From: support
Date: Tue, 21 Feb 2023 17:15:13 +0000 (+0000)
Subject: Built motion from commit 53172ac8.|2.6.30
X-Git-Url: http://repos.xcallymotion.com/base//%22https:/wiki.xcallymotion.com/display/XMV/%C3%90%C2%9D%C3%90%C2%BE%C3%90%C2%B2%C3%91%C2%8B%C3%90%C2%B5?a=commitdiff_plain;h=20ea4bb33c0909cc3a955887906a2e373a83fce1;p=motion2.git
Built motion from commit 53172ac8.|2.6.30
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index f8bc186..a1a545f 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2023-02-21T10:09:44.092Z",
+ "time": "2023-02-21T17:07:06.975Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 362387d..a6c8722 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2023-02-21T10:09:44.092Z",
+ "time": "2023-02-21T17:07:06.975Z",
"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 c08bba1..bb8fc4d 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 _0x2888=['contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','STRING','contactManager','integration','motionbar','jscripty','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'];(function(_0x83a0b2,_0x5a3aee){var _0x3fa21a=function(_0x5c2515){while(--_0x5c2515){_0x83a0b2['push'](_0x83a0b2['shift']());}};_0x3fa21a(++_0x5a3aee);}(_0x2888,0x102));var _0x8288=function(_0x491a09,_0x91cd3c){_0x491a09=_0x491a09-0x0;var _0x27956c=_0x2888[_0x491a09];return _0x27956c;};'use strict';var Sequelize=require(_0x8288('0x0'));module[_0x8288('0x1')]={'name':{'type':Sequelize[_0x8288('0x2')],'get':function(_0x190f2b){return this[_0x8288('0x3')]('action');}},'action':{'type':Sequelize[_0x8288('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x8288('0x5'),_0x8288('0x6'),_0x8288('0x7'),_0x8288('0x8'),'urlForward',_0x8288('0x9'),'bot',_0x8288('0xa')]],'msg':_0x8288('0xb')}},'comment':_0x8288('0xb')},'data1':{'type':Sequelize[_0x8288('0x4')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x8288('0xc')},'data3':{'type':Sequelize[_0x8288('0x4')](0x1000),'comment':_0x8288('0xd')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x8288('0x4')](0x1000),'comments':_0x8288('0xe')},'data6':{'type':Sequelize[_0x8288('0x4')],'comments':_0x8288('0xf')},'data7':{'type':Sequelize[_0x8288('0x10')],'comments':_0x8288('0x11')}};
\ No newline at end of file
+var _0xbaad=['Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','script'];(function(_0x1698dc,_0x36e1c5){var _0x296f21=function(_0x467603){while(--_0x467603){_0x1698dc['push'](_0x1698dc['shift']());}};_0x296f21(++_0x36e1c5);}(_0xbaad,0x1e6));var _0xdbaa=function(_0x1d2cab,_0xafde3){_0x1d2cab=_0x1d2cab-0x0;var _0x4861d2=_0xbaad[_0x1d2cab];return _0x4861d2;};'use strict';var Sequelize=require(_0xdbaa('0x0'));module[_0xdbaa('0x1')]={'name':{'type':Sequelize[_0xdbaa('0x2')],'get':function(_0x36b71c){return this[_0xdbaa('0x3')](_0xdbaa('0x4'));}},'action':{'type':Sequelize[_0xdbaa('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0xdbaa('0x6'),_0xdbaa('0x7'),_0xdbaa('0x8'),_0xdbaa('0x9'),_0xdbaa('0xa'),_0xdbaa('0xb'),_0xdbaa('0xc'),_0xdbaa('0xd')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xdbaa('0xe')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0xdbaa('0xf')},'data2':{'type':Sequelize[_0xdbaa('0x5')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0xdbaa('0x5')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0xdbaa('0x5')](0x1000),'comments':_0xdbaa('0x10')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0xdbaa('0x11')},'data6':{'type':Sequelize[_0xdbaa('0x5')],'comments':_0xdbaa('0x12')},'data7':{'type':Sequelize['TEXT'],'comments':_0xdbaa('0x13')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index d869514..a04b653 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 _0xb98e=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','set','apply','reject','save','then','destroy','error','stack','name','send','update','body','Action','find','params','catch'];(function(_0x14335a,_0x34e57b){var _0x270a3b=function(_0x455913){while(--_0x455913){_0x14335a['push'](_0x14335a['shift']());}};_0x270a3b(++_0x34e57b);}(_0xb98e,0x188));var _0xeb98=function(_0x249e96,_0x3ea39d){_0x249e96=_0x249e96-0x0;var _0x17444c=_0xb98e[_0x249e96];return _0x17444c;};'use strict';var emlformat=require(_0xeb98('0x0'));var rimraf=require(_0xeb98('0x1'));var zipdir=require(_0xeb98('0x2'));var jsonpatch=require(_0xeb98('0x3'));var rp=require(_0xeb98('0x4'));var moment=require(_0xeb98('0x5'));var BPromise=require(_0xeb98('0x6'));var Mustache=require(_0xeb98('0x7'));var util=require(_0xeb98('0x8'));var path=require(_0xeb98('0x9'));var sox=require(_0xeb98('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xeb98('0xb'));var crypto=require(_0xeb98('0xc'));var jsforce=require(_0xeb98('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xeb98('0xe'));var querystring=require('querystring');var Papa=require(_0xeb98('0xf'));var Redis=require(_0xeb98('0x10'));var authService=require(_0xeb98('0x11'));var qs=require(_0xeb98('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xeb98('0x13'));var logger=require(_0xeb98('0x14'))(_0xeb98('0x15'));var utils=require(_0xeb98('0x16'));var config=require(_0xeb98('0x17'));var licenseUtil=require(_0xeb98('0x18'));var db=require(_0xeb98('0x19'))['db'];function respondWithStatusCode(_0x76bddf,_0x2acfc9){_0x2acfc9=_0x2acfc9||0xcc;return function(_0x38593b){if(_0x38593b){return _0x76bddf[_0xeb98('0x1a')](_0x2acfc9);}return _0x76bddf[_0xeb98('0x1b')](_0x2acfc9)[_0xeb98('0x1c')]();};}function respondWithResult(_0x451e01,_0x5462d4){_0x5462d4=_0x5462d4||0xc8;return function(_0x1522b5){if(_0x1522b5){return _0x451e01['status'](_0x5462d4)[_0xeb98('0x1d')](_0x1522b5);}};}function respondWithFilteredResult(_0x2ac353,_0x5c8cc5){return function(_0x4e2bf6){if(_0x4e2bf6){var _0x3dc623=typeof _0x5c8cc5['offset']===_0xeb98('0x1e')&&typeof _0x5c8cc5[_0xeb98('0x1f')]===_0xeb98('0x1e');var _0x13d7c7=_0x4e2bf6[_0xeb98('0x20')];var _0x15442c=_0x3dc623?0x0:_0x5c8cc5['offset'];var _0x2a5e7f=_0x3dc623?_0x4e2bf6['count']:_0x5c8cc5['offset']+_0x5c8cc5['limit'];var _0x3d3ff5;if(_0x2a5e7f>=_0x13d7c7){_0x2a5e7f=_0x13d7c7;_0x3d3ff5=0xc8;}else{_0x3d3ff5=0xce;}_0x2ac353[_0xeb98('0x1b')](_0x3d3ff5);return _0x2ac353[_0xeb98('0x21')]('Content-Range',_0x15442c+'-'+_0x2a5e7f+'/'+_0x13d7c7)[_0xeb98('0x1d')](_0x4e2bf6);}return null;};}function patchUpdates(_0x31335d){return function(_0x30c233){try{jsonpatch[_0xeb98('0x22')](_0x30c233,_0x31335d,!![]);}catch(_0x231870){return BPromise[_0xeb98('0x23')](_0x231870);}return _0x30c233[_0xeb98('0x24')]();};}function saveUpdates(_0x1edba5,_0x3343f5){return function(_0x2415ca){if(_0x2415ca){return _0x2415ca['update'](_0x1edba5)[_0xeb98('0x25')](function(_0xc94a45){return _0xc94a45;});}return null;};}function removeEntity(_0x5a2532,_0x4c713e){return function(_0x1f9ace){if(_0x1f9ace){return _0x1f9ace[_0xeb98('0x26')]()[_0xeb98('0x25')](function(){_0x5a2532[_0xeb98('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30b70a,_0x4f0699){return function(_0x567330){if(!_0x567330){_0x30b70a[_0xeb98('0x1a')](0x194);}return _0x567330;};}function handleError(_0x1c77b1,_0x568c2d){_0x568c2d=_0x568c2d||0x1f4;return function(_0x4647b7){logger[_0xeb98('0x27')](_0x4647b7[_0xeb98('0x28')]);if(_0x4647b7[_0xeb98('0x29')]){delete _0x4647b7[_0xeb98('0x29')];}_0x1c77b1[_0xeb98('0x1b')](_0x568c2d)[_0xeb98('0x2a')](_0x4647b7);};}exports[_0xeb98('0x2b')]=function(_0x1cd94e,_0x35a86d){if(_0x1cd94e['body']['id']){delete _0x1cd94e[_0xeb98('0x2c')]['id'];}return db[_0xeb98('0x2d')][_0xeb98('0x2e')]({'where':{'id':_0x1cd94e[_0xeb98('0x2f')]['id']}})[_0xeb98('0x25')](handleEntityNotFound(_0x35a86d,null))['then'](saveUpdates(_0x1cd94e[_0xeb98('0x2c')],null))[_0xeb98('0x25')](respondWithResult(_0x35a86d,null))[_0xeb98('0x30')](handleError(_0x35a86d,null));};exports[_0xeb98('0x26')]=function(_0x5b327b,_0x133b49){return db['Action'][_0xeb98('0x2e')]({'where':{'id':_0x5b327b[_0xeb98('0x2f')]['id']}})[_0xeb98('0x25')](handleEntityNotFound(_0x133b49,null))[_0xeb98('0x25')](removeEntity(_0x133b49,null))[_0xeb98('0x30')](handleError(_0x133b49,null));};
\ No newline at end of file
+var _0xb722=['count','offset','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','body','find','params','Action','catch','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit'];(function(_0x2ce4ad,_0x1375c5){var _0xba860f=function(_0x17c1ab){while(--_0x17c1ab){_0x2ce4ad['push'](_0x2ce4ad['shift']());}};_0xba860f(++_0x1375c5);}(_0xb722,0x1a1));var _0x2b72=function(_0x4bc54d,_0x118086){_0x4bc54d=_0x4bc54d-0x0;var _0x5cb698=_0xb722[_0x4bc54d];return _0x5cb698;};'use strict';var emlformat=require(_0x2b72('0x0'));var rimraf=require(_0x2b72('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2b72('0x2'));var rp=require(_0x2b72('0x3'));var moment=require(_0x2b72('0x4'));var BPromise=require(_0x2b72('0x5'));var Mustache=require(_0x2b72('0x6'));var util=require(_0x2b72('0x7'));var path=require(_0x2b72('0x8'));var sox=require(_0x2b72('0x9'));var csv=require('to-csv');var ejs=require(_0x2b72('0xa'));var fs=require('fs');var fs_extra=require(_0x2b72('0xb'));var _=require('lodash');var squel=require(_0x2b72('0xc'));var crypto=require(_0x2b72('0xd'));var jsforce=require(_0x2b72('0xe'));var deskjs=require(_0x2b72('0xf'));var toCsv=require(_0x2b72('0x10'));var querystring=require(_0x2b72('0x11'));var Papa=require(_0x2b72('0x12'));var Redis=require(_0x2b72('0x13'));var authService=require(_0x2b72('0x14'));var qs=require(_0x2b72('0x15'));var as=require(_0x2b72('0x16'));var hardwareService=require(_0x2b72('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0x2b72('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x2b72('0x19'));var db=require(_0x2b72('0x1a'))['db'];function respondWithStatusCode(_0x41a607,_0x5d8ec4){_0x5d8ec4=_0x5d8ec4||0xcc;return function(_0x3baeda){if(_0x3baeda){return _0x41a607[_0x2b72('0x1b')](_0x5d8ec4);}return _0x41a607[_0x2b72('0x1c')](_0x5d8ec4)[_0x2b72('0x1d')]();};}function respondWithResult(_0xc3122b,_0x38f61c){_0x38f61c=_0x38f61c||0xc8;return function(_0x582e29){if(_0x582e29){return _0xc3122b[_0x2b72('0x1c')](_0x38f61c)[_0x2b72('0x1e')](_0x582e29);}};}function respondWithFilteredResult(_0x2eb91c,_0x5bdaf6){return function(_0xb4afb){if(_0xb4afb){var _0x7737=typeof _0x5bdaf6['offset']===_0x2b72('0x1f')&&typeof _0x5bdaf6[_0x2b72('0x20')]==='undefined';var _0x32ac10=_0xb4afb[_0x2b72('0x21')];var _0x16005b=_0x7737?0x0:_0x5bdaf6[_0x2b72('0x22')];var _0x55c228=_0x7737?_0xb4afb[_0x2b72('0x21')]:_0x5bdaf6[_0x2b72('0x22')]+_0x5bdaf6[_0x2b72('0x20')];var _0x456a11;if(_0x55c228>=_0x32ac10){_0x55c228=_0x32ac10;_0x456a11=0xc8;}else{_0x456a11=0xce;}_0x2eb91c[_0x2b72('0x1c')](_0x456a11);return _0x2eb91c['set'](_0x2b72('0x23'),_0x16005b+'-'+_0x55c228+'/'+_0x32ac10)[_0x2b72('0x1e')](_0xb4afb);}return null;};}function patchUpdates(_0x601939){return function(_0x497331){try{jsonpatch[_0x2b72('0x24')](_0x497331,_0x601939,!![]);}catch(_0x5aef45){return BPromise[_0x2b72('0x25')](_0x5aef45);}return _0x497331['save']();};}function saveUpdates(_0x2355c0,_0x1920e4){return function(_0x2594ff){if(_0x2594ff){return _0x2594ff[_0x2b72('0x26')](_0x2355c0)['then'](function(_0x4a7e55){return _0x4a7e55;});}return null;};}function removeEntity(_0x47feb9,_0x45b6b2){return function(_0x3b8d7b){if(_0x3b8d7b){return _0x3b8d7b[_0x2b72('0x27')]()[_0x2b72('0x28')](function(){_0x47feb9[_0x2b72('0x1c')](0xcc)[_0x2b72('0x1d')]();});}};}function handleEntityNotFound(_0x118797,_0x2f8b6d){return function(_0x5bc0ec){if(!_0x5bc0ec){_0x118797[_0x2b72('0x1b')](0x194);}return _0x5bc0ec;};}function handleError(_0x3de6fb,_0x4e75f2){_0x4e75f2=_0x4e75f2||0x1f4;return function(_0x35feb5){logger[_0x2b72('0x29')](_0x35feb5[_0x2b72('0x2a')]);if(_0x35feb5['name']){delete _0x35feb5[_0x2b72('0x2b')];}_0x3de6fb['status'](_0x4e75f2)[_0x2b72('0x2c')](_0x35feb5);};}exports['update']=function(_0x14d697,_0x9e8d3c){if(_0x14d697[_0x2b72('0x2d')]['id']){delete _0x14d697[_0x2b72('0x2d')]['id'];}return db['Action'][_0x2b72('0x2e')]({'where':{'id':_0x14d697[_0x2b72('0x2f')]['id']}})[_0x2b72('0x28')](handleEntityNotFound(_0x9e8d3c,null))[_0x2b72('0x28')](saveUpdates(_0x14d697['body'],null))[_0x2b72('0x28')](respondWithResult(_0x9e8d3c,null))['catch'](handleError(_0x9e8d3c,null));};exports[_0x2b72('0x27')]=function(_0x266693,_0x3496d6){return db[_0x2b72('0x30')][_0x2b72('0x2e')]({'where':{'id':_0x266693[_0x2b72('0x2f')]['id']}})['then'](handleEntityNotFound(_0x3496d6,null))[_0x2b72('0x28')](removeEntity(_0x3496d6,null))[_0x2b72('0x31')](handleError(_0x3496d6,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index b55251d..e44ec80 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 _0x73a1=['tools_actions','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Action'];(function(_0x18f6da,_0x10be70){var _0x35c6e4=function(_0x52da51){while(--_0x52da51){_0x18f6da['push'](_0x18f6da['shift']());}};_0x35c6e4(++_0x10be70);}(_0x73a1,0x161));var _0x173a=function(_0x503950,_0x5022eb){_0x503950=_0x503950-0x0;var _0x1657a9=_0x73a1[_0x503950];return _0x1657a9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x173a('0x0'))(_0x173a('0x1'));var moment=require('moment');var BPromise=require(_0x173a('0x2'));var rp=require(_0x173a('0x3'));var fs=require('fs');var path=require(_0x173a('0x4'));var rimraf=require(_0x173a('0x5'));var config=require(_0x173a('0x6'));var attributes=require('./action.attributes');module[_0x173a('0x7')]=function(_0x1a8b94,_0xac84a){return _0x1a8b94[_0x173a('0x8')](_0x173a('0x9'),attributes,{'tableName':_0x173a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x43d4=['api','moment','rimraf','../../config/environment','./action.attributes','exports','define','Action','lodash','util','../../config/logger'];(function(_0xccb939,_0x2ba302){var _0x42027d=function(_0x1e27cd){while(--_0x1e27cd){_0xccb939['push'](_0xccb939['shift']());}};_0x42027d(++_0x2ba302);}(_0x43d4,0x173));var _0x443d=function(_0x32fe12,_0x32f64d){_0x32fe12=_0x32fe12-0x0;var _0x5346d4=_0x43d4[_0x32fe12];return _0x5346d4;};'use strict';var _=require(_0x443d('0x0'));var util=require(_0x443d('0x1'));var logger=require(_0x443d('0x2'))(_0x443d('0x3'));var moment=require(_0x443d('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x443d('0x5'));var config=require(_0x443d('0x6'));var attributes=require(_0x443d('0x7'));module[_0x443d('0x8')]=function(_0x4b3123,_0x5df9e0){return _0x4b3123[_0x443d('0x9')](_0x443d('0xa'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index 1471665..198ed46 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 _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','Action,\x20%s,\x20%s','Action,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x5086bd,_0x58e31f){var _0x56479b=function(_0xec1be1){while(--_0xec1be1){_0x5086bd['push'](_0x5086bd['shift']());}};_0x56479b(++_0x58e31f);}(_0xe14b,0x93));var _0xbe14=function(_0x547510,_0x30e1c5){_0x547510=_0x547510-0x0;var _0x273c31=_0xe14b[_0x547510];return _0x273c31;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});}
\ No newline at end of file
+var _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x51b1f2,_0x5b6a93){var _0x1fa5fa=function(_0x3a7ffe){while(--_0x3a7ffe){_0x51b1f2['push'](_0x51b1f2['shift']());}};_0x1fa5fa(++_0x5b6a93);}(_0xabce,0x103));var _0xeabc=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xabce[_0x12d033];return _0x3b4e80;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Action,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 133f321..7e37fe3 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 _0x37c0=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','/:id','update','destroy','exports','multer','util'];(function(_0x909557,_0x3a0599){var _0x867eaf=function(_0x2ddc9f){while(--_0x2ddc9f){_0x909557['push'](_0x909557['shift']());}};_0x867eaf(++_0x3a0599);}(_0x37c0,0x15c));var _0x037c=function(_0x5c5b17,_0x3c4947){_0x5c5b17=_0x5c5b17-0x0;var _0x1c6282=_0x37c0[_0x5c5b17];return _0x1c6282;};'use strict';var multer=require(_0x037c('0x0'));var util=require(_0x037c('0x1'));var path=require(_0x037c('0x2'));var timeout=require('connect-timeout');var express=require(_0x037c('0x3'));var router=express[_0x037c('0x4')]();var fs_extra=require(_0x037c('0x5'));var auth=require(_0x037c('0x6'));var interaction=require(_0x037c('0x7'));var config=require(_0x037c('0x8'));var controller=require(_0x037c('0x9'));router['put'](_0x037c('0xa'),auth['isAuthenticated'](),controller[_0x037c('0xb')]);router['delete'](_0x037c('0xa'),auth['isAuthenticated'](),controller[_0x037c('0xc')]);module[_0x037c('0xd')]=router;
\ No newline at end of file
+var _0xea6e=['isAuthenticated','update','delete','/:id','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','put'];(function(_0x110596,_0x1faae7){var _0x51fef2=function(_0x443662){while(--_0x443662){_0x110596['push'](_0x110596['shift']());}};_0x51fef2(++_0x1faae7);}(_0xea6e,0x1a9));var _0xeea6=function(_0x2dc343,_0xf015a2){_0x2dc343=_0x2dc343-0x0;var _0x51eac5=_0xea6e[_0x2dc343];return _0x51eac5;};'use strict';var multer=require(_0xeea6('0x0'));var util=require(_0xeea6('0x1'));var path=require(_0xeea6('0x2'));var timeout=require(_0xeea6('0x3'));var express=require('express');var router=express[_0xeea6('0x4')]();var fs_extra=require(_0xeea6('0x5'));var auth=require(_0xeea6('0x6'));var interaction=require(_0xeea6('0x7'));var config=require(_0xeea6('0x8'));var controller=require('./action.controller');router[_0xeea6('0x9')]('/:id',auth[_0xeea6('0xa')](),controller[_0xeea6('0xb')]);router[_0xeea6('0xc')](_0xeea6('0xd'),auth[_0xeea6('0xa')](),controller['destroy']);module[_0xeea6('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 db2805f..c9035a8 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 _0x46ed=['sequelize','exports','STRING','TEXT'];(function(_0x3df223,_0x1740fc){var _0x562d11=function(_0x343009){while(--_0x343009){_0x3df223['push'](_0x3df223['shift']());}};_0x562d11(++_0x1740fc);}(_0x46ed,0x168));var _0xd46e=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x46ed[_0x178e48];return _0x440d7e;};'use strict';var Sequelize=require(_0xd46e('0x0'));module[_0xd46e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xd46e('0x2')]},'parent':{'type':Sequelize[_0xd46e('0x2')]},'table':{'type':Sequelize[_0xd46e('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xd46e('0x3')]}};
\ No newline at end of file
+var _0xeda8=['sequelize','exports','STRING','TEXT'];(function(_0x4da444,_0x3f6072){var _0x37040f=function(_0x33b62d){while(--_0x33b62d){_0x4da444['push'](_0x4da444['shift']());}};_0x37040f(++_0x3f6072);}(_0xeda8,0x104));var _0x8eda=function(_0x46ce2e,_0x19e9f2){_0x46ce2e=_0x46ce2e-0x0;var _0x400554=_0xeda8[_0x46ce2e];return _0x400554;};'use strict';var Sequelize=require(_0x8eda('0x0'));module[_0x8eda('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8eda('0x2')]},'parent':{'type':Sequelize[_0x8eda('0x2')]},'table':{'type':Sequelize[_0x8eda('0x2')]},'conditions':{'type':Sequelize[_0x8eda('0x3')]},'joins':{'type':Sequelize[_0x8eda('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 206e2c9..bfece3b 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 _0xd90c=['role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','preview','join','left_join','right_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','table','MetricId','metric','replace','function','format','groupBy','order','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','toString','sequelize','QueryTypes','SELECT','cross_join','SUM(%s)','value','ValidationErrorItem','from','%s.%s\x20=\x20%s.%s','web','%s-%s.%s','generate','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','fork','../../components/export/','output','savename','select','countTable','COUNT(*)','ROUND(%s)','debug','Limited\x20Query:','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','save','update','destroy','get','CustomReports','then','end','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','AnalyticCustomReport','includeAll','findAll','catch','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x3b6248,_0x369c42){var _0x46c3e1=function(_0x4e6e13){while(--_0x4e6e13){_0x3b6248['push'](_0x3b6248['shift']());}};_0x46c3e1(++_0x369c42);}(_0xd90c,0x194));var _0xcd90=function(_0x5d8f,_0x14d9d3){_0x5d8f=_0x5d8f-0x0;var _0x252a50=_0xd90c[_0x5d8f];return _0x252a50;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcd90('0x0'));var zipdir=require(_0xcd90('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcd90('0x2'));var moment=require(_0xcd90('0x3'));var BPromise=require(_0xcd90('0x4'));var Mustache=require(_0xcd90('0x5'));var util=require(_0xcd90('0x6'));var path=require('path');var sox=require(_0xcd90('0x7'));var csv=require(_0xcd90('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcd90('0x9'));var _=require('lodash');var squel=require(_0xcd90('0xa'));var crypto=require(_0xcd90('0xb'));var jsforce=require(_0xcd90('0xc'));var deskjs=require(_0xcd90('0xd'));var toCsv=require(_0xcd90('0x8'));var querystring=require(_0xcd90('0xe'));var Papa=require(_0xcd90('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xcd90('0x10'));var hardwareService=require(_0xcd90('0x11'));var logger=require(_0xcd90('0x12'))(_0xcd90('0x13'));var utils=require(_0xcd90('0x14'));var config=require(_0xcd90('0x15'));var licenseUtil=require(_0xcd90('0x16'));var db=require(_0xcd90('0x17'))['db'];var dbH=require(_0xcd90('0x17'))['dbH'];function respondWithStatusCode(_0x588994,_0x566602){_0x566602=_0x566602||0xcc;return function(_0x168eab){if(_0x168eab){return _0x588994['sendStatus'](_0x566602);}return _0x588994['status'](_0x566602)['end']();};}function respondWithResult(_0x56b5de,_0x528ded){_0x528ded=_0x528ded||0xc8;return function(_0x3e447e){if(_0x3e447e){return _0x56b5de[_0xcd90('0x18')](_0x528ded)[_0xcd90('0x19')](_0x3e447e);}};}function respondWithFilteredResult(_0x5d696e,_0x3d8568){return function(_0x485fa8){if(_0x485fa8){var _0x404b4b=typeof _0x3d8568[_0xcd90('0x1a')]===_0xcd90('0x1b')&&typeof _0x3d8568[_0xcd90('0x1c')]==='undefined';var _0x2c3195=_0x485fa8[_0xcd90('0x1d')];var _0x1212dc=_0x404b4b?0x0:_0x3d8568[_0xcd90('0x1a')];var _0x3d9b55=_0x404b4b?_0x485fa8['count']:_0x3d8568[_0xcd90('0x1a')]+_0x3d8568['limit'];var _0x1640a0;if(_0x3d9b55>=_0x2c3195){_0x3d9b55=_0x2c3195;_0x1640a0=0xc8;}else{_0x1640a0=0xce;}_0x5d696e[_0xcd90('0x18')](_0x1640a0);return _0x5d696e['set']('Content-Range',_0x1212dc+'-'+_0x3d9b55+'/'+_0x2c3195)[_0xcd90('0x19')](_0x485fa8);}return null;};}function patchUpdates(_0x2ac571){return function(_0x2456b4){try{jsonpatch['apply'](_0x2456b4,_0x2ac571,!![]);}catch(_0x41e254){return BPromise[_0xcd90('0x1e')](_0x41e254);}return _0x2456b4[_0xcd90('0x1f')]();};}function saveUpdates(_0xf1e087,_0x336846){return function(_0x17d935){if(_0x17d935){return _0x17d935[_0xcd90('0x20')](_0xf1e087)['then'](function(_0x44db84){return _0x44db84;});}return null;};}function removeEntity(_0x2a438b,_0x5ed642){return function(_0x5dae8e){if(_0x5dae8e){return _0x5dae8e[_0xcd90('0x21')]()['then'](function(){var _0xa410a3=_0x5dae8e[_0xcd90('0x22')]({'plain':!![]});var _0x52666f=_0xcd90('0x23');return db['UserProfileResource']['destroy']({'where':{'type':_0x52666f,'resourceId':_0xa410a3['id']}})[_0xcd90('0x24')](function(){return _0x5dae8e;});})[_0xcd90('0x24')](function(){_0x2a438b[_0xcd90('0x18')](0xcc)[_0xcd90('0x25')]();});}};}function handleEntityNotFound(_0x1d45e9,_0x1d271b){return function(_0x4f8c40){if(!_0x4f8c40){_0x1d45e9[_0xcd90('0x26')](0x194);}return _0x4f8c40;};}function handleError(_0x49e401,_0x9133bf){_0x9133bf=_0x9133bf||0x1f4;return function(_0x18d58a){logger[_0xcd90('0x27')](_0x18d58a[_0xcd90('0x28')]);if(_0x18d58a[_0xcd90('0x29')]){delete _0x18d58a['name'];}_0x49e401[_0xcd90('0x18')](_0x9133bf)[_0xcd90('0x2a')](_0x18d58a);};}exports[_0xcd90('0x2b')]=function(_0x1b9d82,_0x2d312c){var _0x507cfa={},_0x4052e7={},_0x16bbab={'count':0x0,'rows':[]};var _0x4049b6=_[_0xcd90('0x2c')](db['AnalyticCustomReport'][_0xcd90('0x2d')],function(_0x10004d){return{'name':_0x10004d['fieldName'],'type':_0x10004d[_0xcd90('0x2e')][_0xcd90('0x2f')]};});_0x4052e7[_0xcd90('0x30')]=_['map'](_0x4049b6,_0xcd90('0x29'));_0x4052e7[_0xcd90('0x31')]=_[_0xcd90('0x32')](_0x1b9d82['query']);_0x4052e7[_0xcd90('0x33')]=_[_0xcd90('0x34')](_0x4052e7[_0xcd90('0x30')],_0x4052e7['query']);_0x507cfa[_0xcd90('0x35')]=_['intersection'](_0x4052e7['model'],qs[_0xcd90('0x36')](_0x1b9d82[_0xcd90('0x31')][_0xcd90('0x36')]));_0x507cfa['attributes']=_0x507cfa[_0xcd90('0x35')][_0xcd90('0x37')]?_0x507cfa[_0xcd90('0x35')]:_0x4052e7[_0xcd90('0x30')];if(!_0x1b9d82['query'][_0xcd90('0x38')](_0xcd90('0x39'))){_0x507cfa[_0xcd90('0x1c')]=qs[_0xcd90('0x1c')](_0x1b9d82['query'][_0xcd90('0x1c')]);_0x507cfa[_0xcd90('0x1a')]=qs[_0xcd90('0x1a')](_0x1b9d82[_0xcd90('0x31')][_0xcd90('0x1a')]);}_0x507cfa['order']=qs['sort'](_0x1b9d82['query'][_0xcd90('0x3a')]);_0x507cfa['where']=qs[_0xcd90('0x33')](_[_0xcd90('0x3b')](_0x1b9d82[_0xcd90('0x31')],_0x4052e7[_0xcd90('0x33')]),_0x4049b6);if(_0x1b9d82['query'][_0xcd90('0x3c')]){_0x507cfa[_0xcd90('0x3d')]=_['merge'](_0x507cfa[_0xcd90('0x3d')],{'$or':_[_0xcd90('0x2c')](_0x4049b6,function(_0x72ab36){if(_0x72ab36[_0xcd90('0x2e')]!==_0xcd90('0x3e')){var _0x5a8052={};_0x5a8052[_0x72ab36['name']]={'$like':'%'+_0x1b9d82[_0xcd90('0x31')][_0xcd90('0x3c')]+'%'};return _0x5a8052;}})});}_0x507cfa=_[_0xcd90('0x3f')]({},_0x507cfa,_0x1b9d82[_0xcd90('0x40')]);var _0x49bf30={'where':_0x507cfa[_0xcd90('0x3d')]};return db[_0xcd90('0x41')]['count'](_0x49bf30)[_0xcd90('0x24')](function(_0x33e97a){_0x16bbab[_0xcd90('0x1d')]=_0x33e97a;if(_0x1b9d82[_0xcd90('0x31')][_0xcd90('0x42')]){_0x507cfa['include']=[{'all':!![]}];}return db[_0xcd90('0x41')][_0xcd90('0x43')](_0x507cfa);})[_0xcd90('0x24')](function(_0x3b5139){_0x16bbab['rows']=_0x3b5139;return _0x16bbab;})[_0xcd90('0x24')](respondWithFilteredResult(_0x2d312c,_0x507cfa))[_0xcd90('0x44')](handleError(_0x2d312c,null));};exports['show']=function(_0x2a3f16,_0x3a0e42){var _0x3023d5={'raw':![],'where':{'id':_0x2a3f16[_0xcd90('0x45')]['id']}},_0x5f191b={};_0x5f191b[_0xcd90('0x30')]=_[_0xcd90('0x32')](db[_0xcd90('0x41')][_0xcd90('0x2d')]);_0x5f191b[_0xcd90('0x31')]=_[_0xcd90('0x32')](_0x2a3f16[_0xcd90('0x31')]);_0x5f191b[_0xcd90('0x33')]=_[_0xcd90('0x34')](_0x5f191b[_0xcd90('0x30')],_0x5f191b['query']);_0x3023d5[_0xcd90('0x35')]=_[_0xcd90('0x34')](_0x5f191b[_0xcd90('0x30')],qs[_0xcd90('0x36')](_0x2a3f16['query'][_0xcd90('0x36')]));_0x3023d5[_0xcd90('0x35')]=_0x3023d5['attributes'][_0xcd90('0x37')]?_0x3023d5[_0xcd90('0x35')]:_0x5f191b[_0xcd90('0x30')];if(_0x2a3f16['query']['includeAll']){_0x3023d5['include']=[{'all':!![]}];}_0x3023d5=_[_0xcd90('0x3f')]({},_0x3023d5,_0x2a3f16[_0xcd90('0x40')]);return db[_0xcd90('0x41')]['find'](_0x3023d5)['then'](handleEntityNotFound(_0x3a0e42,null))[_0xcd90('0x24')](respondWithResult(_0x3a0e42,null))['catch'](handleError(_0x3a0e42,null));};exports[_0xcd90('0x46')]=function(_0xbd66d6,_0x50cc61){return db[_0xcd90('0x41')]['create'](_0xbd66d6['body'],{})[_0xcd90('0x24')](function(_0x518066){var _0x27b5b4=_0xbd66d6[_0xcd90('0x47')][_0xcd90('0x22')]({'plain':!![]});if(!_0x27b5b4)throw new Error(_0xcd90('0x48'));if(_0x27b5b4[_0xcd90('0x49')]===_0xcd90('0x47')){var _0xd3690a=_0x518066[_0xcd90('0x22')]({'plain':!![]});var _0x1720b5='Reports';return db[_0xcd90('0x4a')]['find']({'where':{'name':_0x1720b5,'userProfileId':_0x27b5b4[_0xcd90('0x4b')]},'raw':!![]})[_0xcd90('0x24')](function(_0x32b476){if(_0x32b476&&_0x32b476[_0xcd90('0x4c')]===0x0){return db[_0xcd90('0x4d')]['create']({'name':_0xd3690a['name'],'resourceId':_0xd3690a['id'],'type':'CustomReports','sectionId':_0x32b476['id']},{})[_0xcd90('0x24')](function(){return _0x518066;});}else{return _0x518066;}})[_0xcd90('0x44')](function(_0x2f0cd6){logger[_0xcd90('0x27')](_0xcd90('0x4e'),_0x2f0cd6);throw _0x2f0cd6;});}return _0x518066;})[_0xcd90('0x24')](respondWithResult(_0x50cc61,0xc9))[_0xcd90('0x44')](handleError(_0x50cc61,null));};exports[_0xcd90('0x20')]=function(_0x3ee117,_0x43f255){if(_0x3ee117[_0xcd90('0x4f')]['id']){delete _0x3ee117['body']['id'];}return db[_0xcd90('0x41')][_0xcd90('0x50')]({'where':{'id':_0x3ee117[_0xcd90('0x45')]['id']}})['then'](handleEntityNotFound(_0x43f255,null))[_0xcd90('0x24')](saveUpdates(_0x3ee117[_0xcd90('0x4f')],null))[_0xcd90('0x24')](respondWithResult(_0x43f255,null))[_0xcd90('0x44')](handleError(_0x43f255,null));};exports[_0xcd90('0x21')]=function(_0x44a9b2,_0x3eef6f){return db[_0xcd90('0x41')]['find']({'where':{'id':_0x44a9b2[_0xcd90('0x45')]['id']}})[_0xcd90('0x24')](handleEntityNotFound(_0x3eef6f,null))['then'](removeEntity(_0x3eef6f,null))[_0xcd90('0x44')](handleError(_0x3eef6f,null));};exports[_0xcd90('0x51')]=function(_0x34cfd4,_0x459ac7){var _0x204a96=0xa;var _0x167883=[_0xcd90('0x52'),_0xcd90('0x53'),_0xcd90('0x54'),'cross_join'];var _0x3f47b3={'SUM':'SUM(%s)','COUNT':_0xcd90('0x55'),'COUNT DISTINCT':_0xcd90('0x56'),'MAX':_0xcd90('0x57'),'MIN':_0xcd90('0x58'),'AVG':_0xcd90('0x59'),'GROUP_CONCAT':_0xcd90('0x5a'),'GROUP_CONCAT ASC':_0xcd90('0x5b'),'GROUP_CONCAT DESC':_0xcd90('0x5c')};var _0x19d0ab={'SEC_TO_TIME':_0xcd90('0x5d'),'DATE':_0xcd90('0x5e'),'HOUR':_0xcd90('0x5f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xcd90('0x60')};var _0x489422=function(_0x14db94){return!_[_0xcd90('0x61')]([_0xcd90('0x62'),_0xcd90('0x63'),'IS\x20EMPTY',_0xcd90('0x64')],_0x14db94);};var _0x1d9873=function(_0xc337fd){if(!_0xc337fd||!_0xc337fd[_0xcd90('0x65')]['length']){return'';}for(var _0x58b875='(',_0x4e0b8f=0x0;_0x4e0b8f<_0xc337fd[_0xcd90('0x65')][_0xcd90('0x37')];_0x4e0b8f+=0x1){_0x4e0b8f>0x0&&(_0x58b875+='\x20'+_0xc337fd[_0xcd90('0x66')]+'\x20');_0x58b875+=_0xc337fd[_0xcd90('0x65')][_0x4e0b8f]['group']?_0x1d9873(_0xc337fd[_0xcd90('0x65')][_0x4e0b8f][_0xcd90('0x67')]):_0xc337fd['rules'][_0x4e0b8f][_0xcd90('0x68')]+'\x20'+_0xc337fd[_0xcd90('0x65')][_0x4e0b8f][_0xcd90('0x69')]+(_0x489422(_0xc337fd[_0xcd90('0x65')][_0x4e0b8f][_0xcd90('0x69')])?'\x20'+_0xc337fd[_0xcd90('0x65')][_0x4e0b8f]['value']:'');}return _0x58b875+')';};var _0x3ef861={'where':{'id':_0x34cfd4['params']['id']}},_0x47b510,_0x28d770,_0x3197b3,_0x14a59e,_0x14c0d2;_0x3ef861=_[_0xcd90('0x3f')]({},_0x3ef861,_0x34cfd4['options']);return db[_0xcd90('0x41')][_0xcd90('0x50')](_0x3ef861)[_0xcd90('0x24')](function(_0x228c62){if(_0x228c62){_0x47b510=_0x228c62;return _0x228c62[_0xcd90('0x6a')]();}return null;})[_0xcd90('0x24')](function(_0x283b4b){if(_0x283b4b){if(!_0x283b4b['length']){throw new db[(_0xcd90('0x6b'))]['ValidationErrorItem'](_0xcd90('0x6c'),0x193);}_0x28d770=_0x283b4b;return db[_0xcd90('0x6d')]['findAll']({'raw':!![]});}return null;})[_0xcd90('0x24')](function(_0x1da753){if(_0x1da753){_0x3197b3=_[_0xcd90('0x6e')](_0x1da753,'id');var _0x31ee53;var _0x31de09=squel['select']();_0x31de09['from'](_0x47b510[_0xcd90('0x6f')]);for(var _0x5abf07=0x0;_0x5abf07<_0x28d770['length'];_0x5abf07+=0x1){_0x31ee53=_0x28d770[_0x5abf07][_0xcd90('0x70')]?_0x3197b3[_0x28d770[_0x5abf07]['MetricId']][_0xcd90('0x71')]:_0x28d770[_0x5abf07][_0xcd90('0x68')];_0x31ee53=_0x28d770[_0x5abf07]['function']?_[_0xcd90('0x72')](_0x3f47b3[_0x28d770[_0x5abf07][_0xcd90('0x73')]],'%s',_0x31ee53):_0x31ee53;_0x31ee53=_0x28d770[_0x5abf07][_0xcd90('0x74')]?_['replace'](_0x19d0ab[_0x28d770[_0x5abf07]['format']],'%s',_0x31ee53):_0x31ee53;if(_0x28d770[_0x5abf07][_0xcd90('0x75')]){_0x31de09[_0xcd90('0x67')](_0x31ee53);}_0x28d770[_0x5abf07]['orderBy']&&_0x31de09[_0xcd90('0x76')](_0x31ee53,_0x28d770[_0x5abf07][_0xcd90('0x77')]===_0xcd90('0x78')?![]:!![]);_0x31de09['field'](_0x31ee53,_0x28d770[_0x5abf07][_0xcd90('0x79')]||_0x31ee53);}if(_0x47b510[_0xcd90('0x7a')]){_0x47b510[_0xcd90('0x7a')]=JSON[_0xcd90('0x7b')](_0x47b510[_0xcd90('0x7a')]);for(var _0x27a4dc=0x0;_0x27a4dc<_0x47b510[_0xcd90('0x7a')][_0xcd90('0x37')];_0x27a4dc+=0x1){if(_0x47b510[_0xcd90('0x7a')][_0x27a4dc][_0xcd90('0x2e')]&&_[_0xcd90('0x61')](_0x167883,_0x47b510[_0xcd90('0x7a')][_0x27a4dc][_0xcd90('0x2e')])&&_0x47b510[_0xcd90('0x7a')][_0x27a4dc][_0xcd90('0x7c')]&&_0x47b510[_0xcd90('0x7a')][_0x27a4dc][_0xcd90('0x7d')]&&_0x47b510[_0xcd90('0x7a')][_0x27a4dc][_0xcd90('0x7e')]){_0x31de09[_0x47b510[_0xcd90('0x7a')][_0x27a4dc][_0xcd90('0x2e')]](_0x47b510['joins'][_0x27a4dc][_0xcd90('0x7d')],null,util[_0xcd90('0x74')]('%s.%s\x20=\x20%s.%s',_0x47b510[_0xcd90('0x6f')],_0x47b510['joins'][_0x27a4dc][_0xcd90('0x7c')],_0x47b510[_0xcd90('0x7a')][_0x27a4dc][_0xcd90('0x7d')],_0x47b510['joins'][_0x27a4dc][_0xcd90('0x7e')]));}}}if(_0x47b510['conditions']){_0x47b510[_0xcd90('0x7f')]=JSON[_0xcd90('0x7b')](_0x47b510[_0xcd90('0x7f')]);_0x31de09[_0xcd90('0x3d')](_0x1d9873(_0x47b510[_0xcd90('0x7f')]['group']));}_0x14c0d2=_0x31de09[_0xcd90('0x80')]();_0x31de09[_0xcd90('0x1c')](_0x204a96);_0x31de09['offset'](0x0);logger['debug']('Limited\x20Query:',_0x31de09[_0xcd90('0x81')]());return dbH[_0xcd90('0x82')][_0xcd90('0x31')](_0x31de09[_0xcd90('0x81')](),{'type':dbH[_0xcd90('0x82')][_0xcd90('0x83')][_0xcd90('0x84')]});}})[_0xcd90('0x24')](respondWithResult(_0x459ac7,null))[_0xcd90('0x44')](handleError(_0x459ac7,null));};function runReport(_0x100d41,_0x18edbd,_0x73ee9d){var _0x1f464f=_0x18edbd[_0xcd90('0x29')];var _0x351b21=0xa;var _0x23b5ab=[_0xcd90('0x52'),_0xcd90('0x53'),'right_join',_0xcd90('0x85')];var _0x1c370e={'SUM':_0xcd90('0x86'),'COUNT':_0xcd90('0x55'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xcd90('0x57'),'MIN':_0xcd90('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xcd90('0x5b'),'GROUP_CONCAT DESC':_0xcd90('0x5c')};var _0x1b647c={'SEC_TO_TIME':_0xcd90('0x5d'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5a0019=function(_0x37b726){return!_['includes']([_0xcd90('0x62'),_0xcd90('0x63'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x37b726);};var _0x3c490e=function(_0x495992){if(!_0x495992||!_0x495992[_0xcd90('0x65')][_0xcd90('0x37')]){return'';}for(var _0x1ced2b='(',_0x2ac844=0x0;_0x2ac844<_0x495992[_0xcd90('0x65')][_0xcd90('0x37')];_0x2ac844+=0x1){_0x2ac844>0x0&&(_0x1ced2b+='\x20'+_0x495992[_0xcd90('0x66')]+'\x20');_0x1ced2b+=_0x495992[_0xcd90('0x65')][_0x2ac844][_0xcd90('0x67')]?_0x3c490e(_0x495992[_0xcd90('0x65')][_0x2ac844][_0xcd90('0x67')]):_0x495992[_0xcd90('0x65')][_0x2ac844]['field']+'\x20'+_0x495992[_0xcd90('0x65')][_0x2ac844]['condition']+(_0x5a0019(_0x495992['rules'][_0x2ac844]['condition'])?'\x20'+_0x495992[_0xcd90('0x65')][_0x2ac844][_0xcd90('0x87')]:'');}return _0x1ced2b+')';};var _0x5a84b1={'where':{'id':_0x100d41['id']}},_0x740246,_0x58d3e2,_0x37c4da,_0x24a5d8,_0x256460;_0x5a84b1=_['merge']({},_0x5a84b1,_0x73ee9d);return db['AnalyticCustomReport']['find'](_0x5a84b1)[_0xcd90('0x24')](function(_0x40dcb6){if(_0x40dcb6){_0x740246=_0x40dcb6;return _0x40dcb6[_0xcd90('0x6a')]();}return null;})['then'](function(_0x4ed024){if(_0x4ed024){if(!_0x4ed024[_0xcd90('0x37')]){throw new db[(_0xcd90('0x6b'))][(_0xcd90('0x88'))](_0xcd90('0x6c'),0x193);}_0x58d3e2=_0x4ed024;return db[_0xcd90('0x6d')]['findAll']({'raw':!![]});}return null;})[_0xcd90('0x24')](function(_0x11795c){if(_0x11795c){_0x37c4da=_[_0xcd90('0x6e')](_0x11795c,'id');var _0x460b08;var _0xb355f3=squel['select']();_0xb355f3[_0xcd90('0x89')](_0x740246[_0xcd90('0x6f')]);for(var _0x1ecb7a=0x0;_0x1ecb7a<_0x58d3e2['length'];_0x1ecb7a+=0x1){_0x460b08=_0x58d3e2[_0x1ecb7a][_0xcd90('0x70')]?_0x37c4da[_0x58d3e2[_0x1ecb7a][_0xcd90('0x70')]][_0xcd90('0x71')]:_0x58d3e2[_0x1ecb7a][_0xcd90('0x68')];_0x460b08=_0x58d3e2[_0x1ecb7a][_0xcd90('0x73')]?_[_0xcd90('0x72')](_0x1c370e[_0x58d3e2[_0x1ecb7a]['function']],'%s',_0x460b08):_0x460b08;_0x460b08=_0x58d3e2[_0x1ecb7a][_0xcd90('0x74')]?_['replace'](_0x1b647c[_0x58d3e2[_0x1ecb7a]['format']],'%s',_0x460b08):_0x460b08;if(_0x58d3e2[_0x1ecb7a][_0xcd90('0x75')]){_0xb355f3[_0xcd90('0x67')](_0x460b08);}_0x58d3e2[_0x1ecb7a][_0xcd90('0x77')]&&_0xb355f3[_0xcd90('0x76')](_0x460b08,_0x58d3e2[_0x1ecb7a]['orderBy']===_0xcd90('0x78')?![]:!![]);_0xb355f3[_0xcd90('0x68')](_0x460b08,_0x58d3e2[_0x1ecb7a][_0xcd90('0x79')]||_0x460b08);}if(_0x740246[_0xcd90('0x7a')]){_0x740246[_0xcd90('0x7a')]=JSON['parse'](_0x740246[_0xcd90('0x7a')]);for(var _0x164dd8=0x0;_0x164dd8<_0x740246[_0xcd90('0x7a')][_0xcd90('0x37')];_0x164dd8+=0x1){if(_0x740246[_0xcd90('0x7a')][_0x164dd8][_0xcd90('0x2e')]&&_[_0xcd90('0x61')](_0x23b5ab,_0x740246['joins'][_0x164dd8][_0xcd90('0x2e')])&&_0x740246[_0xcd90('0x7a')][_0x164dd8][_0xcd90('0x7c')]&&_0x740246[_0xcd90('0x7a')][_0x164dd8]['foreignTable']&&_0x740246[_0xcd90('0x7a')][_0x164dd8][_0xcd90('0x7e')]){_0xb355f3[_0x740246[_0xcd90('0x7a')][_0x164dd8][_0xcd90('0x2e')]](_0x740246[_0xcd90('0x7a')][_0x164dd8][_0xcd90('0x7d')],null,util[_0xcd90('0x74')](_0xcd90('0x8a'),_0x740246[_0xcd90('0x6f')],_0x740246['joins'][_0x164dd8][_0xcd90('0x7c')],_0x740246['joins'][_0x164dd8][_0xcd90('0x7d')],_0x740246[_0xcd90('0x7a')][_0x164dd8][_0xcd90('0x7e')]));}}}if(_0x740246[_0xcd90('0x7f')]){_0x740246[_0xcd90('0x7f')]=JSON[_0xcd90('0x7b')](_0x740246['conditions']);_0xb355f3['where'](_0x3c490e(_0x740246[_0xcd90('0x7f')][_0xcd90('0x67')]));}_0x256460=_0xb355f3[_0xcd90('0x80')]();_0xb355f3['limit'](_0x351b21);_0xb355f3[_0xcd90('0x1a')](0x0);return;}})[_0xcd90('0x24')](function(){if(_0x18edbd['output']===_0xcd90('0x8b')){return null;}var _0x32ec47=_[_0xcd90('0x3f')](_0x18edbd,{'name':_0x18edbd['fullPath']||_0x18edbd[_0xcd90('0x29')]||_0x740246['name'],'basename':_0x1f464f,'savename':util[_0xcd90('0x74')](_0xcd90('0x8c'),_0x18edbd[_0xcd90('0x29')]||_0x740246[_0xcd90('0x29')],require('randomstring')[_0xcd90('0x8d')](0x4),_0x18edbd['output']||'csv'),'reportId':_0x740246['id'],'reportType':_0xcd90('0x8e')});return db[_0xcd90('0x8f')]['create'](_0x32ec47,{'raw':!![]});})['then'](function(_0x240be7){if(_0x740246[_0xcd90('0x6f')]==='cdr'){_0x256460['where'](_0x740246[_0xcd90('0x6f')]+_0xcd90('0x90'),_0x18edbd[_0xcd90('0x91')],_0x18edbd[_0xcd90('0x92')]);}else{_0x256460['where'](_0x740246[_0xcd90('0x6f')]+_0xcd90('0x93'),_0x18edbd[_0xcd90('0x91')],_0x18edbd['endDate']);}if(_0x240be7){logger['info'](_0xcd90('0x94'),_0x256460[_0xcd90('0x81')]());require('child_process')[_0xcd90('0x95')](path[_0xcd90('0x52')](__dirname,_0xcd90('0x96'),_0x240be7[_0xcd90('0x97')]),[_0x240be7['id'],_0x256460['toString'](),path[_0xcd90('0x52')](__dirname,'../../files/reports',_0x240be7[_0xcd90('0x98')]),_0x1f464f]);return _0x240be7;}else{var _0x29e7a3=squel[_0xcd90('0x99')]();_0x29e7a3[_0xcd90('0x89')]('('+_0x256460[_0xcd90('0x81')]()+')',_0xcd90('0x9a'));_0x29e7a3[_0xcd90('0x68')](_0xcd90('0x9b'),'count');_0x256460['limit'](_0x18edbd[_0xcd90('0x1c')]||_0x351b21);_0x256460['offset'](_0x18edbd[_0xcd90('0x1a')]||0x0);return dbH['sequelize'][_0xcd90('0x31')](_0x29e7a3['toString'](),{'type':dbH[_0xcd90('0x82')][_0xcd90('0x83')]['SELECT']})[_0xcd90('0x24')](function(_0x5c3667){if(!_0x5c3667[_0xcd90('0x37')]){_0x24a5d8=0x0;}else{_0x24a5d8=_0x5c3667[0x0][_0xcd90('0x1d')]||0x0;}return dbH[_0xcd90('0x82')][_0xcd90('0x31')](_0x256460[_0xcd90('0x81')](),{'type':dbH['sequelize']['QueryTypes']['SELECT']});})[_0xcd90('0x24')](function(_0x2745ab){return{'rows':_0x2745ab||[],'count':_0x24a5d8};});}});}exports['run']=function(_0x3ca88e,_0x18768d){return runReport(_0x3ca88e[_0xcd90('0x45')],_0x3ca88e[_0xcd90('0x31')],_0x3ca88e[_0xcd90('0x40')])[_0xcd90('0x24')](respondWithResult(_0x18768d,null))['catch'](handleError(_0x18768d,null));};exports['runReport']=runReport;exports[_0xcd90('0x31')]=function(_0x3d2e62,_0x156fbb){var _0x6b1cf=0xa;var _0x12ab41=[_0xcd90('0x52'),_0xcd90('0x53'),_0xcd90('0x54'),_0xcd90('0x85')];var _0x24c062={'SUM':_0xcd90('0x86'),'COUNT':_0xcd90('0x55'),'COUNT DISTINCT':_0xcd90('0x56'),'MAX':_0xcd90('0x57'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xcd90('0x5b'),'GROUP_CONCAT DESC':_0xcd90('0x5c')};var _0x37a906={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xcd90('0x9c'),'UNIX_TIMESTAMP':_0xcd90('0x60')};var _0x49036e=function(_0x3efaca){return!_[_0xcd90('0x61')]([_0xcd90('0x62'),_0xcd90('0x63'),'IS\x20EMPTY',_0xcd90('0x64')],_0x3efaca);};var _0x93820c=function(_0x4eab49){if(!_0x4eab49||!_0x4eab49[_0xcd90('0x65')]['length']){return'';}for(var _0x495030='(',_0x37ef0e=0x0;_0x37ef0e<_0x4eab49[_0xcd90('0x65')][_0xcd90('0x37')];_0x37ef0e+=0x1){_0x37ef0e>0x0&&(_0x495030+='\x20'+_0x4eab49[_0xcd90('0x66')]+'\x20');_0x495030+=_0x4eab49['rules'][_0x37ef0e]['group']?_0x93820c(_0x4eab49[_0xcd90('0x65')][_0x37ef0e][_0xcd90('0x67')]):_0x4eab49[_0xcd90('0x65')][_0x37ef0e][_0xcd90('0x68')]+'\x20'+_0x4eab49[_0xcd90('0x65')][_0x37ef0e][_0xcd90('0x69')]+(_0x49036e(_0x4eab49[_0xcd90('0x65')][_0x37ef0e][_0xcd90('0x69')])?'\x20'+_0x4eab49[_0xcd90('0x65')][_0x37ef0e][_0xcd90('0x87')]:'');}return _0x495030+')';};var _0x46fc3b={'where':{'id':_0x3d2e62[_0xcd90('0x45')]['id']}},_0x14a077,_0x4571e8,_0xe7199a,_0x4f8aae,_0x21c4bb;_0x46fc3b=_[_0xcd90('0x3f')]({},_0x46fc3b,_0x3d2e62['options']);return db['AnalyticCustomReport'][_0xcd90('0x50')](_0x46fc3b)[_0xcd90('0x24')](function(_0x55b6d0){if(_0x55b6d0){_0x14a077=_0x55b6d0;return _0x55b6d0['getFields']();}return null;})['then'](function(_0x29e76e){if(_0x29e76e){if(!_0x29e76e[_0xcd90('0x37')]){throw new db[(_0xcd90('0x6b'))]['ValidationErrorItem'](_0xcd90('0x6c'),0x193);}_0x4571e8=_0x29e76e;return db[_0xcd90('0x6d')][_0xcd90('0x43')]({'raw':!![]});}return null;})[_0xcd90('0x24')](function(_0x25dcb6){if(_0x25dcb6){_0xe7199a=_[_0xcd90('0x6e')](_0x25dcb6,'id');var _0x274e29;var _0x56885d=squel[_0xcd90('0x99')]();_0x56885d[_0xcd90('0x89')](_0x14a077[_0xcd90('0x6f')]);for(var _0x2719df=0x0;_0x2719df<_0x4571e8[_0xcd90('0x37')];_0x2719df+=0x1){_0x274e29=_0x4571e8[_0x2719df]['MetricId']?_0xe7199a[_0x4571e8[_0x2719df][_0xcd90('0x70')]][_0xcd90('0x71')]:_0x4571e8[_0x2719df][_0xcd90('0x68')];_0x274e29=_0x4571e8[_0x2719df][_0xcd90('0x73')]?_[_0xcd90('0x72')](_0x24c062[_0x4571e8[_0x2719df][_0xcd90('0x73')]],'%s',_0x274e29):_0x274e29;_0x274e29=_0x4571e8[_0x2719df][_0xcd90('0x74')]?_[_0xcd90('0x72')](_0x37a906[_0x4571e8[_0x2719df][_0xcd90('0x74')]],'%s',_0x274e29):_0x274e29;if(_0x4571e8[_0x2719df][_0xcd90('0x75')]){_0x56885d[_0xcd90('0x67')](_0x274e29);}_0x4571e8[_0x2719df][_0xcd90('0x77')]&&_0x56885d['order'](_0x274e29,_0x4571e8[_0x2719df]['orderBy']===_0xcd90('0x78')?![]:!![]);_0x56885d[_0xcd90('0x68')](_0x274e29,_0x4571e8[_0x2719df]['alias']||_0x274e29);}if(_0x14a077['joins']){_0x14a077[_0xcd90('0x7a')]=JSON['parse'](_0x14a077[_0xcd90('0x7a')]);for(var _0x3581b1=0x0;_0x3581b1<_0x14a077[_0xcd90('0x7a')][_0xcd90('0x37')];_0x3581b1+=0x1){if(_0x14a077[_0xcd90('0x7a')][_0x3581b1][_0xcd90('0x2e')]&&_[_0xcd90('0x61')](_0x12ab41,_0x14a077[_0xcd90('0x7a')][_0x3581b1]['type'])&&_0x14a077['joins'][_0x3581b1][_0xcd90('0x7c')]&&_0x14a077[_0xcd90('0x7a')][_0x3581b1][_0xcd90('0x7d')]&&_0x14a077[_0xcd90('0x7a')][_0x3581b1]['foreignKey']){_0x56885d[_0x14a077[_0xcd90('0x7a')][_0x3581b1][_0xcd90('0x2e')]](_0x14a077[_0xcd90('0x7a')][_0x3581b1][_0xcd90('0x7d')],null,util[_0xcd90('0x74')](_0xcd90('0x8a'),_0x14a077[_0xcd90('0x6f')],_0x14a077[_0xcd90('0x7a')][_0x3581b1][_0xcd90('0x7c')],_0x14a077[_0xcd90('0x7a')][_0x3581b1][_0xcd90('0x7d')],_0x14a077[_0xcd90('0x7a')][_0x3581b1][_0xcd90('0x7e')]));}}}if(_0x14a077[_0xcd90('0x7f')]){_0x14a077['conditions']=JSON[_0xcd90('0x7b')](_0x14a077[_0xcd90('0x7f')]);_0x56885d[_0xcd90('0x3d')](_0x93820c(_0x14a077['conditions'][_0xcd90('0x67')]));}_0x21c4bb=_0x56885d[_0xcd90('0x80')]();_0x56885d[_0xcd90('0x1c')](_0x6b1cf);_0x56885d[_0xcd90('0x1a')](0x0);logger[_0xcd90('0x9d')](_0xcd90('0x9e'),_0x56885d['toString']());return dbH[_0xcd90('0x82')][_0xcd90('0x31')](_0x56885d['toString'](),{'type':dbH[_0xcd90('0x82')][_0xcd90('0x83')][_0xcd90('0x84')]});}})[_0xcd90('0x24')](function(){return{'sql':_0x21c4bb[_0xcd90('0x81')]()};})[_0xcd90('0x24')](respondWithResult(_0x156fbb,null))['catch'](handleError(_0x156fbb,null));};
\ No newline at end of file
+var _0xed5a=['orderBy','DESC','alias','joins','parentKey','foreignKey','foreignTable','format','conditions','clone','debug','toString','sequelize','left_join','cross_join','AVG(%s)','GROUP_CONCAT(%s)','UNIX_TIMESTAMP(%s)','operator','Please\x20insert\x20at\x20least\x20one\x20field','select','from','metric','groupBy','%s.%s\x20=\x20%s.%s','output','fullPath','%s-%s.%s','randomstring','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','QueryTypes','SELECT','run','right_join','Limited\x20Query:','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','count','status','set','json','apply','update','get','UserProfileResource','destroy','then','error','stack','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','length','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','preview','join','SUM(%s)','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)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','table','MetricId','function','replace'];(function(_0x47217f,_0x444865){var _0x3914eb=function(_0x34d051){while(--_0x34d051){_0x47217f['push'](_0x47217f['shift']());}};_0x3914eb(++_0x444865);}(_0xed5a,0x180));var _0xaed5=function(_0xf51c06,_0x388e5b){_0xf51c06=_0xf51c06-0x0;var _0x1d5420=_0xed5a[_0xf51c06];return _0x1d5420;};'use strict';var emlformat=require(_0xaed5('0x0'));var rimraf=require(_0xaed5('0x1'));var zipdir=require(_0xaed5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaed5('0x3'));var moment=require(_0xaed5('0x4'));var BPromise=require(_0xaed5('0x5'));var Mustache=require(_0xaed5('0x6'));var util=require('util');var path=require(_0xaed5('0x7'));var sox=require(_0xaed5('0x8'));var csv=require(_0xaed5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaed5('0xa'));var _=require(_0xaed5('0xb'));var squel=require('squel');var crypto=require(_0xaed5('0xc'));var jsforce=require(_0xaed5('0xd'));var deskjs=require(_0xaed5('0xe'));var toCsv=require(_0xaed5('0x9'));var querystring=require(_0xaed5('0xf'));var Papa=require('papaparse');var Redis=require(_0xaed5('0x10'));var authService=require(_0xaed5('0x11'));var qs=require(_0xaed5('0x12'));var as=require(_0xaed5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xaed5('0x14'));var utils=require(_0xaed5('0x15'));var config=require(_0xaed5('0x16'));var licenseUtil=require(_0xaed5('0x17'));var db=require(_0xaed5('0x18'))['db'];var dbH=require(_0xaed5('0x18'))['dbH'];function respondWithStatusCode(_0x232290,_0x638530){_0x638530=_0x638530||0xcc;return function(_0x3b789e){if(_0x3b789e){return _0x232290[_0xaed5('0x19')](_0x638530);}return _0x232290['status'](_0x638530)[_0xaed5('0x1a')]();};}function respondWithResult(_0x149b14,_0x3a609a){_0x3a609a=_0x3a609a||0xc8;return function(_0x1eecce){if(_0x1eecce){return _0x149b14['status'](_0x3a609a)['json'](_0x1eecce);}};}function respondWithFilteredResult(_0x374a35,_0x20af56){return function(_0x5dd4b6){if(_0x5dd4b6){var _0x4fbe42=typeof _0x20af56[_0xaed5('0x1b')]===_0xaed5('0x1c')&&typeof _0x20af56['limit']==='undefined';var _0x846168=_0x5dd4b6[_0xaed5('0x1d')];var _0x111dbe=_0x4fbe42?0x0:_0x20af56[_0xaed5('0x1b')];var _0x104e60=_0x4fbe42?_0x5dd4b6[_0xaed5('0x1d')]:_0x20af56[_0xaed5('0x1b')]+_0x20af56['limit'];var _0x376f28;if(_0x104e60>=_0x846168){_0x104e60=_0x846168;_0x376f28=0xc8;}else{_0x376f28=0xce;}_0x374a35[_0xaed5('0x1e')](_0x376f28);return _0x374a35[_0xaed5('0x1f')]('Content-Range',_0x111dbe+'-'+_0x104e60+'/'+_0x846168)[_0xaed5('0x20')](_0x5dd4b6);}return null;};}function patchUpdates(_0x292ecf){return function(_0x479da3){try{jsonpatch[_0xaed5('0x21')](_0x479da3,_0x292ecf,!![]);}catch(_0x23ae04){return BPromise['reject'](_0x23ae04);}return _0x479da3['save']();};}function saveUpdates(_0x517fd0,_0x57f87a){return function(_0xf36e42){if(_0xf36e42){return _0xf36e42[_0xaed5('0x22')](_0x517fd0)['then'](function(_0x256c56){return _0x256c56;});}return null;};}function removeEntity(_0x3accf5,_0x418a11){return function(_0xc76732){if(_0xc76732){return _0xc76732['destroy']()['then'](function(){var _0x28bda7=_0xc76732[_0xaed5('0x23')]({'plain':!![]});var _0x589965='CustomReports';return db[_0xaed5('0x24')][_0xaed5('0x25')]({'where':{'type':_0x589965,'resourceId':_0x28bda7['id']}})[_0xaed5('0x26')](function(){return _0xc76732;});})[_0xaed5('0x26')](function(){_0x3accf5['status'](0xcc)[_0xaed5('0x1a')]();});}};}function handleEntityNotFound(_0x593fbd,_0x1eb7b3){return function(_0x5c880e){if(!_0x5c880e){_0x593fbd['sendStatus'](0x194);}return _0x5c880e;};}function handleError(_0x1f030f,_0x5960cc){_0x5960cc=_0x5960cc||0x1f4;return function(_0x3bc5c1){logger[_0xaed5('0x27')](_0x3bc5c1[_0xaed5('0x28')]);if(_0x3bc5c1['name']){delete _0x3bc5c1['name'];}_0x1f030f[_0xaed5('0x1e')](_0x5960cc)[_0xaed5('0x29')](_0x3bc5c1);};}exports[_0xaed5('0x2a')]=function(_0x15db0b,_0x3abf0e){var _0x302e43={},_0xebdb29={},_0x58cb55={'count':0x0,'rows':[]};var _0x66764e=_[_0xaed5('0x2b')](db[_0xaed5('0x2c')][_0xaed5('0x2d')],function(_0x2c8795){return{'name':_0x2c8795[_0xaed5('0x2e')],'type':_0x2c8795[_0xaed5('0x2f')][_0xaed5('0x30')]};});_0xebdb29[_0xaed5('0x31')]=_['map'](_0x66764e,_0xaed5('0x32'));_0xebdb29[_0xaed5('0x33')]=_[_0xaed5('0x34')](_0x15db0b[_0xaed5('0x33')]);_0xebdb29[_0xaed5('0x35')]=_[_0xaed5('0x36')](_0xebdb29[_0xaed5('0x31')],_0xebdb29[_0xaed5('0x33')]);_0x302e43['attributes']=_[_0xaed5('0x36')](_0xebdb29[_0xaed5('0x31')],qs[_0xaed5('0x37')](_0x15db0b[_0xaed5('0x33')][_0xaed5('0x37')]));_0x302e43[_0xaed5('0x38')]=_0x302e43[_0xaed5('0x38')]['length']?_0x302e43['attributes']:_0xebdb29[_0xaed5('0x31')];if(!_0x15db0b[_0xaed5('0x33')][_0xaed5('0x39')](_0xaed5('0x3a'))){_0x302e43['limit']=qs['limit'](_0x15db0b[_0xaed5('0x33')][_0xaed5('0x3b')]);_0x302e43[_0xaed5('0x1b')]=qs[_0xaed5('0x1b')](_0x15db0b[_0xaed5('0x33')][_0xaed5('0x1b')]);}_0x302e43[_0xaed5('0x3c')]=qs[_0xaed5('0x3d')](_0x15db0b[_0xaed5('0x33')][_0xaed5('0x3d')]);_0x302e43[_0xaed5('0x3e')]=qs[_0xaed5('0x35')](_[_0xaed5('0x3f')](_0x15db0b[_0xaed5('0x33')],_0xebdb29['filters']),_0x66764e);if(_0x15db0b[_0xaed5('0x33')][_0xaed5('0x40')]){_0x302e43[_0xaed5('0x3e')]=_[_0xaed5('0x41')](_0x302e43['where'],{'$or':_[_0xaed5('0x2b')](_0x66764e,function(_0x525bf5){if(_0x525bf5[_0xaed5('0x2f')]!==_0xaed5('0x42')){var _0xff17ef={};_0xff17ef[_0x525bf5[_0xaed5('0x32')]]={'$like':'%'+_0x15db0b[_0xaed5('0x33')]['filter']+'%'};return _0xff17ef;}})});}_0x302e43=_[_0xaed5('0x41')]({},_0x302e43,_0x15db0b[_0xaed5('0x43')]);var _0x45da73={'where':_0x302e43[_0xaed5('0x3e')]};return db[_0xaed5('0x2c')][_0xaed5('0x1d')](_0x45da73)[_0xaed5('0x26')](function(_0x350c1b){_0x58cb55['count']=_0x350c1b;if(_0x15db0b[_0xaed5('0x33')]['includeAll']){_0x302e43[_0xaed5('0x44')]=[{'all':!![]}];}return db[_0xaed5('0x2c')][_0xaed5('0x45')](_0x302e43);})[_0xaed5('0x26')](function(_0x29d738){_0x58cb55[_0xaed5('0x46')]=_0x29d738;return _0x58cb55;})[_0xaed5('0x26')](respondWithFilteredResult(_0x3abf0e,_0x302e43))[_0xaed5('0x47')](handleError(_0x3abf0e,null));};exports[_0xaed5('0x48')]=function(_0x427a06,_0x4e1bc1){var _0x46dc14={'raw':![],'where':{'id':_0x427a06['params']['id']}},_0x471503={};_0x471503[_0xaed5('0x31')]=_[_0xaed5('0x34')](db['AnalyticCustomReport'][_0xaed5('0x2d')]);_0x471503[_0xaed5('0x33')]=_[_0xaed5('0x34')](_0x427a06[_0xaed5('0x33')]);_0x471503[_0xaed5('0x35')]=_['intersection'](_0x471503[_0xaed5('0x31')],_0x471503['query']);_0x46dc14[_0xaed5('0x38')]=_['intersection'](_0x471503[_0xaed5('0x31')],qs[_0xaed5('0x37')](_0x427a06[_0xaed5('0x33')][_0xaed5('0x37')]));_0x46dc14[_0xaed5('0x38')]=_0x46dc14[_0xaed5('0x38')][_0xaed5('0x49')]?_0x46dc14[_0xaed5('0x38')]:_0x471503[_0xaed5('0x31')];if(_0x427a06[_0xaed5('0x33')]['includeAll']){_0x46dc14[_0xaed5('0x44')]=[{'all':!![]}];}_0x46dc14=_[_0xaed5('0x41')]({},_0x46dc14,_0x427a06['options']);return db[_0xaed5('0x2c')][_0xaed5('0x4a')](_0x46dc14)[_0xaed5('0x26')](handleEntityNotFound(_0x4e1bc1,null))['then'](respondWithResult(_0x4e1bc1,null))['catch'](handleError(_0x4e1bc1,null));};exports[_0xaed5('0x4b')]=function(_0x4287f3,_0x1946c1){return db[_0xaed5('0x2c')][_0xaed5('0x4b')](_0x4287f3['body'],{})[_0xaed5('0x26')](function(_0xe2de6d){var _0x281bec=_0x4287f3['user'][_0xaed5('0x23')]({'plain':!![]});if(!_0x281bec)throw new Error(_0xaed5('0x4c'));if(_0x281bec[_0xaed5('0x4d')]===_0xaed5('0x4e')){var _0x47038b=_0xe2de6d['get']({'plain':!![]});var _0x1d104a='Reports';return db[_0xaed5('0x4f')][_0xaed5('0x4a')]({'where':{'name':_0x1d104a,'userProfileId':_0x281bec[_0xaed5('0x50')]},'raw':!![]})[_0xaed5('0x26')](function(_0x2e6e68){if(_0x2e6e68&&_0x2e6e68['autoAssociation']===0x0){return db[_0xaed5('0x24')][_0xaed5('0x4b')]({'name':_0x47038b['name'],'resourceId':_0x47038b['id'],'type':_0xaed5('0x51'),'sectionId':_0x2e6e68['id']},{})[_0xaed5('0x26')](function(){return _0xe2de6d;});}else{return _0xe2de6d;}})[_0xaed5('0x47')](function(_0xbbd90b){logger[_0xaed5('0x27')](_0xaed5('0x52'),_0xbbd90b);throw _0xbbd90b;});}return _0xe2de6d;})[_0xaed5('0x26')](respondWithResult(_0x1946c1,0xc9))['catch'](handleError(_0x1946c1,null));};exports[_0xaed5('0x22')]=function(_0x5965a8,_0x2a7dd2){if(_0x5965a8[_0xaed5('0x53')]['id']){delete _0x5965a8[_0xaed5('0x53')]['id'];}return db[_0xaed5('0x2c')]['find']({'where':{'id':_0x5965a8[_0xaed5('0x54')]['id']}})['then'](handleEntityNotFound(_0x2a7dd2,null))[_0xaed5('0x26')](saveUpdates(_0x5965a8[_0xaed5('0x53')],null))[_0xaed5('0x26')](respondWithResult(_0x2a7dd2,null))[_0xaed5('0x47')](handleError(_0x2a7dd2,null));};exports['destroy']=function(_0x3d80c8,_0xbb0363){return db['AnalyticCustomReport'][_0xaed5('0x4a')]({'where':{'id':_0x3d80c8[_0xaed5('0x54')]['id']}})[_0xaed5('0x26')](handleEntityNotFound(_0xbb0363,null))[_0xaed5('0x26')](removeEntity(_0xbb0363,null))[_0xaed5('0x47')](handleError(_0xbb0363,null));};exports[_0xaed5('0x55')]=function(_0x5c5c52,_0x4828f0){var _0x14d05f=0xa;var _0x229624=[_0xaed5('0x56'),'left_join','right_join','cross_join'];var _0x505e0d={'SUM':_0xaed5('0x57'),'COUNT':_0xaed5('0x58'),'COUNT DISTINCT':_0xaed5('0x59'),'MAX':_0xaed5('0x5a'),'MIN':_0xaed5('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xaed5('0x5c'),'GROUP_CONCAT DESC':_0xaed5('0x5d')};var _0x2f95c6={'SEC_TO_TIME':_0xaed5('0x5e'),'DATE':_0xaed5('0x5f'),'HOUR':_0xaed5('0x60'),'ROUND':_0xaed5('0x61'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xabd9c1=function(_0x416be7){return!_[_0xaed5('0x62')]([_0xaed5('0x63'),_0xaed5('0x64'),_0xaed5('0x65'),_0xaed5('0x66')],_0x416be7);};var _0x45b919=function(_0x584bc9){if(!_0x584bc9||!_0x584bc9[_0xaed5('0x67')][_0xaed5('0x49')]){return'';}for(var _0x468007='(',_0x16adc0=0x0;_0x16adc0<_0x584bc9[_0xaed5('0x67')][_0xaed5('0x49')];_0x16adc0+=0x1){_0x16adc0>0x0&&(_0x468007+='\x20'+_0x584bc9['operator']+'\x20');_0x468007+=_0x584bc9['rules'][_0x16adc0][_0xaed5('0x68')]?_0x45b919(_0x584bc9[_0xaed5('0x67')][_0x16adc0][_0xaed5('0x68')]):_0x584bc9['rules'][_0x16adc0][_0xaed5('0x69')]+'\x20'+_0x584bc9['rules'][_0x16adc0]['condition']+(_0xabd9c1(_0x584bc9['rules'][_0x16adc0][_0xaed5('0x6a')])?'\x20'+_0x584bc9[_0xaed5('0x67')][_0x16adc0][_0xaed5('0x6b')]:'');}return _0x468007+')';};var _0x20a344={'where':{'id':_0x5c5c52[_0xaed5('0x54')]['id']}},_0x47b5af,_0x2765d,_0xbf7dc1,_0x29581f,_0x18be83;_0x20a344=_[_0xaed5('0x41')]({},_0x20a344,_0x5c5c52[_0xaed5('0x43')]);return db['AnalyticCustomReport']['find'](_0x20a344)['then'](function(_0x5aebe0){if(_0x5aebe0){_0x47b5af=_0x5aebe0;return _0x5aebe0[_0xaed5('0x6c')]();}return null;})['then'](function(_0x105432){if(_0x105432){if(!_0x105432[_0xaed5('0x49')]){throw new db[(_0xaed5('0x6d'))][(_0xaed5('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2765d=_0x105432;return db[_0xaed5('0x6f')][_0xaed5('0x45')]({'raw':!![]});}return null;})['then'](function(_0x387342){if(_0x387342){_0xbf7dc1=_[_0xaed5('0x70')](_0x387342,'id');var _0x10d5d6;var _0x4c912e=squel['select']();_0x4c912e['from'](_0x47b5af[_0xaed5('0x71')]);for(var _0x2d6191=0x0;_0x2d6191<_0x2765d[_0xaed5('0x49')];_0x2d6191+=0x1){_0x10d5d6=_0x2765d[_0x2d6191][_0xaed5('0x72')]?_0xbf7dc1[_0x2765d[_0x2d6191]['MetricId']]['metric']:_0x2765d[_0x2d6191][_0xaed5('0x69')];_0x10d5d6=_0x2765d[_0x2d6191][_0xaed5('0x73')]?_['replace'](_0x505e0d[_0x2765d[_0x2d6191][_0xaed5('0x73')]],'%s',_0x10d5d6):_0x10d5d6;_0x10d5d6=_0x2765d[_0x2d6191]['format']?_[_0xaed5('0x74')](_0x2f95c6[_0x2765d[_0x2d6191]['format']],'%s',_0x10d5d6):_0x10d5d6;if(_0x2765d[_0x2d6191]['groupBy']){_0x4c912e[_0xaed5('0x68')](_0x10d5d6);}_0x2765d[_0x2d6191][_0xaed5('0x75')]&&_0x4c912e[_0xaed5('0x3c')](_0x10d5d6,_0x2765d[_0x2d6191][_0xaed5('0x75')]===_0xaed5('0x76')?![]:!![]);_0x4c912e[_0xaed5('0x69')](_0x10d5d6,_0x2765d[_0x2d6191][_0xaed5('0x77')]||_0x10d5d6);}if(_0x47b5af[_0xaed5('0x78')]){_0x47b5af[_0xaed5('0x78')]=JSON['parse'](_0x47b5af['joins']);for(var _0x4f8dc4=0x0;_0x4f8dc4<_0x47b5af[_0xaed5('0x78')]['length'];_0x4f8dc4+=0x1){if(_0x47b5af[_0xaed5('0x78')][_0x4f8dc4][_0xaed5('0x2f')]&&_[_0xaed5('0x62')](_0x229624,_0x47b5af[_0xaed5('0x78')][_0x4f8dc4][_0xaed5('0x2f')])&&_0x47b5af[_0xaed5('0x78')][_0x4f8dc4][_0xaed5('0x79')]&&_0x47b5af['joins'][_0x4f8dc4]['foreignTable']&&_0x47b5af[_0xaed5('0x78')][_0x4f8dc4][_0xaed5('0x7a')]){_0x4c912e[_0x47b5af[_0xaed5('0x78')][_0x4f8dc4]['type']](_0x47b5af[_0xaed5('0x78')][_0x4f8dc4][_0xaed5('0x7b')],null,util[_0xaed5('0x7c')]('%s.%s\x20=\x20%s.%s',_0x47b5af['table'],_0x47b5af['joins'][_0x4f8dc4][_0xaed5('0x79')],_0x47b5af[_0xaed5('0x78')][_0x4f8dc4][_0xaed5('0x7b')],_0x47b5af[_0xaed5('0x78')][_0x4f8dc4][_0xaed5('0x7a')]));}}}if(_0x47b5af[_0xaed5('0x7d')]){_0x47b5af[_0xaed5('0x7d')]=JSON['parse'](_0x47b5af[_0xaed5('0x7d')]);_0x4c912e[_0xaed5('0x3e')](_0x45b919(_0x47b5af[_0xaed5('0x7d')][_0xaed5('0x68')]));}_0x18be83=_0x4c912e[_0xaed5('0x7e')]();_0x4c912e[_0xaed5('0x3b')](_0x14d05f);_0x4c912e[_0xaed5('0x1b')](0x0);logger[_0xaed5('0x7f')]('Limited\x20Query:',_0x4c912e[_0xaed5('0x80')]());return dbH[_0xaed5('0x81')][_0xaed5('0x33')](_0x4c912e[_0xaed5('0x80')](),{'type':dbH[_0xaed5('0x81')]['QueryTypes']['SELECT']});}})[_0xaed5('0x26')](respondWithResult(_0x4828f0,null))[_0xaed5('0x47')](handleError(_0x4828f0,null));};function runReport(_0x4d3634,_0x43c2cf,_0x598ba5){var _0x185fe4=_0x43c2cf['name'];var _0x34e119=0xa;var _0x1353f9=[_0xaed5('0x56'),_0xaed5('0x82'),'right_join',_0xaed5('0x83')];var _0x39b2b4={'SUM':_0xaed5('0x57'),'COUNT':_0xaed5('0x58'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xaed5('0x5b'),'AVG':_0xaed5('0x84'),'GROUP_CONCAT':_0xaed5('0x85'),'GROUP_CONCAT ASC':_0xaed5('0x5c'),'GROUP_CONCAT DESC':_0xaed5('0x5d')};var _0x4763ff={'SEC_TO_TIME':_0xaed5('0x5e'),'DATE':'DATE(%s)','HOUR':_0xaed5('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xaed5('0x86')};var _0x3b9f83=function(_0x5257ac){return!_[_0xaed5('0x62')](['IS\x20NULL',_0xaed5('0x64'),_0xaed5('0x65'),_0xaed5('0x66')],_0x5257ac);};var _0xda9468=function(_0x196d4f){if(!_0x196d4f||!_0x196d4f[_0xaed5('0x67')][_0xaed5('0x49')]){return'';}for(var _0x33246a='(',_0x4244a9=0x0;_0x4244a9<_0x196d4f[_0xaed5('0x67')]['length'];_0x4244a9+=0x1){_0x4244a9>0x0&&(_0x33246a+='\x20'+_0x196d4f[_0xaed5('0x87')]+'\x20');_0x33246a+=_0x196d4f[_0xaed5('0x67')][_0x4244a9]['group']?_0xda9468(_0x196d4f[_0xaed5('0x67')][_0x4244a9][_0xaed5('0x68')]):_0x196d4f['rules'][_0x4244a9][_0xaed5('0x69')]+'\x20'+_0x196d4f['rules'][_0x4244a9]['condition']+(_0x3b9f83(_0x196d4f[_0xaed5('0x67')][_0x4244a9][_0xaed5('0x6a')])?'\x20'+_0x196d4f[_0xaed5('0x67')][_0x4244a9]['value']:'');}return _0x33246a+')';};var _0x3dc4ed={'where':{'id':_0x4d3634['id']}},_0x4280d3,_0x320018,_0x412ab2,_0x150aad,_0x12a97b;_0x3dc4ed=_[_0xaed5('0x41')]({},_0x3dc4ed,_0x598ba5);return db[_0xaed5('0x2c')]['find'](_0x3dc4ed)[_0xaed5('0x26')](function(_0x3a37f4){if(_0x3a37f4){_0x4280d3=_0x3a37f4;return _0x3a37f4[_0xaed5('0x6c')]();}return null;})['then'](function(_0x17c8ea){if(_0x17c8ea){if(!_0x17c8ea[_0xaed5('0x49')]){throw new db[(_0xaed5('0x6d'))]['ValidationErrorItem'](_0xaed5('0x88'),0x193);}_0x320018=_0x17c8ea;return db[_0xaed5('0x6f')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x245fdc){if(_0x245fdc){_0x412ab2=_[_0xaed5('0x70')](_0x245fdc,'id');var _0x3a4aa6;var _0x36653b=squel[_0xaed5('0x89')]();_0x36653b[_0xaed5('0x8a')](_0x4280d3[_0xaed5('0x71')]);for(var _0x5773de=0x0;_0x5773de<_0x320018[_0xaed5('0x49')];_0x5773de+=0x1){_0x3a4aa6=_0x320018[_0x5773de][_0xaed5('0x72')]?_0x412ab2[_0x320018[_0x5773de][_0xaed5('0x72')]][_0xaed5('0x8b')]:_0x320018[_0x5773de]['field'];_0x3a4aa6=_0x320018[_0x5773de][_0xaed5('0x73')]?_['replace'](_0x39b2b4[_0x320018[_0x5773de]['function']],'%s',_0x3a4aa6):_0x3a4aa6;_0x3a4aa6=_0x320018[_0x5773de][_0xaed5('0x7c')]?_[_0xaed5('0x74')](_0x4763ff[_0x320018[_0x5773de][_0xaed5('0x7c')]],'%s',_0x3a4aa6):_0x3a4aa6;if(_0x320018[_0x5773de][_0xaed5('0x8c')]){_0x36653b[_0xaed5('0x68')](_0x3a4aa6);}_0x320018[_0x5773de][_0xaed5('0x75')]&&_0x36653b[_0xaed5('0x3c')](_0x3a4aa6,_0x320018[_0x5773de][_0xaed5('0x75')]==='DESC'?![]:!![]);_0x36653b['field'](_0x3a4aa6,_0x320018[_0x5773de]['alias']||_0x3a4aa6);}if(_0x4280d3[_0xaed5('0x78')]){_0x4280d3[_0xaed5('0x78')]=JSON['parse'](_0x4280d3['joins']);for(var _0x48d0a9=0x0;_0x48d0a9<_0x4280d3['joins'][_0xaed5('0x49')];_0x48d0a9+=0x1){if(_0x4280d3[_0xaed5('0x78')][_0x48d0a9]['type']&&_[_0xaed5('0x62')](_0x1353f9,_0x4280d3[_0xaed5('0x78')][_0x48d0a9][_0xaed5('0x2f')])&&_0x4280d3[_0xaed5('0x78')][_0x48d0a9][_0xaed5('0x79')]&&_0x4280d3[_0xaed5('0x78')][_0x48d0a9][_0xaed5('0x7b')]&&_0x4280d3[_0xaed5('0x78')][_0x48d0a9][_0xaed5('0x7a')]){_0x36653b[_0x4280d3['joins'][_0x48d0a9][_0xaed5('0x2f')]](_0x4280d3['joins'][_0x48d0a9][_0xaed5('0x7b')],null,util['format'](_0xaed5('0x8d'),_0x4280d3[_0xaed5('0x71')],_0x4280d3[_0xaed5('0x78')][_0x48d0a9]['parentKey'],_0x4280d3[_0xaed5('0x78')][_0x48d0a9][_0xaed5('0x7b')],_0x4280d3[_0xaed5('0x78')][_0x48d0a9][_0xaed5('0x7a')]));}}}if(_0x4280d3[_0xaed5('0x7d')]){_0x4280d3['conditions']=JSON['parse'](_0x4280d3[_0xaed5('0x7d')]);_0x36653b[_0xaed5('0x3e')](_0xda9468(_0x4280d3['conditions'][_0xaed5('0x68')]));}_0x12a97b=_0x36653b[_0xaed5('0x7e')]();_0x36653b[_0xaed5('0x3b')](_0x34e119);_0x36653b[_0xaed5('0x1b')](0x0);return;}})[_0xaed5('0x26')](function(){if(_0x43c2cf[_0xaed5('0x8e')]==='web'){return null;}var _0x2fcf22=_[_0xaed5('0x41')](_0x43c2cf,{'name':_0x43c2cf[_0xaed5('0x8f')]||_0x43c2cf[_0xaed5('0x32')]||_0x4280d3[_0xaed5('0x32')],'basename':_0x185fe4,'savename':util[_0xaed5('0x7c')](_0xaed5('0x90'),_0x43c2cf[_0xaed5('0x32')]||_0x4280d3[_0xaed5('0x32')],require(_0xaed5('0x91'))['generate'](0x4),_0x43c2cf[_0xaed5('0x8e')]||_0xaed5('0x92')),'reportId':_0x4280d3['id'],'reportType':'custom'});return db[_0xaed5('0x93')][_0xaed5('0x4b')](_0x2fcf22,{'raw':!![]});})['then'](function(_0x32a7e4){if(_0x4280d3[_0xaed5('0x71')]===_0xaed5('0x94')){_0x12a97b[_0xaed5('0x3e')](_0x4280d3[_0xaed5('0x71')]+_0xaed5('0x95'),_0x43c2cf[_0xaed5('0x96')],_0x43c2cf[_0xaed5('0x97')]);}else{_0x12a97b[_0xaed5('0x3e')](_0x4280d3[_0xaed5('0x71')]+_0xaed5('0x98'),_0x43c2cf['startDate'],_0x43c2cf[_0xaed5('0x97')]);}if(_0x32a7e4){logger[_0xaed5('0x99')](_0xaed5('0x9a'),_0x12a97b[_0xaed5('0x80')]());require(_0xaed5('0x9b'))[_0xaed5('0x9c')](path[_0xaed5('0x56')](__dirname,_0xaed5('0x9d'),_0x32a7e4[_0xaed5('0x8e')]),[_0x32a7e4['id'],_0x12a97b[_0xaed5('0x80')](),path[_0xaed5('0x56')](__dirname,_0xaed5('0x9e'),_0x32a7e4[_0xaed5('0x9f')]),_0x185fe4]);return _0x32a7e4;}else{var _0x2102d4=squel[_0xaed5('0x89')]();_0x2102d4[_0xaed5('0x8a')]('('+_0x12a97b[_0xaed5('0x80')]()+')',_0xaed5('0xa0'));_0x2102d4[_0xaed5('0x69')](_0xaed5('0xa1'),'count');_0x12a97b[_0xaed5('0x3b')](_0x43c2cf[_0xaed5('0x3b')]||_0x34e119);_0x12a97b[_0xaed5('0x1b')](_0x43c2cf['offset']||0x0);return dbH['sequelize']['query'](_0x2102d4[_0xaed5('0x80')](),{'type':dbH[_0xaed5('0x81')][_0xaed5('0xa2')]['SELECT']})['then'](function(_0x5441cd){if(!_0x5441cd[_0xaed5('0x49')]){_0x150aad=0x0;}else{_0x150aad=_0x5441cd[0x0][_0xaed5('0x1d')]||0x0;}return dbH['sequelize'][_0xaed5('0x33')](_0x12a97b['toString'](),{'type':dbH[_0xaed5('0x81')][_0xaed5('0xa2')][_0xaed5('0xa3')]});})[_0xaed5('0x26')](function(_0x1cb2cd){return{'rows':_0x1cb2cd||[],'count':_0x150aad};});}});}exports[_0xaed5('0xa4')]=function(_0x3f032c,_0x336f6e){return runReport(_0x3f032c[_0xaed5('0x54')],_0x3f032c[_0xaed5('0x33')],_0x3f032c['options'])[_0xaed5('0x26')](respondWithResult(_0x336f6e,null))[_0xaed5('0x47')](handleError(_0x336f6e,null));};exports['runReport']=runReport;exports['query']=function(_0x304d38,_0x2292d5){var _0x2002f9=0xa;var _0x97e1ad=[_0xaed5('0x56'),_0xaed5('0x82'),_0xaed5('0xa5'),_0xaed5('0x83')];var _0x3cccdb={'SUM':'SUM(%s)','COUNT':_0xaed5('0x58'),'COUNT DISTINCT':_0xaed5('0x59'),'MAX':_0xaed5('0x5a'),'MIN':_0xaed5('0x5b'),'AVG':_0xaed5('0x84'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xaed5('0x5c'),'GROUP_CONCAT DESC':_0xaed5('0x5d')};var _0x1e57b4={'SEC_TO_TIME':_0xaed5('0x5e'),'DATE':_0xaed5('0x5f'),'HOUR':_0xaed5('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2ef500=function(_0x523a88){return!_['includes']([_0xaed5('0x63'),_0xaed5('0x64'),_0xaed5('0x65'),_0xaed5('0x66')],_0x523a88);};var _0x559214=function(_0x48c450){if(!_0x48c450||!_0x48c450[_0xaed5('0x67')][_0xaed5('0x49')]){return'';}for(var _0x155f01='(',_0x5214bc=0x0;_0x5214bc<_0x48c450[_0xaed5('0x67')]['length'];_0x5214bc+=0x1){_0x5214bc>0x0&&(_0x155f01+='\x20'+_0x48c450[_0xaed5('0x87')]+'\x20');_0x155f01+=_0x48c450[_0xaed5('0x67')][_0x5214bc][_0xaed5('0x68')]?_0x559214(_0x48c450[_0xaed5('0x67')][_0x5214bc][_0xaed5('0x68')]):_0x48c450['rules'][_0x5214bc][_0xaed5('0x69')]+'\x20'+_0x48c450[_0xaed5('0x67')][_0x5214bc][_0xaed5('0x6a')]+(_0x2ef500(_0x48c450['rules'][_0x5214bc][_0xaed5('0x6a')])?'\x20'+_0x48c450[_0xaed5('0x67')][_0x5214bc][_0xaed5('0x6b')]:'');}return _0x155f01+')';};var _0x21a837={'where':{'id':_0x304d38[_0xaed5('0x54')]['id']}},_0x59058a,_0x51d4f1,_0x5aad3d,_0x4eceb7,_0x153077;_0x21a837=_[_0xaed5('0x41')]({},_0x21a837,_0x304d38[_0xaed5('0x43')]);return db[_0xaed5('0x2c')][_0xaed5('0x4a')](_0x21a837)[_0xaed5('0x26')](function(_0x41623c){if(_0x41623c){_0x59058a=_0x41623c;return _0x41623c['getFields']();}return null;})[_0xaed5('0x26')](function(_0x3de961){if(_0x3de961){if(!_0x3de961[_0xaed5('0x49')]){throw new db[(_0xaed5('0x6d'))][(_0xaed5('0x6e'))](_0xaed5('0x88'),0x193);}_0x51d4f1=_0x3de961;return db[_0xaed5('0x6f')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x37bf5c){if(_0x37bf5c){_0x5aad3d=_[_0xaed5('0x70')](_0x37bf5c,'id');var _0x2f4543;var _0x1d4ca4=squel[_0xaed5('0x89')]();_0x1d4ca4[_0xaed5('0x8a')](_0x59058a[_0xaed5('0x71')]);for(var _0x30be31=0x0;_0x30be31<_0x51d4f1[_0xaed5('0x49')];_0x30be31+=0x1){_0x2f4543=_0x51d4f1[_0x30be31][_0xaed5('0x72')]?_0x5aad3d[_0x51d4f1[_0x30be31][_0xaed5('0x72')]][_0xaed5('0x8b')]:_0x51d4f1[_0x30be31]['field'];_0x2f4543=_0x51d4f1[_0x30be31][_0xaed5('0x73')]?_['replace'](_0x3cccdb[_0x51d4f1[_0x30be31]['function']],'%s',_0x2f4543):_0x2f4543;_0x2f4543=_0x51d4f1[_0x30be31][_0xaed5('0x7c')]?_[_0xaed5('0x74')](_0x1e57b4[_0x51d4f1[_0x30be31][_0xaed5('0x7c')]],'%s',_0x2f4543):_0x2f4543;if(_0x51d4f1[_0x30be31]['groupBy']){_0x1d4ca4[_0xaed5('0x68')](_0x2f4543);}_0x51d4f1[_0x30be31][_0xaed5('0x75')]&&_0x1d4ca4[_0xaed5('0x3c')](_0x2f4543,_0x51d4f1[_0x30be31]['orderBy']===_0xaed5('0x76')?![]:!![]);_0x1d4ca4[_0xaed5('0x69')](_0x2f4543,_0x51d4f1[_0x30be31][_0xaed5('0x77')]||_0x2f4543);}if(_0x59058a['joins']){_0x59058a[_0xaed5('0x78')]=JSON['parse'](_0x59058a['joins']);for(var _0x455109=0x0;_0x455109<_0x59058a[_0xaed5('0x78')][_0xaed5('0x49')];_0x455109+=0x1){if(_0x59058a[_0xaed5('0x78')][_0x455109][_0xaed5('0x2f')]&&_['includes'](_0x97e1ad,_0x59058a[_0xaed5('0x78')][_0x455109]['type'])&&_0x59058a[_0xaed5('0x78')][_0x455109][_0xaed5('0x79')]&&_0x59058a[_0xaed5('0x78')][_0x455109][_0xaed5('0x7b')]&&_0x59058a['joins'][_0x455109][_0xaed5('0x7a')]){_0x1d4ca4[_0x59058a[_0xaed5('0x78')][_0x455109][_0xaed5('0x2f')]](_0x59058a[_0xaed5('0x78')][_0x455109][_0xaed5('0x7b')],null,util[_0xaed5('0x7c')](_0xaed5('0x8d'),_0x59058a['table'],_0x59058a[_0xaed5('0x78')][_0x455109][_0xaed5('0x79')],_0x59058a[_0xaed5('0x78')][_0x455109][_0xaed5('0x7b')],_0x59058a[_0xaed5('0x78')][_0x455109][_0xaed5('0x7a')]));}}}if(_0x59058a[_0xaed5('0x7d')]){_0x59058a[_0xaed5('0x7d')]=JSON['parse'](_0x59058a['conditions']);_0x1d4ca4[_0xaed5('0x3e')](_0x559214(_0x59058a[_0xaed5('0x7d')][_0xaed5('0x68')]));}_0x153077=_0x1d4ca4[_0xaed5('0x7e')]();_0x1d4ca4[_0xaed5('0x3b')](_0x2002f9);_0x1d4ca4[_0xaed5('0x1b')](0x0);logger[_0xaed5('0x7f')](_0xaed5('0xa6'),_0x1d4ca4[_0xaed5('0x80')]());return dbH['sequelize']['query'](_0x1d4ca4[_0xaed5('0x80')](),{'type':dbH[_0xaed5('0x81')]['QueryTypes'][_0xaed5('0xa3')]});}})['then'](function(){return{'sql':_0x153077[_0xaed5('0x80')]()};})[_0xaed5('0x26')](respondWithResult(_0x2292d5,null))[_0xaed5('0x47')](handleError(_0x2292d5,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 9098a80..4b2f7eb 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 _0xb603=['request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','define','util','api','bluebird'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xb603,0x7b));var _0x3b60=function(_0x4c440b,_0x3ea627){_0x4c440b=_0x4c440b-0x0;var _0x2d48cf=_0xb603[_0x4c440b];return _0x2d48cf;};'use strict';var _=require('lodash');var util=require(_0x3b60('0x0'));var logger=require('../../config/logger')(_0x3b60('0x1'));var moment=require('moment');var BPromise=require(_0x3b60('0x2'));var rp=require(_0x3b60('0x3'));var fs=require('fs');var path=require(_0x3b60('0x4'));var rimraf=require(_0x3b60('0x5'));var config=require(_0x3b60('0x6'));var attributes=require(_0x3b60('0x7'));module['exports']=function(_0x49596b,_0x4fec35){return _0x49596b[_0x3b60('0x8')]('AnalyticCustomReport',attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7f35=['analytics_custom_reports','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','AnalyticCustomReport'];(function(_0x28a74b,_0x256e2f){var _0x313a33=function(_0x2cfe45){while(--_0x2cfe45){_0x28a74b['push'](_0x28a74b['shift']());}};_0x313a33(++_0x256e2f);}(_0x7f35,0x1ed));var _0x57f3=function(_0x37a507,_0x16580a){_0x37a507=_0x37a507-0x0;var _0x368a1a=_0x7f35[_0x37a507];return _0x368a1a;};'use strict';var _=require(_0x57f3('0x0'));var util=require(_0x57f3('0x1'));var logger=require(_0x57f3('0x2'))('api');var moment=require(_0x57f3('0x3'));var BPromise=require(_0x57f3('0x4'));var rp=require(_0x57f3('0x5'));var fs=require('fs');var path=require(_0x57f3('0x6'));var rimraf=require(_0x57f3('0x7'));var config=require(_0x57f3('0x8'));var attributes=require(_0x57f3('0x9'));module['exports']=function(_0x31fdd2,_0x41fc27){return _0x31fdd2['define'](_0x57f3('0xa'),attributes,{'tableName':_0x57f3('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 7a61ebe..c647f1a 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 _0xd25c=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticCustomReport,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x49d5a6,_0x3a1f12){var _0x56d4fa=function(_0x1faeb8){while(--_0x1faeb8){_0x49d5a6['push'](_0x49d5a6['shift']());}};_0x56d4fa(++_0x3a1f12);}(_0xd25c,0x11a));var _0xcd25=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xd25c[_0x4243a3];return _0x1b2a33;};'use strict';var _=require(_0xcd25('0x0'));var util=require('util');var moment=require(_0xcd25('0x1'));var BPromise=require(_0xcd25('0x2'));var rs=require(_0xcd25('0x3'));var fs=require('fs');var Redis=require(_0xcd25('0x4'));var db=require(_0xcd25('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcd25('0x6'))(_0xcd25('0x7'));var config=require(_0xcd25('0x8'));var jayson=require(_0xcd25('0x9'));var client=jayson[_0xcd25('0xa')][_0xcd25('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ce790,_0x57c19f,_0x3bba6f){return new BPromise(function(_0x2fc27e,_0x5c031c){return client[_0xcd25('0xc')](_0x4ce790,_0x3bba6f)['then'](function(_0x15c5e7){logger[_0xcd25('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0x57c19f,_0xcd25('0xe'));logger[_0xcd25('0xf')](_0xcd25('0x10'),_0x57c19f,_0xcd25('0xe'),JSON[_0xcd25('0x11')](_0x15c5e7));if(_0x15c5e7[_0xcd25('0x12')]){if(_0x15c5e7['error'][_0xcd25('0x13')]===0x1f4){logger[_0xcd25('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x57c19f,_0x15c5e7[_0xcd25('0x12')][_0xcd25('0x14')]);return _0x5c031c(_0x15c5e7[_0xcd25('0x12')]['message']);}logger[_0xcd25('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x57c19f,_0x15c5e7[_0xcd25('0x12')]['message']);return _0x2fc27e(_0x15c5e7[_0xcd25('0x12')][_0xcd25('0x14')]);}else{logger['info'](_0xcd25('0x15'),_0x57c19f,_0xcd25('0xe'));_0x2fc27e(_0x15c5e7[_0xcd25('0x16')][_0xcd25('0x14')]);}})[_0xcd25('0x17')](function(_0x25bf0d){logger[_0xcd25('0x12')](_0xcd25('0x15'),_0x57c19f,_0x25bf0d);_0x5c031c(_0x25bf0d);});});}
\ No newline at end of file
+var _0x8253=['request','then','info','debug','error','code','AnalyticCustomReport,\x20%s,\x20%s','message','request\x20sent','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise'];(function(_0x5cd883,_0x3d1e2a){var _0x23bace=function(_0x16293a){while(--_0x16293a){_0x5cd883['push'](_0x5cd883['shift']());}};_0x23bace(++_0x3d1e2a);}(_0x8253,0x1a2));var _0x3825=function(_0x451980,_0x2ad060){_0x451980=_0x451980-0x0;var _0x3a66cf=_0x8253[_0x451980];return _0x3a66cf;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3825('0x0'));var BPromise=require(_0x3825('0x1'));var rs=require(_0x3825('0x2'));var fs=require('fs');var Redis=require(_0x3825('0x3'));var db=require(_0x3825('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x3825('0x5'));var jayson=require(_0x3825('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x28521b,_0x2005fb,_0x3b8690){return new BPromise(function(_0x2fb04d,_0x1c0847){return client[_0x3825('0x7')](_0x28521b,_0x3b8690)[_0x3825('0x8')](function(_0x2b3245){logger[_0x3825('0x9')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2005fb,'request\x20sent');logger[_0x3825('0xa')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x2005fb,'request\x20sent',JSON['stringify'](_0x2b3245));if(_0x2b3245['error']){if(_0x2b3245[_0x3825('0xb')][_0x3825('0xc')]===0x1f4){logger[_0x3825('0xb')](_0x3825('0xd'),_0x2005fb,_0x2b3245[_0x3825('0xb')]['message']);return _0x1c0847(_0x2b3245[_0x3825('0xb')][_0x3825('0xe')]);}logger[_0x3825('0xb')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2005fb,_0x2b3245[_0x3825('0xb')]['message']);return _0x2fb04d(_0x2b3245['error'][_0x3825('0xe')]);}else{logger[_0x3825('0x9')](_0x3825('0xd'),_0x2005fb,_0x3825('0xf'));_0x2fb04d(_0x2b3245['result'][_0x3825('0xe')]);}})[_0x3825('0x10')](function(_0x2d4e4a){logger[_0x3825('0xb')](_0x3825('0xd'),_0x2005fb,_0x2d4e4a);_0x1c0847(_0x2d4e4a);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 7d60f32..33f31fd 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 _0x2853=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','get','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','update','destroy','exports'];(function(_0x4a7cb9,_0x42df8c){var _0x4bfd62=function(_0x5016b5){while(--_0x5016b5){_0x4a7cb9['push'](_0x4a7cb9['shift']());}};_0x4bfd62(++_0x42df8c);}(_0x2853,0xea));var _0x3285=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x2853[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require('multer');var util=require(_0x3285('0x0'));var path=require(_0x3285('0x1'));var timeout=require(_0x3285('0x2'));var express=require(_0x3285('0x3'));var router=express[_0x3285('0x4')]();var fs_extra=require(_0x3285('0x5'));var auth=require(_0x3285('0x6'));var interaction=require(_0x3285('0x7'));var config=require(_0x3285('0x8'));var controller=require(_0x3285('0x9'));router['get']('/',auth[_0x3285('0xa')](),controller['index']);router[_0x3285('0xb')](_0x3285('0xc'),auth[_0x3285('0xa')](),controller[_0x3285('0xd')]);router[_0x3285('0xb')](_0x3285('0xe'),auth[_0x3285('0xa')](),controller[_0x3285('0xf')]);router[_0x3285('0xb')](_0x3285('0x10'),auth[_0x3285('0xa')](),controller[_0x3285('0x11')]);router['get'](_0x3285('0x12'),auth[_0x3285('0xa')](),controller[_0x3285('0x13')]);router[_0x3285('0x14')]('/',auth[_0x3285('0xa')](),controller[_0x3285('0x15')]);router[_0x3285('0x16')](_0x3285('0xc'),auth[_0x3285('0xa')](),controller[_0x3285('0x17')]);router['delete']('/:id',auth[_0x3285('0xa')](),controller[_0x3285('0x18')]);module[_0x3285('0x19')]=router;
\ No newline at end of file
+var _0xd5c7=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','query','post','update','delete','destroy'];(function(_0x1e7edc,_0x4394c3){var _0x56dcae=function(_0x5208c8){while(--_0x5208c8){_0x1e7edc['push'](_0x1e7edc['shift']());}};_0x56dcae(++_0x4394c3);}(_0xd5c7,0x180));var _0x7d5c=function(_0x1c7e28,_0x30ea10){_0x1c7e28=_0x1c7e28-0x0;var _0x25f956=_0xd5c7[_0x1c7e28];return _0x25f956;};'use strict';var multer=require(_0x7d5c('0x0'));var util=require('util');var path=require(_0x7d5c('0x1'));var timeout=require(_0x7d5c('0x2'));var express=require(_0x7d5c('0x3'));var router=express[_0x7d5c('0x4')]();var fs_extra=require(_0x7d5c('0x5'));var auth=require(_0x7d5c('0x6'));var interaction=require(_0x7d5c('0x7'));var config=require(_0x7d5c('0x8'));var controller=require(_0x7d5c('0x9'));router[_0x7d5c('0xa')]('/',auth[_0x7d5c('0xb')](),controller[_0x7d5c('0xc')]);router[_0x7d5c('0xa')](_0x7d5c('0xd'),auth[_0x7d5c('0xb')](),controller[_0x7d5c('0xe')]);router[_0x7d5c('0xa')](_0x7d5c('0xf'),auth[_0x7d5c('0xb')](),controller[_0x7d5c('0x10')]);router[_0x7d5c('0xa')](_0x7d5c('0x11'),auth['isAuthenticated'](),controller[_0x7d5c('0x12')]);router[_0x7d5c('0xa')]('/:id/query',auth[_0x7d5c('0xb')](),controller[_0x7d5c('0x13')]);router[_0x7d5c('0x14')]('/',auth[_0x7d5c('0xb')](),controller['create']);router['put']('/:id',auth[_0x7d5c('0xb')](),controller[_0x7d5c('0x15')]);router[_0x7d5c('0x16')](_0x7d5c('0xd'),auth[_0x7d5c('0xb')](),controller[_0x7d5c('0x17')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 4256745..7825041 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 _0x3eea=['STRING','TEXT','sequelize'];(function(_0x433ab5,_0x16e711){var _0x315911=function(_0x2d24a2){while(--_0x2d24a2){_0x433ab5['push'](_0x433ab5['shift']());}};_0x315911(++_0x16e711);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x850605,_0x278e88){_0x850605=_0x850605-0x0;var _0x7eafa1=_0x3eea[_0x850605];return _0x7eafa1;};'use strict';var Sequelize=require(_0xa3ee('0x0'));module['exports']={'name':{'type':Sequelize[_0xa3ee('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa3ee('0x1')]},'parent':{'type':Sequelize[_0xa3ee('0x1')]},'table':{'type':Sequelize[_0xa3ee('0x1')]},'conditions':{'type':Sequelize[_0xa3ee('0x2')]},'joins':{'type':Sequelize[_0xa3ee('0x2')]}};
\ No newline at end of file
+var _0x8ef6=['STRING','TEXT','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8ef6,0xf2));var _0x68ef=function(_0x35cb74,_0x141a20){_0x35cb74=_0x35cb74-0x0;var _0x48acbf=_0x8ef6[_0x35cb74];return _0x48acbf;};'use strict';var Sequelize=require(_0x68ef('0x0'));module[_0x68ef('0x1')]={'name':{'type':Sequelize[_0x68ef('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x68ef('0x2')]},'parent':{'type':Sequelize[_0x68ef('0x2')]},'table':{'type':Sequelize[_0x68ef('0x2')]},'conditions':{'type':Sequelize[_0x68ef('0x3')]},'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 5f46351..5e18100 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 _0xabce=['where','findAll','show','includeAll','options','find','catch','create','body','user','role','Reports','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','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','operator','group','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','table','MetricId','field','function','replace','format','groupBy','orderBy','joins','parse','includes','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','SELECT','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','ValidationErrorItem','AnalyticMetric','keyBy','select','metric','DESC','foreignKey','output','web','%s-%s.%s','default','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','from','countTable','COUNT(*)','sequelize','QueryTypes','run','runReport','Sequelize','alias','clone','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','limit','undefined','count','set','json','apply','save','update','then','get','DefaultReports','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','filter','merge'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xabce,0x103));var _0xeabc=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xabce[_0x3899d1];return _0xeb4a7d;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];var dbH=require(_0xeabc('0x19'))[_0xeabc('0x1a')];function respondWithStatusCode(_0xcfbf06,_0x53df9c){_0x53df9c=_0x53df9c||0xcc;return function(_0x235c2d){if(_0x235c2d){return _0xcfbf06[_0xeabc('0x1b')](_0x53df9c);}return _0xcfbf06[_0xeabc('0x1c')](_0x53df9c)['end']();};}function respondWithResult(_0x5f4ee8,_0x3170ea){_0x3170ea=_0x3170ea||0xc8;return function(_0x3ae954){if(_0x3ae954){return _0x5f4ee8[_0xeabc('0x1c')](_0x3170ea)['json'](_0x3ae954);}};}function respondWithFilteredResult(_0xf913d7,_0x638976){return function(_0x49f2d8){if(_0x49f2d8){var _0x53fe28=typeof _0x638976[_0xeabc('0x1d')]==='undefined'&&typeof _0x638976[_0xeabc('0x1e')]===_0xeabc('0x1f');var _0x58a3c0=_0x49f2d8[_0xeabc('0x20')];var _0x31dd53=_0x53fe28?0x0:_0x638976[_0xeabc('0x1d')];var _0x384be5=_0x53fe28?_0x49f2d8[_0xeabc('0x20')]:_0x638976['offset']+_0x638976[_0xeabc('0x1e')];var _0x4d68ea;if(_0x384be5>=_0x58a3c0){_0x384be5=_0x58a3c0;_0x4d68ea=0xc8;}else{_0x4d68ea=0xce;}_0xf913d7[_0xeabc('0x1c')](_0x4d68ea);return _0xf913d7[_0xeabc('0x21')]('Content-Range',_0x31dd53+'-'+_0x384be5+'/'+_0x58a3c0)[_0xeabc('0x22')](_0x49f2d8);}return null;};}function patchUpdates(_0x41d67a){return function(_0x254590){try{jsonpatch[_0xeabc('0x23')](_0x254590,_0x41d67a,!![]);}catch(_0x3c9611){return BPromise['reject'](_0x3c9611);}return _0x254590[_0xeabc('0x24')]();};}function saveUpdates(_0x10c675,_0x91ab00){return function(_0x5bdd57){if(_0x5bdd57){return _0x5bdd57[_0xeabc('0x25')](_0x10c675)[_0xeabc('0x26')](function(_0x214953){return _0x214953;});}return null;};}function removeEntity(_0x319119,_0x5b8838){return function(_0x109e1d){if(_0x109e1d){return _0x109e1d['destroy']()[_0xeabc('0x26')](function(){var _0x4d4e29=_0x109e1d[_0xeabc('0x27')]({'plain':!![]});var _0x12acbd=_0xeabc('0x28');return db[_0xeabc('0x29')][_0xeabc('0x2a')]({'where':{'type':_0x12acbd,'resourceId':_0x4d4e29['id']}})[_0xeabc('0x26')](function(){return _0x109e1d;});})[_0xeabc('0x26')](function(){_0x319119['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x459c8a,_0x5bf8f2){return function(_0x3c1b5b){if(!_0x3c1b5b){_0x459c8a[_0xeabc('0x1b')](0x194);}return _0x3c1b5b;};}function handleError(_0x48fb52,_0x2163e6){_0x2163e6=_0x2163e6||0x1f4;return function(_0x38572d){logger[_0xeabc('0x2b')](_0x38572d[_0xeabc('0x2c')]);if(_0x38572d[_0xeabc('0x2d')]){delete _0x38572d[_0xeabc('0x2d')];}_0x48fb52[_0xeabc('0x1c')](_0x2163e6)[_0xeabc('0x2e')](_0x38572d);};}exports[_0xeabc('0x2f')]=function(_0x5ebb86,_0x5b34dd){var _0x5bb1f1={},_0x2f03e8={},_0x2d027e={'count':0x0,'rows':[]};var _0x98b445=_[_0xeabc('0x30')](db[_0xeabc('0x31')][_0xeabc('0x32')],function(_0x61c0af){return{'name':_0x61c0af['fieldName'],'type':_0x61c0af[_0xeabc('0x33')][_0xeabc('0x34')]};});_0x2f03e8[_0xeabc('0x35')]=_['map'](_0x98b445,_0xeabc('0x2d'));_0x2f03e8[_0xeabc('0x36')]=_[_0xeabc('0x37')](_0x5ebb86['query']);_0x2f03e8[_0xeabc('0x38')]=_[_0xeabc('0x39')](_0x2f03e8[_0xeabc('0x35')],_0x2f03e8['query']);_0x5bb1f1[_0xeabc('0x3a')]=_[_0xeabc('0x39')](_0x2f03e8['model'],qs['fields'](_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x3b')]));_0x5bb1f1['attributes']=_0x5bb1f1[_0xeabc('0x3a')][_0xeabc('0x3c')]?_0x5bb1f1[_0xeabc('0x3a')]:_0x2f03e8[_0xeabc('0x35')];if(!_0x5ebb86[_0xeabc('0x36')]['hasOwnProperty'](_0xeabc('0x3d'))){_0x5bb1f1['limit']=qs[_0xeabc('0x1e')](_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x1e')]);_0x5bb1f1['offset']=qs['offset'](_0x5ebb86[_0xeabc('0x36')]['offset']);}_0x5bb1f1[_0xeabc('0x3e')]=qs['sort'](_0x5ebb86['query']['sort']);_0x5bb1f1['where']=qs[_0xeabc('0x38')](_['pick'](_0x5ebb86[_0xeabc('0x36')],_0x2f03e8[_0xeabc('0x38')]),_0x98b445);if(_0x5ebb86['query'][_0xeabc('0x3f')]){_0x5bb1f1['where']=_[_0xeabc('0x40')](_0x5bb1f1['where'],{'$or':_[_0xeabc('0x30')](_0x98b445,function(_0xf1b7ef){if(_0xf1b7ef[_0xeabc('0x33')]!=='VIRTUAL'){var _0x5a00d0={};_0x5a00d0[_0xf1b7ef['name']]={'$like':'%'+_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x3f')]+'%'};return _0x5a00d0;}})});}_0x5bb1f1=_[_0xeabc('0x40')]({},_0x5bb1f1,_0x5ebb86['options']);var _0x4f1897={'where':_0x5bb1f1[_0xeabc('0x41')]};return db[_0xeabc('0x31')]['count'](_0x4f1897)[_0xeabc('0x26')](function(_0x5e0b78){_0x2d027e[_0xeabc('0x20')]=_0x5e0b78;if(_0x5ebb86['query']['includeAll']){_0x5bb1f1['include']=[{'all':!![]}];}return db[_0xeabc('0x31')][_0xeabc('0x42')](_0x5bb1f1);})[_0xeabc('0x26')](function(_0x3eeeb5){_0x2d027e['rows']=_0x3eeeb5;return _0x2d027e;})[_0xeabc('0x26')](respondWithFilteredResult(_0x5b34dd,_0x5bb1f1))['catch'](handleError(_0x5b34dd,null));};exports[_0xeabc('0x43')]=function(_0x1a4bbe,_0x3a7807){var _0x17a0df={'raw':!![],'where':{'id':_0x1a4bbe['params']['id']}},_0xc849c9={};_0xc849c9['model']=_[_0xeabc('0x37')](db['AnalyticDefaultReport'][_0xeabc('0x32')]);_0xc849c9[_0xeabc('0x36')]=_['keys'](_0x1a4bbe[_0xeabc('0x36')]);_0xc849c9[_0xeabc('0x38')]=_[_0xeabc('0x39')](_0xc849c9[_0xeabc('0x35')],_0xc849c9[_0xeabc('0x36')]);_0x17a0df[_0xeabc('0x3a')]=_[_0xeabc('0x39')](_0xc849c9['model'],qs[_0xeabc('0x3b')](_0x1a4bbe[_0xeabc('0x36')][_0xeabc('0x3b')]));_0x17a0df[_0xeabc('0x3a')]=_0x17a0df[_0xeabc('0x3a')][_0xeabc('0x3c')]?_0x17a0df[_0xeabc('0x3a')]:_0xc849c9[_0xeabc('0x35')];if(_0x1a4bbe[_0xeabc('0x36')][_0xeabc('0x44')]){_0x17a0df['include']=[{'all':!![]}];}_0x17a0df=_[_0xeabc('0x40')]({},_0x17a0df,_0x1a4bbe[_0xeabc('0x45')]);return db[_0xeabc('0x31')][_0xeabc('0x46')](_0x17a0df)[_0xeabc('0x26')](handleEntityNotFound(_0x3a7807,null))[_0xeabc('0x26')](respondWithResult(_0x3a7807,null))[_0xeabc('0x47')](handleError(_0x3a7807,null));};exports['create']=function(_0x766743,_0x32e09b){return db[_0xeabc('0x31')][_0xeabc('0x48')](_0x766743[_0xeabc('0x49')],{})['then'](function(_0x305946){var _0x2b2b9c=_0x766743[_0xeabc('0x4a')][_0xeabc('0x27')]({'plain':!![]});if(!_0x2b2b9c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b2b9c[_0xeabc('0x4b')]===_0xeabc('0x4a')){var _0x568847=_0x305946[_0xeabc('0x27')]({'plain':!![]});var _0x5a0d4d=_0xeabc('0x4c');return db['UserProfileSection'][_0xeabc('0x46')]({'where':{'name':_0x5a0d4d,'userProfileId':_0x2b2b9c[_0xeabc('0x4d')]},'raw':!![]})[_0xeabc('0x26')](function(_0x1524c3){if(_0x1524c3&&_0x1524c3[_0xeabc('0x4e')]===0x0){return db[_0xeabc('0x29')][_0xeabc('0x48')]({'name':_0x568847[_0xeabc('0x2d')],'resourceId':_0x568847['id'],'type':_0xeabc('0x28'),'sectionId':_0x1524c3['id']},{})[_0xeabc('0x26')](function(){return _0x305946;});}else{return _0x305946;}})['catch'](function(_0x180a14){logger[_0xeabc('0x2b')](_0xeabc('0x4f'),_0x180a14);throw _0x180a14;});}return _0x305946;})[_0xeabc('0x26')](respondWithResult(_0x32e09b,0xc9))['catch'](handleError(_0x32e09b,null));};exports[_0xeabc('0x25')]=function(_0x392913,_0x10d56f){if(_0x392913[_0xeabc('0x49')]['id']){delete _0x392913['body']['id'];}return db[_0xeabc('0x31')][_0xeabc('0x46')]({'where':{'id':_0x392913[_0xeabc('0x50')]['id']}})[_0xeabc('0x26')](handleEntityNotFound(_0x10d56f,null))[_0xeabc('0x26')](saveUpdates(_0x392913[_0xeabc('0x49')],null))[_0xeabc('0x26')](respondWithResult(_0x10d56f,null))[_0xeabc('0x47')](handleError(_0x10d56f,null));};exports[_0xeabc('0x2a')]=function(_0x58ab08,_0x4546c4){return db['AnalyticDefaultReport']['find']({'where':{'id':_0x58ab08['params']['id']}})[_0xeabc('0x26')](handleEntityNotFound(_0x4546c4,null))[_0xeabc('0x26')](removeEntity(_0x4546c4,null))[_0xeabc('0x47')](handleError(_0x4546c4,null));};exports[_0xeabc('0x51')]=function(_0xe89728,_0x2f78f3){var _0x4a2ad6=0xa;var _0x4358d7=[_0xeabc('0x52'),_0xeabc('0x53'),_0xeabc('0x54'),_0xeabc('0x55')];var _0x2c7b4e={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xeabc('0x58'),'AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x536f42={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':_0xeabc('0x5e'),'UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x26c784=function(_0xc2ef0c){return!_['includes']([_0xeabc('0x60'),_0xeabc('0x61'),_0xeabc('0x62'),_0xeabc('0x63')],_0xc2ef0c);};var _0x11cc1f=function(_0x514787){if(!_0x514787||!_0x514787['rules'][_0xeabc('0x3c')]){return'';}for(var _0x7b659f='(',_0x1b6675=0x0;_0x1b6675<_0x514787[_0xeabc('0x64')][_0xeabc('0x3c')];_0x1b6675+=0x1){_0x1b6675>0x0&&(_0x7b659f+='\x20'+_0x514787[_0xeabc('0x65')]+'\x20');_0x7b659f+=_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x66')]?_0x11cc1f(_0x514787[_0xeabc('0x64')][_0x1b6675]['group']):_0x514787[_0xeabc('0x64')][_0x1b6675]['field']+'\x20'+_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x67')]+(_0x26c784(_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x67')])?'\x20'+_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x68')]:'');}return _0x7b659f+')';};var _0xf48062={'where':{'id':_0xe89728[_0xeabc('0x50')]['id']}},_0xb59a2a,_0x5d4bc2,_0x24d0e5,_0x5702cb,_0x3fa31b;_0xf48062=_[_0xeabc('0x40')]({},_0xf48062,_0xe89728[_0xeabc('0x45')]);return db['AnalyticDefaultReport'][_0xeabc('0x46')](_0xf48062)['then'](function(_0x54e7d6){if(_0x54e7d6){_0xb59a2a=_0x54e7d6;return _0x54e7d6[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x23270a){if(_0x23270a){if(!_0x23270a[_0xeabc('0x3c')]){throw new db['Sequelize']['ValidationErrorItem'](_0xeabc('0x6a'),0x193);}_0x5d4bc2=_0x23270a;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xeabc('0x26')](function(_0x4f1a4f){if(_0x4f1a4f){_0x24d0e5=_['keyBy'](_0x4f1a4f,'id');var _0xa44f2d;var _0x1c84b5=squel['select']();_0x1c84b5['from'](_0xb59a2a[_0xeabc('0x6b')]);for(var _0x5d183a=0x0;_0x5d183a<_0x5d4bc2[_0xeabc('0x3c')];_0x5d183a+=0x1){_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x6c')]?_0x24d0e5[_0x5d4bc2[_0x5d183a]['MetricId']]['metric']:_0x5d4bc2[_0x5d183a][_0xeabc('0x6d')];_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x6e')]?_[_0xeabc('0x6f')](_0x2c7b4e[_0x5d4bc2[_0x5d183a][_0xeabc('0x6e')]],'%s',_0xa44f2d):_0xa44f2d;_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x70')]?_['replace'](_0x536f42[_0x5d4bc2[_0x5d183a]['format']],'%s',_0xa44f2d):_0xa44f2d;if(_0x5d4bc2[_0x5d183a][_0xeabc('0x71')]){_0x1c84b5['group'](_0xa44f2d);}_0x5d4bc2[_0x5d183a][_0xeabc('0x72')]&&_0x1c84b5['order'](_0xa44f2d,_0x5d4bc2[_0x5d183a][_0xeabc('0x72')]==='DESC'?![]:!![]);_0x1c84b5[_0xeabc('0x6d')](_0xa44f2d,_0x5d4bc2[_0x5d183a]['alias']||_0xa44f2d);}if(_0xb59a2a[_0xeabc('0x73')]){_0xb59a2a[_0xeabc('0x73')]=JSON[_0xeabc('0x74')](_0xb59a2a[_0xeabc('0x73')]);for(var _0x5e121c=0x0;_0x5e121c<_0xb59a2a[_0xeabc('0x73')]['length'];_0x5e121c+=0x1){if(_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')]&&_[_0xeabc('0x75')](_0x4358d7,_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')])&&_0xb59a2a['joins'][_0x5e121c][_0xeabc('0x76')]&&_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x77')]&&_0xb59a2a[_0xeabc('0x73')][_0x5e121c]['foreignKey']){_0x1c84b5[_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')]](_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x77')],null,util['format'](_0xeabc('0x78'),_0xb59a2a[_0xeabc('0x6b')],_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x76')],_0xb59a2a['joins'][_0x5e121c]['foreignTable'],_0xb59a2a[_0xeabc('0x73')][_0x5e121c]['foreignKey']));}}}if(_0xb59a2a['conditions']){_0xb59a2a[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0xb59a2a[_0xeabc('0x79')]);_0x1c84b5['where'](_0x11cc1f(_0xb59a2a[_0xeabc('0x79')][_0xeabc('0x66')]));}_0x3fa31b=_0x1c84b5['clone']();_0x1c84b5[_0xeabc('0x1e')](_0x4a2ad6);_0x1c84b5[_0xeabc('0x1d')](0x0);logger[_0xeabc('0x7a')](_0xeabc('0x7b'),_0x1c84b5[_0xeabc('0x7c')]());return dbH['sequelize'][_0xeabc('0x36')](_0x1c84b5['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0xeabc('0x7d')]});}})[_0xeabc('0x26')](respondWithResult(_0x2f78f3,null))[_0xeabc('0x47')](handleError(_0x2f78f3,null));};function runReport(_0x4424ce,_0x33fa74,_0x51368f){var _0x39f961=_0x33fa74['name'];var _0x1795fe=0xa;var _0x2f95c7=['join',_0xeabc('0x53'),'right_join','cross_join'];var _0x952dc7={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':_0xeabc('0x7e'),'MAX':_0xeabc('0x7f'),'MIN':'MIN(%s)','AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':_0xeabc('0x80'),'GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x348064={'SEC_TO_TIME':_0xeabc('0x81'),'DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':_0xeabc('0x5e'),'UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x522c6e=function(_0x436f8e){return!_[_0xeabc('0x75')]([_0xeabc('0x60'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xeabc('0x63')],_0x436f8e);};var _0x273ca5=function(_0xe90200){if(!_0xe90200||!_0xe90200[_0xeabc('0x64')][_0xeabc('0x3c')]){return'';}for(var _0x5f5a47='(',_0x289f98=0x0;_0x289f98<_0xe90200['rules']['length'];_0x289f98+=0x1){_0x289f98>0x0&&(_0x5f5a47+='\x20'+_0xe90200[_0xeabc('0x65')]+'\x20');_0x5f5a47+=_0xe90200[_0xeabc('0x64')][_0x289f98]['group']?_0x273ca5(_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x66')]):_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x6d')]+'\x20'+_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x67')]+(_0x522c6e(_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x67')])?'\x20'+_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x68')]:'');}return _0x5f5a47+')';};var _0x1f8197={'where':{'id':_0x4424ce['id']}},_0x485c13,_0xb54c35,_0x5c9d6f,_0x1caaa7,_0x3e764a;_0x1f8197=_[_0xeabc('0x40')]({},_0x1f8197,_0x51368f);return db[_0xeabc('0x31')][_0xeabc('0x46')](_0x1f8197)[_0xeabc('0x26')](function(_0x40f51e){if(_0x40f51e){_0x485c13=_0x40f51e;return _0x40f51e[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x156e20){if(_0x156e20){if(!_0x156e20[_0xeabc('0x3c')]){throw new db['Sequelize'][(_0xeabc('0x82'))](_0xeabc('0x6a'),0x193);}_0xb54c35=_0x156e20;return db[_0xeabc('0x83')][_0xeabc('0x42')]({'raw':!![]});}return null;})['then'](function(_0x26c595){if(_0x26c595){_0x5c9d6f=_[_0xeabc('0x84')](_0x26c595,'id');var _0x580661;var _0x3de927=squel[_0xeabc('0x85')]();_0x3de927['from'](_0x485c13['table']);for(var _0x489b1d=0x0;_0x489b1d<_0xb54c35['length'];_0x489b1d+=0x1){_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x6c')]?_0x5c9d6f[_0xb54c35[_0x489b1d][_0xeabc('0x6c')]][_0xeabc('0x86')]:_0xb54c35[_0x489b1d][_0xeabc('0x6d')];_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x6e')]?_[_0xeabc('0x6f')](_0x952dc7[_0xb54c35[_0x489b1d][_0xeabc('0x6e')]],'%s',_0x580661):_0x580661;_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x70')]?_[_0xeabc('0x6f')](_0x348064[_0xb54c35[_0x489b1d][_0xeabc('0x70')]],'%s',_0x580661):_0x580661;if(_0xb54c35[_0x489b1d]['groupBy']){_0x3de927[_0xeabc('0x66')](_0x580661);}_0xb54c35[_0x489b1d][_0xeabc('0x72')]&&_0x3de927['order'](_0x580661,_0xb54c35[_0x489b1d][_0xeabc('0x72')]===_0xeabc('0x87')?![]:!![]);_0x3de927[_0xeabc('0x6d')](_0x580661,_0xb54c35[_0x489b1d]['alias']||_0x580661);}if(_0x485c13[_0xeabc('0x73')]){_0x485c13['joins']=JSON[_0xeabc('0x74')](_0x485c13[_0xeabc('0x73')]);for(var _0x1841f0=0x0;_0x1841f0<_0x485c13[_0xeabc('0x73')][_0xeabc('0x3c')];_0x1841f0+=0x1){if(_0x485c13['joins'][_0x1841f0]['type']&&_['includes'](_0x2f95c7,_0x485c13['joins'][_0x1841f0][_0xeabc('0x33')])&&_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x76')]&&_0x485c13['joins'][_0x1841f0][_0xeabc('0x77')]&&_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x88')]){_0x3de927[_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x33')]](_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x77')],null,util[_0xeabc('0x70')](_0xeabc('0x78'),_0x485c13[_0xeabc('0x6b')],_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x76')],_0x485c13['joins'][_0x1841f0]['foreignTable'],_0x485c13[_0xeabc('0x73')][_0x1841f0]['foreignKey']));}}}if(_0x485c13[_0xeabc('0x79')]){_0x485c13[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0x485c13['conditions']);_0x3de927[_0xeabc('0x41')](_0x273ca5(_0x485c13[_0xeabc('0x79')][_0xeabc('0x66')]));}_0x3e764a=_0x3de927['clone']();_0x3de927['limit'](_0x1795fe);_0x3de927[_0xeabc('0x1d')](0x0);return;}})[_0xeabc('0x26')](function(){if(_0x33fa74[_0xeabc('0x89')]===_0xeabc('0x8a')){return null;}var _0x2cc9b3=_[_0xeabc('0x40')](_0x33fa74,{'name':_0x33fa74['fullPath']||_0x33fa74['name']||_0x485c13[_0xeabc('0x2d')],'basename':_0x39f961,'savename':util[_0xeabc('0x70')](_0xeabc('0x8b'),_0x33fa74[_0xeabc('0x2d')]||_0x485c13['name'],require('randomstring')['generate'](0x4),_0x33fa74[_0xeabc('0x89')]||'csv'),'reportId':_0x485c13['id'],'reportType':_0xeabc('0x8c')});return db['AnalyticExtractedReport'][_0xeabc('0x48')](_0x2cc9b3,{'raw':!![]});})['then'](function(_0x6e6ab2){if(_0x485c13[_0xeabc('0x6b')]===_0xeabc('0x8d')){_0x3e764a[_0xeabc('0x41')](_0x485c13[_0xeabc('0x6b')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x33fa74[_0xeabc('0x8e')],_0x33fa74[_0xeabc('0x8f')]);}else{_0x3e764a[_0xeabc('0x41')](_0x485c13['table']+_0xeabc('0x90'),_0x33fa74[_0xeabc('0x8e')],_0x33fa74[_0xeabc('0x8f')]);}if(_0x6e6ab2){logger[_0xeabc('0x91')](_0xeabc('0x92'),_0x3e764a['toString']());require(_0xeabc('0x93'))[_0xeabc('0x94')](path['join'](__dirname,_0xeabc('0x95'),_0x6e6ab2[_0xeabc('0x89')]),[_0x6e6ab2['id'],_0x3e764a['toString'](),path[_0xeabc('0x52')](__dirname,_0xeabc('0x96'),_0x6e6ab2[_0xeabc('0x97')]),_0x39f961]);return _0x6e6ab2;}else{var _0x307d26=squel[_0xeabc('0x85')]();_0x307d26[_0xeabc('0x98')]('('+_0x3e764a[_0xeabc('0x7c')]()+')',_0xeabc('0x99'));_0x307d26[_0xeabc('0x6d')](_0xeabc('0x9a'),_0xeabc('0x20'));_0x3e764a[_0xeabc('0x1e')](_0x33fa74[_0xeabc('0x1e')]||_0x1795fe);_0x3e764a['offset'](_0x33fa74['offset']||0x0);return dbH[_0xeabc('0x9b')][_0xeabc('0x36')](_0x307d26[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')]['QueryTypes'][_0xeabc('0x7d')]})['then'](function(_0x49fba2){if(!_0x49fba2['length']){_0x1caaa7=0x0;}else{_0x1caaa7=_0x49fba2[0x0]['count']||0x0;}return dbH['sequelize']['query'](_0x3e764a[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')][_0xeabc('0x9c')][_0xeabc('0x7d')]});})[_0xeabc('0x26')](function(_0xe27492){return{'rows':_0xe27492||[],'count':_0x1caaa7};});}});}exports[_0xeabc('0x9d')]=function(_0x3eaedf,_0x44dc85){return runReport(_0x3eaedf['params'],_0x3eaedf[_0xeabc('0x36')],_0x3eaedf[_0xeabc('0x45')])[_0xeabc('0x26')](respondWithResult(_0x44dc85,null))[_0xeabc('0x47')](handleError(_0x44dc85,null));};exports[_0xeabc('0x9e')]=runReport;exports[_0xeabc('0x36')]=function(_0x2a29d7,_0x5bb5d6){var _0x3513ce=0xa;var _0x58cb5d=[_0xeabc('0x52'),_0xeabc('0x53'),'right_join',_0xeabc('0x55')];var _0x4c8bf3={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':_0xeabc('0x7e'),'MAX':_0xeabc('0x7f'),'MIN':_0xeabc('0x58'),'AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':_0xeabc('0x80'),'GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x484c75={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x580f72=function(_0x37907a){return!_[_0xeabc('0x75')]([_0xeabc('0x60'),_0xeabc('0x61'),_0xeabc('0x62'),_0xeabc('0x63')],_0x37907a);};var _0x57db6d=function(_0x13cc55){if(!_0x13cc55||!_0x13cc55['rules'][_0xeabc('0x3c')]){return'';}for(var _0x43b88e='(',_0x1fa464=0x0;_0x1fa464<_0x13cc55[_0xeabc('0x64')]['length'];_0x1fa464+=0x1){_0x1fa464>0x0&&(_0x43b88e+='\x20'+_0x13cc55[_0xeabc('0x65')]+'\x20');_0x43b88e+=_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x66')]?_0x57db6d(_0x13cc55['rules'][_0x1fa464][_0xeabc('0x66')]):_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x6d')]+'\x20'+_0x13cc55['rules'][_0x1fa464]['condition']+(_0x580f72(_0x13cc55['rules'][_0x1fa464]['condition'])?'\x20'+_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x68')]:'');}return _0x43b88e+')';};var _0x52e84f={'where':{'id':_0x2a29d7[_0xeabc('0x50')]['id']}},_0x12f024,_0x1d35da,_0x2695a4,_0x199251,_0x1899d6;_0x52e84f=_[_0xeabc('0x40')]({},_0x52e84f,_0x2a29d7[_0xeabc('0x45')]);return db[_0xeabc('0x31')]['find'](_0x52e84f)[_0xeabc('0x26')](function(_0x5bb015){if(_0x5bb015){_0x12f024=_0x5bb015;return _0x5bb015[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x438ce3){if(_0x438ce3){if(!_0x438ce3[_0xeabc('0x3c')]){throw new db[(_0xeabc('0x9f'))][(_0xeabc('0x82'))](_0xeabc('0x6a'),0x193);}_0x1d35da=_0x438ce3;return db['AnalyticMetric'][_0xeabc('0x42')]({'raw':!![]});}return null;})['then'](function(_0x475160){if(_0x475160){_0x2695a4=_['keyBy'](_0x475160,'id');var _0x10d66b;var _0x12a042=squel[_0xeabc('0x85')]();_0x12a042[_0xeabc('0x98')](_0x12f024[_0xeabc('0x6b')]);for(var _0x49bf0f=0x0;_0x49bf0f<_0x1d35da[_0xeabc('0x3c')];_0x49bf0f+=0x1){_0x10d66b=_0x1d35da[_0x49bf0f][_0xeabc('0x6c')]?_0x2695a4[_0x1d35da[_0x49bf0f][_0xeabc('0x6c')]][_0xeabc('0x86')]:_0x1d35da[_0x49bf0f][_0xeabc('0x6d')];_0x10d66b=_0x1d35da[_0x49bf0f]['function']?_[_0xeabc('0x6f')](_0x4c8bf3[_0x1d35da[_0x49bf0f][_0xeabc('0x6e')]],'%s',_0x10d66b):_0x10d66b;_0x10d66b=_0x1d35da[_0x49bf0f][_0xeabc('0x70')]?_[_0xeabc('0x6f')](_0x484c75[_0x1d35da[_0x49bf0f][_0xeabc('0x70')]],'%s',_0x10d66b):_0x10d66b;if(_0x1d35da[_0x49bf0f]['groupBy']){_0x12a042[_0xeabc('0x66')](_0x10d66b);}_0x1d35da[_0x49bf0f]['orderBy']&&_0x12a042[_0xeabc('0x3e')](_0x10d66b,_0x1d35da[_0x49bf0f][_0xeabc('0x72')]===_0xeabc('0x87')?![]:!![]);_0x12a042[_0xeabc('0x6d')](_0x10d66b,_0x1d35da[_0x49bf0f][_0xeabc('0xa0')]||_0x10d66b);}if(_0x12f024[_0xeabc('0x73')]){_0x12f024[_0xeabc('0x73')]=JSON[_0xeabc('0x74')](_0x12f024[_0xeabc('0x73')]);for(var _0x223a3=0x0;_0x223a3<_0x12f024['joins'][_0xeabc('0x3c')];_0x223a3+=0x1){if(_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x33')]&&_[_0xeabc('0x75')](_0x58cb5d,_0x12f024['joins'][_0x223a3][_0xeabc('0x33')])&&_0x12f024['joins'][_0x223a3]['parentKey']&&_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x77')]&&_0x12f024[_0xeabc('0x73')][_0x223a3]['foreignKey']){_0x12a042[_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x33')]](_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x77')],null,util[_0xeabc('0x70')]('%s.%s\x20=\x20%s.%s',_0x12f024[_0xeabc('0x6b')],_0x12f024[_0xeabc('0x73')][_0x223a3]['parentKey'],_0x12f024['joins'][_0x223a3][_0xeabc('0x77')],_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x88')]));}}}if(_0x12f024[_0xeabc('0x79')]){_0x12f024[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0x12f024[_0xeabc('0x79')]);_0x12a042[_0xeabc('0x41')](_0x57db6d(_0x12f024[_0xeabc('0x79')]['group']));}_0x1899d6=_0x12a042[_0xeabc('0xa1')]();_0x12a042['limit'](_0x3513ce);_0x12a042[_0xeabc('0x1d')](0x0);logger['debug'](_0xeabc('0x7b'),_0x12a042[_0xeabc('0x7c')]());return dbH[_0xeabc('0x9b')][_0xeabc('0x36')](_0x12a042[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')][_0xeabc('0x9c')][_0xeabc('0x7d')]});}})[_0xeabc('0x26')](function(){return{'sql':_0x1899d6[_0xeabc('0x7c')]()};})['then'](respondWithResult(_0x5bb5d6,null))['catch'](handleError(_0x5bb5d6,null));};
\ No newline at end of file
+var _0xabce=['where','findAll','show','includeAll','options','find','catch','create','body','user','role','Reports','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','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','operator','group','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','table','MetricId','field','function','replace','format','groupBy','orderBy','joins','parse','includes','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','SELECT','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','ValidationErrorItem','AnalyticMetric','keyBy','select','metric','DESC','foreignKey','output','web','%s-%s.%s','default','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','from','countTable','COUNT(*)','sequelize','QueryTypes','run','runReport','Sequelize','alias','clone','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','limit','undefined','count','set','json','apply','save','update','then','get','DefaultReports','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','filter','merge'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xabce,0x103));var _0xeabc=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xabce[_0xae7c2f];return _0x5d7001;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];var dbH=require(_0xeabc('0x19'))[_0xeabc('0x1a')];function respondWithStatusCode(_0xcfbf06,_0x53df9c){_0x53df9c=_0x53df9c||0xcc;return function(_0x235c2d){if(_0x235c2d){return _0xcfbf06[_0xeabc('0x1b')](_0x53df9c);}return _0xcfbf06[_0xeabc('0x1c')](_0x53df9c)['end']();};}function respondWithResult(_0x5f4ee8,_0x3170ea){_0x3170ea=_0x3170ea||0xc8;return function(_0x3ae954){if(_0x3ae954){return _0x5f4ee8[_0xeabc('0x1c')](_0x3170ea)['json'](_0x3ae954);}};}function respondWithFilteredResult(_0xf913d7,_0x638976){return function(_0x49f2d8){if(_0x49f2d8){var _0x53fe28=typeof _0x638976[_0xeabc('0x1d')]==='undefined'&&typeof _0x638976[_0xeabc('0x1e')]===_0xeabc('0x1f');var _0x58a3c0=_0x49f2d8[_0xeabc('0x20')];var _0x31dd53=_0x53fe28?0x0:_0x638976[_0xeabc('0x1d')];var _0x384be5=_0x53fe28?_0x49f2d8[_0xeabc('0x20')]:_0x638976['offset']+_0x638976[_0xeabc('0x1e')];var _0x4d68ea;if(_0x384be5>=_0x58a3c0){_0x384be5=_0x58a3c0;_0x4d68ea=0xc8;}else{_0x4d68ea=0xce;}_0xf913d7[_0xeabc('0x1c')](_0x4d68ea);return _0xf913d7[_0xeabc('0x21')]('Content-Range',_0x31dd53+'-'+_0x384be5+'/'+_0x58a3c0)[_0xeabc('0x22')](_0x49f2d8);}return null;};}function patchUpdates(_0x41d67a){return function(_0x254590){try{jsonpatch[_0xeabc('0x23')](_0x254590,_0x41d67a,!![]);}catch(_0x3c9611){return BPromise['reject'](_0x3c9611);}return _0x254590[_0xeabc('0x24')]();};}function saveUpdates(_0x10c675,_0x91ab00){return function(_0x5bdd57){if(_0x5bdd57){return _0x5bdd57[_0xeabc('0x25')](_0x10c675)[_0xeabc('0x26')](function(_0x214953){return _0x214953;});}return null;};}function removeEntity(_0x319119,_0x5b8838){return function(_0x109e1d){if(_0x109e1d){return _0x109e1d['destroy']()[_0xeabc('0x26')](function(){var _0x4d4e29=_0x109e1d[_0xeabc('0x27')]({'plain':!![]});var _0x12acbd=_0xeabc('0x28');return db[_0xeabc('0x29')][_0xeabc('0x2a')]({'where':{'type':_0x12acbd,'resourceId':_0x4d4e29['id']}})[_0xeabc('0x26')](function(){return _0x109e1d;});})[_0xeabc('0x26')](function(){_0x319119['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x459c8a,_0x5bf8f2){return function(_0x3c1b5b){if(!_0x3c1b5b){_0x459c8a[_0xeabc('0x1b')](0x194);}return _0x3c1b5b;};}function handleError(_0x48fb52,_0x2163e6){_0x2163e6=_0x2163e6||0x1f4;return function(_0x38572d){logger[_0xeabc('0x2b')](_0x38572d[_0xeabc('0x2c')]);if(_0x38572d[_0xeabc('0x2d')]){delete _0x38572d[_0xeabc('0x2d')];}_0x48fb52[_0xeabc('0x1c')](_0x2163e6)[_0xeabc('0x2e')](_0x38572d);};}exports[_0xeabc('0x2f')]=function(_0x5ebb86,_0x5b34dd){var _0x5bb1f1={},_0x2f03e8={},_0x2d027e={'count':0x0,'rows':[]};var _0x98b445=_[_0xeabc('0x30')](db[_0xeabc('0x31')][_0xeabc('0x32')],function(_0x61c0af){return{'name':_0x61c0af['fieldName'],'type':_0x61c0af[_0xeabc('0x33')][_0xeabc('0x34')]};});_0x2f03e8[_0xeabc('0x35')]=_['map'](_0x98b445,_0xeabc('0x2d'));_0x2f03e8[_0xeabc('0x36')]=_[_0xeabc('0x37')](_0x5ebb86['query']);_0x2f03e8[_0xeabc('0x38')]=_[_0xeabc('0x39')](_0x2f03e8[_0xeabc('0x35')],_0x2f03e8['query']);_0x5bb1f1[_0xeabc('0x3a')]=_[_0xeabc('0x39')](_0x2f03e8['model'],qs['fields'](_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x3b')]));_0x5bb1f1['attributes']=_0x5bb1f1[_0xeabc('0x3a')][_0xeabc('0x3c')]?_0x5bb1f1[_0xeabc('0x3a')]:_0x2f03e8[_0xeabc('0x35')];if(!_0x5ebb86[_0xeabc('0x36')]['hasOwnProperty'](_0xeabc('0x3d'))){_0x5bb1f1['limit']=qs[_0xeabc('0x1e')](_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x1e')]);_0x5bb1f1['offset']=qs['offset'](_0x5ebb86[_0xeabc('0x36')]['offset']);}_0x5bb1f1[_0xeabc('0x3e')]=qs['sort'](_0x5ebb86['query']['sort']);_0x5bb1f1['where']=qs[_0xeabc('0x38')](_['pick'](_0x5ebb86[_0xeabc('0x36')],_0x2f03e8[_0xeabc('0x38')]),_0x98b445);if(_0x5ebb86['query'][_0xeabc('0x3f')]){_0x5bb1f1['where']=_[_0xeabc('0x40')](_0x5bb1f1['where'],{'$or':_[_0xeabc('0x30')](_0x98b445,function(_0xf1b7ef){if(_0xf1b7ef[_0xeabc('0x33')]!=='VIRTUAL'){var _0x5a00d0={};_0x5a00d0[_0xf1b7ef['name']]={'$like':'%'+_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x3f')]+'%'};return _0x5a00d0;}})});}_0x5bb1f1=_[_0xeabc('0x40')]({},_0x5bb1f1,_0x5ebb86['options']);var _0x4f1897={'where':_0x5bb1f1[_0xeabc('0x41')]};return db[_0xeabc('0x31')]['count'](_0x4f1897)[_0xeabc('0x26')](function(_0x5e0b78){_0x2d027e[_0xeabc('0x20')]=_0x5e0b78;if(_0x5ebb86['query']['includeAll']){_0x5bb1f1['include']=[{'all':!![]}];}return db[_0xeabc('0x31')][_0xeabc('0x42')](_0x5bb1f1);})[_0xeabc('0x26')](function(_0x3eeeb5){_0x2d027e['rows']=_0x3eeeb5;return _0x2d027e;})[_0xeabc('0x26')](respondWithFilteredResult(_0x5b34dd,_0x5bb1f1))['catch'](handleError(_0x5b34dd,null));};exports[_0xeabc('0x43')]=function(_0x1a4bbe,_0x3a7807){var _0x17a0df={'raw':!![],'where':{'id':_0x1a4bbe['params']['id']}},_0xc849c9={};_0xc849c9['model']=_[_0xeabc('0x37')](db['AnalyticDefaultReport'][_0xeabc('0x32')]);_0xc849c9[_0xeabc('0x36')]=_['keys'](_0x1a4bbe[_0xeabc('0x36')]);_0xc849c9[_0xeabc('0x38')]=_[_0xeabc('0x39')](_0xc849c9[_0xeabc('0x35')],_0xc849c9[_0xeabc('0x36')]);_0x17a0df[_0xeabc('0x3a')]=_[_0xeabc('0x39')](_0xc849c9['model'],qs[_0xeabc('0x3b')](_0x1a4bbe[_0xeabc('0x36')][_0xeabc('0x3b')]));_0x17a0df[_0xeabc('0x3a')]=_0x17a0df[_0xeabc('0x3a')][_0xeabc('0x3c')]?_0x17a0df[_0xeabc('0x3a')]:_0xc849c9[_0xeabc('0x35')];if(_0x1a4bbe[_0xeabc('0x36')][_0xeabc('0x44')]){_0x17a0df['include']=[{'all':!![]}];}_0x17a0df=_[_0xeabc('0x40')]({},_0x17a0df,_0x1a4bbe[_0xeabc('0x45')]);return db[_0xeabc('0x31')][_0xeabc('0x46')](_0x17a0df)[_0xeabc('0x26')](handleEntityNotFound(_0x3a7807,null))[_0xeabc('0x26')](respondWithResult(_0x3a7807,null))[_0xeabc('0x47')](handleError(_0x3a7807,null));};exports['create']=function(_0x766743,_0x32e09b){return db[_0xeabc('0x31')][_0xeabc('0x48')](_0x766743[_0xeabc('0x49')],{})['then'](function(_0x305946){var _0x2b2b9c=_0x766743[_0xeabc('0x4a')][_0xeabc('0x27')]({'plain':!![]});if(!_0x2b2b9c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b2b9c[_0xeabc('0x4b')]===_0xeabc('0x4a')){var _0x568847=_0x305946[_0xeabc('0x27')]({'plain':!![]});var _0x5a0d4d=_0xeabc('0x4c');return db['UserProfileSection'][_0xeabc('0x46')]({'where':{'name':_0x5a0d4d,'userProfileId':_0x2b2b9c[_0xeabc('0x4d')]},'raw':!![]})[_0xeabc('0x26')](function(_0x1524c3){if(_0x1524c3&&_0x1524c3[_0xeabc('0x4e')]===0x0){return db[_0xeabc('0x29')][_0xeabc('0x48')]({'name':_0x568847[_0xeabc('0x2d')],'resourceId':_0x568847['id'],'type':_0xeabc('0x28'),'sectionId':_0x1524c3['id']},{})[_0xeabc('0x26')](function(){return _0x305946;});}else{return _0x305946;}})['catch'](function(_0x180a14){logger[_0xeabc('0x2b')](_0xeabc('0x4f'),_0x180a14);throw _0x180a14;});}return _0x305946;})[_0xeabc('0x26')](respondWithResult(_0x32e09b,0xc9))['catch'](handleError(_0x32e09b,null));};exports[_0xeabc('0x25')]=function(_0x392913,_0x10d56f){if(_0x392913[_0xeabc('0x49')]['id']){delete _0x392913['body']['id'];}return db[_0xeabc('0x31')][_0xeabc('0x46')]({'where':{'id':_0x392913[_0xeabc('0x50')]['id']}})[_0xeabc('0x26')](handleEntityNotFound(_0x10d56f,null))[_0xeabc('0x26')](saveUpdates(_0x392913[_0xeabc('0x49')],null))[_0xeabc('0x26')](respondWithResult(_0x10d56f,null))[_0xeabc('0x47')](handleError(_0x10d56f,null));};exports[_0xeabc('0x2a')]=function(_0x58ab08,_0x4546c4){return db['AnalyticDefaultReport']['find']({'where':{'id':_0x58ab08['params']['id']}})[_0xeabc('0x26')](handleEntityNotFound(_0x4546c4,null))[_0xeabc('0x26')](removeEntity(_0x4546c4,null))[_0xeabc('0x47')](handleError(_0x4546c4,null));};exports[_0xeabc('0x51')]=function(_0xe89728,_0x2f78f3){var _0x4a2ad6=0xa;var _0x4358d7=[_0xeabc('0x52'),_0xeabc('0x53'),_0xeabc('0x54'),_0xeabc('0x55')];var _0x2c7b4e={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xeabc('0x58'),'AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x536f42={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':_0xeabc('0x5e'),'UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x26c784=function(_0xc2ef0c){return!_['includes']([_0xeabc('0x60'),_0xeabc('0x61'),_0xeabc('0x62'),_0xeabc('0x63')],_0xc2ef0c);};var _0x11cc1f=function(_0x514787){if(!_0x514787||!_0x514787['rules'][_0xeabc('0x3c')]){return'';}for(var _0x7b659f='(',_0x1b6675=0x0;_0x1b6675<_0x514787[_0xeabc('0x64')][_0xeabc('0x3c')];_0x1b6675+=0x1){_0x1b6675>0x0&&(_0x7b659f+='\x20'+_0x514787[_0xeabc('0x65')]+'\x20');_0x7b659f+=_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x66')]?_0x11cc1f(_0x514787[_0xeabc('0x64')][_0x1b6675]['group']):_0x514787[_0xeabc('0x64')][_0x1b6675]['field']+'\x20'+_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x67')]+(_0x26c784(_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x67')])?'\x20'+_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x68')]:'');}return _0x7b659f+')';};var _0xf48062={'where':{'id':_0xe89728[_0xeabc('0x50')]['id']}},_0xb59a2a,_0x5d4bc2,_0x24d0e5,_0x5702cb,_0x3fa31b;_0xf48062=_[_0xeabc('0x40')]({},_0xf48062,_0xe89728[_0xeabc('0x45')]);return db['AnalyticDefaultReport'][_0xeabc('0x46')](_0xf48062)['then'](function(_0x54e7d6){if(_0x54e7d6){_0xb59a2a=_0x54e7d6;return _0x54e7d6[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x23270a){if(_0x23270a){if(!_0x23270a[_0xeabc('0x3c')]){throw new db['Sequelize']['ValidationErrorItem'](_0xeabc('0x6a'),0x193);}_0x5d4bc2=_0x23270a;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xeabc('0x26')](function(_0x4f1a4f){if(_0x4f1a4f){_0x24d0e5=_['keyBy'](_0x4f1a4f,'id');var _0xa44f2d;var _0x1c84b5=squel['select']();_0x1c84b5['from'](_0xb59a2a[_0xeabc('0x6b')]);for(var _0x5d183a=0x0;_0x5d183a<_0x5d4bc2[_0xeabc('0x3c')];_0x5d183a+=0x1){_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x6c')]?_0x24d0e5[_0x5d4bc2[_0x5d183a]['MetricId']]['metric']:_0x5d4bc2[_0x5d183a][_0xeabc('0x6d')];_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x6e')]?_[_0xeabc('0x6f')](_0x2c7b4e[_0x5d4bc2[_0x5d183a][_0xeabc('0x6e')]],'%s',_0xa44f2d):_0xa44f2d;_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x70')]?_['replace'](_0x536f42[_0x5d4bc2[_0x5d183a]['format']],'%s',_0xa44f2d):_0xa44f2d;if(_0x5d4bc2[_0x5d183a][_0xeabc('0x71')]){_0x1c84b5['group'](_0xa44f2d);}_0x5d4bc2[_0x5d183a][_0xeabc('0x72')]&&_0x1c84b5['order'](_0xa44f2d,_0x5d4bc2[_0x5d183a][_0xeabc('0x72')]==='DESC'?![]:!![]);_0x1c84b5[_0xeabc('0x6d')](_0xa44f2d,_0x5d4bc2[_0x5d183a]['alias']||_0xa44f2d);}if(_0xb59a2a[_0xeabc('0x73')]){_0xb59a2a[_0xeabc('0x73')]=JSON[_0xeabc('0x74')](_0xb59a2a[_0xeabc('0x73')]);for(var _0x5e121c=0x0;_0x5e121c<_0xb59a2a[_0xeabc('0x73')]['length'];_0x5e121c+=0x1){if(_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')]&&_[_0xeabc('0x75')](_0x4358d7,_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')])&&_0xb59a2a['joins'][_0x5e121c][_0xeabc('0x76')]&&_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x77')]&&_0xb59a2a[_0xeabc('0x73')][_0x5e121c]['foreignKey']){_0x1c84b5[_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')]](_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x77')],null,util['format'](_0xeabc('0x78'),_0xb59a2a[_0xeabc('0x6b')],_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x76')],_0xb59a2a['joins'][_0x5e121c]['foreignTable'],_0xb59a2a[_0xeabc('0x73')][_0x5e121c]['foreignKey']));}}}if(_0xb59a2a['conditions']){_0xb59a2a[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0xb59a2a[_0xeabc('0x79')]);_0x1c84b5['where'](_0x11cc1f(_0xb59a2a[_0xeabc('0x79')][_0xeabc('0x66')]));}_0x3fa31b=_0x1c84b5['clone']();_0x1c84b5[_0xeabc('0x1e')](_0x4a2ad6);_0x1c84b5[_0xeabc('0x1d')](0x0);logger[_0xeabc('0x7a')](_0xeabc('0x7b'),_0x1c84b5[_0xeabc('0x7c')]());return dbH['sequelize'][_0xeabc('0x36')](_0x1c84b5['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0xeabc('0x7d')]});}})[_0xeabc('0x26')](respondWithResult(_0x2f78f3,null))[_0xeabc('0x47')](handleError(_0x2f78f3,null));};function runReport(_0x4424ce,_0x33fa74,_0x51368f){var _0x39f961=_0x33fa74['name'];var _0x1795fe=0xa;var _0x2f95c7=['join',_0xeabc('0x53'),'right_join','cross_join'];var _0x952dc7={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':_0xeabc('0x7e'),'MAX':_0xeabc('0x7f'),'MIN':'MIN(%s)','AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':_0xeabc('0x80'),'GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x348064={'SEC_TO_TIME':_0xeabc('0x81'),'DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':_0xeabc('0x5e'),'UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x522c6e=function(_0x436f8e){return!_[_0xeabc('0x75')]([_0xeabc('0x60'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xeabc('0x63')],_0x436f8e);};var _0x273ca5=function(_0xe90200){if(!_0xe90200||!_0xe90200[_0xeabc('0x64')][_0xeabc('0x3c')]){return'';}for(var _0x5f5a47='(',_0x289f98=0x0;_0x289f98<_0xe90200['rules']['length'];_0x289f98+=0x1){_0x289f98>0x0&&(_0x5f5a47+='\x20'+_0xe90200[_0xeabc('0x65')]+'\x20');_0x5f5a47+=_0xe90200[_0xeabc('0x64')][_0x289f98]['group']?_0x273ca5(_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x66')]):_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x6d')]+'\x20'+_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x67')]+(_0x522c6e(_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x67')])?'\x20'+_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x68')]:'');}return _0x5f5a47+')';};var _0x1f8197={'where':{'id':_0x4424ce['id']}},_0x485c13,_0xb54c35,_0x5c9d6f,_0x1caaa7,_0x3e764a;_0x1f8197=_[_0xeabc('0x40')]({},_0x1f8197,_0x51368f);return db[_0xeabc('0x31')][_0xeabc('0x46')](_0x1f8197)[_0xeabc('0x26')](function(_0x40f51e){if(_0x40f51e){_0x485c13=_0x40f51e;return _0x40f51e[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x156e20){if(_0x156e20){if(!_0x156e20[_0xeabc('0x3c')]){throw new db['Sequelize'][(_0xeabc('0x82'))](_0xeabc('0x6a'),0x193);}_0xb54c35=_0x156e20;return db[_0xeabc('0x83')][_0xeabc('0x42')]({'raw':!![]});}return null;})['then'](function(_0x26c595){if(_0x26c595){_0x5c9d6f=_[_0xeabc('0x84')](_0x26c595,'id');var _0x580661;var _0x3de927=squel[_0xeabc('0x85')]();_0x3de927['from'](_0x485c13['table']);for(var _0x489b1d=0x0;_0x489b1d<_0xb54c35['length'];_0x489b1d+=0x1){_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x6c')]?_0x5c9d6f[_0xb54c35[_0x489b1d][_0xeabc('0x6c')]][_0xeabc('0x86')]:_0xb54c35[_0x489b1d][_0xeabc('0x6d')];_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x6e')]?_[_0xeabc('0x6f')](_0x952dc7[_0xb54c35[_0x489b1d][_0xeabc('0x6e')]],'%s',_0x580661):_0x580661;_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x70')]?_[_0xeabc('0x6f')](_0x348064[_0xb54c35[_0x489b1d][_0xeabc('0x70')]],'%s',_0x580661):_0x580661;if(_0xb54c35[_0x489b1d]['groupBy']){_0x3de927[_0xeabc('0x66')](_0x580661);}_0xb54c35[_0x489b1d][_0xeabc('0x72')]&&_0x3de927['order'](_0x580661,_0xb54c35[_0x489b1d][_0xeabc('0x72')]===_0xeabc('0x87')?![]:!![]);_0x3de927[_0xeabc('0x6d')](_0x580661,_0xb54c35[_0x489b1d]['alias']||_0x580661);}if(_0x485c13[_0xeabc('0x73')]){_0x485c13['joins']=JSON[_0xeabc('0x74')](_0x485c13[_0xeabc('0x73')]);for(var _0x1841f0=0x0;_0x1841f0<_0x485c13[_0xeabc('0x73')][_0xeabc('0x3c')];_0x1841f0+=0x1){if(_0x485c13['joins'][_0x1841f0]['type']&&_['includes'](_0x2f95c7,_0x485c13['joins'][_0x1841f0][_0xeabc('0x33')])&&_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x76')]&&_0x485c13['joins'][_0x1841f0][_0xeabc('0x77')]&&_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x88')]){_0x3de927[_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x33')]](_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x77')],null,util[_0xeabc('0x70')](_0xeabc('0x78'),_0x485c13[_0xeabc('0x6b')],_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x76')],_0x485c13['joins'][_0x1841f0]['foreignTable'],_0x485c13[_0xeabc('0x73')][_0x1841f0]['foreignKey']));}}}if(_0x485c13[_0xeabc('0x79')]){_0x485c13[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0x485c13['conditions']);_0x3de927[_0xeabc('0x41')](_0x273ca5(_0x485c13[_0xeabc('0x79')][_0xeabc('0x66')]));}_0x3e764a=_0x3de927['clone']();_0x3de927['limit'](_0x1795fe);_0x3de927[_0xeabc('0x1d')](0x0);return;}})[_0xeabc('0x26')](function(){if(_0x33fa74[_0xeabc('0x89')]===_0xeabc('0x8a')){return null;}var _0x2cc9b3=_[_0xeabc('0x40')](_0x33fa74,{'name':_0x33fa74['fullPath']||_0x33fa74['name']||_0x485c13[_0xeabc('0x2d')],'basename':_0x39f961,'savename':util[_0xeabc('0x70')](_0xeabc('0x8b'),_0x33fa74[_0xeabc('0x2d')]||_0x485c13['name'],require('randomstring')['generate'](0x4),_0x33fa74[_0xeabc('0x89')]||'csv'),'reportId':_0x485c13['id'],'reportType':_0xeabc('0x8c')});return db['AnalyticExtractedReport'][_0xeabc('0x48')](_0x2cc9b3,{'raw':!![]});})['then'](function(_0x6e6ab2){if(_0x485c13[_0xeabc('0x6b')]===_0xeabc('0x8d')){_0x3e764a[_0xeabc('0x41')](_0x485c13[_0xeabc('0x6b')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x33fa74[_0xeabc('0x8e')],_0x33fa74[_0xeabc('0x8f')]);}else{_0x3e764a[_0xeabc('0x41')](_0x485c13['table']+_0xeabc('0x90'),_0x33fa74[_0xeabc('0x8e')],_0x33fa74[_0xeabc('0x8f')]);}if(_0x6e6ab2){logger[_0xeabc('0x91')](_0xeabc('0x92'),_0x3e764a['toString']());require(_0xeabc('0x93'))[_0xeabc('0x94')](path['join'](__dirname,_0xeabc('0x95'),_0x6e6ab2[_0xeabc('0x89')]),[_0x6e6ab2['id'],_0x3e764a['toString'](),path[_0xeabc('0x52')](__dirname,_0xeabc('0x96'),_0x6e6ab2[_0xeabc('0x97')]),_0x39f961]);return _0x6e6ab2;}else{var _0x307d26=squel[_0xeabc('0x85')]();_0x307d26[_0xeabc('0x98')]('('+_0x3e764a[_0xeabc('0x7c')]()+')',_0xeabc('0x99'));_0x307d26[_0xeabc('0x6d')](_0xeabc('0x9a'),_0xeabc('0x20'));_0x3e764a[_0xeabc('0x1e')](_0x33fa74[_0xeabc('0x1e')]||_0x1795fe);_0x3e764a['offset'](_0x33fa74['offset']||0x0);return dbH[_0xeabc('0x9b')][_0xeabc('0x36')](_0x307d26[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')]['QueryTypes'][_0xeabc('0x7d')]})['then'](function(_0x49fba2){if(!_0x49fba2['length']){_0x1caaa7=0x0;}else{_0x1caaa7=_0x49fba2[0x0]['count']||0x0;}return dbH['sequelize']['query'](_0x3e764a[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')][_0xeabc('0x9c')][_0xeabc('0x7d')]});})[_0xeabc('0x26')](function(_0xe27492){return{'rows':_0xe27492||[],'count':_0x1caaa7};});}});}exports[_0xeabc('0x9d')]=function(_0x3eaedf,_0x44dc85){return runReport(_0x3eaedf['params'],_0x3eaedf[_0xeabc('0x36')],_0x3eaedf[_0xeabc('0x45')])[_0xeabc('0x26')](respondWithResult(_0x44dc85,null))[_0xeabc('0x47')](handleError(_0x44dc85,null));};exports[_0xeabc('0x9e')]=runReport;exports[_0xeabc('0x36')]=function(_0x2a29d7,_0x5bb5d6){var _0x3513ce=0xa;var _0x58cb5d=[_0xeabc('0x52'),_0xeabc('0x53'),'right_join',_0xeabc('0x55')];var _0x4c8bf3={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':_0xeabc('0x7e'),'MAX':_0xeabc('0x7f'),'MIN':_0xeabc('0x58'),'AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':_0xeabc('0x80'),'GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x484c75={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x580f72=function(_0x37907a){return!_[_0xeabc('0x75')]([_0xeabc('0x60'),_0xeabc('0x61'),_0xeabc('0x62'),_0xeabc('0x63')],_0x37907a);};var _0x57db6d=function(_0x13cc55){if(!_0x13cc55||!_0x13cc55['rules'][_0xeabc('0x3c')]){return'';}for(var _0x43b88e='(',_0x1fa464=0x0;_0x1fa464<_0x13cc55[_0xeabc('0x64')]['length'];_0x1fa464+=0x1){_0x1fa464>0x0&&(_0x43b88e+='\x20'+_0x13cc55[_0xeabc('0x65')]+'\x20');_0x43b88e+=_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x66')]?_0x57db6d(_0x13cc55['rules'][_0x1fa464][_0xeabc('0x66')]):_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x6d')]+'\x20'+_0x13cc55['rules'][_0x1fa464]['condition']+(_0x580f72(_0x13cc55['rules'][_0x1fa464]['condition'])?'\x20'+_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x68')]:'');}return _0x43b88e+')';};var _0x52e84f={'where':{'id':_0x2a29d7[_0xeabc('0x50')]['id']}},_0x12f024,_0x1d35da,_0x2695a4,_0x199251,_0x1899d6;_0x52e84f=_[_0xeabc('0x40')]({},_0x52e84f,_0x2a29d7[_0xeabc('0x45')]);return db[_0xeabc('0x31')]['find'](_0x52e84f)[_0xeabc('0x26')](function(_0x5bb015){if(_0x5bb015){_0x12f024=_0x5bb015;return _0x5bb015[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x438ce3){if(_0x438ce3){if(!_0x438ce3[_0xeabc('0x3c')]){throw new db[(_0xeabc('0x9f'))][(_0xeabc('0x82'))](_0xeabc('0x6a'),0x193);}_0x1d35da=_0x438ce3;return db['AnalyticMetric'][_0xeabc('0x42')]({'raw':!![]});}return null;})['then'](function(_0x475160){if(_0x475160){_0x2695a4=_['keyBy'](_0x475160,'id');var _0x10d66b;var _0x12a042=squel[_0xeabc('0x85')]();_0x12a042[_0xeabc('0x98')](_0x12f024[_0xeabc('0x6b')]);for(var _0x49bf0f=0x0;_0x49bf0f<_0x1d35da[_0xeabc('0x3c')];_0x49bf0f+=0x1){_0x10d66b=_0x1d35da[_0x49bf0f][_0xeabc('0x6c')]?_0x2695a4[_0x1d35da[_0x49bf0f][_0xeabc('0x6c')]][_0xeabc('0x86')]:_0x1d35da[_0x49bf0f][_0xeabc('0x6d')];_0x10d66b=_0x1d35da[_0x49bf0f]['function']?_[_0xeabc('0x6f')](_0x4c8bf3[_0x1d35da[_0x49bf0f][_0xeabc('0x6e')]],'%s',_0x10d66b):_0x10d66b;_0x10d66b=_0x1d35da[_0x49bf0f][_0xeabc('0x70')]?_[_0xeabc('0x6f')](_0x484c75[_0x1d35da[_0x49bf0f][_0xeabc('0x70')]],'%s',_0x10d66b):_0x10d66b;if(_0x1d35da[_0x49bf0f]['groupBy']){_0x12a042[_0xeabc('0x66')](_0x10d66b);}_0x1d35da[_0x49bf0f]['orderBy']&&_0x12a042[_0xeabc('0x3e')](_0x10d66b,_0x1d35da[_0x49bf0f][_0xeabc('0x72')]===_0xeabc('0x87')?![]:!![]);_0x12a042[_0xeabc('0x6d')](_0x10d66b,_0x1d35da[_0x49bf0f][_0xeabc('0xa0')]||_0x10d66b);}if(_0x12f024[_0xeabc('0x73')]){_0x12f024[_0xeabc('0x73')]=JSON[_0xeabc('0x74')](_0x12f024[_0xeabc('0x73')]);for(var _0x223a3=0x0;_0x223a3<_0x12f024['joins'][_0xeabc('0x3c')];_0x223a3+=0x1){if(_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x33')]&&_[_0xeabc('0x75')](_0x58cb5d,_0x12f024['joins'][_0x223a3][_0xeabc('0x33')])&&_0x12f024['joins'][_0x223a3]['parentKey']&&_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x77')]&&_0x12f024[_0xeabc('0x73')][_0x223a3]['foreignKey']){_0x12a042[_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x33')]](_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x77')],null,util[_0xeabc('0x70')]('%s.%s\x20=\x20%s.%s',_0x12f024[_0xeabc('0x6b')],_0x12f024[_0xeabc('0x73')][_0x223a3]['parentKey'],_0x12f024['joins'][_0x223a3][_0xeabc('0x77')],_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x88')]));}}}if(_0x12f024[_0xeabc('0x79')]){_0x12f024[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0x12f024[_0xeabc('0x79')]);_0x12a042[_0xeabc('0x41')](_0x57db6d(_0x12f024[_0xeabc('0x79')]['group']));}_0x1899d6=_0x12a042[_0xeabc('0xa1')]();_0x12a042['limit'](_0x3513ce);_0x12a042[_0xeabc('0x1d')](0x0);logger['debug'](_0xeabc('0x7b'),_0x12a042[_0xeabc('0x7c')]());return dbH[_0xeabc('0x9b')][_0xeabc('0x36')](_0x12a042[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')][_0xeabc('0x9c')][_0xeabc('0x7d')]});}})[_0xeabc('0x26')](function(){return{'sql':_0x1899d6[_0xeabc('0x7c')]()};})['then'](respondWithResult(_0x5bb5d6,null))['catch'](handleError(_0x5bb5d6,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 595e920..774ef84 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 _0x4cff=['exports','define','AnalyticDefaultReport','analytics_default_reports','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./analyticDefaultReport.attributes'];(function(_0x1f2f86,_0x57341c){var _0x43a6b3=function(_0x30430b){while(--_0x30430b){_0x1f2f86['push'](_0x1f2f86['shift']());}};_0x43a6b3(++_0x57341c);}(_0x4cff,0xe8));var _0xf4cf=function(_0x1e1850,_0x47f3e1){_0x1e1850=_0x1e1850-0x0;var _0x36458d=_0x4cff[_0x1e1850];return _0x36458d;};'use strict';var _=require('lodash');var util=require(_0xf4cf('0x0'));var logger=require(_0xf4cf('0x1'))(_0xf4cf('0x2'));var moment=require('moment');var BPromise=require(_0xf4cf('0x3'));var rp=require(_0xf4cf('0x4'));var fs=require('fs');var path=require(_0xf4cf('0x5'));var rimraf=require('rimraf');var config=require(_0xf4cf('0x6'));var attributes=require(_0xf4cf('0x7'));module[_0xf4cf('0x8')]=function(_0x13031f,_0x297cba){return _0x13031f[_0xf4cf('0x9')](_0xf4cf('0xa'),attributes,{'tableName':_0xf4cf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x35e4=['lodash','util','../../config/logger','api','moment','bluebird','path','exports','define','AnalyticDefaultReport','analytics_default_reports'];(function(_0x5848ef,_0x4010df){var _0x34ef2a=function(_0x467b36){while(--_0x467b36){_0x5848ef['push'](_0x5848ef['shift']());}};_0x34ef2a(++_0x4010df);}(_0x35e4,0x84));var _0x435e=function(_0x39705e,_0x452f5a){_0x39705e=_0x39705e-0x0;var _0xe408f3=_0x35e4[_0x39705e];return _0xe408f3;};'use strict';var _=require(_0x435e('0x0'));var util=require(_0x435e('0x1'));var logger=require(_0x435e('0x2'))(_0x435e('0x3'));var moment=require(_0x435e('0x4'));var BPromise=require(_0x435e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x435e('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./analyticDefaultReport.attributes');module[_0x435e('0x7')]=function(_0x5176d5,_0xa96d8c){return _0x5176d5[_0x435e('0x8')](_0x435e('0x9'),attributes,{'tableName':_0x435e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index 57b4fb4..78f2787 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 _0x1e44=['result','catch','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x4b33d1,_0x2414e1){var _0x9e7221=function(_0x476ecc){while(--_0x476ecc){_0x4b33d1['push'](_0x4b33d1['shift']());}};_0x9e7221(++_0x2414e1);}(_0x1e44,0xe9));var _0x41e4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1e44[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x41e4('0x0'));var moment=require('moment');var BPromise=require(_0x41e4('0x1'));var rs=require(_0x41e4('0x2'));var fs=require('fs');var Redis=require(_0x41e4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x41e4('0x4'));var logger=require('../../config/logger')(_0x41e4('0x5'));var config=require(_0x41e4('0x6'));var jayson=require(_0x41e4('0x7'));var client=jayson[_0x41e4('0x8')][_0x41e4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x103aa2,_0x5a2ada,_0x16fe0f){return new BPromise(function(_0x1b8151,_0x27b484){return client['request'](_0x103aa2,_0x16fe0f)[_0x41e4('0xa')](function(_0x2a12ef){logger[_0x41e4('0xb')](_0x41e4('0xc'),_0x5a2ada,_0x41e4('0xd'));logger[_0x41e4('0xe')](_0x41e4('0xf'),_0x5a2ada,'request\x20sent',JSON['stringify'](_0x2a12ef));if(_0x2a12ef['error']){if(_0x2a12ef[_0x41e4('0x10')][_0x41e4('0x11')]===0x1f4){logger[_0x41e4('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x5a2ada,_0x2a12ef['error'][_0x41e4('0x12')]);return _0x27b484(_0x2a12ef[_0x41e4('0x10')][_0x41e4('0x12')]);}logger[_0x41e4('0x10')](_0x41e4('0xc'),_0x5a2ada,_0x2a12ef[_0x41e4('0x10')][_0x41e4('0x12')]);return _0x1b8151(_0x2a12ef[_0x41e4('0x10')][_0x41e4('0x12')]);}else{logger['info'](_0x41e4('0xc'),_0x5a2ada,_0x41e4('0xd'));_0x1b8151(_0x2a12ef[_0x41e4('0x13')]['message']);}})[_0x41e4('0x14')](function(_0x5912eb){logger['error'](_0x41e4('0xc'),_0x5a2ada,_0x5912eb);_0x27b484(_0x5912eb);});});}
\ No newline at end of file
+var _0xbaaf=['../../config/environment','jayson/promise','client','http','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xbaaf,0x111));var _0xfbaa=function(_0x5eff99,_0x39ad14){_0x5eff99=_0x5eff99-0x0;var _0x293de7=_0xbaaf[_0x5eff99];return _0x293de7;};'use strict';var _=require('lodash');var util=require(_0xfbaa('0x0'));var moment=require('moment');var BPromise=require(_0xfbaa('0x1'));var rs=require(_0xfbaa('0x2'));var fs=require('fs');var Redis=require(_0xfbaa('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xfbaa('0x4'));var logger=require(_0xfbaa('0x5'))(_0xfbaa('0x6'));var config=require(_0xfbaa('0x7'));var jayson=require(_0xfbaa('0x8'));var client=jayson[_0xfbaa('0x9')][_0xfbaa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2ea1f6,_0x203006,_0x1c8a5e){return new BPromise(function(_0x516796,_0x4fd881){return client['request'](_0x2ea1f6,_0x1c8a5e)[_0xfbaa('0xb')](function(_0x490a2b){logger[_0xfbaa('0xc')](_0xfbaa('0xd'),_0x203006,_0xfbaa('0xe'));logger['debug']('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x203006,_0xfbaa('0xe'),JSON[_0xfbaa('0xf')](_0x490a2b));if(_0x490a2b['error']){if(_0x490a2b[_0xfbaa('0x10')]['code']===0x1f4){logger[_0xfbaa('0x10')](_0xfbaa('0xd'),_0x203006,_0x490a2b[_0xfbaa('0x10')][_0xfbaa('0x11')]);return _0x4fd881(_0x490a2b['error']['message']);}logger[_0xfbaa('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x203006,_0x490a2b['error']['message']);return _0x516796(_0x490a2b[_0xfbaa('0x10')]['message']);}else{logger[_0xfbaa('0xc')](_0xfbaa('0xd'),_0x203006,_0xfbaa('0xe'));_0x516796(_0x490a2b[_0xfbaa('0x12')]['message']);}})[_0xfbaa('0x13')](function(_0x4881fa){logger[_0xfbaa('0x10')](_0xfbaa('0xd'),_0x203006,_0x4881fa);_0x4fd881(_0x4881fa);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 9cc91f3..770d9ac 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 _0x3a32=['express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/preview','run','/:id/query','query','post','create','put','destroy','multer','util','path','connect-timeout'];(function(_0x1bd153,_0x3a3110){var _0x1f7f6c=function(_0x5f5670){while(--_0x5f5670){_0x1bd153['push'](_0x1bd153['shift']());}};_0x1f7f6c(++_0x3a3110);}(_0x3a32,0x65));var _0x23a3=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0x3a32[_0x4bb66f];return _0xf2772f;};'use strict';var multer=require(_0x23a3('0x0'));var util=require(_0x23a3('0x1'));var path=require(_0x23a3('0x2'));var timeout=require(_0x23a3('0x3'));var express=require(_0x23a3('0x4'));var router=express['Router']();var fs_extra=require(_0x23a3('0x5'));var auth=require(_0x23a3('0x6'));var interaction=require(_0x23a3('0x7'));var config=require('../../config/environment');var controller=require('./analyticDefaultReport.controller');router[_0x23a3('0x8')]('/',auth[_0x23a3('0x9')](),controller[_0x23a3('0xa')]);router[_0x23a3('0x8')](_0x23a3('0xb'),auth[_0x23a3('0x9')](),controller[_0x23a3('0xc')]);router[_0x23a3('0x8')](_0x23a3('0xd'),auth[_0x23a3('0x9')](),controller['preview']);router[_0x23a3('0x8')]('/:id/run',auth[_0x23a3('0x9')](),controller[_0x23a3('0xe')]);router[_0x23a3('0x8')](_0x23a3('0xf'),auth[_0x23a3('0x9')](),controller[_0x23a3('0x10')]);router[_0x23a3('0x11')]('/',auth[_0x23a3('0x9')](),controller[_0x23a3('0x12')]);router[_0x23a3('0x13')](_0x23a3('0xb'),auth[_0x23a3('0x9')](),controller['update']);router['delete'](_0x23a3('0xb'),auth[_0x23a3('0x9')](),controller[_0x23a3('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x1815=['isAuthenticated','index','/:id','show','/:id/preview','preview','post','create','update','delete','multer','express','Router','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','get'];(function(_0x24f611,_0x512b7c){var _0x2bc7a7=function(_0x3adaaa){while(--_0x3adaaa){_0x24f611['push'](_0x24f611['shift']());}};_0x2bc7a7(++_0x512b7c);}(_0x1815,0xa3));var _0x5181=function(_0x43fc7d,_0x97d6b2){_0x43fc7d=_0x43fc7d-0x0;var _0x2b568e=_0x1815[_0x43fc7d];return _0x2b568e;};'use strict';var multer=require(_0x5181('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5181('0x1'));var router=express[_0x5181('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x5181('0x3'));var interaction=require(_0x5181('0x4'));var config=require('../../config/environment');var controller=require(_0x5181('0x5'));router[_0x5181('0x6')]('/',auth[_0x5181('0x7')](),controller[_0x5181('0x8')]);router[_0x5181('0x6')](_0x5181('0x9'),auth[_0x5181('0x7')](),controller[_0x5181('0xa')]);router[_0x5181('0x6')](_0x5181('0xb'),auth['isAuthenticated'](),controller[_0x5181('0xc')]);router[_0x5181('0x6')]('/:id/run',auth['isAuthenticated'](),controller['run']);router['get']('/:id/query',auth['isAuthenticated'](),controller['query']);router[_0x5181('0xd')]('/',auth[_0x5181('0x7')](),controller[_0x5181('0xe')]);router['put'](_0x5181('0x9'),auth[_0x5181('0x7')](),controller[_0x5181('0xf')]);router[_0x5181('0x10')](_0x5181('0x9'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 0b9bcc9..2b52887 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 _0x77e3=['Loading','ENUM','manual','INTEGER','UNSIGNED','exports','STRING','pdf','xlsx','DATE'];(function(_0x99250c,_0x4603c0){var _0x3927d5=function(_0xa13c94){while(--_0xa13c94){_0x99250c['push'](_0x99250c['shift']());}};_0x3927d5(++_0x4603c0);}(_0x77e3,0x69));var _0x377e=function(_0x532577,_0x22e2fe){_0x532577=_0x532577-0x0;var _0x5fdc7e=_0x77e3[_0x532577];return _0x5fdc7e;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x377e('0x0')]={'name':{'type':Sequelize[_0x377e('0x1')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize['ENUM']('csv',_0x377e('0x2'),_0x377e('0x3')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x377e('0x4')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize['STRING'],'defaultValue':_0x377e('0x5')},'type':{'type':Sequelize[_0x377e('0x6')](_0x377e('0x7'),'scheduled'),'allowNull':![],'defaultValue':_0x377e('0x7')},'reportId':{'type':Sequelize[_0x377e('0x8')](0xb)[_0x377e('0x9')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x26c9=['Loading','manual','INTEGER','UNSIGNED','STRING','ENUM','csv','pdf','xlsx','DATE'];(function(_0xab752c,_0xc3f85a){var _0x40553d=function(_0x471542){while(--_0x471542){_0xab752c['push'](_0xab752c['shift']());}};_0x40553d(++_0xc3f85a);}(_0x26c9,0x18a));var _0x926c=function(_0x19c02b,_0x13618a){_0x19c02b=_0x19c02b-0x0;var _0x42a649=_0x26c9[_0x19c02b];return _0x42a649;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module['exports']={'name':{'type':Sequelize[_0x926c('0x0')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x926c('0x1')](_0x926c('0x2'),_0x926c('0x3'),_0x926c('0x4')),'allowNull':![],'defaultValue':_0x926c('0x2')},'savename':{'type':Sequelize[_0x926c('0x0')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x926c('0x5')]},'status':{'type':Sequelize[_0x926c('0x0')],'defaultValue':_0x926c('0x6')},'type':{'type':Sequelize[_0x926c('0x1')]('manual','scheduled'),'allowNull':![],'defaultValue':_0x926c('0x7')},'reportId':{'type':Sequelize[_0x926c('0x8')](0xb)[_0x926c('0x9')]},'reportType':{'type':Sequelize[_0x926c('0x0')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index bfb28a9..614910c 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 _0x11f3=['fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','ExtractedReports','destroy','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','keys','query','filters','model','attributes','intersection','fields','length','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','create','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','download','basename','savename','output','existsSync','join','root','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','server/files/reports','format','%s.%s','toLowerCase','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox'];(function(_0x5f168c,_0x2b7e8e){var _0x405a03=function(_0x3bca4f){while(--_0x3bca4f){_0x5f168c['push'](_0x5f168c['shift']());}};_0x405a03(++_0x2b7e8e);}(_0x11f3,0x118));var _0x311f=function(_0x56fe68,_0x40fdef){_0x56fe68=_0x56fe68-0x0;var _0x1eeb3b=_0x11f3[_0x56fe68];return _0x1eeb3b;};'use strict';var emlformat=require(_0x311f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x311f('0x1'));var jsonpatch=require(_0x311f('0x2'));var rp=require(_0x311f('0x3'));var moment=require(_0x311f('0x4'));var BPromise=require(_0x311f('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x311f('0x6'));var sox=require(_0x311f('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x311f('0x8'));var _=require(_0x311f('0x9'));var squel=require(_0x311f('0xa'));var crypto=require(_0x311f('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x311f('0xc'));var querystring=require(_0x311f('0xd'));var Papa=require(_0x311f('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x311f('0xf'));var hardwareService=require(_0x311f('0x10'));var logger=require(_0x311f('0x11'))(_0x311f('0x12'));var utils=require('../../config/utils');var config=require(_0x311f('0x13'));var licenseUtil=require(_0x311f('0x14'));var db=require(_0x311f('0x15'))['db'];function respondWithStatusCode(_0x4c1d2b,_0x454f23){_0x454f23=_0x454f23||0xcc;return function(_0x3853b6){if(_0x3853b6){return _0x4c1d2b[_0x311f('0x16')](_0x454f23);}return _0x4c1d2b[_0x311f('0x17')](_0x454f23)[_0x311f('0x18')]();};}function respondWithResult(_0x59a9af,_0x588dc5){_0x588dc5=_0x588dc5||0xc8;return function(_0x569a5d){if(_0x569a5d){return _0x59a9af['status'](_0x588dc5)[_0x311f('0x19')](_0x569a5d);}};}function respondWithFilteredResult(_0x45205f,_0x4b62a3){return function(_0x5a3b46){if(_0x5a3b46){var _0x3ca013=typeof _0x4b62a3[_0x311f('0x1a')]===_0x311f('0x1b')&&typeof _0x4b62a3[_0x311f('0x1c')]===_0x311f('0x1b');var _0x20928a=_0x5a3b46['count'];var _0x599853=_0x3ca013?0x0:_0x4b62a3['offset'];var _0xe3dd85=_0x3ca013?_0x5a3b46[_0x311f('0x1d')]:_0x4b62a3[_0x311f('0x1a')]+_0x4b62a3[_0x311f('0x1c')];var _0x57d92f;if(_0xe3dd85>=_0x20928a){_0xe3dd85=_0x20928a;_0x57d92f=0xc8;}else{_0x57d92f=0xce;}_0x45205f[_0x311f('0x17')](_0x57d92f);return _0x45205f[_0x311f('0x1e')](_0x311f('0x1f'),_0x599853+'-'+_0xe3dd85+'/'+_0x20928a)['json'](_0x5a3b46);}return null;};}function patchUpdates(_0x16ad57){return function(_0x4c33e6){try{jsonpatch[_0x311f('0x20')](_0x4c33e6,_0x16ad57,!![]);}catch(_0x4e4daf){return BPromise[_0x311f('0x21')](_0x4e4daf);}return _0x4c33e6[_0x311f('0x22')]();};}function saveUpdates(_0x54a556,_0x8bdf81){return function(_0x40a4ea){if(_0x40a4ea){return _0x40a4ea[_0x311f('0x23')](_0x54a556)['then'](function(_0xed6471){return _0xed6471;});}return null;};}function removeEntity(_0x78b4f7,_0x1d2dc5){return function(_0x4cf0d0){if(_0x4cf0d0){return _0x4cf0d0['destroy']()[_0x311f('0x24')](function(){var _0xc5d64e=_0x4cf0d0[_0x311f('0x25')]({'plain':!![]});var _0x2e2ed1=_0x311f('0x26');return db['UserProfileResource'][_0x311f('0x27')]({'where':{'type':_0x2e2ed1,'resourceId':_0xc5d64e['id']}})[_0x311f('0x24')](function(){return _0x4cf0d0;});})[_0x311f('0x24')](function(){_0x78b4f7[_0x311f('0x17')](0xcc)[_0x311f('0x18')]();});}};}function handleEntityNotFound(_0x2871fa,_0x50cc7e){return function(_0x3d8112){if(!_0x3d8112){_0x2871fa['sendStatus'](0x194);}return _0x3d8112;};}function handleError(_0xfbfec5,_0x22d2fc){_0x22d2fc=_0x22d2fc||0x1f4;return function(_0x2060d2){logger[_0x311f('0x28')](_0x2060d2[_0x311f('0x29')]);if(_0x2060d2[_0x311f('0x2a')]){delete _0x2060d2['name'];}_0xfbfec5[_0x311f('0x17')](_0x22d2fc)[_0x311f('0x2b')](_0x2060d2);};}exports[_0x311f('0x2c')]=function(_0x4810cf,_0x18077c){var _0xd39ea5={},_0x539780={},_0x10521c={'count':0x0,'rows':[]};var _0x4391b1=_[_0x311f('0x2d')](db[_0x311f('0x2e')][_0x311f('0x2f')],function(_0x2661a0){return{'name':_0x2661a0[_0x311f('0x30')],'type':_0x2661a0[_0x311f('0x31')][_0x311f('0x32')]};});_0x539780['model']=_[_0x311f('0x2d')](_0x4391b1,_0x311f('0x2a'));_0x539780['query']=_[_0x311f('0x33')](_0x4810cf[_0x311f('0x34')]);_0x539780[_0x311f('0x35')]=_['intersection'](_0x539780[_0x311f('0x36')],_0x539780['query']);_0xd39ea5[_0x311f('0x37')]=_[_0x311f('0x38')](_0x539780[_0x311f('0x36')],qs[_0x311f('0x39')](_0x4810cf[_0x311f('0x34')][_0x311f('0x39')]));_0xd39ea5[_0x311f('0x37')]=_0xd39ea5[_0x311f('0x37')][_0x311f('0x3a')]?_0xd39ea5[_0x311f('0x37')]:_0x539780[_0x311f('0x36')];if(!_0x4810cf[_0x311f('0x34')]['hasOwnProperty']('nolimit')){_0xd39ea5[_0x311f('0x1c')]=qs['limit'](_0x4810cf[_0x311f('0x34')][_0x311f('0x1c')]);_0xd39ea5[_0x311f('0x1a')]=qs[_0x311f('0x1a')](_0x4810cf[_0x311f('0x34')]['offset']);}_0xd39ea5['order']=qs[_0x311f('0x3b')](_0x4810cf[_0x311f('0x34')][_0x311f('0x3b')]);_0xd39ea5[_0x311f('0x3c')]=qs[_0x311f('0x35')](_[_0x311f('0x3d')](_0x4810cf[_0x311f('0x34')],_0x539780[_0x311f('0x35')]),_0x4391b1);if(_0x4810cf[_0x311f('0x34')][_0x311f('0x3e')]){_0xd39ea5[_0x311f('0x3c')]=_[_0x311f('0x3f')](_0xd39ea5[_0x311f('0x3c')],{'$or':_[_0x311f('0x2d')](_0x4391b1,function(_0xe5ec07){if(_0xe5ec07['type']!==_0x311f('0x40')){var _0x3ee9c0={};_0x3ee9c0[_0xe5ec07[_0x311f('0x2a')]]={'$like':'%'+_0x4810cf[_0x311f('0x34')]['filter']+'%'};return _0x3ee9c0;}})});}_0xd39ea5=_[_0x311f('0x3f')]({},_0xd39ea5,_0x4810cf[_0x311f('0x41')]);var _0x53ee7a={'where':_0xd39ea5[_0x311f('0x3c')]};return db['AnalyticExtractedReport'][_0x311f('0x1d')](_0x53ee7a)[_0x311f('0x24')](function(_0x1dc8bb){_0x10521c[_0x311f('0x1d')]=_0x1dc8bb;if(_0x4810cf[_0x311f('0x34')][_0x311f('0x42')]){_0xd39ea5[_0x311f('0x43')]=[{'all':!![]}];}return db['AnalyticExtractedReport']['findAll'](_0xd39ea5);})[_0x311f('0x24')](function(_0x4f4bc0){_0x10521c[_0x311f('0x44')]=_0x4f4bc0;return _0x10521c;})[_0x311f('0x24')](respondWithFilteredResult(_0x18077c,_0xd39ea5))[_0x311f('0x45')](handleError(_0x18077c,null));};exports[_0x311f('0x46')]=function(_0x3453c5,_0x796911){var _0x36deff={'raw':!![],'where':{'id':_0x3453c5[_0x311f('0x47')]['id']}},_0x3d0dc5={};_0x3d0dc5[_0x311f('0x36')]=_[_0x311f('0x33')](db[_0x311f('0x2e')][_0x311f('0x2f')]);_0x3d0dc5[_0x311f('0x34')]=_['keys'](_0x3453c5[_0x311f('0x34')]);_0x3d0dc5[_0x311f('0x35')]=_[_0x311f('0x38')](_0x3d0dc5[_0x311f('0x36')],_0x3d0dc5[_0x311f('0x34')]);_0x36deff[_0x311f('0x37')]=_[_0x311f('0x38')](_0x3d0dc5[_0x311f('0x36')],qs[_0x311f('0x39')](_0x3453c5[_0x311f('0x34')]['fields']));_0x36deff['attributes']=_0x36deff[_0x311f('0x37')][_0x311f('0x3a')]?_0x36deff[_0x311f('0x37')]:_0x3d0dc5[_0x311f('0x36')];if(_0x3453c5['query']['includeAll']){_0x36deff[_0x311f('0x43')]=[{'all':!![]}];}_0x36deff=_[_0x311f('0x3f')]({},_0x36deff,_0x3453c5['options']);return db[_0x311f('0x2e')]['find'](_0x36deff)[_0x311f('0x24')](handleEntityNotFound(_0x796911,null))[_0x311f('0x24')](respondWithResult(_0x796911,null))[_0x311f('0x45')](handleError(_0x796911,null));};exports[_0x311f('0x48')]=function(_0x2b07e9,_0x552aad){return db[_0x311f('0x2e')][_0x311f('0x48')](_0x2b07e9['body'],{})[_0x311f('0x24')](function(_0x6aeb07){var _0x5e8135=_0x2b07e9[_0x311f('0x49')]['get']({'plain':!![]});if(!_0x5e8135)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5e8135[_0x311f('0x4a')]==='user'){var _0x541ccf=_0x6aeb07[_0x311f('0x25')]({'plain':!![]});var _0x22bf6b=_0x311f('0x26');return db[_0x311f('0x4b')]['find']({'where':{'name':_0x22bf6b,'userProfileId':_0x5e8135[_0x311f('0x4c')]},'raw':!![]})[_0x311f('0x24')](function(_0x424563){if(_0x424563&&_0x424563[_0x311f('0x4d')]===0x0){return db['UserProfileResource'][_0x311f('0x48')]({'name':_0x541ccf[_0x311f('0x2a')],'resourceId':_0x541ccf['id'],'type':_0x424563[_0x311f('0x2a')],'sectionId':_0x424563['id']},{})[_0x311f('0x24')](function(){return _0x6aeb07;});}else{return _0x6aeb07;}})[_0x311f('0x45')](function(_0x2dc3d4){logger['error'](_0x311f('0x4e'),_0x2dc3d4);throw _0x2dc3d4;});}return _0x6aeb07;})[_0x311f('0x24')](respondWithResult(_0x552aad,0xc9))['catch'](handleError(_0x552aad,null));};exports['update']=function(_0x107ded,_0x24075){if(_0x107ded[_0x311f('0x4f')]['id']){delete _0x107ded[_0x311f('0x4f')]['id'];}return db[_0x311f('0x2e')]['find']({'where':{'id':_0x107ded[_0x311f('0x47')]['id']}})['then'](handleEntityNotFound(_0x24075,null))[_0x311f('0x24')](saveUpdates(_0x107ded[_0x311f('0x4f')],null))[_0x311f('0x24')](respondWithResult(_0x24075,null))['catch'](handleError(_0x24075,null));};exports[_0x311f('0x27')]=function(_0x35ece7,_0x1c71d8){return db[_0x311f('0x2e')][_0x311f('0x50')]({'where':{'id':_0x35ece7[_0x311f('0x47')]['id']}})[_0x311f('0x24')](handleEntityNotFound(_0x1c71d8,null))['then'](removeEntity(_0x1c71d8,null))[_0x311f('0x45')](handleError(_0x1c71d8,null));};exports[_0x311f('0x51')]=function(_0x4883a7,_0x436e1c,_0x2582df){return db['AnalyticExtractedReport'][_0x311f('0x50')]({'where':{'id':_0x4883a7[_0x311f('0x47')]['id']},'attributes':['name',_0x311f('0x52'),_0x311f('0x53'),_0x311f('0x54')],'raw':!![]})[_0x311f('0x24')](handleEntityNotFound(_0x436e1c,null))[_0x311f('0x24')](function(_0x3efd58){if(_0x3efd58){if(!fs[_0x311f('0x55')](path[_0x311f('0x56')](config[_0x311f('0x57')],'server/files/reports',_0x3efd58[_0x311f('0x53')]))){throw new db[(_0x311f('0x58'))][(_0x311f('0x59'))](_0x311f('0x5a'));}if(_0x4883a7[_0x311f('0x34')][_0x311f('0x5b')]){return _0x436e1c[_0x311f('0x16')](0xc8);}return _0x436e1c[_0x311f('0x51')](path[_0x311f('0x56')](config['root'],_0x311f('0x5c'),_0x3efd58['savename']),util[_0x311f('0x5d')](_0x311f('0x5e'),_0x3efd58[_0x311f('0x52')]||_0x3efd58[_0x311f('0x2a')],_0x3efd58[_0x311f('0x54')][_0x311f('0x5f')]()));}})[_0x311f('0x45')](handleError(_0x436e1c,null));};
\ No newline at end of file
+var _0x8d2b=['nolimit','order','sort','where','pick','filter','VIRTUAL','options','include','rows','catch','show','params','keys','includeAll','merge','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','output','existsSync','join','root','Sequelize','ValidationError','exists','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','ExtractedReports','stack','name','send','index','AnalyticExtractedReport','rawAttributes','fieldName','type','key','map','query','filters','intersection','model','attributes','fields','length'];(function(_0x373edd,_0x1c8e44){var _0x2fbecd=function(_0x54ea63){while(--_0x54ea63){_0x373edd['push'](_0x373edd['shift']());}};_0x2fbecd(++_0x1c8e44);}(_0x8d2b,0x1ab));var _0xb8d2=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0x8d2b[_0xf71120];return _0xbe2fd3;};'use strict';var emlformat=require(_0xb8d2('0x0'));var rimraf=require(_0xb8d2('0x1'));var zipdir=require(_0xb8d2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb8d2('0x3'));var moment=require(_0xb8d2('0x4'));var BPromise=require(_0xb8d2('0x5'));var Mustache=require(_0xb8d2('0x6'));var util=require(_0xb8d2('0x7'));var path=require(_0xb8d2('0x8'));var sox=require(_0xb8d2('0x9'));var csv=require(_0xb8d2('0xa'));var ejs=require(_0xb8d2('0xb'));var fs=require('fs');var fs_extra=require(_0xb8d2('0xc'));var _=require(_0xb8d2('0xd'));var squel=require('squel');var crypto=require(_0xb8d2('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xb8d2('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb8d2('0x10'));var Papa=require('papaparse');var Redis=require(_0xb8d2('0x11'));var authService=require(_0xb8d2('0x12'));var qs=require(_0xb8d2('0x13'));var as=require(_0xb8d2('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb8d2('0x15'));var utils=require('../../config/utils');var config=require(_0xb8d2('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xb8d2('0x17'))['db'];function respondWithStatusCode(_0x5f04ca,_0xd29e20){_0xd29e20=_0xd29e20||0xcc;return function(_0x2aee41){if(_0x2aee41){return _0x5f04ca[_0xb8d2('0x18')](_0xd29e20);}return _0x5f04ca['status'](_0xd29e20)[_0xb8d2('0x19')]();};}function respondWithResult(_0xabc180,_0x4eaef1){_0x4eaef1=_0x4eaef1||0xc8;return function(_0x3e0ce6){if(_0x3e0ce6){return _0xabc180[_0xb8d2('0x1a')](_0x4eaef1)[_0xb8d2('0x1b')](_0x3e0ce6);}};}function respondWithFilteredResult(_0x53c19b,_0x20b50e){return function(_0x269e0e){if(_0x269e0e){var _0xcff364=typeof _0x20b50e[_0xb8d2('0x1c')]===_0xb8d2('0x1d')&&typeof _0x20b50e[_0xb8d2('0x1e')]===_0xb8d2('0x1d');var _0x34f6d3=_0x269e0e[_0xb8d2('0x1f')];var _0x22aa24=_0xcff364?0x0:_0x20b50e[_0xb8d2('0x1c')];var _0x248b5f=_0xcff364?_0x269e0e[_0xb8d2('0x1f')]:_0x20b50e[_0xb8d2('0x1c')]+_0x20b50e['limit'];var _0x2a366e;if(_0x248b5f>=_0x34f6d3){_0x248b5f=_0x34f6d3;_0x2a366e=0xc8;}else{_0x2a366e=0xce;}_0x53c19b[_0xb8d2('0x1a')](_0x2a366e);return _0x53c19b[_0xb8d2('0x20')]('Content-Range',_0x22aa24+'-'+_0x248b5f+'/'+_0x34f6d3)[_0xb8d2('0x1b')](_0x269e0e);}return null;};}function patchUpdates(_0x27386b){return function(_0x352ac0){try{jsonpatch[_0xb8d2('0x21')](_0x352ac0,_0x27386b,!![]);}catch(_0x2fbf18){return BPromise[_0xb8d2('0x22')](_0x2fbf18);}return _0x352ac0[_0xb8d2('0x23')]();};}function saveUpdates(_0x4111a9,_0x3918ea){return function(_0x13b0a1){if(_0x13b0a1){return _0x13b0a1[_0xb8d2('0x24')](_0x4111a9)[_0xb8d2('0x25')](function(_0x5a504f){return _0x5a504f;});}return null;};}function removeEntity(_0x55353d,_0x569de0){return function(_0x4ffbec){if(_0x4ffbec){return _0x4ffbec[_0xb8d2('0x26')]()[_0xb8d2('0x25')](function(){var _0x2c12d0=_0x4ffbec[_0xb8d2('0x27')]({'plain':!![]});var _0x51b45f=_0xb8d2('0x28');return db['UserProfileResource'][_0xb8d2('0x26')]({'where':{'type':_0x51b45f,'resourceId':_0x2c12d0['id']}})[_0xb8d2('0x25')](function(){return _0x4ffbec;});})['then'](function(){_0x55353d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x534abe,_0x353fd5){return function(_0x1e10c1){if(!_0x1e10c1){_0x534abe[_0xb8d2('0x18')](0x194);}return _0x1e10c1;};}function handleError(_0x1b0d84,_0x2e74f6){_0x2e74f6=_0x2e74f6||0x1f4;return function(_0x223bd3){logger['error'](_0x223bd3[_0xb8d2('0x29')]);if(_0x223bd3[_0xb8d2('0x2a')]){delete _0x223bd3['name'];}_0x1b0d84[_0xb8d2('0x1a')](_0x2e74f6)[_0xb8d2('0x2b')](_0x223bd3);};}exports[_0xb8d2('0x2c')]=function(_0x45ed30,_0x588c8d){var _0x5c29c9={},_0x1c4517={},_0x460dc2={'count':0x0,'rows':[]};var _0x293b16=_['map'](db[_0xb8d2('0x2d')][_0xb8d2('0x2e')],function(_0x3e5302){return{'name':_0x3e5302[_0xb8d2('0x2f')],'type':_0x3e5302[_0xb8d2('0x30')][_0xb8d2('0x31')]};});_0x1c4517['model']=_[_0xb8d2('0x32')](_0x293b16,'name');_0x1c4517[_0xb8d2('0x33')]=_['keys'](_0x45ed30['query']);_0x1c4517[_0xb8d2('0x34')]=_[_0xb8d2('0x35')](_0x1c4517[_0xb8d2('0x36')],_0x1c4517[_0xb8d2('0x33')]);_0x5c29c9[_0xb8d2('0x37')]=_[_0xb8d2('0x35')](_0x1c4517[_0xb8d2('0x36')],qs[_0xb8d2('0x38')](_0x45ed30[_0xb8d2('0x33')]['fields']));_0x5c29c9['attributes']=_0x5c29c9[_0xb8d2('0x37')][_0xb8d2('0x39')]?_0x5c29c9[_0xb8d2('0x37')]:_0x1c4517[_0xb8d2('0x36')];if(!_0x45ed30['query']['hasOwnProperty'](_0xb8d2('0x3a'))){_0x5c29c9[_0xb8d2('0x1e')]=qs['limit'](_0x45ed30[_0xb8d2('0x33')][_0xb8d2('0x1e')]);_0x5c29c9[_0xb8d2('0x1c')]=qs[_0xb8d2('0x1c')](_0x45ed30['query']['offset']);}_0x5c29c9[_0xb8d2('0x3b')]=qs[_0xb8d2('0x3c')](_0x45ed30[_0xb8d2('0x33')][_0xb8d2('0x3c')]);_0x5c29c9[_0xb8d2('0x3d')]=qs[_0xb8d2('0x34')](_[_0xb8d2('0x3e')](_0x45ed30[_0xb8d2('0x33')],_0x1c4517['filters']),_0x293b16);if(_0x45ed30[_0xb8d2('0x33')][_0xb8d2('0x3f')]){_0x5c29c9[_0xb8d2('0x3d')]=_['merge'](_0x5c29c9[_0xb8d2('0x3d')],{'$or':_['map'](_0x293b16,function(_0x4582e2){if(_0x4582e2[_0xb8d2('0x30')]!==_0xb8d2('0x40')){var _0x36864b={};_0x36864b[_0x4582e2[_0xb8d2('0x2a')]]={'$like':'%'+_0x45ed30[_0xb8d2('0x33')][_0xb8d2('0x3f')]+'%'};return _0x36864b;}})});}_0x5c29c9=_['merge']({},_0x5c29c9,_0x45ed30[_0xb8d2('0x41')]);var _0xeb857d={'where':_0x5c29c9[_0xb8d2('0x3d')]};return db[_0xb8d2('0x2d')][_0xb8d2('0x1f')](_0xeb857d)[_0xb8d2('0x25')](function(_0x19bf2d){_0x460dc2[_0xb8d2('0x1f')]=_0x19bf2d;if(_0x45ed30[_0xb8d2('0x33')]['includeAll']){_0x5c29c9[_0xb8d2('0x42')]=[{'all':!![]}];}return db[_0xb8d2('0x2d')]['findAll'](_0x5c29c9);})[_0xb8d2('0x25')](function(_0x285766){_0x460dc2[_0xb8d2('0x43')]=_0x285766;return _0x460dc2;})[_0xb8d2('0x25')](respondWithFilteredResult(_0x588c8d,_0x5c29c9))[_0xb8d2('0x44')](handleError(_0x588c8d,null));};exports[_0xb8d2('0x45')]=function(_0x2a1b45,_0x3e8310){var _0x3d0f23={'raw':!![],'where':{'id':_0x2a1b45[_0xb8d2('0x46')]['id']}},_0xbea801={};_0xbea801['model']=_[_0xb8d2('0x47')](db[_0xb8d2('0x2d')][_0xb8d2('0x2e')]);_0xbea801[_0xb8d2('0x33')]=_['keys'](_0x2a1b45['query']);_0xbea801[_0xb8d2('0x34')]=_[_0xb8d2('0x35')](_0xbea801[_0xb8d2('0x36')],_0xbea801[_0xb8d2('0x33')]);_0x3d0f23[_0xb8d2('0x37')]=_['intersection'](_0xbea801[_0xb8d2('0x36')],qs['fields'](_0x2a1b45['query'][_0xb8d2('0x38')]));_0x3d0f23[_0xb8d2('0x37')]=_0x3d0f23[_0xb8d2('0x37')][_0xb8d2('0x39')]?_0x3d0f23[_0xb8d2('0x37')]:_0xbea801[_0xb8d2('0x36')];if(_0x2a1b45[_0xb8d2('0x33')][_0xb8d2('0x48')]){_0x3d0f23[_0xb8d2('0x42')]=[{'all':!![]}];}_0x3d0f23=_[_0xb8d2('0x49')]({},_0x3d0f23,_0x2a1b45[_0xb8d2('0x41')]);return db['AnalyticExtractedReport'][_0xb8d2('0x4a')](_0x3d0f23)['then'](handleEntityNotFound(_0x3e8310,null))[_0xb8d2('0x25')](respondWithResult(_0x3e8310,null))[_0xb8d2('0x44')](handleError(_0x3e8310,null));};exports[_0xb8d2('0x4b')]=function(_0x673839,_0x22ba4c){return db[_0xb8d2('0x2d')][_0xb8d2('0x4b')](_0x673839[_0xb8d2('0x4c')],{})[_0xb8d2('0x25')](function(_0x5285f5){var _0x200a6d=_0x673839[_0xb8d2('0x4d')][_0xb8d2('0x27')]({'plain':!![]});if(!_0x200a6d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x200a6d[_0xb8d2('0x4e')]==='user'){var _0xd7e100=_0x5285f5[_0xb8d2('0x27')]({'plain':!![]});var _0x452a7f=_0xb8d2('0x28');return db[_0xb8d2('0x4f')][_0xb8d2('0x4a')]({'where':{'name':_0x452a7f,'userProfileId':_0x200a6d[_0xb8d2('0x50')]},'raw':!![]})[_0xb8d2('0x25')](function(_0x3de457){if(_0x3de457&&_0x3de457[_0xb8d2('0x51')]===0x0){return db[_0xb8d2('0x52')][_0xb8d2('0x4b')]({'name':_0xd7e100[_0xb8d2('0x2a')],'resourceId':_0xd7e100['id'],'type':_0x3de457['name'],'sectionId':_0x3de457['id']},{})[_0xb8d2('0x25')](function(){return _0x5285f5;});}else{return _0x5285f5;}})[_0xb8d2('0x44')](function(_0x2e5821){logger[_0xb8d2('0x53')](_0xb8d2('0x54'),_0x2e5821);throw _0x2e5821;});}return _0x5285f5;})[_0xb8d2('0x25')](respondWithResult(_0x22ba4c,0xc9))[_0xb8d2('0x44')](handleError(_0x22ba4c,null));};exports['update']=function(_0x2213b5,_0x5bccb0){if(_0x2213b5[_0xb8d2('0x4c')]['id']){delete _0x2213b5[_0xb8d2('0x4c')]['id'];}return db[_0xb8d2('0x2d')]['find']({'where':{'id':_0x2213b5[_0xb8d2('0x46')]['id']}})[_0xb8d2('0x25')](handleEntityNotFound(_0x5bccb0,null))[_0xb8d2('0x25')](saveUpdates(_0x2213b5['body'],null))[_0xb8d2('0x25')](respondWithResult(_0x5bccb0,null))[_0xb8d2('0x44')](handleError(_0x5bccb0,null));};exports[_0xb8d2('0x26')]=function(_0x15d19d,_0x40c5b3){return db[_0xb8d2('0x2d')][_0xb8d2('0x4a')]({'where':{'id':_0x15d19d[_0xb8d2('0x46')]['id']}})[_0xb8d2('0x25')](handleEntityNotFound(_0x40c5b3,null))[_0xb8d2('0x25')](removeEntity(_0x40c5b3,null))[_0xb8d2('0x44')](handleError(_0x40c5b3,null));};exports[_0xb8d2('0x55')]=function(_0x14e672,_0x2eda95,_0x5b96fd){return db[_0xb8d2('0x2d')][_0xb8d2('0x4a')]({'where':{'id':_0x14e672['params']['id']},'attributes':[_0xb8d2('0x2a'),_0xb8d2('0x56'),_0xb8d2('0x57'),_0xb8d2('0x58')],'raw':!![]})[_0xb8d2('0x25')](handleEntityNotFound(_0x2eda95,null))['then'](function(_0x9d25ed){if(_0x9d25ed){if(!fs[_0xb8d2('0x59')](path[_0xb8d2('0x5a')](config[_0xb8d2('0x5b')],'server/files/reports',_0x9d25ed[_0xb8d2('0x57')]))){throw new db[(_0xb8d2('0x5c'))][(_0xb8d2('0x5d'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x14e672[_0xb8d2('0x33')][_0xb8d2('0x5e')]){return _0x2eda95[_0xb8d2('0x18')](0xc8);}return _0x2eda95[_0xb8d2('0x55')](path['join'](config[_0xb8d2('0x5b')],'server/files/reports',_0x9d25ed[_0xb8d2('0x57')]),util['format'](_0xb8d2('0x5f'),_0x9d25ed['basename']||_0x9d25ed[_0xb8d2('0x2a')],_0x9d25ed[_0xb8d2('0x58')][_0xb8d2('0x60')]()));}})['catch'](handleError(_0x2eda95,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 1451a09..8d25b9b 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 _0xc5f8=['api','moment','bluebird','request-promise','path','../../config/environment','exports','AnalyticExtractedReport','lodash'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xc5f8,0x74));var _0x8c5f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc5f8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8c5f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8c5f('0x1'));var moment=require(_0x8c5f('0x2'));var BPromise=require(_0x8c5f('0x3'));var rp=require(_0x8c5f('0x4'));var fs=require('fs');var path=require(_0x8c5f('0x5'));var rimraf=require('rimraf');var config=require(_0x8c5f('0x6'));var attributes=require('./analyticExtractedReport.attributes');module[_0x8c5f('0x7')]=function(_0x13bbbc,_0x305aad){return _0x13bbbc['define'](_0x8c5f('0x8'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x87e8=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','define','AnalyticExtractedReport','analytics_extracted_reports','lodash'];(function(_0x39f28f,_0x352bf1){var _0x595e11=function(_0x1d9da8){while(--_0x1d9da8){_0x39f28f['push'](_0x39f28f['shift']());}};_0x595e11(++_0x352bf1);}(_0x87e8,0x151));var _0x887e=function(_0x492990,_0x2e8cd4){_0x492990=_0x492990-0x0;var _0x1daa7c=_0x87e8[_0x492990];return _0x1daa7c;};'use strict';var _=require(_0x887e('0x0'));var util=require(_0x887e('0x1'));var logger=require(_0x887e('0x2'))(_0x887e('0x3'));var moment=require(_0x887e('0x4'));var BPromise=require('bluebird');var rp=require(_0x887e('0x5'));var fs=require('fs');var path=require(_0x887e('0x6'));var rimraf=require(_0x887e('0x7'));var config=require(_0x887e('0x8'));var attributes=require(_0x887e('0x9'));module['exports']=function(_0x10dacc,_0x22c1e4){return _0x10dacc[_0x887e('0xa')](_0x887e('0xb'),attributes,{'tableName':_0x887e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index fdcb607..3f51d70 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 _0xb375=['jayson/promise','http','request','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment'];(function(_0x355059,_0x3e089c){var _0x146343=function(_0x50e027){while(--_0x50e027){_0x355059['push'](_0x355059['shift']());}};_0x146343(++_0x3e089c);}(_0xb375,0x9f));var _0x5b37=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb375[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5b37('0x0'));var util=require(_0x5b37('0x1'));var moment=require(_0x5b37('0x2'));var BPromise=require(_0x5b37('0x3'));var rs=require(_0x5b37('0x4'));var fs=require('fs');var Redis=require(_0x5b37('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5b37('0x6'))(_0x5b37('0x7'));var config=require(_0x5b37('0x8'));var jayson=require(_0x5b37('0x9'));var client=jayson['client'][_0x5b37('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x44f4ce,_0x122aac,_0xd9c66f){return new BPromise(function(_0x24145b,_0x3c3861){return client[_0x5b37('0xb')](_0x44f4ce,_0xd9c66f)['then'](function(_0x51b17a){logger[_0x5b37('0xc')](_0x5b37('0xd'),_0x122aac,_0x5b37('0xe'));logger[_0x5b37('0xf')](_0x5b37('0x10'),_0x122aac,'request\x20sent',JSON['stringify'](_0x51b17a));if(_0x51b17a[_0x5b37('0x11')]){if(_0x51b17a[_0x5b37('0x11')][_0x5b37('0x12')]===0x1f4){logger[_0x5b37('0x11')](_0x5b37('0xd'),_0x122aac,_0x51b17a['error'][_0x5b37('0x13')]);return _0x3c3861(_0x51b17a['error'][_0x5b37('0x13')]);}logger[_0x5b37('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x122aac,_0x51b17a['error'][_0x5b37('0x13')]);return _0x24145b(_0x51b17a[_0x5b37('0x11')]['message']);}else{logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x122aac,_0x5b37('0xe'));_0x24145b(_0x51b17a['result'][_0x5b37('0x13')]);}})[_0x5b37('0x14')](function(_0x408bba){logger[_0x5b37('0x11')](_0x5b37('0xd'),_0x122aac,_0x408bba);_0x3c3861(_0x408bba);});});}
\ No newline at end of file
+var _0x08df=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x100682,_0x11afec){var _0xcb6e87=function(_0x3ef421){while(--_0x3ef421){_0x100682['push'](_0x100682['shift']());}};_0xcb6e87(++_0x11afec);}(_0x08df,0xe6));var _0xf08d=function(_0x2f2360,_0x151089){_0x2f2360=_0x2f2360-0x0;var _0x1cc8d3=_0x08df[_0x2f2360];return _0x1cc8d3;};'use strict';var _=require(_0xf08d('0x0'));var util=require(_0xf08d('0x1'));var moment=require('moment');var BPromise=require(_0xf08d('0x2'));var rs=require(_0xf08d('0x3'));var fs=require('fs');var Redis=require(_0xf08d('0x4'));var db=require(_0xf08d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf08d('0x6'))(_0xf08d('0x7'));var config=require(_0xf08d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf08d('0x9')][_0xf08d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37cdbc,_0x2a47f0,_0x25496f){return new BPromise(function(_0x41eefa,_0x5963ed){return client[_0xf08d('0xb')](_0x37cdbc,_0x25496f)[_0xf08d('0xc')](function(_0x2ee081){logger[_0xf08d('0xd')](_0xf08d('0xe'),_0x2a47f0,_0xf08d('0xf'));logger[_0xf08d('0x10')](_0xf08d('0x11'),_0x2a47f0,'request\x20sent',JSON[_0xf08d('0x12')](_0x2ee081));if(_0x2ee081[_0xf08d('0x13')]){if(_0x2ee081[_0xf08d('0x13')][_0xf08d('0x14')]===0x1f4){logger[_0xf08d('0x13')](_0xf08d('0xe'),_0x2a47f0,_0x2ee081['error'][_0xf08d('0x15')]);return _0x5963ed(_0x2ee081[_0xf08d('0x13')][_0xf08d('0x15')]);}logger['error'](_0xf08d('0xe'),_0x2a47f0,_0x2ee081['error'][_0xf08d('0x15')]);return _0x41eefa(_0x2ee081[_0xf08d('0x13')]['message']);}else{logger[_0xf08d('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x2a47f0,_0xf08d('0xf'));_0x41eefa(_0x2ee081['result'][_0xf08d('0x15')]);}})[_0xf08d('0x16')](function(_0x4e7ca9){logger[_0xf08d('0x13')](_0xf08d('0xe'),_0x2a47f0,_0x4e7ca9);_0x5963ed(_0x4e7ca9);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 6ea197c..f44a0c7 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 _0xedcf=['show','/:id/download','download','post','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index'];(function(_0x37e52a,_0x493694){var _0x6ca662=function(_0x4dafc5){while(--_0x4dafc5){_0x37e52a['push'](_0x37e52a['shift']());}};_0x6ca662(++_0x493694);}(_0xedcf,0x191));var _0xfedc=function(_0x367354,_0x1b5cd1){_0x367354=_0x367354-0x0;var _0x9a51eb=_0xedcf[_0x367354];return _0x9a51eb;};'use strict';var multer=require(_0xfedc('0x0'));var util=require(_0xfedc('0x1'));var path=require(_0xfedc('0x2'));var timeout=require(_0xfedc('0x3'));var express=require('express');var router=express[_0xfedc('0x4')]();var fs_extra=require(_0xfedc('0x5'));var auth=require(_0xfedc('0x6'));var interaction=require(_0xfedc('0x7'));var config=require(_0xfedc('0x8'));var controller=require(_0xfedc('0x9'));router[_0xfedc('0xa')]('/',auth[_0xfedc('0xb')](),controller[_0xfedc('0xc')]);router[_0xfedc('0xa')]('/:id',auth[_0xfedc('0xb')](),controller[_0xfedc('0xd')]);router['get'](_0xfedc('0xe'),auth[_0xfedc('0xb')](),controller[_0xfedc('0xf')]);router[_0xfedc('0x10')]('/',auth[_0xfedc('0xb')](),controller[_0xfedc('0x11')]);router[_0xfedc('0x12')](_0xfedc('0x13'),auth[_0xfedc('0xb')](),controller['update']);router[_0xfedc('0x14')](_0xfedc('0x13'),auth[_0xfedc('0xb')](),controller[_0xfedc('0x15')]);module[_0xfedc('0x16')]=router;
\ No newline at end of file
+var _0x0535=['show','/:id/download','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','/:id'];(function(_0x3b1027,_0x5bc8c6){var _0xb75f51=function(_0x1fe49d){while(--_0x1fe49d){_0x3b1027['push'](_0x3b1027['shift']());}};_0xb75f51(++_0x5bc8c6);}(_0x0535,0x1eb));var _0x5053=function(_0x586aa0,_0x3f4b42){_0x586aa0=_0x586aa0-0x0;var _0xc91e96=_0x0535[_0x586aa0];return _0xc91e96;};'use strict';var multer=require(_0x5053('0x0'));var util=require(_0x5053('0x1'));var path=require(_0x5053('0x2'));var timeout=require(_0x5053('0x3'));var express=require(_0x5053('0x4'));var router=express['Router']();var fs_extra=require(_0x5053('0x5'));var auth=require(_0x5053('0x6'));var interaction=require(_0x5053('0x7'));var config=require(_0x5053('0x8'));var controller=require(_0x5053('0x9'));router[_0x5053('0xa')]('/',auth[_0x5053('0xb')](),controller['index']);router['get'](_0x5053('0xc'),auth['isAuthenticated'](),controller[_0x5053('0xd')]);router[_0x5053('0xa')](_0x5053('0xe'),auth[_0x5053('0xb')](),controller['download']);router[_0x5053('0xf')]('/',auth[_0x5053('0xb')](),controller[_0x5053('0x10')]);router[_0x5053('0x11')](_0x5053('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x5053('0x12')](_0x5053('0xc'),auth[_0x5053('0xb')](),controller[_0x5053('0x13')]);module[_0x5053('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 9accd8e..f1e8603 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 _0xe7bb=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x371f33,_0x278a69){var _0x246c96=function(_0x4f8bad){while(--_0x4f8bad){_0x371f33['push'](_0x371f33['shift']());}};_0x246c96(++_0x278a69);}(_0xe7bb,0x148));var _0xbe7b=function(_0x4797a1,_0x2f87fb){_0x4797a1=_0x4797a1-0x0;var _0x20e3ea=_0xe7bb[_0x4797a1];return _0x20e3ea;};'use strict';var Sequelize=require(_0xbe7b('0x0'));module[_0xbe7b('0x1')]={'field':{'type':Sequelize[_0xbe7b('0x2')]},'alias':{'type':Sequelize[_0xbe7b('0x3')]},'function':{'type':Sequelize[_0xbe7b('0x3')]},'format':{'type':Sequelize[_0xbe7b('0x3')]},'groupBy':{'type':Sequelize[_0xbe7b('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xbe7b('0x3')]},'custom':{'type':Sequelize[_0xbe7b('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0x16ca=['sequelize','exports','STRING','BOOLEAN'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0x16ca,0x1d4));var _0xa16c=function(_0x4998bd,_0x3faca9){_0x4998bd=_0x4998bd-0x0;var _0x5d4b6c=_0x16ca[_0x4998bd];return _0x5d4b6c;};'use strict';var Sequelize=require(_0xa16c('0x0'));module[_0xa16c('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0xa16c('0x2')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0xa16c('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xa16c('0x2')]},'custom':{'type':Sequelize[_0xa16c('0x3')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 5c4a496..1a3cfae 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 _0x37f8=['find','create','body','bulkCreate','destroy','bulkDestroy','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','AnalyticFieldReport','includeAll','findAll','rows','catch','show','params','length','include'];(function(_0x1f8ff1,_0x4157a1){var _0x56e65b=function(_0x4953ee){while(--_0x4953ee){_0x1f8ff1['push'](_0x1f8ff1['shift']());}};_0x56e65b(++_0x4157a1);}(_0x37f8,0x1ab));var _0x837f=function(_0x5df89d,_0x2f3a0e){_0x5df89d=_0x5df89d-0x0;var _0x319c4c=_0x37f8[_0x5df89d];return _0x319c4c;};'use strict';var emlformat=require(_0x837f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x837f('0x1'));var rp=require(_0x837f('0x2'));var moment=require(_0x837f('0x3'));var BPromise=require(_0x837f('0x4'));var Mustache=require(_0x837f('0x5'));var util=require('util');var path=require(_0x837f('0x6'));var sox=require(_0x837f('0x7'));var csv=require(_0x837f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x837f('0x9'));var _=require(_0x837f('0xa'));var squel=require('squel');var crypto=require(_0x837f('0xb'));var jsforce=require(_0x837f('0xc'));var deskjs=require(_0x837f('0xd'));var toCsv=require(_0x837f('0x8'));var querystring=require(_0x837f('0xe'));var Papa=require(_0x837f('0xf'));var Redis=require(_0x837f('0x10'));var authService=require(_0x837f('0x11'));var qs=require(_0x837f('0x12'));var as=require(_0x837f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x837f('0x14'))(_0x837f('0x15'));var utils=require(_0x837f('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x837f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2cc2db,_0x2ae8b4){_0x2ae8b4=_0x2ae8b4||0xcc;return function(_0x117ba8){if(_0x117ba8){return _0x2cc2db['sendStatus'](_0x2ae8b4);}return _0x2cc2db[_0x837f('0x18')](_0x2ae8b4)[_0x837f('0x19')]();};}function respondWithResult(_0x37962d,_0x5c27db){_0x5c27db=_0x5c27db||0xc8;return function(_0x346654){if(_0x346654){return _0x37962d[_0x837f('0x18')](_0x5c27db)['json'](_0x346654);}};}function respondWithFilteredResult(_0x30edaa,_0x25b4f6){return function(_0x27dac2){if(_0x27dac2){var _0x3e54a1=typeof _0x25b4f6[_0x837f('0x1a')]===_0x837f('0x1b')&&typeof _0x25b4f6[_0x837f('0x1c')]===_0x837f('0x1b');var _0xa1e8e3=_0x27dac2[_0x837f('0x1d')];var _0x1e6bad=_0x3e54a1?0x0:_0x25b4f6[_0x837f('0x1a')];var _0x5885e5=_0x3e54a1?_0x27dac2[_0x837f('0x1d')]:_0x25b4f6[_0x837f('0x1a')]+_0x25b4f6[_0x837f('0x1c')];var _0x2b0340;if(_0x5885e5>=_0xa1e8e3){_0x5885e5=_0xa1e8e3;_0x2b0340=0xc8;}else{_0x2b0340=0xce;}_0x30edaa['status'](_0x2b0340);return _0x30edaa[_0x837f('0x1e')](_0x837f('0x1f'),_0x1e6bad+'-'+_0x5885e5+'/'+_0xa1e8e3)[_0x837f('0x20')](_0x27dac2);}return null;};}function patchUpdates(_0x43342d){return function(_0x91ee59){try{jsonpatch[_0x837f('0x21')](_0x91ee59,_0x43342d,!![]);}catch(_0x16fdbd){return BPromise['reject'](_0x16fdbd);}return _0x91ee59['save']();};}function saveUpdates(_0x3ba0d6,_0x1c642f){return function(_0x4748be){if(_0x4748be){return _0x4748be[_0x837f('0x22')](_0x3ba0d6)[_0x837f('0x23')](function(_0x1bccc8){return _0x1bccc8;});}return null;};}function removeEntity(_0x3a5ae8,_0x503bb7){return function(_0x783781){if(_0x783781){return _0x783781['destroy']()[_0x837f('0x23')](function(){_0x3a5ae8[_0x837f('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2becca,_0x219312){return function(_0x395bfc){if(!_0x395bfc){_0x2becca[_0x837f('0x24')](0x194);}return _0x395bfc;};}function handleError(_0x5dc635,_0x5f4f70){_0x5f4f70=_0x5f4f70||0x1f4;return function(_0x22511b){logger[_0x837f('0x25')](_0x22511b['stack']);if(_0x22511b[_0x837f('0x26')]){delete _0x22511b[_0x837f('0x26')];}_0x5dc635[_0x837f('0x18')](_0x5f4f70)[_0x837f('0x27')](_0x22511b);};}exports[_0x837f('0x28')]=function(_0x1e9212,_0x206241){var _0x450f3e={},_0x4c682a={},_0x3a96d7={'count':0x0,'rows':[]};var _0x507151=_[_0x837f('0x29')](db['AnalyticFieldReport'][_0x837f('0x2a')],function(_0x5e1ca4){return{'name':_0x5e1ca4[_0x837f('0x2b')],'type':_0x5e1ca4[_0x837f('0x2c')][_0x837f('0x2d')]};});_0x4c682a[_0x837f('0x2e')]=_[_0x837f('0x29')](_0x507151,'name');_0x4c682a[_0x837f('0x2f')]=_[_0x837f('0x30')](_0x1e9212[_0x837f('0x2f')]);_0x4c682a[_0x837f('0x31')]=_[_0x837f('0x32')](_0x4c682a[_0x837f('0x2e')],_0x4c682a[_0x837f('0x2f')]);_0x450f3e[_0x837f('0x33')]=_[_0x837f('0x32')](_0x4c682a[_0x837f('0x2e')],qs[_0x837f('0x34')](_0x1e9212['query'][_0x837f('0x34')]));_0x450f3e[_0x837f('0x33')]=_0x450f3e[_0x837f('0x33')]['length']?_0x450f3e[_0x837f('0x33')]:_0x4c682a['model'];if(!_0x1e9212[_0x837f('0x2f')]['hasOwnProperty'](_0x837f('0x35'))){_0x450f3e['limit']=qs[_0x837f('0x1c')](_0x1e9212[_0x837f('0x2f')][_0x837f('0x1c')]);_0x450f3e[_0x837f('0x1a')]=qs[_0x837f('0x1a')](_0x1e9212['query'][_0x837f('0x1a')]);}_0x450f3e[_0x837f('0x36')]=qs[_0x837f('0x37')](_0x1e9212[_0x837f('0x2f')]['sort']);_0x450f3e['where']=qs['filters'](_[_0x837f('0x38')](_0x1e9212[_0x837f('0x2f')],_0x4c682a[_0x837f('0x31')]),_0x507151);if(_0x1e9212['query'][_0x837f('0x39')]){_0x450f3e[_0x837f('0x3a')]=_[_0x837f('0x3b')](_0x450f3e[_0x837f('0x3a')],{'$or':_[_0x837f('0x29')](_0x507151,function(_0x3b127c){if(_0x3b127c[_0x837f('0x2c')]!==_0x837f('0x3c')){var _0x2092d0={};_0x2092d0[_0x3b127c[_0x837f('0x26')]]={'$like':'%'+_0x1e9212[_0x837f('0x2f')][_0x837f('0x39')]+'%'};return _0x2092d0;}})});}_0x450f3e=_[_0x837f('0x3b')]({},_0x450f3e,_0x1e9212[_0x837f('0x3d')]);var _0x237c8c={'where':_0x450f3e[_0x837f('0x3a')]};return db[_0x837f('0x3e')][_0x837f('0x1d')](_0x237c8c)['then'](function(_0x2f68de){_0x3a96d7[_0x837f('0x1d')]=_0x2f68de;if(_0x1e9212[_0x837f('0x2f')][_0x837f('0x3f')]){_0x450f3e['include']=[{'all':!![]}];}return db[_0x837f('0x3e')][_0x837f('0x40')](_0x450f3e);})['then'](function(_0x2f9325){_0x3a96d7[_0x837f('0x41')]=_0x2f9325;return _0x3a96d7;})[_0x837f('0x23')](respondWithFilteredResult(_0x206241,_0x450f3e))[_0x837f('0x42')](handleError(_0x206241,null));};exports[_0x837f('0x43')]=function(_0x32edca,_0x1ed168){var _0x197261={'raw':![],'where':{'id':_0x32edca[_0x837f('0x44')]['id']}},_0x36e1d8={};_0x36e1d8[_0x837f('0x2e')]=_[_0x837f('0x30')](db[_0x837f('0x3e')]['rawAttributes']);_0x36e1d8['query']=_[_0x837f('0x30')](_0x32edca['query']);_0x36e1d8[_0x837f('0x31')]=_[_0x837f('0x32')](_0x36e1d8[_0x837f('0x2e')],_0x36e1d8[_0x837f('0x2f')]);_0x197261[_0x837f('0x33')]=_[_0x837f('0x32')](_0x36e1d8[_0x837f('0x2e')],qs[_0x837f('0x34')](_0x32edca['query']['fields']));_0x197261[_0x837f('0x33')]=_0x197261[_0x837f('0x33')][_0x837f('0x45')]?_0x197261[_0x837f('0x33')]:_0x36e1d8[_0x837f('0x2e')];if(_0x32edca['query']['includeAll']){_0x197261[_0x837f('0x46')]=[{'all':!![]}];}_0x197261=_[_0x837f('0x3b')]({},_0x197261,_0x32edca[_0x837f('0x3d')]);return db[_0x837f('0x3e')][_0x837f('0x47')](_0x197261)[_0x837f('0x23')](handleEntityNotFound(_0x1ed168,null))[_0x837f('0x23')](respondWithResult(_0x1ed168,null))['catch'](handleError(_0x1ed168,null));};exports[_0x837f('0x48')]=function(_0x1f0312,_0x356dbd){return db[_0x837f('0x3e')]['create'](_0x1f0312[_0x837f('0x49')],{})[_0x837f('0x23')](respondWithResult(_0x356dbd,0xc9))[_0x837f('0x42')](handleError(_0x356dbd,null));};exports[_0x837f('0x4a')]=function(_0x588001,_0x1572ac){return db[_0x837f('0x3e')][_0x837f('0x4a')](_0x588001[_0x837f('0x49')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x1572ac,0xc9))[_0x837f('0x42')](handleError(_0x1572ac,null));};exports[_0x837f('0x22')]=function(_0x15a408,_0x20c3ec){if(_0x15a408[_0x837f('0x49')]['id']){delete _0x15a408[_0x837f('0x49')]['id'];}return db['AnalyticFieldReport'][_0x837f('0x47')]({'where':{'id':_0x15a408['params']['id']}})[_0x837f('0x23')](handleEntityNotFound(_0x20c3ec,null))[_0x837f('0x23')](saveUpdates(_0x15a408['body'],null))['then'](respondWithResult(_0x20c3ec,null))['catch'](handleError(_0x20c3ec,null));};exports[_0x837f('0x4b')]=function(_0x11508e,_0x2cea90){return db['AnalyticFieldReport'][_0x837f('0x47')]({'where':{'id':_0x11508e[_0x837f('0x44')]['id']}})['then'](handleEntityNotFound(_0x2cea90,null))[_0x837f('0x23')](removeEntity(_0x2cea90,null))['catch'](handleError(_0x2cea90,null));};exports[_0x837f('0x4c')]=function(_0x4ff27f,_0x1adbbb){return db[_0x837f('0x3e')]['destroy']({'where':{'id':_0x4ff27f[_0x837f('0x2f')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0x837f('0x23')](respondWithResult(_0x1adbbb,0xcc))[_0x837f('0x42')](handleError(_0x1adbbb,null));};exports[_0x837f('0x4d')]=function(_0x57c62d,_0x3be0e4,_0x134bb1){return db[_0x837f('0x4e')][_0x837f('0x4f')]({'where':{'id':_0x57c62d[_0x837f('0x44')]['id']}})['then'](handleEntityNotFound(_0x3be0e4,null))['then'](function(_0x34271c){if(_0x34271c){return db[_0x837f('0x50')][_0x837f('0x51')](function(_0x257b1b){return db[_0x837f('0x3e')][_0x837f('0x4b')]({'where':{'CustomReportId':_0x57c62d['params']['id']},'transaction':_0x257b1b})['then'](function(_0x3e514b){var _0x498d11=_[_0x837f('0x29')](_0x57c62d[_0x837f('0x49')],function(_0x5ebd48){delete _0x5ebd48['id'];_0x5ebd48[_0x837f('0x52')]=_0x57c62d[_0x837f('0x44')]['id'];return _0x5ebd48;});return db['AnalyticFieldReport'][_0x837f('0x4a')](_0x498d11,{'transaction':_0x257b1b});});})['then'](function(){return db['AnalyticFieldReport']['findAll']({'where':{'CustomReportId':_0x57c62d[_0x837f('0x44')]['id']}});});}})['then'](respondWithResult(_0x3be0e4,null))[_0x837f('0x42')](handleError(_0x3be0e4,null));};
\ No newline at end of file
+var _0xa8f8=['fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','options','AnalyticFieldReport','includeAll','include','findAll','rows','show','params','find','create','body','catch','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','transaction','CustomReportId','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes'];(function(_0x1665d9,_0x18304c){var _0x48f948=function(_0x1674f1){while(--_0x1674f1){_0x1665d9['push'](_0x1665d9['shift']());}};_0x48f948(++_0x18304c);}(_0xa8f8,0xcf));var _0x8a8f=function(_0xdb5808,_0x58c067){_0xdb5808=_0xdb5808-0x0;var _0x111072=_0xa8f8[_0xdb5808];return _0x111072;};'use strict';var emlformat=require(_0x8a8f('0x0'));var rimraf=require(_0x8a8f('0x1'));var zipdir=require(_0x8a8f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8a8f('0x3'));var moment=require('moment');var BPromise=require(_0x8a8f('0x4'));var Mustache=require(_0x8a8f('0x5'));var util=require(_0x8a8f('0x6'));var path=require(_0x8a8f('0x7'));var sox=require(_0x8a8f('0x8'));var csv=require('to-csv');var ejs=require(_0x8a8f('0x9'));var fs=require('fs');var fs_extra=require(_0x8a8f('0xa'));var _=require(_0x8a8f('0xb'));var squel=require(_0x8a8f('0xc'));var crypto=require('crypto');var jsforce=require(_0x8a8f('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8a8f('0xe'));var Papa=require('papaparse');var Redis=require(_0x8a8f('0xf'));var authService=require(_0x8a8f('0x10'));var qs=require(_0x8a8f('0x11'));var as=require(_0x8a8f('0x12'));var hardwareService=require(_0x8a8f('0x13'));var logger=require(_0x8a8f('0x14'))('api');var utils=require(_0x8a8f('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x8a8f('0x16'));var db=require(_0x8a8f('0x17'))['db'];function respondWithStatusCode(_0x1601c8,_0x357301){_0x357301=_0x357301||0xcc;return function(_0x196e96){if(_0x196e96){return _0x1601c8[_0x8a8f('0x18')](_0x357301);}return _0x1601c8['status'](_0x357301)['end']();};}function respondWithResult(_0x2938b7,_0x512021){_0x512021=_0x512021||0xc8;return function(_0x5aa639){if(_0x5aa639){return _0x2938b7['status'](_0x512021)[_0x8a8f('0x19')](_0x5aa639);}};}function respondWithFilteredResult(_0x558b68,_0x130dd7){return function(_0x66d2b9){if(_0x66d2b9){var _0x4d2595=typeof _0x130dd7[_0x8a8f('0x1a')]===_0x8a8f('0x1b')&&typeof _0x130dd7[_0x8a8f('0x1c')]==='undefined';var _0x207e78=_0x66d2b9[_0x8a8f('0x1d')];var _0x3a97e0=_0x4d2595?0x0:_0x130dd7['offset'];var _0x4592cf=_0x4d2595?_0x66d2b9[_0x8a8f('0x1d')]:_0x130dd7[_0x8a8f('0x1a')]+_0x130dd7[_0x8a8f('0x1c')];var _0x51ad9e;if(_0x4592cf>=_0x207e78){_0x4592cf=_0x207e78;_0x51ad9e=0xc8;}else{_0x51ad9e=0xce;}_0x558b68[_0x8a8f('0x1e')](_0x51ad9e);return _0x558b68[_0x8a8f('0x1f')](_0x8a8f('0x20'),_0x3a97e0+'-'+_0x4592cf+'/'+_0x207e78)[_0x8a8f('0x19')](_0x66d2b9);}return null;};}function patchUpdates(_0x72f6be){return function(_0x9db74d){try{jsonpatch[_0x8a8f('0x21')](_0x9db74d,_0x72f6be,!![]);}catch(_0x4c3db){return BPromise[_0x8a8f('0x22')](_0x4c3db);}return _0x9db74d['save']();};}function saveUpdates(_0x43cb3e,_0x2311a6){return function(_0x3e95b8){if(_0x3e95b8){return _0x3e95b8[_0x8a8f('0x23')](_0x43cb3e)[_0x8a8f('0x24')](function(_0xc008c4){return _0xc008c4;});}return null;};}function removeEntity(_0x1c3c75,_0xb3e52e){return function(_0xa5216e){if(_0xa5216e){return _0xa5216e[_0x8a8f('0x25')]()[_0x8a8f('0x24')](function(){_0x1c3c75[_0x8a8f('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe5d97e,_0x48be8e){return function(_0x1b7cbf){if(!_0x1b7cbf){_0xe5d97e[_0x8a8f('0x18')](0x194);}return _0x1b7cbf;};}function handleError(_0x39b97d,_0x2d82de){_0x2d82de=_0x2d82de||0x1f4;return function(_0x19cd4d){logger[_0x8a8f('0x26')](_0x19cd4d[_0x8a8f('0x27')]);if(_0x19cd4d[_0x8a8f('0x28')]){delete _0x19cd4d[_0x8a8f('0x28')];}_0x39b97d['status'](_0x2d82de)[_0x8a8f('0x29')](_0x19cd4d);};}exports[_0x8a8f('0x2a')]=function(_0x3034a1,_0x5f4fae){var _0x166017={},_0x3c2c8f={},_0x8e530b={'count':0x0,'rows':[]};var _0x2052dd=_[_0x8a8f('0x2b')](db['AnalyticFieldReport'][_0x8a8f('0x2c')],function(_0x3bd6d4){return{'name':_0x3bd6d4[_0x8a8f('0x2d')],'type':_0x3bd6d4[_0x8a8f('0x2e')][_0x8a8f('0x2f')]};});_0x3c2c8f[_0x8a8f('0x30')]=_[_0x8a8f('0x2b')](_0x2052dd,_0x8a8f('0x28'));_0x3c2c8f[_0x8a8f('0x31')]=_[_0x8a8f('0x32')](_0x3034a1[_0x8a8f('0x31')]);_0x3c2c8f[_0x8a8f('0x33')]=_['intersection'](_0x3c2c8f['model'],_0x3c2c8f[_0x8a8f('0x31')]);_0x166017[_0x8a8f('0x34')]=_[_0x8a8f('0x35')](_0x3c2c8f[_0x8a8f('0x30')],qs['fields'](_0x3034a1[_0x8a8f('0x31')][_0x8a8f('0x36')]));_0x166017[_0x8a8f('0x34')]=_0x166017[_0x8a8f('0x34')][_0x8a8f('0x37')]?_0x166017['attributes']:_0x3c2c8f[_0x8a8f('0x30')];if(!_0x3034a1[_0x8a8f('0x31')][_0x8a8f('0x38')]('nolimit')){_0x166017[_0x8a8f('0x1c')]=qs[_0x8a8f('0x1c')](_0x3034a1['query'][_0x8a8f('0x1c')]);_0x166017['offset']=qs[_0x8a8f('0x1a')](_0x3034a1['query'][_0x8a8f('0x1a')]);}_0x166017[_0x8a8f('0x39')]=qs['sort'](_0x3034a1['query'][_0x8a8f('0x3a')]);_0x166017[_0x8a8f('0x3b')]=qs[_0x8a8f('0x33')](_[_0x8a8f('0x3c')](_0x3034a1[_0x8a8f('0x31')],_0x3c2c8f[_0x8a8f('0x33')]),_0x2052dd);if(_0x3034a1[_0x8a8f('0x31')]['filter']){_0x166017[_0x8a8f('0x3b')]=_['merge'](_0x166017['where'],{'$or':_[_0x8a8f('0x2b')](_0x2052dd,function(_0x1504bf){if(_0x1504bf[_0x8a8f('0x2e')]!==_0x8a8f('0x3d')){var _0x198f3f={};_0x198f3f[_0x1504bf['name']]={'$like':'%'+_0x3034a1[_0x8a8f('0x31')][_0x8a8f('0x3e')]+'%'};return _0x198f3f;}})});}_0x166017=_[_0x8a8f('0x3f')]({},_0x166017,_0x3034a1[_0x8a8f('0x40')]);var _0x5c937c={'where':_0x166017[_0x8a8f('0x3b')]};return db[_0x8a8f('0x41')][_0x8a8f('0x1d')](_0x5c937c)['then'](function(_0x34de0e){_0x8e530b[_0x8a8f('0x1d')]=_0x34de0e;if(_0x3034a1['query'][_0x8a8f('0x42')]){_0x166017[_0x8a8f('0x43')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x8a8f('0x44')](_0x166017);})[_0x8a8f('0x24')](function(_0x44931b){_0x8e530b[_0x8a8f('0x45')]=_0x44931b;return _0x8e530b;})[_0x8a8f('0x24')](respondWithFilteredResult(_0x5f4fae,_0x166017))['catch'](handleError(_0x5f4fae,null));};exports[_0x8a8f('0x46')]=function(_0x23d95a,_0x3a37e4){var _0x103210={'raw':![],'where':{'id':_0x23d95a[_0x8a8f('0x47')]['id']}},_0x2e12cc={};_0x2e12cc[_0x8a8f('0x30')]=_[_0x8a8f('0x32')](db[_0x8a8f('0x41')][_0x8a8f('0x2c')]);_0x2e12cc[_0x8a8f('0x31')]=_[_0x8a8f('0x32')](_0x23d95a[_0x8a8f('0x31')]);_0x2e12cc[_0x8a8f('0x33')]=_[_0x8a8f('0x35')](_0x2e12cc[_0x8a8f('0x30')],_0x2e12cc['query']);_0x103210[_0x8a8f('0x34')]=_[_0x8a8f('0x35')](_0x2e12cc[_0x8a8f('0x30')],qs[_0x8a8f('0x36')](_0x23d95a[_0x8a8f('0x31')][_0x8a8f('0x36')]));_0x103210[_0x8a8f('0x34')]=_0x103210['attributes'][_0x8a8f('0x37')]?_0x103210[_0x8a8f('0x34')]:_0x2e12cc[_0x8a8f('0x30')];if(_0x23d95a[_0x8a8f('0x31')][_0x8a8f('0x42')]){_0x103210[_0x8a8f('0x43')]=[{'all':!![]}];}_0x103210=_['merge']({},_0x103210,_0x23d95a[_0x8a8f('0x40')]);return db[_0x8a8f('0x41')][_0x8a8f('0x48')](_0x103210)[_0x8a8f('0x24')](handleEntityNotFound(_0x3a37e4,null))[_0x8a8f('0x24')](respondWithResult(_0x3a37e4,null))['catch'](handleError(_0x3a37e4,null));};exports[_0x8a8f('0x49')]=function(_0x3916a7,_0x16fd91){return db[_0x8a8f('0x41')][_0x8a8f('0x49')](_0x3916a7[_0x8a8f('0x4a')],{})['then'](respondWithResult(_0x16fd91,0xc9))[_0x8a8f('0x4b')](handleError(_0x16fd91,null));};exports[_0x8a8f('0x4c')]=function(_0x402dea,_0x729f1e){return db[_0x8a8f('0x41')][_0x8a8f('0x4c')](_0x402dea[_0x8a8f('0x4a')],{'raw':![],'individualHooks':!![]})[_0x8a8f('0x24')](respondWithResult(_0x729f1e,0xc9))[_0x8a8f('0x4b')](handleError(_0x729f1e,null));};exports[_0x8a8f('0x23')]=function(_0x15e237,_0x3c5242){if(_0x15e237[_0x8a8f('0x4a')]['id']){delete _0x15e237[_0x8a8f('0x4a')]['id'];}return db[_0x8a8f('0x41')][_0x8a8f('0x48')]({'where':{'id':_0x15e237['params']['id']}})[_0x8a8f('0x24')](handleEntityNotFound(_0x3c5242,null))['then'](saveUpdates(_0x15e237['body'],null))[_0x8a8f('0x24')](respondWithResult(_0x3c5242,null))[_0x8a8f('0x4b')](handleError(_0x3c5242,null));};exports[_0x8a8f('0x25')]=function(_0x581c5b,_0x2b9a8f){return db[_0x8a8f('0x41')][_0x8a8f('0x48')]({'where':{'id':_0x581c5b['params']['id']}})['then'](handleEntityNotFound(_0x2b9a8f,null))[_0x8a8f('0x24')](removeEntity(_0x2b9a8f,null))[_0x8a8f('0x4b')](handleError(_0x2b9a8f,null));};exports[_0x8a8f('0x4d')]=function(_0x1f7572,_0x27bcbe){return db[_0x8a8f('0x41')][_0x8a8f('0x25')]({'where':{'id':_0x1f7572[_0x8a8f('0x31')][_0x8a8f('0x4e')]||[]},'raw':![],'individualHooks':!![]})[_0x8a8f('0x24')](respondWithResult(_0x27bcbe,0xcc))['catch'](handleError(_0x27bcbe,null));};exports[_0x8a8f('0x4f')]=function(_0xdc9894,_0x52c4ba,_0xf20816){return db[_0x8a8f('0x50')][_0x8a8f('0x51')]({'where':{'id':_0xdc9894['params']['id']}})[_0x8a8f('0x24')](handleEntityNotFound(_0x52c4ba,null))[_0x8a8f('0x24')](function(_0x28bd60){if(_0x28bd60){return db['sequelize'][_0x8a8f('0x52')](function(_0x257b99){return db[_0x8a8f('0x41')][_0x8a8f('0x25')]({'where':{'CustomReportId':_0xdc9894[_0x8a8f('0x47')]['id']},'transaction':_0x257b99})[_0x8a8f('0x24')](function(_0x2c9c8a){var _0x33b3f9=_[_0x8a8f('0x2b')](_0xdc9894['body'],function(_0x15a8fe){delete _0x15a8fe['id'];_0x15a8fe[_0x8a8f('0x53')]=_0xdc9894[_0x8a8f('0x47')]['id'];return _0x15a8fe;});return db[_0x8a8f('0x41')][_0x8a8f('0x4c')](_0x33b3f9,{'transaction':_0x257b99});});})[_0x8a8f('0x24')](function(){return db['AnalyticFieldReport']['findAll']({'where':{'CustomReportId':_0xdc9894[_0x8a8f('0x47')]['id']}});});}})[_0x8a8f('0x24')](respondWithResult(_0x52c4ba,null))[_0x8a8f('0x4b')](handleError(_0x52c4ba,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 6419f67..c59672d 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 _0x45aa=['lodash','api','moment','bluebird','./analyticFieldReport.attributes','exports','define','analytics_report_fields'];(function(_0x56d61c,_0x21707d){var _0x499c05=function(_0x6451b7){while(--_0x6451b7){_0x56d61c['push'](_0x56d61c['shift']());}};_0x499c05(++_0x21707d);}(_0x45aa,0x158));var _0xa45a=function(_0x75ff5c,_0x45c306){_0x75ff5c=_0x75ff5c-0x0;var _0xcffae9=_0x45aa[_0x75ff5c];return _0xcffae9;};'use strict';var _=require(_0xa45a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa45a('0x1'));var moment=require(_0xa45a('0x2'));var BPromise=require(_0xa45a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa45a('0x4'));module[_0xa45a('0x5')]=function(_0x3206d6,_0x5179b3){return _0x3206d6[_0xa45a('0x6')]('AnalyticFieldReport',attributes,{'tableName':_0xa45a('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x97d1=['util','../../config/logger','api','request-promise','path','rimraf','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields'];(function(_0x1b0265,_0x530166){var _0x34a785=function(_0x578623){while(--_0x578623){_0x1b0265['push'](_0x1b0265['shift']());}};_0x34a785(++_0x530166);}(_0x97d1,0x18c));var _0x197d=function(_0x701c5d,_0x47a566){_0x701c5d=_0x701c5d-0x0;var _0x617b08=_0x97d1[_0x701c5d];return _0x617b08;};'use strict';var _=require('lodash');var util=require(_0x197d('0x0'));var logger=require(_0x197d('0x1'))(_0x197d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x197d('0x3'));var fs=require('fs');var path=require(_0x197d('0x4'));var rimraf=require(_0x197d('0x5'));var config=require('../../config/environment');var attributes=require(_0x197d('0x6'));module[_0x197d('0x7')]=function(_0x1981cb,_0x5bd188){return _0x1981cb[_0x197d('0x8')](_0x197d('0x9'),attributes,{'tableName':_0x197d('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 c3ecf8b..c110c5f 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 _0xc357=['client','http','request','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3dd0b9,_0x1d6c92){var _0x4c0351=function(_0x2cf6a8){while(--_0x2cf6a8){_0x3dd0b9['push'](_0x3dd0b9['shift']());}};_0x4c0351(++_0x1d6c92);}(_0xc357,0x1c1));var _0x7c35=function(_0x402373,_0x53fb31){_0x402373=_0x402373-0x0;var _0x25a890=_0xc357[_0x402373];return _0x25a890;};'use strict';var _=require(_0x7c35('0x0'));var util=require(_0x7c35('0x1'));var moment=require(_0x7c35('0x2'));var BPromise=require(_0x7c35('0x3'));var rs=require(_0x7c35('0x4'));var fs=require('fs');var Redis=require(_0x7c35('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7c35('0x6'));var logger=require(_0x7c35('0x7'))(_0x7c35('0x8'));var config=require(_0x7c35('0x9'));var jayson=require(_0x7c35('0xa'));var client=jayson[_0x7c35('0xb')][_0x7c35('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x394e61,_0x20cdf6,_0x4581e4){return new BPromise(function(_0x3d7caf,_0x362d8f){return client[_0x7c35('0xd')](_0x394e61,_0x4581e4)[_0x7c35('0xe')](function(_0x3f64ec){logger['info'](_0x7c35('0xf'),_0x20cdf6,_0x7c35('0x10'));logger['debug'](_0x7c35('0x11'),_0x20cdf6,_0x7c35('0x10'),JSON['stringify'](_0x3f64ec));if(_0x3f64ec[_0x7c35('0x12')]){if(_0x3f64ec[_0x7c35('0x12')]['code']===0x1f4){logger[_0x7c35('0x12')](_0x7c35('0xf'),_0x20cdf6,_0x3f64ec['error'][_0x7c35('0x13')]);return _0x362d8f(_0x3f64ec[_0x7c35('0x12')]['message']);}logger[_0x7c35('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x20cdf6,_0x3f64ec['error'][_0x7c35('0x13')]);return _0x3d7caf(_0x3f64ec[_0x7c35('0x12')][_0x7c35('0x13')]);}else{logger[_0x7c35('0x14')](_0x7c35('0xf'),_0x20cdf6,_0x7c35('0x10'));_0x3d7caf(_0x3f64ec[_0x7c35('0x15')][_0x7c35('0x13')]);}})[_0x7c35('0x16')](function(_0x19b86d){logger[_0x7c35('0x12')](_0x7c35('0xf'),_0x20cdf6,_0x19b86d);_0x362d8f(_0x19b86d);});});}
\ No newline at end of file
+var _0x5eba=['AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x24f890,_0x37890a){var _0x150d59=function(_0x36a83b){while(--_0x36a83b){_0x24f890['push'](_0x24f890['shift']());}};_0x150d59(++_0x37890a);}(_0x5eba,0x15d));var _0xa5eb=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x5eba[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require(_0xa5eb('0x0'));var moment=require(_0xa5eb('0x1'));var BPromise=require(_0xa5eb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa5eb('0x3'));var db=require(_0xa5eb('0x4'))['db'];var utils=require(_0xa5eb('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xa5eb('0x6'));var jayson=require(_0xa5eb('0x7'));var client=jayson[_0xa5eb('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4dc492,_0x2a4e10,_0x14927e){return new BPromise(function(_0x4820cb,_0x37c5a3){return client[_0xa5eb('0x9')](_0x4dc492,_0x14927e)[_0xa5eb('0xa')](function(_0x359ea1){logger[_0xa5eb('0xb')](_0xa5eb('0xc'),_0x2a4e10,_0xa5eb('0xd'));logger['debug'](_0xa5eb('0xe'),_0x2a4e10,'request\x20sent',JSON['stringify'](_0x359ea1));if(_0x359ea1[_0xa5eb('0xf')]){if(_0x359ea1[_0xa5eb('0xf')]['code']===0x1f4){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x2a4e10,_0x359ea1[_0xa5eb('0xf')]['message']);return _0x37c5a3(_0x359ea1[_0xa5eb('0xf')][_0xa5eb('0x10')]);}logger[_0xa5eb('0xf')](_0xa5eb('0xc'),_0x2a4e10,_0x359ea1[_0xa5eb('0xf')]['message']);return _0x4820cb(_0x359ea1[_0xa5eb('0xf')]['message']);}else{logger[_0xa5eb('0xb')](_0xa5eb('0xc'),_0x2a4e10,_0xa5eb('0xd'));_0x4820cb(_0x359ea1[_0xa5eb('0x11')][_0xa5eb('0x10')]);}})[_0xa5eb('0x12')](function(_0x5829e5){logger[_0xa5eb('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2a4e10,_0x5829e5);_0x37c5a3(_0x5829e5);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index e781dee..8f6dd29 100644
--- a/server/api/analyticFieldReport/index.js
+++ b/server/api/analyticFieldReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x326c2a,_0x12ed32){var _0x386496=function(_0x47de9d){while(--_0x47de9d){_0x326c2a['push'](_0x326c2a['shift']());}};_0x386496(++_0x12ed32);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router;
\ No newline at end of file
+var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x4f8bff,_0x1d7a9c){var _0x365554=function(_0x2b019b){while(--_0x2b019b){_0x4f8bff['push'](_0x4f8bff['shift']());}};_0x365554(++_0x1d7a9c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js
index 9194da2..e944d05 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 _0xa1e8=['STRING','name','sequelize'];(function(_0x5320f2,_0x4427ff){var _0x16eff9=function(_0x21879f){while(--_0x21879f){_0x5320f2['push'](_0x5320f2['shift']());}};_0x16eff9(++_0x4427ff);}(_0xa1e8,0x1af));var _0x8a1e=function(_0x1068e2,_0x5da9f6){_0x1068e2=_0x1068e2-0x0;var _0x4bc4f2=_0xa1e8[_0x1068e2];return _0x4bc4f2;};'use strict';var Sequelize=require(_0x8a1e('0x0'));module['exports']={'name':{'type':Sequelize[_0x8a1e('0x1')],'allowNull':![],'unique':_0x8a1e('0x2')},'table':{'type':Sequelize[_0x8a1e('0x1')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x8a1e('0x1')]}};
\ No newline at end of file
+var _0x915a=['STRING','name','sequelize','exports'];(function(_0x56241c,_0x47eba5){var _0x35a07b=function(_0x19afe8){while(--_0x19afe8){_0x56241c['push'](_0x56241c['shift']());}};_0x35a07b(++_0x47eba5);}(_0x915a,0x1d2));var _0xa915=function(_0xf13970,_0xd0f3a0){_0xf13970=_0xf13970-0x0;var _0x25fa5f=_0x915a[_0xf13970];return _0x25fa5f;};'use strict';var Sequelize=require(_0xa915('0x0'));module[_0xa915('0x1')]={'name':{'type':Sequelize[_0xa915('0x2')],'allowNull':![],'unique':_0xa915('0x3')},'table':{'type':Sequelize[_0xa915('0x2')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0xa915('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index a613838..ab2443a 100644
--- a/server/api/analyticMetric/analyticMetric.controller.js
+++ b/server/api/analyticMetric/analyticMetric.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x55ca=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','get','Metrics','UserProfileResource','destroy','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','AnalyticMetric','findAll','catch','show','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x360e5b,_0x2f5b){var _0x48c8b2=function(_0x10d63d){while(--_0x10d63d){_0x360e5b['push'](_0x360e5b['shift']());}};_0x48c8b2(++_0x2f5b);}(_0x55ca,0x126));var _0xa55c=function(_0x263999,_0x477176){_0x263999=_0x263999-0x0;var _0x336996=_0x55ca[_0x263999];return _0x336996;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){var _0x54b038=_0x5ba836[_0xa55c('0x21')]({'plain':!![]});var _0x190757=_0xa55c('0x22');return db[_0xa55c('0x23')][_0xa55c('0x24')]({'where':{'type':_0x190757,'resourceId':_0x54b038['id']}})[_0xa55c('0x20')](function(){return _0x5ba836;});})[_0xa55c('0x20')](function(){_0x1fc828[_0xa55c('0x18')](0xcc)[_0xa55c('0x25')]();});}};}function handleEntityNotFound(_0x3cd152,_0x1273d7){return function(_0x57f271){if(!_0x57f271){_0x3cd152[_0xa55c('0x26')](0x194);}return _0x57f271;};}function handleError(_0x28814f,_0x1c9f6b){_0x1c9f6b=_0x1c9f6b||0x1f4;return function(_0x906caa){logger['error'](_0x906caa[_0xa55c('0x27')]);if(_0x906caa[_0xa55c('0x28')]){delete _0x906caa[_0xa55c('0x28')];}_0x28814f[_0xa55c('0x18')](_0x1c9f6b)[_0xa55c('0x29')](_0x906caa);};}exports[_0xa55c('0x2a')]=function(_0x52d37f,_0x23e698){var _0x490b7d={},_0x35c9c2={},_0x1d730b={'count':0x0,'rows':[]};var _0x1cc53e=_[_0xa55c('0x2b')](db['AnalyticMetric'][_0xa55c('0x2c')],function(_0x2096ae){return{'name':_0x2096ae[_0xa55c('0x2d')],'type':_0x2096ae[_0xa55c('0x2e')][_0xa55c('0x2f')]};});_0x35c9c2[_0xa55c('0x30')]=_[_0xa55c('0x2b')](_0x1cc53e,_0xa55c('0x28'));_0x35c9c2[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x52d37f[_0xa55c('0x31')]);_0x35c9c2['filters']=_['intersection'](_0x35c9c2[_0xa55c('0x30')],_0x35c9c2[_0xa55c('0x31')]);_0x490b7d['attributes']=_[_0xa55c('0x33')](_0x35c9c2[_0xa55c('0x30')],qs[_0xa55c('0x34')](_0x52d37f[_0xa55c('0x31')][_0xa55c('0x34')]));_0x490b7d[_0xa55c('0x35')]=_0x490b7d[_0xa55c('0x35')][_0xa55c('0x36')]?_0x490b7d[_0xa55c('0x35')]:_0x35c9c2['model'];if(!_0x52d37f['query']['hasOwnProperty'](_0xa55c('0x37'))){_0x490b7d[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x52d37f['query'][_0xa55c('0x1c')]);_0x490b7d['offset']=qs[_0xa55c('0x1a')](_0x52d37f['query'][_0xa55c('0x1a')]);}_0x490b7d[_0xa55c('0x38')]=qs[_0xa55c('0x39')](_0x52d37f['query'][_0xa55c('0x39')]);_0x490b7d[_0xa55c('0x3a')]=qs['filters'](_[_0xa55c('0x3b')](_0x52d37f[_0xa55c('0x31')],_0x35c9c2['filters']),_0x1cc53e);if(_0x52d37f['query'][_0xa55c('0x3c')]){_0x490b7d['where']=_[_0xa55c('0x3d')](_0x490b7d[_0xa55c('0x3a')],{'$or':_['map'](_0x1cc53e,function(_0x542d76){if(_0x542d76['type']!=='VIRTUAL'){var _0x3b3308={};_0x3b3308[_0x542d76[_0xa55c('0x28')]]={'$like':'%'+_0x52d37f[_0xa55c('0x31')][_0xa55c('0x3c')]+'%'};return _0x3b3308;}})});}_0x490b7d=_[_0xa55c('0x3d')]({},_0x490b7d,_0x52d37f['options']);var _0x3d52d8={'where':_0x490b7d[_0xa55c('0x3a')]};return db[_0xa55c('0x3e')][_0xa55c('0x1d')](_0x3d52d8)[_0xa55c('0x20')](function(_0x23cef5){_0x1d730b['count']=_0x23cef5;if(_0x52d37f[_0xa55c('0x31')]['includeAll']){_0x490b7d['include']=[{'all':!![]}];}return db[_0xa55c('0x3e')][_0xa55c('0x3f')](_0x490b7d);})['then'](function(_0x2bd98b){_0x1d730b['rows']=_0x2bd98b;return _0x1d730b;})['then'](respondWithFilteredResult(_0x23e698,_0x490b7d))[_0xa55c('0x40')](handleError(_0x23e698,null));};exports[_0xa55c('0x41')]=function(_0x1630ac,_0x540337){var _0x1b2708={'raw':!![],'where':{'id':_0x1630ac['params']['id']}},_0xd5a006={};_0xd5a006[_0xa55c('0x30')]=_['keys'](db[_0xa55c('0x3e')][_0xa55c('0x2c')]);_0xd5a006['query']=_[_0xa55c('0x32')](_0x1630ac[_0xa55c('0x31')]);_0xd5a006['filters']=_[_0xa55c('0x33')](_0xd5a006[_0xa55c('0x30')],_0xd5a006[_0xa55c('0x31')]);_0x1b2708['attributes']=_[_0xa55c('0x33')](_0xd5a006['model'],qs[_0xa55c('0x34')](_0x1630ac[_0xa55c('0x31')][_0xa55c('0x34')]));_0x1b2708['attributes']=_0x1b2708[_0xa55c('0x35')][_0xa55c('0x36')]?_0x1b2708['attributes']:_0xd5a006[_0xa55c('0x30')];if(_0x1630ac[_0xa55c('0x31')]['includeAll']){_0x1b2708[_0xa55c('0x42')]=[{'all':!![]}];}_0x1b2708=_[_0xa55c('0x3d')]({},_0x1b2708,_0x1630ac['options']);return db[_0xa55c('0x3e')][_0xa55c('0x43')](_0x1b2708)[_0xa55c('0x20')](handleEntityNotFound(_0x540337,null))[_0xa55c('0x20')](respondWithResult(_0x540337,null))['catch'](handleError(_0x540337,null));};exports[_0xa55c('0x44')]=function(_0x58a7ea,_0x2157d6){return db[_0xa55c('0x3e')][_0xa55c('0x44')](_0x58a7ea['body'],{})[_0xa55c('0x20')](function(_0x250b00){var _0x574fe9=_0x58a7ea[_0xa55c('0x45')][_0xa55c('0x21')]({'plain':!![]});if(!_0x574fe9)throw new Error(_0xa55c('0x46'));if(_0x574fe9[_0xa55c('0x47')]===_0xa55c('0x45')){var _0x1c84d9=_0x250b00[_0xa55c('0x21')]({'plain':!![]});var _0x129626=_0xa55c('0x22');return db[_0xa55c('0x48')]['find']({'where':{'name':_0x129626,'userProfileId':_0x574fe9[_0xa55c('0x49')]},'raw':!![]})[_0xa55c('0x20')](function(_0x216de8){if(_0x216de8&&_0x216de8['autoAssociation']===0x0){return db[_0xa55c('0x23')][_0xa55c('0x44')]({'name':_0x1c84d9['name'],'resourceId':_0x1c84d9['id'],'type':_0x216de8[_0xa55c('0x28')],'sectionId':_0x216de8['id']},{})['then'](function(){return _0x250b00;});}else{return _0x250b00;}})[_0xa55c('0x40')](function(_0x228df4){logger[_0xa55c('0x4a')](_0xa55c('0x4b'),_0x228df4);throw _0x228df4;});}return _0x250b00;})[_0xa55c('0x20')](respondWithResult(_0x2157d6,0xc9))['catch'](handleError(_0x2157d6,null));};exports[_0xa55c('0x1f')]=function(_0x4607ca,_0x4b85cc){if(_0x4607ca[_0xa55c('0x4c')]['id']){delete _0x4607ca[_0xa55c('0x4c')]['id'];}return db[_0xa55c('0x3e')][_0xa55c('0x43')]({'where':{'id':_0x4607ca['params']['id']}})['then'](handleEntityNotFound(_0x4b85cc,null))[_0xa55c('0x20')](saveUpdates(_0x4607ca[_0xa55c('0x4c')],null))[_0xa55c('0x20')](respondWithResult(_0x4b85cc,null))[_0xa55c('0x40')](handleError(_0x4b85cc,null));};exports['destroy']=function(_0x30c0c9,_0x5ce463){return db[_0xa55c('0x3e')][_0xa55c('0x43')]({'where':{'id':_0x30c0c9[_0xa55c('0x4d')]['id']}})[_0xa55c('0x20')](handleEntityNotFound(_0x5ce463,null))[_0xa55c('0x20')](removeEntity(_0x5ce463,null))['catch'](handleError(_0x5ce463,null));};
\ No newline at end of file
+var _0x7fbe=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','get','UserProfileResource','destroy','end','error','stack','name','send','index','AnalyticMetric','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','rows','show','params','create','body','role','user','Metrics','find','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x4baf26,_0x34dc70){var _0x3d12c6=function(_0x46582a){while(--_0x46582a){_0x4baf26['push'](_0x4baf26['shift']());}};_0x3d12c6(++_0x34dc70);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x410344,_0x11c039){_0x410344=_0x410344-0x0;var _0x210ff4=_0x7fbe[_0x410344];return _0x210ff4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7fb('0x0'));var jsonpatch=require(_0xe7fb('0x1'));var rp=require(_0xe7fb('0x2'));var moment=require(_0xe7fb('0x3'));var BPromise=require(_0xe7fb('0x4'));var Mustache=require(_0xe7fb('0x5'));var util=require(_0xe7fb('0x6'));var path=require(_0xe7fb('0x7'));var sox=require(_0xe7fb('0x8'));var csv=require(_0xe7fb('0x9'));var ejs=require(_0xe7fb('0xa'));var fs=require('fs');var fs_extra=require(_0xe7fb('0xb'));var _=require(_0xe7fb('0xc'));var squel=require(_0xe7fb('0xd'));var crypto=require('crypto');var jsforce=require(_0xe7fb('0xe'));var deskjs=require(_0xe7fb('0xf'));var toCsv=require(_0xe7fb('0x9'));var querystring=require(_0xe7fb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7fb('0x11'));var qs=require(_0xe7fb('0x12'));var as=require(_0xe7fb('0x13'));var hardwareService=require(_0xe7fb('0x14'));var logger=require(_0xe7fb('0x15'))(_0xe7fb('0x16'));var utils=require(_0xe7fb('0x17'));var config=require(_0xe7fb('0x18'));var licenseUtil=require(_0xe7fb('0x19'));var db=require(_0xe7fb('0x1a'))['db'];function respondWithStatusCode(_0x2437d4,_0x188e1d){_0x188e1d=_0x188e1d||0xcc;return function(_0xdf9760){if(_0xdf9760){return _0x2437d4[_0xe7fb('0x1b')](_0x188e1d);}return _0x2437d4[_0xe7fb('0x1c')](_0x188e1d)['end']();};}function respondWithResult(_0x278b75,_0x2225e5){_0x2225e5=_0x2225e5||0xc8;return function(_0x5573ab){if(_0x5573ab){return _0x278b75[_0xe7fb('0x1c')](_0x2225e5)[_0xe7fb('0x1d')](_0x5573ab);}};}function respondWithFilteredResult(_0x482f7d,_0xa76acf){return function(_0x559129){if(_0x559129){var _0x12fff6=typeof _0xa76acf[_0xe7fb('0x1e')]===_0xe7fb('0x1f')&&typeof _0xa76acf[_0xe7fb('0x20')]==='undefined';var _0x892b0f=_0x559129['count'];var _0x293a47=_0x12fff6?0x0:_0xa76acf['offset'];var _0x1e77fd=_0x12fff6?_0x559129[_0xe7fb('0x21')]:_0xa76acf[_0xe7fb('0x1e')]+_0xa76acf[_0xe7fb('0x20')];var _0x5df1a1;if(_0x1e77fd>=_0x892b0f){_0x1e77fd=_0x892b0f;_0x5df1a1=0xc8;}else{_0x5df1a1=0xce;}_0x482f7d[_0xe7fb('0x1c')](_0x5df1a1);return _0x482f7d['set'](_0xe7fb('0x22'),_0x293a47+'-'+_0x1e77fd+'/'+_0x892b0f)['json'](_0x559129);}return null;};}function patchUpdates(_0x15f7a4){return function(_0x4ea664){try{jsonpatch[_0xe7fb('0x23')](_0x4ea664,_0x15f7a4,!![]);}catch(_0x135624){return BPromise['reject'](_0x135624);}return _0x4ea664[_0xe7fb('0x24')]();};}function saveUpdates(_0x4742bd,_0x3ae8f1){return function(_0x4dcb4b){if(_0x4dcb4b){return _0x4dcb4b[_0xe7fb('0x25')](_0x4742bd)[_0xe7fb('0x26')](function(_0x5da3d9){return _0x5da3d9;});}return null;};}function removeEntity(_0x5bea27,_0x52f08b){return function(_0x35e4db){if(_0x35e4db){return _0x35e4db['destroy']()['then'](function(){var _0x4026b1=_0x35e4db[_0xe7fb('0x27')]({'plain':!![]});var _0x2996ae='Metrics';return db[_0xe7fb('0x28')][_0xe7fb('0x29')]({'where':{'type':_0x2996ae,'resourceId':_0x4026b1['id']}})[_0xe7fb('0x26')](function(){return _0x35e4db;});})[_0xe7fb('0x26')](function(){_0x5bea27[_0xe7fb('0x1c')](0xcc)[_0xe7fb('0x2a')]();});}};}function handleEntityNotFound(_0x380130,_0x59e015){return function(_0x5df9f2){if(!_0x5df9f2){_0x380130[_0xe7fb('0x1b')](0x194);}return _0x5df9f2;};}function handleError(_0x3bdee9,_0xead63){_0xead63=_0xead63||0x1f4;return function(_0x4fd290){logger[_0xe7fb('0x2b')](_0x4fd290[_0xe7fb('0x2c')]);if(_0x4fd290[_0xe7fb('0x2d')]){delete _0x4fd290[_0xe7fb('0x2d')];}_0x3bdee9[_0xe7fb('0x1c')](_0xead63)[_0xe7fb('0x2e')](_0x4fd290);};}exports[_0xe7fb('0x2f')]=function(_0x3dd0be,_0x4ce993){var _0x3d1fb5={},_0x1742f3={},_0x29d1ca={'count':0x0,'rows':[]};var _0x547a04=_['map'](db[_0xe7fb('0x30')]['rawAttributes'],function(_0xac56b4){return{'name':_0xac56b4[_0xe7fb('0x31')],'type':_0xac56b4[_0xe7fb('0x32')][_0xe7fb('0x33')]};});_0x1742f3['model']=_[_0xe7fb('0x34')](_0x547a04,_0xe7fb('0x2d'));_0x1742f3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x3dd0be[_0xe7fb('0x35')]);_0x1742f3['filters']=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],_0x1742f3[_0xe7fb('0x35')]);_0x3d1fb5[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],qs[_0xe7fb('0x3a')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3a')]));_0x3d1fb5['attributes']=_0x3d1fb5[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x3d1fb5[_0xe7fb('0x39')]:_0x1742f3['model'];if(!_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3c')](_0xe7fb('0x3d'))){_0x3d1fb5[_0xe7fb('0x20')]=qs[_0xe7fb('0x20')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x20')]);_0x3d1fb5[_0xe7fb('0x1e')]=qs[_0xe7fb('0x1e')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x1e')]);}_0x3d1fb5[_0xe7fb('0x3e')]=qs[_0xe7fb('0x3f')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3f')]);_0x3d1fb5[_0xe7fb('0x40')]=qs[_0xe7fb('0x41')](_[_0xe7fb('0x42')](_0x3dd0be[_0xe7fb('0x35')],_0x1742f3['filters']),_0x547a04);if(_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]){_0x3d1fb5[_0xe7fb('0x40')]=_[_0xe7fb('0x44')](_0x3d1fb5['where'],{'$or':_[_0xe7fb('0x34')](_0x547a04,function(_0x186418){if(_0x186418[_0xe7fb('0x32')]!==_0xe7fb('0x45')){var _0x49fe9d={};_0x49fe9d[_0x186418[_0xe7fb('0x2d')]]={'$like':'%'+_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]+'%'};return _0x49fe9d;}})});}_0x3d1fb5=_[_0xe7fb('0x44')]({},_0x3d1fb5,_0x3dd0be[_0xe7fb('0x46')]);var _0xb729fc={'where':_0x3d1fb5['where']};return db[_0xe7fb('0x30')][_0xe7fb('0x21')](_0xb729fc)[_0xe7fb('0x26')](function(_0x4b263d){_0x29d1ca[_0xe7fb('0x21')]=_0x4b263d;if(_0x3dd0be[_0xe7fb('0x35')]['includeAll']){_0x3d1fb5['include']=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x3d1fb5);})['then'](function(_0x900d67){_0x29d1ca[_0xe7fb('0x47')]=_0x900d67;return _0x29d1ca;})[_0xe7fb('0x26')](respondWithFilteredResult(_0x4ce993,_0x3d1fb5))['catch'](handleError(_0x4ce993,null));};exports[_0xe7fb('0x48')]=function(_0x58d743,_0x19277f){var _0x32cfa4={'raw':!![],'where':{'id':_0x58d743[_0xe7fb('0x49')]['id']}},_0x4d29d3={};_0x4d29d3[_0xe7fb('0x38')]=_[_0xe7fb('0x36')](db[_0xe7fb('0x30')]['rawAttributes']);_0x4d29d3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x58d743[_0xe7fb('0x35')]);_0x4d29d3['filters']=_[_0xe7fb('0x37')](_0x4d29d3[_0xe7fb('0x38')],_0x4d29d3[_0xe7fb('0x35')]);_0x32cfa4[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x4d29d3['model'],qs[_0xe7fb('0x3a')](_0x58d743['query'][_0xe7fb('0x3a')]));_0x32cfa4[_0xe7fb('0x39')]=_0x32cfa4[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x32cfa4[_0xe7fb('0x39')]:_0x4d29d3['model'];if(_0x58d743[_0xe7fb('0x35')]['includeAll']){_0x32cfa4['include']=[{'all':!![]}];}_0x32cfa4=_[_0xe7fb('0x44')]({},_0x32cfa4,_0x58d743[_0xe7fb('0x46')]);return db[_0xe7fb('0x30')]['find'](_0x32cfa4)[_0xe7fb('0x26')](handleEntityNotFound(_0x19277f,null))[_0xe7fb('0x26')](respondWithResult(_0x19277f,null))['catch'](handleError(_0x19277f,null));};exports['create']=function(_0x284bcb,_0x42270b){return db[_0xe7fb('0x30')][_0xe7fb('0x4a')](_0x284bcb[_0xe7fb('0x4b')],{})[_0xe7fb('0x26')](function(_0x18a590){var _0x347177=_0x284bcb['user'][_0xe7fb('0x27')]({'plain':!![]});if(!_0x347177)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x347177[_0xe7fb('0x4c')]===_0xe7fb('0x4d')){var _0x5cedfb=_0x18a590[_0xe7fb('0x27')]({'plain':!![]});var _0x5efd24=_0xe7fb('0x4e');return db['UserProfileSection'][_0xe7fb('0x4f')]({'where':{'name':_0x5efd24,'userProfileId':_0x347177['userProfileId']},'raw':!![]})[_0xe7fb('0x26')](function(_0x59158c){if(_0x59158c&&_0x59158c[_0xe7fb('0x50')]===0x0){return db[_0xe7fb('0x28')][_0xe7fb('0x4a')]({'name':_0x5cedfb[_0xe7fb('0x2d')],'resourceId':_0x5cedfb['id'],'type':_0x59158c[_0xe7fb('0x2d')],'sectionId':_0x59158c['id']},{})[_0xe7fb('0x26')](function(){return _0x18a590;});}else{return _0x18a590;}})[_0xe7fb('0x51')](function(_0x582a4a){logger['error'](_0xe7fb('0x52'),_0x582a4a);throw _0x582a4a;});}return _0x18a590;})['then'](respondWithResult(_0x42270b,0xc9))['catch'](handleError(_0x42270b,null));};exports['update']=function(_0x50b8df,_0x539252){if(_0x50b8df[_0xe7fb('0x4b')]['id']){delete _0x50b8df[_0xe7fb('0x4b')]['id'];}return db[_0xe7fb('0x30')][_0xe7fb('0x4f')]({'where':{'id':_0x50b8df['params']['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x539252,null))[_0xe7fb('0x26')](saveUpdates(_0x50b8df[_0xe7fb('0x4b')],null))['then'](respondWithResult(_0x539252,null))['catch'](handleError(_0x539252,null));};exports[_0xe7fb('0x29')]=function(_0x377e5f,_0x300b8e){return db['AnalyticMetric'][_0xe7fb('0x4f')]({'where':{'id':_0x377e5f[_0xe7fb('0x49')]['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x300b8e,null))[_0xe7fb('0x26')](removeEntity(_0x300b8e,null))['catch'](handleError(_0x300b8e,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 5e9d258..b3185fc 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 _0x1db9=['AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','exports','define'];(function(_0x486eff,_0x5cb3b0){var _0x95293b=function(_0x25b947){while(--_0x25b947){_0x486eff['push'](_0x486eff['shift']());}};_0x95293b(++_0x5cb3b0);}(_0x1db9,0x176));var _0x91db=function(_0x139529,_0x253a7c){_0x139529=_0x139529-0x0;var _0x1f9df0=_0x1db9[_0x139529];return _0x1f9df0;};'use strict';var _=require(_0x91db('0x0'));var util=require(_0x91db('0x1'));var logger=require(_0x91db('0x2'))(_0x91db('0x3'));var moment=require(_0x91db('0x4'));var BPromise=require(_0x91db('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91db('0x6'));var rimraf=require(_0x91db('0x7'));var config=require('../../config/environment');var attributes=require('./analyticMetric.attributes');module[_0x91db('0x8')]=function(_0x4b3f5c,_0x5e69d9){return _0x4b3f5c[_0x91db('0x9')](_0x91db('0xa'),attributes,{'tableName':_0x91db('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbecd=['AnalyticMetric','analytics_metrics','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define'];(function(_0x2077be,_0x26136a){var _0x198bbf=function(_0x2fd7e3){while(--_0x2fd7e3){_0x2077be['push'](_0x2077be['shift']());}};_0x198bbf(++_0x26136a);}(_0xbecd,0x6a));var _0xdbec=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xbecd[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xdbec('0x0'));var util=require('util');var logger=require(_0xdbec('0x1'))(_0xdbec('0x2'));var moment=require('moment');var BPromise=require(_0xdbec('0x3'));var rp=require(_0xdbec('0x4'));var fs=require('fs');var path=require(_0xdbec('0x5'));var rimraf=require(_0xdbec('0x6'));var config=require(_0xdbec('0x7'));var attributes=require(_0xdbec('0x8'));module[_0xdbec('0x9')]=function(_0x411618,_0x578a3b){return _0x411618[_0xdbec('0xa')](_0xdbec('0xb'),attributes,{'tableName':_0xdbec('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index 758d524..b06bcc3 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 _0xfd3b=['request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','AnalyticMetric,\x20%s,\x20%s'];(function(_0x5cbcdf,_0x2224a4){var _0x4be16f=function(_0x12665c){while(--_0x12665c){_0x5cbcdf['push'](_0x5cbcdf['shift']());}};_0x4be16f(++_0x2224a4);}(_0xfd3b,0xd9));var _0xbfd3=function(_0x23b4df,_0x3bd0fc){_0x23b4df=_0x23b4df-0x0;var _0x25d87b=_0xfd3b[_0x23b4df];return _0x25d87b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbfd3('0x0'));var BPromise=require('bluebird');var rs=require(_0xbfd3('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbfd3('0x2'))['db'];var utils=require(_0xbfd3('0x3'));var logger=require(_0xbfd3('0x4'))(_0xbfd3('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbfd3('0x6')][_0xbfd3('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x26dbc0,_0x46e10d,_0x3427b4){return new BPromise(function(_0x3dda28,_0x300a70){return client['request'](_0x26dbc0,_0x3427b4)[_0xbfd3('0x8')](function(_0x332c0f){logger[_0xbfd3('0x9')](_0xbfd3('0xa'),_0x46e10d,_0xbfd3('0xb'));logger[_0xbfd3('0xc')](_0xbfd3('0xd'),_0x46e10d,'request\x20sent',JSON[_0xbfd3('0xe')](_0x332c0f));if(_0x332c0f[_0xbfd3('0xf')]){if(_0x332c0f[_0xbfd3('0xf')]['code']===0x1f4){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x46e10d,_0x332c0f[_0xbfd3('0xf')]['message']);return _0x300a70(_0x332c0f[_0xbfd3('0xf')][_0xbfd3('0x10')]);}logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x46e10d,_0x332c0f[_0xbfd3('0xf')][_0xbfd3('0x10')]);return _0x3dda28(_0x332c0f[_0xbfd3('0xf')]['message']);}else{logger[_0xbfd3('0x9')]('AnalyticMetric,\x20%s,\x20%s',_0x46e10d,_0xbfd3('0xb'));_0x3dda28(_0x332c0f[_0xbfd3('0x11')][_0xbfd3('0x10')]);}})[_0xbfd3('0x12')](function(_0x59684f){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x46e10d,_0x59684f);_0x300a70(_0x59684f);});});}
\ No newline at end of file
+var _0x6cd7=['jayson/promise','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','debug','request\x20sent','error','message','result','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0xb971d3,_0x2df9cf){var _0x2710bf=function(_0x551dbc){while(--_0x551dbc){_0xb971d3['push'](_0xb971d3['shift']());}};_0x2710bf(++_0x2df9cf);}(_0x6cd7,0x1d3));var _0x76cd=function(_0x44f1f1,_0x4be4e4){_0x44f1f1=_0x44f1f1-0x0;var _0x1fae61=_0x6cd7[_0x44f1f1];return _0x1fae61;};'use strict';var _=require(_0x76cd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x76cd('0x1'));var fs=require('fs');var Redis=require(_0x76cd('0x2'));var db=require(_0x76cd('0x3'))['db'];var utils=require(_0x76cd('0x4'));var logger=require(_0x76cd('0x5'))(_0x76cd('0x6'));var config=require(_0x76cd('0x7'));var jayson=require(_0x76cd('0x8'));var client=jayson['client'][_0x76cd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4fe37b,_0x2d12d9,_0x497afd){return new BPromise(function(_0x32467d,_0x4c1427){return client[_0x76cd('0xa')](_0x4fe37b,_0x497afd)[_0x76cd('0xb')](function(_0x2056b7){logger[_0x76cd('0xc')](_0x76cd('0xd'),_0x2d12d9,'request\x20sent');logger[_0x76cd('0xe')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x2d12d9,_0x76cd('0xf'),JSON['stringify'](_0x2056b7));if(_0x2056b7[_0x76cd('0x10')]){if(_0x2056b7[_0x76cd('0x10')]['code']===0x1f4){logger[_0x76cd('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x2d12d9,_0x2056b7[_0x76cd('0x10')]['message']);return _0x4c1427(_0x2056b7['error']['message']);}logger['error'](_0x76cd('0xd'),_0x2d12d9,_0x2056b7[_0x76cd('0x10')][_0x76cd('0x11')]);return _0x32467d(_0x2056b7[_0x76cd('0x10')][_0x76cd('0x11')]);}else{logger['info'](_0x76cd('0xd'),_0x2d12d9,_0x76cd('0xf'));_0x32467d(_0x2056b7[_0x76cd('0x12')]['message']);}})['catch'](function(_0x195cbb){logger[_0x76cd('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x2d12d9,_0x195cbb);_0x4c1427(_0x195cbb);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 0567246..27e6f46 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 _0xdb94=['exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','isAuthenticated','index','get','/:id','post','create','put','update','delete','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb94,0xe5));var _0x4db9=function(_0x31cc2d,_0x906ff){_0x31cc2d=_0x31cc2d-0x0;var _0x53529c=_0xdb94[_0x31cc2d];return _0x53529c;};'use strict';var multer=require('multer');var util=require(_0x4db9('0x0'));var path=require(_0x4db9('0x1'));var timeout=require('connect-timeout');var express=require(_0x4db9('0x2'));var router=express[_0x4db9('0x3')]();var fs_extra=require(_0x4db9('0x4'));var auth=require(_0x4db9('0x5'));var interaction=require(_0x4db9('0x6'));var config=require('../../config/environment');var controller=require(_0x4db9('0x7'));router['get']('/',auth[_0x4db9('0x8')](),controller[_0x4db9('0x9')]);router[_0x4db9('0xa')](_0x4db9('0xb'),auth[_0x4db9('0x8')](),controller['show']);router[_0x4db9('0xc')]('/',auth[_0x4db9('0x8')](),controller[_0x4db9('0xd')]);router[_0x4db9('0xe')](_0x4db9('0xb'),auth['isAuthenticated'](),controller[_0x4db9('0xf')]);router[_0x4db9('0x10')](_0x4db9('0xb'),auth[_0x4db9('0x8')](),controller[_0x4db9('0x11')]);module[_0x4db9('0x12')]=router;
\ No newline at end of file
+var _0x3fc6=['update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','create','put','/:id'];(function(_0x3e0dc4,_0x13971b){var _0x586111=function(_0x123c53){while(--_0x123c53){_0x3e0dc4['push'](_0x3e0dc4['shift']());}};_0x586111(++_0x13971b);}(_0x3fc6,0x159));var _0x63fc=function(_0x533f09,_0x3a31e2){_0x533f09=_0x533f09-0x0;var _0x52d981=_0x3fc6[_0x533f09];return _0x52d981;};'use strict';var multer=require(_0x63fc('0x0'));var util=require(_0x63fc('0x1'));var path=require(_0x63fc('0x2'));var timeout=require('connect-timeout');var express=require(_0x63fc('0x3'));var router=express[_0x63fc('0x4')]();var fs_extra=require(_0x63fc('0x5'));var auth=require(_0x63fc('0x6'));var interaction=require(_0x63fc('0x7'));var config=require(_0x63fc('0x8'));var controller=require('./analyticMetric.controller');router['get']('/',auth[_0x63fc('0x9')](),controller[_0x63fc('0xa')]);router[_0x63fc('0xb')]('/:id',auth[_0x63fc('0x9')](),controller[_0x63fc('0xc')]);router['post']('/',auth[_0x63fc('0x9')](),controller[_0x63fc('0xd')]);router[_0x63fc('0xe')](_0x63fc('0xf'),auth[_0x63fc('0x9')](),controller[_0x63fc('0x10')]);router[_0x63fc('0x11')](_0x63fc('0xf'),auth[_0x63fc('0x9')](),controller[_0x63fc('0x12')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 3ea2715..836d765 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 _0xc0bd=['sequelize','exports','TEXT'];(function(_0xf61586,_0x56b0c4){var _0x2b6eb3=function(_0x47e12b){while(--_0x47e12b){_0xf61586['push'](_0xf61586['shift']());}};_0x2b6eb3(++_0x56b0c4);}(_0xc0bd,0x10e));var _0xdc0b=function(_0x436e07,_0x53348f){_0x436e07=_0x436e07-0x0;var _0x52c4e4=_0xc0bd[_0x436e07];return _0x52c4e4;};'use strict';var Sequelize=require(_0xdc0b('0x0'));module[_0xdc0b('0x1')]={'tree':{'type':Sequelize[_0xdc0b('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x7aad=['sequelize','TEXT'];(function(_0x1573ea,_0x434f02){var _0x51c0e2=function(_0x5c9b28){while(--_0x5c9b28){_0x1573ea['push'](_0x1573ea['shift']());}};_0x51c0e2(++_0x434f02);}(_0x7aad,0x160));var _0xd7aa=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0x7aad[_0x3899d1];return _0xeb4a7d;};'use strict';var Sequelize=require(_0xd7aa('0x0'));module['exports']={'tree':{'type':Sequelize[_0xd7aa('0x1')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index d340643..bfd271b 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 _0x95f6=['moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','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','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','AnalyticTreeReport','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','findAll','rows','show','params','include','find','catch','create','body','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x1170fe,_0x414dcf){var _0x5a5e84=function(_0x4faa20){while(--_0x4faa20){_0x1170fe['push'](_0x1170fe['shift']());}};_0x5a5e84(++_0x414dcf);}(_0x95f6,0xe3));var _0x695f=function(_0x33670a,_0x55e188){_0x33670a=_0x33670a-0x0;var _0x36ad1d=_0x95f6[_0x33670a];return _0x36ad1d;};'use strict';var emlformat=require(_0x695f('0x0'));var rimraf=require(_0x695f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x695f('0x2'));var rp=require(_0x695f('0x3'));var moment=require(_0x695f('0x4'));var BPromise=require(_0x695f('0x5'));var Mustache=require(_0x695f('0x6'));var util=require(_0x695f('0x7'));var path=require('path');var sox=require(_0x695f('0x8'));var csv=require(_0x695f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x695f('0xa'));var _=require(_0x695f('0xb'));var squel=require(_0x695f('0xc'));var crypto=require('crypto');var jsforce=require(_0x695f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x695f('0x9'));var querystring=require(_0x695f('0xe'));var Papa=require(_0x695f('0xf'));var Redis=require(_0x695f('0x10'));var authService=require(_0x695f('0x11'));var qs=require(_0x695f('0x12'));var as=require(_0x695f('0x13'));var hardwareService=require(_0x695f('0x14'));var logger=require(_0x695f('0x15'))(_0x695f('0x16'));var utils=require(_0x695f('0x17'));var config=require(_0x695f('0x18'));var licenseUtil=require(_0x695f('0x19'));var db=require(_0x695f('0x1a'))['db'];function respondWithStatusCode(_0x5058ed,_0x772819){_0x772819=_0x772819||0xcc;return function(_0xbefb39){if(_0xbefb39){return _0x5058ed['sendStatus'](_0x772819);}return _0x5058ed[_0x695f('0x1b')](_0x772819)[_0x695f('0x1c')]();};}function respondWithResult(_0x474ee2,_0x1917e6){_0x1917e6=_0x1917e6||0xc8;return function(_0x2de76b){if(_0x2de76b){return _0x474ee2[_0x695f('0x1b')](_0x1917e6)[_0x695f('0x1d')](_0x2de76b);}};}function respondWithFilteredResult(_0x58b159,_0x2f3057){return function(_0x305512){if(_0x305512){var _0x25ed89=typeof _0x2f3057[_0x695f('0x1e')]===_0x695f('0x1f')&&typeof _0x2f3057[_0x695f('0x20')]===_0x695f('0x1f');var _0x4111d6=_0x305512[_0x695f('0x21')];var _0x5f4d27=_0x25ed89?0x0:_0x2f3057[_0x695f('0x1e')];var _0x4481bb=_0x25ed89?_0x305512[_0x695f('0x21')]:_0x2f3057[_0x695f('0x1e')]+_0x2f3057['limit'];var _0x4f54f8;if(_0x4481bb>=_0x4111d6){_0x4481bb=_0x4111d6;_0x4f54f8=0xc8;}else{_0x4f54f8=0xce;}_0x58b159['status'](_0x4f54f8);return _0x58b159[_0x695f('0x22')](_0x695f('0x23'),_0x5f4d27+'-'+_0x4481bb+'/'+_0x4111d6)[_0x695f('0x1d')](_0x305512);}return null;};}function patchUpdates(_0x593929){return function(_0x1a6734){try{jsonpatch['apply'](_0x1a6734,_0x593929,!![]);}catch(_0x4fc4ea){return BPromise[_0x695f('0x24')](_0x4fc4ea);}return _0x1a6734[_0x695f('0x25')]();};}function saveUpdates(_0x14df64,_0x323ad7){return function(_0x2f6da2){if(_0x2f6da2){return _0x2f6da2[_0x695f('0x26')](_0x14df64)[_0x695f('0x27')](function(_0x49107c){return _0x49107c;});}return null;};}function removeEntity(_0x11c62f,_0x52847b){return function(_0x3a6b45){if(_0x3a6b45){return _0x3a6b45[_0x695f('0x28')]()[_0x695f('0x27')](function(){_0x11c62f[_0x695f('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24e6e2,_0x12e64e){return function(_0x26a828){if(!_0x26a828){_0x24e6e2[_0x695f('0x29')](0x194);}return _0x26a828;};}function handleError(_0x355de5,_0x17716f){_0x17716f=_0x17716f||0x1f4;return function(_0x1d7eca){logger[_0x695f('0x2a')](_0x1d7eca[_0x695f('0x2b')]);if(_0x1d7eca['name']){delete _0x1d7eca[_0x695f('0x2c')];}_0x355de5[_0x695f('0x1b')](_0x17716f)['send'](_0x1d7eca);};}exports[_0x695f('0x2d')]=function(_0x2c2106,_0x4aedaf){var _0x28aa28={},_0x283b76={},_0x42951c={'count':0x0,'rows':[]};var _0x18bd06=_[_0x695f('0x2e')](db[_0x695f('0x2f')][_0x695f('0x30')],function(_0x5e5eb1){return{'name':_0x5e5eb1[_0x695f('0x31')],'type':_0x5e5eb1['type'][_0x695f('0x32')]};});_0x283b76['model']=_['map'](_0x18bd06,_0x695f('0x2c'));_0x283b76[_0x695f('0x33')]=_[_0x695f('0x34')](_0x2c2106[_0x695f('0x33')]);_0x283b76[_0x695f('0x35')]=_[_0x695f('0x36')](_0x283b76[_0x695f('0x37')],_0x283b76['query']);_0x28aa28[_0x695f('0x38')]=_['intersection'](_0x283b76[_0x695f('0x37')],qs[_0x695f('0x39')](_0x2c2106['query'][_0x695f('0x39')]));_0x28aa28['attributes']=_0x28aa28[_0x695f('0x38')]['length']?_0x28aa28[_0x695f('0x38')]:_0x283b76[_0x695f('0x37')];if(!_0x2c2106['query'][_0x695f('0x3a')]('nolimit')){_0x28aa28[_0x695f('0x20')]=qs[_0x695f('0x20')](_0x2c2106[_0x695f('0x33')]['limit']);_0x28aa28[_0x695f('0x1e')]=qs[_0x695f('0x1e')](_0x2c2106['query']['offset']);}_0x28aa28['order']=qs[_0x695f('0x3b')](_0x2c2106[_0x695f('0x33')][_0x695f('0x3b')]);_0x28aa28['where']=qs[_0x695f('0x35')](_[_0x695f('0x3c')](_0x2c2106[_0x695f('0x33')],_0x283b76[_0x695f('0x35')]),_0x18bd06);if(_0x2c2106[_0x695f('0x33')][_0x695f('0x3d')]){_0x28aa28[_0x695f('0x3e')]=_[_0x695f('0x3f')](_0x28aa28[_0x695f('0x3e')],{'$or':_[_0x695f('0x2e')](_0x18bd06,function(_0xba6a84){if(_0xba6a84[_0x695f('0x40')]!==_0x695f('0x41')){var _0x35e968={};_0x35e968[_0xba6a84['name']]={'$like':'%'+_0x2c2106['query'][_0x695f('0x3d')]+'%'};return _0x35e968;}})});}_0x28aa28=_[_0x695f('0x3f')]({},_0x28aa28,_0x2c2106[_0x695f('0x42')]);var _0x3a2e14={'where':_0x28aa28[_0x695f('0x3e')]};return db[_0x695f('0x2f')][_0x695f('0x21')](_0x3a2e14)[_0x695f('0x27')](function(_0x271442){_0x42951c['count']=_0x271442;if(_0x2c2106['query'][_0x695f('0x43')]){_0x28aa28['include']=[{'all':!![]}];}return db[_0x695f('0x2f')][_0x695f('0x44')](_0x28aa28);})['then'](function(_0x338e6a){_0x42951c[_0x695f('0x45')]=_0x338e6a;return _0x42951c;})[_0x695f('0x27')](respondWithFilteredResult(_0x4aedaf,_0x28aa28))['catch'](handleError(_0x4aedaf,null));};exports[_0x695f('0x46')]=function(_0x53dd29,_0xc07bbb){var _0x4b90ea={'raw':!![],'where':{'id':_0x53dd29[_0x695f('0x47')]['id']}},_0x1f1a40={};_0x1f1a40['model']=_[_0x695f('0x34')](db[_0x695f('0x2f')][_0x695f('0x30')]);_0x1f1a40[_0x695f('0x33')]=_['keys'](_0x53dd29[_0x695f('0x33')]);_0x1f1a40['filters']=_[_0x695f('0x36')](_0x1f1a40[_0x695f('0x37')],_0x1f1a40[_0x695f('0x33')]);_0x4b90ea[_0x695f('0x38')]=_['intersection'](_0x1f1a40[_0x695f('0x37')],qs[_0x695f('0x39')](_0x53dd29[_0x695f('0x33')][_0x695f('0x39')]));_0x4b90ea[_0x695f('0x38')]=_0x4b90ea[_0x695f('0x38')]['length']?_0x4b90ea[_0x695f('0x38')]:_0x1f1a40[_0x695f('0x37')];if(_0x53dd29[_0x695f('0x33')][_0x695f('0x43')]){_0x4b90ea[_0x695f('0x48')]=[{'all':!![]}];}_0x4b90ea=_[_0x695f('0x3f')]({},_0x4b90ea,_0x53dd29[_0x695f('0x42')]);return db[_0x695f('0x2f')][_0x695f('0x49')](_0x4b90ea)[_0x695f('0x27')](handleEntityNotFound(_0xc07bbb,null))['then'](respondWithResult(_0xc07bbb,null))[_0x695f('0x4a')](handleError(_0xc07bbb,null));};exports[_0x695f('0x4b')]=function(_0x2d5c6d,_0x3bcfb5){return db[_0x695f('0x2f')]['create'](_0x2d5c6d[_0x695f('0x4c')],{})[_0x695f('0x27')](respondWithResult(_0x3bcfb5,0xc9))[_0x695f('0x4a')](handleError(_0x3bcfb5,null));};exports[_0x695f('0x26')]=function(_0x5a2d6a,_0x5cf4d1){if(_0x5a2d6a[_0x695f('0x4c')]['id']){delete _0x5a2d6a[_0x695f('0x4c')]['id'];}return db['AnalyticTreeReport']['find']({'where':{'id':_0x5a2d6a['params']['id']}})[_0x695f('0x27')](handleEntityNotFound(_0x5cf4d1,null))[_0x695f('0x27')](saveUpdates(_0x5a2d6a[_0x695f('0x4c')],null))['then'](respondWithResult(_0x5cf4d1,null))[_0x695f('0x4a')](handleError(_0x5cf4d1,null));};exports[_0x695f('0x28')]=function(_0x4cceba,_0x1d9359){return db[_0x695f('0x2f')][_0x695f('0x49')]({'where':{'id':_0x4cceba[_0x695f('0x47')]['id']}})[_0x695f('0x27')](handleEntityNotFound(_0x1d9359,null))[_0x695f('0x27')](removeEntity(_0x1d9359,null))[_0x695f('0x4a')](handleError(_0x1d9359,null));};
\ No newline at end of file
+var _0x0b88=['save','update','then','destroy','error','name','send','index','rawAttributes','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','AnalyticTreeReport','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply'];(function(_0x5c2e5e,_0x2bc00e){var _0x46a5da=function(_0xf0fa38){while(--_0xf0fa38){_0x5c2e5e['push'](_0x5c2e5e['shift']());}};_0x46a5da(++_0x2bc00e);}(_0x0b88,0x13e));var _0x80b8=function(_0x8e952b,_0x1befc5){_0x8e952b=_0x8e952b-0x0;var _0x132332=_0x0b88[_0x8e952b];return _0x132332;};'use strict';var emlformat=require(_0x80b8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x80b8('0x1'));var jsonpatch=require(_0x80b8('0x2'));var rp=require(_0x80b8('0x3'));var moment=require(_0x80b8('0x4'));var BPromise=require(_0x80b8('0x5'));var Mustache=require(_0x80b8('0x6'));var util=require(_0x80b8('0x7'));var path=require(_0x80b8('0x8'));var sox=require(_0x80b8('0x9'));var csv=require(_0x80b8('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x80b8('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x80b8('0xc'));var toCsv=require(_0x80b8('0xa'));var querystring=require(_0x80b8('0xd'));var Papa=require('papaparse');var Redis=require(_0x80b8('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x80b8('0xf'));var as=require(_0x80b8('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x80b8('0x11'))(_0x80b8('0x12'));var utils=require(_0x80b8('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x80b8('0x14'));var db=require(_0x80b8('0x15'))['db'];function respondWithStatusCode(_0x306c6a,_0x124164){_0x124164=_0x124164||0xcc;return function(_0x2ba10f){if(_0x2ba10f){return _0x306c6a[_0x80b8('0x16')](_0x124164);}return _0x306c6a[_0x80b8('0x17')](_0x124164)[_0x80b8('0x18')]();};}function respondWithResult(_0x12c48a,_0x545c21){_0x545c21=_0x545c21||0xc8;return function(_0x3b3ac0){if(_0x3b3ac0){return _0x12c48a['status'](_0x545c21)[_0x80b8('0x19')](_0x3b3ac0);}};}function respondWithFilteredResult(_0x24b120,_0x3e3553){return function(_0x256024){if(_0x256024){var _0x26f2fa=typeof _0x3e3553[_0x80b8('0x1a')]===_0x80b8('0x1b')&&typeof _0x3e3553[_0x80b8('0x1c')]===_0x80b8('0x1b');var _0x12d584=_0x256024['count'];var _0x5d944b=_0x26f2fa?0x0:_0x3e3553['offset'];var _0x2f85f0=_0x26f2fa?_0x256024[_0x80b8('0x1d')]:_0x3e3553['offset']+_0x3e3553[_0x80b8('0x1c')];var _0x299396;if(_0x2f85f0>=_0x12d584){_0x2f85f0=_0x12d584;_0x299396=0xc8;}else{_0x299396=0xce;}_0x24b120[_0x80b8('0x17')](_0x299396);return _0x24b120[_0x80b8('0x1e')]('Content-Range',_0x5d944b+'-'+_0x2f85f0+'/'+_0x12d584)[_0x80b8('0x19')](_0x256024);}return null;};}function patchUpdates(_0x1c9ac2){return function(_0x3d267c){try{jsonpatch[_0x80b8('0x1f')](_0x3d267c,_0x1c9ac2,!![]);}catch(_0x4366a3){return BPromise['reject'](_0x4366a3);}return _0x3d267c[_0x80b8('0x20')]();};}function saveUpdates(_0x2f4c45,_0x323e71){return function(_0x128f8f){if(_0x128f8f){return _0x128f8f[_0x80b8('0x21')](_0x2f4c45)[_0x80b8('0x22')](function(_0x5172e3){return _0x5172e3;});}return null;};}function removeEntity(_0x45db9a,_0x599812){return function(_0x1a9030){if(_0x1a9030){return _0x1a9030[_0x80b8('0x23')]()[_0x80b8('0x22')](function(){_0x45db9a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x40b33c,_0x394863){return function(_0x26fca4){if(!_0x26fca4){_0x40b33c[_0x80b8('0x16')](0x194);}return _0x26fca4;};}function handleError(_0x24db76,_0x548067){_0x548067=_0x548067||0x1f4;return function(_0x3139a3){logger[_0x80b8('0x24')](_0x3139a3['stack']);if(_0x3139a3['name']){delete _0x3139a3[_0x80b8('0x25')];}_0x24db76[_0x80b8('0x17')](_0x548067)[_0x80b8('0x26')](_0x3139a3);};}exports[_0x80b8('0x27')]=function(_0x10eb63,_0x7390bf){var _0xe175b0={},_0x1a0f8c={},_0x242c06={'count':0x0,'rows':[]};var _0x20204c=_['map'](db['AnalyticTreeReport'][_0x80b8('0x28')],function(_0x4fa035){return{'name':_0x4fa035['fieldName'],'type':_0x4fa035[_0x80b8('0x29')][_0x80b8('0x2a')]};});_0x1a0f8c[_0x80b8('0x2b')]=_[_0x80b8('0x2c')](_0x20204c,_0x80b8('0x25'));_0x1a0f8c[_0x80b8('0x2d')]=_['keys'](_0x10eb63['query']);_0x1a0f8c['filters']=_[_0x80b8('0x2e')](_0x1a0f8c[_0x80b8('0x2b')],_0x1a0f8c[_0x80b8('0x2d')]);_0xe175b0[_0x80b8('0x2f')]=_[_0x80b8('0x2e')](_0x1a0f8c[_0x80b8('0x2b')],qs[_0x80b8('0x30')](_0x10eb63['query'][_0x80b8('0x30')]));_0xe175b0[_0x80b8('0x2f')]=_0xe175b0[_0x80b8('0x2f')][_0x80b8('0x31')]?_0xe175b0['attributes']:_0x1a0f8c['model'];if(!_0x10eb63[_0x80b8('0x2d')][_0x80b8('0x32')]('nolimit')){_0xe175b0[_0x80b8('0x1c')]=qs[_0x80b8('0x1c')](_0x10eb63['query']['limit']);_0xe175b0[_0x80b8('0x1a')]=qs[_0x80b8('0x1a')](_0x10eb63['query'][_0x80b8('0x1a')]);}_0xe175b0['order']=qs[_0x80b8('0x33')](_0x10eb63[_0x80b8('0x2d')][_0x80b8('0x33')]);_0xe175b0[_0x80b8('0x34')]=qs['filters'](_[_0x80b8('0x35')](_0x10eb63[_0x80b8('0x2d')],_0x1a0f8c[_0x80b8('0x36')]),_0x20204c);if(_0x10eb63[_0x80b8('0x2d')][_0x80b8('0x37')]){_0xe175b0['where']=_[_0x80b8('0x38')](_0xe175b0[_0x80b8('0x34')],{'$or':_['map'](_0x20204c,function(_0x373a44){if(_0x373a44[_0x80b8('0x29')]!==_0x80b8('0x39')){var _0x123d7a={};_0x123d7a[_0x373a44[_0x80b8('0x25')]]={'$like':'%'+_0x10eb63[_0x80b8('0x2d')][_0x80b8('0x37')]+'%'};return _0x123d7a;}})});}_0xe175b0=_[_0x80b8('0x38')]({},_0xe175b0,_0x10eb63[_0x80b8('0x3a')]);var _0x119c3f={'where':_0xe175b0[_0x80b8('0x34')]};return db['AnalyticTreeReport'][_0x80b8('0x1d')](_0x119c3f)['then'](function(_0x33933f){_0x242c06['count']=_0x33933f;if(_0x10eb63[_0x80b8('0x2d')][_0x80b8('0x3b')]){_0xe175b0[_0x80b8('0x3c')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x80b8('0x3d')](_0xe175b0);})[_0x80b8('0x22')](function(_0x370bff){_0x242c06[_0x80b8('0x3e')]=_0x370bff;return _0x242c06;})[_0x80b8('0x22')](respondWithFilteredResult(_0x7390bf,_0xe175b0))[_0x80b8('0x3f')](handleError(_0x7390bf,null));};exports['show']=function(_0x2c2529,_0x50c29f){var _0x48ca09={'raw':!![],'where':{'id':_0x2c2529[_0x80b8('0x40')]['id']}},_0x4a1b2f={};_0x4a1b2f['model']=_[_0x80b8('0x41')](db['AnalyticTreeReport'][_0x80b8('0x28')]);_0x4a1b2f[_0x80b8('0x2d')]=_[_0x80b8('0x41')](_0x2c2529[_0x80b8('0x2d')]);_0x4a1b2f['filters']=_[_0x80b8('0x2e')](_0x4a1b2f[_0x80b8('0x2b')],_0x4a1b2f['query']);_0x48ca09[_0x80b8('0x2f')]=_['intersection'](_0x4a1b2f[_0x80b8('0x2b')],qs[_0x80b8('0x30')](_0x2c2529['query'][_0x80b8('0x30')]));_0x48ca09[_0x80b8('0x2f')]=_0x48ca09['attributes'][_0x80b8('0x31')]?_0x48ca09[_0x80b8('0x2f')]:_0x4a1b2f[_0x80b8('0x2b')];if(_0x2c2529['query']['includeAll']){_0x48ca09[_0x80b8('0x3c')]=[{'all':!![]}];}_0x48ca09=_[_0x80b8('0x38')]({},_0x48ca09,_0x2c2529[_0x80b8('0x3a')]);return db[_0x80b8('0x42')][_0x80b8('0x43')](_0x48ca09)[_0x80b8('0x22')](handleEntityNotFound(_0x50c29f,null))['then'](respondWithResult(_0x50c29f,null))['catch'](handleError(_0x50c29f,null));};exports['create']=function(_0x32eb83,_0xac360d){return db['AnalyticTreeReport'][_0x80b8('0x44')](_0x32eb83[_0x80b8('0x45')],{})[_0x80b8('0x22')](respondWithResult(_0xac360d,0xc9))[_0x80b8('0x3f')](handleError(_0xac360d,null));};exports[_0x80b8('0x21')]=function(_0x1d17ab,_0x50f083){if(_0x1d17ab[_0x80b8('0x45')]['id']){delete _0x1d17ab['body']['id'];}return db['AnalyticTreeReport'][_0x80b8('0x43')]({'where':{'id':_0x1d17ab[_0x80b8('0x40')]['id']}})[_0x80b8('0x22')](handleEntityNotFound(_0x50f083,null))[_0x80b8('0x22')](saveUpdates(_0x1d17ab[_0x80b8('0x45')],null))[_0x80b8('0x22')](respondWithResult(_0x50f083,null))[_0x80b8('0x3f')](handleError(_0x50f083,null));};exports[_0x80b8('0x23')]=function(_0x251261,_0x56ca51){return db[_0x80b8('0x42')][_0x80b8('0x43')]({'where':{'id':_0x251261[_0x80b8('0x40')]['id']}})['then'](handleEntityNotFound(_0x56ca51,null))[_0x80b8('0x22')](removeEntity(_0x56ca51,null))['catch'](handleError(_0x56ca51,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 55723d1..b7ce727 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 _0x1b54=['util','api','moment','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash'];(function(_0x4d0662,_0x145963){var _0x6eea6d=function(_0x2def06){while(--_0x2def06){_0x4d0662['push'](_0x4d0662['shift']());}};_0x6eea6d(++_0x145963);}(_0x1b54,0x74));var _0x41b5=function(_0x5527f6,_0x450dac){_0x5527f6=_0x5527f6-0x0;var _0x40be53=_0x1b54[_0x5527f6];return _0x40be53;};'use strict';var _=require(_0x41b5('0x0'));var util=require(_0x41b5('0x1'));var logger=require('../../config/logger')(_0x41b5('0x2'));var moment=require(_0x41b5('0x3'));var BPromise=require('bluebird');var rp=require(_0x41b5('0x4'));var fs=require('fs');var path=require(_0x41b5('0x5'));var rimraf=require(_0x41b5('0x6'));var config=require(_0x41b5('0x7'));var attributes=require(_0x41b5('0x8'));module[_0x41b5('0x9')]=function(_0x3e8aa6,_0x218b1f){return _0x3e8aa6[_0x41b5('0xa')](_0x41b5('0xb'),attributes,{'tableName':_0x41b5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd01a=['api','moment','bluebird','rimraf','../../config/environment','exports','analytics_report_trees','lodash','util','../../config/logger'];(function(_0x1f0639,_0x306cfb){var _0x1080c2=function(_0x3d6490){while(--_0x3d6490){_0x1f0639['push'](_0x1f0639['shift']());}};_0x1080c2(++_0x306cfb);}(_0xd01a,0x151));var _0xad01=function(_0x3c4cd4,_0x3556f2){_0x3c4cd4=_0x3c4cd4-0x0;var _0x5cb366=_0xd01a[_0x3c4cd4];return _0x5cb366;};'use strict';var _=require(_0xad01('0x0'));var util=require(_0xad01('0x1'));var logger=require(_0xad01('0x2'))(_0xad01('0x3'));var moment=require(_0xad01('0x4'));var BPromise=require(_0xad01('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xad01('0x6'));var config=require(_0xad01('0x7'));var attributes=require('./analyticTreeReport.attributes');module[_0xad01('0x8')]=function(_0xfe1f24,_0x5e805f){return _0xfe1f24['define']('AnalyticTreeReport',attributes,{'tableName':_0xad01('0x9'),'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 97b1324..c3266ab 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 _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x5cbe57,_0x2af0cf){var _0x14cca4=function(_0x1d13f1){while(--_0x1d13f1){_0x5cbe57['push'](_0x5cbe57['shift']());}};_0x14cca4(++_0x2af0cf);}(_0x2ef3,0xba));var _0x32ef=function(_0x31468e,_0x303635){_0x31468e=_0x31468e-0x0;var _0x5899cb=_0x2ef3[_0x31468e];return _0x5899cb;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}
\ No newline at end of file
+var _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x5abbaf,_0x1a0041){_0x5abbaf=_0x5abbaf-0x0;var _0xad0c75=_0x7a54[_0x5abbaf];return _0xad0c75;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index a86c7c7..ec59f76 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 _0xef86=['destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','put','delete'];(function(_0x4cfc85,_0x4d6829){var _0x1972af=function(_0x22b4d5){while(--_0x22b4d5){_0x4cfc85['push'](_0x4cfc85['shift']());}};_0x1972af(++_0x4d6829);}(_0xef86,0x178));var _0x6ef8=function(_0x5b80c8,_0x8f620f){_0x5b80c8=_0x5b80c8-0x0;var _0x314c6c=_0xef86[_0x5b80c8];return _0x314c6c;};'use strict';var multer=require(_0x6ef8('0x0'));var util=require(_0x6ef8('0x1'));var path=require(_0x6ef8('0x2'));var timeout=require('connect-timeout');var express=require(_0x6ef8('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6ef8('0x4'));var interaction=require(_0x6ef8('0x5'));var config=require(_0x6ef8('0x6'));var controller=require('./analyticTreeReport.controller');router[_0x6ef8('0x7')]('/',auth[_0x6ef8('0x8')](),controller[_0x6ef8('0x9')]);router[_0x6ef8('0x7')](_0x6ef8('0xa'),auth[_0x6ef8('0x8')](),controller['show']);router[_0x6ef8('0xb')]('/',auth[_0x6ef8('0x8')](),controller[_0x6ef8('0xc')]);router[_0x6ef8('0xd')](_0x6ef8('0xa'),auth[_0x6ef8('0x8')](),controller['update']);router[_0x6ef8('0xe')](_0x6ef8('0xa'),auth[_0x6ef8('0x8')](),controller[_0x6ef8('0xf')]);module[_0x6ef8('0x10')]=router;
\ No newline at end of file
+var _0xf580=['index','/:id','show','create','put','delete','destroy','exports','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated'];(function(_0x469a2d,_0x53bcbe){var _0x148147=function(_0xe46eea){while(--_0xe46eea){_0x469a2d['push'](_0x469a2d['shift']());}};_0x148147(++_0x53bcbe);}(_0xf580,0x128));var _0x0f58=function(_0x2767d6,_0x4c0b1b){_0x2767d6=_0x2767d6-0x0;var _0x58f812=_0xf580[_0x2767d6];return _0x58f812;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x0f58('0x0'));var express=require(_0x0f58('0x1'));var router=express[_0x0f58('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0f58('0x3'));var config=require(_0x0f58('0x4'));var controller=require(_0x0f58('0x5'));router[_0x0f58('0x6')]('/',auth[_0x0f58('0x7')](),controller[_0x0f58('0x8')]);router[_0x0f58('0x6')](_0x0f58('0x9'),auth[_0x0f58('0x7')](),controller[_0x0f58('0xa')]);router['post']('/',auth[_0x0f58('0x7')](),controller[_0x0f58('0xb')]);router[_0x0f58('0xc')]('/:id',auth[_0x0f58('0x7')](),controller['update']);router[_0x0f58('0xd')](_0x0f58('0x9'),auth[_0x0f58('0x7')](),controller[_0x0f58('0xe')]);module[_0x0f58('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 6502497..5d003fb 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 _0x1cc7=['STRING','sequelize','exports'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x1cc7,0x15a));var _0x71cc=function(_0x51e2be,_0x42eaa5){_0x51e2be=_0x51e2be-0x0;var _0x4d93df=_0x1cc7[_0x51e2be];return _0x4d93df;};'use strict';var Sequelize=require(_0x71cc('0x0'));module[_0x71cc('0x1')]={'name':{'type':Sequelize[_0x71cc('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x295f=['exports','STRING'];(function(_0x1e2e47,_0x28c9bb){var _0x471f21=function(_0x4d1fc3){while(--_0x4d1fc3){_0x1e2e47['push'](_0x1e2e47['shift']());}};_0x471f21(++_0x28c9bb);}(_0x295f,0x168));var _0xf295=function(_0x4f1d08,_0x9422d0){_0x4f1d08=_0x4f1d08-0x0;var _0x54ff81=_0x295f[_0x4f1d08];return _0x54ff81;};'use strict';var Sequelize=require('sequelize');module[_0xf295('0x0')]={'name':{'type':Sequelize[_0xf295('0x1')]},'basename':{'type':Sequelize[_0xf295('0x1')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index b7120cc..34fba37 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 _0xf2da=['filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','clone','get','createdAt','updatedAt','body','omit','create','originalname','file','mimetype','download','findOne','join','server/files/attachments/','offline-chat/','basename','eml-format','zip-dir','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','Attachment','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x32580e,_0x13b569){var _0x19f538=function(_0x1ed012){while(--_0x1ed012){_0x32580e['push'](_0x32580e['shift']());}};_0x19f538(++_0x13b569);}(_0xf2da,0x1ca));var _0xaf2d=function(_0x34ad72,_0x1e43f6){_0x34ad72=_0x34ad72-0x0;var _0x5c9aa8=_0xf2da[_0x34ad72];return _0x5c9aa8;};'use strict';var emlformat=require(_0xaf2d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaf2d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xaf2d('0x2'));var BPromise=require(_0xaf2d('0x3'));var Mustache=require(_0xaf2d('0x4'));var util=require('util');var path=require(_0xaf2d('0x5'));var sox=require('sox');var csv=require(_0xaf2d('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaf2d('0x7'));var _=require(_0xaf2d('0x8'));var squel=require('squel');var crypto=require(_0xaf2d('0x9'));var jsforce=require(_0xaf2d('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaf2d('0xb'));var Papa=require(_0xaf2d('0xc'));var Redis=require(_0xaf2d('0xd'));var authService=require(_0xaf2d('0xe'));var qs=require(_0xaf2d('0xf'));var as=require(_0xaf2d('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaf2d('0x11'))(_0xaf2d('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xaf2d('0x13'))['db'];function respondWithStatusCode(_0x11e406,_0x23cc2c){_0x23cc2c=_0x23cc2c||0xcc;return function(_0x1e42f6){if(_0x1e42f6){return _0x11e406[_0xaf2d('0x14')](_0x23cc2c);}return _0x11e406[_0xaf2d('0x15')](_0x23cc2c)[_0xaf2d('0x16')]();};}function respondWithResult(_0x2d57ec,_0x1b06e1){_0x1b06e1=_0x1b06e1||0xc8;return function(_0x58b264){if(_0x58b264){return _0x2d57ec[_0xaf2d('0x15')](_0x1b06e1)[_0xaf2d('0x17')](_0x58b264);}};}function respondWithFilteredResult(_0x6ccb66,_0x483d66){return function(_0x4d647a){if(_0x4d647a){var _0x2a8842=typeof _0x483d66[_0xaf2d('0x18')]===_0xaf2d('0x19')&&typeof _0x483d66[_0xaf2d('0x1a')]===_0xaf2d('0x19');var _0x1b7a1d=_0x4d647a[_0xaf2d('0x1b')];var _0x2945bd=_0x2a8842?0x0:_0x483d66[_0xaf2d('0x18')];var _0x16c13e=_0x2a8842?_0x4d647a[_0xaf2d('0x1b')]:_0x483d66[_0xaf2d('0x18')]+_0x483d66[_0xaf2d('0x1a')];var _0x8a11f2;if(_0x16c13e>=_0x1b7a1d){_0x16c13e=_0x1b7a1d;_0x8a11f2=0xc8;}else{_0x8a11f2=0xce;}_0x6ccb66[_0xaf2d('0x15')](_0x8a11f2);return _0x6ccb66['set'](_0xaf2d('0x1c'),_0x2945bd+'-'+_0x16c13e+'/'+_0x1b7a1d)[_0xaf2d('0x17')](_0x4d647a);}return null;};}function patchUpdates(_0x120435){return function(_0x22543a){try{jsonpatch[_0xaf2d('0x1d')](_0x22543a,_0x120435,!![]);}catch(_0x1b93f7){return BPromise[_0xaf2d('0x1e')](_0x1b93f7);}return _0x22543a[_0xaf2d('0x1f')]();};}function saveUpdates(_0x14328f,_0x1c603b){return function(_0x513409){if(_0x513409){return _0x513409[_0xaf2d('0x20')](_0x14328f)[_0xaf2d('0x21')](function(_0x4c06e3){return _0x4c06e3;});}return null;};}function removeEntity(_0x3af619,_0x2b2814){return function(_0x324984){if(_0x324984){return _0x324984[_0xaf2d('0x22')]()[_0xaf2d('0x21')](function(){_0x3af619[_0xaf2d('0x15')](0xcc)[_0xaf2d('0x16')]();});}};}function handleEntityNotFound(_0x21c513,_0x18354c){return function(_0x26d9e1){if(!_0x26d9e1){_0x21c513['sendStatus'](0x194);}return _0x26d9e1;};}function handleError(_0x4973c3,_0x299588){_0x299588=_0x299588||0x1f4;return function(_0x832d7e){logger[_0xaf2d('0x23')](_0x832d7e[_0xaf2d('0x24')]);if(_0x832d7e[_0xaf2d('0x25')]){delete _0x832d7e['name'];}_0x4973c3[_0xaf2d('0x15')](_0x299588)['send'](_0x832d7e);};}exports[_0xaf2d('0x26')]=function(_0x1b37b8,_0x1cc8af){var _0x4a6da9={},_0x4ff9ab={},_0x3a65b5={'count':0x0,'rows':[]};var _0x30d094=_[_0xaf2d('0x27')](db[_0xaf2d('0x28')][_0xaf2d('0x29')],function(_0x34748f){return{'name':_0x34748f['fieldName'],'type':_0x34748f[_0xaf2d('0x2a')][_0xaf2d('0x2b')]};});_0x4ff9ab[_0xaf2d('0x2c')]=_[_0xaf2d('0x27')](_0x30d094,_0xaf2d('0x25'));_0x4ff9ab[_0xaf2d('0x2d')]=_[_0xaf2d('0x2e')](_0x1b37b8[_0xaf2d('0x2d')]);_0x4ff9ab[_0xaf2d('0x2f')]=_[_0xaf2d('0x30')](_0x4ff9ab[_0xaf2d('0x2c')],_0x4ff9ab[_0xaf2d('0x2d')]);_0x4a6da9['attributes']=_[_0xaf2d('0x30')](_0x4ff9ab[_0xaf2d('0x2c')],qs[_0xaf2d('0x31')](_0x1b37b8['query'][_0xaf2d('0x31')]));_0x4a6da9[_0xaf2d('0x32')]=_0x4a6da9[_0xaf2d('0x32')][_0xaf2d('0x33')]?_0x4a6da9[_0xaf2d('0x32')]:_0x4ff9ab[_0xaf2d('0x2c')];if(!_0x1b37b8[_0xaf2d('0x2d')][_0xaf2d('0x34')](_0xaf2d('0x35'))){_0x4a6da9['limit']=qs[_0xaf2d('0x1a')](_0x1b37b8[_0xaf2d('0x2d')][_0xaf2d('0x1a')]);_0x4a6da9[_0xaf2d('0x18')]=qs[_0xaf2d('0x18')](_0x1b37b8['query'][_0xaf2d('0x18')]);}_0x4a6da9[_0xaf2d('0x36')]=qs[_0xaf2d('0x37')](_0x1b37b8[_0xaf2d('0x2d')][_0xaf2d('0x37')]);_0x4a6da9[_0xaf2d('0x38')]=qs[_0xaf2d('0x2f')](_[_0xaf2d('0x39')](_0x1b37b8[_0xaf2d('0x2d')],_0x4ff9ab[_0xaf2d('0x2f')]),_0x30d094);if(_0x1b37b8[_0xaf2d('0x2d')][_0xaf2d('0x3a')]){_0x4a6da9['where']=_[_0xaf2d('0x3b')](_0x4a6da9[_0xaf2d('0x38')],{'$or':_[_0xaf2d('0x27')](_0x30d094,function(_0x3d29b9){if(_0x3d29b9[_0xaf2d('0x2a')]!==_0xaf2d('0x3c')){var _0x3b1d89={};_0x3b1d89[_0x3d29b9['name']]={'$like':'%'+_0x1b37b8[_0xaf2d('0x2d')][_0xaf2d('0x3a')]+'%'};return _0x3b1d89;}})});}_0x4a6da9=_[_0xaf2d('0x3b')]({},_0x4a6da9,_0x1b37b8['options']);var _0x519645={'where':_0x4a6da9[_0xaf2d('0x38')]};return db['Attachment'][_0xaf2d('0x1b')](_0x519645)['then'](function(_0x42c531){_0x3a65b5['count']=_0x42c531;if(_0x1b37b8[_0xaf2d('0x2d')][_0xaf2d('0x3d')]){_0x4a6da9[_0xaf2d('0x3e')]=[{'all':!![]}];}return db['Attachment'][_0xaf2d('0x3f')](_0x4a6da9);})[_0xaf2d('0x21')](function(_0x36da9c){_0x3a65b5[_0xaf2d('0x40')]=_0x36da9c;return _0x3a65b5;})[_0xaf2d('0x21')](respondWithFilteredResult(_0x1cc8af,_0x4a6da9))[_0xaf2d('0x41')](handleError(_0x1cc8af,null));};exports[_0xaf2d('0x42')]=function(_0x2aa952,_0x43acc3){var _0x20c734={'raw':!![],'where':{'id':_0x2aa952[_0xaf2d('0x43')]['id']}},_0x1fd0a5={};_0x1fd0a5[_0xaf2d('0x2c')]=_[_0xaf2d('0x2e')](db['Attachment'][_0xaf2d('0x29')]);_0x1fd0a5[_0xaf2d('0x2d')]=_[_0xaf2d('0x2e')](_0x2aa952[_0xaf2d('0x2d')]);_0x1fd0a5[_0xaf2d('0x2f')]=_['intersection'](_0x1fd0a5[_0xaf2d('0x2c')],_0x1fd0a5[_0xaf2d('0x2d')]);_0x20c734['attributes']=_['intersection'](_0x1fd0a5[_0xaf2d('0x2c')],qs['fields'](_0x2aa952[_0xaf2d('0x2d')]['fields']));_0x20c734['attributes']=_0x20c734[_0xaf2d('0x32')][_0xaf2d('0x33')]?_0x20c734[_0xaf2d('0x32')]:_0x1fd0a5[_0xaf2d('0x2c')];if(_0x2aa952[_0xaf2d('0x2d')][_0xaf2d('0x3d')]){_0x20c734['include']=[{'all':!![]}];}_0x20c734=_[_0xaf2d('0x3b')]({},_0x20c734,_0x2aa952[_0xaf2d('0x44')]);return db[_0xaf2d('0x28')][_0xaf2d('0x45')](_0x20c734)[_0xaf2d('0x21')](handleEntityNotFound(_0x43acc3,null))[_0xaf2d('0x21')](respondWithResult(_0x43acc3,null))[_0xaf2d('0x41')](handleError(_0x43acc3,null));};exports[_0xaf2d('0x46')]=function(_0x216bad,_0x39aa3d){var _0x168788={'where':{'id':_0x216bad[_0xaf2d('0x43')]['id']}},_0x22ad3a={};_0x22ad3a[_0xaf2d('0x2c')]=_[_0xaf2d('0x2e')](db[_0xaf2d('0x28')][_0xaf2d('0x29')]);_0x168788[_0xaf2d('0x32')]=_['intersection'](_0x22ad3a[_0xaf2d('0x2c')],qs[_0xaf2d('0x31')](_0x216bad['query'][_0xaf2d('0x31')]));_0x168788[_0xaf2d('0x32')]=_0x168788[_0xaf2d('0x32')][_0xaf2d('0x33')]?_0x168788[_0xaf2d('0x32')]:_0x22ad3a[_0xaf2d('0x2c')];if(_0x216bad[_0xaf2d('0x2d')]['includeAll']){_0x168788['include']=[{'all':!![]}];}_0x168788=_[_0xaf2d('0x3b')]({},_0x168788,_0x216bad[_0xaf2d('0x44')]);return db[_0xaf2d('0x28')][_0xaf2d('0x45')](_0x168788)[_0xaf2d('0x21')](handleEntityNotFound(_0x39aa3d,null))[_0xaf2d('0x21')](function(_0x1abe6d){if(_0x1abe6d){var _0x39c4b8=_0x1abe6d[_0xaf2d('0x47')]({'plain':!![]});_0x39c4b8=qs['omit'](_0x39c4b8,['id',_0xaf2d('0x48'),_0xaf2d('0x49')]);_0x216bad[_0xaf2d('0x4a')]=_[_0xaf2d('0x4b')](_0x216bad['body'],['id','createdAt','updatedAt']);return db['Attachment'][_0xaf2d('0x4c')](_[_0xaf2d('0x3b')](_0x39c4b8,_0x216bad['body']),{'include':_0x216bad[_0xaf2d('0x2d')]['includeAll']?[{'all':!![]}]:undefined});}})[_0xaf2d('0x21')](respondWithResult(_0x39aa3d,0xc9))[_0xaf2d('0x41')](handleError(_0x39aa3d,null));};exports[_0xaf2d('0x20')]=function(_0x23a90d,_0x21f91d){if(_0x23a90d[_0xaf2d('0x4a')]['id']){delete _0x23a90d[_0xaf2d('0x4a')]['id'];}return db[_0xaf2d('0x28')][_0xaf2d('0x45')]({'where':{'id':_0x23a90d['params']['id']}})[_0xaf2d('0x21')](handleEntityNotFound(_0x21f91d,null))[_0xaf2d('0x21')](saveUpdates(_0x23a90d[_0xaf2d('0x4a')],null))[_0xaf2d('0x21')](respondWithResult(_0x21f91d,null))[_0xaf2d('0x41')](handleError(_0x21f91d,null));};exports[_0xaf2d('0x22')]=function(_0x5bb3c6,_0xe4df82){return db[_0xaf2d('0x28')][_0xaf2d('0x45')]({'where':{'id':_0x5bb3c6[_0xaf2d('0x43')]['id']}})[_0xaf2d('0x21')](handleEntityNotFound(_0xe4df82,null))['then'](removeEntity(_0xe4df82,null))[_0xaf2d('0x41')](handleError(_0xe4df82,null));};exports[_0xaf2d('0x4c')]=function(_0x35f356,_0x2e523c,_0x47ccfc){_0x35f356[_0xaf2d('0x4a')][_0xaf2d('0x25')]=_0x35f356['file'][_0xaf2d('0x4d')];_0x35f356[_0xaf2d('0x4a')]['basename']=_0x35f356[_0xaf2d('0x4e')]['filename'];_0x35f356['body']['type']=_0x35f356[_0xaf2d('0x4e')][_0xaf2d('0x4f')];return db['Attachment'][_0xaf2d('0x4c')](_0x35f356['body'])[_0xaf2d('0x21')](respondWithResult(_0x2e523c,0xc9))[_0xaf2d('0x41')](handleError(_0x2e523c,null));};exports[_0xaf2d('0x50')]=function(_0x531ccc,_0x33f439,_0x34d524){return db['Attachment'][_0xaf2d('0x51')]({'where':{'id':_0x531ccc['params']['id']},'raw':!![]})[_0xaf2d('0x21')](handleEntityNotFound(_0x33f439,null))[_0xaf2d('0x21')](function(_0x554c75){if(_0x554c75){var _0x19e3b6=_0x554c75['ChatOfflineMessageId']!==null;var _0x585ae1=path[_0xaf2d('0x52')](config['root'],_0xaf2d('0x53'));if(_0x19e3b6){_0x585ae1=path[_0xaf2d('0x52')](_0x585ae1,_0xaf2d('0x54'));}var _0x383e18=path['join'](_0x585ae1,_0x554c75[_0xaf2d('0x55')]);return _0x33f439[_0xaf2d('0x50')](_0x383e18);}})[_0xaf2d('0x41')](handleError(_0x33f439,null));};
\ No newline at end of file
+var _0x7a3e=['options','include','findAll','rows','catch','params','find','get','omit','createdAt','updatedAt','body','create','file','basename','filename','mimetype','findOne','ChatOfflineMessageId','join','root','offline-chat/','download','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','Attachment','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter'];(function(_0x1c2f29,_0x5a2668){var _0x258465=function(_0x30332f){while(--_0x30332f){_0x1c2f29['push'](_0x1c2f29['shift']());}};_0x258465(++_0x5a2668);}(_0x7a3e,0x17b));var _0xe7a3=function(_0x43fd4b,_0x3f68ec){_0x43fd4b=_0x43fd4b-0x0;var _0x1fc2e2=_0x7a3e[_0x43fd4b];return _0x1fc2e2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe7a3('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe7a3('0x1'));var rp=require(_0xe7a3('0x2'));var moment=require(_0xe7a3('0x3'));var BPromise=require(_0xe7a3('0x4'));var Mustache=require(_0xe7a3('0x5'));var util=require(_0xe7a3('0x6'));var path=require(_0xe7a3('0x7'));var sox=require(_0xe7a3('0x8'));var csv=require(_0xe7a3('0x9'));var ejs=require(_0xe7a3('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe7a3('0xb'));var crypto=require(_0xe7a3('0xc'));var jsforce=require(_0xe7a3('0xd'));var deskjs=require(_0xe7a3('0xe'));var toCsv=require(_0xe7a3('0x9'));var querystring=require(_0xe7a3('0xf'));var Papa=require('papaparse');var Redis=require(_0xe7a3('0x10'));var authService=require(_0xe7a3('0x11'));var qs=require(_0xe7a3('0x12'));var as=require(_0xe7a3('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xe7a3('0x14'));var config=require(_0xe7a3('0x15'));var licenseUtil=require(_0xe7a3('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b65d4,_0x1ade64){_0x1ade64=_0x1ade64||0xcc;return function(_0x26fef7){if(_0x26fef7){return _0x4b65d4[_0xe7a3('0x17')](_0x1ade64);}return _0x4b65d4['status'](_0x1ade64)[_0xe7a3('0x18')]();};}function respondWithResult(_0xad5a9b,_0x438ecb){_0x438ecb=_0x438ecb||0xc8;return function(_0x15e842){if(_0x15e842){return _0xad5a9b[_0xe7a3('0x19')](_0x438ecb)[_0xe7a3('0x1a')](_0x15e842);}};}function respondWithFilteredResult(_0x425e5b,_0x42b4de){return function(_0x118952){if(_0x118952){var _0x21a2aa=typeof _0x42b4de[_0xe7a3('0x1b')]===_0xe7a3('0x1c')&&typeof _0x42b4de[_0xe7a3('0x1d')]===_0xe7a3('0x1c');var _0x52704e=_0x118952['count'];var _0x251f6a=_0x21a2aa?0x0:_0x42b4de[_0xe7a3('0x1b')];var _0x3bf283=_0x21a2aa?_0x118952[_0xe7a3('0x1e')]:_0x42b4de[_0xe7a3('0x1b')]+_0x42b4de[_0xe7a3('0x1d')];var _0x4063a8;if(_0x3bf283>=_0x52704e){_0x3bf283=_0x52704e;_0x4063a8=0xc8;}else{_0x4063a8=0xce;}_0x425e5b[_0xe7a3('0x19')](_0x4063a8);return _0x425e5b[_0xe7a3('0x1f')](_0xe7a3('0x20'),_0x251f6a+'-'+_0x3bf283+'/'+_0x52704e)[_0xe7a3('0x1a')](_0x118952);}return null;};}function patchUpdates(_0xdecbc4){return function(_0x1010bc){try{jsonpatch[_0xe7a3('0x21')](_0x1010bc,_0xdecbc4,!![]);}catch(_0x570ef5){return BPromise[_0xe7a3('0x22')](_0x570ef5);}return _0x1010bc[_0xe7a3('0x23')]();};}function saveUpdates(_0x52890b,_0x14072c){return function(_0x37345a){if(_0x37345a){return _0x37345a[_0xe7a3('0x24')](_0x52890b)[_0xe7a3('0x25')](function(_0x204c08){return _0x204c08;});}return null;};}function removeEntity(_0x2b140c,_0x4ee209){return function(_0x152c93){if(_0x152c93){return _0x152c93[_0xe7a3('0x26')]()[_0xe7a3('0x25')](function(){_0x2b140c[_0xe7a3('0x19')](0xcc)[_0xe7a3('0x18')]();});}};}function handleEntityNotFound(_0x553f81,_0x4f3182){return function(_0x58b714){if(!_0x58b714){_0x553f81[_0xe7a3('0x17')](0x194);}return _0x58b714;};}function handleError(_0x13ccfa,_0x319529){_0x319529=_0x319529||0x1f4;return function(_0x589b03){logger[_0xe7a3('0x27')](_0x589b03[_0xe7a3('0x28')]);if(_0x589b03['name']){delete _0x589b03[_0xe7a3('0x29')];}_0x13ccfa[_0xe7a3('0x19')](_0x319529)[_0xe7a3('0x2a')](_0x589b03);};}exports[_0xe7a3('0x2b')]=function(_0x221576,_0x594275){var _0x323eb0={},_0x2c6ecf={},_0x70764a={'count':0x0,'rows':[]};var _0x23dd0c=_['map'](db[_0xe7a3('0x2c')][_0xe7a3('0x2d')],function(_0x41626f){return{'name':_0x41626f[_0xe7a3('0x2e')],'type':_0x41626f[_0xe7a3('0x2f')][_0xe7a3('0x30')]};});_0x2c6ecf[_0xe7a3('0x31')]=_[_0xe7a3('0x32')](_0x23dd0c,'name');_0x2c6ecf[_0xe7a3('0x33')]=_[_0xe7a3('0x34')](_0x221576[_0xe7a3('0x33')]);_0x2c6ecf[_0xe7a3('0x35')]=_[_0xe7a3('0x36')](_0x2c6ecf[_0xe7a3('0x31')],_0x2c6ecf['query']);_0x323eb0[_0xe7a3('0x37')]=_[_0xe7a3('0x36')](_0x2c6ecf[_0xe7a3('0x31')],qs[_0xe7a3('0x38')](_0x221576['query'][_0xe7a3('0x38')]));_0x323eb0['attributes']=_0x323eb0[_0xe7a3('0x37')][_0xe7a3('0x39')]?_0x323eb0[_0xe7a3('0x37')]:_0x2c6ecf['model'];if(!_0x221576[_0xe7a3('0x33')][_0xe7a3('0x3a')](_0xe7a3('0x3b'))){_0x323eb0[_0xe7a3('0x1d')]=qs[_0xe7a3('0x1d')](_0x221576['query'][_0xe7a3('0x1d')]);_0x323eb0[_0xe7a3('0x1b')]=qs[_0xe7a3('0x1b')](_0x221576[_0xe7a3('0x33')][_0xe7a3('0x1b')]);}_0x323eb0[_0xe7a3('0x3c')]=qs[_0xe7a3('0x3d')](_0x221576['query'][_0xe7a3('0x3d')]);_0x323eb0[_0xe7a3('0x3e')]=qs[_0xe7a3('0x35')](_['pick'](_0x221576['query'],_0x2c6ecf[_0xe7a3('0x35')]),_0x23dd0c);if(_0x221576[_0xe7a3('0x33')]['filter']){_0x323eb0[_0xe7a3('0x3e')]=_[_0xe7a3('0x3f')](_0x323eb0['where'],{'$or':_[_0xe7a3('0x32')](_0x23dd0c,function(_0x7a7572){if(_0x7a7572[_0xe7a3('0x2f')]!==_0xe7a3('0x40')){var _0x2184cd={};_0x2184cd[_0x7a7572[_0xe7a3('0x29')]]={'$like':'%'+_0x221576[_0xe7a3('0x33')][_0xe7a3('0x41')]+'%'};return _0x2184cd;}})});}_0x323eb0=_['merge']({},_0x323eb0,_0x221576[_0xe7a3('0x42')]);var _0x490e33={'where':_0x323eb0['where']};return db[_0xe7a3('0x2c')][_0xe7a3('0x1e')](_0x490e33)[_0xe7a3('0x25')](function(_0x24cc94){_0x70764a[_0xe7a3('0x1e')]=_0x24cc94;if(_0x221576['query']['includeAll']){_0x323eb0[_0xe7a3('0x43')]=[{'all':!![]}];}return db[_0xe7a3('0x2c')][_0xe7a3('0x44')](_0x323eb0);})[_0xe7a3('0x25')](function(_0x4e1fc2){_0x70764a[_0xe7a3('0x45')]=_0x4e1fc2;return _0x70764a;})['then'](respondWithFilteredResult(_0x594275,_0x323eb0))[_0xe7a3('0x46')](handleError(_0x594275,null));};exports['show']=function(_0x3bd930,_0x2cfd48){var _0x24c4aa={'raw':!![],'where':{'id':_0x3bd930[_0xe7a3('0x47')]['id']}},_0x13eb53={};_0x13eb53[_0xe7a3('0x31')]=_[_0xe7a3('0x34')](db[_0xe7a3('0x2c')][_0xe7a3('0x2d')]);_0x13eb53[_0xe7a3('0x33')]=_[_0xe7a3('0x34')](_0x3bd930[_0xe7a3('0x33')]);_0x13eb53[_0xe7a3('0x35')]=_[_0xe7a3('0x36')](_0x13eb53[_0xe7a3('0x31')],_0x13eb53['query']);_0x24c4aa[_0xe7a3('0x37')]=_[_0xe7a3('0x36')](_0x13eb53[_0xe7a3('0x31')],qs[_0xe7a3('0x38')](_0x3bd930['query']['fields']));_0x24c4aa[_0xe7a3('0x37')]=_0x24c4aa[_0xe7a3('0x37')]['length']?_0x24c4aa[_0xe7a3('0x37')]:_0x13eb53[_0xe7a3('0x31')];if(_0x3bd930['query']['includeAll']){_0x24c4aa['include']=[{'all':!![]}];}_0x24c4aa=_[_0xe7a3('0x3f')]({},_0x24c4aa,_0x3bd930[_0xe7a3('0x42')]);return db['Attachment'][_0xe7a3('0x48')](_0x24c4aa)[_0xe7a3('0x25')](handleEntityNotFound(_0x2cfd48,null))[_0xe7a3('0x25')](respondWithResult(_0x2cfd48,null))[_0xe7a3('0x46')](handleError(_0x2cfd48,null));};exports['clone']=function(_0x323b6b,_0x52823d){var _0x4ecb64={'where':{'id':_0x323b6b[_0xe7a3('0x47')]['id']}},_0x38064d={};_0x38064d[_0xe7a3('0x31')]=_[_0xe7a3('0x34')](db[_0xe7a3('0x2c')][_0xe7a3('0x2d')]);_0x4ecb64[_0xe7a3('0x37')]=_[_0xe7a3('0x36')](_0x38064d[_0xe7a3('0x31')],qs[_0xe7a3('0x38')](_0x323b6b['query']['fields']));_0x4ecb64[_0xe7a3('0x37')]=_0x4ecb64[_0xe7a3('0x37')][_0xe7a3('0x39')]?_0x4ecb64[_0xe7a3('0x37')]:_0x38064d[_0xe7a3('0x31')];if(_0x323b6b['query']['includeAll']){_0x4ecb64[_0xe7a3('0x43')]=[{'all':!![]}];}_0x4ecb64=_['merge']({},_0x4ecb64,_0x323b6b[_0xe7a3('0x42')]);return db[_0xe7a3('0x2c')]['find'](_0x4ecb64)[_0xe7a3('0x25')](handleEntityNotFound(_0x52823d,null))[_0xe7a3('0x25')](function(_0x16c3f9){if(_0x16c3f9){var _0x318602=_0x16c3f9[_0xe7a3('0x49')]({'plain':!![]});_0x318602=qs[_0xe7a3('0x4a')](_0x318602,['id',_0xe7a3('0x4b'),_0xe7a3('0x4c')]);_0x323b6b[_0xe7a3('0x4d')]=_[_0xe7a3('0x4a')](_0x323b6b[_0xe7a3('0x4d')],['id',_0xe7a3('0x4b'),'updatedAt']);return db['Attachment'][_0xe7a3('0x4e')](_[_0xe7a3('0x3f')](_0x318602,_0x323b6b['body']),{'include':_0x323b6b[_0xe7a3('0x33')]['includeAll']?[{'all':!![]}]:undefined});}})[_0xe7a3('0x25')](respondWithResult(_0x52823d,0xc9))['catch'](handleError(_0x52823d,null));};exports[_0xe7a3('0x24')]=function(_0x3ac246,_0x150971){if(_0x3ac246[_0xe7a3('0x4d')]['id']){delete _0x3ac246[_0xe7a3('0x4d')]['id'];}return db[_0xe7a3('0x2c')][_0xe7a3('0x48')]({'where':{'id':_0x3ac246[_0xe7a3('0x47')]['id']}})[_0xe7a3('0x25')](handleEntityNotFound(_0x150971,null))['then'](saveUpdates(_0x3ac246[_0xe7a3('0x4d')],null))[_0xe7a3('0x25')](respondWithResult(_0x150971,null))[_0xe7a3('0x46')](handleError(_0x150971,null));};exports['destroy']=function(_0x36829d,_0x3933e3){return db[_0xe7a3('0x2c')]['find']({'where':{'id':_0x36829d[_0xe7a3('0x47')]['id']}})['then'](handleEntityNotFound(_0x3933e3,null))[_0xe7a3('0x25')](removeEntity(_0x3933e3,null))['catch'](handleError(_0x3933e3,null));};exports[_0xe7a3('0x4e')]=function(_0x4586a3,_0x1e2f2c,_0xe4e3f0){_0x4586a3[_0xe7a3('0x4d')]['name']=_0x4586a3[_0xe7a3('0x4f')]['originalname'];_0x4586a3[_0xe7a3('0x4d')][_0xe7a3('0x50')]=_0x4586a3[_0xe7a3('0x4f')][_0xe7a3('0x51')];_0x4586a3[_0xe7a3('0x4d')][_0xe7a3('0x2f')]=_0x4586a3[_0xe7a3('0x4f')][_0xe7a3('0x52')];return db[_0xe7a3('0x2c')][_0xe7a3('0x4e')](_0x4586a3[_0xe7a3('0x4d')])['then'](respondWithResult(_0x1e2f2c,0xc9))[_0xe7a3('0x46')](handleError(_0x1e2f2c,null));};exports['download']=function(_0x31859f,_0xc749bd,_0x1d18f4){return db[_0xe7a3('0x2c')][_0xe7a3('0x53')]({'where':{'id':_0x31859f[_0xe7a3('0x47')]['id']},'raw':!![]})[_0xe7a3('0x25')](handleEntityNotFound(_0xc749bd,null))[_0xe7a3('0x25')](function(_0x570d8c){if(_0x570d8c){var _0xa5897c=_0x570d8c[_0xe7a3('0x54')]!==null;var _0x361066=path[_0xe7a3('0x55')](config[_0xe7a3('0x56')],'server/files/attachments/');if(_0xa5897c){_0x361066=path[_0xe7a3('0x55')](_0x361066,_0xe7a3('0x57'));}var _0x17532c=path[_0xe7a3('0x55')](_0x361066,_0x570d8c[_0xe7a3('0x50')]);return _0xc749bd[_0xe7a3('0x58')](_0x17532c);}})[_0xe7a3('0x46')](handleError(_0xc749bd,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 5624ca5..0527ce7 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 _0xfc83=['exports','define','lodash','request-promise','path','../../config/environment','./attachment.attributes'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xfc83,0x1bb));var _0x3fc8=function(_0x5f0285,_0x5968fb){_0x5f0285=_0x5f0285-0x0;var _0x312527=_0xfc83[_0x5f0285];return _0x312527;};'use strict';var _=require(_0x3fc8('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3fc8('0x1'));var fs=require('fs');var path=require(_0x3fc8('0x2'));var rimraf=require('rimraf');var config=require(_0x3fc8('0x3'));var attributes=require(_0x3fc8('0x4'));module[_0x3fc8('0x5')]=function(_0x2d2dde,_0x3da91d){return _0x2d2dde[_0x3fc8('0x6')]('Attachment',attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3a80=['Attachment','attachments','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define'];(function(_0x40c778,_0x471c5d){var _0x42127f=function(_0x414ec7){while(--_0x414ec7){_0x40c778['push'](_0x40c778['shift']());}};_0x42127f(++_0x471c5d);}(_0x3a80,0x154));var _0x03a8=function(_0x75a7dc,_0x2d5289){_0x75a7dc=_0x75a7dc-0x0;var _0x100d01=_0x3a80[_0x75a7dc];return _0x100d01;};'use strict';var _=require(_0x03a8('0x0'));var util=require('util');var logger=require(_0x03a8('0x1'))(_0x03a8('0x2'));var moment=require('moment');var BPromise=require(_0x03a8('0x3'));var rp=require(_0x03a8('0x4'));var fs=require('fs');var path=require(_0x03a8('0x5'));var rimraf=require(_0x03a8('0x6'));var config=require(_0x03a8('0x7'));var attributes=require(_0x03a8('0x8'));module[_0x03a8('0x9')]=function(_0x4dc8ba,_0x2f9753){return _0x4dc8ba[_0x03a8('0xa')](_0x03a8('0xb'),attributes,{'tableName':_0x03a8('0xc'),'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 eec4cde..7e2147c 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 _0x04b8=['Attachment','create','body','options','raw','debug','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateAttachment'];(function(_0x14cb75,_0x119a59){var _0x4cd743=function(_0xd0e0b2){while(--_0xd0e0b2){_0x14cb75['push'](_0x14cb75['shift']());}};_0x4cd743(++_0x119a59);}(_0x04b8,0x159));var _0x804b=function(_0x11238d,_0x499ac8){_0x11238d=_0x11238d-0x0;var _0x3686b0=_0x04b8[_0x11238d];return _0x3686b0;};'use strict';var _=require('lodash');var util=require(_0x804b('0x0'));var moment=require('moment');var BPromise=require(_0x804b('0x1'));var rs=require(_0x804b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x804b('0x3'))['db'];var utils=require(_0x804b('0x4'));var logger=require('../../config/logger')(_0x804b('0x5'));var config=require(_0x804b('0x6'));var jayson=require(_0x804b('0x7'));var client=jayson['client'][_0x804b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c5404,_0x476262,_0x50826d){return new BPromise(function(_0x27e950,_0x1071b4){return client['request'](_0x3c5404,_0x50826d)[_0x804b('0x9')](function(_0x336325){logger[_0x804b('0xa')](_0x804b('0xb'),_0x476262,_0x804b('0xc'));logger['debug'](_0x804b('0xd'),_0x476262,_0x804b('0xc'),JSON[_0x804b('0xe')](_0x336325));if(_0x336325[_0x804b('0xf')]){if(_0x336325[_0x804b('0xf')][_0x804b('0x10')]===0x1f4){logger['error'](_0x804b('0xb'),_0x476262,_0x336325['error'][_0x804b('0x11')]);return _0x1071b4(_0x336325[_0x804b('0xf')][_0x804b('0x11')]);}logger[_0x804b('0xf')]('Attachment,\x20%s,\x20%s',_0x476262,_0x336325[_0x804b('0xf')][_0x804b('0x11')]);return _0x27e950(_0x336325[_0x804b('0xf')][_0x804b('0x11')]);}else{logger['info'](_0x804b('0xb'),_0x476262,_0x804b('0xc'));_0x27e950(_0x336325['result'][_0x804b('0x11')]);}})['catch'](function(_0x2c90b9){logger[_0x804b('0xf')](_0x804b('0xb'),_0x476262,_0x2c90b9);_0x1071b4(_0x2c90b9);});});}exports[_0x804b('0x12')]=function(_0x3a05c0){var _0x5a0a82=this;return new Promise(function(_0x871d6c,_0x50b4fe){return db[_0x804b('0x13')][_0x804b('0x14')](_0x3a05c0[_0x804b('0x15')],{'raw':_0x3a05c0[_0x804b('0x16')]?_0x3a05c0['options'][_0x804b('0x17')]===undefined?!![]:![]:!![]})[_0x804b('0x9')](function(_0x427166){logger[_0x804b('0xa')](_0x804b('0x12'),_0x3a05c0);logger[_0x804b('0x18')](_0x804b('0x12'),_0x3a05c0,JSON[_0x804b('0xe')](_0x427166));_0x871d6c(_0x427166);})[_0x804b('0x19')](function(_0x2b7271){logger[_0x804b('0xf')]('CreateAttachment',_0x2b7271[_0x804b('0x11')],_0x3a05c0);_0x50b4fe(_0x5a0a82[_0x804b('0xf')](0x1f4,_0x2b7271['message']));});});};
\ No newline at end of file
+var _0x9224=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateAttachment','create','body','options','raw'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x9224,0xa3));var _0x4922=function(_0x1953a9,_0x12bedb){_0x1953a9=_0x1953a9-0x0;var _0x46b7c3=_0x9224[_0x1953a9];return _0x46b7c3;};'use strict';var _=require('lodash');var util=require(_0x4922('0x0'));var moment=require(_0x4922('0x1'));var BPromise=require(_0x4922('0x2'));var rs=require(_0x4922('0x3'));var fs=require('fs');var Redis=require(_0x4922('0x4'));var db=require(_0x4922('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x4922('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4922('0x7')][_0x4922('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4216c0,_0x251048,_0x7a8bd1){return new BPromise(function(_0x245562,_0x5c65dd){return client[_0x4922('0x9')](_0x4216c0,_0x7a8bd1)[_0x4922('0xa')](function(_0x50db40){logger[_0x4922('0xb')](_0x4922('0xc'),_0x251048,_0x4922('0xd'));logger[_0x4922('0xe')](_0x4922('0xf'),_0x251048,_0x4922('0xd'),JSON[_0x4922('0x10')](_0x50db40));if(_0x50db40[_0x4922('0x11')]){if(_0x50db40['error'][_0x4922('0x12')]===0x1f4){logger['error'](_0x4922('0xc'),_0x251048,_0x50db40[_0x4922('0x11')][_0x4922('0x13')]);return _0x5c65dd(_0x50db40[_0x4922('0x11')][_0x4922('0x13')]);}logger['error'](_0x4922('0xc'),_0x251048,_0x50db40[_0x4922('0x11')]['message']);return _0x245562(_0x50db40[_0x4922('0x11')][_0x4922('0x13')]);}else{logger[_0x4922('0xb')](_0x4922('0xc'),_0x251048,_0x4922('0xd'));_0x245562(_0x50db40[_0x4922('0x14')][_0x4922('0x13')]);}})['catch'](function(_0x2ae924){logger['error'](_0x4922('0xc'),_0x251048,_0x2ae924);_0x5c65dd(_0x2ae924);});});}exports[_0x4922('0x15')]=function(_0x1d7fc2){var _0x15cdc9=this;return new Promise(function(_0x2ef410,_0x435e7b){return db['Attachment'][_0x4922('0x16')](_0x1d7fc2[_0x4922('0x17')],{'raw':_0x1d7fc2[_0x4922('0x18')]?_0x1d7fc2[_0x4922('0x18')][_0x4922('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x2b6a2d){logger[_0x4922('0xb')](_0x4922('0x15'),_0x1d7fc2);logger[_0x4922('0xe')](_0x4922('0x15'),_0x1d7fc2,JSON[_0x4922('0x10')](_0x2b6a2d));_0x2ef410(_0x2b6a2d);})[_0x4922('0x1a')](function(_0x3b182b){logger['error'](_0x4922('0x15'),_0x3b182b[_0x4922('0x13')],_0x1d7fc2);_0x435e7b(_0x15cdc9['error'](0x1f4,_0x3b182b[_0x4922('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 37eb14e..7b3db64 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 _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x272f77,_0x16df79){var _0x112c0d=function(_0x440b93){while(--_0x440b93){_0x272f77['push'](_0x272f77['shift']());}};_0x112c0d(++_0x16df79);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3a6e88,_0xd356f0){_0x3a6e88=_0x3a6e88-0x0;var _0x2527a9=_0x5f2f[_0x3a6e88];return _0x2527a9;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router;
\ No newline at end of file
+var _0x757a=['put','/:id','update','delete','destroy','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','post','/:id/clone','clone','diskStorage','%s-%s','replace','single','file','create'];(function(_0x52200a,_0x213479){var _0x46fe3b=function(_0x46848e){while(--_0x46848e){_0x52200a['push'](_0x52200a['shift']());}};_0x46fe3b(++_0x213479);}(_0x757a,0xde));var _0xa757=function(_0x4ae8d1,_0x743049){_0x4ae8d1=_0x4ae8d1-0x0;var _0x71ce21=_0x757a[_0x4ae8d1];return _0x71ce21;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0x7')](_0xa757('0xb'),auth[_0xa757('0x9')](),controller['download']);router[_0xa757('0xc')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);var upload=multer({'storage':multer[_0xa757('0xf')]({'destination':function(_0x188ad5,_0x17408b,_0x483d77){_0x483d77(null,path['join'](config['root'],'server/files/attachments/'));},'filename':function(_0x4db68e,_0x421040,_0x544b45){_0x544b45(null,util['format'](_0xa757('0x10'),Date['now'](),_0x421040['originalname'][_0xa757('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa757('0xc')]('/',upload[_0xa757('0x12')](_0xa757('0x13')),controller[_0xa757('0x14')]);router[_0xa757('0x15')](_0xa757('0x16'),auth[_0xa757('0x9')](),controller[_0xa757('0x17')]);router[_0xa757('0x18')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0x19')]);module[_0xa757('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 28b880d..84b32ad 100644
--- a/server/api/authActiveDirectory/authActiveDirectory.controller.js
+++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8d01=['moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','api','activedirectory','undefined','baseDN','domain','authenticate','error','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','blocked','user','agent','blockedAt','add','minutes','clearBlockUser','getLicense','catch','status','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','User','passport','passport-local'];(function(_0x545dda,_0x577f99){var _0xef8cba=function(_0x3cf2e8){while(--_0x3cf2e8){_0x545dda['push'](_0x545dda['shift']());}};_0xef8cba(++_0x577f99);}(_0x8d01,0x193));var _0x18d0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8d01[_0x3dd15e];return _0x231fd0;};'use strict';var passport=require(_0x18d0('0x0'));var LocalStrategy=require(_0x18d0('0x1'))['Strategy'];var moment=require(_0x18d0('0x2'));var ActiveDirectory=require(_0x18d0('0x3'));var BPromise=require(_0x18d0('0x4'));var util=require(_0x18d0('0x5'));var db=require(_0x18d0('0x6'))['db'];var authService=require(_0x18d0('0x7'));var utils=require('../../config/utils');var config=require('../../config/environment');var logger=require('../../config/logger')(_0x18d0('0x8'));function isActiveDirectoryConfigured(_0x5211ca){var _0x3de2d8=![];if(typeof _0x5211ca[_0x18d0('0x9')]!==_0x18d0('0xa')){_0x3de2d8=_0x5211ca[_0x18d0('0x9')][_0x18d0('0xb')]&&_0x5211ca[_0x18d0('0x9')]['url']&&_0x5211ca[_0x18d0('0x9')][_0x18d0('0xc')];}return _0x3de2d8;}function adAuthenticate(_0x1ed66a,_0x14557f,_0x3319c6){return new BPromise(function(_0x1fc404,_0x4874b1){try{var _0x3f59f7=new ActiveDirectory(_0x1ed66a);_0x3f59f7[_0x18d0('0xd')](_0x14557f,_0x3319c6,function(_0x1375fb,_0x5a2817){if(_0x1375fb){logger[_0x18d0('0xe')]('Error\x20authenticate\x20%s:\x20%s',_0x14557f,util['inspect'](_0x1375fb,{'showHidden':![],'depth':null}));_0x4874b1(_0x18d0('0xf'));}else if(!_0x5a2817){logger[_0x18d0('0xe')](_0x18d0('0x10'),_0x14557f);_0x4874b1(_0x18d0('0xf'));}else{_0x1fc404(_0x5a2817);}});}catch(_0x309cef){_0x4874b1(_0x309cef);}});}function ActiveDirectoryAuthenticate(_0x49c6e7,_0x200df5,_0x418374,_0x4bdca5){var _0x278153,_0x5aac21;if(!isActiveDirectoryConfigured(config)){logger[_0x18d0('0xe')](_0x18d0('0x11'),_0x200df5);return _0x4bdca5(null,![],{'message':_0x18d0('0xf')});}return db[_0x18d0('0x12')][_0x18d0('0x13')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x18d0('0x14')],'raw':!![]})[_0x18d0('0x15')](function(_0x2d36bd){_0x278153=_0x2d36bd;if(!_0x278153['adSsoEnabled']){logger[_0x18d0('0xe')](_0x18d0('0x16'),_0x200df5);throw new Error(_0x18d0('0xf'));}return _0x49c6e7[_0x18d0('0x13')]({'attributes':['id',_0x18d0('0x17'),_0x18d0('0x18'),_0x18d0('0x19'),_0x18d0('0x1a'),'disabled',_0x18d0('0x1b'),'blockedAt','online'],'where':{'name':_0x200df5,'role':{'$or':['admin',_0x18d0('0x1c'),_0x18d0('0x1d')]},'adSsoEnabled':!![]}});})[_0x18d0('0x15')](function(_0x4bec6a){if(!_0x4bec6a||_0x4bec6a&&_0x4bec6a[_0x18d0('0x17')]!==_0x200df5){throw new Error(_0x18d0('0xf'));}_0x5aac21=_0x4bec6a;var _0x1c164e=_0x5aac21[_0x18d0('0x17')]+'@'+config[_0x18d0('0x9')][_0x18d0('0xc')];return adAuthenticate(config[_0x18d0('0x9')],_0x1c164e,_0x418374);})[_0x18d0('0x15')](function(_0x2c1a76){if(_0x5aac21['disabled']){throw new Error(_0x18d0('0xf'));}if(_0x278153['blockDuration']>0x0){if(_0x5aac21[_0x18d0('0x1b')]){if(moment(_0x5aac21[_0x18d0('0x1e')])[_0x18d0('0x1f')](_0x278153[_0x18d0('0x14')],_0x18d0('0x20'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x18d0('0x21')](_0x5aac21,0x0,![],null)[_0x18d0('0x15')](function(){return utils[_0x18d0('0x22')](_0x5aac21);})[_0x18d0('0x15')](function(){return _0x4bdca5(null,_0x5aac21);});}else{return utils['getLicense'](_0x5aac21)[_0x18d0('0x15')](function(){return _0x4bdca5(null,_0x5aac21);});}}else{return utils[_0x18d0('0x22')](_0x5aac21)[_0x18d0('0x15')](function(){return _0x4bdca5(null,_0x5aac21);});}})[_0x18d0('0x23')](function(_0xfdc08f){return _0x4bdca5(null,![],_0xfdc08f);});}function handleError(_0x5c5b78,_0x3dfa94,_0x4cf86e){return _0x5c5b78[_0x18d0('0x24')](_0x3dfa94||0x1f4)['send']({'message':_0x4cf86e?_0x4cf86e[_0x18d0('0x25')]||_0x4cf86e:''});}exports[_0x18d0('0x26')]=function(_0x4fc99e,_0x3f540b,_0x2c94ec){passport[_0x18d0('0xd')](_0x18d0('0x27'),function(_0x224d6a,_0xc0bf90,_0x448507){var _0x132e87=_0x224d6a||_0x448507;if(_0x132e87){return handleError(_0x3f540b,0x191,_0x132e87);}if(!_0xc0bf90){return handleError(_0x3f540b,0x194,{'message':_0x18d0('0x28')});}else{var _0xfa8aa={'payload':{'id':_0xc0bf90['id'],'role':_0xc0bf90[_0x18d0('0x1a')]},'options':{'expiresIn':0x15180}};return authService[_0x18d0('0x29')](_0xfa8aa)[_0x18d0('0x15')](function(_0x47ec8f){_0x3f540b[_0x18d0('0x2a')]({'id':_0xc0bf90['id'],'token':_0x47ec8f,'statusCall':'','isAlreadyLogged':_0xc0bf90['online']});});}})(_0x4fc99e,_0x3f540b,_0x2c94ec);};passport[_0x18d0('0x2b')](_0x18d0('0x27'),new LocalStrategy({'usernameField':_0x18d0('0x17'),'passwordField':_0x18d0('0x18')},function(_0x2579a1,_0x261d75,_0x30d4c8){return ActiveDirectoryAuthenticate(db[_0x18d0('0x2c')],_0x2579a1,_0x261d75,_0x30d4c8);}));
\ No newline at end of file
+var _0x4f11=['use','passport','passport-local','Strategy','moment','activedirectory2','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','undefined','activedirectory','baseDN','url','domain','error','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','blockDuration','then','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','password','salt','role','disabled','blocked','blockedAt','online','admin','user','name','add','clearBlockUser','getLicense','catch','status','message','login','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json'];(function(_0x3cfbf2,_0x444904){var _0x1492ed=function(_0x293a91){while(--_0x293a91){_0x3cfbf2['push'](_0x3cfbf2['shift']());}};_0x1492ed(++_0x444904);}(_0x4f11,0xcd));var _0x14f1=function(_0x64c9c3,_0x432c66){_0x64c9c3=_0x64c9c3-0x0;var _0x5a189c=_0x4f11[_0x64c9c3];return _0x5a189c;};'use strict';var passport=require(_0x14f1('0x0'));var LocalStrategy=require(_0x14f1('0x1'))[_0x14f1('0x2')];var moment=require(_0x14f1('0x3'));var ActiveDirectory=require(_0x14f1('0x4'));var BPromise=require('bluebird');var util=require(_0x14f1('0x5'));var db=require(_0x14f1('0x6'))['db'];var authService=require(_0x14f1('0x7'));var utils=require(_0x14f1('0x8'));var config=require(_0x14f1('0x9'));var logger=require(_0x14f1('0xa'))(_0x14f1('0xb'));function isActiveDirectoryConfigured(_0x58c2c6){var _0x2dd330=![];if(typeof _0x58c2c6['activedirectory']!==_0x14f1('0xc')){_0x2dd330=_0x58c2c6[_0x14f1('0xd')][_0x14f1('0xe')]&&_0x58c2c6[_0x14f1('0xd')][_0x14f1('0xf')]&&_0x58c2c6[_0x14f1('0xd')][_0x14f1('0x10')];}return _0x2dd330;}function adAuthenticate(_0x591c2e,_0x7e066a,_0xca801c){return new BPromise(function(_0x76e4d,_0x2a502d){try{var _0x4828bf=new ActiveDirectory(_0x591c2e);_0x4828bf['authenticate'](_0x7e066a,_0xca801c,function(_0x4a7058,_0x2125d2){if(_0x4a7058){logger[_0x14f1('0x11')]('Error\x20authenticate\x20%s:\x20%s',_0x7e066a,util[_0x14f1('0x12')](_0x4a7058,{'showHidden':![],'depth':null}));_0x2a502d(_0x14f1('0x13'));}else if(!_0x2125d2){logger[_0x14f1('0x11')](_0x14f1('0x14'),_0x7e066a);_0x2a502d(_0x14f1('0x13'));}else{_0x76e4d(_0x2125d2);}});}catch(_0x367f18){_0x2a502d(_0x367f18);}});}function ActiveDirectoryAuthenticate(_0x5ad8d8,_0x1086b0,_0x7a3f1e,_0x29d949){var _0x36572a,_0x391c01;if(!isActiveDirectoryConfigured(config)){logger[_0x14f1('0x11')](_0x14f1('0x15'),_0x1086b0);return _0x29d949(null,![],{'message':_0x14f1('0x13')});}return db[_0x14f1('0x16')][_0x14f1('0x17')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x14f1('0x18')],'raw':!![]})[_0x14f1('0x19')](function(_0x45e42d){_0x36572a=_0x45e42d;if(!_0x36572a[_0x14f1('0x1a')]){logger[_0x14f1('0x11')](_0x14f1('0x1b'),_0x1086b0);throw new Error(_0x14f1('0x13'));}return _0x5ad8d8[_0x14f1('0x17')]({'attributes':['id','name',_0x14f1('0x1c'),_0x14f1('0x1d'),_0x14f1('0x1e'),_0x14f1('0x1f'),_0x14f1('0x20'),_0x14f1('0x21'),_0x14f1('0x22')],'where':{'name':_0x1086b0,'role':{'$or':[_0x14f1('0x23'),_0x14f1('0x24'),'agent']},'adSsoEnabled':!![]}});})[_0x14f1('0x19')](function(_0x4f5a83){if(!_0x4f5a83||_0x4f5a83&&_0x4f5a83[_0x14f1('0x25')]!==_0x1086b0){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x391c01=_0x4f5a83;var _0x393262=_0x391c01['name']+'@'+config['activedirectory'][_0x14f1('0x10')];return adAuthenticate(config[_0x14f1('0xd')],_0x393262,_0x7a3f1e);})[_0x14f1('0x19')](function(_0x31975a){if(_0x391c01['disabled']){throw new Error(_0x14f1('0x13'));}if(_0x36572a[_0x14f1('0x18')]>0x0){if(_0x391c01['blocked']){if(moment(_0x391c01[_0x14f1('0x21')])[_0x14f1('0x26')](_0x36572a['blockDuration'],'minutes')>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x14f1('0x27')](_0x391c01,0x0,![],null)[_0x14f1('0x19')](function(){return utils[_0x14f1('0x28')](_0x391c01);})[_0x14f1('0x19')](function(){return _0x29d949(null,_0x391c01);});}else{return utils['getLicense'](_0x391c01)[_0x14f1('0x19')](function(){return _0x29d949(null,_0x391c01);});}}else{return utils[_0x14f1('0x28')](_0x391c01)['then'](function(){return _0x29d949(null,_0x391c01);});}})[_0x14f1('0x29')](function(_0x61f3dd){return _0x29d949(null,![],_0x61f3dd);});}function handleError(_0x37e650,_0x501604,_0x4ee1d5){return _0x37e650[_0x14f1('0x2a')](_0x501604||0x1f4)['send']({'message':_0x4ee1d5?_0x4ee1d5[_0x14f1('0x2b')]||_0x4ee1d5:''});}exports[_0x14f1('0x2c')]=function(_0x1244c7,_0x2bbdb1,_0x12e500){passport[_0x14f1('0x2d')](_0x14f1('0x2e'),function(_0x1a5cef,_0x450d1e,_0x4e4ef9){var _0x89257b=_0x1a5cef||_0x4e4ef9;if(_0x89257b){return handleError(_0x2bbdb1,0x191,_0x89257b);}if(!_0x450d1e){return handleError(_0x2bbdb1,0x194,{'message':_0x14f1('0x2f')});}else{var _0x57811e={'payload':{'id':_0x450d1e['id'],'role':_0x450d1e[_0x14f1('0x1e')]},'options':{'expiresIn':0x15180}};return authService[_0x14f1('0x30')](_0x57811e)['then'](function(_0x3cc83e){_0x2bbdb1[_0x14f1('0x31')]({'id':_0x450d1e['id'],'token':_0x3cc83e,'statusCall':'','isAlreadyLogged':_0x450d1e['online']});});}})(_0x1244c7,_0x2bbdb1,_0x12e500);};passport[_0x14f1('0x32')]('ad-login',new LocalStrategy({'usernameField':_0x14f1('0x25'),'passwordField':_0x14f1('0x1c')},function(_0x5cad08,_0x5ebf81,_0x254e0d){return ActiveDirectoryAuthenticate(db['User'],_0x5cad08,_0x5ebf81,_0x254e0d);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 63c1609..e98dd31 100644
--- a/server/api/authActiveDirectory/index.js
+++ b/server/api/authActiveDirectory/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7c3b=['login','exports','express','Router','./authActiveDirectory.controller'];(function(_0x58ff85,_0x754999){var _0x331870=function(_0x12b5c9){while(--_0x12b5c9){_0x58ff85['push'](_0x58ff85['shift']());}};_0x331870(++_0x754999);}(_0x7c3b,0x9d));var _0xb7c3=function(_0x233d36,_0x18271c){_0x233d36=_0x233d36-0x0;var _0x1d4b17=_0x7c3b[_0x233d36];return _0x1d4b17;};'use strict';var express=require(_0xb7c3('0x0'));var router=express[_0xb7c3('0x1')]();var controller=require(_0xb7c3('0x2'));router['post']('/',controller[_0xb7c3('0x3')]);module[_0xb7c3('0x4')]=router;
\ No newline at end of file
+var _0xa4dd=['login','exports','Router','./authActiveDirectory.controller'];(function(_0x574de1,_0x123779){var _0x51030d=function(_0x288b21){while(--_0x288b21){_0x574de1['push'](_0x574de1['shift']());}};_0x51030d(++_0x123779);}(_0xa4dd,0x1da));var _0xda4d=function(_0x4aa1b1,_0x56b523){_0x4aa1b1=_0x4aa1b1-0x0;var _0x1961c4=_0xa4dd[_0x4aa1b1];return _0x1961c4;};'use strict';var express=require('express');var router=express[_0xda4d('0x0')]();var controller=require(_0xda4d('0x1'));router['post']('/',controller[_0xda4d('0x2')]);module[_0xda4d('0x3')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index aa56d08..7b40526 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x7a54,0x106));var _0x47a5=function(_0x2ecf86,_0x222f6d){_0x2ecf86=_0x2ecf86-0x0;var _0x58f6ec=_0x7a54[_0x2ecf86];return _0x58f6ec;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
+var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x51d958,_0x1aaa67){var _0x7d6412=function(_0x2e9eee){while(--_0x2e9eee){_0x51d958['push'](_0x51d958['shift']());}};_0x7d6412(++_0x1aaa67);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 5e4778a..7a2dcdc 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 _0xf5af=['isMiddleware','setTokenCookie','exports','passport','Router','../user/user.controller.js','get','login','/callback','callback'];(function(_0x41582d,_0x291b1c){var _0x59c504=function(_0x4d967e){while(--_0x4d967e){_0x41582d['push'](_0x41582d['shift']());}};_0x59c504(++_0x291b1c);}(_0xf5af,0x175));var _0xff5a=function(_0x41fc64,_0x2609d6){_0x41fc64=_0x41fc64-0x0;var _0x3b9dad=_0xf5af[_0x41fc64];return _0x3b9dad;};'use strict';var express=require('express');var passport=require(_0xff5a('0x0'));var router=express[_0xff5a('0x1')]();var controller=require('./authGoogle.controller');var userController=require(_0xff5a('0x2'));var authService=require('../../components/auth/service');router[_0xff5a('0x3')]('/',controller[_0xff5a('0x4')]);router[_0xff5a('0x3')](_0xff5a('0x5'),controller[_0xff5a('0x6')],authService[_0xff5a('0x7')],userController[_0xff5a('0x4')],authService[_0xff5a('0x8')]);module[_0xff5a('0x9')]=router;
\ No newline at end of file
+var _0xa7b1=['exports','express','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','login','/callback','callback','isMiddleware','setTokenCookie'];(function(_0x4e95ba,_0x13ca80){var _0xa4576=function(_0x184e06){while(--_0x184e06){_0x4e95ba['push'](_0x4e95ba['shift']());}};_0xa4576(++_0x13ca80);}(_0xa7b1,0x1f0));var _0x1a7b=function(_0x33b0ac,_0x385378){_0x33b0ac=_0x33b0ac-0x0;var _0x888a0a=_0xa7b1[_0x33b0ac];return _0x888a0a;};'use strict';var express=require(_0x1a7b('0x0'));var passport=require('passport');var router=express[_0x1a7b('0x1')]();var controller=require(_0x1a7b('0x2'));var userController=require(_0x1a7b('0x3'));var authService=require(_0x1a7b('0x4'));router['get']('/',controller[_0x1a7b('0x5')]);router['get'](_0x1a7b('0x6'),controller[_0x1a7b('0x7')],authService[_0x1a7b('0x8')],userController[_0x1a7b('0x5')],authService[_0x1a7b('0x9')]);module[_0x1a7b('0xa')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 1448fad..4f76a43 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 _0x0f5f=['passport','passport-local','Strategy','jayson/promise','lodash','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','then','name','password','salt','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','authenticate','blockDuration','add','minutes','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','getLicense','find','MailServerOut','Smtp','CloudProvider','merge','format','email','request','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','error','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','trim','toLowerCase','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','host','/reset/','Reset\x20Email\x20sent!','reset','User','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','resetPasswordToken','save','Password\x20reset!','catch','use','util'];(function(_0x3c233a,_0x378882){var _0x5d8815=function(_0x568936){while(--_0x568936){_0x3c233a['push'](_0x3c233a['shift']());}};_0x5d8815(++_0x378882);}(_0x0f5f,0xa7));var _0xf0f5=function(_0x45b86a,_0x2dda03){_0x45b86a=_0x45b86a-0x0;var _0x113053=_0x0f5f[_0x45b86a];return _0x113053;};'use strict';var util=require(_0xf0f5('0x0'));var passport=require(_0xf0f5('0x1'));var LocalStrategy=require(_0xf0f5('0x2'))[_0xf0f5('0x3')];var jayson=require(_0xf0f5('0x4'));var _=require(_0xf0f5('0x5'));var rs=require(_0xf0f5('0x6'));var moment=require('moment');var db=require(_0xf0f5('0x7'))['db'];var authService=require(_0xf0f5('0x8'));var utils=require(_0xf0f5('0x9'));var client=jayson[_0xf0f5('0xa')][_0xf0f5('0xb')]({'port':0x232b});function localAuthenticate(_0x200802,_0x459868,_0x332dbe,_0x3742ec){var _0x56ae27,_0x3a79d3;return db[_0xf0f5('0xc')][_0xf0f5('0xd')]({'where':{'id':0x1},'attributes':[_0xf0f5('0xe'),'blockDuration'],'raw':!![]})[_0xf0f5('0xf')](function(_0x4fef7c){_0x56ae27=_0x4fef7c;return _0x200802[_0xf0f5('0xd')]({'attributes':['id',_0xf0f5('0x10'),_0xf0f5('0x11'),_0xf0f5('0x12'),'role',_0xf0f5('0x13'),_0xf0f5('0x14'),_0xf0f5('0x15'),_0xf0f5('0x16')],'where':{'name':_0x459868,'role':{'$or':[_0xf0f5('0x17'),_0xf0f5('0x18'),_0xf0f5('0x19')]}}});})[_0xf0f5('0xf')](function(_0x484eb9){if(!_0x484eb9||_0x484eb9&&_0x484eb9[_0xf0f5('0x10')]!==_0x459868){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x3a79d3=_0x484eb9;return _0x3a79d3;}})[_0xf0f5('0xf')](function(){_0x3a79d3[_0xf0f5('0x1a')](_0x332dbe,function(_0x39f1d1,_0x45fecb){var _0x315570=_0x3a79d3['loginAttempts']+0x1;if(_0x39f1d1){return _0x3742ec(_0x39f1d1);}else if(!_0x45fecb){if(_0x3a79d3[_0xf0f5('0x13')]){return _0x3742ec(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x56ae27[_0xf0f5('0xe')]>0x0){if(_0x3a79d3[_0xf0f5('0x14')]){if(_0x56ae27[_0xf0f5('0x1b')]>0x0){if(moment(_0x3a79d3[_0xf0f5('0x15')])[_0xf0f5('0x1c')](_0x56ae27[_0xf0f5('0x1b')],_0xf0f5('0x1d'))>moment()){return _0x3742ec(null,![],{'message':_0xf0f5('0x1e')});}else{return utils[_0xf0f5('0x1f')](_0x3a79d3,_0x315570,![],null)[_0xf0f5('0xf')](function(){return _0x3742ec(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x3742ec(null,![],{'message':_0xf0f5('0x1e')});}}else{if(_0x315570>=_0x56ae27[_0xf0f5('0xe')]){return utils['clearBlockUser'](_0x3a79d3,0x0,!![],moment())[_0xf0f5('0xf')](function(){return _0x3742ec(null,![],{'message':_0xf0f5('0x1e')});});}else{return utils[_0xf0f5('0x1f')](_0x3a79d3,_0x315570,![],null)['then'](function(){return _0x3742ec(null,![],{'message':_0xf0f5('0x1e')});});}}}else{return _0x3742ec(null,![],{'message':_0xf0f5('0x1e')});}}else{if(_0x3a79d3[_0xf0f5('0x13')]){return _0x3742ec(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x56ae27[_0xf0f5('0xe')]>0x0){if(_0x3a79d3[_0xf0f5('0x14')]){if(_0x56ae27[_0xf0f5('0x1b')]>0x0){if(moment(_0x3a79d3['blockedAt'])[_0xf0f5('0x1c')](_0x56ae27['blockDuration'],_0xf0f5('0x1d'))>moment()){return _0x3742ec(null,![],{'message':_0xf0f5('0x1e')});}else{return utils[_0xf0f5('0x1f')](_0x3a79d3,0x0,![],null)[_0xf0f5('0xf')](function(){return utils[_0xf0f5('0x20')](_0x3a79d3);})['then'](function(){return _0x3742ec(null,_0x3a79d3);});}}else{return _0x3742ec(null,![],{'message':_0xf0f5('0x1e')});}}else{return utils[_0xf0f5('0x1f')](_0x3a79d3,0x0,![],null)[_0xf0f5('0xf')](function(){return utils[_0xf0f5('0x20')](_0x3a79d3);})[_0xf0f5('0xf')](function(){return _0x3742ec(null,_0x3a79d3);})['catch'](function(_0x30c4d4){return _0x3742ec(null,![],_0x30c4d4);});}}else{if(_0x3a79d3[_0xf0f5('0x14')]){return _0x3742ec(null,![],{'message':_0xf0f5('0x1e')});}else{return utils[_0xf0f5('0x20')](_0x3a79d3)[_0xf0f5('0xf')](function(){return _0x3742ec(null,_0x3a79d3);});}}}});})['catch'](function(_0x1af9e8){return _0x3742ec(null,![],_0x1af9e8);});}function sendServiceMail(_0x2bb634){return db['MailAccount'][_0xf0f5('0x21')]({'where':{'service':!![]},'attributes':['id',_0xf0f5('0x10'),'email'],'include':[{'model':db[_0xf0f5('0x22')],'as':_0xf0f5('0x23'),'include':[{'model':db[_0xf0f5('0x24')],'as':_0xf0f5('0x24')}]}]})['then'](function(_0xe5cb3a){if(!_0xe5cb3a){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x5267ba=_0xe5cb3a['getSmtpOptions']();var _0x5c85c9={'account':_0x5267ba,'message':_[_0xf0f5('0x25')]({'from':util[_0xf0f5('0x26')]('\x22%s\x22\x20<%s>',_0xe5cb3a['name'],_0xe5cb3a[_0xf0f5('0x27')]||_0xe5cb3a[_0xf0f5('0x23')]['user'])},_0x2bb634)};return client[_0xf0f5('0x28')]('SendMail',_0x5c85c9);})[_0xf0f5('0xf')](function(_0x314891){if(_0x314891['error']){throw new Error(util[_0xf0f5('0x26')](_0xf0f5('0x29'),_0x314891['error'][_0xf0f5('0x2a')]||JSON[_0xf0f5('0x2b')](_0x314891[_0xf0f5('0x2c')])));}return!![];});}function handleError(_0x2fe680,_0x84f139,_0x3206f0){return _0x2fe680[_0xf0f5('0x2d')](_0x84f139||0x1f4)[_0xf0f5('0x2e')]({'message':_0x3206f0?_0x3206f0[_0xf0f5('0x2a')]||_0x3206f0:''});}exports[_0xf0f5('0x2f')]=function(_0x3813c2,_0x12b690,_0x490893){passport[_0xf0f5('0x1a')](_0xf0f5('0x30'),function(_0x4c90b3,_0x33d990,_0x5ac832){var _0x39da1f=_0x4c90b3||_0x5ac832;if(_0x39da1f){return handleError(_0x12b690,0x191,_0x39da1f);}if(!_0x33d990){return handleError(_0x12b690,0x194,{'message':_0xf0f5('0x31')});}else{var _0xd166c8={'payload':{'id':_0x33d990['id'],'role':_0x33d990[_0xf0f5('0x32')]},'options':{'expiresIn':0x15180}};return authService[_0xf0f5('0x33')](_0xd166c8)['then'](function(_0x153dc0){_0x12b690[_0xf0f5('0x34')]({'id':_0x33d990['id'],'token':_0x153dc0,'statusCall':'','isAlreadyLogged':_0x33d990[_0xf0f5('0x35')]});});}})(_0x3813c2,_0x12b690,_0x490893);};exports[_0xf0f5('0x36')]=function(_0x1fc4bc,_0x371c6b){if(!_0x1fc4bc[_0xf0f5('0x37')]['email']){return handleError(_0x371c6b,0x1f4,{'message':_0xf0f5('0x38')});}var _0x213da8=rs['generate']();_0x1fc4bc[_0xf0f5('0x37')][_0xf0f5('0x27')]=_0x1fc4bc['body'][_0xf0f5('0x27')][_0xf0f5('0x39')]()[_0xf0f5('0x3a')]();var _0x4340ce;return db[_0xf0f5('0xc')][_0xf0f5('0xd')]({'where':{'id':0x1},'attributes':[_0xf0f5('0xe'),'blockDuration'],'raw':!![]})[_0xf0f5('0xf')](function(_0x58a8b0){_0x4340ce=_0x58a8b0;return db['User'][_0xf0f5('0x21')]({'where':{'email':_0x1fc4bc[_0xf0f5('0x37')][_0xf0f5('0x27')]}});})['then'](function(_0x3cfae9){if(!_0x3cfae9){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x3cfae9[_0xf0f5('0x13')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x3cfae9[_0xf0f5('0x14')]){if(moment(_0x3cfae9['blockedAt'])[_0xf0f5('0x1c')](_0x4340ce['blockDuration'],'minutes')>moment()){throw new Error(_0xf0f5('0x3b'));}else{_0x3cfae9[_0xf0f5('0x14')]=![];_0x3cfae9[_0xf0f5('0x15')]=null;}}_0x3cfae9['resetPasswordToken']=_0x213da8;_0x3cfae9[_0xf0f5('0x3c')]=Date[_0xf0f5('0x3d')]()+0x36ee80;return _0x3cfae9['save']();})[_0xf0f5('0xf')](function(){return sendServiceMail({'to':_0x1fc4bc[_0xf0f5('0x37')][_0xf0f5('0x27')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xf0f5('0x3e')+_0xf0f5('0x3f')+_0xf0f5('0x40')+_0x1fc4bc['headers'][_0xf0f5('0x41')]+_0xf0f5('0x42')+_0x213da8+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0xf0f5('0xf')](function(){_0x371c6b[_0xf0f5('0x2d')](0xc8)[_0xf0f5('0x2e')]({'message':_0xf0f5('0x43')});})['catch'](function(_0x41df26){return handleError(_0x371c6b,0x1f4,_0x41df26);});};exports[_0xf0f5('0x44')]=function(_0x584d6e,_0x1809f7){return db[_0xf0f5('0x45')][_0xf0f5('0x21')]({'where':{'resetPasswordToken':_0x584d6e[_0xf0f5('0x46')][_0xf0f5('0x47')],'resetPasswordExpires':{'$gt':Date[_0xf0f5('0x3d')]()}}})['then'](function(_0x2729a8){if(!_0x2729a8){throw new Error(_0xf0f5('0x48'));}return db[_0xf0f5('0xc')][_0xf0f5('0xd')]({'attributes':['id',_0xf0f5('0x49'),_0xf0f5('0x4a'),_0xf0f5('0x4b')]})[_0xf0f5('0xf')](function(_0x4698c9){if(_0x4698c9[_0xf0f5('0x49')])authService[_0xf0f5('0x4c')](_0x584d6e[_0xf0f5('0x37')][_0xf0f5('0x11')]);if(!_0x4698c9['enforcePasswordHistory']||!_0x2729a8[_0xf0f5('0x4d')])return _0x2729a8;authService[_0xf0f5('0x4e')](_0x584d6e[_0xf0f5('0x37')][_0xf0f5('0x11')],_0x2729a8['previousPasswords'],_0x4698c9[_0xf0f5('0x4b')]);return _0x2729a8;})[_0xf0f5('0xf')](function(){_0x2729a8[_0xf0f5('0x11')]=_0x584d6e[_0xf0f5('0x37')][_0xf0f5('0x11')];_0x2729a8[_0xf0f5('0x4f')]=null;_0x2729a8['resetPasswordExpires']=null;return _0x2729a8[_0xf0f5('0x50')]();});})[_0xf0f5('0xf')](function(){_0x1809f7[_0xf0f5('0x2d')](0xc8)[_0xf0f5('0x2e')]({'message':_0xf0f5('0x51')});})[_0xf0f5('0x52')](function(_0x23e3f7){return handleError(_0x1809f7,0x1f4,_0x23e3f7);});};passport[_0xf0f5('0x53')](_0xf0f5('0x30'),new LocalStrategy({'usernameField':_0xf0f5('0x10'),'passwordField':_0xf0f5('0x11')},function(_0x202bed,_0x1dcdba,_0x213b51){return localAuthenticate(db[_0xf0f5('0x45')],_0x202bed,_0x1dcdba,_0x213b51);}));
\ No newline at end of file
+var _0x65a4=['findOne','blockDuration','then','name','password','salt','role','disabled','blocked','blockedAt','admin','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','allowedLoginAttempts','add','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','\x22%s\x22\x20<%s>','user','request','SendMail','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','forgot','body','trim','Setting','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','minutes','resetPasswordToken','resetPasswordExpires','now','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','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','previousPasswords','validatePasswordHistory','send','util','passport','passport-local','Strategy','jayson/promise','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','http'];(function(_0x1b8f5a,_0x57c154){var _0x594189=function(_0x15b277){while(--_0x15b277){_0x1b8f5a['push'](_0x1b8f5a['shift']());}};_0x594189(++_0x57c154);}(_0x65a4,0x185));var _0x465a=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x65a4[_0x3b380d];return _0x54502b;};'use strict';var util=require(_0x465a('0x0'));var passport=require(_0x465a('0x1'));var LocalStrategy=require(_0x465a('0x2'))[_0x465a('0x3')];var jayson=require(_0x465a('0x4'));var _=require(_0x465a('0x5'));var rs=require('randomstring');var moment=require(_0x465a('0x6'));var db=require(_0x465a('0x7'))['db'];var authService=require(_0x465a('0x8'));var utils=require(_0x465a('0x9'));var client=jayson['client'][_0x465a('0xa')]({'port':0x232b});function localAuthenticate(_0x16bc0e,_0x14fb56,_0x2db2be,_0x3183e8){var _0x2f9fed,_0x143ace;return db['Setting'][_0x465a('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x465a('0xc')],'raw':!![]})[_0x465a('0xd')](function(_0x45ac3f){_0x2f9fed=_0x45ac3f;return _0x16bc0e['findOne']({'attributes':['id',_0x465a('0xe'),_0x465a('0xf'),_0x465a('0x10'),_0x465a('0x11'),_0x465a('0x12'),_0x465a('0x13'),_0x465a('0x14'),'loginAttempts'],'where':{'name':_0x14fb56,'role':{'$or':[_0x465a('0x15'),'user','agent']}}});})[_0x465a('0xd')](function(_0x14d68e){if(!_0x14d68e||_0x14d68e&&_0x14d68e[_0x465a('0xe')]!==_0x14fb56){throw new Error(_0x465a('0x16'));}else{_0x143ace=_0x14d68e;return _0x143ace;}})[_0x465a('0xd')](function(){_0x143ace[_0x465a('0x17')](_0x2db2be,function(_0x4d5a97,_0x542361){var _0x1b2a3d=_0x143ace[_0x465a('0x18')]+0x1;if(_0x4d5a97){return _0x3183e8(_0x4d5a97);}else if(!_0x542361){if(_0x143ace[_0x465a('0x12')]){return _0x3183e8(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x2f9fed[_0x465a('0x19')]>0x0){if(_0x143ace[_0x465a('0x13')]){if(_0x2f9fed['blockDuration']>0x0){if(moment(_0x143ace['blockedAt'])[_0x465a('0x1a')](_0x2f9fed['blockDuration'],'minutes')>moment()){return _0x3183e8(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x465a('0x1b')](_0x143ace,_0x1b2a3d,![],null)['then'](function(){return _0x3183e8(null,![],{'message':_0x465a('0x16')});});}}else{return _0x3183e8(null,![],{'message':_0x465a('0x16')});}}else{if(_0x1b2a3d>=_0x2f9fed['allowedLoginAttempts']){return utils['clearBlockUser'](_0x143ace,0x0,!![],moment())[_0x465a('0xd')](function(){return _0x3183e8(null,![],{'message':_0x465a('0x16')});});}else{return utils[_0x465a('0x1b')](_0x143ace,_0x1b2a3d,![],null)[_0x465a('0xd')](function(){return _0x3183e8(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x3183e8(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x143ace['disabled']){return _0x3183e8(null,![],{'message':_0x465a('0x16')});}else if(_0x2f9fed[_0x465a('0x19')]>0x0){if(_0x143ace[_0x465a('0x13')]){if(_0x2f9fed[_0x465a('0xc')]>0x0){if(moment(_0x143ace[_0x465a('0x14')])['add'](_0x2f9fed[_0x465a('0xc')],'minutes')>moment()){return _0x3183e8(null,![],{'message':_0x465a('0x16')});}else{return utils['clearBlockUser'](_0x143ace,0x0,![],null)[_0x465a('0xd')](function(){return utils[_0x465a('0x1c')](_0x143ace);})['then'](function(){return _0x3183e8(null,_0x143ace);});}}else{return _0x3183e8(null,![],{'message':_0x465a('0x16')});}}else{return utils[_0x465a('0x1b')](_0x143ace,0x0,![],null)[_0x465a('0xd')](function(){return utils[_0x465a('0x1c')](_0x143ace);})[_0x465a('0xd')](function(){return _0x3183e8(null,_0x143ace);})[_0x465a('0x1d')](function(_0x43449f){return _0x3183e8(null,![],_0x43449f);});}}else{if(_0x143ace[_0x465a('0x13')]){return _0x3183e8(null,![],{'message':_0x465a('0x16')});}else{return utils[_0x465a('0x1c')](_0x143ace)[_0x465a('0xd')](function(){return _0x3183e8(null,_0x143ace);});}}}});})[_0x465a('0x1d')](function(_0x1a3585){return _0x3183e8(null,![],_0x1a3585);});}function sendServiceMail(_0x529864){return db[_0x465a('0x1e')][_0x465a('0x1f')]({'where':{'service':!![]},'attributes':['id',_0x465a('0xe'),_0x465a('0x20')],'include':[{'model':db[_0x465a('0x21')],'as':_0x465a('0x22'),'include':[{'model':db[_0x465a('0x23')],'as':_0x465a('0x23')}]}]})[_0x465a('0xd')](function(_0x44878a){if(!_0x44878a){throw new Error(_0x465a('0x24'));}var _0x39dd8a=_0x44878a[_0x465a('0x25')]();var _0x24074f={'account':_0x39dd8a,'message':_[_0x465a('0x26')]({'from':util['format'](_0x465a('0x27'),_0x44878a[_0x465a('0xe')],_0x44878a[_0x465a('0x20')]||_0x44878a[_0x465a('0x22')][_0x465a('0x28')])},_0x529864)};return client[_0x465a('0x29')](_0x465a('0x2a'),_0x24074f);})[_0x465a('0xd')](function(_0x477f4f){if(_0x477f4f[_0x465a('0x2b')]){throw new Error(util[_0x465a('0x2c')](_0x465a('0x2d'),_0x477f4f[_0x465a('0x2b')][_0x465a('0x2e')]||JSON[_0x465a('0x2f')](_0x477f4f[_0x465a('0x2b')])));}return!![];});}function handleError(_0x2d74b7,_0x111d7e,_0x346183){return _0x2d74b7[_0x465a('0x30')](_0x111d7e||0x1f4)['send']({'message':_0x346183?_0x346183[_0x465a('0x2e')]||_0x346183:''});}exports[_0x465a('0x31')]=function(_0x4709e6,_0xb59aab,_0x51e93b){passport[_0x465a('0x17')](_0x465a('0x32'),function(_0x10c0b2,_0x4ac56d,_0x171728){var _0x31941f=_0x10c0b2||_0x171728;if(_0x31941f){return handleError(_0xb59aab,0x191,_0x31941f);}if(!_0x4ac56d){return handleError(_0xb59aab,0x194,{'message':_0x465a('0x33')});}else{var _0x169577={'payload':{'id':_0x4ac56d['id'],'role':_0x4ac56d[_0x465a('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0x465a('0x34')](_0x169577)['then'](function(_0x13f150){_0xb59aab[_0x465a('0x35')]({'id':_0x4ac56d['id'],'token':_0x13f150,'statusCall':'','isAlreadyLogged':_0x4ac56d['online']});});}})(_0x4709e6,_0xb59aab,_0x51e93b);};exports[_0x465a('0x36')]=function(_0x6fe1aa,_0x1b6d2e){if(!_0x6fe1aa[_0x465a('0x37')][_0x465a('0x20')]){return handleError(_0x1b6d2e,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x15f5c8=rs['generate']();_0x6fe1aa[_0x465a('0x37')]['email']=_0x6fe1aa[_0x465a('0x37')]['email'][_0x465a('0x38')]()['toLowerCase']();var _0x5841c8;return db[_0x465a('0x39')][_0x465a('0xb')]({'where':{'id':0x1},'attributes':[_0x465a('0x19'),_0x465a('0xc')],'raw':!![]})[_0x465a('0xd')](function(_0x1f8fae){_0x5841c8=_0x1f8fae;return db[_0x465a('0x3a')][_0x465a('0x1f')]({'where':{'email':_0x6fe1aa[_0x465a('0x37')]['email']}});})['then'](function(_0x7beda1){if(!_0x7beda1){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x7beda1['disabled']){throw new Error(_0x465a('0x3b'));}if(_0x7beda1[_0x465a('0x13')]){if(moment(_0x7beda1[_0x465a('0x14')])['add'](_0x5841c8[_0x465a('0xc')],_0x465a('0x3c'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x7beda1[_0x465a('0x13')]=![];_0x7beda1[_0x465a('0x14')]=null;}}_0x7beda1[_0x465a('0x3d')]=_0x15f5c8;_0x7beda1[_0x465a('0x3e')]=Date[_0x465a('0x3f')]()+0x36ee80;return _0x7beda1[_0x465a('0x40')]();})['then'](function(){return sendServiceMail({'to':_0x6fe1aa[_0x465a('0x37')]['email'],'subject':_0x465a('0x41'),'text':_0x465a('0x42')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+'https://'+_0x6fe1aa['headers']['host']+_0x465a('0x43')+_0x15f5c8+'\x0a\x0a'+_0x465a('0x44')});})[_0x465a('0xd')](function(){_0x1b6d2e['status'](0xc8)['send']({'message':_0x465a('0x45')});})[_0x465a('0x1d')](function(_0x4624d8){return handleError(_0x1b6d2e,0x1f4,_0x4624d8);});};exports[_0x465a('0x46')]=function(_0x244e78,_0x202d47){return db[_0x465a('0x3a')][_0x465a('0x1f')]({'where':{'resetPasswordToken':_0x244e78[_0x465a('0x47')][_0x465a('0x48')],'resetPasswordExpires':{'$gt':Date[_0x465a('0x3f')]()}}})['then'](function(_0x5eac7c){if(!_0x5eac7c){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting'][_0x465a('0xb')]({'attributes':['id','securePassword',_0x465a('0x49'),_0x465a('0x4a')]})['then'](function(_0x1c335c){if(_0x1c335c[_0x465a('0x4b')])authService[_0x465a('0x4c')](_0x244e78[_0x465a('0x37')][_0x465a('0xf')]);if(!_0x1c335c[_0x465a('0x49')]||!_0x5eac7c[_0x465a('0x4d')])return _0x5eac7c;authService[_0x465a('0x4e')](_0x244e78[_0x465a('0x37')][_0x465a('0xf')],_0x5eac7c[_0x465a('0x4d')],_0x1c335c[_0x465a('0x4a')]);return _0x5eac7c;})['then'](function(){_0x5eac7c[_0x465a('0xf')]=_0x244e78[_0x465a('0x37')][_0x465a('0xf')];_0x5eac7c[_0x465a('0x3d')]=null;_0x5eac7c['resetPasswordExpires']=null;return _0x5eac7c[_0x465a('0x40')]();});})[_0x465a('0xd')](function(){_0x202d47[_0x465a('0x30')](0xc8)[_0x465a('0x4f')]({'message':'Password\x20reset!'});})['catch'](function(_0x582800){return handleError(_0x202d47,0x1f4,_0x582800);});};passport['use']('local-login',new LocalStrategy({'usernameField':_0x465a('0xe'),'passwordField':'password'},function(_0x4e86e4,_0x2033eb,_0x3bc9cb){return localAuthenticate(db[_0x465a('0x3a')],_0x4e86e4,_0x2033eb,_0x3bc9cb);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index c4bd647..2ae684d 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 _0x3033=['forgot','/reset/:token','reset','express','Router','post','login','/forgot'];(function(_0x24963c,_0x32a74f){var _0x4d6294=function(_0x3d99d1){while(--_0x3d99d1){_0x24963c['push'](_0x24963c['shift']());}};_0x4d6294(++_0x32a74f);}(_0x3033,0x1b3));var _0x3303=function(_0x34129e,_0x484c10){_0x34129e=_0x34129e-0x0;var _0x1d9c65=_0x3033[_0x34129e];return _0x1d9c65;};'use strict';var express=require(_0x3303('0x0'));var router=express[_0x3303('0x1')]();var controller=require('./authLocal.controller');router[_0x3303('0x2')]('/',controller[_0x3303('0x3')]);router[_0x3303('0x2')](_0x3303('0x4'),controller[_0x3303('0x5')]);router[_0x3303('0x2')](_0x3303('0x6'),controller[_0x3303('0x7')]);module['exports']=router;
\ No newline at end of file
+var _0xf894=['./authLocal.controller','post','login','forgot','exports','express','Router'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xf894,0x186));var _0x4f89=function(_0x559758,_0x314ab1){_0x559758=_0x559758-0x0;var _0x544a9a=_0xf894[_0x559758];return _0x544a9a;};'use strict';var express=require(_0x4f89('0x0'));var router=express[_0x4f89('0x1')]();var controller=require(_0x4f89('0x2'));router[_0x4f89('0x3')]('/',controller[_0x4f89('0x4')]);router['post']('/forgot',controller[_0x4f89('0x5')]);router['post']('/reset/:token',controller['reset']);module[_0x4f89('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 e003bd2..dd5a49e 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 _0x410e=['STRING','INTEGER','sequelize','exports'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x410e,0x10e));var _0xe410=function(_0x38f26e,_0xa15f5e){_0x38f26e=_0x38f26e-0x0;var _0x1e2fb3=_0x410e[_0x38f26e];return _0x1e2fb3;};'use strict';var Sequelize=require(_0xe410('0x0'));module[_0xe410('0x1')]={'name':{'type':Sequelize[_0xe410('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe410('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xe410('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x18cb=['BOOLEAN','sequelize','exports','STRING'];(function(_0x30be97,_0x3ea719){var _0x1d3a90=function(_0x512e8a){while(--_0x512e8a){_0x30be97['push'](_0x30be97['shift']());}};_0x1d3a90(++_0x3ea719);}(_0x18cb,0x1ed));var _0xb18c=function(_0x265639,_0x29bb4e){_0x265639=_0x265639-0x0;var _0x4df1c3=_0x18cb[_0x265639];return _0x4df1c3;};'use strict';var Sequelize=require(_0xb18c('0x0'));module[_0xb18c('0x1')]={'name':{'type':Sequelize[_0xb18c('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xb18c('0x2')]},'description':{'type':Sequelize[_0xb18c('0x2')]},'status':{'type':Sequelize[_0xb18c('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index 4bfa762..1481a3f 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 _0xf8ea=['omit','getConditions','findOne','addActions','Action','getActions','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','apply','reject','update','destroy','then','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','params','intersection','find','create','body','Condition','ids'];(function(_0x15569e,_0x39fa26){var _0x404aa7=function(_0xb12b0a){while(--_0xb12b0a){_0x15569e['push'](_0x15569e['shift']());}};_0x404aa7(++_0x39fa26);}(_0xf8ea,0x13a));var _0xaf8e=function(_0x538c48,_0x538cfa){_0x538c48=_0x538c48-0x0;var _0x4c7364=_0xf8ea[_0x538c48];return _0x4c7364;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xaf8e('0x0'));var jsonpatch=require(_0xaf8e('0x1'));var rp=require(_0xaf8e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xaf8e('0x3'));var util=require(_0xaf8e('0x4'));var path=require(_0xaf8e('0x5'));var sox=require(_0xaf8e('0x6'));var csv=require(_0xaf8e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaf8e('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xaf8e('0x9'));var jsforce=require(_0xaf8e('0xa'));var deskjs=require(_0xaf8e('0xb'));var toCsv=require('to-csv');var querystring=require(_0xaf8e('0xc'));var Papa=require('papaparse');var Redis=require(_0xaf8e('0xd'));var authService=require(_0xaf8e('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaf8e('0xf'));var logger=require('../../config/logger')(_0xaf8e('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xaf8e('0x11'));var db=require(_0xaf8e('0x12'))['db'];function respondWithStatusCode(_0xb6db6d,_0x4ee399){_0x4ee399=_0x4ee399||0xcc;return function(_0x1c2344){if(_0x1c2344){return _0xb6db6d[_0xaf8e('0x13')](_0x4ee399);}return _0xb6db6d['status'](_0x4ee399)[_0xaf8e('0x14')]();};}function respondWithResult(_0x11a4c3,_0x2e4224){_0x2e4224=_0x2e4224||0xc8;return function(_0x1a7c81){if(_0x1a7c81){return _0x11a4c3[_0xaf8e('0x15')](_0x2e4224)['json'](_0x1a7c81);}};}function respondWithFilteredResult(_0x4d4b5f,_0x32fa59){return function(_0x513460){if(_0x513460){var _0x56af27=typeof _0x32fa59[_0xaf8e('0x16')]===_0xaf8e('0x17')&&typeof _0x32fa59['limit']===_0xaf8e('0x17');var _0x447cb7=_0x513460['count'];var _0x4b7683=_0x56af27?0x0:_0x32fa59[_0xaf8e('0x16')];var _0x4221c9=_0x56af27?_0x513460[_0xaf8e('0x18')]:_0x32fa59[_0xaf8e('0x16')]+_0x32fa59[_0xaf8e('0x19')];var _0x15b61e;if(_0x4221c9>=_0x447cb7){_0x4221c9=_0x447cb7;_0x15b61e=0xc8;}else{_0x15b61e=0xce;}_0x4d4b5f[_0xaf8e('0x15')](_0x15b61e);return _0x4d4b5f[_0xaf8e('0x1a')](_0xaf8e('0x1b'),_0x4b7683+'-'+_0x4221c9+'/'+_0x447cb7)['json'](_0x513460);}return null;};}function patchUpdates(_0x466f0e){return function(_0x59f270){try{jsonpatch[_0xaf8e('0x1c')](_0x59f270,_0x466f0e,!![]);}catch(_0x1738e5){return BPromise[_0xaf8e('0x1d')](_0x1738e5);}return _0x59f270['save']();};}function saveUpdates(_0x3d1f13,_0x49fe07){return function(_0x2a1f67){if(_0x2a1f67){return _0x2a1f67[_0xaf8e('0x1e')](_0x3d1f13)['then'](function(_0xe8983a){return _0xe8983a;});}return null;};}function removeEntity(_0x31fd2e,_0x424fd9){return function(_0x4cf95f){if(_0x4cf95f){return _0x4cf95f[_0xaf8e('0x1f')]()[_0xaf8e('0x20')](function(){_0x31fd2e[_0xaf8e('0x15')](0xcc)[_0xaf8e('0x14')]();});}};}function handleEntityNotFound(_0x981746,_0x5aa8a2){return function(_0x2c1814){if(!_0x2c1814){_0x981746[_0xaf8e('0x13')](0x194);}return _0x2c1814;};}function handleError(_0x52abce,_0x449da1){_0x449da1=_0x449da1||0x1f4;return function(_0xbc7ff8){logger['error'](_0xbc7ff8[_0xaf8e('0x21')]);if(_0xbc7ff8[_0xaf8e('0x22')]){delete _0xbc7ff8['name'];}_0x52abce['status'](_0x449da1)[_0xaf8e('0x23')](_0xbc7ff8);};}exports[_0xaf8e('0x24')]=function(_0x5b62d6,_0x475117){var _0x308821={},_0x65c950={},_0x2566cf={'count':0x0,'rows':[]};var _0x2321a1=_[_0xaf8e('0x25')](db[_0xaf8e('0x26')][_0xaf8e('0x27')],function(_0x4ac101){return{'name':_0x4ac101[_0xaf8e('0x28')],'type':_0x4ac101[_0xaf8e('0x29')][_0xaf8e('0x2a')]};});_0x65c950[_0xaf8e('0x2b')]=_[_0xaf8e('0x25')](_0x2321a1,_0xaf8e('0x22'));_0x65c950[_0xaf8e('0x2c')]=_[_0xaf8e('0x2d')](_0x5b62d6[_0xaf8e('0x2c')]);_0x65c950[_0xaf8e('0x2e')]=_['intersection'](_0x65c950[_0xaf8e('0x2b')],_0x65c950[_0xaf8e('0x2c')]);_0x308821[_0xaf8e('0x2f')]=_['intersection'](_0x65c950[_0xaf8e('0x2b')],qs['fields'](_0x5b62d6[_0xaf8e('0x2c')][_0xaf8e('0x30')]));_0x308821[_0xaf8e('0x2f')]=_0x308821[_0xaf8e('0x2f')][_0xaf8e('0x31')]?_0x308821[_0xaf8e('0x2f')]:_0x65c950[_0xaf8e('0x2b')];if(!_0x5b62d6['query'][_0xaf8e('0x32')](_0xaf8e('0x33'))){_0x308821['limit']=qs[_0xaf8e('0x19')](_0x5b62d6[_0xaf8e('0x2c')][_0xaf8e('0x19')]);_0x308821[_0xaf8e('0x16')]=qs[_0xaf8e('0x16')](_0x5b62d6[_0xaf8e('0x2c')][_0xaf8e('0x16')]);}_0x308821[_0xaf8e('0x34')]=qs[_0xaf8e('0x35')](_0x5b62d6['query']['sort']);_0x308821['where']=qs['filters'](_[_0xaf8e('0x36')](_0x5b62d6[_0xaf8e('0x2c')],_0x65c950[_0xaf8e('0x2e')]),_0x2321a1);if(_0x5b62d6['query'][_0xaf8e('0x37')]){_0x308821['where']=_['merge'](_0x308821[_0xaf8e('0x38')],{'$or':_[_0xaf8e('0x25')](_0x2321a1,function(_0x121532){if(_0x121532[_0xaf8e('0x29')]!==_0xaf8e('0x39')){var _0x5dbb19={};_0x5dbb19[_0x121532[_0xaf8e('0x22')]]={'$like':'%'+_0x5b62d6[_0xaf8e('0x2c')][_0xaf8e('0x37')]+'%'};return _0x5dbb19;}})});}_0x308821=_[_0xaf8e('0x3a')]({},_0x308821,_0x5b62d6[_0xaf8e('0x3b')]);var _0x34ac43={'where':_0x308821[_0xaf8e('0x38')]};return db[_0xaf8e('0x26')][_0xaf8e('0x18')](_0x34ac43)[_0xaf8e('0x20')](function(_0xc4038b){_0x2566cf['count']=_0xc4038b;if(_0x5b62d6['query'][_0xaf8e('0x3c')]){_0x308821['include']=[{'all':!![]}];}return db[_0xaf8e('0x26')][_0xaf8e('0x3d')](_0x308821);})[_0xaf8e('0x20')](function(_0x160dbc){_0x2566cf[_0xaf8e('0x3e')]=_0x160dbc;return _0x2566cf;})['then'](respondWithFilteredResult(_0x475117,_0x308821))[_0xaf8e('0x3f')](handleError(_0x475117,null));};exports['show']=function(_0x3960fa,_0x2fd0b0){var _0x4176a5={'raw':![],'where':{'id':_0x3960fa[_0xaf8e('0x40')]['id']}},_0x89a8b2={};_0x89a8b2[_0xaf8e('0x2b')]=_[_0xaf8e('0x2d')](db['Automation'][_0xaf8e('0x27')]);_0x89a8b2['query']=_[_0xaf8e('0x2d')](_0x3960fa[_0xaf8e('0x2c')]);_0x89a8b2['filters']=_[_0xaf8e('0x41')](_0x89a8b2[_0xaf8e('0x2b')],_0x89a8b2[_0xaf8e('0x2c')]);_0x4176a5[_0xaf8e('0x2f')]=_[_0xaf8e('0x41')](_0x89a8b2[_0xaf8e('0x2b')],qs['fields'](_0x3960fa[_0xaf8e('0x2c')]['fields']));_0x4176a5[_0xaf8e('0x2f')]=_0x4176a5[_0xaf8e('0x2f')]['length']?_0x4176a5[_0xaf8e('0x2f')]:_0x89a8b2[_0xaf8e('0x2b')];if(_0x3960fa['query'][_0xaf8e('0x3c')]){_0x4176a5['include']=[{'all':!![]}];}_0x4176a5=_[_0xaf8e('0x3a')]({},_0x4176a5,_0x3960fa[_0xaf8e('0x3b')]);return db[_0xaf8e('0x26')][_0xaf8e('0x42')](_0x4176a5)[_0xaf8e('0x20')](handleEntityNotFound(_0x2fd0b0,null))[_0xaf8e('0x20')](respondWithResult(_0x2fd0b0,null))[_0xaf8e('0x3f')](handleError(_0x2fd0b0,null));};exports[_0xaf8e('0x43')]=function(_0x5a5018,_0x2d1aee){return db[_0xaf8e('0x26')]['create'](_0x5a5018[_0xaf8e('0x44')],{})[_0xaf8e('0x20')](respondWithResult(_0x2d1aee,0xc9))[_0xaf8e('0x3f')](handleError(_0x2d1aee,null));};exports['update']=function(_0x2bc764,_0x38a54c){if(_0x2bc764[_0xaf8e('0x44')]['id']){delete _0x2bc764['body']['id'];}return db[_0xaf8e('0x26')]['find']({'where':{'id':_0x2bc764[_0xaf8e('0x40')]['id']}})[_0xaf8e('0x20')](handleEntityNotFound(_0x38a54c,null))[_0xaf8e('0x20')](saveUpdates(_0x2bc764[_0xaf8e('0x44')],null))[_0xaf8e('0x20')](respondWithResult(_0x38a54c,null))[_0xaf8e('0x3f')](handleError(_0x38a54c,null));};exports[_0xaf8e('0x1f')]=function(_0x219306,_0x481e24){return db[_0xaf8e('0x26')][_0xaf8e('0x42')]({'where':{'id':_0x219306[_0xaf8e('0x40')]['id']}})['then'](handleEntityNotFound(_0x481e24,null))[_0xaf8e('0x20')](removeEntity(_0x481e24,null))[_0xaf8e('0x3f')](handleError(_0x481e24,null));};exports['addConditions']=function(_0x426de5,_0x5b8aa8,_0x2d6e8f){return db[_0xaf8e('0x45')][_0xaf8e('0x42')]({'where':{'id':_0x426de5[_0xaf8e('0x40')]['id']}})['then'](handleEntityNotFound(_0x5b8aa8,null))[_0xaf8e('0x20')](function(_0x5e94a3){if(_0x5e94a3){return _0x5e94a3['addConditions'](_0x426de5[_0xaf8e('0x44')][_0xaf8e('0x46')],_[_0xaf8e('0x47')](_0x426de5[_0xaf8e('0x44')],['ids','id'])||{});}})[_0xaf8e('0x20')](respondWithResult(_0x5b8aa8,null))['catch'](handleError(_0x5b8aa8,null));};exports[_0xaf8e('0x48')]=function(_0x42ab50,_0x425dcc,_0x493111){var _0x254346={};var _0x2fc7eb={};var _0x563549;var _0x218d3e;return db[_0xaf8e('0x26')][_0xaf8e('0x49')]({'where':{'id':_0x42ab50['params']['id']}})[_0xaf8e('0x20')](handleEntityNotFound(_0x425dcc,null))[_0xaf8e('0x20')](function(_0x3dd0e8){if(_0x3dd0e8){_0x563549=_0x3dd0e8;_0x2fc7eb[_0xaf8e('0x2b')]=_[_0xaf8e('0x2d')](db[_0xaf8e('0x45')][_0xaf8e('0x27')]);_0x2fc7eb[_0xaf8e('0x2c')]=_[_0xaf8e('0x2d')](_0x42ab50[_0xaf8e('0x2c')]);_0x2fc7eb[_0xaf8e('0x2e')]=_[_0xaf8e('0x41')](_0x2fc7eb[_0xaf8e('0x2b')],_0x2fc7eb[_0xaf8e('0x2c')]);_0x254346[_0xaf8e('0x2f')]=_['intersection'](_0x2fc7eb[_0xaf8e('0x2b')],qs['fields'](_0x42ab50['query']['fields']));_0x254346[_0xaf8e('0x2f')]=_0x254346[_0xaf8e('0x2f')][_0xaf8e('0x31')]?_0x254346['attributes']:_0x2fc7eb[_0xaf8e('0x2b')];_0x254346[_0xaf8e('0x34')]=qs[_0xaf8e('0x35')](_0x42ab50['query'][_0xaf8e('0x35')]);_0x254346[_0xaf8e('0x38')]=qs['filters'](_[_0xaf8e('0x36')](_0x42ab50['query'],_0x2fc7eb[_0xaf8e('0x2e')]));if(_0x42ab50[_0xaf8e('0x2c')]['filter']){_0x254346[_0xaf8e('0x38')]=_[_0xaf8e('0x3a')](_0x254346[_0xaf8e('0x38')],{'$or':_[_0xaf8e('0x25')](_0x254346[_0xaf8e('0x2f')],function(_0x17e34f){var _0x1814dc={};_0x1814dc[_0x17e34f]={'$like':'%'+_0x42ab50['query'][_0xaf8e('0x37')]+'%'};return _0x1814dc;})});}_0x254346=_[_0xaf8e('0x3a')]({},_0x254346,_0x42ab50['options']);return _0x563549['getConditions'](_0x254346);}})[_0xaf8e('0x20')](function(_0x1f6966){if(_0x1f6966){_0x218d3e=_0x1f6966['length'];if(!_0x42ab50[_0xaf8e('0x2c')][_0xaf8e('0x32')](_0xaf8e('0x33'))){_0x254346['limit']=qs[_0xaf8e('0x19')](_0x42ab50[_0xaf8e('0x2c')][_0xaf8e('0x19')]);_0x254346[_0xaf8e('0x16')]=qs['offset'](_0x42ab50[_0xaf8e('0x2c')][_0xaf8e('0x16')]);}return _0x563549[_0xaf8e('0x48')](_0x254346);}})[_0xaf8e('0x20')](function(_0x1e9e9b){if(_0x1e9e9b){return _0x1e9e9b?{'count':_0x218d3e,'rows':_0x1e9e9b}:null;}})[_0xaf8e('0x20')](respondWithResult(_0x425dcc,null))[_0xaf8e('0x3f')](handleError(_0x425dcc,null));};exports[_0xaf8e('0x4a')]=function(_0x5f3d93,_0x3f14e2,_0x29080d){return db[_0xaf8e('0x4b')][_0xaf8e('0x42')]({'where':{'id':_0x5f3d93[_0xaf8e('0x40')]['id']}})[_0xaf8e('0x20')](handleEntityNotFound(_0x3f14e2,null))[_0xaf8e('0x20')](function(_0x1d58a1){if(_0x1d58a1){return _0x1d58a1[_0xaf8e('0x4a')](_0x5f3d93[_0xaf8e('0x44')]['ids'],_[_0xaf8e('0x47')](_0x5f3d93['body'],[_0xaf8e('0x46'),'id'])||{});}})[_0xaf8e('0x20')](respondWithResult(_0x3f14e2,null))[_0xaf8e('0x3f')](handleError(_0x3f14e2,null));};exports['getActions']=function(_0x3ce7f4,_0x2d1a9f,_0x43c20f){var _0x4e4350={};var _0x3f4275={};var _0x98e9aa;var _0x323065;return db['Automation'][_0xaf8e('0x49')]({'where':{'id':_0x3ce7f4[_0xaf8e('0x40')]['id']}})[_0xaf8e('0x20')](handleEntityNotFound(_0x2d1a9f,null))[_0xaf8e('0x20')](function(_0x2dc1bd){if(_0x2dc1bd){_0x98e9aa=_0x2dc1bd;_0x3f4275[_0xaf8e('0x2b')]=_[_0xaf8e('0x2d')](db[_0xaf8e('0x4b')]['rawAttributes']);_0x3f4275[_0xaf8e('0x2c')]=_['keys'](_0x3ce7f4[_0xaf8e('0x2c')]);_0x3f4275['filters']=_[_0xaf8e('0x41')](_0x3f4275[_0xaf8e('0x2b')],_0x3f4275[_0xaf8e('0x2c')]);_0x4e4350[_0xaf8e('0x2f')]=_[_0xaf8e('0x41')](_0x3f4275['model'],qs[_0xaf8e('0x30')](_0x3ce7f4[_0xaf8e('0x2c')][_0xaf8e('0x30')]));_0x4e4350[_0xaf8e('0x2f')]=_0x4e4350[_0xaf8e('0x2f')][_0xaf8e('0x31')]?_0x4e4350[_0xaf8e('0x2f')]:_0x3f4275[_0xaf8e('0x2b')];_0x4e4350['order']=qs['sort'](_0x3ce7f4[_0xaf8e('0x2c')][_0xaf8e('0x35')]);_0x4e4350['where']=qs[_0xaf8e('0x2e')](_[_0xaf8e('0x36')](_0x3ce7f4[_0xaf8e('0x2c')],_0x3f4275[_0xaf8e('0x2e')]));if(_0x3ce7f4[_0xaf8e('0x2c')][_0xaf8e('0x37')]){_0x4e4350[_0xaf8e('0x38')]=_[_0xaf8e('0x3a')](_0x4e4350['where'],{'$or':_['map'](_0x4e4350[_0xaf8e('0x2f')],function(_0x5da0a8){var _0x5e6d80={};_0x5e6d80[_0x5da0a8]={'$like':'%'+_0x3ce7f4[_0xaf8e('0x2c')][_0xaf8e('0x37')]+'%'};return _0x5e6d80;})});}_0x4e4350=_[_0xaf8e('0x3a')]({},_0x4e4350,_0x3ce7f4['options']);return _0x98e9aa[_0xaf8e('0x4c')](_0x4e4350);}})['then'](function(_0x104358){if(_0x104358){_0x323065=_0x104358[_0xaf8e('0x31')];if(!_0x3ce7f4['query']['hasOwnProperty'](_0xaf8e('0x33'))){_0x4e4350[_0xaf8e('0x19')]=qs[_0xaf8e('0x19')](_0x3ce7f4[_0xaf8e('0x2c')][_0xaf8e('0x19')]);_0x4e4350[_0xaf8e('0x16')]=qs[_0xaf8e('0x16')](_0x3ce7f4[_0xaf8e('0x2c')][_0xaf8e('0x16')]);}return _0x98e9aa['getActions'](_0x4e4350);}})[_0xaf8e('0x20')](function(_0xa138ce){if(_0xa138ce){return _0xa138ce?{'count':_0x323065,'rows':_0xa138ce}:null;}})[_0xaf8e('0x20')](respondWithResult(_0x2d1a9f,null))[_0xaf8e('0x3f')](handleError(_0x2d1a9f,null));};
\ No newline at end of file
+var _0x1d0a=['apply','save','update','then','sendStatus','error','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','params','length','create','body','destroy','find','addConditions','Condition','ids','omit','getConditions','order','hasOwnProperty','addActions','Action','findOne','rimraf','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','limit','undefined','count','offset'];(function(_0x23f4b5,_0x51c195){var _0x1ee161=function(_0x2dadb5){while(--_0x2dadb5){_0x23f4b5['push'](_0x23f4b5['shift']());}};_0x1ee161(++_0x51c195);}(_0x1d0a,0x17b));var _0xa1d0=function(_0x4227f0,_0x23724b){_0x4227f0=_0x4227f0-0x0;var _0x2e04d9=_0x1d0a[_0x4227f0];return _0x2e04d9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa1d0('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa1d0('0x1'));var BPromise=require(_0xa1d0('0x2'));var Mustache=require(_0xa1d0('0x3'));var util=require(_0xa1d0('0x4'));var path=require(_0xa1d0('0x5'));var sox=require(_0xa1d0('0x6'));var csv=require('to-csv');var ejs=require(_0xa1d0('0x7'));var fs=require('fs');var fs_extra=require(_0xa1d0('0x8'));var _=require(_0xa1d0('0x9'));var squel=require(_0xa1d0('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa1d0('0xb'));var toCsv=require(_0xa1d0('0xc'));var querystring=require(_0xa1d0('0xd'));var Papa=require(_0xa1d0('0xe'));var Redis=require(_0xa1d0('0xf'));var authService=require(_0xa1d0('0x10'));var qs=require(_0xa1d0('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa1d0('0x12'));var logger=require(_0xa1d0('0x13'))(_0xa1d0('0x14'));var utils=require(_0xa1d0('0x15'));var config=require(_0xa1d0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xa1d0('0x17'))['db'];function respondWithStatusCode(_0x1f2a67,_0x571731){_0x571731=_0x571731||0xcc;return function(_0x3f42e6){if(_0x3f42e6){return _0x1f2a67['sendStatus'](_0x571731);}return _0x1f2a67['status'](_0x571731)[_0xa1d0('0x18')]();};}function respondWithResult(_0x31bf5e,_0x2796c9){_0x2796c9=_0x2796c9||0xc8;return function(_0x3b629c){if(_0x3b629c){return _0x31bf5e[_0xa1d0('0x19')](_0x2796c9)[_0xa1d0('0x1a')](_0x3b629c);}};}function respondWithFilteredResult(_0x31cb0a,_0xcb45fe){return function(_0x57a9e1){if(_0x57a9e1){var _0x1ef267=typeof _0xcb45fe['offset']==='undefined'&&typeof _0xcb45fe[_0xa1d0('0x1b')]===_0xa1d0('0x1c');var _0x537c78=_0x57a9e1[_0xa1d0('0x1d')];var _0x25cf77=_0x1ef267?0x0:_0xcb45fe[_0xa1d0('0x1e')];var _0x260bc8=_0x1ef267?_0x57a9e1[_0xa1d0('0x1d')]:_0xcb45fe[_0xa1d0('0x1e')]+_0xcb45fe[_0xa1d0('0x1b')];var _0xdc707e;if(_0x260bc8>=_0x537c78){_0x260bc8=_0x537c78;_0xdc707e=0xc8;}else{_0xdc707e=0xce;}_0x31cb0a[_0xa1d0('0x19')](_0xdc707e);return _0x31cb0a['set']('Content-Range',_0x25cf77+'-'+_0x260bc8+'/'+_0x537c78)['json'](_0x57a9e1);}return null;};}function patchUpdates(_0x303383){return function(_0x16bc6d){try{jsonpatch[_0xa1d0('0x1f')](_0x16bc6d,_0x303383,!![]);}catch(_0x33c226){return BPromise['reject'](_0x33c226);}return _0x16bc6d[_0xa1d0('0x20')]();};}function saveUpdates(_0x280957,_0x10cc06){return function(_0x2dfa7f){if(_0x2dfa7f){return _0x2dfa7f[_0xa1d0('0x21')](_0x280957)['then'](function(_0x525a60){return _0x525a60;});}return null;};}function removeEntity(_0x1ccae6,_0x50bef0){return function(_0x4c147c){if(_0x4c147c){return _0x4c147c['destroy']()[_0xa1d0('0x22')](function(){_0x1ccae6['status'](0xcc)[_0xa1d0('0x18')]();});}};}function handleEntityNotFound(_0x1909c3,_0x4ccd5f){return function(_0x466eef){if(!_0x466eef){_0x1909c3[_0xa1d0('0x23')](0x194);}return _0x466eef;};}function handleError(_0x292b99,_0x27671e){_0x27671e=_0x27671e||0x1f4;return function(_0x322900){logger[_0xa1d0('0x24')](_0x322900[_0xa1d0('0x25')]);if(_0x322900[_0xa1d0('0x26')]){delete _0x322900[_0xa1d0('0x26')];}_0x292b99[_0xa1d0('0x19')](_0x27671e)[_0xa1d0('0x27')](_0x322900);};}exports[_0xa1d0('0x28')]=function(_0x44e1a6,_0x4f8dc1){var _0x1ab93f={},_0x18f453={},_0x311627={'count':0x0,'rows':[]};var _0x117c4f=_[_0xa1d0('0x29')](db[_0xa1d0('0x2a')][_0xa1d0('0x2b')],function(_0x27e86d){return{'name':_0x27e86d[_0xa1d0('0x2c')],'type':_0x27e86d[_0xa1d0('0x2d')][_0xa1d0('0x2e')]};});_0x18f453[_0xa1d0('0x2f')]=_[_0xa1d0('0x29')](_0x117c4f,'name');_0x18f453[_0xa1d0('0x30')]=_[_0xa1d0('0x31')](_0x44e1a6[_0xa1d0('0x30')]);_0x18f453[_0xa1d0('0x32')]=_[_0xa1d0('0x33')](_0x18f453['model'],_0x18f453[_0xa1d0('0x30')]);_0x1ab93f[_0xa1d0('0x34')]=_['intersection'](_0x18f453['model'],qs[_0xa1d0('0x35')](_0x44e1a6['query']['fields']));_0x1ab93f['attributes']=_0x1ab93f['attributes']['length']?_0x1ab93f[_0xa1d0('0x34')]:_0x18f453[_0xa1d0('0x2f')];if(!_0x44e1a6['query']['hasOwnProperty'](_0xa1d0('0x36'))){_0x1ab93f['limit']=qs[_0xa1d0('0x1b')](_0x44e1a6[_0xa1d0('0x30')][_0xa1d0('0x1b')]);_0x1ab93f[_0xa1d0('0x1e')]=qs[_0xa1d0('0x1e')](_0x44e1a6[_0xa1d0('0x30')][_0xa1d0('0x1e')]);}_0x1ab93f['order']=qs[_0xa1d0('0x37')](_0x44e1a6[_0xa1d0('0x30')][_0xa1d0('0x37')]);_0x1ab93f['where']=qs[_0xa1d0('0x32')](_[_0xa1d0('0x38')](_0x44e1a6[_0xa1d0('0x30')],_0x18f453[_0xa1d0('0x32')]),_0x117c4f);if(_0x44e1a6[_0xa1d0('0x30')][_0xa1d0('0x39')]){_0x1ab93f[_0xa1d0('0x3a')]=_[_0xa1d0('0x3b')](_0x1ab93f['where'],{'$or':_['map'](_0x117c4f,function(_0x5bf0a2){if(_0x5bf0a2['type']!=='VIRTUAL'){var _0x1f3364={};_0x1f3364[_0x5bf0a2[_0xa1d0('0x26')]]={'$like':'%'+_0x44e1a6['query'][_0xa1d0('0x39')]+'%'};return _0x1f3364;}})});}_0x1ab93f=_['merge']({},_0x1ab93f,_0x44e1a6[_0xa1d0('0x3c')]);var _0x4e659f={'where':_0x1ab93f['where']};return db['Automation'][_0xa1d0('0x1d')](_0x4e659f)[_0xa1d0('0x22')](function(_0x239957){_0x311627['count']=_0x239957;if(_0x44e1a6[_0xa1d0('0x30')][_0xa1d0('0x3d')]){_0x1ab93f[_0xa1d0('0x3e')]=[{'all':!![]}];}return db[_0xa1d0('0x2a')][_0xa1d0('0x3f')](_0x1ab93f);})[_0xa1d0('0x22')](function(_0x358af1){_0x311627[_0xa1d0('0x40')]=_0x358af1;return _0x311627;})['then'](respondWithFilteredResult(_0x4f8dc1,_0x1ab93f))[_0xa1d0('0x41')](handleError(_0x4f8dc1,null));};exports['show']=function(_0x1421ce,_0x45ca5d){var _0x595938={'raw':![],'where':{'id':_0x1421ce[_0xa1d0('0x42')]['id']}},_0x22892a={};_0x22892a['model']=_['keys'](db['Automation'][_0xa1d0('0x2b')]);_0x22892a[_0xa1d0('0x30')]=_[_0xa1d0('0x31')](_0x1421ce['query']);_0x22892a[_0xa1d0('0x32')]=_['intersection'](_0x22892a[_0xa1d0('0x2f')],_0x22892a[_0xa1d0('0x30')]);_0x595938[_0xa1d0('0x34')]=_[_0xa1d0('0x33')](_0x22892a['model'],qs[_0xa1d0('0x35')](_0x1421ce[_0xa1d0('0x30')][_0xa1d0('0x35')]));_0x595938[_0xa1d0('0x34')]=_0x595938[_0xa1d0('0x34')][_0xa1d0('0x43')]?_0x595938[_0xa1d0('0x34')]:_0x22892a[_0xa1d0('0x2f')];if(_0x1421ce[_0xa1d0('0x30')]['includeAll']){_0x595938[_0xa1d0('0x3e')]=[{'all':!![]}];}_0x595938=_[_0xa1d0('0x3b')]({},_0x595938,_0x1421ce[_0xa1d0('0x3c')]);return db[_0xa1d0('0x2a')]['find'](_0x595938)[_0xa1d0('0x22')](handleEntityNotFound(_0x45ca5d,null))['then'](respondWithResult(_0x45ca5d,null))[_0xa1d0('0x41')](handleError(_0x45ca5d,null));};exports['create']=function(_0x2d2365,_0x2751f3){return db[_0xa1d0('0x2a')][_0xa1d0('0x44')](_0x2d2365[_0xa1d0('0x45')],{})[_0xa1d0('0x22')](respondWithResult(_0x2751f3,0xc9))[_0xa1d0('0x41')](handleError(_0x2751f3,null));};exports[_0xa1d0('0x21')]=function(_0x335877,_0x49ff55){if(_0x335877[_0xa1d0('0x45')]['id']){delete _0x335877['body']['id'];}return db[_0xa1d0('0x2a')]['find']({'where':{'id':_0x335877[_0xa1d0('0x42')]['id']}})[_0xa1d0('0x22')](handleEntityNotFound(_0x49ff55,null))[_0xa1d0('0x22')](saveUpdates(_0x335877[_0xa1d0('0x45')],null))[_0xa1d0('0x22')](respondWithResult(_0x49ff55,null))['catch'](handleError(_0x49ff55,null));};exports[_0xa1d0('0x46')]=function(_0x8fe2fa,_0x36f6a7){return db['Automation'][_0xa1d0('0x47')]({'where':{'id':_0x8fe2fa[_0xa1d0('0x42')]['id']}})['then'](handleEntityNotFound(_0x36f6a7,null))[_0xa1d0('0x22')](removeEntity(_0x36f6a7,null))[_0xa1d0('0x41')](handleError(_0x36f6a7,null));};exports[_0xa1d0('0x48')]=function(_0x4d139d,_0x3648d5,_0x25c45c){return db[_0xa1d0('0x49')][_0xa1d0('0x47')]({'where':{'id':_0x4d139d[_0xa1d0('0x42')]['id']}})[_0xa1d0('0x22')](handleEntityNotFound(_0x3648d5,null))['then'](function(_0x7f43a1){if(_0x7f43a1){return _0x7f43a1['addConditions'](_0x4d139d[_0xa1d0('0x45')][_0xa1d0('0x4a')],_[_0xa1d0('0x4b')](_0x4d139d[_0xa1d0('0x45')],[_0xa1d0('0x4a'),'id'])||{});}})['then'](respondWithResult(_0x3648d5,null))['catch'](handleError(_0x3648d5,null));};exports[_0xa1d0('0x4c')]=function(_0x3419e4,_0x1660ad,_0x3c305e){var _0x243e08={};var _0x29c210={};var _0x2b4039;var _0x4c1c16;return db[_0xa1d0('0x2a')]['findOne']({'where':{'id':_0x3419e4[_0xa1d0('0x42')]['id']}})[_0xa1d0('0x22')](handleEntityNotFound(_0x1660ad,null))['then'](function(_0x2c1284){if(_0x2c1284){_0x2b4039=_0x2c1284;_0x29c210[_0xa1d0('0x2f')]=_['keys'](db[_0xa1d0('0x49')][_0xa1d0('0x2b')]);_0x29c210[_0xa1d0('0x30')]=_[_0xa1d0('0x31')](_0x3419e4[_0xa1d0('0x30')]);_0x29c210[_0xa1d0('0x32')]=_['intersection'](_0x29c210['model'],_0x29c210[_0xa1d0('0x30')]);_0x243e08[_0xa1d0('0x34')]=_[_0xa1d0('0x33')](_0x29c210[_0xa1d0('0x2f')],qs[_0xa1d0('0x35')](_0x3419e4[_0xa1d0('0x30')][_0xa1d0('0x35')]));_0x243e08[_0xa1d0('0x34')]=_0x243e08[_0xa1d0('0x34')]['length']?_0x243e08['attributes']:_0x29c210[_0xa1d0('0x2f')];_0x243e08[_0xa1d0('0x4d')]=qs[_0xa1d0('0x37')](_0x3419e4[_0xa1d0('0x30')][_0xa1d0('0x37')]);_0x243e08['where']=qs[_0xa1d0('0x32')](_[_0xa1d0('0x38')](_0x3419e4['query'],_0x29c210[_0xa1d0('0x32')]));if(_0x3419e4['query']['filter']){_0x243e08[_0xa1d0('0x3a')]=_[_0xa1d0('0x3b')](_0x243e08[_0xa1d0('0x3a')],{'$or':_[_0xa1d0('0x29')](_0x243e08[_0xa1d0('0x34')],function(_0x28f849){var _0x2bce92={};_0x2bce92[_0x28f849]={'$like':'%'+_0x3419e4[_0xa1d0('0x30')][_0xa1d0('0x39')]+'%'};return _0x2bce92;})});}_0x243e08=_[_0xa1d0('0x3b')]({},_0x243e08,_0x3419e4[_0xa1d0('0x3c')]);return _0x2b4039['getConditions'](_0x243e08);}})[_0xa1d0('0x22')](function(_0x1d5404){if(_0x1d5404){_0x4c1c16=_0x1d5404[_0xa1d0('0x43')];if(!_0x3419e4[_0xa1d0('0x30')][_0xa1d0('0x4e')](_0xa1d0('0x36'))){_0x243e08['limit']=qs[_0xa1d0('0x1b')](_0x3419e4['query'][_0xa1d0('0x1b')]);_0x243e08[_0xa1d0('0x1e')]=qs[_0xa1d0('0x1e')](_0x3419e4[_0xa1d0('0x30')]['offset']);}return _0x2b4039[_0xa1d0('0x4c')](_0x243e08);}})[_0xa1d0('0x22')](function(_0x4bc803){if(_0x4bc803){return _0x4bc803?{'count':_0x4c1c16,'rows':_0x4bc803}:null;}})[_0xa1d0('0x22')](respondWithResult(_0x1660ad,null))[_0xa1d0('0x41')](handleError(_0x1660ad,null));};exports[_0xa1d0('0x4f')]=function(_0x4b9246,_0x5df7fb,_0x2118d3){return db[_0xa1d0('0x50')]['find']({'where':{'id':_0x4b9246[_0xa1d0('0x42')]['id']}})[_0xa1d0('0x22')](handleEntityNotFound(_0x5df7fb,null))[_0xa1d0('0x22')](function(_0x181338){if(_0x181338){return _0x181338['addActions'](_0x4b9246[_0xa1d0('0x45')][_0xa1d0('0x4a')],_[_0xa1d0('0x4b')](_0x4b9246[_0xa1d0('0x45')],[_0xa1d0('0x4a'),'id'])||{});}})[_0xa1d0('0x22')](respondWithResult(_0x5df7fb,null))['catch'](handleError(_0x5df7fb,null));};exports['getActions']=function(_0x11ab37,_0x37c38e,_0x41f8c0){var _0x671fa3={};var _0x3fd111={};var _0x48420f;var _0x117342;return db['Automation'][_0xa1d0('0x51')]({'where':{'id':_0x11ab37['params']['id']}})['then'](handleEntityNotFound(_0x37c38e,null))[_0xa1d0('0x22')](function(_0x51aca2){if(_0x51aca2){_0x48420f=_0x51aca2;_0x3fd111['model']=_[_0xa1d0('0x31')](db[_0xa1d0('0x50')][_0xa1d0('0x2b')]);_0x3fd111['query']=_['keys'](_0x11ab37[_0xa1d0('0x30')]);_0x3fd111[_0xa1d0('0x32')]=_['intersection'](_0x3fd111['model'],_0x3fd111['query']);_0x671fa3[_0xa1d0('0x34')]=_[_0xa1d0('0x33')](_0x3fd111[_0xa1d0('0x2f')],qs[_0xa1d0('0x35')](_0x11ab37[_0xa1d0('0x30')][_0xa1d0('0x35')]));_0x671fa3[_0xa1d0('0x34')]=_0x671fa3['attributes']['length']?_0x671fa3['attributes']:_0x3fd111[_0xa1d0('0x2f')];_0x671fa3[_0xa1d0('0x4d')]=qs[_0xa1d0('0x37')](_0x11ab37['query']['sort']);_0x671fa3[_0xa1d0('0x3a')]=qs[_0xa1d0('0x32')](_[_0xa1d0('0x38')](_0x11ab37[_0xa1d0('0x30')],_0x3fd111['filters']));if(_0x11ab37[_0xa1d0('0x30')][_0xa1d0('0x39')]){_0x671fa3[_0xa1d0('0x3a')]=_[_0xa1d0('0x3b')](_0x671fa3['where'],{'$or':_[_0xa1d0('0x29')](_0x671fa3['attributes'],function(_0x218f47){var _0x5c06be={};_0x5c06be[_0x218f47]={'$like':'%'+_0x11ab37[_0xa1d0('0x30')][_0xa1d0('0x39')]+'%'};return _0x5c06be;})});}_0x671fa3=_['merge']({},_0x671fa3,_0x11ab37['options']);return _0x48420f['getActions'](_0x671fa3);}})[_0xa1d0('0x22')](function(_0x47a6e1){if(_0x47a6e1){_0x117342=_0x47a6e1[_0xa1d0('0x43')];if(!_0x11ab37[_0xa1d0('0x30')][_0xa1d0('0x4e')]('nolimit')){_0x671fa3[_0xa1d0('0x1b')]=qs[_0xa1d0('0x1b')](_0x11ab37[_0xa1d0('0x30')][_0xa1d0('0x1b')]);_0x671fa3[_0xa1d0('0x1e')]=qs[_0xa1d0('0x1e')](_0x11ab37[_0xa1d0('0x30')][_0xa1d0('0x1e')]);}return _0x48420f['getActions'](_0x671fa3);}})[_0xa1d0('0x22')](function(_0x24a32d){if(_0x24a32d){return _0x24a32d?{'count':_0x117342,'rows':_0x24a32d}:null;}})[_0xa1d0('0x22')](respondWithResult(_0x37c38e,null))[_0xa1d0('0x41')](handleError(_0x37c38e,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index ae66ef2..97a80dd 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 _0x3e9f=['exports','define','Automation','tools_automations','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x3e9f,0x10e));var _0xf3e9=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x3e9f[_0x3511d3];return _0x5d6321;};'use strict';var _=require(_0xf3e9('0x0'));var util=require(_0xf3e9('0x1'));var logger=require('../../config/logger')(_0xf3e9('0x2'));var moment=require(_0xf3e9('0x3'));var BPromise=require(_0xf3e9('0x4'));var rp=require(_0xf3e9('0x5'));var fs=require('fs');var path=require(_0xf3e9('0x6'));var rimraf=require(_0xf3e9('0x7'));var config=require(_0xf3e9('0x8'));var attributes=require(_0xf3e9('0x9'));module[_0xf3e9('0xa')]=function(_0xb33505,_0x5e6c2b){return _0xb33505[_0xf3e9('0xb')](_0xf3e9('0xc'),attributes,{'tableName':_0xf3e9('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf886=['../../config/logger','api','moment','bluebird','path','rimraf','./automation.attributes','exports','Automation','tools_automations','lodash','util'];(function(_0x371ea6,_0x3158d9){var _0x33431e=function(_0x1649bb){while(--_0x1649bb){_0x371ea6['push'](_0x371ea6['shift']());}};_0x33431e(++_0x3158d9);}(_0xf886,0x142));var _0x6f88=function(_0x3b3f4f,_0x403216){_0x3b3f4f=_0x3b3f4f-0x0;var _0x174dbe=_0xf886[_0x3b3f4f];return _0x174dbe;};'use strict';var _=require(_0x6f88('0x0'));var util=require(_0x6f88('0x1'));var logger=require(_0x6f88('0x2'))(_0x6f88('0x3'));var moment=require(_0x6f88('0x4'));var BPromise=require(_0x6f88('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6f88('0x6'));var rimraf=require(_0x6f88('0x7'));var config=require('../../config/environment');var attributes=require(_0x6f88('0x8'));module[_0x6f88('0x9')]=function(_0x4b4ac6,_0x2dfd0a){return _0x4b4ac6['define'](_0x6f88('0xa'),attributes,{'tableName':_0x6f88('0xb'),'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 56a4760..849fbbb 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 _0x38b2=['util','moment','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash'];(function(_0x3f7598,_0x212e37){var _0x51fb16=function(_0x4a5c0b){while(--_0x4a5c0b){_0x3f7598['push'](_0x3f7598['shift']());}};_0x51fb16(++_0x212e37);}(_0x38b2,0xf6));var _0x238b=function(_0xdf6b11,_0x1ece9f){_0xdf6b11=_0xdf6b11-0x0;var _0x599f62=_0x38b2[_0xdf6b11];return _0x599f62;};'use strict';var _=require(_0x238b('0x0'));var util=require(_0x238b('0x1'));var moment=require(_0x238b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x238b('0x3'));var db=require(_0x238b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x238b('0x5'))('rpc');var config=require(_0x238b('0x6'));var jayson=require(_0x238b('0x7'));var client=jayson[_0x238b('0x8')][_0x238b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5509fe,_0x202714,_0x12ac57){return new BPromise(function(_0x4b79d3,_0x16e19d){return client[_0x238b('0xa')](_0x5509fe,_0x12ac57)[_0x238b('0xb')](function(_0x3124e1){logger[_0x238b('0xc')](_0x238b('0xd'),_0x202714,_0x238b('0xe'));logger['debug'](_0x238b('0xf'),_0x202714,_0x238b('0xe'),JSON[_0x238b('0x10')](_0x3124e1));if(_0x3124e1[_0x238b('0x11')]){if(_0x3124e1[_0x238b('0x11')]['code']===0x1f4){logger[_0x238b('0x11')](_0x238b('0xd'),_0x202714,_0x3124e1[_0x238b('0x11')][_0x238b('0x12')]);return _0x16e19d(_0x3124e1['error']['message']);}logger['error'](_0x238b('0xd'),_0x202714,_0x3124e1[_0x238b('0x11')][_0x238b('0x12')]);return _0x4b79d3(_0x3124e1[_0x238b('0x11')][_0x238b('0x12')]);}else{logger[_0x238b('0xc')](_0x238b('0xd'),_0x202714,_0x238b('0xe'));_0x4b79d3(_0x3124e1['result'][_0x238b('0x12')]);}})['catch'](function(_0x2bb3e7){logger['error'](_0x238b('0xd'),_0x202714,_0x2bb3e7);_0x16e19d(_0x2bb3e7);});});}
\ No newline at end of file
+var _0x349f=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','Automation,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x419cee,_0x3f2988){var _0x4b6be2=function(_0x2967d3){while(--_0x2967d3){_0x419cee['push'](_0x419cee['shift']());}};_0x4b6be2(++_0x3f2988);}(_0x349f,0xa8));var _0xf349=function(_0x3e4cb3,_0x99f949){_0x3e4cb3=_0x3e4cb3-0x0;var _0x2a11b3=_0x349f[_0x3e4cb3];return _0x2a11b3;};'use strict';var _=require(_0xf349('0x0'));var util=require(_0xf349('0x1'));var moment=require(_0xf349('0x2'));var BPromise=require('bluebird');var rs=require(_0xf349('0x3'));var fs=require('fs');var Redis=require(_0xf349('0x4'));var db=require(_0xf349('0x5'))['db'];var utils=require(_0xf349('0x6'));var logger=require(_0xf349('0x7'))(_0xf349('0x8'));var config=require(_0xf349('0x9'));var jayson=require(_0xf349('0xa'));var client=jayson[_0xf349('0xb')][_0xf349('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4c6f4c,_0x1bd44a,_0x23fb4b){return new BPromise(function(_0x6c6cd2,_0x21a480){return client[_0xf349('0xd')](_0x4c6f4c,_0x23fb4b)[_0xf349('0xe')](function(_0x3e2147){logger['info']('Automation,\x20%s,\x20%s',_0x1bd44a,_0xf349('0xf'));logger[_0xf349('0x10')](_0xf349('0x11'),_0x1bd44a,_0xf349('0xf'),JSON[_0xf349('0x12')](_0x3e2147));if(_0x3e2147['error']){if(_0x3e2147['error']['code']===0x1f4){logger[_0xf349('0x13')](_0xf349('0x14'),_0x1bd44a,_0x3e2147[_0xf349('0x13')][_0xf349('0x15')]);return _0x21a480(_0x3e2147[_0xf349('0x13')]['message']);}logger[_0xf349('0x13')](_0xf349('0x14'),_0x1bd44a,_0x3e2147['error'][_0xf349('0x15')]);return _0x6c6cd2(_0x3e2147[_0xf349('0x13')]['message']);}else{logger[_0xf349('0x16')]('Automation,\x20%s,\x20%s',_0x1bd44a,_0xf349('0xf'));_0x6c6cd2(_0x3e2147[_0xf349('0x17')][_0xf349('0x15')]);}})[_0xf349('0x18')](function(_0x14c06d){logger[_0xf349('0x13')](_0xf349('0x14'),_0x1bd44a,_0x14c06d);_0x21a480(_0x14c06d);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index e623de8..87a6784 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 _0x2557=['isAuthenticated','index','/:id','/:id/conditions','/:id/actions','getActions','post','create','addActions','put','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get'];(function(_0x254076,_0x5e7b8d){var _0x21a93e=function(_0x26aa78){while(--_0x26aa78){_0x254076['push'](_0x254076['shift']());}};_0x21a93e(++_0x5e7b8d);}(_0x2557,0x11e));var _0x7255=function(_0x54cf7e,_0x2f5310){_0x54cf7e=_0x54cf7e-0x0;var _0x47bb30=_0x2557[_0x54cf7e];return _0x47bb30;};'use strict';var multer=require(_0x7255('0x0'));var util=require('util');var path=require(_0x7255('0x1'));var timeout=require(_0x7255('0x2'));var express=require(_0x7255('0x3'));var router=express[_0x7255('0x4')]();var fs_extra=require(_0x7255('0x5'));var auth=require(_0x7255('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./automation.controller');router[_0x7255('0x7')]('/',auth[_0x7255('0x8')](),controller[_0x7255('0x9')]);router[_0x7255('0x7')](_0x7255('0xa'),auth[_0x7255('0x8')](),controller['show']);router[_0x7255('0x7')](_0x7255('0xb'),auth[_0x7255('0x8')](),controller['getConditions']);router[_0x7255('0x7')](_0x7255('0xc'),auth[_0x7255('0x8')](),controller[_0x7255('0xd')]);router[_0x7255('0xe')]('/',auth[_0x7255('0x8')](),controller[_0x7255('0xf')]);router['post'](_0x7255('0xb'),auth['isAuthenticated'](),controller['addConditions']);router['post'](_0x7255('0xc'),auth[_0x7255('0x8')](),controller[_0x7255('0x10')]);router[_0x7255('0x11')](_0x7255('0xa'),auth[_0x7255('0x8')](),controller[_0x7255('0x12')]);router['delete'](_0x7255('0xa'),auth[_0x7255('0x8')](),controller[_0x7255('0x13')]);module[_0x7255('0x14')]=router;
\ No newline at end of file
+var _0xd765=['update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./automation.controller','isAuthenticated','index','get','/:id','show','getConditions','/:id/actions','post','create','put'];(function(_0x178856,_0x41f045){var _0x3c7fe7=function(_0x4d9ce4){while(--_0x4d9ce4){_0x178856['push'](_0x178856['shift']());}};_0x3c7fe7(++_0x41f045);}(_0xd765,0xdf));var _0x5d76=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xd765[_0x1cc8fe];return _0x230054;};'use strict';var multer=require(_0x5d76('0x0'));var util=require(_0x5d76('0x1'));var path=require(_0x5d76('0x2'));var timeout=require(_0x5d76('0x3'));var express=require(_0x5d76('0x4'));var router=express[_0x5d76('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5d76('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5d76('0x7'));var controller=require(_0x5d76('0x8'));router['get']('/',auth[_0x5d76('0x9')](),controller[_0x5d76('0xa')]);router[_0x5d76('0xb')](_0x5d76('0xc'),auth[_0x5d76('0x9')](),controller[_0x5d76('0xd')]);router['get']('/:id/conditions',auth[_0x5d76('0x9')](),controller[_0x5d76('0xe')]);router[_0x5d76('0xb')](_0x5d76('0xf'),auth['isAuthenticated'](),controller['getActions']);router[_0x5d76('0x10')]('/',auth[_0x5d76('0x9')](),controller[_0x5d76('0x11')]);router['post']('/:id/conditions',auth['isAuthenticated'](),controller['addConditions']);router[_0x5d76('0x10')](_0x5d76('0xf'),auth[_0x5d76('0x9')](),controller['addActions']);router[_0x5d76('0x12')](_0x5d76('0xc'),auth['isAuthenticated'](),controller[_0x5d76('0x13')]);router[_0x5d76('0x14')](_0x5d76('0xc'),auth[_0x5d76('0x9')](),controller[_0x5d76('0x15')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 28e7202..93fb0eb 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 _0x4ffa=['Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','STRING','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER'];(function(_0x1f4674,_0x146085){var _0x3e7f42=function(_0x4bd366){while(--_0x4bd366){_0x1f4674['push'](_0x1f4674['shift']());}};_0x3e7f42(++_0x146085);}(_0x4ffa,0x124));var _0xa4ff=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x4ffa[_0x1cc8fe];return _0x230054;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xa4ff('0x0')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xa4ff('0x1')](_0xa4ff('0x2')),'allowNull':![],'defaultValue':_0xa4ff('0x2')},'description':{'type':Sequelize[_0xa4ff('0x0')]},'active':{'type':Sequelize[_0xa4ff('0x3')],'defaultValue':0x0,'comment':_0xa4ff('0x4')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xa4ff('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xa4ff('0x6')},'dialOriginateCallerIdName':{'type':Sequelize[_0xa4ff('0x0')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xa4ff('0x7')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa4ff('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0xa4ff('0x7')](0x3)[_0xa4ff('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xa4ff('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa4ff('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa4ff('0x9')},'dialBusyRetryFrequency':{'type':Sequelize[_0xa4ff('0x7')](0x5)[_0xa4ff('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xa4ff('0x7')](0x3)[_0xa4ff('0x5')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xa4ff('0x7')](0x5)[_0xa4ff('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xa4ff('0x7')](0x3)[_0xa4ff('0x5')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xa4ff('0x0')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xa4ff('0xa')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xa4ff('0xb'),_0xa4ff('0xc'),'onlyIfOpen'),'defaultValue':_0xa4ff('0xb')},'dialAMDActive':{'type':Sequelize[_0xa4ff('0x3')],'defaultValue':0x0,'comment':_0xa4ff('0xd')},'dialAMDInitialSilence':{'type':Sequelize[_0xa4ff('0x7')](0x9)[_0xa4ff('0x5')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xa4ff('0xe')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0xa4ff('0x5')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xa4ff('0xf')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xa4ff('0x7')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xa4ff('0x10')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xa4ff('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xa4ff('0x7')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xa4ff('0x7')](0x9)[_0xa4ff('0x5')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xa4ff('0x11')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xa4ff('0x7')](0x9)[_0xa4ff('0x5')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xa4ff('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xa4ff('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa4ff('0x12')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xa4ff('0x13'),'ASC'),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xa4ff('0x0')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xa4ff('0x7')](0x3)[_0xa4ff('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa4ff('0x14')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xa4ff('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa4ff('0x15')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xa4ff('0x7')](0x3)[_0xa4ff('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa4ff('0x16')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xa4ff('0x7')](0x5)[_0xa4ff('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xa4ff('0x7')](0x3)[_0xa4ff('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa4ff('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa4ff('0x17')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xa4ff('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa4ff('0x18')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xa4ff('0x7')](0x5)[_0xa4ff('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa4ff('0x19')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa4ff('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa4ff('0x1a')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa4ff('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa4ff('0x1b')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xa4ff('0x7')](0x3)[_0xa4ff('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa4ff('0x1c')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xa4ff('0x7')](0x5)[_0xa4ff('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa4ff('0x1d')}};
\ No newline at end of file
+var _0xa1ea=['ENUM','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','ivr','BOOLEAN','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\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,*,*,*'];(function(_0x1182e8,_0x14cc0e){var _0x4deabd=function(_0x2178c1){while(--_0x2178c1){_0x1182e8['push'](_0x1182e8['shift']());}};_0x4deabd(++_0x14cc0e);}(_0xa1ea,0x102));var _0xaa1e=function(_0x188b18,_0x22f59a){_0x188b18=_0x188b18-0x0;var _0x52e7ce=_0xa1ea[_0x188b18];return _0x52e7ce;};'use strict';var Sequelize=require(_0xaa1e('0x0'));module[_0xaa1e('0x1')]={'name':{'type':Sequelize[_0xaa1e('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xaa1e('0x3')),'allowNull':![],'defaultValue':_0xaa1e('0x3')},'description':{'type':Sequelize[_0xaa1e('0x2')]},'active':{'type':Sequelize[_0xaa1e('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0xaa1e('0x5')](0x4)[_0xaa1e('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xaa1e('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0xaa1e('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xaa1e('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xaa1e('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0xaa1e('0x5')](0x3)[_0xaa1e('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xaa1e('0x5')](0x5)[_0xaa1e('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xaa1e('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xaa1e('0x9')},'dialBusyRetryFrequency':{'type':Sequelize[_0xaa1e('0x5')](0x5)[_0xaa1e('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xaa1e('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xaa1e('0x6')],'defaultValue':0x3,'comment':_0xaa1e('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xaa1e('0x5')](0x5)[_0xaa1e('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xaa1e('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0xaa1e('0x5')](0x3)[_0xaa1e('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xaa1e('0xd')},'dialTimezone':{'type':Sequelize[_0xaa1e('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xaa1e('0x2')],'defaultValue':_0xaa1e('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0xaa1e('0xf')](_0xaa1e('0x10'),'never',_0xaa1e('0x11')),'defaultValue':_0xaa1e('0x10')},'dialAMDActive':{'type':Sequelize[_0xaa1e('0x4')],'defaultValue':0x0,'comment':_0xaa1e('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0xaa1e('0x5')](0x9)[_0xaa1e('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xaa1e('0x13')},'dialAMDGreeting':{'type':Sequelize[_0xaa1e('0x5')](0x9)[_0xaa1e('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xaa1e('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xaa1e('0x5')](0x9)[_0xaa1e('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xaa1e('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xaa1e('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xaa1e('0x16')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xaa1e('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xaa1e('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xaa1e('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xaa1e('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xaa1e('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xaa1e('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xaa1e('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xaa1e('0x5')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xaa1e('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0xaa1e('0xf')](_0xaa1e('0x1c'),_0xaa1e('0x1d')),'defaultValue':_0xaa1e('0x1c')},'dialPrefix':{'type':Sequelize[_0xaa1e('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xaa1e('0x5')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xaa1e('0x1e')},'dialCutDigit':{'type':Sequelize[_0xaa1e('0x5')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xaa1e('0x1f')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xaa1e('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xaa1e('0x20')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xaa1e('0x5')](0x5)[_0xaa1e('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xaa1e('0x21')},'dialDropMaxRetry':{'type':Sequelize[_0xaa1e('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xaa1e('0x22')},'dialDropRetryFrequency':{'type':Sequelize[_0xaa1e('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xaa1e('0x5')](0x3)[_0xaa1e('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xaa1e('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xaa1e('0x23')},'dialMachineMaxRetry':{'type':Sequelize[_0xaa1e('0x5')](0x3)[_0xaa1e('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xaa1e('0x24')},'dialMachineRetryFrequency':{'type':Sequelize[_0xaa1e('0x5')](0x5)[_0xaa1e('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xaa1e('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xaa1e('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xaa1e('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xaa1e('0x26')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index d7ecfd7..1bd87e5 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 _0x5e49=['userProfileId','getHoppers','findOne','CmHopper','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','scheduledAt','ContactId','ListId','select','field','NOW()','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','CampaignId\x20=\x20?','toString','COALESCE(phone,\x27\x27)','onlyIfOpen','fromQuery','CmListId','phone\x20IS\x20NOT\x20NULL','cm_hopper_additional_phones','cmHopperId','h.id','ci.OrderBY','h.ContactId\x20=\x20ci.CmContactId','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','eml-format','rimraf','zip-dir','moment','mustache','util','sox','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','get','IvrCampaigns','UserProfileResource','destroy','error','stack','name','send','index','map','Campaign','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','include','findAll','rows','catch','show','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','includeAll','createdAt','body','omit','updatedAt','UserProfileSection'];(function(_0x212577,_0x3826ca){var _0xccb36b=function(_0x1ae7a3){while(--_0x1ae7a3){_0x212577['push'](_0x212577['shift']());}};_0xccb36b(++_0x3826ca);}(_0x5e49,0x152));var _0x95e4=function(_0x1b2704,_0x345e20){_0x1b2704=_0x1b2704-0x0;var _0x4e3e41=_0x5e49[_0x1b2704];return _0x4e3e41;};'use strict';var emlformat=require(_0x95e4('0x0'));var rimraf=require(_0x95e4('0x1'));var zipdir=require(_0x95e4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x95e4('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x95e4('0x4'));var util=require(_0x95e4('0x5'));var path=require('path');var sox=require(_0x95e4('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x95e4('0x7'));var squel=require(_0x95e4('0x8'));var crypto=require(_0x95e4('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x95e4('0xa'));var querystring=require(_0x95e4('0xb'));var Papa=require(_0x95e4('0xc'));var Redis=require(_0x95e4('0xd'));var authService=require(_0x95e4('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x95e4('0xf'));var hardwareService=require(_0x95e4('0x10'));var logger=require(_0x95e4('0x11'))('api');var utils=require(_0x95e4('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x95e4('0x13'));var db=require(_0x95e4('0x14'))['db'];function respondWithStatusCode(_0x7744c,_0x5cec3e){_0x5cec3e=_0x5cec3e||0xcc;return function(_0x1c2faa){if(_0x1c2faa){return _0x7744c[_0x95e4('0x15')](_0x5cec3e);}return _0x7744c[_0x95e4('0x16')](_0x5cec3e)[_0x95e4('0x17')]();};}function respondWithResult(_0x471429,_0x24d17c){_0x24d17c=_0x24d17c||0xc8;return function(_0x4c3d40){if(_0x4c3d40){return _0x471429['status'](_0x24d17c)[_0x95e4('0x18')](_0x4c3d40);}};}function respondWithFilteredResult(_0x5a96f2,_0xa70bb7){return function(_0x264d7e){if(_0x264d7e){var _0x2da6d0=typeof _0xa70bb7[_0x95e4('0x19')]==='undefined'&&typeof _0xa70bb7[_0x95e4('0x1a')]===_0x95e4('0x1b');var _0x550ccc=_0x264d7e[_0x95e4('0x1c')];var _0x38e928=_0x2da6d0?0x0:_0xa70bb7[_0x95e4('0x19')];var _0x438e04=_0x2da6d0?_0x264d7e[_0x95e4('0x1c')]:_0xa70bb7[_0x95e4('0x19')]+_0xa70bb7[_0x95e4('0x1a')];var _0x2369b3;if(_0x438e04>=_0x550ccc){_0x438e04=_0x550ccc;_0x2369b3=0xc8;}else{_0x2369b3=0xce;}_0x5a96f2['status'](_0x2369b3);return _0x5a96f2[_0x95e4('0x1d')](_0x95e4('0x1e'),_0x38e928+'-'+_0x438e04+'/'+_0x550ccc)[_0x95e4('0x18')](_0x264d7e);}return null;};}function patchUpdates(_0x39b060){return function(_0x98eacd){try{jsonpatch['apply'](_0x98eacd,_0x39b060,!![]);}catch(_0x4eeb73){return BPromise[_0x95e4('0x1f')](_0x4eeb73);}return _0x98eacd['save']();};}function saveUpdates(_0x2d15ab,_0x15628c){return function(_0x5f06b1){if(_0x5f06b1){return _0x5f06b1[_0x95e4('0x20')](_0x2d15ab)['then'](function(_0x24f041){return _0x24f041;});}return null;};}function removeEntity(_0x169b01,_0x1b1009){return function(_0x7a624b){if(_0x7a624b){return _0x7a624b['destroy']()[_0x95e4('0x21')](function(){var _0x251f0b=_0x7a624b[_0x95e4('0x22')]({'plain':!![]});var _0x280230=_0x95e4('0x23');return db[_0x95e4('0x24')][_0x95e4('0x25')]({'where':{'type':_0x280230,'resourceId':_0x251f0b['id']}})['then'](function(){return _0x7a624b;});})[_0x95e4('0x21')](function(){_0x169b01[_0x95e4('0x16')](0xcc)[_0x95e4('0x17')]();});}};}function handleEntityNotFound(_0x3d566d,_0x1e4a04){return function(_0x281bbc){if(!_0x281bbc){_0x3d566d['sendStatus'](0x194);}return _0x281bbc;};}function handleError(_0x151ccb,_0x2782d9){_0x2782d9=_0x2782d9||0x1f4;return function(_0x7c445a){logger[_0x95e4('0x26')](_0x7c445a[_0x95e4('0x27')]);if(_0x7c445a[_0x95e4('0x28')]){delete _0x7c445a[_0x95e4('0x28')];}_0x151ccb[_0x95e4('0x16')](_0x2782d9)[_0x95e4('0x29')](_0x7c445a);};}exports[_0x95e4('0x2a')]=function(_0x5a6c47,_0x3c6d05){var _0x18ee61={},_0x374c92={},_0x53d403={'count':0x0,'rows':[]};var _0x28c0f0=_[_0x95e4('0x2b')](db[_0x95e4('0x2c')][_0x95e4('0x2d')],function(_0xe70192){return{'name':_0xe70192[_0x95e4('0x2e')],'type':_0xe70192[_0x95e4('0x2f')]['key']};});_0x374c92[_0x95e4('0x30')]=_[_0x95e4('0x2b')](_0x28c0f0,_0x95e4('0x28'));_0x374c92['query']=_[_0x95e4('0x31')](_0x5a6c47[_0x95e4('0x32')]);_0x374c92[_0x95e4('0x33')]=_[_0x95e4('0x34')](_0x374c92[_0x95e4('0x30')],_0x374c92[_0x95e4('0x32')]);_0x18ee61[_0x95e4('0x35')]=_['intersection'](_0x374c92[_0x95e4('0x30')],qs[_0x95e4('0x36')](_0x5a6c47[_0x95e4('0x32')][_0x95e4('0x36')]));_0x18ee61[_0x95e4('0x35')]=_0x18ee61['attributes'][_0x95e4('0x37')]?_0x18ee61[_0x95e4('0x35')]:_0x374c92[_0x95e4('0x30')];if(!_0x5a6c47['query'][_0x95e4('0x38')](_0x95e4('0x39'))){_0x18ee61['limit']=qs[_0x95e4('0x1a')](_0x5a6c47[_0x95e4('0x32')]['limit']);_0x18ee61[_0x95e4('0x19')]=qs[_0x95e4('0x19')](_0x5a6c47[_0x95e4('0x32')]['offset']);}_0x18ee61[_0x95e4('0x3a')]=qs[_0x95e4('0x3b')](_0x5a6c47[_0x95e4('0x32')][_0x95e4('0x3b')]);_0x18ee61[_0x95e4('0x3c')]=qs[_0x95e4('0x33')](_[_0x95e4('0x3d')](_0x5a6c47['query'],_0x374c92[_0x95e4('0x33')]),_0x28c0f0);if(_0x5a6c47['query']['filter']){_0x18ee61['where']=_[_0x95e4('0x3e')](_0x18ee61['where'],{'$or':_['map'](_0x28c0f0,function(_0x2eeb89){if(_0x2eeb89[_0x95e4('0x2f')]!=='VIRTUAL'){var _0x4b3631={};_0x4b3631[_0x2eeb89[_0x95e4('0x28')]]={'$like':'%'+_0x5a6c47[_0x95e4('0x32')][_0x95e4('0x3f')]+'%'};return _0x4b3631;}})});}_0x18ee61=_[_0x95e4('0x3e')]({},_0x18ee61,_0x5a6c47[_0x95e4('0x40')]);var _0x5f5b5a={'where':_0x18ee61[_0x95e4('0x3c')]};return db[_0x95e4('0x2c')][_0x95e4('0x1c')](_0x5f5b5a)[_0x95e4('0x21')](function(_0x198869){_0x53d403[_0x95e4('0x1c')]=_0x198869;if(_0x5a6c47[_0x95e4('0x32')]['includeAll']){_0x18ee61[_0x95e4('0x41')]=[{'all':!![]}];}return db['Campaign'][_0x95e4('0x42')](_0x18ee61);})[_0x95e4('0x21')](function(_0x52f83f){_0x53d403[_0x95e4('0x43')]=_0x52f83f;return _0x53d403;})[_0x95e4('0x21')](respondWithFilteredResult(_0x3c6d05,_0x18ee61))[_0x95e4('0x44')](handleError(_0x3c6d05,null));};exports[_0x95e4('0x45')]=function(_0x437470,_0x1dfa39){var _0x1c4160={'raw':![],'where':{'id':_0x437470['params']['id']}},_0x13129a={};_0x13129a[_0x95e4('0x30')]=_[_0x95e4('0x31')](db[_0x95e4('0x2c')][_0x95e4('0x2d')]);_0x13129a['query']=_[_0x95e4('0x31')](_0x437470[_0x95e4('0x32')]);_0x13129a[_0x95e4('0x33')]=_[_0x95e4('0x34')](_0x13129a[_0x95e4('0x30')],_0x13129a['query']);_0x1c4160[_0x95e4('0x35')]=_[_0x95e4('0x34')](_0x13129a['model'],qs[_0x95e4('0x36')](_0x437470[_0x95e4('0x32')][_0x95e4('0x36')]));_0x1c4160['attributes']=_0x1c4160['attributes'][_0x95e4('0x37')]?_0x1c4160['attributes']:_0x13129a['model'];if(_0x437470[_0x95e4('0x32')]['includeAll']){_0x1c4160[_0x95e4('0x41')]=[{'all':!![]}];}_0x1c4160=_['merge']({},_0x1c4160,_0x437470['options']);return db[_0x95e4('0x2c')][_0x95e4('0x46')](_0x1c4160)[_0x95e4('0x21')](handleEntityNotFound(_0x1dfa39,null))['then'](respondWithResult(_0x1dfa39,null))['catch'](handleError(_0x1dfa39,null));};exports[_0x95e4('0x47')]=function(_0x1186ba,_0x1e269d){return db[_0x95e4('0x2c')][_0x95e4('0x47')](_0x1186ba['body'],{})[_0x95e4('0x21')](function(_0xf90e5b){var _0xc1ceb4=_0x1186ba['user'][_0x95e4('0x22')]({'plain':!![]});if(!_0xc1ceb4)throw new Error(_0x95e4('0x48'));if(_0xc1ceb4[_0x95e4('0x49')]===_0x95e4('0x4a')){var _0x24a46a=_0xf90e5b[_0x95e4('0x22')]({'plain':!![]});var _0x59440c=_0x95e4('0x23');return db['UserProfileSection'][_0x95e4('0x46')]({'where':{'name':_0x59440c,'userProfileId':_0xc1ceb4['userProfileId']},'raw':!![]})[_0x95e4('0x21')](function(_0x5d6283){if(_0x5d6283&&_0x5d6283[_0x95e4('0x4b')]===0x0){return db[_0x95e4('0x24')][_0x95e4('0x47')]({'name':_0x24a46a['name'],'resourceId':_0x24a46a['id'],'type':_0x5d6283[_0x95e4('0x28')],'sectionId':_0x5d6283['id']},{})[_0x95e4('0x21')](function(){return _0xf90e5b;});}else{return _0xf90e5b;}})['catch'](function(_0x3df80a){logger['error'](_0x95e4('0x4c'),_0x3df80a);throw _0x3df80a;});}return _0xf90e5b;})[_0x95e4('0x21')](respondWithResult(_0x1e269d,0xc9))[_0x95e4('0x44')](handleError(_0x1e269d,null));};exports[_0x95e4('0x4d')]=function(_0x3bf893,_0x5ba4ea){var _0x2fbb73={'where':{'id':_0x3bf893[_0x95e4('0x4e')]['id']}},_0xd34b7f={};_0xd34b7f[_0x95e4('0x30')]=_[_0x95e4('0x31')](db['Campaign'][_0x95e4('0x2d')]);_0x2fbb73['attributes']=_['intersection'](_0xd34b7f[_0x95e4('0x30')],qs[_0x95e4('0x36')](_0x3bf893[_0x95e4('0x32')][_0x95e4('0x36')]));_0x2fbb73[_0x95e4('0x35')]=_0x2fbb73[_0x95e4('0x35')][_0x95e4('0x37')]?_0x2fbb73['attributes']:_0xd34b7f[_0x95e4('0x30')];if(_0x3bf893['query'][_0x95e4('0x4f')]){_0x2fbb73['include']=[{'all':!![]}];}_0x2fbb73=_[_0x95e4('0x3e')]({},_0x2fbb73,_0x3bf893[_0x95e4('0x40')]);return db[_0x95e4('0x2c')][_0x95e4('0x46')](_0x2fbb73)[_0x95e4('0x21')](handleEntityNotFound(_0x5ba4ea,null))[_0x95e4('0x21')](function(_0x4c65b7){if(_0x4c65b7){var _0x123601=_0x4c65b7[_0x95e4('0x22')]({'plain':!![]});_0x123601=qs['omit'](_0x123601,['id',_0x95e4('0x50'),'updatedAt']);_0x3bf893[_0x95e4('0x51')]=_[_0x95e4('0x52')](_0x3bf893[_0x95e4('0x51')],['id',_0x95e4('0x50'),_0x95e4('0x53')]);return db[_0x95e4('0x2c')][_0x95e4('0x47')](_['merge'](_0x123601,_0x3bf893[_0x95e4('0x51')]),{'include':_0x3bf893[_0x95e4('0x32')][_0x95e4('0x4f')]?[{'all':!![]}]:undefined})[_0x95e4('0x21')](function(_0x5c8ec0){var _0x4e2f82=_0x3bf893[_0x95e4('0x4a')][_0x95e4('0x22')]({'plain':!![]});if(!_0x4e2f82)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4e2f82['role']==='user'){var _0x398207=_0x5c8ec0[_0x95e4('0x22')]({'plain':!![]});var _0x529a89='IvrCampaigns';return db[_0x95e4('0x54')][_0x95e4('0x46')]({'where':{'name':_0x529a89,'userProfileId':_0x4e2f82[_0x95e4('0x55')]},'raw':!![]})[_0x95e4('0x21')](function(_0x2ee11a){if(_0x2ee11a&&_0x2ee11a[_0x95e4('0x4b')]===0x0){return db['UserProfileResource'][_0x95e4('0x47')]({'name':_0x398207[_0x95e4('0x28')],'resourceId':_0x398207['id'],'type':_0x2ee11a[_0x95e4('0x28')],'sectionId':_0x2ee11a['id']},{})[_0x95e4('0x21')](function(){return _0x5c8ec0;});}else{return _0x5c8ec0;}})['catch'](function(_0x5c1d9a){logger[_0x95e4('0x26')](_0x95e4('0x4c'),_0x5c1d9a);throw _0x5c1d9a;});}return _0x5c8ec0;});}})[_0x95e4('0x21')](respondWithResult(_0x5ba4ea,0xc9))[_0x95e4('0x44')](handleError(_0x5ba4ea,null));};exports[_0x95e4('0x20')]=function(_0x104026,_0x47b4d6){if(_0x104026[_0x95e4('0x51')]['id']){delete _0x104026[_0x95e4('0x51')]['id'];}return db[_0x95e4('0x2c')][_0x95e4('0x46')]({'where':{'id':_0x104026['params']['id']}})[_0x95e4('0x21')](handleEntityNotFound(_0x47b4d6,null))[_0x95e4('0x21')](saveUpdates(_0x104026[_0x95e4('0x51')],null))[_0x95e4('0x21')](respondWithResult(_0x47b4d6,null))[_0x95e4('0x44')](handleError(_0x47b4d6,null));};exports[_0x95e4('0x25')]=function(_0x97d441,_0x548269){return db[_0x95e4('0x2c')][_0x95e4('0x46')]({'where':{'id':_0x97d441[_0x95e4('0x4e')]['id']}})[_0x95e4('0x21')](handleEntityNotFound(_0x548269,null))['then'](removeEntity(_0x548269,null))['catch'](handleError(_0x548269,null));};exports[_0x95e4('0x56')]=function(_0x5bbfbe,_0x3694d4,_0x40c42f){var _0x4d365a={'raw':!![],'where':{}};var _0x58ad27={};var _0x3dfa42={'count':0x0,'rows':[]};return db[_0x95e4('0x2c')][_0x95e4('0x57')]({'where':{'id':_0x5bbfbe[_0x95e4('0x4e')]['id']}})[_0x95e4('0x21')](handleEntityNotFound(_0x3694d4,null))[_0x95e4('0x21')](function(_0x14dabc){if(_0x14dabc){_0x58ad27[_0x95e4('0x30')]=_[_0x95e4('0x31')](db[_0x95e4('0x58')]['rawAttributes']);_0x58ad27['query']=_[_0x95e4('0x31')](_0x5bbfbe[_0x95e4('0x32')]);_0x58ad27[_0x95e4('0x33')]=_[_0x95e4('0x34')](_0x58ad27[_0x95e4('0x30')],_0x58ad27['query']);_0x4d365a[_0x95e4('0x35')]=_[_0x95e4('0x34')](_0x58ad27[_0x95e4('0x30')],qs[_0x95e4('0x36')](_0x5bbfbe['query'][_0x95e4('0x36')]));_0x4d365a[_0x95e4('0x35')]=_0x4d365a[_0x95e4('0x35')][_0x95e4('0x37')]?_0x4d365a[_0x95e4('0x35')]:_0x58ad27[_0x95e4('0x30')];if(!_0x5bbfbe[_0x95e4('0x32')][_0x95e4('0x38')](_0x95e4('0x39'))){_0x4d365a[_0x95e4('0x1a')]=qs['limit'](_0x5bbfbe[_0x95e4('0x32')]['limit']);_0x4d365a[_0x95e4('0x19')]=qs[_0x95e4('0x19')](_0x5bbfbe['query'][_0x95e4('0x19')]);}_0x4d365a['order']=qs[_0x95e4('0x3b')](_0x5bbfbe[_0x95e4('0x32')][_0x95e4('0x3b')]);_0x4d365a[_0x95e4('0x3c')]=qs[_0x95e4('0x33')](_[_0x95e4('0x3d')](_0x5bbfbe['query'],_0x58ad27[_0x95e4('0x33')]));_0x4d365a[_0x95e4('0x3c')][_0x95e4('0x59')]=_0x14dabc['id'];if(_0x5bbfbe[_0x95e4('0x32')][_0x95e4('0x3f')]){_0x4d365a[_0x95e4('0x3c')]=_[_0x95e4('0x3e')](_0x4d365a[_0x95e4('0x3c')],{'$or':_['map'](_0x4d365a[_0x95e4('0x35')],function(_0x3bfd72){var _0x30ccf0={};_0x30ccf0[_0x3bfd72]={'$like':'%'+_0x5bbfbe[_0x95e4('0x32')]['filter']+'%'};return _0x30ccf0;})});}_0x4d365a=_[_0x95e4('0x3e')]({},_0x4d365a,_0x5bbfbe['options']);return db['CmHopper']['count']({'where':_0x4d365a[_0x95e4('0x3c')]})[_0x95e4('0x21')](function(_0x78c143){_0x3dfa42['count']=_0x78c143;if(_0x5bbfbe['query'][_0x95e4('0x4f')]){_0x4d365a[_0x95e4('0x41')]=[{'all':!![]}];}return db[_0x95e4('0x58')]['findAll'](_0x4d365a);})[_0x95e4('0x21')](function(_0x3c2c28){_0x3dfa42[_0x95e4('0x43')]=_0x3c2c28;return _0x3dfa42;});}})['then'](respondWithFilteredResult(_0x3694d4,_0x4d365a))['catch'](handleError(_0x3694d4,null));};exports[_0x95e4('0x5a')]=function(_0x58c46b,_0x552925,_0x168d45){var _0x39edf8={'raw':!![],'where':{}};var _0x383d60={};var _0x34a289={'count':0x0,'rows':[]};return db[_0x95e4('0x2c')][_0x95e4('0x57')]({'where':{'id':_0x58c46b[_0x95e4('0x4e')]['id']}})[_0x95e4('0x21')](handleEntityNotFound(_0x552925,null))[_0x95e4('0x21')](function(_0x43280d){if(_0x43280d){_0x383d60[_0x95e4('0x30')]=_[_0x95e4('0x31')](db[_0x95e4('0x5b')][_0x95e4('0x2d')]);_0x383d60[_0x95e4('0x32')]=_[_0x95e4('0x31')](_0x58c46b[_0x95e4('0x32')]);_0x383d60[_0x95e4('0x33')]=_['intersection'](_0x383d60[_0x95e4('0x30')],_0x383d60[_0x95e4('0x32')]);_0x39edf8['attributes']=_[_0x95e4('0x34')](_0x383d60[_0x95e4('0x30')],qs[_0x95e4('0x36')](_0x58c46b['query'][_0x95e4('0x36')]));_0x39edf8[_0x95e4('0x35')]=_0x39edf8[_0x95e4('0x35')]['length']?_0x39edf8[_0x95e4('0x35')]:_0x383d60['model'];if(!_0x58c46b['query'][_0x95e4('0x38')](_0x95e4('0x39'))){_0x39edf8[_0x95e4('0x1a')]=qs[_0x95e4('0x1a')](_0x58c46b[_0x95e4('0x32')][_0x95e4('0x1a')]);_0x39edf8[_0x95e4('0x19')]=qs[_0x95e4('0x19')](_0x58c46b[_0x95e4('0x32')][_0x95e4('0x19')]);}_0x39edf8[_0x95e4('0x3a')]=qs[_0x95e4('0x3b')](_0x58c46b['query'][_0x95e4('0x3b')]);_0x39edf8[_0x95e4('0x3c')]=qs['filters'](_['pick'](_0x58c46b['query'],_0x383d60[_0x95e4('0x33')]));_0x39edf8['where'][_0x95e4('0x59')]=_0x43280d['id'];if(_0x58c46b[_0x95e4('0x32')]['filter']){_0x39edf8[_0x95e4('0x3c')]=_[_0x95e4('0x3e')](_0x39edf8[_0x95e4('0x3c')],{'$or':_[_0x95e4('0x2b')](_0x39edf8['attributes'],function(_0x1df0b3){var _0x2f1581={};_0x2f1581[_0x1df0b3]={'$like':'%'+_0x58c46b[_0x95e4('0x32')][_0x95e4('0x3f')]+'%'};return _0x2f1581;})});}_0x39edf8=_[_0x95e4('0x3e')]({},_0x39edf8,_0x58c46b[_0x95e4('0x40')]);return db[_0x95e4('0x5b')][_0x95e4('0x1c')]({'where':_0x39edf8[_0x95e4('0x3c')]})['then'](function(_0x5a05ab){_0x34a289['count']=_0x5a05ab;if(_0x58c46b[_0x95e4('0x32')][_0x95e4('0x4f')]){_0x39edf8[_0x95e4('0x41')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x95e4('0x42')](_0x39edf8);})[_0x95e4('0x21')](function(_0x511471){_0x34a289[_0x95e4('0x43')]=_0x511471;return _0x34a289;});}})['then'](respondWithFilteredResult(_0x552925,_0x39edf8))[_0x95e4('0x44')](handleError(_0x552925,null));};exports[_0x95e4('0x5c')]=function(_0x734e9f,_0x98f744,_0x59dfd9){var _0x345921={'raw':!![],'where':{}};var _0x4a6e90={};var _0x1c276e={'count':0x0,'rows':[]};return db[_0x95e4('0x2c')][_0x95e4('0x57')]({'where':{'id':_0x734e9f[_0x95e4('0x4e')]['id']}})[_0x95e4('0x21')](handleEntityNotFound(_0x98f744,null))['then'](function(_0x37c3a1){if(_0x37c3a1){_0x4a6e90['model']=_[_0x95e4('0x31')](db[_0x95e4('0x5d')]['rawAttributes']);_0x4a6e90[_0x95e4('0x32')]=_['keys'](_0x734e9f[_0x95e4('0x32')]);_0x4a6e90['filters']=_[_0x95e4('0x34')](_0x4a6e90[_0x95e4('0x30')],_0x4a6e90['query']);_0x345921[_0x95e4('0x35')]=_[_0x95e4('0x34')](_0x4a6e90[_0x95e4('0x30')],qs[_0x95e4('0x36')](_0x734e9f[_0x95e4('0x32')][_0x95e4('0x36')]));_0x345921['attributes']=_0x345921[_0x95e4('0x35')][_0x95e4('0x37')]?_0x345921[_0x95e4('0x35')]:_0x4a6e90[_0x95e4('0x30')];if(!_0x734e9f[_0x95e4('0x32')][_0x95e4('0x38')](_0x95e4('0x39'))){_0x345921[_0x95e4('0x1a')]=qs['limit'](_0x734e9f[_0x95e4('0x32')][_0x95e4('0x1a')]);_0x345921[_0x95e4('0x19')]=qs['offset'](_0x734e9f[_0x95e4('0x32')][_0x95e4('0x19')]);}_0x345921[_0x95e4('0x3a')]=qs[_0x95e4('0x3b')](_0x734e9f[_0x95e4('0x32')][_0x95e4('0x3b')]);_0x345921[_0x95e4('0x3c')]=qs[_0x95e4('0x33')](_[_0x95e4('0x3d')](_0x734e9f['query'],_0x4a6e90[_0x95e4('0x33')]));_0x345921[_0x95e4('0x3c')][_0x95e4('0x59')]=_0x37c3a1['id'];if(_0x734e9f['query']['filter']){_0x345921[_0x95e4('0x3c')]=_['merge'](_0x345921[_0x95e4('0x3c')],{'$or':_[_0x95e4('0x2b')](_0x345921[_0x95e4('0x35')],function(_0x2527ef){var _0x56afab={};_0x56afab[_0x2527ef]={'$like':'%'+_0x734e9f[_0x95e4('0x32')][_0x95e4('0x3f')]+'%'};return _0x56afab;})});}_0x345921=_[_0x95e4('0x3e')]({},_0x345921,_0x734e9f[_0x95e4('0x40')]);return db['CmHopperFinal'][_0x95e4('0x1c')]({'where':_0x345921[_0x95e4('0x3c')]})['then'](function(_0x3b704f){_0x1c276e[_0x95e4('0x1c')]=_0x3b704f;if(_0x734e9f[_0x95e4('0x32')][_0x95e4('0x4f')]){_0x345921[_0x95e4('0x41')]=[{'all':!![]}];}return db[_0x95e4('0x5d')]['findAll'](_0x345921);})[_0x95e4('0x21')](function(_0x45f5af){_0x1c276e[_0x95e4('0x43')]=_0x45f5af;return _0x1c276e;});}})[_0x95e4('0x21')](respondWithFilteredResult(_0x98f744,_0x345921))[_0x95e4('0x44')](handleError(_0x98f744,null));};exports[_0x95e4('0x5e')]=function(_0x4f9888,_0x2e0efc,_0x6910f3){var _0x130697={'raw':!![],'where':{}};var _0x47c4ef={};var _0x9b9f37={'count':0x0,'rows':[]};return db['Campaign'][_0x95e4('0x57')]({'where':{'id':_0x4f9888[_0x95e4('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2e0efc,null))[_0x95e4('0x21')](function(_0x212eea){if(_0x212eea){_0x47c4ef[_0x95e4('0x30')]=_[_0x95e4('0x31')](db['CmHopperBlack'][_0x95e4('0x2d')]);_0x47c4ef[_0x95e4('0x32')]=_['keys'](_0x4f9888[_0x95e4('0x32')]);_0x47c4ef[_0x95e4('0x33')]=_[_0x95e4('0x34')](_0x47c4ef[_0x95e4('0x30')],_0x47c4ef[_0x95e4('0x32')]);_0x130697['attributes']=_['intersection'](_0x47c4ef[_0x95e4('0x30')],qs[_0x95e4('0x36')](_0x4f9888['query'][_0x95e4('0x36')]));_0x130697[_0x95e4('0x35')]=_0x130697[_0x95e4('0x35')][_0x95e4('0x37')]?_0x130697['attributes']:_0x47c4ef['model'];if(!_0x4f9888[_0x95e4('0x32')][_0x95e4('0x38')]('nolimit')){_0x130697[_0x95e4('0x1a')]=qs[_0x95e4('0x1a')](_0x4f9888[_0x95e4('0x32')][_0x95e4('0x1a')]);_0x130697['offset']=qs['offset'](_0x4f9888[_0x95e4('0x32')][_0x95e4('0x19')]);}_0x130697['order']=qs['sort'](_0x4f9888[_0x95e4('0x32')][_0x95e4('0x3b')]);_0x130697[_0x95e4('0x3c')]=qs[_0x95e4('0x33')](_[_0x95e4('0x3d')](_0x4f9888['query'],_0x47c4ef[_0x95e4('0x33')]));_0x130697[_0x95e4('0x3c')][_0x95e4('0x59')]=_0x212eea['id'];if(_0x4f9888[_0x95e4('0x32')]['filter']){_0x130697['where']=_['merge'](_0x130697[_0x95e4('0x3c')],{'$or':_[_0x95e4('0x2b')](_0x130697[_0x95e4('0x35')],function(_0x1af6bd){var _0x486cfd={};_0x486cfd[_0x1af6bd]={'$like':'%'+_0x4f9888[_0x95e4('0x32')][_0x95e4('0x3f')]+'%'};return _0x486cfd;})});}_0x130697=_[_0x95e4('0x3e')]({},_0x130697,_0x4f9888[_0x95e4('0x40')]);return db[_0x95e4('0x5f')][_0x95e4('0x1c')]({'where':_0x130697[_0x95e4('0x3c')]})[_0x95e4('0x21')](function(_0xf921fe){_0x9b9f37[_0x95e4('0x1c')]=_0xf921fe;if(_0x4f9888[_0x95e4('0x32')][_0x95e4('0x4f')]){_0x130697[_0x95e4('0x41')]=[{'all':!![]}];}return db[_0x95e4('0x5f')]['findAll'](_0x130697);})[_0x95e4('0x21')](function(_0x5085eb){_0x9b9f37[_0x95e4('0x43')]=_0x5085eb;return _0x9b9f37;});}})[_0x95e4('0x21')](respondWithFilteredResult(_0x2e0efc,_0x130697))['catch'](handleError(_0x2e0efc,null));};exports[_0x95e4('0x60')]=function(_0x140e5b,_0x50ad9c,_0x349eda){var _0x89243e={};var _0x3a67ce={};var _0xbdb79;var _0x4101cc;return db[_0x95e4('0x2c')][_0x95e4('0x57')]({'where':{'id':_0x140e5b['params']['id']}})[_0x95e4('0x21')](handleEntityNotFound(_0x50ad9c,null))[_0x95e4('0x21')](function(_0x5eae32){if(_0x5eae32){_0xbdb79=_0x5eae32;_0x3a67ce[_0x95e4('0x30')]=_[_0x95e4('0x31')](db[_0x95e4('0x61')][_0x95e4('0x2d')]);_0x3a67ce[_0x95e4('0x32')]=_['keys'](_0x140e5b[_0x95e4('0x32')]);_0x3a67ce[_0x95e4('0x33')]=_[_0x95e4('0x34')](_0x3a67ce['model'],_0x3a67ce[_0x95e4('0x32')]);_0x89243e[_0x95e4('0x35')]=_[_0x95e4('0x34')](_0x3a67ce[_0x95e4('0x30')],qs[_0x95e4('0x36')](_0x140e5b[_0x95e4('0x32')][_0x95e4('0x36')]));_0x89243e[_0x95e4('0x35')]=_0x89243e['attributes'][_0x95e4('0x37')]?_0x89243e[_0x95e4('0x35')]:_0x3a67ce[_0x95e4('0x30')];_0x89243e['order']=qs[_0x95e4('0x3b')](_0x140e5b[_0x95e4('0x32')]['sort']);_0x89243e[_0x95e4('0x3c')]=qs[_0x95e4('0x33')](_[_0x95e4('0x3d')](_0x140e5b[_0x95e4('0x32')],_0x3a67ce[_0x95e4('0x33')]));if(_0x140e5b[_0x95e4('0x32')][_0x95e4('0x3f')]){_0x89243e[_0x95e4('0x3c')]=_[_0x95e4('0x3e')](_0x89243e[_0x95e4('0x3c')],{'$or':_[_0x95e4('0x2b')](_0x89243e[_0x95e4('0x35')],function(_0x42e293){var _0x97c060={};_0x97c060[_0x42e293]={'$like':'%'+_0x140e5b['query'][_0x95e4('0x3f')]+'%'};return _0x97c060;})});}_0x89243e=_['merge']({},_0x89243e,_0x140e5b['options']);return _0xbdb79[_0x95e4('0x60')](_0x89243e);}})['then'](function(_0x2647cd){if(_0x2647cd){_0x4101cc=_0x2647cd[_0x95e4('0x37')];if(!_0x140e5b[_0x95e4('0x32')][_0x95e4('0x38')](_0x95e4('0x39'))){_0x89243e[_0x95e4('0x1a')]=qs[_0x95e4('0x1a')](_0x140e5b['query'][_0x95e4('0x1a')]);_0x89243e[_0x95e4('0x19')]=qs['offset'](_0x140e5b[_0x95e4('0x32')][_0x95e4('0x19')]);}return _0xbdb79[_0x95e4('0x60')](_0x89243e);}})[_0x95e4('0x21')](function(_0x5c420e){if(_0x5c420e){return _0x5c420e?{'count':_0x4101cc,'rows':_0x5c420e}:null;}})['then'](respondWithResult(_0x50ad9c,null))[_0x95e4('0x44')](handleError(_0x50ad9c,null));};exports[_0x95e4('0x62')]=function(_0x54e6d5,_0x36cfa3,_0x63297c){var _0x3ac9c7,_0x543f02;var _0x28a5aa=[];var _0x3e56b1=moment()[_0x95e4('0x63')](_0x95e4('0x64'));return db[_0x95e4('0x2c')][_0x95e4('0x46')]({'where':{'id':_0x54e6d5[_0x95e4('0x4e')]['id']}})[_0x95e4('0x21')](handleEntityNotFound(_0x36cfa3,null))[_0x95e4('0x21')](function(_0x412536){if(_0x412536){_0x543f02=_0x412536;return _0x412536['addLists'](_0x54e6d5[_0x95e4('0x51')]['ids'],_[_0x95e4('0x52')](_0x54e6d5[_0x95e4('0x51')],[_0x95e4('0x65'),'id'])||{});}return null;})[_0x95e4('0x66')](function(_0x160908){var _0x18af88;var _0x3386fa;_0x3ac9c7=_0x160908||[];var _0x383d90=[];if(_0x160908){for(var _0x3fa31b=0x0;_0x3fa31b<_0x160908[_0x95e4('0x37')];_0x3fa31b+=0x1){var _0x185e7b=_0x160908[_0x3fa31b][_0x95e4('0x22')]({'plain':!![]});_0x543f02[_0x95e4('0x67')]=_0x54e6d5[_0x95e4('0x51')][_0x95e4('0x67')]?_0x54e6d5['body'][_0x95e4('0x67')]:_0x543f02[_0x95e4('0x67')];switch(_0x543f02[_0x95e4('0x67')]){case _0x95e4('0x68'):_0x18af88=squel[_0x95e4('0x69')]()[_0x95e4('0x6a')](_0x95e4('0x6b'))['fromQuery']([_0x95e4('0x6c'),_0x95e4('0x6d'),_0x95e4('0x6e'),_0x95e4('0x6f'),_0x95e4('0x59'),'createdAt',_0x95e4('0x53')],squel[_0x95e4('0x70')]()[_0x95e4('0x71')](_0x95e4('0x6c'),'phone')[_0x95e4('0x71')](_0x95e4('0x72'),_0x95e4('0x6d'))[_0x95e4('0x71')]('id','ContactId')['field'](_0x185e7b['CmListId']['toString'](),_0x95e4('0x6f'))['field'](_0x54e6d5[_0x95e4('0x4e')]['id']['toString'](),_0x95e4('0x59'))[_0x95e4('0x71')]('\x27'+_0x3e56b1+'\x27',_0x95e4('0x50'))[_0x95e4('0x71')]('\x27'+_0x3e56b1+'\x27',_0x95e4('0x53'))['from'](_0x95e4('0x73'))[_0x95e4('0x3c')](_0x95e4('0x74'))[_0x95e4('0x3c')](_0x95e4('0x75'),_0x185e7b['CmListId']['toString']())[_0x95e4('0x3c')]('phone\x20IS\x20NOT\x20NULL')[_0x95e4('0x3c')](_0x95e4('0x76'),squel[_0x95e4('0x70')]()[_0x95e4('0x71')](_0x95e4('0x77'))[_0x95e4('0x78')](_0x95e4('0x79'))[_0x95e4('0x3c')](_0x95e4('0x7a'),_0x54e6d5[_0x95e4('0x4e')]['id'][_0x95e4('0x7b')]()))[_0x95e4('0x3c')]('phone\x20NOT\x20IN\x20(?)',squel[_0x95e4('0x70')]()[_0x95e4('0x71')](_0x95e4('0x7c'))[_0x95e4('0x78')]('cm_hopper')['where'](_0x95e4('0x7a'),_0x54e6d5['params']['id'][_0x95e4('0x7b')]())))[_0x95e4('0x7b')]();break;case _0x95e4('0x7d'):_0x18af88=squel[_0x95e4('0x69')]()[_0x95e4('0x6a')](_0x95e4('0x6b'))[_0x95e4('0x7e')](['phone',_0x95e4('0x6d'),_0x95e4('0x6e'),_0x95e4('0x6f'),_0x95e4('0x59'),_0x95e4('0x50'),_0x95e4('0x53')],squel[_0x95e4('0x70')]()[_0x95e4('0x71')]('phone',_0x95e4('0x6c'))[_0x95e4('0x71')](_0x95e4('0x72'),'scheduledAt')[_0x95e4('0x71')]('id',_0x95e4('0x6e'))[_0x95e4('0x71')](_0x185e7b['CmListId']['toString'](),_0x95e4('0x6f'))[_0x95e4('0x71')](_0x54e6d5[_0x95e4('0x4e')]['id'][_0x95e4('0x7b')](),_0x95e4('0x59'))[_0x95e4('0x71')]('\x27'+_0x3e56b1+'\x27',_0x95e4('0x50'))[_0x95e4('0x71')]('\x27'+_0x3e56b1+'\x27',_0x95e4('0x53'))[_0x95e4('0x78')](_0x95e4('0x73'))['where'](_0x95e4('0x74'))[_0x95e4('0x3c')](_0x95e4('0x75'),_0x185e7b[_0x95e4('0x7f')][_0x95e4('0x7b')]())['where'](_0x95e4('0x80'))[_0x95e4('0x3c')](_0x95e4('0x76'),squel[_0x95e4('0x70')]()[_0x95e4('0x71')](_0x95e4('0x7c'))['from'](_0x95e4('0x6b'))[_0x95e4('0x3c')](_0x95e4('0x7a'),_0x54e6d5[_0x95e4('0x4e')]['id'][_0x95e4('0x7b')]())))[_0x95e4('0x7b')]();break;default:_0x18af88=squel[_0x95e4('0x69')]()[_0x95e4('0x6a')](_0x95e4('0x6b'))[_0x95e4('0x7e')]([_0x95e4('0x6c'),_0x95e4('0x6d'),_0x95e4('0x6e'),_0x95e4('0x6f'),_0x95e4('0x59'),'createdAt','updatedAt'],squel[_0x95e4('0x70')]()[_0x95e4('0x71')](_0x95e4('0x6c'),_0x95e4('0x6c'))['field'](_0x95e4('0x72'),_0x95e4('0x6d'))[_0x95e4('0x71')]('id',_0x95e4('0x6e'))[_0x95e4('0x71')](_0x185e7b[_0x95e4('0x7f')][_0x95e4('0x7b')](),_0x95e4('0x6f'))[_0x95e4('0x71')](_0x54e6d5[_0x95e4('0x4e')]['id'][_0x95e4('0x7b')](),_0x95e4('0x59'))[_0x95e4('0x71')]('\x27'+_0x3e56b1+'\x27',_0x95e4('0x50'))['field']('\x27'+_0x3e56b1+'\x27','updatedAt')['from'](_0x95e4('0x73'))[_0x95e4('0x3c')](_0x95e4('0x74'))[_0x95e4('0x3c')](_0x95e4('0x75'),_0x185e7b['CmListId']['toString']())[_0x95e4('0x3c')]('phone\x20IS\x20NOT\x20NULL'))[_0x95e4('0x7b')]();}_0x3386fa=squel[_0x95e4('0x69')]()[_0x95e4('0x6a')](_0x95e4('0x81'))['fromQuery']([_0x95e4('0x82'),_0x95e4('0x6d'),'phone','OrderBy',_0x95e4('0x50'),_0x95e4('0x53')],squel['select']()['field'](_0x95e4('0x83'),'id')[_0x95e4('0x71')]('NOW()',_0x95e4('0x6d'))[_0x95e4('0x71')]('ci.item',_0x95e4('0x6c'))[_0x95e4('0x71')](_0x95e4('0x84'),'OrderBy')[_0x95e4('0x71')]('\x27'+_0x3e56b1+'\x27','createdAt')['field']('\x27'+_0x3e56b1+'\x27','updatedAt')[_0x95e4('0x78')]('cm_contact_has_items','ci')['join']('cm_hopper','h',_0x95e4('0x85'))[_0x95e4('0x3c')]('h.ListId\x20=\x20?',_0x185e7b[_0x95e4('0x7f')][_0x95e4('0x7b')]())[_0x95e4('0x3c')]('h.CampaignId=?',_0x54e6d5[_0x95e4('0x4e')]['id']['toString']())[_0x95e4('0x3c')](_0x95e4('0x86'),_0x3e56b1))[_0x95e4('0x7b')]();_0x383d90[_0x95e4('0x87')](db['sequelize'][_0x95e4('0x32')](_0x18af88));_0x28a5aa[_0x95e4('0x87')](db[_0x95e4('0x88')]['query'](_0x3386fa));}return BPromise[_0x95e4('0x89')](_0x383d90);}})[_0x95e4('0x21')](function(){return BPromise[_0x95e4('0x89')](_0x28a5aa);})[_0x95e4('0x21')](function(){return _0x3ac9c7;})[_0x95e4('0x21')](respondWithResult(_0x36cfa3,null))[_0x95e4('0x44')](handleError(_0x36cfa3,null));};exports[_0x95e4('0x8a')]=function(_0x46089c,_0x3e2762,_0xe12c96){return db[_0x95e4('0x2c')][_0x95e4('0x46')]({'where':{'id':_0x46089c[_0x95e4('0x4e')]['id']}})[_0x95e4('0x21')](handleEntityNotFound(_0x3e2762,null))[_0x95e4('0x21')](function(_0x27b0df){if(_0x27b0df){return _0x27b0df[_0x95e4('0x8a')](_0x46089c[_0x95e4('0x32')][_0x95e4('0x65')]);}})[_0x95e4('0x21')](function(_0x2901d6){if(_0x2901d6){return db[_0x95e4('0x58')][_0x95e4('0x25')]({'where':{'ListId':_0x46089c[_0x95e4('0x32')][_0x95e4('0x65')],'CampaignId':_0x46089c[_0x95e4('0x4e')]['id']}})[_0x95e4('0x21')](function(){return _0x2901d6;});}})[_0x95e4('0x21')](respondWithStatusCode(_0x3e2762,null))[_0x95e4('0x44')](handleError(_0x3e2762,null));};exports[_0x95e4('0x8b')]=function(_0x8adba0,_0x43af58,_0x25be13){var _0x52964d={};var _0x30b103={};var _0x581181;var _0x43b1ae;return db[_0x95e4('0x2c')][_0x95e4('0x57')]({'where':{'id':_0x8adba0[_0x95e4('0x4e')]['id']}})[_0x95e4('0x21')](handleEntityNotFound(_0x43af58,null))[_0x95e4('0x21')](function(_0x38859e){if(_0x38859e){_0x581181=_0x38859e;_0x30b103[_0x95e4('0x30')]=_['keys'](db[_0x95e4('0x61')][_0x95e4('0x2d')]);_0x30b103['query']=_[_0x95e4('0x31')](_0x8adba0[_0x95e4('0x32')]);_0x30b103[_0x95e4('0x33')]=_[_0x95e4('0x34')](_0x30b103['model'],_0x30b103['query']);_0x52964d[_0x95e4('0x35')]=_['intersection'](_0x30b103[_0x95e4('0x30')],qs[_0x95e4('0x36')](_0x8adba0[_0x95e4('0x32')][_0x95e4('0x36')]));_0x52964d[_0x95e4('0x35')]=_0x52964d[_0x95e4('0x35')][_0x95e4('0x37')]?_0x52964d[_0x95e4('0x35')]:_0x30b103[_0x95e4('0x30')];_0x52964d[_0x95e4('0x3a')]=qs['sort'](_0x8adba0[_0x95e4('0x32')][_0x95e4('0x3b')]);_0x52964d[_0x95e4('0x3c')]=qs[_0x95e4('0x33')](_['pick'](_0x8adba0[_0x95e4('0x32')],_0x30b103['filters']));if(_0x8adba0[_0x95e4('0x32')][_0x95e4('0x3f')]){_0x52964d[_0x95e4('0x3c')]=_[_0x95e4('0x3e')](_0x52964d['where'],{'$or':_[_0x95e4('0x2b')](_0x52964d['attributes'],function(_0x189b2d){var _0x36a61a={};_0x36a61a[_0x189b2d]={'$like':'%'+_0x8adba0[_0x95e4('0x32')][_0x95e4('0x3f')]+'%'};return _0x36a61a;})});}_0x52964d=_[_0x95e4('0x3e')]({},_0x52964d,_0x8adba0['options']);return _0x581181[_0x95e4('0x8b')](_0x52964d);}})[_0x95e4('0x21')](function(_0x2bf66c){if(_0x2bf66c){_0x43b1ae=_0x2bf66c[_0x95e4('0x37')];if(!_0x8adba0[_0x95e4('0x32')][_0x95e4('0x38')](_0x95e4('0x39'))){_0x52964d[_0x95e4('0x1a')]=qs[_0x95e4('0x1a')](_0x8adba0[_0x95e4('0x32')]['limit']);_0x52964d[_0x95e4('0x19')]=qs[_0x95e4('0x19')](_0x8adba0[_0x95e4('0x32')]['offset']);}return _0x581181['getBlackLists'](_0x52964d);}})[_0x95e4('0x21')](function(_0x3b03d5){if(_0x3b03d5){return _0x3b03d5?{'count':_0x43b1ae,'rows':_0x3b03d5}:null;}})[_0x95e4('0x21')](respondWithResult(_0x43af58,null))[_0x95e4('0x44')](handleError(_0x43af58,null));};exports[_0x95e4('0x8c')]=function(_0x364054,_0x39dbb7,_0x46432e){var _0x1efbbb,_0x57bb95;var _0x2b3ca7=[];var _0xd77dc7=moment()['format'](_0x95e4('0x64'));return db['Campaign']['find']({'where':{'id':_0x364054[_0x95e4('0x4e')]['id']}})[_0x95e4('0x21')](handleEntityNotFound(_0x39dbb7,null))[_0x95e4('0x21')](function(_0x5b9e4c){if(_0x5b9e4c){_0x57bb95=_0x5b9e4c;return _0x5b9e4c[_0x95e4('0x8c')](_0x364054[_0x95e4('0x51')][_0x95e4('0x65')],_['omit'](_0x364054[_0x95e4('0x51')],[_0x95e4('0x65'),'id'])||{});}return null;})['spread'](function(_0x124017){var _0xa012e6;var _0x3b8d1b;_0x1efbbb=_0x124017||[];var _0x56e251=[];if(_0x124017){for(var _0x3480fa=0x0;_0x3480fa<_0x124017[_0x95e4('0x37')];_0x3480fa+=0x1){var _0x55bc79=_0x124017[_0x3480fa][_0x95e4('0x22')]({'plain':!![]});_0xa012e6=squel[_0x95e4('0x69')]()[_0x95e4('0x6a')]('cm_hopper_black')[_0x95e4('0x7e')]([_0x95e4('0x6c'),_0x95e4('0x6e'),_0x95e4('0x6f'),_0x95e4('0x59'),_0x95e4('0x50'),_0x95e4('0x53')],squel[_0x95e4('0x70')]()['field'](_0x95e4('0x6c'),'phone')[_0x95e4('0x71')]('id',_0x95e4('0x6e'))['field'](_0x55bc79[_0x95e4('0x7f')][_0x95e4('0x7b')](),_0x95e4('0x6f'))[_0x95e4('0x71')](_0x364054['params']['id']['toString'](),_0x95e4('0x59'))['field'](_0x95e4('0x72'),'createdAt')[_0x95e4('0x71')](_0x95e4('0x72'),_0x95e4('0x53'))[_0x95e4('0x78')]('cm_contacts')[_0x95e4('0x3c')](_0x95e4('0x74'))[_0x95e4('0x3c')](_0x95e4('0x75'),_0x55bc79[_0x95e4('0x7f')]['toString']())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x95e4('0x7b')]();_0x56e251[_0x95e4('0x87')](db[_0x95e4('0x88')][_0x95e4('0x32')](_0xa012e6));}return BPromise[_0x95e4('0x89')](_0x56e251);}})['then'](function(){return _0x1efbbb;})[_0x95e4('0x21')](respondWithResult(_0x39dbb7,null))[_0x95e4('0x44')](handleError(_0x39dbb7,null));};exports['removeBlackLists']=function(_0x5cc249,_0x1e52eb,_0x36cd7d){return db['Campaign'][_0x95e4('0x46')]({'where':{'id':_0x5cc249[_0x95e4('0x4e')]['id']}})[_0x95e4('0x21')](handleEntityNotFound(_0x1e52eb,null))[_0x95e4('0x21')](function(_0x14c168){if(_0x14c168){return _0x14c168['removeBlackLists'](_0x5cc249[_0x95e4('0x32')][_0x95e4('0x65')]);}})[_0x95e4('0x21')](function(_0x4e08c2){if(_0x4e08c2){return db[_0x95e4('0x5f')][_0x95e4('0x25')]({'where':{'ListId':_0x5cc249[_0x95e4('0x32')][_0x95e4('0x65')],'CampaignId':_0x5cc249[_0x95e4('0x4e')]['id']}})[_0x95e4('0x21')](function(){return _0x4e08c2;});}})[_0x95e4('0x21')](respondWithStatusCode(_0x1e52eb,null))['catch'](handleError(_0x1e52eb,null));};
\ No newline at end of file
+var _0xa5df=['keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','params','includeAll','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','find','createdAt','updatedAt','getHoppers','findOne','CmHopper','CampaignId','CmHopperHistory','hasOwnProperty','findAll','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','omit','dialCheckDuplicateType','into','phone','scheduledAt','ListId','select','field','NOW()','ContactId','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','fromQuery','ListId\x20=\x20?','cm_hopper','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.OrderBY','cm_contact_has_items','join','h.ListId\x20=\x20?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','request-promise','mustache','sox','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','UserProfileResource','destroy','then','error','stack','name','send','index','Campaign','rawAttributes','fieldName','type','key','model','map','query'];(function(_0x2f5272,_0x4cb698){var _0x30b0f9=function(_0x4e81c4){while(--_0x4e81c4){_0x2f5272['push'](_0x2f5272['shift']());}};_0x30b0f9(++_0x4cb698);}(_0xa5df,0xe8));var _0xfa5d=function(_0x16011b,_0x5cbe6c){_0x16011b=_0x16011b-0x0;var _0x3c50f8=_0xa5df[_0x16011b];return _0x3c50f8;};'use strict';var emlformat=require(_0xfa5d('0x0'));var rimraf=require(_0xfa5d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfa5d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xfa5d('0x3'));var util=require('util');var path=require('path');var sox=require(_0xfa5d('0x4'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xfa5d('0x5'));var jsforce=require(_0xfa5d('0x6'));var deskjs=require('desk.js');var toCsv=require(_0xfa5d('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xfa5d('0x8'));var authService=require(_0xfa5d('0x9'));var qs=require(_0xfa5d('0xa'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfa5d('0xb'));var logger=require(_0xfa5d('0xc'))('api');var utils=require(_0xfa5d('0xd'));var config=require(_0xfa5d('0xe'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2edc6d,_0x535c04){_0x535c04=_0x535c04||0xcc;return function(_0x49b6f4){if(_0x49b6f4){return _0x2edc6d[_0xfa5d('0xf')](_0x535c04);}return _0x2edc6d[_0xfa5d('0x10')](_0x535c04)[_0xfa5d('0x11')]();};}function respondWithResult(_0x485d78,_0x5f5ca0){_0x5f5ca0=_0x5f5ca0||0xc8;return function(_0xc9d9db){if(_0xc9d9db){return _0x485d78['status'](_0x5f5ca0)[_0xfa5d('0x12')](_0xc9d9db);}};}function respondWithFilteredResult(_0x1ba120,_0x198272){return function(_0x3b4b91){if(_0x3b4b91){var _0x5eb640=typeof _0x198272[_0xfa5d('0x13')]===_0xfa5d('0x14')&&typeof _0x198272[_0xfa5d('0x15')]===_0xfa5d('0x14');var _0x5595ca=_0x3b4b91[_0xfa5d('0x16')];var _0x5d165f=_0x5eb640?0x0:_0x198272[_0xfa5d('0x13')];var _0x51f9df=_0x5eb640?_0x3b4b91[_0xfa5d('0x16')]:_0x198272[_0xfa5d('0x13')]+_0x198272[_0xfa5d('0x15')];var _0x46f32d;if(_0x51f9df>=_0x5595ca){_0x51f9df=_0x5595ca;_0x46f32d=0xc8;}else{_0x46f32d=0xce;}_0x1ba120[_0xfa5d('0x10')](_0x46f32d);return _0x1ba120[_0xfa5d('0x17')](_0xfa5d('0x18'),_0x5d165f+'-'+_0x51f9df+'/'+_0x5595ca)[_0xfa5d('0x12')](_0x3b4b91);}return null;};}function patchUpdates(_0x14ff29){return function(_0x2a95f8){try{jsonpatch[_0xfa5d('0x19')](_0x2a95f8,_0x14ff29,!![]);}catch(_0x497c0a){return BPromise['reject'](_0x497c0a);}return _0x2a95f8[_0xfa5d('0x1a')]();};}function saveUpdates(_0x534add,_0x47f21e){return function(_0x499071){if(_0x499071){return _0x499071[_0xfa5d('0x1b')](_0x534add)['then'](function(_0x1664f6){return _0x1664f6;});}return null;};}function removeEntity(_0x340b7c,_0x35dc54){return function(_0x51cba2){if(_0x51cba2){return _0x51cba2['destroy']()['then'](function(){var _0x5debcd=_0x51cba2['get']({'plain':!![]});var _0x3550a1='IvrCampaigns';return db[_0xfa5d('0x1c')][_0xfa5d('0x1d')]({'where':{'type':_0x3550a1,'resourceId':_0x5debcd['id']}})['then'](function(){return _0x51cba2;});})[_0xfa5d('0x1e')](function(){_0x340b7c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x128ff4,_0x4b6d11){return function(_0x37d93e){if(!_0x37d93e){_0x128ff4['sendStatus'](0x194);}return _0x37d93e;};}function handleError(_0x57bcfe,_0x5e2345){_0x5e2345=_0x5e2345||0x1f4;return function(_0x117b11){logger[_0xfa5d('0x1f')](_0x117b11[_0xfa5d('0x20')]);if(_0x117b11[_0xfa5d('0x21')]){delete _0x117b11[_0xfa5d('0x21')];}_0x57bcfe[_0xfa5d('0x10')](_0x5e2345)[_0xfa5d('0x22')](_0x117b11);};}exports[_0xfa5d('0x23')]=function(_0x5919b6,_0x20289f){var _0x474c78={},_0x5cce05={},_0x598cbc={'count':0x0,'rows':[]};var _0x2c783f=_['map'](db[_0xfa5d('0x24')][_0xfa5d('0x25')],function(_0x8bffb1){return{'name':_0x8bffb1[_0xfa5d('0x26')],'type':_0x8bffb1[_0xfa5d('0x27')][_0xfa5d('0x28')]};});_0x5cce05[_0xfa5d('0x29')]=_[_0xfa5d('0x2a')](_0x2c783f,_0xfa5d('0x21'));_0x5cce05[_0xfa5d('0x2b')]=_[_0xfa5d('0x2c')](_0x5919b6[_0xfa5d('0x2b')]);_0x5cce05['filters']=_[_0xfa5d('0x2d')](_0x5cce05[_0xfa5d('0x29')],_0x5cce05[_0xfa5d('0x2b')]);_0x474c78[_0xfa5d('0x2e')]=_[_0xfa5d('0x2d')](_0x5cce05[_0xfa5d('0x29')],qs[_0xfa5d('0x2f')](_0x5919b6[_0xfa5d('0x2b')][_0xfa5d('0x2f')]));_0x474c78[_0xfa5d('0x2e')]=_0x474c78[_0xfa5d('0x2e')][_0xfa5d('0x30')]?_0x474c78[_0xfa5d('0x2e')]:_0x5cce05[_0xfa5d('0x29')];if(!_0x5919b6[_0xfa5d('0x2b')]['hasOwnProperty'](_0xfa5d('0x31'))){_0x474c78[_0xfa5d('0x15')]=qs['limit'](_0x5919b6[_0xfa5d('0x2b')]['limit']);_0x474c78[_0xfa5d('0x13')]=qs[_0xfa5d('0x13')](_0x5919b6['query'][_0xfa5d('0x13')]);}_0x474c78[_0xfa5d('0x32')]=qs[_0xfa5d('0x33')](_0x5919b6[_0xfa5d('0x2b')]['sort']);_0x474c78[_0xfa5d('0x34')]=qs[_0xfa5d('0x35')](_[_0xfa5d('0x36')](_0x5919b6['query'],_0x5cce05['filters']),_0x2c783f);if(_0x5919b6[_0xfa5d('0x2b')][_0xfa5d('0x37')]){_0x474c78['where']=_[_0xfa5d('0x38')](_0x474c78['where'],{'$or':_['map'](_0x2c783f,function(_0x211b34){if(_0x211b34['type']!==_0xfa5d('0x39')){var _0x16e99f={};_0x16e99f[_0x211b34['name']]={'$like':'%'+_0x5919b6[_0xfa5d('0x2b')][_0xfa5d('0x37')]+'%'};return _0x16e99f;}})});}_0x474c78=_[_0xfa5d('0x38')]({},_0x474c78,_0x5919b6[_0xfa5d('0x3a')]);var _0x31868d={'where':_0x474c78['where']};return db[_0xfa5d('0x24')][_0xfa5d('0x16')](_0x31868d)[_0xfa5d('0x1e')](function(_0x1970fc){_0x598cbc[_0xfa5d('0x16')]=_0x1970fc;if(_0x5919b6[_0xfa5d('0x2b')]['includeAll']){_0x474c78[_0xfa5d('0x3b')]=[{'all':!![]}];}return db[_0xfa5d('0x24')]['findAll'](_0x474c78);})['then'](function(_0x18bea6){_0x598cbc[_0xfa5d('0x3c')]=_0x18bea6;return _0x598cbc;})[_0xfa5d('0x1e')](respondWithFilteredResult(_0x20289f,_0x474c78))[_0xfa5d('0x3d')](handleError(_0x20289f,null));};exports[_0xfa5d('0x3e')]=function(_0xf817bd,_0x18c42c){var _0xfc8bc9={'raw':![],'where':{'id':_0xf817bd[_0xfa5d('0x3f')]['id']}},_0x53c37a={};_0x53c37a['model']=_[_0xfa5d('0x2c')](db[_0xfa5d('0x24')][_0xfa5d('0x25')]);_0x53c37a[_0xfa5d('0x2b')]=_[_0xfa5d('0x2c')](_0xf817bd[_0xfa5d('0x2b')]);_0x53c37a[_0xfa5d('0x35')]=_[_0xfa5d('0x2d')](_0x53c37a[_0xfa5d('0x29')],_0x53c37a[_0xfa5d('0x2b')]);_0xfc8bc9['attributes']=_[_0xfa5d('0x2d')](_0x53c37a[_0xfa5d('0x29')],qs['fields'](_0xf817bd[_0xfa5d('0x2b')][_0xfa5d('0x2f')]));_0xfc8bc9[_0xfa5d('0x2e')]=_0xfc8bc9[_0xfa5d('0x2e')][_0xfa5d('0x30')]?_0xfc8bc9[_0xfa5d('0x2e')]:_0x53c37a['model'];if(_0xf817bd[_0xfa5d('0x2b')][_0xfa5d('0x40')]){_0xfc8bc9[_0xfa5d('0x3b')]=[{'all':!![]}];}_0xfc8bc9=_[_0xfa5d('0x38')]({},_0xfc8bc9,_0xf817bd[_0xfa5d('0x3a')]);return db[_0xfa5d('0x24')]['find'](_0xfc8bc9)[_0xfa5d('0x1e')](handleEntityNotFound(_0x18c42c,null))[_0xfa5d('0x1e')](respondWithResult(_0x18c42c,null))[_0xfa5d('0x3d')](handleError(_0x18c42c,null));};exports['create']=function(_0x50c5f3,_0x156c1e){return db[_0xfa5d('0x24')][_0xfa5d('0x41')](_0x50c5f3[_0xfa5d('0x42')],{})[_0xfa5d('0x1e')](function(_0x17b540){var _0x153bcf=_0x50c5f3['user'][_0xfa5d('0x43')]({'plain':!![]});if(!_0x153bcf)throw new Error(_0xfa5d('0x44'));if(_0x153bcf[_0xfa5d('0x45')]===_0xfa5d('0x46')){var _0x2fe279=_0x17b540[_0xfa5d('0x43')]({'plain':!![]});var _0x3f5e91='IvrCampaigns';return db[_0xfa5d('0x47')]['find']({'where':{'name':_0x3f5e91,'userProfileId':_0x153bcf[_0xfa5d('0x48')]},'raw':!![]})[_0xfa5d('0x1e')](function(_0x118963){if(_0x118963&&_0x118963[_0xfa5d('0x49')]===0x0){return db[_0xfa5d('0x1c')][_0xfa5d('0x41')]({'name':_0x2fe279[_0xfa5d('0x21')],'resourceId':_0x2fe279['id'],'type':_0x118963[_0xfa5d('0x21')],'sectionId':_0x118963['id']},{})[_0xfa5d('0x1e')](function(){return _0x17b540;});}else{return _0x17b540;}})[_0xfa5d('0x3d')](function(_0x556001){logger[_0xfa5d('0x1f')](_0xfa5d('0x4a'),_0x556001);throw _0x556001;});}return _0x17b540;})[_0xfa5d('0x1e')](respondWithResult(_0x156c1e,0xc9))[_0xfa5d('0x3d')](handleError(_0x156c1e,null));};exports[_0xfa5d('0x4b')]=function(_0x1a90f1,_0x5ae786){var _0x112bd3={'where':{'id':_0x1a90f1[_0xfa5d('0x3f')]['id']}},_0x423a86={};_0x423a86[_0xfa5d('0x29')]=_[_0xfa5d('0x2c')](db['Campaign']['rawAttributes']);_0x112bd3['attributes']=_[_0xfa5d('0x2d')](_0x423a86[_0xfa5d('0x29')],qs[_0xfa5d('0x2f')](_0x1a90f1[_0xfa5d('0x2b')][_0xfa5d('0x2f')]));_0x112bd3[_0xfa5d('0x2e')]=_0x112bd3[_0xfa5d('0x2e')]['length']?_0x112bd3[_0xfa5d('0x2e')]:_0x423a86[_0xfa5d('0x29')];if(_0x1a90f1[_0xfa5d('0x2b')][_0xfa5d('0x40')]){_0x112bd3[_0xfa5d('0x3b')]=[{'all':!![]}];}_0x112bd3=_[_0xfa5d('0x38')]({},_0x112bd3,_0x1a90f1[_0xfa5d('0x3a')]);return db['Campaign'][_0xfa5d('0x4c')](_0x112bd3)[_0xfa5d('0x1e')](handleEntityNotFound(_0x5ae786,null))[_0xfa5d('0x1e')](function(_0x33fdcd){if(_0x33fdcd){var _0x5bb4fa=_0x33fdcd[_0xfa5d('0x43')]({'plain':!![]});_0x5bb4fa=qs['omit'](_0x5bb4fa,['id',_0xfa5d('0x4d'),'updatedAt']);_0x1a90f1[_0xfa5d('0x42')]=_['omit'](_0x1a90f1[_0xfa5d('0x42')],['id',_0xfa5d('0x4d'),_0xfa5d('0x4e')]);return db[_0xfa5d('0x24')]['create'](_[_0xfa5d('0x38')](_0x5bb4fa,_0x1a90f1[_0xfa5d('0x42')]),{'include':_0x1a90f1[_0xfa5d('0x2b')][_0xfa5d('0x40')]?[{'all':!![]}]:undefined})[_0xfa5d('0x1e')](function(_0x1abfb7){var _0x57549f=_0x1a90f1[_0xfa5d('0x46')][_0xfa5d('0x43')]({'plain':!![]});if(!_0x57549f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x57549f[_0xfa5d('0x45')]===_0xfa5d('0x46')){var _0x27a586=_0x1abfb7[_0xfa5d('0x43')]({'plain':!![]});var _0xb4eff7='IvrCampaigns';return db[_0xfa5d('0x47')][_0xfa5d('0x4c')]({'where':{'name':_0xb4eff7,'userProfileId':_0x57549f[_0xfa5d('0x48')]},'raw':!![]})[_0xfa5d('0x1e')](function(_0x4c4c25){if(_0x4c4c25&&_0x4c4c25['autoAssociation']===0x0){return db['UserProfileResource'][_0xfa5d('0x41')]({'name':_0x27a586[_0xfa5d('0x21')],'resourceId':_0x27a586['id'],'type':_0x4c4c25['name'],'sectionId':_0x4c4c25['id']},{})['then'](function(){return _0x1abfb7;});}else{return _0x1abfb7;}})[_0xfa5d('0x3d')](function(_0x385964){logger[_0xfa5d('0x1f')](_0xfa5d('0x4a'),_0x385964);throw _0x385964;});}return _0x1abfb7;});}})[_0xfa5d('0x1e')](respondWithResult(_0x5ae786,0xc9))[_0xfa5d('0x3d')](handleError(_0x5ae786,null));};exports[_0xfa5d('0x1b')]=function(_0x874e4d,_0x17f978){if(_0x874e4d[_0xfa5d('0x42')]['id']){delete _0x874e4d['body']['id'];}return db[_0xfa5d('0x24')]['find']({'where':{'id':_0x874e4d[_0xfa5d('0x3f')]['id']}})[_0xfa5d('0x1e')](handleEntityNotFound(_0x17f978,null))[_0xfa5d('0x1e')](saveUpdates(_0x874e4d[_0xfa5d('0x42')],null))[_0xfa5d('0x1e')](respondWithResult(_0x17f978,null))[_0xfa5d('0x3d')](handleError(_0x17f978,null));};exports[_0xfa5d('0x1d')]=function(_0x2c165,_0x1e61a8){return db['Campaign'][_0xfa5d('0x4c')]({'where':{'id':_0x2c165[_0xfa5d('0x3f')]['id']}})[_0xfa5d('0x1e')](handleEntityNotFound(_0x1e61a8,null))['then'](removeEntity(_0x1e61a8,null))[_0xfa5d('0x3d')](handleError(_0x1e61a8,null));};exports[_0xfa5d('0x4f')]=function(_0x2b7a77,_0x9b533e,_0x1d02ee){var _0x423832={'raw':!![],'where':{}};var _0x1a7150={};var _0x233a37={'count':0x0,'rows':[]};return db[_0xfa5d('0x24')][_0xfa5d('0x50')]({'where':{'id':_0x2b7a77[_0xfa5d('0x3f')]['id']}})[_0xfa5d('0x1e')](handleEntityNotFound(_0x9b533e,null))['then'](function(_0x5e66b7){if(_0x5e66b7){_0x1a7150[_0xfa5d('0x29')]=_[_0xfa5d('0x2c')](db[_0xfa5d('0x51')]['rawAttributes']);_0x1a7150[_0xfa5d('0x2b')]=_[_0xfa5d('0x2c')](_0x2b7a77[_0xfa5d('0x2b')]);_0x1a7150[_0xfa5d('0x35')]=_[_0xfa5d('0x2d')](_0x1a7150[_0xfa5d('0x29')],_0x1a7150['query']);_0x423832[_0xfa5d('0x2e')]=_[_0xfa5d('0x2d')](_0x1a7150[_0xfa5d('0x29')],qs[_0xfa5d('0x2f')](_0x2b7a77[_0xfa5d('0x2b')][_0xfa5d('0x2f')]));_0x423832[_0xfa5d('0x2e')]=_0x423832[_0xfa5d('0x2e')][_0xfa5d('0x30')]?_0x423832['attributes']:_0x1a7150[_0xfa5d('0x29')];if(!_0x2b7a77['query']['hasOwnProperty']('nolimit')){_0x423832[_0xfa5d('0x15')]=qs[_0xfa5d('0x15')](_0x2b7a77['query']['limit']);_0x423832[_0xfa5d('0x13')]=qs[_0xfa5d('0x13')](_0x2b7a77['query'][_0xfa5d('0x13')]);}_0x423832['order']=qs[_0xfa5d('0x33')](_0x2b7a77[_0xfa5d('0x2b')][_0xfa5d('0x33')]);_0x423832[_0xfa5d('0x34')]=qs[_0xfa5d('0x35')](_['pick'](_0x2b7a77[_0xfa5d('0x2b')],_0x1a7150['filters']));_0x423832[_0xfa5d('0x34')][_0xfa5d('0x52')]=_0x5e66b7['id'];if(_0x2b7a77[_0xfa5d('0x2b')][_0xfa5d('0x37')]){_0x423832[_0xfa5d('0x34')]=_['merge'](_0x423832[_0xfa5d('0x34')],{'$or':_[_0xfa5d('0x2a')](_0x423832[_0xfa5d('0x2e')],function(_0x26e397){var _0x3deaeb={};_0x3deaeb[_0x26e397]={'$like':'%'+_0x2b7a77['query'][_0xfa5d('0x37')]+'%'};return _0x3deaeb;})});}_0x423832=_[_0xfa5d('0x38')]({},_0x423832,_0x2b7a77['options']);return db[_0xfa5d('0x51')]['count']({'where':_0x423832[_0xfa5d('0x34')]})[_0xfa5d('0x1e')](function(_0x3ce1bf){_0x233a37[_0xfa5d('0x16')]=_0x3ce1bf;if(_0x2b7a77[_0xfa5d('0x2b')][_0xfa5d('0x40')]){_0x423832['include']=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x423832);})[_0xfa5d('0x1e')](function(_0x2d0a72){_0x233a37[_0xfa5d('0x3c')]=_0x2d0a72;return _0x233a37;});}})['then'](respondWithFilteredResult(_0x9b533e,_0x423832))[_0xfa5d('0x3d')](handleError(_0x9b533e,null));};exports['getHopperHistories']=function(_0x329fb1,_0x54e19d,_0x2405b3){var _0x12feca={'raw':!![],'where':{}};var _0x57755b={};var _0x1a4095={'count':0x0,'rows':[]};return db[_0xfa5d('0x24')][_0xfa5d('0x50')]({'where':{'id':_0x329fb1[_0xfa5d('0x3f')]['id']}})[_0xfa5d('0x1e')](handleEntityNotFound(_0x54e19d,null))[_0xfa5d('0x1e')](function(_0x1c35d9){if(_0x1c35d9){_0x57755b[_0xfa5d('0x29')]=_[_0xfa5d('0x2c')](db[_0xfa5d('0x53')][_0xfa5d('0x25')]);_0x57755b[_0xfa5d('0x2b')]=_[_0xfa5d('0x2c')](_0x329fb1[_0xfa5d('0x2b')]);_0x57755b[_0xfa5d('0x35')]=_[_0xfa5d('0x2d')](_0x57755b[_0xfa5d('0x29')],_0x57755b['query']);_0x12feca['attributes']=_[_0xfa5d('0x2d')](_0x57755b[_0xfa5d('0x29')],qs[_0xfa5d('0x2f')](_0x329fb1[_0xfa5d('0x2b')][_0xfa5d('0x2f')]));_0x12feca[_0xfa5d('0x2e')]=_0x12feca['attributes'][_0xfa5d('0x30')]?_0x12feca[_0xfa5d('0x2e')]:_0x57755b['model'];if(!_0x329fb1['query'][_0xfa5d('0x54')](_0xfa5d('0x31'))){_0x12feca[_0xfa5d('0x15')]=qs[_0xfa5d('0x15')](_0x329fb1[_0xfa5d('0x2b')][_0xfa5d('0x15')]);_0x12feca[_0xfa5d('0x13')]=qs[_0xfa5d('0x13')](_0x329fb1[_0xfa5d('0x2b')][_0xfa5d('0x13')]);}_0x12feca[_0xfa5d('0x32')]=qs['sort'](_0x329fb1[_0xfa5d('0x2b')][_0xfa5d('0x33')]);_0x12feca['where']=qs[_0xfa5d('0x35')](_[_0xfa5d('0x36')](_0x329fb1[_0xfa5d('0x2b')],_0x57755b[_0xfa5d('0x35')]));_0x12feca[_0xfa5d('0x34')][_0xfa5d('0x52')]=_0x1c35d9['id'];if(_0x329fb1['query'][_0xfa5d('0x37')]){_0x12feca['where']=_[_0xfa5d('0x38')](_0x12feca['where'],{'$or':_[_0xfa5d('0x2a')](_0x12feca[_0xfa5d('0x2e')],function(_0x37ff1e){var _0x2dda91={};_0x2dda91[_0x37ff1e]={'$like':'%'+_0x329fb1[_0xfa5d('0x2b')]['filter']+'%'};return _0x2dda91;})});}_0x12feca=_['merge']({},_0x12feca,_0x329fb1['options']);return db[_0xfa5d('0x53')][_0xfa5d('0x16')]({'where':_0x12feca[_0xfa5d('0x34')]})[_0xfa5d('0x1e')](function(_0xa85059){_0x1a4095['count']=_0xa85059;if(_0x329fb1[_0xfa5d('0x2b')][_0xfa5d('0x40')]){_0x12feca[_0xfa5d('0x3b')]=[{'all':!![]}];}return db[_0xfa5d('0x53')][_0xfa5d('0x55')](_0x12feca);})[_0xfa5d('0x1e')](function(_0x8fd596){_0x1a4095[_0xfa5d('0x3c')]=_0x8fd596;return _0x1a4095;});}})[_0xfa5d('0x1e')](respondWithFilteredResult(_0x54e19d,_0x12feca))[_0xfa5d('0x3d')](handleError(_0x54e19d,null));};exports[_0xfa5d('0x56')]=function(_0x21d158,_0x33b048,_0x46cc1d){var _0x5c453a={'raw':!![],'where':{}};var _0x4189f2={};var _0x50b935={'count':0x0,'rows':[]};return db[_0xfa5d('0x24')][_0xfa5d('0x50')]({'where':{'id':_0x21d158[_0xfa5d('0x3f')]['id']}})['then'](handleEntityNotFound(_0x33b048,null))[_0xfa5d('0x1e')](function(_0x1a374c){if(_0x1a374c){_0x4189f2[_0xfa5d('0x29')]=_[_0xfa5d('0x2c')](db[_0xfa5d('0x57')]['rawAttributes']);_0x4189f2[_0xfa5d('0x2b')]=_[_0xfa5d('0x2c')](_0x21d158['query']);_0x4189f2['filters']=_['intersection'](_0x4189f2[_0xfa5d('0x29')],_0x4189f2[_0xfa5d('0x2b')]);_0x5c453a[_0xfa5d('0x2e')]=_[_0xfa5d('0x2d')](_0x4189f2[_0xfa5d('0x29')],qs[_0xfa5d('0x2f')](_0x21d158['query'][_0xfa5d('0x2f')]));_0x5c453a[_0xfa5d('0x2e')]=_0x5c453a[_0xfa5d('0x2e')][_0xfa5d('0x30')]?_0x5c453a['attributes']:_0x4189f2[_0xfa5d('0x29')];if(!_0x21d158[_0xfa5d('0x2b')]['hasOwnProperty'](_0xfa5d('0x31'))){_0x5c453a[_0xfa5d('0x15')]=qs[_0xfa5d('0x15')](_0x21d158[_0xfa5d('0x2b')][_0xfa5d('0x15')]);_0x5c453a['offset']=qs['offset'](_0x21d158['query'][_0xfa5d('0x13')]);}_0x5c453a[_0xfa5d('0x32')]=qs['sort'](_0x21d158[_0xfa5d('0x2b')][_0xfa5d('0x33')]);_0x5c453a[_0xfa5d('0x34')]=qs[_0xfa5d('0x35')](_[_0xfa5d('0x36')](_0x21d158[_0xfa5d('0x2b')],_0x4189f2[_0xfa5d('0x35')]));_0x5c453a['where'][_0xfa5d('0x52')]=_0x1a374c['id'];if(_0x21d158[_0xfa5d('0x2b')][_0xfa5d('0x37')]){_0x5c453a[_0xfa5d('0x34')]=_[_0xfa5d('0x38')](_0x5c453a[_0xfa5d('0x34')],{'$or':_[_0xfa5d('0x2a')](_0x5c453a['attributes'],function(_0xc5c56){var _0x19dd21={};_0x19dd21[_0xc5c56]={'$like':'%'+_0x21d158[_0xfa5d('0x2b')][_0xfa5d('0x37')]+'%'};return _0x19dd21;})});}_0x5c453a=_['merge']({},_0x5c453a,_0x21d158[_0xfa5d('0x3a')]);return db[_0xfa5d('0x57')][_0xfa5d('0x16')]({'where':_0x5c453a[_0xfa5d('0x34')]})[_0xfa5d('0x1e')](function(_0x394509){_0x50b935[_0xfa5d('0x16')]=_0x394509;if(_0x21d158[_0xfa5d('0x2b')][_0xfa5d('0x40')]){_0x5c453a['include']=[{'all':!![]}];}return db[_0xfa5d('0x57')][_0xfa5d('0x55')](_0x5c453a);})['then'](function(_0x9b8d32){_0x50b935[_0xfa5d('0x3c')]=_0x9b8d32;return _0x50b935;});}})['then'](respondWithFilteredResult(_0x33b048,_0x5c453a))[_0xfa5d('0x3d')](handleError(_0x33b048,null));};exports['getHopperBlacks']=function(_0x20aeb4,_0x176001,_0x2705e0){var _0x10ce7d={'raw':!![],'where':{}};var _0x39cd9f={};var _0x8bb023={'count':0x0,'rows':[]};return db[_0xfa5d('0x24')]['findOne']({'where':{'id':_0x20aeb4[_0xfa5d('0x3f')]['id']}})[_0xfa5d('0x1e')](handleEntityNotFound(_0x176001,null))[_0xfa5d('0x1e')](function(_0x398c84){if(_0x398c84){_0x39cd9f[_0xfa5d('0x29')]=_['keys'](db[_0xfa5d('0x58')][_0xfa5d('0x25')]);_0x39cd9f[_0xfa5d('0x2b')]=_[_0xfa5d('0x2c')](_0x20aeb4[_0xfa5d('0x2b')]);_0x39cd9f[_0xfa5d('0x35')]=_[_0xfa5d('0x2d')](_0x39cd9f[_0xfa5d('0x29')],_0x39cd9f[_0xfa5d('0x2b')]);_0x10ce7d[_0xfa5d('0x2e')]=_['intersection'](_0x39cd9f['model'],qs['fields'](_0x20aeb4[_0xfa5d('0x2b')][_0xfa5d('0x2f')]));_0x10ce7d[_0xfa5d('0x2e')]=_0x10ce7d[_0xfa5d('0x2e')][_0xfa5d('0x30')]?_0x10ce7d['attributes']:_0x39cd9f['model'];if(!_0x20aeb4[_0xfa5d('0x2b')][_0xfa5d('0x54')]('nolimit')){_0x10ce7d[_0xfa5d('0x15')]=qs[_0xfa5d('0x15')](_0x20aeb4[_0xfa5d('0x2b')][_0xfa5d('0x15')]);_0x10ce7d['offset']=qs[_0xfa5d('0x13')](_0x20aeb4[_0xfa5d('0x2b')][_0xfa5d('0x13')]);}_0x10ce7d[_0xfa5d('0x32')]=qs[_0xfa5d('0x33')](_0x20aeb4[_0xfa5d('0x2b')][_0xfa5d('0x33')]);_0x10ce7d['where']=qs[_0xfa5d('0x35')](_['pick'](_0x20aeb4[_0xfa5d('0x2b')],_0x39cd9f[_0xfa5d('0x35')]));_0x10ce7d[_0xfa5d('0x34')][_0xfa5d('0x52')]=_0x398c84['id'];if(_0x20aeb4[_0xfa5d('0x2b')][_0xfa5d('0x37')]){_0x10ce7d[_0xfa5d('0x34')]=_[_0xfa5d('0x38')](_0x10ce7d[_0xfa5d('0x34')],{'$or':_[_0xfa5d('0x2a')](_0x10ce7d[_0xfa5d('0x2e')],function(_0x24daa4){var _0x3c03b3={};_0x3c03b3[_0x24daa4]={'$like':'%'+_0x20aeb4[_0xfa5d('0x2b')]['filter']+'%'};return _0x3c03b3;})});}_0x10ce7d=_[_0xfa5d('0x38')]({},_0x10ce7d,_0x20aeb4['options']);return db[_0xfa5d('0x58')]['count']({'where':_0x10ce7d['where']})[_0xfa5d('0x1e')](function(_0x23a404){_0x8bb023['count']=_0x23a404;if(_0x20aeb4['query'][_0xfa5d('0x40')]){_0x10ce7d[_0xfa5d('0x3b')]=[{'all':!![]}];}return db[_0xfa5d('0x58')][_0xfa5d('0x55')](_0x10ce7d);})[_0xfa5d('0x1e')](function(_0x232606){_0x8bb023['rows']=_0x232606;return _0x8bb023;});}})[_0xfa5d('0x1e')](respondWithFilteredResult(_0x176001,_0x10ce7d))['catch'](handleError(_0x176001,null));};exports[_0xfa5d('0x59')]=function(_0x2e3c25,_0x240e7c,_0x434db1){var _0x1d0b99={};var _0x147ec1={};var _0xef642;var _0x4dc25b;return db[_0xfa5d('0x24')][_0xfa5d('0x50')]({'where':{'id':_0x2e3c25['params']['id']}})['then'](handleEntityNotFound(_0x240e7c,null))[_0xfa5d('0x1e')](function(_0x5c147f){if(_0x5c147f){_0xef642=_0x5c147f;_0x147ec1['model']=_[_0xfa5d('0x2c')](db[_0xfa5d('0x5a')][_0xfa5d('0x25')]);_0x147ec1[_0xfa5d('0x2b')]=_['keys'](_0x2e3c25[_0xfa5d('0x2b')]);_0x147ec1[_0xfa5d('0x35')]=_['intersection'](_0x147ec1[_0xfa5d('0x29')],_0x147ec1[_0xfa5d('0x2b')]);_0x1d0b99[_0xfa5d('0x2e')]=_[_0xfa5d('0x2d')](_0x147ec1[_0xfa5d('0x29')],qs[_0xfa5d('0x2f')](_0x2e3c25[_0xfa5d('0x2b')]['fields']));_0x1d0b99[_0xfa5d('0x2e')]=_0x1d0b99[_0xfa5d('0x2e')][_0xfa5d('0x30')]?_0x1d0b99[_0xfa5d('0x2e')]:_0x147ec1[_0xfa5d('0x29')];_0x1d0b99[_0xfa5d('0x32')]=qs[_0xfa5d('0x33')](_0x2e3c25[_0xfa5d('0x2b')][_0xfa5d('0x33')]);_0x1d0b99[_0xfa5d('0x34')]=qs['filters'](_[_0xfa5d('0x36')](_0x2e3c25['query'],_0x147ec1[_0xfa5d('0x35')]));if(_0x2e3c25['query'][_0xfa5d('0x37')]){_0x1d0b99[_0xfa5d('0x34')]=_['merge'](_0x1d0b99[_0xfa5d('0x34')],{'$or':_[_0xfa5d('0x2a')](_0x1d0b99[_0xfa5d('0x2e')],function(_0x2a4242){var _0x3c3f25={};_0x3c3f25[_0x2a4242]={'$like':'%'+_0x2e3c25[_0xfa5d('0x2b')][_0xfa5d('0x37')]+'%'};return _0x3c3f25;})});}_0x1d0b99=_['merge']({},_0x1d0b99,_0x2e3c25[_0xfa5d('0x3a')]);return _0xef642[_0xfa5d('0x59')](_0x1d0b99);}})[_0xfa5d('0x1e')](function(_0x37e184){if(_0x37e184){_0x4dc25b=_0x37e184[_0xfa5d('0x30')];if(!_0x2e3c25[_0xfa5d('0x2b')][_0xfa5d('0x54')](_0xfa5d('0x31'))){_0x1d0b99[_0xfa5d('0x15')]=qs[_0xfa5d('0x15')](_0x2e3c25[_0xfa5d('0x2b')][_0xfa5d('0x15')]);_0x1d0b99[_0xfa5d('0x13')]=qs[_0xfa5d('0x13')](_0x2e3c25[_0xfa5d('0x2b')][_0xfa5d('0x13')]);}return _0xef642[_0xfa5d('0x59')](_0x1d0b99);}})['then'](function(_0x393f68){if(_0x393f68){return _0x393f68?{'count':_0x4dc25b,'rows':_0x393f68}:null;}})[_0xfa5d('0x1e')](respondWithResult(_0x240e7c,null))[_0xfa5d('0x3d')](handleError(_0x240e7c,null));};exports[_0xfa5d('0x5b')]=function(_0x492987,_0x10a906,_0x332249){var _0x1c657d,_0x4b6945;var _0x3d76b2=[];var _0x146c83=moment()[_0xfa5d('0x5c')](_0xfa5d('0x5d'));return db['Campaign']['find']({'where':{'id':_0x492987[_0xfa5d('0x3f')]['id']}})[_0xfa5d('0x1e')](handleEntityNotFound(_0x10a906,null))['then'](function(_0x2b7765){if(_0x2b7765){_0x4b6945=_0x2b7765;return _0x2b7765[_0xfa5d('0x5b')](_0x492987['body'][_0xfa5d('0x5e')],_[_0xfa5d('0x5f')](_0x492987[_0xfa5d('0x42')],[_0xfa5d('0x5e'),'id'])||{});}return null;})['spread'](function(_0xf2328e){var _0x50f4fd;var _0x422a68;_0x1c657d=_0xf2328e||[];var _0x5aed15=[];if(_0xf2328e){for(var _0x333b41=0x0;_0x333b41<_0xf2328e[_0xfa5d('0x30')];_0x333b41+=0x1){var _0x303cd8=_0xf2328e[_0x333b41][_0xfa5d('0x43')]({'plain':!![]});_0x4b6945['dialCheckDuplicateType']=_0x492987['body'][_0xfa5d('0x60')]?_0x492987[_0xfa5d('0x42')][_0xfa5d('0x60')]:_0x4b6945[_0xfa5d('0x60')];switch(_0x4b6945[_0xfa5d('0x60')]){case'always':_0x50f4fd=squel['insert']()[_0xfa5d('0x61')]('cm_hopper')['fromQuery']([_0xfa5d('0x62'),_0xfa5d('0x63'),'ContactId',_0xfa5d('0x64'),'CampaignId','createdAt','updatedAt'],squel[_0xfa5d('0x65')]()[_0xfa5d('0x66')]('phone',_0xfa5d('0x62'))['field'](_0xfa5d('0x67'),'scheduledAt')[_0xfa5d('0x66')]('id',_0xfa5d('0x68'))[_0xfa5d('0x66')](_0x303cd8[_0xfa5d('0x69')][_0xfa5d('0x6a')](),_0xfa5d('0x64'))['field'](_0x492987[_0xfa5d('0x3f')]['id'][_0xfa5d('0x6a')](),_0xfa5d('0x52'))[_0xfa5d('0x66')]('\x27'+_0x146c83+'\x27',_0xfa5d('0x4d'))['field']('\x27'+_0x146c83+'\x27',_0xfa5d('0x4e'))[_0xfa5d('0x6b')](_0xfa5d('0x6c'))[_0xfa5d('0x34')](_0xfa5d('0x6d'))[_0xfa5d('0x34')]('ListId\x20=\x20?',_0x303cd8[_0xfa5d('0x69')][_0xfa5d('0x6a')]())[_0xfa5d('0x34')](_0xfa5d('0x6e'))[_0xfa5d('0x34')](_0xfa5d('0x6f'),squel[_0xfa5d('0x65')]()[_0xfa5d('0x66')](_0xfa5d('0x70'))[_0xfa5d('0x6b')](_0xfa5d('0x71'))[_0xfa5d('0x34')](_0xfa5d('0x72'),_0x492987['params']['id'][_0xfa5d('0x6a')]()))[_0xfa5d('0x34')](_0xfa5d('0x6f'),squel[_0xfa5d('0x65')]()[_0xfa5d('0x66')](_0xfa5d('0x73'))[_0xfa5d('0x6b')]('cm_hopper')[_0xfa5d('0x34')](_0xfa5d('0x72'),_0x492987['params']['id'][_0xfa5d('0x6a')]())))[_0xfa5d('0x6a')]();break;case _0xfa5d('0x74'):_0x50f4fd=squel[_0xfa5d('0x75')]()[_0xfa5d('0x61')]('cm_hopper')[_0xfa5d('0x76')]([_0xfa5d('0x62'),_0xfa5d('0x63'),_0xfa5d('0x68'),_0xfa5d('0x64'),_0xfa5d('0x52'),_0xfa5d('0x4d'),_0xfa5d('0x4e')],squel[_0xfa5d('0x65')]()[_0xfa5d('0x66')](_0xfa5d('0x62'),_0xfa5d('0x62'))[_0xfa5d('0x66')](_0xfa5d('0x67'),_0xfa5d('0x63'))[_0xfa5d('0x66')]('id','ContactId')['field'](_0x303cd8[_0xfa5d('0x69')][_0xfa5d('0x6a')](),'ListId')[_0xfa5d('0x66')](_0x492987[_0xfa5d('0x3f')]['id'][_0xfa5d('0x6a')](),_0xfa5d('0x52'))['field']('\x27'+_0x146c83+'\x27',_0xfa5d('0x4d'))['field']('\x27'+_0x146c83+'\x27','updatedAt')[_0xfa5d('0x6b')]('cm_contacts')[_0xfa5d('0x34')](_0xfa5d('0x6d'))[_0xfa5d('0x34')](_0xfa5d('0x77'),_0x303cd8[_0xfa5d('0x69')][_0xfa5d('0x6a')]())[_0xfa5d('0x34')](_0xfa5d('0x6e'))[_0xfa5d('0x34')](_0xfa5d('0x6f'),squel[_0xfa5d('0x65')]()[_0xfa5d('0x66')](_0xfa5d('0x73'))[_0xfa5d('0x6b')]('cm_hopper')['where'](_0xfa5d('0x72'),_0x492987['params']['id'][_0xfa5d('0x6a')]())))[_0xfa5d('0x6a')]();break;default:_0x50f4fd=squel['insert']()[_0xfa5d('0x61')](_0xfa5d('0x78'))[_0xfa5d('0x76')](['phone',_0xfa5d('0x63'),'ContactId',_0xfa5d('0x64'),'CampaignId',_0xfa5d('0x4d'),_0xfa5d('0x4e')],squel[_0xfa5d('0x65')]()['field'](_0xfa5d('0x62'),_0xfa5d('0x62'))[_0xfa5d('0x66')](_0xfa5d('0x67'),_0xfa5d('0x63'))[_0xfa5d('0x66')]('id',_0xfa5d('0x68'))[_0xfa5d('0x66')](_0x303cd8[_0xfa5d('0x69')][_0xfa5d('0x6a')](),_0xfa5d('0x64'))[_0xfa5d('0x66')](_0x492987[_0xfa5d('0x3f')]['id']['toString'](),_0xfa5d('0x52'))[_0xfa5d('0x66')]('\x27'+_0x146c83+'\x27',_0xfa5d('0x4d'))[_0xfa5d('0x66')]('\x27'+_0x146c83+'\x27','updatedAt')[_0xfa5d('0x6b')](_0xfa5d('0x6c'))[_0xfa5d('0x34')](_0xfa5d('0x6d'))['where'](_0xfa5d('0x77'),_0x303cd8['CmListId']['toString']())['where'](_0xfa5d('0x6e')))[_0xfa5d('0x6a')]();}_0x422a68=squel[_0xfa5d('0x75')]()[_0xfa5d('0x61')](_0xfa5d('0x79'))['fromQuery']([_0xfa5d('0x7a'),_0xfa5d('0x63'),_0xfa5d('0x62'),_0xfa5d('0x7b'),_0xfa5d('0x4d'),'updatedAt'],squel[_0xfa5d('0x65')]()[_0xfa5d('0x66')](_0xfa5d('0x7c'),'id')[_0xfa5d('0x66')](_0xfa5d('0x67'),_0xfa5d('0x63'))['field']('ci.item',_0xfa5d('0x62'))[_0xfa5d('0x66')](_0xfa5d('0x7d'),_0xfa5d('0x7b'))[_0xfa5d('0x66')]('\x27'+_0x146c83+'\x27',_0xfa5d('0x4d'))[_0xfa5d('0x66')]('\x27'+_0x146c83+'\x27','updatedAt')[_0xfa5d('0x6b')](_0xfa5d('0x7e'),'ci')[_0xfa5d('0x7f')](_0xfa5d('0x78'),'h','h.ContactId\x20=\x20ci.CmContactId')['where'](_0xfa5d('0x80'),_0x303cd8[_0xfa5d('0x69')][_0xfa5d('0x6a')]())['where']('h.CampaignId=?',_0x492987[_0xfa5d('0x3f')]['id']['toString']())[_0xfa5d('0x34')](_0xfa5d('0x81'),_0x146c83))[_0xfa5d('0x6a')]();_0x5aed15[_0xfa5d('0x82')](db[_0xfa5d('0x83')][_0xfa5d('0x2b')](_0x50f4fd));_0x3d76b2[_0xfa5d('0x82')](db['sequelize'][_0xfa5d('0x2b')](_0x422a68));}return BPromise[_0xfa5d('0x84')](_0x5aed15);}})[_0xfa5d('0x1e')](function(){return BPromise[_0xfa5d('0x84')](_0x3d76b2);})[_0xfa5d('0x1e')](function(){return _0x1c657d;})[_0xfa5d('0x1e')](respondWithResult(_0x10a906,null))[_0xfa5d('0x3d')](handleError(_0x10a906,null));};exports[_0xfa5d('0x85')]=function(_0x4d0176,_0x312120,_0x5b9982){return db[_0xfa5d('0x24')]['find']({'where':{'id':_0x4d0176[_0xfa5d('0x3f')]['id']}})[_0xfa5d('0x1e')](handleEntityNotFound(_0x312120,null))[_0xfa5d('0x1e')](function(_0x2daa22){if(_0x2daa22){return _0x2daa22[_0xfa5d('0x85')](_0x4d0176[_0xfa5d('0x2b')]['ids']);}})[_0xfa5d('0x1e')](function(_0xbc0e8f){if(_0xbc0e8f){return db[_0xfa5d('0x51')][_0xfa5d('0x1d')]({'where':{'ListId':_0x4d0176[_0xfa5d('0x2b')][_0xfa5d('0x5e')],'CampaignId':_0x4d0176['params']['id']}})[_0xfa5d('0x1e')](function(){return _0xbc0e8f;});}})['then'](respondWithStatusCode(_0x312120,null))['catch'](handleError(_0x312120,null));};exports[_0xfa5d('0x86')]=function(_0x48ae11,_0x38cc51,_0x33294d){var _0x597bac={};var _0x461cf8={};var _0x361ebb;var _0x27d415;return db['Campaign'][_0xfa5d('0x50')]({'where':{'id':_0x48ae11['params']['id']}})[_0xfa5d('0x1e')](handleEntityNotFound(_0x38cc51,null))['then'](function(_0x15292f){if(_0x15292f){_0x361ebb=_0x15292f;_0x461cf8[_0xfa5d('0x29')]=_[_0xfa5d('0x2c')](db[_0xfa5d('0x5a')][_0xfa5d('0x25')]);_0x461cf8[_0xfa5d('0x2b')]=_[_0xfa5d('0x2c')](_0x48ae11[_0xfa5d('0x2b')]);_0x461cf8[_0xfa5d('0x35')]=_[_0xfa5d('0x2d')](_0x461cf8[_0xfa5d('0x29')],_0x461cf8[_0xfa5d('0x2b')]);_0x597bac['attributes']=_['intersection'](_0x461cf8[_0xfa5d('0x29')],qs['fields'](_0x48ae11[_0xfa5d('0x2b')][_0xfa5d('0x2f')]));_0x597bac[_0xfa5d('0x2e')]=_0x597bac[_0xfa5d('0x2e')][_0xfa5d('0x30')]?_0x597bac['attributes']:_0x461cf8[_0xfa5d('0x29')];_0x597bac['order']=qs[_0xfa5d('0x33')](_0x48ae11[_0xfa5d('0x2b')][_0xfa5d('0x33')]);_0x597bac['where']=qs[_0xfa5d('0x35')](_[_0xfa5d('0x36')](_0x48ae11['query'],_0x461cf8[_0xfa5d('0x35')]));if(_0x48ae11[_0xfa5d('0x2b')][_0xfa5d('0x37')]){_0x597bac[_0xfa5d('0x34')]=_[_0xfa5d('0x38')](_0x597bac['where'],{'$or':_[_0xfa5d('0x2a')](_0x597bac['attributes'],function(_0x2de8f3){var _0x50ca7c={};_0x50ca7c[_0x2de8f3]={'$like':'%'+_0x48ae11['query'][_0xfa5d('0x37')]+'%'};return _0x50ca7c;})});}_0x597bac=_['merge']({},_0x597bac,_0x48ae11[_0xfa5d('0x3a')]);return _0x361ebb[_0xfa5d('0x86')](_0x597bac);}})[_0xfa5d('0x1e')](function(_0x1c6375){if(_0x1c6375){_0x27d415=_0x1c6375[_0xfa5d('0x30')];if(!_0x48ae11['query'][_0xfa5d('0x54')](_0xfa5d('0x31'))){_0x597bac[_0xfa5d('0x15')]=qs[_0xfa5d('0x15')](_0x48ae11[_0xfa5d('0x2b')]['limit']);_0x597bac[_0xfa5d('0x13')]=qs[_0xfa5d('0x13')](_0x48ae11[_0xfa5d('0x2b')][_0xfa5d('0x13')]);}return _0x361ebb[_0xfa5d('0x86')](_0x597bac);}})[_0xfa5d('0x1e')](function(_0x2c3b8d){if(_0x2c3b8d){return _0x2c3b8d?{'count':_0x27d415,'rows':_0x2c3b8d}:null;}})['then'](respondWithResult(_0x38cc51,null))['catch'](handleError(_0x38cc51,null));};exports['addBlackLists']=function(_0x10c4cd,_0x36c359,_0x4215ca){var _0x4ce962,_0x3cffc4;var _0x2fa394=[];var _0xd4ad0a=moment()[_0xfa5d('0x5c')](_0xfa5d('0x5d'));return db[_0xfa5d('0x24')]['find']({'where':{'id':_0x10c4cd[_0xfa5d('0x3f')]['id']}})[_0xfa5d('0x1e')](handleEntityNotFound(_0x36c359,null))[_0xfa5d('0x1e')](function(_0x549e5f){if(_0x549e5f){_0x3cffc4=_0x549e5f;return _0x549e5f[_0xfa5d('0x87')](_0x10c4cd['body']['ids'],_[_0xfa5d('0x5f')](_0x10c4cd[_0xfa5d('0x42')],['ids','id'])||{});}return null;})['spread'](function(_0xb26a8c){var _0x546585;var _0x1214bf;_0x4ce962=_0xb26a8c||[];var _0x24dff2=[];if(_0xb26a8c){for(var _0x3c147e=0x0;_0x3c147e<_0xb26a8c[_0xfa5d('0x30')];_0x3c147e+=0x1){var _0x393e1f=_0xb26a8c[_0x3c147e][_0xfa5d('0x43')]({'plain':!![]});_0x546585=squel[_0xfa5d('0x75')]()[_0xfa5d('0x61')](_0xfa5d('0x88'))[_0xfa5d('0x76')](['phone',_0xfa5d('0x68'),'ListId','CampaignId',_0xfa5d('0x4d'),_0xfa5d('0x4e')],squel[_0xfa5d('0x65')]()[_0xfa5d('0x66')](_0xfa5d('0x62'),_0xfa5d('0x62'))['field']('id',_0xfa5d('0x68'))[_0xfa5d('0x66')](_0x393e1f['CmListId'][_0xfa5d('0x6a')](),'ListId')['field'](_0x10c4cd[_0xfa5d('0x3f')]['id'][_0xfa5d('0x6a')](),_0xfa5d('0x52'))['field'](_0xfa5d('0x67'),_0xfa5d('0x4d'))[_0xfa5d('0x66')](_0xfa5d('0x67'),_0xfa5d('0x4e'))[_0xfa5d('0x6b')](_0xfa5d('0x6c'))[_0xfa5d('0x34')]('deletedAt\x20IS\x20NULL')[_0xfa5d('0x34')]('ListId\x20=\x20?',_0x393e1f[_0xfa5d('0x69')]['toString']())[_0xfa5d('0x34')](_0xfa5d('0x6e')))[_0xfa5d('0x6a')]();_0x24dff2[_0xfa5d('0x82')](db[_0xfa5d('0x83')]['query'](_0x546585));}return BPromise[_0xfa5d('0x84')](_0x24dff2);}})[_0xfa5d('0x1e')](function(){return _0x4ce962;})[_0xfa5d('0x1e')](respondWithResult(_0x36c359,null))[_0xfa5d('0x3d')](handleError(_0x36c359,null));};exports[_0xfa5d('0x89')]=function(_0x325913,_0x43dee1,_0x5eb124){return db[_0xfa5d('0x24')]['find']({'where':{'id':_0x325913[_0xfa5d('0x3f')]['id']}})[_0xfa5d('0x1e')](handleEntityNotFound(_0x43dee1,null))[_0xfa5d('0x1e')](function(_0x48e775){if(_0x48e775){return _0x48e775[_0xfa5d('0x89')](_0x325913[_0xfa5d('0x2b')][_0xfa5d('0x5e')]);}})[_0xfa5d('0x1e')](function(_0x13cfd3){if(_0x13cfd3){return db[_0xfa5d('0x58')][_0xfa5d('0x1d')]({'where':{'ListId':_0x325913[_0xfa5d('0x2b')]['ids'],'CampaignId':_0x325913[_0xfa5d('0x3f')]['id']}})['then'](function(){return _0x13cfd3;});}})[_0xfa5d('0x1e')](respondWithStatusCode(_0x43dee1,null))[_0xfa5d('0x3d')](handleError(_0x43dee1,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 23bc622..54d37cf 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x217b5b,_0x3572bf){var _0x2c357f=function(_0x2f16ad){while(--_0x2f16ad){_0x217b5b['push'](_0x217b5b['shift']());}};_0x2c357f(++_0x3572bf);}(_0x7a54,0x106));var _0x47a5=function(_0x47203e,_0x5f2962){_0x47203e=_0x47203e-0x0;var _0xef49d3=_0x7a54[_0x47203e];return _0xef49d3;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x241eb9,_0x5ccc3f){var _0x4f916b=function(_0x412d98){while(--_0x412d98){_0x241eb9['push'](_0x241eb9['shift']());}};_0x4f916b(++_0x5ccc3f);}(_0x7a54,0x106));var _0x47a5=function(_0x5cade1,_0x201cc7){_0x5cade1=_0x5cade1-0x0;var _0x7f4b1d=_0x7a54[_0x5cade1];return _0x7f4b1d;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index 0b4c8a0..ba2c12c 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 _0xc30d=['where','attributes','limit','map','model','include','GetCampaign','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','Campaign','findAll','options','raw'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0xc30d,0x6e));var _0xdc30=function(_0x5b33be,_0x20b6e7){_0x5b33be=_0x5b33be-0x0;var _0x1497f4=_0xc30d[_0x5b33be];return _0x1497f4;};'use strict';var _=require(_0xdc30('0x0'));var util=require('util');var moment=require(_0xdc30('0x1'));var BPromise=require(_0xdc30('0x2'));var rs=require(_0xdc30('0x3'));var fs=require('fs');var Redis=require(_0xdc30('0x4'));var db=require(_0xdc30('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdc30('0x6'))('rpc');var config=require(_0xdc30('0x7'));var jayson=require(_0xdc30('0x8'));var client=jayson[_0xdc30('0x9')][_0xdc30('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4011da,_0x2773c5,_0x4a0310){return new BPromise(function(_0x1cdfb4,_0x39c377){return client[_0xdc30('0xb')](_0x4011da,_0x4a0310)[_0xdc30('0xc')](function(_0x1a9c5f){logger[_0xdc30('0xd')](_0xdc30('0xe'),_0x2773c5,_0xdc30('0xf'));logger[_0xdc30('0x10')]('Campaign,\x20%s,\x20%s,\x20%s',_0x2773c5,'request\x20sent',JSON['stringify'](_0x1a9c5f));if(_0x1a9c5f[_0xdc30('0x11')]){if(_0x1a9c5f[_0xdc30('0x11')][_0xdc30('0x12')]===0x1f4){logger[_0xdc30('0x11')](_0xdc30('0xe'),_0x2773c5,_0x1a9c5f[_0xdc30('0x11')][_0xdc30('0x13')]);return _0x39c377(_0x1a9c5f['error'][_0xdc30('0x13')]);}logger[_0xdc30('0x11')](_0xdc30('0xe'),_0x2773c5,_0x1a9c5f[_0xdc30('0x11')]['message']);return _0x1cdfb4(_0x1a9c5f[_0xdc30('0x11')][_0xdc30('0x13')]);}else{logger[_0xdc30('0xd')]('Campaign,\x20%s,\x20%s',_0x2773c5,_0xdc30('0xf'));_0x1cdfb4(_0x1a9c5f[_0xdc30('0x14')][_0xdc30('0x13')]);}})[_0xdc30('0x15')](function(_0x358251){logger[_0xdc30('0x11')](_0xdc30('0xe'),_0x2773c5,_0x358251);_0x39c377(_0x358251);});});}exports['GetCampaign']=function(_0x3eff2c){var _0x158bfc=this;return new Promise(function(_0x57a868,_0x5678a9){return db[_0xdc30('0x16')][_0xdc30('0x17')]({'raw':_0x3eff2c[_0xdc30('0x18')]?_0x3eff2c[_0xdc30('0x18')][_0xdc30('0x19')]===undefined?!![]:![]:!![],'where':_0x3eff2c[_0xdc30('0x18')]?_0x3eff2c[_0xdc30('0x18')][_0xdc30('0x1a')]||null:null,'attributes':_0x3eff2c[_0xdc30('0x18')]?_0x3eff2c[_0xdc30('0x18')][_0xdc30('0x1b')]||null:null,'limit':_0x3eff2c[_0xdc30('0x18')]?_0x3eff2c[_0xdc30('0x18')][_0xdc30('0x1c')]||null:null,'include':_0x3eff2c[_0xdc30('0x18')]?_0x3eff2c[_0xdc30('0x18')]['include']?_[_0xdc30('0x1d')](_0x3eff2c['options']['include'],function(_0x2bde2e){return{'model':db[_0x2bde2e[_0xdc30('0x1e')]],'as':_0x2bde2e['as'],'attributes':_0x2bde2e[_0xdc30('0x1b')],'include':_0x2bde2e['include']?_[_0xdc30('0x1d')](_0x2bde2e[_0xdc30('0x1f')],function(_0x4fdafc){return{'model':db[_0x4fdafc[_0xdc30('0x1e')]],'as':_0x4fdafc['as'],'attributes':_0x4fdafc['attributes'],'include':_0x4fdafc[_0xdc30('0x1f')]?_['map'](_0x4fdafc[_0xdc30('0x1f')],function(_0x16ee63){return{'model':db[_0x16ee63[_0xdc30('0x1e')]],'as':_0x16ee63['as'],'attributes':_0x16ee63['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x7c310e){logger['info'](_0xdc30('0x20'),_0x3eff2c);logger[_0xdc30('0x10')](_0xdc30('0x20'),_0x3eff2c,JSON[_0xdc30('0x21')](_0x7c310e));_0x57a868(_0x7c310e);})[_0xdc30('0x15')](function(_0x2c309e){logger['error'](_0xdc30('0x20'),_0x2c309e[_0xdc30('0x13')],_0x3eff2c);_0x5678a9(_0x158bfc[_0xdc30('0x11')](0x1f4,_0x2c309e[_0xdc30('0x13')]));});});};
\ No newline at end of file
+var _0xcee0=['result','catch','GetCampaign','findAll','options','raw','where','attributes','limit','include','map','model','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xcee0,0x1e1));var _0x0cee=function(_0x54b283,_0x5eb8a6){_0x54b283=_0x54b283-0x0;var _0x2462b3=_0xcee0[_0x54b283];return _0x2462b3;};'use strict';var _=require(_0x0cee('0x0'));var util=require(_0x0cee('0x1'));var moment=require(_0x0cee('0x2'));var BPromise=require(_0x0cee('0x3'));var rs=require(_0x0cee('0x4'));var fs=require('fs');var Redis=require(_0x0cee('0x5'));var db=require(_0x0cee('0x6'))['db'];var utils=require(_0x0cee('0x7'));var logger=require(_0x0cee('0x8'))('rpc');var config=require(_0x0cee('0x9'));var jayson=require(_0x0cee('0xa'));var client=jayson[_0x0cee('0xb')][_0x0cee('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2af845,_0x49f5ef,_0x45491f){return new BPromise(function(_0x24ff83,_0x34854d){return client[_0x0cee('0xd')](_0x2af845,_0x45491f)[_0x0cee('0xe')](function(_0x3ec038){logger[_0x0cee('0xf')](_0x0cee('0x10'),_0x49f5ef,_0x0cee('0x11'));logger[_0x0cee('0x12')](_0x0cee('0x13'),_0x49f5ef,_0x0cee('0x11'),JSON['stringify'](_0x3ec038));if(_0x3ec038[_0x0cee('0x14')]){if(_0x3ec038[_0x0cee('0x14')][_0x0cee('0x15')]===0x1f4){logger[_0x0cee('0x14')](_0x0cee('0x10'),_0x49f5ef,_0x3ec038[_0x0cee('0x14')][_0x0cee('0x16')]);return _0x34854d(_0x3ec038[_0x0cee('0x14')]['message']);}logger[_0x0cee('0x14')](_0x0cee('0x10'),_0x49f5ef,_0x3ec038[_0x0cee('0x14')][_0x0cee('0x16')]);return _0x24ff83(_0x3ec038[_0x0cee('0x14')][_0x0cee('0x16')]);}else{logger[_0x0cee('0xf')](_0x0cee('0x10'),_0x49f5ef,'request\x20sent');_0x24ff83(_0x3ec038[_0x0cee('0x17')][_0x0cee('0x16')]);}})[_0x0cee('0x18')](function(_0x652dcc){logger[_0x0cee('0x14')](_0x0cee('0x10'),_0x49f5ef,_0x652dcc);_0x34854d(_0x652dcc);});});}exports[_0x0cee('0x19')]=function(_0x237596){var _0x2e20b7=this;return new Promise(function(_0x500b0d,_0x1e811d){return db['Campaign'][_0x0cee('0x1a')]({'raw':_0x237596[_0x0cee('0x1b')]?_0x237596['options'][_0x0cee('0x1c')]===undefined?!![]:![]:!![],'where':_0x237596[_0x0cee('0x1b')]?_0x237596[_0x0cee('0x1b')][_0x0cee('0x1d')]||null:null,'attributes':_0x237596[_0x0cee('0x1b')]?_0x237596[_0x0cee('0x1b')][_0x0cee('0x1e')]||null:null,'limit':_0x237596[_0x0cee('0x1b')]?_0x237596[_0x0cee('0x1b')][_0x0cee('0x1f')]||null:null,'include':_0x237596[_0x0cee('0x1b')]?_0x237596[_0x0cee('0x1b')][_0x0cee('0x20')]?_['map'](_0x237596[_0x0cee('0x1b')][_0x0cee('0x20')],function(_0x512cfc){return{'model':db[_0x512cfc['model']],'as':_0x512cfc['as'],'attributes':_0x512cfc[_0x0cee('0x1e')],'include':_0x512cfc[_0x0cee('0x20')]?_[_0x0cee('0x21')](_0x512cfc['include'],function(_0x15e4ed){return{'model':db[_0x15e4ed[_0x0cee('0x22')]],'as':_0x15e4ed['as'],'attributes':_0x15e4ed[_0x0cee('0x1e')],'include':_0x15e4ed[_0x0cee('0x20')]?_[_0x0cee('0x21')](_0x15e4ed[_0x0cee('0x20')],function(_0x24739e){return{'model':db[_0x24739e[_0x0cee('0x22')]],'as':_0x24739e['as'],'attributes':_0x24739e[_0x0cee('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3ceaf4){logger[_0x0cee('0xf')]('GetCampaign',_0x237596);logger[_0x0cee('0x12')](_0x0cee('0x19'),_0x237596,JSON[_0x0cee('0x23')](_0x3ceaf4));_0x500b0d(_0x3ceaf4);})[_0x0cee('0x18')](function(_0x5d69e2){logger[_0x0cee('0x14')](_0x0cee('0x19'),_0x5d69e2[_0x0cee('0x16')],_0x237596);_0x1e811d(_0x2e20b7[_0x0cee('0x14')](0x1f4,_0x5d69e2[_0x0cee('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 71a4b20..de47ee2 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 _0x5139=['update','delete','removeBlackLists','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','index','/:id','get','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists','/:id/blacklists','post','create','/:id/clone','clone','addBlackLists','put'];(function(_0x7b7cf3,_0x8acc46){var _0x43455e=function(_0x3434df){while(--_0x3434df){_0x7b7cf3['push'](_0x7b7cf3['shift']());}};_0x43455e(++_0x8acc46);}(_0x5139,0xa4));var _0x9513=function(_0x26ef30,_0x38267a){_0x26ef30=_0x26ef30-0x0;var _0x59fe20=_0x5139[_0x26ef30];return _0x59fe20;};'use strict';var multer=require('multer');var util=require(_0x9513('0x0'));var path=require('path');var timeout=require(_0x9513('0x1'));var express=require(_0x9513('0x2'));var router=express[_0x9513('0x3')]();var fs_extra=require(_0x9513('0x4'));var auth=require(_0x9513('0x5'));var interaction=require(_0x9513('0x6'));var config=require(_0x9513('0x7'));var controller=require(_0x9513('0x8'));router['get']('/',auth[_0x9513('0x9')](),controller[_0x9513('0xa')]);router['get'](_0x9513('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x9513('0xc')](_0x9513('0xd'),auth[_0x9513('0x9')](),controller['getHoppers']);router[_0x9513('0xc')](_0x9513('0xe'),auth['isAuthenticated'](),controller[_0x9513('0xf')]);router[_0x9513('0xc')](_0x9513('0x10'),auth[_0x9513('0x9')](),controller[_0x9513('0x11')]);router['get'](_0x9513('0x12'),auth[_0x9513('0x9')](),controller[_0x9513('0x13')]);router[_0x9513('0xc')]('/:id/lists',auth['isAuthenticated'](),controller[_0x9513('0x14')]);router[_0x9513('0xc')](_0x9513('0x15'),auth['isAuthenticated'](),controller['getBlackLists']);router[_0x9513('0x16')]('/',auth[_0x9513('0x9')](),controller[_0x9513('0x17')]);router[_0x9513('0x16')](_0x9513('0x18'),auth[_0x9513('0x9')](),controller[_0x9513('0x19')]);router[_0x9513('0x16')]('/:id/lists',auth['isAuthenticated'](),controller['addLists']);router[_0x9513('0x16')](_0x9513('0x15'),auth[_0x9513('0x9')](),controller[_0x9513('0x1a')]);router[_0x9513('0x1b')](_0x9513('0xb'),auth[_0x9513('0x9')](),controller[_0x9513('0x1c')]);router[_0x9513('0x1d')](_0x9513('0xb'),auth[_0x9513('0x9')](),controller['destroy']);router[_0x9513('0x1d')]('/:id/lists',auth[_0x9513('0x9')](),controller['removeLists']);router[_0x9513('0x1d')](_0x9513('0x15'),auth[_0x9513('0x9')](),controller[_0x9513('0x1e')]);module[_0x9513('0x1f')]=router;
\ No newline at end of file
+var _0xe439=['../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','index','get','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','getBlackLists','post','create','clone','addLists','put','update','delete','destroy','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x2d0c13,_0x3fa0e7){var _0x1c580a=function(_0x36dc92){while(--_0x36dc92){_0x2d0c13['push'](_0x2d0c13['shift']());}};_0x1c580a(++_0x3fa0e7);}(_0xe439,0xc0));var _0x9e43=function(_0x5ec8ca,_0x3649e3){_0x5ec8ca=_0x5ec8ca-0x0;var _0x315ec4=_0xe439[_0x5ec8ca];return _0x315ec4;};'use strict';var multer=require(_0x9e43('0x0'));var util=require(_0x9e43('0x1'));var path=require(_0x9e43('0x2'));var timeout=require(_0x9e43('0x3'));var express=require(_0x9e43('0x4'));var router=express['Router']();var fs_extra=require(_0x9e43('0x5'));var auth=require(_0x9e43('0x6'));var interaction=require(_0x9e43('0x7'));var config=require(_0x9e43('0x8'));var controller=require(_0x9e43('0x9'));router['get']('/',auth[_0x9e43('0xa')](),controller[_0x9e43('0xb')]);router[_0x9e43('0xc')]('/:id',auth[_0x9e43('0xa')](),controller['show']);router[_0x9e43('0xc')]('/:id/hoppers',auth[_0x9e43('0xa')](),controller[_0x9e43('0xd')]);router[_0x9e43('0xc')]('/:id/hopper_histories',auth[_0x9e43('0xa')](),controller[_0x9e43('0xe')]);router['get'](_0x9e43('0xf'),auth[_0x9e43('0xa')](),controller[_0x9e43('0x10')]);router[_0x9e43('0xc')](_0x9e43('0x11'),auth['isAuthenticated'](),controller[_0x9e43('0x12')]);router['get'](_0x9e43('0x13'),auth[_0x9e43('0xa')](),controller['getLists']);router['get'](_0x9e43('0x14'),auth[_0x9e43('0xa')](),controller[_0x9e43('0x15')]);router[_0x9e43('0x16')]('/',auth['isAuthenticated'](),controller[_0x9e43('0x17')]);router['post']('/:id/clone',auth['isAuthenticated'](),controller[_0x9e43('0x18')]);router[_0x9e43('0x16')](_0x9e43('0x13'),auth['isAuthenticated'](),controller[_0x9e43('0x19')]);router['post'](_0x9e43('0x14'),auth[_0x9e43('0xa')](),controller['addBlackLists']);router[_0x9e43('0x1a')]('/:id',auth[_0x9e43('0xa')](),controller[_0x9e43('0x1b')]);router[_0x9e43('0x1c')]('/:id',auth[_0x9e43('0xa')](),controller[_0x9e43('0x1d')]);router[_0x9e43('0x1c')](_0x9e43('0x13'),auth[_0x9e43('0xa')](),controller[_0x9e43('0x1e')]);router[_0x9e43('0x1c')](_0x9e43('0x14'),auth[_0x9e43('0xa')](),controller[_0x9e43('0x1f')]);module[_0x9e43('0x20')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 7ed0d89..afe3973 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 _0x04e9=['TEXT','medium','VIRTUAL','getDataValue','key','STRING'];(function(_0x333a74,_0x4e5043){var _0x5d1062=function(_0x2ae6a3){while(--_0x2ae6a3){_0x333a74['push'](_0x333a74['shift']());}};_0x5d1062(++_0x4e5043);}(_0x04e9,0x173));var _0x904e=function(_0x16aefb,_0x14361a){_0x16aefb=_0x16aefb-0x0;var _0x31afb2=_0x04e9[_0x16aefb];return _0x31afb2;};'use strict';var Sequelize=require('sequelize');module['exports']={'key':{'type':Sequelize[_0x904e('0x0')],'allowNull':![]},'value':{'type':Sequelize[_0x904e('0x1')],'length':_0x904e('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x904e('0x3')],'get':function(){return this[_0x904e('0x4')](_0x904e('0x5'));}}};
\ No newline at end of file
+var _0x3413=['getDataValue','key','sequelize','exports','TEXT','medium'];(function(_0xec3584,_0x28f47e){var _0x272b72=function(_0x424537){while(--_0x424537){_0xec3584['push'](_0xec3584['shift']());}};_0x272b72(++_0x28f47e);}(_0x3413,0x68));var _0x3341=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3413[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3341('0x0'));module[_0x3341('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x3341('0x2')],'length':_0x3341('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x3341('0x4')](_0x3341('0x5'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 1f51b31..84da57a 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 _0x273e=['util','path','to-csv','ejs','fs-extra','lodash','squel','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','apply','save','update','then','get','CannedAnswers','UserProfileResource','end','sendStatus','name','send','index','map','CannedAnswer','fieldName','type','key','model','query','keys','filters','intersection','fields','hasOwnProperty','nolimit','order','sort','where','merge','filter','includeAll','findAll','rows','show','params','rawAttributes','attributes','length','include','find','catch','body','destroy','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache'];(function(_0x259cad,_0x3dae11){var _0x4e6a68=function(_0x1669dc){while(--_0x1669dc){_0x259cad['push'](_0x259cad['shift']());}};_0x4e6a68(++_0x3dae11);}(_0x273e,0x1ac));var _0xe273=function(_0x3725d7,_0x99c771){_0x3725d7=_0x3725d7-0x0;var _0x3764cc=_0x273e[_0x3725d7];return _0x3764cc;};'use strict';var emlformat=require(_0xe273('0x0'));var rimraf=require(_0xe273('0x1'));var zipdir=require(_0xe273('0x2'));var jsonpatch=require(_0xe273('0x3'));var rp=require(_0xe273('0x4'));var moment=require('moment');var BPromise=require(_0xe273('0x5'));var Mustache=require(_0xe273('0x6'));var util=require(_0xe273('0x7'));var path=require(_0xe273('0x8'));var sox=require('sox');var csv=require(_0xe273('0x9'));var ejs=require(_0xe273('0xa'));var fs=require('fs');var fs_extra=require(_0xe273('0xb'));var _=require(_0xe273('0xc'));var squel=require(_0xe273('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe273('0x9'));var querystring=require(_0xe273('0xe'));var Papa=require('papaparse');var Redis=require(_0xe273('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe273('0x10'));var as=require(_0xe273('0x11'));var hardwareService=require(_0xe273('0x12'));var logger=require('../../config/logger')(_0xe273('0x13'));var utils=require('../../config/utils');var config=require(_0xe273('0x14'));var licenseUtil=require(_0xe273('0x15'));var db=require(_0xe273('0x16'))['db'];function respondWithStatusCode(_0x3d0ddf,_0xd8675c){_0xd8675c=_0xd8675c||0xcc;return function(_0x4e93b4){if(_0x4e93b4){return _0x3d0ddf['sendStatus'](_0xd8675c);}return _0x3d0ddf[_0xe273('0x17')](_0xd8675c)['end']();};}function respondWithResult(_0x5daded,_0x3cf152){_0x3cf152=_0x3cf152||0xc8;return function(_0x507f5b){if(_0x507f5b){return _0x5daded[_0xe273('0x17')](_0x3cf152)[_0xe273('0x18')](_0x507f5b);}};}function respondWithFilteredResult(_0x5ce816,_0x2b63e0){return function(_0x2d7e58){if(_0x2d7e58){var _0x5d6d41=typeof _0x2b63e0[_0xe273('0x19')]===_0xe273('0x1a')&&typeof _0x2b63e0[_0xe273('0x1b')]==='undefined';var _0x2208b5=_0x2d7e58[_0xe273('0x1c')];var _0x1eedb3=_0x5d6d41?0x0:_0x2b63e0[_0xe273('0x19')];var _0x3e070a=_0x5d6d41?_0x2d7e58[_0xe273('0x1c')]:_0x2b63e0[_0xe273('0x19')]+_0x2b63e0[_0xe273('0x1b')];var _0xaa4e3f;if(_0x3e070a>=_0x2208b5){_0x3e070a=_0x2208b5;_0xaa4e3f=0xc8;}else{_0xaa4e3f=0xce;}_0x5ce816[_0xe273('0x17')](_0xaa4e3f);return _0x5ce816[_0xe273('0x1d')]('Content-Range',_0x1eedb3+'-'+_0x3e070a+'/'+_0x2208b5)[_0xe273('0x18')](_0x2d7e58);}return null;};}function patchUpdates(_0x6b49de){return function(_0x2b971b){try{jsonpatch[_0xe273('0x1e')](_0x2b971b,_0x6b49de,!![]);}catch(_0xf0e8fc){return BPromise['reject'](_0xf0e8fc);}return _0x2b971b[_0xe273('0x1f')]();};}function saveUpdates(_0x34cec4,_0x30a80a){return function(_0x3efd43){if(_0x3efd43){return _0x3efd43[_0xe273('0x20')](_0x34cec4)[_0xe273('0x21')](function(_0x2ed8f4){return _0x2ed8f4;});}return null;};}function removeEntity(_0x3262fa,_0x24ee11){return function(_0x405eef){if(_0x405eef){return _0x405eef['destroy']()[_0xe273('0x21')](function(){var _0x298f18=_0x405eef[_0xe273('0x22')]({'plain':!![]});var _0x2a1f1c=_0xe273('0x23');return db[_0xe273('0x24')]['destroy']({'where':{'type':_0x2a1f1c,'resourceId':_0x298f18['id']}})['then'](function(){return _0x405eef;});})[_0xe273('0x21')](function(){_0x3262fa[_0xe273('0x17')](0xcc)[_0xe273('0x25')]();});}};}function handleEntityNotFound(_0x53a4fe,_0x35970e){return function(_0xda34c4){if(!_0xda34c4){_0x53a4fe[_0xe273('0x26')](0x194);}return _0xda34c4;};}function handleError(_0x29bde6,_0x5a8445){_0x5a8445=_0x5a8445||0x1f4;return function(_0x566dd6){logger['error'](_0x566dd6['stack']);if(_0x566dd6[_0xe273('0x27')]){delete _0x566dd6[_0xe273('0x27')];}_0x29bde6[_0xe273('0x17')](_0x5a8445)[_0xe273('0x28')](_0x566dd6);};}exports[_0xe273('0x29')]=function(_0x64c7e8,_0x34fdac){var _0x5e5cf2={},_0x156415={},_0x118c3c={'count':0x0,'rows':[]};var _0x3e43b8=_[_0xe273('0x2a')](db[_0xe273('0x2b')]['rawAttributes'],function(_0x3bc85a){return{'name':_0x3bc85a[_0xe273('0x2c')],'type':_0x3bc85a[_0xe273('0x2d')][_0xe273('0x2e')]};});_0x156415[_0xe273('0x2f')]=_[_0xe273('0x2a')](_0x3e43b8,'name');_0x156415[_0xe273('0x30')]=_[_0xe273('0x31')](_0x64c7e8[_0xe273('0x30')]);_0x156415[_0xe273('0x32')]=_[_0xe273('0x33')](_0x156415[_0xe273('0x2f')],_0x156415[_0xe273('0x30')]);_0x5e5cf2['attributes']=_['intersection'](_0x156415[_0xe273('0x2f')],qs[_0xe273('0x34')](_0x64c7e8[_0xe273('0x30')]['fields']));_0x5e5cf2['attributes']=_0x5e5cf2['attributes']['length']?_0x5e5cf2['attributes']:_0x156415[_0xe273('0x2f')];if(!_0x64c7e8[_0xe273('0x30')][_0xe273('0x35')](_0xe273('0x36'))){_0x5e5cf2[_0xe273('0x1b')]=qs[_0xe273('0x1b')](_0x64c7e8[_0xe273('0x30')][_0xe273('0x1b')]);_0x5e5cf2['offset']=qs[_0xe273('0x19')](_0x64c7e8[_0xe273('0x30')][_0xe273('0x19')]);}_0x5e5cf2[_0xe273('0x37')]=qs[_0xe273('0x38')](_0x64c7e8['query']['sort']);_0x5e5cf2[_0xe273('0x39')]=qs[_0xe273('0x32')](_['pick'](_0x64c7e8[_0xe273('0x30')],_0x156415[_0xe273('0x32')]),_0x3e43b8);if(_0x64c7e8[_0xe273('0x30')]['filter']){_0x5e5cf2[_0xe273('0x39')]=_[_0xe273('0x3a')](_0x5e5cf2[_0xe273('0x39')],{'$or':[{'key':{'$like':'%'+_0x64c7e8[_0xe273('0x30')][_0xe273('0x3b')]+'%'}},{'value':{'$like':'%'+_0x64c7e8['query']['filter']+'%'}}]});}_0x5e5cf2=_[_0xe273('0x3a')]({},_0x5e5cf2,_0x64c7e8['options']);var _0x48cf3c={'where':_0x5e5cf2[_0xe273('0x39')]};return db[_0xe273('0x2b')]['count'](_0x48cf3c)[_0xe273('0x21')](function(_0xb070e0){_0x118c3c[_0xe273('0x1c')]=_0xb070e0;if(_0x64c7e8[_0xe273('0x30')][_0xe273('0x3c')]){_0x5e5cf2['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xe273('0x3d')](_0x5e5cf2);})['then'](function(_0x272bcd){_0x118c3c[_0xe273('0x3e')]=_0x272bcd;return _0x118c3c;})['then'](respondWithFilteredResult(_0x34fdac,_0x5e5cf2))['catch'](handleError(_0x34fdac,null));};exports[_0xe273('0x3f')]=function(_0x3ed147,_0x30cb26){var _0x5309a3={'raw':!![],'where':{'id':_0x3ed147[_0xe273('0x40')]['id']}},_0x4e4f1e={};_0x4e4f1e[_0xe273('0x2f')]=_[_0xe273('0x31')](db[_0xe273('0x2b')][_0xe273('0x41')]);_0x4e4f1e[_0xe273('0x30')]=_['keys'](_0x3ed147['query']);_0x4e4f1e[_0xe273('0x32')]=_[_0xe273('0x33')](_0x4e4f1e[_0xe273('0x2f')],_0x4e4f1e[_0xe273('0x30')]);_0x5309a3[_0xe273('0x42')]=_[_0xe273('0x33')](_0x4e4f1e['model'],qs[_0xe273('0x34')](_0x3ed147[_0xe273('0x30')]['fields']));_0x5309a3[_0xe273('0x42')]=_0x5309a3[_0xe273('0x42')][_0xe273('0x43')]?_0x5309a3[_0xe273('0x42')]:_0x4e4f1e[_0xe273('0x2f')];if(_0x3ed147[_0xe273('0x30')][_0xe273('0x3c')]){_0x5309a3[_0xe273('0x44')]=[{'all':!![]}];}_0x5309a3=_[_0xe273('0x3a')]({},_0x5309a3,_0x3ed147['options']);return db[_0xe273('0x2b')][_0xe273('0x45')](_0x5309a3)[_0xe273('0x21')](handleEntityNotFound(_0x30cb26,null))['then'](respondWithResult(_0x30cb26,null))[_0xe273('0x46')](handleError(_0x30cb26,null));};exports[_0xe273('0x20')]=function(_0x385fb8,_0x307bfd){if(_0x385fb8['body']['id']){delete _0x385fb8[_0xe273('0x47')]['id'];}return db[_0xe273('0x2b')]['find']({'where':{'id':_0x385fb8[_0xe273('0x40')]['id']}})[_0xe273('0x21')](handleEntityNotFound(_0x307bfd,null))[_0xe273('0x21')](saveUpdates(_0x385fb8[_0xe273('0x47')],null))['then'](respondWithResult(_0x307bfd,null))['catch'](handleError(_0x307bfd,null));};exports[_0xe273('0x48')]=function(_0x4f9b06,_0x38380b){return db[_0xe273('0x2b')][_0xe273('0x45')]({'where':{'id':_0x4f9b06[_0xe273('0x40')]['id']}})[_0xe273('0x21')](handleEntityNotFound(_0x38380b,null))[_0xe273('0x21')](removeEntity(_0x38380b,null))['catch'](handleError(_0x38380b,null));};exports[_0xe273('0x49')]=function(_0x1cb61c,_0xd780c5){var _0x389ec5={'key':_0x1cb61c[_0xe273('0x47')][_0xe273('0x2e')]};if(_0x1cb61c[_0xe273('0x47')][_0xe273('0x4a')]){_0x389ec5['MailAccountId']=_0x1cb61c[_0xe273('0x47')][_0xe273('0x4a')];}else if(_0x1cb61c[_0xe273('0x47')]['SmsAccountId']){_0x389ec5[_0xe273('0x4b')]=_0x1cb61c[_0xe273('0x47')]['SmsAccountId'];}else if(_0x1cb61c[_0xe273('0x47')][_0xe273('0x4c')]){_0x389ec5[_0xe273('0x4c')]=_0x1cb61c['body'][_0xe273('0x4c')];}else if(_0x1cb61c[_0xe273('0x47')][_0xe273('0x4d')]){_0x389ec5[_0xe273('0x4d')]=_0x1cb61c['body'][_0xe273('0x4d')];}return db['CannedAnswer'][_0xe273('0x45')]({'where':_0x389ec5})[_0xe273('0x21')](function(_0x2bcf39){if(_0x2bcf39){throw new db[(_0xe273('0x4e'))][(_0xe273('0x4f'))](_0xe273('0x50'));}return db[_0xe273('0x2b')]['create'](_0x1cb61c[_0xe273('0x47')]);})[_0xe273('0x21')](function(_0x3c1737){var _0x267823=_0x1cb61c[_0xe273('0x51')][_0xe273('0x22')]({'plain':!![]});if(!_0x267823)throw new Error(_0xe273('0x52'));if(_0x267823[_0xe273('0x53')]===_0xe273('0x51')){var _0x34b8f8=_0x3c1737[_0xe273('0x22')]({'plain':!![]});return db[_0xe273('0x54')]['find']({'where':{'name':_0xe273('0x23'),'userProfileId':_0x267823['userProfileId']},'raw':!![]})[_0xe273('0x21')](function(_0x2e1ab7){if(_0x2e1ab7&&_0x2e1ab7[_0xe273('0x55')]===0x0){return db[_0xe273('0x24')][_0xe273('0x49')]({'name':_0x34b8f8[_0xe273('0x27')],'resourceId':_0x34b8f8['id'],'type':_0x2e1ab7[_0xe273('0x27')],'sectionId':_0x2e1ab7['id']},{})['then'](function(){return _0x3c1737;});}else{return _0x3c1737;}})[_0xe273('0x46')](function(_0x952593){logger['error'](_0xe273('0x56'),_0x952593);throw _0x952593;});}return _0x3c1737;})[_0xe273('0x21')](respondWithResult(_0xd780c5,0xc9))[_0xe273('0x46')](handleError(_0xd780c5,null));};
\ No newline at end of file
+var _0xce7e=['where','filter','options','includeAll','include','findAll','rows','catch','show','find','update','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','UserProfileSection','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','json','reject','save','then','get','CannedAnswers','UserProfileResource','error','stack','name','index','CannedAnswer','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','merge'];(function(_0x275d85,_0x5a883e){var _0x3cd754=function(_0x209dee){while(--_0x209dee){_0x275d85['push'](_0x275d85['shift']());}};_0x3cd754(++_0x5a883e);}(_0xce7e,0x106));var _0xece7=function(_0x2e86e8,_0x25bf06){_0x2e86e8=_0x2e86e8-0x0;var _0x1f065a=_0xce7e[_0x2e86e8];return _0x1f065a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xece7('0x0'));var zipdir=require(_0xece7('0x1'));var jsonpatch=require(_0xece7('0x2'));var rp=require(_0xece7('0x3'));var moment=require(_0xece7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xece7('0x5'));var util=require(_0xece7('0x6'));var path=require(_0xece7('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xece7('0x8'));var fs=require('fs');var fs_extra=require(_0xece7('0x9'));var _=require('lodash');var squel=require(_0xece7('0xa'));var crypto=require('crypto');var jsforce=require(_0xece7('0xb'));var deskjs=require(_0xece7('0xc'));var toCsv=require(_0xece7('0xd'));var querystring=require(_0xece7('0xe'));var Papa=require(_0xece7('0xf'));var Redis=require('ioredis');var authService=require(_0xece7('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xece7('0x11'));var logger=require(_0xece7('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xece7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xece7('0x14'))['db'];function respondWithStatusCode(_0x335cad,_0x1949b8){_0x1949b8=_0x1949b8||0xcc;return function(_0x57e56c){if(_0x57e56c){return _0x335cad[_0xece7('0x15')](_0x1949b8);}return _0x335cad[_0xece7('0x16')](_0x1949b8)[_0xece7('0x17')]();};}function respondWithResult(_0x4c0660,_0x352353){_0x352353=_0x352353||0xc8;return function(_0x5899a1){if(_0x5899a1){return _0x4c0660[_0xece7('0x16')](_0x352353)['json'](_0x5899a1);}};}function respondWithFilteredResult(_0x5ce44d,_0x5ce872){return function(_0x385d7b){if(_0x385d7b){var _0x513645=typeof _0x5ce872[_0xece7('0x18')]===_0xece7('0x19')&&typeof _0x5ce872[_0xece7('0x1a')]==='undefined';var _0x449f48=_0x385d7b[_0xece7('0x1b')];var _0x33414b=_0x513645?0x0:_0x5ce872['offset'];var _0x237519=_0x513645?_0x385d7b[_0xece7('0x1b')]:_0x5ce872[_0xece7('0x18')]+_0x5ce872[_0xece7('0x1a')];var _0x1d39f3;if(_0x237519>=_0x449f48){_0x237519=_0x449f48;_0x1d39f3=0xc8;}else{_0x1d39f3=0xce;}_0x5ce44d[_0xece7('0x16')](_0x1d39f3);return _0x5ce44d['set']('Content-Range',_0x33414b+'-'+_0x237519+'/'+_0x449f48)[_0xece7('0x1c')](_0x385d7b);}return null;};}function patchUpdates(_0x3344b7){return function(_0x34615d){try{jsonpatch['apply'](_0x34615d,_0x3344b7,!![]);}catch(_0x1343e2){return BPromise[_0xece7('0x1d')](_0x1343e2);}return _0x34615d[_0xece7('0x1e')]();};}function saveUpdates(_0x5741a1,_0x5d3ed6){return function(_0x1e7ad3){if(_0x1e7ad3){return _0x1e7ad3['update'](_0x5741a1)[_0xece7('0x1f')](function(_0x183b75){return _0x183b75;});}return null;};}function removeEntity(_0x34a833,_0x12a852){return function(_0x14da43){if(_0x14da43){return _0x14da43['destroy']()[_0xece7('0x1f')](function(){var _0x421a50=_0x14da43[_0xece7('0x20')]({'plain':!![]});var _0x1d64a3=_0xece7('0x21');return db[_0xece7('0x22')]['destroy']({'where':{'type':_0x1d64a3,'resourceId':_0x421a50['id']}})[_0xece7('0x1f')](function(){return _0x14da43;});})['then'](function(){_0x34a833[_0xece7('0x16')](0xcc)[_0xece7('0x17')]();});}};}function handleEntityNotFound(_0x2e82c5,_0x238d73){return function(_0x239dc1){if(!_0x239dc1){_0x2e82c5[_0xece7('0x15')](0x194);}return _0x239dc1;};}function handleError(_0x2706f0,_0x4fa2c3){_0x4fa2c3=_0x4fa2c3||0x1f4;return function(_0x450722){logger[_0xece7('0x23')](_0x450722[_0xece7('0x24')]);if(_0x450722[_0xece7('0x25')]){delete _0x450722[_0xece7('0x25')];}_0x2706f0['status'](_0x4fa2c3)['send'](_0x450722);};}exports[_0xece7('0x26')]=function(_0x190ba2,_0x5c2f72){var _0x593573={},_0x45a213={},_0x76400c={'count':0x0,'rows':[]};var _0x5bfd19=_['map'](db[_0xece7('0x27')][_0xece7('0x28')],function(_0xa6374b){return{'name':_0xa6374b[_0xece7('0x29')],'type':_0xa6374b['type'][_0xece7('0x2a')]};});_0x45a213[_0xece7('0x2b')]=_[_0xece7('0x2c')](_0x5bfd19,_0xece7('0x25'));_0x45a213[_0xece7('0x2d')]=_[_0xece7('0x2e')](_0x190ba2[_0xece7('0x2d')]);_0x45a213[_0xece7('0x2f')]=_[_0xece7('0x30')](_0x45a213['model'],_0x45a213[_0xece7('0x2d')]);_0x593573[_0xece7('0x31')]=_[_0xece7('0x30')](_0x45a213[_0xece7('0x2b')],qs[_0xece7('0x32')](_0x190ba2[_0xece7('0x2d')]['fields']));_0x593573[_0xece7('0x31')]=_0x593573[_0xece7('0x31')][_0xece7('0x33')]?_0x593573[_0xece7('0x31')]:_0x45a213[_0xece7('0x2b')];if(!_0x190ba2[_0xece7('0x2d')][_0xece7('0x34')](_0xece7('0x35'))){_0x593573[_0xece7('0x1a')]=qs['limit'](_0x190ba2[_0xece7('0x2d')][_0xece7('0x1a')]);_0x593573[_0xece7('0x18')]=qs[_0xece7('0x18')](_0x190ba2[_0xece7('0x2d')]['offset']);}_0x593573[_0xece7('0x36')]=qs[_0xece7('0x37')](_0x190ba2[_0xece7('0x2d')][_0xece7('0x37')]);_0x593573['where']=qs[_0xece7('0x2f')](_[_0xece7('0x38')](_0x190ba2[_0xece7('0x2d')],_0x45a213[_0xece7('0x2f')]),_0x5bfd19);if(_0x190ba2['query']['filter']){_0x593573['where']=_[_0xece7('0x39')](_0x593573[_0xece7('0x3a')],{'$or':[{'key':{'$like':'%'+_0x190ba2[_0xece7('0x2d')][_0xece7('0x3b')]+'%'}},{'value':{'$like':'%'+_0x190ba2['query'][_0xece7('0x3b')]+'%'}}]});}_0x593573=_[_0xece7('0x39')]({},_0x593573,_0x190ba2[_0xece7('0x3c')]);var _0x461515={'where':_0x593573[_0xece7('0x3a')]};return db[_0xece7('0x27')][_0xece7('0x1b')](_0x461515)[_0xece7('0x1f')](function(_0x35e233){_0x76400c[_0xece7('0x1b')]=_0x35e233;if(_0x190ba2[_0xece7('0x2d')][_0xece7('0x3d')]){_0x593573[_0xece7('0x3e')]=[{'all':!![]}];}return db[_0xece7('0x27')][_0xece7('0x3f')](_0x593573);})[_0xece7('0x1f')](function(_0x3700e5){_0x76400c[_0xece7('0x40')]=_0x3700e5;return _0x76400c;})['then'](respondWithFilteredResult(_0x5c2f72,_0x593573))[_0xece7('0x41')](handleError(_0x5c2f72,null));};exports[_0xece7('0x42')]=function(_0x3e0401,_0x59d998){var _0x3cd57e={'raw':!![],'where':{'id':_0x3e0401['params']['id']}},_0x4d9777={};_0x4d9777[_0xece7('0x2b')]=_[_0xece7('0x2e')](db[_0xece7('0x27')][_0xece7('0x28')]);_0x4d9777['query']=_[_0xece7('0x2e')](_0x3e0401[_0xece7('0x2d')]);_0x4d9777[_0xece7('0x2f')]=_[_0xece7('0x30')](_0x4d9777[_0xece7('0x2b')],_0x4d9777[_0xece7('0x2d')]);_0x3cd57e[_0xece7('0x31')]=_[_0xece7('0x30')](_0x4d9777[_0xece7('0x2b')],qs['fields'](_0x3e0401['query'][_0xece7('0x32')]));_0x3cd57e['attributes']=_0x3cd57e[_0xece7('0x31')][_0xece7('0x33')]?_0x3cd57e[_0xece7('0x31')]:_0x4d9777[_0xece7('0x2b')];if(_0x3e0401['query'][_0xece7('0x3d')]){_0x3cd57e[_0xece7('0x3e')]=[{'all':!![]}];}_0x3cd57e=_[_0xece7('0x39')]({},_0x3cd57e,_0x3e0401[_0xece7('0x3c')]);return db[_0xece7('0x27')][_0xece7('0x43')](_0x3cd57e)[_0xece7('0x1f')](handleEntityNotFound(_0x59d998,null))['then'](respondWithResult(_0x59d998,null))[_0xece7('0x41')](handleError(_0x59d998,null));};exports[_0xece7('0x44')]=function(_0x383284,_0x1468e7){if(_0x383284[_0xece7('0x45')]['id']){delete _0x383284['body']['id'];}return db['CannedAnswer'][_0xece7('0x43')]({'where':{'id':_0x383284['params']['id']}})[_0xece7('0x1f')](handleEntityNotFound(_0x1468e7,null))[_0xece7('0x1f')](saveUpdates(_0x383284['body'],null))[_0xece7('0x1f')](respondWithResult(_0x1468e7,null))[_0xece7('0x41')](handleError(_0x1468e7,null));};exports['destroy']=function(_0x44cbf2,_0x2a5e21){return db[_0xece7('0x27')][_0xece7('0x43')]({'where':{'id':_0x44cbf2[_0xece7('0x46')]['id']}})['then'](handleEntityNotFound(_0x2a5e21,null))[_0xece7('0x1f')](removeEntity(_0x2a5e21,null))[_0xece7('0x41')](handleError(_0x2a5e21,null));};exports[_0xece7('0x47')]=function(_0x3e775a,_0x309716){var _0x4067fe={'key':_0x3e775a[_0xece7('0x45')][_0xece7('0x2a')]};if(_0x3e775a[_0xece7('0x45')][_0xece7('0x48')]){_0x4067fe[_0xece7('0x48')]=_0x3e775a[_0xece7('0x45')][_0xece7('0x48')];}else if(_0x3e775a[_0xece7('0x45')][_0xece7('0x49')]){_0x4067fe[_0xece7('0x49')]=_0x3e775a[_0xece7('0x45')][_0xece7('0x49')];}else if(_0x3e775a[_0xece7('0x45')][_0xece7('0x4a')]){_0x4067fe[_0xece7('0x4a')]=_0x3e775a['body']['OpenchannelAccountId'];}else if(_0x3e775a['body']['ChatWebsiteId']){_0x4067fe[_0xece7('0x4b')]=_0x3e775a[_0xece7('0x45')][_0xece7('0x4b')];}return db[_0xece7('0x27')][_0xece7('0x43')]({'where':_0x4067fe})[_0xece7('0x1f')](function(_0x288e85){if(_0x288e85){throw new db['Sequelize'][(_0xece7('0x4c'))](_0xece7('0x4d'));}return db[_0xece7('0x27')]['create'](_0x3e775a[_0xece7('0x45')]);})[_0xece7('0x1f')](function(_0x4fd346){var _0x5ee11d=_0x3e775a[_0xece7('0x4e')][_0xece7('0x20')]({'plain':!![]});if(!_0x5ee11d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5ee11d['role']===_0xece7('0x4e')){var _0x459ccb=_0x4fd346['get']({'plain':!![]});return db[_0xece7('0x4f')]['find']({'where':{'name':_0xece7('0x21'),'userProfileId':_0x5ee11d['userProfileId']},'raw':!![]})[_0xece7('0x1f')](function(_0x571173){if(_0x571173&&_0x571173['autoAssociation']===0x0){return db['UserProfileResource'][_0xece7('0x47')]({'name':_0x459ccb[_0xece7('0x25')],'resourceId':_0x459ccb['id'],'type':_0x571173[_0xece7('0x25')],'sectionId':_0x571173['id']},{})['then'](function(){return _0x4fd346;});}else{return _0x4fd346;}})[_0xece7('0x41')](function(_0x214f58){logger[_0xece7('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x214f58);throw _0x214f58;});}return _0x4fd346;})[_0xece7('0x1f')](respondWithResult(_0x309716,0xc9))[_0xece7('0x41')](handleError(_0x309716,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 03f5927..42da8df 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 _0x0962=['../../config/environment','./cannedAnswer.attributes','define','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3d0d63,_0x39cfa5){var _0x11dafe=function(_0x4f9a5e){while(--_0x4f9a5e){_0x3d0d63['push'](_0x3d0d63['shift']());}};_0x11dafe(++_0x39cfa5);}(_0x0962,0x116));var _0x2096=function(_0x3a9d5a,_0x4da2d1){_0x3a9d5a=_0x3a9d5a-0x0;var _0x141eda=_0x0962[_0x3a9d5a];return _0x141eda;};'use strict';var _=require(_0x2096('0x0'));var util=require(_0x2096('0x1'));var logger=require(_0x2096('0x2'))(_0x2096('0x3'));var moment=require(_0x2096('0x4'));var BPromise=require(_0x2096('0x5'));var rp=require(_0x2096('0x6'));var fs=require('fs');var path=require(_0x2096('0x7'));var rimraf=require('rimraf');var config=require(_0x2096('0x8'));var attributes=require(_0x2096('0x9'));module['exports']=function(_0x233148,_0x38b92b){return _0x233148[_0x2096('0xa')]('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2096('0xb'),'collate':_0x2096('0xc')});};
\ No newline at end of file
+var _0x3ea3=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','exports','define','tools_canned_answers','utf8mb4_unicode_ci','lodash'];(function(_0xde1219,_0x1702f7){var _0x213431=function(_0x5b8566){while(--_0x5b8566){_0xde1219['push'](_0xde1219['shift']());}};_0x213431(++_0x1702f7);}(_0x3ea3,0x1c7));var _0x33ea=function(_0x3821a8,_0x1ddaf8){_0x3821a8=_0x3821a8-0x0;var _0x19c8c=_0x3ea3[_0x3821a8];return _0x19c8c;};'use strict';var _=require(_0x33ea('0x0'));var util=require(_0x33ea('0x1'));var logger=require(_0x33ea('0x2'))(_0x33ea('0x3'));var moment=require(_0x33ea('0x4'));var BPromise=require('bluebird');var rp=require(_0x33ea('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x33ea('0x6'));var config=require(_0x33ea('0x7'));var attributes=require('./cannedAnswer.attributes');module[_0x33ea('0x8')]=function(_0x5152d1,_0x38ba3d){return _0x5152d1[_0x33ea('0x9')]('CannedAnswer',attributes,{'tableName':_0x33ea('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x33ea('0xb')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index dc045cb..88bb4aa 100644
--- a/server/api/cannedAnswer/cannedAnswer.rpc.js
+++ b/server/api/cannedAnswer/cannedAnswer.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x20c719,_0x4da4f9){var _0x15954c=function(_0x1eb76c){while(--_0x1eb76c){_0x20c719['push'](_0x20c719['shift']());}};_0x15954c(++_0x4da4f9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
+var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3cfe26,_0xf4ecef){var _0x390996=function(_0x33daca){while(--_0x33daca){_0x3cfe26['push'](_0x3cfe26['shift']());}};_0x390996(++_0xf4ecef);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js
index 9a7c87e..1e56a15 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 _0xa213=['create','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa213,0x181));var _0x3a21=function(_0x5ee5b5,_0x31c99c){_0x5ee5b5=_0x5ee5b5-0x0;var _0x6f8eb9=_0xa213[_0x5ee5b5];return _0x6f8eb9;};'use strict';var multer=require('multer');var util=require(_0x3a21('0x0'));var path=require(_0x3a21('0x1'));var timeout=require(_0x3a21('0x2'));var express=require(_0x3a21('0x3'));var router=express[_0x3a21('0x4')]();var fs_extra=require(_0x3a21('0x5'));var auth=require(_0x3a21('0x6'));var interaction=require(_0x3a21('0x7'));var config=require(_0x3a21('0x8'));var controller=require('./cannedAnswer.controller');router[_0x3a21('0x9')]('/',auth[_0x3a21('0xa')](),controller[_0x3a21('0xb')]);router[_0x3a21('0x9')](_0x3a21('0xc'),auth['isAuthenticated'](),controller[_0x3a21('0xd')]);router[_0x3a21('0xe')]('/',auth['isAuthenticated'](),controller[_0x3a21('0xf')]);router[_0x3a21('0x10')](_0x3a21('0xc'),auth[_0x3a21('0xa')](),controller['update']);router[_0x3a21('0x11')](_0x3a21('0xc'),auth[_0x3a21('0xa')](),controller[_0x3a21('0x12')]);module[_0x3a21('0x13')]=router;
\ No newline at end of file
+var _0xae24=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','show','create','put','/:id','update','destroy'];(function(_0x20aadb,_0x5a607a){var _0x520018=function(_0x1d258a){while(--_0x1d258a){_0x20aadb['push'](_0x20aadb['shift']());}};_0x520018(++_0x5a607a);}(_0xae24,0x1a3));var _0x4ae2=function(_0x18a65f,_0x1b638d){_0x18a65f=_0x18a65f-0x0;var _0xed28c7=_0xae24[_0x18a65f];return _0xed28c7;};'use strict';var multer=require(_0x4ae2('0x0'));var util=require(_0x4ae2('0x1'));var path=require(_0x4ae2('0x2'));var timeout=require(_0x4ae2('0x3'));var express=require(_0x4ae2('0x4'));var router=express['Router']();var fs_extra=require(_0x4ae2('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4ae2('0x6'));var config=require(_0x4ae2('0x7'));var controller=require(_0x4ae2('0x8'));router[_0x4ae2('0x9')]('/',auth[_0x4ae2('0xa')](),controller[_0x4ae2('0xb')]);router['get']('/:id',auth[_0x4ae2('0xa')](),controller[_0x4ae2('0xc')]);router['post']('/',auth[_0x4ae2('0xa')](),controller[_0x4ae2('0xd')]);router[_0x4ae2('0xe')](_0x4ae2('0xf'),auth[_0x4ae2('0xa')](),controller[_0x4ae2('0x10')]);router['delete'](_0x4ae2('0xf'),auth['isAuthenticated'](),controller[_0x4ae2('0x11')]);module[_0x4ae2('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 0960d23..3f9546f 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 _0x608c=['STRING','INTEGER','sequelize','DATE','1970-01-01\x2000:00:01'];(function(_0x553c78,_0x4656c2){var _0x2f68c5=function(_0x4b9fac){while(--_0x4b9fac){_0x553c78['push'](_0x553c78['shift']());}};_0x2f68c5(++_0x4656c2);}(_0x608c,0x1a1));var _0xc608=function(_0x38ff2b,_0x3a0316){_0x38ff2b=_0x38ff2b-0x0;var _0x341f5e=_0x608c[_0x38ff2b];return _0x341f5e;};'use strict';var Sequelize=require(_0xc608('0x0'));module['exports']={'calldate':{'type':Sequelize[_0xc608('0x1')],'allowNull':![],'defaultValue':_0xc608('0x2')},'clid':{'type':Sequelize[_0xc608('0x3')]},'src':{'type':Sequelize[_0xc608('0x3')]},'dst':{'type':Sequelize[_0xc608('0x3')]},'dcontext':{'type':Sequelize[_0xc608('0x3')]},'channel':{'type':Sequelize[_0xc608('0x3')]},'dstchannel':{'type':Sequelize[_0xc608('0x3')]},'lastapp':{'type':Sequelize[_0xc608('0x3')]},'lastdata':{'type':Sequelize[_0xc608('0x3')]},'duration':{'type':Sequelize[_0xc608('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xc608('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xc608('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xc608('0x3')]},'linkedid':{'type':Sequelize[_0xc608('0x3')]},'sequence':{'type':Sequelize[_0xc608('0x3')]},'peeraccount':{'type':Sequelize[_0xc608('0x3')]},'type':{'type':Sequelize[_0xc608('0x3')]},'tag':{'type':Sequelize[_0xc608('0x3')]}};
\ No newline at end of file
+var _0xacb8=['INTEGER','sequelize','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0x475846,_0x1538be){var _0x4a7f68=function(_0x53f655){while(--_0x53f655){_0x475846['push'](_0x475846['shift']());}};_0x4a7f68(++_0x1538be);}(_0xacb8,0x119));var _0x8acb=function(_0x3445b0,_0x362241){_0x3445b0=_0x3445b0-0x0;var _0x2251c0=_0xacb8[_0x3445b0];return _0x2251c0;};'use strict';var Sequelize=require(_0x8acb('0x0'));module['exports']={'calldate':{'type':Sequelize[_0x8acb('0x1')],'allowNull':![],'defaultValue':_0x8acb('0x2')},'clid':{'type':Sequelize[_0x8acb('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x8acb('0x3')]},'dcontext':{'type':Sequelize[_0x8acb('0x3')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x8acb('0x3')]},'lastapp':{'type':Sequelize[_0x8acb('0x3')]},'lastdata':{'type':Sequelize[_0x8acb('0x3')]},'duration':{'type':Sequelize[_0x8acb('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x8acb('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x8acb('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x8acb('0x3')]},'userfield':{'type':Sequelize[_0x8acb('0x3')]},'uniqueid':{'type':Sequelize[_0x8acb('0x3')]},'linkedid':{'type':Sequelize[_0x8acb('0x3')]},'sequence':{'type':Sequelize[_0x8acb('0x3')]},'peeraccount':{'type':Sequelize[_0x8acb('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 0d5112e..91c7fbd 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 _0xf006=['fieldName','keys','filters','intersection','model','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','type','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','destroy','describe','zip-dir','fast-json-patch','moment','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','count','set','Content-Range','reject','save','update','then','error','stack','name','send','index','map','Cdr','rawAttributes'];(function(_0x35387d,_0x1ba72f){var _0x3aba56=function(_0x42cd08){while(--_0x42cd08){_0x35387d['push'](_0x35387d['shift']());}};_0x3aba56(++_0x1ba72f);}(_0xf006,0x146));var _0x6f00=function(_0xc11280,_0x5c97b8){_0xc11280=_0xc11280-0x0;var _0x45b2f7=_0xf006[_0xc11280];return _0x45b2f7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6f00('0x0'));var jsonpatch=require(_0x6f00('0x1'));var rp=require('request-promise');var moment=require(_0x6f00('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x6f00('0x3'));var util=require('util');var path=require('path');var sox=require(_0x6f00('0x4'));var csv=require(_0x6f00('0x5'));var ejs=require(_0x6f00('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6f00('0x7'));var squel=require('squel');var crypto=require(_0x6f00('0x8'));var jsforce=require(_0x6f00('0x9'));var deskjs=require(_0x6f00('0xa'));var toCsv=require(_0x6f00('0x5'));var querystring=require(_0x6f00('0xb'));var Papa=require(_0x6f00('0xc'));var Redis=require(_0x6f00('0xd'));var authService=require(_0x6f00('0xe'));var qs=require(_0x6f00('0xf'));var as=require(_0x6f00('0x10'));var hardwareService=require(_0x6f00('0x11'));var logger=require(_0x6f00('0x12'))(_0x6f00('0x13'));var utils=require('../../config/utils');var config=require(_0x6f00('0x14'));var licenseUtil=require(_0x6f00('0x15'));var db=require(_0x6f00('0x16'))['db'];function respondWithStatusCode(_0x36a2ec,_0x289fe9){_0x289fe9=_0x289fe9||0xcc;return function(_0x5e3264){if(_0x5e3264){return _0x36a2ec[_0x6f00('0x17')](_0x289fe9);}return _0x36a2ec['status'](_0x289fe9)[_0x6f00('0x18')]();};}function respondWithResult(_0x5047f5,_0x324e67){_0x324e67=_0x324e67||0xc8;return function(_0x220e68){if(_0x220e68){return _0x5047f5[_0x6f00('0x19')](_0x324e67)[_0x6f00('0x1a')](_0x220e68);}};}function respondWithFilteredResult(_0xa6e7a1,_0x411203){return function(_0x46bc2c){if(_0x46bc2c){var _0x4d8aee=typeof _0x411203[_0x6f00('0x1b')]==='undefined'&&typeof _0x411203[_0x6f00('0x1c')]==='undefined';var _0x534275=_0x46bc2c[_0x6f00('0x1d')];var _0x6cf83f=_0x4d8aee?0x0:_0x411203[_0x6f00('0x1b')];var _0x340f78=_0x4d8aee?_0x46bc2c[_0x6f00('0x1d')]:_0x411203[_0x6f00('0x1b')]+_0x411203[_0x6f00('0x1c')];var _0x295640;if(_0x340f78>=_0x534275){_0x340f78=_0x534275;_0x295640=0xc8;}else{_0x295640=0xce;}_0xa6e7a1[_0x6f00('0x19')](_0x295640);return _0xa6e7a1[_0x6f00('0x1e')](_0x6f00('0x1f'),_0x6cf83f+'-'+_0x340f78+'/'+_0x534275)[_0x6f00('0x1a')](_0x46bc2c);}return null;};}function patchUpdates(_0x4e11de){return function(_0x4f3031){try{jsonpatch['apply'](_0x4f3031,_0x4e11de,!![]);}catch(_0x2a5286){return BPromise[_0x6f00('0x20')](_0x2a5286);}return _0x4f3031[_0x6f00('0x21')]();};}function saveUpdates(_0x57340f,_0xe301e5){return function(_0x9066ff){if(_0x9066ff){return _0x9066ff[_0x6f00('0x22')](_0x57340f)[_0x6f00('0x23')](function(_0x388983){return _0x388983;});}return null;};}function removeEntity(_0x1cbf1c,_0x90d74c){return function(_0x1ea061){if(_0x1ea061){return _0x1ea061['destroy']()[_0x6f00('0x23')](function(){_0x1cbf1c[_0x6f00('0x19')](0xcc)[_0x6f00('0x18')]();});}};}function handleEntityNotFound(_0x4d41ef,_0x37f062){return function(_0x4f7e29){if(!_0x4f7e29){_0x4d41ef[_0x6f00('0x17')](0x194);}return _0x4f7e29;};}function handleError(_0x511293,_0x434735){_0x434735=_0x434735||0x1f4;return function(_0x39375d){logger[_0x6f00('0x24')](_0x39375d[_0x6f00('0x25')]);if(_0x39375d[_0x6f00('0x26')]){delete _0x39375d['name'];}_0x511293[_0x6f00('0x19')](_0x434735)[_0x6f00('0x27')](_0x39375d);};}exports[_0x6f00('0x28')]=function(_0x4366a4,_0x2671fe){var _0x235a86={},_0xff36ce={},_0x451849={'count':0x0,'rows':[]};var _0x22f107=_[_0x6f00('0x29')](db[_0x6f00('0x2a')][_0x6f00('0x2b')],function(_0x29555d){return{'name':_0x29555d[_0x6f00('0x2c')],'type':_0x29555d['type']['key']};});_0xff36ce['model']=_['map'](_0x22f107,'name');_0xff36ce['query']=_[_0x6f00('0x2d')](_0x4366a4['query']);_0xff36ce[_0x6f00('0x2e')]=_[_0x6f00('0x2f')](_0xff36ce[_0x6f00('0x30')],_0xff36ce[_0x6f00('0x31')]);_0x235a86[_0x6f00('0x32')]=_[_0x6f00('0x2f')](_0xff36ce['model'],qs[_0x6f00('0x33')](_0x4366a4[_0x6f00('0x31')][_0x6f00('0x33')]));_0x235a86[_0x6f00('0x32')]=_0x235a86[_0x6f00('0x32')]['length']?_0x235a86['attributes']:_0xff36ce['model'];if(!_0x4366a4[_0x6f00('0x31')][_0x6f00('0x34')](_0x6f00('0x35'))){_0x235a86[_0x6f00('0x1c')]=qs[_0x6f00('0x1c')](_0x4366a4['query'][_0x6f00('0x1c')]);_0x235a86[_0x6f00('0x1b')]=qs[_0x6f00('0x1b')](_0x4366a4[_0x6f00('0x31')][_0x6f00('0x1b')]);}_0x235a86[_0x6f00('0x36')]=qs[_0x6f00('0x37')](_0x4366a4['query'][_0x6f00('0x37')]);_0x235a86[_0x6f00('0x38')]=qs[_0x6f00('0x2e')](_['pick'](_0x4366a4[_0x6f00('0x31')],_0xff36ce[_0x6f00('0x2e')]),_0x22f107);if(_0x4366a4[_0x6f00('0x31')]['filter']){_0x235a86[_0x6f00('0x38')]=_['merge'](_0x235a86[_0x6f00('0x38')],{'$or':_['map'](_0x22f107,function(_0x3dc8e3){if(_0x3dc8e3[_0x6f00('0x39')]!==_0x6f00('0x3a')){var _0x896b3f={};_0x896b3f[_0x3dc8e3['name']]={'$like':'%'+_0x4366a4[_0x6f00('0x31')]['filter']+'%'};return _0x896b3f;}})});}_0x235a86=_[_0x6f00('0x3b')]({},_0x235a86,_0x4366a4['options']);var _0x7785e1={'where':_0x235a86[_0x6f00('0x38')]};return db[_0x6f00('0x2a')][_0x6f00('0x1d')](_0x7785e1)['then'](function(_0x53dc8c){_0x451849[_0x6f00('0x1d')]=_0x53dc8c;if(_0x4366a4['query'][_0x6f00('0x3c')]){_0x235a86[_0x6f00('0x3d')]=[{'all':!![]}];}return db['Cdr'][_0x6f00('0x3e')](_0x235a86);})['then'](function(_0x4cac2c){_0x451849[_0x6f00('0x3f')]=_0x4cac2c;return _0x451849;})[_0x6f00('0x23')](respondWithFilteredResult(_0x2671fe,_0x235a86))[_0x6f00('0x40')](handleError(_0x2671fe,null));};exports[_0x6f00('0x41')]=function(_0x56399a,_0x38ee25){var _0x4523f2={'raw':!![],'where':{'id':_0x56399a[_0x6f00('0x42')]['id']}},_0x2bb5aa={};_0x2bb5aa[_0x6f00('0x30')]=_[_0x6f00('0x2d')](db['Cdr'][_0x6f00('0x2b')]);_0x2bb5aa[_0x6f00('0x31')]=_[_0x6f00('0x2d')](_0x56399a[_0x6f00('0x31')]);_0x2bb5aa[_0x6f00('0x2e')]=_[_0x6f00('0x2f')](_0x2bb5aa['model'],_0x2bb5aa[_0x6f00('0x31')]);_0x4523f2[_0x6f00('0x32')]=_[_0x6f00('0x2f')](_0x2bb5aa['model'],qs[_0x6f00('0x33')](_0x56399a['query'][_0x6f00('0x33')]));_0x4523f2[_0x6f00('0x32')]=_0x4523f2['attributes'][_0x6f00('0x43')]?_0x4523f2['attributes']:_0x2bb5aa[_0x6f00('0x30')];if(_0x56399a[_0x6f00('0x31')][_0x6f00('0x3c')]){_0x4523f2[_0x6f00('0x3d')]=[{'all':!![]}];}_0x4523f2=_['merge']({},_0x4523f2,_0x56399a[_0x6f00('0x44')]);return db['Cdr'][_0x6f00('0x45')](_0x4523f2)['then'](handleEntityNotFound(_0x38ee25,null))[_0x6f00('0x23')](respondWithResult(_0x38ee25,null))[_0x6f00('0x40')](handleError(_0x38ee25,null));};exports[_0x6f00('0x46')]=function(_0x9b003,_0x470ff3){return db[_0x6f00('0x2a')][_0x6f00('0x46')](_0x9b003[_0x6f00('0x47')],{})['then'](respondWithResult(_0x470ff3,0xc9))[_0x6f00('0x40')](handleError(_0x470ff3,null));};exports['update']=function(_0x265666,_0x31fb17){if(_0x265666[_0x6f00('0x47')]['id']){delete _0x265666['body']['id'];}return db['Cdr'][_0x6f00('0x45')]({'where':{'id':_0x265666[_0x6f00('0x42')]['id']}})['then'](handleEntityNotFound(_0x31fb17,null))[_0x6f00('0x23')](saveUpdates(_0x265666['body'],null))[_0x6f00('0x23')](respondWithResult(_0x31fb17,null))['catch'](handleError(_0x31fb17,null));};exports[_0x6f00('0x48')]=function(_0x222b4c,_0x4c6e06){return db['Cdr'][_0x6f00('0x45')]({'where':{'id':_0x222b4c[_0x6f00('0x42')]['id']}})['then'](handleEntityNotFound(_0x4c6e06,null))[_0x6f00('0x23')](removeEntity(_0x4c6e06,null))['catch'](handleError(_0x4c6e06,null));};exports[_0x6f00('0x49')]=function(_0x7f80ed,_0x3100ee){return db[_0x6f00('0x2a')][_0x6f00('0x49')]()[_0x6f00('0x23')](respondWithResult(_0x3100ee,null))[_0x6f00('0x40')](handleError(_0x3100ee,null));};
\ No newline at end of file
+var _0xac95=['query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','then','include','catch','params','rawAttributes','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','sendStatus','error','stack','name','index','map','Cdr','type','key','model'];(function(_0x24cc72,_0x4dc73a){var _0xd49f1e=function(_0x39f581){while(--_0x39f581){_0x24cc72['push'](_0x24cc72['shift']());}};_0xd49f1e(++_0x4dc73a);}(_0xac95,0xa8));var _0x5ac9=function(_0x9cb007,_0x36ce28){_0x9cb007=_0x9cb007-0x0;var _0x3037f5=_0xac95[_0x9cb007];return _0x3037f5;};'use strict';var emlformat=require(_0x5ac9('0x0'));var rimraf=require(_0x5ac9('0x1'));var zipdir=require(_0x5ac9('0x2'));var jsonpatch=require(_0x5ac9('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5ac9('0x4'));var Mustache=require(_0x5ac9('0x5'));var util=require('util');var path=require(_0x5ac9('0x6'));var sox=require(_0x5ac9('0x7'));var csv=require('to-csv');var ejs=require(_0x5ac9('0x8'));var fs=require('fs');var fs_extra=require(_0x5ac9('0x9'));var _=require(_0x5ac9('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5ac9('0xb'));var deskjs=require(_0x5ac9('0xc'));var toCsv=require(_0x5ac9('0xd'));var querystring=require(_0x5ac9('0xe'));var Papa=require(_0x5ac9('0xf'));var Redis=require(_0x5ac9('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5ac9('0x11'));var as=require(_0x5ac9('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5ac9('0x13'))('api');var utils=require(_0x5ac9('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x5ac9('0x15'));var db=require(_0x5ac9('0x16'))['db'];function respondWithStatusCode(_0x371231,_0x40eb62){_0x40eb62=_0x40eb62||0xcc;return function(_0x4f9a04){if(_0x4f9a04){return _0x371231['sendStatus'](_0x40eb62);}return _0x371231[_0x5ac9('0x17')](_0x40eb62)['end']();};}function respondWithResult(_0x3a7d64,_0x364007){_0x364007=_0x364007||0xc8;return function(_0x50658c){if(_0x50658c){return _0x3a7d64[_0x5ac9('0x17')](_0x364007)[_0x5ac9('0x18')](_0x50658c);}};}function respondWithFilteredResult(_0x3f8fac,_0x122590){return function(_0x456ed9){if(_0x456ed9){var _0x2fe47e=typeof _0x122590[_0x5ac9('0x19')]===_0x5ac9('0x1a')&&typeof _0x122590[_0x5ac9('0x1b')]==='undefined';var _0x53a8db=_0x456ed9[_0x5ac9('0x1c')];var _0x193c56=_0x2fe47e?0x0:_0x122590[_0x5ac9('0x19')];var _0x4463ff=_0x2fe47e?_0x456ed9[_0x5ac9('0x1c')]:_0x122590[_0x5ac9('0x19')]+_0x122590[_0x5ac9('0x1b')];var _0x429bf3;if(_0x4463ff>=_0x53a8db){_0x4463ff=_0x53a8db;_0x429bf3=0xc8;}else{_0x429bf3=0xce;}_0x3f8fac[_0x5ac9('0x17')](_0x429bf3);return _0x3f8fac[_0x5ac9('0x1d')](_0x5ac9('0x1e'),_0x193c56+'-'+_0x4463ff+'/'+_0x53a8db)[_0x5ac9('0x18')](_0x456ed9);}return null;};}function patchUpdates(_0x2efa5f){return function(_0x479c6b){try{jsonpatch[_0x5ac9('0x1f')](_0x479c6b,_0x2efa5f,!![]);}catch(_0x1f5546){return BPromise[_0x5ac9('0x20')](_0x1f5546);}return _0x479c6b[_0x5ac9('0x21')]();};}function saveUpdates(_0x2d2ba5,_0x492679){return function(_0x45417d){if(_0x45417d){return _0x45417d[_0x5ac9('0x22')](_0x2d2ba5)['then'](function(_0x5e42a1){return _0x5e42a1;});}return null;};}function removeEntity(_0x5a4664,_0xc36d2){return function(_0x2e666b){if(_0x2e666b){return _0x2e666b['destroy']()['then'](function(){_0x5a4664[_0x5ac9('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49352f,_0x2d1bb5){return function(_0x505acc){if(!_0x505acc){_0x49352f[_0x5ac9('0x23')](0x194);}return _0x505acc;};}function handleError(_0x3b77be,_0x770c48){_0x770c48=_0x770c48||0x1f4;return function(_0x3a7f68){logger[_0x5ac9('0x24')](_0x3a7f68[_0x5ac9('0x25')]);if(_0x3a7f68[_0x5ac9('0x26')]){delete _0x3a7f68[_0x5ac9('0x26')];}_0x3b77be[_0x5ac9('0x17')](_0x770c48)['send'](_0x3a7f68);};}exports[_0x5ac9('0x27')]=function(_0x14a7fe,_0x2a7db9){var _0x3a536c={},_0x3d51ab={},_0x58c9be={'count':0x0,'rows':[]};var _0x47f6ad=_[_0x5ac9('0x28')](db[_0x5ac9('0x29')]['rawAttributes'],function(_0x3a15cf){return{'name':_0x3a15cf['fieldName'],'type':_0x3a15cf[_0x5ac9('0x2a')][_0x5ac9('0x2b')]};});_0x3d51ab[_0x5ac9('0x2c')]=_['map'](_0x47f6ad,_0x5ac9('0x26'));_0x3d51ab[_0x5ac9('0x2d')]=_[_0x5ac9('0x2e')](_0x14a7fe[_0x5ac9('0x2d')]);_0x3d51ab[_0x5ac9('0x2f')]=_[_0x5ac9('0x30')](_0x3d51ab['model'],_0x3d51ab['query']);_0x3a536c[_0x5ac9('0x31')]=_['intersection'](_0x3d51ab['model'],qs[_0x5ac9('0x32')](_0x14a7fe[_0x5ac9('0x2d')][_0x5ac9('0x32')]));_0x3a536c[_0x5ac9('0x31')]=_0x3a536c[_0x5ac9('0x31')][_0x5ac9('0x33')]?_0x3a536c[_0x5ac9('0x31')]:_0x3d51ab[_0x5ac9('0x2c')];if(!_0x14a7fe[_0x5ac9('0x2d')]['hasOwnProperty'](_0x5ac9('0x34'))){_0x3a536c[_0x5ac9('0x1b')]=qs['limit'](_0x14a7fe['query'][_0x5ac9('0x1b')]);_0x3a536c[_0x5ac9('0x19')]=qs[_0x5ac9('0x19')](_0x14a7fe[_0x5ac9('0x2d')]['offset']);}_0x3a536c[_0x5ac9('0x35')]=qs['sort'](_0x14a7fe[_0x5ac9('0x2d')][_0x5ac9('0x36')]);_0x3a536c[_0x5ac9('0x37')]=qs[_0x5ac9('0x2f')](_[_0x5ac9('0x38')](_0x14a7fe[_0x5ac9('0x2d')],_0x3d51ab[_0x5ac9('0x2f')]),_0x47f6ad);if(_0x14a7fe[_0x5ac9('0x2d')][_0x5ac9('0x39')]){_0x3a536c[_0x5ac9('0x37')]=_[_0x5ac9('0x3a')](_0x3a536c[_0x5ac9('0x37')],{'$or':_['map'](_0x47f6ad,function(_0x5d57ff){if(_0x5d57ff[_0x5ac9('0x2a')]!==_0x5ac9('0x3b')){var _0x3003f6={};_0x3003f6[_0x5d57ff[_0x5ac9('0x26')]]={'$like':'%'+_0x14a7fe[_0x5ac9('0x2d')][_0x5ac9('0x39')]+'%'};return _0x3003f6;}})});}_0x3a536c=_['merge']({},_0x3a536c,_0x14a7fe[_0x5ac9('0x3c')]);var _0x16b74e={'where':_0x3a536c['where']};return db['Cdr']['count'](_0x16b74e)[_0x5ac9('0x3d')](function(_0xc6be86){_0x58c9be[_0x5ac9('0x1c')]=_0xc6be86;if(_0x14a7fe[_0x5ac9('0x2d')]['includeAll']){_0x3a536c[_0x5ac9('0x3e')]=[{'all':!![]}];}return db['Cdr']['findAll'](_0x3a536c);})[_0x5ac9('0x3d')](function(_0x45bc9b){_0x58c9be['rows']=_0x45bc9b;return _0x58c9be;})[_0x5ac9('0x3d')](respondWithFilteredResult(_0x2a7db9,_0x3a536c))[_0x5ac9('0x3f')](handleError(_0x2a7db9,null));};exports['show']=function(_0x2a1c19,_0xba7c84){var _0x433634={'raw':!![],'where':{'id':_0x2a1c19[_0x5ac9('0x40')]['id']}},_0x1caf84={};_0x1caf84[_0x5ac9('0x2c')]=_[_0x5ac9('0x2e')](db[_0x5ac9('0x29')][_0x5ac9('0x41')]);_0x1caf84[_0x5ac9('0x2d')]=_[_0x5ac9('0x2e')](_0x2a1c19[_0x5ac9('0x2d')]);_0x1caf84['filters']=_[_0x5ac9('0x30')](_0x1caf84[_0x5ac9('0x2c')],_0x1caf84[_0x5ac9('0x2d')]);_0x433634['attributes']=_[_0x5ac9('0x30')](_0x1caf84[_0x5ac9('0x2c')],qs[_0x5ac9('0x32')](_0x2a1c19['query'][_0x5ac9('0x32')]));_0x433634[_0x5ac9('0x31')]=_0x433634[_0x5ac9('0x31')][_0x5ac9('0x33')]?_0x433634[_0x5ac9('0x31')]:_0x1caf84[_0x5ac9('0x2c')];if(_0x2a1c19['query']['includeAll']){_0x433634[_0x5ac9('0x3e')]=[{'all':!![]}];}_0x433634=_['merge']({},_0x433634,_0x2a1c19[_0x5ac9('0x3c')]);return db['Cdr'][_0x5ac9('0x42')](_0x433634)[_0x5ac9('0x3d')](handleEntityNotFound(_0xba7c84,null))[_0x5ac9('0x3d')](respondWithResult(_0xba7c84,null))[_0x5ac9('0x3f')](handleError(_0xba7c84,null));};exports[_0x5ac9('0x43')]=function(_0x671363,_0x324b7d){return db[_0x5ac9('0x29')][_0x5ac9('0x43')](_0x671363[_0x5ac9('0x44')],{})[_0x5ac9('0x3d')](respondWithResult(_0x324b7d,0xc9))['catch'](handleError(_0x324b7d,null));};exports[_0x5ac9('0x22')]=function(_0x4bb9c7,_0x482df4){if(_0x4bb9c7['body']['id']){delete _0x4bb9c7[_0x5ac9('0x44')]['id'];}return db[_0x5ac9('0x29')][_0x5ac9('0x42')]({'where':{'id':_0x4bb9c7['params']['id']}})[_0x5ac9('0x3d')](handleEntityNotFound(_0x482df4,null))[_0x5ac9('0x3d')](saveUpdates(_0x4bb9c7[_0x5ac9('0x44')],null))[_0x5ac9('0x3d')](respondWithResult(_0x482df4,null))[_0x5ac9('0x3f')](handleError(_0x482df4,null));};exports[_0x5ac9('0x45')]=function(_0x499fd3,_0x47a7b8){return db[_0x5ac9('0x29')][_0x5ac9('0x42')]({'where':{'id':_0x499fd3['params']['id']}})[_0x5ac9('0x3d')](handleEntityNotFound(_0x47a7b8,null))[_0x5ac9('0x3d')](removeEntity(_0x47a7b8,null))[_0x5ac9('0x3f')](handleError(_0x47a7b8,null));};exports[_0x5ac9('0x46')]=function(_0x6b3995,_0x575a3f){return db[_0x5ac9('0x29')][_0x5ac9('0x46')]()[_0x5ac9('0x3d')](respondWithResult(_0x575a3f,null))['catch'](handleError(_0x575a3f,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 8077015..b4bd4ea 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x37bf68,_0x3e5229){var _0x1c3851=function(_0x310de2){while(--_0x310de2){_0x37bf68['push'](_0x37bf68['shift']());}};_0x1c3851(++_0x3e5229);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0xa507e1,_0x480eac){var _0x1bcba3=function(_0xf8595b){while(--_0xf8595b){_0xa507e1['push'](_0xa507e1['shift']());}};_0x1bcba3(++_0x480eac);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 48f2b1a..120a5e5 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 _0x4143=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash'];(function(_0x1e6992,_0x17ba6b){var _0x641ce=function(_0x3f8256){while(--_0x3f8256){_0x1e6992['push'](_0x1e6992['shift']());}};_0x641ce(++_0x17ba6b);}(_0x4143,0x107));var _0x3414=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x4143[_0x4fc9e6];return _0x551d28;};'use strict';var _=require(_0x3414('0x0'));var util=require(_0x3414('0x1'));var moment=require(_0x3414('0x2'));var BPromise=require(_0x3414('0x3'));var rs=require(_0x3414('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3414('0x5'))['db'];var utils=require(_0x3414('0x6'));var logger=require(_0x3414('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3414('0x8'));var client=jayson[_0x3414('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x31b209,_0x3bda66,_0x5cb0eb){return new BPromise(function(_0x2248d6,_0x127830){return client[_0x3414('0xa')](_0x31b209,_0x5cb0eb)[_0x3414('0xb')](function(_0xf35baf){logger[_0x3414('0xc')](_0x3414('0xd'),_0x3bda66,_0x3414('0xe'));logger[_0x3414('0xf')](_0x3414('0x10'),_0x3bda66,'request\x20sent',JSON[_0x3414('0x11')](_0xf35baf));if(_0xf35baf[_0x3414('0x12')]){if(_0xf35baf[_0x3414('0x12')][_0x3414('0x13')]===0x1f4){logger[_0x3414('0x12')](_0x3414('0xd'),_0x3bda66,_0xf35baf['error'][_0x3414('0x14')]);return _0x127830(_0xf35baf[_0x3414('0x12')][_0x3414('0x14')]);}logger[_0x3414('0x12')]('Cdr,\x20%s,\x20%s',_0x3bda66,_0xf35baf[_0x3414('0x12')][_0x3414('0x14')]);return _0x2248d6(_0xf35baf[_0x3414('0x12')][_0x3414('0x14')]);}else{logger['info'](_0x3414('0xd'),_0x3bda66,_0x3414('0xe'));_0x2248d6(_0xf35baf['result'][_0x3414('0x14')]);}})[_0x3414('0x15')](function(_0x37320a){logger[_0x3414('0x12')](_0x3414('0xd'),_0x3bda66,_0x37320a);_0x127830(_0x37320a);});});}
\ No newline at end of file
+var _0x0752=['client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1e2b56,_0x280b73){var _0xbbf763=function(_0x49934f){while(--_0x49934f){_0x1e2b56['push'](_0x1e2b56['shift']());}};_0xbbf763(++_0x280b73);}(_0x0752,0xa4));var _0x2075=function(_0x4109ab,_0x35a6c6){_0x4109ab=_0x4109ab-0x0;var _0x4073c4=_0x0752[_0x4109ab];return _0x4073c4;};'use strict';var _=require(_0x2075('0x0'));var util=require(_0x2075('0x1'));var moment=require('moment');var BPromise=require(_0x2075('0x2'));var rs=require(_0x2075('0x3'));var fs=require('fs');var Redis=require(_0x2075('0x4'));var db=require(_0x2075('0x5'))['db'];var utils=require(_0x2075('0x6'));var logger=require(_0x2075('0x7'))(_0x2075('0x8'));var config=require(_0x2075('0x9'));var jayson=require(_0x2075('0xa'));var client=jayson[_0x2075('0xb')][_0x2075('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x411fe3,_0x3145fc,_0x1896b5){return new BPromise(function(_0x7d293e,_0x4e222b){return client[_0x2075('0xd')](_0x411fe3,_0x1896b5)[_0x2075('0xe')](function(_0x4c8445){logger[_0x2075('0xf')](_0x2075('0x10'),_0x3145fc,_0x2075('0x11'));logger['debug'](_0x2075('0x12'),_0x3145fc,_0x2075('0x11'),JSON[_0x2075('0x13')](_0x4c8445));if(_0x4c8445[_0x2075('0x14')]){if(_0x4c8445['error'][_0x2075('0x15')]===0x1f4){logger[_0x2075('0x14')]('Cdr,\x20%s,\x20%s',_0x3145fc,_0x4c8445[_0x2075('0x14')][_0x2075('0x16')]);return _0x4e222b(_0x4c8445[_0x2075('0x14')][_0x2075('0x16')]);}logger[_0x2075('0x14')](_0x2075('0x10'),_0x3145fc,_0x4c8445[_0x2075('0x14')][_0x2075('0x16')]);return _0x7d293e(_0x4c8445['error'][_0x2075('0x16')]);}else{logger[_0x2075('0xf')](_0x2075('0x10'),_0x3145fc,'request\x20sent');_0x7d293e(_0x4c8445[_0x2075('0x17')][_0x2075('0x16')]);}})[_0x2075('0x18')](function(_0x2fd239){logger['error'](_0x2075('0x10'),_0x3145fc,_0x2fd239);_0x4e222b(_0x2fd239);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 26e143e..c553441 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x41eb8b,_0x8e630f){var _0x57f6be=function(_0x552d87){while(--_0x552d87){_0x41eb8b['push'](_0x41eb8b['shift']());}};_0x57f6be(++_0x8e630f);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x4febd4,_0x256ec4){var _0x12c32e=function(_0x3c5f29){while(--_0x3c5f29){_0x4febd4['push'](_0x4febd4['shift']());}};_0x12c32e(++_0x256ec4);}(_0xb10b,0x12a));var _0xbb10=function(_0x1f1837,_0x4b304e){_0x1f1837=_0x1f1837-0x0;var _0x25ab57=_0xb10b[_0x1f1837];return _0x25ab57;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 81dbeeb..f949920 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 _0xd143=['*,*,*,*','exports','INTEGER','noop','STRING'];(function(_0x543896,_0xea52c1){var _0x4f3be3=function(_0x4358fe){while(--_0x4358fe){_0x543896['push'](_0x543896['shift']());}};_0x4f3be3(++_0xea52c1);}(_0xd143,0x1e6));var _0x3d14=function(_0x1b5e7e,_0x26ae2d){_0x1b5e7e=_0x1b5e7e-0x0;var _0x11188c=_0xd143[_0x1b5e7e];return _0x11188c;};'use strict';var Sequelize=require('sequelize');module[_0x3d14('0x0')]={'priority':{'type':Sequelize[_0x3d14('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3d14('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x3d14('0x3')]},'interval':{'type':Sequelize[_0x3d14('0x3')],'defaultValue':_0x3d14('0x4')}};
\ No newline at end of file
+var _0x26a3=['sequelize','exports','INTEGER','STRING','noop','*,*,*,*'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x26a3,0x1ce));var _0x326a=function(_0x1faa29,_0x4d6a85){_0x1faa29=_0x1faa29-0x0;var _0x452fe0=_0x26a3[_0x1faa29];return _0x452fe0;};'use strict';var Sequelize=require(_0x326a('0x0'));module[_0x326a('0x1')]={'priority':{'type':Sequelize[_0x326a('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x326a('0x3')],'allowNull':![],'defaultValue':_0x326a('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x326a('0x3')]},'interval':{'type':Sequelize[_0x326a('0x3')],'defaultValue':_0x326a('0x5')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index dc11383..ac2be04 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 _0x6146=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','error','stack','name','send','show','params','model','ChatApplication','rawAttributes','query','keys','filters','intersection','attributes','fields','length','includeAll','merge','options','find','catch','update','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox'];(function(_0x5a6744,_0x144876){var _0xff7177=function(_0x4b3e10){while(--_0x4b3e10){_0x5a6744['push'](_0x5a6744['shift']());}};_0xff7177(++_0x144876);}(_0x6146,0xba));var _0x6614=function(_0x9f321b,_0x2f2818){_0x9f321b=_0x9f321b-0x0;var _0x574eb7=_0x6146[_0x9f321b];return _0x574eb7;};'use strict';var emlformat=require(_0x6614('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6614('0x1'));var jsonpatch=require(_0x6614('0x2'));var rp=require(_0x6614('0x3'));var moment=require(_0x6614('0x4'));var BPromise=require(_0x6614('0x5'));var Mustache=require(_0x6614('0x6'));var util=require(_0x6614('0x7'));var path=require('path');var sox=require(_0x6614('0x8'));var csv=require(_0x6614('0x9'));var ejs=require(_0x6614('0xa'));var fs=require('fs');var fs_extra=require(_0x6614('0xb'));var _=require(_0x6614('0xc'));var squel=require(_0x6614('0xd'));var crypto=require(_0x6614('0xe'));var jsforce=require(_0x6614('0xf'));var deskjs=require(_0x6614('0x10'));var toCsv=require('to-csv');var querystring=require(_0x6614('0x11'));var Papa=require(_0x6614('0x12'));var Redis=require(_0x6614('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x6614('0x14'));var as=require(_0x6614('0x15'));var hardwareService=require(_0x6614('0x16'));var logger=require(_0x6614('0x17'))(_0x6614('0x18'));var utils=require(_0x6614('0x19'));var config=require(_0x6614('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x6614('0x1b'))['db'];function respondWithStatusCode(_0x4fa29b,_0x3550a7){_0x3550a7=_0x3550a7||0xcc;return function(_0x11b16b){if(_0x11b16b){return _0x4fa29b[_0x6614('0x1c')](_0x3550a7);}return _0x4fa29b[_0x6614('0x1d')](_0x3550a7)[_0x6614('0x1e')]();};}function respondWithResult(_0x1d0d2b,_0x1bae1d){_0x1bae1d=_0x1bae1d||0xc8;return function(_0x288cd7){if(_0x288cd7){return _0x1d0d2b[_0x6614('0x1d')](_0x1bae1d)['json'](_0x288cd7);}};}function respondWithFilteredResult(_0x481f26,_0x219365){return function(_0x40a008){if(_0x40a008){var _0x5e933f=typeof _0x219365[_0x6614('0x1f')]===_0x6614('0x20')&&typeof _0x219365[_0x6614('0x21')]==='undefined';var _0xfddeb9=_0x40a008[_0x6614('0x22')];var _0x449ec5=_0x5e933f?0x0:_0x219365['offset'];var _0x53080d=_0x5e933f?_0x40a008[_0x6614('0x22')]:_0x219365[_0x6614('0x1f')]+_0x219365[_0x6614('0x21')];var _0x30c5bc;if(_0x53080d>=_0xfddeb9){_0x53080d=_0xfddeb9;_0x30c5bc=0xc8;}else{_0x30c5bc=0xce;}_0x481f26['status'](_0x30c5bc);return _0x481f26[_0x6614('0x23')](_0x6614('0x24'),_0x449ec5+'-'+_0x53080d+'/'+_0xfddeb9)[_0x6614('0x25')](_0x40a008);}return null;};}function patchUpdates(_0x5442e0){return function(_0x15c667){try{jsonpatch[_0x6614('0x26')](_0x15c667,_0x5442e0,!![]);}catch(_0x13868d){return BPromise[_0x6614('0x27')](_0x13868d);}return _0x15c667[_0x6614('0x28')]();};}function saveUpdates(_0x1db8fc,_0x18889c){return function(_0x3275ee){if(_0x3275ee){return _0x3275ee['update'](_0x1db8fc)[_0x6614('0x29')](function(_0x4a665a){return _0x4a665a;});}return null;};}function removeEntity(_0x13ad7a,_0x30205e){return function(_0x332fca){if(_0x332fca){return _0x332fca['destroy']()['then'](function(){_0x13ad7a[_0x6614('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1137ef,_0x5c8651){return function(_0x3c82e5){if(!_0x3c82e5){_0x1137ef[_0x6614('0x1c')](0x194);}return _0x3c82e5;};}function handleError(_0x5ddae6,_0x119e53){_0x119e53=_0x119e53||0x1f4;return function(_0x4e9450){logger[_0x6614('0x2a')](_0x4e9450[_0x6614('0x2b')]);if(_0x4e9450[_0x6614('0x2c')]){delete _0x4e9450[_0x6614('0x2c')];}_0x5ddae6[_0x6614('0x1d')](_0x119e53)[_0x6614('0x2d')](_0x4e9450);};}exports[_0x6614('0x2e')]=function(_0x2f9a26,_0x1fef5f){var _0x32ee73={'raw':!![],'where':{'id':_0x2f9a26[_0x6614('0x2f')]['id']}},_0x153b8e={};_0x153b8e[_0x6614('0x30')]=_['keys'](db[_0x6614('0x31')][_0x6614('0x32')]);_0x153b8e[_0x6614('0x33')]=_[_0x6614('0x34')](_0x2f9a26[_0x6614('0x33')]);_0x153b8e[_0x6614('0x35')]=_[_0x6614('0x36')](_0x153b8e[_0x6614('0x30')],_0x153b8e['query']);_0x32ee73[_0x6614('0x37')]=_[_0x6614('0x36')](_0x153b8e[_0x6614('0x30')],qs['fields'](_0x2f9a26['query'][_0x6614('0x38')]));_0x32ee73['attributes']=_0x32ee73[_0x6614('0x37')][_0x6614('0x39')]?_0x32ee73['attributes']:_0x153b8e[_0x6614('0x30')];if(_0x2f9a26[_0x6614('0x33')][_0x6614('0x3a')]){_0x32ee73['include']=[{'all':!![]}];}_0x32ee73=_[_0x6614('0x3b')]({},_0x32ee73,_0x2f9a26[_0x6614('0x3c')]);return db[_0x6614('0x31')][_0x6614('0x3d')](_0x32ee73)[_0x6614('0x29')](handleEntityNotFound(_0x1fef5f,null))[_0x6614('0x29')](respondWithResult(_0x1fef5f,null))[_0x6614('0x3e')](handleError(_0x1fef5f,null));};exports[_0x6614('0x3f')]=function(_0x2c40d1,_0x15a9bd){if(_0x2c40d1[_0x6614('0x40')]['id']){delete _0x2c40d1[_0x6614('0x40')]['id'];}return db[_0x6614('0x31')][_0x6614('0x3d')]({'where':{'id':_0x2c40d1[_0x6614('0x2f')]['id']}})[_0x6614('0x29')](handleEntityNotFound(_0x15a9bd,null))[_0x6614('0x29')](saveUpdates(_0x2c40d1[_0x6614('0x40')],null))[_0x6614('0x29')](respondWithResult(_0x15a9bd,null))[_0x6614('0x3e')](handleError(_0x15a9bd,null));};exports['destroy']=function(_0x1a59b8,_0x1019fe){return db[_0x6614('0x31')][_0x6614('0x3d')]({'where':{'id':_0x1a59b8[_0x6614('0x2f')]['id']}})[_0x6614('0x29')](handleEntityNotFound(_0x1019fe,null))[_0x6614('0x29')](removeEntity(_0x1019fe,null))[_0x6614('0x3e')](handleError(_0x1019fe,null));};
\ No newline at end of file
+var _0x252f=['status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','show','params','model','query','keys','intersection','fields','attributes','length','merge','options','ChatApplication','find','catch','body','destroy','eml-format','rimraf','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x5249b7,_0x361a1d){var _0x552a2b=function(_0x26f199){while(--_0x26f199){_0x5249b7['push'](_0x5249b7['shift']());}};_0x552a2b(++_0x361a1d);}(_0x252f,0xd0));var _0xf252=function(_0x561e73,_0x13a224){_0x561e73=_0x561e73-0x0;var _0x2dc60d=_0x252f[_0x561e73];return _0x2dc60d;};'use strict';var emlformat=require(_0xf252('0x0'));var rimraf=require(_0xf252('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf252('0x2'));var moment=require(_0xf252('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf252('0x4'));var path=require(_0xf252('0x5'));var sox=require(_0xf252('0x6'));var csv=require(_0xf252('0x7'));var ejs=require(_0xf252('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf252('0x9'));var squel=require(_0xf252('0xa'));var crypto=require(_0xf252('0xb'));var jsforce=require(_0xf252('0xc'));var deskjs=require(_0xf252('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf252('0xe'));var Papa=require(_0xf252('0xf'));var Redis=require('ioredis');var authService=require(_0xf252('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xf252('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf252('0x12'))(_0xf252('0x13'));var utils=require(_0xf252('0x14'));var config=require(_0xf252('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xf252('0x16'))['db'];function respondWithStatusCode(_0xf54ee9,_0x2fc7d3){_0x2fc7d3=_0x2fc7d3||0xcc;return function(_0x10d4e1){if(_0x10d4e1){return _0xf54ee9[_0xf252('0x17')](_0x2fc7d3);}return _0xf54ee9[_0xf252('0x18')](_0x2fc7d3)['end']();};}function respondWithResult(_0x36da86,_0x18fa76){_0x18fa76=_0x18fa76||0xc8;return function(_0xbdb67a){if(_0xbdb67a){return _0x36da86['status'](_0x18fa76)[_0xf252('0x19')](_0xbdb67a);}};}function respondWithFilteredResult(_0xf7285f,_0x33c420){return function(_0x25affc){if(_0x25affc){var _0x486254=typeof _0x33c420[_0xf252('0x1a')]==='undefined'&&typeof _0x33c420[_0xf252('0x1b')]===_0xf252('0x1c');var _0x331bd6=_0x25affc['count'];var _0x4f6bd5=_0x486254?0x0:_0x33c420[_0xf252('0x1a')];var _0x34ce46=_0x486254?_0x25affc[_0xf252('0x1d')]:_0x33c420['offset']+_0x33c420[_0xf252('0x1b')];var _0x4f063c;if(_0x34ce46>=_0x331bd6){_0x34ce46=_0x331bd6;_0x4f063c=0xc8;}else{_0x4f063c=0xce;}_0xf7285f['status'](_0x4f063c);return _0xf7285f[_0xf252('0x1e')](_0xf252('0x1f'),_0x4f6bd5+'-'+_0x34ce46+'/'+_0x331bd6)[_0xf252('0x19')](_0x25affc);}return null;};}function patchUpdates(_0x2ab64c){return function(_0x4c86fb){try{jsonpatch[_0xf252('0x20')](_0x4c86fb,_0x2ab64c,!![]);}catch(_0x43a9f0){return BPromise[_0xf252('0x21')](_0x43a9f0);}return _0x4c86fb[_0xf252('0x22')]();};}function saveUpdates(_0x574614,_0x579022){return function(_0x12d287){if(_0x12d287){return _0x12d287[_0xf252('0x23')](_0x574614)[_0xf252('0x24')](function(_0x524683){return _0x524683;});}return null;};}function removeEntity(_0x18c14d,_0x2ba040){return function(_0x284dca){if(_0x284dca){return _0x284dca['destroy']()[_0xf252('0x24')](function(){_0x18c14d[_0xf252('0x18')](0xcc)[_0xf252('0x25')]();});}};}function handleEntityNotFound(_0x36f8a5,_0x74ad3c){return function(_0x165ff4){if(!_0x165ff4){_0x36f8a5['sendStatus'](0x194);}return _0x165ff4;};}function handleError(_0x4dd530,_0xdd0977){_0xdd0977=_0xdd0977||0x1f4;return function(_0x2c6073){logger[_0xf252('0x26')](_0x2c6073[_0xf252('0x27')]);if(_0x2c6073[_0xf252('0x28')]){delete _0x2c6073[_0xf252('0x28')];}_0x4dd530[_0xf252('0x18')](_0xdd0977)[_0xf252('0x29')](_0x2c6073);};}exports[_0xf252('0x2a')]=function(_0x4bc687,_0x234af2){var _0x5aedad={'raw':!![],'where':{'id':_0x4bc687[_0xf252('0x2b')]['id']}},_0x534c98={};_0x534c98[_0xf252('0x2c')]=_['keys'](db['ChatApplication']['rawAttributes']);_0x534c98[_0xf252('0x2d')]=_[_0xf252('0x2e')](_0x4bc687[_0xf252('0x2d')]);_0x534c98['filters']=_[_0xf252('0x2f')](_0x534c98['model'],_0x534c98[_0xf252('0x2d')]);_0x5aedad['attributes']=_[_0xf252('0x2f')](_0x534c98[_0xf252('0x2c')],qs[_0xf252('0x30')](_0x4bc687[_0xf252('0x2d')][_0xf252('0x30')]));_0x5aedad[_0xf252('0x31')]=_0x5aedad[_0xf252('0x31')][_0xf252('0x32')]?_0x5aedad[_0xf252('0x31')]:_0x534c98['model'];if(_0x4bc687[_0xf252('0x2d')]['includeAll']){_0x5aedad['include']=[{'all':!![]}];}_0x5aedad=_[_0xf252('0x33')]({},_0x5aedad,_0x4bc687[_0xf252('0x34')]);return db[_0xf252('0x35')][_0xf252('0x36')](_0x5aedad)['then'](handleEntityNotFound(_0x234af2,null))['then'](respondWithResult(_0x234af2,null))[_0xf252('0x37')](handleError(_0x234af2,null));};exports[_0xf252('0x23')]=function(_0x2f803b,_0x1fec2e){if(_0x2f803b[_0xf252('0x38')]['id']){delete _0x2f803b[_0xf252('0x38')]['id'];}return db['ChatApplication'][_0xf252('0x36')]({'where':{'id':_0x2f803b['params']['id']}})[_0xf252('0x24')](handleEntityNotFound(_0x1fec2e,null))['then'](saveUpdates(_0x2f803b[_0xf252('0x38')],null))[_0xf252('0x24')](respondWithResult(_0x1fec2e,null))[_0xf252('0x37')](handleError(_0x1fec2e,null));};exports[_0xf252('0x39')]=function(_0x35d20b,_0x5311f9){return db[_0xf252('0x35')][_0xf252('0x36')]({'where':{'id':_0x35d20b[_0xf252('0x2b')]['id']}})[_0xf252('0x24')](handleEntityNotFound(_0x5311f9,null))[_0xf252('0x24')](removeEntity(_0x5311f9,null))[_0xf252('0x37')](handleError(_0x5311f9,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 3c2230e..4a8bba7 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 _0xfeff=['util','../../config/logger','path','rimraf','../../config/environment','./chatApplication.attributes','exports','ChatApplication','utf8mb4_unicode_ci','lodash'];(function(_0x19b96a,_0x2303ca){var _0x4dcbd1=function(_0x385460){while(--_0x385460){_0x19b96a['push'](_0x19b96a['shift']());}};_0x4dcbd1(++_0x2303ca);}(_0xfeff,0xe5));var _0xffef=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xfeff[_0x50a0c2];return _0x5ebadd;};'use strict';var _=require(_0xffef('0x0'));var util=require(_0xffef('0x1'));var logger=require(_0xffef('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xffef('0x3'));var rimraf=require(_0xffef('0x4'));var config=require(_0xffef('0x5'));var attributes=require(_0xffef('0x6'));module[_0xffef('0x7')]=function(_0xaf0432,_0x2b43ee){return _0xaf0432['define'](_0xffef('0x8'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xffef('0x9')});};
\ No newline at end of file
+var _0x954d=['moment','bluebird','request-promise','rimraf','../../config/environment','./chatApplication.attributes','define','ChatApplication','utf8mb4','utf8mb4_unicode_ci','api'];(function(_0x590a38,_0x2bc65c){var _0xf36626=function(_0x551cd1){while(--_0x551cd1){_0x590a38['push'](_0x590a38['shift']());}};_0xf36626(++_0x2bc65c);}(_0x954d,0x196));var _0xd954=function(_0x1b3d60,_0x51583b){_0x1b3d60=_0x1b3d60-0x0;var _0x4abc3d=_0x954d[_0x1b3d60];return _0x4abc3d;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xd954('0x0'));var moment=require(_0xd954('0x1'));var BPromise=require(_0xd954('0x2'));var rp=require(_0xd954('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd954('0x4'));var config=require(_0xd954('0x5'));var attributes=require(_0xd954('0x6'));module['exports']=function(_0x53e385,_0x57382b){return _0x53e385[_0xd954('0x7')](_0xd954('0x8'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd954('0x9'),'collate':_0xd954('0xa')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 0221a98..0a7bfc8 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 _0x0133=['ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','http','then','info','ChatApplication,\x20%s,\x20%s','debug'];(function(_0x40f5d4,_0x5c7478){var _0x4408b9=function(_0x367ca5){while(--_0x367ca5){_0x40f5d4['push'](_0x40f5d4['shift']());}};_0x4408b9(++_0x5c7478);}(_0x0133,0x197));var _0x3013=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0x0133[_0x37c22c];return _0x119d79;};'use strict';var _=require(_0x3013('0x0'));var util=require(_0x3013('0x1'));var moment=require(_0x3013('0x2'));var BPromise=require(_0x3013('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3013('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3013('0x5'));var logger=require('../../config/logger')(_0x3013('0x6'));var config=require(_0x3013('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3013('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x577e16,_0x5a449e,_0x55e9df){return new BPromise(function(_0x5038a8,_0x22361a){return client['request'](_0x577e16,_0x55e9df)[_0x3013('0x9')](function(_0x270686){logger[_0x3013('0xa')](_0x3013('0xb'),_0x5a449e,'request\x20sent');logger[_0x3013('0xc')](_0x3013('0xd'),_0x5a449e,_0x3013('0xe'),JSON[_0x3013('0xf')](_0x270686));if(_0x270686[_0x3013('0x10')]){if(_0x270686[_0x3013('0x10')][_0x3013('0x11')]===0x1f4){logger[_0x3013('0x10')](_0x3013('0xb'),_0x5a449e,_0x270686[_0x3013('0x10')][_0x3013('0x12')]);return _0x22361a(_0x270686['error']['message']);}logger[_0x3013('0x10')](_0x3013('0xb'),_0x5a449e,_0x270686[_0x3013('0x10')][_0x3013('0x12')]);return _0x5038a8(_0x270686[_0x3013('0x10')][_0x3013('0x12')]);}else{logger[_0x3013('0xa')]('ChatApplication,\x20%s,\x20%s',_0x5a449e,_0x3013('0xe'));_0x5038a8(_0x270686[_0x3013('0x13')][_0x3013('0x12')]);}})[_0x3013('0x14')](function(_0x19eb86){logger[_0x3013('0x10')](_0x3013('0xb'),_0x5a449e,_0x19eb86);_0x22361a(_0x19eb86);});});}
\ No newline at end of file
+var _0xd9bd=['http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0xd9bd,0x1f0));var _0xdd9b=function(_0x5ff52a,_0x6310c8){_0x5ff52a=_0x5ff52a-0x0;var _0x56a84a=_0xd9bd[_0x5ff52a];return _0x56a84a;};'use strict';var _=require('lodash');var util=require(_0xdd9b('0x0'));var moment=require(_0xdd9b('0x1'));var BPromise=require(_0xdd9b('0x2'));var rs=require(_0xdd9b('0x3'));var fs=require('fs');var Redis=require(_0xdd9b('0x4'));var db=require(_0xdd9b('0x5'))['db'];var utils=require(_0xdd9b('0x6'));var logger=require('../../config/logger')(_0xdd9b('0x7'));var config=require(_0xdd9b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xdd9b('0x9')][_0xdd9b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a5bb7,_0x4eff81,_0xa886df){return new BPromise(function(_0x126d07,_0x239e4d){return client[_0xdd9b('0xb')](_0x3a5bb7,_0xa886df)[_0xdd9b('0xc')](function(_0x19be82){logger[_0xdd9b('0xd')](_0xdd9b('0xe'),_0x4eff81,_0xdd9b('0xf'));logger['debug'](_0xdd9b('0x10'),_0x4eff81,_0xdd9b('0xf'),JSON[_0xdd9b('0x11')](_0x19be82));if(_0x19be82[_0xdd9b('0x12')]){if(_0x19be82[_0xdd9b('0x12')][_0xdd9b('0x13')]===0x1f4){logger['error'](_0xdd9b('0xe'),_0x4eff81,_0x19be82['error'][_0xdd9b('0x14')]);return _0x239e4d(_0x19be82[_0xdd9b('0x12')][_0xdd9b('0x14')]);}logger[_0xdd9b('0x12')](_0xdd9b('0xe'),_0x4eff81,_0x19be82[_0xdd9b('0x12')][_0xdd9b('0x14')]);return _0x126d07(_0x19be82[_0xdd9b('0x12')][_0xdd9b('0x14')]);}else{logger['info'](_0xdd9b('0xe'),_0x4eff81,_0xdd9b('0xf'));_0x126d07(_0x19be82['result'][_0xdd9b('0x14')]);}})[_0xdd9b('0x15')](function(_0x1525a0){logger[_0xdd9b('0x12')](_0xdd9b('0xe'),_0x4eff81,_0x1525a0);_0x239e4d(_0x1525a0);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index d2874e9..b8bb648 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 _0xebf5=['./chatApplication.controller','get','isAuthenticated','show','put','update','/:id','multer','util','path','express','Router','fs-extra','../../config/environment'];(function(_0x561a36,_0x4226d4){var _0x44353b=function(_0x5308b3){while(--_0x5308b3){_0x561a36['push'](_0x561a36['shift']());}};_0x44353b(++_0x4226d4);}(_0xebf5,0x12d));var _0x5ebf=function(_0x22dfe0,_0x43613b){_0x22dfe0=_0x22dfe0-0x0;var _0x91bbfb=_0xebf5[_0x22dfe0];return _0x91bbfb;};'use strict';var multer=require(_0x5ebf('0x0'));var util=require(_0x5ebf('0x1'));var path=require(_0x5ebf('0x2'));var timeout=require('connect-timeout');var express=require(_0x5ebf('0x3'));var router=express[_0x5ebf('0x4')]();var fs_extra=require(_0x5ebf('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5ebf('0x6'));var controller=require(_0x5ebf('0x7'));router[_0x5ebf('0x8')]('/:id',auth[_0x5ebf('0x9')](),controller[_0x5ebf('0xa')]);router[_0x5ebf('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x5ebf('0xc')]);router['delete'](_0x5ebf('0xd'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x436c=['../../components/auth/service','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0xa8369a,_0x3d2319){var _0x4b74b7=function(_0x11d138){while(--_0x11d138){_0xa8369a['push'](_0xa8369a['shift']());}};_0x4b74b7(++_0x3d2319);}(_0x436c,0x8a));var _0xc436=function(_0x4d8261,_0x2b1c12){_0x4d8261=_0x4d8261-0x0;var _0x2a56a2=_0x436c[_0x4d8261];return _0x2a56a2;};'use strict';var multer=require(_0xc436('0x0'));var util=require(_0xc436('0x1'));var path=require(_0xc436('0x2'));var timeout=require(_0xc436('0x3'));var express=require('express');var router=express[_0xc436('0x4')]();var fs_extra=require(_0xc436('0x5'));var auth=require(_0xc436('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc436('0x7'));router[_0xc436('0x8')](_0xc436('0x9'),auth[_0xc436('0xa')](),controller[_0xc436('0xb')]);router[_0xc436('0xc')](_0xc436('0x9'),auth[_0xc436('0xa')](),controller[_0xc436('0xd')]);router[_0xc436('0xe')]('/:id',auth[_0xc436('0xa')](),controller[_0xc436('0xf')]);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 34447b5..6422256 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 _0x0514=['sequelize','STRING'];(function(_0x820291,_0x121322){var _0x338d05=function(_0x1a1c9c){while(--_0x1a1c9c){_0x820291['push'](_0x820291['shift']());}};_0x338d05(++_0x121322);}(_0x0514,0x1f0));var _0x4051=function(_0x171fb1,_0x57c30a){_0x171fb1=_0x171fb1-0x0;var _0x1ca28c=_0x0514[_0x171fb1];return _0x1ca28c;};'use strict';var Sequelize=require(_0x4051('0x0'));module['exports']={'name':{'type':Sequelize[_0x4051('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x4051('0x1')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0x1261=['exports','STRING','BOOLEAN'];(function(_0x51be52,_0x15aa89){var _0x16ac7f=function(_0x4dbafe){while(--_0x4dbafe){_0x51be52['push'](_0x51be52['shift']());}};_0x16ac7f(++_0x15aa89);}(_0x1261,0x144));var _0x1126=function(_0x26659f,_0x32f426){_0x26659f=_0x26659f-0x0;var _0x42667f=_0x1261[_0x26659f];return _0x42667f;};'use strict';var Sequelize=require('sequelize');module[_0x1126('0x0')]={'name':{'type':Sequelize[_0x1126('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x1126('0x1')]},'write':{'type':Sequelize[_0x1126('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 54e5ba2..a9a7d89 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 _0x3797=['count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','filters','pick','filter','merge','where','VIRTUAL','includeAll','include','findAll','rows','show','params','options','catch','create','body','find','describe','getUnread','user','toInteger','addMembers','ids','omit','getMembers','findOne','removeMembers','addMessage','ChatInternalMessage','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','hasOwnProperty','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','end','status','json','offset','limit'];(function(_0x49b9fb,_0x3a49f6){var _0x19742e=function(_0x30b19b){while(--_0x30b19b){_0x49b9fb['push'](_0x49b9fb['shift']());}};_0x19742e(++_0x3a49f6);}(_0x3797,0x164));var _0x7379=function(_0x232d32,_0x3ccf6d){_0x232d32=_0x232d32-0x0;var _0x163cf2=_0x3797[_0x232d32];return _0x163cf2;};'use strict';var emlformat=require(_0x7379('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7379('0x1'));var jsonpatch=require(_0x7379('0x2'));var rp=require(_0x7379('0x3'));var moment=require(_0x7379('0x4'));var BPromise=require(_0x7379('0x5'));var Mustache=require('mustache');var util=require(_0x7379('0x6'));var path=require('path');var sox=require(_0x7379('0x7'));var csv=require(_0x7379('0x8'));var ejs=require(_0x7379('0x9'));var fs=require('fs');var fs_extra=require(_0x7379('0xa'));var _=require(_0x7379('0xb'));var squel=require(_0x7379('0xc'));var crypto=require(_0x7379('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7379('0xe'));var toCsv=require(_0x7379('0x8'));var querystring=require('querystring');var Papa=require(_0x7379('0xf'));var Redis=require(_0x7379('0x10'));var authService=require(_0x7379('0x11'));var qs=require(_0x7379('0x12'));var as=require(_0x7379('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7379('0x14'))(_0x7379('0x15'));var utils=require(_0x7379('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7379('0x17'))['db'];config[_0x7379('0x18')]=_[_0x7379('0x19')](config[_0x7379('0x18')],{'host':_0x7379('0x1a'),'port':0x18eb});var socket=require(_0x7379('0x1b'))(new Redis(config[_0x7379('0x18')]));require(_0x7379('0x1c'))[_0x7379('0x1d')](socket);function respondWithStatusCode(_0x495d24,_0x41d35f){_0x41d35f=_0x41d35f||0xcc;return function(_0x55bf95){if(_0x55bf95){return _0x495d24[_0x7379('0x1e')](_0x41d35f);}return _0x495d24['status'](_0x41d35f)[_0x7379('0x1f')]();};}function respondWithResult(_0x5db331,_0x1fc4d4){_0x1fc4d4=_0x1fc4d4||0xc8;return function(_0x1cdff3){if(_0x1cdff3){return _0x5db331[_0x7379('0x20')](_0x1fc4d4)[_0x7379('0x21')](_0x1cdff3);}};}function respondWithFilteredResult(_0x305501,_0x591a32){return function(_0x8d6ef9){if(_0x8d6ef9){var _0x4f5ab7=typeof _0x591a32[_0x7379('0x22')]==='undefined'&&typeof _0x591a32[_0x7379('0x23')]==='undefined';var _0x599317=_0x8d6ef9['count'];var _0x1c63b2=_0x4f5ab7?0x0:_0x591a32[_0x7379('0x22')];var _0x4208af=_0x4f5ab7?_0x8d6ef9[_0x7379('0x24')]:_0x591a32[_0x7379('0x22')]+_0x591a32[_0x7379('0x23')];var _0x33e92e;if(_0x4208af>=_0x599317){_0x4208af=_0x599317;_0x33e92e=0xc8;}else{_0x33e92e=0xce;}_0x305501[_0x7379('0x20')](_0x33e92e);return _0x305501[_0x7379('0x25')](_0x7379('0x26'),_0x1c63b2+'-'+_0x4208af+'/'+_0x599317)['json'](_0x8d6ef9);}return null;};}function patchUpdates(_0x55fbfd){return function(_0x394509){try{jsonpatch[_0x7379('0x27')](_0x394509,_0x55fbfd,!![]);}catch(_0x358c43){return BPromise[_0x7379('0x28')](_0x358c43);}return _0x394509[_0x7379('0x29')]();};}function saveUpdates(_0x3d4350,_0x1b749f){return function(_0x5c8756){if(_0x5c8756){return _0x5c8756[_0x7379('0x2a')](_0x3d4350)[_0x7379('0x2b')](function(_0x31eead){return _0x31eead;});}return null;};}function removeEntity(_0x34a68f,_0x541c33){return function(_0x575832){if(_0x575832){return _0x575832[_0x7379('0x2c')]()[_0x7379('0x2b')](function(){_0x34a68f[_0x7379('0x20')](0xcc)[_0x7379('0x1f')]();});}};}function handleEntityNotFound(_0x196900,_0x5e0207){return function(_0x7c0630){if(!_0x7c0630){_0x196900['sendStatus'](0x194);}return _0x7c0630;};}function handleError(_0x11a9d2,_0x170c23){_0x170c23=_0x170c23||0x1f4;return function(_0x2ac48c){logger['error'](_0x2ac48c[_0x7379('0x2d')]);if(_0x2ac48c[_0x7379('0x2e')]){delete _0x2ac48c[_0x7379('0x2e')];}_0x11a9d2[_0x7379('0x20')](_0x170c23)[_0x7379('0x2f')](_0x2ac48c);};}exports[_0x7379('0x30')]=function(_0x5f3787,_0x3f7525){var _0x1ca092={},_0x2fd6f8={},_0x2ffa03={'count':0x0,'rows':[]};var _0x571334=_[_0x7379('0x31')](db[_0x7379('0x32')][_0x7379('0x33')],function(_0x32d9bb){return{'name':_0x32d9bb[_0x7379('0x34')],'type':_0x32d9bb[_0x7379('0x35')]['key']};});_0x2fd6f8[_0x7379('0x36')]=_['map'](_0x571334,'name');_0x2fd6f8[_0x7379('0x37')]=_[_0x7379('0x38')](_0x5f3787['query']);_0x2fd6f8['filters']=_[_0x7379('0x39')](_0x2fd6f8[_0x7379('0x36')],_0x2fd6f8[_0x7379('0x37')]);_0x1ca092[_0x7379('0x3a')]=_[_0x7379('0x39')](_0x2fd6f8[_0x7379('0x36')],qs[_0x7379('0x3b')](_0x5f3787[_0x7379('0x37')][_0x7379('0x3b')]));_0x1ca092[_0x7379('0x3a')]=_0x1ca092[_0x7379('0x3a')][_0x7379('0x3c')]?_0x1ca092[_0x7379('0x3a')]:_0x2fd6f8[_0x7379('0x36')];if(!_0x5f3787[_0x7379('0x37')]['hasOwnProperty'](_0x7379('0x3d'))){_0x1ca092[_0x7379('0x23')]=qs[_0x7379('0x23')](_0x5f3787[_0x7379('0x37')][_0x7379('0x23')]);_0x1ca092['offset']=qs['offset'](_0x5f3787[_0x7379('0x37')]['offset']);}_0x1ca092[_0x7379('0x3e')]=qs['sort'](_0x5f3787[_0x7379('0x37')][_0x7379('0x3f')]);_0x1ca092['where']=qs[_0x7379('0x40')](_[_0x7379('0x41')](_0x5f3787['query'],_0x2fd6f8[_0x7379('0x40')]),_0x571334);if(_0x5f3787['query'][_0x7379('0x42')]){_0x1ca092['where']=_[_0x7379('0x43')](_0x1ca092[_0x7379('0x44')],{'$or':_[_0x7379('0x31')](_0x571334,function(_0x38412b){if(_0x38412b[_0x7379('0x35')]!==_0x7379('0x45')){var _0x273e96={};_0x273e96[_0x38412b[_0x7379('0x2e')]]={'$like':'%'+_0x5f3787[_0x7379('0x37')][_0x7379('0x42')]+'%'};return _0x273e96;}})});}_0x1ca092=_['merge']({},_0x1ca092,_0x5f3787['options']);var _0x189646={'where':_0x1ca092[_0x7379('0x44')]};return db['ChatGroup'][_0x7379('0x24')](_0x189646)[_0x7379('0x2b')](function(_0x42e968){_0x2ffa03[_0x7379('0x24')]=_0x42e968;if(_0x5f3787[_0x7379('0x37')][_0x7379('0x46')]){_0x1ca092[_0x7379('0x47')]=[{'all':!![]}];}return db[_0x7379('0x32')][_0x7379('0x48')](_0x1ca092);})['then'](function(_0x1716f9){_0x2ffa03[_0x7379('0x49')]=_0x1716f9;return _0x2ffa03;})[_0x7379('0x2b')](respondWithFilteredResult(_0x3f7525,_0x1ca092))['catch'](handleError(_0x3f7525,null));};exports[_0x7379('0x4a')]=function(_0x28b3cb,_0x227e9f){var _0x1eeef6={'raw':!![],'where':{'id':_0x28b3cb[_0x7379('0x4b')]['id']}},_0x1ba726={};_0x1ba726[_0x7379('0x36')]=_[_0x7379('0x38')](db[_0x7379('0x32')][_0x7379('0x33')]);_0x1ba726['query']=_[_0x7379('0x38')](_0x28b3cb[_0x7379('0x37')]);_0x1ba726['filters']=_[_0x7379('0x39')](_0x1ba726[_0x7379('0x36')],_0x1ba726[_0x7379('0x37')]);_0x1eeef6[_0x7379('0x3a')]=_[_0x7379('0x39')](_0x1ba726['model'],qs[_0x7379('0x3b')](_0x28b3cb[_0x7379('0x37')][_0x7379('0x3b')]));_0x1eeef6[_0x7379('0x3a')]=_0x1eeef6['attributes']['length']?_0x1eeef6['attributes']:_0x1ba726[_0x7379('0x36')];if(_0x28b3cb[_0x7379('0x37')]['includeAll']){_0x1eeef6[_0x7379('0x47')]=[{'all':!![]}];}_0x1eeef6=_[_0x7379('0x43')]({},_0x1eeef6,_0x28b3cb[_0x7379('0x4c')]);return db['ChatGroup']['find'](_0x1eeef6)[_0x7379('0x2b')](handleEntityNotFound(_0x227e9f,null))[_0x7379('0x2b')](respondWithResult(_0x227e9f,null))[_0x7379('0x4d')](handleError(_0x227e9f,null));};exports[_0x7379('0x4e')]=function(_0x244caf,_0x5bce17){return db[_0x7379('0x32')]['create'](_0x244caf[_0x7379('0x4f')],{})[_0x7379('0x2b')](respondWithResult(_0x5bce17,0xc9))[_0x7379('0x4d')](handleError(_0x5bce17,null));};exports['update']=function(_0x2e7f37,_0x3a5dd9){if(_0x2e7f37['body']['id']){delete _0x2e7f37['body']['id'];}return db['ChatGroup'][_0x7379('0x50')]({'where':{'id':_0x2e7f37[_0x7379('0x4b')]['id']}})[_0x7379('0x2b')](handleEntityNotFound(_0x3a5dd9,null))[_0x7379('0x2b')](saveUpdates(_0x2e7f37[_0x7379('0x4f')],null))[_0x7379('0x2b')](respondWithResult(_0x3a5dd9,null))[_0x7379('0x4d')](handleError(_0x3a5dd9,null));};exports[_0x7379('0x2c')]=function(_0x11141d,_0x23b92e){return db['ChatGroup'][_0x7379('0x50')]({'where':{'id':_0x11141d[_0x7379('0x4b')]['id']}})['then'](handleEntityNotFound(_0x23b92e,null))[_0x7379('0x2b')](removeEntity(_0x23b92e,null))[_0x7379('0x4d')](handleError(_0x23b92e,null));};exports[_0x7379('0x51')]=function(_0x313375,_0x5efe69){return db['ChatGroup']['describe']()['then'](respondWithResult(_0x5efe69,null))[_0x7379('0x4d')](handleError(_0x5efe69,null));};exports[_0x7379('0x52')]=function(_0x38da20,_0x1ff82e,_0x5e266e){return db['ChatInternalMessage'][_0x7379('0x24')]({'where':{'ChatGroupId':_0x38da20[_0x7379('0x4b')]['id'],'ToId':_0x38da20[_0x7379('0x53')]['id'],'read':![]}})['then'](function(_0x53bb2a){return{'id':_[_0x7379('0x54')](_0x38da20[_0x7379('0x4b')]['id']),'count':_0x53bb2a};})[_0x7379('0x2b')](respondWithResult(_0x1ff82e,null))[_0x7379('0x4d')](handleError(_0x1ff82e,null));};exports[_0x7379('0x55')]=function(_0x34421e,_0x4beeb3,_0x102df5){return db[_0x7379('0x32')][_0x7379('0x50')]({'where':{'id':_0x34421e[_0x7379('0x4b')]['id']}})[_0x7379('0x2b')](handleEntityNotFound(_0x4beeb3,null))[_0x7379('0x2b')](function(_0x273a8c){if(_0x273a8c){return _0x273a8c[_0x7379('0x55')](_0x34421e[_0x7379('0x4f')][_0x7379('0x56')],_[_0x7379('0x57')](_0x34421e[_0x7379('0x4f')],[_0x7379('0x56'),'id'])||{});}})[_0x7379('0x2b')](respondWithResult(_0x4beeb3,null))[_0x7379('0x4d')](handleError(_0x4beeb3,null));};exports[_0x7379('0x58')]=function(_0x1f5771,_0x2abb75,_0x53b188){var _0x3318b5={};var _0x4252f0={};var _0x45c9b3;var _0x323055;return db[_0x7379('0x32')][_0x7379('0x59')]({'where':{'id':_0x1f5771[_0x7379('0x4b')]['id']}})[_0x7379('0x2b')](handleEntityNotFound(_0x2abb75,null))['then'](function(_0x11d107){if(_0x11d107){_0x45c9b3=_0x11d107;_0x4252f0[_0x7379('0x36')]=_[_0x7379('0x38')](db['User'][_0x7379('0x33')]);_0x4252f0[_0x7379('0x37')]=_[_0x7379('0x38')](_0x1f5771['query']);_0x4252f0[_0x7379('0x40')]=_[_0x7379('0x39')](_0x4252f0['model'],_0x4252f0[_0x7379('0x37')]);_0x3318b5['attributes']=_['intersection'](_0x4252f0['model'],qs[_0x7379('0x3b')](_0x1f5771[_0x7379('0x37')][_0x7379('0x3b')]));_0x3318b5[_0x7379('0x3a')]=_0x3318b5[_0x7379('0x3a')][_0x7379('0x3c')]?_0x3318b5[_0x7379('0x3a')]:_0x4252f0['model'];_0x3318b5[_0x7379('0x3e')]=qs[_0x7379('0x3f')](_0x1f5771['query']['sort']);_0x3318b5[_0x7379('0x44')]=qs[_0x7379('0x40')](_[_0x7379('0x41')](_0x1f5771[_0x7379('0x37')],_0x4252f0[_0x7379('0x40')]));if(_0x1f5771[_0x7379('0x37')][_0x7379('0x42')]){_0x3318b5[_0x7379('0x44')]=_[_0x7379('0x43')](_0x3318b5[_0x7379('0x44')],{'$or':_[_0x7379('0x31')](_0x3318b5['attributes'],function(_0x4b7961){var _0x198ae8={};_0x198ae8[_0x4b7961]={'$like':'%'+_0x1f5771[_0x7379('0x37')][_0x7379('0x42')]+'%'};return _0x198ae8;})});}_0x3318b5=_[_0x7379('0x43')]({},_0x3318b5,_0x1f5771[_0x7379('0x4c')]);return _0x45c9b3[_0x7379('0x58')](_0x3318b5);}})[_0x7379('0x2b')](function(_0x8b5780){if(_0x8b5780){_0x323055=_0x8b5780[_0x7379('0x3c')];if(!_0x1f5771['query']['hasOwnProperty'](_0x7379('0x3d'))){_0x3318b5[_0x7379('0x23')]=qs[_0x7379('0x23')](_0x1f5771[_0x7379('0x37')]['limit']);_0x3318b5[_0x7379('0x22')]=qs[_0x7379('0x22')](_0x1f5771[_0x7379('0x37')][_0x7379('0x22')]);}return _0x45c9b3[_0x7379('0x58')](_0x3318b5);}})[_0x7379('0x2b')](function(_0x387ba9){if(_0x387ba9){return _0x387ba9?{'count':_0x323055,'rows':_0x387ba9}:null;}})[_0x7379('0x2b')](respondWithResult(_0x2abb75,null))['catch'](handleError(_0x2abb75,null));};exports[_0x7379('0x5a')]=function(_0xf512c0,_0x207649,_0x51742a){return db['ChatGroup'][_0x7379('0x50')]({'where':{'id':_0xf512c0[_0x7379('0x4b')]['id']}})[_0x7379('0x2b')](handleEntityNotFound(_0x207649,null))[_0x7379('0x2b')](function(_0x1d1246){if(_0x1d1246){return _0x1d1246[_0x7379('0x5a')](_0xf512c0[_0x7379('0x37')]['ids']);}})[_0x7379('0x2b')](respondWithStatusCode(_0x207649,null))[_0x7379('0x4d')](handleError(_0x207649,null));};exports[_0x7379('0x5b')]=function(_0x17ca5a,_0x1c059e,_0x4caa38){if(_0x17ca5a['body']['id']){delete _0x17ca5a[_0x7379('0x4f')]['id'];}return db[_0x7379('0x32')]['find']({'where':{'id':_0x17ca5a['params']['id']}})[_0x7379('0x2b')](handleEntityNotFound(_0x1c059e,null))[_0x7379('0x2b')](function(_0xe343a5){if(_0xe343a5){_0x17ca5a['body']['ChatGroupId']=_0xe343a5['id'];return db[_0x7379('0x5c')][_0x7379('0x4e')](_0x17ca5a[_0x7379('0x4f')]);}})['then'](respondWithResult(_0x1c059e,null))[_0x7379('0x4d')](handleError(_0x1c059e,null));};exports[_0x7379('0x5d')]=function(_0xc1657d,_0x1e24e9,_0x2a342e){var _0x157494={};var _0x64d288={};var _0x24e47a;var _0x154197;return db['ChatGroup'][_0x7379('0x59')]({'where':{'id':_0xc1657d[_0x7379('0x4b')]['id']}})[_0x7379('0x2b')](handleEntityNotFound(_0x1e24e9,null))[_0x7379('0x2b')](function(_0x558fd6){if(_0x558fd6){_0x24e47a=_0x558fd6;_0x64d288[_0x7379('0x36')]=_[_0x7379('0x38')](db[_0x7379('0x5c')][_0x7379('0x33')]);_0x64d288[_0x7379('0x37')]=_[_0x7379('0x38')](_0xc1657d['query']);_0x64d288[_0x7379('0x40')]=_['intersection'](_0x64d288[_0x7379('0x36')],_0x64d288[_0x7379('0x37')]);_0x157494[_0x7379('0x3a')]=_[_0x7379('0x39')](_0x64d288[_0x7379('0x36')],qs[_0x7379('0x3b')](_0xc1657d[_0x7379('0x37')][_0x7379('0x3b')]));_0x157494['attributes']=_0x157494[_0x7379('0x3a')][_0x7379('0x3c')]?_0x157494[_0x7379('0x3a')]:_0x64d288[_0x7379('0x36')];_0x157494[_0x7379('0x3e')]=qs[_0x7379('0x3f')](_0xc1657d[_0x7379('0x37')][_0x7379('0x3f')]);_0x157494[_0x7379('0x44')]=qs[_0x7379('0x40')](_[_0x7379('0x41')](_0xc1657d['query'],_0x64d288[_0x7379('0x40')]));if(_0xc1657d['query']['filter']){_0x157494[_0x7379('0x44')]=_[_0x7379('0x43')](_0x157494[_0x7379('0x44')],{'$or':_[_0x7379('0x31')](_0x157494[_0x7379('0x3a')],function(_0x8de295){var _0x56141d={};_0x56141d[_0x8de295]={'$like':'%'+_0xc1657d[_0x7379('0x37')][_0x7379('0x42')]+'%'};return _0x56141d;})});}if(_0xc1657d[_0x7379('0x37')][_0x7379('0x5e')]){var _0x586139=_0xc1657d[_0x7379('0x37')]['$gte']['split'](',');var _0x3db31a={};_0x3db31a[_0x586139[0x0]]={'$gte':moment(_0x586139[0x1])[_0x7379('0x5f')](_0x7379('0x60'))};_0x157494[_0x7379('0x44')]=_[_0x7379('0x43')](_0x157494[_0x7379('0x44')],_0x3db31a);}_0x157494=_[_0x7379('0x43')]({},_0x157494,_0xc1657d[_0x7379('0x4c')]);return _0x24e47a[_0x7379('0x5d')](_0x157494);}})[_0x7379('0x2b')](function(_0x426e34){if(_0x426e34){_0x154197=_0x426e34['length'];if(!_0xc1657d['query'][_0x7379('0x61')](_0x7379('0x3d'))){_0x157494[_0x7379('0x23')]=qs[_0x7379('0x23')](_0xc1657d[_0x7379('0x37')][_0x7379('0x23')]);_0x157494[_0x7379('0x22')]=qs['offset'](_0xc1657d[_0x7379('0x37')]['offset']);}return _0x24e47a[_0x7379('0x5d')](_0x157494);}})[_0x7379('0x2b')](function(_0x39ef80){if(_0x39ef80){return _0x39ef80?{'count':_0x154197,'rows':_0x39ef80}:null;}})[_0x7379('0x2b')](respondWithResult(_0x1e24e9,null))['catch'](handleError(_0x1e24e9,null));};
\ No newline at end of file
+var _0x88f2=['ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','register','status','end','json','offset','undefined','limit','count','reject','update','destroy','then','sendStatus','name','send','index','map','rawAttributes','fieldName','type','key','keys','query','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','includeAll','ChatGroup','findAll','rows','catch','params','intersection','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','omit','ids','findOne','User','getMembers','removeMembers','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv'];(function(_0x3b8e87,_0x20af08){var _0x242a76=function(_0x1ad9fa){while(--_0x1ad9fa){_0x3b8e87['push'](_0x3b8e87['shift']());}};_0x242a76(++_0x20af08);}(_0x88f2,0x1c7));var _0x288f=function(_0xd124af,_0x4b2563){_0xd124af=_0xd124af-0x0;var _0x4228d3=_0x88f2[_0xd124af];return _0x4228d3;};'use strict';var emlformat=require(_0x288f('0x0'));var rimraf=require(_0x288f('0x1'));var zipdir=require(_0x288f('0x2'));var jsonpatch=require(_0x288f('0x3'));var rp=require('request-promise');var moment=require(_0x288f('0x4'));var BPromise=require(_0x288f('0x5'));var Mustache=require(_0x288f('0x6'));var util=require('util');var path=require(_0x288f('0x7'));var sox=require(_0x288f('0x8'));var csv=require(_0x288f('0x9'));var ejs=require(_0x288f('0xa'));var fs=require('fs');var fs_extra=require(_0x288f('0xb'));var _=require('lodash');var squel=require(_0x288f('0xc'));var crypto=require('crypto');var jsforce=require(_0x288f('0xd'));var deskjs=require(_0x288f('0xe'));var toCsv=require(_0x288f('0x9'));var querystring=require(_0x288f('0xf'));var Papa=require('papaparse');var Redis=require(_0x288f('0x10'));var authService=require(_0x288f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x288f('0x12'));var hardwareService=require(_0x288f('0x13'));var logger=require(_0x288f('0x14'))(_0x288f('0x15'));var utils=require(_0x288f('0x16'));var config=require(_0x288f('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x288f('0x18'))['db'];config['redis']=_[_0x288f('0x19')](config[_0x288f('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x288f('0x1b'))(new Redis(config[_0x288f('0x1a')]));require('./chatGroup.socket')[_0x288f('0x1c')](socket);function respondWithStatusCode(_0x4a0a69,_0x3be335){_0x3be335=_0x3be335||0xcc;return function(_0x109440){if(_0x109440){return _0x4a0a69['sendStatus'](_0x3be335);}return _0x4a0a69[_0x288f('0x1d')](_0x3be335)[_0x288f('0x1e')]();};}function respondWithResult(_0x3802f9,_0x48647d){_0x48647d=_0x48647d||0xc8;return function(_0xf9725){if(_0xf9725){return _0x3802f9[_0x288f('0x1d')](_0x48647d)[_0x288f('0x1f')](_0xf9725);}};}function respondWithFilteredResult(_0x3a555e,_0x11583a){return function(_0x5b6727){if(_0x5b6727){var _0x24ecfd=typeof _0x11583a[_0x288f('0x20')]===_0x288f('0x21')&&typeof _0x11583a[_0x288f('0x22')]===_0x288f('0x21');var _0x5a6248=_0x5b6727[_0x288f('0x23')];var _0x2b49d6=_0x24ecfd?0x0:_0x11583a['offset'];var _0x9762ec=_0x24ecfd?_0x5b6727[_0x288f('0x23')]:_0x11583a['offset']+_0x11583a[_0x288f('0x22')];var _0x5bd299;if(_0x9762ec>=_0x5a6248){_0x9762ec=_0x5a6248;_0x5bd299=0xc8;}else{_0x5bd299=0xce;}_0x3a555e[_0x288f('0x1d')](_0x5bd299);return _0x3a555e['set']('Content-Range',_0x2b49d6+'-'+_0x9762ec+'/'+_0x5a6248)[_0x288f('0x1f')](_0x5b6727);}return null;};}function patchUpdates(_0x946953){return function(_0x2c9275){try{jsonpatch['apply'](_0x2c9275,_0x946953,!![]);}catch(_0x340030){return BPromise[_0x288f('0x24')](_0x340030);}return _0x2c9275['save']();};}function saveUpdates(_0x3e2b06,_0x12b084){return function(_0x34d59c){if(_0x34d59c){return _0x34d59c[_0x288f('0x25')](_0x3e2b06)['then'](function(_0x2c0fdb){return _0x2c0fdb;});}return null;};}function removeEntity(_0x4a6a62,_0x3377c4){return function(_0x34bf30){if(_0x34bf30){return _0x34bf30[_0x288f('0x26')]()[_0x288f('0x27')](function(){_0x4a6a62[_0x288f('0x1d')](0xcc)[_0x288f('0x1e')]();});}};}function handleEntityNotFound(_0x434163,_0x2ca24b){return function(_0x5abd5d){if(!_0x5abd5d){_0x434163[_0x288f('0x28')](0x194);}return _0x5abd5d;};}function handleError(_0x17879e,_0xb43bb0){_0xb43bb0=_0xb43bb0||0x1f4;return function(_0x15bcd1){logger['error'](_0x15bcd1['stack']);if(_0x15bcd1[_0x288f('0x29')]){delete _0x15bcd1['name'];}_0x17879e[_0x288f('0x1d')](_0xb43bb0)[_0x288f('0x2a')](_0x15bcd1);};}exports[_0x288f('0x2b')]=function(_0x31e15b,_0x44fc19){var _0x32fb25={},_0x2be33a={},_0x4154de={'count':0x0,'rows':[]};var _0x2148f0=_[_0x288f('0x2c')](db['ChatGroup'][_0x288f('0x2d')],function(_0x260bd0){return{'name':_0x260bd0[_0x288f('0x2e')],'type':_0x260bd0[_0x288f('0x2f')][_0x288f('0x30')]};});_0x2be33a['model']=_[_0x288f('0x2c')](_0x2148f0,_0x288f('0x29'));_0x2be33a['query']=_[_0x288f('0x31')](_0x31e15b[_0x288f('0x32')]);_0x2be33a['filters']=_['intersection'](_0x2be33a['model'],_0x2be33a[_0x288f('0x32')]);_0x32fb25['attributes']=_['intersection'](_0x2be33a[_0x288f('0x33')],qs[_0x288f('0x34')](_0x31e15b['query']['fields']));_0x32fb25[_0x288f('0x35')]=_0x32fb25[_0x288f('0x35')][_0x288f('0x36')]?_0x32fb25[_0x288f('0x35')]:_0x2be33a[_0x288f('0x33')];if(!_0x31e15b[_0x288f('0x32')][_0x288f('0x37')](_0x288f('0x38'))){_0x32fb25['limit']=qs[_0x288f('0x22')](_0x31e15b[_0x288f('0x32')][_0x288f('0x22')]);_0x32fb25[_0x288f('0x20')]=qs[_0x288f('0x20')](_0x31e15b[_0x288f('0x32')][_0x288f('0x20')]);}_0x32fb25[_0x288f('0x39')]=qs['sort'](_0x31e15b[_0x288f('0x32')][_0x288f('0x3a')]);_0x32fb25['where']=qs[_0x288f('0x3b')](_[_0x288f('0x3c')](_0x31e15b[_0x288f('0x32')],_0x2be33a[_0x288f('0x3b')]),_0x2148f0);if(_0x31e15b['query'][_0x288f('0x3d')]){_0x32fb25[_0x288f('0x3e')]=_[_0x288f('0x3f')](_0x32fb25[_0x288f('0x3e')],{'$or':_[_0x288f('0x2c')](_0x2148f0,function(_0xfe16a0){if(_0xfe16a0[_0x288f('0x2f')]!=='VIRTUAL'){var _0x4a8b25={};_0x4a8b25[_0xfe16a0[_0x288f('0x29')]]={'$like':'%'+_0x31e15b[_0x288f('0x32')][_0x288f('0x3d')]+'%'};return _0x4a8b25;}})});}_0x32fb25=_['merge']({},_0x32fb25,_0x31e15b[_0x288f('0x40')]);var _0x783a6b={'where':_0x32fb25['where']};return db['ChatGroup'][_0x288f('0x23')](_0x783a6b)[_0x288f('0x27')](function(_0x308880){_0x4154de[_0x288f('0x23')]=_0x308880;if(_0x31e15b[_0x288f('0x32')][_0x288f('0x41')]){_0x32fb25['include']=[{'all':!![]}];}return db[_0x288f('0x42')][_0x288f('0x43')](_0x32fb25);})[_0x288f('0x27')](function(_0x26f2b0){_0x4154de[_0x288f('0x44')]=_0x26f2b0;return _0x4154de;})[_0x288f('0x27')](respondWithFilteredResult(_0x44fc19,_0x32fb25))[_0x288f('0x45')](handleError(_0x44fc19,null));};exports['show']=function(_0x1e6f62,_0x47a483){var _0x34e5b9={'raw':!![],'where':{'id':_0x1e6f62[_0x288f('0x46')]['id']}},_0x41fcbb={};_0x41fcbb[_0x288f('0x33')]=_[_0x288f('0x31')](db[_0x288f('0x42')][_0x288f('0x2d')]);_0x41fcbb['query']=_['keys'](_0x1e6f62[_0x288f('0x32')]);_0x41fcbb[_0x288f('0x3b')]=_['intersection'](_0x41fcbb[_0x288f('0x33')],_0x41fcbb[_0x288f('0x32')]);_0x34e5b9[_0x288f('0x35')]=_[_0x288f('0x47')](_0x41fcbb['model'],qs[_0x288f('0x34')](_0x1e6f62[_0x288f('0x32')][_0x288f('0x34')]));_0x34e5b9['attributes']=_0x34e5b9[_0x288f('0x35')]['length']?_0x34e5b9[_0x288f('0x35')]:_0x41fcbb['model'];if(_0x1e6f62['query'][_0x288f('0x41')]){_0x34e5b9['include']=[{'all':!![]}];}_0x34e5b9=_[_0x288f('0x3f')]({},_0x34e5b9,_0x1e6f62[_0x288f('0x40')]);return db[_0x288f('0x42')][_0x288f('0x48')](_0x34e5b9)['then'](handleEntityNotFound(_0x47a483,null))[_0x288f('0x27')](respondWithResult(_0x47a483,null))[_0x288f('0x45')](handleError(_0x47a483,null));};exports[_0x288f('0x49')]=function(_0x1c23a2,_0x892824){return db[_0x288f('0x42')][_0x288f('0x49')](_0x1c23a2[_0x288f('0x4a')],{})[_0x288f('0x27')](respondWithResult(_0x892824,0xc9))['catch'](handleError(_0x892824,null));};exports[_0x288f('0x25')]=function(_0x382d75,_0x51f00a){if(_0x382d75[_0x288f('0x4a')]['id']){delete _0x382d75[_0x288f('0x4a')]['id'];}return db[_0x288f('0x42')][_0x288f('0x48')]({'where':{'id':_0x382d75[_0x288f('0x46')]['id']}})[_0x288f('0x27')](handleEntityNotFound(_0x51f00a,null))[_0x288f('0x27')](saveUpdates(_0x382d75['body'],null))[_0x288f('0x27')](respondWithResult(_0x51f00a,null))[_0x288f('0x45')](handleError(_0x51f00a,null));};exports['destroy']=function(_0x4a7a6c,_0x55d079){return db[_0x288f('0x42')][_0x288f('0x48')]({'where':{'id':_0x4a7a6c[_0x288f('0x46')]['id']}})['then'](handleEntityNotFound(_0x55d079,null))[_0x288f('0x27')](removeEntity(_0x55d079,null))['catch'](handleError(_0x55d079,null));};exports[_0x288f('0x4b')]=function(_0xf15634,_0x578c19){return db[_0x288f('0x42')][_0x288f('0x4b')]()[_0x288f('0x27')](respondWithResult(_0x578c19,null))[_0x288f('0x45')](handleError(_0x578c19,null));};exports[_0x288f('0x4c')]=function(_0x27156e,_0x314209,_0x1f50ce){return db[_0x288f('0x4d')]['count']({'where':{'ChatGroupId':_0x27156e[_0x288f('0x46')]['id'],'ToId':_0x27156e[_0x288f('0x4e')]['id'],'read':![]}})[_0x288f('0x27')](function(_0x19dde8){return{'id':_[_0x288f('0x4f')](_0x27156e[_0x288f('0x46')]['id']),'count':_0x19dde8};})['then'](respondWithResult(_0x314209,null))['catch'](handleError(_0x314209,null));};exports['addMembers']=function(_0xe7531a,_0x1f489c,_0x543447){return db[_0x288f('0x42')][_0x288f('0x48')]({'where':{'id':_0xe7531a['params']['id']}})[_0x288f('0x27')](handleEntityNotFound(_0x1f489c,null))['then'](function(_0x4b3460){if(_0x4b3460){return _0x4b3460[_0x288f('0x50')](_0xe7531a['body']['ids'],_[_0x288f('0x51')](_0xe7531a['body'],[_0x288f('0x52'),'id'])||{});}})[_0x288f('0x27')](respondWithResult(_0x1f489c,null))[_0x288f('0x45')](handleError(_0x1f489c,null));};exports['getMembers']=function(_0xf85108,_0x133f86,_0x44f00a){var _0x24949a={};var _0x3d0561={};var _0x600f03;var _0x52f1df;return db['ChatGroup'][_0x288f('0x53')]({'where':{'id':_0xf85108[_0x288f('0x46')]['id']}})['then'](handleEntityNotFound(_0x133f86,null))['then'](function(_0x2d602b){if(_0x2d602b){_0x600f03=_0x2d602b;_0x3d0561['model']=_[_0x288f('0x31')](db[_0x288f('0x54')][_0x288f('0x2d')]);_0x3d0561[_0x288f('0x32')]=_[_0x288f('0x31')](_0xf85108[_0x288f('0x32')]);_0x3d0561[_0x288f('0x3b')]=_['intersection'](_0x3d0561[_0x288f('0x33')],_0x3d0561[_0x288f('0x32')]);_0x24949a[_0x288f('0x35')]=_[_0x288f('0x47')](_0x3d0561['model'],qs[_0x288f('0x34')](_0xf85108[_0x288f('0x32')]['fields']));_0x24949a['attributes']=_0x24949a[_0x288f('0x35')]['length']?_0x24949a[_0x288f('0x35')]:_0x3d0561['model'];_0x24949a['order']=qs[_0x288f('0x3a')](_0xf85108[_0x288f('0x32')][_0x288f('0x3a')]);_0x24949a[_0x288f('0x3e')]=qs[_0x288f('0x3b')](_['pick'](_0xf85108[_0x288f('0x32')],_0x3d0561[_0x288f('0x3b')]));if(_0xf85108[_0x288f('0x32')][_0x288f('0x3d')]){_0x24949a['where']=_['merge'](_0x24949a[_0x288f('0x3e')],{'$or':_[_0x288f('0x2c')](_0x24949a[_0x288f('0x35')],function(_0x56136e){var _0x135b48={};_0x135b48[_0x56136e]={'$like':'%'+_0xf85108[_0x288f('0x32')][_0x288f('0x3d')]+'%'};return _0x135b48;})});}_0x24949a=_['merge']({},_0x24949a,_0xf85108[_0x288f('0x40')]);return _0x600f03['getMembers'](_0x24949a);}})[_0x288f('0x27')](function(_0x4d1a70){if(_0x4d1a70){_0x52f1df=_0x4d1a70[_0x288f('0x36')];if(!_0xf85108[_0x288f('0x32')]['hasOwnProperty'](_0x288f('0x38'))){_0x24949a[_0x288f('0x22')]=qs[_0x288f('0x22')](_0xf85108[_0x288f('0x32')]['limit']);_0x24949a[_0x288f('0x20')]=qs[_0x288f('0x20')](_0xf85108[_0x288f('0x32')][_0x288f('0x20')]);}return _0x600f03[_0x288f('0x55')](_0x24949a);}})['then'](function(_0x58c4f3){if(_0x58c4f3){return _0x58c4f3?{'count':_0x52f1df,'rows':_0x58c4f3}:null;}})['then'](respondWithResult(_0x133f86,null))[_0x288f('0x45')](handleError(_0x133f86,null));};exports[_0x288f('0x56')]=function(_0x2448e0,_0x27598b,_0x48c777){return db[_0x288f('0x42')][_0x288f('0x48')]({'where':{'id':_0x2448e0[_0x288f('0x46')]['id']}})[_0x288f('0x27')](handleEntityNotFound(_0x27598b,null))['then'](function(_0x44932c){if(_0x44932c){return _0x44932c[_0x288f('0x56')](_0x2448e0['query'][_0x288f('0x52')]);}})[_0x288f('0x27')](respondWithStatusCode(_0x27598b,null))[_0x288f('0x45')](handleError(_0x27598b,null));};exports['addMessage']=function(_0x5324f2,_0x55a117,_0xefa238){if(_0x5324f2[_0x288f('0x4a')]['id']){delete _0x5324f2['body']['id'];}return db[_0x288f('0x42')][_0x288f('0x48')]({'where':{'id':_0x5324f2[_0x288f('0x46')]['id']}})[_0x288f('0x27')](handleEntityNotFound(_0x55a117,null))[_0x288f('0x27')](function(_0x469698){if(_0x469698){_0x5324f2['body'][_0x288f('0x57')]=_0x469698['id'];return db[_0x288f('0x4d')][_0x288f('0x49')](_0x5324f2[_0x288f('0x4a')]);}})['then'](respondWithResult(_0x55a117,null))[_0x288f('0x45')](handleError(_0x55a117,null));};exports[_0x288f('0x58')]=function(_0x1a0131,_0xdd24a2,_0x1bde0f){var _0x42f7ba={};var _0x4b938f={};var _0x1894ef;var _0x5e5350;return db['ChatGroup']['findOne']({'where':{'id':_0x1a0131[_0x288f('0x46')]['id']}})['then'](handleEntityNotFound(_0xdd24a2,null))[_0x288f('0x27')](function(_0x481629){if(_0x481629){_0x1894ef=_0x481629;_0x4b938f[_0x288f('0x33')]=_[_0x288f('0x31')](db[_0x288f('0x4d')][_0x288f('0x2d')]);_0x4b938f[_0x288f('0x32')]=_['keys'](_0x1a0131[_0x288f('0x32')]);_0x4b938f[_0x288f('0x3b')]=_['intersection'](_0x4b938f['model'],_0x4b938f[_0x288f('0x32')]);_0x42f7ba[_0x288f('0x35')]=_[_0x288f('0x47')](_0x4b938f[_0x288f('0x33')],qs[_0x288f('0x34')](_0x1a0131[_0x288f('0x32')][_0x288f('0x34')]));_0x42f7ba[_0x288f('0x35')]=_0x42f7ba[_0x288f('0x35')][_0x288f('0x36')]?_0x42f7ba[_0x288f('0x35')]:_0x4b938f['model'];_0x42f7ba[_0x288f('0x39')]=qs['sort'](_0x1a0131[_0x288f('0x32')][_0x288f('0x3a')]);_0x42f7ba[_0x288f('0x3e')]=qs['filters'](_[_0x288f('0x3c')](_0x1a0131['query'],_0x4b938f['filters']));if(_0x1a0131['query'][_0x288f('0x3d')]){_0x42f7ba['where']=_[_0x288f('0x3f')](_0x42f7ba['where'],{'$or':_[_0x288f('0x2c')](_0x42f7ba['attributes'],function(_0x2052d1){var _0xdabfcf={};_0xdabfcf[_0x2052d1]={'$like':'%'+_0x1a0131[_0x288f('0x32')]['filter']+'%'};return _0xdabfcf;})});}if(_0x1a0131[_0x288f('0x32')][_0x288f('0x59')]){var _0x3ac1ec=_0x1a0131[_0x288f('0x32')]['$gte'][_0x288f('0x5a')](',');var _0x4b34be={};_0x4b34be[_0x3ac1ec[0x0]]={'$gte':moment(_0x3ac1ec[0x1])[_0x288f('0x5b')](_0x288f('0x5c'))};_0x42f7ba['where']=_['merge'](_0x42f7ba['where'],_0x4b34be);}_0x42f7ba=_['merge']({},_0x42f7ba,_0x1a0131[_0x288f('0x40')]);return _0x1894ef[_0x288f('0x58')](_0x42f7ba);}})[_0x288f('0x27')](function(_0x206081){if(_0x206081){_0x5e5350=_0x206081[_0x288f('0x36')];if(!_0x1a0131['query'][_0x288f('0x37')](_0x288f('0x38'))){_0x42f7ba[_0x288f('0x22')]=qs[_0x288f('0x22')](_0x1a0131[_0x288f('0x32')]['limit']);_0x42f7ba[_0x288f('0x20')]=qs[_0x288f('0x20')](_0x1a0131[_0x288f('0x32')][_0x288f('0x20')]);}return _0x1894ef['getMessages'](_0x42f7ba);}})[_0x288f('0x27')](function(_0x5d8715){if(_0x5d8715){return _0x5d8715?{'count':_0x5e5350,'rows':_0x5d8715}:null;}})[_0x288f('0x27')](respondWithResult(_0xdd24a2,null))[_0x288f('0x45')](handleError(_0xdd24a2,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index bb73b25..07e11c1 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 _0xcc4b=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatGroup'];(function(_0x1d0de6,_0x3c2621){var _0x2fa79f=function(_0x1e9418){while(--_0x1e9418){_0x1d0de6['push'](_0x1d0de6['shift']());}};_0x2fa79f(++_0x3c2621);}(_0xcc4b,0x16f));var _0xbcc4=function(_0x22a75f,_0xf98f1f){_0x22a75f=_0x22a75f-0x0;var _0x583584=_0xcc4b[_0x22a75f];return _0x583584;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0xbcc4('0x0'))['db'][_0xbcc4('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xbcc4('0x2')](0x0);var events={'afterCreate':_0xbcc4('0x3'),'afterUpdate':_0xbcc4('0x4'),'afterDestroy':'remove'};function emitEvent(_0xc9c076){return function(_0x4c960d,_0x370606,_0x27b998){ChatGroupEvents[_0xbcc4('0x5')](_0xc9c076+':'+_0x4c960d['id'],_0x4c960d);ChatGroupEvents['emit'](_0xc9c076,_0x4c960d);_0x27b998(null);};}for(var e in events){if(events[_0xbcc4('0x6')](e)){var event=events[e];ChatGroup[_0xbcc4('0x7')](e,emitEvent(event));}}module[_0xbcc4('0x8')]=ChatGroupEvents;
\ No newline at end of file
+var _0xdcdb=['exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x18d29b,_0x3034d2){var _0x3c354f=function(_0xb6ea2){while(--_0xb6ea2){_0x18d29b['push'](_0x18d29b['shift']());}};_0x3c354f(++_0x3034d2);}(_0xdcdb,0x64));var _0xbdcd=function(_0x3cbea3,_0x17cae9){_0x3cbea3=_0x3cbea3-0x0;var _0x5cd639=_0xdcdb[_0x3cbea3];return _0x5cd639;};'use strict';var EventEmitter=require(_0xbdcd('0x0'));var ChatGroup=require(_0xbdcd('0x1'))['db'][_0xbdcd('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xbdcd('0x3')](0x0);var events={'afterCreate':_0xbdcd('0x4'),'afterUpdate':_0xbdcd('0x5'),'afterDestroy':_0xbdcd('0x6')};function emitEvent(_0x408a2f){return function(_0x13e06e,_0x2dbf8c,_0x2a604c){ChatGroupEvents[_0xbdcd('0x7')](_0x408a2f+':'+_0x13e06e['id'],_0x13e06e);ChatGroupEvents[_0xbdcd('0x7')](_0x408a2f,_0x13e06e);_0x2a604c(null);};}for(var e in events){if(events[_0xbdcd('0x8')](e)){var event=events[e];ChatGroup[_0xbdcd('0x9')](e,emitEvent(event));}}module[_0xbdcd('0xa')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index b75656e..6c94ee2 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 _0xe9d7=['../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x34fbd4,_0x3b303b){var _0x5723dc=function(_0x44cd65){while(--_0x44cd65){_0x34fbd4['push'](_0x34fbd4['shift']());}};_0x5723dc(++_0x3b303b);}(_0xe9d7,0xd8));var _0x7e9d=function(_0x5f1617,_0x46277b){_0x5f1617=_0x5f1617-0x0;var _0x3af5da=_0xe9d7[_0x5f1617];return _0x3af5da;};'use strict';var _=require(_0x7e9d('0x0'));var util=require(_0x7e9d('0x1'));var logger=require(_0x7e9d('0x2'))(_0x7e9d('0x3'));var moment=require(_0x7e9d('0x4'));var BPromise=require(_0x7e9d('0x5'));var rp=require(_0x7e9d('0x6'));var fs=require('fs');var path=require(_0x7e9d('0x7'));var rimraf=require(_0x7e9d('0x8'));var config=require(_0x7e9d('0x9'));var attributes=require(_0x7e9d('0xa'));module[_0x7e9d('0xb')]=function(_0x2b4566,_0x3bb1fb){return _0x2b4566[_0x7e9d('0xc')](_0x7e9d('0xd'),attributes,{'tableName':_0x7e9d('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa02d=['./chatGroup.attributes','exports','ChatGroup','chat_groups','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1dc0bf,_0x592eef){var _0x24ecef=function(_0xf954e3){while(--_0xf954e3){_0x1dc0bf['push'](_0x1dc0bf['shift']());}};_0x24ecef(++_0x592eef);}(_0xa02d,0x197));var _0xda02=function(_0x323430,_0x3d2b6d){_0x323430=_0x323430-0x0;var _0x9eecd1=_0xa02d[_0x323430];return _0x9eecd1;};'use strict';var _=require(_0xda02('0x0'));var util=require('util');var logger=require(_0xda02('0x1'))(_0xda02('0x2'));var moment=require(_0xda02('0x3'));var BPromise=require(_0xda02('0x4'));var rp=require(_0xda02('0x5'));var fs=require('fs');var path=require(_0xda02('0x6'));var rimraf=require(_0xda02('0x7'));var config=require(_0xda02('0x8'));var attributes=require(_0xda02('0x9'));module[_0xda02('0xa')]=function(_0x5a0a08,_0x3d9600){return _0x5a0a08['define'](_0xda02('0xb'),attributes,{'tableName':_0xda02('0xc'),'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 faf0581..0446b72 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 _0x8375=['request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatGroup.socket','register','request','info'];(function(_0x5875e7,_0x2c3ef8){var _0x1ebb9b=function(_0x517a44){while(--_0x517a44){_0x5875e7['push'](_0x5875e7['shift']());}};_0x1ebb9b(++_0x2c3ef8);}(_0x8375,0x132));var _0x5837=function(_0x5e96cf,_0x9698c){_0x5e96cf=_0x5e96cf-0x0;var _0x3bf168=_0x8375[_0x5e96cf];return _0x3bf168;};'use strict';var _=require('lodash');var util=require(_0x5837('0x0'));var moment=require(_0x5837('0x1'));var BPromise=require(_0x5837('0x2'));var rs=require(_0x5837('0x3'));var fs=require('fs');var Redis=require(_0x5837('0x4'));var db=require(_0x5837('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5837('0x6'))(_0x5837('0x7'));var config=require('../../config/environment');var jayson=require(_0x5837('0x8'));var client=jayson[_0x5837('0x9')][_0x5837('0xa')]({'port':0x232a});config[_0x5837('0xb')]=_['defaults'](config[_0x5837('0xb')],{'host':_0x5837('0xc'),'port':0x18eb});var socket=require(_0x5837('0xd'))(new Redis(config[_0x5837('0xb')]));require(_0x5837('0xe'))[_0x5837('0xf')](socket);function respondWithRpcPromise(_0x1bde71,_0x3f16c1,_0x2ce163){return new BPromise(function(_0x4f2b93,_0x4051b5){return client[_0x5837('0x10')](_0x1bde71,_0x2ce163)['then'](function(_0x102203){logger[_0x5837('0x11')]('ChatGroup,\x20%s,\x20%s',_0x3f16c1,_0x5837('0x12'));logger['debug'](_0x5837('0x13'),_0x3f16c1,_0x5837('0x12'),JSON[_0x5837('0x14')](_0x102203));if(_0x102203[_0x5837('0x15')]){if(_0x102203['error'][_0x5837('0x16')]===0x1f4){logger[_0x5837('0x15')](_0x5837('0x17'),_0x3f16c1,_0x102203['error'][_0x5837('0x18')]);return _0x4051b5(_0x102203[_0x5837('0x15')][_0x5837('0x18')]);}logger[_0x5837('0x15')](_0x5837('0x17'),_0x3f16c1,_0x102203[_0x5837('0x15')]['message']);return _0x4f2b93(_0x102203['error']['message']);}else{logger[_0x5837('0x11')](_0x5837('0x17'),_0x3f16c1,_0x5837('0x12'));_0x4f2b93(_0x102203[_0x5837('0x19')][_0x5837('0x18')]);}})[_0x5837('0x1a')](function(_0x2b87fb){logger['error'](_0x5837('0x17'),_0x3f16c1,_0x2b87fb);_0x4051b5(_0x2b87fb);});});}
\ No newline at end of file
+var _0x383a=['debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','ChatGroup,\x20%s,\x20%s','message','info','result','catch','util','moment','ioredis','../../config/utils','../../config/logger','rpc','client','http','redis','request','request\x20sent'];(function(_0x4f9704,_0x48445e){var _0x247f1b=function(_0x1010c5){while(--_0x1010c5){_0x4f9704['push'](_0x4f9704['shift']());}};_0x247f1b(++_0x48445e);}(_0x383a,0x1ad));var _0xa383=function(_0x5b8b97,_0x6b4dfa){_0x5b8b97=_0x5b8b97-0x0;var _0x1fdf84=_0x383a[_0x5b8b97];return _0x1fdf84;};'use strict';var _=require('lodash');var util=require(_0xa383('0x0'));var moment=require(_0xa383('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa383('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xa383('0x3'));var logger=require(_0xa383('0x4'))(_0xa383('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa383('0x6')][_0xa383('0x7')]({'port':0x232a});config[_0xa383('0x8')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa383('0x8')]));require('./chatGroup.socket')['register'](socket);function respondWithRpcPromise(_0x1b676b,_0x3d63e4,_0x54a64c){return new BPromise(function(_0x3c0b0b,_0x98afe6){return client[_0xa383('0x9')](_0x1b676b,_0x54a64c)['then'](function(_0x2b6871){logger['info']('ChatGroup,\x20%s,\x20%s',_0x3d63e4,_0xa383('0xa'));logger[_0xa383('0xb')](_0xa383('0xc'),_0x3d63e4,_0xa383('0xa'),JSON['stringify'](_0x2b6871));if(_0x2b6871[_0xa383('0xd')]){if(_0x2b6871[_0xa383('0xd')][_0xa383('0xe')]===0x1f4){logger[_0xa383('0xd')](_0xa383('0xf'),_0x3d63e4,_0x2b6871[_0xa383('0xd')][_0xa383('0x10')]);return _0x98afe6(_0x2b6871[_0xa383('0xd')]['message']);}logger['error'](_0xa383('0xf'),_0x3d63e4,_0x2b6871[_0xa383('0xd')][_0xa383('0x10')]);return _0x3c0b0b(_0x2b6871[_0xa383('0xd')]['message']);}else{logger[_0xa383('0x11')]('ChatGroup,\x20%s,\x20%s',_0x3d63e4,_0xa383('0xa'));_0x3c0b0b(_0x2b6871[_0xa383('0x12')][_0xa383('0x10')]);}})[_0xa383('0x13')](function(_0x1e0b81){logger[_0xa383('0xd')](_0xa383('0xf'),_0x3d63e4,_0x1e0b81);_0x98afe6(_0x1e0b81);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index b0b7df5..5b65078 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 _0xed5c=['./chatGroup.events','save','remove','emit','register','length'];(function(_0x2e589c,_0x68475b){var _0x3ff05e=function(_0x24ecf9){while(--_0x24ecf9){_0x2e589c['push'](_0x2e589c['shift']());}};_0x3ff05e(++_0x68475b);}(_0xed5c,0x1c8));var _0xced5=function(_0x401eb5,_0x22790e){_0x401eb5=_0x401eb5-0x0;var _0x2dd86c=_0xed5c[_0x401eb5];return _0x2dd86c;};'use strict';var ChatGroupEvents=require(_0xced5('0x0'));var events=[_0xced5('0x1'),_0xced5('0x2'),'update'];function createListener(_0x5f9868,_0x173bf8){return function(_0x20c081){_0x173bf8[_0xced5('0x3')](_0x5f9868,_0x20c081);};}function removeListener(_0x4a2081,_0x2c9e11){return function(){ChatGroupEvents['removeListener'](_0x4a2081,_0x2c9e11);};}exports[_0xced5('0x4')]=function(_0x3a6579){for(var _0x20edbf=0x0,_0x17a85a=events[_0xced5('0x5')];_0x20edbf<_0x17a85a;_0x20edbf++){var _0x593c84=events[_0x20edbf];var _0x12fcc2=createListener('chatGroup:'+_0x593c84,_0x3a6579);ChatGroupEvents['on'](_0x593c84,_0x12fcc2);}};
\ No newline at end of file
+var _0x566f=['remove','update','emit','removeListener','register','chatGroup:','./chatGroup.events'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x566f,0x1e2));var _0xf566=function(_0x43970e,_0x2e9e79){_0x43970e=_0x43970e-0x0;var _0x4fb408=_0x566f[_0x43970e];return _0x4fb408;};'use strict';var ChatGroupEvents=require(_0xf566('0x0'));var events=['save',_0xf566('0x1'),_0xf566('0x2')];function createListener(_0x4cef56,_0x2aded2){return function(_0x4ada16){_0x2aded2[_0xf566('0x3')](_0x4cef56,_0x4ada16);};}function removeListener(_0x1712bb,_0x825595){return function(){ChatGroupEvents[_0xf566('0x4')](_0x1712bb,_0x825595);};}exports[_0xf566('0x5')]=function(_0x2de8ae){for(var _0x5e0aef=0x0,_0xe1dc3d=events['length'];_0x5e0aef<_0xe1dc3d;_0x5e0aef++){var _0x4827db=events[_0x5e0aef];var _0x491fc9=createListener(_0xf566('0x6')+_0x4827db,_0x2de8ae);ChatGroupEvents['on'](_0x4827db,_0x491fc9);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index d960a9f..9412265 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 _0x7915=['/:id/members','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','/:id','show','/:id/unread','isAuthenticated','getUnread','/:id/messages','getMessages','post','addMembers','addMessage','put','update','destroy','delete'];(function(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0x7915,0x1c2));var _0x5791=function(_0x37a927,_0x1a10ad){_0x37a927=_0x37a927-0x0;var _0x1ad0c4=_0x7915[_0x37a927];return _0x1ad0c4;};'use strict';var multer=require(_0x5791('0x0'));var util=require(_0x5791('0x1'));var path=require(_0x5791('0x2'));var timeout=require(_0x5791('0x3'));var express=require(_0x5791('0x4'));var router=express[_0x5791('0x5')]();var fs_extra=require(_0x5791('0x6'));var auth=require(_0x5791('0x7'));var interaction=require(_0x5791('0x8'));var config=require(_0x5791('0x9'));var controller=require(_0x5791('0xa'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x5791('0xb')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x5791('0xb')](_0x5791('0xc'),auth['isAuthenticated'](),controller[_0x5791('0xd')]);router[_0x5791('0xb')](_0x5791('0xe'),auth[_0x5791('0xf')](),controller[_0x5791('0x10')]);router['get']('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0x5791('0xb')](_0x5791('0x11'),auth[_0x5791('0xf')](),controller[_0x5791('0x12')]);router[_0x5791('0x13')]('/',auth[_0x5791('0xf')](),controller['create']);router[_0x5791('0x13')]('/:id/members',auth['isAuthenticated'](),controller[_0x5791('0x14')]);router[_0x5791('0x13')](_0x5791('0x11'),auth[_0x5791('0xf')](),controller[_0x5791('0x15')]);router[_0x5791('0x16')](_0x5791('0xc'),auth[_0x5791('0xf')](),controller[_0x5791('0x17')]);router['delete'](_0x5791('0xc'),auth[_0x5791('0xf')](),controller[_0x5791('0x18')]);router[_0x5791('0x19')](_0x5791('0x1a'),auth[_0x5791('0xf')](),controller['removeMembers']);module[_0x5791('0x1b')]=router;
\ No newline at end of file
+var _0x45e1=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','isAuthenticated','index','get','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','put','update','delete','destroy','removeMembers','exports','multer','util','path'];(function(_0x6ff984,_0x52fbd1){var _0x1b8400=function(_0x15ce8c){while(--_0x15ce8c){_0x6ff984['push'](_0x6ff984['shift']());}};_0x1b8400(++_0x52fbd1);}(_0x45e1,0x11f));var _0x145e=function(_0x4cc123,_0x34b10c){_0x4cc123=_0x4cc123-0x0;var _0x982e94=_0x45e1[_0x4cc123];return _0x982e94;};'use strict';var multer=require(_0x145e('0x0'));var util=require(_0x145e('0x1'));var path=require(_0x145e('0x2'));var timeout=require(_0x145e('0x3'));var express=require(_0x145e('0x4'));var router=express[_0x145e('0x5')]();var fs_extra=require(_0x145e('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x145e('0x7'));var config=require('../../config/environment');var controller=require('./chatGroup.controller');router['get']('/',auth[_0x145e('0x8')](),controller[_0x145e('0x9')]);router[_0x145e('0xa')]('/describe',auth[_0x145e('0x8')](),controller['describe']);router[_0x145e('0xa')](_0x145e('0xb'),auth['isAuthenticated'](),controller[_0x145e('0xc')]);router[_0x145e('0xa')](_0x145e('0xd'),auth[_0x145e('0x8')](),controller[_0x145e('0xe')]);router['get'](_0x145e('0xf'),auth[_0x145e('0x8')](),controller[_0x145e('0x10')]);router[_0x145e('0xa')](_0x145e('0x11'),auth[_0x145e('0x8')](),controller[_0x145e('0x12')]);router[_0x145e('0x13')]('/',auth[_0x145e('0x8')](),controller[_0x145e('0x14')]);router[_0x145e('0x13')]('/:id/members',auth[_0x145e('0x8')](),controller[_0x145e('0x15')]);router[_0x145e('0x13')](_0x145e('0x11'),auth[_0x145e('0x8')](),controller[_0x145e('0x16')]);router[_0x145e('0x17')](_0x145e('0xb'),auth[_0x145e('0x8')](),controller[_0x145e('0x18')]);router[_0x145e('0x19')]('/:id',auth[_0x145e('0x8')](),controller[_0x145e('0x1a')]);router['delete']('/:id/members',auth['isAuthenticated'](),controller[_0x145e('0x1b')]);module[_0x145e('0x1c')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 3c9f7f7..8336fbf 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 _0xb8df=['sequelize','exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','out'];(function(_0x36b5be,_0x25cbb9){var _0x186b09=function(_0x559d03){while(--_0x559d03){_0x36b5be['push'](_0x36b5be['shift']());}};_0x186b09(++_0x25cbb9);}(_0xb8df,0x9a));var _0xfb8d=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xb8df[_0x3054be];return _0x3df150;};'use strict';var Sequelize=require(_0xfb8d('0x0'));module[_0xfb8d('0x1')]={'closed':{'type':Sequelize[_0xfb8d('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xfb8d('0x3')]},'ratingType':{'type':Sequelize[_0xfb8d('0x4')](_0xfb8d('0x5'),_0xfb8d('0x6')),'defaultValue':_0xfb8d('0x5')},'ratingMessage':{'type':Sequelize[_0xfb8d('0x7')]},'pathTranscript':{'type':Sequelize[_0xfb8d('0x7')]},'mailTranscript':{'type':Sequelize[_0xfb8d('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xfb8d('0x9')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xfb8d('0x8')]},'thirdDisposition':{'type':Sequelize[_0xfb8d('0x8')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0xfb8d('0x8')]},'osName':{'type':Sequelize[_0xfb8d('0x8')]},'osVersion':{'type':Sequelize[_0xfb8d('0x8')]},'deviceModel':{'type':Sequelize[_0xfb8d('0x8')]},'deviceVendor':{'type':Sequelize[_0xfb8d('0x8')]},'deviceType':{'type':Sequelize[_0xfb8d('0x8')]},'referer':{'type':Sequelize[_0xfb8d('0x7')]},'customerIp':{'type':Sequelize[_0xfb8d('0x8')]},'formData':{'type':Sequelize[_0xfb8d('0x7')]('long')},'read1stAt':{'type':Sequelize[_0xfb8d('0x9')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xfb8d('0x4')]('in',_0xfb8d('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0xfb8d('0x8')]},'vidaooSessionId':{'type':Sequelize[_0xfb8d('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0xfb8d('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xfb8d('0x3')]}};
\ No newline at end of file
+var _0x8c1e=['STRING','DATE','out','BOOLEAN','sequelize','exports','INTEGER','ENUM','star','thumb','TEXT'];(function(_0x32f060,_0x3e6045){var _0x596642=function(_0x351ce7){while(--_0x351ce7){_0x32f060['push'](_0x32f060['shift']());}};_0x596642(++_0x3e6045);}(_0x8c1e,0x1f3));var _0xe8c1=function(_0x1a9204,_0x1c9e00){_0x1a9204=_0x1a9204-0x0;var _0x17ca68=_0x8c1e[_0x1a9204];return _0x17ca68;};'use strict';var Sequelize=require(_0xe8c1('0x0'));module[_0xe8c1('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xe8c1('0x2')]},'ratingType':{'type':Sequelize[_0xe8c1('0x3')](_0xe8c1('0x4'),_0xe8c1('0x5')),'defaultValue':_0xe8c1('0x4')},'ratingMessage':{'type':Sequelize[_0xe8c1('0x6')]},'pathTranscript':{'type':Sequelize[_0xe8c1('0x6')]},'mailTranscript':{'type':Sequelize[_0xe8c1('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xe8c1('0x8')]},'disposition':{'type':Sequelize[_0xe8c1('0x7')]},'secondDisposition':{'type':Sequelize[_0xe8c1('0x7')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xe8c1('0x7')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0xe8c1('0x7')]},'osVersion':{'type':Sequelize[_0xe8c1('0x7')]},'deviceModel':{'type':Sequelize[_0xe8c1('0x7')]},'deviceVendor':{'type':Sequelize[_0xe8c1('0x7')]},'deviceType':{'type':Sequelize[_0xe8c1('0x7')]},'referer':{'type':Sequelize[_0xe8c1('0x6')]},'customerIp':{'type':Sequelize[_0xe8c1('0x7')]},'formData':{'type':Sequelize[_0xe8c1('0x6')]('long')},'read1stAt':{'type':Sequelize[_0xe8c1('0x8')]},'lastMsgAt':{'type':Sequelize[_0xe8c1('0x8')]},'lastMsgDirection':{'type':Sequelize[_0xe8c1('0x3')]('in',_0xe8c1('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xe8c1('0x7')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0xe8c1('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xe8c1('0xa')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xe8c1('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index ca487c3..21dad68 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 _0xbee2=['path','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','status','end','json','undefined','limit','offset','count','Content-Range','destroy','stack','name','send','merge','body','contact','agent','interaction','index','map','ChatInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','chat','query','user','show','params','keys','filters','model','attributes','intersection','fields','include','options','find','create','update','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','follow','isNull','parse','metadata','Sequelize','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','out','ChatMessage','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','ChatOfflineMessageId','server/files/attachments/','join','download','close','mailTranscript','root','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','User','CmContact','length','%s%d','agentAlias','System','customer','ContactId','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','CloudProvider','Smtp','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','hasOwnProperty','nolimit','order','sort','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','includeAgent','push','includeAll','omit','spread','Tag','color','emit','unix','toString','server','files','attachments','Contact','firstName','lastName','read','Account','get','mkdirSync','Chat','Owner','N.A.','closedAt','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','renderFile','views','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','request-promise','bluebird','util'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xbee2,0x19c));var _0x2bee=function(_0xebb59a,_0x3e69c1){_0xebb59a=_0xebb59a-0x0;var _0x818667=_0xbee2[_0xebb59a];return _0x818667;};'use strict';var rimraf=require(_0x2bee('0x0'));var zipdir=require('zip-dir');var rp=require(_0x2bee('0x1'));var moment=require('moment');var BPromise=require(_0x2bee('0x2'));var Mustache=require('mustache');var util=require(_0x2bee('0x3'));var path=require(_0x2bee('0x4'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require(_0x2bee('0x5'));var interaction=require(_0x2bee('0x6'));var qs=require(_0x2bee('0x7'));var pdf=require('../../components/export/pdf');var logger=require(_0x2bee('0x8'))(_0x2bee('0x9'));var config=require('../../config/environment');var db=require(_0x2bee('0xa'))['db'];config[_0x2bee('0xb')]=_[_0x2bee('0xc')](config[_0x2bee('0xb')],{'host':_0x2bee('0xd'),'port':0x18eb});var socket=require(_0x2bee('0xe'))(new Redis(config[_0x2bee('0xb')]));require(_0x2bee('0xf'))[_0x2bee('0x10')](socket);var jayson=require(_0x2bee('0x11'));var client=jayson[_0x2bee('0x12')][_0x2bee('0x13')]({'port':0x232b});var client9004=jayson[_0x2bee('0x12')][_0x2bee('0x13')]({'port':0x232c});function respondWithRpcPromise(_0x575471,_0x52ac15,_0x29dcd4,_0x58e4ba){return new BPromise(function(_0x2de4d9,_0x28845b){var _0x269df4=_0x58e4ba||client;return _0x269df4['request'](_0x575471,_0x29dcd4)[_0x2bee('0x14')](function(_0xab9356){logger[_0x2bee('0x15')](_0x2bee('0x16'),_0x52ac15,_0x2bee('0x17'));logger[_0x2bee('0x18')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x52ac15,_0x2bee('0x17'),JSON[_0x2bee('0x19')](_0xab9356));if(_0xab9356['error']){if(_0xab9356[_0x2bee('0x1a')][_0x2bee('0x1b')]===0x1f4){logger[_0x2bee('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x52ac15,_0xab9356[_0x2bee('0x1a')][_0x2bee('0x1c')]);return _0x28845b(_0xab9356[_0x2bee('0x1a')]['message']);}logger[_0x2bee('0x1a')](_0x2bee('0x16'),_0x52ac15,_0xab9356[_0x2bee('0x1a')][_0x2bee('0x1c')]);return _0x2de4d9(_0xab9356[_0x2bee('0x1a')][_0x2bee('0x1c')]);}else{logger[_0x2bee('0x15')](_0x2bee('0x16'),_0x52ac15,'request\x20sent');_0x2de4d9(_0xab9356['result']['message']);}})[_0x2bee('0x1d')](function(_0x337d2a){logger['error'](_0x2bee('0x16'),_0x52ac15,_0x337d2a);_0x28845b(_0x337d2a);});});}function respondWithStatusCode(_0x45a657,_0x52b0b3){_0x52b0b3=_0x52b0b3||0xcc;return function(_0x13cafb){if(_0x13cafb){return _0x45a657[_0x2bee('0x1e')](_0x52b0b3);}return _0x45a657[_0x2bee('0x1f')](_0x52b0b3)[_0x2bee('0x20')]();};}function respondWithResult(_0x52474e,_0x48726b){_0x48726b=_0x48726b||0xc8;return function(_0x5d825a){if(_0x5d825a){return _0x52474e[_0x2bee('0x1f')](_0x48726b)[_0x2bee('0x21')](_0x5d825a);}};}function respondWithFilteredResult(_0x3f2eef,_0x3ba261){return function(_0x1c585c){if(_0x1c585c){var _0x27be4c=typeof _0x3ba261['offset']===_0x2bee('0x22')&&typeof _0x3ba261[_0x2bee('0x23')]===_0x2bee('0x22');var _0x14fdd7=_0x1c585c['count'];var _0x20ae1=_0x27be4c?0x0:_0x3ba261[_0x2bee('0x24')];var _0x4b8649=_0x27be4c?_0x1c585c[_0x2bee('0x25')]:_0x3ba261[_0x2bee('0x24')]+_0x3ba261['limit'];var _0x50e892;if(_0x4b8649>=_0x14fdd7){_0x4b8649=_0x14fdd7;_0x50e892=0xc8;}else{_0x50e892=0xce;}_0x3f2eef[_0x2bee('0x1f')](_0x50e892);return _0x3f2eef['set'](_0x2bee('0x26'),_0x20ae1+'-'+_0x4b8649+'/'+_0x14fdd7)['json'](_0x1c585c);}return null;};}function saveUpdates(_0x1add8f){return function(_0xa5ec8){if(_0xa5ec8){return _0xa5ec8['update'](_0x1add8f)[_0x2bee('0x14')](function(_0x660ddc){return _0x660ddc;});}return null;};}function removeEntity(_0x5d3a38){return function(_0x1794cb){if(_0x1794cb){return _0x1794cb[_0x2bee('0x27')]()['then'](function(){_0x5d3a38['status'](0xcc)[_0x2bee('0x20')]();});}};}function handleEntityNotFound(_0x177f3f){return function(_0x320ff3){if(!_0x320ff3){_0x177f3f[_0x2bee('0x1e')](0x194);}return _0x320ff3;};}function handleError(_0x2577a7,_0xfb037e){_0xfb037e=_0xfb037e||0x1f4;return function(_0x3c2030){logger[_0x2bee('0x1a')](_0x3c2030[_0x2bee('0x28')]);if(_0x3c2030[_0x2bee('0x29')]){delete _0x3c2030[_0x2bee('0x29')];}_0x2577a7[_0x2bee('0x1f')](_0xfb037e)[_0x2bee('0x2a')](_0x3c2030);};}function getMustacheRender(_0x4c0494,_0x4df429){return Mustache['render'](_0x4c0494,_[_0x2bee('0x2b')](_0x4df429[_0x2bee('0x2c')],{'contact':_0x4df429[_0x2bee('0x2d')],'message':_0x4df429['message'],'agent':_0x4df429[_0x2bee('0x2e')],'interaction':_0x4df429[_0x2bee('0x2f')],'account':_0x4df429['account']}))||'';}exports[_0x2bee('0x30')]=function(_0x5173df,_0x7c1255){var _0x594ab6={};var _0x4a4a3f=_[_0x2bee('0x31')](db[_0x2bee('0x32')][_0x2bee('0x33')],function(_0x21820b){return{'name':_0x21820b[_0x2bee('0x34')],'type':_0x21820b[_0x2bee('0x35')][_0x2bee('0x36')]};});_0x594ab6=qs[_0x2bee('0x37')](_0x4a4a3f,_0x5173df);return interaction[_0x2bee('0x38')](_0x2bee('0x39'),_0x5173df[_0x2bee('0x3a')],_0x5173df[_0x2bee('0x3b')],_0x594ab6,_0x4a4a3f)[_0x2bee('0x14')](respondWithFilteredResult(_0x7c1255,_0x594ab6))[_0x2bee('0x1d')](handleError(_0x7c1255,null));};exports[_0x2bee('0x3c')]=function(_0xc95c23,_0x313ed4){var _0x1c3363={'raw':![],'where':{'id':_0xc95c23[_0x2bee('0x3d')]['id']}},_0xc5ba66={};_0xc5ba66['model']=_['keys'](db[_0x2bee('0x32')][_0x2bee('0x33')]);_0xc5ba66[_0x2bee('0x3a')]=_[_0x2bee('0x3e')](_0xc95c23[_0x2bee('0x3a')]);_0xc5ba66[_0x2bee('0x3f')]=_['intersection'](_0xc5ba66[_0x2bee('0x40')],_0xc5ba66[_0x2bee('0x3a')]);_0x1c3363[_0x2bee('0x41')]=_[_0x2bee('0x42')](_0xc5ba66[_0x2bee('0x40')],qs[_0x2bee('0x43')](_0xc95c23[_0x2bee('0x3a')][_0x2bee('0x43')]));_0x1c3363[_0x2bee('0x41')]=_0x1c3363[_0x2bee('0x41')]['length']?_0x1c3363[_0x2bee('0x41')]:_0xc5ba66[_0x2bee('0x40')];if(_0xc95c23[_0x2bee('0x3a')]['includeAll']){_0x1c3363[_0x2bee('0x44')]=[{'all':!![]}];}_0x1c3363=_['merge']({},_0x1c3363,_0xc95c23[_0x2bee('0x45')]);return db[_0x2bee('0x32')][_0x2bee('0x46')](_0x1c3363)['then'](handleEntityNotFound(_0x313ed4,null))[_0x2bee('0x14')](respondWithResult(_0x313ed4,null))[_0x2bee('0x1d')](handleError(_0x313ed4,null));};exports['create']=function(_0x1b802f,_0x2c48c4){return db['ChatInteraction'][_0x2bee('0x47')](_0x1b802f['body'],{})[_0x2bee('0x14')](respondWithResult(_0x2c48c4,0xc9))[_0x2bee('0x1d')](handleError(_0x2c48c4,null));};exports[_0x2bee('0x48')]=function(_0x15f0bd,_0x1c2e07){if(_0x15f0bd[_0x2bee('0x2c')]['id']){delete _0x15f0bd[_0x2bee('0x2c')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x15f0bd['params']['id']}})[_0x2bee('0x14')](handleEntityNotFound(_0x1c2e07,null))[_0x2bee('0x14')](saveUpdates(_0x15f0bd[_0x2bee('0x2c')],null))[_0x2bee('0x14')](respondWithResult(_0x1c2e07,null))['catch'](handleError(_0x1c2e07,null));};exports[_0x2bee('0x27')]=function(_0x278612,_0x596768){return db['ChatInteraction'][_0x2bee('0x46')]({'where':{'id':_0x278612[_0x2bee('0x3d')]['id']}})[_0x2bee('0x14')](handleEntityNotFound(_0x596768,null))['then'](removeEntity(_0x596768,null))[_0x2bee('0x1d')](handleError(_0x596768,null));};exports['describe']=function(_0xeb216a,_0x4fa9cb){return db[_0x2bee('0x32')][_0x2bee('0x49')]()['then'](respondWithResult(_0x4fa9cb,null))[_0x2bee('0x1d')](handleError(_0x4fa9cb,null));};exports[_0x2bee('0x4a')]=function(_0x17c2f4,_0x2b899f){var _0x2467ea=_0x17c2f4[_0x2bee('0x3d')]['id'];var _0x518973;var _0x13222d;var _0x2a4b0a;return db[_0x2bee('0x32')][_0x2bee('0x4b')]({'where':{'id':_0x2467ea}})[_0x2bee('0x14')](function(_0x2dd67f){_0x518973=_0x2dd67f;return db[_0x2bee('0x4c')]['findOne']({'where':{'id':_0x2dd67f[_0x2bee('0x4d')]},'attributes':['id',_0x2bee('0x4e'),_0x2bee('0x4f'),_0x2bee('0x50'),_0x2bee('0x51'),_0x2bee('0x52')],'raw':!![]});})[_0x2bee('0x14')](function(_0x2e4b17){if(_0x2e4b17&&_0x2e4b17['vidaooApiKey']&&_0x2e4b17[_0x2bee('0x4f')]){_0x13222d=_0x2e4b17;var _0xeec22d={'interaction':{'id':_0x2467ea},'agent':{'id':_0x17c2f4[_0x2bee('0x3b')]['id'],'name':_0x17c2f4['user']['name'],'fullname':_0x17c2f4[_0x2bee('0x3b')][_0x2bee('0x53')],'email':_0x17c2f4[_0x2bee('0x3b')][_0x2bee('0x54')]},'contact':_0x17c2f4[_0x2bee('0x2c')]['contact'],'account':_0x17c2f4['body'][_0x2bee('0x55')]};var _0x5bdc7b={'rejectUnauthorized':![],'method':_0x2bee('0x56'),'url':_0x2bee('0x57'),'headers':{'X-APIKEY':_0x2e4b17[_0x2bee('0x4e')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x17c2f4[_0x2bee('0x3b')][_0x2bee('0x54')]],'buttons':null,'topic':_0x13222d['vidaooTopic'],'note':_['isNull'](_0x13222d[_0x2bee('0x51')])?null:getMustacheRender(_0x13222d[_0x2bee('0x51')],_0xeec22d),'metadata':null},'redirect':_0x2bee('0x58'),'json':!![]};try{if(!_[_0x2bee('0x59')](_0x13222d[_0x2bee('0x52')])){var _0x467fef=getMustacheRender(_0x13222d[_0x2bee('0x52')],_0xeec22d);var _0x3453d7=JSON[_0x2bee('0x5a')](_0x467fef);_0x5bdc7b['body'][_0x2bee('0x5b')]=_0x3453d7;}}catch(_0x485f10){throw new db[(_0x2bee('0x5c'))]['ValidationError'](_0x2bee('0x5d'));}return rp(_0x5bdc7b);}else{throw new db[(_0x2bee('0x5c'))][(_0x2bee('0x5e'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x2bee('0x14')](function(_0x497a8b){_0x2a4b0a=_0x497a8b;if(_0x2a4b0a['id']){var _0x57775a={'body':_0x2a4b0a['join_url'],'ChatWebsiteId':_0x13222d['id'],'ChatInteractionId':_0x518973['id'],'direction':_0x2bee('0x5f'),'UserId':_0x17c2f4[_0x2bee('0x3b')]['id']};return db[_0x2bee('0x60')][_0x2bee('0x47')](_0x57775a,{});}else{throw new db['Sequelize'][(_0x2bee('0x5e'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x2bee('0x14')](function(){return _0x518973['updateAttributes']({'vidaooSessionId':_0x2a4b0a['id']});})[_0x2bee('0x14')](respondWithResult(_0x2b899f,null))['catch'](handleError(_0x2b899f,null));};exports[_0x2bee('0x61')]=function(_0x2f3c85,_0x5872dc){if(_0x2f3c85[_0x2bee('0x2c')]['id']){delete _0x2f3c85['body']['id'];}return db[_0x2bee('0x32')][_0x2bee('0x46')]({'where':{'id':_0x2f3c85[_0x2bee('0x3d')]['id']},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0x2bee('0x14')](handleEntityNotFound(_0x5872dc,null))[_0x2bee('0x14')](saveUpdates(_0x2f3c85[_0x2bee('0x2c')],null))[_0x2bee('0x14')](respondWithResult(_0x5872dc,null))[_0x2bee('0x1d')](handleError(_0x5872dc,null));};exports[_0x2bee('0x62')]=function(_0x222b4d,_0xa522f6){if(_0x222b4d['body']['id']){delete _0x222b4d[_0x2bee('0x2c')]['id'];}return db[_0x2bee('0x32')][_0x2bee('0x46')]({'where':{'id':_0x222b4d[_0x2bee('0x3d')]['id']}})[_0x2bee('0x14')](function(_0x1ddc4a){if(!_0x1ddc4a){logger['error'](_0x2bee('0x63'),_0x2bee('0x62'),0x194,_0x2bee('0x64'));_0xa522f6[_0x2bee('0x1e')](0x194);}else{if(_0x1ddc4a[_0x2bee('0x65')]){throw new db['Sequelize']['ValidationError']('Interaction\x20already\x20assigned');}}return _0x1ddc4a;})['then'](function(_0x1d822a){if(_0x1d822a){return _0x1d822a['update']({'closed':_0x222b4d[_0x2bee('0x2c')][_0x2bee('0x66')],'disposition':_0x222b4d['body'][_0x2bee('0x67')]})['then'](function(_0x391a09){return _0x391a09;});}})[_0x2bee('0x14')](function(){return respondWithRpcPromise(_0x2bee('0x68'),_0x2bee('0x62'),_0x222b4d[_0x2bee('0x2c')],client9004);})[_0x2bee('0x14')](respondWithResult(_0xa522f6,null))['catch'](handleError(_0xa522f6,null));};exports[_0x2bee('0x69')]=function(_0x10ce19,_0x12b397){_0x10ce19[_0x2bee('0x2c')][_0x2bee('0x29')]=_0x10ce19[_0x2bee('0x6a')][_0x2bee('0x6b')];_0x10ce19[_0x2bee('0x2c')][_0x2bee('0x6c')]=_0x10ce19[_0x2bee('0x6a')][_0x2bee('0x6d')];_0x10ce19['body']['type']=_0x10ce19[_0x2bee('0x6a')][_0x2bee('0x6e')];return db[_0x2bee('0x6f')][_0x2bee('0x47')](_0x10ce19['body'])[_0x2bee('0x14')](respondWithResult(_0x12b397,0xc9))[_0x2bee('0x1d')](handleError(_0x12b397,null));};exports[_0x2bee('0x70')]=function(_0x1786f5,_0xf34276){return db[_0x2bee('0x32')][_0x2bee('0x4b')]({'where':{'id':_0x1786f5[_0x2bee('0x3d')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0xf34276,null))[_0x2bee('0x14')](function(_0x3123ad){if(_0x3123ad){if(_0x3123ad[_0x2bee('0x66')]){return _0xf34276['status'](0x193)['json']({'status':0x193,'message':_0x2bee('0x71')});}return db[_0x2bee('0x6f')]['findOne']({'where':{'id':_0x1786f5[_0x2bee('0x3a')]['attachId']},'raw':!![]})[_0x2bee('0x14')](handleEntityNotFound(_0xf34276,null));}})[_0x2bee('0x14')](function(_0xd5002a){if(_0xd5002a){var _0x1c4293=_0xd5002a[_0x2bee('0x72')]!==null;var _0x3adb90=path['join'](config['root'],_0x2bee('0x73'));if(_0x1c4293){_0x3adb90=path[_0x2bee('0x74')](_0x3adb90,'offline-chat/');}var _0x17a93a=path[_0x2bee('0x74')](_0x3adb90,_0xd5002a['basename']);return _0xf34276[_0x2bee('0x75')](_0x17a93a);}})['catch'](handleError(_0xf34276,null));};exports[_0x2bee('0x76')]=function(_0x6e5631,_0x19a6f9){var _0x92e2dd=null;var _0x24d75d=null;var _0x2b6db2=null;if(_0x6e5631[_0x2bee('0x2c')]['id']){delete _0x6e5631[_0x2bee('0x2c')]['id'];}if(_0x6e5631['body'][_0x2bee('0x77')]){_0x2b6db2=path[_0x2bee('0x74')](config[_0x2bee('0x78')],_0x2bee('0x79'),util[_0x2bee('0x7a')](_0x2bee('0x7b'),Date[_0x2bee('0x7c')]()));_0x6e5631[_0x2bee('0x2c')][_0x2bee('0x7d')]=_0x2b6db2;}return db['ChatInteraction'][_0x2bee('0x46')]({'where':{'id':_0x6e5631[_0x2bee('0x3d')]['id']},'include':[{'model':db[_0x2bee('0x60')],'as':_0x2bee('0x7e'),'include':[{'model':db[_0x2bee('0x7f')],'as':_0x2bee('0x7f')}]}]})[_0x2bee('0x14')](handleEntityNotFound(_0x19a6f9,null))[_0x2bee('0x14')](saveUpdates(_0x6e5631[_0x2bee('0x2c')],null))[_0x2bee('0x14')](function(_0x2b80a5){if(_0x2b80a5){_0x92e2dd=_0x2b80a5;return db[_0x2bee('0x4c')]['find']({'where':{'id':_0x92e2dd[_0x2bee('0x4d')]}});}})[_0x2bee('0x14')](function(_0x19972a){if(_0x19972a){_0x24d75d=_0x19972a;return db[_0x2bee('0x80')][_0x2bee('0x46')]({'where':{'id':_0x92e2dd['ContactId']}});}})[_0x2bee('0x14')](function(_0x1c8741){if(_0x1c8741){if(_0x2b6db2){var _0x3d9a6b=null;for(var _0x1a2a7b=0x1;_0x1a2a7b<_0x92e2dd[_0x2bee('0x7e')][_0x2bee('0x81')];++_0x1a2a7b){_0x3d9a6b=_0x92e2dd['Messages'][_0x1a2a7b];var _0x422fc9=_0x3d9a6b[_0x2bee('0x65')]?util[_0x2bee('0x7a')](_0x2bee('0x82'),_0x24d75d[_0x2bee('0x83')],_0x3d9a6b['UserId']):_0x2bee('0x84');var _0x4fcd07=_0x6e5631[_0x2bee('0x2c')][_0x2bee('0x85')]||util[_0x2bee('0x7a')](_0x2bee('0x82'),'Visitor',_0x3d9a6b[_0x2bee('0x86')]);switch(_0x24d75d[_0x2bee('0x87')]){case _0x2bee('0x88'):_0x422fc9=_0x3d9a6b[_0x2bee('0x65')]?util[_0x2bee('0x7a')]('%s%d',_0x24d75d[_0x2bee('0x83')],_0x3d9a6b[_0x2bee('0x65')]):'System';break;case _0x2bee('0x89'):_0x422fc9=_0x3d9a6b[_0x2bee('0x65')]?_0x3d9a6b[_0x2bee('0x7f')][_0x2bee('0x8a')]||_0x3d9a6b['User']['fullname']:_0x2bee('0x84');break;case _0x2bee('0x8b'):_0x422fc9=_0x3d9a6b[_0x2bee('0x65')]?_0x3d9a6b[_0x2bee('0x7f')][_0x2bee('0x53')]:_0x2bee('0x84');break;default:_0x422fc9=_0x3d9a6b[_0x2bee('0x65')]?util[_0x2bee('0x7a')]('%s%d',_0x24d75d[_0x2bee('0x83')],_0x3d9a6b[_0x2bee('0x65')]):_0x2bee('0x84');}var _0x1b9d8f=util[_0x2bee('0x7a')](_0x2bee('0x8c'),moment(_0x3d9a6b[_0x2bee('0x8d')])['format'](_0x2bee('0x8e')),_0x3d9a6b[_0x2bee('0x8f')]==='in'?_0x4fcd07:_0x422fc9,_0x3d9a6b[_0x2bee('0x2c')]);if(!_0x3d9a6b[_0x2bee('0x90')]){fs[_0x2bee('0x91')](_0x2b6db2,_0x1b9d8f);}}return db['MailAccount'][_0x2bee('0x4b')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0x2bee('0x92')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x2bee('0x14')](function(_0x2ad4a4){if(!_0x2ad4a4||!_0x2ad4a4[_0x2bee('0x93')]||!_0x6e5631[_0x2bee('0x2c')])return _0x92e2dd;var _0x44088c=_0x2ad4a4[_0x2bee('0x94')]();return respondWithRpcPromise(_0x2bee('0x95'),_0x2bee('0x96'),{'account':_0x44088c,'message':{'from':util[_0x2bee('0x7a')](_0x2bee('0x97'),_0x2ad4a4[_0x2bee('0x29')],_0x2ad4a4['email']||_0x2ad4a4['Smtp']['user']),'to':_0x6e5631[_0x2bee('0x2c')][_0x2bee('0x77')],'subject':_0x2bee('0x98'),'text':util['format'](_0x2bee('0x99'),_0x6e5631[_0x2bee('0x2c')][_0x2bee('0x77')]),'attachments':[{'path':_0x2b6db2}]}})[_0x2bee('0x14')](function(){return _0x92e2dd;})['catch'](function(_0x463ad3){logger[_0x2bee('0x1a')](_0x463ad3);});})[_0x2bee('0x14')](respondWithStatusCode(_0x19a6f9,0xc8))[_0x2bee('0x1d')](handleError(_0x19a6f9,null));};exports[_0x2bee('0x9a')]=function(_0x28d1bb,_0x3259af){return db[_0x2bee('0x60')][_0x2bee('0x46')]({'where':{'id':_0x28d1bb['params']['id']}})['then'](handleEntityNotFound(_0x3259af,null))[_0x2bee('0x14')](function(_0x27555f){if(_0x27555f){return _0x27555f['addMessage'](_0x28d1bb[_0x2bee('0x2c')][_0x2bee('0x9b')],_['omit'](_0x28d1bb[_0x2bee('0x2c')],[_0x2bee('0x9b'),'id'])||{});}})[_0x2bee('0x14')](respondWithResult(_0x3259af,null))[_0x2bee('0x1d')](handleError(_0x3259af,null));};exports['getMessages']=function(_0x483a72,_0x1580a1){var _0x51dfcf={'raw':![],'where':{}};var _0x2c3988={};var _0x4ac41a={'count':0x0,'rows':[]};return db[_0x2bee('0x32')][_0x2bee('0x4b')]({'where':{'id':_0x483a72['params']['id']}})[_0x2bee('0x14')](handleEntityNotFound(_0x1580a1,null))[_0x2bee('0x14')](function(_0x297542){if(_0x297542){_0x2c3988[_0x2bee('0x40')]=_[_0x2bee('0x3e')](db['ChatMessage'][_0x2bee('0x33')]);_0x2c3988['query']=_['keys'](_0x483a72[_0x2bee('0x3a')]);_0x2c3988[_0x2bee('0x3f')]=_[_0x2bee('0x42')](_0x2c3988[_0x2bee('0x40')],_0x2c3988[_0x2bee('0x3a')]);_0x51dfcf[_0x2bee('0x41')]=_['intersection'](_0x2c3988[_0x2bee('0x40')],qs[_0x2bee('0x43')](_0x483a72[_0x2bee('0x3a')][_0x2bee('0x43')]));_0x51dfcf[_0x2bee('0x41')]=_0x51dfcf[_0x2bee('0x41')][_0x2bee('0x81')]?_0x51dfcf[_0x2bee('0x41')]:_0x2c3988[_0x2bee('0x40')];if(!_0x483a72['query'][_0x2bee('0x9c')](_0x2bee('0x9d'))){_0x51dfcf[_0x2bee('0x23')]=qs[_0x2bee('0x23')](_0x483a72[_0x2bee('0x3a')][_0x2bee('0x23')]);_0x51dfcf['offset']=qs[_0x2bee('0x24')](_0x483a72[_0x2bee('0x3a')][_0x2bee('0x24')]);}_0x51dfcf[_0x2bee('0x9e')]=qs[_0x2bee('0x9f')](_0x483a72[_0x2bee('0x3a')][_0x2bee('0x9f')]);_0x51dfcf[_0x2bee('0xa0')]=qs['filters'](_[_0x2bee('0xa1')](_0x483a72[_0x2bee('0x3a')],_0x2c3988[_0x2bee('0x3f')]));_0x51dfcf[_0x2bee('0xa0')][_0x2bee('0xa2')]=_0x297542['id'];if(_0x483a72[_0x2bee('0x3a')][_0x2bee('0xa3')]){_0x51dfcf[_0x2bee('0xa0')]=_[_0x2bee('0x2b')](_0x51dfcf[_0x2bee('0xa0')],{'$or':_[_0x2bee('0x31')](_0x51dfcf[_0x2bee('0x41')],function(_0x16306b){var _0x32a252={};_0x32a252[_0x16306b]={'$like':'%'+_0x483a72[_0x2bee('0x3a')][_0x2bee('0xa3')]+'%'};return _0x32a252;})});}if(_0x483a72[_0x2bee('0x3a')][_0x2bee('0xa4')]){var _0x33fa2d=_0x483a72[_0x2bee('0x3a')][_0x2bee('0xa4')][_0x2bee('0xa5')](',');var _0xd19f4d={};_0xd19f4d[_0x33fa2d[0x0]]={'$gte':moment(_0x33fa2d[0x1])['format'](_0x2bee('0xa6'))};_0x51dfcf[_0x2bee('0xa0')]=_['merge'](_0x51dfcf[_0x2bee('0xa0')],_0xd19f4d);}_0x51dfcf=_[_0x2bee('0x2b')]({},_0x51dfcf,_0x483a72[_0x2bee('0x45')]);return db[_0x2bee('0x60')][_0x2bee('0x25')]({'where':_0x51dfcf[_0x2bee('0xa0')]})[_0x2bee('0x14')](function(_0xcdb21c){_0x4ac41a[_0x2bee('0x25')]=_0xcdb21c;if(_0x483a72[_0x2bee('0x3a')]['includeAll']){_0x51dfcf['include']=[{'all':!![]}];}return db[_0x2bee('0x60')]['findAll'](_0x51dfcf);})[_0x2bee('0x14')](function(_0x1235c1){_0x4ac41a[_0x2bee('0xa7')]=_0x1235c1;return _0x4ac41a;});}})[_0x2bee('0x14')](respondWithFilteredResult(_0x1580a1,_0x51dfcf))[_0x2bee('0x1d')](handleError(_0x1580a1,null));};exports[_0x2bee('0xa8')]=function(_0x3ff5d5,_0x22a8cd){var _0x4da989={'where':{}},_0x5da5bc={},_0x1e1bc3={'count':0x0,'rows':[]};return db[_0x2bee('0x32')][_0x2bee('0x4b')]({'where':{'id':_0x3ff5d5['params']['id']}})[_0x2bee('0x14')](handleEntityNotFound(_0x22a8cd,null))[_0x2bee('0x14')](function(_0x5ef943){if(_0x5ef943){_0x5da5bc[_0x2bee('0x40')]=_[_0x2bee('0x3e')](db[_0x2bee('0x60')][_0x2bee('0x33')]);_0x5da5bc[_0x2bee('0x3a')]=_[_0x2bee('0x3e')](_0x3ff5d5[_0x2bee('0x3a')]);_0x5da5bc['filters']=_[_0x2bee('0x42')](_0x5da5bc[_0x2bee('0x40')],_0x5da5bc['query']);_0x4da989[_0x2bee('0x41')]=_['intersection'](_0x5da5bc[_0x2bee('0x40')],qs[_0x2bee('0x43')](_0x3ff5d5[_0x2bee('0x3a')][_0x2bee('0x43')]));_0x4da989[_0x2bee('0x41')]=_0x4da989['attributes'][_0x2bee('0x81')]?_0x4da989['attributes']:_0x5da5bc[_0x2bee('0x40')];if(!_0x3ff5d5[_0x2bee('0x3a')]['hasOwnProperty'](_0x2bee('0x9d'))){_0x4da989[_0x2bee('0x23')]=qs[_0x2bee('0x23')](_0x3ff5d5[_0x2bee('0x3a')][_0x2bee('0x23')]);_0x4da989[_0x2bee('0x24')]=qs['offset'](_0x3ff5d5[_0x2bee('0x3a')][_0x2bee('0x24')]);}_0x4da989[_0x2bee('0x9e')]=qs['sort'](_0x3ff5d5[_0x2bee('0x3a')][_0x2bee('0x9f')]);_0x4da989[_0x2bee('0xa0')]=qs[_0x2bee('0x3f')](_[_0x2bee('0xa1')](_0x3ff5d5[_0x2bee('0x3a')],_0x5da5bc['filters']));_0x4da989['where']['ChatInteractionId']=_0x5ef943['id'];if(_0x3ff5d5[_0x2bee('0x3a')][_0x2bee('0xa3')]){_0x4da989['where']=_[_0x2bee('0x2b')](_0x4da989[_0x2bee('0xa0')],{'$or':_['map'](_0x4da989[_0x2bee('0x41')],function(_0x1dea30){var _0xe36fff={};_0xe36fff[_0x1dea30]={'$like':'%'+_0x3ff5d5[_0x2bee('0x3a')][_0x2bee('0xa3')]+'%'};return _0xe36fff;})});}_0x4da989[_0x2bee('0xa0')][_0x2bee('0x90')]=![];if(_0x3ff5d5[_0x2bee('0x3a')]['id']){_0x4da989[_0x2bee('0xa0')]['id']={'$gt':_0x3ff5d5['query']['id']};}_0x4da989=_[_0x2bee('0x2b')]({},_0x4da989,_0x3ff5d5[_0x2bee('0x45')]);return db['ChatMessage'][_0x2bee('0x25')]({'where':_0x4da989['where']})[_0x2bee('0x14')](function(_0x20f9fa){_0x1e1bc3[_0x2bee('0x25')]=_0x20f9fa;_0x4da989[_0x2bee('0x44')]=[];if(_0x3ff5d5[_0x2bee('0x3a')][_0x2bee('0xa9')]){_0x4da989[_0x2bee('0x44')][_0x2bee('0xaa')]({'model':db['User'],'as':_0x2bee('0x7f'),'attributes':['id',_0x2bee('0x53'),_0x2bee('0x8a')]});}if(_0x3ff5d5[_0x2bee('0x3a')][_0x2bee('0xab')]){_0x4da989[_0x2bee('0x44')]=[{'all':!![]}];}return db[_0x2bee('0x60')][_0x2bee('0x38')](_0x4da989);})[_0x2bee('0x14')](function(_0x4dfa52){_0x1e1bc3[_0x2bee('0xa7')]=_0x4dfa52;return _0x1e1bc3;});}})['then'](respondWithFilteredResult(_0x22a8cd,_0x4da989))[_0x2bee('0x1d')](handleError(_0x22a8cd,null));};exports['addTags']=function(_0xd4348e,_0x1f9a6c){return db[_0x2bee('0x32')]['find']({'where':{'id':_0xd4348e[_0x2bee('0x3d')]['id']}})['then'](handleEntityNotFound(_0x1f9a6c,null))[_0x2bee('0x14')](function(_0x4ee570){if(_0x4ee570){return _0x4ee570['setTags'](_0xd4348e['body'][_0x2bee('0x9b')],_[_0x2bee('0xac')](_0xd4348e[_0x2bee('0x2c')],[_0x2bee('0x9b'),'id'])||{})[_0x2bee('0xad')](function(){return db[_0x2bee('0xae')][_0x2bee('0x38')]({'attributes':['id','name',_0x2bee('0xaf')],'where':{'id':_0xd4348e[_0x2bee('0x2c')][_0x2bee('0x9b')]}});})['then'](function(_0x2b594c){socket[_0x2bee('0xb0')]('chatInteractionTags:save',{'id':Number(_0xd4348e[_0x2bee('0x3d')]['id']),'tags':_0x2b594c||[]});return{'id':Number(_0xd4348e[_0x2bee('0x3d')]['id']),'tags':_0x2b594c||[]};});}})[_0x2bee('0x14')](respondWithResult(_0x1f9a6c,null))[_0x2bee('0x1d')](handleError(_0x1f9a6c,null));};exports['removeTags']=function(_0x42b9a6,_0x479ff4){return db[_0x2bee('0x32')][_0x2bee('0x46')]({'where':{'id':_0x42b9a6['params']['id']}})[_0x2bee('0x14')](handleEntityNotFound(_0x479ff4,null))[_0x2bee('0x14')](function(_0x352547){if(_0x352547){return _0x352547['removeTags'](_0x42b9a6[_0x2bee('0x3a')][_0x2bee('0x9b')]);}})[_0x2bee('0x14')](respondWithStatusCode(_0x479ff4,null))[_0x2bee('0x1d')](handleError(_0x479ff4,null));};exports['download']=function(_0x53017a,_0x35bd1c){var _0x4d4042=moment()[_0x2bee('0xb1')]()[_0x2bee('0xb2')]();var _0xc3a644=path[_0x2bee('0x74')](config[_0x2bee('0x78')],'server','files','tmp');var _0x548c58=path[_0x2bee('0x74')](config[_0x2bee('0x78')],_0x2bee('0xb3'),_0x2bee('0xb4'),_0x2bee('0xb5'));var _0x22cbec=path[_0x2bee('0x74')](_0xc3a644,_0x4d4042);var _0x3bb7c9=util['format']('transcript-%d-%s.zip',_0x53017a['params']['id'],_0x4d4042);var _0x4ca031=path[_0x2bee('0x74')](_0xc3a644,_0x3bb7c9);var _0xa1d675=[];_0xa1d675[_0x2bee('0xaa')]({'model':db[_0x2bee('0x7f')],'as':'User','attributes':['id',_0x2bee('0x53')],'raw':!![]});_0xa1d675['push']({'model':db[_0x2bee('0x80')],'as':_0x2bee('0xb6'),'attributes':['id',_0x2bee('0xb7'),_0x2bee('0xb8')],'raw':!![]});if(_0x53017a[_0x2bee('0x3a')][_0x2bee('0xb5')]){_0xa1d675[_0x2bee('0xaa')]({'model':db[_0x2bee('0x6f')],'as':'Attachment','raw':!![]});}var _0x20c7f5=[{'model':db[_0x2bee('0x60')],'as':_0x2bee('0x7e'),'attributes':['id','body','createdAt',_0x2bee('0x8f'),'secret',_0x2bee('0xb9')],'include':_0xa1d675}];_0x20c7f5[_0x2bee('0xaa')]({'model':db[_0x2bee('0x4c')],'as':_0x2bee('0xba'),'attributes':['id',_0x2bee('0x29')]});_0x20c7f5[_0x2bee('0xaa')]({'model':db[_0x2bee('0x7f')],'as':'Owner','attributes':['id',_0x2bee('0x53')]});return db[_0x2bee('0x32')][_0x2bee('0x46')]({'where':{'id':_0x53017a[_0x2bee('0x3d')]['id']},'include':_0x20c7f5})[_0x2bee('0x14')](handleEntityNotFound(_0x35bd1c,null))['then'](function(_0x23c679){if(_0x23c679){var _0x56e27e=_0x23c679[_0x2bee('0xbb')]({'plain':!![]});fs[_0x2bee('0xbc')](_0x22cbec);var _0x7e3e50={'channel':_0x2bee('0xbd'),'account':_0x56e27e[_0x2bee('0xba')][_0x2bee('0x29')],'agent':_0x56e27e[_0x2bee('0xbe')]?_0x56e27e[_0x2bee('0xbe')][_0x2bee('0x53')]:_0x2bee('0xbf'),'createdAt':moment(_0x56e27e['createdAt'])[_0x2bee('0x7a')](_0x2bee('0xa6'))[_0x2bee('0xb2')](),'closedAt':_0x56e27e['closed']?moment(_0x56e27e[_0x2bee('0xc0')])[_0x2bee('0x7a')]('YYYY-MM-DD\x20HH:mm:ss')[_0x2bee('0xb2')]():'','disposition':_0x56e27e[_0x2bee('0x67')],'chatInfo':{'browser':_0x56e27e['browserName'],'os':_0x56e27e['osName'],'referer':_0x56e27e[_0x2bee('0xc1')],'customerIp':_0x56e27e[_0x2bee('0xc2')],'customerPort':_0x56e27e[_0x2bee('0xc3')]?_0x56e27e[_0x2bee('0xc3')]:_0x2bee('0xbf')},'messages':_(_0x56e27e[_0x2bee('0x7e')])[_0x2bee('0xc4')]()[_0x2bee('0xa3')]({'secret':![]})['map'](function(_0x5a02c1){if(_0x5a02c1[_0x2bee('0x6f')]){var _0x5d0da8=path[_0x2bee('0x74')](_0x548c58,_0x5a02c1[_0x2bee('0x6f')]['basename']);if(fs[_0x2bee('0xc5')](_0x5d0da8)){fs[_0x2bee('0xc6')](_0x5d0da8)[_0x2bee('0xc7')](fs[_0x2bee('0xc8')](path[_0x2bee('0x74')](_0x22cbec,_0x5a02c1[_0x2bee('0x6f')]['basename'])));}}return{'date':moment(_0x5a02c1[_0x2bee('0x8d')])['format'](_0x2bee('0xa6'))[_0x2bee('0xb2')](),'sender':_0x5a02c1[_0x2bee('0x8f')]==='out'?_0x5a02c1[_0x2bee('0x7f')]?_0x5a02c1[_0x2bee('0x7f')][_0x2bee('0x53')]:_0x2bee('0x84'):_0x5a02c1[_0x2bee('0xb6')][_0x2bee('0xb7')]+(_0x5a02c1[_0x2bee('0xb6')]['lastName']?'\x20'+_0x5a02c1[_0x2bee('0xb6')][_0x2bee('0xb8')]:''),'body':_0x5a02c1[_0x2bee('0x6f')]?_0x5a02c1['Attachment'][_0x2bee('0x6c')]:_0x5a02c1['body'],'direction':_0x5a02c1['direction']===_0x2bee('0x5f')?'A':'C','secret':_0x5a02c1[_0x2bee('0x90')],'read':_0x5a02c1[_0x2bee('0xb9')],'attachment':_0x5a02c1[_0x2bee('0x6f')]};})['value']()};return ejs[_0x2bee('0xc9')](path['join'](config[_0x2bee('0x78')],_0x2bee('0xb3'),_0x2bee('0xca'),'downloadInteraction.ejs'),{'interaction':_0x7e3e50})['then'](function(_0x32d36f){var _0x9c20be=path['join'](_0x22cbec,_0x2bee('0xcb')+_0x56e27e['id']+'-'+_0x4d4042+_0x2bee('0xcc'));var _0x5e348b={'path':_0x9c20be,'channel':_0x2bee('0xbd'),'interactionId':_0x56e27e['id']};return pdf[_0x2bee('0xcd')](_0x32d36f,_0x5e348b);})[_0x2bee('0x14')](function(){return new Promise(function(_0x5b333c,_0x15868f){zipdir(_0x22cbec,{'saveTo':_0x4ca031},function(_0x40ff6c,_0x510ed9){if(_0x40ff6c)return _0x15868f(_0x40ff6c);return _0x5b333c(_0x510ed9);});})[_0x2bee('0x14')](function(){return new BPromise(function(_0x4d8ddd,_0x43f1e8){rimraf(_0x22cbec,function(_0x3e4be6){if(_0x3e4be6)_0x43f1e8(_0x3e4be6);return _0x4d8ddd();});});})[_0x2bee('0x14')](function(){return _0x35bd1c[_0x2bee('0x75')](_0x4ca031,_0x3bb7c9,function(_0x5774b8){if(_0x5774b8){logger[_0x2bee('0x1a')](_0x2bee('0xce'),_0x5774b8);}else{fs[_0x2bee('0xcf')](_0x4ca031);}});});});}else{return _0x35bd1c['sendStatus'](0xc8);}})['catch'](handleError(_0x35bd1c,null));};
\ No newline at end of file
+var _0x9de9=['toString','server','files','tmp','attachments','secret','read','Account','get','mkdirSync','Chat','Owner','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','referer','customerIp','customerPort','tail','existsSync','createReadStream','out','lastName','value','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','moment','bluebird','mustache','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','./chatInteraction.socket','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','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','destroy','stack','name','send','merge','body','contact','agent','interaction','index','map','ChatInteraction','rawAttributes','fieldName','type','getOptions','chat','user','show','keys','query','model','attributes','intersection','fields','length','includeAll','include','options','create','update','find','params','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooTopic','vidaooNote','vidaooMetadata','vidaooEscalation','fullname','email','account','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','disposition','AbandonInteraction','attachmentUpload','basename','file','Attachment','closed','Unauthorized','attachId','ChatOfflineMessageId','join','root','offline-chat/','close','server/files/chat/upload/','format','transcript-%s.txt','pathTranscript','Messages','User','ContactId','agentAlias','System','customer','%s%d','Visitor','agentIdentifier','website_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailServerOut','Smtp','CloudProvider','SendMail','sendMail','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','omit','ids','getMessages','filters','hasOwnProperty','nolimit','sort','where','ChatInteractionId','filter','$gte','split','findAll','pick','includeAgent','push','rows','addTags','setTags','spread','Tag','color','emit','chatInteractionTags:save','removeTags','download','unix'];(function(_0x4537d2,_0x359e33){var _0x4e6285=function(_0x4c5a86){while(--_0x4c5a86){_0x4537d2['push'](_0x4537d2['shift']());}};_0x4e6285(++_0x359e33);}(_0x9de9,0xea));var _0x99de=function(_0x349f9f,_0x287410){_0x349f9f=_0x349f9f-0x0;var _0x3a1069=_0x9de9[_0x349f9f];return _0x3a1069;};'use strict';var rimraf=require(_0x99de('0x0'));var zipdir=require(_0x99de('0x1'));var rp=require('request-promise');var moment=require(_0x99de('0x2'));var BPromise=require(_0x99de('0x3'));var Mustache=require(_0x99de('0x4'));var util=require('util');var path=require(_0x99de('0x5'));var ejs=require(_0x99de('0x6'));var fs=require('fs');var _=require(_0x99de('0x7'));var Redis=require(_0x99de('0x8'));var interaction=require(_0x99de('0x9'));var qs=require(_0x99de('0xa'));var pdf=require(_0x99de('0xb'));var logger=require(_0x99de('0xc'))(_0x99de('0xd'));var config=require(_0x99de('0xe'));var db=require(_0x99de('0xf'))['db'];config[_0x99de('0x10')]=_[_0x99de('0x11')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x99de('0x12'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x99de('0x13')][_0x99de('0x14')]({'port':0x232b});var client9004=jayson[_0x99de('0x13')][_0x99de('0x14')]({'port':0x232c});function respondWithRpcPromise(_0x1aa4ce,_0xf823d2,_0x3169e3,_0x532b0d){return new BPromise(function(_0x2c3f7e,_0x1975cd){var _0x48d1a5=_0x532b0d||client;return _0x48d1a5[_0x99de('0x15')](_0x1aa4ce,_0x3169e3)[_0x99de('0x16')](function(_0x15897f){logger[_0x99de('0x17')](_0x99de('0x18'),_0xf823d2,_0x99de('0x19'));logger[_0x99de('0x1a')](_0x99de('0x1b'),_0xf823d2,'request\x20sent',JSON[_0x99de('0x1c')](_0x15897f));if(_0x15897f['error']){if(_0x15897f[_0x99de('0x1d')][_0x99de('0x1e')]===0x1f4){logger[_0x99de('0x1d')](_0x99de('0x18'),_0xf823d2,_0x15897f[_0x99de('0x1d')]['message']);return _0x1975cd(_0x15897f[_0x99de('0x1d')][_0x99de('0x1f')]);}logger[_0x99de('0x1d')](_0x99de('0x18'),_0xf823d2,_0x15897f['error'][_0x99de('0x1f')]);return _0x2c3f7e(_0x15897f['error']['message']);}else{logger[_0x99de('0x17')](_0x99de('0x18'),_0xf823d2,_0x99de('0x19'));_0x2c3f7e(_0x15897f[_0x99de('0x20')][_0x99de('0x1f')]);}})[_0x99de('0x21')](function(_0x305fee){logger[_0x99de('0x1d')](_0x99de('0x18'),_0xf823d2,_0x305fee);_0x1975cd(_0x305fee);});});}function respondWithStatusCode(_0x52444b,_0xf850d3){_0xf850d3=_0xf850d3||0xcc;return function(_0x5e796a){if(_0x5e796a){return _0x52444b[_0x99de('0x22')](_0xf850d3);}return _0x52444b[_0x99de('0x23')](_0xf850d3)[_0x99de('0x24')]();};}function respondWithResult(_0x1f26b4,_0x6339da){_0x6339da=_0x6339da||0xc8;return function(_0x158860){if(_0x158860){return _0x1f26b4[_0x99de('0x23')](_0x6339da)[_0x99de('0x25')](_0x158860);}};}function respondWithFilteredResult(_0x5e066d,_0x2b94dc){return function(_0x1c35f0){if(_0x1c35f0){var _0x52980d=typeof _0x2b94dc[_0x99de('0x26')]==='undefined'&&typeof _0x2b94dc[_0x99de('0x27')]===_0x99de('0x28');var _0x95b561=_0x1c35f0[_0x99de('0x29')];var _0x554e7b=_0x52980d?0x0:_0x2b94dc['offset'];var _0xaf2afd=_0x52980d?_0x1c35f0[_0x99de('0x29')]:_0x2b94dc[_0x99de('0x26')]+_0x2b94dc['limit'];var _0x53199c;if(_0xaf2afd>=_0x95b561){_0xaf2afd=_0x95b561;_0x53199c=0xc8;}else{_0x53199c=0xce;}_0x5e066d[_0x99de('0x23')](_0x53199c);return _0x5e066d[_0x99de('0x2a')](_0x99de('0x2b'),_0x554e7b+'-'+_0xaf2afd+'/'+_0x95b561)[_0x99de('0x25')](_0x1c35f0);}return null;};}function saveUpdates(_0x5acb27){return function(_0x4b77ac){if(_0x4b77ac){return _0x4b77ac['update'](_0x5acb27)[_0x99de('0x16')](function(_0x4e0f05){return _0x4e0f05;});}return null;};}function removeEntity(_0x4e9279){return function(_0x875bf6){if(_0x875bf6){return _0x875bf6[_0x99de('0x2c')]()[_0x99de('0x16')](function(){_0x4e9279['status'](0xcc)[_0x99de('0x24')]();});}};}function handleEntityNotFound(_0x3ff95f){return function(_0x36ab95){if(!_0x36ab95){_0x3ff95f['sendStatus'](0x194);}return _0x36ab95;};}function handleError(_0x1545f3,_0x3a8152){_0x3a8152=_0x3a8152||0x1f4;return function(_0x3baa74){logger[_0x99de('0x1d')](_0x3baa74[_0x99de('0x2d')]);if(_0x3baa74[_0x99de('0x2e')]){delete _0x3baa74[_0x99de('0x2e')];}_0x1545f3[_0x99de('0x23')](_0x3a8152)[_0x99de('0x2f')](_0x3baa74);};}function getMustacheRender(_0x29a05f,_0x48c592){return Mustache['render'](_0x29a05f,_[_0x99de('0x30')](_0x48c592[_0x99de('0x31')],{'contact':_0x48c592[_0x99de('0x32')],'message':_0x48c592[_0x99de('0x1f')],'agent':_0x48c592[_0x99de('0x33')],'interaction':_0x48c592[_0x99de('0x34')],'account':_0x48c592['account']}))||'';}exports[_0x99de('0x35')]=function(_0x4c1efa,_0x4596a6){var _0xa7746c={};var _0x3297df=_[_0x99de('0x36')](db[_0x99de('0x37')][_0x99de('0x38')],function(_0x853c36){return{'name':_0x853c36[_0x99de('0x39')],'type':_0x853c36[_0x99de('0x3a')]['key']};});_0xa7746c=qs[_0x99de('0x3b')](_0x3297df,_0x4c1efa);return interaction['findAll'](_0x99de('0x3c'),_0x4c1efa['query'],_0x4c1efa[_0x99de('0x3d')],_0xa7746c,_0x3297df)['then'](respondWithFilteredResult(_0x4596a6,_0xa7746c))[_0x99de('0x21')](handleError(_0x4596a6,null));};exports[_0x99de('0x3e')]=function(_0x3e3c5c,_0x46888f){var _0xc9f6bd={'raw':![],'where':{'id':_0x3e3c5c['params']['id']}},_0x3c64c1={};_0x3c64c1['model']=_[_0x99de('0x3f')](db[_0x99de('0x37')][_0x99de('0x38')]);_0x3c64c1['query']=_[_0x99de('0x3f')](_0x3e3c5c[_0x99de('0x40')]);_0x3c64c1['filters']=_['intersection'](_0x3c64c1[_0x99de('0x41')],_0x3c64c1[_0x99de('0x40')]);_0xc9f6bd[_0x99de('0x42')]=_[_0x99de('0x43')](_0x3c64c1[_0x99de('0x41')],qs['fields'](_0x3e3c5c[_0x99de('0x40')][_0x99de('0x44')]));_0xc9f6bd['attributes']=_0xc9f6bd['attributes'][_0x99de('0x45')]?_0xc9f6bd['attributes']:_0x3c64c1[_0x99de('0x41')];if(_0x3e3c5c[_0x99de('0x40')][_0x99de('0x46')]){_0xc9f6bd[_0x99de('0x47')]=[{'all':!![]}];}_0xc9f6bd=_[_0x99de('0x30')]({},_0xc9f6bd,_0x3e3c5c[_0x99de('0x48')]);return db[_0x99de('0x37')]['find'](_0xc9f6bd)['then'](handleEntityNotFound(_0x46888f,null))[_0x99de('0x16')](respondWithResult(_0x46888f,null))[_0x99de('0x21')](handleError(_0x46888f,null));};exports[_0x99de('0x49')]=function(_0x219973,_0x4f9501){return db[_0x99de('0x37')][_0x99de('0x49')](_0x219973[_0x99de('0x31')],{})[_0x99de('0x16')](respondWithResult(_0x4f9501,0xc9))['catch'](handleError(_0x4f9501,null));};exports[_0x99de('0x4a')]=function(_0x254c3b,_0x91209b){if(_0x254c3b['body']['id']){delete _0x254c3b[_0x99de('0x31')]['id'];}return db[_0x99de('0x37')][_0x99de('0x4b')]({'where':{'id':_0x254c3b[_0x99de('0x4c')]['id']}})[_0x99de('0x16')](handleEntityNotFound(_0x91209b,null))[_0x99de('0x16')](saveUpdates(_0x254c3b['body'],null))[_0x99de('0x16')](respondWithResult(_0x91209b,null))[_0x99de('0x21')](handleError(_0x91209b,null));};exports['destroy']=function(_0x66dfde,_0x2f7d32){return db['ChatInteraction'][_0x99de('0x4b')]({'where':{'id':_0x66dfde[_0x99de('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2f7d32,null))[_0x99de('0x16')](removeEntity(_0x2f7d32,null))[_0x99de('0x21')](handleError(_0x2f7d32,null));};exports[_0x99de('0x4d')]=function(_0x413472,_0x238fbb){return db['ChatInteraction']['describe']()[_0x99de('0x16')](respondWithResult(_0x238fbb,null))[_0x99de('0x21')](handleError(_0x238fbb,null));};exports[_0x99de('0x4e')]=function(_0x29d424,_0x1c6599){var _0x34fc16=_0x29d424[_0x99de('0x4c')]['id'];var _0x349569;var _0x305467;var _0x2cc9ad;return db['ChatInteraction'][_0x99de('0x4f')]({'where':{'id':_0x34fc16}})['then'](function(_0x2b7f44){_0x349569=_0x2b7f44;return db[_0x99de('0x50')][_0x99de('0x4f')]({'where':{'id':_0x2b7f44[_0x99de('0x51')]},'attributes':['id',_0x99de('0x52'),'vidaooEscalation',_0x99de('0x53'),_0x99de('0x54'),_0x99de('0x55')],'raw':!![]});})[_0x99de('0x16')](function(_0x43f1bd){if(_0x43f1bd&&_0x43f1bd[_0x99de('0x52')]&&_0x43f1bd[_0x99de('0x56')]){_0x305467=_0x43f1bd;var _0x18f38f={'interaction':{'id':_0x34fc16},'agent':{'id':_0x29d424[_0x99de('0x3d')]['id'],'name':_0x29d424[_0x99de('0x3d')]['name'],'fullname':_0x29d424['user'][_0x99de('0x57')],'email':_0x29d424[_0x99de('0x3d')][_0x99de('0x58')]},'contact':_0x29d424[_0x99de('0x31')]['contact'],'account':_0x29d424['body'][_0x99de('0x59')]};var _0xde780={'rejectUnauthorized':![],'method':'POST','url':_0x99de('0x5a'),'headers':{'X-APIKEY':_0x43f1bd[_0x99de('0x52')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x29d424[_0x99de('0x3d')][_0x99de('0x58')]],'buttons':null,'topic':_0x305467[_0x99de('0x53')],'note':_[_0x99de('0x5b')](_0x305467[_0x99de('0x54')])?null:getMustacheRender(_0x305467['vidaooNote'],_0x18f38f),'metadata':null},'redirect':'follow','json':!![]};try{if(!_['isNull'](_0x305467[_0x99de('0x55')])){var _0x57bad7=getMustacheRender(_0x305467[_0x99de('0x55')],_0x18f38f);var _0x383e87=JSON['parse'](_0x57bad7);_0xde780[_0x99de('0x31')]['metadata']=_0x383e87;}}catch(_0x54f07a){throw new db[(_0x99de('0x5c'))][(_0x99de('0x5d'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0xde780);}else{throw new db[(_0x99de('0x5c'))][(_0x99de('0x5d'))](_0x99de('0x5e'));}})[_0x99de('0x16')](function(_0x3a7673){_0x2cc9ad=_0x3a7673;if(_0x2cc9ad['id']){var _0x1eb75c={'body':_0x2cc9ad['join_url'],'ChatWebsiteId':_0x305467['id'],'ChatInteractionId':_0x349569['id'],'direction':'out','UserId':_0x29d424[_0x99de('0x3d')]['id']};return db[_0x99de('0x5f')]['create'](_0x1eb75c,{});}else{throw new db[(_0x99de('0x5c'))][(_0x99de('0x5d'))](_0x99de('0x60'));}})[_0x99de('0x16')](function(){return _0x349569[_0x99de('0x61')]({'vidaooSessionId':_0x2cc9ad['id']});})[_0x99de('0x16')](respondWithResult(_0x1c6599,null))['catch'](handleError(_0x1c6599,null));};exports['customUpdate']=function(_0xe520b8,_0x55d2d8){if(_0xe520b8[_0x99de('0x31')]['id']){delete _0xe520b8[_0x99de('0x31')]['id'];}return db[_0x99de('0x37')][_0x99de('0x4b')]({'where':{'id':_0xe520b8[_0x99de('0x4c')]['id']},'include':[{'model':db[_0x99de('0x62')],'as':_0x99de('0x63')}]})[_0x99de('0x16')](handleEntityNotFound(_0x55d2d8,null))['then'](saveUpdates(_0xe520b8[_0x99de('0x31')],null))['then'](respondWithResult(_0x55d2d8,null))[_0x99de('0x21')](handleError(_0x55d2d8,null));};exports[_0x99de('0x64')]=function(_0x790f13,_0x4ab3ab){if(_0x790f13[_0x99de('0x31')]['id']){delete _0x790f13['body']['id'];}return db['ChatInteraction'][_0x99de('0x4b')]({'where':{'id':_0x790f13[_0x99de('0x4c')]['id']}})['then'](function(_0x1f2fb7){if(!_0x1f2fb7){logger['error'](_0x99de('0x65'),'abandon',0x194,_0x99de('0x66'));_0x4ab3ab[_0x99de('0x22')](0x194);}else{if(_0x1f2fb7[_0x99de('0x67')]){throw new db['Sequelize'][(_0x99de('0x5d'))]('Interaction\x20already\x20assigned');}}return _0x1f2fb7;})['then'](function(_0x394cf7){if(_0x394cf7){return _0x394cf7['update']({'closed':_0x790f13[_0x99de('0x31')]['closed'],'disposition':_0x790f13[_0x99de('0x31')][_0x99de('0x68')]})[_0x99de('0x16')](function(_0x390421){return _0x390421;});}})[_0x99de('0x16')](function(){return respondWithRpcPromise(_0x99de('0x69'),_0x99de('0x64'),_0x790f13[_0x99de('0x31')],client9004);})[_0x99de('0x16')](respondWithResult(_0x4ab3ab,null))[_0x99de('0x21')](handleError(_0x4ab3ab,null));};exports[_0x99de('0x6a')]=function(_0x13aee1,_0x41511f){_0x13aee1['body']['name']=_0x13aee1['file']['originalname'];_0x13aee1['body'][_0x99de('0x6b')]=_0x13aee1['file']['filename'];_0x13aee1['body'][_0x99de('0x3a')]=_0x13aee1[_0x99de('0x6c')]['mimetype'];return db[_0x99de('0x6d')][_0x99de('0x49')](_0x13aee1['body'])['then'](respondWithResult(_0x41511f,0xc9))[_0x99de('0x21')](handleError(_0x41511f,null));};exports['attachmentDownload']=function(_0x302a3c,_0x3ce5d9){return db[_0x99de('0x37')][_0x99de('0x4f')]({'where':{'id':_0x302a3c[_0x99de('0x4c')]['id']},'raw':!![]})[_0x99de('0x16')](handleEntityNotFound(_0x3ce5d9,null))['then'](function(_0x4be993){if(_0x4be993){if(_0x4be993[_0x99de('0x6e')]){return _0x3ce5d9[_0x99de('0x23')](0x193)[_0x99de('0x25')]({'status':0x193,'message':_0x99de('0x6f')});}return db[_0x99de('0x6d')][_0x99de('0x4f')]({'where':{'id':_0x302a3c[_0x99de('0x40')][_0x99de('0x70')]},'raw':!![]})[_0x99de('0x16')](handleEntityNotFound(_0x3ce5d9,null));}})[_0x99de('0x16')](function(_0x7ed6cc){if(_0x7ed6cc){var _0x267d36=_0x7ed6cc[_0x99de('0x71')]!==null;var _0x3020e2=path[_0x99de('0x72')](config[_0x99de('0x73')],'server/files/attachments/');if(_0x267d36){_0x3020e2=path[_0x99de('0x72')](_0x3020e2,_0x99de('0x74'));}var _0x4e0692=path[_0x99de('0x72')](_0x3020e2,_0x7ed6cc[_0x99de('0x6b')]);return _0x3ce5d9['download'](_0x4e0692);}})['catch'](handleError(_0x3ce5d9,null));};exports[_0x99de('0x75')]=function(_0x381892,_0x553763){var _0x44a88a=null;var _0x521fa2=null;var _0x1b70bf=null;if(_0x381892[_0x99de('0x31')]['id']){delete _0x381892[_0x99de('0x31')]['id'];}if(_0x381892['body']['mailTranscript']){_0x1b70bf=path[_0x99de('0x72')](config[_0x99de('0x73')],_0x99de('0x76'),util[_0x99de('0x77')](_0x99de('0x78'),Date['now']()));_0x381892[_0x99de('0x31')][_0x99de('0x79')]=_0x1b70bf;}return db['ChatInteraction'][_0x99de('0x4b')]({'where':{'id':_0x381892[_0x99de('0x4c')]['id']},'include':[{'model':db[_0x99de('0x5f')],'as':_0x99de('0x7a'),'include':[{'model':db[_0x99de('0x7b')],'as':_0x99de('0x7b')}]}]})[_0x99de('0x16')](handleEntityNotFound(_0x553763,null))[_0x99de('0x16')](saveUpdates(_0x381892[_0x99de('0x31')],null))[_0x99de('0x16')](function(_0x125365){if(_0x125365){_0x44a88a=_0x125365;return db[_0x99de('0x50')][_0x99de('0x4b')]({'where':{'id':_0x44a88a[_0x99de('0x51')]}});}})[_0x99de('0x16')](function(_0x1b635d){if(_0x1b635d){_0x521fa2=_0x1b635d;return db[_0x99de('0x62')]['find']({'where':{'id':_0x44a88a[_0x99de('0x7c')]}});}})[_0x99de('0x16')](function(_0x5c626d){if(_0x5c626d){if(_0x1b70bf){var _0x3d1b16=null;for(var _0x111c24=0x1;_0x111c24<_0x44a88a['Messages']['length'];++_0x111c24){_0x3d1b16=_0x44a88a[_0x99de('0x7a')][_0x111c24];var _0x63d456=_0x3d1b16[_0x99de('0x67')]?util['format']('%s%d',_0x521fa2[_0x99de('0x7d')],_0x3d1b16['UserId']):_0x99de('0x7e');var _0x53fa43=_0x381892['body'][_0x99de('0x7f')]||util[_0x99de('0x77')](_0x99de('0x80'),_0x99de('0x81'),_0x3d1b16['ContactId']);switch(_0x521fa2[_0x99de('0x82')]){case _0x99de('0x83'):_0x63d456=_0x3d1b16[_0x99de('0x67')]?util['format'](_0x99de('0x80'),_0x521fa2[_0x99de('0x7d')],_0x3d1b16[_0x99de('0x67')]):_0x99de('0x7e');break;case'agent_alias':_0x63d456=_0x3d1b16['UserId']?_0x3d1b16[_0x99de('0x7b')][_0x99de('0x84')]||_0x3d1b16['User'][_0x99de('0x57')]:_0x99de('0x7e');break;case _0x99de('0x85'):_0x63d456=_0x3d1b16[_0x99de('0x67')]?_0x3d1b16['User'][_0x99de('0x57')]:_0x99de('0x7e');break;default:_0x63d456=_0x3d1b16['UserId']?util[_0x99de('0x77')](_0x99de('0x80'),_0x521fa2[_0x99de('0x7d')],_0x3d1b16[_0x99de('0x67')]):_0x99de('0x7e');}var _0x4aa681=util[_0x99de('0x77')](_0x99de('0x86'),moment(_0x3d1b16[_0x99de('0x87')])[_0x99de('0x77')](_0x99de('0x88')),_0x3d1b16[_0x99de('0x89')]==='in'?_0x53fa43:_0x63d456,_0x3d1b16[_0x99de('0x31')]);if(!_0x3d1b16['secret']){fs[_0x99de('0x8a')](_0x1b70bf,_0x4aa681);}}return db['MailAccount'][_0x99de('0x4f')]({'where':{'service':!![]},'include':[{'model':db[_0x99de('0x8b')],'as':_0x99de('0x8c'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x99de('0x8d'),'raw':!![]}]}]});}}})['then'](function(_0x2c68d5){if(!_0x2c68d5||!_0x2c68d5[_0x99de('0x8c')]||!_0x381892[_0x99de('0x31')])return _0x44a88a;var _0x24c34a=_0x2c68d5['getSmtpOptions']();return respondWithRpcPromise(_0x99de('0x8e'),_0x99de('0x8f'),{'account':_0x24c34a,'message':{'from':util[_0x99de('0x77')]('\x22%s\x22\x20<%s>',_0x2c68d5[_0x99de('0x2e')],_0x2c68d5[_0x99de('0x58')]||_0x2c68d5[_0x99de('0x8c')][_0x99de('0x3d')]),'to':_0x381892[_0x99de('0x31')][_0x99de('0x90')],'subject':_0x99de('0x91'),'text':util[_0x99de('0x77')](_0x99de('0x92'),_0x381892[_0x99de('0x31')][_0x99de('0x90')]),'attachments':[{'path':_0x1b70bf}]}})[_0x99de('0x16')](function(){return _0x44a88a;})[_0x99de('0x21')](function(_0x248635){logger[_0x99de('0x1d')](_0x248635);});})['then'](respondWithStatusCode(_0x553763,0xc8))[_0x99de('0x21')](handleError(_0x553763,null));};exports['addMessage']=function(_0xb2b1bf,_0x4d1ef6){return db[_0x99de('0x5f')]['find']({'where':{'id':_0xb2b1bf[_0x99de('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4d1ef6,null))[_0x99de('0x16')](function(_0x447f69){if(_0x447f69){return _0x447f69['addMessage'](_0xb2b1bf[_0x99de('0x31')]['ids'],_[_0x99de('0x93')](_0xb2b1bf['body'],[_0x99de('0x94'),'id'])||{});}})['then'](respondWithResult(_0x4d1ef6,null))['catch'](handleError(_0x4d1ef6,null));};exports[_0x99de('0x95')]=function(_0x4531db,_0x5be36a){var _0x32fe0b={'raw':![],'where':{}};var _0x11e232={};var _0x58608c={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x99de('0x4f')]({'where':{'id':_0x4531db['params']['id']}})[_0x99de('0x16')](handleEntityNotFound(_0x5be36a,null))[_0x99de('0x16')](function(_0x1bdfe5){if(_0x1bdfe5){_0x11e232[_0x99de('0x41')]=_[_0x99de('0x3f')](db[_0x99de('0x5f')]['rawAttributes']);_0x11e232[_0x99de('0x40')]=_[_0x99de('0x3f')](_0x4531db[_0x99de('0x40')]);_0x11e232[_0x99de('0x96')]=_[_0x99de('0x43')](_0x11e232[_0x99de('0x41')],_0x11e232[_0x99de('0x40')]);_0x32fe0b['attributes']=_[_0x99de('0x43')](_0x11e232['model'],qs[_0x99de('0x44')](_0x4531db['query'][_0x99de('0x44')]));_0x32fe0b[_0x99de('0x42')]=_0x32fe0b[_0x99de('0x42')]['length']?_0x32fe0b[_0x99de('0x42')]:_0x11e232[_0x99de('0x41')];if(!_0x4531db[_0x99de('0x40')][_0x99de('0x97')](_0x99de('0x98'))){_0x32fe0b[_0x99de('0x27')]=qs[_0x99de('0x27')](_0x4531db[_0x99de('0x40')][_0x99de('0x27')]);_0x32fe0b[_0x99de('0x26')]=qs[_0x99de('0x26')](_0x4531db[_0x99de('0x40')][_0x99de('0x26')]);}_0x32fe0b['order']=qs['sort'](_0x4531db['query'][_0x99de('0x99')]);_0x32fe0b[_0x99de('0x9a')]=qs[_0x99de('0x96')](_['pick'](_0x4531db[_0x99de('0x40')],_0x11e232[_0x99de('0x96')]));_0x32fe0b['where'][_0x99de('0x9b')]=_0x1bdfe5['id'];if(_0x4531db[_0x99de('0x40')][_0x99de('0x9c')]){_0x32fe0b[_0x99de('0x9a')]=_[_0x99de('0x30')](_0x32fe0b[_0x99de('0x9a')],{'$or':_[_0x99de('0x36')](_0x32fe0b[_0x99de('0x42')],function(_0x3efcc9){var _0x5d64c9={};_0x5d64c9[_0x3efcc9]={'$like':'%'+_0x4531db[_0x99de('0x40')][_0x99de('0x9c')]+'%'};return _0x5d64c9;})});}if(_0x4531db['query'][_0x99de('0x9d')]){var _0x4a9a4d=_0x4531db[_0x99de('0x40')]['$gte'][_0x99de('0x9e')](',');var _0x3f816b={};_0x3f816b[_0x4a9a4d[0x0]]={'$gte':moment(_0x4a9a4d[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x32fe0b[_0x99de('0x9a')]=_[_0x99de('0x30')](_0x32fe0b[_0x99de('0x9a')],_0x3f816b);}_0x32fe0b=_[_0x99de('0x30')]({},_0x32fe0b,_0x4531db[_0x99de('0x48')]);return db[_0x99de('0x5f')][_0x99de('0x29')]({'where':_0x32fe0b[_0x99de('0x9a')]})[_0x99de('0x16')](function(_0x2354ef){_0x58608c['count']=_0x2354ef;if(_0x4531db['query'][_0x99de('0x46')]){_0x32fe0b[_0x99de('0x47')]=[{'all':!![]}];}return db[_0x99de('0x5f')][_0x99de('0x9f')](_0x32fe0b);})[_0x99de('0x16')](function(_0x356a79){_0x58608c['rows']=_0x356a79;return _0x58608c;});}})[_0x99de('0x16')](respondWithFilteredResult(_0x5be36a,_0x32fe0b))[_0x99de('0x21')](handleError(_0x5be36a,null));};exports['getMyMessages']=function(_0x21e899,_0xe0f57c){var _0x5ded14={'where':{}},_0x1b2b43={},_0xb36948={'count':0x0,'rows':[]};return db[_0x99de('0x37')]['findOne']({'where':{'id':_0x21e899['params']['id']}})[_0x99de('0x16')](handleEntityNotFound(_0xe0f57c,null))[_0x99de('0x16')](function(_0x13597b){if(_0x13597b){_0x1b2b43[_0x99de('0x41')]=_[_0x99de('0x3f')](db[_0x99de('0x5f')][_0x99de('0x38')]);_0x1b2b43['query']=_['keys'](_0x21e899[_0x99de('0x40')]);_0x1b2b43[_0x99de('0x96')]=_['intersection'](_0x1b2b43[_0x99de('0x41')],_0x1b2b43['query']);_0x5ded14['attributes']=_[_0x99de('0x43')](_0x1b2b43[_0x99de('0x41')],qs[_0x99de('0x44')](_0x21e899[_0x99de('0x40')][_0x99de('0x44')]));_0x5ded14[_0x99de('0x42')]=_0x5ded14[_0x99de('0x42')]['length']?_0x5ded14['attributes']:_0x1b2b43[_0x99de('0x41')];if(!_0x21e899[_0x99de('0x40')][_0x99de('0x97')](_0x99de('0x98'))){_0x5ded14[_0x99de('0x27')]=qs[_0x99de('0x27')](_0x21e899[_0x99de('0x40')]['limit']);_0x5ded14[_0x99de('0x26')]=qs[_0x99de('0x26')](_0x21e899[_0x99de('0x40')]['offset']);}_0x5ded14['order']=qs[_0x99de('0x99')](_0x21e899[_0x99de('0x40')][_0x99de('0x99')]);_0x5ded14[_0x99de('0x9a')]=qs[_0x99de('0x96')](_[_0x99de('0xa0')](_0x21e899['query'],_0x1b2b43['filters']));_0x5ded14[_0x99de('0x9a')][_0x99de('0x9b')]=_0x13597b['id'];if(_0x21e899[_0x99de('0x40')][_0x99de('0x9c')]){_0x5ded14['where']=_[_0x99de('0x30')](_0x5ded14[_0x99de('0x9a')],{'$or':_['map'](_0x5ded14[_0x99de('0x42')],function(_0x454029){var _0x253979={};_0x253979[_0x454029]={'$like':'%'+_0x21e899[_0x99de('0x40')][_0x99de('0x9c')]+'%'};return _0x253979;})});}_0x5ded14[_0x99de('0x9a')]['secret']=![];if(_0x21e899[_0x99de('0x40')]['id']){_0x5ded14[_0x99de('0x9a')]['id']={'$gt':_0x21e899['query']['id']};}_0x5ded14=_[_0x99de('0x30')]({},_0x5ded14,_0x21e899[_0x99de('0x48')]);return db[_0x99de('0x5f')][_0x99de('0x29')]({'where':_0x5ded14[_0x99de('0x9a')]})['then'](function(_0x31237f){_0xb36948[_0x99de('0x29')]=_0x31237f;_0x5ded14[_0x99de('0x47')]=[];if(_0x21e899[_0x99de('0x40')][_0x99de('0xa1')]){_0x5ded14['include'][_0x99de('0xa2')]({'model':db['User'],'as':'User','attributes':['id','fullname',_0x99de('0x84')]});}if(_0x21e899['query'][_0x99de('0x46')]){_0x5ded14[_0x99de('0x47')]=[{'all':!![]}];}return db[_0x99de('0x5f')][_0x99de('0x9f')](_0x5ded14);})[_0x99de('0x16')](function(_0x314dcf){_0xb36948[_0x99de('0xa3')]=_0x314dcf;return _0xb36948;});}})[_0x99de('0x16')](respondWithFilteredResult(_0xe0f57c,_0x5ded14))[_0x99de('0x21')](handleError(_0xe0f57c,null));};exports[_0x99de('0xa4')]=function(_0x577b32,_0x199a7d){return db[_0x99de('0x37')][_0x99de('0x4b')]({'where':{'id':_0x577b32[_0x99de('0x4c')]['id']}})[_0x99de('0x16')](handleEntityNotFound(_0x199a7d,null))[_0x99de('0x16')](function(_0x5dbcb1){if(_0x5dbcb1){return _0x5dbcb1[_0x99de('0xa5')](_0x577b32['body'][_0x99de('0x94')],_['omit'](_0x577b32['body'],[_0x99de('0x94'),'id'])||{})[_0x99de('0xa6')](function(){return db[_0x99de('0xa7')]['findAll']({'attributes':['id',_0x99de('0x2e'),_0x99de('0xa8')],'where':{'id':_0x577b32[_0x99de('0x31')][_0x99de('0x94')]}});})['then'](function(_0x2a6f74){socket[_0x99de('0xa9')](_0x99de('0xaa'),{'id':Number(_0x577b32[_0x99de('0x4c')]['id']),'tags':_0x2a6f74||[]});return{'id':Number(_0x577b32[_0x99de('0x4c')]['id']),'tags':_0x2a6f74||[]};});}})['then'](respondWithResult(_0x199a7d,null))['catch'](handleError(_0x199a7d,null));};exports[_0x99de('0xab')]=function(_0x2d0efd,_0x3f97a1){return db[_0x99de('0x37')][_0x99de('0x4b')]({'where':{'id':_0x2d0efd[_0x99de('0x4c')]['id']}})[_0x99de('0x16')](handleEntityNotFound(_0x3f97a1,null))[_0x99de('0x16')](function(_0x4a36df){if(_0x4a36df){return _0x4a36df[_0x99de('0xab')](_0x2d0efd[_0x99de('0x40')][_0x99de('0x94')]);}})['then'](respondWithStatusCode(_0x3f97a1,null))[_0x99de('0x21')](handleError(_0x3f97a1,null));};exports[_0x99de('0xac')]=function(_0x435321,_0x2a86c5){var _0x37db35=moment()[_0x99de('0xad')]()[_0x99de('0xae')]();var _0x1136c0=path['join'](config[_0x99de('0x73')],_0x99de('0xaf'),_0x99de('0xb0'),_0x99de('0xb1'));var _0x5540c1=path[_0x99de('0x72')](config['root'],_0x99de('0xaf'),_0x99de('0xb0'),_0x99de('0xb2'));var _0x3ede1a=path[_0x99de('0x72')](_0x1136c0,_0x37db35);var _0x7ac006=util[_0x99de('0x77')]('transcript-%d-%s.zip',_0x435321[_0x99de('0x4c')]['id'],_0x37db35);var _0xf2182d=path[_0x99de('0x72')](_0x1136c0,_0x7ac006);var _0x316914=[];_0x316914[_0x99de('0xa2')]({'model':db['User'],'as':_0x99de('0x7b'),'attributes':['id',_0x99de('0x57')],'raw':!![]});_0x316914[_0x99de('0xa2')]({'model':db[_0x99de('0x62')],'as':'Contact','attributes':['id','firstName','lastName'],'raw':!![]});if(_0x435321[_0x99de('0x40')][_0x99de('0xb2')]){_0x316914[_0x99de('0xa2')]({'model':db['Attachment'],'as':_0x99de('0x6d'),'raw':!![]});}var _0xac8593=[{'model':db[_0x99de('0x5f')],'as':_0x99de('0x7a'),'attributes':['id',_0x99de('0x31'),_0x99de('0x87'),_0x99de('0x89'),_0x99de('0xb3'),_0x99de('0xb4')],'include':_0x316914}];_0xac8593[_0x99de('0xa2')]({'model':db[_0x99de('0x50')],'as':_0x99de('0xb5'),'attributes':['id','name']});_0xac8593[_0x99de('0xa2')]({'model':db[_0x99de('0x7b')],'as':'Owner','attributes':['id',_0x99de('0x57')]});return db[_0x99de('0x37')][_0x99de('0x4b')]({'where':{'id':_0x435321[_0x99de('0x4c')]['id']},'include':_0xac8593})['then'](handleEntityNotFound(_0x2a86c5,null))['then'](function(_0x2e01b0){if(_0x2e01b0){var _0x5363f0=_0x2e01b0[_0x99de('0xb6')]({'plain':!![]});fs[_0x99de('0xb7')](_0x3ede1a);var _0x14c5ef={'channel':_0x99de('0xb8'),'account':_0x5363f0['Account'][_0x99de('0x2e')],'agent':_0x5363f0[_0x99de('0xb9')]?_0x5363f0[_0x99de('0xb9')][_0x99de('0x57')]:_0x99de('0xba'),'createdAt':moment(_0x5363f0[_0x99de('0x87')])[_0x99de('0x77')](_0x99de('0xbb'))[_0x99de('0xae')](),'closedAt':_0x5363f0[_0x99de('0x6e')]?moment(_0x5363f0[_0x99de('0xbc')])[_0x99de('0x77')](_0x99de('0xbb'))['toString']():'','disposition':_0x5363f0[_0x99de('0x68')],'chatInfo':{'browser':_0x5363f0['browserName'],'os':_0x5363f0['osName'],'referer':_0x5363f0[_0x99de('0xbd')],'customerIp':_0x5363f0[_0x99de('0xbe')],'customerPort':_0x5363f0[_0x99de('0xbf')]?_0x5363f0[_0x99de('0xbf')]:_0x99de('0xba')},'messages':_(_0x5363f0[_0x99de('0x7a')])[_0x99de('0xc0')]()[_0x99de('0x9c')]({'secret':![]})['map'](function(_0x38fce1){if(_0x38fce1[_0x99de('0x6d')]){var _0x1f46e7=path[_0x99de('0x72')](_0x5540c1,_0x38fce1[_0x99de('0x6d')][_0x99de('0x6b')]);if(fs[_0x99de('0xc1')](_0x1f46e7)){fs[_0x99de('0xc2')](_0x1f46e7)['pipe'](fs['createWriteStream'](path['join'](_0x3ede1a,_0x38fce1[_0x99de('0x6d')][_0x99de('0x6b')])));}}return{'date':moment(_0x38fce1[_0x99de('0x87')])[_0x99de('0x77')](_0x99de('0xbb'))[_0x99de('0xae')](),'sender':_0x38fce1['direction']===_0x99de('0xc3')?_0x38fce1['User']?_0x38fce1[_0x99de('0x7b')][_0x99de('0x57')]:_0x99de('0x7e'):_0x38fce1['Contact']['firstName']+(_0x38fce1[_0x99de('0x63')]['lastName']?'\x20'+_0x38fce1[_0x99de('0x63')][_0x99de('0xc4')]:''),'body':_0x38fce1[_0x99de('0x6d')]?_0x38fce1[_0x99de('0x6d')][_0x99de('0x6b')]:_0x38fce1[_0x99de('0x31')],'direction':_0x38fce1[_0x99de('0x89')]===_0x99de('0xc3')?'A':'C','secret':_0x38fce1['secret'],'read':_0x38fce1[_0x99de('0xb4')],'attachment':_0x38fce1[_0x99de('0x6d')]};})[_0x99de('0xc5')]()};return ejs['renderFile'](path[_0x99de('0x72')](config[_0x99de('0x73')],_0x99de('0xaf'),_0x99de('0xc6'),_0x99de('0xc7')),{'interaction':_0x14c5ef})[_0x99de('0x16')](function(_0x1ca5f4){var _0x3b4b4f=path[_0x99de('0x72')](_0x3ede1a,_0x99de('0xc8')+_0x5363f0['id']+'-'+_0x37db35+'.pdf');var _0x1ede47={'path':_0x3b4b4f,'channel':_0x99de('0xb8'),'interactionId':_0x5363f0['id']};return pdf[_0x99de('0xc9')](_0x1ca5f4,_0x1ede47);})['then'](function(){return new Promise(function(_0x12587e,_0x4d5b76){zipdir(_0x3ede1a,{'saveTo':_0xf2182d},function(_0x2c4b3b,_0x410ad0){if(_0x2c4b3b)return _0x4d5b76(_0x2c4b3b);return _0x12587e(_0x410ad0);});})['then'](function(){return new BPromise(function(_0x28ad32,_0x38bcc9){rimraf(_0x3ede1a,function(_0x10f2f7){if(_0x10f2f7)_0x38bcc9(_0x10f2f7);return _0x28ad32();});});})[_0x99de('0x16')](function(){return _0x2a86c5[_0x99de('0xac')](_0xf2182d,_0x7ac006,function(_0x4e81a2){if(_0x4e81a2){logger['error'](_0x99de('0xca'),_0x4e81a2);}else{fs[_0x99de('0xcb')](_0xf2182d);}});});});}else{return _0x2a86c5[_0x99de('0x22')](0xc8);}})[_0x99de('0x21')](handleError(_0x2a86c5,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 9a1b209..9a192ef 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 _0xe9ba=['then','Users','map','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','ChatInteraction','setMaxListeners','save','update','remove','getUsers'];(function(_0x5002da,_0x33154f){var _0x4c79ca=function(_0x19451c){while(--_0x19451c){_0x5002da['push'](_0x5002da['shift']());}};_0x4c79ca(++_0x33154f);}(_0xe9ba,0x1a8));var _0xae9b=function(_0x262c2d,_0x4373cb){_0x262c2d=_0x262c2d-0x0;var _0x444ea3=_0xe9ba[_0x262c2d];return _0x444ea3;};'use strict';var EventEmitter=require(_0xae9b('0x0'));var ChatInteraction=require(_0xae9b('0x1'))['db'][_0xae9b('0x2')];var ChatMessage=require(_0xae9b('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xae9b('0x3')](0x0);var events={'afterCreate':_0xae9b('0x4'),'afterUpdate':_0xae9b('0x5'),'afterDestroy':_0xae9b('0x6')};function emitEvent(_0x41c594){return function(_0x485a27,_0x122bb0,_0xd27ca8){_0x485a27[_0xae9b('0x7')]({'attributes':['id'],'raw':!![]})[_0xae9b('0x8')](function(_0x2337ef){_0x485a27['setDataValue'](_0xae9b('0x9'),_0x2337ef[_0xae9b('0xa')](function(_0x259df9){return{'id':_0x259df9['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x485a27['id'],'direction':'in','read':![]},'raw':!![]});})[_0xae9b('0x8')](function(_0xfafcf7){_0x485a27['setDataValue']('unreadMessages',_0xfafcf7[_0xae9b('0xb')]);ChatInteractionEvents[_0xae9b('0xc')](_0x41c594+':'+_0x485a27['id'],_0x485a27);ChatInteractionEvents[_0xae9b('0xc')](_0x41c594,_0x485a27);_0xd27ca8(null);})[_0xae9b('0xd')](_0xd27ca8(null));};}for(var e in events){if(events[_0xae9b('0xe')](e)){var event=events[e];ChatInteraction[_0xae9b('0xf')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
+var _0x1faf=['then','emit','hasOwnProperty','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','setDataValue','Users'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x1faf,0x1f1));var _0xf1fa=function(_0x39b63c,_0x22eedd){_0x39b63c=_0x39b63c-0x0;var _0x25c645=_0x1faf[_0x39b63c];return _0x25c645;};'use strict';var EventEmitter=require(_0xf1fa('0x0'));var ChatInteraction=require(_0xf1fa('0x1'))['db'][_0xf1fa('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0xf1fa('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xf1fa('0x4')](0x0);var events={'afterCreate':_0xf1fa('0x5'),'afterUpdate':_0xf1fa('0x6'),'afterDestroy':_0xf1fa('0x7')};function emitEvent(_0x359496){return function(_0x2888f5,_0x56f7cb,_0x5131b9){_0x2888f5['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x59fea9){_0x2888f5[_0xf1fa('0x8')](_0xf1fa('0x9'),_0x59fea9['map'](function(_0x258dba){return{'id':_0x258dba['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x2888f5['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf1fa('0xa')](function(_0x27212d){_0x2888f5[_0xf1fa('0x8')]('unreadMessages',_0x27212d['length']);ChatInteractionEvents['emit'](_0x359496+':'+_0x2888f5['id'],_0x2888f5);ChatInteractionEvents[_0xf1fa('0xb')](_0x359496,_0x2888f5);_0x5131b9(null);})['catch'](_0x5131b9(null));};}for(var e in events){if(events[_0xf1fa('0xc')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index ea076fa..f679793 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 _0x1b89=['path','rimraf','exports','define','ChatInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x421725,_0x318a04){var _0x51b322=function(_0xe58018){while(--_0xe58018){_0x421725['push'](_0x421725['shift']());}};_0x51b322(++_0x318a04);}(_0x1b89,0x66));var _0x91b8=function(_0x3cb287,_0x40bcde){_0x3cb287=_0x3cb287-0x0;var _0x156532=_0x1b89[_0x3cb287];return _0x156532;};'use strict';var _=require(_0x91b8('0x0'));var util=require(_0x91b8('0x1'));var logger=require(_0x91b8('0x2'))(_0x91b8('0x3'));var moment=require('moment');var BPromise=require(_0x91b8('0x4'));var rp=require(_0x91b8('0x5'));var fs=require('fs');var path=require(_0x91b8('0x6'));var rimraf=require(_0x91b8('0x7'));var config=require('../../config/environment');var attributes=require('./chatInteraction.attributes');module[_0x91b8('0x8')]=function(_0x1a4925,_0x49b3e8){return _0x1a4925[_0x91b8('0x9')](_0x91b8('0xa'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x183f9b,_0x1b3952,_0x1827af){if(_0x183f9b[_0x91b8('0xb')](_0x91b8('0xc'))){_0x183f9b[_0x91b8('0xd')]=moment()[_0x91b8('0xe')](_0x91b8('0xf'));}_0x1827af(null,_0x183f9b);}},'charset':_0x91b8('0x10'),'collate':_0x91b8('0x11')});};
\ No newline at end of file
+var _0x2fc6=['./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x93afc8,_0x1a5c64){var _0xf769e0=function(_0x53e341){while(--_0x53e341){_0x93afc8['push'](_0x93afc8['shift']());}};_0xf769e0(++_0x1a5c64);}(_0x2fc6,0x19d));var _0x62fc=function(_0x24092c,_0x171263){_0x24092c=_0x24092c-0x0;var _0x5f2cfc=_0x2fc6[_0x24092c];return _0x5f2cfc;};'use strict';var _=require(_0x62fc('0x0'));var util=require('util');var logger=require(_0x62fc('0x1'))(_0x62fc('0x2'));var moment=require('moment');var BPromise=require(_0x62fc('0x3'));var rp=require(_0x62fc('0x4'));var fs=require('fs');var path=require(_0x62fc('0x5'));var rimraf=require(_0x62fc('0x6'));var config=require('../../config/environment');var attributes=require(_0x62fc('0x7'));module[_0x62fc('0x8')]=function(_0x328196,_0x401747){return _0x328196[_0x62fc('0x9')](_0x62fc('0xa'),attributes,{'tableName':_0x62fc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x544db7,_0x1e82fc,_0x444280){if(_0x544db7['changed'](_0x62fc('0xc'))){_0x544db7[_0x62fc('0xd')]=moment()['format'](_0x62fc('0xe'));}_0x444280(null,_0x544db7);}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index e5e3db8..e3115b6 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 _0xe33f=['error','code','ChatInteraction,\x20%s,\x20%s','message','result','UpdateChatInteraction','update','body','options','where','attributes','catch','ChatInteraction','addTags','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','defaults','redis','localhost','./chatInteraction.socket','register','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xe33f,0x17a));var _0xfe33=function(_0x59d100,_0x2a2210){_0x59d100=_0x59d100-0x0;var _0x2773be=_0xe33f[_0x59d100];return _0x2773be;};'use strict';var _=require('lodash');var util=require(_0xfe33('0x0'));var moment=require(_0xfe33('0x1'));var BPromise=require(_0xfe33('0x2'));var rs=require(_0xfe33('0x3'));var fs=require('fs');var Redis=require(_0xfe33('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfe33('0x5'));var logger=require(_0xfe33('0x6'))('rpc');var config=require(_0xfe33('0x7'));var jayson=require(_0xfe33('0x8'));var client=jayson[_0xfe33('0x9')]['http']({'port':0x232a});config['redis']=_[_0xfe33('0xa')](config[_0xfe33('0xb')],{'host':_0xfe33('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xfe33('0xd'))[_0xfe33('0xe')](socket);function respondWithRpcPromise(_0x291eb8,_0x5cdc73,_0x4641ee){return new BPromise(function(_0x4a1c61,_0x5bd7fe){return client[_0xfe33('0xf')](_0x291eb8,_0x4641ee)[_0xfe33('0x10')](function(_0x6b9d7f){logger[_0xfe33('0x11')]('ChatInteraction,\x20%s,\x20%s',_0x5cdc73,_0xfe33('0x12'));logger[_0xfe33('0x13')](_0xfe33('0x14'),_0x5cdc73,'request\x20sent',JSON[_0xfe33('0x15')](_0x6b9d7f));if(_0x6b9d7f['error']){if(_0x6b9d7f[_0xfe33('0x16')][_0xfe33('0x17')]===0x1f4){logger['error'](_0xfe33('0x18'),_0x5cdc73,_0x6b9d7f[_0xfe33('0x16')][_0xfe33('0x19')]);return _0x5bd7fe(_0x6b9d7f[_0xfe33('0x16')]['message']);}logger['error'](_0xfe33('0x18'),_0x5cdc73,_0x6b9d7f[_0xfe33('0x16')][_0xfe33('0x19')]);return _0x4a1c61(_0x6b9d7f[_0xfe33('0x16')][_0xfe33('0x19')]);}else{logger[_0xfe33('0x11')]('ChatInteraction,\x20%s,\x20%s',_0x5cdc73,_0xfe33('0x12'));_0x4a1c61(_0x6b9d7f[_0xfe33('0x1a')][_0xfe33('0x19')]);}})['catch'](function(_0x20250d){logger[_0xfe33('0x16')](_0xfe33('0x18'),_0x5cdc73,_0x20250d);_0x5bd7fe(_0x20250d);});});}exports[_0xfe33('0x1b')]=function(_0x1e5c23){var _0x21cf11=this;return new Promise(function(_0x2d167c,_0x583e49){return db['ChatInteraction'][_0xfe33('0x1c')](_0x1e5c23[_0xfe33('0x1d')],{'raw':_0x1e5c23[_0xfe33('0x1e')]?_0x1e5c23[_0xfe33('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e5c23[_0xfe33('0x1e')]?_0x1e5c23[_0xfe33('0x1e')][_0xfe33('0x1f')]||null:null,'attributes':_0x1e5c23[_0xfe33('0x1e')]?_0x1e5c23[_0xfe33('0x1e')][_0xfe33('0x20')]||null:null,'limit':_0x1e5c23[_0xfe33('0x1e')]?_0x1e5c23[_0xfe33('0x1e')]['limit']||null:null})[_0xfe33('0x10')](function(_0xddc6a){logger[_0xfe33('0x11')]('UpdateChatInteraction',_0x1e5c23);logger[_0xfe33('0x13')](_0xfe33('0x1b'),_0x1e5c23,JSON[_0xfe33('0x15')](_0xddc6a));_0x2d167c(_0xddc6a);})[_0xfe33('0x21')](function(_0x4d2c38){logger[_0xfe33('0x16')](_0xfe33('0x1b'),_0x4d2c38['message'],_0x1e5c23);_0x583e49(_0x21cf11['error'](0x1f4,_0x4d2c38[_0xfe33('0x19')]));});});};exports['AddTagsToChatInteraction']=function(_0x3bf189){return new Promise(function(_0x59cbda,_0x10fa53){return db[_0xfe33('0x22')]['find']({'where':_0x3bf189['options']?_0x3bf189[_0xfe33('0x1e')][_0xfe33('0x1f')]||null:null})['then'](function(_0x2914ef){if(_0x2914ef){return _0x2914ef[_0xfe33('0x23')](_0x3bf189[_0xfe33('0x1d')][_0xfe33('0x24')],_[_0xfe33('0x25')](_0x3bf189['body'],[_0xfe33('0x24'),'id'])||{});}})[_0xfe33('0x26')](function(_0x1f6a3f){logger[_0xfe33('0x11')]('AddTags',_0x3bf189);logger[_0xfe33('0x13')](_0xfe33('0x27'),_0x3bf189,JSON['stringify'](_0x1f6a3f));_0x59cbda(_0x1f6a3f);})[_0xfe33('0x21')](function(_0x277cd1){logger[_0xfe33('0x16')](_0xfe33('0x27'),_0x277cd1[_0xfe33('0x19')],_0x3bf189);_0x10fa53(_this['error'](0x1f4,_0x277cd1['message']));});});};
\ No newline at end of file
+var _0xefc5=['body','options','where','attributes','limit','addTags','ids','omit','spread','AddTags','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','./chatInteraction.socket','register','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','UpdateChatInteraction','ChatInteraction','update'];(function(_0x3ed5cc,_0x576f9a){var _0x301449=function(_0x11429c){while(--_0x11429c){_0x3ed5cc['push'](_0x3ed5cc['shift']());}};_0x301449(++_0x576f9a);}(_0xefc5,0xef));var _0x5efc=function(_0xd0cd0b,_0x490956){_0xd0cd0b=_0xd0cd0b-0x0;var _0x59cced=_0xefc5[_0xd0cd0b];return _0x59cced;};'use strict';var _=require(_0x5efc('0x0'));var util=require(_0x5efc('0x1'));var moment=require(_0x5efc('0x2'));var BPromise=require('bluebird');var rs=require(_0x5efc('0x3'));var fs=require('fs');var Redis=require(_0x5efc('0x4'));var db=require(_0x5efc('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5efc('0x6'))(_0x5efc('0x7'));var config=require(_0x5efc('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x5efc('0x9')]=_[_0x5efc('0xa')](config[_0x5efc('0x9')],{'host':_0x5efc('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5efc('0x9')]));require(_0x5efc('0xc'))[_0x5efc('0xd')](socket);function respondWithRpcPromise(_0x389002,_0x2bf501,_0x1b54e6){return new BPromise(function(_0x290d9b,_0x3a5fd8){return client[_0x5efc('0xe')](_0x389002,_0x1b54e6)[_0x5efc('0xf')](function(_0x4a1dc6){logger['info'](_0x5efc('0x10'),_0x2bf501,_0x5efc('0x11'));logger[_0x5efc('0x12')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x2bf501,_0x5efc('0x11'),JSON[_0x5efc('0x13')](_0x4a1dc6));if(_0x4a1dc6[_0x5efc('0x14')]){if(_0x4a1dc6['error'][_0x5efc('0x15')]===0x1f4){logger[_0x5efc('0x14')](_0x5efc('0x10'),_0x2bf501,_0x4a1dc6['error'][_0x5efc('0x16')]);return _0x3a5fd8(_0x4a1dc6[_0x5efc('0x14')][_0x5efc('0x16')]);}logger[_0x5efc('0x14')](_0x5efc('0x10'),_0x2bf501,_0x4a1dc6['error'][_0x5efc('0x16')]);return _0x290d9b(_0x4a1dc6['error'][_0x5efc('0x16')]);}else{logger[_0x5efc('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x2bf501,_0x5efc('0x11'));_0x290d9b(_0x4a1dc6['result']['message']);}})['catch'](function(_0x5c1ade){logger['error'](_0x5efc('0x10'),_0x2bf501,_0x5c1ade);_0x3a5fd8(_0x5c1ade);});});}exports[_0x5efc('0x18')]=function(_0x5dfd11){var _0x248723=this;return new Promise(function(_0x546e40,_0x46879c){return db[_0x5efc('0x19')][_0x5efc('0x1a')](_0x5dfd11[_0x5efc('0x1b')],{'raw':_0x5dfd11['options']?_0x5dfd11[_0x5efc('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5dfd11[_0x5efc('0x1c')]?_0x5dfd11[_0x5efc('0x1c')][_0x5efc('0x1d')]||null:null,'attributes':_0x5dfd11[_0x5efc('0x1c')]?_0x5dfd11[_0x5efc('0x1c')][_0x5efc('0x1e')]||null:null,'limit':_0x5dfd11[_0x5efc('0x1c')]?_0x5dfd11[_0x5efc('0x1c')][_0x5efc('0x1f')]||null:null})[_0x5efc('0xf')](function(_0x5da14a){logger[_0x5efc('0x17')](_0x5efc('0x18'),_0x5dfd11);logger[_0x5efc('0x12')]('UpdateChatInteraction',_0x5dfd11,JSON[_0x5efc('0x13')](_0x5da14a));_0x546e40(_0x5da14a);})['catch'](function(_0x3f6d26){logger[_0x5efc('0x14')](_0x5efc('0x18'),_0x3f6d26[_0x5efc('0x16')],_0x5dfd11);_0x46879c(_0x248723[_0x5efc('0x14')](0x1f4,_0x3f6d26[_0x5efc('0x16')]));});});};exports['AddTagsToChatInteraction']=function(_0x4ffa09){return new Promise(function(_0x5ad668,_0x356ece){return db[_0x5efc('0x19')]['find']({'where':_0x4ffa09[_0x5efc('0x1c')]?_0x4ffa09[_0x5efc('0x1c')][_0x5efc('0x1d')]||null:null})['then'](function(_0x683a35){if(_0x683a35){return _0x683a35[_0x5efc('0x20')](_0x4ffa09[_0x5efc('0x1b')][_0x5efc('0x21')],_[_0x5efc('0x22')](_0x4ffa09[_0x5efc('0x1b')],[_0x5efc('0x21'),'id'])||{});}})[_0x5efc('0x23')](function(_0x2180f7){logger[_0x5efc('0x17')](_0x5efc('0x24'),_0x4ffa09);logger[_0x5efc('0x12')](_0x5efc('0x24'),_0x4ffa09,JSON[_0x5efc('0x13')](_0x2180f7));_0x5ad668(_0x2180f7);})[_0x5efc('0x25')](function(_0x585067){logger[_0x5efc('0x14')](_0x5efc('0x24'),_0x585067[_0x5efc('0x16')],_0x4ffa09);_0x356ece(_this[_0x5efc('0x14')](0x1f4,_0x585067[_0x5efc('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 321595c..95f8ed8 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 _0xa16e=['emit','removeListener','register','length','chatInteraction:','save','remove','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa16e,0xcd));var _0xea16=function(_0x425d83,_0x236601){_0x425d83=_0x425d83-0x0;var _0x344b8b=_0xa16e[_0x425d83];return _0x344b8b;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0xea16('0x0'),_0xea16('0x1'),_0xea16('0x2')];function createListener(_0x4d9f1a,_0x318918){return function(_0x23376c){_0x318918[_0xea16('0x3')](_0x4d9f1a,_0x23376c);};}function removeListener(_0xe6413e,_0x49e443){return function(){ChatInteractionEvents[_0xea16('0x4')](_0xe6413e,_0x49e443);};}exports[_0xea16('0x5')]=function(_0x2c06b0){for(var _0x491b60=0x0,_0x4bc088=events[_0xea16('0x6')];_0x491b60<_0x4bc088;_0x491b60++){var _0x267e29=events[_0x491b60];var _0x374e4d=createListener(_0xea16('0x7')+_0x267e29,_0x2c06b0);ChatInteractionEvents['on'](_0x267e29,_0x374e4d);}};
\ No newline at end of file
+var _0x2168=['register','length','chatInteraction:','save','remove','update','emit','removeListener'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2168,0x15b));var _0x8216=function(_0x88b5f7,_0x413271){_0x88b5f7=_0x88b5f7-0x0;var _0x52b7cc=_0x2168[_0x88b5f7];return _0x52b7cc;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x8216('0x0'),_0x8216('0x1'),_0x8216('0x2')];function createListener(_0x10dcf5,_0x3b1393){return function(_0x434c3f){_0x3b1393[_0x8216('0x3')](_0x10dcf5,_0x434c3f);};}function removeListener(_0x1b7bca,_0x5c5cb7){return function(){ChatInteractionEvents[_0x8216('0x4')](_0x1b7bca,_0x5c5cb7);};}exports[_0x8216('0x5')]=function(_0x777c10){for(var _0x145f39=0x0,_0x436c67=events[_0x8216('0x6')];_0x145f39<_0x436c67;_0x145f39++){var _0x16edb3=events[_0x145f39];var _0x4d43ed=createListener(_0x8216('0x7')+_0x16edb3,_0x777c10);ChatInteractionEvents['on'](_0x16edb3,_0x4d43ed);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 6787b15..e634715 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 _0x8892=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','index','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','/:id/my_messages','post','isAuthenticated','create','/:id/vidaoo','diskStorage','root','format','%s-%s','now','originalname','/:id/attachment_upload','single','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x8892,0xfa));var _0x2889=function(_0x4f2e46,_0x3bd517){_0x4f2e46=_0x4f2e46-0x0;var _0x4f8b04=_0x8892[_0x4f2e46];return _0x4f8b04;};'use strict';var multer=require(_0x2889('0x0'));var util=require('util');var path=require(_0x2889('0x1'));var timeout=require(_0x2889('0x2'));var express=require(_0x2889('0x3'));var router=express[_0x2889('0x4')]();var fs_extra=require(_0x2889('0x5'));var auth=require(_0x2889('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2889('0x7'));var controller=require(_0x2889('0x8'));router[_0x2889('0x9')]('/',auth['isAuthenticated'](),controller[_0x2889('0xa')]);router['get'](_0x2889('0xb'),auth['isAuthenticated'](),controller[_0x2889('0xc')]);router[_0x2889('0x9')](_0x2889('0xd'),auth[_0x2889('0xe')](),controller[_0x2889('0xf')]);router[_0x2889('0x9')](_0x2889('0x10'),auth[_0x2889('0xe')](),controller[_0x2889('0x11')]);router[_0x2889('0x9')](_0x2889('0x12'),auth['isAuthenticated'](),controller['getMessages']);router['get'](_0x2889('0x13'),auth[_0x2889('0xe')](),controller['getMyMessages']);router[_0x2889('0x9')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0x2889('0x14')]('/',auth[_0x2889('0x15')](),controller[_0x2889('0x16')]);router[_0x2889('0x14')](_0x2889('0x17'),auth['isAuthenticated'](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x2889('0x18')]({'destination':function(_0x291089,_0x22a548,_0x415ec5){_0x415ec5(null,path['join'](config[_0x2889('0x19')],'server/files/attachments/'));},'filename':function(_0x2eb0c6,_0x3f1d16,_0xab09bf){_0xab09bf(null,util[_0x2889('0x1a')](_0x2889('0x1b'),Date[_0x2889('0x1c')](),_0x3f1d16[_0x2889('0x1d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2889('0x14')](_0x2889('0x1e'),upload[_0x2889('0x1f')]('file'),controller['attachmentUpload']);router[_0x2889('0x14')](_0x2889('0x12'),auth['isChatInteractionAuthorized'](),controller[_0x2889('0x20')]);router['post'](_0x2889('0x21'),auth['isAuthenticated'](),interaction[_0x2889('0x22')](_0x2889('0x23'),_0x2889('0x24')),controller[_0x2889('0x25')]);router[_0x2889('0x26')](_0x2889('0xd'),auth[_0x2889('0x15')](),interaction['tracked']('chat',_0x2889('0x27')),controller[_0x2889('0x28')]);router[_0x2889('0x26')](_0x2889('0x29'),controller[_0x2889('0x2a')]);router[_0x2889('0x26')]('/:id/abandon',auth[_0x2889('0xe')](),controller[_0x2889('0x2b')]);router['put'](_0x2889('0x2c'),controller[_0x2889('0x2d')]);router[_0x2889('0x2e')]('/:id',auth[_0x2889('0x15')](),interaction[_0x2889('0x22')](_0x2889('0x23'),_0x2889('0x2f')),controller[_0x2889('0x30')]);router[_0x2889('0x2e')](_0x2889('0x21'),auth[_0x2889('0x15')](),controller[_0x2889('0x31')]);module['exports']=router;
\ No newline at end of file
+var _0xff3c=['chatinteraction:destroy','destroy','removeTags','exports','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','/describe','isAuthenticated','describe','/:id','isChatInteractionAuthorized','show','attachmentDownload','/:id/messages','/:id/my_messages','getMyMessages','create','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','update','/:id/abandon','close','delete'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xff3c,0x12a));var _0xcff3=function(_0xf32741,_0x43ce1c){_0xf32741=_0xf32741-0x0;var _0x9810e5=_0xff3c[_0xf32741];return _0x9810e5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcff3('0x0'));var timeout=require(_0xcff3('0x1'));var express=require('express');var router=express[_0xcff3('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xcff3('0x3'));var interaction=require(_0xcff3('0x4'));var config=require('../../config/environment');var controller=require(_0xcff3('0x5'));router[_0xcff3('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0xcff3('0x6')](_0xcff3('0x7'),auth[_0xcff3('0x8')](),controller[_0xcff3('0x9')]);router['get'](_0xcff3('0xa'),auth[_0xcff3('0xb')](),controller[_0xcff3('0xc')]);router[_0xcff3('0x6')]('/:id/attachment_download',auth[_0xcff3('0xb')](),controller[_0xcff3('0xd')]);router[_0xcff3('0x6')](_0xcff3('0xe'),auth[_0xcff3('0x8')](),controller['getMessages']);router['get'](_0xcff3('0xf'),auth[_0xcff3('0xb')](),controller[_0xcff3('0x10')]);router[_0xcff3('0x6')]('/:id/download',auth[_0xcff3('0x8')](),controller['download']);router['post']('/',auth[_0xcff3('0x8')](),controller[_0xcff3('0x11')]);router[_0xcff3('0x12')](_0xcff3('0x13'),auth[_0xcff3('0x8')](),controller[_0xcff3('0x14')]);var upload=multer({'storage':multer[_0xcff3('0x15')]({'destination':function(_0x48a382,_0x4be9e8,_0x5eb60b){_0x5eb60b(null,path[_0xcff3('0x16')](config[_0xcff3('0x17')],_0xcff3('0x18')));},'filename':function(_0x308718,_0x1970ce,_0x18b57e){_0x18b57e(null,util[_0xcff3('0x19')](_0xcff3('0x1a'),Date[_0xcff3('0x1b')](),_0x1970ce[_0xcff3('0x1c')][_0xcff3('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xcff3('0x1e'),upload[_0xcff3('0x1f')](_0xcff3('0x20')),controller[_0xcff3('0x21')]);router[_0xcff3('0x12')]('/:id/messages',auth[_0xcff3('0xb')](),controller[_0xcff3('0x22')]);router[_0xcff3('0x12')](_0xcff3('0x23'),auth[_0xcff3('0x8')](),interaction[_0xcff3('0x24')](_0xcff3('0x25'),_0xcff3('0x26')),controller[_0xcff3('0x27')]);router[_0xcff3('0x28')](_0xcff3('0xa'),auth[_0xcff3('0x8')](),interaction[_0xcff3('0x24')](_0xcff3('0x25'),'chatinteraction:update'),controller[_0xcff3('0x29')]);router[_0xcff3('0x28')]('/:id/custom_update',controller['customUpdate']);router['put'](_0xcff3('0x2a'),auth[_0xcff3('0xb')](),controller['abandon']);router[_0xcff3('0x28')]('/:id/close',controller[_0xcff3('0x2b')]);router[_0xcff3('0x2c')](_0xcff3('0xa'),auth[_0xcff3('0x8')](),interaction[_0xcff3('0x24')](_0xcff3('0x25'),_0xcff3('0x2d')),controller[_0xcff3('0x2e')]);router[_0xcff3('0x2c')](_0xcff3('0x23'),auth['isAuthenticated'](),controller[_0xcff3('0x2f')]);module[_0xcff3('0x30')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 7606c30..9533b34 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 _0x2938=['sequelize','exports','TEXT','BOOLEAN','INTEGER'];(function(_0xe37bb4,_0x21a453){var _0x53b9db=function(_0xd7851){while(--_0xd7851){_0xe37bb4['push'](_0xe37bb4['shift']());}};_0x53b9db(++_0x21a453);}(_0x2938,0xe1));var _0x8293=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x2938[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0x8293('0x0'));module[_0x8293('0x1')]={'body':{'type':Sequelize[_0x8293('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x8293('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x8293('0x4')]}};
\ No newline at end of file
+var _0xd77d=['sequelize','exports','TEXT','medium','BOOLEAN','INTEGER'];(function(_0x1b76e6,_0x598520){var _0x333b53=function(_0x106e6a){while(--_0x106e6a){_0x1b76e6['push'](_0x1b76e6['shift']());}};_0x333b53(++_0x598520);}(_0xd77d,0x198));var _0xdd77=function(_0x260ea2,_0x545ddb){_0x260ea2=_0x260ea2-0x0;var _0x3227d0=_0xd77d[_0x260ea2];return _0x3227d0;};'use strict';var Sequelize=require(_0xdd77('0x0'));module[_0xdd77('0x1')]={'body':{'type':Sequelize[_0xdd77('0x2')](_0xdd77('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xdd77('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xdd77('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 375d322..37dad4b 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 _0xeafe=['sendStatus','error','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','limit','order','sort','where','filter','VIRTUAL','merge','options','ChatInternalMessage','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','get','lastMessageAt','createdAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','getUsers','agent','admin','user','fullname','role','online','lastLoginAt','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','push','ToId','read','-createdAt','all','eml-format','zip-dir','moment','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','end','status','json','offset','undefined','count','set','Content-Range','reject','save','update','then','destroy'];(function(_0x31adf9,_0x511868){var _0x4412b5=function(_0x192d84){while(--_0x192d84){_0x31adf9['push'](_0x31adf9['shift']());}};_0x4412b5(++_0x511868);}(_0xeafe,0x1e3));var _0xeeaf=function(_0x394ac6,_0x3cf2e0){_0x394ac6=_0x394ac6-0x0;var _0x58be47=_0xeafe[_0x394ac6];return _0x58be47;};'use strict';var emlformat=require(_0xeeaf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xeeaf('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xeeaf('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xeeaf('0x3'));var util=require('util');var path=require(_0xeeaf('0x4'));var sox=require(_0xeeaf('0x5'));var csv=require(_0xeeaf('0x6'));var ejs=require(_0xeeaf('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xeeaf('0x8'));var crypto=require(_0xeeaf('0x9'));var jsforce=require(_0xeeaf('0xa'));var deskjs=require(_0xeeaf('0xb'));var toCsv=require(_0xeeaf('0x6'));var querystring=require(_0xeeaf('0xc'));var Papa=require(_0xeeaf('0xd'));var Redis=require(_0xeeaf('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xeeaf('0xf'));var as=require(_0xeeaf('0x10'));var hardwareService=require(_0xeeaf('0x11'));var logger=require(_0xeeaf('0x12'))(_0xeeaf('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xeeaf('0x14'))['db'];config[_0xeeaf('0x15')]=_['defaults'](config['redis'],{'host':_0xeeaf('0x16'),'port':0x18eb});var socket=require(_0xeeaf('0x17'))(new Redis(config[_0xeeaf('0x15')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithStatusCode(_0x59332e,_0x102b02){_0x102b02=_0x102b02||0xcc;return function(_0x503f30){if(_0x503f30){return _0x59332e['sendStatus'](_0x102b02);}return _0x59332e['status'](_0x102b02)[_0xeeaf('0x18')]();};}function respondWithResult(_0x24ec9a,_0x302c2a){_0x302c2a=_0x302c2a||0xc8;return function(_0x3b0f8c){if(_0x3b0f8c){return _0x24ec9a[_0xeeaf('0x19')](_0x302c2a)[_0xeeaf('0x1a')](_0x3b0f8c);}};}function respondWithFilteredResult(_0x3aa19d,_0x1b1b01){return function(_0x5488c1){if(_0x5488c1){var _0x288139=typeof _0x1b1b01[_0xeeaf('0x1b')]===_0xeeaf('0x1c')&&typeof _0x1b1b01['limit']===_0xeeaf('0x1c');var _0x394f82=_0x5488c1[_0xeeaf('0x1d')];var _0x1082f5=_0x288139?0x0:_0x1b1b01[_0xeeaf('0x1b')];var _0x50ac03=_0x288139?_0x5488c1[_0xeeaf('0x1d')]:_0x1b1b01['offset']+_0x1b1b01['limit'];var _0x378e09;if(_0x50ac03>=_0x394f82){_0x50ac03=_0x394f82;_0x378e09=0xc8;}else{_0x378e09=0xce;}_0x3aa19d[_0xeeaf('0x19')](_0x378e09);return _0x3aa19d[_0xeeaf('0x1e')](_0xeeaf('0x1f'),_0x1082f5+'-'+_0x50ac03+'/'+_0x394f82)[_0xeeaf('0x1a')](_0x5488c1);}return null;};}function patchUpdates(_0x3278ff){return function(_0x3167ff){try{jsonpatch['apply'](_0x3167ff,_0x3278ff,!![]);}catch(_0x58dc67){return BPromise[_0xeeaf('0x20')](_0x58dc67);}return _0x3167ff[_0xeeaf('0x21')]();};}function saveUpdates(_0x435e90,_0x20fa31){return function(_0x1b4fff){if(_0x1b4fff){return _0x1b4fff[_0xeeaf('0x22')](_0x435e90)[_0xeeaf('0x23')](function(_0x262174){return _0x262174;});}return null;};}function removeEntity(_0x4df4c3,_0x5711ce){return function(_0x1fc4d1){if(_0x1fc4d1){return _0x1fc4d1[_0xeeaf('0x24')]()[_0xeeaf('0x23')](function(){_0x4df4c3[_0xeeaf('0x19')](0xcc)[_0xeeaf('0x18')]();});}};}function handleEntityNotFound(_0x5b5171,_0x1f11f1){return function(_0x5ea7be){if(!_0x5ea7be){_0x5b5171[_0xeeaf('0x25')](0x194);}return _0x5ea7be;};}function handleError(_0x176bef,_0x4a9bfe){_0x4a9bfe=_0x4a9bfe||0x1f4;return function(_0x5ef2f6){logger[_0xeeaf('0x26')](_0x5ef2f6['stack']);if(_0x5ef2f6[_0xeeaf('0x27')]){delete _0x5ef2f6[_0xeeaf('0x27')];}_0x176bef[_0xeeaf('0x19')](_0x4a9bfe)[_0xeeaf('0x28')](_0x5ef2f6);};}exports[_0xeeaf('0x29')]=function(_0x4aa86d,_0x2d2bd2){var _0x52c85f={},_0x1adb45={},_0x4f9141={'count':0x0,'rows':[]};var _0x1d311f=_['map'](db['ChatInternalMessage'][_0xeeaf('0x2a')],function(_0x55f06c){return{'name':_0x55f06c[_0xeeaf('0x2b')],'type':_0x55f06c[_0xeeaf('0x2c')][_0xeeaf('0x2d')]};});_0x1adb45[_0xeeaf('0x2e')]=_[_0xeeaf('0x2f')](_0x1d311f,'name');_0x1adb45[_0xeeaf('0x30')]=_[_0xeeaf('0x31')](_0x4aa86d[_0xeeaf('0x30')]);_0x1adb45[_0xeeaf('0x32')]=_[_0xeeaf('0x33')](_0x1adb45['model'],_0x1adb45['query']);_0x52c85f[_0xeeaf('0x34')]=_['intersection'](_0x1adb45[_0xeeaf('0x2e')],qs[_0xeeaf('0x35')](_0x4aa86d['query']['fields']));_0x52c85f[_0xeeaf('0x34')]=_0x52c85f[_0xeeaf('0x34')][_0xeeaf('0x36')]?_0x52c85f[_0xeeaf('0x34')]:_0x1adb45[_0xeeaf('0x2e')];if(!_0x4aa86d['query']['hasOwnProperty']('nolimit')){_0x52c85f[_0xeeaf('0x37')]=qs[_0xeeaf('0x37')](_0x4aa86d[_0xeeaf('0x30')][_0xeeaf('0x37')]);_0x52c85f['offset']=qs[_0xeeaf('0x1b')](_0x4aa86d['query']['offset']);}_0x52c85f[_0xeeaf('0x38')]=qs[_0xeeaf('0x39')](_0x4aa86d[_0xeeaf('0x30')][_0xeeaf('0x39')]);_0x52c85f[_0xeeaf('0x3a')]=qs[_0xeeaf('0x32')](_['pick'](_0x4aa86d[_0xeeaf('0x30')],_0x1adb45[_0xeeaf('0x32')]),_0x1d311f);if(_0x4aa86d[_0xeeaf('0x30')][_0xeeaf('0x3b')]){_0x52c85f[_0xeeaf('0x3a')]=_['merge'](_0x52c85f[_0xeeaf('0x3a')],{'$or':_[_0xeeaf('0x2f')](_0x1d311f,function(_0x424efc){if(_0x424efc[_0xeeaf('0x2c')]!==_0xeeaf('0x3c')){var _0x7d392a={};_0x7d392a[_0x424efc[_0xeeaf('0x27')]]={'$like':'%'+_0x4aa86d[_0xeeaf('0x30')][_0xeeaf('0x3b')]+'%'};return _0x7d392a;}})});}_0x52c85f=_[_0xeeaf('0x3d')]({},_0x52c85f,_0x4aa86d[_0xeeaf('0x3e')]);var _0x2320a0={'where':_0x52c85f[_0xeeaf('0x3a')]};return db[_0xeeaf('0x3f')]['count'](_0x2320a0)[_0xeeaf('0x23')](function(_0x37fcd0){_0x4f9141[_0xeeaf('0x1d')]=_0x37fcd0;if(_0x4aa86d[_0xeeaf('0x30')][_0xeeaf('0x40')]){_0x52c85f[_0xeeaf('0x41')]=[{'all':!![]}];}return db[_0xeeaf('0x3f')][_0xeeaf('0x42')](_0x52c85f);})[_0xeeaf('0x23')](function(_0x1b6775){_0x4f9141[_0xeeaf('0x43')]=_0x1b6775;return _0x4f9141;})[_0xeeaf('0x23')](respondWithFilteredResult(_0x2d2bd2,_0x52c85f))[_0xeeaf('0x44')](handleError(_0x2d2bd2,null));};exports[_0xeeaf('0x45')]=function(_0x4bbb65,_0x1e1995){var _0x58541e={'raw':!![],'where':{'id':_0x4bbb65[_0xeeaf('0x46')]['id']}},_0x41cad5={};_0x41cad5[_0xeeaf('0x2e')]=_[_0xeeaf('0x31')](db['ChatInternalMessage'][_0xeeaf('0x2a')]);_0x41cad5[_0xeeaf('0x30')]=_[_0xeeaf('0x31')](_0x4bbb65['query']);_0x41cad5['filters']=_[_0xeeaf('0x33')](_0x41cad5[_0xeeaf('0x2e')],_0x41cad5['query']);_0x58541e[_0xeeaf('0x34')]=_[_0xeeaf('0x33')](_0x41cad5['model'],qs['fields'](_0x4bbb65[_0xeeaf('0x30')][_0xeeaf('0x35')]));_0x58541e[_0xeeaf('0x34')]=_0x58541e[_0xeeaf('0x34')][_0xeeaf('0x36')]?_0x58541e['attributes']:_0x41cad5[_0xeeaf('0x2e')];if(_0x4bbb65['query'][_0xeeaf('0x40')]){_0x58541e['include']=[{'all':!![]}];}_0x58541e=_[_0xeeaf('0x3d')]({},_0x58541e,_0x4bbb65[_0xeeaf('0x3e')]);return db['ChatInternalMessage'][_0xeeaf('0x47')](_0x58541e)['then'](handleEntityNotFound(_0x1e1995,null))[_0xeeaf('0x23')](respondWithResult(_0x1e1995,null))[_0xeeaf('0x44')](handleError(_0x1e1995,null));};exports[_0xeeaf('0x48')]=function(_0x1da369,_0xbe4f0d){return db[_0xeeaf('0x3f')][_0xeeaf('0x48')](_0x1da369['body'],{})[_0xeeaf('0x23')](respondWithResult(_0xbe4f0d,0xc9))[_0xeeaf('0x44')](handleError(_0xbe4f0d,null));};exports[_0xeeaf('0x22')]=function(_0x5a5ea5,_0xd90447){if(_0x5a5ea5['body']['id']){delete _0x5a5ea5[_0xeeaf('0x49')]['id'];}return db[_0xeeaf('0x3f')]['find']({'where':{'id':_0x5a5ea5[_0xeeaf('0x46')]['id']}})['then'](handleEntityNotFound(_0xd90447,null))[_0xeeaf('0x23')](saveUpdates(_0x5a5ea5['body'],null))[_0xeeaf('0x23')](respondWithResult(_0xd90447,null))[_0xeeaf('0x44')](handleError(_0xd90447,null));};exports[_0xeeaf('0x24')]=function(_0x1be4a0,_0x38a96e){return db[_0xeeaf('0x3f')][_0xeeaf('0x47')]({'where':{'id':_0x1be4a0['params']['id']}})[_0xeeaf('0x23')](handleEntityNotFound(_0x38a96e,null))[_0xeeaf('0x23')](removeEntity(_0x38a96e,null))[_0xeeaf('0x44')](handleError(_0x38a96e,null));};exports[_0xeeaf('0x4a')]=function(_0xb65196,_0x3d7191){return db[_0xeeaf('0x3f')][_0xeeaf('0x4a')]()[_0xeeaf('0x23')](respondWithResult(_0x3d7191,null))['catch'](handleError(_0x3d7191,null));};function wrapUser(_0x26d5ba){return function(_0x1c95e0){var _0x1a629c=_0x26d5ba[_0xeeaf('0x4b')]({'plain':!![]});_0x1a629c['messages']=[];if(_0x1c95e0){_0x1a629c[_0xeeaf('0x4c')]=_0x1c95e0[_0xeeaf('0x4d')];_0x1a629c[_0xeeaf('0x4e')]=_0x1c95e0;}else{_0x1a629c['lastMessageAt']=moment(0x0)['format'](_0xeeaf('0x4f'));_0x1a629c[_0xeeaf('0x4e')]={};}return _0x1a629c;};}exports[_0xeeaf('0x50')]=function(_0x4ea5f6,_0x3fd18b,_0x23f8dd){var _0x2be0e4=[];return db['User']['findAll']({'where':{'role':[_0xeeaf('0x51'),_0xeeaf('0x52'),_0xeeaf('0x53')]},'attributes':['id',_0xeeaf('0x54'),'name',_0xeeaf('0x55'),'userpic','internal',_0xeeaf('0x56'),_0xeeaf('0x57'),'allowmessenger',_0xeeaf('0x58')],'order':qs[_0xeeaf('0x39')](_0xeeaf('0x59')),'include':[{'model':db[_0xeeaf('0x5a')],'as':_0xeeaf('0x5b'),'attributes':['id',_0xeeaf('0x27'),_0xeeaf('0x2c')],'through':{'attributes':[]}}]})[_0xeeaf('0x23')](function(_0x19e658){if(_0x19e658){var _0x3e5d80=_0x4ea5f6[_0xeeaf('0x53')][_0xeeaf('0x4b')]({'plain':!![]});if(!_0x3e5d80)throw new Error(_0xeeaf('0x5c'));if(_0x3e5d80[_0xeeaf('0x55')]===_0xeeaf('0x53')){return db[_0xeeaf('0x5d')][_0xeeaf('0x47')]({'where':{'name':_0xeeaf('0x5e'),'userProfileId':_0x3e5d80[_0xeeaf('0x5f')]},'raw':!![]})['then'](function(_0x3a26aa){if(_0x3a26aa){if(_0x3a26aa[_0xeeaf('0x60')]===0x0){return db[_0xeeaf('0x61')][_0xeeaf('0x42')]({'where':{'sectionId':_0x3a26aa['id']},'raw':!![]})['then'](function(_0x3c8294){var _0x54bd27=[];if(_[_0xeeaf('0x62')](_0x3c8294)){_0x54bd27=_['filter'](_0x19e658,function(_0x3ea501){if(_0x3ea501[_0xeeaf('0x55')]!==_0xeeaf('0x51')){return _0x3ea501;}});return _0x54bd27;}else{for(var _0x4b26a8=0x0;_0x4b26a8<_0x19e658[_0xeeaf('0x36')];_0x4b26a8++){var _0x43288c=_0x19e658[_0x4b26a8];if(_0x43288c[_0xeeaf('0x55')]==='agent'){var _0x5eb79d=_[_0xeeaf('0x47')](_0x3c8294,function(_0x334083){return _0x334083['resourceId']===_0x43288c['id'];});if(_0x5eb79d)_0x54bd27[_0xeeaf('0x63')](_0x43288c);}else{_0x54bd27['push'](_0x43288c);}}return _0x54bd27;}});}else{return _0x19e658;}}else{var _0x452bd0=_[_0xeeaf('0x3b')](_0x19e658,function(_0x34f1fd){if(_0x34f1fd[_0xeeaf('0x55')]!==_0xeeaf('0x51')){return _0x34f1fd;}});return _0x452bd0;}});}else{return _0x19e658;}}})['then'](function(_0x56b569){var _0x129af2=[];if(_0x56b569){_0x2be0e4=_0x56b569;for(var _0x1fba24=0x0;_0x1fba24<_0x56b569[_0xeeaf('0x36')];_0x1fba24+=0x1){_0x2be0e4[_0x1fba24]['messages']=[];_0x129af2[_0xeeaf('0x63')](db[_0xeeaf('0x3f')][_0xeeaf('0x47')]({'where':{'FromId':[_0x4ea5f6[_0xeeaf('0x53')]['id'],_0x56b569[_0x1fba24]['id']],'ToId':[_0x4ea5f6[_0xeeaf('0x53')]['id'],_0x56b569[_0x1fba24]['id']],'ChatGroupId':null},'attributes':['id',_0xeeaf('0x4d'),'FromId',_0xeeaf('0x64'),_0xeeaf('0x65'),_0xeeaf('0x49')],'order':qs['sort'](_0xeeaf('0x66')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xeeaf('0x23')](wrapUser(_0x56b569[_0x1fba24])));}return BPromise[_0xeeaf('0x67')](_0x129af2);}return[];})[_0xeeaf('0x23')](function(_0x3dd37c){return{'rows':_0x3dd37c,'count':_0x3dd37c[_0xeeaf('0x36')]};})[_0xeeaf('0x23')](respondWithResult(_0x3fd18b,null))[_0xeeaf('0x44')](handleError(_0x3fd18b,null));};
\ No newline at end of file
+var _0xea65=['../../config/logger','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','sendStatus','status','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','end','error','name','send','index','rawAttributes','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','ChatInternalMessage','includeAll','include','rows','catch','show','find','create','body','params','describe','messages','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','findAll','agent','admin','user','fullname','role','userpic','internal','online','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','resourceId','push','FromId','ToId','read','-createdAt','all','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x55976e,_0x37b18c){var _0x27023a=function(_0x2923c9){while(--_0x2923c9){_0x55976e['push'](_0x55976e['shift']());}};_0x27023a(++_0x37b18c);}(_0xea65,0x141));var _0x5ea6=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xea65[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5ea6('0x0'));var jsonpatch=require(_0x5ea6('0x1'));var rp=require(_0x5ea6('0x2'));var moment=require(_0x5ea6('0x3'));var BPromise=require(_0x5ea6('0x4'));var Mustache=require('mustache');var util=require(_0x5ea6('0x5'));var path=require(_0x5ea6('0x6'));var sox=require(_0x5ea6('0x7'));var csv=require(_0x5ea6('0x8'));var ejs=require(_0x5ea6('0x9'));var fs=require('fs');var fs_extra=require(_0x5ea6('0xa'));var _=require(_0x5ea6('0xb'));var squel=require(_0x5ea6('0xc'));var crypto=require('crypto');var jsforce=require(_0x5ea6('0xd'));var deskjs=require(_0x5ea6('0xe'));var toCsv=require(_0x5ea6('0x8'));var querystring=require(_0x5ea6('0xf'));var Papa=require(_0x5ea6('0x10'));var Redis=require(_0x5ea6('0x11'));var authService=require(_0x5ea6('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5ea6('0x13'));var hardwareService=require(_0x5ea6('0x14'));var logger=require(_0x5ea6('0x15'))(_0x5ea6('0x16'));var utils=require(_0x5ea6('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x5ea6('0x18')]=_[_0x5ea6('0x19')](config[_0x5ea6('0x18')],{'host':_0x5ea6('0x1a'),'port':0x18eb});var socket=require(_0x5ea6('0x1b'))(new Redis(config[_0x5ea6('0x18')]));require(_0x5ea6('0x1c'))['register'](socket);function respondWithStatusCode(_0x570148,_0x1f0906){_0x1f0906=_0x1f0906||0xcc;return function(_0x34b2a0){if(_0x34b2a0){return _0x570148[_0x5ea6('0x1d')](_0x1f0906);}return _0x570148[_0x5ea6('0x1e')](_0x1f0906)['end']();};}function respondWithResult(_0x519a56,_0x286b21){_0x286b21=_0x286b21||0xc8;return function(_0x5e4c57){if(_0x5e4c57){return _0x519a56[_0x5ea6('0x1e')](_0x286b21)['json'](_0x5e4c57);}};}function respondWithFilteredResult(_0x11e712,_0x712c54){return function(_0x532e8b){if(_0x532e8b){var _0x4bbea5=typeof _0x712c54[_0x5ea6('0x1f')]===_0x5ea6('0x20')&&typeof _0x712c54[_0x5ea6('0x21')]===_0x5ea6('0x20');var _0x44abd4=_0x532e8b[_0x5ea6('0x22')];var _0x370b23=_0x4bbea5?0x0:_0x712c54[_0x5ea6('0x1f')];var _0x5d57f8=_0x4bbea5?_0x532e8b[_0x5ea6('0x22')]:_0x712c54[_0x5ea6('0x1f')]+_0x712c54[_0x5ea6('0x21')];var _0x2133c6;if(_0x5d57f8>=_0x44abd4){_0x5d57f8=_0x44abd4;_0x2133c6=0xc8;}else{_0x2133c6=0xce;}_0x11e712['status'](_0x2133c6);return _0x11e712['set'](_0x5ea6('0x23'),_0x370b23+'-'+_0x5d57f8+'/'+_0x44abd4)['json'](_0x532e8b);}return null;};}function patchUpdates(_0x387aae){return function(_0x559e62){try{jsonpatch[_0x5ea6('0x24')](_0x559e62,_0x387aae,!![]);}catch(_0x56c481){return BPromise['reject'](_0x56c481);}return _0x559e62[_0x5ea6('0x25')]();};}function saveUpdates(_0x12229a,_0x624c6f){return function(_0x2016cb){if(_0x2016cb){return _0x2016cb[_0x5ea6('0x26')](_0x12229a)[_0x5ea6('0x27')](function(_0x362b83){return _0x362b83;});}return null;};}function removeEntity(_0x23559a,_0x3bab8c){return function(_0x166958){if(_0x166958){return _0x166958[_0x5ea6('0x28')]()[_0x5ea6('0x27')](function(){_0x23559a[_0x5ea6('0x1e')](0xcc)[_0x5ea6('0x29')]();});}};}function handleEntityNotFound(_0x5a943f,_0x1a1c2e){return function(_0x25c711){if(!_0x25c711){_0x5a943f[_0x5ea6('0x1d')](0x194);}return _0x25c711;};}function handleError(_0x33f9d9,_0x5dd328){_0x5dd328=_0x5dd328||0x1f4;return function(_0x2c4fc8){logger[_0x5ea6('0x2a')](_0x2c4fc8['stack']);if(_0x2c4fc8[_0x5ea6('0x2b')]){delete _0x2c4fc8['name'];}_0x33f9d9[_0x5ea6('0x1e')](_0x5dd328)[_0x5ea6('0x2c')](_0x2c4fc8);};}exports[_0x5ea6('0x2d')]=function(_0x3510d2,_0x8c7431){var _0x4dde76={},_0x545ef9={},_0x2af232={'count':0x0,'rows':[]};var _0xf4f138=_['map'](db['ChatInternalMessage'][_0x5ea6('0x2e')],function(_0x7330a0){return{'name':_0x7330a0['fieldName'],'type':_0x7330a0['type'][_0x5ea6('0x2f')]};});_0x545ef9[_0x5ea6('0x30')]=_[_0x5ea6('0x31')](_0xf4f138,'name');_0x545ef9[_0x5ea6('0x32')]=_[_0x5ea6('0x33')](_0x3510d2[_0x5ea6('0x32')]);_0x545ef9[_0x5ea6('0x34')]=_[_0x5ea6('0x35')](_0x545ef9['model'],_0x545ef9[_0x5ea6('0x32')]);_0x4dde76[_0x5ea6('0x36')]=_[_0x5ea6('0x35')](_0x545ef9['model'],qs[_0x5ea6('0x37')](_0x3510d2[_0x5ea6('0x32')][_0x5ea6('0x37')]));_0x4dde76[_0x5ea6('0x36')]=_0x4dde76[_0x5ea6('0x36')][_0x5ea6('0x38')]?_0x4dde76['attributes']:_0x545ef9[_0x5ea6('0x30')];if(!_0x3510d2['query'][_0x5ea6('0x39')](_0x5ea6('0x3a'))){_0x4dde76[_0x5ea6('0x21')]=qs[_0x5ea6('0x21')](_0x3510d2[_0x5ea6('0x32')][_0x5ea6('0x21')]);_0x4dde76[_0x5ea6('0x1f')]=qs[_0x5ea6('0x1f')](_0x3510d2['query'][_0x5ea6('0x1f')]);}_0x4dde76[_0x5ea6('0x3b')]=qs[_0x5ea6('0x3c')](_0x3510d2[_0x5ea6('0x32')][_0x5ea6('0x3c')]);_0x4dde76[_0x5ea6('0x3d')]=qs[_0x5ea6('0x34')](_[_0x5ea6('0x3e')](_0x3510d2['query'],_0x545ef9[_0x5ea6('0x34')]),_0xf4f138);if(_0x3510d2[_0x5ea6('0x32')][_0x5ea6('0x3f')]){_0x4dde76[_0x5ea6('0x3d')]=_['merge'](_0x4dde76[_0x5ea6('0x3d')],{'$or':_[_0x5ea6('0x31')](_0xf4f138,function(_0x1e71ef){if(_0x1e71ef[_0x5ea6('0x40')]!==_0x5ea6('0x41')){var _0x35684b={};_0x35684b[_0x1e71ef[_0x5ea6('0x2b')]]={'$like':'%'+_0x3510d2[_0x5ea6('0x32')][_0x5ea6('0x3f')]+'%'};return _0x35684b;}})});}_0x4dde76=_['merge']({},_0x4dde76,_0x3510d2[_0x5ea6('0x42')]);var _0x3a480e={'where':_0x4dde76['where']};return db[_0x5ea6('0x43')][_0x5ea6('0x22')](_0x3a480e)['then'](function(_0x35919e){_0x2af232[_0x5ea6('0x22')]=_0x35919e;if(_0x3510d2['query'][_0x5ea6('0x44')]){_0x4dde76[_0x5ea6('0x45')]=[{'all':!![]}];}return db['ChatInternalMessage']['findAll'](_0x4dde76);})[_0x5ea6('0x27')](function(_0x40717c){_0x2af232[_0x5ea6('0x46')]=_0x40717c;return _0x2af232;})['then'](respondWithFilteredResult(_0x8c7431,_0x4dde76))[_0x5ea6('0x47')](handleError(_0x8c7431,null));};exports[_0x5ea6('0x48')]=function(_0x3ae0f8,_0x2f19ce){var _0x7346cb={'raw':!![],'where':{'id':_0x3ae0f8['params']['id']}},_0x1ad6b1={};_0x1ad6b1[_0x5ea6('0x30')]=_['keys'](db[_0x5ea6('0x43')]['rawAttributes']);_0x1ad6b1[_0x5ea6('0x32')]=_[_0x5ea6('0x33')](_0x3ae0f8['query']);_0x1ad6b1['filters']=_['intersection'](_0x1ad6b1[_0x5ea6('0x30')],_0x1ad6b1['query']);_0x7346cb[_0x5ea6('0x36')]=_['intersection'](_0x1ad6b1['model'],qs[_0x5ea6('0x37')](_0x3ae0f8[_0x5ea6('0x32')][_0x5ea6('0x37')]));_0x7346cb[_0x5ea6('0x36')]=_0x7346cb[_0x5ea6('0x36')][_0x5ea6('0x38')]?_0x7346cb['attributes']:_0x1ad6b1[_0x5ea6('0x30')];if(_0x3ae0f8[_0x5ea6('0x32')][_0x5ea6('0x44')]){_0x7346cb[_0x5ea6('0x45')]=[{'all':!![]}];}_0x7346cb=_['merge']({},_0x7346cb,_0x3ae0f8[_0x5ea6('0x42')]);return db['ChatInternalMessage'][_0x5ea6('0x49')](_0x7346cb)['then'](handleEntityNotFound(_0x2f19ce,null))[_0x5ea6('0x27')](respondWithResult(_0x2f19ce,null))[_0x5ea6('0x47')](handleError(_0x2f19ce,null));};exports['create']=function(_0x129db5,_0x15f92e){return db[_0x5ea6('0x43')][_0x5ea6('0x4a')](_0x129db5[_0x5ea6('0x4b')],{})[_0x5ea6('0x27')](respondWithResult(_0x15f92e,0xc9))['catch'](handleError(_0x15f92e,null));};exports[_0x5ea6('0x26')]=function(_0x5aa76c,_0x475111){if(_0x5aa76c[_0x5ea6('0x4b')]['id']){delete _0x5aa76c['body']['id'];}return db[_0x5ea6('0x43')][_0x5ea6('0x49')]({'where':{'id':_0x5aa76c[_0x5ea6('0x4c')]['id']}})['then'](handleEntityNotFound(_0x475111,null))[_0x5ea6('0x27')](saveUpdates(_0x5aa76c[_0x5ea6('0x4b')],null))[_0x5ea6('0x27')](respondWithResult(_0x475111,null))[_0x5ea6('0x47')](handleError(_0x475111,null));};exports[_0x5ea6('0x28')]=function(_0x53c3a2,_0xd4a4ae){return db['ChatInternalMessage']['find']({'where':{'id':_0x53c3a2[_0x5ea6('0x4c')]['id']}})['then'](handleEntityNotFound(_0xd4a4ae,null))['then'](removeEntity(_0xd4a4ae,null))[_0x5ea6('0x47')](handleError(_0xd4a4ae,null));};exports[_0x5ea6('0x4d')]=function(_0x346f6b,_0x1345a9){return db[_0x5ea6('0x43')][_0x5ea6('0x4d')]()[_0x5ea6('0x27')](respondWithResult(_0x1345a9,null))[_0x5ea6('0x47')](handleError(_0x1345a9,null));};function wrapUser(_0xbe33d){return function(_0x2d366d){var _0xfb49a8=_0xbe33d['get']({'plain':!![]});_0xfb49a8[_0x5ea6('0x4e')]=[];if(_0x2d366d){_0xfb49a8[_0x5ea6('0x4f')]=_0x2d366d[_0x5ea6('0x50')];_0xfb49a8['lastMessage']=_0x2d366d;}else{_0xfb49a8[_0x5ea6('0x4f')]=moment(0x0)[_0x5ea6('0x51')](_0x5ea6('0x52'));_0xfb49a8[_0x5ea6('0x53')]={};}return _0xfb49a8;};}exports[_0x5ea6('0x54')]=function(_0x37d282,_0x4fe6dc,_0x4b2e2c){var _0x47e3ef=[];return db[_0x5ea6('0x55')][_0x5ea6('0x56')]({'where':{'role':[_0x5ea6('0x57'),_0x5ea6('0x58'),_0x5ea6('0x59')]},'attributes':['id',_0x5ea6('0x5a'),'name',_0x5ea6('0x5b'),_0x5ea6('0x5c'),_0x5ea6('0x5d'),_0x5ea6('0x5e'),'lastLoginAt',_0x5ea6('0x5f'),_0x5ea6('0x60')],'order':qs[_0x5ea6('0x3c')](_0x5ea6('0x61')),'include':[{'model':db[_0x5ea6('0x62')],'as':_0x5ea6('0x63'),'attributes':['id',_0x5ea6('0x2b'),'type'],'through':{'attributes':[]}}]})[_0x5ea6('0x27')](function(_0x127a74){if(_0x127a74){var _0x47737e=_0x37d282[_0x5ea6('0x59')][_0x5ea6('0x64')]({'plain':!![]});if(!_0x47737e)throw new Error(_0x5ea6('0x65'));if(_0x47737e[_0x5ea6('0x5b')]===_0x5ea6('0x59')){return db[_0x5ea6('0x66')][_0x5ea6('0x49')]({'where':{'name':_0x5ea6('0x67'),'userProfileId':_0x47737e[_0x5ea6('0x68')]},'raw':!![]})[_0x5ea6('0x27')](function(_0x21e11e){if(_0x21e11e){if(_0x21e11e[_0x5ea6('0x69')]===0x0){return db[_0x5ea6('0x6a')]['findAll']({'where':{'sectionId':_0x21e11e['id']},'raw':!![]})[_0x5ea6('0x27')](function(_0x1f5462){var _0x47e004=[];if(_['isEmpty'](_0x1f5462)){_0x47e004=_[_0x5ea6('0x3f')](_0x127a74,function(_0x328a55){if(_0x328a55[_0x5ea6('0x5b')]!==_0x5ea6('0x57')){return _0x328a55;}});return _0x47e004;}else{for(var _0x27f73a=0x0;_0x27f73a<_0x127a74[_0x5ea6('0x38')];_0x27f73a++){var _0x733afc=_0x127a74[_0x27f73a];if(_0x733afc['role']==='agent'){var _0x12d3c3=_[_0x5ea6('0x49')](_0x1f5462,function(_0x5bc98b){return _0x5bc98b[_0x5ea6('0x6b')]===_0x733afc['id'];});if(_0x12d3c3)_0x47e004[_0x5ea6('0x6c')](_0x733afc);}else{_0x47e004['push'](_0x733afc);}}return _0x47e004;}});}else{return _0x127a74;}}else{var _0x440fcb=_[_0x5ea6('0x3f')](_0x127a74,function(_0x4180dd){if(_0x4180dd[_0x5ea6('0x5b')]!==_0x5ea6('0x57')){return _0x4180dd;}});return _0x440fcb;}});}else{return _0x127a74;}}})['then'](function(_0x5e3904){var _0x19eadc=[];if(_0x5e3904){_0x47e3ef=_0x5e3904;for(var _0x2d2f1a=0x0;_0x2d2f1a<_0x5e3904[_0x5ea6('0x38')];_0x2d2f1a+=0x1){_0x47e3ef[_0x2d2f1a][_0x5ea6('0x4e')]=[];_0x19eadc['push'](db['ChatInternalMessage'][_0x5ea6('0x49')]({'where':{'FromId':[_0x37d282[_0x5ea6('0x59')]['id'],_0x5e3904[_0x2d2f1a]['id']],'ToId':[_0x37d282[_0x5ea6('0x59')]['id'],_0x5e3904[_0x2d2f1a]['id']],'ChatGroupId':null},'attributes':['id',_0x5ea6('0x50'),_0x5ea6('0x6d'),_0x5ea6('0x6e'),_0x5ea6('0x6f'),_0x5ea6('0x4b')],'order':qs['sort'](_0x5ea6('0x70')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x5e3904[_0x2d2f1a])));}return BPromise[_0x5ea6('0x71')](_0x19eadc);}return[];})[_0x5ea6('0x27')](function(_0x4c0049){return{'rows':_0x4c0049,'count':_0x4c0049[_0x5ea6('0x38')]};})[_0x5ea6('0x27')](respondWithResult(_0x4fe6dc,null))[_0x5ea6('0x47')](handleError(_0x4fe6dc,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 93890be..ccedb57 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 _0x03bb=['hook','exports','../../mysqldb','ChatInternalMessage','update','remove','emit','hasOwnProperty'];(function(_0x4f3f1c,_0x2c00d7){var _0x286849=function(_0x17fc8a){while(--_0x17fc8a){_0x4f3f1c['push'](_0x4f3f1c['shift']());}};_0x286849(++_0x2c00d7);}(_0x03bb,0x17a));var _0xb03b=function(_0x4a599b,_0x1d2125){_0x4a599b=_0x4a599b-0x0;var _0x2d53d3=_0x03bb[_0x4a599b];return _0x2d53d3;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0xb03b('0x0'))['db'][_0xb03b('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xb03b('0x2'),'afterDestroy':_0xb03b('0x3')};function emitEvent(_0x30b12c){return function(_0x2ade90,_0x490dba,_0x573865){ChatInternalMessageEvents[_0xb03b('0x4')](_0x30b12c+':'+_0x2ade90['id'],_0x2ade90);ChatInternalMessageEvents[_0xb03b('0x4')](_0x30b12c,_0x2ade90);_0x573865(null);};}for(var e in events){if(events[_0xb03b('0x5')](e)){var event=events[e];ChatInternalMessage[_0xb03b('0x6')](e,emitEvent(event));}}module[_0xb03b('0x7')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xe1a7=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove','emit'];(function(_0x258973,_0x501ee6){var _0x287688=function(_0x3e8039){while(--_0x3e8039){_0x258973['push'](_0x258973['shift']());}};_0x287688(++_0x501ee6);}(_0xe1a7,0x87));var _0x7e1a=function(_0x489f47,_0x25ab58){_0x489f47=_0x489f47-0x0;var _0x3b166=_0xe1a7[_0x489f47];return _0x3b166;};'use strict';var EventEmitter=require(_0x7e1a('0x0'));var ChatInternalMessage=require(_0x7e1a('0x1'))['db'][_0x7e1a('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x7e1a('0x3')](0x0);var events={'afterCreate':_0x7e1a('0x4'),'afterUpdate':_0x7e1a('0x5'),'afterDestroy':_0x7e1a('0x6')};function emitEvent(_0x5cd02c){return function(_0xb25685,_0x4c37b4,_0x54f3f5){ChatInternalMessageEvents[_0x7e1a('0x7')](_0x5cd02c+':'+_0xb25685['id'],_0xb25685);ChatInternalMessageEvents[_0x7e1a('0x7')](_0x5cd02c,_0xb25685);_0x54f3f5(null);};}for(var e in events){if(events[_0x7e1a('0x8')](e)){var event=events[e];ChatInternalMessage[_0x7e1a('0x9')](e,emitEvent(event));}}module[_0x7e1a('0xa')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 4476b05..6d17e27 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 _0x9aa3=['bluebird','request-promise','path','rimraf','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x4e41e8,_0x397929){var _0x6d3de=function(_0x5f02dd){while(--_0x5f02dd){_0x4e41e8['push'](_0x4e41e8['shift']());}};_0x6d3de(++_0x397929);}(_0x9aa3,0x1eb));var _0x39aa=function(_0x479082,_0x40aa61){_0x479082=_0x479082-0x0;var _0x21348a=_0x9aa3[_0x479082];return _0x21348a;};'use strict';var _=require(_0x39aa('0x0'));var util=require(_0x39aa('0x1'));var logger=require(_0x39aa('0x2'))(_0x39aa('0x3'));var moment=require(_0x39aa('0x4'));var BPromise=require(_0x39aa('0x5'));var rp=require(_0x39aa('0x6'));var fs=require('fs');var path=require(_0x39aa('0x7'));var rimraf=require(_0x39aa('0x8'));var config=require('../../config/environment');var attributes=require(_0x39aa('0x9'));module[_0x39aa('0xa')]=function(_0x27ec35,_0x373115){return _0x27ec35[_0x39aa('0xb')](_0x39aa('0xc'),attributes,{'tableName':_0x39aa('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x39aa('0xe'),'collate':_0x39aa('0xf')});};
\ No newline at end of file
+var _0xf16b=['rimraf','./chatInternalMessage.attributes','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x45e0a8,_0x3ee1d0){var _0x3beda9=function(_0x12899d){while(--_0x12899d){_0x45e0a8['push'](_0x45e0a8['shift']());}};_0x3beda9(++_0x3ee1d0);}(_0xf16b,0x13a));var _0xbf16=function(_0x467057,_0x31e452){_0x467057=_0x467057-0x0;var _0xab58e4=_0xf16b[_0x467057];return _0xab58e4;};'use strict';var _=require(_0xbf16('0x0'));var util=require(_0xbf16('0x1'));var logger=require(_0xbf16('0x2'))(_0xbf16('0x3'));var moment=require(_0xbf16('0x4'));var BPromise=require(_0xbf16('0x5'));var rp=require(_0xbf16('0x6'));var fs=require('fs');var path=require(_0xbf16('0x7'));var rimraf=require(_0xbf16('0x8'));var config=require('../../config/environment');var attributes=require(_0xbf16('0x9'));module['exports']=function(_0x598030,_0x28cbe9){return _0x598030['define'](_0xbf16('0xa'),attributes,{'tableName':_0xbf16('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbf16('0xc'),'collate':_0xbf16('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index e9d6dd5..0faf13d 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 _0xd976=['result','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x518148,_0x1404a9){var _0x17f869=function(_0x21c6ef){while(--_0x21c6ef){_0x518148['push'](_0x518148['shift']());}};_0x17f869(++_0x1404a9);}(_0xd976,0x179));var _0x6d97=function(_0x44ff47,_0x52c922){_0x44ff47=_0x44ff47-0x0;var _0x201e11=_0xd976[_0x44ff47];return _0x201e11;};'use strict';var _=require(_0x6d97('0x0'));var util=require('util');var moment=require(_0x6d97('0x1'));var BPromise=require('bluebird');var rs=require(_0x6d97('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6d97('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x6d97('0x4'))('rpc');var config=require(_0x6d97('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x6d97('0x6')][_0x6d97('0x7')]({'port':0x232a});config[_0x6d97('0x8')]=_[_0x6d97('0x9')](config['redis'],{'host':_0x6d97('0xa'),'port':0x18eb});var socket=require(_0x6d97('0xb'))(new Redis(config[_0x6d97('0x8')]));require(_0x6d97('0xc'))['register'](socket);function respondWithRpcPromise(_0x5cab90,_0x544893,_0x17a529){return new BPromise(function(_0x34780e,_0x1abf57){return client[_0x6d97('0xd')](_0x5cab90,_0x17a529)[_0x6d97('0xe')](function(_0x406c2f){logger[_0x6d97('0xf')](_0x6d97('0x10'),_0x544893,_0x6d97('0x11'));logger['debug'](_0x6d97('0x12'),_0x544893,_0x6d97('0x11'),JSON[_0x6d97('0x13')](_0x406c2f));if(_0x406c2f['error']){if(_0x406c2f[_0x6d97('0x14')][_0x6d97('0x15')]===0x1f4){logger['error'](_0x6d97('0x10'),_0x544893,_0x406c2f[_0x6d97('0x14')]['message']);return _0x1abf57(_0x406c2f[_0x6d97('0x14')][_0x6d97('0x16')]);}logger[_0x6d97('0x14')](_0x6d97('0x10'),_0x544893,_0x406c2f[_0x6d97('0x14')][_0x6d97('0x16')]);return _0x34780e(_0x406c2f['error'][_0x6d97('0x16')]);}else{logger[_0x6d97('0xf')](_0x6d97('0x10'),_0x544893,_0x6d97('0x11'));_0x34780e(_0x406c2f[_0x6d97('0x17')]['message']);}})[_0x6d97('0x18')](function(_0x2e1a8a){logger[_0x6d97('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x544893,_0x2e1a8a);_0x1abf57(_0x2e1a8a);});});}
\ No newline at end of file
+var _0x024a=['debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x3bc407,_0x57c903){var _0x4963f2=function(_0x56daf6){while(--_0x56daf6){_0x3bc407['push'](_0x3bc407['shift']());}};_0x4963f2(++_0x57c903);}(_0x024a,0x17f));var _0xa024=function(_0xcc4189,_0x5ee71e){_0xcc4189=_0xcc4189-0x0;var _0x56939f=_0x024a[_0xcc4189];return _0x56939f;};'use strict';var _=require(_0xa024('0x0'));var util=require(_0xa024('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa024('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xa024('0x3'));var logger=require(_0xa024('0x4'))(_0xa024('0x5'));var config=require('../../config/environment');var jayson=require(_0xa024('0x6'));var client=jayson['client'][_0xa024('0x7')]({'port':0x232a});config[_0xa024('0x8')]=_['defaults'](config[_0xa024('0x8')],{'host':_0xa024('0x9'),'port':0x18eb});var socket=require(_0xa024('0xa'))(new Redis(config[_0xa024('0x8')]));require(_0xa024('0xb'))[_0xa024('0xc')](socket);function respondWithRpcPromise(_0x1fafd3,_0x2ec2e1,_0x40100c){return new BPromise(function(_0x1ed31e,_0x5f0856){return client[_0xa024('0xd')](_0x1fafd3,_0x40100c)['then'](function(_0x105c94){logger[_0xa024('0xe')](_0xa024('0xf'),_0x2ec2e1,_0xa024('0x10'));logger[_0xa024('0x11')](_0xa024('0x12'),_0x2ec2e1,_0xa024('0x10'),JSON[_0xa024('0x13')](_0x105c94));if(_0x105c94[_0xa024('0x14')]){if(_0x105c94[_0xa024('0x14')][_0xa024('0x15')]===0x1f4){logger[_0xa024('0x14')](_0xa024('0xf'),_0x2ec2e1,_0x105c94[_0xa024('0x14')][_0xa024('0x16')]);return _0x5f0856(_0x105c94[_0xa024('0x14')][_0xa024('0x16')]);}logger[_0xa024('0x14')](_0xa024('0xf'),_0x2ec2e1,_0x105c94[_0xa024('0x14')][_0xa024('0x16')]);return _0x1ed31e(_0x105c94[_0xa024('0x14')][_0xa024('0x16')]);}else{logger[_0xa024('0xe')](_0xa024('0xf'),_0x2ec2e1,_0xa024('0x10'));_0x1ed31e(_0x105c94[_0xa024('0x17')][_0xa024('0x16')]);}})[_0xa024('0x18')](function(_0x165fcd){logger[_0xa024('0x14')](_0xa024('0xf'),_0x2ec2e1,_0x165fcd);_0x5f0856(_0x165fcd);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index c5140cd..4988219 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 _0x0360=['removeListener','register','length','chatInternalMessage:','update'];(function(_0x174945,_0x2221a9){var _0x4a62d6=function(_0x4e0db8){while(--_0x4e0db8){_0x174945['push'](_0x174945['shift']());}};_0x4a62d6(++_0x2221a9);}(_0x0360,0xae));var _0x0036=function(_0x49da91,_0x423bda){_0x49da91=_0x49da91-0x0;var _0xd6a44e=_0x0360[_0x49da91];return _0xd6a44e;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=['save','remove',_0x0036('0x0')];function createListener(_0x518b1c,_0x4618da){return function(_0x1987e3){_0x4618da['emit'](_0x518b1c,_0x1987e3);};}function removeListener(_0x30ae5f,_0x28c161){return function(){ChatInternalMessageEvents[_0x0036('0x1')](_0x30ae5f,_0x28c161);};}exports[_0x0036('0x2')]=function(_0x57b3f7){for(var _0x128865=0x0,_0x29e43a=events[_0x0036('0x3')];_0x128865<_0x29e43a;_0x128865++){var _0x387e5e=events[_0x128865];var _0x913fd3=createListener(_0x0036('0x4')+_0x387e5e,_0x57b3f7);ChatInternalMessageEvents['on'](_0x387e5e,_0x913fd3);}};
\ No newline at end of file
+var _0xf752=['length','save','remove','update','emit','removeListener'];(function(_0x25aa94,_0x4662f4){var _0x451740=function(_0x454ebc){while(--_0x454ebc){_0x25aa94['push'](_0x25aa94['shift']());}};_0x451740(++_0x4662f4);}(_0xf752,0x157));var _0x2f75=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xf752[_0x57b54c];return _0x59cc19;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x2f75('0x0'),_0x2f75('0x1'),_0x2f75('0x2')];function createListener(_0x409c97,_0x5aef4b){return function(_0x94e91b){_0x5aef4b[_0x2f75('0x3')](_0x409c97,_0x94e91b);};}function removeListener(_0x4b0d18,_0x442f83){return function(){ChatInternalMessageEvents[_0x2f75('0x4')](_0x4b0d18,_0x442f83);};}exports['register']=function(_0x581adc){for(var _0xa2e52a=0x0,_0x3f0d9a=events[_0x2f75('0x5')];_0xa2e52a<_0x3f0d9a;_0xa2e52a++){var _0x39fa5b=events[_0xa2e52a];var _0x147b85=createListener('chatInternalMessage:'+_0x39fa5b,_0x581adc);ChatInternalMessageEvents['on'](_0x39fa5b,_0x147b85);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 82886eb..a3c19c1 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 _0xeb70=['create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','show','post'];(function(_0xe07094,_0x1cd13b){var _0x2d447b=function(_0x417dc5){while(--_0x417dc5){_0xe07094['push'](_0xe07094['shift']());}};_0x2d447b(++_0x1cd13b);}(_0xeb70,0x13f));var _0x0eb7=function(_0x60ebfd,_0x1d617a){_0x60ebfd=_0x60ebfd-0x0;var _0x312588=_0xeb70[_0x60ebfd];return _0x312588;};'use strict';var multer=require(_0x0eb7('0x0'));var util=require(_0x0eb7('0x1'));var path=require(_0x0eb7('0x2'));var timeout=require(_0x0eb7('0x3'));var express=require('express');var router=express[_0x0eb7('0x4')]();var fs_extra=require(_0x0eb7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0eb7('0x6'));var config=require('../../config/environment');var controller=require(_0x0eb7('0x7'));router[_0x0eb7('0x8')]('/',auth[_0x0eb7('0x9')](),controller[_0x0eb7('0xa')]);router['get'](_0x0eb7('0xb'),auth[_0x0eb7('0x9')](),controller[_0x0eb7('0xc')]);router[_0x0eb7('0x8')](_0x0eb7('0xd'),auth[_0x0eb7('0x9')](),controller[_0x0eb7('0xe')]);router[_0x0eb7('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0eb7('0xf')]);router[_0x0eb7('0x10')]('/',auth[_0x0eb7('0x9')](),controller[_0x0eb7('0x11')]);router[_0x0eb7('0x12')](_0x0eb7('0x13'),controller[_0x0eb7('0x14')]);router[_0x0eb7('0x15')](_0x0eb7('0x13'),auth['isAuthenticated'](),controller[_0x0eb7('0x16')]);module[_0x0eb7('0x17')]=router;
\ No newline at end of file
+var _0x14bc=['describe','getUsers','/:id','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index'];(function(_0x501ad7,_0x2fee71){var _0x89e71=function(_0x25c0ad){while(--_0x25c0ad){_0x501ad7['push'](_0x501ad7['shift']());}};_0x89e71(++_0x2fee71);}(_0x14bc,0x190));var _0xc14b=function(_0x54c7f1,_0x2f5695){_0x54c7f1=_0x54c7f1-0x0;var _0xb75df=_0x14bc[_0x54c7f1];return _0xb75df;};'use strict';var multer=require(_0xc14b('0x0'));var util=require(_0xc14b('0x1'));var path=require(_0xc14b('0x2'));var timeout=require(_0xc14b('0x3'));var express=require(_0xc14b('0x4'));var router=express[_0xc14b('0x5')]();var fs_extra=require(_0xc14b('0x6'));var auth=require(_0xc14b('0x7'));var interaction=require(_0xc14b('0x8'));var config=require(_0xc14b('0x9'));var controller=require(_0xc14b('0xa'));router[_0xc14b('0xb')]('/',auth[_0xc14b('0xc')](),controller[_0xc14b('0xd')]);router[_0xc14b('0xb')]('/describe',auth[_0xc14b('0xc')](),controller[_0xc14b('0xe')]);router[_0xc14b('0xb')]('/users',auth[_0xc14b('0xc')](),controller[_0xc14b('0xf')]);router[_0xc14b('0xb')](_0xc14b('0x10'),auth['isAuthenticated'](),controller['show']);router[_0xc14b('0x11')]('/',auth[_0xc14b('0xc')](),controller[_0xc14b('0x12')]);router[_0xc14b('0x13')]('/:id',controller[_0xc14b('0x14')]);router[_0xc14b('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xc14b('0x16')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 7416951..5ee69fa 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 _0x2964=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x164c5e,_0x3a74cd){var _0xb30150=function(_0x5c3397){while(--_0x5c3397){_0x164c5e['push'](_0x164c5e['shift']());}};_0xb30150(++_0x3a74cd);}(_0x2964,0x108));var _0x4296=function(_0x6b6243,_0x2ca502){_0x6b6243=_0x6b6243-0x0;var _0x3b2a3f=_0x2964[_0x6b6243];return _0x3b2a3f;};'use strict';var Sequelize=require(_0x4296('0x0'));module[_0x4296('0x1')]={'body':{'type':Sequelize[_0x4296('0x2')](_0x4296('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x4296('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x4296('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4296('0x5')]('in',_0x4296('0x6')),'defaultValue':_0x4296('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x4296('0x7')]},'providerResponse':{'type':Sequelize[_0x4296('0x2')]}};
\ No newline at end of file
+var _0x4b0f=['out','DATE','STRING','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x583745,_0x2d1897){var _0x4ba020=function(_0x288616){while(--_0x288616){_0x583745['push'](_0x583745['shift']());}};_0x4ba020(++_0x2d1897);}(_0x4b0f,0xa3));var _0xf4b0=function(_0x25a1ac,_0x113c18){_0x25a1ac=_0x25a1ac-0x0;var _0x13ea3a=_0x4b0f[_0x25a1ac];return _0x13ea3a;};'use strict';var Sequelize=require('sequelize');module[_0xf4b0('0x0')]={'body':{'type':Sequelize[_0xf4b0('0x1')](_0xf4b0('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xf4b0('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xf4b0('0x4')]('in',_0xf4b0('0x5')),'defaultValue':_0xf4b0('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xf4b0('0x6')]},'providerName':{'type':Sequelize[_0xf4b0('0x7')]},'providerResponse':{'type':Sequelize[_0xf4b0('0x1')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 9eb98e5..33f74d7 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 _0x8a78=['message','catch','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','sendStatus','stack','name','send','index','map','ChatMessage','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','body','destroy','describe','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteraction','ChatInteractionId','isNil','interaction','info','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','User','email','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','chat-interactions','chat','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','fullname','interface','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','http','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x277a87,_0x47a708){var _0xf75fd=function(_0x5e4b7e){while(--_0x5e4b7e){_0x277a87['push'](_0x277a87['shift']());}};_0xf75fd(++_0x47a708);}(_0x8a78,0x169));var _0x88a7=function(_0x22b39b,_0x2b7d63){_0x22b39b=_0x22b39b-0x0;var _0x280e1d=_0x8a78[_0x22b39b];return _0x280e1d;};'use strict';var emlformat=require(_0x88a7('0x0'));var rimraf=require(_0x88a7('0x1'));var zipdir=require(_0x88a7('0x2'));var jsonpatch=require(_0x88a7('0x3'));var rp=require(_0x88a7('0x4'));var moment=require(_0x88a7('0x5'));var BPromise=require(_0x88a7('0x6'));var Mustache=require(_0x88a7('0x7'));var util=require('util');var path=require(_0x88a7('0x8'));var sox=require(_0x88a7('0x9'));var csv=require(_0x88a7('0xa'));var ejs=require(_0x88a7('0xb'));var fs=require('fs');var fs_extra=require(_0x88a7('0xc'));var _=require(_0x88a7('0xd'));var squel=require(_0x88a7('0xe'));var crypto=require(_0x88a7('0xf'));var jsforce=require(_0x88a7('0x10'));var deskjs=require(_0x88a7('0x11'));var toCsv=require(_0x88a7('0xa'));var querystring=require('querystring');var Papa=require(_0x88a7('0x12'));var Redis=require('ioredis');var authService=require(_0x88a7('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x88a7('0x14'));var logger=require(_0x88a7('0x15'))(_0x88a7('0x16'));var utils=require(_0x88a7('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x88a7('0x18')]=_[_0x88a7('0x19')](config['redis'],{'host':_0x88a7('0x1a'),'port':0x18eb});var socket=require(_0x88a7('0x1b'))(new Redis(config[_0x88a7('0x18')]));require('./chatMessage.socket')['register'](socket);var jayson=require(_0x88a7('0x1c'));var client=jayson[_0x88a7('0x1d')][_0x88a7('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0x88a7('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x54502c,_0x463ec7,_0x436bf5,_0x437d7d){return new BPromise(function(_0xc2cb4a,_0xbf1eb4){var _0x27c17c=_0x437d7d||client;return _0x27c17c[_0x88a7('0x1f')](_0x54502c,_0x436bf5)[_0x88a7('0x20')](function(_0x130d54){logger['info'](_0x88a7('0x21'),_0x463ec7,_0x88a7('0x22'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x463ec7,_0x88a7('0x22'),JSON[_0x88a7('0x23')](_0x130d54));if(_0x130d54['error']){if(_0x130d54[_0x88a7('0x24')][_0x88a7('0x25')]===0x1f4){logger['error'](_0x88a7('0x21'),_0x463ec7,_0x130d54['error'][_0x88a7('0x26')]);return _0xbf1eb4(_0x130d54[_0x88a7('0x24')][_0x88a7('0x26')]);}logger[_0x88a7('0x24')]('ChatMessage,\x20%s,\x20%s',_0x463ec7,_0x130d54['error']['message']);return _0xc2cb4a(_0x130d54[_0x88a7('0x24')][_0x88a7('0x26')]);}else{logger['info'](_0x88a7('0x21'),_0x463ec7,'request\x20sent');_0xc2cb4a(_0x130d54['result'][_0x88a7('0x26')]);}})[_0x88a7('0x27')](function(_0x33bd93){logger[_0x88a7('0x24')](_0x88a7('0x21'),_0x463ec7,_0x33bd93);_0xbf1eb4(_0x33bd93);});});}function respondWithStatusCode(_0x589b59,_0x76d3c){_0x76d3c=_0x76d3c||0xcc;return function(_0x3f23d2){if(_0x3f23d2){return _0x589b59['sendStatus'](_0x76d3c);}return _0x589b59['status'](_0x76d3c)[_0x88a7('0x28')]();};}function respondWithResult(_0x31a49f,_0x241d71){_0x241d71=_0x241d71||0xc8;return function(_0x28c7e9){if(_0x28c7e9){return _0x31a49f[_0x88a7('0x29')](_0x241d71)[_0x88a7('0x2a')](_0x28c7e9);}};}function respondWithFilteredResult(_0x551d7c,_0x2874f3){return function(_0x41ccf8){if(_0x41ccf8){var _0x357336=typeof _0x2874f3[_0x88a7('0x2b')]==='undefined'&&typeof _0x2874f3[_0x88a7('0x2c')]===_0x88a7('0x2d');var _0x2ba76b=_0x41ccf8[_0x88a7('0x2e')];var _0x392808=_0x357336?0x0:_0x2874f3['offset'];var _0x57f118=_0x357336?_0x41ccf8[_0x88a7('0x2e')]:_0x2874f3[_0x88a7('0x2b')]+_0x2874f3[_0x88a7('0x2c')];var _0x1418f6;if(_0x57f118>=_0x2ba76b){_0x57f118=_0x2ba76b;_0x1418f6=0xc8;}else{_0x1418f6=0xce;}_0x551d7c['status'](_0x1418f6);return _0x551d7c[_0x88a7('0x2f')](_0x88a7('0x30'),_0x392808+'-'+_0x57f118+'/'+_0x2ba76b)['json'](_0x41ccf8);}return null;};}function patchUpdates(_0x34e55b){return function(_0x363949){try{jsonpatch['apply'](_0x363949,_0x34e55b,!![]);}catch(_0x91d11d){return BPromise[_0x88a7('0x31')](_0x91d11d);}return _0x363949[_0x88a7('0x32')]();};}function saveUpdates(_0x469c9e,_0x376cdc){return function(_0x2b302f){if(_0x2b302f){return _0x2b302f[_0x88a7('0x33')](_0x469c9e)['then'](function(_0x294e32){return _0x294e32;});}return null;};}function removeEntity(_0x555b41,_0x3c133b){return function(_0x4b1ad2){if(_0x4b1ad2){return _0x4b1ad2['destroy']()[_0x88a7('0x20')](function(){_0x555b41[_0x88a7('0x29')](0xcc)[_0x88a7('0x28')]();});}};}function handleEntityNotFound(_0x21cde8,_0x52de23){return function(_0x3c0ed4){if(!_0x3c0ed4){_0x21cde8[_0x88a7('0x34')](0x194);}return _0x3c0ed4;};}function handleError(_0x1fe343,_0x2ffc1c){_0x2ffc1c=_0x2ffc1c||0x1f4;return function(_0x172e6a){logger[_0x88a7('0x24')](_0x172e6a[_0x88a7('0x35')]);if(_0x172e6a['name']){delete _0x172e6a[_0x88a7('0x36')];}_0x1fe343[_0x88a7('0x29')](_0x2ffc1c)[_0x88a7('0x37')](_0x172e6a);};}exports[_0x88a7('0x38')]=function(_0x9ef2eb,_0x5ec345){var _0x385d12={},_0x388dd7={},_0x46dda9={'count':0x0,'rows':[]};var _0x2944d1=_[_0x88a7('0x39')](db[_0x88a7('0x3a')]['rawAttributes'],function(_0x8c64b2){return{'name':_0x8c64b2[_0x88a7('0x3b')],'type':_0x8c64b2[_0x88a7('0x3c')][_0x88a7('0x3d')]};});_0x388dd7[_0x88a7('0x3e')]=_[_0x88a7('0x39')](_0x2944d1,_0x88a7('0x36'));_0x388dd7[_0x88a7('0x3f')]=_[_0x88a7('0x40')](_0x9ef2eb['query']);_0x388dd7[_0x88a7('0x41')]=_[_0x88a7('0x42')](_0x388dd7[_0x88a7('0x3e')],_0x388dd7[_0x88a7('0x3f')]);_0x385d12['attributes']=_[_0x88a7('0x42')](_0x388dd7['model'],qs[_0x88a7('0x43')](_0x9ef2eb[_0x88a7('0x3f')][_0x88a7('0x43')]));_0x385d12[_0x88a7('0x44')]=_0x385d12[_0x88a7('0x44')]['length']?_0x385d12[_0x88a7('0x44')]:_0x388dd7[_0x88a7('0x3e')];if(!_0x9ef2eb[_0x88a7('0x3f')][_0x88a7('0x45')](_0x88a7('0x46'))){_0x385d12[_0x88a7('0x2c')]=qs['limit'](_0x9ef2eb[_0x88a7('0x3f')][_0x88a7('0x2c')]);_0x385d12[_0x88a7('0x2b')]=qs['offset'](_0x9ef2eb[_0x88a7('0x3f')][_0x88a7('0x2b')]);}_0x385d12[_0x88a7('0x47')]=qs[_0x88a7('0x48')](_0x9ef2eb[_0x88a7('0x3f')][_0x88a7('0x48')]);_0x385d12[_0x88a7('0x49')]=qs['filters'](_[_0x88a7('0x4a')](_0x9ef2eb[_0x88a7('0x3f')],_0x388dd7[_0x88a7('0x41')]),_0x2944d1);if(_0x9ef2eb['query']['filter']){_0x385d12['where']=_[_0x88a7('0x4b')](_0x385d12['where'],{'$or':_['map'](_0x2944d1,function(_0x39aca0){if(_0x39aca0['type']!==_0x88a7('0x4c')){var _0x21246b={};_0x21246b[_0x39aca0[_0x88a7('0x36')]]={'$like':'%'+_0x9ef2eb[_0x88a7('0x3f')][_0x88a7('0x4d')]+'%'};return _0x21246b;}})});}_0x385d12=_[_0x88a7('0x4b')]({},_0x385d12,_0x9ef2eb[_0x88a7('0x4e')]);var _0xf59847={'where':_0x385d12[_0x88a7('0x49')]};return db[_0x88a7('0x3a')]['count'](_0xf59847)[_0x88a7('0x20')](function(_0x52abd1){_0x46dda9[_0x88a7('0x2e')]=_0x52abd1;if(_0x9ef2eb[_0x88a7('0x3f')][_0x88a7('0x4f')]){_0x385d12[_0x88a7('0x50')]=[{'all':!![]}];}return db[_0x88a7('0x3a')][_0x88a7('0x51')](_0x385d12);})['then'](function(_0x5480bc){_0x46dda9[_0x88a7('0x52')]=_0x5480bc;return _0x46dda9;})[_0x88a7('0x20')](respondWithFilteredResult(_0x5ec345,_0x385d12))[_0x88a7('0x27')](handleError(_0x5ec345,null));};exports[_0x88a7('0x53')]=function(_0x562ba2,_0x53cb15){var _0x2e87cc={'raw':!![],'where':{'id':_0x562ba2[_0x88a7('0x54')]['id']}},_0x470a92={};_0x470a92[_0x88a7('0x3e')]=_[_0x88a7('0x40')](db[_0x88a7('0x3a')][_0x88a7('0x55')]);_0x470a92['query']=_[_0x88a7('0x40')](_0x562ba2[_0x88a7('0x3f')]);_0x470a92['filters']=_[_0x88a7('0x42')](_0x470a92[_0x88a7('0x3e')],_0x470a92[_0x88a7('0x3f')]);_0x2e87cc[_0x88a7('0x44')]=_[_0x88a7('0x42')](_0x470a92[_0x88a7('0x3e')],qs[_0x88a7('0x43')](_0x562ba2[_0x88a7('0x3f')]['fields']));_0x2e87cc[_0x88a7('0x44')]=_0x2e87cc['attributes']['length']?_0x2e87cc[_0x88a7('0x44')]:_0x470a92[_0x88a7('0x3e')];if(_0x562ba2[_0x88a7('0x3f')][_0x88a7('0x4f')]){_0x2e87cc['include']=[{'all':!![]}];}_0x2e87cc=_[_0x88a7('0x4b')]({},_0x2e87cc,_0x562ba2[_0x88a7('0x4e')]);return db[_0x88a7('0x3a')][_0x88a7('0x56')](_0x2e87cc)[_0x88a7('0x20')](handleEntityNotFound(_0x53cb15,null))[_0x88a7('0x20')](respondWithResult(_0x53cb15,null))[_0x88a7('0x27')](handleError(_0x53cb15,null));};exports[_0x88a7('0x57')]=function(_0x3eb39f,_0x553db5){return db[_0x88a7('0x3a')][_0x88a7('0x57')](_0x3eb39f[_0x88a7('0x58')],{})[_0x88a7('0x20')](respondWithResult(_0x553db5,0xc9))[_0x88a7('0x27')](handleError(_0x553db5,null));};exports[_0x88a7('0x33')]=function(_0x3eb141,_0x1707ed){if(_0x3eb141['body']['id']){delete _0x3eb141[_0x88a7('0x58')]['id'];}return db[_0x88a7('0x3a')][_0x88a7('0x56')]({'where':{'id':_0x3eb141[_0x88a7('0x54')]['id']}})['then'](handleEntityNotFound(_0x1707ed,null))['then'](saveUpdates(_0x3eb141['body'],null))['then'](respondWithResult(_0x1707ed,null))[_0x88a7('0x27')](handleError(_0x1707ed,null));};exports[_0x88a7('0x59')]=function(_0x1132dd,_0x1a2ae0){return db[_0x88a7('0x3a')][_0x88a7('0x56')]({'where':{'id':_0x1132dd[_0x88a7('0x54')]['id']}})[_0x88a7('0x20')](handleEntityNotFound(_0x1a2ae0,null))['then'](removeEntity(_0x1a2ae0,null))[_0x88a7('0x27')](handleError(_0x1a2ae0,null));};exports[_0x88a7('0x5a')]=function(_0x2a6fea,_0x1c6097){return db['ChatMessage'][_0x88a7('0x5a')]()[_0x88a7('0x20')](respondWithResult(_0x1c6097,null))['catch'](handleError(_0x1c6097,null));};var interaction_log=require(_0x88a7('0x15'))('chat-interactions');exports[_0x88a7('0x5b')]=function(_0x182ec5,_0x36cd37,_0x25315b){var _0x3085de={'agent':{},'channel':'chat'};if(_0x182ec5['body']['id']){delete _0x182ec5[_0x88a7('0x58')]['id'];}_0x182ec5['body'][_0x88a7('0x5c')]=!![];_0x182ec5[_0x88a7('0x58')]['readAt']=moment()[_0x88a7('0x5d')](_0x88a7('0x5e'));_0x182ec5['body'][_0x88a7('0x5f')]=_0x182ec5['body'][_0x88a7('0x5f')]||_0x182ec5['user']['id'];_0x3085de[_0x88a7('0x60')]['id']=_0x182ec5['body'][_0x88a7('0x5f')];return db['ChatMessage'][_0x88a7('0x56')]({'where':{'id':_0x182ec5[_0x88a7('0x54')]['id'],'UserId':null}})[_0x88a7('0x20')](handleEntityNotFound(_0x36cd37,null))['then'](saveUpdates(_0x182ec5[_0x88a7('0x58')],null))['then'](function(_0x2c7b47){if(_0x2c7b47){_0x3085de['message']=_0x2c7b47[_0x88a7('0x61')]({'plain':!![]});return db[_0x88a7('0x62')][_0x88a7('0x56')]({'where':{'id':_0x2c7b47[_0x88a7('0x63')]}});}return null;})[_0x88a7('0x20')](handleEntityNotFound(_0x36cd37,null))[_0x88a7('0x20')](function(_0x19eb48){if(_0x19eb48){return _0x19eb48[_0x88a7('0x33')]({'UserId':_0x182ec5[_0x88a7('0x58')][_0x88a7('0x5f')],'read1stAt':_[_0x88a7('0x64')](_0x19eb48['read1stAt'])?moment()['format'](_0x88a7('0x5e')):undefined});}return null;})[_0x88a7('0x20')](function(_0x5d8878){if(_0x5d8878){_0x3085de[_0x88a7('0x65')]=_0x5d8878['get']({'plain':!![]});interaction_log[_0x88a7('0x66')](_0x88a7('0x67'),_0x182ec5['user']['id'],_0x182ec5[_0x88a7('0x68')][_0x88a7('0x36')],_0x182ec5[_0x88a7('0x68')][_0x88a7('0x69')],_0x3085de[_0x88a7('0x65')]['id'],_0x182ec5[_0x88a7('0x58')]?JSON[_0x88a7('0x23')](_0x182ec5[_0x88a7('0x58')]):_0x88a7('0x6a'));return respondWithRpcPromise(_0x88a7('0x6b'),_0x88a7('0x6c'),_0x3085de);}return null;})['then'](function(_0x44b0cf){var _0x22c7c8=_0x88a7('0x6d')+_0x44b0cf[_0x88a7('0x26')][_0x88a7('0x6e')];return db['sequelize'][_0x88a7('0x3f')](_0x22c7c8,{'type':db[_0x88a7('0x6f')][_0x88a7('0x70')][_0x88a7('0x71')],'raw':!![]})[_0x88a7('0x20')](function(_0x3a054b){return _0x3a054b;});})[_0x88a7('0x20')](function(_0x5cca0e){if(_0x5cca0e){_0x3085de[_0x88a7('0x26')]['contact']=_0x5cca0e[0x0];if(!_0x182ec5[_0x88a7('0x58')][_0x88a7('0x5f')])return;return db[_0x88a7('0x72')][_0x88a7('0x56')]({'where':{'id':_0x182ec5[_0x88a7('0x58')][_0x88a7('0x5f')],'role':'agent'},'attributes':['id',_0x88a7('0x36'),'fullname',_0x88a7('0x73'),_0x88a7('0x74')],'raw':!![]});}return null;})[_0x88a7('0x20')](function(_0x544ca3){if(!_0x544ca3)return null;_0x3085de[_0x88a7('0x26')]['agent']=_0x544ca3;return _0x3085de;})[_0x88a7('0x20')](function(_0xeb77e){if(_0xeb77e){if(_0x182ec5[_0x88a7('0x58')][_0x88a7('0x75')]){_0x3085de[_0x88a7('0x26')]['interface']=util[_0x88a7('0x5d')](_0x88a7('0x76'),_0x182ec5[_0x88a7('0x68')][_0x88a7('0x36')]);_0x3085de[_0x88a7('0x26')][_0x88a7('0x77')]=_0x3085de[_0x88a7('0x77')];_0x3085de['message'][_0x88a7('0x78')]=_0x3085de[_0x88a7('0x77')];_0x3085de[_0x88a7('0x26')][_0x88a7('0x79')]='accept';return respondWithRpcPromise('EventManager',_0x88a7('0x7a'),{'event':_0x88a7('0x7b'),'message':_[_0x88a7('0x4b')](_0x3085de[_0x88a7('0x26')],JSON[_0x88a7('0x7c')](_0x3085de[_0x88a7('0x65')][_0x88a7('0x7d')]))},client9002)['then'](function(){return _0x3085de;});}return _0x3085de;}return null;})['then'](respondWithResult(_0x36cd37,null))['catch'](handleError(_0x36cd37,null));};var interaction_log=require(_0x88a7('0x15'))(_0x88a7('0x7e'));exports['reject']=function(_0x38ee21,_0x10e1bf,_0x33ff84){var _0x211183={'agent':{},'channel':_0x88a7('0x7f')};if(_0x38ee21[_0x88a7('0x58')]['id']){delete _0x38ee21[_0x88a7('0x58')]['id'];}_0x38ee21['body'][_0x88a7('0x5f')]=_0x38ee21['body'][_0x88a7('0x5f')]||_0x38ee21[_0x88a7('0x68')]['id'];_0x211183['agent']['id']=_0x38ee21[_0x88a7('0x58')]['UserId'];return db[_0x88a7('0x3a')][_0x88a7('0x56')]({'where':{'id':_0x38ee21[_0x88a7('0x54')]['id'],'UserId':null}})[_0x88a7('0x20')](handleEntityNotFound(_0x10e1bf,null))[_0x88a7('0x20')](function(_0x2509fd){if(_0x2509fd){_0x211183[_0x88a7('0x26')]=_0x2509fd[_0x88a7('0x61')]({'plain':!![]});return db[_0x88a7('0x62')][_0x88a7('0x56')]({'where':{'id':_0x2509fd[_0x88a7('0x63')]}});}return null;})[_0x88a7('0x20')](handleEntityNotFound(_0x10e1bf,null))[_0x88a7('0x20')](function(_0x420e3d){if(_0x420e3d){_0x211183[_0x88a7('0x65')]=_0x420e3d[_0x88a7('0x61')]({'plain':!![]});interaction_log[_0x88a7('0x66')](_0x88a7('0x80'),_0x38ee21[_0x88a7('0x68')]['id'],_0x38ee21['user'][_0x88a7('0x36')],_0x38ee21[_0x88a7('0x68')]['role'],_0x211183['interaction']['id'],_0x38ee21[_0x88a7('0x58')]?JSON[_0x88a7('0x23')](_0x38ee21['body']):_0x88a7('0x6a'));return respondWithRpcPromise('RejectMessage',_0x88a7('0x81'),_0x211183);}return null;})['then'](function(_0x563b56){var _0x3dbafa=_0x88a7('0x6d')+_0x563b56[_0x88a7('0x26')][_0x88a7('0x6e')];return db['sequelize'][_0x88a7('0x3f')](_0x3dbafa,{'type':db[_0x88a7('0x6f')][_0x88a7('0x70')][_0x88a7('0x71')],'raw':!![]})[_0x88a7('0x20')](function(_0xefbf64){return _0xefbf64;});})[_0x88a7('0x20')](function(_0x463137){if(_0x463137){_0x211183[_0x88a7('0x26')]['contact']=_0x463137[0x0];if(!_0x38ee21[_0x88a7('0x58')]['UserId'])return;return db[_0x88a7('0x72')]['find']({'where':{'id':_0x38ee21[_0x88a7('0x58')][_0x88a7('0x5f')],'role':'agent'},'attributes':['id',_0x88a7('0x36'),_0x88a7('0x82'),'email','internal'],'raw':!![]});}return null;})['then'](function(_0x460c11){if(!_0x460c11)return null;_0x211183[_0x88a7('0x26')][_0x88a7('0x60')]=_0x460c11;return _0x211183;})[_0x88a7('0x20')](function(_0x146356){if(_0x146356){_0x146356['message'][_0x88a7('0x83')]=util[_0x88a7('0x5d')](_0x88a7('0x76'),_0x38ee21['user'][_0x88a7('0x36')]);_0x146356[_0x88a7('0x26')][_0x88a7('0x77')]=_0x211183[_0x88a7('0x77')];_0x146356[_0x88a7('0x26')][_0x88a7('0x78')]=_0x211183[_0x88a7('0x77')];_0x146356[_0x88a7('0x26')]['event']='reject';respondWithRpcPromise(_0x88a7('0x7a'),'EventManager',{'event':_0x88a7('0x84'),'message':_[_0x88a7('0x4b')](_0x211183[_0x88a7('0x26')],JSON['parse'](_0x211183[_0x88a7('0x65')][_0x88a7('0x7d')]))},client9002);return _0x211183;}return null;})['then'](respondWithResult(_0x10e1bf,null))[_0x88a7('0x27')](handleError(_0x10e1bf,null));};
\ No newline at end of file
+var _0x6bb3=['interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','fullname','internal','manual','interface','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','SIP/%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','offset','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','sendStatus','name','send','ChatMessage','rawAttributes','key','model','map','query','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','fields','options','create','body','find','describe','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','isNil','read1stAt'];(function(_0x3de6f7,_0x996459){var _0x1f1db2=function(_0x136ae7){while(--_0x136ae7){_0x3de6f7['push'](_0x3de6f7['shift']());}};_0x1f1db2(++_0x996459);}(_0x6bb3,0x1a9));var _0x36bb=function(_0x30b45f,_0x5703f1){_0x30b45f=_0x30b45f-0x0;var _0x383efd=_0x6bb3[_0x30b45f];return _0x383efd;};'use strict';var emlformat=require(_0x36bb('0x0'));var rimraf=require(_0x36bb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x36bb('0x2'));var rp=require(_0x36bb('0x3'));var moment=require(_0x36bb('0x4'));var BPromise=require(_0x36bb('0x5'));var Mustache=require(_0x36bb('0x6'));var util=require(_0x36bb('0x7'));var path=require(_0x36bb('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x36bb('0x9'));var fs=require('fs');var fs_extra=require(_0x36bb('0xa'));var _=require(_0x36bb('0xb'));var squel=require(_0x36bb('0xc'));var crypto=require(_0x36bb('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x36bb('0xe'));var toCsv=require('to-csv');var querystring=require(_0x36bb('0xf'));var Papa=require(_0x36bb('0x10'));var Redis=require(_0x36bb('0x11'));var authService=require(_0x36bb('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x36bb('0x13'));var hardwareService=require(_0x36bb('0x14'));var logger=require(_0x36bb('0x15'))('api');var utils=require(_0x36bb('0x16'));var config=require(_0x36bb('0x17'));var licenseUtil=require(_0x36bb('0x18'));var db=require(_0x36bb('0x19'))['db'];config[_0x36bb('0x1a')]=_[_0x36bb('0x1b')](config['redis'],{'host':_0x36bb('0x1c'),'port':0x18eb});var socket=require(_0x36bb('0x1d'))(new Redis(config[_0x36bb('0x1a')]));require('./chatMessage.socket')[_0x36bb('0x1e')](socket);var jayson=require(_0x36bb('0x1f'));var client=jayson['client'][_0x36bb('0x20')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x37f8d7,_0x1e3d82,_0x691286,_0x25d8c5){return new BPromise(function(_0x387de4,_0x4a5184){var _0x326241=_0x25d8c5||client;return _0x326241[_0x36bb('0x21')](_0x37f8d7,_0x691286)[_0x36bb('0x22')](function(_0x2804de){logger[_0x36bb('0x23')](_0x36bb('0x24'),_0x1e3d82,_0x36bb('0x25'));logger[_0x36bb('0x26')](_0x36bb('0x27'),_0x1e3d82,'request\x20sent',JSON[_0x36bb('0x28')](_0x2804de));if(_0x2804de[_0x36bb('0x29')]){if(_0x2804de[_0x36bb('0x29')][_0x36bb('0x2a')]===0x1f4){logger[_0x36bb('0x29')](_0x36bb('0x24'),_0x1e3d82,_0x2804de['error']['message']);return _0x4a5184(_0x2804de[_0x36bb('0x29')][_0x36bb('0x2b')]);}logger[_0x36bb('0x29')]('ChatMessage,\x20%s,\x20%s',_0x1e3d82,_0x2804de['error'][_0x36bb('0x2b')]);return _0x387de4(_0x2804de[_0x36bb('0x29')]['message']);}else{logger[_0x36bb('0x23')](_0x36bb('0x24'),_0x1e3d82,_0x36bb('0x25'));_0x387de4(_0x2804de[_0x36bb('0x2c')]['message']);}})['catch'](function(_0xc38292){logger[_0x36bb('0x29')](_0x36bb('0x24'),_0x1e3d82,_0xc38292);_0x4a5184(_0xc38292);});});}function respondWithStatusCode(_0x4a4fa2,_0x3c07f9){_0x3c07f9=_0x3c07f9||0xcc;return function(_0x658084){if(_0x658084){return _0x4a4fa2['sendStatus'](_0x3c07f9);}return _0x4a4fa2[_0x36bb('0x2d')](_0x3c07f9)['end']();};}function respondWithResult(_0xb10cca,_0x2c7090){_0x2c7090=_0x2c7090||0xc8;return function(_0x453def){if(_0x453def){return _0xb10cca[_0x36bb('0x2d')](_0x2c7090)['json'](_0x453def);}};}function respondWithFilteredResult(_0x22d2b1,_0x146712){return function(_0x3cac80){if(_0x3cac80){var _0x50a294=typeof _0x146712[_0x36bb('0x2e')]==='undefined'&&typeof _0x146712[_0x36bb('0x2f')]==='undefined';var _0x54acac=_0x3cac80[_0x36bb('0x30')];var _0x3df7da=_0x50a294?0x0:_0x146712[_0x36bb('0x2e')];var _0x3a91aa=_0x50a294?_0x3cac80['count']:_0x146712['offset']+_0x146712[_0x36bb('0x2f')];var _0x19c50f;if(_0x3a91aa>=_0x54acac){_0x3a91aa=_0x54acac;_0x19c50f=0xc8;}else{_0x19c50f=0xce;}_0x22d2b1[_0x36bb('0x2d')](_0x19c50f);return _0x22d2b1[_0x36bb('0x31')](_0x36bb('0x32'),_0x3df7da+'-'+_0x3a91aa+'/'+_0x54acac)[_0x36bb('0x33')](_0x3cac80);}return null;};}function patchUpdates(_0x19ac3){return function(_0x37d9cc){try{jsonpatch[_0x36bb('0x34')](_0x37d9cc,_0x19ac3,!![]);}catch(_0x2dcd9c){return BPromise[_0x36bb('0x35')](_0x2dcd9c);}return _0x37d9cc[_0x36bb('0x36')]();};}function saveUpdates(_0x4fb936,_0x22ada8){return function(_0x3ccbbc){if(_0x3ccbbc){return _0x3ccbbc[_0x36bb('0x37')](_0x4fb936)['then'](function(_0xa20d10){return _0xa20d10;});}return null;};}function removeEntity(_0x15d1ee,_0x28885a){return function(_0xbe5c4c){if(_0xbe5c4c){return _0xbe5c4c[_0x36bb('0x38')]()[_0x36bb('0x22')](function(){_0x15d1ee[_0x36bb('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f719e,_0xa80fe3){return function(_0x4a7e48){if(!_0x4a7e48){_0x1f719e[_0x36bb('0x39')](0x194);}return _0x4a7e48;};}function handleError(_0x19610c,_0x232eec){_0x232eec=_0x232eec||0x1f4;return function(_0x2c5213){logger[_0x36bb('0x29')](_0x2c5213['stack']);if(_0x2c5213[_0x36bb('0x3a')]){delete _0x2c5213[_0x36bb('0x3a')];}_0x19610c[_0x36bb('0x2d')](_0x232eec)[_0x36bb('0x3b')](_0x2c5213);};}exports['index']=function(_0x13f4c5,_0x5a0af3){var _0x4ee13f={},_0x4171f5={},_0x4fa9e4={'count':0x0,'rows':[]};var _0x427137=_['map'](db[_0x36bb('0x3c')][_0x36bb('0x3d')],function(_0x35f1bb){return{'name':_0x35f1bb['fieldName'],'type':_0x35f1bb['type'][_0x36bb('0x3e')]};});_0x4171f5[_0x36bb('0x3f')]=_[_0x36bb('0x40')](_0x427137,_0x36bb('0x3a'));_0x4171f5[_0x36bb('0x41')]=_['keys'](_0x13f4c5['query']);_0x4171f5['filters']=_[_0x36bb('0x42')](_0x4171f5[_0x36bb('0x3f')],_0x4171f5[_0x36bb('0x41')]);_0x4ee13f['attributes']=_[_0x36bb('0x42')](_0x4171f5[_0x36bb('0x3f')],qs['fields'](_0x13f4c5['query']['fields']));_0x4ee13f[_0x36bb('0x43')]=_0x4ee13f[_0x36bb('0x43')][_0x36bb('0x44')]?_0x4ee13f[_0x36bb('0x43')]:_0x4171f5[_0x36bb('0x3f')];if(!_0x13f4c5[_0x36bb('0x41')][_0x36bb('0x45')](_0x36bb('0x46'))){_0x4ee13f[_0x36bb('0x2f')]=qs[_0x36bb('0x2f')](_0x13f4c5[_0x36bb('0x41')]['limit']);_0x4ee13f[_0x36bb('0x2e')]=qs[_0x36bb('0x2e')](_0x13f4c5[_0x36bb('0x41')][_0x36bb('0x2e')]);}_0x4ee13f['order']=qs[_0x36bb('0x47')](_0x13f4c5[_0x36bb('0x41')][_0x36bb('0x47')]);_0x4ee13f[_0x36bb('0x48')]=qs[_0x36bb('0x49')](_[_0x36bb('0x4a')](_0x13f4c5[_0x36bb('0x41')],_0x4171f5['filters']),_0x427137);if(_0x13f4c5['query'][_0x36bb('0x4b')]){_0x4ee13f[_0x36bb('0x48')]=_[_0x36bb('0x4c')](_0x4ee13f[_0x36bb('0x48')],{'$or':_['map'](_0x427137,function(_0x588067){if(_0x588067[_0x36bb('0x4d')]!==_0x36bb('0x4e')){var _0x3fb77f={};_0x3fb77f[_0x588067[_0x36bb('0x3a')]]={'$like':'%'+_0x13f4c5[_0x36bb('0x41')][_0x36bb('0x4b')]+'%'};return _0x3fb77f;}})});}_0x4ee13f=_['merge']({},_0x4ee13f,_0x13f4c5['options']);var _0x1f7abf={'where':_0x4ee13f[_0x36bb('0x48')]};return db[_0x36bb('0x3c')][_0x36bb('0x30')](_0x1f7abf)[_0x36bb('0x22')](function(_0x14b863){_0x4fa9e4[_0x36bb('0x30')]=_0x14b863;if(_0x13f4c5[_0x36bb('0x41')][_0x36bb('0x4f')]){_0x4ee13f[_0x36bb('0x50')]=[{'all':!![]}];}return db[_0x36bb('0x3c')][_0x36bb('0x51')](_0x4ee13f);})[_0x36bb('0x22')](function(_0x4b1b38){_0x4fa9e4[_0x36bb('0x52')]=_0x4b1b38;return _0x4fa9e4;})['then'](respondWithFilteredResult(_0x5a0af3,_0x4ee13f))[_0x36bb('0x53')](handleError(_0x5a0af3,null));};exports[_0x36bb('0x54')]=function(_0x3e977d,_0x43b0d4){var _0x447882={'raw':!![],'where':{'id':_0x3e977d[_0x36bb('0x55')]['id']}},_0x53a4e3={};_0x53a4e3[_0x36bb('0x3f')]=_[_0x36bb('0x56')](db['ChatMessage']['rawAttributes']);_0x53a4e3[_0x36bb('0x41')]=_[_0x36bb('0x56')](_0x3e977d[_0x36bb('0x41')]);_0x53a4e3[_0x36bb('0x49')]=_[_0x36bb('0x42')](_0x53a4e3[_0x36bb('0x3f')],_0x53a4e3[_0x36bb('0x41')]);_0x447882['attributes']=_[_0x36bb('0x42')](_0x53a4e3[_0x36bb('0x3f')],qs[_0x36bb('0x57')](_0x3e977d['query'][_0x36bb('0x57')]));_0x447882['attributes']=_0x447882[_0x36bb('0x43')]['length']?_0x447882[_0x36bb('0x43')]:_0x53a4e3[_0x36bb('0x3f')];if(_0x3e977d[_0x36bb('0x41')][_0x36bb('0x4f')]){_0x447882[_0x36bb('0x50')]=[{'all':!![]}];}_0x447882=_[_0x36bb('0x4c')]({},_0x447882,_0x3e977d[_0x36bb('0x58')]);return db[_0x36bb('0x3c')]['find'](_0x447882)[_0x36bb('0x22')](handleEntityNotFound(_0x43b0d4,null))[_0x36bb('0x22')](respondWithResult(_0x43b0d4,null))['catch'](handleError(_0x43b0d4,null));};exports[_0x36bb('0x59')]=function(_0x117ee4,_0x4924ec){return db[_0x36bb('0x3c')][_0x36bb('0x59')](_0x117ee4['body'],{})[_0x36bb('0x22')](respondWithResult(_0x4924ec,0xc9))[_0x36bb('0x53')](handleError(_0x4924ec,null));};exports[_0x36bb('0x37')]=function(_0x36a25f,_0x23ff42){if(_0x36a25f[_0x36bb('0x5a')]['id']){delete _0x36a25f['body']['id'];}return db[_0x36bb('0x3c')]['find']({'where':{'id':_0x36a25f[_0x36bb('0x55')]['id']}})[_0x36bb('0x22')](handleEntityNotFound(_0x23ff42,null))[_0x36bb('0x22')](saveUpdates(_0x36a25f[_0x36bb('0x5a')],null))[_0x36bb('0x22')](respondWithResult(_0x23ff42,null))['catch'](handleError(_0x23ff42,null));};exports[_0x36bb('0x38')]=function(_0x56990e,_0x1bea1c){return db[_0x36bb('0x3c')][_0x36bb('0x5b')]({'where':{'id':_0x56990e['params']['id']}})[_0x36bb('0x22')](handleEntityNotFound(_0x1bea1c,null))[_0x36bb('0x22')](removeEntity(_0x1bea1c,null))[_0x36bb('0x53')](handleError(_0x1bea1c,null));};exports[_0x36bb('0x5c')]=function(_0x2e6657,_0x3ab3c9){return db[_0x36bb('0x3c')][_0x36bb('0x5c')]()[_0x36bb('0x22')](respondWithResult(_0x3ab3c9,null))[_0x36bb('0x53')](handleError(_0x3ab3c9,null));};var interaction_log=require('../../config/logger')(_0x36bb('0x5d'));exports[_0x36bb('0x5e')]=function(_0x29d3bb,_0x37bc12,_0x20b412){var _0xc21049={'agent':{},'channel':_0x36bb('0x5f')};if(_0x29d3bb[_0x36bb('0x5a')]['id']){delete _0x29d3bb['body']['id'];}_0x29d3bb['body'][_0x36bb('0x60')]=!![];_0x29d3bb[_0x36bb('0x5a')][_0x36bb('0x61')]=moment()[_0x36bb('0x62')](_0x36bb('0x63'));_0x29d3bb[_0x36bb('0x5a')][_0x36bb('0x64')]=_0x29d3bb[_0x36bb('0x5a')]['UserId']||_0x29d3bb[_0x36bb('0x65')]['id'];_0xc21049[_0x36bb('0x66')]['id']=_0x29d3bb['body'][_0x36bb('0x64')];return db[_0x36bb('0x3c')][_0x36bb('0x5b')]({'where':{'id':_0x29d3bb[_0x36bb('0x55')]['id'],'UserId':null}})[_0x36bb('0x22')](handleEntityNotFound(_0x37bc12,null))[_0x36bb('0x22')](saveUpdates(_0x29d3bb[_0x36bb('0x5a')],null))[_0x36bb('0x22')](function(_0x32ce53){if(_0x32ce53){_0xc21049[_0x36bb('0x2b')]=_0x32ce53[_0x36bb('0x67')]({'plain':!![]});return db[_0x36bb('0x68')][_0x36bb('0x5b')]({'where':{'id':_0x32ce53['ChatInteractionId']}});}return null;})[_0x36bb('0x22')](handleEntityNotFound(_0x37bc12,null))['then'](function(_0x4fedfd){if(_0x4fedfd){return _0x4fedfd[_0x36bb('0x37')]({'UserId':_0x29d3bb['body'][_0x36bb('0x64')],'read1stAt':_[_0x36bb('0x69')](_0x4fedfd[_0x36bb('0x6a')])?moment()[_0x36bb('0x62')](_0x36bb('0x63')):undefined});}return null;})['then'](function(_0x3fa64f){if(_0x3fa64f){_0xc21049[_0x36bb('0x6b')]=_0x3fa64f[_0x36bb('0x67')]({'plain':!![]});interaction_log[_0x36bb('0x23')](_0x36bb('0x6c'),_0x29d3bb[_0x36bb('0x65')]['id'],_0x29d3bb['user'][_0x36bb('0x3a')],_0x29d3bb['user'][_0x36bb('0x6d')],_0xc21049['interaction']['id'],_0x29d3bb['body']?JSON[_0x36bb('0x28')](_0x29d3bb['body']):_0x36bb('0x6e'));return respondWithRpcPromise('AcceptMessage',_0x36bb('0x6f'),_0xc21049);}return null;})[_0x36bb('0x22')](function(_0x502811){var _0x21156e=_0x36bb('0x70')+_0x502811[_0x36bb('0x2b')][_0x36bb('0x71')];return db[_0x36bb('0x72')][_0x36bb('0x41')](_0x21156e,{'type':db['Sequelize'][_0x36bb('0x73')][_0x36bb('0x74')],'raw':!![]})['then'](function(_0x19cb82){return _0x19cb82;});})[_0x36bb('0x22')](function(_0x541722){if(_0x541722){_0xc21049[_0x36bb('0x2b')][_0x36bb('0x75')]=_0x541722[0x0];if(!_0x29d3bb[_0x36bb('0x5a')]['UserId'])return;return db['User'][_0x36bb('0x5b')]({'where':{'id':_0x29d3bb[_0x36bb('0x5a')]['UserId'],'role':_0x36bb('0x66')},'attributes':['id','name',_0x36bb('0x76'),'email',_0x36bb('0x77')],'raw':!![]});}return null;})[_0x36bb('0x22')](function(_0x2e06aa){if(!_0x2e06aa)return null;_0xc21049[_0x36bb('0x2b')][_0x36bb('0x66')]=_0x2e06aa;return _0xc21049;})['then'](function(_0x393515){if(_0x393515){if(_0x29d3bb[_0x36bb('0x5a')][_0x36bb('0x78')]){_0xc21049[_0x36bb('0x2b')][_0x36bb('0x79')]=util[_0x36bb('0x62')]('SIP/%s',_0x29d3bb[_0x36bb('0x65')][_0x36bb('0x3a')]);_0xc21049[_0x36bb('0x2b')][_0x36bb('0x7a')]=_0xc21049[_0x36bb('0x7a')];_0xc21049['message'][_0x36bb('0x7b')]=_0xc21049['channel'];_0xc21049[_0x36bb('0x2b')][_0x36bb('0x7c')]='accept';return respondWithRpcPromise('EventManager',_0x36bb('0x7d'),{'event':_0x36bb('0x7e'),'message':_[_0x36bb('0x4c')](_0xc21049[_0x36bb('0x2b')],JSON[_0x36bb('0x7f')](_0xc21049[_0x36bb('0x6b')][_0x36bb('0x80')]))},client9002)[_0x36bb('0x22')](function(){return _0xc21049;});}return _0xc21049;}return null;})['then'](respondWithResult(_0x37bc12,null))[_0x36bb('0x53')](handleError(_0x37bc12,null));};var interaction_log=require(_0x36bb('0x15'))(_0x36bb('0x5d'));exports['reject']=function(_0xfafa58,_0x555416,_0x2fec8a){var _0x13f40c={'agent':{},'channel':_0x36bb('0x5f')};if(_0xfafa58['body']['id']){delete _0xfafa58['body']['id'];}_0xfafa58['body'][_0x36bb('0x64')]=_0xfafa58[_0x36bb('0x5a')][_0x36bb('0x64')]||_0xfafa58[_0x36bb('0x65')]['id'];_0x13f40c[_0x36bb('0x66')]['id']=_0xfafa58[_0x36bb('0x5a')][_0x36bb('0x64')];return db[_0x36bb('0x3c')][_0x36bb('0x5b')]({'where':{'id':_0xfafa58['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x555416,null))['then'](function(_0x1f800e){if(_0x1f800e){_0x13f40c[_0x36bb('0x2b')]=_0x1f800e[_0x36bb('0x67')]({'plain':!![]});return db[_0x36bb('0x68')][_0x36bb('0x5b')]({'where':{'id':_0x1f800e[_0x36bb('0x81')]}});}return null;})[_0x36bb('0x22')](handleEntityNotFound(_0x555416,null))[_0x36bb('0x22')](function(_0x42bcb5){if(_0x42bcb5){_0x13f40c['interaction']=_0x42bcb5[_0x36bb('0x67')]({'plain':!![]});interaction_log[_0x36bb('0x23')](_0x36bb('0x82'),_0xfafa58[_0x36bb('0x65')]['id'],_0xfafa58['user']['name'],_0xfafa58[_0x36bb('0x65')]['role'],_0x13f40c[_0x36bb('0x6b')]['id'],_0xfafa58[_0x36bb('0x5a')]?JSON[_0x36bb('0x28')](_0xfafa58[_0x36bb('0x5a')]):_0x36bb('0x6e'));return respondWithRpcPromise(_0x36bb('0x83'),'rejectMessage',_0x13f40c);}return null;})[_0x36bb('0x22')](function(_0x27f2cb){var _0x1974ad='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x27f2cb[_0x36bb('0x2b')][_0x36bb('0x71')];return db[_0x36bb('0x72')]['query'](_0x1974ad,{'type':db['Sequelize'][_0x36bb('0x73')][_0x36bb('0x74')],'raw':!![]})[_0x36bb('0x22')](function(_0x53e221){return _0x53e221;});})[_0x36bb('0x22')](function(_0x4aac0c){if(_0x4aac0c){_0x13f40c['message']['contact']=_0x4aac0c[0x0];if(!_0xfafa58[_0x36bb('0x5a')][_0x36bb('0x64')])return;return db['User'][_0x36bb('0x5b')]({'where':{'id':_0xfafa58[_0x36bb('0x5a')][_0x36bb('0x64')],'role':'agent'},'attributes':['id',_0x36bb('0x3a'),_0x36bb('0x76'),'email',_0x36bb('0x77')],'raw':!![]});}return null;})[_0x36bb('0x22')](function(_0x14d2f0){if(!_0x14d2f0)return null;_0x13f40c[_0x36bb('0x2b')][_0x36bb('0x66')]=_0x14d2f0;return _0x13f40c;})[_0x36bb('0x22')](function(_0x48e095){if(_0x48e095){_0x48e095[_0x36bb('0x2b')][_0x36bb('0x79')]=util[_0x36bb('0x62')](_0x36bb('0x84'),_0xfafa58[_0x36bb('0x65')][_0x36bb('0x3a')]);_0x48e095[_0x36bb('0x2b')][_0x36bb('0x7a')]=_0x13f40c[_0x36bb('0x7a')];_0x48e095[_0x36bb('0x2b')][_0x36bb('0x7b')]=_0x13f40c[_0x36bb('0x7a')];_0x48e095['message'][_0x36bb('0x7c')]='reject';respondWithRpcPromise('EventManager',_0x36bb('0x7d'),{'event':'rejectmessage','message':_[_0x36bb('0x4c')](_0x13f40c[_0x36bb('0x2b')],JSON[_0x36bb('0x7f')](_0x13f40c[_0x36bb('0x6b')][_0x36bb('0x80')]))},client9002);return _0x13f40c;}return null;})[_0x36bb('0x22')](respondWithResult(_0x555416,null))[_0x36bb('0x53')](handleError(_0x555416,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 97d56ae..10cdcae 100644
--- a/server/api/chatMessage/chatMessage.events.js
+++ b/server/api/chatMessage/chatMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3cd9=['setMaxListeners','save','emit','hasOwnProperty','hook','exports','events','ChatMessage'];(function(_0x3fcf93,_0xe1d945){var _0x5424c9=function(_0x3b0c31){while(--_0x3b0c31){_0x3fcf93['push'](_0x3fcf93['shift']());}};_0x5424c9(++_0xe1d945);}(_0x3cd9,0x146));var _0x93cd=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0x3cd9[_0x173d7e];return _0x2220d6;};'use strict';var EventEmitter=require(_0x93cd('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x93cd('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x93cd('0x2')](0x0);var events={'afterCreate':_0x93cd('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x35888b){return function(_0x41b15f,_0x44e7e7,_0x4b8afd){ChatMessageEvents[_0x93cd('0x4')](_0x35888b+':'+_0x41b15f['id'],_0x41b15f);ChatMessageEvents[_0x93cd('0x4')](_0x35888b,_0x41b15f);_0x4b8afd(null);};}for(var e in events){if(events[_0x93cd('0x5')](e)){var event=events[e];ChatMessage[_0x93cd('0x6')](e,emitEvent(event));}}module[_0x93cd('0x7')]=ChatMessageEvents;
\ No newline at end of file
+var _0xcc3c=['remove','emit','hasOwnProperty','hook','../../mysqldb','ChatMessage','save','update'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0xcc3c,0x1cc));var _0xccc3=function(_0x3c0a2e,_0x17072c){_0x3c0a2e=_0x3c0a2e-0x0;var _0x44dbc2=_0xcc3c[_0x3c0a2e];return _0x44dbc2;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xccc3('0x0'))['db'][_0xccc3('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xccc3('0x2'),'afterUpdate':_0xccc3('0x3'),'afterDestroy':_0xccc3('0x4')};function emitEvent(_0x41f078){return function(_0xf9f4d4,_0x167267,_0x3142c0){ChatMessageEvents[_0xccc3('0x5')](_0x41f078+':'+_0xf9f4d4['id'],_0xf9f4d4);ChatMessageEvents[_0xccc3('0x5')](_0x41f078,_0xf9f4d4);_0x3142c0(null);};}for(var e in events){if(events[_0xccc3('0x6')](e)){var event=events[e];ChatMessage[_0xccc3('0x7')](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index c7afd1e..a5c2cda 100644
--- a/server/api/chatMessage/chatMessage.model.js
+++ b/server/api/chatMessage/chatMessage.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xad7a=['FULLTEXT','models','toLowerCase','direction','out','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatMessage.attributes','exports','define','chat_messages','fti_chat_messages','body'];(function(_0x1e393b,_0x355f6b){var _0x3d0bfe=function(_0x320830){while(--_0x320830){_0x1e393b['push'](_0x1e393b['shift']());}};_0x3d0bfe(++_0x355f6b);}(_0xad7a,0x1b1));var _0xaad7=function(_0x247e38,_0x1c9dda){_0x247e38=_0x247e38-0x0;var _0x33c15b=_0xad7a[_0x247e38];return _0x33c15b;};'use strict';var _=require(_0xaad7('0x0'));var util=require(_0xaad7('0x1'));var logger=require(_0xaad7('0x2'))(_0xaad7('0x3'));var moment=require(_0xaad7('0x4'));var BPromise=require(_0xaad7('0x5'));var rp=require(_0xaad7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaad7('0x7'));var config=require(_0xaad7('0x8'));var attributes=require(_0xaad7('0x9'));module[_0xaad7('0xa')]=function(_0xb0cd1f,_0x171abe){return _0xb0cd1f[_0xaad7('0xb')]('ChatMessage',attributes,{'tableName':_0xaad7('0xc'),'paranoid':![],'indexes':[{'name':_0xaad7('0xd'),'fields':[_0xaad7('0xe')],'type':_0xaad7('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2e6c9f,_0x214b5e,_0x144c85){var _0x5d80a3=_0xb0cd1f[_0xaad7('0x10')];var _0x10900f=_0x2e6c9f['get']({'plain':!![]});if(_0x10900f['direction'][_0xaad7('0x11')]()==='in'||_0x10900f[_0xaad7('0x12')]['toLowerCase']()===_0xaad7('0x13')&&!_0x10900f['secret']&&!_[_0xaad7('0x14')](_0x10900f[_0xaad7('0x15')])){_0x5d80a3[_0xaad7('0x16')][_0xaad7('0x17')]({'where':{'id':_0x10900f[_0xaad7('0x18')]}})[_0xaad7('0x19')](function(_0x4dc42b){if(_0x4dc42b){_0x4dc42b[_0xaad7('0x1a')]({'lastMsgAt':_0x10900f[_0xaad7('0x1b')],'lastMsgDirection':_0x10900f[_0xaad7('0x12')]['toLowerCase']()});}})[_0xaad7('0x1c')](function(_0x598fdd){console[_0xaad7('0x1d')](_0x598fdd);});}_0x144c85();}},'charset':_0xaad7('0x1e'),'collate':_0xaad7('0x1f')});};
\ No newline at end of file
+var _0x9f7b=['catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./chatMessage.attributes','exports','ChatMessage','fti_chat_messages','body','models','direction','toLowerCase','out','secret','isNil','UserId','findOne','then','update','createdAt'];(function(_0x695b76,_0x551526){var _0x1dc21f=function(_0x5fdb1c){while(--_0x5fdb1c){_0x695b76['push'](_0x695b76['shift']());}};_0x1dc21f(++_0x551526);}(_0x9f7b,0xdc));var _0xb9f7=function(_0x26ec3f,_0x3ad343){_0x26ec3f=_0x26ec3f-0x0;var _0x1ea443=_0x9f7b[_0x26ec3f];return _0x1ea443;};'use strict';var _=require('lodash');var util=require(_0xb9f7('0x0'));var logger=require(_0xb9f7('0x1'))(_0xb9f7('0x2'));var moment=require(_0xb9f7('0x3'));var BPromise=require(_0xb9f7('0x4'));var rp=require(_0xb9f7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb9f7('0x6'));var config=require('../../config/environment');var attributes=require(_0xb9f7('0x7'));module[_0xb9f7('0x8')]=function(_0x522fe6,_0x2d4d39){return _0x522fe6['define'](_0xb9f7('0x9'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0xb9f7('0xa'),'fields':[_0xb9f7('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x434aa1,_0x87cced,_0xece0b){var _0x1af0e3=_0x522fe6[_0xb9f7('0xc')];var _0xf2d60a=_0x434aa1['get']({'plain':!![]});if(_0xf2d60a[_0xb9f7('0xd')][_0xb9f7('0xe')]()==='in'||_0xf2d60a[_0xb9f7('0xd')][_0xb9f7('0xe')]()===_0xb9f7('0xf')&&!_0xf2d60a[_0xb9f7('0x10')]&&!_[_0xb9f7('0x11')](_0xf2d60a[_0xb9f7('0x12')])){_0x1af0e3['ChatInteraction'][_0xb9f7('0x13')]({'where':{'id':_0xf2d60a['ChatInteractionId']}})[_0xb9f7('0x14')](function(_0x16d697){if(_0x16d697){_0x16d697[_0xb9f7('0x15')]({'lastMsgAt':_0xf2d60a[_0xb9f7('0x16')],'lastMsgDirection':_0xf2d60a[_0xb9f7('0xd')]['toLowerCase']()});}})[_0xb9f7('0x17')](function(_0x23280d){console[_0xb9f7('0x18')](_0x23280d);});}_0xece0b();}},'charset':_0xb9f7('0x19'),'collate':_0xb9f7('0x1a')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 3c475a7..06fa428 100644
--- a/server/api/chatMessage/chatMessage.rpc.js
+++ b/server/api/chatMessage/chatMessage.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdae3=['info','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s','error','message','result','catch','ChatMessage','body','options','CreateChatMessage','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then'];(function(_0x2b68fd,_0x594330){var _0x367bad=function(_0x5826bc){while(--_0x5826bc){_0x2b68fd['push'](_0x2b68fd['shift']());}};_0x367bad(++_0x594330);}(_0xdae3,0x10e));var _0x3dae=function(_0x19c1d9,_0x530af1){_0x19c1d9=_0x19c1d9-0x0;var _0x298bd2=_0xdae3[_0x19c1d9];return _0x298bd2;};'use strict';var _=require(_0x3dae('0x0'));var util=require(_0x3dae('0x1'));var moment=require(_0x3dae('0x2'));var BPromise=require(_0x3dae('0x3'));var rs=require(_0x3dae('0x4'));var fs=require('fs');var Redis=require(_0x3dae('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3dae('0x6'))(_0x3dae('0x7'));var config=require(_0x3dae('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3dae('0x9')]['http']({'port':0x232a});config[_0x3dae('0xa')]=_[_0x3dae('0xb')](config[_0x3dae('0xa')],{'host':_0x3dae('0xc'),'port':0x18eb});var socket=require(_0x3dae('0xd'))(new Redis(config['redis']));require(_0x3dae('0xe'))[_0x3dae('0xf')](socket);function respondWithRpcPromise(_0x4f5f9e,_0x535685,_0x554ed4){return new BPromise(function(_0x4e3295,_0x4f0808){return client[_0x3dae('0x10')](_0x4f5f9e,_0x554ed4)[_0x3dae('0x11')](function(_0x512fed){logger[_0x3dae('0x12')]('ChatMessage,\x20%s,\x20%s',_0x535685,'request\x20sent');logger[_0x3dae('0x13')](_0x3dae('0x14'),_0x535685,_0x3dae('0x15'),JSON['stringify'](_0x512fed));if(_0x512fed['error']){if(_0x512fed['error']['code']===0x1f4){logger['error'](_0x3dae('0x16'),_0x535685,_0x512fed[_0x3dae('0x17')][_0x3dae('0x18')]);return _0x4f0808(_0x512fed[_0x3dae('0x17')]['message']);}logger[_0x3dae('0x17')](_0x3dae('0x16'),_0x535685,_0x512fed[_0x3dae('0x17')]['message']);return _0x4e3295(_0x512fed[_0x3dae('0x17')][_0x3dae('0x18')]);}else{logger[_0x3dae('0x12')](_0x3dae('0x16'),_0x535685,_0x3dae('0x15'));_0x4e3295(_0x512fed[_0x3dae('0x19')][_0x3dae('0x18')]);}})[_0x3dae('0x1a')](function(_0x7b1c17){logger['error']('ChatMessage,\x20%s,\x20%s',_0x535685,_0x7b1c17);_0x4f0808(_0x7b1c17);});});}exports['CreateChatMessage']=function(_0x137434){var _0x4e8c31=this;return new Promise(function(_0x155c4b,_0x238190){return db[_0x3dae('0x1b')]['create'](_0x137434[_0x3dae('0x1c')],{'raw':_0x137434[_0x3dae('0x1d')]?_0x137434[_0x3dae('0x1d')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x6b35b){logger['info'](_0x3dae('0x1e'),_0x137434);logger[_0x3dae('0x13')]('CreateChatMessage',_0x137434,JSON[_0x3dae('0x1f')](_0x6b35b));_0x155c4b(_0x6b35b);})[_0x3dae('0x1a')](function(_0x316b61){logger[_0x3dae('0x17')](_0x3dae('0x1e'),_0x316b61['message'],_0x137434);_0x238190(_0x4e8c31[_0x3dae('0x17')](0x1f4,_0x316b61[_0x3dae('0x18')]));});});};
\ No newline at end of file
+var _0xff2c=['create','options','raw','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateChatMessage','ChatMessage'];(function(_0x38854e,_0x23cbc9){var _0x3f8415=function(_0x4e493e){while(--_0x4e493e){_0x38854e['push'](_0x38854e['shift']());}};_0x3f8415(++_0x23cbc9);}(_0xff2c,0x88));var _0xcff2=function(_0x24fa1a,_0x16d9c2){_0x24fa1a=_0x24fa1a-0x0;var _0xc5621f=_0xff2c[_0x24fa1a];return _0xc5621f;};'use strict';var _=require('lodash');var util=require(_0xcff2('0x0'));var moment=require('moment');var BPromise=require(_0xcff2('0x1'));var rs=require(_0xcff2('0x2'));var fs=require('fs');var Redis=require(_0xcff2('0x3'));var db=require(_0xcff2('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xcff2('0x5'))(_0xcff2('0x6'));var config=require(_0xcff2('0x7'));var jayson=require(_0xcff2('0x8'));var client=jayson[_0xcff2('0x9')][_0xcff2('0xa')]({'port':0x232a});config[_0xcff2('0xb')]=_['defaults'](config[_0xcff2('0xb')],{'host':_0xcff2('0xc'),'port':0x18eb});var socket=require(_0xcff2('0xd'))(new Redis(config['redis']));require(_0xcff2('0xe'))[_0xcff2('0xf')](socket);function respondWithRpcPromise(_0x2e47d1,_0x5acdad,_0x54a1d1){return new BPromise(function(_0x2b6550,_0xfa8629){return client[_0xcff2('0x10')](_0x2e47d1,_0x54a1d1)[_0xcff2('0x11')](function(_0x196860){logger[_0xcff2('0x12')](_0xcff2('0x13'),_0x5acdad,_0xcff2('0x14'));logger[_0xcff2('0x15')](_0xcff2('0x16'),_0x5acdad,_0xcff2('0x14'),JSON[_0xcff2('0x17')](_0x196860));if(_0x196860[_0xcff2('0x18')]){if(_0x196860[_0xcff2('0x18')][_0xcff2('0x19')]===0x1f4){logger['error'](_0xcff2('0x13'),_0x5acdad,_0x196860[_0xcff2('0x18')]['message']);return _0xfa8629(_0x196860[_0xcff2('0x18')][_0xcff2('0x1a')]);}logger['error'](_0xcff2('0x13'),_0x5acdad,_0x196860['error']['message']);return _0x2b6550(_0x196860[_0xcff2('0x18')][_0xcff2('0x1a')]);}else{logger[_0xcff2('0x12')](_0xcff2('0x13'),_0x5acdad,_0xcff2('0x14'));_0x2b6550(_0x196860['result']['message']);}})['catch'](function(_0x5a58f4){logger[_0xcff2('0x18')](_0xcff2('0x13'),_0x5acdad,_0x5a58f4);_0xfa8629(_0x5a58f4);});});}exports[_0xcff2('0x1b')]=function(_0x55c2b6){var _0x4d074e=this;return new Promise(function(_0x3fe88e,_0x5213d6){return db[_0xcff2('0x1c')][_0xcff2('0x1d')](_0x55c2b6['body'],{'raw':_0x55c2b6[_0xcff2('0x1e')]?_0x55c2b6[_0xcff2('0x1e')][_0xcff2('0x1f')]===undefined?!![]:![]:!![]})[_0xcff2('0x11')](function(_0x5e985d){logger[_0xcff2('0x12')](_0xcff2('0x1b'),_0x55c2b6);logger[_0xcff2('0x15')](_0xcff2('0x1b'),_0x55c2b6,JSON[_0xcff2('0x17')](_0x5e985d));_0x3fe88e(_0x5e985d);})[_0xcff2('0x20')](function(_0x28cbd1){logger[_0xcff2('0x18')]('CreateChatMessage',_0x28cbd1[_0xcff2('0x1a')],_0x55c2b6);_0x5213d6(_0x4d074e['error'](0x1f4,_0x28cbd1[_0xcff2('0x1a')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 0dcc3e0..9f2b8eb 100644
--- a/server/api/chatMessage/chatMessage.socket.js
+++ b/server/api/chatMessage/chatMessage.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd6d6=['chatMessage:','./chatMessage.events','save','remove','update','emit','removeListener','register','length'];(function(_0x2a38d4,_0x43ddc8){var _0x41379e=function(_0xce721f){while(--_0xce721f){_0x2a38d4['push'](_0x2a38d4['shift']());}};_0x41379e(++_0x43ddc8);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x1fe49f,_0x4e690a){_0x1fe49f=_0x1fe49f-0x0;var _0x18bdd5=_0xd6d6[_0x1fe49f];return _0x18bdd5;};'use strict';var ChatMessageEvents=require(_0x6d6d('0x0'));var events=[_0x6d6d('0x1'),_0x6d6d('0x2'),_0x6d6d('0x3')];function createListener(_0x536523,_0x2e1aed){return function(_0x3b743d){_0x2e1aed[_0x6d6d('0x4')](_0x536523,_0x3b743d);};}function removeListener(_0x2a838a,_0x5207c9){return function(){ChatMessageEvents[_0x6d6d('0x5')](_0x2a838a,_0x5207c9);};}exports[_0x6d6d('0x6')]=function(_0x5702dc){for(var _0x210ff7=0x0,_0x1bf731=events[_0x6d6d('0x7')];_0x210ff7<_0x1bf731;_0x210ff7++){var _0x18f824=events[_0x210ff7];var _0xd49f57=createListener(_0x6d6d('0x8')+_0x18f824,_0x5702dc);ChatMessageEvents['on'](_0x18f824,_0xd49f57);}};
\ No newline at end of file
+var _0x05bc=['update','emit','removeListener','register','length','chatMessage:','save'];(function(_0x4923fd,_0x463a25){var _0x2bb776=function(_0x456f37){while(--_0x456f37){_0x4923fd['push'](_0x4923fd['shift']());}};_0x2bb776(++_0x463a25);}(_0x05bc,0xae));var _0xc05b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x05bc[_0x3dd15e];return _0x231fd0;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0xc05b('0x0'),'remove',_0xc05b('0x1')];function createListener(_0x2762de,_0x59d194){return function(_0x36c0ca){_0x59d194[_0xc05b('0x2')](_0x2762de,_0x36c0ca);};}function removeListener(_0xf971c9,_0x36356e){return function(){ChatMessageEvents[_0xc05b('0x3')](_0xf971c9,_0x36356e);};}exports[_0xc05b('0x4')]=function(_0x2514a1){for(var _0x22c8db=0x0,_0x9c6c57=events[_0xc05b('0x5')];_0x22c8db<_0x9c6c57;_0x22c8db++){var _0x275f0f=events[_0x22c8db];var _0x143ba4=createListener(_0xc05b('0x6')+_0x275f0f,_0x2514a1);ChatMessageEvents['on'](_0x275f0f,_0x143ba4);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 59819e8..b8c1409 100644
--- a/server/api/chatMessage/index.js
+++ b/server/api/chatMessage/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4c41=['tracked','chat','chatmessage:create','create','put','update','/:id/reject','reject','delete','/:id','destroy','exports','multer','path','express','fs-extra','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','show','post'];(function(_0x487f47,_0x32b30b){var _0x35988b=function(_0x589ef6){while(--_0x589ef6){_0x487f47['push'](_0x487f47['shift']());}};_0x35988b(++_0x32b30b);}(_0x4c41,0x174));var _0x14c4=function(_0x21ce08,_0xc2b67){_0x21ce08=_0x21ce08-0x0;var _0x347516=_0x4c41[_0x21ce08];return _0x347516;};'use strict';var multer=require(_0x14c4('0x0'));var util=require('util');var path=require(_0x14c4('0x1'));var timeout=require('connect-timeout');var express=require(_0x14c4('0x2'));var router=express['Router']();var fs_extra=require(_0x14c4('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x14c4('0x4'));router[_0x14c4('0x5')]('/',auth[_0x14c4('0x6')](),controller[_0x14c4('0x7')]);router[_0x14c4('0x5')](_0x14c4('0x8'),auth[_0x14c4('0x6')](),controller[_0x14c4('0x9')]);router[_0x14c4('0x5')]('/:id',auth['isAuthenticated'](),controller[_0x14c4('0xa')]);router[_0x14c4('0xb')]('/',auth[_0x14c4('0x6')](),interaction[_0x14c4('0xc')](_0x14c4('0xd'),_0x14c4('0xe')),controller[_0x14c4('0xf')]);router[_0x14c4('0x10')]('/:id',controller[_0x14c4('0x11')]);router[_0x14c4('0x10')]('/:id/accept',auth[_0x14c4('0x6')](),controller['accept']);router[_0x14c4('0x10')](_0x14c4('0x12'),auth['isAuthenticated'](),controller[_0x14c4('0x13')]);router[_0x14c4('0x14')](_0x14c4('0x15'),auth[_0x14c4('0x6')](),controller[_0x14c4('0x16')]);module[_0x14c4('0x17')]=router;
\ No newline at end of file
+var _0x716c=['tracked','chat','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./chatMessage.controller','get','isAuthenticated','describe','/:id','show','post'];(function(_0x146811,_0x464fb6){var _0x5f2cd7=function(_0x59baf5){while(--_0x59baf5){_0x146811['push'](_0x146811['shift']());}};_0x5f2cd7(++_0x464fb6);}(_0x716c,0xa7));var _0xc716=function(_0x2b3fa2,_0x32c747){_0x2b3fa2=_0x2b3fa2-0x0;var _0x5b6acc=_0x716c[_0x2b3fa2];return _0x5b6acc;};'use strict';var multer=require(_0xc716('0x0'));var util=require(_0xc716('0x1'));var path=require(_0xc716('0x2'));var timeout=require(_0xc716('0x3'));var express=require(_0xc716('0x4'));var router=express[_0xc716('0x5')]();var fs_extra=require(_0xc716('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc716('0x7'));var controller=require(_0xc716('0x8'));router[_0xc716('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc716('0x9')]('/describe',auth[_0xc716('0xa')](),controller[_0xc716('0xb')]);router[_0xc716('0x9')](_0xc716('0xc'),auth[_0xc716('0xa')](),controller[_0xc716('0xd')]);router[_0xc716('0xe')]('/',auth[_0xc716('0xa')](),interaction[_0xc716('0xf')](_0xc716('0x10'),_0xc716('0x11')),controller[_0xc716('0x12')]);router[_0xc716('0x13')](_0xc716('0xc'),controller[_0xc716('0x14')]);router[_0xc716('0x13')](_0xc716('0x15'),auth[_0xc716('0xa')](),controller[_0xc716('0x16')]);router[_0xc716('0x13')](_0xc716('0x17'),auth['isAuthenticated'](),controller['reject']);router[_0xc716('0x18')]('/:id',auth[_0xc716('0xa')](),controller[_0xc716('0x19')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 92fb8ca..293840f 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f66=['medium','TEXT','exports'];(function(_0x165983,_0x5d33f0){var _0x2bdd01=function(_0x130e80){while(--_0x130e80){_0x165983['push'](_0x165983['shift']());}};_0x2bdd01(++_0x5d33f0);}(_0x5f66,0x1a0));var _0x65f6=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x5f66[_0x138adb];return _0x1b27f2;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x65f6('0x2')](_0x65f6('0x1')),'allowNull':![]}};
\ No newline at end of file
+var _0x0b0e=['medium','sequelize','TEXT'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3d13bb,_0x262a54){_0x3d13bb=_0x3d13bb-0x0;var _0x4b5a1b=_0x0b0e[_0x3d13bb];return _0x4b5a1b;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('0x2')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index c75fca0..aab91d4 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x2e089c,_0x320e17){var _0x1560c2=function(_0x98bc8){while(--_0x98bc8){_0x2e089c['push'](_0x2e089c['shift']());}};_0x1560c2(++_0x320e17);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
+var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0xef0477,_0x153cdf){var _0x3ea869=function(_0x2c8778){while(--_0x2c8778){_0xef0477['push'](_0xef0477['shift']());}};_0x3ea869(++_0x153cdf);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index 3d97646..d17828f 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbc20=['ChatOfflineMessage','setMaxListeners','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x46111d,_0x5d286b){var _0xe82586=function(_0x39551b){while(--_0x39551b){_0x46111d['push'](_0x46111d['shift']());}};_0xe82586(++_0x5d286b);}(_0xbc20,0x181));var _0x0bc2=function(_0x40927b,_0xf9b0a0){_0x40927b=_0x40927b-0x0;var _0x2635e8=_0xbc20[_0x40927b];return _0x2635e8;};'use strict';var EventEmitter=require(_0x0bc2('0x0'));var ChatOfflineMessage=require(_0x0bc2('0x1'))['db'][_0x0bc2('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x0bc2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0bc2('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4d1076){return function(_0x1c455b,_0x2b95d3,_0x564cbf){ChatOfflineMessageEvents[_0x0bc2('0x5')](_0x4d1076+':'+_0x1c455b['id'],_0x1c455b);ChatOfflineMessageEvents['emit'](_0x4d1076,_0x1c455b);_0x564cbf(null);};}for(var e in events){if(events[_0x0bc2('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x0bc2('0x7')](e,emitEvent(event));}}module[_0x0bc2('0x8')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x3b40=['ChatOfflineMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','../../mysqldb'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x3b40,0x13a));var _0x03b4=function(_0x3119cb,_0x470a49){_0x3119cb=_0x3119cb-0x0;var _0x19d737=_0x3b40[_0x3119cb];return _0x19d737;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x03b4('0x0'))['db'][_0x03b4('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x03b4('0x2')](0x0);var events={'afterCreate':_0x03b4('0x3'),'afterUpdate':_0x03b4('0x4'),'afterDestroy':_0x03b4('0x5')};function emitEvent(_0x1472c2){return function(_0x39fc5b,_0x24449f,_0x5f47f0){ChatOfflineMessageEvents[_0x03b4('0x6')](_0x1472c2+':'+_0x39fc5b['id'],_0x39fc5b);ChatOfflineMessageEvents['emit'](_0x1472c2,_0x39fc5b);_0x5f47f0(null);};}for(var e in events){if(events[_0x03b4('0x7')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0x03b4('0x8')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 73a2d0b..5650953 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.model.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x67b3=['utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','ChatOfflineMessage','chat_offline_messages','utf8mb4'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x67b3,0x91));var _0x367b=function(_0x67f95e,_0x3ca797){_0x67f95e=_0x67f95e-0x0;var _0x538f5a=_0x67b3[_0x67f95e];return _0x538f5a;};'use strict';var attributes=require(_0x367b('0x0'));module[_0x367b('0x1')]=function(_0x319029){return _0x319029['define'](_0x367b('0x2'),attributes,{'tableName':_0x367b('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x367b('0x4'),'collate':_0x367b('0x5')});};
\ No newline at end of file
+var _0x8674=['./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x87506e,_0x5680ec){var _0x5496a4=function(_0x1e29ab){while(--_0x1e29ab){_0x87506e['push'](_0x87506e['shift']());}};_0x5496a4(++_0x5680ec);}(_0x8674,0x188));var _0x4867=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x8674[_0x32f7d7];return _0x133d09;};'use strict';var attributes=require(_0x4867('0x0'));module[_0x4867('0x1')]=function(_0x3c8b8a){return _0x3c8b8a[_0x4867('0x2')](_0x4867('0x3'),attributes,{'tableName':_0x4867('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4867('0x5'),'collate':_0x4867('0x6')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 6a6de6a..e2d8a6d 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5af9=['lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','catch'];(function(_0x339969,_0x51a7c6){var _0xd4165d=function(_0x57c869){while(--_0x57c869){_0x339969['push'](_0x339969['shift']());}};_0xd4165d(++_0x51a7c6);}(_0x5af9,0xdc));var _0x95af=function(_0x1265ed,_0x4b85e8){_0x1265ed=_0x1265ed-0x0;var _0x5ac459=_0x5af9[_0x1265ed];return _0x5ac459;};'use strict';var _=require(_0x95af('0x0'));var util=require(_0x95af('0x1'));var moment=require(_0x95af('0x2'));var BPromise=require('bluebird');var rs=require(_0x95af('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x95af('0x4'));var logger=require(_0x95af('0x5'))(_0x95af('0x6'));var config=require('../../config/environment');var jayson=require(_0x95af('0x7'));var client=jayson[_0x95af('0x8')][_0x95af('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x15005f,_0x73307d,_0x5266eb){return new BPromise(function(_0xba1a38,_0x3fdf1b){return client[_0x95af('0xa')](_0x15005f,_0x5266eb)[_0x95af('0xb')](function(_0x4dc1de){logger[_0x95af('0xc')]('ChatOfflineMessage,\x20%s,\x20%s',_0x73307d,_0x95af('0xd'));logger[_0x95af('0xe')](_0x95af('0xf'),_0x73307d,_0x95af('0xd'),JSON[_0x95af('0x10')](_0x4dc1de));if(_0x4dc1de[_0x95af('0x11')]){if(_0x4dc1de[_0x95af('0x11')][_0x95af('0x12')]===0x1f4){logger['error'](_0x95af('0x13'),_0x73307d,_0x4dc1de[_0x95af('0x11')][_0x95af('0x14')]);return _0x3fdf1b(_0x4dc1de[_0x95af('0x11')][_0x95af('0x14')]);}logger[_0x95af('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x73307d,_0x4dc1de[_0x95af('0x11')][_0x95af('0x14')]);return _0xba1a38(_0x4dc1de[_0x95af('0x11')][_0x95af('0x14')]);}else{logger[_0x95af('0xc')](_0x95af('0x13'),_0x73307d,_0x95af('0xd'));_0xba1a38(_0x4dc1de['result'][_0x95af('0x14')]);}})[_0x95af('0x15')](function(_0x1dee5e){logger[_0x95af('0x11')](_0x95af('0x13'),_0x73307d,_0x1dee5e);_0x3fdf1b(_0x1dee5e);});});}
\ No newline at end of file
+var _0x9fd0=['request','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x350a47,_0x1d9f43){var _0x152572=function(_0x53807b){while(--_0x53807b){_0x350a47['push'](_0x350a47['shift']());}};_0x152572(++_0x1d9f43);}(_0x9fd0,0x1c2));var _0x09fd=function(_0x36f80c,_0x443cdc){_0x36f80c=_0x36f80c-0x0;var _0x28b842=_0x9fd0[_0x36f80c];return _0x28b842;};'use strict';var _=require(_0x09fd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x09fd('0x1'));var fs=require('fs');var Redis=require(_0x09fd('0x2'));var db=require(_0x09fd('0x3'))['db'];var utils=require(_0x09fd('0x4'));var logger=require(_0x09fd('0x5'))(_0x09fd('0x6'));var config=require(_0x09fd('0x7'));var jayson=require(_0x09fd('0x8'));var client=jayson['client'][_0x09fd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x161604,_0x3d00e4,_0x369e91){return new BPromise(function(_0xced1bc,_0x1b3186){return client[_0x09fd('0xa')](_0x161604,_0x369e91)[_0x09fd('0xb')](function(_0x434d1e){logger['info'](_0x09fd('0xc'),_0x3d00e4,_0x09fd('0xd'));logger['debug'](_0x09fd('0xe'),_0x3d00e4,_0x09fd('0xd'),JSON['stringify'](_0x434d1e));if(_0x434d1e['error']){if(_0x434d1e[_0x09fd('0xf')][_0x09fd('0x10')]===0x1f4){logger['error'](_0x09fd('0xc'),_0x3d00e4,_0x434d1e[_0x09fd('0xf')]['message']);return _0x1b3186(_0x434d1e[_0x09fd('0xf')]['message']);}logger[_0x09fd('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3d00e4,_0x434d1e[_0x09fd('0xf')][_0x09fd('0x11')]);return _0xced1bc(_0x434d1e[_0x09fd('0xf')]['message']);}else{logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x3d00e4,_0x09fd('0xd'));_0xced1bc(_0x434d1e[_0x09fd('0x12')][_0x09fd('0x11')]);}})[_0x09fd('0x13')](function(_0x102bae){logger['error'](_0x09fd('0xc'),_0x3d00e4,_0x102bae);_0x1b3186(_0x102bae);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 56be498..bbf0cb0 100644
--- a/server/api/chatOfflineMessage/index.js
+++ b/server/api/chatOfflineMessage/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0fe6=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','index','/describe','isAuthenticated','describe','show','post','create','put','/:id','delete','destroy','exports','multer','util','path'];(function(_0x462545,_0x3c0f1b){var _0x680d51=function(_0x22727b){while(--_0x22727b){_0x462545['push'](_0x462545['shift']());}};_0x680d51(++_0x3c0f1b);}(_0x0fe6,0x11d));var _0x60fe=function(_0x46405c,_0x3d9b08){_0x46405c=_0x46405c-0x0;var _0x1d3e43=_0x0fe6[_0x46405c];return _0x1d3e43;};'use strict';var multer=require(_0x60fe('0x0'));var util=require(_0x60fe('0x1'));var path=require(_0x60fe('0x2'));var timeout=require(_0x60fe('0x3'));var express=require(_0x60fe('0x4'));var router=express[_0x60fe('0x5')]();var fs_extra=require(_0x60fe('0x6'));var auth=require(_0x60fe('0x7'));var interaction=require(_0x60fe('0x8'));var config=require(_0x60fe('0x9'));var controller=require(_0x60fe('0xa'));router[_0x60fe('0xb')]('/',auth['isAuthenticated'](),controller[_0x60fe('0xc')]);router['get'](_0x60fe('0xd'),auth[_0x60fe('0xe')](),controller[_0x60fe('0xf')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x60fe('0x10')]);router[_0x60fe('0x11')]('/',auth[_0x60fe('0xe')](),controller[_0x60fe('0x12')]);router[_0x60fe('0x13')](_0x60fe('0x14'),auth[_0x60fe('0xe')](),controller['update']);router[_0x60fe('0x15')]('/:id',auth[_0x60fe('0xe')](),controller[_0x60fe('0x16')]);module[_0x60fe('0x17')]=router;
\ No newline at end of file
+var _0x32db=['/:id','show','post','put','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','get','isAuthenticated','index','describe'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x32db,0x16e));var _0xb32d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x32db[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xb32d('0x0'));var util=require('util');var path=require(_0xb32d('0x1'));var timeout=require('connect-timeout');var express=require(_0xb32d('0x2'));var router=express[_0xb32d('0x3')]();var fs_extra=require(_0xb32d('0x4'));var auth=require(_0xb32d('0x5'));var interaction=require(_0xb32d('0x6'));var config=require('../../config/environment');var controller=require(_0xb32d('0x7'));router[_0xb32d('0x8')]('/',auth[_0xb32d('0x9')](),controller[_0xb32d('0xa')]);router[_0xb32d('0x8')]('/describe',auth[_0xb32d('0x9')](),controller[_0xb32d('0xb')]);router[_0xb32d('0x8')](_0xb32d('0xc'),auth['isAuthenticated'](),controller[_0xb32d('0xd')]);router[_0xb32d('0xe')]('/',auth[_0xb32d('0x9')](),controller['create']);router[_0xb32d('0xf')](_0xb32d('0xc'),auth[_0xb32d('0x9')](),controller['update']);router[_0xb32d('0x10')]('/:id',auth[_0xb32d('0x9')](),controller[_0xb32d('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 5af9afc..4338588 100644
--- a/server/api/chatProactiveAction/chatProactiveAction.attributes.js
+++ b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6210=['mouseOver','timeout','INTEGER','sequelize','exports','ENUM'];(function(_0x308174,_0x4e7dc4){var _0x59d18d=function(_0x1aa6a5){while(--_0x1aa6a5){_0x308174['push'](_0x308174['shift']());}};_0x59d18d(++_0x4e7dc4);}(_0x6210,0x177));var _0x0621=function(_0x5a9c0c,_0x4ec485){_0x5a9c0c=_0x5a9c0c-0x0;var _0x53c77d=_0x6210[_0x5a9c0c];return _0x53c77d;};'use strict';var Sequelize=require(_0x0621('0x0'));module[_0x0621('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x0621('0x2')](_0x0621('0x3'),_0x0621('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x0621('0x5')]}};
\ No newline at end of file
+var _0x16cb=['INTEGER','sequelize','exports','STRING','ENUM','mouseOver'];(function(_0x130927,_0x4630c0){var _0x180b7e=function(_0xf078a6){while(--_0xf078a6){_0x130927['push'](_0x130927['shift']());}};_0x180b7e(++_0x4630c0);}(_0x16cb,0x1cf));var _0xb16c=function(_0xffdd96,_0x5d72a5){_0xffdd96=_0xffdd96-0x0;var _0x6f7980=_0x16cb[_0xffdd96];return _0x6f7980;};'use strict';var Sequelize=require(_0xb16c('0x0'));module[_0xb16c('0x1')]={'name':{'type':Sequelize[_0xb16c('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xb16c('0x3')](_0xb16c('0x4'),'timeout'),'defaultValue':_0xb16c('0x4')},'selector':{'type':Sequelize[_0xb16c('0x2')]},'timeout':{'type':Sequelize[_0xb16c('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index e11f10e..95c4e7e 100644
--- a/server/api/chatProactiveAction/chatProactiveAction.controller.js
+++ b/server/api/chatProactiveAction/chatProactiveAction.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x60c2=['intersection','length','attributes','includeAll','include','merge','options','ChatProactiveAction','catch','create','body','params','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','model','keys','rawAttributes','query','filters'];(function(_0x3460c9,_0x565510){var _0x1d8283=function(_0x8a51bd){while(--_0x8a51bd){_0x3460c9['push'](_0x3460c9['shift']());}};_0x1d8283(++_0x565510);}(_0x60c2,0x8f));var _0x260c=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x60c2[_0x432682];return _0x463d05;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x260c('0x0'));var zipdir=require(_0x260c('0x1'));var jsonpatch=require(_0x260c('0x2'));var rp=require(_0x260c('0x3'));var moment=require(_0x260c('0x4'));var BPromise=require(_0x260c('0x5'));var Mustache=require(_0x260c('0x6'));var util=require(_0x260c('0x7'));var path=require(_0x260c('0x8'));var sox=require(_0x260c('0x9'));var csv=require(_0x260c('0xa'));var ejs=require(_0x260c('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x260c('0xc'));var squel=require(_0x260c('0xd'));var crypto=require(_0x260c('0xe'));var jsforce=require(_0x260c('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x260c('0xa'));var querystring=require(_0x260c('0x10'));var Papa=require(_0x260c('0x11'));var Redis=require(_0x260c('0x12'));var authService=require(_0x260c('0x13'));var qs=require(_0x260c('0x14'));var as=require(_0x260c('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x260c('0x16'))(_0x260c('0x17'));var utils=require(_0x260c('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x260c('0x19'));var db=require(_0x260c('0x1a'))['db'];function respondWithStatusCode(_0x191490,_0x5aed37){_0x5aed37=_0x5aed37||0xcc;return function(_0xc44e8d){if(_0xc44e8d){return _0x191490[_0x260c('0x1b')](_0x5aed37);}return _0x191490[_0x260c('0x1c')](_0x5aed37)[_0x260c('0x1d')]();};}function respondWithResult(_0x1d3775,_0x53df53){_0x53df53=_0x53df53||0xc8;return function(_0x3930b6){if(_0x3930b6){return _0x1d3775['status'](_0x53df53)[_0x260c('0x1e')](_0x3930b6);}};}function respondWithFilteredResult(_0x5a021c,_0x47edc1){return function(_0xd8b310){if(_0xd8b310){var _0x5299a4=typeof _0x47edc1[_0x260c('0x1f')]===_0x260c('0x20')&&typeof _0x47edc1[_0x260c('0x21')]===_0x260c('0x20');var _0x2bf3b8=_0xd8b310[_0x260c('0x22')];var _0x11e634=_0x5299a4?0x0:_0x47edc1[_0x260c('0x1f')];var _0x201e59=_0x5299a4?_0xd8b310[_0x260c('0x22')]:_0x47edc1[_0x260c('0x1f')]+_0x47edc1['limit'];var _0xd977b;if(_0x201e59>=_0x2bf3b8){_0x201e59=_0x2bf3b8;_0xd977b=0xc8;}else{_0xd977b=0xce;}_0x5a021c['status'](_0xd977b);return _0x5a021c[_0x260c('0x23')](_0x260c('0x24'),_0x11e634+'-'+_0x201e59+'/'+_0x2bf3b8)['json'](_0xd8b310);}return null;};}function patchUpdates(_0x1ccf81){return function(_0xe824db){try{jsonpatch[_0x260c('0x25')](_0xe824db,_0x1ccf81,!![]);}catch(_0x1c53e1){return BPromise[_0x260c('0x26')](_0x1c53e1);}return _0xe824db[_0x260c('0x27')]();};}function saveUpdates(_0x4b5b7a,_0xd5b7d8){return function(_0x158bc6){if(_0x158bc6){return _0x158bc6[_0x260c('0x28')](_0x4b5b7a)[_0x260c('0x29')](function(_0x58688c){return _0x58688c;});}return null;};}function removeEntity(_0x3f299f,_0x304961){return function(_0x461c8a){if(_0x461c8a){return _0x461c8a[_0x260c('0x2a')]()['then'](function(){_0x3f299f[_0x260c('0x1c')](0xcc)[_0x260c('0x1d')]();});}};}function handleEntityNotFound(_0x3bdfce,_0x29e10e){return function(_0x4cf0f9){if(!_0x4cf0f9){_0x3bdfce[_0x260c('0x1b')](0x194);}return _0x4cf0f9;};}function handleError(_0x2957e5,_0x480179){_0x480179=_0x480179||0x1f4;return function(_0x5def72){logger[_0x260c('0x2b')](_0x5def72[_0x260c('0x2c')]);if(_0x5def72[_0x260c('0x2d')]){delete _0x5def72[_0x260c('0x2d')];}_0x2957e5[_0x260c('0x1c')](_0x480179)[_0x260c('0x2e')](_0x5def72);};}exports['show']=function(_0xf1ad3e,_0x2e49dd){var _0x16b663={'raw':!![],'where':{'id':_0xf1ad3e['params']['id']}},_0x233a61={};_0x233a61[_0x260c('0x2f')]=_[_0x260c('0x30')](db['ChatProactiveAction'][_0x260c('0x31')]);_0x233a61[_0x260c('0x32')]=_[_0x260c('0x30')](_0xf1ad3e[_0x260c('0x32')]);_0x233a61[_0x260c('0x33')]=_[_0x260c('0x34')](_0x233a61[_0x260c('0x2f')],_0x233a61[_0x260c('0x32')]);_0x16b663['attributes']=_[_0x260c('0x34')](_0x233a61[_0x260c('0x2f')],qs['fields'](_0xf1ad3e[_0x260c('0x32')]['fields']));_0x16b663['attributes']=_0x16b663['attributes'][_0x260c('0x35')]?_0x16b663[_0x260c('0x36')]:_0x233a61['model'];if(_0xf1ad3e[_0x260c('0x32')][_0x260c('0x37')]){_0x16b663[_0x260c('0x38')]=[{'all':!![]}];}_0x16b663=_[_0x260c('0x39')]({},_0x16b663,_0xf1ad3e[_0x260c('0x3a')]);return db[_0x260c('0x3b')]['find'](_0x16b663)[_0x260c('0x29')](handleEntityNotFound(_0x2e49dd,null))[_0x260c('0x29')](respondWithResult(_0x2e49dd,null))[_0x260c('0x3c')](handleError(_0x2e49dd,null));};exports[_0x260c('0x3d')]=function(_0xd12212,_0x220738){return db[_0x260c('0x3b')][_0x260c('0x3d')](_0xd12212[_0x260c('0x3e')],{})['then'](respondWithResult(_0x220738,0xc9))[_0x260c('0x3c')](handleError(_0x220738,null));};exports['update']=function(_0x5362dd,_0x5287ee){if(_0x5362dd['body']['id']){delete _0x5362dd['body']['id'];}return db['ChatProactiveAction']['find']({'where':{'id':_0x5362dd[_0x260c('0x3f')]['id']}})[_0x260c('0x29')](handleEntityNotFound(_0x5287ee,null))[_0x260c('0x29')](saveUpdates(_0x5362dd[_0x260c('0x3e')],null))['then'](respondWithResult(_0x5287ee,null))[_0x260c('0x3c')](handleError(_0x5287ee,null));};exports[_0x260c('0x2a')]=function(_0x5f5120,_0x35afd6){return db[_0x260c('0x3b')][_0x260c('0x40')]({'where':{'id':_0x5f5120[_0x260c('0x3f')]['id']}})[_0x260c('0x29')](handleEntityNotFound(_0x35afd6,null))['then'](removeEntity(_0x35afd6,null))['catch'](handleError(_0x35afd6,null));};
\ No newline at end of file
+var _0x212b=['querystring','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','json','apply','reject','save','update','then','destroy','error','name','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','length','include','merge','options','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js'];(function(_0x1283d4,_0x36b6f1){var _0x433643=function(_0x4c9fbe){while(--_0x4c9fbe){_0x1283d4['push'](_0x1283d4['shift']());}};_0x433643(++_0x36b6f1);}(_0x212b,0x148));var _0xb212=function(_0x1de219,_0x3c742e){_0x1de219=_0x1de219-0x0;var _0x1ab5d7=_0x212b[_0x1de219];return _0x1ab5d7;};'use strict';var emlformat=require(_0xb212('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb212('0x1'));var jsonpatch=require(_0xb212('0x2'));var rp=require(_0xb212('0x3'));var moment=require(_0xb212('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb212('0x5'));var util=require(_0xb212('0x6'));var path=require(_0xb212('0x7'));var sox=require('sox');var csv=require(_0xb212('0x8'));var ejs=require(_0xb212('0x9'));var fs=require('fs');var fs_extra=require(_0xb212('0xa'));var _=require('lodash');var squel=require(_0xb212('0xb'));var crypto=require(_0xb212('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb212('0xd'));var toCsv=require(_0xb212('0x8'));var querystring=require(_0xb212('0xe'));var Papa=require('papaparse');var Redis=require(_0xb212('0xf'));var authService=require(_0xb212('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb212('0x11'))('api');var utils=require(_0xb212('0x12'));var config=require(_0xb212('0x13'));var licenseUtil=require(_0xb212('0x14'));var db=require(_0xb212('0x15'))['db'];function respondWithStatusCode(_0x41eba8,_0x1dd322){_0x1dd322=_0x1dd322||0xcc;return function(_0x11ea42){if(_0x11ea42){return _0x41eba8[_0xb212('0x16')](_0x1dd322);}return _0x41eba8[_0xb212('0x17')](_0x1dd322)[_0xb212('0x18')]();};}function respondWithResult(_0x2b64a7,_0x2f12bf){_0x2f12bf=_0x2f12bf||0xc8;return function(_0x5118f5){if(_0x5118f5){return _0x2b64a7['status'](_0x2f12bf)['json'](_0x5118f5);}};}function respondWithFilteredResult(_0x4baa5b,_0x105d4c){return function(_0x11dcab){if(_0x11dcab){var _0x1b2f6d=typeof _0x105d4c['offset']===_0xb212('0x19')&&typeof _0x105d4c[_0xb212('0x1a')]===_0xb212('0x19');var _0xaffb30=_0x11dcab[_0xb212('0x1b')];var _0x267c58=_0x1b2f6d?0x0:_0x105d4c[_0xb212('0x1c')];var _0xe6b2f8=_0x1b2f6d?_0x11dcab[_0xb212('0x1b')]:_0x105d4c[_0xb212('0x1c')]+_0x105d4c[_0xb212('0x1a')];var _0x30f248;if(_0xe6b2f8>=_0xaffb30){_0xe6b2f8=_0xaffb30;_0x30f248=0xc8;}else{_0x30f248=0xce;}_0x4baa5b[_0xb212('0x17')](_0x30f248);return _0x4baa5b['set']('Content-Range',_0x267c58+'-'+_0xe6b2f8+'/'+_0xaffb30)[_0xb212('0x1d')](_0x11dcab);}return null;};}function patchUpdates(_0x409e51){return function(_0x228a57){try{jsonpatch[_0xb212('0x1e')](_0x228a57,_0x409e51,!![]);}catch(_0x1a374d){return BPromise[_0xb212('0x1f')](_0x1a374d);}return _0x228a57[_0xb212('0x20')]();};}function saveUpdates(_0x19fc16,_0x3b9361){return function(_0x30aaba){if(_0x30aaba){return _0x30aaba[_0xb212('0x21')](_0x19fc16)[_0xb212('0x22')](function(_0x114d8f){return _0x114d8f;});}return null;};}function removeEntity(_0x491c3b,_0x5e0c12){return function(_0x25d40e){if(_0x25d40e){return _0x25d40e[_0xb212('0x23')]()[_0xb212('0x22')](function(){_0x491c3b[_0xb212('0x17')](0xcc)[_0xb212('0x18')]();});}};}function handleEntityNotFound(_0x2b9046,_0x2aafe4){return function(_0x4ca0a2){if(!_0x4ca0a2){_0x2b9046[_0xb212('0x16')](0x194);}return _0x4ca0a2;};}function handleError(_0x48d420,_0xd1180f){_0xd1180f=_0xd1180f||0x1f4;return function(_0x32849a){logger[_0xb212('0x24')](_0x32849a['stack']);if(_0x32849a[_0xb212('0x25')]){delete _0x32849a[_0xb212('0x25')];}_0x48d420[_0xb212('0x17')](_0xd1180f)['send'](_0x32849a);};}exports[_0xb212('0x26')]=function(_0x277812,_0x882231){var _0xdf3d5d={'raw':!![],'where':{'id':_0x277812[_0xb212('0x27')]['id']}},_0xd069d9={};_0xd069d9[_0xb212('0x28')]=_[_0xb212('0x29')](db[_0xb212('0x2a')][_0xb212('0x2b')]);_0xd069d9[_0xb212('0x2c')]=_[_0xb212('0x29')](_0x277812[_0xb212('0x2c')]);_0xd069d9[_0xb212('0x2d')]=_[_0xb212('0x2e')](_0xd069d9['model'],_0xd069d9['query']);_0xdf3d5d[_0xb212('0x2f')]=_[_0xb212('0x2e')](_0xd069d9['model'],qs[_0xb212('0x30')](_0x277812[_0xb212('0x2c')][_0xb212('0x30')]));_0xdf3d5d[_0xb212('0x2f')]=_0xdf3d5d[_0xb212('0x2f')][_0xb212('0x31')]?_0xdf3d5d[_0xb212('0x2f')]:_0xd069d9[_0xb212('0x28')];if(_0x277812['query']['includeAll']){_0xdf3d5d[_0xb212('0x32')]=[{'all':!![]}];}_0xdf3d5d=_[_0xb212('0x33')]({},_0xdf3d5d,_0x277812[_0xb212('0x34')]);return db[_0xb212('0x2a')][_0xb212('0x35')](_0xdf3d5d)[_0xb212('0x22')](handleEntityNotFound(_0x882231,null))[_0xb212('0x22')](respondWithResult(_0x882231,null))[_0xb212('0x36')](handleError(_0x882231,null));};exports[_0xb212('0x37')]=function(_0x249ccb,_0x769ba9){return db[_0xb212('0x2a')][_0xb212('0x37')](_0x249ccb['body'],{})[_0xb212('0x22')](respondWithResult(_0x769ba9,0xc9))[_0xb212('0x36')](handleError(_0x769ba9,null));};exports[_0xb212('0x21')]=function(_0x3f0141,_0x115e11){if(_0x3f0141['body']['id']){delete _0x3f0141[_0xb212('0x38')]['id'];}return db[_0xb212('0x2a')]['find']({'where':{'id':_0x3f0141[_0xb212('0x27')]['id']}})['then'](handleEntityNotFound(_0x115e11,null))[_0xb212('0x22')](saveUpdates(_0x3f0141[_0xb212('0x38')],null))['then'](respondWithResult(_0x115e11,null))[_0xb212('0x36')](handleError(_0x115e11,null));};exports[_0xb212('0x23')]=function(_0x2c8820,_0x2b36a0){return db['ChatProactiveAction'][_0xb212('0x35')]({'where':{'id':_0x2c8820[_0xb212('0x27')]['id']}})['then'](handleEntityNotFound(_0x2b36a0,null))[_0xb212('0x22')](removeEntity(_0x2b36a0,null))['catch'](handleError(_0x2b36a0,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 87010af..568487b 100644
--- a/server/api/chatProactiveAction/chatProactiveAction.model.js
+++ b/server/api/chatProactiveAction/chatProactiveAction.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb86b=['../../config/environment','exports','define','ChatProactiveAction','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb86b,0x158));var _0xbb86=function(_0x1ebb10,_0x156b3e){_0x1ebb10=_0x1ebb10-0x0;var _0x20d709=_0xb86b[_0x1ebb10];return _0x20d709;};'use strict';var _=require('lodash');var util=require(_0xbb86('0x0'));var logger=require(_0xbb86('0x1'))(_0xbb86('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbb86('0x3'));var fs=require('fs');var path=require(_0xbb86('0x4'));var rimraf=require(_0xbb86('0x5'));var config=require(_0xbb86('0x6'));var attributes=require('./chatProactiveAction.attributes');module[_0xbb86('0x7')]=function(_0x1522c5,_0x47d6f2){return _0x1522c5[_0xbb86('0x8')](_0xbb86('0x9'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5a84=['../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','ChatProactiveAction','chat_proactive_actions','util'];(function(_0x6aa32f,_0x3820f7){var _0x52bfee=function(_0x49814f){while(--_0x49814f){_0x6aa32f['push'](_0x6aa32f['shift']());}};_0x52bfee(++_0x3820f7);}(_0x5a84,0xd0));var _0x45a8=function(_0x154dcb,_0x4072a9){_0x154dcb=_0x154dcb-0x0;var _0x4d3295=_0x5a84[_0x154dcb];return _0x4d3295;};'use strict';var _=require('lodash');var util=require(_0x45a8('0x0'));var logger=require(_0x45a8('0x1'))('api');var moment=require(_0x45a8('0x2'));var BPromise=require(_0x45a8('0x3'));var rp=require(_0x45a8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x45a8('0x5'));var config=require(_0x45a8('0x6'));var attributes=require('./chatProactiveAction.attributes');module[_0x45a8('0x7')]=function(_0x4fe006,_0x1f71c0){return _0x4fe006[_0x45a8('0x8')](_0x45a8('0x9'),attributes,{'tableName':_0x45a8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index e746427..9c0f4b7 100644
--- a/server/api/chatProactiveAction/chatProactiveAction.rpc.js
+++ b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x88fa=['error','code','ChatProactiveAction,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x88fa,0x1d3));var _0xa88f=function(_0x37e21b,_0x50b31e){_0x37e21b=_0x37e21b-0x0;var _0x411f61=_0x88fa[_0x37e21b];return _0x411f61;};'use strict';var _=require(_0xa88f('0x0'));var util=require('util');var moment=require(_0xa88f('0x1'));var BPromise=require(_0xa88f('0x2'));var rs=require(_0xa88f('0x3'));var fs=require('fs');var Redis=require(_0xa88f('0x4'));var db=require(_0xa88f('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa88f('0x6'));var config=require(_0xa88f('0x7'));var jayson=require(_0xa88f('0x8'));var client=jayson[_0xa88f('0x9')][_0xa88f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5194d6,_0x829bef,_0x3b16ac){return new BPromise(function(_0x5543bd,_0x48cef0){return client[_0xa88f('0xb')](_0x5194d6,_0x3b16ac)[_0xa88f('0xc')](function(_0x22f87e){logger[_0xa88f('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x829bef,_0xa88f('0xe'));logger[_0xa88f('0xf')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x829bef,_0xa88f('0xe'),JSON['stringify'](_0x22f87e));if(_0x22f87e[_0xa88f('0x10')]){if(_0x22f87e['error'][_0xa88f('0x11')]===0x1f4){logger[_0xa88f('0x10')](_0xa88f('0x12'),_0x829bef,_0x22f87e[_0xa88f('0x10')][_0xa88f('0x13')]);return _0x48cef0(_0x22f87e['error'][_0xa88f('0x13')]);}logger[_0xa88f('0x10')](_0xa88f('0x12'),_0x829bef,_0x22f87e[_0xa88f('0x10')][_0xa88f('0x13')]);return _0x5543bd(_0x22f87e[_0xa88f('0x10')]['message']);}else{logger[_0xa88f('0xd')](_0xa88f('0x12'),_0x829bef,_0xa88f('0xe'));_0x5543bd(_0x22f87e['result'][_0xa88f('0x13')]);}})[_0xa88f('0x14')](function(_0x4b801f){logger[_0xa88f('0x10')](_0xa88f('0x12'),_0x829bef,_0x4b801f);_0x48cef0(_0x4b801f);});});}
\ No newline at end of file
+var _0x5453=['error','code','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x5453,0x1d0));var _0x3545=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x5453[_0x2be8c2];return _0x97f531;};'use strict';var _=require(_0x3545('0x0'));var util=require(_0x3545('0x1'));var moment=require('moment');var BPromise=require(_0x3545('0x2'));var rs=require(_0x3545('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3545('0x4'))['db'];var utils=require(_0x3545('0x5'));var logger=require('../../config/logger')(_0x3545('0x6'));var config=require(_0x3545('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3545('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x793add,_0x3ca4c2,_0x55161a){return new BPromise(function(_0xde8f6e,_0x2e18fb){return client[_0x3545('0x9')](_0x793add,_0x55161a)[_0x3545('0xa')](function(_0x4498d4){logger[_0x3545('0xb')](_0x3545('0xc'),_0x3ca4c2,_0x3545('0xd'));logger[_0x3545('0xe')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x3ca4c2,_0x3545('0xd'),JSON[_0x3545('0xf')](_0x4498d4));if(_0x4498d4[_0x3545('0x10')]){if(_0x4498d4[_0x3545('0x10')][_0x3545('0x11')]===0x1f4){logger[_0x3545('0x10')](_0x3545('0xc'),_0x3ca4c2,_0x4498d4[_0x3545('0x10')][_0x3545('0x12')]);return _0x2e18fb(_0x4498d4[_0x3545('0x10')][_0x3545('0x12')]);}logger[_0x3545('0x10')]('ChatProactiveAction,\x20%s,\x20%s',_0x3ca4c2,_0x4498d4['error'][_0x3545('0x12')]);return _0xde8f6e(_0x4498d4[_0x3545('0x10')][_0x3545('0x12')]);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x3ca4c2,_0x3545('0xd'));_0xde8f6e(_0x4498d4['result'][_0x3545('0x12')]);}})[_0x3545('0x13')](function(_0x5ef2ed){logger[_0x3545('0x10')](_0x3545('0xc'),_0x3ca4c2,_0x5ef2ed);_0x2e18fb(_0x5ef2ed);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index a774461..dfdfe2c 100644
--- a/server/api/chatProactiveAction/index.js
+++ b/server/api/chatProactiveAction/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x326f=['../../config/environment','./chatProactiveAction.controller','get','/:id','show','post','isAuthenticated','create','update','delete','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5d6e39,_0x9a4e4c){var _0x219494=function(_0x2de8b5){while(--_0x2de8b5){_0x5d6e39['push'](_0x5d6e39['shift']());}};_0x219494(++_0x9a4e4c);}(_0x326f,0xd1));var _0xf326=function(_0xe04e2,_0x2fab1a){_0xe04e2=_0xe04e2-0x0;var _0x5dae9c=_0x326f[_0xe04e2];return _0x5dae9c;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')](_0xf326('0xa'),auth['isAuthenticated'](),controller[_0xf326('0xb')]);router[_0xf326('0xc')]('/',auth[_0xf326('0xd')](),controller[_0xf326('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xf326('0xf')]);router[_0xf326('0x10')](_0xf326('0xa'),auth[_0xf326('0xd')](),controller[_0xf326('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x71ab=['get','/:id','isAuthenticated','show','post','create','put','update','delete','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x71ab,0x64));var _0xb71a=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x71ab[_0x3e5086];return _0xfeb102;};'use strict';var multer=require('multer');var util=require(_0xb71a('0x0'));var path=require('path');var timeout=require(_0xb71a('0x1'));var express=require('express');var router=express[_0xb71a('0x2')]();var fs_extra=require(_0xb71a('0x3'));var auth=require(_0xb71a('0x4'));var interaction=require(_0xb71a('0x5'));var config=require(_0xb71a('0x6'));var controller=require(_0xb71a('0x7'));router[_0xb71a('0x8')](_0xb71a('0x9'),auth[_0xb71a('0xa')](),controller[_0xb71a('0xb')]);router[_0xb71a('0xc')]('/',auth[_0xb71a('0xa')](),controller[_0xb71a('0xd')]);router[_0xb71a('0xe')](_0xb71a('0x9'),auth[_0xb71a('0xa')](),controller[_0xb71a('0xf')]);router[_0xb71a('0x10')]('/:id',auth[_0xb71a('0xa')](),controller['destroy']);module[_0xb71a('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index fb42be6..042b50e 100644
--- a/server/api/chatQueue/chatQueue.attributes.js
+++ b/server/api/chatQueue/chatQueue.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3c44=['sequelize','exports','name','STRING','ENUM','rrmemory','beepall','roundrobin'];(function(_0x2c5bf3,_0x14ea88){var _0x32b188=function(_0x1bcb56){while(--_0x1bcb56){_0x2c5bf3['push'](_0x2c5bf3['shift']());}};_0x32b188(++_0x14ea88);}(_0x3c44,0x140));var _0x43c4=function(_0x2eb21e,_0x5d3db7){_0x2eb21e=_0x2eb21e-0x0;var _0x279d30=_0x3c44[_0x2eb21e];return _0x279d30;};'use strict';var Sequelize=require(_0x43c4('0x0'));module[_0x43c4('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x43c4('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x43c4('0x3')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x43c4('0x4')](_0x43c4('0x5'),_0x43c4('0x6'),_0x43c4('0x7'))}};
\ No newline at end of file
+var _0x7eba=['ENUM','rrmemory','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x438e20,_0x35e4ed){var _0x3cf994=function(_0x19baac){while(--_0x19baac){_0x438e20['push'](_0x438e20['shift']());}};_0x3cf994(++_0x35e4ed);}(_0x7eba,0x153));var _0xa7eb=function(_0x543733,_0x2799ae){_0x543733=_0x543733-0x0;var _0x1e51c=_0x7eba[_0x543733];return _0x1e51c;};'use strict';var Sequelize=require(_0xa7eb('0x0'));module[_0xa7eb('0x1')]={'name':{'type':Sequelize[_0xa7eb('0x2')],'unique':_0xa7eb('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa7eb('0x2')]},'timeout':{'type':Sequelize[_0xa7eb('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa7eb('0x5')](_0xa7eb('0x6'),'beepall',_0xa7eb('0x7'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index abcb749..01aecde 100644
--- a/server/api/chatQueue/chatQueue.controller.js
+++ b/server/api/chatQueue/chatQueue.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x41e6=['addTeams','ids','Agents','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','userChatQueue:save','removeTeams','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','push','toString','QueryTypes','TeamId','union','value','isEmpty','removeAgents','emit','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','bluebird','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','end','status','offset','undefined','limit','count','set','Content-Range','json','then','destroy','get','ChatQueues','sendStatus','error','stack','name','send','index','map','fieldName','type','key','where','include','query','findAll','rows','catch','show','model','keys','ChatQueue','rawAttributes','filters','intersection','fields','attributes','length','includeAll','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','nolimit','order','sort','pick','ChatQueueId','filter','User','UserId','updatedAt','createdAt','format','%s/%s','chatPause','params','Team','getTeams'];(function(_0x3a48b7,_0x2c74d8){var _0x5c6680=function(_0x1c4e29){while(--_0x1c4e29){_0x3a48b7['push'](_0x3a48b7['shift']());}};_0x5c6680(++_0x2c74d8);}(_0x41e6,0x199));var _0x641e=function(_0x1acc2d,_0x1cfdac){_0x1acc2d=_0x1acc2d-0x0;var _0x1cc820=_0x41e6[_0x1acc2d];return _0x1cc820;};'use strict';var BPromise=require(_0x641e('0x0'));var util=require('util');var _=require(_0x641e('0x1'));var squel=require('squel');var Redis=require('ioredis');var qs=require(_0x641e('0x2'));var logger=require(_0x641e('0x3'))(_0x641e('0x4'));var config=require(_0x641e('0x5'));var db=require(_0x641e('0x6'))['db'];config['redis']=_[_0x641e('0x7')](config[_0x641e('0x8')],{'host':_0x641e('0x9'),'port':0x18eb});var socket=require(_0x641e('0xa'))(new Redis(config[_0x641e('0x8')]));require(_0x641e('0xb'))[_0x641e('0xc')](socket);function respondWithStatusCode(_0x5a290a,_0x4ab63b){_0x4ab63b=_0x4ab63b||0xcc;return function(_0xe40eda){if(_0xe40eda){return _0x5a290a['sendStatus'](_0x4ab63b);}return _0x5a290a['status'](_0x4ab63b)[_0x641e('0xd')]();};}function respondWithResult(_0x3f7dcc,_0x53d183){_0x53d183=_0x53d183||0xc8;return function(_0x55cc7c){if(_0x55cc7c){return _0x3f7dcc[_0x641e('0xe')](_0x53d183)['json'](_0x55cc7c);}};}function respondWithFilteredResult(_0x3fb091,_0x39d109){return function(_0xd4b4bc){if(_0xd4b4bc){var _0xc04898=typeof _0x39d109[_0x641e('0xf')]===_0x641e('0x10')&&typeof _0x39d109[_0x641e('0x11')]==='undefined';var _0x1a3f4c=_0xd4b4bc['count'];var _0x4f8825=_0xc04898?0x0:_0x39d109[_0x641e('0xf')];var _0x5bffc5=_0xc04898?_0xd4b4bc[_0x641e('0x12')]:_0x39d109[_0x641e('0xf')]+_0x39d109[_0x641e('0x11')];var _0x252f2d;if(_0x5bffc5>=_0x1a3f4c){_0x5bffc5=_0x1a3f4c;_0x252f2d=0xc8;}else{_0x252f2d=0xce;}_0x3fb091['status'](_0x252f2d);return _0x3fb091[_0x641e('0x13')](_0x641e('0x14'),_0x4f8825+'-'+_0x5bffc5+'/'+_0x1a3f4c)[_0x641e('0x15')](_0xd4b4bc);}return null;};}function saveUpdates(_0x19640e){return function(_0x4394bc){if(_0x4394bc){return _0x4394bc['update'](_0x19640e)[_0x641e('0x16')](function(_0x4743c2){return _0x4743c2;});}return null;};}function removeEntity(_0x58bad2){return function(_0x44d7a7){if(_0x44d7a7){return _0x44d7a7[_0x641e('0x17')]()[_0x641e('0x16')](function(){var _0x4f3bdc=_0x44d7a7[_0x641e('0x18')]({'plain':!![]});var _0x7eab=_0x641e('0x19');return db['UserProfileResource']['destroy']({'where':{'type':_0x7eab,'resourceId':_0x4f3bdc['id']}})[_0x641e('0x16')](function(){return _0x44d7a7;});})[_0x641e('0x16')](function(){_0x58bad2[_0x641e('0xe')](0xcc)[_0x641e('0xd')]();});}};}function handleEntityNotFound(_0x586d11){return function(_0x598e28){if(!_0x598e28){_0x586d11[_0x641e('0x1a')](0x194);}return _0x598e28;};}function handleError(_0x1ab37f,_0x34ecfb){_0x34ecfb=_0x34ecfb||0x1f4;return function(_0x6ec6e1){logger[_0x641e('0x1b')](_0x6ec6e1[_0x641e('0x1c')]);if(_0x6ec6e1[_0x641e('0x1d')]){delete _0x6ec6e1['name'];}_0x1ab37f[_0x641e('0xe')](_0x34ecfb)[_0x641e('0x1e')](_0x6ec6e1);};}exports[_0x641e('0x1f')]=function(_0x2b689c,_0x3bd7ab){var _0x276702={};var _0x3f6c8f={'count':0x0,'rows':[]};var _0x4c899b=_[_0x641e('0x20')](db['ChatQueue']['rawAttributes'],function(_0x4b5515){return{'name':_0x4b5515[_0x641e('0x21')],'type':_0x4b5515[_0x641e('0x22')][_0x641e('0x23')]};});_0x276702=qs['getOptions'](_0x4c899b,_0x2b689c);var _0x251e9e={'where':_0x276702[_0x641e('0x24')]};return db['ChatQueue']['count'](_0x251e9e)[_0x641e('0x16')](function(_0x5104e8){_0x3f6c8f[_0x641e('0x12')]=_0x5104e8;_0x276702[_0x641e('0x25')]=qs[_0x641e('0x25')](_0x2b689c[_0x641e('0x26')]);return db['ChatQueue'][_0x641e('0x27')](_0x276702);})[_0x641e('0x16')](function(_0x1238a7){_0x3f6c8f[_0x641e('0x28')]=_0x1238a7;return _0x3f6c8f;})[_0x641e('0x16')](respondWithFilteredResult(_0x3bd7ab,_0x276702))[_0x641e('0x29')](handleError(_0x3bd7ab,null));};exports[_0x641e('0x2a')]=function(_0x39438e,_0xbc42ae){var _0x3faf29={'raw':!![],'where':{'id':_0x39438e['params']['id']}},_0xf318d9={};_0xf318d9[_0x641e('0x2b')]=_[_0x641e('0x2c')](db[_0x641e('0x2d')][_0x641e('0x2e')]);_0xf318d9[_0x641e('0x26')]=_['keys'](_0x39438e['query']);_0xf318d9[_0x641e('0x2f')]=_[_0x641e('0x30')](_0xf318d9[_0x641e('0x2b')],_0xf318d9['query']);_0x3faf29['attributes']=_['intersection'](_0xf318d9[_0x641e('0x2b')],qs[_0x641e('0x31')](_0x39438e[_0x641e('0x26')][_0x641e('0x31')]));_0x3faf29['attributes']=_0x3faf29[_0x641e('0x32')][_0x641e('0x33')]?_0x3faf29[_0x641e('0x32')]:_0xf318d9[_0x641e('0x2b')];if(_0x39438e[_0x641e('0x26')][_0x641e('0x34')]){_0x3faf29[_0x641e('0x25')]=[{'all':!![]}];}_0x3faf29=_[_0x641e('0x35')]({},_0x3faf29,_0x39438e[_0x641e('0x36')]);return db[_0x641e('0x2d')][_0x641e('0x37')](_0x3faf29)[_0x641e('0x16')](handleEntityNotFound(_0xbc42ae,null))[_0x641e('0x16')](respondWithResult(_0xbc42ae,null))[_0x641e('0x29')](handleError(_0xbc42ae,null));};exports[_0x641e('0x38')]=function(_0x13cc3a,_0x22ad08){return db[_0x641e('0x2d')][_0x641e('0x38')](_0x13cc3a[_0x641e('0x39')],{})[_0x641e('0x16')](function(_0x5b1f94){var _0x39d9f3=_0x13cc3a[_0x641e('0x3a')]['get']({'plain':!![]});if(!_0x39d9f3)throw new Error(_0x641e('0x3b'));if(_0x39d9f3[_0x641e('0x3c')]===_0x641e('0x3a')){var _0x5b7760=_0x5b1f94['get']({'plain':!![]});var _0x20caa5=_0x641e('0x19');return db[_0x641e('0x3d')][_0x641e('0x37')]({'where':{'name':_0x20caa5,'userProfileId':_0x39d9f3[_0x641e('0x3e')]},'raw':!![]})[_0x641e('0x16')](function(_0xa4b1df){if(_0xa4b1df&&_0xa4b1df[_0x641e('0x3f')]===0x0){return db[_0x641e('0x40')][_0x641e('0x38')]({'name':_0x5b7760['name'],'resourceId':_0x5b7760['id'],'type':_0xa4b1df['name'],'sectionId':_0xa4b1df['id']},{})[_0x641e('0x16')](function(){return _0x5b1f94;});}else{return _0x5b1f94;}})['catch'](function(_0x3a2a77){logger[_0x641e('0x1b')](_0x641e('0x41'),_0x3a2a77);throw _0x3a2a77;});}return _0x5b1f94;})[_0x641e('0x16')](respondWithResult(_0x22ad08,0xc9))[_0x641e('0x29')](handleError(_0x22ad08,null));};exports['update']=function(_0x51086a,_0x48dd43){if(_0x51086a[_0x641e('0x39')]['id']){delete _0x51086a[_0x641e('0x39')]['id'];}return db[_0x641e('0x2d')][_0x641e('0x37')]({'where':{'id':_0x51086a['params']['id']}})[_0x641e('0x16')](handleEntityNotFound(_0x48dd43,null))[_0x641e('0x16')](saveUpdates(_0x51086a['body'],null))[_0x641e('0x16')](respondWithResult(_0x48dd43,null))['catch'](handleError(_0x48dd43,null));};exports['destroy']=function(_0x40e7e3,_0x211e6b){return db['ChatQueue']['find']({'where':{'id':_0x40e7e3['params']['id']}})[_0x641e('0x16')](handleEntityNotFound(_0x211e6b,null))[_0x641e('0x16')](removeEntity(_0x211e6b,null))[_0x641e('0x29')](handleError(_0x211e6b,null));};exports[_0x641e('0x42')]=function(_0x5399b4,_0x8b0229){return db[_0x641e('0x2d')][_0x641e('0x42')]()[_0x641e('0x16')](respondWithResult(_0x8b0229,null))[_0x641e('0x29')](handleError(_0x8b0229,null));};exports[_0x641e('0x43')]=function(_0x403e82,_0x40ee18){var _0x2ed109={'raw':!![],'where':{}},_0x57aaa0={},_0x20763b;return db['ChatQueue'][_0x641e('0x44')]({'where':{'id':_0x403e82['params']['id']}})[_0x641e('0x16')](handleEntityNotFound(_0x40ee18,null))['then'](function(_0x14548e){if(_0x14548e){_0x20763b=_0x14548e[_0x641e('0x18')]({'plain':!![]});_0x57aaa0['model']=_['keys'](db[_0x641e('0x45')][_0x641e('0x2e')]);_0x57aaa0['query']=_['keys'](_0x403e82['query']);_0x57aaa0['filters']=_[_0x641e('0x30')](_0x57aaa0['model'],_0x57aaa0[_0x641e('0x26')]);_0x2ed109['attributes']=_[_0x641e('0x30')](_0x57aaa0[_0x641e('0x2b')],qs['fields'](_0x403e82[_0x641e('0x26')][_0x641e('0x31')]));_0x2ed109['attributes']=_0x2ed109['attributes']['length']?_0x2ed109['attributes']:_0x57aaa0[_0x641e('0x2b')];if(!_0x403e82['query'][_0x641e('0x46')](_0x641e('0x47'))){_0x2ed109[_0x641e('0x11')]=qs['limit'](_0x403e82[_0x641e('0x26')][_0x641e('0x11')]);_0x2ed109['offset']=qs[_0x641e('0xf')](_0x403e82[_0x641e('0x26')]['offset']);}_0x2ed109[_0x641e('0x48')]=qs[_0x641e('0x49')](_0x403e82[_0x641e('0x26')][_0x641e('0x49')]);_0x2ed109[_0x641e('0x24')]=qs['filters'](_[_0x641e('0x4a')](_0x403e82[_0x641e('0x26')],_0x57aaa0['filters']));_0x2ed109[_0x641e('0x24')][_0x641e('0x4b')]=_0x14548e['id'];if(_0x403e82[_0x641e('0x26')]['filter']){_0x2ed109[_0x641e('0x24')]=_[_0x641e('0x35')](_0x2ed109[_0x641e('0x24')],{'$or':_['map'](_0x2ed109[_0x641e('0x32')],function(_0x4e41d8){var _0x25924b={};_0x25924b[_0x4e41d8]={'$like':'%'+_0x403e82['query'][_0x641e('0x4c')]+'%'};return _0x25924b;})});}_0x2ed109=_[_0x641e('0x35')]({},_0x2ed109,_0x403e82[_0x641e('0x36')]);return db['UserChatQueue'][_0x641e('0x27')](_0x2ed109);}})['then'](function(_0x25870c){if(_0x25870c){return db[_0x641e('0x4d')]['findAndCountAll']({'where':{'id':_['map'](_0x25870c,_0x641e('0x4e')),'role':'agent'},'attributes':['id',_0x641e('0x1d'),'chatPause',_0x641e('0x4f'),_0x641e('0x50')]});}})['then'](function(_0x199e23){if(_0x199e23){return{'count':_0x199e23[_0x641e('0x12')],'rows':_['map'](_0x199e23[_0x641e('0x28')],function(_0x58600a){return{'membername':_0x58600a[_0x641e('0x1d')],'UserId':_0x58600a['id'],'queue_name':_0x20763b[_0x641e('0x1d')],'ChatQueueId':_0x20763b['id'],'interface':util[_0x641e('0x51')](_0x641e('0x52'),'SIP',_0x58600a[_0x641e('0x1d')]),'penalty':0x0,'paused':_0x58600a[_0x641e('0x53')],'createdAt':_0x58600a['createdAt'],'updatedAt':_0x58600a[_0x641e('0x4f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x641e('0x16')](respondWithFilteredResult(_0x40ee18,_0x2ed109))[_0x641e('0x29')](handleError(_0x40ee18,null));};exports['getTeams']=function(_0x4cbb4f,_0x283c76){var _0x560239={};var _0x1b59b8={};var _0x5de5c3;var _0x5815c5;return db[_0x641e('0x2d')]['findOne']({'where':{'id':_0x4cbb4f[_0x641e('0x54')]['id']}})[_0x641e('0x16')](handleEntityNotFound(_0x283c76,null))[_0x641e('0x16')](function(_0x1139c8){if(_0x1139c8){_0x5de5c3=_0x1139c8;_0x1b59b8[_0x641e('0x2b')]=_[_0x641e('0x2c')](db[_0x641e('0x55')][_0x641e('0x2e')]);_0x1b59b8[_0x641e('0x26')]=_[_0x641e('0x2c')](_0x4cbb4f[_0x641e('0x26')]);_0x1b59b8[_0x641e('0x2f')]=_['intersection'](_0x1b59b8[_0x641e('0x2b')],_0x1b59b8[_0x641e('0x26')]);_0x560239[_0x641e('0x32')]=_['intersection'](_0x1b59b8[_0x641e('0x2b')],qs[_0x641e('0x31')](_0x4cbb4f[_0x641e('0x26')][_0x641e('0x31')]));_0x560239[_0x641e('0x32')]=_0x560239[_0x641e('0x32')][_0x641e('0x33')]?_0x560239[_0x641e('0x32')]:_0x1b59b8[_0x641e('0x2b')];_0x560239['order']=qs[_0x641e('0x49')](_0x4cbb4f[_0x641e('0x26')][_0x641e('0x49')]);_0x560239[_0x641e('0x24')]=qs[_0x641e('0x2f')](_['pick'](_0x4cbb4f[_0x641e('0x26')],_0x1b59b8[_0x641e('0x2f')]));if(_0x4cbb4f[_0x641e('0x26')][_0x641e('0x4c')]){_0x560239['where']=_[_0x641e('0x35')](_0x560239[_0x641e('0x24')],{'$or':_[_0x641e('0x20')](_0x560239[_0x641e('0x32')],function(_0x3b4945){var _0x58ca55={};_0x58ca55[_0x3b4945]={'$like':'%'+_0x4cbb4f[_0x641e('0x26')]['filter']+'%'};return _0x58ca55;})});}_0x560239=_[_0x641e('0x35')]({},_0x560239,_0x4cbb4f[_0x641e('0x36')]);return _0x5de5c3[_0x641e('0x56')](_0x560239);}})[_0x641e('0x16')](function(_0x2ad335){if(_0x2ad335){_0x5815c5=_0x2ad335[_0x641e('0x33')];if(!_0x4cbb4f['query']['hasOwnProperty'](_0x641e('0x47'))){_0x560239[_0x641e('0x11')]=qs[_0x641e('0x11')](_0x4cbb4f[_0x641e('0x26')]['limit']);_0x560239[_0x641e('0xf')]=qs['offset'](_0x4cbb4f[_0x641e('0x26')][_0x641e('0xf')]);}return _0x5de5c3['getTeams'](_0x560239);}})[_0x641e('0x16')](function(_0x1ed5c7){if(_0x1ed5c7){return _0x1ed5c7?{'count':_0x5815c5,'rows':_0x1ed5c7}:null;}})[_0x641e('0x16')](respondWithResult(_0x283c76,null))['catch'](handleError(_0x283c76,null));};exports[_0x641e('0x57')]=function(_0x23fa40,_0x8e25b){var _0x2de13a=_0x23fa40['body'][_0x641e('0x58')];return db['Team'][_0x641e('0x27')]({'where':{'id':_0x2de13a},'attributes':['id'],'include':[{'model':db[_0x641e('0x4d')],'as':_0x641e('0x59'),'attributes':['id',_0x641e('0x1d'),'online',_0x641e('0x5a'),_0x641e('0x5b')],'raw':!![]}]})['then'](function(_0x4d7466){if(_0x4d7466){var _0x4ad15b=_[_0x641e('0x5c')](_0x4d7466,function(_0x5b0644){var _0x24da97=_0x5b0644[_0x641e('0x18')]({'plain':!![]});return _0x24da97[_0x641e('0x59')];});return db[_0x641e('0x2d')][_0x641e('0x37')]({'where':{'id':_0x23fa40[_0x641e('0x54')]['id']}})[_0x641e('0x16')](function(_0x5a45b1){return db[_0x641e('0x5d')][_0x641e('0x5e')](function(_0x3f0ac4){return _0x5a45b1[_0x641e('0x57')](_0x2de13a,{'transaction':_0x3f0ac4})['then'](function(){return BPromise[_0x641e('0x5f')](_0x4ad15b,function(_0x2ea7e8){return db[_0x641e('0x45')][_0x641e('0x60')]({'where':{'UserId':_0x2ea7e8['id'],'ChatQueueId':_0x23fa40[_0x641e('0x54')]['id']},'transaction':_0x3f0ac4});});})[_0x641e('0x16')](function(){_0x4ad15b[_0x641e('0x61')](function(_0x2f6f0a){socket['emit'](_0x641e('0x62'),{'UserId':_0x2f6f0a['id'],'ChatQueueId':_0x5a45b1['id']});});});});});}})[_0x641e('0x16')](respondWithStatusCode(_0x8e25b,null))[_0x641e('0x29')](handleError(_0x8e25b,null));};exports[_0x641e('0x63')]=function(_0x4a77a3,_0x30bcf9){return db[_0x641e('0x55')][_0x641e('0x27')]({'where':{'id':_0x4a77a3[_0x641e('0x26')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x641e('0x16')](handleEntityNotFound(_0x30bcf9,null))[_0x641e('0x16')](function(_0x37ee14){var _0x3ebac1=_[_0x641e('0x20')](_0x37ee14,'id');var _0x4ecd6d=[];var _0xb6e915=[];var _0x684fe5=squel['select']();_0x684fe5[_0x641e('0x64')](_0x641e('0x65'))[_0x641e('0x66')](_0x641e('0x67'),'tq')[_0x641e('0x68')](_0x641e('0x69'),'ut',_0x641e('0x6a'))[_0x641e('0x24')](_0x641e('0x6b'),_0x4a77a3['params']['id']);for(var _0x52765b=0x0;_0x52765b<_0x37ee14[_0x641e('0x33')];_0x52765b+=0x1){let _0x27690e=_0x37ee14[_0x52765b];for(var _0x530957=0x0;_0x530957<_0x27690e[_0x641e('0x59')][_0x641e('0x33')];_0x530957+=0x1){let _0x5be4ad=_0x27690e[_0x641e('0x59')][_0x530957];var _0x5773a9=_0x684fe5[_0x641e('0x6c')]();_0x5773a9[_0x641e('0x24')]('ut.UserId\x20=\x20?',_0x5be4ad['id']);_0xb6e915[_0x641e('0x6d')](db[_0x641e('0x5d')][_0x641e('0x26')](_0x5773a9[_0x641e('0x6e')](),{'type':db['sequelize'][_0x641e('0x6f')]['SELECT']})['then'](function(_0x3cf7a2){if(_0x3cf7a2['length']===0x1){return _0x5be4ad['id'];}else{var _0x16b6c1=_['every'](_['map'](_0x3cf7a2,_0x641e('0x70')),function(_0x43ba73){return _['includes'](_0x3ebac1,_0x43ba73);});if(_0x16b6c1){return _0x5be4ad['id'];}}}));}}return BPromise['all'](_0xb6e915)[_0x641e('0x16')](function(_0x54b2d4){_0x4ecd6d=_(_0x4ecd6d)[_0x641e('0x71')](_0x54b2d4)['compact']()[_0x641e('0x72')]();return db['ChatQueue'][_0x641e('0x37')]({'where':{'id':_0x4a77a3[_0x641e('0x54')]['id']}})[_0x641e('0x16')](function(_0x3bb47e){return db[_0x641e('0x5d')][_0x641e('0x5e')](function(_0x212cdb){return _0x3bb47e[_0x641e('0x63')](_0x4a77a3['query'][_0x641e('0x58')],{'transaction':_0x212cdb})[_0x641e('0x16')](function(){if(!_[_0x641e('0x73')](_0x4ecd6d)){return _0x3bb47e[_0x641e('0x74')](_0x4ecd6d,{'transaction':_0x212cdb});}})['then'](function(){_0x4ecd6d[_0x641e('0x61')](function(_0x4c530c){socket[_0x641e('0x75')](_0x641e('0x76'),{'UserId':_0x4c530c,'ChatQueueId':_0x3bb47e['id']});});});});});});})[_0x641e('0x16')](respondWithStatusCode(_0x30bcf9,null))[_0x641e('0x29')](handleError(_0x30bcf9,null));};exports[_0x641e('0x77')]=function(_0x4ae860,_0x1ea625){return db[_0x641e('0x2d')][_0x641e('0x37')]({'where':{'id':_0x4ae860[_0x641e('0x54')]['id']}})[_0x641e('0x16')](handleEntityNotFound(_0x1ea625,null))[_0x641e('0x16')](function(_0x266df9){if(_0x266df9){return _0x266df9[_0x641e('0x77')](_0x4ae860['body']['ids'],_[_0x641e('0x78')](_0x4ae860[_0x641e('0x39')],['ids','id'])||{})[_0x641e('0x79')](function(_0x5f0ac0){for(var _0xe40bd6=0x0;_0xe40bd6<_0x4ae860['body'][_0x641e('0x58')][_0x641e('0x33')];_0xe40bd6+=0x1){socket['emit'](_0x641e('0x62'),{'UserId':Number(_0x4ae860[_0x641e('0x39')][_0x641e('0x58')][_0xe40bd6]),'ChatQueueId':Number(_0x4ae860['params']['id'])});}return _0x5f0ac0;});}})[_0x641e('0x16')](respondWithResult(_0x1ea625,null))[_0x641e('0x29')](handleError(_0x1ea625,null));};exports[_0x641e('0x74')]=function(_0x58bd2d,_0x58f6e4){return db[_0x641e('0x2d')][_0x641e('0x37')]({'where':{'id':_0x58bd2d[_0x641e('0x54')]['id']}})[_0x641e('0x16')](handleEntityNotFound(_0x58f6e4,null))[_0x641e('0x16')](function(_0x25020f){if(_0x25020f){return _0x25020f[_0x641e('0x74')](_0x58bd2d['query']['ids'])[_0x641e('0x16')](function(){if(_[_0x641e('0x7a')](_0x58bd2d['query'][_0x641e('0x58')])){for(var _0x25fbfe=0x0;_0x25fbfe<_0x58bd2d[_0x641e('0x26')][_0x641e('0x58')][_0x641e('0x33')];_0x25fbfe+=0x1){socket[_0x641e('0x75')](_0x641e('0x76'),{'UserId':Number(_0x58bd2d[_0x641e('0x26')]['ids'][_0x25fbfe]),'ChatQueueId':Number(_0x58bd2d[_0x641e('0x54')]['id'])});}}else{socket['emit'](_0x641e('0x76'),{'UserId':Number(_0x58bd2d['query'][_0x641e('0x58')]),'ChatQueueId':Number(_0x58bd2d[_0x641e('0x54')]['id'])});}});}})[_0x641e('0x16')](respondWithStatusCode(_0x58f6e4,null))['catch'](handleError(_0x58f6e4,null));};exports[_0x641e('0x7b')]=function(_0x43582e,_0x185eae){var _0x181973={};var _0x3de5ad={};var _0x4ba526;var _0x2deb04;return db[_0x641e('0x2d')][_0x641e('0x44')]({'where':{'id':_0x43582e[_0x641e('0x54')]['id']}})[_0x641e('0x16')](handleEntityNotFound(_0x185eae,null))[_0x641e('0x16')](function(_0x10e65c){if(_0x10e65c){_0x4ba526=_0x10e65c;_0x3de5ad[_0x641e('0x2b')]=_[_0x641e('0x2c')](db['User'][_0x641e('0x2e')]);_0x3de5ad[_0x641e('0x26')]=_[_0x641e('0x2c')](_0x43582e[_0x641e('0x26')]);_0x3de5ad['filters']=_[_0x641e('0x30')](_0x3de5ad[_0x641e('0x2b')],_0x3de5ad['query']);_0x181973[_0x641e('0x32')]=_[_0x641e('0x30')](_0x3de5ad[_0x641e('0x2b')],qs[_0x641e('0x31')](_0x43582e[_0x641e('0x26')]['fields']));_0x181973['attributes']=_0x181973[_0x641e('0x32')]['length']?_0x181973[_0x641e('0x32')]:_0x3de5ad[_0x641e('0x2b')];_0x181973[_0x641e('0x48')]=qs[_0x641e('0x49')](_0x43582e[_0x641e('0x26')][_0x641e('0x49')]);_0x181973[_0x641e('0x24')]=qs['filters'](_[_0x641e('0x4a')](_0x43582e[_0x641e('0x26')],_0x3de5ad['filters']));if(_0x43582e[_0x641e('0x26')]['filter']){_0x181973[_0x641e('0x24')]=_[_0x641e('0x35')](_0x181973[_0x641e('0x24')],{'$or':_[_0x641e('0x20')](_0x181973['attributes'],function(_0x5c00bf){var _0x562ac7={};_0x562ac7[_0x5c00bf]={'$like':'%'+_0x43582e[_0x641e('0x26')]['filter']+'%'};return _0x562ac7;})});}_0x181973=_[_0x641e('0x35')]({},_0x181973,_0x43582e[_0x641e('0x36')]);return _0x4ba526[_0x641e('0x7b')](_0x181973);}})['then'](function(_0x5b4266){if(_0x5b4266){_0x2deb04=_0x5b4266[_0x641e('0x33')];if(!_0x43582e[_0x641e('0x26')][_0x641e('0x46')](_0x641e('0x47'))){_0x181973[_0x641e('0x11')]=qs[_0x641e('0x11')](_0x43582e['query'][_0x641e('0x11')]);_0x181973['offset']=qs[_0x641e('0xf')](_0x43582e[_0x641e('0x26')]['offset']);}return _0x4ba526[_0x641e('0x7b')](_0x181973);}})[_0x641e('0x16')](function(_0x235b0d){if(_0x235b0d){return _0x235b0d?{'count':_0x2deb04,'rows':_0x235b0d}:null;}})[_0x641e('0x16')](respondWithResult(_0x185eae,null))['catch'](handleError(_0x185eae,null));};
\ No newline at end of file
+var _0x94a3=['sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','get','ChatQueues','UserProfileResource','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','getOptions','where','ChatQueue','include','query','rows','show','model','keys','filters','intersection','attributes','fields','length','includeAll','merge','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','findOne','UserChatQueue','hasOwnProperty','order','sort','ChatQueueId','filter','options','findAll','User','findAndCountAll','UserId','agent','chatPause','%s/%s','SIP','updatedAt','Team','pick','nolimit','addTeams','ids','Agents','online','interface','flatMap','transaction','each','findOrCreate','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','sequelize','SELECT','every','TeamId','union','value','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','lodash','squel','ioredis','../../config/logger','redis','localhost','socket.io-emitter'];(function(_0x4d8666,_0x2ff19d){var _0x37175b=function(_0x1b8de6){while(--_0x1b8de6){_0x4d8666['push'](_0x4d8666['shift']());}};_0x37175b(++_0x2ff19d);}(_0x94a3,0x6e));var _0x394a=function(_0x40325a,_0x3901ba){_0x40325a=_0x40325a-0x0;var _0x1578a3=_0x94a3[_0x40325a];return _0x1578a3;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x394a('0x0'));var squel=require(_0x394a('0x1'));var Redis=require(_0x394a('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0x394a('0x3'))('api');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x394a('0x4')]=_['defaults'](config[_0x394a('0x4')],{'host':_0x394a('0x5'),'port':0x18eb});var socket=require(_0x394a('0x6'))(new Redis(config['redis']));require('./chatQueue.socket')['register'](socket);function respondWithStatusCode(_0x481087,_0x2ecea7){_0x2ecea7=_0x2ecea7||0xcc;return function(_0x10a02f){if(_0x10a02f){return _0x481087[_0x394a('0x7')](_0x2ecea7);}return _0x481087[_0x394a('0x8')](_0x2ecea7)[_0x394a('0x9')]();};}function respondWithResult(_0x1d341c,_0x156a47){_0x156a47=_0x156a47||0xc8;return function(_0x315b5c){if(_0x315b5c){return _0x1d341c[_0x394a('0x8')](_0x156a47)[_0x394a('0xa')](_0x315b5c);}};}function respondWithFilteredResult(_0x5552bd,_0x2d1e5c){return function(_0x340e02){if(_0x340e02){var _0x4639ae=typeof _0x2d1e5c[_0x394a('0xb')]===_0x394a('0xc')&&typeof _0x2d1e5c[_0x394a('0xd')]===_0x394a('0xc');var _0x148e0e=_0x340e02[_0x394a('0xe')];var _0x583bca=_0x4639ae?0x0:_0x2d1e5c[_0x394a('0xb')];var _0x4c9eb9=_0x4639ae?_0x340e02[_0x394a('0xe')]:_0x2d1e5c[_0x394a('0xb')]+_0x2d1e5c[_0x394a('0xd')];var _0x1d58df;if(_0x4c9eb9>=_0x148e0e){_0x4c9eb9=_0x148e0e;_0x1d58df=0xc8;}else{_0x1d58df=0xce;}_0x5552bd['status'](_0x1d58df);return _0x5552bd[_0x394a('0xf')](_0x394a('0x10'),_0x583bca+'-'+_0x4c9eb9+'/'+_0x148e0e)[_0x394a('0xa')](_0x340e02);}return null;};}function saveUpdates(_0x46b4fa){return function(_0x365fd2){if(_0x365fd2){return _0x365fd2[_0x394a('0x11')](_0x46b4fa)[_0x394a('0x12')](function(_0x451692){return _0x451692;});}return null;};}function removeEntity(_0x2c5e30){return function(_0x2f4709){if(_0x2f4709){return _0x2f4709['destroy']()[_0x394a('0x12')](function(){var _0x6d43c2=_0x2f4709[_0x394a('0x13')]({'plain':!![]});var _0x1e8436=_0x394a('0x14');return db[_0x394a('0x15')][_0x394a('0x16')]({'where':{'type':_0x1e8436,'resourceId':_0x6d43c2['id']}})[_0x394a('0x12')](function(){return _0x2f4709;});})[_0x394a('0x12')](function(){_0x2c5e30[_0x394a('0x8')](0xcc)[_0x394a('0x9')]();});}};}function handleEntityNotFound(_0x142313){return function(_0x4f0c56){if(!_0x4f0c56){_0x142313['sendStatus'](0x194);}return _0x4f0c56;};}function handleError(_0x59e36e,_0x35edb6){_0x35edb6=_0x35edb6||0x1f4;return function(_0x3f6e51){logger[_0x394a('0x17')](_0x3f6e51[_0x394a('0x18')]);if(_0x3f6e51[_0x394a('0x19')]){delete _0x3f6e51[_0x394a('0x19')];}_0x59e36e[_0x394a('0x8')](_0x35edb6)[_0x394a('0x1a')](_0x3f6e51);};}exports[_0x394a('0x1b')]=function(_0x2a01ec,_0x5b7257){var _0x3dabbb={};var _0x163ac0={'count':0x0,'rows':[]};var _0x9586a7=_[_0x394a('0x1c')](db['ChatQueue'][_0x394a('0x1d')],function(_0x585720){return{'name':_0x585720[_0x394a('0x1e')],'type':_0x585720[_0x394a('0x1f')][_0x394a('0x20')]};});_0x3dabbb=qs[_0x394a('0x21')](_0x9586a7,_0x2a01ec);var _0x49f787={'where':_0x3dabbb[_0x394a('0x22')]};return db[_0x394a('0x23')][_0x394a('0xe')](_0x49f787)[_0x394a('0x12')](function(_0x1cceee){_0x163ac0[_0x394a('0xe')]=_0x1cceee;_0x3dabbb[_0x394a('0x24')]=qs[_0x394a('0x24')](_0x2a01ec[_0x394a('0x25')]);return db[_0x394a('0x23')]['findAll'](_0x3dabbb);})[_0x394a('0x12')](function(_0x3bf486){_0x163ac0[_0x394a('0x26')]=_0x3bf486;return _0x163ac0;})[_0x394a('0x12')](respondWithFilteredResult(_0x5b7257,_0x3dabbb))['catch'](handleError(_0x5b7257,null));};exports[_0x394a('0x27')]=function(_0x4a2da7,_0x2e491b){var _0x4ae28a={'raw':!![],'where':{'id':_0x4a2da7['params']['id']}},_0x26de76={};_0x26de76[_0x394a('0x28')]=_[_0x394a('0x29')](db[_0x394a('0x23')][_0x394a('0x1d')]);_0x26de76['query']=_['keys'](_0x4a2da7[_0x394a('0x25')]);_0x26de76[_0x394a('0x2a')]=_[_0x394a('0x2b')](_0x26de76[_0x394a('0x28')],_0x26de76[_0x394a('0x25')]);_0x4ae28a[_0x394a('0x2c')]=_[_0x394a('0x2b')](_0x26de76[_0x394a('0x28')],qs[_0x394a('0x2d')](_0x4a2da7[_0x394a('0x25')]['fields']));_0x4ae28a[_0x394a('0x2c')]=_0x4ae28a[_0x394a('0x2c')][_0x394a('0x2e')]?_0x4ae28a[_0x394a('0x2c')]:_0x26de76[_0x394a('0x28')];if(_0x4a2da7[_0x394a('0x25')][_0x394a('0x2f')]){_0x4ae28a[_0x394a('0x24')]=[{'all':!![]}];}_0x4ae28a=_[_0x394a('0x30')]({},_0x4ae28a,_0x4a2da7['options']);return db[_0x394a('0x23')]['find'](_0x4ae28a)[_0x394a('0x12')](handleEntityNotFound(_0x2e491b,null))['then'](respondWithResult(_0x2e491b,null))[_0x394a('0x31')](handleError(_0x2e491b,null));};exports[_0x394a('0x32')]=function(_0xb5cbfa,_0x4eac6e){return db[_0x394a('0x23')]['create'](_0xb5cbfa[_0x394a('0x33')],{})[_0x394a('0x12')](function(_0x368041){var _0x29c6cf=_0xb5cbfa['user']['get']({'plain':!![]});if(!_0x29c6cf)throw new Error(_0x394a('0x34'));if(_0x29c6cf[_0x394a('0x35')]===_0x394a('0x36')){var _0x41946c=_0x368041['get']({'plain':!![]});var _0x169b0d='ChatQueues';return db[_0x394a('0x37')][_0x394a('0x38')]({'where':{'name':_0x169b0d,'userProfileId':_0x29c6cf['userProfileId']},'raw':!![]})[_0x394a('0x12')](function(_0x5e33fb){if(_0x5e33fb&&_0x5e33fb[_0x394a('0x39')]===0x0){return db[_0x394a('0x15')]['create']({'name':_0x41946c[_0x394a('0x19')],'resourceId':_0x41946c['id'],'type':_0x5e33fb[_0x394a('0x19')],'sectionId':_0x5e33fb['id']},{})[_0x394a('0x12')](function(){return _0x368041;});}else{return _0x368041;}})['catch'](function(_0x4dcef1){logger['error'](_0x394a('0x3a'),_0x4dcef1);throw _0x4dcef1;});}return _0x368041;})['then'](respondWithResult(_0x4eac6e,0xc9))[_0x394a('0x31')](handleError(_0x4eac6e,null));};exports['update']=function(_0x545013,_0x48d502){if(_0x545013['body']['id']){delete _0x545013['body']['id'];}return db[_0x394a('0x23')][_0x394a('0x38')]({'where':{'id':_0x545013[_0x394a('0x3b')]['id']}})[_0x394a('0x12')](handleEntityNotFound(_0x48d502,null))['then'](saveUpdates(_0x545013['body'],null))[_0x394a('0x12')](respondWithResult(_0x48d502,null))['catch'](handleError(_0x48d502,null));};exports['destroy']=function(_0x58a64c,_0x7f851c){return db['ChatQueue'][_0x394a('0x38')]({'where':{'id':_0x58a64c[_0x394a('0x3b')]['id']}})[_0x394a('0x12')](handleEntityNotFound(_0x7f851c,null))['then'](removeEntity(_0x7f851c,null))[_0x394a('0x31')](handleError(_0x7f851c,null));};exports[_0x394a('0x3c')]=function(_0x294ed8,_0x1754e8){return db['ChatQueue']['describe']()[_0x394a('0x12')](respondWithResult(_0x1754e8,null))['catch'](handleError(_0x1754e8,null));};exports['getMembers']=function(_0x13fe6e,_0x4ab577){var _0x24f61d={'raw':!![],'where':{}},_0x37515e={},_0x6ca926;return db[_0x394a('0x23')][_0x394a('0x3d')]({'where':{'id':_0x13fe6e[_0x394a('0x3b')]['id']}})[_0x394a('0x12')](handleEntityNotFound(_0x4ab577,null))['then'](function(_0x2ddcf0){if(_0x2ddcf0){_0x6ca926=_0x2ddcf0['get']({'plain':!![]});_0x37515e[_0x394a('0x28')]=_['keys'](db[_0x394a('0x3e')]['rawAttributes']);_0x37515e[_0x394a('0x25')]=_['keys'](_0x13fe6e[_0x394a('0x25')]);_0x37515e[_0x394a('0x2a')]=_['intersection'](_0x37515e[_0x394a('0x28')],_0x37515e[_0x394a('0x25')]);_0x24f61d['attributes']=_['intersection'](_0x37515e[_0x394a('0x28')],qs[_0x394a('0x2d')](_0x13fe6e[_0x394a('0x25')][_0x394a('0x2d')]));_0x24f61d[_0x394a('0x2c')]=_0x24f61d[_0x394a('0x2c')][_0x394a('0x2e')]?_0x24f61d[_0x394a('0x2c')]:_0x37515e['model'];if(!_0x13fe6e['query'][_0x394a('0x3f')]('nolimit')){_0x24f61d[_0x394a('0xd')]=qs[_0x394a('0xd')](_0x13fe6e[_0x394a('0x25')][_0x394a('0xd')]);_0x24f61d['offset']=qs[_0x394a('0xb')](_0x13fe6e[_0x394a('0x25')][_0x394a('0xb')]);}_0x24f61d[_0x394a('0x40')]=qs[_0x394a('0x41')](_0x13fe6e[_0x394a('0x25')][_0x394a('0x41')]);_0x24f61d[_0x394a('0x22')]=qs[_0x394a('0x2a')](_['pick'](_0x13fe6e[_0x394a('0x25')],_0x37515e[_0x394a('0x2a')]));_0x24f61d[_0x394a('0x22')][_0x394a('0x42')]=_0x2ddcf0['id'];if(_0x13fe6e[_0x394a('0x25')][_0x394a('0x43')]){_0x24f61d[_0x394a('0x22')]=_[_0x394a('0x30')](_0x24f61d[_0x394a('0x22')],{'$or':_[_0x394a('0x1c')](_0x24f61d['attributes'],function(_0x18a8da){var _0x30a1e7={};_0x30a1e7[_0x18a8da]={'$like':'%'+_0x13fe6e[_0x394a('0x25')][_0x394a('0x43')]+'%'};return _0x30a1e7;})});}_0x24f61d=_[_0x394a('0x30')]({},_0x24f61d,_0x13fe6e[_0x394a('0x44')]);return db[_0x394a('0x3e')][_0x394a('0x45')](_0x24f61d);}})[_0x394a('0x12')](function(_0x1ce099){if(_0x1ce099){return db[_0x394a('0x46')][_0x394a('0x47')]({'where':{'id':_[_0x394a('0x1c')](_0x1ce099,_0x394a('0x48')),'role':_0x394a('0x49')},'attributes':['id','name',_0x394a('0x4a'),'updatedAt','createdAt']});}})[_0x394a('0x12')](function(_0x48dba2){if(_0x48dba2){return{'count':_0x48dba2['count'],'rows':_[_0x394a('0x1c')](_0x48dba2[_0x394a('0x26')],function(_0x3c69b8){return{'membername':_0x3c69b8[_0x394a('0x19')],'UserId':_0x3c69b8['id'],'queue_name':_0x6ca926[_0x394a('0x19')],'ChatQueueId':_0x6ca926['id'],'interface':util['format'](_0x394a('0x4b'),_0x394a('0x4c'),_0x3c69b8[_0x394a('0x19')]),'penalty':0x0,'paused':_0x3c69b8[_0x394a('0x4a')],'createdAt':_0x3c69b8['createdAt'],'updatedAt':_0x3c69b8[_0x394a('0x4d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x394a('0x12')](respondWithFilteredResult(_0x4ab577,_0x24f61d))[_0x394a('0x31')](handleError(_0x4ab577,null));};exports['getTeams']=function(_0x773a87,_0x1a0920){var _0xffe80c={};var _0x1a6b6c={};var _0x4ef0f1;var _0x16524e;return db[_0x394a('0x23')][_0x394a('0x3d')]({'where':{'id':_0x773a87['params']['id']}})[_0x394a('0x12')](handleEntityNotFound(_0x1a0920,null))['then'](function(_0x465ab0){if(_0x465ab0){_0x4ef0f1=_0x465ab0;_0x1a6b6c[_0x394a('0x28')]=_[_0x394a('0x29')](db[_0x394a('0x4e')][_0x394a('0x1d')]);_0x1a6b6c['query']=_[_0x394a('0x29')](_0x773a87[_0x394a('0x25')]);_0x1a6b6c['filters']=_[_0x394a('0x2b')](_0x1a6b6c['model'],_0x1a6b6c[_0x394a('0x25')]);_0xffe80c[_0x394a('0x2c')]=_[_0x394a('0x2b')](_0x1a6b6c[_0x394a('0x28')],qs[_0x394a('0x2d')](_0x773a87[_0x394a('0x25')]['fields']));_0xffe80c[_0x394a('0x2c')]=_0xffe80c[_0x394a('0x2c')][_0x394a('0x2e')]?_0xffe80c['attributes']:_0x1a6b6c[_0x394a('0x28')];_0xffe80c[_0x394a('0x40')]=qs[_0x394a('0x41')](_0x773a87[_0x394a('0x25')]['sort']);_0xffe80c[_0x394a('0x22')]=qs[_0x394a('0x2a')](_[_0x394a('0x4f')](_0x773a87[_0x394a('0x25')],_0x1a6b6c[_0x394a('0x2a')]));if(_0x773a87[_0x394a('0x25')][_0x394a('0x43')]){_0xffe80c[_0x394a('0x22')]=_['merge'](_0xffe80c['where'],{'$or':_[_0x394a('0x1c')](_0xffe80c[_0x394a('0x2c')],function(_0x4275fb){var _0x26bcbd={};_0x26bcbd[_0x4275fb]={'$like':'%'+_0x773a87[_0x394a('0x25')][_0x394a('0x43')]+'%'};return _0x26bcbd;})});}_0xffe80c=_[_0x394a('0x30')]({},_0xffe80c,_0x773a87[_0x394a('0x44')]);return _0x4ef0f1['getTeams'](_0xffe80c);}})[_0x394a('0x12')](function(_0x4a34a5){if(_0x4a34a5){_0x16524e=_0x4a34a5[_0x394a('0x2e')];if(!_0x773a87[_0x394a('0x25')][_0x394a('0x3f')](_0x394a('0x50'))){_0xffe80c['limit']=qs[_0x394a('0xd')](_0x773a87[_0x394a('0x25')][_0x394a('0xd')]);_0xffe80c[_0x394a('0xb')]=qs[_0x394a('0xb')](_0x773a87[_0x394a('0x25')][_0x394a('0xb')]);}return _0x4ef0f1['getTeams'](_0xffe80c);}})[_0x394a('0x12')](function(_0xc87dfa){if(_0xc87dfa){return _0xc87dfa?{'count':_0x16524e,'rows':_0xc87dfa}:null;}})[_0x394a('0x12')](respondWithResult(_0x1a0920,null))['catch'](handleError(_0x1a0920,null));};exports[_0x394a('0x51')]=function(_0x362a69,_0x492fbb){var _0x2a0739=_0x362a69['body'][_0x394a('0x52')];return db['Team'][_0x394a('0x45')]({'where':{'id':_0x2a0739},'attributes':['id'],'include':[{'model':db['User'],'as':_0x394a('0x53'),'attributes':['id',_0x394a('0x19'),_0x394a('0x54'),'voicePause',_0x394a('0x55')],'raw':!![]}]})['then'](function(_0x10c9ab){if(_0x10c9ab){var _0x16457d=_[_0x394a('0x56')](_0x10c9ab,function(_0x26bd5a){var _0xa6193=_0x26bd5a[_0x394a('0x13')]({'plain':!![]});return _0xa6193[_0x394a('0x53')];});return db[_0x394a('0x23')]['find']({'where':{'id':_0x362a69['params']['id']}})[_0x394a('0x12')](function(_0x2a65c9){return db['sequelize'][_0x394a('0x57')](function(_0x1e37e8){return _0x2a65c9[_0x394a('0x51')](_0x2a0739,{'transaction':_0x1e37e8})[_0x394a('0x12')](function(){return BPromise[_0x394a('0x58')](_0x16457d,function(_0x2ed9c2){return db[_0x394a('0x3e')][_0x394a('0x59')]({'where':{'UserId':_0x2ed9c2['id'],'ChatQueueId':_0x362a69[_0x394a('0x3b')]['id']},'transaction':_0x1e37e8});});})[_0x394a('0x12')](function(){_0x16457d['forEach'](function(_0x1a6d02){socket[_0x394a('0x5a')](_0x394a('0x5b'),{'UserId':_0x1a6d02['id'],'ChatQueueId':_0x2a65c9['id']});});});});});}})[_0x394a('0x12')](respondWithStatusCode(_0x492fbb,null))[_0x394a('0x31')](handleError(_0x492fbb,null));};exports[_0x394a('0x5c')]=function(_0x55d3c4,_0x2b85a4){return db['Team'][_0x394a('0x45')]({'where':{'id':_0x55d3c4[_0x394a('0x25')][_0x394a('0x52')]},'attributes':['id'],'include':[{'model':db[_0x394a('0x46')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2b85a4,null))[_0x394a('0x12')](function(_0x2ab6b3){var _0x73bdc=_[_0x394a('0x1c')](_0x2ab6b3,'id');var _0x519789=[];var _0x585d9c=[];var _0x5c4188=squel[_0x394a('0x5d')]();_0x5c4188[_0x394a('0x5e')](_0x394a('0x5f'))[_0x394a('0x60')](_0x394a('0x61'),'tq')[_0x394a('0x62')](_0x394a('0x63'),'ut',_0x394a('0x64'))[_0x394a('0x22')]('ChatQueueId\x20=\x20?',_0x55d3c4['params']['id']);for(var _0x43767f=0x0;_0x43767f<_0x2ab6b3['length'];_0x43767f+=0x1){let _0x7d7e41=_0x2ab6b3[_0x43767f];for(var _0x4d7cd9=0x0;_0x4d7cd9<_0x7d7e41[_0x394a('0x53')][_0x394a('0x2e')];_0x4d7cd9+=0x1){let _0x31dca1=_0x7d7e41[_0x394a('0x53')][_0x4d7cd9];var _0x11bb7e=_0x5c4188['clone']();_0x11bb7e[_0x394a('0x22')](_0x394a('0x65'),_0x31dca1['id']);_0x585d9c[_0x394a('0x66')](db['sequelize'][_0x394a('0x25')](_0x11bb7e[_0x394a('0x67')](),{'type':db[_0x394a('0x68')]['QueryTypes'][_0x394a('0x69')]})[_0x394a('0x12')](function(_0x1a4080){if(_0x1a4080[_0x394a('0x2e')]===0x1){return _0x31dca1['id'];}else{var _0x26e9a5=_[_0x394a('0x6a')](_[_0x394a('0x1c')](_0x1a4080,_0x394a('0x6b')),function(_0x193d96){return _['includes'](_0x73bdc,_0x193d96);});if(_0x26e9a5){return _0x31dca1['id'];}}}));}}return BPromise['all'](_0x585d9c)[_0x394a('0x12')](function(_0x11c397){_0x519789=_(_0x519789)[_0x394a('0x6c')](_0x11c397)['compact']()[_0x394a('0x6d')]();return db[_0x394a('0x23')][_0x394a('0x38')]({'where':{'id':_0x55d3c4[_0x394a('0x3b')]['id']}})['then'](function(_0x4a760e){return db[_0x394a('0x68')][_0x394a('0x57')](function(_0x298faa){return _0x4a760e[_0x394a('0x5c')](_0x55d3c4[_0x394a('0x25')][_0x394a('0x52')],{'transaction':_0x298faa})[_0x394a('0x12')](function(){if(!_['isEmpty'](_0x519789)){return _0x4a760e[_0x394a('0x6e')](_0x519789,{'transaction':_0x298faa});}})['then'](function(){_0x519789['forEach'](function(_0x4cfae6){socket[_0x394a('0x5a')](_0x394a('0x6f'),{'UserId':_0x4cfae6,'ChatQueueId':_0x4a760e['id']});});});});});});})[_0x394a('0x12')](respondWithStatusCode(_0x2b85a4,null))[_0x394a('0x31')](handleError(_0x2b85a4,null));};exports[_0x394a('0x70')]=function(_0x3156dc,_0x53292b){return db[_0x394a('0x23')][_0x394a('0x38')]({'where':{'id':_0x3156dc[_0x394a('0x3b')]['id']}})['then'](handleEntityNotFound(_0x53292b,null))['then'](function(_0x5a6640){if(_0x5a6640){return _0x5a6640[_0x394a('0x70')](_0x3156dc[_0x394a('0x33')][_0x394a('0x52')],_[_0x394a('0x71')](_0x3156dc[_0x394a('0x33')],['ids','id'])||{})[_0x394a('0x72')](function(_0x1868fa){for(var _0x5376c7=0x0;_0x5376c7<_0x3156dc['body']['ids'][_0x394a('0x2e')];_0x5376c7+=0x1){socket[_0x394a('0x5a')]('userChatQueue:save',{'UserId':Number(_0x3156dc[_0x394a('0x33')][_0x394a('0x52')][_0x5376c7]),'ChatQueueId':Number(_0x3156dc[_0x394a('0x3b')]['id'])});}return _0x1868fa;});}})[_0x394a('0x12')](respondWithResult(_0x53292b,null))['catch'](handleError(_0x53292b,null));};exports[_0x394a('0x6e')]=function(_0x33e29b,_0x2d2c6d){return db[_0x394a('0x23')][_0x394a('0x38')]({'where':{'id':_0x33e29b[_0x394a('0x3b')]['id']}})[_0x394a('0x12')](handleEntityNotFound(_0x2d2c6d,null))[_0x394a('0x12')](function(_0x387005){if(_0x387005){return _0x387005[_0x394a('0x6e')](_0x33e29b[_0x394a('0x25')][_0x394a('0x52')])[_0x394a('0x12')](function(){if(_[_0x394a('0x73')](_0x33e29b[_0x394a('0x25')][_0x394a('0x52')])){for(var _0x16bc85=0x0;_0x16bc85<_0x33e29b[_0x394a('0x25')][_0x394a('0x52')][_0x394a('0x2e')];_0x16bc85+=0x1){socket[_0x394a('0x5a')]('userChatQueue:remove',{'UserId':Number(_0x33e29b[_0x394a('0x25')]['ids'][_0x16bc85]),'ChatQueueId':Number(_0x33e29b['params']['id'])});}}else{socket[_0x394a('0x5a')](_0x394a('0x6f'),{'UserId':Number(_0x33e29b['query'][_0x394a('0x52')]),'ChatQueueId':Number(_0x33e29b['params']['id'])});}});}})[_0x394a('0x12')](respondWithStatusCode(_0x2d2c6d,null))[_0x394a('0x31')](handleError(_0x2d2c6d,null));};exports[_0x394a('0x74')]=function(_0x56a63d,_0xc0d59b){var _0xcde607={};var _0x3d499c={};var _0x33c279;var _0x3b4334;return db[_0x394a('0x23')]['findOne']({'where':{'id':_0x56a63d[_0x394a('0x3b')]['id']}})[_0x394a('0x12')](handleEntityNotFound(_0xc0d59b,null))['then'](function(_0x1f2160){if(_0x1f2160){_0x33c279=_0x1f2160;_0x3d499c[_0x394a('0x28')]=_['keys'](db[_0x394a('0x46')][_0x394a('0x1d')]);_0x3d499c[_0x394a('0x25')]=_[_0x394a('0x29')](_0x56a63d['query']);_0x3d499c[_0x394a('0x2a')]=_[_0x394a('0x2b')](_0x3d499c[_0x394a('0x28')],_0x3d499c[_0x394a('0x25')]);_0xcde607['attributes']=_[_0x394a('0x2b')](_0x3d499c['model'],qs[_0x394a('0x2d')](_0x56a63d[_0x394a('0x25')][_0x394a('0x2d')]));_0xcde607['attributes']=_0xcde607['attributes'][_0x394a('0x2e')]?_0xcde607[_0x394a('0x2c')]:_0x3d499c[_0x394a('0x28')];_0xcde607[_0x394a('0x40')]=qs['sort'](_0x56a63d[_0x394a('0x25')][_0x394a('0x41')]);_0xcde607[_0x394a('0x22')]=qs[_0x394a('0x2a')](_[_0x394a('0x4f')](_0x56a63d[_0x394a('0x25')],_0x3d499c['filters']));if(_0x56a63d['query'][_0x394a('0x43')]){_0xcde607['where']=_['merge'](_0xcde607[_0x394a('0x22')],{'$or':_[_0x394a('0x1c')](_0xcde607[_0x394a('0x2c')],function(_0x587130){var _0x5a1d74={};_0x5a1d74[_0x587130]={'$like':'%'+_0x56a63d[_0x394a('0x25')][_0x394a('0x43')]+'%'};return _0x5a1d74;})});}_0xcde607=_[_0x394a('0x30')]({},_0xcde607,_0x56a63d[_0x394a('0x44')]);return _0x33c279[_0x394a('0x74')](_0xcde607);}})[_0x394a('0x12')](function(_0x28d447){if(_0x28d447){_0x3b4334=_0x28d447[_0x394a('0x2e')];if(!_0x56a63d[_0x394a('0x25')][_0x394a('0x3f')](_0x394a('0x50'))){_0xcde607['limit']=qs['limit'](_0x56a63d['query'][_0x394a('0xd')]);_0xcde607[_0x394a('0xb')]=qs['offset'](_0x56a63d[_0x394a('0x25')][_0x394a('0xb')]);}return _0x33c279[_0x394a('0x74')](_0xcde607);}})['then'](function(_0x55f028){if(_0x55f028){return _0x55f028?{'count':_0x3b4334,'rows':_0x55f028}:null;}})[_0x394a('0x12')](respondWithResult(_0xc0d59b,null))[_0x394a('0x31')](handleError(_0xc0d59b,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index d0f6abf..5affbae 100644
--- a/server/api/chatQueue/chatQueue.events.js
+++ b/server/api/chatQueue/chatQueue.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x560e=['events','../../mysqldb','ChatQueue','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0x38a0b2,_0x5f2ac9){var _0x3acb97=function(_0x348927){while(--_0x348927){_0x38a0b2['push'](_0x38a0b2['shift']());}};_0x3acb97(++_0x5f2ac9);}(_0x560e,0x1cc));var _0xe560=function(_0x2b12d9,_0x37f8d4){_0x2b12d9=_0x2b12d9-0x0;var _0x4eb2bf=_0x560e[_0x2b12d9];return _0x4eb2bf;};'use strict';var EventEmitter=require(_0xe560('0x0'));var ChatQueue=require(_0xe560('0x1'))['db'][_0xe560('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xe560('0x3')](0x0);var events={'afterCreate':_0xe560('0x4'),'afterUpdate':_0xe560('0x5'),'afterDestroy':_0xe560('0x6')};function emitEvent(_0x118ef4){return function(_0x33ecdb,_0x5ae2d7,_0x460a4e){ChatQueueEvents[_0xe560('0x7')](_0x118ef4+':'+_0x33ecdb['id'],_0x33ecdb);ChatQueueEvents[_0xe560('0x7')](_0x118ef4,_0x33ecdb);_0x460a4e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xe560('0x8')](e,emitEvent(event));}}module[_0xe560('0x9')]=ChatQueueEvents;
\ No newline at end of file
+var _0x3a3d=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','remove','emit'];(function(_0x24a31e,_0x2f6dd4){var _0x1de563=function(_0x5e8830){while(--_0x5e8830){_0x24a31e['push'](_0x24a31e['shift']());}};_0x1de563(++_0x2f6dd4);}(_0x3a3d,0x174));var _0xd3a3=function(_0x46d4d6,_0x134ae2){_0x46d4d6=_0x46d4d6-0x0;var _0x173a9b=_0x3a3d[_0x46d4d6];return _0x173a9b;};'use strict';var EventEmitter=require(_0xd3a3('0x0'));var ChatQueue=require(_0xd3a3('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xd3a3('0x2')](0x0);var events={'afterCreate':_0xd3a3('0x3'),'afterUpdate':'update','afterDestroy':_0xd3a3('0x4')};function emitEvent(_0x4478df){return function(_0x3e9396,_0x369eac,_0x3f1108){ChatQueueEvents[_0xd3a3('0x5')](_0x4478df+':'+_0x3e9396['id'],_0x3e9396);ChatQueueEvents['emit'](_0x4478df,_0x3e9396);_0x3f1108(null);};}for(var e in events){if(events[_0xd3a3('0x6')](e)){var event=events[e];ChatQueue[_0xd3a3('0x7')](e,emitEvent(event));}}module[_0xd3a3('0x8')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 2524dcd..c8200d9 100644
--- a/server/api/chatQueue/chatQueue.model.js
+++ b/server/api/chatQueue/chatQueue.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xead6=['api','moment','path','../../config/environment','exports','define','ChatQueue','util'];(function(_0x226f4e,_0x1f66cc){var _0x24964f=function(_0x4e6cdf){while(--_0x4e6cdf){_0x226f4e['push'](_0x226f4e['shift']());}};_0x24964f(++_0x1f66cc);}(_0xead6,0x18f));var _0x6ead=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xead6[_0x3ab51d];return _0x29a04e;};'use strict';var _=require('lodash');var util=require(_0x6ead('0x0'));var logger=require('../../config/logger')(_0x6ead('0x1'));var moment=require(_0x6ead('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6ead('0x3'));var rimraf=require('rimraf');var config=require(_0x6ead('0x4'));var attributes=require('./chatQueue.attributes');module[_0x6ead('0x5')]=function(_0x5165b0,_0x49c4ca){return _0x5165b0[_0x6ead('0x6')](_0x6ead('0x7'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb2aa=['api','moment','bluebird','request-promise','./chatQueue.attributes','exports','ChatQueue','util','../../config/logger'];(function(_0xec74ca,_0x1902ab){var _0xa3c13c=function(_0x490d46){while(--_0x490d46){_0xec74ca['push'](_0xec74ca['shift']());}};_0xa3c13c(++_0x1902ab);}(_0xb2aa,0x16f));var _0xab2a=function(_0x30bff2,_0xf29349){_0x30bff2=_0x30bff2-0x0;var _0x8bdfe2=_0xb2aa[_0x30bff2];return _0x8bdfe2;};'use strict';var _=require('lodash');var util=require(_0xab2a('0x0'));var logger=require(_0xab2a('0x1'))(_0xab2a('0x2'));var moment=require(_0xab2a('0x3'));var BPromise=require(_0xab2a('0x4'));var rp=require(_0xab2a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xab2a('0x6'));module[_0xab2a('0x7')]=function(_0x55bb2d,_0x551931){return _0x55bb2d['define'](_0xab2a('0x8'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index 2361755..f8145e8 100644
--- a/server/api/chatQueue/chatQueue.rpc.js
+++ b/server/api/chatQueue/chatQueue.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6eb2=['error','code','message','ChatQueue,\x20%s,\x20%s','info','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','attributes','limit','include','map','model','find','where','ShowChatQueue','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./chatQueue.socket','register','request','then','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x1755f9,_0x176a42){var _0x322247=function(_0x3eeb6d){while(--_0x3eeb6d){_0x1755f9['push'](_0x1755f9['shift']());}};_0x322247(++_0x176a42);}(_0x6eb2,0x10a));var _0x26eb=function(_0x179b80,_0x440291){_0x179b80=_0x179b80-0x0;var _0x1e8d03=_0x6eb2[_0x179b80];return _0x1e8d03;};'use strict';var _=require(_0x26eb('0x0'));var util=require('util');var moment=require(_0x26eb('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x26eb('0x2'));var db=require(_0x26eb('0x3'))['db'];var utils=require(_0x26eb('0x4'));var logger=require(_0x26eb('0x5'))(_0x26eb('0x6'));var config=require(_0x26eb('0x7'));var jayson=require(_0x26eb('0x8'));var client=jayson['client'][_0x26eb('0x9')]({'port':0x232a});config[_0x26eb('0xa')]=_[_0x26eb('0xb')](config[_0x26eb('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x26eb('0xc'))(new Redis(config['redis']));require(_0x26eb('0xd'))[_0x26eb('0xe')](socket);function respondWithRpcPromise(_0x57577b,_0x3d010f,_0x352e01){return new BPromise(function(_0x14d022,_0x5db75f){return client[_0x26eb('0xf')](_0x57577b,_0x352e01)[_0x26eb('0x10')](function(_0x26ead1){logger['info']('ChatQueue,\x20%s,\x20%s',_0x3d010f,'request\x20sent');logger[_0x26eb('0x11')](_0x26eb('0x12'),_0x3d010f,_0x26eb('0x13'),JSON[_0x26eb('0x14')](_0x26ead1));if(_0x26ead1[_0x26eb('0x15')]){if(_0x26ead1[_0x26eb('0x15')][_0x26eb('0x16')]===0x1f4){logger[_0x26eb('0x15')]('ChatQueue,\x20%s,\x20%s',_0x3d010f,_0x26ead1[_0x26eb('0x15')][_0x26eb('0x17')]);return _0x5db75f(_0x26ead1[_0x26eb('0x15')]['message']);}logger[_0x26eb('0x15')](_0x26eb('0x18'),_0x3d010f,_0x26ead1[_0x26eb('0x15')][_0x26eb('0x17')]);return _0x14d022(_0x26ead1[_0x26eb('0x15')][_0x26eb('0x17')]);}else{logger[_0x26eb('0x19')]('ChatQueue,\x20%s,\x20%s',_0x3d010f,'request\x20sent');_0x14d022(_0x26ead1[_0x26eb('0x1a')]['message']);}})[_0x26eb('0x1b')](function(_0x34d66c){logger['error'](_0x26eb('0x18'),_0x3d010f,_0x34d66c);_0x5db75f(_0x34d66c);});});}exports[_0x26eb('0x1c')]=function(_0x3522c2){var _0x5bc8f9=this;return new Promise(function(_0x185dff,_0x3eb486){return db[_0x26eb('0x1d')][_0x26eb('0x1e')]({'raw':_0x3522c2['options']?_0x3522c2[_0x26eb('0x1f')][_0x26eb('0x20')]===undefined?!![]:![]:!![],'where':_0x3522c2[_0x26eb('0x1f')]?_0x3522c2[_0x26eb('0x1f')]['where']||null:null,'attributes':_0x3522c2[_0x26eb('0x1f')]?_0x3522c2[_0x26eb('0x1f')][_0x26eb('0x21')]||null:null,'limit':_0x3522c2[_0x26eb('0x1f')]?_0x3522c2[_0x26eb('0x1f')][_0x26eb('0x22')]||null:null,'include':_0x3522c2[_0x26eb('0x1f')]?_0x3522c2[_0x26eb('0x1f')][_0x26eb('0x23')]?_[_0x26eb('0x24')](_0x3522c2[_0x26eb('0x1f')]['include'],function(_0xa93eaf){return{'model':db[_0xa93eaf['model']],'as':_0xa93eaf['as'],'attributes':_0xa93eaf[_0x26eb('0x21')],'include':_0xa93eaf[_0x26eb('0x23')]?_['map'](_0xa93eaf[_0x26eb('0x23')],function(_0x457c8f){return{'model':db[_0x457c8f[_0x26eb('0x25')]],'as':_0x457c8f['as'],'attributes':_0x457c8f[_0x26eb('0x21')],'include':_0x457c8f[_0x26eb('0x23')]?_[_0x26eb('0x24')](_0x457c8f[_0x26eb('0x23')],function(_0x4925f0){return{'model':db[_0x4925f0[_0x26eb('0x25')]],'as':_0x4925f0['as'],'attributes':_0x4925f0['attributes']};}):[]};}):[]};}):[]:[]})[_0x26eb('0x10')](function(_0x52473d){logger[_0x26eb('0x19')](_0x26eb('0x1c'),_0x3522c2);logger[_0x26eb('0x11')](_0x26eb('0x1c'),_0x3522c2,JSON[_0x26eb('0x14')](_0x52473d));_0x185dff(_0x52473d);})[_0x26eb('0x1b')](function(_0x4e58a6){logger[_0x26eb('0x15')](_0x26eb('0x1c'),_0x4e58a6[_0x26eb('0x17')],_0x3522c2);_0x3eb486(_0x5bc8f9[_0x26eb('0x15')](0x1f4,_0x4e58a6[_0x26eb('0x17')]));});});};exports['ShowChatQueue']=function(_0x4ad2d2){var _0x2a94dc=this;return new Promise(function(_0x1842e5,_0x5eeb9b){return db[_0x26eb('0x1d')][_0x26eb('0x26')]({'raw':_0x4ad2d2['options']?_0x4ad2d2['options'][_0x26eb('0x20')]===undefined?!![]:![]:!![],'where':_0x4ad2d2['options']?_0x4ad2d2[_0x26eb('0x1f')][_0x26eb('0x27')]||null:null,'attributes':_0x4ad2d2[_0x26eb('0x1f')]?_0x4ad2d2[_0x26eb('0x1f')]['attributes']||null:null,'include':_0x4ad2d2[_0x26eb('0x1f')]?_0x4ad2d2[_0x26eb('0x1f')][_0x26eb('0x23')]?_['map'](_0x4ad2d2[_0x26eb('0x1f')][_0x26eb('0x23')],function(_0x22e1f8){return{'model':db[_0x22e1f8['model']],'as':_0x22e1f8['as'],'attributes':_0x22e1f8[_0x26eb('0x21')],'include':_0x22e1f8['include']?_[_0x26eb('0x24')](_0x22e1f8[_0x26eb('0x23')],function(_0x381b21){return{'model':db[_0x381b21[_0x26eb('0x25')]],'as':_0x381b21['as'],'attributes':_0x381b21[_0x26eb('0x21')],'include':_0x381b21['include']?_[_0x26eb('0x24')](_0x381b21['include'],function(_0x2e61fe){return{'model':db[_0x2e61fe['model']],'as':_0x2e61fe['as'],'attributes':_0x2e61fe[_0x26eb('0x21')]};}):[]};}):[]};}):[]:[]})[_0x26eb('0x10')](function(_0x57c4e0){logger[_0x26eb('0x19')](_0x26eb('0x28'),_0x4ad2d2);logger[_0x26eb('0x11')]('ShowChatQueue',_0x4ad2d2,JSON['stringify'](_0x57c4e0));_0x1842e5(_0x57c4e0);})[_0x26eb('0x1b')](function(_0xa05cca){logger[_0x26eb('0x15')](_0x26eb('0x28'),_0xa05cca[_0x26eb('0x17')],_0x4ad2d2);_0x5eeb9b(_0x2a94dc[_0x26eb('0x15')](0x1f4,_0xa05cca[_0x26eb('0x17')]));});});};
\ No newline at end of file
+var _0x2cb0=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','limit','include','map','model','attributes','find','ShowChatQueue','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x2cb0,0x12c));var _0x02cb=function(_0x2880a9,_0x9d6d4a){_0x2880a9=_0x2880a9-0x0;var _0x5360f6=_0x2cb0[_0x2880a9];return _0x5360f6;};'use strict';var _=require(_0x02cb('0x0'));var util=require(_0x02cb('0x1'));var moment=require('moment');var BPromise=require(_0x02cb('0x2'));var rs=require(_0x02cb('0x3'));var fs=require('fs');var Redis=require(_0x02cb('0x4'));var db=require(_0x02cb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x02cb('0x6'))(_0x02cb('0x7'));var config=require(_0x02cb('0x8'));var jayson=require(_0x02cb('0x9'));var client=jayson[_0x02cb('0xa')][_0x02cb('0xb')]({'port':0x232a});config[_0x02cb('0xc')]=_[_0x02cb('0xd')](config['redis'],{'host':_0x02cb('0xe'),'port':0x18eb});var socket=require(_0x02cb('0xf'))(new Redis(config[_0x02cb('0xc')]));require(_0x02cb('0x10'))[_0x02cb('0x11')](socket);function respondWithRpcPromise(_0x5a1efb,_0x1735c8,_0x847342){return new BPromise(function(_0x2787a7,_0x59511e){return client[_0x02cb('0x12')](_0x5a1efb,_0x847342)[_0x02cb('0x13')](function(_0x26b7d4){logger[_0x02cb('0x14')]('ChatQueue,\x20%s,\x20%s',_0x1735c8,_0x02cb('0x15'));logger[_0x02cb('0x16')](_0x02cb('0x17'),_0x1735c8,_0x02cb('0x15'),JSON[_0x02cb('0x18')](_0x26b7d4));if(_0x26b7d4[_0x02cb('0x19')]){if(_0x26b7d4['error'][_0x02cb('0x1a')]===0x1f4){logger[_0x02cb('0x19')](_0x02cb('0x1b'),_0x1735c8,_0x26b7d4['error'][_0x02cb('0x1c')]);return _0x59511e(_0x26b7d4[_0x02cb('0x19')][_0x02cb('0x1c')]);}logger[_0x02cb('0x19')](_0x02cb('0x1b'),_0x1735c8,_0x26b7d4['error']['message']);return _0x2787a7(_0x26b7d4[_0x02cb('0x19')][_0x02cb('0x1c')]);}else{logger[_0x02cb('0x14')](_0x02cb('0x1b'),_0x1735c8,'request\x20sent');_0x2787a7(_0x26b7d4[_0x02cb('0x1d')]['message']);}})[_0x02cb('0x1e')](function(_0x4cbb03){logger[_0x02cb('0x19')](_0x02cb('0x1b'),_0x1735c8,_0x4cbb03);_0x59511e(_0x4cbb03);});});}exports[_0x02cb('0x1f')]=function(_0x5c4dbb){var _0x26ac13=this;return new Promise(function(_0x47c161,_0x426b1e){return db[_0x02cb('0x20')][_0x02cb('0x21')]({'raw':_0x5c4dbb[_0x02cb('0x22')]?_0x5c4dbb[_0x02cb('0x22')][_0x02cb('0x23')]===undefined?!![]:![]:!![],'where':_0x5c4dbb['options']?_0x5c4dbb[_0x02cb('0x22')][_0x02cb('0x24')]||null:null,'attributes':_0x5c4dbb[_0x02cb('0x22')]?_0x5c4dbb['options']['attributes']||null:null,'limit':_0x5c4dbb['options']?_0x5c4dbb['options'][_0x02cb('0x25')]||null:null,'include':_0x5c4dbb[_0x02cb('0x22')]?_0x5c4dbb[_0x02cb('0x22')][_0x02cb('0x26')]?_[_0x02cb('0x27')](_0x5c4dbb[_0x02cb('0x22')][_0x02cb('0x26')],function(_0x2ee82f){return{'model':db[_0x2ee82f[_0x02cb('0x28')]],'as':_0x2ee82f['as'],'attributes':_0x2ee82f['attributes'],'include':_0x2ee82f[_0x02cb('0x26')]?_[_0x02cb('0x27')](_0x2ee82f[_0x02cb('0x26')],function(_0x2dbe1d){return{'model':db[_0x2dbe1d[_0x02cb('0x28')]],'as':_0x2dbe1d['as'],'attributes':_0x2dbe1d[_0x02cb('0x29')],'include':_0x2dbe1d[_0x02cb('0x26')]?_[_0x02cb('0x27')](_0x2dbe1d[_0x02cb('0x26')],function(_0x540908){return{'model':db[_0x540908['model']],'as':_0x540908['as'],'attributes':_0x540908[_0x02cb('0x29')]};}):[]};}):[]};}):[]:[]})[_0x02cb('0x13')](function(_0x195700){logger[_0x02cb('0x14')](_0x02cb('0x1f'),_0x5c4dbb);logger['debug'](_0x02cb('0x1f'),_0x5c4dbb,JSON['stringify'](_0x195700));_0x47c161(_0x195700);})[_0x02cb('0x1e')](function(_0x5d99e5){logger[_0x02cb('0x19')](_0x02cb('0x1f'),_0x5d99e5['message'],_0x5c4dbb);_0x426b1e(_0x26ac13['error'](0x1f4,_0x5d99e5[_0x02cb('0x1c')]));});});};exports['ShowChatQueue']=function(_0x56d4a1){var _0x37bce4=this;return new Promise(function(_0x4a00d3,_0x80a436){return db[_0x02cb('0x20')][_0x02cb('0x2a')]({'raw':_0x56d4a1[_0x02cb('0x22')]?_0x56d4a1[_0x02cb('0x22')][_0x02cb('0x23')]===undefined?!![]:![]:!![],'where':_0x56d4a1[_0x02cb('0x22')]?_0x56d4a1[_0x02cb('0x22')][_0x02cb('0x24')]||null:null,'attributes':_0x56d4a1[_0x02cb('0x22')]?_0x56d4a1[_0x02cb('0x22')][_0x02cb('0x29')]||null:null,'include':_0x56d4a1['options']?_0x56d4a1['options'][_0x02cb('0x26')]?_[_0x02cb('0x27')](_0x56d4a1[_0x02cb('0x22')][_0x02cb('0x26')],function(_0x199388){return{'model':db[_0x199388[_0x02cb('0x28')]],'as':_0x199388['as'],'attributes':_0x199388[_0x02cb('0x29')],'include':_0x199388[_0x02cb('0x26')]?_[_0x02cb('0x27')](_0x199388[_0x02cb('0x26')],function(_0x11de05){return{'model':db[_0x11de05[_0x02cb('0x28')]],'as':_0x11de05['as'],'attributes':_0x11de05[_0x02cb('0x29')],'include':_0x11de05[_0x02cb('0x26')]?_[_0x02cb('0x27')](_0x11de05['include'],function(_0x22170b){return{'model':db[_0x22170b[_0x02cb('0x28')]],'as':_0x22170b['as'],'attributes':_0x22170b[_0x02cb('0x29')]};}):[]};}):[]};}):[]:[]})[_0x02cb('0x13')](function(_0x239198){logger[_0x02cb('0x14')]('ShowChatQueue',_0x56d4a1);logger['debug'](_0x02cb('0x2b'),_0x56d4a1,JSON[_0x02cb('0x18')](_0x239198));_0x4a00d3(_0x239198);})[_0x02cb('0x1e')](function(_0x4c599d){logger['error'](_0x02cb('0x2b'),_0x4c599d['message'],_0x56d4a1);_0x80a436(_0x37bce4[_0x02cb('0x19')](0x1f4,_0x4c599d[_0x02cb('0x1c')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 7a2ff79..942c9fc 100644
--- a/server/api/chatQueue/chatQueue.socket.js
+++ b/server/api/chatQueue/chatQueue.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0e85=['update','removeListener','register','length','chatQueue:','./chatQueue.events','save'];(function(_0x4b5637,_0x47f524){var _0x81ee55=function(_0x30a5cf){while(--_0x30a5cf){_0x4b5637['push'](_0x4b5637['shift']());}};_0x81ee55(++_0x47f524);}(_0x0e85,0x7c));var _0x50e8=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x0e85[_0x4a53d];return _0x27410e;};'use strict';var ChatQueueEvents=require(_0x50e8('0x0'));var events=[_0x50e8('0x1'),'remove',_0x50e8('0x2')];function createListener(_0x682d10,_0x55e515){return function(_0x55cba3){_0x55e515['emit'](_0x682d10,_0x55cba3);};}function removeListener(_0x236cf3,_0x4e90e7){return function(){ChatQueueEvents[_0x50e8('0x3')](_0x236cf3,_0x4e90e7);};}exports[_0x50e8('0x4')]=function(_0xe3151e){for(var _0xfde42=0x0,_0x5e8b01=events[_0x50e8('0x5')];_0xfde42<_0x5e8b01;_0xfde42++){var _0x108edc=events[_0xfde42];var _0x42665e=createListener(_0x50e8('0x6')+_0x108edc,_0xe3151e);ChatQueueEvents['on'](_0x108edc,_0x42665e);}};
\ No newline at end of file
+var _0x9bde=['chatQueue:','save','update','emit','removeListener','register','length'];(function(_0x349148,_0x31eabb){var _0x2f2b0f=function(_0x44726e){while(--_0x44726e){_0x349148['push'](_0x349148['shift']());}};_0x2f2b0f(++_0x31eabb);}(_0x9bde,0xe1));var _0xe9bd=function(_0x4e8c18,_0x1a1cc3){_0x4e8c18=_0x4e8c18-0x0;var _0x54ebb6=_0x9bde[_0x4e8c18];return _0x54ebb6;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0xe9bd('0x0'),'remove',_0xe9bd('0x1')];function createListener(_0x4c63ca,_0x51786f){return function(_0x3005aa){_0x51786f[_0xe9bd('0x2')](_0x4c63ca,_0x3005aa);};}function removeListener(_0x1c1b34,_0x10822d){return function(){ChatQueueEvents[_0xe9bd('0x3')](_0x1c1b34,_0x10822d);};}exports[_0xe9bd('0x4')]=function(_0x4fd7b8){for(var _0x4763e9=0x0,_0x5f18fe=events[_0xe9bd('0x5')];_0x4763e9<_0x5f18fe;_0x4763e9++){var _0xa66ae2=events[_0x4763e9];var _0x2d5c75=createListener(_0xe9bd('0x6')+_0xa66ae2,_0x4fd7b8);ChatQueueEvents['on'](_0xa66ae2,_0x2d5c75);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index fee91b7..56a510d 100644
--- a/server/api/chatQueue/index.js
+++ b/server/api/chatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x5e3513,_0xf4c3d5){var _0x2dcd97=function(_0x143f94){while(--_0x143f94){_0x5e3513['push'](_0x5e3513['shift']());}};_0x2dcd97(++_0xf4c3d5);}(_0x55ca,0x126));var _0xa55c=function(_0x1ef547,_0x31bfdb){_0x1ef547=_0x1ef547-0x0;var _0x1d697b=_0x55ca[_0x1ef547];return _0x1d697b;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router;
\ No newline at end of file
+var _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x3e74,0x175));var _0x43e7=function(_0x3c88e1,_0x30e9fe){_0x3c88e1=_0x3c88e1-0x0;var _0x4ae01b=_0x3e74[_0x3c88e1];return _0x4ae01b;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 27c4099..5268fba 100644
--- a/server/api/chatQueueReport/chatQueueReport.attributes.js
+++ b/server/api/chatQueueReport/chatQueueReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdf4e=['exports','STRING','DATE','moment','sequelize'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xdf4e,0x17a));var _0xedf4=function(_0x5b6cf1,_0x32fdcd){_0x5b6cf1=_0x5b6cf1-0x0;var _0x46278c=_0xdf4e[_0x5b6cf1];return _0x46278c;};'use strict';var moment=require(_0xedf4('0x0'));var Sequelize=require(_0xedf4('0x1'));module[_0xedf4('0x2')]={'uniqueid':{'type':Sequelize[_0xedf4('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xedf4('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xedf4('0x4')]},'exitAt':{'type':Sequelize[_0xedf4('0x4')]},'reason':{'type':Sequelize[_0xedf4('0x3')]}};
\ No newline at end of file
+var _0x3544=['DATE','moment','exports','STRING'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0x3544,0x121));var _0x4354=function(_0x1562a2,_0x2e4655){_0x1562a2=_0x1562a2-0x0;var _0x39a636=_0x3544[_0x1562a2];return _0x39a636;};'use strict';var moment=require(_0x4354('0x0'));var Sequelize=require('sequelize');module[_0x4354('0x1')]={'uniqueid':{'type':Sequelize[_0x4354('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x4354('0x3')]},'leaveAt':{'type':Sequelize[_0x4354('0x3')]},'acceptAt':{'type':Sequelize[_0x4354('0x3')]},'exitAt':{'type':Sequelize[_0x4354('0x3')]},'reason':{'type':Sequelize[_0x4354('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index b82da3b..67776fc 100644
--- a/server/api/chatQueueReport/chatQueueReport.controller.js
+++ b/server/api/chatQueueReport/chatQueueReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe9ef=['describe','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','fs-extra','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','error','stack','name','send','index','ChatQueueReport','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','params'];(function(_0x219af8,_0x5559b3){var _0x5d6acf=function(_0x33930a){while(--_0x33930a){_0x219af8['push'](_0x219af8['shift']());}};_0x5d6acf(++_0x5559b3);}(_0xe9ef,0x16e));var _0xfe9e=function(_0x59d89e,_0x55edf5){_0x59d89e=_0x59d89e-0x0;var _0x554e93=_0xe9ef[_0x59d89e];return _0x554e93;};'use strict';var emlformat=require(_0xfe9e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfe9e('0x1'));var jsonpatch=require(_0xfe9e('0x2'));var rp=require('request-promise');var moment=require(_0xfe9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xfe9e('0x4'));var util=require(_0xfe9e('0x5'));var path=require(_0xfe9e('0x6'));var sox=require(_0xfe9e('0x7'));var csv=require('to-csv');var ejs=require(_0xfe9e('0x8'));var fs=require('fs');var fs_extra=require(_0xfe9e('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xfe9e('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xfe9e('0xb'));var toCsv=require(_0xfe9e('0xc'));var querystring=require(_0xfe9e('0xd'));var Papa=require('papaparse');var Redis=require(_0xfe9e('0xe'));var authService=require(_0xfe9e('0xf'));var qs=require(_0xfe9e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfe9e('0x11'));var logger=require('../../config/logger')(_0xfe9e('0x12'));var utils=require(_0xfe9e('0x13'));var config=require(_0xfe9e('0x14'));var licenseUtil=require(_0xfe9e('0x15'));var db=require(_0xfe9e('0x16'))['db'];function respondWithStatusCode(_0x32b437,_0x2ba797){_0x2ba797=_0x2ba797||0xcc;return function(_0x3ec8de){if(_0x3ec8de){return _0x32b437[_0xfe9e('0x17')](_0x2ba797);}return _0x32b437['status'](_0x2ba797)[_0xfe9e('0x18')]();};}function respondWithResult(_0x173e46,_0x55ac95){_0x55ac95=_0x55ac95||0xc8;return function(_0x344a80){if(_0x344a80){return _0x173e46[_0xfe9e('0x19')](_0x55ac95)[_0xfe9e('0x1a')](_0x344a80);}};}function respondWithFilteredResult(_0x3f5f68,_0x503d81){return function(_0x4edf71){if(_0x4edf71){var _0x44d746=typeof _0x503d81[_0xfe9e('0x1b')]===_0xfe9e('0x1c')&&typeof _0x503d81[_0xfe9e('0x1d')]==='undefined';var _0x2efc88=_0x4edf71[_0xfe9e('0x1e')];var _0xdf0a3b=_0x44d746?0x0:_0x503d81[_0xfe9e('0x1b')];var _0x495344=_0x44d746?_0x4edf71[_0xfe9e('0x1e')]:_0x503d81[_0xfe9e('0x1b')]+_0x503d81[_0xfe9e('0x1d')];var _0xec283a;if(_0x495344>=_0x2efc88){_0x495344=_0x2efc88;_0xec283a=0xc8;}else{_0xec283a=0xce;}_0x3f5f68[_0xfe9e('0x19')](_0xec283a);return _0x3f5f68['set']('Content-Range',_0xdf0a3b+'-'+_0x495344+'/'+_0x2efc88)[_0xfe9e('0x1a')](_0x4edf71);}return null;};}function patchUpdates(_0x1c956a){return function(_0x17a3df){try{jsonpatch[_0xfe9e('0x1f')](_0x17a3df,_0x1c956a,!![]);}catch(_0x1ad37a){return BPromise[_0xfe9e('0x20')](_0x1ad37a);}return _0x17a3df[_0xfe9e('0x21')]();};}function saveUpdates(_0xb5d636,_0x3c0c92){return function(_0xa7d9d8){if(_0xa7d9d8){return _0xa7d9d8[_0xfe9e('0x22')](_0xb5d636)[_0xfe9e('0x23')](function(_0x5f0311){return _0x5f0311;});}return null;};}function removeEntity(_0xcfe347,_0x269bcb){return function(_0x4e34cb){if(_0x4e34cb){return _0x4e34cb[_0xfe9e('0x24')]()['then'](function(){_0xcfe347[_0xfe9e('0x19')](0xcc)[_0xfe9e('0x18')]();});}};}function handleEntityNotFound(_0x56308e,_0x162ce2){return function(_0x3b5aea){if(!_0x3b5aea){_0x56308e[_0xfe9e('0x17')](0x194);}return _0x3b5aea;};}function handleError(_0x344746,_0x46ec65){_0x46ec65=_0x46ec65||0x1f4;return function(_0x42f89d){logger[_0xfe9e('0x25')](_0x42f89d[_0xfe9e('0x26')]);if(_0x42f89d[_0xfe9e('0x27')]){delete _0x42f89d[_0xfe9e('0x27')];}_0x344746[_0xfe9e('0x19')](_0x46ec65)[_0xfe9e('0x28')](_0x42f89d);};}exports[_0xfe9e('0x29')]=function(_0x4b952a,_0x5687ed){var _0x2ee15b={},_0x116b50={},_0x3f0cf4={'count':0x0,'rows':[]};var _0x11be5f=_['map'](db[_0xfe9e('0x2a')]['rawAttributes'],function(_0x55b08a){return{'name':_0x55b08a['fieldName'],'type':_0x55b08a[_0xfe9e('0x2b')][_0xfe9e('0x2c')]};});_0x116b50[_0xfe9e('0x2d')]=_['map'](_0x11be5f,'name');_0x116b50[_0xfe9e('0x2e')]=_[_0xfe9e('0x2f')](_0x4b952a[_0xfe9e('0x2e')]);_0x116b50[_0xfe9e('0x30')]=_[_0xfe9e('0x31')](_0x116b50['model'],_0x116b50['query']);_0x2ee15b[_0xfe9e('0x32')]=_[_0xfe9e('0x31')](_0x116b50[_0xfe9e('0x2d')],qs[_0xfe9e('0x33')](_0x4b952a[_0xfe9e('0x2e')][_0xfe9e('0x33')]));_0x2ee15b[_0xfe9e('0x32')]=_0x2ee15b[_0xfe9e('0x32')]['length']?_0x2ee15b[_0xfe9e('0x32')]:_0x116b50[_0xfe9e('0x2d')];if(!_0x4b952a[_0xfe9e('0x2e')]['hasOwnProperty'](_0xfe9e('0x34'))){_0x2ee15b[_0xfe9e('0x1d')]=qs['limit'](_0x4b952a['query'][_0xfe9e('0x1d')]);_0x2ee15b[_0xfe9e('0x1b')]=qs[_0xfe9e('0x1b')](_0x4b952a[_0xfe9e('0x2e')][_0xfe9e('0x1b')]);}_0x2ee15b[_0xfe9e('0x35')]=qs[_0xfe9e('0x36')](_0x4b952a['query']['sort']);_0x2ee15b[_0xfe9e('0x37')]=qs[_0xfe9e('0x30')](_[_0xfe9e('0x38')](_0x4b952a[_0xfe9e('0x2e')],_0x116b50[_0xfe9e('0x30')]),_0x11be5f);if(_0x4b952a[_0xfe9e('0x2e')][_0xfe9e('0x39')]){_0x2ee15b['where']=_[_0xfe9e('0x3a')](_0x2ee15b['where'],{'$or':_[_0xfe9e('0x3b')](_0x11be5f,function(_0x5a3c25){if(_0x5a3c25[_0xfe9e('0x2b')]!=='VIRTUAL'){var _0xaff270={};_0xaff270[_0x5a3c25[_0xfe9e('0x27')]]={'$like':'%'+_0x4b952a[_0xfe9e('0x2e')][_0xfe9e('0x39')]+'%'};return _0xaff270;}})});}_0x2ee15b=_[_0xfe9e('0x3a')]({},_0x2ee15b,_0x4b952a[_0xfe9e('0x3c')]);var _0x58e703={'where':_0x2ee15b['where']};return db[_0xfe9e('0x2a')]['count'](_0x58e703)[_0xfe9e('0x23')](function(_0x43abfe){_0x3f0cf4['count']=_0x43abfe;if(_0x4b952a[_0xfe9e('0x2e')][_0xfe9e('0x3d')]){_0x2ee15b[_0xfe9e('0x3e')]=[{'all':!![]}];}return db[_0xfe9e('0x2a')][_0xfe9e('0x3f')](_0x2ee15b);})['then'](function(_0x258156){_0x3f0cf4[_0xfe9e('0x40')]=_0x258156;return _0x3f0cf4;})[_0xfe9e('0x23')](respondWithFilteredResult(_0x5687ed,_0x2ee15b))[_0xfe9e('0x41')](handleError(_0x5687ed,null));};exports[_0xfe9e('0x42')]=function(_0x29c297,_0x160575){var _0x3caf7b={'raw':!![],'where':{'id':_0x29c297['params']['id']}},_0x30d892={};_0x30d892[_0xfe9e('0x2d')]=_[_0xfe9e('0x2f')](db[_0xfe9e('0x2a')][_0xfe9e('0x43')]);_0x30d892[_0xfe9e('0x2e')]=_['keys'](_0x29c297[_0xfe9e('0x2e')]);_0x30d892[_0xfe9e('0x30')]=_[_0xfe9e('0x31')](_0x30d892[_0xfe9e('0x2d')],_0x30d892[_0xfe9e('0x2e')]);_0x3caf7b['attributes']=_[_0xfe9e('0x31')](_0x30d892[_0xfe9e('0x2d')],qs[_0xfe9e('0x33')](_0x29c297[_0xfe9e('0x2e')][_0xfe9e('0x33')]));_0x3caf7b[_0xfe9e('0x32')]=_0x3caf7b['attributes']['length']?_0x3caf7b[_0xfe9e('0x32')]:_0x30d892[_0xfe9e('0x2d')];if(_0x29c297[_0xfe9e('0x2e')][_0xfe9e('0x3d')]){_0x3caf7b[_0xfe9e('0x3e')]=[{'all':!![]}];}_0x3caf7b=_[_0xfe9e('0x3a')]({},_0x3caf7b,_0x29c297['options']);return db['ChatQueueReport'][_0xfe9e('0x44')](_0x3caf7b)[_0xfe9e('0x23')](handleEntityNotFound(_0x160575,null))[_0xfe9e('0x23')](respondWithResult(_0x160575,null))['catch'](handleError(_0x160575,null));};exports[_0xfe9e('0x45')]=function(_0x8682eb,_0xad0a90){return db[_0xfe9e('0x2a')]['create'](_0x8682eb[_0xfe9e('0x46')],{})[_0xfe9e('0x23')](respondWithResult(_0xad0a90,0xc9))[_0xfe9e('0x41')](handleError(_0xad0a90,null));};exports[_0xfe9e('0x22')]=function(_0x1b870a,_0x52e445){if(_0x1b870a[_0xfe9e('0x46')]['id']){delete _0x1b870a[_0xfe9e('0x46')]['id'];}return db[_0xfe9e('0x2a')][_0xfe9e('0x44')]({'where':{'id':_0x1b870a['params']['id']}})['then'](handleEntityNotFound(_0x52e445,null))[_0xfe9e('0x23')](saveUpdates(_0x1b870a[_0xfe9e('0x46')],null))[_0xfe9e('0x23')](respondWithResult(_0x52e445,null))[_0xfe9e('0x41')](handleError(_0x52e445,null));};exports[_0xfe9e('0x24')]=function(_0x3c6c03,_0x3e4acd){return db[_0xfe9e('0x2a')][_0xfe9e('0x44')]({'where':{'id':_0x3c6c03[_0xfe9e('0x47')]['id']}})[_0xfe9e('0x23')](handleEntityNotFound(_0x3e4acd,null))[_0xfe9e('0x23')](removeEntity(_0x3e4acd,null))['catch'](handleError(_0x3e4acd,null));};exports['describe']=function(_0xf25001,_0x563fea){return db['ChatQueueReport'][_0xfe9e('0x48')]()[_0xfe9e('0x23')](respondWithResult(_0x563fea,null))[_0xfe9e('0x41')](handleError(_0x563fea,null));};
\ No newline at end of file
+var _0x3079=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','index','ChatQueueReport','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','catch','show','params','rawAttributes','includeAll','include','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x1da8a7,_0x2367fd){var _0x419b8a=function(_0x1626cf){while(--_0x1626cf){_0x1da8a7['push'](_0x1da8a7['shift']());}};_0x419b8a(++_0x2367fd);}(_0x3079,0x110));var _0x9307=function(_0x5d278c,_0x38e967){_0x5d278c=_0x5d278c-0x0;var _0x13a35e=_0x3079[_0x5d278c];return _0x13a35e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9307('0x0'));var zipdir=require(_0x9307('0x1'));var jsonpatch=require(_0x9307('0x2'));var rp=require(_0x9307('0x3'));var moment=require('moment');var BPromise=require(_0x9307('0x4'));var Mustache=require(_0x9307('0x5'));var util=require('util');var path=require('path');var sox=require(_0x9307('0x6'));var csv=require(_0x9307('0x7'));var ejs=require(_0x9307('0x8'));var fs=require('fs');var fs_extra=require(_0x9307('0x9'));var _=require(_0x9307('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9307('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x9307('0x7'));var querystring=require(_0x9307('0xc'));var Papa=require('papaparse');var Redis=require(_0x9307('0xd'));var authService=require(_0x9307('0xe'));var qs=require(_0x9307('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9307('0x10'))(_0x9307('0x11'));var utils=require(_0x9307('0x12'));var config=require(_0x9307('0x13'));var licenseUtil=require(_0x9307('0x14'));var db=require(_0x9307('0x15'))['db'];function respondWithStatusCode(_0x4bc72d,_0x2bab66){_0x2bab66=_0x2bab66||0xcc;return function(_0x2fc4a5){if(_0x2fc4a5){return _0x4bc72d['sendStatus'](_0x2bab66);}return _0x4bc72d['status'](_0x2bab66)[_0x9307('0x16')]();};}function respondWithResult(_0x3d3671,_0x4a7e80){_0x4a7e80=_0x4a7e80||0xc8;return function(_0x3d9864){if(_0x3d9864){return _0x3d3671[_0x9307('0x17')](_0x4a7e80)['json'](_0x3d9864);}};}function respondWithFilteredResult(_0x108830,_0x231bba){return function(_0x4e79f7){if(_0x4e79f7){var _0x3fc6fd=typeof _0x231bba[_0x9307('0x18')]===_0x9307('0x19')&&typeof _0x231bba['limit']===_0x9307('0x19');var _0x27682a=_0x4e79f7['count'];var _0xbba867=_0x3fc6fd?0x0:_0x231bba[_0x9307('0x18')];var _0x1e8af2=_0x3fc6fd?_0x4e79f7[_0x9307('0x1a')]:_0x231bba[_0x9307('0x18')]+_0x231bba[_0x9307('0x1b')];var _0x5810d7;if(_0x1e8af2>=_0x27682a){_0x1e8af2=_0x27682a;_0x5810d7=0xc8;}else{_0x5810d7=0xce;}_0x108830[_0x9307('0x17')](_0x5810d7);return _0x108830[_0x9307('0x1c')](_0x9307('0x1d'),_0xbba867+'-'+_0x1e8af2+'/'+_0x27682a)['json'](_0x4e79f7);}return null;};}function patchUpdates(_0x2f35c7){return function(_0x3a139e){try{jsonpatch['apply'](_0x3a139e,_0x2f35c7,!![]);}catch(_0x307ab9){return BPromise[_0x9307('0x1e')](_0x307ab9);}return _0x3a139e[_0x9307('0x1f')]();};}function saveUpdates(_0x39bbcc,_0x15e7c4){return function(_0xf39222){if(_0xf39222){return _0xf39222[_0x9307('0x20')](_0x39bbcc)[_0x9307('0x21')](function(_0x2f5f68){return _0x2f5f68;});}return null;};}function removeEntity(_0x29b0c2,_0x3241d9){return function(_0x5d42a0){if(_0x5d42a0){return _0x5d42a0[_0x9307('0x22')]()['then'](function(){_0x29b0c2[_0x9307('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c59ef,_0x5bb98a){return function(_0x4d1a13){if(!_0x4d1a13){_0x2c59ef[_0x9307('0x23')](0x194);}return _0x4d1a13;};}function handleError(_0x366dea,_0xfeffdc){_0xfeffdc=_0xfeffdc||0x1f4;return function(_0x330d48){logger[_0x9307('0x24')](_0x330d48[_0x9307('0x25')]);if(_0x330d48[_0x9307('0x26')]){delete _0x330d48['name'];}_0x366dea[_0x9307('0x17')](_0xfeffdc)['send'](_0x330d48);};}exports[_0x9307('0x27')]=function(_0x1c7e60,_0x10ea72){var _0x5deda1={},_0x4619e5={},_0x5459c1={'count':0x0,'rows':[]};var _0x5440a6=_['map'](db[_0x9307('0x28')]['rawAttributes'],function(_0xfe280b){return{'name':_0xfe280b[_0x9307('0x29')],'type':_0xfe280b[_0x9307('0x2a')][_0x9307('0x2b')]};});_0x4619e5[_0x9307('0x2c')]=_[_0x9307('0x2d')](_0x5440a6,'name');_0x4619e5[_0x9307('0x2e')]=_[_0x9307('0x2f')](_0x1c7e60[_0x9307('0x2e')]);_0x4619e5[_0x9307('0x30')]=_[_0x9307('0x31')](_0x4619e5[_0x9307('0x2c')],_0x4619e5[_0x9307('0x2e')]);_0x5deda1['attributes']=_['intersection'](_0x4619e5[_0x9307('0x2c')],qs[_0x9307('0x32')](_0x1c7e60[_0x9307('0x2e')][_0x9307('0x32')]));_0x5deda1[_0x9307('0x33')]=_0x5deda1[_0x9307('0x33')][_0x9307('0x34')]?_0x5deda1[_0x9307('0x33')]:_0x4619e5[_0x9307('0x2c')];if(!_0x1c7e60[_0x9307('0x2e')]['hasOwnProperty'](_0x9307('0x35'))){_0x5deda1[_0x9307('0x1b')]=qs[_0x9307('0x1b')](_0x1c7e60[_0x9307('0x2e')][_0x9307('0x1b')]);_0x5deda1[_0x9307('0x18')]=qs[_0x9307('0x18')](_0x1c7e60[_0x9307('0x2e')][_0x9307('0x18')]);}_0x5deda1[_0x9307('0x36')]=qs[_0x9307('0x37')](_0x1c7e60[_0x9307('0x2e')][_0x9307('0x37')]);_0x5deda1[_0x9307('0x38')]=qs['filters'](_[_0x9307('0x39')](_0x1c7e60[_0x9307('0x2e')],_0x4619e5[_0x9307('0x30')]),_0x5440a6);if(_0x1c7e60[_0x9307('0x2e')][_0x9307('0x3a')]){_0x5deda1[_0x9307('0x38')]=_[_0x9307('0x3b')](_0x5deda1[_0x9307('0x38')],{'$or':_['map'](_0x5440a6,function(_0x11a404){if(_0x11a404[_0x9307('0x2a')]!==_0x9307('0x3c')){var _0x5a8665={};_0x5a8665[_0x11a404[_0x9307('0x26')]]={'$like':'%'+_0x1c7e60[_0x9307('0x2e')][_0x9307('0x3a')]+'%'};return _0x5a8665;}})});}_0x5deda1=_['merge']({},_0x5deda1,_0x1c7e60[_0x9307('0x3d')]);var _0x356747={'where':_0x5deda1[_0x9307('0x38')]};return db[_0x9307('0x28')]['count'](_0x356747)['then'](function(_0x2a7e00){_0x5459c1[_0x9307('0x1a')]=_0x2a7e00;if(_0x1c7e60[_0x9307('0x2e')]['includeAll']){_0x5deda1['include']=[{'all':!![]}];}return db[_0x9307('0x28')]['findAll'](_0x5deda1);})[_0x9307('0x21')](function(_0x24cff3){_0x5459c1['rows']=_0x24cff3;return _0x5459c1;})[_0x9307('0x21')](respondWithFilteredResult(_0x10ea72,_0x5deda1))[_0x9307('0x3e')](handleError(_0x10ea72,null));};exports[_0x9307('0x3f')]=function(_0x39055e,_0x18a738){var _0x1a63ff={'raw':!![],'where':{'id':_0x39055e[_0x9307('0x40')]['id']}},_0x248d24={};_0x248d24[_0x9307('0x2c')]=_['keys'](db['ChatQueueReport'][_0x9307('0x41')]);_0x248d24[_0x9307('0x2e')]=_[_0x9307('0x2f')](_0x39055e[_0x9307('0x2e')]);_0x248d24[_0x9307('0x30')]=_[_0x9307('0x31')](_0x248d24['model'],_0x248d24['query']);_0x1a63ff[_0x9307('0x33')]=_[_0x9307('0x31')](_0x248d24['model'],qs[_0x9307('0x32')](_0x39055e['query'][_0x9307('0x32')]));_0x1a63ff[_0x9307('0x33')]=_0x1a63ff['attributes'][_0x9307('0x34')]?_0x1a63ff[_0x9307('0x33')]:_0x248d24[_0x9307('0x2c')];if(_0x39055e[_0x9307('0x2e')][_0x9307('0x42')]){_0x1a63ff[_0x9307('0x43')]=[{'all':!![]}];}_0x1a63ff=_[_0x9307('0x3b')]({},_0x1a63ff,_0x39055e[_0x9307('0x3d')]);return db['ChatQueueReport'][_0x9307('0x44')](_0x1a63ff)[_0x9307('0x21')](handleEntityNotFound(_0x18a738,null))[_0x9307('0x21')](respondWithResult(_0x18a738,null))[_0x9307('0x3e')](handleError(_0x18a738,null));};exports[_0x9307('0x45')]=function(_0x4f1615,_0x119cc2){return db['ChatQueueReport']['create'](_0x4f1615[_0x9307('0x46')],{})[_0x9307('0x21')](respondWithResult(_0x119cc2,0xc9))[_0x9307('0x3e')](handleError(_0x119cc2,null));};exports[_0x9307('0x20')]=function(_0x196a8e,_0x48a768){if(_0x196a8e[_0x9307('0x46')]['id']){delete _0x196a8e['body']['id'];}return db[_0x9307('0x28')][_0x9307('0x44')]({'where':{'id':_0x196a8e['params']['id']}})['then'](handleEntityNotFound(_0x48a768,null))[_0x9307('0x21')](saveUpdates(_0x196a8e[_0x9307('0x46')],null))[_0x9307('0x21')](respondWithResult(_0x48a768,null))[_0x9307('0x3e')](handleError(_0x48a768,null));};exports[_0x9307('0x22')]=function(_0x5a5f7c,_0x1aa8cb){return db[_0x9307('0x28')][_0x9307('0x44')]({'where':{'id':_0x5a5f7c[_0x9307('0x40')]['id']}})['then'](handleEntityNotFound(_0x1aa8cb,null))['then'](removeEntity(_0x1aa8cb,null))['catch'](handleError(_0x1aa8cb,null));};exports[_0x9307('0x47')]=function(_0x517e52,_0x48ccb6){return db['ChatQueueReport'][_0x9307('0x47')]()[_0x9307('0x21')](respondWithResult(_0x48ccb6,null))[_0x9307('0x3e')](handleError(_0x48ccb6,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 930a80f..5ec6f18 100644
--- a/server/api/chatQueueReport/chatQueueReport.model.js
+++ b/server/api/chatQueueReport/chatQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x1bf809,_0x536f55){var _0x1caa4e=function(_0x9f9636){while(--_0x9f9636){_0x1bf809['push'](_0x1bf809['shift']());}};_0x1caa4e(++_0x536f55);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x36d500,_0x1cab6f){var _0x22604b=function(_0x8d2d83){while(--_0x8d2d83){_0x36d500['push'](_0x36d500['shift']());}};_0x22604b(++_0x1cab6f);}(_0x757a,0xde));var _0xa757=function(_0x334888,_0xbab26d){_0x334888=_0x334888-0x0;var _0xa5a8a7=_0x757a[_0x334888];return _0xa5a8a7;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 5015b27..e52e75b 100644
--- a/server/api/chatQueueReport/chatQueueReport.rpc.js
+++ b/server/api/chatQueueReport/chatQueueReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfcfb=['../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','CreateChatQueueReport','ChatQueueReport','create','options','raw','UpdateChatQueueReport','update','body','where','attributes','limit','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0xfcfb,0x1d4));var _0xbfcf=function(_0x512f81,_0x4a7986){_0x512f81=_0x512f81-0x0;var _0xa15099=_0xfcfb[_0x512f81];return _0xa15099;};'use strict';var _=require(_0xbfcf('0x0'));var util=require(_0xbfcf('0x1'));var moment=require(_0xbfcf('0x2'));var BPromise=require(_0xbfcf('0x3'));var rs=require(_0xbfcf('0x4'));var fs=require('fs');var Redis=require(_0xbfcf('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xbfcf('0x6'));var logger=require('../../config/logger')(_0xbfcf('0x7'));var config=require(_0xbfcf('0x8'));var jayson=require(_0xbfcf('0x9'));var client=jayson[_0xbfcf('0xa')][_0xbfcf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x262b2d,_0x307ad5,_0x4124c6){return new BPromise(function(_0x8d0c4f,_0x2fef6e){return client[_0xbfcf('0xc')](_0x262b2d,_0x4124c6)[_0xbfcf('0xd')](function(_0x401a33){logger[_0xbfcf('0xe')](_0xbfcf('0xf'),_0x307ad5,'request\x20sent');logger['debug'](_0xbfcf('0x10'),_0x307ad5,_0xbfcf('0x11'),JSON[_0xbfcf('0x12')](_0x401a33));if(_0x401a33[_0xbfcf('0x13')]){if(_0x401a33[_0xbfcf('0x13')]['code']===0x1f4){logger[_0xbfcf('0x13')](_0xbfcf('0xf'),_0x307ad5,_0x401a33[_0xbfcf('0x13')][_0xbfcf('0x14')]);return _0x2fef6e(_0x401a33[_0xbfcf('0x13')][_0xbfcf('0x14')]);}logger[_0xbfcf('0x13')](_0xbfcf('0xf'),_0x307ad5,_0x401a33[_0xbfcf('0x13')]['message']);return _0x8d0c4f(_0x401a33[_0xbfcf('0x13')][_0xbfcf('0x14')]);}else{logger[_0xbfcf('0xe')](_0xbfcf('0xf'),_0x307ad5,_0xbfcf('0x11'));_0x8d0c4f(_0x401a33['result'][_0xbfcf('0x14')]);}})[_0xbfcf('0x15')](function(_0xf94bcd){logger[_0xbfcf('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0x307ad5,_0xf94bcd);_0x2fef6e(_0xf94bcd);});});}exports[_0xbfcf('0x16')]=function(_0x9046cc){var _0x400be9=this;return new Promise(function(_0x546395,_0x1765b9){return db[_0xbfcf('0x17')][_0xbfcf('0x18')](_0x9046cc['body'],{'raw':_0x9046cc[_0xbfcf('0x19')]?_0x9046cc['options'][_0xbfcf('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0xc2c8fd){logger[_0xbfcf('0xe')](_0xbfcf('0x16'),_0x9046cc);logger['debug'](_0xbfcf('0x16'),_0x9046cc,JSON[_0xbfcf('0x12')](_0xc2c8fd));_0x546395(_0xc2c8fd);})[_0xbfcf('0x15')](function(_0x3e2c8c){logger[_0xbfcf('0x13')](_0xbfcf('0x16'),_0x3e2c8c[_0xbfcf('0x14')],_0x9046cc);_0x1765b9(_0x400be9[_0xbfcf('0x13')](0x1f4,_0x3e2c8c[_0xbfcf('0x14')]));});});};exports[_0xbfcf('0x1b')]=function(_0x4eba83){var _0x169e17=this;return new Promise(function(_0x4562b9,_0x295b0f){return db[_0xbfcf('0x17')][_0xbfcf('0x1c')](_0x4eba83[_0xbfcf('0x1d')],{'raw':_0x4eba83[_0xbfcf('0x19')]?_0x4eba83['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4eba83['options']?_0x4eba83[_0xbfcf('0x19')][_0xbfcf('0x1e')]||null:null,'attributes':_0x4eba83[_0xbfcf('0x19')]?_0x4eba83[_0xbfcf('0x19')][_0xbfcf('0x1f')]||null:null,'limit':_0x4eba83[_0xbfcf('0x19')]?_0x4eba83['options'][_0xbfcf('0x20')]||null:null})[_0xbfcf('0xd')](function(_0x5d49b7){logger[_0xbfcf('0xe')]('UpdateChatQueueReport',_0x4eba83);logger[_0xbfcf('0x21')]('UpdateChatQueueReport',_0x4eba83,JSON[_0xbfcf('0x12')](_0x5d49b7));_0x4562b9(_0x5d49b7);})['catch'](function(_0x4aca5e){logger['error'](_0xbfcf('0x1b'),_0x4aca5e[_0xbfcf('0x14')],_0x4eba83);_0x295b0f(_0x169e17[_0xbfcf('0x13')](0x1f4,_0x4aca5e[_0xbfcf('0x14')]));});});};
\ No newline at end of file
+var _0x864b=['where','attributes','limit','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','debug','UpdateChatQueueReport','update'];(function(_0x1c8add,_0x13871c){var _0x1b8d30=function(_0x103b06){while(--_0x103b06){_0x1c8add['push'](_0x1c8add['shift']());}};_0x1b8d30(++_0x13871c);}(_0x864b,0x179));var _0xb864=function(_0x288b36,_0x527364){_0x288b36=_0x288b36-0x0;var _0x486645=_0x864b[_0x288b36];return _0x486645;};'use strict';var _=require(_0xb864('0x0'));var util=require(_0xb864('0x1'));var moment=require('moment');var BPromise=require(_0xb864('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb864('0x3'));var db=require(_0xb864('0x4'))['db'];var utils=require(_0xb864('0x5'));var logger=require(_0xb864('0x6'))(_0xb864('0x7'));var config=require(_0xb864('0x8'));var jayson=require(_0xb864('0x9'));var client=jayson['client'][_0xb864('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2c06e4,_0x1ce4e9,_0x525999){return new BPromise(function(_0x2ae8a3,_0x460a36){return client[_0xb864('0xb')](_0x2c06e4,_0x525999)[_0xb864('0xc')](function(_0x362b82){logger[_0xb864('0xd')](_0xb864('0xe'),_0x1ce4e9,_0xb864('0xf'));logger['debug'](_0xb864('0x10'),_0x1ce4e9,_0xb864('0xf'),JSON[_0xb864('0x11')](_0x362b82));if(_0x362b82['error']){if(_0x362b82[_0xb864('0x12')][_0xb864('0x13')]===0x1f4){logger[_0xb864('0x12')](_0xb864('0xe'),_0x1ce4e9,_0x362b82[_0xb864('0x12')][_0xb864('0x14')]);return _0x460a36(_0x362b82[_0xb864('0x12')]['message']);}logger[_0xb864('0x12')](_0xb864('0xe'),_0x1ce4e9,_0x362b82[_0xb864('0x12')][_0xb864('0x14')]);return _0x2ae8a3(_0x362b82['error'][_0xb864('0x14')]);}else{logger[_0xb864('0xd')](_0xb864('0xe'),_0x1ce4e9,_0xb864('0xf'));_0x2ae8a3(_0x362b82['result'][_0xb864('0x14')]);}})[_0xb864('0x15')](function(_0x228d54){logger['error'](_0xb864('0xe'),_0x1ce4e9,_0x228d54);_0x460a36(_0x228d54);});});}exports[_0xb864('0x16')]=function(_0x3ffa5c){var _0x18f10f=this;return new Promise(function(_0x51bdeb,_0x181a47){return db[_0xb864('0x17')][_0xb864('0x18')](_0x3ffa5c[_0xb864('0x19')],{'raw':_0x3ffa5c[_0xb864('0x1a')]?_0x3ffa5c[_0xb864('0x1a')][_0xb864('0x1b')]===undefined?!![]:![]:!![]})[_0xb864('0xc')](function(_0x5e1f47){logger[_0xb864('0xd')]('CreateChatQueueReport',_0x3ffa5c);logger[_0xb864('0x1c')]('CreateChatQueueReport',_0x3ffa5c,JSON[_0xb864('0x11')](_0x5e1f47));_0x51bdeb(_0x5e1f47);})[_0xb864('0x15')](function(_0x2c4ae3){logger['error']('CreateChatQueueReport',_0x2c4ae3[_0xb864('0x14')],_0x3ffa5c);_0x181a47(_0x18f10f[_0xb864('0x12')](0x1f4,_0x2c4ae3[_0xb864('0x14')]));});});};exports[_0xb864('0x1d')]=function(_0x5f3e76){var _0x110f2b=this;return new Promise(function(_0xcf627d,_0x227f0c){return db[_0xb864('0x17')][_0xb864('0x1e')](_0x5f3e76[_0xb864('0x19')],{'raw':_0x5f3e76[_0xb864('0x1a')]?_0x5f3e76[_0xb864('0x1a')][_0xb864('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5f3e76[_0xb864('0x1a')]?_0x5f3e76[_0xb864('0x1a')][_0xb864('0x1f')]||null:null,'attributes':_0x5f3e76[_0xb864('0x1a')]?_0x5f3e76[_0xb864('0x1a')][_0xb864('0x20')]||null:null,'limit':_0x5f3e76['options']?_0x5f3e76['options'][_0xb864('0x21')]||null:null})[_0xb864('0xc')](function(_0x1c70ce){logger[_0xb864('0xd')](_0xb864('0x1d'),_0x5f3e76);logger['debug'](_0xb864('0x1d'),_0x5f3e76,JSON[_0xb864('0x11')](_0x1c70ce));_0xcf627d(_0x1c70ce);})[_0xb864('0x15')](function(_0x568d92){logger['error'](_0xb864('0x1d'),_0x568d92[_0xb864('0x14')],_0x5f3e76);_0x227f0c(_0x110f2b[_0xb864('0x12')](0x1f4,_0x568d92['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 03970fd..b68e106 100644
--- a/server/api/chatQueueReport/index.js
+++ b/server/api/chatQueueReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x402c=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','post','create','put','update','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x3e76be,_0x4cfd11){var _0x3d76e8=function(_0x12168a){while(--_0x12168a){_0x3e76be['push'](_0x3e76be['shift']());}};_0x3d76e8(++_0x4cfd11);}(_0x402c,0xc3));var _0xc402=function(_0x49a982,_0x129a07){_0x49a982=_0x49a982-0x0;var _0x2a0bc9=_0x402c[_0x49a982];return _0x2a0bc9;};'use strict';var multer=require('multer');var util=require(_0xc402('0x0'));var path=require(_0xc402('0x1'));var timeout=require(_0xc402('0x2'));var express=require(_0xc402('0x3'));var router=express[_0xc402('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc402('0x5'));var interaction=require(_0xc402('0x6'));var config=require(_0xc402('0x7'));var controller=require(_0xc402('0x8'));router[_0xc402('0x9')]('/',auth[_0xc402('0xa')](),controller['index']);router['get'](_0xc402('0xb'),auth[_0xc402('0xa')](),controller[_0xc402('0xc')]);router[_0xc402('0x9')](_0xc402('0xd'),auth[_0xc402('0xa')](),controller['show']);router[_0xc402('0xe')]('/',auth[_0xc402('0xa')](),controller[_0xc402('0xf')]);router[_0xc402('0x10')](_0xc402('0xd'),auth[_0xc402('0xa')](),controller[_0xc402('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc402('0x12')]);module[_0xc402('0x13')]=router;
\ No newline at end of file
+var _0xf5af=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','destroy','exports'];(function(_0x587d69,_0x470f37){var _0x5a3c15=function(_0x2f3e57){while(--_0x2f3e57){_0x587d69['push'](_0x587d69['shift']());}};_0x5a3c15(++_0x470f37);}(_0xf5af,0x84));var _0xff5a=function(_0xfbbb04,_0x3fc65c){_0xfbbb04=_0xfbbb04-0x0;var _0x4ee2ee=_0xf5af[_0xfbbb04];return _0x4ee2ee;};'use strict';var multer=require(_0xff5a('0x0'));var util=require(_0xff5a('0x1'));var path=require('path');var timeout=require(_0xff5a('0x2'));var express=require(_0xff5a('0x3'));var router=express[_0xff5a('0x4')]();var fs_extra=require(_0xff5a('0x5'));var auth=require(_0xff5a('0x6'));var interaction=require(_0xff5a('0x7'));var config=require(_0xff5a('0x8'));var controller=require(_0xff5a('0x9'));router[_0xff5a('0xa')]('/',auth[_0xff5a('0xb')](),controller['index']);router[_0xff5a('0xa')](_0xff5a('0xc'),auth[_0xff5a('0xb')](),controller[_0xff5a('0xd')]);router[_0xff5a('0xa')](_0xff5a('0xe'),auth[_0xff5a('0xb')](),controller[_0xff5a('0xf')]);router[_0xff5a('0x10')]('/',auth[_0xff5a('0xb')](),controller[_0xff5a('0x11')]);router[_0xff5a('0x12')](_0xff5a('0xe'),auth[_0xff5a('0xb')](),controller[_0xff5a('0x13')]);router['delete'](_0xff5a('0xe'),auth['isAuthenticated'](),controller[_0xff5a('0x14')]);module[_0xff5a('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 3950e43..f96498d 100644
--- a/server/api/chatTransferReport/chatTransferReport.attributes.js
+++ b/server/api/chatTransferReport/chatTransferReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x5c68f1,_0x863857){var _0x337364=function(_0x1bb815){while(--_0x1bb815){_0x5c68f1['push'](_0x5c68f1['shift']());}};_0x337364(++_0x863857);}(_0x70e0,0x17b));var _0x070e=function(_0x3c9648,_0x3e7391){_0x3c9648=_0x3c9648-0x0;var _0x26bc44=_0x70e0[_0x3c9648];return _0x26bc44;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}};
\ No newline at end of file
+var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x297c55,_0x34fa75){var _0x120389=function(_0x595108){while(--_0x595108){_0x297c55['push'](_0x297c55['shift']());}};_0x120389(++_0x34fa75);}(_0x9c44,0x178));var _0x49c4=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x9c44[_0x5f09c5];return _0x426ad9;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 6866a56..b2100eb 100644
--- a/server/api/chatTransferReport/chatTransferReport.controller.js
+++ b/server/api/chatTransferReport/chatTransferReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1710=['apply','reject','save','update','then','end','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','options','includeAll','include','rows','catch','params','find','create','body','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','json','undefined','offset','count','limit','set','Content-Range'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x1710,0x158));var _0x0171=function(_0x1e96d3,_0x522dbe){_0x1e96d3=_0x1e96d3-0x0;var _0x1454e0=_0x1710[_0x1e96d3];return _0x1454e0;};'use strict';var emlformat=require(_0x0171('0x0'));var rimraf=require(_0x0171('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0171('0x2'));var rp=require(_0x0171('0x3'));var moment=require('moment');var BPromise=require(_0x0171('0x4'));var Mustache=require(_0x0171('0x5'));var util=require(_0x0171('0x6'));var path=require(_0x0171('0x7'));var sox=require('sox');var csv=require(_0x0171('0x8'));var ejs=require(_0x0171('0x9'));var fs=require('fs');var fs_extra=require(_0x0171('0xa'));var _=require(_0x0171('0xb'));var squel=require(_0x0171('0xc'));var crypto=require(_0x0171('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0171('0xe'));var Papa=require(_0x0171('0xf'));var Redis=require('ioredis');var authService=require(_0x0171('0x10'));var qs=require(_0x0171('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0171('0x12'));var logger=require(_0x0171('0x13'))(_0x0171('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0171('0x15'))['db'];function respondWithStatusCode(_0x57cb3a,_0x150507){_0x150507=_0x150507||0xcc;return function(_0x5bcd6c){if(_0x5bcd6c){return _0x57cb3a[_0x0171('0x16')](_0x150507);}return _0x57cb3a[_0x0171('0x17')](_0x150507)['end']();};}function respondWithResult(_0x16f1a4,_0x422b06){_0x422b06=_0x422b06||0xc8;return function(_0x390b2c){if(_0x390b2c){return _0x16f1a4[_0x0171('0x17')](_0x422b06)[_0x0171('0x18')](_0x390b2c);}};}function respondWithFilteredResult(_0x3f55cb,_0x23a493){return function(_0x5160b5){if(_0x5160b5){var _0x21f26c=typeof _0x23a493['offset']===_0x0171('0x19')&&typeof _0x23a493['limit']==='undefined';var _0x198209=_0x5160b5['count'];var _0x46ffd0=_0x21f26c?0x0:_0x23a493[_0x0171('0x1a')];var _0xd7a90a=_0x21f26c?_0x5160b5[_0x0171('0x1b')]:_0x23a493['offset']+_0x23a493[_0x0171('0x1c')];var _0x4d1e5f;if(_0xd7a90a>=_0x198209){_0xd7a90a=_0x198209;_0x4d1e5f=0xc8;}else{_0x4d1e5f=0xce;}_0x3f55cb[_0x0171('0x17')](_0x4d1e5f);return _0x3f55cb[_0x0171('0x1d')](_0x0171('0x1e'),_0x46ffd0+'-'+_0xd7a90a+'/'+_0x198209)[_0x0171('0x18')](_0x5160b5);}return null;};}function patchUpdates(_0x53d28d){return function(_0x2839d0){try{jsonpatch[_0x0171('0x1f')](_0x2839d0,_0x53d28d,!![]);}catch(_0xa0f8b1){return BPromise[_0x0171('0x20')](_0xa0f8b1);}return _0x2839d0[_0x0171('0x21')]();};}function saveUpdates(_0xb965a5,_0x335ced){return function(_0x4e63c8){if(_0x4e63c8){return _0x4e63c8[_0x0171('0x22')](_0xb965a5)['then'](function(_0x47e900){return _0x47e900;});}return null;};}function removeEntity(_0x1f4aa4,_0xb6baad){return function(_0x5571b0){if(_0x5571b0){return _0x5571b0['destroy']()[_0x0171('0x23')](function(){_0x1f4aa4[_0x0171('0x17')](0xcc)[_0x0171('0x24')]();});}};}function handleEntityNotFound(_0x5e896f,_0x400adb){return function(_0x332ca2){if(!_0x332ca2){_0x5e896f['sendStatus'](0x194);}return _0x332ca2;};}function handleError(_0x4d765d,_0x98bf07){_0x98bf07=_0x98bf07||0x1f4;return function(_0x89e86a){logger[_0x0171('0x25')](_0x89e86a[_0x0171('0x26')]);if(_0x89e86a[_0x0171('0x27')]){delete _0x89e86a[_0x0171('0x27')];}_0x4d765d[_0x0171('0x17')](_0x98bf07)[_0x0171('0x28')](_0x89e86a);};}exports[_0x0171('0x29')]=function(_0x11d646,_0x361eff){var _0x5abc48={},_0x28b109={},_0x19b3e0={'count':0x0,'rows':[]};var _0x195e79=_[_0x0171('0x2a')](db[_0x0171('0x2b')][_0x0171('0x2c')],function(_0x7bfdd6){return{'name':_0x7bfdd6[_0x0171('0x2d')],'type':_0x7bfdd6['type'][_0x0171('0x2e')]};});_0x28b109['model']=_[_0x0171('0x2a')](_0x195e79,_0x0171('0x27'));_0x28b109[_0x0171('0x2f')]=_[_0x0171('0x30')](_0x11d646[_0x0171('0x2f')]);_0x28b109[_0x0171('0x31')]=_[_0x0171('0x32')](_0x28b109['model'],_0x28b109[_0x0171('0x2f')]);_0x5abc48[_0x0171('0x33')]=_[_0x0171('0x32')](_0x28b109[_0x0171('0x34')],qs['fields'](_0x11d646[_0x0171('0x2f')][_0x0171('0x35')]));_0x5abc48[_0x0171('0x33')]=_0x5abc48['attributes'][_0x0171('0x36')]?_0x5abc48[_0x0171('0x33')]:_0x28b109[_0x0171('0x34')];if(!_0x11d646['query'][_0x0171('0x37')](_0x0171('0x38'))){_0x5abc48[_0x0171('0x1c')]=qs[_0x0171('0x1c')](_0x11d646[_0x0171('0x2f')]['limit']);_0x5abc48[_0x0171('0x1a')]=qs['offset'](_0x11d646[_0x0171('0x2f')]['offset']);}_0x5abc48[_0x0171('0x39')]=qs[_0x0171('0x3a')](_0x11d646[_0x0171('0x2f')]['sort']);_0x5abc48[_0x0171('0x3b')]=qs['filters'](_[_0x0171('0x3c')](_0x11d646[_0x0171('0x2f')],_0x28b109[_0x0171('0x31')]),_0x195e79);if(_0x11d646['query']['filter']){_0x5abc48[_0x0171('0x3b')]=_[_0x0171('0x3d')](_0x5abc48[_0x0171('0x3b')],{'$or':_[_0x0171('0x2a')](_0x195e79,function(_0x4af66a){if(_0x4af66a[_0x0171('0x3e')]!==_0x0171('0x3f')){var _0x32c8f3={};_0x32c8f3[_0x4af66a[_0x0171('0x27')]]={'$like':'%'+_0x11d646[_0x0171('0x2f')]['filter']+'%'};return _0x32c8f3;}})});}_0x5abc48=_['merge']({},_0x5abc48,_0x11d646[_0x0171('0x40')]);var _0x22b524={'where':_0x5abc48[_0x0171('0x3b')]};return db[_0x0171('0x2b')][_0x0171('0x1b')](_0x22b524)[_0x0171('0x23')](function(_0x519759){_0x19b3e0[_0x0171('0x1b')]=_0x519759;if(_0x11d646[_0x0171('0x2f')][_0x0171('0x41')]){_0x5abc48[_0x0171('0x42')]=[{'all':!![]}];}return db[_0x0171('0x2b')]['findAll'](_0x5abc48);})['then'](function(_0x51304a){_0x19b3e0[_0x0171('0x43')]=_0x51304a;return _0x19b3e0;})[_0x0171('0x23')](respondWithFilteredResult(_0x361eff,_0x5abc48))[_0x0171('0x44')](handleError(_0x361eff,null));};exports['show']=function(_0x47e4bb,_0x52f067){var _0x179dd4={'raw':!![],'where':{'id':_0x47e4bb[_0x0171('0x45')]['id']}},_0x321c60={};_0x321c60[_0x0171('0x34')]=_['keys'](db['ChatTransferReport']['rawAttributes']);_0x321c60[_0x0171('0x2f')]=_[_0x0171('0x30')](_0x47e4bb[_0x0171('0x2f')]);_0x321c60[_0x0171('0x31')]=_[_0x0171('0x32')](_0x321c60['model'],_0x321c60['query']);_0x179dd4[_0x0171('0x33')]=_[_0x0171('0x32')](_0x321c60[_0x0171('0x34')],qs[_0x0171('0x35')](_0x47e4bb['query'][_0x0171('0x35')]));_0x179dd4['attributes']=_0x179dd4[_0x0171('0x33')][_0x0171('0x36')]?_0x179dd4[_0x0171('0x33')]:_0x321c60[_0x0171('0x34')];if(_0x47e4bb['query'][_0x0171('0x41')]){_0x179dd4[_0x0171('0x42')]=[{'all':!![]}];}_0x179dd4=_[_0x0171('0x3d')]({},_0x179dd4,_0x47e4bb[_0x0171('0x40')]);return db[_0x0171('0x2b')][_0x0171('0x46')](_0x179dd4)[_0x0171('0x23')](handleEntityNotFound(_0x52f067,null))[_0x0171('0x23')](respondWithResult(_0x52f067,null))[_0x0171('0x44')](handleError(_0x52f067,null));};exports[_0x0171('0x47')]=function(_0xda9cb,_0x5bdc1f){return db[_0x0171('0x2b')][_0x0171('0x47')](_0xda9cb[_0x0171('0x48')],{})[_0x0171('0x23')](respondWithResult(_0x5bdc1f,0xc9))[_0x0171('0x44')](handleError(_0x5bdc1f,null));};exports[_0x0171('0x22')]=function(_0x4d4dc1,_0x3c1b7f){if(_0x4d4dc1['body']['id']){delete _0x4d4dc1[_0x0171('0x48')]['id'];}return db['ChatTransferReport'][_0x0171('0x46')]({'where':{'id':_0x4d4dc1[_0x0171('0x45')]['id']}})[_0x0171('0x23')](handleEntityNotFound(_0x3c1b7f,null))[_0x0171('0x23')](saveUpdates(_0x4d4dc1[_0x0171('0x48')],null))[_0x0171('0x23')](respondWithResult(_0x3c1b7f,null))[_0x0171('0x44')](handleError(_0x3c1b7f,null));};exports[_0x0171('0x49')]=function(_0x4722b4,_0x3b4d1a){return db['ChatTransferReport'][_0x0171('0x46')]({'where':{'id':_0x4722b4[_0x0171('0x45')]['id']}})[_0x0171('0x23')](handleEntityNotFound(_0x3b4d1a,null))[_0x0171('0x23')](removeEntity(_0x3b4d1a,null))['catch'](handleError(_0x3b4d1a,null));};exports['describe']=function(_0x4ea5d0,_0x481d31){return db['ChatTransferReport'][_0x0171('0x4a')]()[_0x0171('0x23')](respondWithResult(_0x481d31,null))[_0x0171('0x44')](handleError(_0x481d31,null));};
\ No newline at end of file
+var _0x5b9c=['stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','ChatTransferReport','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../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','save','update','then','destroy','error'];(function(_0x4ded57,_0x3ce258){var _0x3ad7dc=function(_0x33a15d){while(--_0x33a15d){_0x4ded57['push'](_0x4ded57['shift']());}};_0x3ad7dc(++_0x3ce258);}(_0x5b9c,0x1ad));var _0xc5b9=function(_0x438f79,_0x6d4152){_0x438f79=_0x438f79-0x0;var _0x5ae3a7=_0x5b9c[_0x438f79];return _0x5ae3a7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc5b9('0x0'));var rp=require(_0xc5b9('0x1'));var moment=require('moment');var BPromise=require(_0xc5b9('0x2'));var Mustache=require('mustache');var util=require(_0xc5b9('0x3'));var path=require('path');var sox=require(_0xc5b9('0x4'));var csv=require(_0xc5b9('0x5'));var ejs=require(_0xc5b9('0x6'));var fs=require('fs');var fs_extra=require(_0xc5b9('0x7'));var _=require(_0xc5b9('0x8'));var squel=require('squel');var crypto=require(_0xc5b9('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xc5b9('0xa'));var toCsv=require(_0xc5b9('0x5'));var querystring=require(_0xc5b9('0xb'));var Papa=require(_0xc5b9('0xc'));var Redis=require(_0xc5b9('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xc5b9('0xe'));var as=require(_0xc5b9('0xf'));var hardwareService=require(_0xc5b9('0x10'));var logger=require(_0xc5b9('0x11'))(_0xc5b9('0x12'));var utils=require(_0xc5b9('0x13'));var config=require(_0xc5b9('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xc5b9('0x15'))['db'];function respondWithStatusCode(_0x284a9f,_0x568e0b){_0x568e0b=_0x568e0b||0xcc;return function(_0x3873c2){if(_0x3873c2){return _0x284a9f[_0xc5b9('0x16')](_0x568e0b);}return _0x284a9f[_0xc5b9('0x17')](_0x568e0b)[_0xc5b9('0x18')]();};}function respondWithResult(_0x591186,_0x2b3229){_0x2b3229=_0x2b3229||0xc8;return function(_0x20b22b){if(_0x20b22b){return _0x591186[_0xc5b9('0x17')](_0x2b3229)[_0xc5b9('0x19')](_0x20b22b);}};}function respondWithFilteredResult(_0x11ac51,_0x5f502f){return function(_0x457ec4){if(_0x457ec4){var _0xd8e719=typeof _0x5f502f[_0xc5b9('0x1a')]===_0xc5b9('0x1b')&&typeof _0x5f502f[_0xc5b9('0x1c')]===_0xc5b9('0x1b');var _0x2695cb=_0x457ec4[_0xc5b9('0x1d')];var _0x2f10b1=_0xd8e719?0x0:_0x5f502f[_0xc5b9('0x1a')];var _0x13ba66=_0xd8e719?_0x457ec4[_0xc5b9('0x1d')]:_0x5f502f[_0xc5b9('0x1a')]+_0x5f502f[_0xc5b9('0x1c')];var _0x519399;if(_0x13ba66>=_0x2695cb){_0x13ba66=_0x2695cb;_0x519399=0xc8;}else{_0x519399=0xce;}_0x11ac51[_0xc5b9('0x17')](_0x519399);return _0x11ac51[_0xc5b9('0x1e')](_0xc5b9('0x1f'),_0x2f10b1+'-'+_0x13ba66+'/'+_0x2695cb)[_0xc5b9('0x19')](_0x457ec4);}return null;};}function patchUpdates(_0x29a74c){return function(_0x26d0a0){try{jsonpatch[_0xc5b9('0x20')](_0x26d0a0,_0x29a74c,!![]);}catch(_0x121589){return BPromise[_0xc5b9('0x21')](_0x121589);}return _0x26d0a0[_0xc5b9('0x22')]();};}function saveUpdates(_0x20dc77,_0x16b914){return function(_0x478216){if(_0x478216){return _0x478216[_0xc5b9('0x23')](_0x20dc77)[_0xc5b9('0x24')](function(_0x1c5f54){return _0x1c5f54;});}return null;};}function removeEntity(_0x1e8c50,_0x58dae7){return function(_0x5166e3){if(_0x5166e3){return _0x5166e3[_0xc5b9('0x25')]()[_0xc5b9('0x24')](function(){_0x1e8c50['status'](0xcc)[_0xc5b9('0x18')]();});}};}function handleEntityNotFound(_0x375498,_0x21266a){return function(_0x5dba90){if(!_0x5dba90){_0x375498[_0xc5b9('0x16')](0x194);}return _0x5dba90;};}function handleError(_0x5846ae,_0x5a9b41){_0x5a9b41=_0x5a9b41||0x1f4;return function(_0x58d9c3){logger[_0xc5b9('0x26')](_0x58d9c3[_0xc5b9('0x27')]);if(_0x58d9c3['name']){delete _0x58d9c3[_0xc5b9('0x28')];}_0x5846ae[_0xc5b9('0x17')](_0x5a9b41)[_0xc5b9('0x29')](_0x58d9c3);};}exports[_0xc5b9('0x2a')]=function(_0x50225a,_0x2d4ad1){var _0xe9010={},_0x3d3ba8={},_0x57ee58={'count':0x0,'rows':[]};var _0x97c0a5=_[_0xc5b9('0x2b')](db['ChatTransferReport'][_0xc5b9('0x2c')],function(_0x41fdae){return{'name':_0x41fdae[_0xc5b9('0x2d')],'type':_0x41fdae[_0xc5b9('0x2e')][_0xc5b9('0x2f')]};});_0x3d3ba8[_0xc5b9('0x30')]=_[_0xc5b9('0x2b')](_0x97c0a5,_0xc5b9('0x28'));_0x3d3ba8[_0xc5b9('0x31')]=_[_0xc5b9('0x32')](_0x50225a['query']);_0x3d3ba8[_0xc5b9('0x33')]=_['intersection'](_0x3d3ba8[_0xc5b9('0x30')],_0x3d3ba8[_0xc5b9('0x31')]);_0xe9010['attributes']=_[_0xc5b9('0x34')](_0x3d3ba8[_0xc5b9('0x30')],qs[_0xc5b9('0x35')](_0x50225a[_0xc5b9('0x31')]['fields']));_0xe9010[_0xc5b9('0x36')]=_0xe9010[_0xc5b9('0x36')][_0xc5b9('0x37')]?_0xe9010['attributes']:_0x3d3ba8[_0xc5b9('0x30')];if(!_0x50225a[_0xc5b9('0x31')][_0xc5b9('0x38')](_0xc5b9('0x39'))){_0xe9010[_0xc5b9('0x1c')]=qs[_0xc5b9('0x1c')](_0x50225a[_0xc5b9('0x31')][_0xc5b9('0x1c')]);_0xe9010[_0xc5b9('0x1a')]=qs[_0xc5b9('0x1a')](_0x50225a['query'][_0xc5b9('0x1a')]);}_0xe9010[_0xc5b9('0x3a')]=qs['sort'](_0x50225a[_0xc5b9('0x31')][_0xc5b9('0x3b')]);_0xe9010['where']=qs[_0xc5b9('0x33')](_[_0xc5b9('0x3c')](_0x50225a[_0xc5b9('0x31')],_0x3d3ba8[_0xc5b9('0x33')]),_0x97c0a5);if(_0x50225a[_0xc5b9('0x31')][_0xc5b9('0x3d')]){_0xe9010['where']=_[_0xc5b9('0x3e')](_0xe9010[_0xc5b9('0x3f')],{'$or':_['map'](_0x97c0a5,function(_0x41869c){if(_0x41869c['type']!==_0xc5b9('0x40')){var _0x302412={};_0x302412[_0x41869c[_0xc5b9('0x28')]]={'$like':'%'+_0x50225a[_0xc5b9('0x31')][_0xc5b9('0x3d')]+'%'};return _0x302412;}})});}_0xe9010=_['merge']({},_0xe9010,_0x50225a[_0xc5b9('0x41')]);var _0x3eb874={'where':_0xe9010['where']};return db[_0xc5b9('0x42')][_0xc5b9('0x1d')](_0x3eb874)[_0xc5b9('0x24')](function(_0x353d7a){_0x57ee58['count']=_0x353d7a;if(_0x50225a[_0xc5b9('0x31')][_0xc5b9('0x43')]){_0xe9010[_0xc5b9('0x44')]=[{'all':!![]}];}return db[_0xc5b9('0x42')][_0xc5b9('0x45')](_0xe9010);})['then'](function(_0x379a6b){_0x57ee58[_0xc5b9('0x46')]=_0x379a6b;return _0x57ee58;})[_0xc5b9('0x24')](respondWithFilteredResult(_0x2d4ad1,_0xe9010))[_0xc5b9('0x47')](handleError(_0x2d4ad1,null));};exports[_0xc5b9('0x48')]=function(_0x54df4b,_0x220500){var _0x8be259={'raw':!![],'where':{'id':_0x54df4b['params']['id']}},_0x445095={};_0x445095[_0xc5b9('0x30')]=_[_0xc5b9('0x32')](db[_0xc5b9('0x42')][_0xc5b9('0x2c')]);_0x445095['query']=_[_0xc5b9('0x32')](_0x54df4b[_0xc5b9('0x31')]);_0x445095['filters']=_[_0xc5b9('0x34')](_0x445095[_0xc5b9('0x30')],_0x445095['query']);_0x8be259[_0xc5b9('0x36')]=_['intersection'](_0x445095[_0xc5b9('0x30')],qs[_0xc5b9('0x35')](_0x54df4b[_0xc5b9('0x31')]['fields']));_0x8be259[_0xc5b9('0x36')]=_0x8be259[_0xc5b9('0x36')][_0xc5b9('0x37')]?_0x8be259[_0xc5b9('0x36')]:_0x445095[_0xc5b9('0x30')];if(_0x54df4b[_0xc5b9('0x31')]['includeAll']){_0x8be259['include']=[{'all':!![]}];}_0x8be259=_[_0xc5b9('0x3e')]({},_0x8be259,_0x54df4b['options']);return db[_0xc5b9('0x42')][_0xc5b9('0x49')](_0x8be259)[_0xc5b9('0x24')](handleEntityNotFound(_0x220500,null))[_0xc5b9('0x24')](respondWithResult(_0x220500,null))['catch'](handleError(_0x220500,null));};exports[_0xc5b9('0x4a')]=function(_0x2afa44,_0x24ffc5){return db[_0xc5b9('0x42')][_0xc5b9('0x4a')](_0x2afa44[_0xc5b9('0x4b')],{})[_0xc5b9('0x24')](respondWithResult(_0x24ffc5,0xc9))[_0xc5b9('0x47')](handleError(_0x24ffc5,null));};exports[_0xc5b9('0x23')]=function(_0x27544c,_0x5baf47){if(_0x27544c[_0xc5b9('0x4b')]['id']){delete _0x27544c['body']['id'];}return db['ChatTransferReport']['find']({'where':{'id':_0x27544c['params']['id']}})['then'](handleEntityNotFound(_0x5baf47,null))[_0xc5b9('0x24')](saveUpdates(_0x27544c[_0xc5b9('0x4b')],null))[_0xc5b9('0x24')](respondWithResult(_0x5baf47,null))['catch'](handleError(_0x5baf47,null));};exports[_0xc5b9('0x25')]=function(_0x1b51b4,_0x5c3508){return db[_0xc5b9('0x42')][_0xc5b9('0x49')]({'where':{'id':_0x1b51b4[_0xc5b9('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5c3508,null))[_0xc5b9('0x24')](removeEntity(_0x5c3508,null))['catch'](handleError(_0x5c3508,null));};exports[_0xc5b9('0x4d')]=function(_0x2deea5,_0x8011de){return db[_0xc5b9('0x42')][_0xc5b9('0x4d')]()[_0xc5b9('0x24')](respondWithResult(_0x8011de,null))[_0xc5b9('0x47')](handleError(_0x8011de,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 70ec0e9..57ee8ce 100644
--- a/server/api/chatTransferReport/chatTransferReport.model.js
+++ b/server/api/chatTransferReport/chatTransferReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xebce=['util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','ChatTransferReport','uniqueid'];(function(_0x3b4b14,_0x19bc14){var _0x16b898=function(_0x5de1cd){while(--_0x5de1cd){_0x3b4b14['push'](_0x3b4b14['shift']());}};_0x16b898(++_0x19bc14);}(_0xebce,0x16b));var _0xeebc=function(_0x39c8f2,_0x23df6c){_0x39c8f2=_0x39c8f2-0x0;var _0x445526=_0xebce[_0x39c8f2];return _0x445526;};'use strict';var _=require('lodash');var util=require(_0xeebc('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xeebc('0x1'));var BPromise=require(_0xeebc('0x2'));var rp=require(_0xeebc('0x3'));var fs=require('fs');var path=require(_0xeebc('0x4'));var rimraf=require(_0xeebc('0x5'));var config=require(_0xeebc('0x6'));var attributes=require(_0xeebc('0x7'));module[_0xeebc('0x8')]=function(_0x527fb9,_0x114522){return _0x527fb9['define'](_0xeebc('0x9'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xeebc('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x09e8=['lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','uniqueid'];(function(_0x5d2465,_0x3e2916){var _0x11c10c=function(_0x50eb0b){while(--_0x50eb0b){_0x5d2465['push'](_0x5d2465['shift']());}};_0x11c10c(++_0x3e2916);}(_0x09e8,0x1b0));var _0x809e=function(_0x1c06be,_0x31153c){_0x1c06be=_0x1c06be-0x0;var _0x237925=_0x09e8[_0x1c06be];return _0x237925;};'use strict';var _=require(_0x809e('0x0'));var util=require(_0x809e('0x1'));var logger=require(_0x809e('0x2'))('api');var moment=require(_0x809e('0x3'));var BPromise=require(_0x809e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x809e('0x5'));var config=require(_0x809e('0x6'));var attributes=require(_0x809e('0x7'));module[_0x809e('0x8')]=function(_0x5c6093,_0x27856f){return _0x5c6093[_0x809e('0x9')](_0x809e('0xa'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x809e('0xb'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 78692aa..d8403fb 100644
--- a/server/api/chatTransferReport/chatTransferReport.rpc.js
+++ b/server/api/chatTransferReport/chatTransferReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4be5=['request','then','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x4be5,0xa5));var _0x54be=function(_0x359bbe,_0x5b7fcc){_0x359bbe=_0x359bbe-0x0;var _0x1b3353=_0x4be5[_0x359bbe];return _0x1b3353;};'use strict';var _=require('lodash');var util=require(_0x54be('0x0'));var moment=require(_0x54be('0x1'));var BPromise=require(_0x54be('0x2'));var rs=require(_0x54be('0x3'));var fs=require('fs');var Redis=require(_0x54be('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x54be('0x5'));var logger=require(_0x54be('0x6'))(_0x54be('0x7'));var config=require(_0x54be('0x8'));var jayson=require(_0x54be('0x9'));var client=jayson['client'][_0x54be('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x32084a,_0x2f4b05,_0x2e3f63){return new BPromise(function(_0x118dd0,_0x31cd8f){return client[_0x54be('0xb')](_0x32084a,_0x2e3f63)[_0x54be('0xc')](function(_0x15554c){logger[_0x54be('0xd')](_0x54be('0xe'),_0x2f4b05,'request\x20sent');logger[_0x54be('0xf')](_0x54be('0x10'),_0x2f4b05,_0x54be('0x11'),JSON[_0x54be('0x12')](_0x15554c));if(_0x15554c[_0x54be('0x13')]){if(_0x15554c[_0x54be('0x13')][_0x54be('0x14')]===0x1f4){logger[_0x54be('0x13')](_0x54be('0xe'),_0x2f4b05,_0x15554c['error'][_0x54be('0x15')]);return _0x31cd8f(_0x15554c[_0x54be('0x13')]['message']);}logger['error'](_0x54be('0xe'),_0x2f4b05,_0x15554c[_0x54be('0x13')]['message']);return _0x118dd0(_0x15554c['error'][_0x54be('0x15')]);}else{logger['info'](_0x54be('0xe'),_0x2f4b05,_0x54be('0x11'));_0x118dd0(_0x15554c['result'][_0x54be('0x15')]);}})['catch'](function(_0x477565){logger[_0x54be('0x13')](_0x54be('0xe'),_0x2f4b05,_0x477565);_0x31cd8f(_0x477565);});});}
\ No newline at end of file
+var _0xde21=['result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','message','info'];(function(_0x2ebe96,_0x554634){var _0x3c64cc=function(_0x44f90c){while(--_0x44f90c){_0x2ebe96['push'](_0x2ebe96['shift']());}};_0x3c64cc(++_0x554634);}(_0xde21,0x128));var _0x1de2=function(_0x4e0944,_0x439b17){_0x4e0944=_0x4e0944-0x0;var _0x3c6010=_0xde21[_0x4e0944];return _0x3c6010;};'use strict';var _=require(_0x1de2('0x0'));var util=require(_0x1de2('0x1'));var moment=require(_0x1de2('0x2'));var BPromise=require('bluebird');var rs=require(_0x1de2('0x3'));var fs=require('fs');var Redis=require(_0x1de2('0x4'));var db=require(_0x1de2('0x5'))['db'];var utils=require(_0x1de2('0x6'));var logger=require(_0x1de2('0x7'))(_0x1de2('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1de2('0x9')][_0x1de2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x317d78,_0x2ccd33,_0x42199a){return new BPromise(function(_0x5dac77,_0x482180){return client[_0x1de2('0xb')](_0x317d78,_0x42199a)[_0x1de2('0xc')](function(_0x414747){logger['info'](_0x1de2('0xd'),_0x2ccd33,_0x1de2('0xe'));logger['debug'](_0x1de2('0xf'),_0x2ccd33,'request\x20sent',JSON['stringify'](_0x414747));if(_0x414747[_0x1de2('0x10')]){if(_0x414747[_0x1de2('0x10')]['code']===0x1f4){logger['error'](_0x1de2('0xd'),_0x2ccd33,_0x414747['error'][_0x1de2('0x11')]);return _0x482180(_0x414747[_0x1de2('0x10')][_0x1de2('0x11')]);}logger[_0x1de2('0x10')](_0x1de2('0xd'),_0x2ccd33,_0x414747[_0x1de2('0x10')][_0x1de2('0x11')]);return _0x5dac77(_0x414747[_0x1de2('0x10')][_0x1de2('0x11')]);}else{logger[_0x1de2('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x2ccd33,_0x1de2('0xe'));_0x5dac77(_0x414747[_0x1de2('0x13')]['message']);}})[_0x1de2('0x14')](function(_0x28e30f){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x2ccd33,_0x28e30f);_0x482180(_0x28e30f);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index d72f2ec..05308f8 100644
--- a/server/api/chatTransferReport/index.js
+++ b/server/api/chatTransferReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x95dc=['get','isAuthenticated','describe','show','put','update','delete','/:id','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller'];(function(_0x328358,_0x59c946){var _0x3fc1d0=function(_0x364f29){while(--_0x364f29){_0x328358['push'](_0x328358['shift']());}};_0x3fc1d0(++_0x59c946);}(_0x95dc,0x99));var _0xc95d=function(_0x4ff444,_0x5dbb45){_0x4ff444=_0x4ff444-0x0;var _0x533fbd=_0x95dc[_0x4ff444];return _0x533fbd;};'use strict';var multer=require(_0xc95d('0x0'));var util=require(_0xc95d('0x1'));var path=require(_0xc95d('0x2'));var timeout=require('connect-timeout');var express=require(_0xc95d('0x3'));var router=express[_0xc95d('0x4')]();var fs_extra=require(_0xc95d('0x5'));var auth=require(_0xc95d('0x6'));var interaction=require(_0xc95d('0x7'));var config=require('../../config/environment');var controller=require(_0xc95d('0x8'));router[_0xc95d('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc95d('0x9')]('/describe',auth[_0xc95d('0xa')](),controller[_0xc95d('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xc95d('0xc')]);router['post']('/',auth[_0xc95d('0xa')](),controller['create']);router[_0xc95d('0xd')]('/:id',auth[_0xc95d('0xa')](),controller[_0xc95d('0xe')]);router[_0xc95d('0xf')](_0xc95d('0x10'),auth[_0xc95d('0xa')](),controller[_0xc95d('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0xcbe5=['show','put','/:id','update','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','get'];(function(_0x590d48,_0x12b03a){var _0x3bcc73=function(_0x335f09){while(--_0x335f09){_0x590d48['push'](_0x590d48['shift']());}};_0x3bcc73(++_0x12b03a);}(_0xcbe5,0xd7));var _0x5cbe=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xcbe5[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0x5cbe('0x0'));var util=require(_0x5cbe('0x1'));var path=require(_0x5cbe('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5cbe('0x3')]();var fs_extra=require(_0x5cbe('0x4'));var auth=require(_0x5cbe('0x5'));var interaction=require(_0x5cbe('0x6'));var config=require(_0x5cbe('0x7'));var controller=require('./chatTransferReport.controller');router['get']('/',auth[_0x5cbe('0x8')](),controller[_0x5cbe('0x9')]);router['get'](_0x5cbe('0xa'),auth[_0x5cbe('0x8')](),controller[_0x5cbe('0xb')]);router[_0x5cbe('0xc')]('/:id',auth[_0x5cbe('0x8')](),controller[_0x5cbe('0xd')]);router['post']('/',auth[_0x5cbe('0x8')](),controller['create']);router[_0x5cbe('0xe')](_0x5cbe('0xf'),auth[_0x5cbe('0x8')](),controller[_0x5cbe('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5cbe('0x11')]);module[_0x5cbe('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 10f0532..6298323 100644
--- a/server/api/chatWebsite/chatWebsite.attributes.js
+++ b/server/api/chatWebsite/chatWebsite.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc7a8=['#ffffff','INTEGER','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','Feedback','star','name','text','input','getDataValue','onlineForm','setDataValue','stringify','textarea','Comments','Leave\x20your\x20comments','offlineForm','parse','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','email','Agent','#011F6A'];(function(_0x212306,_0x2fd0f5){var _0x55f2a2=function(_0x345de8){while(--_0x345de8){_0x212306['push'](_0x212306['shift']());}};_0x55f2a2(++_0x2fd0f5);}(_0xc7a8,0x165));var _0x8c7a=function(_0x278a5b,_0x326b82){_0x278a5b=_0x278a5b-0x0;var _0x579e7f=_0xc7a8[_0x278a5b];return _0x579e7f;};'use strict';var Sequelize=require(_0x8c7a('0x0'));var rs=require(_0x8c7a('0x1'));module[_0x8c7a('0x2')]={'name':{'type':Sequelize[_0x8c7a('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x8c7a('0x3')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x8c7a('0x3')]},'mapKey':{'type':Sequelize[_0x8c7a('0x3')],'defaultValue':_0x8c7a('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x8c7a('0x4')},'key':{'type':Sequelize[_0x8c7a('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x8c7a('0x3')],'defaultValue':_0x8c7a('0x5')},'customerAlias':{'type':Sequelize[_0x8c7a('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x8c7a('0x3')],'allowNull':![],'defaultValue':_0x8c7a('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x8c7a('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x8c7a('0x3')],'allowNull':![],'defaultValue':_0x8c7a('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x8c7a('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x8c7a('0x3')]},'animation':{'type':Sequelize[_0x8c7a('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x8c7a('0xa')](_0x8c7a('0xb'),'squared'),'defaultValue':_0x8c7a('0xb')},'header_online':{'type':Sequelize[_0x8c7a('0x3')],'defaultValue':_0x8c7a('0xc')},'start_chat_button':{'type':Sequelize[_0x8c7a('0x3')],'defaultValue':_0x8c7a('0xd')},'offline_chat_button':{'type':Sequelize[_0x8c7a('0x3')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x8c7a('0x3')],'defaultValue':_0x8c7a('0xe')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x8c7a('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x8c7a('0x3')],'defaultValue':_0x8c7a('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0x8c7a('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x8c7a('0x10')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x8c7a('0x11')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x8c7a('0x3')],'defaultValue':_0x8c7a('0x12')},'noteTitle':{'type':Sequelize[_0x8c7a('0x3')],'defaultValue':_0x8c7a('0x13')},'placeholderMessage':{'type':Sequelize[_0x8c7a('0x3')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x8c7a('0x3')],'defaultValue':_0x8c7a('0x14')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x8c7a('0x15')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x8c7a('0x16')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x8c7a('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x8c7a('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x8c7a('0x3')],'defaultValue':_0x8c7a('0x17')},'ratingType':{'type':Sequelize['ENUM'](_0x8c7a('0x18'),'thumb'),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x8c7a('0x10')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x8c7a('0x19'),'type':_0x8c7a('0x1a'),'required':!![]},'props':{'title':_0x8c7a('0x19'),'helpText':''}},{'type':_0x8c7a('0x1b'),'props':{'title':_0x8c7a('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x8c7a('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x8c7a('0x1c')](_0x8c7a('0x1d'))?JSON['parse'](this[_0x8c7a('0x1c')]('onlineForm')):{};},'set':function(_0x5266f1){return this[_0x8c7a('0x1e')]('onlineForm',JSON[_0x8c7a('0x1f')](_0x5266f1));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x8c7a('0x1b'),'props':{'title':_0x8c7a('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x8c7a('0x4'),'type':_0x8c7a('0x4')},'variable':null},{'type':_0x8c7a('0x20'),'config':{'placeholder':_0x8c7a('0x21')},'props':{'title':'Comments','helpText':_0x8c7a('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0x8c7a('0x1c')](_0x8c7a('0x23'))?JSON[_0x8c7a('0x24')](this[_0x8c7a('0x1c')](_0x8c7a('0x23'))):{};},'set':function(_0x3ce590){return this[_0x8c7a('0x1e')](_0x8c7a('0x23'),JSON[_0x8c7a('0x1f')](_0x3ce590));}},'token':{'type':Sequelize[_0x8c7a('0x3')],'defaultValue':function(){return rs[_0x8c7a('0x25')]();}},'autoclose':{'type':Sequelize[_0x8c7a('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x8c7a('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x8c7a('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x8c7a('0x3')],'defaultValue':_0x8c7a('0x26')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x8c7a('0x3')],'defaultValue':_0x8c7a('0x27')},'offlineMessageBody':{'type':Sequelize[_0x8c7a('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x8c7a('0x28')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x8c7a('0x3')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x8c7a('0x10')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x8c7a('0x3')]},'notificationTemplate':{'type':Sequelize[_0x8c7a('0x10')],'defaultValue':function(){return _0x8c7a('0x29');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8c7a('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x8c7a('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x8c7a('0x3')],'defaultValue':_0x8c7a('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize[_0x8c7a('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x8c7a('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x8c7a('0x3')],'defaultValue':_0x8c7a('0x2b')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x8c7a('0x3')],'defaultValue':_0x8c7a('0x2c')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x8c7a('0x2d')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x8c7a('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0x8c7a('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x8c7a('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x8c7a('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8c7a('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8c7a('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8c7a('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x8c7a('0x2e')},'systemAvatar':{'type':Sequelize[_0x8c7a('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8c7a('0x8')],'comment':_0x8c7a('0x2f')},'mandatoryDisposition':{'type':Sequelize[_0x8c7a('0x9')],'defaultValue':![],'comment':_0x8c7a('0x30'),'set':function(_0x42b0a9){if(!_0x42b0a9)this[_0x8c7a('0x1e')](_0x8c7a('0x31'),null);this['setDataValue']('mandatoryDisposition',_0x42b0a9);}},'vidaooEscalation':{'type':Sequelize[_0x8c7a('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x8c7a('0x3')]},'vidaooTopic':{'type':Sequelize[_0x8c7a('0x3')],'allowNull':![],'defaultValue':_0x8c7a('0x32')},'vidaooNote':{'type':Sequelize[_0x8c7a('0x3')],'defaultValue':function(){return _0x8c7a('0x33');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x8c7a('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x8c7a('0x10')]}};
\ No newline at end of file
+var _0x3d04=['address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Skip','Feedback','star','thumb','stringify','name','text','input','getDataValue','onlineForm','textarea','Comments','parse','offlineForm','setDataValue','generate','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING'];(function(_0xf8fa35,_0x3981af){var _0xf34f7f=function(_0x4c49d8){while(--_0x4c49d8){_0xf8fa35['push'](_0xf8fa35['shift']());}};_0xf34f7f(++_0x3981af);}(_0x3d04,0x8f));var _0x43d0=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x3d04[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0x43d0('0x0'));var rs=require(_0x43d0('0x1'));module[_0x43d0('0x2')]={'name':{'type':Sequelize[_0x43d0('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x43d0('0x4')},'description':{'type':Sequelize[_0x43d0('0x3')]},'mapKey':{'type':Sequelize[_0x43d0('0x3')],'defaultValue':_0x43d0('0x5')},'mapKeyOffline':{'type':Sequelize[_0x43d0('0x3')],'defaultValue':_0x43d0('0x5')},'key':{'type':Sequelize[_0x43d0('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x43d0('0x3')],'defaultValue':_0x43d0('0x6')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x43d0('0x3')],'allowNull':![],'defaultValue':_0x43d0('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x43d0('0x3')],'allowNull':![],'defaultValue':_0x43d0('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x43d0('0x3')],'allowNull':![],'defaultValue':_0x43d0('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x43d0('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x43d0('0x3')]},'animation':{'type':Sequelize[_0x43d0('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x43d0('0xb')](_0x43d0('0xc'),'squared'),'defaultValue':_0x43d0('0xc')},'header_online':{'type':Sequelize[_0x43d0('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x43d0('0x3')],'defaultValue':_0x43d0('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x43d0('0xe')},'header_offline':{'type':Sequelize[_0x43d0('0x3')],'defaultValue':_0x43d0('0xf')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x43d0('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x43d0('0x3')],'defaultValue':_0x43d0('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0x43d0('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x43d0('0x11')]},'closingQuestion':{'type':Sequelize[_0x43d0('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x43d0('0x3')],'defaultValue':_0x43d0('0x12')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x43d0('0x13')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x43d0('0x3')],'defaultValue':_0x43d0('0x14')},'closingMessage':{'type':Sequelize[_0x43d0('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x43d0('0x3')],'defaultValue':_0x43d0('0xe')},'skipMessageButton':{'type':Sequelize[_0x43d0('0x3')],'defaultValue':_0x43d0('0x15')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x43d0('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x43d0('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x43d0('0xa')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x43d0('0x3')],'defaultValue':_0x43d0('0x16')},'ratingType':{'type':Sequelize[_0x43d0('0xb')](_0x43d0('0x17'),_0x43d0('0x18')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x43d0('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x43d0('0x19')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x43d0('0x1a'),'type':_0x43d0('0x1b'),'required':!![]},'props':{'title':_0x43d0('0x1a'),'helpText':''}},{'type':_0x43d0('0x1c'),'props':{'title':_0x43d0('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x43d0('0x5'),'type':_0x43d0('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x43d0('0x1d')](_0x43d0('0x1e'))?JSON['parse'](this['getDataValue'](_0x43d0('0x1e'))):{};},'set':function(_0x48cb8c){return this['setDataValue'](_0x43d0('0x1e'),JSON[_0x43d0('0x19')](_0x48cb8c));}},'offlineForm':{'type':Sequelize[_0x43d0('0x11')],'defaultValue':function(){return JSON[_0x43d0('0x19')]({'items':[{'type':_0x43d0('0x1c'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x43d0('0x5')},'variable':null},{'type':_0x43d0('0x1f'),'config':{'placeholder':_0x43d0('0x20')},'props':{'title':'Comments','helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this['getDataValue']('offlineForm')?JSON[_0x43d0('0x21')](this[_0x43d0('0x1d')](_0x43d0('0x22'))):{};},'set':function(_0x1ac517){return this[_0x43d0('0x23')]('offlineForm',JSON[_0x43d0('0x19')](_0x1ac517));}},'token':{'type':Sequelize[_0x43d0('0x3')],'defaultValue':function(){return rs[_0x43d0('0x24')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x43d0('0x3')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x43d0('0x3')]},'waitingTitle':{'type':Sequelize[_0x43d0('0x3')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x43d0('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x43d0('0x3')],'defaultValue':_0x43d0('0x25')},'offlineMessageBody':{'type':Sequelize[_0x43d0('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x43d0('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x43d0('0x26')},'skipUnmanaged':{'type':Sequelize[_0x43d0('0x3')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x43d0('0x3')],'defaultValue':_0x43d0('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0x43d0('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x43d0('0xa')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x43d0('0x3')]},'notificationTemplate':{'type':Sequelize[_0x43d0('0x11')],'defaultValue':function(){return _0x43d0('0x27');}},'notificationSound':{'type':Sequelize[_0x43d0('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x43d0('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x43d0('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x43d0('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0x43d0('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x43d0('0x3')],'defaultValue':_0x43d0('0x29')},'verticalAlignment':{'type':Sequelize[_0x43d0('0x9')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x43d0('0x3')],'defaultValue':_0x43d0('0x2a')},'messagesAlignment':{'type':Sequelize[_0x43d0('0x3')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x43d0('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x43d0('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x43d0('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x43d0('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x43d0('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x43d0('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x43d0('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x43d0('0x9')],'comment':_0x43d0('0x2b')},'mandatoryDisposition':{'type':Sequelize[_0x43d0('0xa')],'defaultValue':![],'comment':_0x43d0('0x2c'),'set':function(_0x47ad65){if(!_0x47ad65)this[_0x43d0('0x23')](_0x43d0('0x2d'),null);this[_0x43d0('0x23')](_0x43d0('0x2e'),_0x47ad65);}},'vidaooEscalation':{'type':Sequelize[_0x43d0('0xa')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x43d0('0x3')],'allowNull':![],'defaultValue':_0x43d0('0x2f')},'vidaooNote':{'type':Sequelize[_0x43d0('0x3')],'defaultValue':function(){return _0x43d0('0x30');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x43d0('0xa')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 85215ab..aa4888d 100644
--- a/server/api/chatWebsite/chatWebsite.controller.js
+++ b/server/api/chatWebsite/chatWebsite.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb533=['sendStatus','status','offset','limit','undefined','count','Content-Range','json','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','user-agent-parser','setUA','user-agent','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','model','device','vendor','%s\x20%s\x20%s','type','index','Pause','mandatoryDispositionPause','ChatWebsite','fieldName','key','map','keys','query','filters','attributes','intersection','fields','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','length','find','create','body','address','forEach','trim','testWildcardValidity','\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','update','describe','addDisposition','ChatWebsiteId','getDispositions','hasOwnProperty','nolimit','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','findOne','removeAnswers','sitepic','file','filename','addAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','existsSync','root','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','download','getSystemAvatar','server/files/images/avatars/system_avatar.png','resolve','ifTime','notify','chat','From\x20is\x20mandatory','isEmpty','Body\x20is\x20mandatory','customerIp','CmContact','No\x20available\x20attributes','createdAt','updatedAt','CompanyId','ListId','includes','mapKey','CmList','List','Contacts','DESC','ChatApplication','Applications','Interval','Intervals','interval','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','applications','orderBy','priority','asc','list','defaults','from','contact','threadId','closed','ChatInteraction','Writing\x20on\x20closed\x20interaction','externalUrl','ContactId','interaction','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','User','unshift','waitForTheAssignedAgent','forcedOwnership','queueId','ChatQueue','Start','startRouting','EventManager','files','Sequelize','ValidationError','no\x20available\x20attributes','difference','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','offline-chat','openNewInteraction','sequelize','transaction','bulkCreate','MailServerOut','CloudProvider','forwardOffline','forwardOfflineAddress','sendMail','Smtp','offlineMessageSubject','MailAccountId','subjectOffline','email','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','getSnippet','getProactiveActions','virtual','License','increment','timezone','server/files/chat/iframe.ejs','3.12.1','headers','origin','http://localhost:9000','testWebsiteWithWildcard','remote','x-real-ip','connection','remoteAddress','replace','alignment','verticalAlignment','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachment','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','ejs','fs-extra','html-to-text','ioredis','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../errors/api','APIBadRequestError','APINotFoundError','APIOutOfIntervalError','handleError','./helpers/wildcard-expressions','url','URL','redis','socket.io-emitter','client','http','then','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ChatWebsite,\x20%s,\x20%s'];(function(_0x41a9b8,_0x3051f1){var _0x5e0120=function(_0x51f2e4){while(--_0x51f2e4){_0x41a9b8['push'](_0x41a9b8['shift']());}};_0x5e0120(++_0x3051f1);}(_0xb533,0x119));var _0x3b53=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xb533[_0x32f7d7];return _0x133d09;};'use strict';var Mustache=require(_0x3b53('0x0'));var util=require(_0x3b53('0x1'));var path=require('path');var ejs=require(_0x3b53('0x2'));var fs=require('fs');var fs_extra=require(_0x3b53('0x3'));var _=require('lodash');var querystring=require('querystring');var htmlToText=require(_0x3b53('0x4'));var Redis=require(_0x3b53('0x5'));var jayson=require(_0x3b53('0x6'));var qs=require(_0x3b53('0x7'));var logger=require(_0x3b53('0x8'))(_0x3b53('0x9'));var config=require(_0x3b53('0xa'));var APIBadRequestError=require(_0x3b53('0xb'))[_0x3b53('0xc')];var APINotFoundError=require(_0x3b53('0xb'))[_0x3b53('0xd')];var APIOutOfIntervalError=require('../../errors/api')[_0x3b53('0xe')];var APIHandleError=require(_0x3b53('0xb'))[_0x3b53('0xf')];var APIConflictError=require('../../errors/api')['APIConflictError'];var wildcardUtils=require(_0x3b53('0x10'));var URL=require(_0x3b53('0x11'))[_0x3b53('0x12')];var db=require('../../mysqldb')['db'];config[_0x3b53('0x13')]=_['defaults'](config[_0x3b53('0x13')],{'host':'localhost','port':0x18eb});var socket=require(_0x3b53('0x14'))(new Redis(config[_0x3b53('0x13')]));require('./chatWebsite.socket')['register'](socket);var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x3b53('0x15')][_0x3b53('0x16')]({'port':0x232a});var client9003=jayson[_0x3b53('0x15')][_0x3b53('0x16')]({'port':0x232b});var client9001=jayson['client'][_0x3b53('0x16')]({'port':0x2329});function respondWithRpcPromise(_0x1573e5,_0x3869a5,_0x2b531d,_0xd41db0){return new Promise(function(_0x1c8804,_0xb663c1){var _0x54d3ae=_0xd41db0||client;return _0x54d3ae['request'](_0x1573e5,_0x2b531d)[_0x3b53('0x17')](function(_0x10ba94){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x3869a5,_0x3b53('0x18'));logger[_0x3b53('0x19')](_0x3b53('0x1a'),_0x3869a5,'request\x20sent',JSON[_0x3b53('0x1b')](_0x10ba94));if(_0x10ba94[_0x3b53('0x1c')]){if(_0x10ba94[_0x3b53('0x1c')][_0x3b53('0x1d')]===0x1f4){logger[_0x3b53('0x1c')]('ChatWebsite,\x20%s,\x20%s',_0x3869a5,_0x10ba94[_0x3b53('0x1c')][_0x3b53('0x1e')]);return _0xb663c1(_0x10ba94[_0x3b53('0x1c')][_0x3b53('0x1e')]);}logger[_0x3b53('0x1c')]('ChatWebsite,\x20%s,\x20%s',_0x3869a5,_0x10ba94[_0x3b53('0x1c')]['message']);return _0x1c8804(_0x10ba94['error'][_0x3b53('0x1e')]);}else{logger[_0x3b53('0x1f')]('ChatWebsite,\x20%s,\x20%s',_0x3869a5,_0x3b53('0x18'));_0x1c8804(_0x10ba94[_0x3b53('0x20')]['message']);}})[_0x3b53('0x21')](function(_0x3075e3){logger[_0x3b53('0x1c')](_0x3b53('0x22'),_0x3869a5,_0x3075e3);_0xb663c1(_0x3075e3);});});}function respondWithStatusCode(_0x289ebd,_0x3ab06e){_0x3ab06e=_0x3ab06e||0xcc;return function(_0x129493){if(_0x129493){return _0x289ebd[_0x3b53('0x23')](_0x3ab06e);}return _0x289ebd['status'](_0x3ab06e)['end']();};}function respondWithResult(_0x9c5517,_0x4aedaa){_0x4aedaa=_0x4aedaa||0xc8;return function(_0x202a80){if(_0x202a80){return _0x9c5517[_0x3b53('0x24')](_0x4aedaa)['json'](_0x202a80);}};}function respondWithFilteredResult(_0x253ca9,_0x8231d2){return function(_0x536832){if(_0x536832){var _0x45b833=typeof _0x8231d2[_0x3b53('0x25')]==='undefined'&&typeof _0x8231d2[_0x3b53('0x26')]===_0x3b53('0x27');var _0x3b83d4=_0x536832[_0x3b53('0x28')];var _0xa6ae13=_0x45b833?0x0:_0x8231d2['offset'];var _0x1262f6=_0x45b833?_0x536832['count']:_0x8231d2[_0x3b53('0x25')]+_0x8231d2[_0x3b53('0x26')];var _0xf0d959;if(_0x1262f6>=_0x3b83d4){_0x1262f6=_0x3b83d4;_0xf0d959=0xc8;}else{_0xf0d959=0xce;}_0x253ca9['status'](_0xf0d959);return _0x253ca9['set'](_0x3b53('0x29'),_0xa6ae13+'-'+_0x1262f6+'/'+_0x3b83d4)[_0x3b53('0x2a')](_0x536832);}return null;};}function saveUpdates(_0x334607){return function(_0x53a338){if(_0x53a338){return _0x53a338['update'](_0x334607)[_0x3b53('0x17')](function(_0x102825){return _0x102825;});}return null;};}function removeEntity(_0x52b5e5){return function(_0x712e47){if(_0x712e47){return _0x712e47[_0x3b53('0x2b')]()[_0x3b53('0x17')](function(){var _0x1a5fe1=_0x712e47[_0x3b53('0x2c')]({'plain':!![]});var _0x1c9459=_0x3b53('0x2d');return db[_0x3b53('0x2e')]['destroy']({'where':{'type':_0x1c9459,'resourceId':_0x1a5fe1['id']}})[_0x3b53('0x17')](function(){return _0x712e47;});})[_0x3b53('0x17')](function(){_0x52b5e5[_0x3b53('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39afc7){return function(_0x442d74){if(!_0x442d74){_0x39afc7['sendStatus'](0x194);}return _0x442d74;};}function handleError(_0x1f2b62,_0x4f1389){_0x4f1389=_0x4f1389||0x1f4;return function(_0x1b929b){logger[_0x3b53('0x1c')](_0x1b929b[_0x3b53('0x2f')]);if(_0x1b929b[_0x3b53('0x30')]){delete _0x1b929b['name'];}_0x1f2b62[_0x3b53('0x24')](_0x4f1389)[_0x3b53('0x31')](_0x1b929b);};}function createInteractionObject(_0x25828d,_0x1e5d8d,_0x5d44df,_0x3c0484){var _0x1aea4a=require(_0x3b53('0x32'));var _0x4e77ad=new _0x1aea4a();var _0x56c851=_0x4e77ad[_0x3b53('0x33')](_0x5d44df[_0x3b53('0x34')])['getResult']();var _0x5686ee=_0x1e5d8d['customerIp'];if(_0x5d44df[_0x3b53('0x35')]){_0x5686ee=_0x5d44df['cf-connecting-ip'];}else if(_0x5d44df[_0x3b53('0x36')]){_0x5686ee=_[_0x3b53('0x37')](_0x5d44df[_0x3b53('0x36')][_0x3b53('0x38')](','));}return{'ContactId':_0x3c0484['id'],'ChatWebsiteId':_0x25828d,'from':(_0x3c0484[_0x3b53('0x39')]||'')+'\x20'+(_0x3c0484[_0x3b53('0x3a')]||''),'customerIp':_0x5686ee,'customerPort':_0x5d44df[_0x3b53('0x3b')]?_0x5d44df[_0x3b53('0x3b')]:null,'referer':_0x1e5d8d[_0x3b53('0x3c')],'browserName':_0x56c851['browser'][_0x3b53('0x30')]&&_0x56c851[_0x3b53('0x3d')][_0x3b53('0x3e')]?util[_0x3b53('0x3f')](_0x3b53('0x40'),_0x56c851[_0x3b53('0x3d')][_0x3b53('0x30')],_0x56c851[_0x3b53('0x3d')][_0x3b53('0x3e')]):'unknown','browserVersion':_0x56c851['browser'][_0x3b53('0x3e')]||'unknown','osName':util[_0x3b53('0x3f')](_0x3b53('0x40'),_0x56c851['os'][_0x3b53('0x30')],_0x56c851['os'][_0x3b53('0x3e')]),'osVersion':_0x56c851['os']['version'],'deviceModel':_0x56c851['device'][_0x3b53('0x41')]&&_0x56c851[_0x3b53('0x42')][_0x3b53('0x43')]?util[_0x3b53('0x3f')](_0x3b53('0x44'),_0x56c851[_0x3b53('0x42')][_0x3b53('0x41')],_0x56c851[_0x3b53('0x42')][_0x3b53('0x43')],_0x56c851[_0x3b53('0x42')][_0x3b53('0x45')]):null,'deviceVendor':_0x56c851[_0x3b53('0x42')][_0x3b53('0x43')],'deviceType':_0x56c851[_0x3b53('0x42')][_0x3b53('0x45')],'formData':JSON[_0x3b53('0x1b')](_0x1e5d8d)};}exports[_0x3b53('0x46')]=function(_0x51fbc8,_0x53c6fb){var _0x473aff={'include':[{'model':db[_0x3b53('0x47')],'as':_0x3b53('0x48')}]},_0x433585={},_0x200d62={'count':0x0,'rows':[]};var _0x3df2a6=_['map'](db[_0x3b53('0x49')]['rawAttributes'],function(_0x2de3f8){return{'name':_0x2de3f8[_0x3b53('0x4a')],'type':_0x2de3f8[_0x3b53('0x45')][_0x3b53('0x4b')]};});_0x433585[_0x3b53('0x41')]=_[_0x3b53('0x4c')](_0x3df2a6,_0x3b53('0x30'));_0x433585['query']=_[_0x3b53('0x4d')](_0x51fbc8[_0x3b53('0x4e')]);_0x433585[_0x3b53('0x4f')]=_['intersection'](_0x433585[_0x3b53('0x41')],_0x433585[_0x3b53('0x4e')]);_0x473aff[_0x3b53('0x50')]=_[_0x3b53('0x51')](_0x433585['model'],qs[_0x3b53('0x52')](_0x51fbc8[_0x3b53('0x4e')][_0x3b53('0x52')]));_0x473aff[_0x3b53('0x50')]=_0x473aff[_0x3b53('0x50')]['length']?_0x473aff[_0x3b53('0x50')]:_0x433585[_0x3b53('0x41')];if(!_0x51fbc8[_0x3b53('0x4e')]['hasOwnProperty']('nolimit')){_0x473aff['limit']=qs[_0x3b53('0x26')](_0x51fbc8['query'][_0x3b53('0x26')]);_0x473aff[_0x3b53('0x25')]=qs[_0x3b53('0x25')](_0x51fbc8[_0x3b53('0x4e')]['offset']);}_0x473aff[_0x3b53('0x53')]=qs[_0x3b53('0x54')](_0x51fbc8[_0x3b53('0x4e')][_0x3b53('0x54')]);_0x473aff['where']=qs['filters'](_[_0x3b53('0x55')](_0x51fbc8[_0x3b53('0x4e')],_0x433585[_0x3b53('0x4f')]),_0x3df2a6);if(_0x51fbc8[_0x3b53('0x4e')][_0x3b53('0x56')]){_0x473aff[_0x3b53('0x57')]=_[_0x3b53('0x58')](_0x473aff[_0x3b53('0x57')],{'$or':_['map'](_0x3df2a6,function(_0x32f3b1){if(_0x32f3b1[_0x3b53('0x45')]!==_0x3b53('0x59')){var _0x36bd53={};_0x36bd53[_0x32f3b1[_0x3b53('0x30')]]={'$like':'%'+_0x51fbc8[_0x3b53('0x4e')][_0x3b53('0x56')]+'%'};return _0x36bd53;}})});}_0x473aff=_[_0x3b53('0x58')]({},_0x473aff,_0x51fbc8[_0x3b53('0x5a')]);var _0x5ded0e={'where':_0x473aff['where']};return db[_0x3b53('0x49')][_0x3b53('0x28')](_0x5ded0e)[_0x3b53('0x17')](function(_0x587147){_0x200d62[_0x3b53('0x28')]=_0x587147;if(_0x51fbc8[_0x3b53('0x4e')][_0x3b53('0x5b')]){_0x473aff[_0x3b53('0x5c')]=[{'all':!![]}];}return db[_0x3b53('0x49')][_0x3b53('0x5d')](_0x473aff);})['then'](function(_0x7f27ba){_0x200d62[_0x3b53('0x5e')]=_0x7f27ba;return _0x200d62;})[_0x3b53('0x17')](respondWithFilteredResult(_0x53c6fb,_0x473aff))['catch'](handleError(_0x53c6fb,null));};exports[_0x3b53('0x5f')]=function(_0x315ac4,_0x5a0765){var _0x4c7cb9={'raw':![],'where':{'id':_0x315ac4[_0x3b53('0x60')]['id']},'include':[{'model':db[_0x3b53('0x47')],'as':_0x3b53('0x48')}]},_0x17fdc4={};_0x17fdc4[_0x3b53('0x41')]=_[_0x3b53('0x4d')](db['ChatWebsite'][_0x3b53('0x61')]);_0x17fdc4[_0x3b53('0x4e')]=_['keys'](_0x315ac4[_0x3b53('0x4e')]);_0x17fdc4[_0x3b53('0x4f')]=_['intersection'](_0x17fdc4[_0x3b53('0x41')],_0x17fdc4[_0x3b53('0x4e')]);_0x4c7cb9[_0x3b53('0x50')]=_['intersection'](_0x17fdc4[_0x3b53('0x41')],qs[_0x3b53('0x52')](_0x315ac4[_0x3b53('0x4e')][_0x3b53('0x52')]));_0x4c7cb9[_0x3b53('0x50')]=_0x4c7cb9['attributes'][_0x3b53('0x62')]?_0x4c7cb9[_0x3b53('0x50')]:_0x17fdc4[_0x3b53('0x41')];if(_0x315ac4[_0x3b53('0x4e')][_0x3b53('0x5b')]){_0x4c7cb9[_0x3b53('0x5c')]=[{'all':!![]}];}_0x4c7cb9=_['merge']({},_0x4c7cb9,_0x315ac4[_0x3b53('0x5a')]);return db['ChatWebsite'][_0x3b53('0x63')](_0x4c7cb9)['then'](handleEntityNotFound(_0x5a0765,null))[_0x3b53('0x17')](respondWithResult(_0x5a0765,null))[_0x3b53('0x21')](handleError(_0x5a0765,null));};exports[_0x3b53('0x64')]=function(_0x2d214f,_0x1ff9ed){var _0x3b42c4=null;_0x2d214f[_0x3b53('0x65')][_0x3b53('0x66')][_0x3b53('0x38')](',')[_0x3b53('0x67')](_0xad01b9=>{if(_0xad01b9[_0x3b53('0x68')]()!==''&&!wildcardUtils[_0x3b53('0x69')](_0xad01b9[_0x3b53('0x68')]())){_0x3b42c4=new APIBadRequestError('\x22'+_0xad01b9[_0x3b53('0x68')]()+_0x3b53('0x6a'));}});if(_0x3b42c4){return handleError(_0x1ff9ed,null)(_0x3b42c4);}return db[_0x3b53('0x49')][_0x3b53('0x64')](_0x2d214f[_0x3b53('0x65')],{})[_0x3b53('0x17')](function(_0x3bd0df){var _0x1da275=_0x2d214f[_0x3b53('0x6b')][_0x3b53('0x2c')]({'plain':!![]});if(!_0x1da275)throw new Error(_0x3b53('0x6c'));if(_0x1da275['role']===_0x3b53('0x6b')){var _0x1fe458=_0x3bd0df['get']({'plain':!![]});var _0x202952=_0x3b53('0x2d');return db[_0x3b53('0x6d')]['find']({'where':{'name':_0x202952,'userProfileId':_0x1da275['userProfileId']},'raw':!![]})[_0x3b53('0x17')](function(_0x481f0c){if(_0x481f0c&&_0x481f0c[_0x3b53('0x6e')]===0x0){return db['UserProfileResource'][_0x3b53('0x64')]({'name':_0x1fe458[_0x3b53('0x30')],'resourceId':_0x1fe458['id'],'type':_0x481f0c[_0x3b53('0x30')],'sectionId':_0x481f0c['id']},{})[_0x3b53('0x17')](function(){return _0x3bd0df;});}else{return _0x3bd0df;}})[_0x3b53('0x21')](function(_0x1a3827){logger[_0x3b53('0x1c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1a3827);throw _0x1a3827;});}return _0x3bd0df;})[_0x3b53('0x17')](respondWithResult(_0x1ff9ed,0xc9))[_0x3b53('0x21')](handleError(_0x1ff9ed,null));};exports[_0x3b53('0x6f')]=function(_0x79de0c,_0x4e86b8){var _0x39ff51=null;_0x79de0c['body'][_0x3b53('0x66')]['split'](',')[_0x3b53('0x67')](_0xe12475=>{if(_0xe12475[_0x3b53('0x68')]()!==''&&!wildcardUtils[_0x3b53('0x69')](_0xe12475[_0x3b53('0x68')]())){_0x39ff51=new APIBadRequestError('\x22'+_0xe12475[_0x3b53('0x68')]()+_0x3b53('0x6a'));}});if(_0x39ff51){return handleError(_0x4e86b8,null)(_0x39ff51);}if(_0x79de0c['body']['id']){delete _0x79de0c['body']['id'];}return db[_0x3b53('0x49')][_0x3b53('0x63')]({'where':{'id':_0x79de0c[_0x3b53('0x60')]['id']},'include':[{'model':db[_0x3b53('0x47')],'as':_0x3b53('0x48')}]})[_0x3b53('0x17')](handleEntityNotFound(_0x4e86b8,null))['then'](saveUpdates(_0x79de0c['body'],null))[_0x3b53('0x17')](respondWithResult(_0x4e86b8,null))[_0x3b53('0x21')](handleError(_0x4e86b8,null));};exports[_0x3b53('0x2b')]=function(_0x5778b7,_0x495baa){return db[_0x3b53('0x49')][_0x3b53('0x63')]({'where':{'id':_0x5778b7['params']['id']}})['then'](handleEntityNotFound(_0x495baa,null))[_0x3b53('0x17')](removeEntity(_0x495baa,null))[_0x3b53('0x21')](handleError(_0x495baa,null));};exports[_0x3b53('0x70')]=function(_0x475890,_0x4ed83b){return db[_0x3b53('0x49')]['describe']()[_0x3b53('0x17')](respondWithResult(_0x4ed83b,null))[_0x3b53('0x21')](handleError(_0x4ed83b,null));};exports[_0x3b53('0x71')]=function(_0x281b46,_0x94e1f8){if(_0x281b46['body']['id']){delete _0x281b46[_0x3b53('0x65')]['id'];}return db[_0x3b53('0x49')][_0x3b53('0x63')]({'where':{'id':_0x281b46['params']['id']}})['then'](handleEntityNotFound(_0x94e1f8,null))[_0x3b53('0x17')](function(_0x54dca3){if(_0x54dca3){_0x281b46[_0x3b53('0x65')][_0x3b53('0x72')]=_0x54dca3['id'];return db['Disposition']['create'](_0x281b46['body']);}})[_0x3b53('0x17')](respondWithResult(_0x94e1f8,null))[_0x3b53('0x21')](handleError(_0x94e1f8,null));};exports[_0x3b53('0x73')]=function(_0xe372ab,_0x3363a2){var _0x58c443={'raw':![],'where':{}};var _0x12a1fa={};var _0x3d459d={'count':0x0,'rows':[]};return db[_0x3b53('0x49')]['findOne']({'where':{'id':_0xe372ab['params']['id']}})[_0x3b53('0x17')](handleEntityNotFound(_0x3363a2,null))[_0x3b53('0x17')](function(_0x1d8b13){if(_0x1d8b13){_0x12a1fa['model']=_[_0x3b53('0x4d')](db['Disposition'][_0x3b53('0x61')]);_0x12a1fa[_0x3b53('0x4e')]=_[_0x3b53('0x4d')](_0xe372ab[_0x3b53('0x4e')]);_0x12a1fa[_0x3b53('0x4f')]=_[_0x3b53('0x51')](_0x12a1fa[_0x3b53('0x41')],_0x12a1fa[_0x3b53('0x4e')]);_0x58c443[_0x3b53('0x50')]=_[_0x3b53('0x51')](_0x12a1fa[_0x3b53('0x41')],qs[_0x3b53('0x52')](_0xe372ab[_0x3b53('0x4e')][_0x3b53('0x52')]));_0x58c443[_0x3b53('0x50')]=_0x58c443['attributes'][_0x3b53('0x62')]?_0x58c443[_0x3b53('0x50')]:_0x12a1fa['model'];if(!_0xe372ab[_0x3b53('0x4e')][_0x3b53('0x74')](_0x3b53('0x75'))){_0x58c443['limit']=qs[_0x3b53('0x26')](_0xe372ab[_0x3b53('0x4e')][_0x3b53('0x26')]);_0x58c443[_0x3b53('0x25')]=qs[_0x3b53('0x25')](_0xe372ab[_0x3b53('0x4e')][_0x3b53('0x25')]);}_0x58c443[_0x3b53('0x53')]=qs[_0x3b53('0x54')](_0xe372ab[_0x3b53('0x4e')][_0x3b53('0x54')]);_0x58c443['where']=qs[_0x3b53('0x4f')](_[_0x3b53('0x55')](_0xe372ab[_0x3b53('0x4e')],_0x12a1fa['filters']));_0x58c443[_0x3b53('0x57')][_0x3b53('0x72')]=_0x1d8b13['id'];if(_0xe372ab[_0x3b53('0x4e')][_0x3b53('0x56')]){_0x58c443['where']=_[_0x3b53('0x58')](_0x58c443[_0x3b53('0x57')],{'$or':_[_0x3b53('0x4c')](_0x58c443['attributes'],function(_0x26e72d){var _0x79eddd={};_0x79eddd[_0x26e72d]={'$like':'%'+_0xe372ab['query']['filter']+'%'};return _0x79eddd;})});}_0x58c443=_[_0x3b53('0x58')]({},_0x58c443,_0xe372ab[_0x3b53('0x5a')]);return db[_0x3b53('0x76')]['count']({'where':_0x58c443[_0x3b53('0x57')]})[_0x3b53('0x17')](function(_0x37e2c6){_0x3d459d[_0x3b53('0x28')]=_0x37e2c6;if(_0xe372ab[_0x3b53('0x4e')]['includeAll']){_0x58c443['include']=[{'all':!![]}];}return db[_0x3b53('0x76')]['findAll'](_0x58c443);})[_0x3b53('0x17')](function(_0x3975fe){_0x3d459d[_0x3b53('0x5e')]=_0x3975fe;return _0x3d459d;});}})[_0x3b53('0x17')](respondWithFilteredResult(_0x3363a2,_0x58c443))[_0x3b53('0x21')](handleError(_0x3363a2,null));};exports['removeDispositions']=function(_0x2ac5eb,_0x497778){return db['ChatWebsite'][_0x3b53('0x63')]({'where':{'id':_0x2ac5eb[_0x3b53('0x60')]['id']}})[_0x3b53('0x17')](handleEntityNotFound(_0x497778,null))['then'](function(_0x5d5009){if(_0x5d5009){return _0x5d5009[_0x3b53('0x77')](_0x2ac5eb[_0x3b53('0x4e')][_0x3b53('0x78')]);}})[_0x3b53('0x17')](respondWithStatusCode(_0x497778,null))[_0x3b53('0x21')](handleError(_0x497778,null));};exports[_0x3b53('0x79')]=function(_0x4c15a9,_0x244e23){if(_0x4c15a9[_0x3b53('0x65')]['id']){delete _0x4c15a9[_0x3b53('0x65')]['id'];}return db[_0x3b53('0x49')][_0x3b53('0x63')]({'where':{'id':_0x4c15a9[_0x3b53('0x60')]['id']}})[_0x3b53('0x17')](handleEntityNotFound(_0x244e23,null))['then'](function(_0x309b62){if(_0x309b62){_0x4c15a9[_0x3b53('0x65')]['ChatWebsiteId']=_0x309b62['id'];return db[_0x3b53('0x7a')][_0x3b53('0x64')](_0x4c15a9[_0x3b53('0x65')]);}})[_0x3b53('0x17')](respondWithResult(_0x244e23,null))[_0x3b53('0x21')](handleError(_0x244e23,null));};exports['getAnswers']=function(_0x44508d,_0x38691c){var _0x528315={'raw':![],'where':{}};var _0x3799a1={};var _0x5cd725={'count':0x0,'rows':[]};return db[_0x3b53('0x49')][_0x3b53('0x7b')]({'where':{'id':_0x44508d[_0x3b53('0x60')]['id']}})[_0x3b53('0x17')](handleEntityNotFound(_0x38691c,null))[_0x3b53('0x17')](function(_0x1a7b99){if(_0x1a7b99){_0x3799a1['model']=_[_0x3b53('0x4d')](db['CannedAnswer'][_0x3b53('0x61')]);_0x3799a1['query']=_[_0x3b53('0x4d')](_0x44508d[_0x3b53('0x4e')]);_0x3799a1[_0x3b53('0x4f')]=_[_0x3b53('0x51')](_0x3799a1[_0x3b53('0x41')],_0x3799a1[_0x3b53('0x4e')]);_0x528315[_0x3b53('0x50')]=_['intersection'](_0x3799a1['model'],qs[_0x3b53('0x52')](_0x44508d[_0x3b53('0x4e')]['fields']));_0x528315[_0x3b53('0x50')]=_0x528315['attributes']['length']?_0x528315['attributes']:_0x3799a1['model'];if(!_0x44508d[_0x3b53('0x4e')][_0x3b53('0x74')](_0x3b53('0x75'))){_0x528315[_0x3b53('0x26')]=qs[_0x3b53('0x26')](_0x44508d['query'][_0x3b53('0x26')]);_0x528315[_0x3b53('0x25')]=qs['offset'](_0x44508d[_0x3b53('0x4e')][_0x3b53('0x25')]);}_0x528315[_0x3b53('0x53')]=qs[_0x3b53('0x54')](_0x44508d['query'][_0x3b53('0x54')]);_0x528315[_0x3b53('0x57')]=qs[_0x3b53('0x4f')](_[_0x3b53('0x55')](_0x44508d[_0x3b53('0x4e')],_0x3799a1['filters']));_0x528315[_0x3b53('0x57')]['ChatWebsiteId']=_0x1a7b99['id'];if(_0x44508d[_0x3b53('0x4e')][_0x3b53('0x56')]){_0x528315[_0x3b53('0x57')]=_['merge'](_0x528315['where'],{'$or':_[_0x3b53('0x4c')](_0x528315[_0x3b53('0x50')],function(_0x20b582){var _0x2655a0={};_0x2655a0[_0x20b582]={'$like':'%'+_0x44508d[_0x3b53('0x4e')][_0x3b53('0x56')]+'%'};return _0x2655a0;})});}_0x528315=_[_0x3b53('0x58')]({},_0x528315,_0x44508d[_0x3b53('0x5a')]);return db[_0x3b53('0x7a')][_0x3b53('0x28')]({'where':_0x528315[_0x3b53('0x57')]})[_0x3b53('0x17')](function(_0x2152b5){_0x5cd725[_0x3b53('0x28')]=_0x2152b5;if(_0x44508d['query'][_0x3b53('0x5b')]){_0x528315[_0x3b53('0x5c')]=[{'all':!![]}];}return db[_0x3b53('0x7a')]['findAll'](_0x528315);})['then'](function(_0x1baefe){_0x5cd725[_0x3b53('0x5e')]=_0x1baefe;return _0x5cd725;});}})[_0x3b53('0x17')](respondWithFilteredResult(_0x38691c,_0x528315))['catch'](handleError(_0x38691c,null));};exports[_0x3b53('0x7c')]=function(_0x1388fe,_0x496a9c){return db['ChatWebsite'][_0x3b53('0x63')]({'where':{'id':_0x1388fe[_0x3b53('0x60')]['id']}})[_0x3b53('0x17')](handleEntityNotFound(_0x496a9c,null))[_0x3b53('0x17')](function(_0x30e53d){if(_0x30e53d){return _0x30e53d[_0x3b53('0x7c')](_0x1388fe['query']['ids']);}})['then'](respondWithStatusCode(_0x496a9c,null))[_0x3b53('0x21')](handleError(_0x496a9c,null));};exports['addLogo']=function(_0x2140b9,_0x56c412){_0x2140b9[_0x3b53('0x65')][_0x3b53('0x7d')]=_0x2140b9[_0x3b53('0x7e')][_0x3b53('0x7f')];return db['ChatWebsite'][_0x3b53('0x63')]({'where':{'id':_0x2140b9[_0x3b53('0x60')]['id']}})[_0x3b53('0x17')](handleEntityNotFound(_0x56c412,null))[_0x3b53('0x17')](saveUpdates(_0x2140b9['body'],null))[_0x3b53('0x17')](respondWithResult(_0x56c412,null))[_0x3b53('0x21')](handleError(_0x56c412,null));};exports[_0x3b53('0x80')]=function(_0x558c34,_0x31dbd8){_0x558c34[_0x3b53('0x65')]['agentAvatar']=_0x558c34[_0x3b53('0x7e')][_0x3b53('0x7f')];return db['ChatWebsite'][_0x3b53('0x63')]({'where':{'id':_0x558c34['params']['id']}})[_0x3b53('0x17')](handleEntityNotFound(_0x31dbd8,null))[_0x3b53('0x17')](saveUpdates(_0x558c34[_0x3b53('0x65')],null))[_0x3b53('0x17')](respondWithResult(_0x31dbd8,null))['catch'](handleError(_0x31dbd8,null));};exports[_0x3b53('0x81')]=function(_0x618329,_0x20da54){_0x618329['body'][_0x3b53('0x82')]=_0x618329[_0x3b53('0x7e')][_0x3b53('0x7f')];return db[_0x3b53('0x49')]['find']({'where':{'id':_0x618329[_0x3b53('0x60')]['id']}})[_0x3b53('0x17')](handleEntityNotFound(_0x20da54,null))['then'](saveUpdates(_0x618329[_0x3b53('0x65')],null))[_0x3b53('0x17')](respondWithResult(_0x20da54,null))['catch'](handleError(_0x20da54,null));};exports[_0x3b53('0x83')]=function(_0x33d735,_0x12f1a7){_0x33d735[_0x3b53('0x65')][_0x3b53('0x84')]=_0x33d735[_0x3b53('0x7e')][_0x3b53('0x7f')];return db[_0x3b53('0x49')]['find']({'where':{'id':_0x33d735[_0x3b53('0x60')]['id']}})[_0x3b53('0x17')](handleEntityNotFound(_0x12f1a7,null))[_0x3b53('0x17')](saveUpdates(_0x33d735['body'],null))[_0x3b53('0x17')](respondWithResult(_0x12f1a7,null))[_0x3b53('0x21')](handleError(_0x12f1a7,null));};exports[_0x3b53('0x85')]=function(_0x1a50b7,_0x313dd8){var _0x3cca48=path[_0x3b53('0x86')](config['root'],_0x3b53('0x87'));var _0x1d916f={'where':{'id':_0x1a50b7['params']['id']},'attributes':['id',_0x3b53('0x7d')],'raw':!![]};var _0x8a923d=![];return require('../../config/license/util')[_0x3b53('0x88')]()['then'](function(_0x41d819){if(_0x41d819){_0x8a923d=_0x41d819[_0x3b53('0x89')];}})[_0x3b53('0x17')](function(){return db[_0x3b53('0x49')][_0x3b53('0x63')](_0x1d916f);})[_0x3b53('0x17')](handleEntityNotFound(_0x313dd8,null))[_0x3b53('0x17')](function(_0x5c1839){if(_0x5c1839){if(!_[_0x3b53('0x8a')](_0x5c1839['sitepic'])){if(fs[_0x3b53('0x8b')](path[_0x3b53('0x86')](config[_0x3b53('0x8c')],'server/files/images/logos/',_0x5c1839[_0x3b53('0x7d')]))&&_0x8a923d){_0x3cca48=path[_0x3b53('0x86')](config['root'],_0x3b53('0x8d'),_0x5c1839[_0x3b53('0x7d')]);}}return _0x313dd8['download'](_0x3cca48);}})['catch'](handleError(_0x313dd8,null));};exports[_0x3b53('0x8e')]=function(_0x30bdfe,_0xd1090c){var _0x1ee4ee=path[_0x3b53('0x86')](config[_0x3b53('0x8c')],_0x3b53('0x8f'));var _0x106585={'where':{'id':_0x30bdfe[_0x3b53('0x60')]['id']},'attributes':['id',_0x3b53('0x90')],'raw':!![]};return db[_0x3b53('0x49')][_0x3b53('0x63')](_0x106585)[_0x3b53('0x17')](handleEntityNotFound(_0xd1090c,null))[_0x3b53('0x17')](function(_0x4e0853){if(_0x4e0853){if(!_[_0x3b53('0x8a')](_0x4e0853['agentAvatar'])){if(fs[_0x3b53('0x8b')](path[_0x3b53('0x86')](config[_0x3b53('0x8c')],_0x3b53('0x91'),_0x4e0853[_0x3b53('0x90')]))){_0x1ee4ee=path[_0x3b53('0x86')](config['root'],_0x3b53('0x91'),_0x4e0853[_0x3b53('0x90')]);}}return _0xd1090c['download'](_0x1ee4ee);}})[_0x3b53('0x21')](handleError(_0xd1090c,null));};exports[_0x3b53('0x92')]=function(_0x4bb0e5,_0x39bbcd){var _0x33c50b=path[_0x3b53('0x86')](config[_0x3b53('0x8c')],_0x3b53('0x93'));var _0x37b911={'where':{'id':_0x4bb0e5[_0x3b53('0x60')]['id']},'attributes':['id',_0x3b53('0x82'),_0x3b53('0x94')],'raw':!![]};return db[_0x3b53('0x49')][_0x3b53('0x63')](_0x37b911)['then'](handleEntityNotFound(_0x39bbcd,null))[_0x3b53('0x17')](function(_0x147072){if(_0x147072){if(!_[_0x3b53('0x8a')](_0x147072[_0x3b53('0x82')])){if(fs[_0x3b53('0x8b')](path[_0x3b53('0x86')](config[_0x3b53('0x8c')],_0x3b53('0x91'),_0x147072[_0x3b53('0x82')]))&&_0x147072[_0x3b53('0x94')]){_0x33c50b=path[_0x3b53('0x86')](config[_0x3b53('0x8c')],_0x3b53('0x91'),_0x147072[_0x3b53('0x82')]);}}return _0x39bbcd[_0x3b53('0x95')](_0x33c50b);}})[_0x3b53('0x21')](handleError(_0x39bbcd,null));};exports[_0x3b53('0x96')]=function(_0x39a03a,_0x455db8){var _0x10b681=path[_0x3b53('0x86')](config[_0x3b53('0x8c')],_0x3b53('0x97'));var _0x459758={'where':{'id':_0x39a03a[_0x3b53('0x60')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x3b53('0x49')][_0x3b53('0x63')](_0x459758)[_0x3b53('0x17')](handleEntityNotFound(_0x455db8,null))[_0x3b53('0x17')](function(_0x3445a6){if(_0x3445a6){if(!_[_0x3b53('0x8a')](_0x3445a6[_0x3b53('0x84')])){if(fs[_0x3b53('0x8b')](path[_0x3b53('0x86')](config[_0x3b53('0x8c')],_0x3b53('0x91'),_0x3445a6['systemAvatar']))){_0x10b681=path[_0x3b53('0x86')](config[_0x3b53('0x8c')],_0x3b53('0x91'),_0x3445a6[_0x3b53('0x84')]);}}return _0x455db8['download'](_0x10b681);}})['catch'](handleError(_0x455db8,null));};function checkWebsiteInterval(_0x952b54){var _0x10939f=_0x952b54['Interval'];if(!_0x10939f){return Promise[_0x3b53('0x98')](_0x952b54);}var _0x5e53a2=_0x952b54['timezone']||undefined;return _0x10939f[_0x3b53('0x99')](_0x5e53a2)[_0x3b53('0x17')](function(_0x616dd3){if(!_0x616dd3){throw new APIOutOfIntervalError();}return _0x952b54;});}exports[_0x3b53('0x9a')]=function(_0x55710d,_0x39385b){var _0x3f07e2={'body':_0x55710d[_0x3b53('0x65')],'channel':_0x3b53('0x9b')};var _0x24e3b9=[];var _0x282bde=[];var _0x1e4b02={};var _0x3750fd=![];if(_0x55710d[_0x3b53('0x65')]['id']){delete _0x55710d[_0x3b53('0x65')]['id'];}if(_[_0x3b53('0x8a')](_0x55710d['body']['from'])){throw new APIBadRequestError(_0x3b53('0x9c'));}if(_['isNil'](_0x55710d[_0x3b53('0x65')]['mapKey'])){throw new APIBadRequestError('MapKey\x20is\x20mandatory');}if(_[_0x3b53('0x9d')](_0x55710d[_0x3b53('0x65')][_0x3b53('0x65')])){throw new APIBadRequestError(_0x3b53('0x9e'));}var _0x17ba64=_0x55710d[_0x3b53('0x65')][_0x3b53('0x9f')]&&_0x55710d[_0x3b53('0x65')][_0x3b53('0x3c')];return db[_0x3b53('0xa0')][_0x3b53('0x70')]()[_0x3b53('0x17')](function(_0x27b443){if(!_0x27b443){throw new Error(_0x3b53('0xa1'));}_0x24e3b9=Object['keys'](_0x27b443)[_0x3b53('0x56')](function(_0x24dcb3){return![_0x3b53('0xa2'),_0x3b53('0xa3')]['includes'](_0x24dcb3);});_0x282bde=Object[_0x3b53('0x4d')](_0x27b443)[_0x3b53('0x56')](function(_0x38da91){return![_0x3b53('0xa2'),_0x3b53('0xa3'),_0x3b53('0xa4'),_0x3b53('0xa5')][_0x3b53('0xa6')](_0x38da91);});if(!_[_0x3b53('0xa6')](_0x282bde,_0x55710d['body']['mapKey'])){throw new APIBadRequestError('Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20'+_0x282bde[_0x3b53('0x86')](',\x20'));}_0x1e4b02[_0x55710d['body'][_0x3b53('0xa7')]]=_0x55710d[_0x3b53('0x65')]['from'];})['then'](function(){return db[_0x3b53('0x49')]['find']({'where':{'id':_0x55710d[_0x3b53('0x60')]['id']},'include':[{'model':db[_0x3b53('0xa8')],'as':_0x3b53('0xa9'),'include':[{'model':db[_0x3b53('0xa0')],'as':_0x3b53('0xaa'),'where':_0x1e4b02,'limit':0x1,'order':[[_0x3b53('0xa3'),_0x3b53('0xab')]]}]},{'model':db[_0x3b53('0xac')],'as':_0x3b53('0xad')},{'model':db['Interval'],'as':_0x3b53('0xae'),'include':[{'model':db[_0x3b53('0xae')],'as':_0x3b53('0xaf'),'attributes':['id',_0x3b53('0xb0')],'raw':!![]}]}]});})[_0x3b53('0x17')](function(_0x362f0c){if(!_0x362f0c){throw new APINotFoundError(util[_0x3b53('0x3f')](_0x3b53('0xb1'),_0x55710d[_0x3b53('0x60')]['id']));}if(_0x17ba64){return checkWebsiteInterval(_0x362f0c);}return _0x362f0c;})[_0x3b53('0x17')](function(_0x57cf2b){_0x3f07e2[_0x3b53('0xb2')]=_0x57cf2b;_0x3f07e2[_0x3b53('0xb3')]=_[_0x3b53('0xb4')](_0x57cf2b[_0x3b53('0xad')],[_0x3b53('0xb5')],[_0x3b53('0xb6')]);if(_0x3f07e2[_0x3b53('0xb2')][_0x3b53('0xad')]){delete _0x3f07e2[_0x3b53('0xb2')][_0x3b53('0xad')];}_0x3f07e2[_0x3b53('0xb7')]=_0x57cf2b[_0x3b53('0xa9')]||{'id':_0x57cf2b[_0x3b53('0xa5')]};if(_0x3f07e2[_0x3b53('0xb7')]&&_0x3f07e2['list'][_0x3b53('0xaa')][_0x3b53('0x62')]){return _0x3f07e2[_0x3b53('0xb7')][_0x3b53('0xaa')][0x0];}var _0x59f971=_[_0x3b53('0xb8')](_0x55710d['body'],{'firstName':_0x55710d[_0x3b53('0x65')][_0x3b53('0xb9')],'ListId':_0x57cf2b[_0x3b53('0xa5')]});_0x59f971[_0x55710d[_0x3b53('0x65')][_0x3b53('0xa7')]]=_0x55710d[_0x3b53('0x65')]['from'];return db[_0x3b53('0xa0')]['create'](_0x59f971,{'fields':_0x24e3b9,'raw':!![]});})[_0x3b53('0x17')](function(_0x32cff0){_0x3f07e2[_0x3b53('0xba')]=_0x32cff0;var _0x45335e=createInteractionObject(_0x55710d[_0x3b53('0x60')]['id'],_0x55710d[_0x3b53('0x65')],_0x55710d['headers'],_0x32cff0);var _0x302709={'ChatWebsiteId':_0x55710d[_0x3b53('0x60')]['id']};if(_0x55710d[_0x3b53('0x65')][_0x3b53('0xbb')]){_0x302709[_0x3b53('0xbb')]=_0x55710d[_0x3b53('0x65')][_0x3b53('0xbb')];_0x302709[_0x3b53('0xbc')]=![];return db[_0x3b53('0xbd')][_0x3b53('0x63')]({'where':_0x302709})[_0x3b53('0x17')](function(_0x19b8ea){var _0x19b5e4=_0x55710d[_0x3b53('0x65')][_0x3b53('0x9f')]&&_0x55710d[_0x3b53('0x65')][_0x3b53('0x3c')];if(_0x19b8ea){_0x3750fd=!![];return _0x19b8ea;}else if(!_0x19b5e4&&_0x19b8ea&&_0x19b8ea[_0x3b53('0xbc')]){throw new APIConflictError(_0x3b53('0xbe'));}_0x45335e['threadId']=_0x55710d[_0x3b53('0x65')][_0x3b53('0xbb')];_0x45335e[_0x3b53('0xbf')]=_0x55710d['body'][_0x3b53('0xbf')];return db[_0x3b53('0xbd')]['create'](_0x45335e);});}_0x302709[_0x3b53('0xc0')]=_0x32cff0['id'];if(_0x55710d[_0x3b53('0x65')][_0x3b53('0xc1')]&&_0x55710d[_0x3b53('0x65')][_0x3b53('0xc1')]['id']){_0x302709['id']=_0x55710d['body']['interaction']['id'];return db[_0x3b53('0xbd')][_0x3b53('0x63')]({'where':_0x302709})[_0x3b53('0x17')](function(_0x59fbe3){var _0x2b2064=_0x55710d[_0x3b53('0x65')][_0x3b53('0x9f')]&&_0x55710d[_0x3b53('0x65')]['referer'];if(!_0x2b2064&&_0x59fbe3&&_0x59fbe3['closed']){throw new APIConflictError('Writing\x20on\x20closed\x20interaction');}else if(_0x59fbe3){_0x3750fd=!![];return _0x59fbe3;}else{return db[_0x3b53('0xbd')][_0x3b53('0x64')](_0x45335e);}});}return db[_0x3b53('0xbd')][_0x3b53('0x64')](_0x45335e);})['then'](function(_0x10df6b){if(!_0x3750fd){return _0x10df6b;}var _0x2f572a={'from':(_0x3f07e2[_0x3b53('0xba')][_0x3b53('0x39')]||'')+'\x20'+(_0x3f07e2['contact']['lastName']||'')};if(_0x55710d[_0x3b53('0x65')][_0x3b53('0xbb')]&&_0x55710d[_0x3b53('0x65')]['messageId']&&_0x55710d[_0x3b53('0x65')][_0x3b53('0xbb')]!=_0x55710d[_0x3b53('0x65')][_0x3b53('0xc2')]){_0x2f572a[_0x3b53('0xbb')]=_0x55710d[_0x3b53('0x65')][_0x3b53('0xc2')];}return _0x10df6b[_0x3b53('0x6f')](_0x2f572a);})[_0x3b53('0x17')](function(_0x13b314){_0x3f07e2['interaction']=_0x13b314['get']({'plain':!![]});_0x3f07e2['interaction'][_0x3b53('0xc3')]=!_0x3750fd;if(_0x3f07e2[_0x3b53('0xc1')][_0x3b53('0xc3')]){if(_0x3f07e2[_0x3b53('0xb2')][_0x3b53('0xc4')]){_0x3f07e2[_0x3b53('0xb3')][_0x3b53('0xc5')]({'id':0x0,'priority':_0x3f07e2[_0x3b53('0xb3')][_0x3b53('0x62')]+0x1,'app':_0x3b53('0xc6'),'appdata':_0x3b53('0xc7'),'interval':_0x3b53('0xc8')});}}return db['ChatMessage'][_0x3b53('0x64')]({'body':_0x55710d[_0x3b53('0x65')]['body'],'ChatWebsiteId':_0x55710d[_0x3b53('0x60')]['id'],'ChatInteractionId':_0x13b314['id'],'direction':'in','ContactId':_0x3f07e2[_0x3b53('0xba')]['id'],'AttachmentId':_0x55710d[_0x3b53('0x65')][_0x3b53('0xc9')]});})[_0x3b53('0x17')](function(_0x4a571a){_0x3f07e2[_0x3b53('0x1e')]=_0x4a571a;if(!_0x3f07e2[_0x3b53('0xc1')]['UserId']){return;}return db[_0x3b53('0xca')][_0x3b53('0x63')]({'attributes':['id','name'],'where':{'id':_0x3f07e2[_0x3b53('0xc1')]['UserId']}});})[_0x3b53('0x17')](function(_0x1d0c31){if(_0x1d0c31){_0x3f07e2[_0x3b53('0xb3')][_0x3b53('0xcb')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1d0c31[_0x3b53('0x30')]+','+(_0x3f07e2['account'][_0x3b53('0xcc')]||0xa),'interval':_0x3b53('0xc8')});_0x3f07e2[_0x3b53('0xcd')]=!![];}if(!_0x3f07e2[_0x3b53('0xc1')][_0x3b53('0xce')]){return;}return db[_0x3b53('0xcf')][_0x3b53('0x63')]({'attributes':['id','name'],'where':{'id':_0x3f07e2['interaction'][_0x3b53('0xce')]}});})[_0x3b53('0x17')](function(_0x30c8e0){if(_0x30c8e0){_0x3f07e2[_0x3b53('0xb3')][_0x3b53('0xcb')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x30c8e0['name']+','+(_0x3f07e2[_0x3b53('0xb2')]['waitForTheAssignedQueue']||0x12c),'interval':_0x3b53('0xc8')});}return respondWithRpcPromise(_0x3b53('0xd0'),_0x3b53('0xd1'),_0x3f07e2);})[_0x3b53('0x17')](function(_0x269102){respondWithRpcPromise(_0x3b53('0xd2'),_0x3b53('0xd2'),{'event':_0x3b53('0x9a'),'message':_0x269102},client9002);return _0x269102;})[_0x3b53('0x17')](respondWithResult(_0x39385b,null))[_0x3b53('0x21')](APIHandleError(_0x39385b));};exports['offline']=function(_0x737b16,_0x15c1e4){var _0x981f85,_0xcbbe02,_0x1cd1c2;var _0x2756b7=[];var _0x13f367={};var _0x529f18=_0x737b16[_0x3b53('0xd3')]||[];var _0x542b71=[];var _0x59ecab;return db[_0x3b53('0xa0')]['describe']()[_0x3b53('0x17')](function(_0x4c3294){if(!_0x4c3294){throw new db[(_0x3b53('0xd4'))][(_0x3b53('0xd5'))](_0x3b53('0xd6'));}_0x2756b7=_[_0x3b53('0xd7')](_[_0x3b53('0x4d')](_0x4c3294),[_0x3b53('0xa2'),_0x3b53('0xa3'),_0x3b53('0xa4'),_0x3b53('0xa5')]);if(_0x737b16[_0x3b53('0x65')]['id']){delete _0x737b16[_0x3b53('0x65')]['id'];}if(_[_0x3b53('0x8a')](_0x737b16[_0x3b53('0x65')][_0x3b53('0xb9')])){throw _0x15c1e4[_0x3b53('0x24')](0x1f4)[_0x3b53('0x31')](new db['Sequelize'][(_0x3b53('0xd5'))](_0x3b53('0xd8')));}if(_[_0x3b53('0x8a')](_0x737b16[_0x3b53('0x65')][_0x3b53('0x65')])||_0x737b16[_0x3b53('0x65')][_0x3b53('0x65')]===''){throw _0x15c1e4[_0x3b53('0x24')](0x1f4)[_0x3b53('0x31')](new db[(_0x3b53('0xd4'))][(_0x3b53('0xd5'))](_0x3b53('0xd9')));}if(_['isNil'](_0x737b16[_0x3b53('0x65')][_0x3b53('0xda')])){throw _0x15c1e4[_0x3b53('0x24')](0x1f4)[_0x3b53('0x31')](new db['Sequelize'][(_0x3b53('0xd5'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2756b7));}if(!_[_0x3b53('0xa6')](_0x2756b7,_0x737b16[_0x3b53('0x65')][_0x3b53('0xda')])){throw _0x15c1e4[_0x3b53('0x24')](0x1f4)['send'](new db[(_0x3b53('0xd4'))]['ValidationError'](_0x3b53('0xdb')+_0x2756b7));}_0x13f367[_0x737b16[_0x3b53('0x65')][_0x3b53('0xda')]]=_0x737b16[_0x3b53('0x65')][_0x3b53('0xb9')];})[_0x3b53('0x17')](function(){return db['ChatWebsite'][_0x3b53('0x63')]({'where':{'id':_0x737b16[_0x3b53('0x60')]['id']},'include':[{'model':db[_0x3b53('0xa8')],'as':_0x3b53('0xa9')},{'model':db['MailAccount'],'as':_0x3b53('0xdc')}]});})[_0x3b53('0x17')](handleEntityNotFound(_0x15c1e4,null))['then'](function(_0x41351b){if(_0x41351b&&_0x41351b[_0x3b53('0xa9')]){_0xcbbe02=_0x41351b;var _0x88b6fb=_['defaults'](_0x737b16[_0x3b53('0x65')],{'firstName':_0x737b16[_0x3b53('0x65')][_0x3b53('0xb9')],'phone':_0x737b16[_0x3b53('0x65')][_0x3b53('0xb9')],'ListId':_0x41351b['ListId']});_0x88b6fb[_0x737b16[_0x3b53('0x65')][_0x3b53('0xda')]]=_0x737b16[_0x3b53('0x65')][_0x3b53('0xb9')];return db[_0x3b53('0xa0')][_0x3b53('0xdd')]({'where':_0x13f367,'defaults':_0x88b6fb});}})[_0x3b53('0xde')](function(_0x204ade){if(_0x204ade){_0x1cd1c2=_0x204ade;var _0x53d1d5=fs[_0x3b53('0xdf')](path[_0x3b53('0x86')](config[_0x3b53('0x8c')],_0x3b53('0xe0')),_0x3b53('0xe1'));var _0x43e9d4=ejs[_0x3b53('0xe2')](_0x53d1d5,{'body':_[_0x3b53('0xe3')](_0x737b16[_0x3b53('0x65')][_0x3b53('0x65')]),'bodyTitle':_0xcbbe02['offlineMessageBody']});return db[_0x3b53('0xe4')]['create']({'body':_0x43e9d4,'plainBody':htmlToText[_0x3b53('0xe5')](_0x43e9d4),'ContactId':_0x204ade['id'],'ChatWebsiteId':_0xcbbe02['id']});}})[_0x3b53('0x17')](function(_0x34add5){_0x59ecab=_0x34add5;if(_0x529f18['length']){var _0x13ad9e=_0x529f18[_0x3b53('0x4c')](function(_0x56a128){return{'name':_0x56a128[_0x3b53('0xe6')],'basename':_0x56a128[_0x3b53('0x7f')],'type':_0x56a128[_0x3b53('0xe7')],'ChatOfflineMessageId':_0x34add5['id']};});_0x542b71=_0x13ad9e['map'](_0x55dd9d=>{var _0x431fdf={'filename':_0x55dd9d[_0x3b53('0x30')],'path':path[_0x3b53('0x86')](config[_0x3b53('0x8c')],_0x3b53('0xe8'),'files',_0x3b53('0xe9'),_0x3b53('0xea'),_0x55dd9d['basename'])};return _0x431fdf;});if(!_0xcbbe02[_0x3b53('0xeb')]){return db[_0x3b53('0xec')][_0x3b53('0xed')](function(_0x2302df){return db['Attachment'][_0x3b53('0xee')](_0x13ad9e,{'transaction':_0x2302df});});}}})['then'](function(){if(_0x59ecab){_0x981f85=_0x59ecab;return db[_0x3b53('0xdc')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x3b53('0xef')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x3b53('0xf0')],'as':_0x3b53('0xf0'),'raw':!![]}]}]});}})[_0x3b53('0x17')](function(_0xc5f8a3){if(_0xc5f8a3&&_0xc5f8a3['Smtp']&&_0xcbbe02[_0x3b53('0xf1')]&&_0xcbbe02[_0x3b53('0xf2')]){var _0x13caf9=_0xc5f8a3['getSmtpOptions']();return respondWithRpcPromise('SendMail',_0x3b53('0xf3'),{'account':_0x13caf9,'message':{'from':util[_0x3b53('0x3f')]('\x22%s\x22\x20<%s>',_0xc5f8a3['name'],_0xc5f8a3['email']||_0xc5f8a3[_0x3b53('0xf4')]['user']),'to':_0xcbbe02[_0x3b53('0xf2')],'subject':_0xcbbe02[_0x3b53('0xf5')],'html':_0x981f85[_0x3b53('0x65')],'attachments':_0x542b71}},client9003)[_0x3b53('0x17')](function(){return _0x981f85;})[_0x3b53('0x21')](function(_0x50091c){logger['error'](_0x50091c);});}})[_0x3b53('0x17')](function(){if(_0xcbbe02&&_0xcbbe02['openNewInteraction']&&_0xcbbe02[_0x3b53('0xf6')]){var _0x10e879=[];if(_0x529f18[_0x3b53('0x62')]){_0x10e879=_0x529f18[_0x3b53('0x4c')](function(_0x7ca889){return{'name':_0x7ca889['originalname'],'basename':_0x7ca889[_0x3b53('0x7f')],'type':_0x7ca889[_0x3b53('0xe7')],'ChatOfflineMessageId':_0x59ecab['id']};});}var _0x419ed0;if(!_[_0x3b53('0x8a')](_0xcbbe02[_0x3b53('0xf7')])){var _0x59c4dd=_['map'](_0x737b16[_0x3b53('0x65')],function(_0x35dadb){return _0x35dadb;});var _0x4dd073=_['toPairsIn'](_0x59c4dd)[0x0];var _0x4af39d=_['mapValues'](_0x4dd073,function(_0x4f53e1){return _0x4f53e1;});_0x419ed0=_0x4af39d[0x1][_0xcbbe02[_0x3b53('0xf7')]];}var _0x385608={'from':_0x1cd1c2['email'],'firstName':_0x1cd1c2[_0x3b53('0x39')],'lastName':_0x1cd1c2[_0x3b53('0x3a')],'mapKey':'email','message':{'from':_0x1cd1c2[_0x3b53('0xf8')],'to':_0xcbbe02[_0x3b53('0xdc')]['email'],'cc':'','subject':_[_0x3b53('0x8a')](_0x419ed0)?_0xcbbe02[_0x3b53('0xf5')]:_0x419ed0,'messageId':'','sentAt':new Date(),'attach':_0x10e879[_0x3b53('0x62')],'attachments':_0x10e879,'originChannel':'Chat','ChatWebsiteId':_0xcbbe02['id'],'ChatOfflineMessageId':_0x981f85['id'],'originTo':_0xcbbe02[_0x3b53('0xdc')][_0x3b53('0xf8')]},'body':_0x981f85[_0x3b53('0x65')]};var _0x161bd9={'account':{'id':_0xcbbe02['MailAccountId']},'body':_0x385608,'log':_0x3b53('0xf9')};return respondWithRpcPromise(_0x3b53('0xf9'),_0x3b53('0xfa'),_0x161bd9,client9001)[_0x3b53('0x17')](function(){return _0x981f85;})[_0x3b53('0x21')](function(_0x3f4ecb){logger[_0x3b53('0x1c')](_0x3f4ecb);});}return;})[_0x3b53('0x17')](function(){if(_0x981f85){return _0x981f85;}})[_0x3b53('0x17')](respondWithResult(_0x15c1e4,null))[_0x3b53('0x21')](function(){for(var _0x1c2161 of _0x529f18){var _0x332c45=path[_0x3b53('0x86')](config['root'],'server',_0x3b53('0xd3'),_0x3b53('0xe9'),_0x3b53('0xea'),_0x1c2161[_0x3b53('0x7f')]);fs_extra[_0x3b53('0xfb')](_0x332c45)[_0x3b53('0x21')](function(_0x42d816){logger[_0x3b53('0x1c')](_0x3b53('0xfc'),_0x332c45,_0x42d816);});}});};exports[_0x3b53('0xfd')]=function(_0x28ca37,_0x4bade5){return db[_0x3b53('0xbd')]['find']({'where':{'id':_0x28ca37['params']['id']}})[_0x3b53('0x17')](handleEntityNotFound(_0x4bade5,null))['then'](function(_0x552814){if(_0x552814){return _0x552814[_0x3b53('0xfd')](_0x28ca37[_0x3b53('0x65')][_0x3b53('0x78')],_[_0x3b53('0xfe')](_0x28ca37[_0x3b53('0x65')],[_0x3b53('0x78'),'id'])||{});}})[_0x3b53('0x17')](respondWithResult(_0x4bade5,null))[_0x3b53('0x21')](handleError(_0x4bade5,null));};exports[_0x3b53('0xff')]=function(_0x217eeb,_0x3c5ef6){var _0x25a4e9={'raw':![],'where':{}};var _0x2de685={};var _0x14dd94={'count':0x0,'rows':[]};return db[_0x3b53('0x49')]['findOne']({'where':{'id':_0x217eeb[_0x3b53('0x60')]['id']}})['then'](handleEntityNotFound(_0x3c5ef6,null))[_0x3b53('0x17')](function(_0x46eee2){if(_0x46eee2){_0x2de685[_0x3b53('0x41')]=_['keys'](db['ChatInteraction'][_0x3b53('0x61')]);_0x2de685['query']=_[_0x3b53('0x4d')](_0x217eeb[_0x3b53('0x4e')]);_0x2de685['filters']=_[_0x3b53('0x51')](_0x2de685[_0x3b53('0x41')],_0x2de685[_0x3b53('0x4e')]);_0x25a4e9['attributes']=_[_0x3b53('0x51')](_0x2de685[_0x3b53('0x41')],qs['fields'](_0x217eeb[_0x3b53('0x4e')]['fields']));_0x25a4e9[_0x3b53('0x50')]=_0x25a4e9[_0x3b53('0x50')]['length']?_0x25a4e9[_0x3b53('0x50')]:_0x2de685[_0x3b53('0x41')];if(!_0x217eeb[_0x3b53('0x4e')][_0x3b53('0x74')]('nolimit')){_0x25a4e9['limit']=qs['limit'](_0x217eeb[_0x3b53('0x4e')][_0x3b53('0x26')]);_0x25a4e9['offset']=qs['offset'](_0x217eeb[_0x3b53('0x4e')]['offset']);}_0x25a4e9['order']=qs[_0x3b53('0x54')](_0x217eeb['query'][_0x3b53('0x54')]);_0x25a4e9[_0x3b53('0x57')]=qs[_0x3b53('0x4f')](_['pick'](_0x217eeb[_0x3b53('0x4e')],_0x2de685[_0x3b53('0x4f')]));_0x25a4e9[_0x3b53('0x57')][_0x3b53('0x72')]=_0x46eee2['id'];if(_0x217eeb[_0x3b53('0x4e')]['filter']){_0x25a4e9[_0x3b53('0x57')]=_['merge'](_0x25a4e9[_0x3b53('0x57')],{'$or':_[_0x3b53('0x4c')](_0x25a4e9['attributes'],function(_0x2f510c){var _0x50b6dd={};_0x50b6dd[_0x2f510c]={'$like':'%'+_0x217eeb[_0x3b53('0x4e')][_0x3b53('0x56')]+'%'};return _0x50b6dd;})});}_0x25a4e9=_['merge']({},_0x25a4e9,_0x217eeb[_0x3b53('0x5a')]);return db[_0x3b53('0xbd')][_0x3b53('0x28')]({'where':_0x25a4e9[_0x3b53('0x57')]})['then'](function(_0x4c4c07){_0x14dd94[_0x3b53('0x28')]=_0x4c4c07;if(_0x217eeb[_0x3b53('0x4e')][_0x3b53('0x5b')]){_0x25a4e9[_0x3b53('0x5c')]=[{'model':db[_0x3b53('0xa0')],'as':_0x3b53('0x100'),'required':![]},{'model':db['User'],'as':_0x3b53('0x101'),'attributes':['name',_0x3b53('0x102'),_0x3b53('0x103')],'required':![]},{'model':db[_0x3b53('0x104')],'as':_0x3b53('0x105'),'attributes':['id','name',_0x3b53('0x106')],'where':_0x217eeb[_0x3b53('0x4e')][_0x3b53('0x107')]?{'id':_0x217eeb[_0x3b53('0x4e')][_0x3b53('0x107')]}:undefined,'required':_0x217eeb[_0x3b53('0x4e')][_0x3b53('0x107')]?!![]:![]}];}return db[_0x3b53('0xbd')][_0x3b53('0x5d')](_0x25a4e9);})[_0x3b53('0x17')](function(_0x90a9cb){_0x14dd94['rows']=_0x90a9cb;return _0x14dd94;});}})[_0x3b53('0x17')](respondWithFilteredResult(_0x3c5ef6,_0x25a4e9))['catch'](handleError(_0x3c5ef6,null));};exports[_0x3b53('0x108')]=function(_0x413d24,_0x43cdb5){var _0x102b16=0x0;var _0x3e4aaa=0x0;var _0x2fb786=![];var _0x5c0d00;var _0x9f4ae2;return db[_0x3b53('0x49')][_0x3b53('0x63')]({'where':{'id':_0x413d24['params']['id']},'include':[{'model':db[_0x3b53('0xae')],'as':_0x3b53('0xae'),'include':[{'model':db[_0x3b53('0xae')],'as':_0x3b53('0xaf'),'attributes':['id','interval']}]}]})[_0x3b53('0x17')](handleEntityNotFound(_0x43cdb5,null))[_0x3b53('0x17')](function(_0x5a9425){if(_0x5a9425){_0x5c0d00=_0x5a9425;return _0x5a9425[_0x3b53('0x109')]({'raw':!![]});}})[_0x3b53('0x17')](function(_0x110cb2){if(_0x5c0d00){if(_0x110cb2){_0x9f4ae2=_0x110cb2;}}return require('../../config/license/util')[_0x3b53('0x88')]();})[_0x3b53('0x17')](function(_0x15df76){if(_0x15df76){_0x3e4aaa=_0x15df76[_0x3b53('0x10a')];_0x2fb786=_0x15df76[_0x3b53('0x89')];}})['then'](function(){return db[_0x3b53('0xbd')][_0x3b53('0x28')]({'where':{'closed':![]}});})[_0x3b53('0x17')](function(_0x52965f){_0x102b16=_0x52965f;if(_0x3e4aaa&&_0x52965f>_0x3e4aaa){return db[_0x3b53('0x10b')]['findOne']({'where':{'id':0x1}})[_0x3b53('0x17')](function(_0x475b5a){if(_0x475b5a){_0x475b5a[_0x3b53('0x10c')]('chatLicenseExceeded');}});}})[_0x3b53('0x17')](function(){var _0x290cdb=_0x5c0d00[_0x3b53('0xae')];var _0x1b49fe=_0x5c0d00[_0x3b53('0x10d')]||undefined;return _0x290cdb?_0x290cdb[_0x3b53('0x99')](_0x1b49fe):!![];})[_0x3b53('0x17')](function(_0xa4167f){var _0x350bd3=fs[_0x3b53('0xdf')](path[_0x3b53('0x86')](config['root'],_0x3b53('0x10e')),_0x3b53('0xe1'));var _0x40b840=_0x3b53('0x10f');var _0x312589=![];var _0x241dc0,_0x105d44;if(_0x413d24[_0x3b53('0x110')][_0x3b53('0x3c')]){_0x241dc0=new URL(_0x413d24['headers'][_0x3b53('0x3c')])[_0x3b53('0x111')];}else if(_0x413d24[_0x3b53('0x110')][_0x3b53('0x111')]){_0x241dc0=new URL(_0x413d24[_0x3b53('0x110')]['origin'])[_0x3b53('0x111')];}else{_0x241dc0=_0x3b53('0x112');}_0x105d44=typeof _0x5c0d00[_0x3b53('0x66')][_0x3b53('0x38')](',')[_0x3b53('0x63')](function(_0x3de22d){return wildcardUtils[_0x3b53('0x113')](_0x3de22d,_0x241dc0);})!==_0x3b53('0x27');var _0x3a03d2={'chatVersion':_0x40b840,'chatWebsiteAddressOrigin':_0x105d44?_0x241dc0:_0x5c0d00[_0x3b53('0x66')],'remote':_0x5c0d00[_0x3b53('0x114')],'query':querystring[_0x3b53('0x1b')](_[_0x3b53('0x58')](_0x5c0d00[_0x3b53('0x2c')]({'plain':!![]}),{'customerIp':_0x413d24[_0x3b53('0x110')][_0x3b53('0x36')]||_0x413d24['headers'][_0x3b53('0x115')]||_0x413d24[_0x3b53('0x116')][_0x3b53('0x117')]||_0x413d24['ip'],'referer':_0x413d24[_0x3b53('0x110')][_0x3b53('0x3c')],'openedInteractions':_0x102b16,'maxInteractions':_0x3e4aaa,'virtual':_0x2fb786[_0x3b53('0x10a')],'online':_0xa4167f,'custom':_0x2fb786,'address':_0x105d44?_0x241dc0:null}))[_0x3b53('0x118')](/'/g,'\x5c\x27')};_0x43cdb5['send'](ejs['render'](Mustache[_0x3b53('0xe2')](_0x350bd3,_0x3a03d2),{'proactiveActions':_0x9f4ae2,'alignment':_0x5c0d00[_0x3b53('0x119')],'verticalAlignment':_0x5c0d00[_0x3b53('0x11a')],'div_color':_0x5c0d00[_0x3b53('0x106')],'labelText':_0x5c0d00[_0x3b53('0x11b')],'text_color':_0x5c0d00[_0x3b53('0x11c')],'text_button_color':_0x5c0d00[_0x3b53('0x11d')],'button_color':_0x5c0d00[_0x3b53('0x11e')],'background_color':_0x5c0d00[_0x3b53('0x11f')],'hideWhenOffline':_0x5c0d00[_0x3b53('0x120')],'intervalId':_0x5c0d00[_0x3b53('0x121')],'isDevelopment':_0x312589,'chatVersion':_0x40b840}));})[_0x3b53('0x21')](handleError(_0x43cdb5,null));};exports[_0x3b53('0x122')]=function(_0x552a26,_0x10d7ed){var _0x22a944=_0x552a26[_0x3b53('0x60')]['id'];var _0x4a543f=_0x552a26[_0x3b53('0x65')];var _0x7fdb39=0xc8;var _0x2a3389=null;return db[_0x3b53('0xec')]['transaction']({'isolationLevel':db['sequelize'][_0x3b53('0x123')][_0x3b53('0x124')][_0x3b53('0x125')]},function(_0x474c28){return db[_0x3b53('0x49')][_0x3b53('0x7b')]({'where':{'id':_0x22a944},'transaction':_0x474c28})['then'](function(_0x3d6095){if(_0x3d6095){return db[_0x3b53('0xac')]['destroy']({'where':{'ChatWebsiteId':_0x22a944},'transaction':_0x474c28})['then'](function(){var _0x8449dc=_[_0x3b53('0x4c')](_0x4a543f,function(_0x4d4354){_0x4d4354[_0x3b53('0x72')]=_0x22a944;return _0x4d4354;});return db['ChatApplication']['bulkCreate'](_0x8449dc,{'transaction':_0x474c28});});}else{_0x7fdb39=0x194;_0x2a3389=[];}});})['then'](function(){if(_0x7fdb39!==0x194){return db['ChatApplication'][_0x3b53('0x126')]({'where':{'ChatWebsiteId':_0x22a944},'order':'priority'})[_0x3b53('0x17')](function(_0x829d39){_0x2a3389=_0x829d39;});}})[_0x3b53('0x21')](function(_0x194cac){_0x7fdb39=0x1f4;logger[_0x3b53('0x1c')](_0x194cac[_0x3b53('0x2f')]);if(_0x194cac[_0x3b53('0x30')]){delete _0x194cac[_0x3b53('0x30')];}_0x2a3389=_0x194cac;})[_0x3b53('0x127')](function(){if(_0x2a3389===null){_0x10d7ed[_0x3b53('0x23')](_0x7fdb39);}else{if(_0x7fdb39===0x1f4){_0x10d7ed[_0x3b53('0x24')](_0x7fdb39)[_0x3b53('0x31')](_0x2a3389);}else{_0x10d7ed[_0x3b53('0x24')](_0x7fdb39)['json'](_0x2a3389);}}});};exports[_0x3b53('0x128')]=function(_0x28132d,_0x5715f9){var _0x4859d9={};var _0x1eea32={};var _0x4688d2;var _0x398a9c;return db[_0x3b53('0x49')][_0x3b53('0x7b')]({'where':{'id':_0x28132d[_0x3b53('0x60')]['id']}})[_0x3b53('0x17')](handleEntityNotFound(_0x5715f9,null))['then'](function(_0x204b95){if(_0x204b95){_0x4688d2=_0x204b95;_0x1eea32[_0x3b53('0x41')]=_[_0x3b53('0x4d')](db[_0x3b53('0xac')][_0x3b53('0x61')]);_0x1eea32[_0x3b53('0x4e')]=_['keys'](_0x28132d[_0x3b53('0x4e')]);_0x1eea32[_0x3b53('0x4f')]=_[_0x3b53('0x51')](_0x1eea32[_0x3b53('0x41')],_0x1eea32[_0x3b53('0x4e')]);_0x4859d9[_0x3b53('0x50')]=_[_0x3b53('0x51')](_0x1eea32[_0x3b53('0x41')],qs[_0x3b53('0x52')](_0x28132d[_0x3b53('0x4e')][_0x3b53('0x52')]));_0x4859d9['attributes']=_0x4859d9[_0x3b53('0x50')][_0x3b53('0x62')]?_0x4859d9['attributes']:_0x1eea32[_0x3b53('0x41')];_0x4859d9[_0x3b53('0x53')]=qs[_0x3b53('0x54')](_0x28132d[_0x3b53('0x4e')][_0x3b53('0x54')]);_0x4859d9[_0x3b53('0x57')]=qs['filters'](_['pick'](_0x28132d[_0x3b53('0x4e')],_0x1eea32[_0x3b53('0x4f')]));if(_0x28132d[_0x3b53('0x4e')][_0x3b53('0x56')]){_0x4859d9[_0x3b53('0x57')]=_['merge'](_0x4859d9['where'],{'$or':_[_0x3b53('0x4c')](_0x4859d9['attributes'],function(_0x1f001c){var _0x10e9ca={};_0x10e9ca[_0x1f001c]={'$like':'%'+_0x28132d['query'][_0x3b53('0x56')]+'%'};return _0x10e9ca;})});}_0x4859d9=_[_0x3b53('0x58')]({},_0x4859d9,_0x28132d[_0x3b53('0x5a')]);return _0x4688d2[_0x3b53('0x128')](_0x4859d9);}})[_0x3b53('0x17')](function(_0x3aad6c){if(_0x3aad6c){_0x398a9c=_0x3aad6c[_0x3b53('0x62')];if(!_0x28132d[_0x3b53('0x4e')][_0x3b53('0x74')](_0x3b53('0x75'))){_0x4859d9[_0x3b53('0x26')]=qs[_0x3b53('0x26')](_0x28132d[_0x3b53('0x4e')]['limit']);_0x4859d9[_0x3b53('0x25')]=qs['offset'](_0x28132d['query'][_0x3b53('0x25')]);}return _0x4688d2[_0x3b53('0x128')](_0x4859d9);}})[_0x3b53('0x17')](function(_0x2bf4fa){if(_0x2bf4fa){return _0x2bf4fa?{'count':_0x398a9c,'rows':_0x2bf4fa}:null;}})[_0x3b53('0x17')](respondWithResult(_0x5715f9,null))[_0x3b53('0x21')](handleError(_0x5715f9,null));};exports[_0x3b53('0x129')]=function(_0x42a337,_0x1248c8){return db[_0x3b53('0x12a')]['find']({'where':{'id':_0x42a337['params']['id']}})['then'](handleEntityNotFound(_0x1248c8,null))[_0x3b53('0x17')](function(_0x378d71){if(_0x378d71){return _0x378d71['addProactiveActions'](_0x42a337[_0x3b53('0x65')]['ids'],_['omit'](_0x42a337['body'],['ids','id'])||{});}})[_0x3b53('0x17')](respondWithResult(_0x1248c8,null))[_0x3b53('0x21')](handleError(_0x1248c8,null));};exports[_0x3b53('0x109')]=function(_0x288bf7,_0x3b4931){var _0x5b70d8={};var _0x532614={};var _0x2ec130;var _0x62fe70;return db[_0x3b53('0x49')][_0x3b53('0x7b')]({'where':{'id':_0x288bf7[_0x3b53('0x60')]['id']}})[_0x3b53('0x17')](handleEntityNotFound(_0x3b4931,null))[_0x3b53('0x17')](function(_0x285398){if(_0x285398){_0x2ec130=_0x285398;_0x532614['model']=_['keys'](db[_0x3b53('0x12b')][_0x3b53('0x61')]);_0x532614['query']=_[_0x3b53('0x4d')](_0x288bf7[_0x3b53('0x4e')]);_0x532614[_0x3b53('0x4f')]=_['intersection'](_0x532614[_0x3b53('0x41')],_0x532614[_0x3b53('0x4e')]);_0x5b70d8[_0x3b53('0x50')]=_[_0x3b53('0x51')](_0x532614[_0x3b53('0x41')],qs[_0x3b53('0x52')](_0x288bf7[_0x3b53('0x4e')][_0x3b53('0x52')]));_0x5b70d8['attributes']=_0x5b70d8[_0x3b53('0x50')][_0x3b53('0x62')]?_0x5b70d8[_0x3b53('0x50')]:_0x532614[_0x3b53('0x41')];_0x5b70d8[_0x3b53('0x53')]=qs['sort'](_0x288bf7[_0x3b53('0x4e')]['sort']);_0x5b70d8[_0x3b53('0x57')]=qs[_0x3b53('0x4f')](_['pick'](_0x288bf7[_0x3b53('0x4e')],_0x532614[_0x3b53('0x4f')]));if(_0x288bf7['query']['filter']){_0x5b70d8['where']=_[_0x3b53('0x58')](_0x5b70d8['where'],{'$or':_[_0x3b53('0x4c')](_0x5b70d8[_0x3b53('0x50')],function(_0x31949c){var _0x6dc898={};_0x6dc898[_0x31949c]={'$like':'%'+_0x288bf7[_0x3b53('0x4e')]['filter']+'%'};return _0x6dc898;})});}_0x5b70d8=_[_0x3b53('0x58')]({},_0x5b70d8,_0x288bf7[_0x3b53('0x5a')]);return _0x2ec130[_0x3b53('0x109')](_0x5b70d8);}})['then'](function(_0x53a9a0){if(_0x53a9a0){_0x62fe70=_0x53a9a0[_0x3b53('0x62')];if(!_0x288bf7[_0x3b53('0x4e')][_0x3b53('0x74')](_0x3b53('0x75'))){_0x5b70d8['limit']=qs[_0x3b53('0x26')](_0x288bf7[_0x3b53('0x4e')][_0x3b53('0x26')]);_0x5b70d8[_0x3b53('0x25')]=qs[_0x3b53('0x25')](_0x288bf7[_0x3b53('0x4e')]['offset']);}return _0x2ec130[_0x3b53('0x109')](_0x5b70d8);}})['then'](function(_0x49ae38){if(_0x49ae38){return _0x49ae38?{'count':_0x62fe70,'rows':_0x49ae38}:null;}})['then'](respondWithResult(_0x3b4931,null))[_0x3b53('0x21')](handleError(_0x3b4931,null));};exports['getFields']=function(_0x258bce,_0x4137fd){var _0x5c3714=_0x258bce[_0x3b53('0x4e')][_0x3b53('0x12c')]===_0x3b53('0x12d')?_0x3b53('0x12e'):_0x3b53('0x12f');return db[_0x3b53('0x49')]['find']({'attributes':['id',_0x5c3714],'where':{'id':_0x258bce[_0x3b53('0x60')]['id']}})['then'](handleEntityNotFound(_0x4137fd,null))[_0x3b53('0x17')](function(_0x42e7e5){if(_0x42e7e5){var _0x3eb191=_0x42e7e5[_0x5c3714];var _0x9592dd=_0x3eb191&&_0x3eb191[_0x3b53('0x130')]?_0x3eb191['items']:[];_0x4137fd[_0x3b53('0x31')]({'fromKey':_[_0x3b53('0x8a')](_0x3eb191[_0x3b53('0x131')])?undefined:_0x3eb191['fromKey'],'count':_0x9592dd[_0x3b53('0x62')],'rows':_0x9592dd});}})['catch'](handleError(_0x4137fd,null));};exports[_0x3b53('0x132')]=function(_0x3735b7,_0x120852){var _0x2adf34={'raw':![],'where':{}};var _0x4bd388={};var _0x3d7056={'count':0x0,'rows':[]};return db[_0x3b53('0x49')][_0x3b53('0x7b')]({'where':{'id':_0x3735b7[_0x3b53('0x60')]['id']}})[_0x3b53('0x17')](handleEntityNotFound(_0x120852,null))[_0x3b53('0x17')](function(_0x3615ec){if(_0x3615ec){_0x4bd388['model']=_[_0x3b53('0x4d')](db[_0x3b53('0xe4')][_0x3b53('0x61')]);_0x4bd388[_0x3b53('0x4e')]=_[_0x3b53('0x4d')](_0x3735b7[_0x3b53('0x4e')]);_0x4bd388[_0x3b53('0x4f')]=_[_0x3b53('0x51')](_0x4bd388['model'],_0x4bd388[_0x3b53('0x4e')]);_0x2adf34['attributes']=_[_0x3b53('0x51')](_0x4bd388[_0x3b53('0x41')],qs[_0x3b53('0x52')](_0x3735b7[_0x3b53('0x4e')]['fields']));_0x2adf34[_0x3b53('0x50')]=_0x2adf34['attributes'][_0x3b53('0x62')]?_0x2adf34[_0x3b53('0x50')]:_0x4bd388[_0x3b53('0x41')];if(!_0x3735b7[_0x3b53('0x4e')][_0x3b53('0x74')](_0x3b53('0x75'))){_0x2adf34['limit']=qs[_0x3b53('0x26')](_0x3735b7[_0x3b53('0x4e')][_0x3b53('0x26')]);_0x2adf34[_0x3b53('0x25')]=qs['offset'](_0x3735b7[_0x3b53('0x4e')][_0x3b53('0x25')]);}_0x2adf34[_0x3b53('0x53')]=qs[_0x3b53('0x54')](_0x3735b7[_0x3b53('0x4e')][_0x3b53('0x54')]);_0x2adf34[_0x3b53('0x57')]=qs[_0x3b53('0x4f')](_[_0x3b53('0x55')](_0x3735b7[_0x3b53('0x4e')],_0x4bd388[_0x3b53('0x4f')]));_0x2adf34[_0x3b53('0x57')][_0x3b53('0x72')]=_0x3615ec['id'];if(_0x3735b7[_0x3b53('0x4e')][_0x3b53('0x56')]){_0x2adf34[_0x3b53('0x57')]=_[_0x3b53('0x58')](_0x2adf34[_0x3b53('0x57')],{'$or':_[_0x3b53('0x4c')](_0x2adf34[_0x3b53('0x50')],function(_0x14a2f4){var _0xd5a8b1={};_0xd5a8b1[_0x14a2f4]={'$like':'%'+_0x3735b7[_0x3b53('0x4e')]['filter']+'%'};return _0xd5a8b1;})});}_0x2adf34=_[_0x3b53('0x58')]({},_0x2adf34,_0x3735b7['options']);return db[_0x3b53('0xe4')][_0x3b53('0x28')]({'where':_0x2adf34['where']})[_0x3b53('0x17')](function(_0x1cdabd){_0x3d7056[_0x3b53('0x28')]=_0x1cdabd;if(_0x3735b7[_0x3b53('0x4e')][_0x3b53('0x5b')]){_0x2adf34[_0x3b53('0x5c')]=[{'all':!![]}];}else{_0x2adf34[_0x3b53('0x5c')]=[{'model':db[_0x3b53('0xa0')],'as':_0x3b53('0x100'),'required':![]},{'model':db[_0x3b53('0x133')],'as':_0x3b53('0x134'),'required':![]}];}return db['ChatOfflineMessage'][_0x3b53('0x5d')](_0x2adf34);})[_0x3b53('0x17')](function(_0x19a2c9){_0x3d7056[_0x3b53('0x5e')]=_0x19a2c9;return _0x3d7056;});}})[_0x3b53('0x17')](respondWithFilteredResult(_0x120852,_0x2adf34))[_0x3b53('0x21')](handleError(_0x120852,null));};exports['addAgents']=function(_0x3f3852,_0x2e973b){return db[_0x3b53('0x49')][_0x3b53('0x63')]({'where':{'id':_0x3f3852[_0x3b53('0x60')]['id']}})['then'](handleEntityNotFound(_0x2e973b,null))[_0x3b53('0x17')](function(_0x25d074){if(_0x25d074){return _0x25d074[_0x3b53('0x135')](_0x3f3852[_0x3b53('0x65')][_0x3b53('0x78')],_[_0x3b53('0xfe')](_0x3f3852[_0x3b53('0x65')],[_0x3b53('0x78'),'id'])||{})[_0x3b53('0xde')](function(_0xa4287e){for(var _0x4a50d4=0x0;_0x4a50d4<_0x3f3852[_0x3b53('0x65')]['ids'][_0x3b53('0x62')];_0x4a50d4+=0x1){socket[_0x3b53('0x136')](_0x3b53('0x137'),{'UserId':Number(_0x3f3852[_0x3b53('0x65')][_0x3b53('0x78')][_0x4a50d4]),'ChatWebsiteId':Number(_0x3f3852[_0x3b53('0x60')]['id'])});}return _0xa4287e;});}})['then'](respondWithResult(_0x2e973b,null))[_0x3b53('0x21')](handleError(_0x2e973b,null));};exports['removeAgents']=function(_0x5f599f,_0x1954db){return db[_0x3b53('0x49')][_0x3b53('0x63')]({'where':{'id':_0x5f599f[_0x3b53('0x60')]['id']}})['then'](handleEntityNotFound(_0x1954db,null))[_0x3b53('0x17')](function(_0x462b3e){if(_0x462b3e){return _0x462b3e[_0x3b53('0x138')](_0x5f599f[_0x3b53('0x4e')]['ids'])[_0x3b53('0x17')](function(){if(_[_0x3b53('0x139')](_0x5f599f[_0x3b53('0x4e')][_0x3b53('0x78')])){for(var _0x4091b7=0x0;_0x4091b7<_0x5f599f[_0x3b53('0x4e')][_0x3b53('0x78')][_0x3b53('0x62')];_0x4091b7+=0x1){socket['emit'](_0x3b53('0x13a'),{'UserId':Number(_0x5f599f['query'][_0x3b53('0x78')][_0x4091b7]),'ChatWebsiteId':Number(_0x5f599f[_0x3b53('0x60')]['id'])});}}else{socket[_0x3b53('0x136')](_0x3b53('0x13a'),{'UserId':Number(_0x5f599f[_0x3b53('0x4e')][_0x3b53('0x78')]),'ChatWebsiteId':Number(_0x5f599f[_0x3b53('0x60')]['id'])});}});}})[_0x3b53('0x17')](respondWithStatusCode(_0x1954db,null))[_0x3b53('0x21')](handleError(_0x1954db,null));};exports[_0x3b53('0x13b')]=function(_0xecf56a,_0x5c1224){var _0x4e4eab={};var _0x345cc0={};var _0x5be9aa;var _0x3d90b4;return db[_0x3b53('0x49')][_0x3b53('0x7b')]({'where':{'id':_0xecf56a[_0x3b53('0x60')]['id']}})[_0x3b53('0x17')](handleEntityNotFound(_0x5c1224,null))['then'](function(_0x302201){if(_0x302201){_0x5be9aa=_0x302201;_0x345cc0[_0x3b53('0x41')]=_['keys'](db[_0x3b53('0xca')][_0x3b53('0x61')]);_0x345cc0['query']=_[_0x3b53('0x4d')](_0xecf56a[_0x3b53('0x4e')]);_0x345cc0[_0x3b53('0x4f')]=_[_0x3b53('0x51')](_0x345cc0['model'],_0x345cc0[_0x3b53('0x4e')]);_0x4e4eab[_0x3b53('0x50')]=_['intersection'](_0x345cc0[_0x3b53('0x41')],qs[_0x3b53('0x52')](_0xecf56a[_0x3b53('0x4e')][_0x3b53('0x52')]));_0x4e4eab[_0x3b53('0x50')]=_0x4e4eab[_0x3b53('0x50')][_0x3b53('0x62')]?_0x4e4eab[_0x3b53('0x50')]:_0x345cc0[_0x3b53('0x41')];_0x4e4eab[_0x3b53('0x53')]=qs[_0x3b53('0x54')](_0xecf56a['query']['sort']);_0x4e4eab[_0x3b53('0x57')]=qs[_0x3b53('0x4f')](_[_0x3b53('0x55')](_0xecf56a['query'],_0x345cc0[_0x3b53('0x4f')]));if(_0xecf56a[_0x3b53('0x4e')]['filter']){_0x4e4eab[_0x3b53('0x57')]=_[_0x3b53('0x58')](_0x4e4eab[_0x3b53('0x57')],{'$or':_[_0x3b53('0x4c')](_0x4e4eab['attributes'],function(_0xdf5d59){var _0x205940={};_0x205940[_0xdf5d59]={'$like':'%'+_0xecf56a['query'][_0x3b53('0x56')]+'%'};return _0x205940;})});}_0x4e4eab=_['merge']({},_0x4e4eab,_0xecf56a['options']);return _0x5be9aa[_0x3b53('0x13b')](_0x4e4eab);}})[_0x3b53('0x17')](function(_0x26c9c4){if(_0x26c9c4){_0x3d90b4=_0x26c9c4[_0x3b53('0x62')];if(!_0xecf56a[_0x3b53('0x4e')][_0x3b53('0x74')](_0x3b53('0x75'))){_0x4e4eab[_0x3b53('0x26')]=qs[_0x3b53('0x26')](_0xecf56a['query'][_0x3b53('0x26')]);_0x4e4eab[_0x3b53('0x25')]=qs[_0x3b53('0x25')](_0xecf56a[_0x3b53('0x4e')]['offset']);}return _0x5be9aa[_0x3b53('0x13b')](_0x4e4eab);}})[_0x3b53('0x17')](function(_0x27dfcb){if(_0x27dfcb){return _0x27dfcb?{'count':_0x3d90b4,'rows':_0x27dfcb}:null;}})[_0x3b53('0x17')](respondWithResult(_0x5c1224,null))[_0x3b53('0x21')](handleError(_0x5c1224,null));};
\ No newline at end of file
+var _0xd8b7=['autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Pause','describe','addDisposition','getDispositions','Disposition','ChatWebsiteId','include','removeDispositions','ids','addAnswer','findOne','CannedAnswer','hasOwnProperty','removeAnswers','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','getLogo','join','../../config/license/util','getLicense','existsSync','root','server/files/images/logos/','download','isNil','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','Interval','resolve','timezone','ifTime','notify','chat','From\x20is\x20mandatory','mapKey','MapKey\x20is\x20mandatory','isEmpty','Body\x20is\x20mandatory','customerIp','No\x20available\x20attributes','createdAt','updatedAt','CompanyId','ListId','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','from','CmList','CmContact','Contacts','DESC','ChatApplication','Applications','Intervals','interval','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','applications','orderBy','List','list','contact','headers','threadId','ChatInteraction','closed','Writing\x20on\x20closed\x20interaction','ContactId','interaction','messageId','update','created','close','unmanaged','*,*,*,*','ChatMessage','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','ChatQueue','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','offline','Sequelize','ValidationError','no\x20available\x20attributes','difference','send','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','spread','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','files','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','MailServerOut','CloudProvider','Smtp','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','email','MailAccountId','originalname','mimetype','toPairsIn','mapValues','subjectOffline','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','server','attachments','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Owner','fullname','internal','Tag','color','tag','getSnippet','getProactiveActions','virtual','License','increment','readFileSync','server/files/chat/iframe.ejs','3.12.1','origin','http://localhost:9000','testWebsiteWithWildcard','remote','remoteAddress','replace','alignment','labelText','textColor','color_button','backgroundColor','hideWhenOffline','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','priority','finally','getApplications','chatProactiveAction','addProactiveActions','ChatProactiveAction','getFields','offlineForm','onlineForm','fromKey','getOfflineMessages','ChatOfflineMessage','Contact','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','mustache','util','ejs','fs-extra','querystring','ioredis','jayson/promise','../../config/logger','api','../../config/environment','APIBadRequestError','../../errors/api','APINotFoundError','APIOutOfIntervalError','APIConflictError','./helpers/wildcard-expressions','URL','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','client','http','request','then','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','info','result','catch','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','destroy','get','stack','name','setUA','user-agent','getResult','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','format','version','unknown','%s\x20%s','device','model','vendor','%s\x20%s\x20%s','type','index','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','create','address','forEach','testWildcardValidity','trim','\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId'];(function(_0x42bb6d,_0x412255){var _0x1db89b=function(_0x5da43a){while(--_0x5da43a){_0x42bb6d['push'](_0x42bb6d['shift']());}};_0x1db89b(++_0x412255);}(_0xd8b7,0xc7));var _0x7d8b=function(_0x531194,_0x5ce58f){_0x531194=_0x531194-0x0;var _0x37c6b4=_0xd8b7[_0x531194];return _0x37c6b4;};'use strict';var Mustache=require(_0x7d8b('0x0'));var util=require(_0x7d8b('0x1'));var path=require('path');var ejs=require(_0x7d8b('0x2'));var fs=require('fs');var fs_extra=require(_0x7d8b('0x3'));var _=require('lodash');var querystring=require(_0x7d8b('0x4'));var htmlToText=require('html-to-text');var Redis=require(_0x7d8b('0x5'));var jayson=require(_0x7d8b('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0x7d8b('0x7'))(_0x7d8b('0x8'));var config=require(_0x7d8b('0x9'));var APIBadRequestError=require('../../errors/api')[_0x7d8b('0xa')];var APINotFoundError=require(_0x7d8b('0xb'))[_0x7d8b('0xc')];var APIOutOfIntervalError=require(_0x7d8b('0xb'))[_0x7d8b('0xd')];var APIHandleError=require('../../errors/api')['handleError'];var APIConflictError=require(_0x7d8b('0xb'))[_0x7d8b('0xe')];var wildcardUtils=require(_0x7d8b('0xf'));var URL=require('url')[_0x7d8b('0x10')];var db=require(_0x7d8b('0x11'))['db'];config[_0x7d8b('0x12')]=_[_0x7d8b('0x13')](config[_0x7d8b('0x12')],{'host':_0x7d8b('0x14'),'port':0x18eb});var socket=require(_0x7d8b('0x15'))(new Redis(config[_0x7d8b('0x12')]));require('./chatWebsite.socket')[_0x7d8b('0x16')](socket);var client=jayson[_0x7d8b('0x17')]['http']({'port':0x232c});var client9002=jayson[_0x7d8b('0x17')]['http']({'port':0x232a});var client9003=jayson[_0x7d8b('0x17')][_0x7d8b('0x18')]({'port':0x232b});var client9001=jayson[_0x7d8b('0x17')][_0x7d8b('0x18')]({'port':0x2329});function respondWithRpcPromise(_0x57edc4,_0x23cdcd,_0x4b1d2f,_0x25a6aa){return new Promise(function(_0x259c13,_0x514818){var _0x39c8c6=_0x25a6aa||client;return _0x39c8c6[_0x7d8b('0x19')](_0x57edc4,_0x4b1d2f)[_0x7d8b('0x1a')](function(_0x47fea8){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x23cdcd,'request\x20sent');logger[_0x7d8b('0x1b')](_0x7d8b('0x1c'),_0x23cdcd,_0x7d8b('0x1d'),JSON[_0x7d8b('0x1e')](_0x47fea8));if(_0x47fea8[_0x7d8b('0x1f')]){if(_0x47fea8[_0x7d8b('0x1f')][_0x7d8b('0x20')]===0x1f4){logger[_0x7d8b('0x1f')](_0x7d8b('0x21'),_0x23cdcd,_0x47fea8[_0x7d8b('0x1f')][_0x7d8b('0x22')]);return _0x514818(_0x47fea8[_0x7d8b('0x1f')][_0x7d8b('0x22')]);}logger[_0x7d8b('0x1f')](_0x7d8b('0x21'),_0x23cdcd,_0x47fea8[_0x7d8b('0x1f')][_0x7d8b('0x22')]);return _0x259c13(_0x47fea8[_0x7d8b('0x1f')][_0x7d8b('0x22')]);}else{logger[_0x7d8b('0x23')](_0x7d8b('0x21'),_0x23cdcd,'request\x20sent');_0x259c13(_0x47fea8[_0x7d8b('0x24')][_0x7d8b('0x22')]);}})[_0x7d8b('0x25')](function(_0x337749){logger['error'](_0x7d8b('0x21'),_0x23cdcd,_0x337749);_0x514818(_0x337749);});});}function respondWithStatusCode(_0x2e5e63,_0x18f2df){_0x18f2df=_0x18f2df||0xcc;return function(_0x1bd096){if(_0x1bd096){return _0x2e5e63[_0x7d8b('0x26')](_0x18f2df);}return _0x2e5e63['status'](_0x18f2df)[_0x7d8b('0x27')]();};}function respondWithResult(_0x32bdef,_0x25ac5a){_0x25ac5a=_0x25ac5a||0xc8;return function(_0xa8454e){if(_0xa8454e){return _0x32bdef[_0x7d8b('0x28')](_0x25ac5a)['json'](_0xa8454e);}};}function respondWithFilteredResult(_0x53d395,_0x4f2397){return function(_0x4ffa8a){if(_0x4ffa8a){var _0x22f649=typeof _0x4f2397[_0x7d8b('0x29')]===_0x7d8b('0x2a')&&typeof _0x4f2397[_0x7d8b('0x2b')]===_0x7d8b('0x2a');var _0x3e9438=_0x4ffa8a['count'];var _0x498844=_0x22f649?0x0:_0x4f2397[_0x7d8b('0x29')];var _0x3f3171=_0x22f649?_0x4ffa8a[_0x7d8b('0x2c')]:_0x4f2397[_0x7d8b('0x29')]+_0x4f2397[_0x7d8b('0x2b')];var _0x328684;if(_0x3f3171>=_0x3e9438){_0x3f3171=_0x3e9438;_0x328684=0xc8;}else{_0x328684=0xce;}_0x53d395[_0x7d8b('0x28')](_0x328684);return _0x53d395['set'](_0x7d8b('0x2d'),_0x498844+'-'+_0x3f3171+'/'+_0x3e9438)[_0x7d8b('0x2e')](_0x4ffa8a);}return null;};}function saveUpdates(_0x565e48){return function(_0x5443f2){if(_0x5443f2){return _0x5443f2['update'](_0x565e48)['then'](function(_0x50df13){return _0x50df13;});}return null;};}function removeEntity(_0x4be95d){return function(_0x742e74){if(_0x742e74){return _0x742e74[_0x7d8b('0x2f')]()[_0x7d8b('0x1a')](function(){var _0x2f0420=_0x742e74[_0x7d8b('0x30')]({'plain':!![]});var _0x4239c8='ChatWebsites';return db['UserProfileResource']['destroy']({'where':{'type':_0x4239c8,'resourceId':_0x2f0420['id']}})['then'](function(){return _0x742e74;});})[_0x7d8b('0x1a')](function(){_0x4be95d['status'](0xcc)[_0x7d8b('0x27')]();});}};}function handleEntityNotFound(_0x3a178e){return function(_0x1572c6){if(!_0x1572c6){_0x3a178e[_0x7d8b('0x26')](0x194);}return _0x1572c6;};}function handleError(_0x30a9da,_0x38b75d){_0x38b75d=_0x38b75d||0x1f4;return function(_0x32e44c){logger['error'](_0x32e44c[_0x7d8b('0x31')]);if(_0x32e44c[_0x7d8b('0x32')]){delete _0x32e44c[_0x7d8b('0x32')];}_0x30a9da['status'](_0x38b75d)['send'](_0x32e44c);};}function createInteractionObject(_0xd8b754,_0x4020c2,_0x1ee71a,_0x5a22e3){var _0x1b1fe5=require('user-agent-parser');var _0x504b7a=new _0x1b1fe5();var _0x501c89=_0x504b7a[_0x7d8b('0x33')](_0x1ee71a[_0x7d8b('0x34')])[_0x7d8b('0x35')]();var _0x461dd8=_0x4020c2['customerIp'];if(_0x1ee71a[_0x7d8b('0x36')]){_0x461dd8=_0x1ee71a['cf-connecting-ip'];}else if(_0x1ee71a[_0x7d8b('0x37')]){_0x461dd8=_[_0x7d8b('0x38')](_0x1ee71a[_0x7d8b('0x37')][_0x7d8b('0x39')](','));}return{'ContactId':_0x5a22e3['id'],'ChatWebsiteId':_0xd8b754,'from':(_0x5a22e3[_0x7d8b('0x3a')]||'')+'\x20'+(_0x5a22e3[_0x7d8b('0x3b')]||''),'customerIp':_0x461dd8,'customerPort':_0x1ee71a[_0x7d8b('0x3c')]?_0x1ee71a[_0x7d8b('0x3c')]:null,'referer':_0x4020c2[_0x7d8b('0x3d')],'browserName':_0x501c89[_0x7d8b('0x3e')][_0x7d8b('0x32')]&&_0x501c89['browser']['version']?util[_0x7d8b('0x3f')]('%s\x20%s',_0x501c89[_0x7d8b('0x3e')][_0x7d8b('0x32')],_0x501c89[_0x7d8b('0x3e')][_0x7d8b('0x40')]):_0x7d8b('0x41'),'browserVersion':_0x501c89[_0x7d8b('0x3e')][_0x7d8b('0x40')]||'unknown','osName':util[_0x7d8b('0x3f')](_0x7d8b('0x42'),_0x501c89['os'][_0x7d8b('0x32')],_0x501c89['os'][_0x7d8b('0x40')]),'osVersion':_0x501c89['os'][_0x7d8b('0x40')],'deviceModel':_0x501c89[_0x7d8b('0x43')][_0x7d8b('0x44')]&&_0x501c89['device'][_0x7d8b('0x45')]?util['format'](_0x7d8b('0x46'),_0x501c89['device'][_0x7d8b('0x44')],_0x501c89[_0x7d8b('0x43')][_0x7d8b('0x45')],_0x501c89[_0x7d8b('0x43')][_0x7d8b('0x47')]):null,'deviceVendor':_0x501c89['device'][_0x7d8b('0x45')],'deviceType':_0x501c89[_0x7d8b('0x43')][_0x7d8b('0x47')],'formData':JSON[_0x7d8b('0x1e')](_0x4020c2)};}exports[_0x7d8b('0x48')]=function(_0x36137,_0x4e6530){var _0x221bbe={'include':[{'model':db['Pause'],'as':_0x7d8b('0x49')}]},_0xc1e294={},_0x29e006={'count':0x0,'rows':[]};var _0x199627=_[_0x7d8b('0x4a')](db[_0x7d8b('0x4b')][_0x7d8b('0x4c')],function(_0xde661b){return{'name':_0xde661b[_0x7d8b('0x4d')],'type':_0xde661b[_0x7d8b('0x47')][_0x7d8b('0x4e')]};});_0xc1e294[_0x7d8b('0x44')]=_['map'](_0x199627,_0x7d8b('0x32'));_0xc1e294[_0x7d8b('0x4f')]=_[_0x7d8b('0x50')](_0x36137[_0x7d8b('0x4f')]);_0xc1e294[_0x7d8b('0x51')]=_[_0x7d8b('0x52')](_0xc1e294['model'],_0xc1e294['query']);_0x221bbe[_0x7d8b('0x53')]=_['intersection'](_0xc1e294[_0x7d8b('0x44')],qs[_0x7d8b('0x54')](_0x36137['query'][_0x7d8b('0x54')]));_0x221bbe[_0x7d8b('0x53')]=_0x221bbe[_0x7d8b('0x53')][_0x7d8b('0x55')]?_0x221bbe[_0x7d8b('0x53')]:_0xc1e294[_0x7d8b('0x44')];if(!_0x36137[_0x7d8b('0x4f')]['hasOwnProperty'](_0x7d8b('0x56'))){_0x221bbe[_0x7d8b('0x2b')]=qs[_0x7d8b('0x2b')](_0x36137[_0x7d8b('0x4f')]['limit']);_0x221bbe[_0x7d8b('0x29')]=qs[_0x7d8b('0x29')](_0x36137[_0x7d8b('0x4f')][_0x7d8b('0x29')]);}_0x221bbe[_0x7d8b('0x57')]=qs['sort'](_0x36137[_0x7d8b('0x4f')][_0x7d8b('0x58')]);_0x221bbe[_0x7d8b('0x59')]=qs[_0x7d8b('0x51')](_[_0x7d8b('0x5a')](_0x36137['query'],_0xc1e294['filters']),_0x199627);if(_0x36137[_0x7d8b('0x4f')][_0x7d8b('0x5b')]){_0x221bbe[_0x7d8b('0x59')]=_[_0x7d8b('0x5c')](_0x221bbe[_0x7d8b('0x59')],{'$or':_['map'](_0x199627,function(_0x4d84db){if(_0x4d84db[_0x7d8b('0x47')]!==_0x7d8b('0x5d')){var _0x5a5517={};_0x5a5517[_0x4d84db[_0x7d8b('0x32')]]={'$like':'%'+_0x36137[_0x7d8b('0x4f')][_0x7d8b('0x5b')]+'%'};return _0x5a5517;}})});}_0x221bbe=_['merge']({},_0x221bbe,_0x36137[_0x7d8b('0x5e')]);var _0x212dc3={'where':_0x221bbe['where']};return db['ChatWebsite']['count'](_0x212dc3)[_0x7d8b('0x1a')](function(_0x299c61){_0x29e006[_0x7d8b('0x2c')]=_0x299c61;if(_0x36137['query'][_0x7d8b('0x5f')]){_0x221bbe['include']=[{'all':!![]}];}return db[_0x7d8b('0x4b')][_0x7d8b('0x60')](_0x221bbe);})[_0x7d8b('0x1a')](function(_0x5756f3){_0x29e006[_0x7d8b('0x61')]=_0x5756f3;return _0x29e006;})[_0x7d8b('0x1a')](respondWithFilteredResult(_0x4e6530,_0x221bbe))[_0x7d8b('0x25')](handleError(_0x4e6530,null));};exports[_0x7d8b('0x62')]=function(_0x404d26,_0x598469){var _0x8708f6={'raw':![],'where':{'id':_0x404d26[_0x7d8b('0x63')]['id']},'include':[{'model':db['Pause'],'as':_0x7d8b('0x49')}]},_0x5836c1={};_0x5836c1[_0x7d8b('0x44')]=_[_0x7d8b('0x50')](db[_0x7d8b('0x4b')]['rawAttributes']);_0x5836c1[_0x7d8b('0x4f')]=_[_0x7d8b('0x50')](_0x404d26[_0x7d8b('0x4f')]);_0x5836c1[_0x7d8b('0x51')]=_['intersection'](_0x5836c1[_0x7d8b('0x44')],_0x5836c1[_0x7d8b('0x4f')]);_0x8708f6[_0x7d8b('0x53')]=_[_0x7d8b('0x52')](_0x5836c1[_0x7d8b('0x44')],qs['fields'](_0x404d26[_0x7d8b('0x4f')][_0x7d8b('0x54')]));_0x8708f6[_0x7d8b('0x53')]=_0x8708f6[_0x7d8b('0x53')][_0x7d8b('0x55')]?_0x8708f6[_0x7d8b('0x53')]:_0x5836c1[_0x7d8b('0x44')];if(_0x404d26['query'][_0x7d8b('0x5f')]){_0x8708f6['include']=[{'all':!![]}];}_0x8708f6=_[_0x7d8b('0x5c')]({},_0x8708f6,_0x404d26[_0x7d8b('0x5e')]);return db[_0x7d8b('0x4b')]['find'](_0x8708f6)[_0x7d8b('0x1a')](handleEntityNotFound(_0x598469,null))[_0x7d8b('0x1a')](respondWithResult(_0x598469,null))[_0x7d8b('0x25')](handleError(_0x598469,null));};exports[_0x7d8b('0x64')]=function(_0x25a00f,_0x57e47d){var _0x3c2b9c=null;_0x25a00f['body'][_0x7d8b('0x65')][_0x7d8b('0x39')](',')[_0x7d8b('0x66')](_0x2bea6a=>{if(_0x2bea6a['trim']()!==''&&!wildcardUtils[_0x7d8b('0x67')](_0x2bea6a[_0x7d8b('0x68')]())){_0x3c2b9c=new APIBadRequestError('\x22'+_0x2bea6a['trim']()+_0x7d8b('0x69'));}});if(_0x3c2b9c){return handleError(_0x57e47d,null)(_0x3c2b9c);}return db[_0x7d8b('0x4b')][_0x7d8b('0x64')](_0x25a00f[_0x7d8b('0x6a')],{})[_0x7d8b('0x1a')](function(_0x1df61f){var _0x1286e7=_0x25a00f[_0x7d8b('0x6b')][_0x7d8b('0x30')]({'plain':!![]});if(!_0x1286e7)throw new Error(_0x7d8b('0x6c'));if(_0x1286e7[_0x7d8b('0x6d')]===_0x7d8b('0x6b')){var _0x3e6905=_0x1df61f[_0x7d8b('0x30')]({'plain':!![]});var _0xd4988c='ChatWebsites';return db[_0x7d8b('0x6e')][_0x7d8b('0x6f')]({'where':{'name':_0xd4988c,'userProfileId':_0x1286e7[_0x7d8b('0x70')]},'raw':!![]})[_0x7d8b('0x1a')](function(_0x2d8fa6){if(_0x2d8fa6&&_0x2d8fa6[_0x7d8b('0x71')]===0x0){return db[_0x7d8b('0x72')][_0x7d8b('0x64')]({'name':_0x3e6905[_0x7d8b('0x32')],'resourceId':_0x3e6905['id'],'type':_0x2d8fa6[_0x7d8b('0x32')],'sectionId':_0x2d8fa6['id']},{})[_0x7d8b('0x1a')](function(){return _0x1df61f;});}else{return _0x1df61f;}})['catch'](function(_0x3ef703){logger[_0x7d8b('0x1f')](_0x7d8b('0x73'),_0x3ef703);throw _0x3ef703;});}return _0x1df61f;})['then'](respondWithResult(_0x57e47d,0xc9))[_0x7d8b('0x25')](handleError(_0x57e47d,null));};exports['update']=function(_0x2ccf2f,_0xf76089){var _0x229602=null;_0x2ccf2f[_0x7d8b('0x6a')][_0x7d8b('0x65')][_0x7d8b('0x39')](',')[_0x7d8b('0x66')](_0x267e82=>{if(_0x267e82[_0x7d8b('0x68')]()!==''&&!wildcardUtils[_0x7d8b('0x67')](_0x267e82[_0x7d8b('0x68')]())){_0x229602=new APIBadRequestError('\x22'+_0x267e82[_0x7d8b('0x68')]()+_0x7d8b('0x69'));}});if(_0x229602){return handleError(_0xf76089,null)(_0x229602);}if(_0x2ccf2f[_0x7d8b('0x6a')]['id']){delete _0x2ccf2f[_0x7d8b('0x6a')]['id'];}return db[_0x7d8b('0x4b')][_0x7d8b('0x6f')]({'where':{'id':_0x2ccf2f[_0x7d8b('0x63')]['id']},'include':[{'model':db[_0x7d8b('0x74')],'as':_0x7d8b('0x49')}]})[_0x7d8b('0x1a')](handleEntityNotFound(_0xf76089,null))[_0x7d8b('0x1a')](saveUpdates(_0x2ccf2f[_0x7d8b('0x6a')],null))[_0x7d8b('0x1a')](respondWithResult(_0xf76089,null))['catch'](handleError(_0xf76089,null));};exports[_0x7d8b('0x2f')]=function(_0x2857d1,_0x282284){return db['ChatWebsite']['find']({'where':{'id':_0x2857d1[_0x7d8b('0x63')]['id']}})[_0x7d8b('0x1a')](handleEntityNotFound(_0x282284,null))[_0x7d8b('0x1a')](removeEntity(_0x282284,null))[_0x7d8b('0x25')](handleError(_0x282284,null));};exports[_0x7d8b('0x75')]=function(_0x57c368,_0x3568a3){return db[_0x7d8b('0x4b')][_0x7d8b('0x75')]()[_0x7d8b('0x1a')](respondWithResult(_0x3568a3,null))[_0x7d8b('0x25')](handleError(_0x3568a3,null));};exports[_0x7d8b('0x76')]=function(_0xb9a30c,_0xbb955c){if(_0xb9a30c[_0x7d8b('0x6a')]['id']){delete _0xb9a30c[_0x7d8b('0x6a')]['id'];}return db[_0x7d8b('0x4b')][_0x7d8b('0x6f')]({'where':{'id':_0xb9a30c['params']['id']}})['then'](handleEntityNotFound(_0xbb955c,null))['then'](function(_0x57907a){if(_0x57907a){_0xb9a30c[_0x7d8b('0x6a')]['ChatWebsiteId']=_0x57907a['id'];return db['Disposition'][_0x7d8b('0x64')](_0xb9a30c[_0x7d8b('0x6a')]);}})[_0x7d8b('0x1a')](respondWithResult(_0xbb955c,null))[_0x7d8b('0x25')](handleError(_0xbb955c,null));};exports[_0x7d8b('0x77')]=function(_0x5bc895,_0x11419c){var _0x4dba37={'raw':![],'where':{}};var _0x22e4dc={};var _0x355fdb={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x5bc895[_0x7d8b('0x63')]['id']}})['then'](handleEntityNotFound(_0x11419c,null))[_0x7d8b('0x1a')](function(_0x2e796f){if(_0x2e796f){_0x22e4dc[_0x7d8b('0x44')]=_['keys'](db[_0x7d8b('0x78')][_0x7d8b('0x4c')]);_0x22e4dc[_0x7d8b('0x4f')]=_[_0x7d8b('0x50')](_0x5bc895[_0x7d8b('0x4f')]);_0x22e4dc[_0x7d8b('0x51')]=_[_0x7d8b('0x52')](_0x22e4dc['model'],_0x22e4dc[_0x7d8b('0x4f')]);_0x4dba37[_0x7d8b('0x53')]=_[_0x7d8b('0x52')](_0x22e4dc['model'],qs['fields'](_0x5bc895['query']['fields']));_0x4dba37[_0x7d8b('0x53')]=_0x4dba37[_0x7d8b('0x53')][_0x7d8b('0x55')]?_0x4dba37[_0x7d8b('0x53')]:_0x22e4dc[_0x7d8b('0x44')];if(!_0x5bc895[_0x7d8b('0x4f')]['hasOwnProperty'](_0x7d8b('0x56'))){_0x4dba37['limit']=qs[_0x7d8b('0x2b')](_0x5bc895['query']['limit']);_0x4dba37[_0x7d8b('0x29')]=qs[_0x7d8b('0x29')](_0x5bc895[_0x7d8b('0x4f')]['offset']);}_0x4dba37['order']=qs[_0x7d8b('0x58')](_0x5bc895[_0x7d8b('0x4f')][_0x7d8b('0x58')]);_0x4dba37[_0x7d8b('0x59')]=qs[_0x7d8b('0x51')](_[_0x7d8b('0x5a')](_0x5bc895[_0x7d8b('0x4f')],_0x22e4dc[_0x7d8b('0x51')]));_0x4dba37['where'][_0x7d8b('0x79')]=_0x2e796f['id'];if(_0x5bc895[_0x7d8b('0x4f')][_0x7d8b('0x5b')]){_0x4dba37['where']=_[_0x7d8b('0x5c')](_0x4dba37[_0x7d8b('0x59')],{'$or':_[_0x7d8b('0x4a')](_0x4dba37[_0x7d8b('0x53')],function(_0x4f4594){var _0xc08c0e={};_0xc08c0e[_0x4f4594]={'$like':'%'+_0x5bc895[_0x7d8b('0x4f')]['filter']+'%'};return _0xc08c0e;})});}_0x4dba37=_['merge']({},_0x4dba37,_0x5bc895[_0x7d8b('0x5e')]);return db['Disposition'][_0x7d8b('0x2c')]({'where':_0x4dba37['where']})[_0x7d8b('0x1a')](function(_0x2ec5be){_0x355fdb[_0x7d8b('0x2c')]=_0x2ec5be;if(_0x5bc895[_0x7d8b('0x4f')][_0x7d8b('0x5f')]){_0x4dba37[_0x7d8b('0x7a')]=[{'all':!![]}];}return db[_0x7d8b('0x78')][_0x7d8b('0x60')](_0x4dba37);})[_0x7d8b('0x1a')](function(_0x458fa0){_0x355fdb[_0x7d8b('0x61')]=_0x458fa0;return _0x355fdb;});}})[_0x7d8b('0x1a')](respondWithFilteredResult(_0x11419c,_0x4dba37))[_0x7d8b('0x25')](handleError(_0x11419c,null));};exports[_0x7d8b('0x7b')]=function(_0x509ef7,_0x2470b5){return db[_0x7d8b('0x4b')][_0x7d8b('0x6f')]({'where':{'id':_0x509ef7[_0x7d8b('0x63')]['id']}})[_0x7d8b('0x1a')](handleEntityNotFound(_0x2470b5,null))['then'](function(_0x6887c0){if(_0x6887c0){return _0x6887c0[_0x7d8b('0x7b')](_0x509ef7[_0x7d8b('0x4f')][_0x7d8b('0x7c')]);}})[_0x7d8b('0x1a')](respondWithStatusCode(_0x2470b5,null))[_0x7d8b('0x25')](handleError(_0x2470b5,null));};exports[_0x7d8b('0x7d')]=function(_0x3b94e4,_0x3c1bb6){if(_0x3b94e4[_0x7d8b('0x6a')]['id']){delete _0x3b94e4[_0x7d8b('0x6a')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x3b94e4['params']['id']}})[_0x7d8b('0x1a')](handleEntityNotFound(_0x3c1bb6,null))['then'](function(_0x13b649){if(_0x13b649){_0x3b94e4['body'][_0x7d8b('0x79')]=_0x13b649['id'];return db['CannedAnswer']['create'](_0x3b94e4[_0x7d8b('0x6a')]);}})[_0x7d8b('0x1a')](respondWithResult(_0x3c1bb6,null))[_0x7d8b('0x25')](handleError(_0x3c1bb6,null));};exports['getAnswers']=function(_0x13e666,_0x2fc009){var _0x580da5={'raw':![],'where':{}};var _0x3a7782={};var _0x1bc13f={'count':0x0,'rows':[]};return db[_0x7d8b('0x4b')][_0x7d8b('0x7e')]({'where':{'id':_0x13e666[_0x7d8b('0x63')]['id']}})[_0x7d8b('0x1a')](handleEntityNotFound(_0x2fc009,null))[_0x7d8b('0x1a')](function(_0x37ce02){if(_0x37ce02){_0x3a7782[_0x7d8b('0x44')]=_[_0x7d8b('0x50')](db[_0x7d8b('0x7f')][_0x7d8b('0x4c')]);_0x3a7782[_0x7d8b('0x4f')]=_['keys'](_0x13e666[_0x7d8b('0x4f')]);_0x3a7782['filters']=_['intersection'](_0x3a7782[_0x7d8b('0x44')],_0x3a7782['query']);_0x580da5['attributes']=_[_0x7d8b('0x52')](_0x3a7782[_0x7d8b('0x44')],qs['fields'](_0x13e666[_0x7d8b('0x4f')]['fields']));_0x580da5[_0x7d8b('0x53')]=_0x580da5[_0x7d8b('0x53')][_0x7d8b('0x55')]?_0x580da5['attributes']:_0x3a7782[_0x7d8b('0x44')];if(!_0x13e666[_0x7d8b('0x4f')][_0x7d8b('0x80')](_0x7d8b('0x56'))){_0x580da5[_0x7d8b('0x2b')]=qs[_0x7d8b('0x2b')](_0x13e666[_0x7d8b('0x4f')]['limit']);_0x580da5[_0x7d8b('0x29')]=qs[_0x7d8b('0x29')](_0x13e666[_0x7d8b('0x4f')][_0x7d8b('0x29')]);}_0x580da5[_0x7d8b('0x57')]=qs[_0x7d8b('0x58')](_0x13e666[_0x7d8b('0x4f')][_0x7d8b('0x58')]);_0x580da5[_0x7d8b('0x59')]=qs['filters'](_[_0x7d8b('0x5a')](_0x13e666['query'],_0x3a7782[_0x7d8b('0x51')]));_0x580da5['where'][_0x7d8b('0x79')]=_0x37ce02['id'];if(_0x13e666[_0x7d8b('0x4f')][_0x7d8b('0x5b')]){_0x580da5[_0x7d8b('0x59')]=_[_0x7d8b('0x5c')](_0x580da5['where'],{'$or':_[_0x7d8b('0x4a')](_0x580da5[_0x7d8b('0x53')],function(_0xed6f21){var _0x373282={};_0x373282[_0xed6f21]={'$like':'%'+_0x13e666[_0x7d8b('0x4f')]['filter']+'%'};return _0x373282;})});}_0x580da5=_[_0x7d8b('0x5c')]({},_0x580da5,_0x13e666[_0x7d8b('0x5e')]);return db['CannedAnswer']['count']({'where':_0x580da5[_0x7d8b('0x59')]})[_0x7d8b('0x1a')](function(_0x3f1ed9){_0x1bc13f['count']=_0x3f1ed9;if(_0x13e666[_0x7d8b('0x4f')]['includeAll']){_0x580da5['include']=[{'all':!![]}];}return db[_0x7d8b('0x7f')]['findAll'](_0x580da5);})[_0x7d8b('0x1a')](function(_0x569569){_0x1bc13f[_0x7d8b('0x61')]=_0x569569;return _0x1bc13f;});}})[_0x7d8b('0x1a')](respondWithFilteredResult(_0x2fc009,_0x580da5))[_0x7d8b('0x25')](handleError(_0x2fc009,null));};exports[_0x7d8b('0x81')]=function(_0x451d29,_0x1883f5){return db[_0x7d8b('0x4b')][_0x7d8b('0x6f')]({'where':{'id':_0x451d29['params']['id']}})['then'](handleEntityNotFound(_0x1883f5,null))[_0x7d8b('0x1a')](function(_0x1f5762){if(_0x1f5762){return _0x1f5762[_0x7d8b('0x81')](_0x451d29[_0x7d8b('0x4f')][_0x7d8b('0x7c')]);}})['then'](respondWithStatusCode(_0x1883f5,null))[_0x7d8b('0x25')](handleError(_0x1883f5,null));};exports['addLogo']=function(_0x3e5490,_0x8c43c9){_0x3e5490['body'][_0x7d8b('0x82')]=_0x3e5490[_0x7d8b('0x83')][_0x7d8b('0x84')];return db[_0x7d8b('0x4b')][_0x7d8b('0x6f')]({'where':{'id':_0x3e5490[_0x7d8b('0x63')]['id']}})['then'](handleEntityNotFound(_0x8c43c9,null))[_0x7d8b('0x1a')](saveUpdates(_0x3e5490[_0x7d8b('0x6a')],null))[_0x7d8b('0x1a')](respondWithResult(_0x8c43c9,null))[_0x7d8b('0x25')](handleError(_0x8c43c9,null));};exports[_0x7d8b('0x85')]=function(_0x1af0cb,_0x4c55eb){_0x1af0cb[_0x7d8b('0x6a')][_0x7d8b('0x86')]=_0x1af0cb['file'][_0x7d8b('0x84')];return db[_0x7d8b('0x4b')][_0x7d8b('0x6f')]({'where':{'id':_0x1af0cb[_0x7d8b('0x63')]['id']}})[_0x7d8b('0x1a')](handleEntityNotFound(_0x4c55eb,null))[_0x7d8b('0x1a')](saveUpdates(_0x1af0cb[_0x7d8b('0x6a')],null))[_0x7d8b('0x1a')](respondWithResult(_0x4c55eb,null))[_0x7d8b('0x25')](handleError(_0x4c55eb,null));};exports[_0x7d8b('0x87')]=function(_0x1f48c7,_0x3bf93f){_0x1f48c7[_0x7d8b('0x6a')][_0x7d8b('0x88')]=_0x1f48c7['file']['filename'];return db[_0x7d8b('0x4b')]['find']({'where':{'id':_0x1f48c7['params']['id']}})['then'](handleEntityNotFound(_0x3bf93f,null))['then'](saveUpdates(_0x1f48c7[_0x7d8b('0x6a')],null))['then'](respondWithResult(_0x3bf93f,null))['catch'](handleError(_0x3bf93f,null));};exports[_0x7d8b('0x89')]=function(_0x5baa02,_0x96d39b){_0x5baa02[_0x7d8b('0x6a')]['systemAvatar']=_0x5baa02[_0x7d8b('0x83')][_0x7d8b('0x84')];return db['ChatWebsite']['find']({'where':{'id':_0x5baa02[_0x7d8b('0x63')]['id']}})['then'](handleEntityNotFound(_0x96d39b,null))[_0x7d8b('0x1a')](saveUpdates(_0x5baa02[_0x7d8b('0x6a')],null))[_0x7d8b('0x1a')](respondWithResult(_0x96d39b,null))[_0x7d8b('0x25')](handleError(_0x96d39b,null));};exports[_0x7d8b('0x8a')]=function(_0x157de2,_0x57b7ff){var _0x344b26=path[_0x7d8b('0x8b')](config['root'],'server/files/images/logos/default_logo.svg');var _0x2e38e2={'where':{'id':_0x157de2[_0x7d8b('0x63')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x1fc937=![];return require(_0x7d8b('0x8c'))[_0x7d8b('0x8d')]()[_0x7d8b('0x1a')](function(_0x5e78ff){if(_0x5e78ff){_0x1fc937=_0x5e78ff['custom'];}})['then'](function(){return db[_0x7d8b('0x4b')]['find'](_0x2e38e2);})[_0x7d8b('0x1a')](handleEntityNotFound(_0x57b7ff,null))[_0x7d8b('0x1a')](function(_0x596165){if(_0x596165){if(!_['isNil'](_0x596165[_0x7d8b('0x82')])){if(fs[_0x7d8b('0x8e')](path[_0x7d8b('0x8b')](config[_0x7d8b('0x8f')],_0x7d8b('0x90'),_0x596165[_0x7d8b('0x82')]))&&_0x1fc937){_0x344b26=path[_0x7d8b('0x8b')](config[_0x7d8b('0x8f')],_0x7d8b('0x90'),_0x596165[_0x7d8b('0x82')]);}}return _0x57b7ff[_0x7d8b('0x91')](_0x344b26);}})['catch'](handleError(_0x57b7ff,null));};exports['getAvatar']=function(_0x1057b0,_0x47d7ab){var _0x5673ac=path['join'](config[_0x7d8b('0x8f')],'server/files/images/avatars/default_avatar.png');var _0x14e486={'where':{'id':_0x1057b0[_0x7d8b('0x63')]['id']},'attributes':['id',_0x7d8b('0x86')],'raw':!![]};return db['ChatWebsite'][_0x7d8b('0x6f')](_0x14e486)['then'](handleEntityNotFound(_0x47d7ab,null))[_0x7d8b('0x1a')](function(_0x89ea7a){if(_0x89ea7a){if(!_[_0x7d8b('0x92')](_0x89ea7a[_0x7d8b('0x86')])){if(fs[_0x7d8b('0x8e')](path[_0x7d8b('0x8b')](config[_0x7d8b('0x8f')],_0x7d8b('0x93'),_0x89ea7a[_0x7d8b('0x86')]))){_0x5673ac=path[_0x7d8b('0x8b')](config[_0x7d8b('0x8f')],_0x7d8b('0x93'),_0x89ea7a[_0x7d8b('0x86')]);}}return _0x47d7ab[_0x7d8b('0x91')](_0x5673ac);}})[_0x7d8b('0x25')](handleError(_0x47d7ab,null));};exports[_0x7d8b('0x94')]=function(_0x4c4a2c,_0x12a77b){var _0x45e6a9=path[_0x7d8b('0x8b')](config[_0x7d8b('0x8f')],'server/files/images/avatars/customer_avatar.png');var _0x1279e6={'where':{'id':_0x4c4a2c[_0x7d8b('0x63')]['id']},'attributes':['id',_0x7d8b('0x88'),_0x7d8b('0x95')],'raw':!![]};return db[_0x7d8b('0x4b')][_0x7d8b('0x6f')](_0x1279e6)[_0x7d8b('0x1a')](handleEntityNotFound(_0x12a77b,null))[_0x7d8b('0x1a')](function(_0xd16fd5){if(_0xd16fd5){if(!_[_0x7d8b('0x92')](_0xd16fd5[_0x7d8b('0x88')])){if(fs[_0x7d8b('0x8e')](path[_0x7d8b('0x8b')](config[_0x7d8b('0x8f')],_0x7d8b('0x93'),_0xd16fd5[_0x7d8b('0x88')]))&&_0xd16fd5[_0x7d8b('0x95')]){_0x45e6a9=path[_0x7d8b('0x8b')](config[_0x7d8b('0x8f')],_0x7d8b('0x93'),_0xd16fd5[_0x7d8b('0x88')]);}}return _0x12a77b['download'](_0x45e6a9);}})['catch'](handleError(_0x12a77b,null));};exports['getSystemAvatar']=function(_0x31706e,_0x514326){var _0x39640a=path['join'](config[_0x7d8b('0x8f')],_0x7d8b('0x96'));var _0x72a4c4={'where':{'id':_0x31706e[_0x7d8b('0x63')]['id']},'attributes':['id',_0x7d8b('0x97')],'raw':!![]};return db[_0x7d8b('0x4b')][_0x7d8b('0x6f')](_0x72a4c4)[_0x7d8b('0x1a')](handleEntityNotFound(_0x514326,null))[_0x7d8b('0x1a')](function(_0x24793a){if(_0x24793a){if(!_[_0x7d8b('0x92')](_0x24793a[_0x7d8b('0x97')])){if(fs[_0x7d8b('0x8e')](path[_0x7d8b('0x8b')](config['root'],'server/files/images/avatars/',_0x24793a[_0x7d8b('0x97')]))){_0x39640a=path['join'](config[_0x7d8b('0x8f')],_0x7d8b('0x93'),_0x24793a[_0x7d8b('0x97')]);}}return _0x514326['download'](_0x39640a);}})[_0x7d8b('0x25')](handleError(_0x514326,null));};function checkWebsiteInterval(_0x14792f){var _0x1e6df6=_0x14792f[_0x7d8b('0x98')];if(!_0x1e6df6){return Promise[_0x7d8b('0x99')](_0x14792f);}var _0x2a837d=_0x14792f[_0x7d8b('0x9a')]||undefined;return _0x1e6df6[_0x7d8b('0x9b')](_0x2a837d)[_0x7d8b('0x1a')](function(_0x36a086){if(!_0x36a086){throw new APIOutOfIntervalError();}return _0x14792f;});}exports[_0x7d8b('0x9c')]=function(_0x2bbf7e,_0x12966e){var _0x18bc0b={'body':_0x2bbf7e['body'],'channel':_0x7d8b('0x9d')};var _0x165b30=[];var _0x13858b=[];var _0x40582e={};var _0x215e87=![];if(_0x2bbf7e[_0x7d8b('0x6a')]['id']){delete _0x2bbf7e[_0x7d8b('0x6a')]['id'];}if(_[_0x7d8b('0x92')](_0x2bbf7e['body']['from'])){throw new APIBadRequestError(_0x7d8b('0x9e'));}if(_[_0x7d8b('0x92')](_0x2bbf7e[_0x7d8b('0x6a')][_0x7d8b('0x9f')])){throw new APIBadRequestError(_0x7d8b('0xa0'));}if(_[_0x7d8b('0xa1')](_0x2bbf7e[_0x7d8b('0x6a')][_0x7d8b('0x6a')])){throw new APIBadRequestError(_0x7d8b('0xa2'));}var _0x4af186=_0x2bbf7e['body'][_0x7d8b('0xa3')]&&_0x2bbf7e['body']['referer'];return db['CmContact'][_0x7d8b('0x75')]()[_0x7d8b('0x1a')](function(_0x207301){if(!_0x207301){throw new Error(_0x7d8b('0xa4'));}_0x165b30=Object[_0x7d8b('0x50')](_0x207301)['filter'](function(_0x193747){return![_0x7d8b('0xa5'),_0x7d8b('0xa6')]['includes'](_0x193747);});_0x13858b=Object[_0x7d8b('0x50')](_0x207301)['filter'](function(_0x1e2232){return![_0x7d8b('0xa5'),_0x7d8b('0xa6'),_0x7d8b('0xa7'),_0x7d8b('0xa8')]['includes'](_0x1e2232);});if(!_['includes'](_0x13858b,_0x2bbf7e[_0x7d8b('0x6a')][_0x7d8b('0x9f')])){throw new APIBadRequestError(_0x7d8b('0xa9')+_0x13858b[_0x7d8b('0x8b')](',\x20'));}_0x40582e[_0x2bbf7e[_0x7d8b('0x6a')]['mapKey']]=_0x2bbf7e[_0x7d8b('0x6a')][_0x7d8b('0xaa')];})[_0x7d8b('0x1a')](function(){return db[_0x7d8b('0x4b')][_0x7d8b('0x6f')]({'where':{'id':_0x2bbf7e[_0x7d8b('0x63')]['id']},'include':[{'model':db[_0x7d8b('0xab')],'as':'List','include':[{'model':db[_0x7d8b('0xac')],'as':_0x7d8b('0xad'),'where':_0x40582e,'limit':0x1,'order':[[_0x7d8b('0xa6'),_0x7d8b('0xae')]]}]},{'model':db[_0x7d8b('0xaf')],'as':_0x7d8b('0xb0')},{'model':db[_0x7d8b('0x98')],'as':_0x7d8b('0x98'),'include':[{'model':db['Interval'],'as':_0x7d8b('0xb1'),'attributes':['id',_0x7d8b('0xb2')],'raw':!![]}]}]});})[_0x7d8b('0x1a')](function(_0x3b7341){if(!_0x3b7341){throw new APINotFoundError(util[_0x7d8b('0x3f')](_0x7d8b('0xb3'),_0x2bbf7e[_0x7d8b('0x63')]['id']));}if(_0x4af186){return checkWebsiteInterval(_0x3b7341);}return _0x3b7341;})[_0x7d8b('0x1a')](function(_0x506970){_0x18bc0b[_0x7d8b('0xb4')]=_0x506970;_0x18bc0b[_0x7d8b('0xb5')]=_[_0x7d8b('0xb6')](_0x506970[_0x7d8b('0xb0')],['priority'],['asc']);if(_0x18bc0b[_0x7d8b('0xb4')]['Applications']){delete _0x18bc0b[_0x7d8b('0xb4')][_0x7d8b('0xb0')];}_0x18bc0b['list']=_0x506970[_0x7d8b('0xb7')]||{'id':_0x506970['ListId']};if(_0x18bc0b[_0x7d8b('0xb8')]&&_0x18bc0b[_0x7d8b('0xb8')]['Contacts'][_0x7d8b('0x55')]){return _0x18bc0b[_0x7d8b('0xb8')][_0x7d8b('0xad')][0x0];}var _0x413546=_['defaults'](_0x2bbf7e[_0x7d8b('0x6a')],{'firstName':_0x2bbf7e[_0x7d8b('0x6a')][_0x7d8b('0xaa')],'ListId':_0x506970[_0x7d8b('0xa8')]});_0x413546[_0x2bbf7e[_0x7d8b('0x6a')][_0x7d8b('0x9f')]]=_0x2bbf7e[_0x7d8b('0x6a')][_0x7d8b('0xaa')];return db[_0x7d8b('0xac')][_0x7d8b('0x64')](_0x413546,{'fields':_0x165b30,'raw':!![]});})['then'](function(_0x27650c){_0x18bc0b[_0x7d8b('0xb9')]=_0x27650c;var _0x1ea9d4=createInteractionObject(_0x2bbf7e[_0x7d8b('0x63')]['id'],_0x2bbf7e[_0x7d8b('0x6a')],_0x2bbf7e[_0x7d8b('0xba')],_0x27650c);var _0xd28d8f={'ChatWebsiteId':_0x2bbf7e[_0x7d8b('0x63')]['id']};if(_0x2bbf7e[_0x7d8b('0x6a')][_0x7d8b('0xbb')]){_0xd28d8f[_0x7d8b('0xbb')]=_0x2bbf7e[_0x7d8b('0x6a')][_0x7d8b('0xbb')];_0xd28d8f['closed']=![];return db[_0x7d8b('0xbc')][_0x7d8b('0x6f')]({'where':_0xd28d8f})[_0x7d8b('0x1a')](function(_0xc57099){var _0x20014d=_0x2bbf7e['body'][_0x7d8b('0xa3')]&&_0x2bbf7e[_0x7d8b('0x6a')][_0x7d8b('0x3d')];if(_0xc57099){_0x215e87=!![];return _0xc57099;}else if(!_0x20014d&&_0xc57099&&_0xc57099[_0x7d8b('0xbd')]){throw new APIConflictError(_0x7d8b('0xbe'));}_0x1ea9d4[_0x7d8b('0xbb')]=_0x2bbf7e[_0x7d8b('0x6a')]['threadId'];_0x1ea9d4['externalUrl']=_0x2bbf7e[_0x7d8b('0x6a')]['externalUrl'];return db[_0x7d8b('0xbc')][_0x7d8b('0x64')](_0x1ea9d4);});}_0xd28d8f[_0x7d8b('0xbf')]=_0x27650c['id'];if(_0x2bbf7e[_0x7d8b('0x6a')][_0x7d8b('0xc0')]&&_0x2bbf7e[_0x7d8b('0x6a')][_0x7d8b('0xc0')]['id']){_0xd28d8f['id']=_0x2bbf7e[_0x7d8b('0x6a')][_0x7d8b('0xc0')]['id'];return db[_0x7d8b('0xbc')][_0x7d8b('0x6f')]({'where':_0xd28d8f})[_0x7d8b('0x1a')](function(_0xf77a9c){var _0x53e1de=_0x2bbf7e[_0x7d8b('0x6a')][_0x7d8b('0xa3')]&&_0x2bbf7e[_0x7d8b('0x6a')][_0x7d8b('0x3d')];if(!_0x53e1de&&_0xf77a9c&&_0xf77a9c[_0x7d8b('0xbd')]){throw new APIConflictError(_0x7d8b('0xbe'));}else if(_0xf77a9c){_0x215e87=!![];return _0xf77a9c;}else{return db[_0x7d8b('0xbc')][_0x7d8b('0x64')](_0x1ea9d4);}});}return db['ChatInteraction'][_0x7d8b('0x64')](_0x1ea9d4);})[_0x7d8b('0x1a')](function(_0x4ab267){if(!_0x215e87){return _0x4ab267;}var _0x168546={'from':(_0x18bc0b[_0x7d8b('0xb9')]['firstName']||'')+'\x20'+(_0x18bc0b[_0x7d8b('0xb9')][_0x7d8b('0x3b')]||'')};if(_0x2bbf7e['body'][_0x7d8b('0xbb')]&&_0x2bbf7e[_0x7d8b('0x6a')][_0x7d8b('0xc1')]&&_0x2bbf7e[_0x7d8b('0x6a')][_0x7d8b('0xbb')]!=_0x2bbf7e[_0x7d8b('0x6a')][_0x7d8b('0xc1')]){_0x168546[_0x7d8b('0xbb')]=_0x2bbf7e[_0x7d8b('0x6a')]['messageId'];}return _0x4ab267[_0x7d8b('0xc2')](_0x168546);})['then'](function(_0x1b34af){_0x18bc0b[_0x7d8b('0xc0')]=_0x1b34af[_0x7d8b('0x30')]({'plain':!![]});_0x18bc0b['interaction'][_0x7d8b('0xc3')]=!_0x215e87;if(_0x18bc0b['interaction'][_0x7d8b('0xc3')]){if(_0x18bc0b[_0x7d8b('0xb4')]['autoclose']){_0x18bc0b['applications']['push']({'id':0x0,'priority':_0x18bc0b[_0x7d8b('0xb5')]['length']+0x1,'app':_0x7d8b('0xc4'),'appdata':_0x7d8b('0xc5'),'interval':_0x7d8b('0xc6')});}}return db[_0x7d8b('0xc7')][_0x7d8b('0x64')]({'body':_0x2bbf7e[_0x7d8b('0x6a')][_0x7d8b('0x6a')],'ChatWebsiteId':_0x2bbf7e[_0x7d8b('0x63')]['id'],'ChatInteractionId':_0x1b34af['id'],'direction':'in','ContactId':_0x18bc0b[_0x7d8b('0xb9')]['id'],'AttachmentId':_0x2bbf7e['body']['AttachmentId']});})['then'](function(_0x10eb78){_0x18bc0b[_0x7d8b('0x22')]=_0x10eb78;if(!_0x18bc0b[_0x7d8b('0xc0')][_0x7d8b('0xc8')]){return;}return db[_0x7d8b('0xc9')][_0x7d8b('0x6f')]({'attributes':['id',_0x7d8b('0x32')],'where':{'id':_0x18bc0b[_0x7d8b('0xc0')][_0x7d8b('0xc8')]}});})[_0x7d8b('0x1a')](function(_0x27e0c4){if(_0x27e0c4){_0x18bc0b['applications'][_0x7d8b('0xca')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x27e0c4[_0x7d8b('0x32')]+','+(_0x18bc0b[_0x7d8b('0xb4')][_0x7d8b('0xcb')]||0xa),'interval':_0x7d8b('0xc6')});_0x18bc0b[_0x7d8b('0xcc')]=!![];}if(!_0x18bc0b['interaction']['queueId']){return;}return db[_0x7d8b('0xcd')][_0x7d8b('0x6f')]({'attributes':['id',_0x7d8b('0x32')],'where':{'id':_0x18bc0b[_0x7d8b('0xc0')]['queueId']}});})['then'](function(_0x49c129){if(_0x49c129){_0x18bc0b[_0x7d8b('0xb5')][_0x7d8b('0xca')]({'id':0x0,'priority':0x1,'app':_0x7d8b('0xce'),'appdata':_0x49c129['name']+','+(_0x18bc0b['account'][_0x7d8b('0xcf')]||0x12c),'interval':_0x7d8b('0xc6')});}return respondWithRpcPromise(_0x7d8b('0xd0'),_0x7d8b('0xd1'),_0x18bc0b);})[_0x7d8b('0x1a')](function(_0x2f7c10){respondWithRpcPromise(_0x7d8b('0xd2'),_0x7d8b('0xd2'),{'event':_0x7d8b('0x9c'),'message':_0x2f7c10},client9002);return _0x2f7c10;})[_0x7d8b('0x1a')](respondWithResult(_0x12966e,null))[_0x7d8b('0x25')](APIHandleError(_0x12966e));};exports[_0x7d8b('0xd3')]=function(_0x1392d6,_0x505397){var _0xfd0132,_0x24c605,_0x1cd99f;var _0x51538c=[];var _0x1c293a={};var _0x1399d4=_0x1392d6['files']||[];var _0x16fcd1=[];var _0x2c0cb1;return db[_0x7d8b('0xac')][_0x7d8b('0x75')]()['then'](function(_0x3cbaeb){if(!_0x3cbaeb){throw new db[(_0x7d8b('0xd4'))][(_0x7d8b('0xd5'))](_0x7d8b('0xd6'));}_0x51538c=_[_0x7d8b('0xd7')](_[_0x7d8b('0x50')](_0x3cbaeb),[_0x7d8b('0xa5'),_0x7d8b('0xa6'),'CompanyId',_0x7d8b('0xa8')]);if(_0x1392d6[_0x7d8b('0x6a')]['id']){delete _0x1392d6[_0x7d8b('0x6a')]['id'];}if(_[_0x7d8b('0x92')](_0x1392d6[_0x7d8b('0x6a')][_0x7d8b('0xaa')])){throw _0x505397[_0x7d8b('0x28')](0x1f4)[_0x7d8b('0xd8')](new db[(_0x7d8b('0xd4'))][(_0x7d8b('0xd5'))](_0x7d8b('0xd9')));}if(_[_0x7d8b('0x92')](_0x1392d6[_0x7d8b('0x6a')][_0x7d8b('0x6a')])||_0x1392d6[_0x7d8b('0x6a')][_0x7d8b('0x6a')]===''){throw _0x505397[_0x7d8b('0x28')](0x1f4)[_0x7d8b('0xd8')](new db[(_0x7d8b('0xd4'))][(_0x7d8b('0xd5'))](_0x7d8b('0xda')));}if(_[_0x7d8b('0x92')](_0x1392d6[_0x7d8b('0x6a')][_0x7d8b('0xdb')])){throw _0x505397[_0x7d8b('0x28')](0x1f4)['send'](new db[(_0x7d8b('0xd4'))][(_0x7d8b('0xd5'))](_0x7d8b('0xdc')+_0x51538c));}if(!_[_0x7d8b('0xdd')](_0x51538c,_0x1392d6[_0x7d8b('0x6a')][_0x7d8b('0xdb')])){throw _0x505397[_0x7d8b('0x28')](0x1f4)[_0x7d8b('0xd8')](new db[(_0x7d8b('0xd4'))][(_0x7d8b('0xd5'))](_0x7d8b('0xde')+_0x51538c));}_0x1c293a[_0x1392d6[_0x7d8b('0x6a')][_0x7d8b('0xdb')]]=_0x1392d6[_0x7d8b('0x6a')]['from'];})[_0x7d8b('0x1a')](function(){return db[_0x7d8b('0x4b')]['find']({'where':{'id':_0x1392d6[_0x7d8b('0x63')]['id']},'include':[{'model':db[_0x7d8b('0xab')],'as':_0x7d8b('0xb7')},{'model':db['MailAccount'],'as':_0x7d8b('0xdf')}]});})[_0x7d8b('0x1a')](handleEntityNotFound(_0x505397,null))[_0x7d8b('0x1a')](function(_0x1d44aa){if(_0x1d44aa&&_0x1d44aa[_0x7d8b('0xb7')]){_0x24c605=_0x1d44aa;var _0x45a10e=_['defaults'](_0x1392d6['body'],{'firstName':_0x1392d6[_0x7d8b('0x6a')]['from'],'phone':_0x1392d6[_0x7d8b('0x6a')][_0x7d8b('0xaa')],'ListId':_0x1d44aa[_0x7d8b('0xa8')]});_0x45a10e[_0x1392d6[_0x7d8b('0x6a')]['mapKeyOffline']]=_0x1392d6[_0x7d8b('0x6a')][_0x7d8b('0xaa')];return db[_0x7d8b('0xac')]['findOrCreate']({'where':_0x1c293a,'defaults':_0x45a10e});}})[_0x7d8b('0xe0')](function(_0x5a2a9f){if(_0x5a2a9f){_0x1cd99f=_0x5a2a9f;var _0x5e5c19=fs['readFileSync'](path['join'](config['root'],_0x7d8b('0xe1')),'utf8');var _0x3b0c52=ejs[_0x7d8b('0xe2')](_0x5e5c19,{'body':_[_0x7d8b('0xe3')](_0x1392d6[_0x7d8b('0x6a')][_0x7d8b('0x6a')]),'bodyTitle':_0x24c605[_0x7d8b('0xe4')]});return db['ChatOfflineMessage'][_0x7d8b('0x64')]({'body':_0x3b0c52,'plainBody':htmlToText['fromString'](_0x3b0c52),'ContactId':_0x5a2a9f['id'],'ChatWebsiteId':_0x24c605['id']});}})[_0x7d8b('0x1a')](function(_0x5b8072){_0x2c0cb1=_0x5b8072;if(_0x1399d4[_0x7d8b('0x55')]){var _0x3de624=_0x1399d4['map'](function(_0x452579){return{'name':_0x452579['originalname'],'basename':_0x452579['filename'],'type':_0x452579['mimetype'],'ChatOfflineMessageId':_0x5b8072['id']};});_0x16fcd1=_0x3de624[_0x7d8b('0x4a')](_0x106928=>{var _0x2f85d1={'filename':_0x106928[_0x7d8b('0x32')],'path':path['join'](config['root'],'server',_0x7d8b('0xe5'),'attachments',_0x7d8b('0xe6'),_0x106928[_0x7d8b('0xe7')])};return _0x2f85d1;});if(!_0x24c605[_0x7d8b('0xe8')]){return db[_0x7d8b('0xe9')][_0x7d8b('0xea')](function(_0xb4192b){return db[_0x7d8b('0xeb')]['bulkCreate'](_0x3de624,{'transaction':_0xb4192b});});}}})['then'](function(){if(_0x2c0cb1){_0xfd0132=_0x2c0cb1;return db[_0x7d8b('0xdf')][_0x7d8b('0x7e')]({'where':{'service':!![]},'include':[{'model':db[_0x7d8b('0xec')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x7d8b('0xed'),'raw':!![]}]}]});}})[_0x7d8b('0x1a')](function(_0xf99f37){if(_0xf99f37&&_0xf99f37[_0x7d8b('0xee')]&&_0x24c605[_0x7d8b('0xef')]&&_0x24c605[_0x7d8b('0xf0')]){var _0xd394ba=_0xf99f37[_0x7d8b('0xf1')]();return respondWithRpcPromise(_0x7d8b('0xf2'),_0x7d8b('0xf3'),{'account':_0xd394ba,'message':{'from':util[_0x7d8b('0x3f')]('\x22%s\x22\x20<%s>',_0xf99f37['name'],_0xf99f37[_0x7d8b('0xf4')]||_0xf99f37[_0x7d8b('0xee')][_0x7d8b('0x6b')]),'to':_0x24c605[_0x7d8b('0xf0')],'subject':_0x24c605['offlineMessageSubject'],'html':_0xfd0132[_0x7d8b('0x6a')],'attachments':_0x16fcd1}},client9003)[_0x7d8b('0x1a')](function(){return _0xfd0132;})[_0x7d8b('0x25')](function(_0x11fcf5){logger['error'](_0x11fcf5);});}})[_0x7d8b('0x1a')](function(){if(_0x24c605&&_0x24c605['openNewInteraction']&&_0x24c605[_0x7d8b('0xf5')]){var _0x47df85=[];if(_0x1399d4[_0x7d8b('0x55')]){_0x47df85=_0x1399d4['map'](function(_0x32c896){return{'name':_0x32c896[_0x7d8b('0xf6')],'basename':_0x32c896['filename'],'type':_0x32c896[_0x7d8b('0xf7')],'ChatOfflineMessageId':_0x2c0cb1['id']};});}var _0x4eb770;if(!_[_0x7d8b('0x92')](_0x24c605['subjectOffline'])){var _0x401c8c=_[_0x7d8b('0x4a')](_0x1392d6[_0x7d8b('0x6a')],function(_0x1ec3d8){return _0x1ec3d8;});var _0x2657f6=_[_0x7d8b('0xf8')](_0x401c8c)[0x0];var _0x65e4a=_[_0x7d8b('0xf9')](_0x2657f6,function(_0x46ccb6){return _0x46ccb6;});_0x4eb770=_0x65e4a[0x1][_0x24c605[_0x7d8b('0xfa')]];}var _0x533557={'from':_0x1cd99f[_0x7d8b('0xf4')],'firstName':_0x1cd99f[_0x7d8b('0x3a')],'lastName':_0x1cd99f[_0x7d8b('0x3b')],'mapKey':_0x7d8b('0xf4'),'message':{'from':_0x1cd99f[_0x7d8b('0xf4')],'to':_0x24c605[_0x7d8b('0xdf')][_0x7d8b('0xf4')],'cc':'','subject':_[_0x7d8b('0x92')](_0x4eb770)?_0x24c605[_0x7d8b('0xfb')]:_0x4eb770,'messageId':'','sentAt':new Date(),'attach':_0x47df85[_0x7d8b('0x55')],'attachments':_0x47df85,'originChannel':_0x7d8b('0xfc'),'ChatWebsiteId':_0x24c605['id'],'ChatOfflineMessageId':_0xfd0132['id'],'originTo':_0x24c605[_0x7d8b('0xdf')]['email']},'body':_0xfd0132[_0x7d8b('0x6a')]};var _0x308022={'account':{'id':_0x24c605[_0x7d8b('0xf5')]},'body':_0x533557,'log':_0x7d8b('0xfd')};return respondWithRpcPromise(_0x7d8b('0xfd'),_0x7d8b('0xfe'),_0x308022,client9001)[_0x7d8b('0x1a')](function(){return _0xfd0132;})['catch'](function(_0x236dcb){logger['error'](_0x236dcb);});}return;})[_0x7d8b('0x1a')](function(){if(_0xfd0132){return _0xfd0132;}})[_0x7d8b('0x1a')](respondWithResult(_0x505397,null))[_0x7d8b('0x25')](function(){for(var _0x2ce4e3 of _0x1399d4){var _0x2a74d2=path[_0x7d8b('0x8b')](config[_0x7d8b('0x8f')],_0x7d8b('0xff'),_0x7d8b('0xe5'),_0x7d8b('0x100'),_0x7d8b('0xe6'),_0x2ce4e3[_0x7d8b('0x84')]);fs_extra[_0x7d8b('0x101')](_0x2a74d2)['catch'](function(_0x45ac32){logger[_0x7d8b('0x1f')](_0x7d8b('0x102'),_0x2a74d2,_0x45ac32);});}});};exports['addInteraction']=function(_0x3bb7fc,_0x9d869c){return db['ChatInteraction'][_0x7d8b('0x6f')]({'where':{'id':_0x3bb7fc[_0x7d8b('0x63')]['id']}})[_0x7d8b('0x1a')](handleEntityNotFound(_0x9d869c,null))[_0x7d8b('0x1a')](function(_0x414cc5){if(_0x414cc5){return _0x414cc5[_0x7d8b('0x103')](_0x3bb7fc[_0x7d8b('0x6a')][_0x7d8b('0x7c')],_[_0x7d8b('0x104')](_0x3bb7fc[_0x7d8b('0x6a')],['ids','id'])||{});}})[_0x7d8b('0x1a')](respondWithResult(_0x9d869c,null))[_0x7d8b('0x25')](handleError(_0x9d869c,null));};exports[_0x7d8b('0x105')]=function(_0x484b1c,_0x110cbd){var _0x2f9299={'raw':![],'where':{}};var _0x4c04b4={};var _0xc16242={'count':0x0,'rows':[]};return db[_0x7d8b('0x4b')]['findOne']({'where':{'id':_0x484b1c[_0x7d8b('0x63')]['id']}})[_0x7d8b('0x1a')](handleEntityNotFound(_0x110cbd,null))[_0x7d8b('0x1a')](function(_0x210733){if(_0x210733){_0x4c04b4[_0x7d8b('0x44')]=_['keys'](db[_0x7d8b('0xbc')][_0x7d8b('0x4c')]);_0x4c04b4['query']=_['keys'](_0x484b1c['query']);_0x4c04b4[_0x7d8b('0x51')]=_[_0x7d8b('0x52')](_0x4c04b4[_0x7d8b('0x44')],_0x4c04b4['query']);_0x2f9299[_0x7d8b('0x53')]=_[_0x7d8b('0x52')](_0x4c04b4[_0x7d8b('0x44')],qs[_0x7d8b('0x54')](_0x484b1c['query']['fields']));_0x2f9299[_0x7d8b('0x53')]=_0x2f9299[_0x7d8b('0x53')][_0x7d8b('0x55')]?_0x2f9299[_0x7d8b('0x53')]:_0x4c04b4[_0x7d8b('0x44')];if(!_0x484b1c['query']['hasOwnProperty']('nolimit')){_0x2f9299[_0x7d8b('0x2b')]=qs[_0x7d8b('0x2b')](_0x484b1c[_0x7d8b('0x4f')][_0x7d8b('0x2b')]);_0x2f9299[_0x7d8b('0x29')]=qs[_0x7d8b('0x29')](_0x484b1c[_0x7d8b('0x4f')][_0x7d8b('0x29')]);}_0x2f9299['order']=qs['sort'](_0x484b1c[_0x7d8b('0x4f')][_0x7d8b('0x58')]);_0x2f9299[_0x7d8b('0x59')]=qs[_0x7d8b('0x51')](_[_0x7d8b('0x5a')](_0x484b1c[_0x7d8b('0x4f')],_0x4c04b4[_0x7d8b('0x51')]));_0x2f9299[_0x7d8b('0x59')][_0x7d8b('0x79')]=_0x210733['id'];if(_0x484b1c['query'][_0x7d8b('0x5b')]){_0x2f9299[_0x7d8b('0x59')]=_[_0x7d8b('0x5c')](_0x2f9299[_0x7d8b('0x59')],{'$or':_[_0x7d8b('0x4a')](_0x2f9299[_0x7d8b('0x53')],function(_0x7f17e){var _0x28c2d3={};_0x28c2d3[_0x7f17e]={'$like':'%'+_0x484b1c['query'][_0x7d8b('0x5b')]+'%'};return _0x28c2d3;})});}_0x2f9299=_[_0x7d8b('0x5c')]({},_0x2f9299,_0x484b1c['options']);return db[_0x7d8b('0xbc')][_0x7d8b('0x2c')]({'where':_0x2f9299[_0x7d8b('0x59')]})[_0x7d8b('0x1a')](function(_0x4e70b4){_0xc16242[_0x7d8b('0x2c')]=_0x4e70b4;if(_0x484b1c[_0x7d8b('0x4f')][_0x7d8b('0x5f')]){_0x2f9299[_0x7d8b('0x7a')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x7d8b('0xc9')],'as':_0x7d8b('0x106'),'attributes':[_0x7d8b('0x32'),_0x7d8b('0x107'),_0x7d8b('0x108')],'required':![]},{'model':db[_0x7d8b('0x109')],'as':'Tags','attributes':['id','name',_0x7d8b('0x10a')],'where':_0x484b1c[_0x7d8b('0x4f')][_0x7d8b('0x10b')]?{'id':_0x484b1c['query']['tag']}:undefined,'required':_0x484b1c[_0x7d8b('0x4f')][_0x7d8b('0x10b')]?!![]:![]}];}return db[_0x7d8b('0xbc')][_0x7d8b('0x60')](_0x2f9299);})[_0x7d8b('0x1a')](function(_0x27b33e){_0xc16242[_0x7d8b('0x61')]=_0x27b33e;return _0xc16242;});}})[_0x7d8b('0x1a')](respondWithFilteredResult(_0x110cbd,_0x2f9299))['catch'](handleError(_0x110cbd,null));};exports[_0x7d8b('0x10c')]=function(_0x4dbd6,_0xd1b7c3){var _0x7ac840=0x0;var _0x36e391=0x0;var _0x5b56de=![];var _0x11f31c;var _0x47248f;return db[_0x7d8b('0x4b')][_0x7d8b('0x6f')]({'where':{'id':_0x4dbd6[_0x7d8b('0x63')]['id']},'include':[{'model':db['Interval'],'as':_0x7d8b('0x98'),'include':[{'model':db[_0x7d8b('0x98')],'as':'Intervals','attributes':['id',_0x7d8b('0xb2')]}]}]})['then'](handleEntityNotFound(_0xd1b7c3,null))[_0x7d8b('0x1a')](function(_0x3dcb17){if(_0x3dcb17){_0x11f31c=_0x3dcb17;return _0x3dcb17[_0x7d8b('0x10d')]({'raw':!![]});}})[_0x7d8b('0x1a')](function(_0xcd23c8){if(_0x11f31c){if(_0xcd23c8){_0x47248f=_0xcd23c8;}}return require(_0x7d8b('0x8c'))['getLicense']();})['then'](function(_0x3003fc){if(_0x3003fc){_0x36e391=_0x3003fc[_0x7d8b('0x10e')];_0x5b56de=_0x3003fc['custom'];}})[_0x7d8b('0x1a')](function(){return db['ChatInteraction']['count']({'where':{'closed':![]}});})[_0x7d8b('0x1a')](function(_0x3cced4){_0x7ac840=_0x3cced4;if(_0x36e391&&_0x3cced4>_0x36e391){return db[_0x7d8b('0x10f')]['findOne']({'where':{'id':0x1}})['then'](function(_0x2604c9){if(_0x2604c9){_0x2604c9[_0x7d8b('0x110')]('chatLicenseExceeded');}});}})[_0x7d8b('0x1a')](function(){var _0x1480ae=_0x11f31c[_0x7d8b('0x98')];var _0x334eba=_0x11f31c[_0x7d8b('0x9a')]||undefined;return _0x1480ae?_0x1480ae[_0x7d8b('0x9b')](_0x334eba):!![];})[_0x7d8b('0x1a')](function(_0x6a9c3b){var _0x552dc8=fs[_0x7d8b('0x111')](path[_0x7d8b('0x8b')](config[_0x7d8b('0x8f')],_0x7d8b('0x112')),'utf8');var _0x20d932=_0x7d8b('0x113');var _0xc2e92a=![];var _0x286d5c,_0x4d3339;if(_0x4dbd6['headers'][_0x7d8b('0x3d')]){_0x286d5c=new URL(_0x4dbd6[_0x7d8b('0xba')][_0x7d8b('0x3d')])['origin'];}else if(_0x4dbd6['headers'][_0x7d8b('0x114')]){_0x286d5c=new URL(_0x4dbd6['headers'][_0x7d8b('0x114')])[_0x7d8b('0x114')];}else{_0x286d5c=_0x7d8b('0x115');}_0x4d3339=typeof _0x11f31c['address'][_0x7d8b('0x39')](',')[_0x7d8b('0x6f')](function(_0x4424eb){return wildcardUtils[_0x7d8b('0x116')](_0x4424eb,_0x286d5c);})!=='undefined';var _0x47ea42={'chatVersion':_0x20d932,'chatWebsiteAddressOrigin':_0x4d3339?_0x286d5c:_0x11f31c['address'],'remote':_0x11f31c[_0x7d8b('0x117')],'query':querystring[_0x7d8b('0x1e')](_[_0x7d8b('0x5c')](_0x11f31c['get']({'plain':!![]}),{'customerIp':_0x4dbd6[_0x7d8b('0xba')][_0x7d8b('0x37')]||_0x4dbd6[_0x7d8b('0xba')]['x-real-ip']||_0x4dbd6['connection'][_0x7d8b('0x118')]||_0x4dbd6['ip'],'referer':_0x4dbd6[_0x7d8b('0xba')][_0x7d8b('0x3d')],'openedInteractions':_0x7ac840,'maxInteractions':_0x36e391,'virtual':_0x5b56de[_0x7d8b('0x10e')],'online':_0x6a9c3b,'custom':_0x5b56de,'address':_0x4d3339?_0x286d5c:null}))[_0x7d8b('0x119')](/'/g,'\x5c\x27')};_0xd1b7c3['send'](ejs[_0x7d8b('0xe2')](Mustache[_0x7d8b('0xe2')](_0x552dc8,_0x47ea42),{'proactiveActions':_0x47248f,'alignment':_0x11f31c[_0x7d8b('0x11a')],'verticalAlignment':_0x11f31c['verticalAlignment'],'div_color':_0x11f31c['color'],'labelText':_0x11f31c[_0x7d8b('0x11b')],'text_color':_0x11f31c[_0x7d8b('0x11c')],'text_button_color':_0x11f31c['textButtonColor'],'button_color':_0x11f31c[_0x7d8b('0x11d')],'background_color':_0x11f31c[_0x7d8b('0x11e')],'hideWhenOffline':_0x11f31c[_0x7d8b('0x11f')],'intervalId':_0x11f31c['IntervalId'],'isDevelopment':_0xc2e92a,'chatVersion':_0x20d932}));})[_0x7d8b('0x25')](handleError(_0xd1b7c3,null));};exports['addApplications']=function(_0x49f4b9,_0x3a94d0){var _0x31548d=_0x49f4b9[_0x7d8b('0x63')]['id'];var _0x74831c=_0x49f4b9[_0x7d8b('0x6a')];var _0x8cebfe=0xc8;var _0x259008=null;return db[_0x7d8b('0xe9')][_0x7d8b('0xea')]({'isolationLevel':db[_0x7d8b('0xe9')][_0x7d8b('0x120')][_0x7d8b('0x121')][_0x7d8b('0x122')]},function(_0xc2cde5){return db[_0x7d8b('0x4b')][_0x7d8b('0x7e')]({'where':{'id':_0x31548d},'transaction':_0xc2cde5})[_0x7d8b('0x1a')](function(_0x760fbb){if(_0x760fbb){return db['ChatApplication'][_0x7d8b('0x2f')]({'where':{'ChatWebsiteId':_0x31548d},'transaction':_0xc2cde5})[_0x7d8b('0x1a')](function(){var _0x48a9ec=_[_0x7d8b('0x4a')](_0x74831c,function(_0x871de7){_0x871de7[_0x7d8b('0x79')]=_0x31548d;return _0x871de7;});return db[_0x7d8b('0xaf')][_0x7d8b('0x123')](_0x48a9ec,{'transaction':_0xc2cde5});});}else{_0x8cebfe=0x194;_0x259008=[];}});})[_0x7d8b('0x1a')](function(){if(_0x8cebfe!==0x194){return db[_0x7d8b('0xaf')][_0x7d8b('0x124')]({'where':{'ChatWebsiteId':_0x31548d},'order':_0x7d8b('0x125')})[_0x7d8b('0x1a')](function(_0x4aebcc){_0x259008=_0x4aebcc;});}})[_0x7d8b('0x25')](function(_0x290396){_0x8cebfe=0x1f4;logger[_0x7d8b('0x1f')](_0x290396[_0x7d8b('0x31')]);if(_0x290396[_0x7d8b('0x32')]){delete _0x290396[_0x7d8b('0x32')];}_0x259008=_0x290396;})[_0x7d8b('0x126')](function(){if(_0x259008===null){_0x3a94d0[_0x7d8b('0x26')](_0x8cebfe);}else{if(_0x8cebfe===0x1f4){_0x3a94d0['status'](_0x8cebfe)[_0x7d8b('0xd8')](_0x259008);}else{_0x3a94d0[_0x7d8b('0x28')](_0x8cebfe)[_0x7d8b('0x2e')](_0x259008);}}});};exports[_0x7d8b('0x127')]=function(_0xb0c755,_0x3d4729){var _0x5cec83={};var _0x4caa74={};var _0x5d2244;var _0x15cc44;return db[_0x7d8b('0x4b')]['findOne']({'where':{'id':_0xb0c755['params']['id']}})[_0x7d8b('0x1a')](handleEntityNotFound(_0x3d4729,null))[_0x7d8b('0x1a')](function(_0x34782f){if(_0x34782f){_0x5d2244=_0x34782f;_0x4caa74[_0x7d8b('0x44')]=_[_0x7d8b('0x50')](db['ChatApplication'][_0x7d8b('0x4c')]);_0x4caa74[_0x7d8b('0x4f')]=_[_0x7d8b('0x50')](_0xb0c755[_0x7d8b('0x4f')]);_0x4caa74[_0x7d8b('0x51')]=_[_0x7d8b('0x52')](_0x4caa74[_0x7d8b('0x44')],_0x4caa74[_0x7d8b('0x4f')]);_0x5cec83[_0x7d8b('0x53')]=_[_0x7d8b('0x52')](_0x4caa74[_0x7d8b('0x44')],qs[_0x7d8b('0x54')](_0xb0c755[_0x7d8b('0x4f')]['fields']));_0x5cec83['attributes']=_0x5cec83['attributes']['length']?_0x5cec83[_0x7d8b('0x53')]:_0x4caa74['model'];_0x5cec83['order']=qs[_0x7d8b('0x58')](_0xb0c755[_0x7d8b('0x4f')]['sort']);_0x5cec83['where']=qs[_0x7d8b('0x51')](_[_0x7d8b('0x5a')](_0xb0c755[_0x7d8b('0x4f')],_0x4caa74[_0x7d8b('0x51')]));if(_0xb0c755[_0x7d8b('0x4f')][_0x7d8b('0x5b')]){_0x5cec83[_0x7d8b('0x59')]=_['merge'](_0x5cec83[_0x7d8b('0x59')],{'$or':_['map'](_0x5cec83[_0x7d8b('0x53')],function(_0x4ade56){var _0x1a3ea5={};_0x1a3ea5[_0x4ade56]={'$like':'%'+_0xb0c755[_0x7d8b('0x4f')][_0x7d8b('0x5b')]+'%'};return _0x1a3ea5;})});}_0x5cec83=_[_0x7d8b('0x5c')]({},_0x5cec83,_0xb0c755[_0x7d8b('0x5e')]);return _0x5d2244[_0x7d8b('0x127')](_0x5cec83);}})[_0x7d8b('0x1a')](function(_0x228eb1){if(_0x228eb1){_0x15cc44=_0x228eb1[_0x7d8b('0x55')];if(!_0xb0c755[_0x7d8b('0x4f')][_0x7d8b('0x80')](_0x7d8b('0x56'))){_0x5cec83['limit']=qs[_0x7d8b('0x2b')](_0xb0c755[_0x7d8b('0x4f')][_0x7d8b('0x2b')]);_0x5cec83[_0x7d8b('0x29')]=qs[_0x7d8b('0x29')](_0xb0c755[_0x7d8b('0x4f')][_0x7d8b('0x29')]);}return _0x5d2244[_0x7d8b('0x127')](_0x5cec83);}})[_0x7d8b('0x1a')](function(_0x5bbeb5){if(_0x5bbeb5){return _0x5bbeb5?{'count':_0x15cc44,'rows':_0x5bbeb5}:null;}})['then'](respondWithResult(_0x3d4729,null))[_0x7d8b('0x25')](handleError(_0x3d4729,null));};exports['addProactiveActions']=function(_0x21d2fb,_0x3f1b6c){return db[_0x7d8b('0x128')][_0x7d8b('0x6f')]({'where':{'id':_0x21d2fb[_0x7d8b('0x63')]['id']}})[_0x7d8b('0x1a')](handleEntityNotFound(_0x3f1b6c,null))[_0x7d8b('0x1a')](function(_0x83fa72){if(_0x83fa72){return _0x83fa72[_0x7d8b('0x129')](_0x21d2fb[_0x7d8b('0x6a')][_0x7d8b('0x7c')],_[_0x7d8b('0x104')](_0x21d2fb[_0x7d8b('0x6a')],[_0x7d8b('0x7c'),'id'])||{});}})['then'](respondWithResult(_0x3f1b6c,null))[_0x7d8b('0x25')](handleError(_0x3f1b6c,null));};exports[_0x7d8b('0x10d')]=function(_0x12d045,_0x5c78f2){var _0xba7c18={};var _0x207ece={};var _0x1958b6;var _0x23424d;return db[_0x7d8b('0x4b')][_0x7d8b('0x7e')]({'where':{'id':_0x12d045['params']['id']}})['then'](handleEntityNotFound(_0x5c78f2,null))[_0x7d8b('0x1a')](function(_0xeb953d){if(_0xeb953d){_0x1958b6=_0xeb953d;_0x207ece[_0x7d8b('0x44')]=_['keys'](db[_0x7d8b('0x12a')][_0x7d8b('0x4c')]);_0x207ece[_0x7d8b('0x4f')]=_['keys'](_0x12d045['query']);_0x207ece[_0x7d8b('0x51')]=_['intersection'](_0x207ece[_0x7d8b('0x44')],_0x207ece['query']);_0xba7c18[_0x7d8b('0x53')]=_[_0x7d8b('0x52')](_0x207ece[_0x7d8b('0x44')],qs[_0x7d8b('0x54')](_0x12d045[_0x7d8b('0x4f')]['fields']));_0xba7c18[_0x7d8b('0x53')]=_0xba7c18['attributes'][_0x7d8b('0x55')]?_0xba7c18[_0x7d8b('0x53')]:_0x207ece['model'];_0xba7c18[_0x7d8b('0x57')]=qs['sort'](_0x12d045[_0x7d8b('0x4f')][_0x7d8b('0x58')]);_0xba7c18[_0x7d8b('0x59')]=qs['filters'](_[_0x7d8b('0x5a')](_0x12d045[_0x7d8b('0x4f')],_0x207ece[_0x7d8b('0x51')]));if(_0x12d045[_0x7d8b('0x4f')]['filter']){_0xba7c18[_0x7d8b('0x59')]=_[_0x7d8b('0x5c')](_0xba7c18[_0x7d8b('0x59')],{'$or':_['map'](_0xba7c18[_0x7d8b('0x53')],function(_0xc84036){var _0x2b494c={};_0x2b494c[_0xc84036]={'$like':'%'+_0x12d045[_0x7d8b('0x4f')][_0x7d8b('0x5b')]+'%'};return _0x2b494c;})});}_0xba7c18=_[_0x7d8b('0x5c')]({},_0xba7c18,_0x12d045['options']);return _0x1958b6['getProactiveActions'](_0xba7c18);}})[_0x7d8b('0x1a')](function(_0x5b9294){if(_0x5b9294){_0x23424d=_0x5b9294[_0x7d8b('0x55')];if(!_0x12d045[_0x7d8b('0x4f')][_0x7d8b('0x80')](_0x7d8b('0x56'))){_0xba7c18[_0x7d8b('0x2b')]=qs[_0x7d8b('0x2b')](_0x12d045[_0x7d8b('0x4f')]['limit']);_0xba7c18[_0x7d8b('0x29')]=qs[_0x7d8b('0x29')](_0x12d045[_0x7d8b('0x4f')][_0x7d8b('0x29')]);}return _0x1958b6[_0x7d8b('0x10d')](_0xba7c18);}})[_0x7d8b('0x1a')](function(_0x2dc496){if(_0x2dc496){return _0x2dc496?{'count':_0x23424d,'rows':_0x2dc496}:null;}})[_0x7d8b('0x1a')](respondWithResult(_0x5c78f2,null))[_0x7d8b('0x25')](handleError(_0x5c78f2,null));};exports[_0x7d8b('0x12b')]=function(_0x57e5ec,_0x595450){var _0x5d2d3d=_0x57e5ec['query']['online']==='false'?_0x7d8b('0x12c'):_0x7d8b('0x12d');return db[_0x7d8b('0x4b')][_0x7d8b('0x6f')]({'attributes':['id',_0x5d2d3d],'where':{'id':_0x57e5ec[_0x7d8b('0x63')]['id']}})[_0x7d8b('0x1a')](handleEntityNotFound(_0x595450,null))[_0x7d8b('0x1a')](function(_0x40178b){if(_0x40178b){var _0x4d1838=_0x40178b[_0x5d2d3d];var _0x57b4c8=_0x4d1838&&_0x4d1838['items']?_0x4d1838['items']:[];_0x595450['send']({'fromKey':_[_0x7d8b('0x92')](_0x4d1838[_0x7d8b('0x12e')])?undefined:_0x4d1838[_0x7d8b('0x12e')],'count':_0x57b4c8['length'],'rows':_0x57b4c8});}})[_0x7d8b('0x25')](handleError(_0x595450,null));};exports[_0x7d8b('0x12f')]=function(_0x4aac16,_0x1040ba){var _0x4f897b={'raw':![],'where':{}};var _0x4e1816={};var _0x4974f9={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x7d8b('0x7e')]({'where':{'id':_0x4aac16[_0x7d8b('0x63')]['id']}})[_0x7d8b('0x1a')](handleEntityNotFound(_0x1040ba,null))[_0x7d8b('0x1a')](function(_0xebdaca){if(_0xebdaca){_0x4e1816[_0x7d8b('0x44')]=_[_0x7d8b('0x50')](db['ChatOfflineMessage'][_0x7d8b('0x4c')]);_0x4e1816[_0x7d8b('0x4f')]=_[_0x7d8b('0x50')](_0x4aac16[_0x7d8b('0x4f')]);_0x4e1816['filters']=_[_0x7d8b('0x52')](_0x4e1816[_0x7d8b('0x44')],_0x4e1816['query']);_0x4f897b[_0x7d8b('0x53')]=_[_0x7d8b('0x52')](_0x4e1816[_0x7d8b('0x44')],qs[_0x7d8b('0x54')](_0x4aac16[_0x7d8b('0x4f')][_0x7d8b('0x54')]));_0x4f897b[_0x7d8b('0x53')]=_0x4f897b['attributes'][_0x7d8b('0x55')]?_0x4f897b['attributes']:_0x4e1816[_0x7d8b('0x44')];if(!_0x4aac16[_0x7d8b('0x4f')]['hasOwnProperty'](_0x7d8b('0x56'))){_0x4f897b['limit']=qs[_0x7d8b('0x2b')](_0x4aac16['query']['limit']);_0x4f897b[_0x7d8b('0x29')]=qs[_0x7d8b('0x29')](_0x4aac16[_0x7d8b('0x4f')]['offset']);}_0x4f897b[_0x7d8b('0x57')]=qs[_0x7d8b('0x58')](_0x4aac16[_0x7d8b('0x4f')][_0x7d8b('0x58')]);_0x4f897b['where']=qs[_0x7d8b('0x51')](_[_0x7d8b('0x5a')](_0x4aac16['query'],_0x4e1816['filters']));_0x4f897b['where'][_0x7d8b('0x79')]=_0xebdaca['id'];if(_0x4aac16['query'][_0x7d8b('0x5b')]){_0x4f897b[_0x7d8b('0x59')]=_[_0x7d8b('0x5c')](_0x4f897b[_0x7d8b('0x59')],{'$or':_['map'](_0x4f897b['attributes'],function(_0x4a7d80){var _0x16708c={};_0x16708c[_0x4a7d80]={'$like':'%'+_0x4aac16[_0x7d8b('0x4f')][_0x7d8b('0x5b')]+'%'};return _0x16708c;})});}_0x4f897b=_[_0x7d8b('0x5c')]({},_0x4f897b,_0x4aac16['options']);return db[_0x7d8b('0x130')]['count']({'where':_0x4f897b[_0x7d8b('0x59')]})['then'](function(_0x192da1){_0x4974f9[_0x7d8b('0x2c')]=_0x192da1;if(_0x4aac16[_0x7d8b('0x4f')][_0x7d8b('0x5f')]){_0x4f897b[_0x7d8b('0x7a')]=[{'all':!![]}];}else{_0x4f897b[_0x7d8b('0x7a')]=[{'model':db[_0x7d8b('0xac')],'as':_0x7d8b('0x131'),'required':![]},{'model':db[_0x7d8b('0xeb')],'as':'Attachments','required':![]}];}return db['ChatOfflineMessage'][_0x7d8b('0x60')](_0x4f897b);})[_0x7d8b('0x1a')](function(_0xd11a00){_0x4974f9[_0x7d8b('0x61')]=_0xd11a00;return _0x4974f9;});}})[_0x7d8b('0x1a')](respondWithFilteredResult(_0x1040ba,_0x4f897b))[_0x7d8b('0x25')](handleError(_0x1040ba,null));};exports['addAgents']=function(_0x4468ae,_0x432d06){return db['ChatWebsite'][_0x7d8b('0x6f')]({'where':{'id':_0x4468ae['params']['id']}})[_0x7d8b('0x1a')](handleEntityNotFound(_0x432d06,null))['then'](function(_0x4d4827){if(_0x4d4827){return _0x4d4827[_0x7d8b('0x132')](_0x4468ae[_0x7d8b('0x6a')]['ids'],_['omit'](_0x4468ae[_0x7d8b('0x6a')],['ids','id'])||{})['spread'](function(_0x64ee28){for(var _0x14a830=0x0;_0x14a830<_0x4468ae[_0x7d8b('0x6a')][_0x7d8b('0x7c')][_0x7d8b('0x55')];_0x14a830+=0x1){socket[_0x7d8b('0x133')](_0x7d8b('0x134'),{'UserId':Number(_0x4468ae[_0x7d8b('0x6a')]['ids'][_0x14a830]),'ChatWebsiteId':Number(_0x4468ae['params']['id'])});}return _0x64ee28;});}})[_0x7d8b('0x1a')](respondWithResult(_0x432d06,null))[_0x7d8b('0x25')](handleError(_0x432d06,null));};exports['removeAgents']=function(_0x441e7e,_0x4ddceb){return db[_0x7d8b('0x4b')]['find']({'where':{'id':_0x441e7e['params']['id']}})[_0x7d8b('0x1a')](handleEntityNotFound(_0x4ddceb,null))[_0x7d8b('0x1a')](function(_0x33f3af){if(_0x33f3af){return _0x33f3af[_0x7d8b('0x135')](_0x441e7e[_0x7d8b('0x4f')][_0x7d8b('0x7c')])[_0x7d8b('0x1a')](function(){if(_['isArray'](_0x441e7e[_0x7d8b('0x4f')][_0x7d8b('0x7c')])){for(var _0x1c0436=0x0;_0x1c0436<_0x441e7e[_0x7d8b('0x4f')]['ids'][_0x7d8b('0x55')];_0x1c0436+=0x1){socket[_0x7d8b('0x133')](_0x7d8b('0x136'),{'UserId':Number(_0x441e7e[_0x7d8b('0x4f')][_0x7d8b('0x7c')][_0x1c0436]),'ChatWebsiteId':Number(_0x441e7e['params']['id'])});}}else{socket[_0x7d8b('0x133')]('userChatWebsite:remove',{'UserId':Number(_0x441e7e[_0x7d8b('0x4f')][_0x7d8b('0x7c')]),'ChatWebsiteId':Number(_0x441e7e['params']['id'])});}});}})['then'](respondWithStatusCode(_0x4ddceb,null))[_0x7d8b('0x25')](handleError(_0x4ddceb,null));};exports[_0x7d8b('0x137')]=function(_0x3565f7,_0x2d1956){var _0x27d8fd={};var _0x14bbd0={};var _0x1be392;var _0x1184ed;return db[_0x7d8b('0x4b')][_0x7d8b('0x7e')]({'where':{'id':_0x3565f7[_0x7d8b('0x63')]['id']}})[_0x7d8b('0x1a')](handleEntityNotFound(_0x2d1956,null))[_0x7d8b('0x1a')](function(_0x2e5321){if(_0x2e5321){_0x1be392=_0x2e5321;_0x14bbd0[_0x7d8b('0x44')]=_[_0x7d8b('0x50')](db[_0x7d8b('0xc9')][_0x7d8b('0x4c')]);_0x14bbd0[_0x7d8b('0x4f')]=_['keys'](_0x3565f7[_0x7d8b('0x4f')]);_0x14bbd0[_0x7d8b('0x51')]=_['intersection'](_0x14bbd0[_0x7d8b('0x44')],_0x14bbd0['query']);_0x27d8fd[_0x7d8b('0x53')]=_['intersection'](_0x14bbd0['model'],qs['fields'](_0x3565f7[_0x7d8b('0x4f')][_0x7d8b('0x54')]));_0x27d8fd['attributes']=_0x27d8fd[_0x7d8b('0x53')][_0x7d8b('0x55')]?_0x27d8fd[_0x7d8b('0x53')]:_0x14bbd0[_0x7d8b('0x44')];_0x27d8fd[_0x7d8b('0x57')]=qs[_0x7d8b('0x58')](_0x3565f7[_0x7d8b('0x4f')][_0x7d8b('0x58')]);_0x27d8fd[_0x7d8b('0x59')]=qs[_0x7d8b('0x51')](_[_0x7d8b('0x5a')](_0x3565f7['query'],_0x14bbd0[_0x7d8b('0x51')]));if(_0x3565f7[_0x7d8b('0x4f')][_0x7d8b('0x5b')]){_0x27d8fd['where']=_[_0x7d8b('0x5c')](_0x27d8fd[_0x7d8b('0x59')],{'$or':_[_0x7d8b('0x4a')](_0x27d8fd[_0x7d8b('0x53')],function(_0x52e05e){var _0x3e5817={};_0x3e5817[_0x52e05e]={'$like':'%'+_0x3565f7[_0x7d8b('0x4f')][_0x7d8b('0x5b')]+'%'};return _0x3e5817;})});}_0x27d8fd=_[_0x7d8b('0x5c')]({},_0x27d8fd,_0x3565f7[_0x7d8b('0x5e')]);return _0x1be392['getAgents'](_0x27d8fd);}})[_0x7d8b('0x1a')](function(_0x2b6136){if(_0x2b6136){_0x1184ed=_0x2b6136[_0x7d8b('0x55')];if(!_0x3565f7[_0x7d8b('0x4f')][_0x7d8b('0x80')](_0x7d8b('0x56'))){_0x27d8fd[_0x7d8b('0x2b')]=qs[_0x7d8b('0x2b')](_0x3565f7[_0x7d8b('0x4f')][_0x7d8b('0x2b')]);_0x27d8fd[_0x7d8b('0x29')]=qs['offset'](_0x3565f7['query'][_0x7d8b('0x29')]);}return _0x1be392['getAgents'](_0x27d8fd);}})[_0x7d8b('0x1a')](function(_0x141d2d){if(_0x141d2d){return _0x141d2d?{'count':_0x1184ed,'rows':_0x141d2d}:null;}})[_0x7d8b('0x1a')](respondWithResult(_0x2d1956,null))[_0x7d8b('0x25')](handleError(_0x2d1956,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 181ad45..af63daa 100644
--- a/server/api/chatWebsite/chatWebsite.events.js
+++ b/server/api/chatWebsite/chatWebsite.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0851=['ChatWebsite','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x8b3293,_0xada7e6){var _0x2e92a9=function(_0x4be383){while(--_0x4be383){_0x8b3293['push'](_0x8b3293['shift']());}};_0x2e92a9(++_0xada7e6);}(_0x0851,0x8a));var _0x1085=function(_0x300a26,_0x1ad864){_0x300a26=_0x300a26-0x0;var _0x43bccd=_0x0851[_0x300a26];return _0x43bccd;};'use strict';var EventEmitter=require(_0x1085('0x0'));var ChatWebsite=require(_0x1085('0x1'))['db'][_0x1085('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x1085('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1085('0x4'),'afterDestroy':_0x1085('0x5')};function emitEvent(_0x2de96f){return function(_0x3cbd88,_0x3b40fb,_0x3a528e){ChatWebsiteEvents[_0x1085('0x6')](_0x2de96f+':'+_0x3cbd88['id'],_0x3cbd88);ChatWebsiteEvents[_0x1085('0x6')](_0x2de96f,_0x3cbd88);_0x3a528e(null);};}for(var e in events){if(events[_0x1085('0x7')](e)){var event=events[e];ChatWebsite[_0x1085('0x8')](e,emitEvent(event));}}module[_0x1085('0x9')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0xf021=['emit','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','remove'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xf021,0x18f));var _0x1f02=function(_0x31e965,_0xbd1e54){_0x31e965=_0x31e965-0x0;var _0x120351=_0xf021[_0x31e965];return _0x120351;};'use strict';var EventEmitter=require(_0x1f02('0x0'));var ChatWebsite=require(_0x1f02('0x1'))['db'][_0x1f02('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x1f02('0x3')](0x0);var events={'afterCreate':_0x1f02('0x4'),'afterUpdate':'update','afterDestroy':_0x1f02('0x5')};function emitEvent(_0x54cd44){return function(_0x2e8594,_0x3164f0,_0x51eff6){ChatWebsiteEvents['emit'](_0x54cd44+':'+_0x2e8594['id'],_0x2e8594);ChatWebsiteEvents[_0x1f02('0x6')](_0x54cd44,_0x2e8594);_0x51eff6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x1f02('0x7')](e,emitEvent(event));}}module[_0x1f02('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 4c5a2d0..d3ce412 100644
--- a/server/api/chatWebsite/chatWebsite.model.js
+++ b/server/api/chatWebsite/chatWebsite.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc997=['ChatWebsite','chat_websites','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define'];(function(_0x5df15f,_0x5a3754){var _0x4ef828=function(_0x5ac12e){while(--_0x5ac12e){_0x5df15f['push'](_0x5df15f['shift']());}};_0x4ef828(++_0x5a3754);}(_0xc997,0x198));var _0x7c99=function(_0x42cc9f,_0x5cc832){_0x42cc9f=_0x42cc9f-0x0;var _0x28abfd=_0xc997[_0x42cc9f];return _0x28abfd;};'use strict';var _=require(_0x7c99('0x0'));var util=require('util');var logger=require(_0x7c99('0x1'))(_0x7c99('0x2'));var moment=require(_0x7c99('0x3'));var BPromise=require(_0x7c99('0x4'));var rp=require(_0x7c99('0x5'));var fs=require('fs');var path=require(_0x7c99('0x6'));var rimraf=require(_0x7c99('0x7'));var config=require(_0x7c99('0x8'));var attributes=require(_0x7c99('0x9'));module[_0x7c99('0xa')]=function(_0x1717d9,_0x5d51d8){return _0x1717d9[_0x7c99('0xb')](_0x7c99('0xc'),attributes,{'tableName':_0x7c99('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4187=['request-promise','rimraf','../../config/environment','./chatWebsite.attributes','exports','ChatWebsite','chat_websites','api','moment','bluebird'];(function(_0x52e363,_0x48062a){var _0x3fc2b5=function(_0x1b0cf9){while(--_0x1b0cf9){_0x52e363['push'](_0x52e363['shift']());}};_0x3fc2b5(++_0x48062a);}(_0x4187,0x133));var _0x7418=function(_0x14e362,_0x40c3ab){_0x14e362=_0x14e362-0x0;var _0x53df45=_0x4187[_0x14e362];return _0x53df45;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x7418('0x0'));var moment=require(_0x7418('0x1'));var BPromise=require(_0x7418('0x2'));var rp=require(_0x7418('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7418('0x4'));var config=require(_0x7418('0x5'));var attributes=require(_0x7418('0x6'));module[_0x7418('0x7')]=function(_0x2bde5f,_0x210b13){return _0x2bde5f['define'](_0x7418('0x8'),attributes,{'tableName':_0x7418('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index 06102c9..f74b956 100644
--- a/server/api/chatWebsite/chatWebsite.rpc.js
+++ b/server/api/chatWebsite/chatWebsite.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb133=['ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x22d3e3,_0x2b59ee){var _0x4ba195=function(_0x32a27e){while(--_0x32a27e){_0x22d3e3['push'](_0x22d3e3['shift']());}};_0x4ba195(++_0x2b59ee);}(_0xb133,0x13b));var _0x3b13=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xb133[_0x4ff09b];return _0x3f5c2e;};'use strict';var _=require('lodash');var util=require(_0x3b13('0x0'));var moment=require(_0x3b13('0x1'));var BPromise=require('bluebird');var rs=require(_0x3b13('0x2'));var fs=require('fs');var Redis=require(_0x3b13('0x3'));var db=require(_0x3b13('0x4'))['db'];var utils=require(_0x3b13('0x5'));var logger=require(_0x3b13('0x6'))('rpc');var config=require(_0x3b13('0x7'));var jayson=require(_0x3b13('0x8'));var client=jayson['client'][_0x3b13('0x9')]({'port':0x232a});config['redis']=_[_0x3b13('0xa')](config[_0x3b13('0xb')],{'host':_0x3b13('0xc'),'port':0x18eb});var socket=require(_0x3b13('0xd'))(new Redis(config[_0x3b13('0xb')]));require(_0x3b13('0xe'))[_0x3b13('0xf')](socket);function respondWithRpcPromise(_0x5c3758,_0x529ca4,_0x591d67){return new BPromise(function(_0x535969,_0x51dec9){return client['request'](_0x5c3758,_0x591d67)[_0x3b13('0x10')](function(_0x2b5773){logger[_0x3b13('0x11')](_0x3b13('0x12'),_0x529ca4,_0x3b13('0x13'));logger[_0x3b13('0x14')](_0x3b13('0x15'),_0x529ca4,'request\x20sent',JSON[_0x3b13('0x16')](_0x2b5773));if(_0x2b5773['error']){if(_0x2b5773[_0x3b13('0x17')][_0x3b13('0x18')]===0x1f4){logger[_0x3b13('0x17')](_0x3b13('0x12'),_0x529ca4,_0x2b5773[_0x3b13('0x17')][_0x3b13('0x19')]);return _0x51dec9(_0x2b5773[_0x3b13('0x17')][_0x3b13('0x19')]);}logger[_0x3b13('0x17')](_0x3b13('0x12'),_0x529ca4,_0x2b5773['error'][_0x3b13('0x19')]);return _0x535969(_0x2b5773['error'][_0x3b13('0x19')]);}else{logger[_0x3b13('0x11')](_0x3b13('0x12'),_0x529ca4,_0x3b13('0x13'));_0x535969(_0x2b5773[_0x3b13('0x1a')][_0x3b13('0x19')]);}})[_0x3b13('0x1b')](function(_0x503add){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x529ca4,_0x503add);_0x51dec9(_0x503add);});});}
\ No newline at end of file
+var _0xa550=['ChatWebsite,\x20%s,\x20%s','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','request\x20sent','debug','stringify','error','code','message'];(function(_0x503923,_0xb36a50){var _0x452bf2=function(_0x17cb98){while(--_0x17cb98){_0x503923['push'](_0x503923['shift']());}};_0x452bf2(++_0xb36a50);}(_0xa550,0x98));var _0x0a55=function(_0x37b07c,_0x5941a1){_0x37b07c=_0x37b07c-0x0;var _0x264672=_0xa550[_0x37b07c];return _0x264672;};'use strict';var _=require('lodash');var util=require(_0x0a55('0x0'));var moment=require(_0x0a55('0x1'));var BPromise=require(_0x0a55('0x2'));var rs=require(_0x0a55('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0a55('0x4'))['db'];var utils=require(_0x0a55('0x5'));var logger=require(_0x0a55('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0a55('0x7'));var client=jayson[_0x0a55('0x8')][_0x0a55('0x9')]({'port':0x232a});config[_0x0a55('0xa')]=_[_0x0a55('0xb')](config[_0x0a55('0xa')],{'host':_0x0a55('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a55('0xa')]));require('./chatWebsite.socket')[_0x0a55('0xd')](socket);function respondWithRpcPromise(_0x45ce91,_0x2e0948,_0x2f6fc7){return new BPromise(function(_0x43f64b,_0xb2b7d8){return client[_0x0a55('0xe')](_0x45ce91,_0x2f6fc7)[_0x0a55('0xf')](function(_0x4ad126){logger[_0x0a55('0x10')]('ChatWebsite,\x20%s,\x20%s',_0x2e0948,_0x0a55('0x11'));logger[_0x0a55('0x12')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x2e0948,'request\x20sent',JSON[_0x0a55('0x13')](_0x4ad126));if(_0x4ad126[_0x0a55('0x14')]){if(_0x4ad126['error'][_0x0a55('0x15')]===0x1f4){logger[_0x0a55('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x2e0948,_0x4ad126[_0x0a55('0x14')][_0x0a55('0x16')]);return _0xb2b7d8(_0x4ad126[_0x0a55('0x14')][_0x0a55('0x16')]);}logger[_0x0a55('0x14')](_0x0a55('0x17'),_0x2e0948,_0x4ad126[_0x0a55('0x14')][_0x0a55('0x16')]);return _0x43f64b(_0x4ad126[_0x0a55('0x14')][_0x0a55('0x16')]);}else{logger[_0x0a55('0x10')](_0x0a55('0x17'),_0x2e0948,'request\x20sent');_0x43f64b(_0x4ad126[_0x0a55('0x18')][_0x0a55('0x16')]);}})['catch'](function(_0x5e4521){logger[_0x0a55('0x14')](_0x0a55('0x17'),_0x2e0948,_0x5e4521);_0xb2b7d8(_0x5e4521);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 7cc7ca2..987973d 100644
--- a/server/api/chatWebsite/chatWebsite.socket.js
+++ b/server/api/chatWebsite/chatWebsite.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x541e=['register','length','./chatWebsite.events','remove','update','emit','removeListener'];(function(_0x482821,_0x4c142d){var _0x3e4aa5=function(_0x6116b1){while(--_0x6116b1){_0x482821['push'](_0x482821['shift']());}};_0x3e4aa5(++_0x4c142d);}(_0x541e,0xc6));var _0xe541=function(_0x541078,_0x5c5aef){_0x541078=_0x541078-0x0;var _0x1518d5=_0x541e[_0x541078];return _0x1518d5;};'use strict';var ChatWebsiteEvents=require(_0xe541('0x0'));var events=['save',_0xe541('0x1'),_0xe541('0x2')];function createListener(_0x5dd4c9,_0xc0b9ba){return function(_0x159d72){_0xc0b9ba[_0xe541('0x3')](_0x5dd4c9,_0x159d72);};}function removeListener(_0xb15bfd,_0x40e5b7){return function(){ChatWebsiteEvents[_0xe541('0x4')](_0xb15bfd,_0x40e5b7);};}exports[_0xe541('0x5')]=function(_0xaab847){for(var _0x574af6=0x0,_0x5e253f=events[_0xe541('0x6')];_0x574af6<_0x5e253f;_0x574af6++){var _0x49f69d=events[_0x574af6];var _0x40128e=createListener('chatWebsite:'+_0x49f69d,_0xaab847);ChatWebsiteEvents['on'](_0x49f69d,_0x40128e);}};
\ No newline at end of file
+var _0x17a4=['emit','register','length','chatWebsite:','save','remove','update'];(function(_0x1f76f2,_0xf20812){var _0x26cb60=function(_0x1d4b6b){while(--_0x1d4b6b){_0x1f76f2['push'](_0x1f76f2['shift']());}};_0x26cb60(++_0xf20812);}(_0x17a4,0x15b));var _0x417a=function(_0xf168d3,_0x43dcfc){_0xf168d3=_0xf168d3-0x0;var _0x17fb54=_0x17a4[_0xf168d3];return _0x17fb54;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x417a('0x0'),_0x417a('0x1'),_0x417a('0x2')];function createListener(_0x347f73,_0x13511c){return function(_0x1594b6){_0x13511c[_0x417a('0x3')](_0x347f73,_0x1594b6);};}function removeListener(_0x323efb,_0x6cf28b){return function(){ChatWebsiteEvents['removeListener'](_0x323efb,_0x6cf28b);};}exports[_0x417a('0x4')]=function(_0xa626ba){for(var _0x3caaeb=0x0,_0xc2309b=events[_0x417a('0x5')];_0x3caaeb<_0xc2309b;_0x3caaeb++){var _0x24467e=events[_0x3caaeb];var _0x13d2a3=createListener(_0x417a('0x6')+_0x24467e,_0xa626ba);ChatWebsiteEvents['on'](_0x24467e,_0x13d2a3);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/helpers/wildcard-expressions.js b/server/api/chatWebsite/helpers/wildcard-expressions.js
index fed0dd3..a869fdc 100644
--- a/server/api/chatWebsite/helpers/wildcard-expressions.js
+++ b/server/api/chatWebsite/helpers/wildcard-expressions.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc599=['replace','exports','escapeRegExp','URL','localhost','test'];(function(_0x4fd737,_0x27cd51){var _0x25b944=function(_0x2cc749){while(--_0x2cc749){_0x4fd737['push'](_0x4fd737['shift']());}};_0x25b944(++_0x27cd51);}(_0xc599,0x1b2));var _0x9c59=function(_0x4754b9,_0x50664f){_0x4754b9=_0x4754b9-0x0;var _0x2fec82=_0xc599[_0x4754b9];return _0x2fec82;};var escapeRegExp=require('../../../utils/misc')[_0x9c59('0x0')];var URL=require('url')[_0x9c59('0x1')];function testWildcardValidity(_0x3c64d1){var _0xa21af2=!![];try{new URL(_0x3c64d1['replace']('*',_0x9c59('0x2')));}catch(_0x129a0c){_0xa21af2=![];}return _0xa21af2&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0x9c59('0x3')](_0x3c64d1);}function testWebsiteWithWildcard(_0x2f16df,_0xed605c){var _0x143652;var _0x470ec3=escapeRegExp(_0x2f16df['trim']()['replace'](/\/$/,''))[_0x9c59('0x4')]('\x5c*','([\x5cw]+)');try{new URL(_0x2f16df[_0x9c59('0x4')]('\x5c*','localhost'));_0x143652=new RegExp(_0x470ec3)[_0x9c59('0x3')](_0xed605c);}catch(_0x458903){_0x143652=![];}return _0x143652;}module[_0x9c59('0x5')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity};
\ No newline at end of file
+var _0x9af6=['escapeRegExp','url','test','trim','replace','([\x5cw]+)','localhost','../../../utils/misc'];(function(_0x45fa54,_0x204790){var _0x3dd2eb=function(_0x38c6a7){while(--_0x38c6a7){_0x45fa54['push'](_0x45fa54['shift']());}};_0x3dd2eb(++_0x204790);}(_0x9af6,0x1d7));var _0x69af=function(_0x20153e,_0x459a1a){_0x20153e=_0x20153e-0x0;var _0x2c621a=_0x9af6[_0x20153e];return _0x2c621a;};var escapeRegExp=require(_0x69af('0x0'))[_0x69af('0x1')];var URL=require(_0x69af('0x2'))['URL'];function testWildcardValidity(_0x5cdef7){var _0x3c6ca8=!![];try{new URL(_0x5cdef7['replace']('*','localhost'));}catch(_0x185b85){_0x3c6ca8=![];}return _0x3c6ca8&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0x69af('0x3')](_0x5cdef7);}function testWebsiteWithWildcard(_0x2b73be,_0x5ba22a){var _0x3848c6;var _0x54e2f1=escapeRegExp(_0x2b73be[_0x69af('0x4')]()[_0x69af('0x5')](/\/$/,''))[_0x69af('0x5')]('\x5c*',_0x69af('0x6'));try{new URL(_0x2b73be[_0x69af('0x5')]('\x5c*',_0x69af('0x7')));_0x3848c6=new RegExp(_0x54e2f1)[_0x69af('0x3')](_0x5ba22a);}catch(_0x37ee87){_0x3848c6=![];}return _0x3848c6;}module['exports']={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index c260398..87e5e0c 100644
--- a/server/api/chatWebsite/index.js
+++ b/server/api/chatWebsite/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd4d0=['addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','single','file','addAvatar','server/files/images/avatars/','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','replace','extname','/:id/offline','offline','addInteraction','addApplications','addProactiveActions','addAgents','put','delete','/:id/dispositions','removeDispositions','removeAnswers','removeAgents','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/canned_answers','/:id/logo','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','create','post','addDisposition'];(function(_0x503185,_0x20d261){var _0xb29eff=function(_0x15e65e){while(--_0x15e65e){_0x503185['push'](_0x503185['shift']());}};_0xb29eff(++_0x20d261);}(_0xd4d0,0xb6));var _0x0d4d=function(_0x5e028b,_0x149511){_0x5e028b=_0x5e028b-0x0;var _0x1f2f05=_0xd4d0[_0x5e028b];return _0x1f2f05;};'use strict';var multer=require(_0x0d4d('0x0'));var util=require(_0x0d4d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0d4d('0x2'));var router=express['Router']();var fs_extra=require(_0x0d4d('0x3'));var auth=require(_0x0d4d('0x4'));var interaction=require(_0x0d4d('0x5'));var config=require(_0x0d4d('0x6'));var controller=require(_0x0d4d('0x7'));router[_0x0d4d('0x8')]('/',auth[_0x0d4d('0x9')](),controller[_0x0d4d('0xa')]);router[_0x0d4d('0x8')](_0x0d4d('0xb'),auth[_0x0d4d('0x9')](),controller[_0x0d4d('0xc')]);router[_0x0d4d('0x8')](_0x0d4d('0xd'),auth[_0x0d4d('0x9')](),controller[_0x0d4d('0xe')]);router['get']('/:id/dispositions',auth[_0x0d4d('0x9')](),controller['getDispositions']);router[_0x0d4d('0x8')](_0x0d4d('0xf'),auth[_0x0d4d('0x9')](),controller['getAnswers']);router[_0x0d4d('0x8')](_0x0d4d('0x10'),controller[_0x0d4d('0x11')]);router[_0x0d4d('0x8')](_0x0d4d('0x12'),controller['getAvatar']);router[_0x0d4d('0x8')](_0x0d4d('0x13'),controller[_0x0d4d('0x14')]);router['get'](_0x0d4d('0x15'),controller[_0x0d4d('0x16')]);router[_0x0d4d('0x8')](_0x0d4d('0x17'),auth[_0x0d4d('0x9')](),controller[_0x0d4d('0x18')]);router[_0x0d4d('0x8')](_0x0d4d('0x19'),controller[_0x0d4d('0x1a')]);router['get'](_0x0d4d('0x1b'),auth[_0x0d4d('0x9')](),controller[_0x0d4d('0x1c')]);router[_0x0d4d('0x8')](_0x0d4d('0x1d'),auth[_0x0d4d('0x9')](),controller[_0x0d4d('0x1e')]);router[_0x0d4d('0x8')](_0x0d4d('0x1f'),controller[_0x0d4d('0x20')]);router[_0x0d4d('0x8')](_0x0d4d('0x21'),auth['isAuthenticated'](),controller[_0x0d4d('0x22')]);router[_0x0d4d('0x8')](_0x0d4d('0x23'),auth[_0x0d4d('0x9')](),controller[_0x0d4d('0x24')]);router['post']('/',auth[_0x0d4d('0x9')](),controller[_0x0d4d('0x25')]);router[_0x0d4d('0x26')]('/:id/dispositions',auth[_0x0d4d('0x9')](),controller[_0x0d4d('0x27')]);router[_0x0d4d('0x26')](_0x0d4d('0xf'),auth[_0x0d4d('0x9')](),controller[_0x0d4d('0x28')]);var upload=multer({'storage':multer[_0x0d4d('0x29')]({'destination':function(_0x4c5956,_0x19d579,_0x4a335e){_0x4a335e(null,path[_0x0d4d('0x2a')](config[_0x0d4d('0x2b')],_0x0d4d('0x2c')));},'filename':function(_0x32fab3,_0x2f1011,_0x149ac7){_0x149ac7(null,util[_0x0d4d('0x2d')](_0x0d4d('0x2e'),Date[_0x0d4d('0x2f')](),_0x2f1011[_0x0d4d('0x30')]));}})});router['post']('/:id/logo',upload[_0x0d4d('0x31')](_0x0d4d('0x32')),controller['addLogo']);var upload=multer({'storage':multer[_0x0d4d('0x29')]({'destination':function(_0x88dd8d,_0x24f633,_0x89f6e7){_0x89f6e7(null,path[_0x0d4d('0x2a')](config[_0x0d4d('0x2b')],'server/files/images/avatars/'));},'filename':function(_0x540504,_0x4a311c,_0x474629){_0x474629(null,util[_0x0d4d('0x2d')]('%s-%s',Date[_0x0d4d('0x2f')](),_0x4a311c[_0x0d4d('0x30')]));}})});router[_0x0d4d('0x26')](_0x0d4d('0x12'),upload[_0x0d4d('0x31')](_0x0d4d('0x32')),controller[_0x0d4d('0x33')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3aab1e,_0x50c322,_0x4fd851){_0x4fd851(null,path[_0x0d4d('0x2a')](config['root'],_0x0d4d('0x34')));},'filename':function(_0x4e353c,_0x58dbac,_0x59da7a){_0x59da7a(null,util[_0x0d4d('0x2d')]('%s-%s',Date[_0x0d4d('0x2f')](),_0x58dbac[_0x0d4d('0x30')]));}})});router[_0x0d4d('0x26')](_0x0d4d('0x13'),upload[_0x0d4d('0x31')](_0x0d4d('0x32')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x0d4d('0x29')]({'destination':function(_0x410c29,_0x35aca1,_0x141e4b){_0x141e4b(null,path[_0x0d4d('0x2a')](config[_0x0d4d('0x2b')],_0x0d4d('0x34')));},'filename':function(_0x1e55d6,_0x13c875,_0x292a11){_0x292a11(null,util['format'](_0x0d4d('0x2e'),Date['now'](),_0x13c875[_0x0d4d('0x30')]));}})});router[_0x0d4d('0x26')](_0x0d4d('0x15'),upload[_0x0d4d('0x31')](_0x0d4d('0x32')),controller[_0x0d4d('0x35')]);router['post'](_0x0d4d('0x36'),controller[_0x0d4d('0x37')]);const offlineUploadMulter=multer({'storage':multer[_0x0d4d('0x29')]({'destination':function(_0x5645af,_0x4e30d6,_0x347aa2){const _0x2e86eb=path[_0x0d4d('0x2a')](config['root'],_0x0d4d('0x38'),_0x0d4d('0x39'),_0x0d4d('0x3a'));fs_extra['ensureDir'](_0x2e86eb,function(){_0x347aa2(null,_0x2e86eb);});},'filename':function(_0x101c85,_0x4a1845,_0x2f327a){const _0x11af41=_0x4a1845[_0x0d4d('0x30')][_0x0d4d('0x3b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x597d0=path[_0x0d4d('0x3c')](_0x11af41);const _0x199ca1=Date[_0x0d4d('0x2f')]()+'-'+_0x11af41[_0x0d4d('0x3b')](_0x597d0,'')+_0x597d0;_0x2f327a(null,_0x199ca1);}})});router[_0x0d4d('0x26')](_0x0d4d('0x3d'),offlineUploadMulter['any'](),controller[_0x0d4d('0x3e')]);router[_0x0d4d('0x26')](_0x0d4d('0x17'),auth['isAuthenticated'](),controller[_0x0d4d('0x3f')]);router[_0x0d4d('0x26')](_0x0d4d('0x1b'),auth['isAuthenticated'](),controller[_0x0d4d('0x40')]);router['post'](_0x0d4d('0x1d'),auth['isAuthenticated'](),controller[_0x0d4d('0x41')]);router[_0x0d4d('0x26')](_0x0d4d('0x23'),auth[_0x0d4d('0x9')](),controller[_0x0d4d('0x42')]);router[_0x0d4d('0x43')](_0x0d4d('0xd'),auth[_0x0d4d('0x9')](),controller['update']);router[_0x0d4d('0x44')](_0x0d4d('0xd'),auth[_0x0d4d('0x9')](),controller['destroy']);router[_0x0d4d('0x44')](_0x0d4d('0x45'),auth[_0x0d4d('0x9')](),controller[_0x0d4d('0x46')]);router[_0x0d4d('0x44')]('/:id/canned_answers',auth[_0x0d4d('0x9')](),controller[_0x0d4d('0x47')]);router[_0x0d4d('0x44')](_0x0d4d('0x23'),auth[_0x0d4d('0x9')](),controller[_0x0d4d('0x48')]);module[_0x0d4d('0x49')]=router;
\ No newline at end of file
+var _0x5c4e=['/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','getAvatar','/:id/customer_avatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','getFields','/:id/offline_messages','/:id/users','post','create','addDisposition','addAnswer','diskStorage','join','server/files/images/logos/','%s-%s','now','single','file','addLogo','root','server/files/images/avatars/','format','originalname','addAvatar','addSystemAvatar','notify','server/files','attachments','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','put','update','delete','destroy','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index'];(function(_0x2efe86,_0x4b6c3f){var _0x48e01c=function(_0x5b1412){while(--_0x5b1412){_0x2efe86['push'](_0x2efe86['shift']());}};_0x48e01c(++_0x4b6c3f);}(_0x5c4e,0x198));var _0xe5c4=function(_0x2966ef,_0x1edce9){_0x2966ef=_0x2966ef-0x0;var _0x28870c=_0x5c4e[_0x2966ef];return _0x28870c;};'use strict';var multer=require(_0xe5c4('0x0'));var util=require('util');var path=require(_0xe5c4('0x1'));var timeout=require(_0xe5c4('0x2'));var express=require(_0xe5c4('0x3'));var router=express[_0xe5c4('0x4')]();var fs_extra=require(_0xe5c4('0x5'));var auth=require(_0xe5c4('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe5c4('0x7'));var controller=require(_0xe5c4('0x8'));router[_0xe5c4('0x9')]('/',auth[_0xe5c4('0xa')](),controller[_0xe5c4('0xb')]);router[_0xe5c4('0x9')](_0xe5c4('0xc'),auth[_0xe5c4('0xa')](),controller[_0xe5c4('0xd')]);router['get'](_0xe5c4('0xe'),auth[_0xe5c4('0xa')](),controller[_0xe5c4('0xf')]);router['get'](_0xe5c4('0x10'),auth[_0xe5c4('0xa')](),controller[_0xe5c4('0x11')]);router[_0xe5c4('0x9')](_0xe5c4('0x12'),auth[_0xe5c4('0xa')](),controller[_0xe5c4('0x13')]);router['get'](_0xe5c4('0x14'),controller['getLogo']);router[_0xe5c4('0x9')](_0xe5c4('0x15'),controller[_0xe5c4('0x16')]);router['get'](_0xe5c4('0x17'),controller['getCustomerAvatar']);router['get'](_0xe5c4('0x18'),controller['getSystemAvatar']);router[_0xe5c4('0x9')](_0xe5c4('0x19'),auth[_0xe5c4('0xa')](),controller[_0xe5c4('0x1a')]);router[_0xe5c4('0x9')]('/:id/snippet',controller['getSnippet']);router[_0xe5c4('0x9')](_0xe5c4('0x1b'),auth['isAuthenticated'](),controller[_0xe5c4('0x1c')]);router[_0xe5c4('0x9')](_0xe5c4('0x1d'),auth[_0xe5c4('0xa')](),controller[_0xe5c4('0x1e')]);router[_0xe5c4('0x9')]('/:id/fields',controller[_0xe5c4('0x1f')]);router['get'](_0xe5c4('0x20'),auth[_0xe5c4('0xa')](),controller['getOfflineMessages']);router[_0xe5c4('0x9')](_0xe5c4('0x21'),auth[_0xe5c4('0xa')](),controller['getAgents']);router[_0xe5c4('0x22')]('/',auth[_0xe5c4('0xa')](),controller[_0xe5c4('0x23')]);router[_0xe5c4('0x22')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xe5c4('0x24')]);router[_0xe5c4('0x22')](_0xe5c4('0x12'),auth[_0xe5c4('0xa')](),controller[_0xe5c4('0x25')]);var upload=multer({'storage':multer[_0xe5c4('0x26')]({'destination':function(_0x2b8b6d,_0x5b29d4,_0x9d535c){_0x9d535c(null,path[_0xe5c4('0x27')](config['root'],_0xe5c4('0x28')));},'filename':function(_0x51a997,_0x3ed6df,_0x4ddcb1){_0x4ddcb1(null,util['format'](_0xe5c4('0x29'),Date[_0xe5c4('0x2a')](),_0x3ed6df['originalname']));}})});router[_0xe5c4('0x22')]('/:id/logo',upload[_0xe5c4('0x2b')](_0xe5c4('0x2c')),controller[_0xe5c4('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5eddbe,_0x58041a,_0x4e6573){_0x4e6573(null,path[_0xe5c4('0x27')](config[_0xe5c4('0x2e')],_0xe5c4('0x2f')));},'filename':function(_0x20e539,_0x807774,_0x3cbd88){_0x3cbd88(null,util[_0xe5c4('0x30')](_0xe5c4('0x29'),Date[_0xe5c4('0x2a')](),_0x807774[_0xe5c4('0x31')]));}})});router['post'](_0xe5c4('0x15'),upload[_0xe5c4('0x2b')]('file'),controller[_0xe5c4('0x32')]);var upload=multer({'storage':multer[_0xe5c4('0x26')]({'destination':function(_0x528122,_0xc7bb6f,_0x15b0ac){_0x15b0ac(null,path[_0xe5c4('0x27')](config[_0xe5c4('0x2e')],'server/files/images/avatars/'));},'filename':function(_0x276e3e,_0x2558de,_0x412cf7){_0x412cf7(null,util[_0xe5c4('0x30')](_0xe5c4('0x29'),Date['now'](),_0x2558de[_0xe5c4('0x31')]));}})});router[_0xe5c4('0x22')](_0xe5c4('0x17'),upload[_0xe5c4('0x2b')](_0xe5c4('0x2c')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0xe5c4('0x26')]({'destination':function(_0x448c99,_0xf1da42,_0x72d35c){_0x72d35c(null,path[_0xe5c4('0x27')](config[_0xe5c4('0x2e')],_0xe5c4('0x2f')));},'filename':function(_0x345452,_0x2001d6,_0xe459ff){_0xe459ff(null,util['format']('%s-%s',Date[_0xe5c4('0x2a')](),_0x2001d6[_0xe5c4('0x31')]));}})});router[_0xe5c4('0x22')](_0xe5c4('0x18'),upload['single'](_0xe5c4('0x2c')),controller[_0xe5c4('0x33')]);router[_0xe5c4('0x22')]('/:id/notify',controller[_0xe5c4('0x34')]);const offlineUploadMulter=multer({'storage':multer[_0xe5c4('0x26')]({'destination':function(_0x3400c1,_0x43d21f,_0xad5dbd){const _0x2ab23b=path['join'](config[_0xe5c4('0x2e')],_0xe5c4('0x35'),_0xe5c4('0x36'),'offline-chat');fs_extra[_0xe5c4('0x37')](_0x2ab23b,function(){_0xad5dbd(null,_0x2ab23b);});},'filename':function(_0x5c915e,_0x2d1b0d,_0x9c7e1){const _0x2652b7=_0x2d1b0d[_0xe5c4('0x31')][_0xe5c4('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x126b7c=path[_0xe5c4('0x39')](_0x2652b7);const _0x458fb9=Date['now']()+'-'+_0x2652b7[_0xe5c4('0x38')](_0x126b7c,'')+_0x126b7c;_0x9c7e1(null,_0x458fb9);}})});router[_0xe5c4('0x22')](_0xe5c4('0x3a'),offlineUploadMulter[_0xe5c4('0x3b')](),controller[_0xe5c4('0x3c')]);router['post'](_0xe5c4('0x19'),auth[_0xe5c4('0xa')](),controller[_0xe5c4('0x3d')]);router[_0xe5c4('0x22')](_0xe5c4('0x1b'),auth[_0xe5c4('0xa')](),controller[_0xe5c4('0x3e')]);router[_0xe5c4('0x22')](_0xe5c4('0x1d'),auth[_0xe5c4('0xa')](),controller[_0xe5c4('0x3f')]);router[_0xe5c4('0x22')](_0xe5c4('0x21'),auth[_0xe5c4('0xa')](),controller['addAgents']);router[_0xe5c4('0x40')](_0xe5c4('0xe'),auth['isAuthenticated'](),controller[_0xe5c4('0x41')]);router[_0xe5c4('0x42')](_0xe5c4('0xe'),auth['isAuthenticated'](),controller[_0xe5c4('0x43')]);router[_0xe5c4('0x42')]('/:id/dispositions',auth['isAuthenticated'](),controller['removeDispositions']);router[_0xe5c4('0x42')](_0xe5c4('0x12'),auth[_0xe5c4('0xa')](),controller['removeAnswers']);router['delete'](_0xe5c4('0x21'),auth[_0xe5c4('0xa')](),controller[_0xe5c4('0x44')]);module[_0xe5c4('0x45')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index 2b28d38..2564a65 100644
--- a/server/api/client-side-logs.js
+++ b/server/api/client-side-logs.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa932=['get','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','isAuthenticated','exports','beaver-logger/server','express','../components/auth/service','../config/environment','env','production','app'];(function(_0x181185,_0x193c0a){var _0x2eeac2=function(_0x733dca){while(--_0x733dca){_0x181185['push'](_0x181185['shift']());}};_0x2eeac2(++_0x193c0a);}(_0xa932,0x117));var _0x2a93=function(_0x2fcf6b,_0xd140ff){_0x2fcf6b=_0x2fcf6b-0x0;var _0x155073=_0xa932[_0x2fcf6b];return _0x155073;};var beaverLogger=require(_0x2a93('0x0'));var express=require(_0x2a93('0x1'));var auth=require(_0x2a93('0x2'));var config=require(_0x2a93('0x3'));var router=express['Router']();var isProduction=config[_0x2a93('0x4')]===_0x2a93('0x5')||![];function clientSideLogs(_0x4692d0,_0x14e173,_0x13f764){var _0x2a58be=_0x4692d0[_0x2a93('0x6')][_0x2a93('0x7')]('client-side-logger');if(!_0x2a58be){throw new Error(_0x2a93('0x8'));}return beaverLogger[_0x2a93('0x9')]({'uri':_0x2a93('0xa'),'logger':_0x2a58be,'enableCors':!isProduction})(_0x4692d0,_0x14e173,_0x13f764);}router['use'](auth[_0x2a93('0xb')](),clientSideLogs);module[_0x2a93('0xc')]=router;
\ No newline at end of file
+var _0x73b5=['expressEndpoint','/client-logs','use','isAuthenticated','exports','beaver-logger/server','express','../components/auth/service','Router','env','app','get','Client-Side\x20logger\x20not\x20found!'];(function(_0x50a200,_0x107e3b){var _0x209610=function(_0x101ba3){while(--_0x101ba3){_0x50a200['push'](_0x50a200['shift']());}};_0x209610(++_0x107e3b);}(_0x73b5,0x1f3));var _0x573b=function(_0x56a7b5,_0x3cee35){_0x56a7b5=_0x56a7b5-0x0;var _0x238f8c=_0x73b5[_0x56a7b5];return _0x238f8c;};var beaverLogger=require(_0x573b('0x0'));var express=require(_0x573b('0x1'));var auth=require(_0x573b('0x2'));var config=require('../config/environment');var router=express[_0x573b('0x3')]();var isProduction=config[_0x573b('0x4')]==='production'||![];function clientSideLogs(_0x144bab,_0x34fe85,_0xb3ddfb){var _0x433f36=_0x144bab[_0x573b('0x5')][_0x573b('0x6')]('client-side-logger');if(!_0x433f36){throw new Error(_0x573b('0x7'));}return beaverLogger[_0x573b('0x8')]({'uri':_0x573b('0x9'),'logger':_0x433f36,'enableCors':!isProduction})(_0x144bab,_0x34fe85,_0xb3ddfb);}router[_0x573b('0xa')](auth[_0x573b('0xb')](),clientSideLogs);module[_0x573b('0xc')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 37500b9..0bed30e 100644
--- a/server/api/cloudProvider/cloudProvider.attributes.js
+++ b/server/api/cloudProvider/cloudProvider.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2523=['sequelize','AmazonAWS','MicrosoftAzure','STRING','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token'];(function(_0x9307ea,_0x38968a){var _0x295554=function(_0x342dcf){while(--_0x342dcf){_0x9307ea['push'](_0x9307ea['shift']());}};_0x295554(++_0x38968a);}(_0x2523,0x1ae));var _0x3252=function(_0x350281,_0x6e5133){_0x350281=_0x350281-0x0;var _0x1eb3e6=_0x2523[_0x350281];return _0x1eb3e6;};'use strict';var Sequelize=require(_0x3252('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x3252('0x1'),'Google',_0x3252('0x2')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('Outlook365','Dynamics365')},'data1':{'type':Sequelize[_0x3252('0x3')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0x3252('0x3')],'comment':_0x3252('0x4')},'data3':{'type':Sequelize[_0x3252('0x3')],'comment':_0x3252('0x5')},'data4':{'type':Sequelize[_0x3252('0x3')],'comment':_0x3252('0x6')},'data5':{'type':Sequelize[_0x3252('0x7')],'comment':_0x3252('0x8')},'data6':{'type':Sequelize['TEXT'],'comment':_0x3252('0x9')},'data7':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}};
\ No newline at end of file
+var _0x8b78=['MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','STRING','ENUM','AmazonAWS','Google','Dynamics365','MicrosoftAzure\x20=>\x20client_secret','TEXT'];(function(_0x415b01,_0x2d427b){var _0x20ee79=function(_0x310391){while(--_0x310391){_0x415b01['push'](_0x415b01['shift']());}};_0x20ee79(++_0x2d427b);}(_0x8b78,0x7a));var _0x88b7=function(_0x572efc,_0x448777){_0x572efc=_0x572efc-0x0;var _0x413052=_0x8b78[_0x572efc];return _0x413052;};'use strict';var Sequelize=require(_0x88b7('0x0'));module['exports']={'name':{'type':Sequelize[_0x88b7('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x88b7('0x2')](_0x88b7('0x3'),_0x88b7('0x4'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('Outlook365',_0x88b7('0x5'))},'data1':{'type':Sequelize[_0x88b7('0x1')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0x88b7('0x1')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0x88b7('0x1')],'comment':_0x88b7('0x6')},'data4':{'type':Sequelize[_0x88b7('0x1')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0x88b7('0x7')],'comment':_0x88b7('0x8')},'data6':{'type':Sequelize[_0x88b7('0x7')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0x88b7('0x7')],'comment':_0x88b7('0x9')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index cd0d5a7..3299ef3 100644
--- a/server/api/cloudProvider/cloudProvider.controller.js
+++ b/server/api/cloudProvider/cloudProvider.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8352=['fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','VIRTUAL','options','CloudProvider','includeAll','findAll','rows','service','MicrosoftAzure','data3','catch','show','keys','rawAttributes','include','find','decryptString','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','params','destroy','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','get','Invalid\x20state\x20parameter','parse','from','state','toString','ascii','isValidIdToken','id_token','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','data6','refresh_token','emit','microsoftAuthorization:success','microsoftAuthorization:error','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','defaults','redis','localhost','socket.io-emitter','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','then','error','send','padEnd','slice','map','fieldName','type','model','name','query','intersection'];(function(_0x3f639c,_0x1e281a){var _0x4d899e=function(_0x318a55){while(--_0x318a55){_0x3f639c['push'](_0x3f639c['shift']());}};_0x4d899e(++_0x1e281a);}(_0x8352,0x1c4));var _0x2835=function(_0x945142,_0x35b37c){_0x945142=_0x945142-0x0;var _0x1368cd=_0x8352[_0x945142];return _0x1368cd;};'use strict';var _=require(_0x2835('0x0'));var Redis=require(_0x2835('0x1'));var qs=require(_0x2835('0x2'));var encryptor=require('../../components/encryptor');var config=require('../../config/environment');var logger=require(_0x2835('0x3'))(_0x2835('0x4'));var db=require(_0x2835('0x5'))['db'];var oauth=require('./cloudProvider.oauth');config['redis']=_[_0x2835('0x6')](config[_0x2835('0x7')],{'host':_0x2835('0x8'),'port':0x18eb});var socket=require(_0x2835('0x9'))(new Redis(config[_0x2835('0x7')]));var redis=new Redis(config[_0x2835('0x7')]);function respondWithStatusCode(_0x54c57a,_0x376477){_0x376477=_0x376477||0xcc;return function(_0x1e7c65){if(_0x1e7c65){return _0x54c57a[_0x2835('0xa')](_0x376477);}return _0x54c57a['status'](_0x376477)[_0x2835('0xb')]();};}function respondWithResult(_0x3386a5,_0x3b1db5){_0x3b1db5=_0x3b1db5||0xc8;return function(_0x3b47a5){if(_0x3b47a5){return _0x3386a5[_0x2835('0xc')](_0x3b1db5)[_0x2835('0xd')](_0x3b47a5);}};}function respondWithFilteredResult(_0x4ac920,_0x1f40bd){return function(_0x5b9c72){if(_0x5b9c72){var _0x5eaf7d=typeof _0x1f40bd[_0x2835('0xe')]===_0x2835('0xf')&&typeof _0x1f40bd[_0x2835('0x10')]===_0x2835('0xf');var _0x1e7d50=_0x5b9c72[_0x2835('0x11')];var _0x706328=_0x5eaf7d?0x0:_0x1f40bd[_0x2835('0xe')];var _0x26afa7=_0x5eaf7d?_0x5b9c72[_0x2835('0x11')]:_0x1f40bd[_0x2835('0xe')]+_0x1f40bd[_0x2835('0x10')];var _0x433fff;if(_0x26afa7>=_0x1e7d50){_0x26afa7=_0x1e7d50;_0x433fff=0xc8;}else{_0x433fff=0xce;}_0x4ac920['status'](_0x433fff);return _0x4ac920[_0x2835('0x12')](_0x2835('0x13'),_0x706328+'-'+_0x26afa7+'/'+_0x1e7d50)[_0x2835('0xd')](_0x5b9c72);}return null;};}function saveUpdates(_0x1f63ea){return function(_0x33cfbe){if(_0x33cfbe){return _0x33cfbe[_0x2835('0x14')](_0x1f63ea)['then'](function(_0x20d4b0){return _0x20d4b0;});}return null;};}function removeEntity(_0x3befd5){return function(_0x3f1655){if(_0x3f1655){return _0x3f1655['destroy']()[_0x2835('0x15')](function(){_0x3befd5[_0x2835('0xc')](0xcc)[_0x2835('0xb')]();});}};}function handleEntityNotFound(_0xe0fe9b){return function(_0x173c69){if(!_0x173c69){_0xe0fe9b['sendStatus'](0x194);}return _0x173c69;};}function handleError(_0x1d29c9,_0x4a20b8){_0x4a20b8=_0x4a20b8||0x1f4;return function(_0x50fac5){logger[_0x2835('0x16')](_0x50fac5['stack']);if(_0x50fac5['name']){delete _0x50fac5['name'];}_0x1d29c9[_0x2835('0xc')](_0x4a20b8)[_0x2835('0x17')](_0x50fac5);};}function maskClientSecret(_0x379989){return _[_0x2835('0x18')](_0x379989[_0x2835('0x19')](0x0,0x3),0x14,'*');}exports['index']=function(_0x58f380,_0x54b6f1){var _0x2d9e4f={},_0x96badf={},_0x17e279={'count':0x0,'rows':[]};var _0x967418=_[_0x2835('0x1a')](db['CloudProvider']['rawAttributes'],function(_0x4d949f){return{'name':_0x4d949f[_0x2835('0x1b')],'type':_0x4d949f[_0x2835('0x1c')]['key']};});_0x96badf[_0x2835('0x1d')]=_['map'](_0x967418,_0x2835('0x1e'));_0x96badf[_0x2835('0x1f')]=_['keys'](_0x58f380[_0x2835('0x1f')]);_0x96badf['filters']=_[_0x2835('0x20')](_0x96badf[_0x2835('0x1d')],_0x96badf[_0x2835('0x1f')]);_0x2d9e4f['attributes']=_['intersection'](_0x96badf[_0x2835('0x1d')],qs['fields'](_0x58f380[_0x2835('0x1f')][_0x2835('0x21')]));_0x2d9e4f[_0x2835('0x22')]=_0x2d9e4f[_0x2835('0x22')][_0x2835('0x23')]?_0x2d9e4f[_0x2835('0x22')]:_0x96badf[_0x2835('0x1d')];if(!_0x58f380[_0x2835('0x1f')][_0x2835('0x24')](_0x2835('0x25'))){_0x2d9e4f[_0x2835('0x10')]=qs['limit'](_0x58f380[_0x2835('0x1f')][_0x2835('0x10')]);_0x2d9e4f[_0x2835('0xe')]=qs[_0x2835('0xe')](_0x58f380['query'][_0x2835('0xe')]);}_0x2d9e4f[_0x2835('0x26')]=qs['sort'](_0x58f380['query'][_0x2835('0x27')]);_0x2d9e4f['where']=qs['filters'](_[_0x2835('0x28')](_0x58f380['query'],_0x96badf[_0x2835('0x29')]),_0x967418);if(_0x58f380[_0x2835('0x1f')][_0x2835('0x2a')]){_0x2d9e4f[_0x2835('0x2b')]=_[_0x2835('0x2c')](_0x2d9e4f[_0x2835('0x2b')],{'$or':_[_0x2835('0x1a')](_0x967418,function(_0x4d1fe0){if(_0x4d1fe0[_0x2835('0x1c')]!==_0x2835('0x2d')){var _0x36f67c={};_0x36f67c[_0x4d1fe0[_0x2835('0x1e')]]={'$like':'%'+_0x58f380[_0x2835('0x1f')][_0x2835('0x2a')]+'%'};return _0x36f67c;}})});}_0x2d9e4f=_[_0x2835('0x2c')]({},_0x2d9e4f,_0x58f380[_0x2835('0x2e')]);var _0x5ea484={'where':_0x2d9e4f[_0x2835('0x2b')]};return db[_0x2835('0x2f')][_0x2835('0x11')](_0x5ea484)['then'](function(_0x1f58a9){_0x17e279[_0x2835('0x11')]=_0x1f58a9;if(_0x58f380[_0x2835('0x1f')][_0x2835('0x30')]){_0x2d9e4f['include']=[{'all':!![]}];}return db[_0x2835('0x2f')][_0x2835('0x31')](_0x2d9e4f);})[_0x2835('0x15')](function(_0x2c2105){_0x17e279[_0x2835('0x32')]=_[_0x2835('0x1a')](_0x2c2105,function(_0x40e9ee){if(_0x40e9ee[_0x2835('0x33')]===_0x2835('0x34')){var _0x1b6980=encryptor['decryptString'](_0x40e9ee[_0x2835('0x35')]);_0x40e9ee['data3']=maskClientSecret(_0x1b6980);}return _0x40e9ee;});return _0x17e279;})[_0x2835('0x15')](respondWithFilteredResult(_0x54b6f1,_0x2d9e4f))[_0x2835('0x36')](handleError(_0x54b6f1,null));};exports[_0x2835('0x37')]=function(_0x22f3b6,_0x26b100){var _0x170c81={'raw':!![],'where':{'id':_0x22f3b6['params']['id']}},_0x2aa5e5={};_0x2aa5e5['model']=_[_0x2835('0x38')](db[_0x2835('0x2f')][_0x2835('0x39')]);_0x2aa5e5[_0x2835('0x1f')]=_[_0x2835('0x38')](_0x22f3b6[_0x2835('0x1f')]);_0x2aa5e5[_0x2835('0x29')]=_[_0x2835('0x20')](_0x2aa5e5[_0x2835('0x1d')],_0x2aa5e5[_0x2835('0x1f')]);_0x170c81[_0x2835('0x22')]=_['intersection'](_0x2aa5e5['model'],qs[_0x2835('0x21')](_0x22f3b6[_0x2835('0x1f')][_0x2835('0x21')]));_0x170c81['attributes']=_0x170c81[_0x2835('0x22')]['length']?_0x170c81[_0x2835('0x22')]:_0x2aa5e5['model'];if(_0x22f3b6['query'][_0x2835('0x30')]){_0x170c81[_0x2835('0x3a')]=[{'all':!![]}];}_0x170c81=_[_0x2835('0x2c')]({},_0x170c81,_0x22f3b6[_0x2835('0x2e')]);return db[_0x2835('0x2f')][_0x2835('0x3b')](_0x170c81)[_0x2835('0x15')](handleEntityNotFound(_0x26b100,null))['then'](function(_0x52aac0){if(_0x52aac0[_0x2835('0x33')]===_0x2835('0x34')){var _0x5f0833=encryptor[_0x2835('0x3c')](_0x52aac0[_0x2835('0x35')]);_0x52aac0[_0x2835('0x35')]=maskClientSecret(_0x5f0833);}return _0x52aac0;})['then'](respondWithResult(_0x26b100,null))['catch'](handleError(_0x26b100,null));};exports[_0x2835('0x3d')]=function(_0x209736,_0x439297){if(!_0x209736[_0x2835('0x3e')][_0x2835('0x1e')])throw new Error(_0x2835('0x3f'));if(!_0x209736[_0x2835('0x3e')][_0x2835('0x33')])throw new Error(_0x2835('0x40'));var _0x1c9e20=db[_0x2835('0x2f')][_0x2835('0x39')][_0x2835('0x33')]['values'];if(!_0x1c9e20[_0x2835('0x41')](_0x209736[_0x2835('0x3e')]['service']))throw new Error(_0x2835('0x42')+_0x1c9e20[_0x2835('0x43')](',\x20'));if(_0x209736[_0x2835('0x3e')][_0x2835('0x33')]===_0x2835('0x34')&&_0x209736[_0x2835('0x3e')][_0x2835('0x35')]){_0x209736[_0x2835('0x3e')]['data3']=encryptor[_0x2835('0x44')](_0x209736[_0x2835('0x3e')][_0x2835('0x35')]);}return db['CloudProvider'][_0x2835('0x3d')](_0x209736[_0x2835('0x3e')],{})[_0x2835('0x15')](respondWithResult(_0x439297,0xc9))[_0x2835('0x36')](handleError(_0x439297,null));};exports[_0x2835('0x14')]=function(_0x30f284,_0x1f5fb0){if(_0x30f284[_0x2835('0x3e')]['id']){delete _0x30f284[_0x2835('0x3e')]['id'];}return db[_0x2835('0x2f')]['find']({'where':{'id':_0x30f284[_0x2835('0x45')]['id']}})[_0x2835('0x15')](handleEntityNotFound(_0x1f5fb0,null))[_0x2835('0x15')](function(_0x141694){if(_0x141694[_0x2835('0x33')]==='MicrosoftAzure'&&_0x30f284[_0x2835('0x3e')][_0x2835('0x35')]){_0x30f284[_0x2835('0x3e')][_0x2835('0x35')]=encryptor['encryptString'](_0x30f284['body']['data3']);}return _0x141694;})[_0x2835('0x15')](saveUpdates(_0x30f284[_0x2835('0x3e')],null))[_0x2835('0x15')](respondWithResult(_0x1f5fb0,null))[_0x2835('0x36')](handleError(_0x1f5fb0,null));};exports[_0x2835('0x46')]=function(_0x3b20ed,_0xd77bfe){return db[_0x2835('0x2f')][_0x2835('0x3b')]({'where':{'id':_0x3b20ed[_0x2835('0x45')]['id']}})[_0x2835('0x15')](handleEntityNotFound(_0xd77bfe,null))[_0x2835('0x15')](removeEntity(_0xd77bfe,null))[_0x2835('0x36')](handleError(_0xd77bfe,null));};exports[_0x2835('0x47')]=function(_0x58dcda,_0x4c0d9d){return db[_0x2835('0x2f')][_0x2835('0x48')]({'where':{'id':_0x58dcda['params']['id']},'raw':!![]})[_0x2835('0x15')](function(_0x6c1a51){if(!_0x6c1a51)return _0x4c0d9d[_0x2835('0xa')](0x194);return{'url':oauth[_0x2835('0x49')](_0x6c1a51,_0x58dcda['user']['id'])};})[_0x2835('0x15')](respondWithResult(_0x4c0d9d,null))[_0x2835('0x36')](handleError(_0x4c0d9d,null));};exports[_0x2835('0x4a')]=function(_0x22dc47,_0x56a7ea){var _0x4100fe=_0x22dc47[_0x2835('0x3e')];var _0x4e0724;var _0x1628ba;if(_0x4100fe[_0x2835('0x16')])throw _0x4100fe;redis[_0x2835('0x4b')](_0x4100fe['state'])['then'](function(_0x4f2610){if(!_0x4f2610)throw new Error(_0x2835('0x4c'));_0x4e0724=JSON[_0x2835('0x4d')](_0x4f2610);var _0x200bc1=Buffer[_0x2835('0x4e')](_0x4100fe[_0x2835('0x4f')],'base64')[_0x2835('0x50')](_0x2835('0x51'));_0x1628ba=JSON[_0x2835('0x4d')](_0x200bc1);if(!oauth[_0x2835('0x52')](_0x4100fe[_0x2835('0x53')],_0x4e0724['oauth2Claims']))throw new Error(_0x2835('0x54'));redis[_0x2835('0x55')](_0x4100fe['state']);return oauth[_0x2835('0x56')](_0x4100fe[_0x2835('0x57')],_0x4e0724);})[_0x2835('0x15')](function(_0x3d29d0){_0x4e0724[_0x2835('0x58')]=_0x3d29d0['access_token'];_0x4e0724[_0x2835('0x59')]=_0x3d29d0[_0x2835('0x5a')];return db[_0x2835('0x2f')][_0x2835('0x14')]({'data5':_0x4e0724[_0x2835('0x58')],'data6':_0x4e0724['data6']},{'where':{'id':_0x4e0724['id']}});})['then'](function(){oauth['startRefreshInterval'](_0x4e0724);socket[_0x2835('0x5b')](_0x2835('0x5c'),{'id':_0x1628ba['id']});return;})[_0x2835('0x15')](respondWithStatusCode(_0x56a7ea,null))[_0x2835('0x36')](function(_0x42bc8f){if(_0x1628ba){socket[_0x2835('0x5b')](_0x2835('0x5d'),{'id':_0x1628ba['id']});}if(!_0x4e0724){logger['error']('Invalid\x20authentication\x20state\x20parameter',_0x42bc8f);return _0x56a7ea[_0x2835('0xc')](0x1f4)[_0x2835('0x17')](_0x42bc8f[_0x2835('0x5e')]);}logger[_0x2835('0x16')](_0x2835('0x5f'),_0x4e0724['id'],JSON[_0x2835('0x60')](_0x42bc8f));});};
\ No newline at end of file
+var _0x4658=['options','find','MicrosoftAzure','catch','create','body','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','destroy','oauth2MicrosoftAuthorize','findOne','user','oauth2MicrosoftCallback','state','Invalid\x20state\x20parameter','parse','from','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','access_token','data5','data6','startRefreshInterval','emit','microsoftAuthorization:success','Invalid\x20authentication\x20state\x20parameter','stringify','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','../../mysqldb','./cloudProvider.oauth','defaults','redis','localhost','socket.io-emitter','sendStatus','status','end','offset','undefined','limit','count','set','json','update','then','error','name','send','padEnd','index','map','CloudProvider','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','VIRTUAL','includeAll','include','rows','service','decryptString','data3','params'];(function(_0x429826,_0xa7bdd4){var _0x4ec65a=function(_0x1f4ddf){while(--_0x1f4ddf){_0x429826['push'](_0x429826['shift']());}};_0x4ec65a(++_0xa7bdd4);}(_0x4658,0x190));var _0x8465=function(_0x5685e4,_0x2c48a1){_0x5685e4=_0x5685e4-0x0;var _0x421e89=_0x4658[_0x5685e4];return _0x421e89;};'use strict';var _=require('lodash');var Redis=require(_0x8465('0x0'));var qs=require(_0x8465('0x1'));var encryptor=require(_0x8465('0x2'));var config=require(_0x8465('0x3'));var logger=require(_0x8465('0x4'))('api');var db=require(_0x8465('0x5'))['db'];var oauth=require(_0x8465('0x6'));config['redis']=_[_0x8465('0x7')](config[_0x8465('0x8')],{'host':_0x8465('0x9'),'port':0x18eb});var socket=require(_0x8465('0xa'))(new Redis(config[_0x8465('0x8')]));var redis=new Redis(config[_0x8465('0x8')]);function respondWithStatusCode(_0x188b9d,_0xdc14d6){_0xdc14d6=_0xdc14d6||0xcc;return function(_0x2753e3){if(_0x2753e3){return _0x188b9d[_0x8465('0xb')](_0xdc14d6);}return _0x188b9d[_0x8465('0xc')](_0xdc14d6)[_0x8465('0xd')]();};}function respondWithResult(_0x339ab0,_0x3d28b3){_0x3d28b3=_0x3d28b3||0xc8;return function(_0x58f5e1){if(_0x58f5e1){return _0x339ab0[_0x8465('0xc')](_0x3d28b3)['json'](_0x58f5e1);}};}function respondWithFilteredResult(_0x3c3f5a,_0x4cc7b9){return function(_0x4d653d){if(_0x4d653d){var _0x384621=typeof _0x4cc7b9[_0x8465('0xe')]===_0x8465('0xf')&&typeof _0x4cc7b9[_0x8465('0x10')]===_0x8465('0xf');var _0x3c9326=_0x4d653d[_0x8465('0x11')];var _0x24976c=_0x384621?0x0:_0x4cc7b9[_0x8465('0xe')];var _0x5cfa9e=_0x384621?_0x4d653d[_0x8465('0x11')]:_0x4cc7b9[_0x8465('0xe')]+_0x4cc7b9['limit'];var _0x47333f;if(_0x5cfa9e>=_0x3c9326){_0x5cfa9e=_0x3c9326;_0x47333f=0xc8;}else{_0x47333f=0xce;}_0x3c3f5a[_0x8465('0xc')](_0x47333f);return _0x3c3f5a[_0x8465('0x12')]('Content-Range',_0x24976c+'-'+_0x5cfa9e+'/'+_0x3c9326)[_0x8465('0x13')](_0x4d653d);}return null;};}function saveUpdates(_0x2e8f87){return function(_0x2837c8){if(_0x2837c8){return _0x2837c8[_0x8465('0x14')](_0x2e8f87)[_0x8465('0x15')](function(_0xd46fb0){return _0xd46fb0;});}return null;};}function removeEntity(_0x21d584){return function(_0x4b5a09){if(_0x4b5a09){return _0x4b5a09['destroy']()['then'](function(){_0x21d584['status'](0xcc)[_0x8465('0xd')]();});}};}function handleEntityNotFound(_0x5e71aa){return function(_0x49caf2){if(!_0x49caf2){_0x5e71aa[_0x8465('0xb')](0x194);}return _0x49caf2;};}function handleError(_0x53a4f1,_0x42ae17){_0x42ae17=_0x42ae17||0x1f4;return function(_0x4a4df4){logger[_0x8465('0x16')](_0x4a4df4['stack']);if(_0x4a4df4[_0x8465('0x17')]){delete _0x4a4df4[_0x8465('0x17')];}_0x53a4f1[_0x8465('0xc')](_0x42ae17)[_0x8465('0x18')](_0x4a4df4);};}function maskClientSecret(_0x576612){return _[_0x8465('0x19')](_0x576612['slice'](0x0,0x3),0x14,'*');}exports[_0x8465('0x1a')]=function(_0x2a358a,_0x217e09){var _0x2d1415={},_0x2ae883={},_0x2efe82={'count':0x0,'rows':[]};var _0xc23a31=_[_0x8465('0x1b')](db[_0x8465('0x1c')][_0x8465('0x1d')],function(_0x108e08){return{'name':_0x108e08[_0x8465('0x1e')],'type':_0x108e08['type'][_0x8465('0x1f')]};});_0x2ae883[_0x8465('0x20')]=_[_0x8465('0x1b')](_0xc23a31,_0x8465('0x17'));_0x2ae883[_0x8465('0x21')]=_[_0x8465('0x22')](_0x2a358a['query']);_0x2ae883['filters']=_[_0x8465('0x23')](_0x2ae883[_0x8465('0x20')],_0x2ae883[_0x8465('0x21')]);_0x2d1415[_0x8465('0x24')]=_['intersection'](_0x2ae883['model'],qs[_0x8465('0x25')](_0x2a358a[_0x8465('0x21')][_0x8465('0x25')]));_0x2d1415[_0x8465('0x24')]=_0x2d1415[_0x8465('0x24')]['length']?_0x2d1415[_0x8465('0x24')]:_0x2ae883[_0x8465('0x20')];if(!_0x2a358a['query'][_0x8465('0x26')](_0x8465('0x27'))){_0x2d1415[_0x8465('0x10')]=qs['limit'](_0x2a358a[_0x8465('0x21')]['limit']);_0x2d1415[_0x8465('0xe')]=qs[_0x8465('0xe')](_0x2a358a['query'][_0x8465('0xe')]);}_0x2d1415['order']=qs['sort'](_0x2a358a['query'][_0x8465('0x28')]);_0x2d1415[_0x8465('0x29')]=qs[_0x8465('0x2a')](_[_0x8465('0x2b')](_0x2a358a['query'],_0x2ae883['filters']),_0xc23a31);if(_0x2a358a[_0x8465('0x21')][_0x8465('0x2c')]){_0x2d1415['where']=_[_0x8465('0x2d')](_0x2d1415['where'],{'$or':_[_0x8465('0x1b')](_0xc23a31,function(_0x3d4b07){if(_0x3d4b07[_0x8465('0x2e')]!==_0x8465('0x2f')){var _0x3e5ec8={};_0x3e5ec8[_0x3d4b07[_0x8465('0x17')]]={'$like':'%'+_0x2a358a[_0x8465('0x21')]['filter']+'%'};return _0x3e5ec8;}})});}_0x2d1415=_[_0x8465('0x2d')]({},_0x2d1415,_0x2a358a['options']);var _0x530cca={'where':_0x2d1415[_0x8465('0x29')]};return db[_0x8465('0x1c')][_0x8465('0x11')](_0x530cca)[_0x8465('0x15')](function(_0x464559){_0x2efe82[_0x8465('0x11')]=_0x464559;if(_0x2a358a[_0x8465('0x21')][_0x8465('0x30')]){_0x2d1415[_0x8465('0x31')]=[{'all':!![]}];}return db['CloudProvider']['findAll'](_0x2d1415);})[_0x8465('0x15')](function(_0x37a995){_0x2efe82[_0x8465('0x32')]=_[_0x8465('0x1b')](_0x37a995,function(_0x33b064){if(_0x33b064[_0x8465('0x33')]==='MicrosoftAzure'){var _0x2f7f70=encryptor[_0x8465('0x34')](_0x33b064[_0x8465('0x35')]);_0x33b064[_0x8465('0x35')]=maskClientSecret(_0x2f7f70);}return _0x33b064;});return _0x2efe82;})['then'](respondWithFilteredResult(_0x217e09,_0x2d1415))['catch'](handleError(_0x217e09,null));};exports['show']=function(_0x327f91,_0x3187bb){var _0x57df81={'raw':!![],'where':{'id':_0x327f91[_0x8465('0x36')]['id']}},_0x5ea6b2={};_0x5ea6b2[_0x8465('0x20')]=_['keys'](db[_0x8465('0x1c')][_0x8465('0x1d')]);_0x5ea6b2[_0x8465('0x21')]=_[_0x8465('0x22')](_0x327f91['query']);_0x5ea6b2[_0x8465('0x2a')]=_['intersection'](_0x5ea6b2['model'],_0x5ea6b2['query']);_0x57df81[_0x8465('0x24')]=_[_0x8465('0x23')](_0x5ea6b2[_0x8465('0x20')],qs['fields'](_0x327f91['query'][_0x8465('0x25')]));_0x57df81['attributes']=_0x57df81[_0x8465('0x24')]['length']?_0x57df81['attributes']:_0x5ea6b2[_0x8465('0x20')];if(_0x327f91[_0x8465('0x21')][_0x8465('0x30')]){_0x57df81[_0x8465('0x31')]=[{'all':!![]}];}_0x57df81=_[_0x8465('0x2d')]({},_0x57df81,_0x327f91[_0x8465('0x37')]);return db['CloudProvider'][_0x8465('0x38')](_0x57df81)[_0x8465('0x15')](handleEntityNotFound(_0x3187bb,null))[_0x8465('0x15')](function(_0xbab861){if(_0xbab861[_0x8465('0x33')]===_0x8465('0x39')){var _0x4d461d=encryptor[_0x8465('0x34')](_0xbab861[_0x8465('0x35')]);_0xbab861[_0x8465('0x35')]=maskClientSecret(_0x4d461d);}return _0xbab861;})[_0x8465('0x15')](respondWithResult(_0x3187bb,null))[_0x8465('0x3a')](handleError(_0x3187bb,null));};exports[_0x8465('0x3b')]=function(_0x514fce,_0x17701e){if(!_0x514fce[_0x8465('0x3c')]['name'])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x514fce[_0x8465('0x3c')][_0x8465('0x33')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x30d613=db[_0x8465('0x1c')]['rawAttributes']['service']['values'];if(!_0x30d613[_0x8465('0x3d')](_0x514fce[_0x8465('0x3c')]['service']))throw new Error(_0x8465('0x3e')+_0x30d613[_0x8465('0x3f')](',\x20'));if(_0x514fce[_0x8465('0x3c')]['service']===_0x8465('0x39')&&_0x514fce[_0x8465('0x3c')][_0x8465('0x35')]){_0x514fce[_0x8465('0x3c')][_0x8465('0x35')]=encryptor['encryptString'](_0x514fce[_0x8465('0x3c')][_0x8465('0x35')]);}return db[_0x8465('0x1c')][_0x8465('0x3b')](_0x514fce['body'],{})[_0x8465('0x15')](respondWithResult(_0x17701e,0xc9))[_0x8465('0x3a')](handleError(_0x17701e,null));};exports[_0x8465('0x14')]=function(_0x42bccb,_0x5423bd){if(_0x42bccb[_0x8465('0x3c')]['id']){delete _0x42bccb[_0x8465('0x3c')]['id'];}return db[_0x8465('0x1c')][_0x8465('0x38')]({'where':{'id':_0x42bccb['params']['id']}})[_0x8465('0x15')](handleEntityNotFound(_0x5423bd,null))[_0x8465('0x15')](function(_0xe4c2c1){if(_0xe4c2c1[_0x8465('0x33')]===_0x8465('0x39')&&_0x42bccb[_0x8465('0x3c')][_0x8465('0x35')]){_0x42bccb[_0x8465('0x3c')][_0x8465('0x35')]=encryptor[_0x8465('0x40')](_0x42bccb['body'][_0x8465('0x35')]);}return _0xe4c2c1;})[_0x8465('0x15')](saveUpdates(_0x42bccb['body'],null))['then'](respondWithResult(_0x5423bd,null))[_0x8465('0x3a')](handleError(_0x5423bd,null));};exports[_0x8465('0x41')]=function(_0x24710f,_0x38d587){return db['CloudProvider'][_0x8465('0x38')]({'where':{'id':_0x24710f[_0x8465('0x36')]['id']}})[_0x8465('0x15')](handleEntityNotFound(_0x38d587,null))[_0x8465('0x15')](removeEntity(_0x38d587,null))['catch'](handleError(_0x38d587,null));};exports[_0x8465('0x42')]=function(_0x3bae44,_0x140c01){return db[_0x8465('0x1c')][_0x8465('0x43')]({'where':{'id':_0x3bae44[_0x8465('0x36')]['id']},'raw':!![]})[_0x8465('0x15')](function(_0x3cfdb3){if(!_0x3cfdb3)return _0x140c01[_0x8465('0xb')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x3cfdb3,_0x3bae44[_0x8465('0x44')]['id'])};})[_0x8465('0x15')](respondWithResult(_0x140c01,null))[_0x8465('0x3a')](handleError(_0x140c01,null));};exports[_0x8465('0x45')]=function(_0x33082a,_0x541b50){var _0x4502ae=_0x33082a[_0x8465('0x3c')];var _0x1b8efd;var _0x4bfbc2;if(_0x4502ae[_0x8465('0x16')])throw _0x4502ae;redis['get'](_0x4502ae[_0x8465('0x46')])['then'](function(_0x31466b){if(!_0x31466b)throw new Error(_0x8465('0x47'));_0x1b8efd=JSON[_0x8465('0x48')](_0x31466b);var _0x29c2d9=Buffer[_0x8465('0x49')](_0x4502ae[_0x8465('0x46')],'base64')[_0x8465('0x4a')](_0x8465('0x4b'));_0x4bfbc2=JSON[_0x8465('0x48')](_0x29c2d9);if(!oauth[_0x8465('0x4c')](_0x4502ae[_0x8465('0x4d')],_0x1b8efd[_0x8465('0x4e')]))throw new Error(_0x8465('0x4f'));redis[_0x8465('0x50')](_0x4502ae[_0x8465('0x46')]);return oauth[_0x8465('0x51')](_0x4502ae[_0x8465('0x52')],_0x1b8efd);})[_0x8465('0x15')](function(_0x4f55e1){_0x1b8efd['data5']=_0x4f55e1[_0x8465('0x53')];_0x1b8efd['data6']=_0x4f55e1['refresh_token'];return db['CloudProvider']['update']({'data5':_0x1b8efd[_0x8465('0x54')],'data6':_0x1b8efd[_0x8465('0x55')]},{'where':{'id':_0x1b8efd['id']}});})['then'](function(){oauth[_0x8465('0x56')](_0x1b8efd);socket[_0x8465('0x57')](_0x8465('0x58'),{'id':_0x4bfbc2['id']});return;})['then'](respondWithStatusCode(_0x541b50,null))['catch'](function(_0x5a017f){if(_0x4bfbc2){socket['emit']('microsoftAuthorization:error',{'id':_0x4bfbc2['id']});}if(!_0x1b8efd){logger[_0x8465('0x16')](_0x8465('0x59'),_0x5a017f);return _0x541b50[_0x8465('0xc')](0x1f4)[_0x8465('0x18')](_0x5a017f['message']);}logger[_0x8465('0x16')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x1b8efd['id'],JSON[_0x8465('0x5a')](_0x5a017f));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 15dcd89..41d8560 100644
--- a/server/api/cloudProvider/cloudProvider.model.js
+++ b/server/api/cloudProvider/cloudProvider.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8342=['path','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0xba56e0,_0x273f3b){var _0x25fbac=function(_0x4ce25c){while(--_0x4ce25c){_0xba56e0['push'](_0xba56e0['shift']());}};_0x25fbac(++_0x273f3b);}(_0x8342,0x86));var _0x2834=function(_0x493696,_0x1c1d41){_0x493696=_0x493696-0x0;var _0x3c4e2a=_0x8342[_0x493696];return _0x3c4e2a;};'use strict';var _=require(_0x2834('0x0'));var util=require(_0x2834('0x1'));var logger=require(_0x2834('0x2'))(_0x2834('0x3'));var moment=require('moment');var BPromise=require(_0x2834('0x4'));var rp=require(_0x2834('0x5'));var fs=require('fs');var path=require(_0x2834('0x6'));var rimraf=require(_0x2834('0x7'));var config=require(_0x2834('0x8'));var attributes=require(_0x2834('0x9'));module[_0x2834('0xa')]=function(_0x5d0f6c,_0x4b6d10){return _0x5d0f6c[_0x2834('0xb')](_0x2834('0xc'),attributes,{'tableName':_0x2834('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9c4a=['../../config/environment','define','CloudProvider','cloud_providers','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x5595b,_0x51c232){var _0x27f8e2=function(_0x49fb9c){while(--_0x49fb9c){_0x5595b['push'](_0x5595b['shift']());}};_0x27f8e2(++_0x51c232);}(_0x9c4a,0x1d0));var _0xa9c4=function(_0x209ec9,_0x30378c){_0x209ec9=_0x209ec9-0x0;var _0x129b1b=_0x9c4a[_0x209ec9];return _0x129b1b;};'use strict';var _=require(_0xa9c4('0x0'));var util=require(_0xa9c4('0x1'));var logger=require(_0xa9c4('0x2'))('api');var moment=require(_0xa9c4('0x3'));var BPromise=require('bluebird');var rp=require(_0xa9c4('0x4'));var fs=require('fs');var path=require(_0xa9c4('0x5'));var rimraf=require('rimraf');var config=require(_0xa9c4('0x6'));var attributes=require('./cloudProvider.attributes');module['exports']=function(_0xf0c9b5,_0x4e6821){return _0xf0c9b5[_0xa9c4('0x7')](_0xa9c4('0x8'),attributes,{'tableName':_0xa9c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js
index 2e19703..9b231cb 100644
--- a/server/api/cloudProvider/cloudProvider.oauth.js
+++ b/server/api/cloudProvider/cloudProvider.oauth.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4886=['login','key','value','oauth2/','set','payload','issuer','aud','audience','isAfter','unix','exp','resolve','then','CloudProvider','findOne','decryptString','POST','data5','access_token','refresh_token','data6','catch','error','authorization_code','{TENANT_ID}','intervals','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','jsonwebtoken','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','redis','defaults','localhost','profile','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','openid','offline_access','/authorize','/token','map','type','push','data7','/.default','join','Outlook365','Dynamics365','replace','data2','code','id_token','from','stringify','toString','randomBytes','hex','client_id','data1','response_type','data4','response_mode','scope','state','nonce'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x4886,0x104));var _0x6488=function(_0x566143,_0x5a44f6){_0x566143=_0x566143-0x0;var _0x40f906=_0x4886[_0x566143];return _0x40f906;};'use strict';var _=require('lodash');var crypto=require('crypto');var jwt=require(_0x6488('0x0'));var moment=require('moment');var Redis=require('ioredis');var rp=require('request-promise');var util=require(_0x6488('0x1'));var encryptor=require(_0x6488('0x2'));var config=require(_0x6488('0x3'));var logger=require(_0x6488('0x4'))(_0x6488('0x5'));var schedule=require('../../config/schedule/cloud-provider');var db=require(_0x6488('0x6'))['db'];config[_0x6488('0x7')]=_[_0x6488('0x8')](config[_0x6488('0x7')],{'host':_0x6488('0x9'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0x6488('0xa'),_0x6488('0xb'),'offline_access',_0x6488('0xc'),_0x6488('0xd'),_0x6488('0xe')],'Dynamics365':[_0x6488('0xf'),_0x6488('0x10')]};var MICROSOFT_AUTH_ENDPOINT=_0x6488('0x11');var MICROSOFT_TOKEN_ENDPOINT=_0x6488('0x12');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x515f51){var _0x167ee1=_[_0x6488('0x13')](AZURE_AUTH_SCOPES[_0x515f51[_0x6488('0x14')]]);if(_0x515f51[_0x6488('0x14')]==='Dynamics365')_0x167ee1[_0x6488('0x15')](_0x515f51[_0x6488('0x16')]+_0x6488('0x17'));return _0x167ee1[_0x6488('0x18')]('\x20');}function getAccessTokenScope(_0x5a4223){if(_0x5a4223[_0x6488('0x14')]===_0x6488('0x19'))return _0x6488('0xc');if(_0x5a4223[_0x6488('0x14')]===_0x6488('0x1a'))return _0x5a4223['data7']+_0x6488('0x17');}function generateMicrosoftAuthorizationUrl(_0x25972c,_0x33bdc5){var _0x407217=MICROSOFT_AUTH_URL[_0x6488('0x1b')]('{TENANT_ID}',_0x25972c[_0x6488('0x1c')]);var _0xe53787=[_0x6488('0x1d'),_0x6488('0x1e')];var _0x3bced2=Buffer[_0x6488('0x1f')](JSON[_0x6488('0x20')]({'id':_0x33bdc5}))[_0x6488('0x21')]('base64');var _0x2b1eca=crypto[_0x6488('0x22')](0x10)['toString'](_0x6488('0x23'));var _0x3bcbb8=getAuthorizationScopes(_0x25972c);var _0x3fea00=[{'key':_0x6488('0x24'),'value':_0x25972c[_0x6488('0x25')]},{'key':_0x6488('0x26'),'value':encodeURIComponent(_0xe53787[_0x6488('0x18')]('\x20'))},{'key':'redirect_uri','value':_0x25972c[_0x6488('0x27')]},{'key':_0x6488('0x28'),'value':'form_post'},{'key':_0x6488('0x29'),'value':encodeURIComponent(_0x3bcbb8)},{'key':_0x6488('0x2a'),'value':_0x3bced2},{'key':_0x6488('0x2b'),'value':_0x2b1eca},{'key':'prompt','value':_0x6488('0x2c')}];var _0x403d3f=_0x407217+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x6488('0x13')](_0x3fea00,function(_0x21de96){return _0x21de96[_0x6488('0x2d')]+'='+_0x21de96[_0x6488('0x2e')];})[_0x6488('0x18')]('&');_0x25972c['oauth2Claims']={'issuer':_0x407217['replace'](_0x6488('0x2f'),''),'audience':_0x25972c[_0x6488('0x25')],'state':_0x3bced2,'nonce':_0x2b1eca};redis[_0x6488('0x30')](_0x3bced2,JSON[_0x6488('0x20')](_0x25972c));return _0x403d3f;}function isValidIdToken(_0x2e09c3,_0x3b8774){try{var _0x5cb5b2=jwt['decode'](_0x2e09c3,{'complete':!![]});var _0x3e42a8=_0x5cb5b2[_0x6488('0x31')];if(_0x3e42a8['iss']!==_0x3b8774[_0x6488('0x32')])return![];if(_0x3e42a8[_0x6488('0x33')]!==_0x3b8774[_0x6488('0x34')])return![];if(_0x3e42a8[_0x6488('0x2b')]!==_0x3b8774[_0x6488('0x2b')])return![];if(moment()[_0x6488('0x35')](moment[_0x6488('0x36')](_0x3e42a8[_0x6488('0x37')])))return![];return!![];}catch(_0xaa10a5){throw _0xaa10a5;}}function refreshOauth2MicrosoftAccessToken(_0x295aa3){return Promise[_0x6488('0x38')]()[_0x6488('0x39')](function(){if(_0x295aa3['data3'])return _0x295aa3;return db[_0x6488('0x3a')][_0x6488('0x3b')]({'where':{'id':_0x295aa3['id']},'raw':!![]});})[_0x6488('0x39')](function(_0x8a988d){var _0x1908e4={'grant_type':'refresh_token','refresh_token':_0x8a988d['data6'],'scope':getAccessTokenScope(_0x8a988d),'redirect_uri':_0x8a988d[_0x6488('0x27')],'client_id':_0x8a988d[_0x6488('0x25')],'client_secret':encryptor[_0x6488('0x3c')](_0x8a988d['data3'])};var _0x331c41={'method':_0x6488('0x3d'),'uri':MICROSOFT_AUTH_URL[_0x6488('0x1b')]('{TENANT_ID}',_0x8a988d[_0x6488('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1908e4,'json':!![]};return rp(_0x331c41);})[_0x6488('0x39')](function(_0x4ae885){_0x295aa3[_0x6488('0x3e')]=_0x4ae885[_0x6488('0x3f')];_0x295aa3['data6']=_0x4ae885[_0x6488('0x40')];return db[_0x6488('0x3a')]['update']({'data5':_0x295aa3[_0x6488('0x3e')],'data6':_0x295aa3[_0x6488('0x41')]},{'where':{'id':_0x295aa3['id']}});})[_0x6488('0x39')](function(){return _0x295aa3;})[_0x6488('0x42')](function(_0x5b4fe5){logger[_0x6488('0x43')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x295aa3['id'],_0x5b4fe5);});}function getOauth2MicrosoftAccessToken(_0x3c83d1,_0x48386a){var _0x230312={'grant_type':_0x6488('0x44'),'code':_0x3c83d1,'scope':getAccessTokenScope(_0x48386a),'redirect_uri':_0x48386a[_0x6488('0x27')],'client_id':_0x48386a[_0x6488('0x25')],'client_secret':encryptor[_0x6488('0x3c')](_0x48386a['data3'])};var _0x1f9c35={'method':'POST','uri':MICROSOFT_AUTH_URL['replace'](_0x6488('0x45'),_0x48386a[_0x6488('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x230312,'json':!![]};return rp(_0x1f9c35);}function startRefreshInterval(_0x39c25a){var _0x480f50=schedule[_0x6488('0x46')];if(_0x480f50[_0x39c25a['id']])clearInterval(_0x480f50[_0x39c25a['id']]);_0x480f50[_0x39c25a['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x39c25a['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x480f50;}function startAllRefreshIntervals(){return db['CloudProvider'][_0x6488('0x47')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x6488('0x39')](function(_0x406162){var _0x1dd0f3=_0x406162[_0x6488('0x13')](function(_0x43cf72){return refreshOauth2MicrosoftAccessToken(_0x43cf72)['then'](function(_0x30173a){startRefreshInterval(_0x30173a);});});return Promise[_0x6488('0x48')](_0x1dd0f3);})[_0x6488('0x42')](function(_0xf33c44){var _0x58f980=_0xf33c44?util[_0x6488('0x49')](_0xf33c44,{'showHidden':![],'depth':null}):'';logger[_0x6488('0x43')](_0x6488('0x4a'),_0x58f980);});}module[_0x6488('0x4b')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x5361=['lodash','jsonwebtoken','moment','ioredis','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','defaults','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office.com/POP.AccessAsUser.All','/authorize','/token','type','Dynamics365','data7','/.default','join','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','replace','data2','code','id_token','from','base64','randomBytes','toString','hex','response_type','redirect_uri','data4','response_mode','form_post','scope','prompt','login','map','key','oauth2Claims','data1','set','stringify','payload','iss','issuer','aud','audience','nonce','isAfter','unix','exp','resolve','then','CloudProvider','findOne','refresh_token','data6','data3','{TENANT_ID}','data5','access_token','update','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','decryptString','intervals','bind','findAll','all','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports'];(function(_0x4b9369,_0x493488){var _0x918fb2=function(_0x1ab7d3){while(--_0x1ab7d3){_0x4b9369['push'](_0x4b9369['shift']());}};_0x918fb2(++_0x493488);}(_0x5361,0x19a));var _0x1536=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x5361[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0x1536('0x0'));var crypto=require('crypto');var jwt=require(_0x1536('0x1'));var moment=require(_0x1536('0x2'));var Redis=require(_0x1536('0x3'));var rp=require('request-promise');var util=require('util');var encryptor=require(_0x1536('0x4'));var config=require(_0x1536('0x5'));var logger=require(_0x1536('0x6'))(_0x1536('0x7'));var schedule=require(_0x1536('0x8'));var db=require(_0x1536('0x9'))['db'];config['redis']=_[_0x1536('0xa')](config[_0x1536('0xb')],{'host':_0x1536('0xc'),'port':0x18eb});var redis=new Redis(config[_0x1536('0xb')]);var MICROSOFT_AUTH_URL=_0x1536('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0x1536('0xe'),_0x1536('0xf'),_0x1536('0x10'),_0x1536('0x11'),'https://outlook.office365.com/IMAP.AccessAsUser.All',_0x1536('0x12'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0x1536('0xe'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0x1536('0x13');var MICROSOFT_TOKEN_ENDPOINT=_0x1536('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x37b90c){var _0x254c09=_['map'](AZURE_AUTH_SCOPES[_0x37b90c[_0x1536('0x15')]]);if(_0x37b90c[_0x1536('0x15')]===_0x1536('0x16'))_0x254c09['push'](_0x37b90c[_0x1536('0x17')]+_0x1536('0x18'));return _0x254c09[_0x1536('0x19')]('\x20');}function getAccessTokenScope(_0x2a7fe4){if(_0x2a7fe4[_0x1536('0x15')]===_0x1536('0x1a'))return _0x1536('0x1b');if(_0x2a7fe4['type']===_0x1536('0x16'))return _0x2a7fe4[_0x1536('0x17')]+_0x1536('0x18');}function generateMicrosoftAuthorizationUrl(_0x9639f9,_0x27813b){var _0x32485f=MICROSOFT_AUTH_URL[_0x1536('0x1c')]('{TENANT_ID}',_0x9639f9[_0x1536('0x1d')]);var _0x1b679c=[_0x1536('0x1e'),_0x1536('0x1f')];var _0x19d819=Buffer[_0x1536('0x20')](JSON['stringify']({'id':_0x27813b}))['toString'](_0x1536('0x21'));var _0xbc6c27=crypto[_0x1536('0x22')](0x10)[_0x1536('0x23')](_0x1536('0x24'));var _0xbf59c6=getAuthorizationScopes(_0x9639f9);var _0x1bd1b2=[{'key':'client_id','value':_0x9639f9['data1']},{'key':_0x1536('0x25'),'value':encodeURIComponent(_0x1b679c[_0x1536('0x19')]('\x20'))},{'key':_0x1536('0x26'),'value':_0x9639f9[_0x1536('0x27')]},{'key':_0x1536('0x28'),'value':_0x1536('0x29')},{'key':_0x1536('0x2a'),'value':encodeURIComponent(_0xbf59c6)},{'key':'state','value':_0x19d819},{'key':'nonce','value':_0xbc6c27},{'key':_0x1536('0x2b'),'value':_0x1536('0x2c')}];var _0x162f2e=_0x32485f+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x1536('0x2d')](_0x1bd1b2,function(_0x391a82){return _0x391a82[_0x1536('0x2e')]+'='+_0x391a82['value'];})['join']('&');_0x9639f9[_0x1536('0x2f')]={'issuer':_0x32485f[_0x1536('0x1c')]('oauth2/',''),'audience':_0x9639f9[_0x1536('0x30')],'state':_0x19d819,'nonce':_0xbc6c27};redis[_0x1536('0x31')](_0x19d819,JSON[_0x1536('0x32')](_0x9639f9));return _0x162f2e;}function isValidIdToken(_0xab4845,_0x4ecad4){try{var _0x129bda=jwt['decode'](_0xab4845,{'complete':!![]});var _0x3d1b68=_0x129bda[_0x1536('0x33')];if(_0x3d1b68[_0x1536('0x34')]!==_0x4ecad4[_0x1536('0x35')])return![];if(_0x3d1b68[_0x1536('0x36')]!==_0x4ecad4[_0x1536('0x37')])return![];if(_0x3d1b68[_0x1536('0x38')]!==_0x4ecad4['nonce'])return![];if(moment()[_0x1536('0x39')](moment[_0x1536('0x3a')](_0x3d1b68[_0x1536('0x3b')])))return![];return!![];}catch(_0xe9bd6d){throw _0xe9bd6d;}}function refreshOauth2MicrosoftAccessToken(_0x5522cd){return Promise[_0x1536('0x3c')]()[_0x1536('0x3d')](function(){if(_0x5522cd['data3'])return _0x5522cd;return db[_0x1536('0x3e')][_0x1536('0x3f')]({'where':{'id':_0x5522cd['id']},'raw':!![]});})[_0x1536('0x3d')](function(_0x27d360){var _0x2fa337={'grant_type':_0x1536('0x40'),'refresh_token':_0x27d360[_0x1536('0x41')],'scope':getAccessTokenScope(_0x27d360),'redirect_uri':_0x27d360[_0x1536('0x27')],'client_id':_0x27d360['data1'],'client_secret':encryptor['decryptString'](_0x27d360[_0x1536('0x42')])};var _0x465424={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x1536('0x1c')](_0x1536('0x43'),_0x27d360['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2fa337,'json':!![]};return rp(_0x465424);})[_0x1536('0x3d')](function(_0x15f152){_0x5522cd[_0x1536('0x44')]=_0x15f152[_0x1536('0x45')];_0x5522cd[_0x1536('0x41')]=_0x15f152[_0x1536('0x40')];return db[_0x1536('0x3e')][_0x1536('0x46')]({'data5':_0x5522cd[_0x1536('0x44')],'data6':_0x5522cd[_0x1536('0x41')]},{'where':{'id':_0x5522cd['id']}});})[_0x1536('0x3d')](function(){return _0x5522cd;})[_0x1536('0x47')](function(_0x2b1487){logger['error'](_0x1536('0x48'),_0x5522cd['id'],_0x2b1487);});}function getOauth2MicrosoftAccessToken(_0x220382,_0x3fb6cd){var _0x2882c6={'grant_type':_0x1536('0x49'),'code':_0x220382,'scope':getAccessTokenScope(_0x3fb6cd),'redirect_uri':_0x3fb6cd[_0x1536('0x27')],'client_id':_0x3fb6cd[_0x1536('0x30')],'client_secret':encryptor[_0x1536('0x4a')](_0x3fb6cd[_0x1536('0x42')])};var _0xf535b3={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x1536('0x1c')](_0x1536('0x43'),_0x3fb6cd[_0x1536('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2882c6,'json':!![]};return rp(_0xf535b3);}function startRefreshInterval(_0x2dd113){var _0x37b0c8=schedule[_0x1536('0x4b')];if(_0x37b0c8[_0x2dd113['id']])clearInterval(_0x37b0c8[_0x2dd113['id']]);_0x37b0c8[_0x2dd113['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x1536('0x4c')](this,{'id':_0x2dd113['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x1536('0x4b')]=_0x37b0c8;}function startAllRefreshIntervals(){return db[_0x1536('0x3e')][_0x1536('0x4d')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x986bf7){var _0x49bded=_0x986bf7[_0x1536('0x2d')](function(_0x56bd04){return refreshOauth2MicrosoftAccessToken(_0x56bd04)['then'](function(_0x2ffc37){startRefreshInterval(_0x2ffc37);});});return Promise[_0x1536('0x4e')](_0x49bded);})[_0x1536('0x47')](function(_0x25964d){var _0x563e42=_0x25964d?util['inspect'](_0x25964d,{'showHidden':![],'depth':null}):'';logger[_0x1536('0x4f')](_0x1536('0x50'),_0x563e42);});}module[_0x1536('0x51')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index 5e64036..4e2801d 100644
--- a/server/api/cloudProvider/cloudProvider.rpc.js
+++ b/server/api/cloudProvider/cloudProvider.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8ed7=['jayson/promise','client','http','then','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x2b4448,_0x5bcc69){var _0xb4b465=function(_0x5ac741){while(--_0x5ac741){_0x2b4448['push'](_0x2b4448['shift']());}};_0xb4b465(++_0x5bcc69);}(_0x8ed7,0x8b));var _0x78ed=function(_0x3a0661,_0x429adc){_0x3a0661=_0x3a0661-0x0;var _0x1ea7e4=_0x8ed7[_0x3a0661];return _0x1ea7e4;};'use strict';var _=require('lodash');var util=require(_0x78ed('0x0'));var moment=require(_0x78ed('0x1'));var BPromise=require(_0x78ed('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x78ed('0x3'))['db'];var utils=require(_0x78ed('0x4'));var logger=require(_0x78ed('0x5'))(_0x78ed('0x6'));var config=require(_0x78ed('0x7'));var jayson=require(_0x78ed('0x8'));var client=jayson[_0x78ed('0x9')][_0x78ed('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1fc5e7,_0x54c783,_0x232d7b){return new BPromise(function(_0x5197a3,_0x1c0ec8){return client['request'](_0x1fc5e7,_0x232d7b)[_0x78ed('0xb')](function(_0x550763){logger['info'](_0x78ed('0xc'),_0x54c783,_0x78ed('0xd'));logger['debug'](_0x78ed('0xe'),_0x54c783,_0x78ed('0xd'),JSON['stringify'](_0x550763));if(_0x550763[_0x78ed('0xf')]){if(_0x550763['error'][_0x78ed('0x10')]===0x1f4){logger[_0x78ed('0xf')](_0x78ed('0xc'),_0x54c783,_0x550763[_0x78ed('0xf')][_0x78ed('0x11')]);return _0x1c0ec8(_0x550763[_0x78ed('0xf')]['message']);}logger[_0x78ed('0xf')]('CloudProvider,\x20%s,\x20%s',_0x54c783,_0x550763['error']['message']);return _0x5197a3(_0x550763['error']['message']);}else{logger[_0x78ed('0x12')](_0x78ed('0xc'),_0x54c783,_0x78ed('0xd'));_0x5197a3(_0x550763[_0x78ed('0x13')][_0x78ed('0x11')]);}})[_0x78ed('0x14')](function(_0x336ae1){logger[_0x78ed('0xf')](_0x78ed('0xc'),_0x54c783,_0x336ae1);_0x1c0ec8(_0x336ae1);});});}
\ No newline at end of file
+var _0xa064=['stringify','error','message','CloudProvider,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s'];(function(_0x35852a,_0x563430){var _0x439c4f=function(_0xa47fbe){while(--_0xa47fbe){_0x35852a['push'](_0x35852a['shift']());}};_0x439c4f(++_0x563430);}(_0xa064,0x192));var _0x4a06=function(_0xf04b83,_0x399c28){_0xf04b83=_0xf04b83-0x0;var _0x3d15eb=_0xa064[_0xf04b83];return _0x3d15eb;};'use strict';var _=require(_0x4a06('0x0'));var util=require(_0x4a06('0x1'));var moment=require(_0x4a06('0x2'));var BPromise=require(_0x4a06('0x3'));var rs=require(_0x4a06('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4a06('0x5'));var logger=require('../../config/logger')(_0x4a06('0x6'));var config=require(_0x4a06('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4a06('0x8')][_0x4a06('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55d4e3,_0x3b01cc,_0x454574){return new BPromise(function(_0x4c966b,_0x5e3342){return client[_0x4a06('0xa')](_0x55d4e3,_0x454574)[_0x4a06('0xb')](function(_0x3a8db5){logger[_0x4a06('0xc')]('CloudProvider,\x20%s,\x20%s',_0x3b01cc,_0x4a06('0xd'));logger[_0x4a06('0xe')](_0x4a06('0xf'),_0x3b01cc,_0x4a06('0xd'),JSON[_0x4a06('0x10')](_0x3a8db5));if(_0x3a8db5[_0x4a06('0x11')]){if(_0x3a8db5[_0x4a06('0x11')]['code']===0x1f4){logger[_0x4a06('0x11')]('CloudProvider,\x20%s,\x20%s',_0x3b01cc,_0x3a8db5[_0x4a06('0x11')][_0x4a06('0x12')]);return _0x5e3342(_0x3a8db5[_0x4a06('0x11')]['message']);}logger[_0x4a06('0x11')](_0x4a06('0x13'),_0x3b01cc,_0x3a8db5[_0x4a06('0x11')]['message']);return _0x4c966b(_0x3a8db5[_0x4a06('0x11')][_0x4a06('0x12')]);}else{logger[_0x4a06('0xc')]('CloudProvider,\x20%s,\x20%s',_0x3b01cc,_0x4a06('0xd'));_0x4c966b(_0x3a8db5[_0x4a06('0x14')][_0x4a06('0x12')]);}})[_0x4a06('0x15')](function(_0x15b067){logger['error'](_0x4a06('0x13'),_0x3b01cc,_0x15b067);_0x5e3342(_0x15b067);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index b71d4f7..1b8e769 100644
--- a/server/api/cloudProvider/index.js
+++ b/server/api/cloudProvider/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc4aa=['put','/:id','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','show','post','create'];(function(_0x5eb979,_0x4ab81e){var _0x164fdb=function(_0x393b1c){while(--_0x393b1c){_0x5eb979['push'](_0x5eb979['shift']());}};_0x164fdb(++_0x4ab81e);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xc4aa[_0x4b369d];return _0x571a98;};'use strict';var express=require(_0xac4a('0x0'));var router=express[_0xac4a('0x1')]();var auth=require(_0xac4a('0x2'));var controller=require(_0xac4a('0x3'));router[_0xac4a('0x4')]('/',auth[_0xac4a('0x5')](),controller['index']);router['get']('/:id',auth[_0xac4a('0x5')](),controller[_0xac4a('0x6')]);router[_0xac4a('0x7')]('/',auth[_0xac4a('0x5')](),controller[_0xac4a('0x8')]);router[_0xac4a('0x9')](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller['update']);router['delete'](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xb')]);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xd')]);router['post'](_0xac4a('0xe'),controller['oauth2MicrosoftCallback']);module[_0xac4a('0xf')]=router;
\ No newline at end of file
+var _0x5f66=['index','post','/:id','update','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','Router','./cloudProvider.controller','get','isAuthenticated'];(function(_0x572385,_0x38208e){var _0x27b7ca=function(_0x4423c4){while(--_0x4423c4){_0x572385['push'](_0x572385['shift']());}};_0x27b7ca(++_0x38208e);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x5f66[_0x2f5ac5];return _0x37c9a8;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);router[_0x65f6('0x2')]('/:id',auth[_0x65f6('0x3')](),controller['show']);router[_0x65f6('0x5')]('/',auth[_0x65f6('0x3')](),controller['create']);router['put'](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller[_0x65f6('0x7')]);router[_0x65f6('0x8')](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller['destroy']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x3')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x5')]('/oauth2/microsoft/callback',controller[_0x65f6('0xb')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 7585452..8e3b2af 100644
--- a/server/api/cmCompany/cmCompany.attributes.js
+++ b/server/api/cmCompany/cmCompany.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7b00=['exports','STRING','sequelize'];(function(_0xfbdff6,_0x2af690){var _0x4cb9be=function(_0x4022d8){while(--_0x4022d8){_0xfbdff6['push'](_0xfbdff6['shift']());}};_0x4cb9be(++_0x2af690);}(_0x7b00,0xa4));var _0x07b0=function(_0x4e5c91,_0x298f64){_0x4e5c91=_0x4e5c91-0x0;var _0x5d40e7=_0x7b00[_0x4e5c91];return _0x5d40e7;};'use strict';var Sequelize=require(_0x07b0('0x0'));module[_0x07b0('0x1')]={'name':{'type':Sequelize[_0x07b0('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x07b0('0x2')]},'companyId':{'type':Sequelize[_0x07b0('0x2')]},'website':{'type':Sequelize[_0x07b0('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x07b0('0x2')]},'type':{'type':Sequelize[_0x07b0('0x2')]},'street':{'type':Sequelize[_0x07b0('0x2')]},'postalCode':{'type':Sequelize[_0x07b0('0x2')]},'city':{'type':Sequelize[_0x07b0('0x2')]},'country':{'type':Sequelize[_0x07b0('0x2')]},'email':{'type':Sequelize[_0x07b0('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x07b0('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x07b0('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x07b0('0x2')]},'description':{'type':Sequelize[_0x07b0('0x2')]}};
\ No newline at end of file
+var _0x2a5e=['sequelize','name','STRING'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0x2a5e,0xf6));var _0xe2a5=function(_0x122cd4,_0x3ed93d){_0x122cd4=_0x122cd4-0x0;var _0x170dcb=_0x2a5e[_0x122cd4];return _0x170dcb;};'use strict';var Sequelize=require(_0xe2a5('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xe2a5('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xe2a5('0x2')]},'companyId':{'type':Sequelize[_0xe2a5('0x2')]},'website':{'type':Sequelize[_0xe2a5('0x2')]},'phone':{'type':Sequelize[_0xe2a5('0x2')]},'fax':{'type':Sequelize[_0xe2a5('0x2')]},'type':{'type':Sequelize[_0xe2a5('0x2')]},'street':{'type':Sequelize[_0xe2a5('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xe2a5('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xe2a5('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0xe2a5('0x2')]},'sPostalCode':{'type':Sequelize[_0xe2a5('0x2')]},'sCity':{'type':Sequelize[_0xe2a5('0x2')]},'sCountry':{'type':Sequelize[_0xe2a5('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 7f103e6..d3f6424 100644
--- a/server/api/cmCompany/cmCompany.controller.js
+++ b/server/api/cmCompany/cmCompany.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x99ff=['limit','count','set','Content-Range','json','apply','reject','update','then','get','Companies','UserProfileResource','error','stack','name','send','index','CmCompany','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','role','UserProfileSection','destroy','describe','CmContact','addContacts','ids','getContacts','hasOwnProperty','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','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','offset','undefined'];(function(_0x442d3c,_0x18bf15){var _0x48c5a4=function(_0x4191f4){while(--_0x4191f4){_0x442d3c['push'](_0x442d3c['shift']());}};_0x48c5a4(++_0x18bf15);}(_0x99ff,0xe2));var _0xf99f=function(_0x507357,_0x2c9a2f){_0x507357=_0x507357-0x0;var _0x164653=_0x99ff[_0x507357];return _0x164653;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf99f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf99f('0x1'));var moment=require('moment');var BPromise=require(_0xf99f('0x2'));var Mustache=require(_0xf99f('0x3'));var util=require(_0xf99f('0x4'));var path=require(_0xf99f('0x5'));var sox=require(_0xf99f('0x6'));var csv=require(_0xf99f('0x7'));var ejs=require(_0xf99f('0x8'));var fs=require('fs');var fs_extra=require(_0xf99f('0x9'));var _=require(_0xf99f('0xa'));var squel=require('squel');var crypto=require(_0xf99f('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf99f('0x7'));var querystring=require(_0xf99f('0xc'));var Papa=require(_0xf99f('0xd'));var Redis=require(_0xf99f('0xe'));var authService=require(_0xf99f('0xf'));var qs=require(_0xf99f('0x10'));var as=require(_0xf99f('0x11'));var hardwareService=require(_0xf99f('0x12'));var logger=require(_0xf99f('0x13'))(_0xf99f('0x14'));var utils=require(_0xf99f('0x15'));var config=require(_0xf99f('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xf99f('0x17'))['db'];function respondWithStatusCode(_0x5ae492,_0x2fe925){_0x2fe925=_0x2fe925||0xcc;return function(_0xdb3b3a){if(_0xdb3b3a){return _0x5ae492[_0xf99f('0x18')](_0x2fe925);}return _0x5ae492[_0xf99f('0x19')](_0x2fe925)[_0xf99f('0x1a')]();};}function respondWithResult(_0x21c15f,_0x3eaa1c){_0x3eaa1c=_0x3eaa1c||0xc8;return function(_0x4dd8e8){if(_0x4dd8e8){return _0x21c15f['status'](_0x3eaa1c)['json'](_0x4dd8e8);}};}function respondWithFilteredResult(_0x19561c,_0x173884){return function(_0x37007e){if(_0x37007e){var _0x869220=typeof _0x173884[_0xf99f('0x1b')]===_0xf99f('0x1c')&&typeof _0x173884[_0xf99f('0x1d')]===_0xf99f('0x1c');var _0xc5ab54=_0x37007e[_0xf99f('0x1e')];var _0x18f7d1=_0x869220?0x0:_0x173884[_0xf99f('0x1b')];var _0x5f0181=_0x869220?_0x37007e[_0xf99f('0x1e')]:_0x173884[_0xf99f('0x1b')]+_0x173884[_0xf99f('0x1d')];var _0x5012f2;if(_0x5f0181>=_0xc5ab54){_0x5f0181=_0xc5ab54;_0x5012f2=0xc8;}else{_0x5012f2=0xce;}_0x19561c[_0xf99f('0x19')](_0x5012f2);return _0x19561c[_0xf99f('0x1f')](_0xf99f('0x20'),_0x18f7d1+'-'+_0x5f0181+'/'+_0xc5ab54)[_0xf99f('0x21')](_0x37007e);}return null;};}function patchUpdates(_0x23ced8){return function(_0x276413){try{jsonpatch[_0xf99f('0x22')](_0x276413,_0x23ced8,!![]);}catch(_0x262670){return BPromise[_0xf99f('0x23')](_0x262670);}return _0x276413['save']();};}function saveUpdates(_0x506500,_0x5ad4a6){return function(_0x38f4d1){if(_0x38f4d1){return _0x38f4d1[_0xf99f('0x24')](_0x506500)[_0xf99f('0x25')](function(_0x1ab25c){return _0x1ab25c;});}return null;};}function removeEntity(_0x421c17,_0x4094f8){return function(_0x12ed07){if(_0x12ed07){return _0x12ed07['destroy']()['then'](function(){var _0x1beb6c=_0x12ed07[_0xf99f('0x26')]({'plain':!![]});var _0x25996e=_0xf99f('0x27');return db[_0xf99f('0x28')]['destroy']({'where':{'type':_0x25996e,'resourceId':_0x1beb6c['id']}})[_0xf99f('0x25')](function(){return _0x12ed07;});})[_0xf99f('0x25')](function(){_0x421c17[_0xf99f('0x19')](0xcc)[_0xf99f('0x1a')]();});}};}function handleEntityNotFound(_0x5c0210,_0x5d1f41){return function(_0x9b5b08){if(!_0x9b5b08){_0x5c0210[_0xf99f('0x18')](0x194);}return _0x9b5b08;};}function handleError(_0x8b1ea2,_0x3d64c7){_0x3d64c7=_0x3d64c7||0x1f4;return function(_0x3cb85a){logger[_0xf99f('0x29')](_0x3cb85a[_0xf99f('0x2a')]);if(_0x3cb85a[_0xf99f('0x2b')]){delete _0x3cb85a[_0xf99f('0x2b')];}_0x8b1ea2['status'](_0x3d64c7)[_0xf99f('0x2c')](_0x3cb85a);};}exports[_0xf99f('0x2d')]=function(_0x345318,_0xbff334){var _0xc7e108={},_0x218e99={},_0xd4e917={'count':0x0,'rows':[]};return db[_0xf99f('0x2e')]['describe']()[_0xf99f('0x25')](function(_0x504f5e){_0x218e99['model']=_[_0xf99f('0x2f')](_0x504f5e);_0x218e99[_0xf99f('0x30')]=_[_0xf99f('0x2f')](_0x345318[_0xf99f('0x30')]);_0x218e99[_0xf99f('0x31')]=_[_0xf99f('0x32')](_0x218e99[_0xf99f('0x33')],_0x218e99['query']);_0xc7e108[_0xf99f('0x34')]=_[_0xf99f('0x32')](_0x218e99[_0xf99f('0x33')],qs[_0xf99f('0x35')](_0x345318[_0xf99f('0x30')][_0xf99f('0x35')]));_0xc7e108['attributes']=_0xc7e108['attributes'][_0xf99f('0x36')]?_0xc7e108[_0xf99f('0x34')]:_0x218e99[_0xf99f('0x33')];if(!_0x345318['query']['hasOwnProperty'](_0xf99f('0x37'))){_0xc7e108['limit']=qs['limit'](_0x345318[_0xf99f('0x30')]['limit']);_0xc7e108[_0xf99f('0x1b')]=qs['offset'](_0x345318[_0xf99f('0x30')][_0xf99f('0x1b')]);}_0xc7e108[_0xf99f('0x38')]=qs[_0xf99f('0x39')](_0x345318[_0xf99f('0x30')][_0xf99f('0x39')]);_0xc7e108[_0xf99f('0x3a')]=qs[_0xf99f('0x31')](_[_0xf99f('0x3b')](_0x345318['query'],_0x218e99[_0xf99f('0x31')]),_0x504f5e);if(_0x345318['query'][_0xf99f('0x3c')]){_0xc7e108[_0xf99f('0x3a')]=_[_0xf99f('0x3d')](_0xc7e108['where'],{'$or':_[_0xf99f('0x3e')](_0xc7e108[_0xf99f('0x34')],function(_0x44ae76){var _0x38549a={};_0x38549a[_0x44ae76]={'$like':'%'+_0x345318['query'][_0xf99f('0x3c')]+'%'};return _0x38549a;})});}_0xc7e108=_[_0xf99f('0x3d')]({},_0xc7e108,_0x345318[_0xf99f('0x3f')]);var _0x3c1a8f={'where':_0xc7e108['where']};return db[_0xf99f('0x2e')][_0xf99f('0x1e')](_0x3c1a8f)[_0xf99f('0x25')](function(_0xcf37c8){_0xd4e917[_0xf99f('0x1e')]=_0xcf37c8;if(_0x345318[_0xf99f('0x30')][_0xf99f('0x40')]){_0xc7e108[_0xf99f('0x41')]=[{'all':!![]}];}return db[_0xf99f('0x2e')][_0xf99f('0x42')](_0xc7e108);})[_0xf99f('0x25')](function(_0x365922){_0xd4e917[_0xf99f('0x43')]=_0x365922;return _0xd4e917;})['then'](respondWithFilteredResult(_0xbff334,_0xc7e108))[_0xf99f('0x44')](handleError(_0xbff334,null));})[_0xf99f('0x44')](handleError(_0xbff334,null));};exports[_0xf99f('0x45')]=function(_0x47de92,_0x35c252){var _0x36325c={'raw':![],'where':{'id':_0x47de92[_0xf99f('0x46')]['id']}},_0xcab6a9={};_0xcab6a9[_0xf99f('0x33')]=_['keys'](db[_0xf99f('0x2e')][_0xf99f('0x47')]);_0xcab6a9[_0xf99f('0x30')]=_[_0xf99f('0x2f')](_0x47de92[_0xf99f('0x30')]);_0xcab6a9[_0xf99f('0x31')]=_['intersection'](_0xcab6a9[_0xf99f('0x33')],_0xcab6a9[_0xf99f('0x30')]);_0x36325c[_0xf99f('0x34')]=_[_0xf99f('0x32')](_0xcab6a9[_0xf99f('0x33')],qs[_0xf99f('0x35')](_0x47de92[_0xf99f('0x30')][_0xf99f('0x35')]));_0x36325c[_0xf99f('0x34')]=_0x36325c[_0xf99f('0x34')][_0xf99f('0x36')]?_0x36325c[_0xf99f('0x34')]:_0xcab6a9[_0xf99f('0x33')];if(_0x47de92[_0xf99f('0x30')]['includeAll']){_0x36325c['include']=[{'all':!![]}];}_0x36325c=_[_0xf99f('0x3d')]({},_0x36325c,_0x47de92['options']);return db[_0xf99f('0x2e')][_0xf99f('0x48')](_0x36325c)[_0xf99f('0x25')](handleEntityNotFound(_0x35c252,null))[_0xf99f('0x25')](respondWithResult(_0x35c252,null))[_0xf99f('0x44')](handleError(_0x35c252,null));};exports[_0xf99f('0x49')]=function(_0x1d0ea6,_0x49bd5c){return db[_0xf99f('0x2e')][_0xf99f('0x49')](_0x1d0ea6[_0xf99f('0x4a')],{})[_0xf99f('0x25')](function(_0xef1309){var _0x53a67d=_0x1d0ea6[_0xf99f('0x4b')][_0xf99f('0x26')]({'plain':!![]});if(!_0x53a67d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x53a67d[_0xf99f('0x4c')]===_0xf99f('0x4b')){var _0x2d9825=_0xef1309[_0xf99f('0x26')]({'plain':!![]});var _0x36cc4f=_0xf99f('0x27');return db[_0xf99f('0x4d')][_0xf99f('0x48')]({'where':{'name':_0x36cc4f,'userProfileId':_0x53a67d['userProfileId']},'raw':!![]})[_0xf99f('0x25')](function(_0x358c0c){if(_0x358c0c&&_0x358c0c['autoAssociation']===0x0){return db[_0xf99f('0x28')][_0xf99f('0x49')]({'name':_0x2d9825[_0xf99f('0x2b')],'resourceId':_0x2d9825['id'],'type':_0x358c0c[_0xf99f('0x2b')],'sectionId':_0x358c0c['id']},{})[_0xf99f('0x25')](function(){return _0xef1309;});}else{return _0xef1309;}})['catch'](function(_0x5a9527){logger[_0xf99f('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5a9527);throw _0x5a9527;});}return _0xef1309;})['then'](respondWithResult(_0x49bd5c,0xc9))[_0xf99f('0x44')](handleError(_0x49bd5c,null));};exports[_0xf99f('0x24')]=function(_0x453428,_0x419f9e){if(_0x453428['body']['id']){delete _0x453428['body']['id'];}return db[_0xf99f('0x2e')][_0xf99f('0x48')]({'where':{'id':_0x453428[_0xf99f('0x46')]['id']}})[_0xf99f('0x25')](handleEntityNotFound(_0x419f9e,null))[_0xf99f('0x25')](saveUpdates(_0x453428[_0xf99f('0x4a')],null))['then'](respondWithResult(_0x419f9e,null))[_0xf99f('0x44')](handleError(_0x419f9e,null));};exports[_0xf99f('0x4e')]=function(_0x1bafe0,_0x869a9a){return db[_0xf99f('0x2e')][_0xf99f('0x48')]({'where':{'id':_0x1bafe0[_0xf99f('0x46')]['id']}})['then'](handleEntityNotFound(_0x869a9a,null))[_0xf99f('0x25')](removeEntity(_0x869a9a,null))[_0xf99f('0x44')](handleError(_0x869a9a,null));};exports[_0xf99f('0x4f')]=function(_0x4fd5cf,_0xa5c1bb){return db['CmCompany']['describe']()[_0xf99f('0x25')](respondWithResult(_0xa5c1bb,null))[_0xf99f('0x44')](handleError(_0xa5c1bb,null));};exports['addContacts']=function(_0x17451e,_0x2886d0,_0x373a94){return db[_0xf99f('0x50')]['find']({'where':{'id':_0x17451e[_0xf99f('0x46')]['id']}})['then'](handleEntityNotFound(_0x2886d0,null))[_0xf99f('0x25')](function(_0x5aae0f){if(_0x5aae0f){return _0x5aae0f[_0xf99f('0x51')](_0x17451e[_0xf99f('0x4a')]['ids'],_['omit'](_0x17451e['body'],[_0xf99f('0x52'),'id'])||{});}})[_0xf99f('0x25')](respondWithResult(_0x2886d0,null))[_0xf99f('0x44')](handleError(_0x2886d0,null));};exports['getContacts']=function(_0x4b326c,_0x3d2fc4,_0x103e5f){var _0x2655f8={};var _0x4b23fe={};var _0x16cd64;var _0x4bde04;return db['CmCompany']['findOne']({'where':{'id':_0x4b326c[_0xf99f('0x46')]['id']}})[_0xf99f('0x25')](handleEntityNotFound(_0x3d2fc4,null))[_0xf99f('0x25')](function(_0x23d2b8){if(_0x23d2b8){_0x16cd64=_0x23d2b8;_0x4b23fe[_0xf99f('0x33')]=_[_0xf99f('0x2f')](db[_0xf99f('0x50')][_0xf99f('0x47')]);_0x4b23fe[_0xf99f('0x30')]=_[_0xf99f('0x2f')](_0x4b326c[_0xf99f('0x30')]);_0x4b23fe[_0xf99f('0x31')]=_['intersection'](_0x4b23fe[_0xf99f('0x33')],_0x4b23fe[_0xf99f('0x30')]);_0x2655f8[_0xf99f('0x34')]=_['intersection'](_0x4b23fe[_0xf99f('0x33')],qs[_0xf99f('0x35')](_0x4b326c[_0xf99f('0x30')][_0xf99f('0x35')]));_0x2655f8[_0xf99f('0x34')]=_0x2655f8[_0xf99f('0x34')][_0xf99f('0x36')]?_0x2655f8['attributes']:_0x4b23fe[_0xf99f('0x33')];_0x2655f8[_0xf99f('0x38')]=qs[_0xf99f('0x39')](_0x4b326c[_0xf99f('0x30')][_0xf99f('0x39')]);_0x2655f8[_0xf99f('0x3a')]=qs['filters'](_[_0xf99f('0x3b')](_0x4b326c[_0xf99f('0x30')],_0x4b23fe['filters']));if(_0x4b326c[_0xf99f('0x30')][_0xf99f('0x3c')]){_0x2655f8[_0xf99f('0x3a')]=_[_0xf99f('0x3d')](_0x2655f8['where'],{'$or':_[_0xf99f('0x3e')](_0x2655f8[_0xf99f('0x34')],function(_0x359ef3){var _0x11c359={};_0x11c359[_0x359ef3]={'$like':'%'+_0x4b326c[_0xf99f('0x30')][_0xf99f('0x3c')]+'%'};return _0x11c359;})});}_0x2655f8=_['merge']({},_0x2655f8,_0x4b326c[_0xf99f('0x3f')]);return _0x16cd64[_0xf99f('0x53')](_0x2655f8);}})['then'](function(_0x2189c4){if(_0x2189c4){_0x4bde04=_0x2189c4[_0xf99f('0x36')];if(!_0x4b326c[_0xf99f('0x30')][_0xf99f('0x54')](_0xf99f('0x37'))){_0x2655f8[_0xf99f('0x1d')]=qs['limit'](_0x4b326c[_0xf99f('0x30')][_0xf99f('0x1d')]);_0x2655f8['offset']=qs['offset'](_0x4b326c[_0xf99f('0x30')][_0xf99f('0x1b')]);}return _0x16cd64['getContacts'](_0x2655f8);}})[_0xf99f('0x25')](function(_0x3a12ca){if(_0x3a12ca){return _0x3a12ca?{'count':_0x4bde04,'rows':_0x3a12ca}:null;}})[_0xf99f('0x25')](respondWithResult(_0x3d2fc4,null))[_0xf99f('0x44')](handleError(_0x3d2fc4,null));};
\ No newline at end of file
+var _0x64e1=['sort','where','filters','merge','filter','options','include','findAll','params','rawAttributes','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','ids','omit','getContacts','findOne','CmContact','pick','map','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','Companies','UserProfileResource','error','stack','name','index','CmCompany','describe','keys','intersection','attributes','model','fields','query','length','hasOwnProperty','nolimit','order'];(function(_0x368113,_0x244119){var _0x475e26=function(_0x301a02){while(--_0x301a02){_0x368113['push'](_0x368113['shift']());}};_0x475e26(++_0x244119);}(_0x64e1,0xcc));var _0x164e=function(_0x718030,_0x3b25c9){_0x718030=_0x718030-0x0;var _0x13b085=_0x64e1[_0x718030];return _0x13b085;};'use strict';var emlformat=require(_0x164e('0x0'));var rimraf=require(_0x164e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x164e('0x2'));var rp=require(_0x164e('0x3'));var moment=require('moment');var BPromise=require(_0x164e('0x4'));var Mustache=require(_0x164e('0x5'));var util=require(_0x164e('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x164e('0x7'));var ejs=require(_0x164e('0x8'));var fs=require('fs');var fs_extra=require(_0x164e('0x9'));var _=require(_0x164e('0xa'));var squel=require(_0x164e('0xb'));var crypto=require(_0x164e('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x164e('0x7'));var querystring=require(_0x164e('0xd'));var Papa=require(_0x164e('0xe'));var Redis=require(_0x164e('0xf'));var authService=require(_0x164e('0x10'));var qs=require(_0x164e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x164e('0x12'))(_0x164e('0x13'));var utils=require(_0x164e('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x164e('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x305214,_0x28cb79){_0x28cb79=_0x28cb79||0xcc;return function(_0xd114a6){if(_0xd114a6){return _0x305214[_0x164e('0x16')](_0x28cb79);}return _0x305214[_0x164e('0x17')](_0x28cb79)[_0x164e('0x18')]();};}function respondWithResult(_0x245c29,_0x4adbb0){_0x4adbb0=_0x4adbb0||0xc8;return function(_0x2206a1){if(_0x2206a1){return _0x245c29[_0x164e('0x17')](_0x4adbb0)[_0x164e('0x19')](_0x2206a1);}};}function respondWithFilteredResult(_0x4d89b7,_0x3b2233){return function(_0x361859){if(_0x361859){var _0x25fbae=typeof _0x3b2233[_0x164e('0x1a')]===_0x164e('0x1b')&&typeof _0x3b2233[_0x164e('0x1c')]==='undefined';var _0x42fc9f=_0x361859[_0x164e('0x1d')];var _0x4e3c95=_0x25fbae?0x0:_0x3b2233[_0x164e('0x1a')];var _0x4f3501=_0x25fbae?_0x361859[_0x164e('0x1d')]:_0x3b2233[_0x164e('0x1a')]+_0x3b2233[_0x164e('0x1c')];var _0x5a06ea;if(_0x4f3501>=_0x42fc9f){_0x4f3501=_0x42fc9f;_0x5a06ea=0xc8;}else{_0x5a06ea=0xce;}_0x4d89b7['status'](_0x5a06ea);return _0x4d89b7[_0x164e('0x1e')](_0x164e('0x1f'),_0x4e3c95+'-'+_0x4f3501+'/'+_0x42fc9f)[_0x164e('0x19')](_0x361859);}return null;};}function patchUpdates(_0x202bf6){return function(_0x397ac9){try{jsonpatch[_0x164e('0x20')](_0x397ac9,_0x202bf6,!![]);}catch(_0x46e5d8){return BPromise[_0x164e('0x21')](_0x46e5d8);}return _0x397ac9[_0x164e('0x22')]();};}function saveUpdates(_0x4fb8b7,_0x186902){return function(_0x55cd93){if(_0x55cd93){return _0x55cd93[_0x164e('0x23')](_0x4fb8b7)['then'](function(_0x2f922a){return _0x2f922a;});}return null;};}function removeEntity(_0xcd3ae6,_0xa30a5d){return function(_0x2a69d3){if(_0x2a69d3){return _0x2a69d3[_0x164e('0x24')]()[_0x164e('0x25')](function(){var _0x242055=_0x2a69d3[_0x164e('0x26')]({'plain':!![]});var _0xc8bd89=_0x164e('0x27');return db[_0x164e('0x28')][_0x164e('0x24')]({'where':{'type':_0xc8bd89,'resourceId':_0x242055['id']}})[_0x164e('0x25')](function(){return _0x2a69d3;});})[_0x164e('0x25')](function(){_0xcd3ae6[_0x164e('0x17')](0xcc)[_0x164e('0x18')]();});}};}function handleEntityNotFound(_0x587777,_0x151160){return function(_0x4fdc48){if(!_0x4fdc48){_0x587777[_0x164e('0x16')](0x194);}return _0x4fdc48;};}function handleError(_0x259ad0,_0x495268){_0x495268=_0x495268||0x1f4;return function(_0x31db0c){logger[_0x164e('0x29')](_0x31db0c[_0x164e('0x2a')]);if(_0x31db0c['name']){delete _0x31db0c[_0x164e('0x2b')];}_0x259ad0[_0x164e('0x17')](_0x495268)['send'](_0x31db0c);};}exports[_0x164e('0x2c')]=function(_0x50e310,_0x2c9b86){var _0x209131={},_0xea448b={},_0x574bd0={'count':0x0,'rows':[]};return db[_0x164e('0x2d')][_0x164e('0x2e')]()[_0x164e('0x25')](function(_0x143bab){_0xea448b['model']=_[_0x164e('0x2f')](_0x143bab);_0xea448b['query']=_[_0x164e('0x2f')](_0x50e310['query']);_0xea448b['filters']=_[_0x164e('0x30')](_0xea448b['model'],_0xea448b['query']);_0x209131[_0x164e('0x31')]=_[_0x164e('0x30')](_0xea448b[_0x164e('0x32')],qs[_0x164e('0x33')](_0x50e310[_0x164e('0x34')][_0x164e('0x33')]));_0x209131[_0x164e('0x31')]=_0x209131[_0x164e('0x31')][_0x164e('0x35')]?_0x209131['attributes']:_0xea448b[_0x164e('0x32')];if(!_0x50e310[_0x164e('0x34')][_0x164e('0x36')](_0x164e('0x37'))){_0x209131[_0x164e('0x1c')]=qs[_0x164e('0x1c')](_0x50e310['query']['limit']);_0x209131[_0x164e('0x1a')]=qs[_0x164e('0x1a')](_0x50e310['query']['offset']);}_0x209131[_0x164e('0x38')]=qs[_0x164e('0x39')](_0x50e310[_0x164e('0x34')]['sort']);_0x209131[_0x164e('0x3a')]=qs[_0x164e('0x3b')](_['pick'](_0x50e310['query'],_0xea448b['filters']),_0x143bab);if(_0x50e310['query']['filter']){_0x209131[_0x164e('0x3a')]=_[_0x164e('0x3c')](_0x209131[_0x164e('0x3a')],{'$or':_['map'](_0x209131[_0x164e('0x31')],function(_0x5dc6d6){var _0x452e26={};_0x452e26[_0x5dc6d6]={'$like':'%'+_0x50e310['query'][_0x164e('0x3d')]+'%'};return _0x452e26;})});}_0x209131=_[_0x164e('0x3c')]({},_0x209131,_0x50e310[_0x164e('0x3e')]);var _0x408a72={'where':_0x209131[_0x164e('0x3a')]};return db[_0x164e('0x2d')][_0x164e('0x1d')](_0x408a72)[_0x164e('0x25')](function(_0x19d189){_0x574bd0[_0x164e('0x1d')]=_0x19d189;if(_0x50e310[_0x164e('0x34')]['includeAll']){_0x209131[_0x164e('0x3f')]=[{'all':!![]}];}return db[_0x164e('0x2d')][_0x164e('0x40')](_0x209131);})[_0x164e('0x25')](function(_0x6e5db8){_0x574bd0['rows']=_0x6e5db8;return _0x574bd0;})[_0x164e('0x25')](respondWithFilteredResult(_0x2c9b86,_0x209131))['catch'](handleError(_0x2c9b86,null));})['catch'](handleError(_0x2c9b86,null));};exports['show']=function(_0xb6d10e,_0x302ea3){var _0x35b96b={'raw':![],'where':{'id':_0xb6d10e[_0x164e('0x41')]['id']}},_0x31af1a={};_0x31af1a[_0x164e('0x32')]=_['keys'](db[_0x164e('0x2d')][_0x164e('0x42')]);_0x31af1a['query']=_['keys'](_0xb6d10e[_0x164e('0x34')]);_0x31af1a[_0x164e('0x3b')]=_['intersection'](_0x31af1a['model'],_0x31af1a[_0x164e('0x34')]);_0x35b96b[_0x164e('0x31')]=_[_0x164e('0x30')](_0x31af1a[_0x164e('0x32')],qs[_0x164e('0x33')](_0xb6d10e[_0x164e('0x34')]['fields']));_0x35b96b[_0x164e('0x31')]=_0x35b96b[_0x164e('0x31')][_0x164e('0x35')]?_0x35b96b[_0x164e('0x31')]:_0x31af1a[_0x164e('0x32')];if(_0xb6d10e['query'][_0x164e('0x43')]){_0x35b96b[_0x164e('0x3f')]=[{'all':!![]}];}_0x35b96b=_['merge']({},_0x35b96b,_0xb6d10e['options']);return db['CmCompany'][_0x164e('0x44')](_0x35b96b)[_0x164e('0x25')](handleEntityNotFound(_0x302ea3,null))[_0x164e('0x25')](respondWithResult(_0x302ea3,null))[_0x164e('0x45')](handleError(_0x302ea3,null));};exports[_0x164e('0x46')]=function(_0x3e626d,_0x4f8f26){return db[_0x164e('0x2d')][_0x164e('0x46')](_0x3e626d[_0x164e('0x47')],{})[_0x164e('0x25')](function(_0x1ab498){var _0x3badc2=_0x3e626d[_0x164e('0x48')]['get']({'plain':!![]});if(!_0x3badc2)throw new Error(_0x164e('0x49'));if(_0x3badc2[_0x164e('0x4a')]===_0x164e('0x48')){var _0x5398b1=_0x1ab498['get']({'plain':!![]});var _0x5ea807='Companies';return db[_0x164e('0x4b')][_0x164e('0x44')]({'where':{'name':_0x5ea807,'userProfileId':_0x3badc2[_0x164e('0x4c')]},'raw':!![]})[_0x164e('0x25')](function(_0x56ac68){if(_0x56ac68&&_0x56ac68[_0x164e('0x4d')]===0x0){return db[_0x164e('0x28')]['create']({'name':_0x5398b1[_0x164e('0x2b')],'resourceId':_0x5398b1['id'],'type':_0x56ac68[_0x164e('0x2b')],'sectionId':_0x56ac68['id']},{})['then'](function(){return _0x1ab498;});}else{return _0x1ab498;}})[_0x164e('0x45')](function(_0x35165c){logger[_0x164e('0x29')](_0x164e('0x4e'),_0x35165c);throw _0x35165c;});}return _0x1ab498;})['then'](respondWithResult(_0x4f8f26,0xc9))[_0x164e('0x45')](handleError(_0x4f8f26,null));};exports[_0x164e('0x23')]=function(_0x13bc4b,_0x282c68){if(_0x13bc4b[_0x164e('0x47')]['id']){delete _0x13bc4b['body']['id'];}return db[_0x164e('0x2d')][_0x164e('0x44')]({'where':{'id':_0x13bc4b[_0x164e('0x41')]['id']}})[_0x164e('0x25')](handleEntityNotFound(_0x282c68,null))[_0x164e('0x25')](saveUpdates(_0x13bc4b[_0x164e('0x47')],null))[_0x164e('0x25')](respondWithResult(_0x282c68,null))[_0x164e('0x45')](handleError(_0x282c68,null));};exports['destroy']=function(_0x186575,_0x2b71aa){return db[_0x164e('0x2d')][_0x164e('0x44')]({'where':{'id':_0x186575[_0x164e('0x41')]['id']}})[_0x164e('0x25')](handleEntityNotFound(_0x2b71aa,null))[_0x164e('0x25')](removeEntity(_0x2b71aa,null))[_0x164e('0x45')](handleError(_0x2b71aa,null));};exports[_0x164e('0x2e')]=function(_0x5ee403,_0x5a2010){return db['CmCompany'][_0x164e('0x2e')]()[_0x164e('0x25')](respondWithResult(_0x5a2010,null))[_0x164e('0x45')](handleError(_0x5a2010,null));};exports[_0x164e('0x4f')]=function(_0x352307,_0xd2254c,_0x512f67){return db['CmContact']['find']({'where':{'id':_0x352307[_0x164e('0x41')]['id']}})[_0x164e('0x25')](handleEntityNotFound(_0xd2254c,null))[_0x164e('0x25')](function(_0x4d52fa){if(_0x4d52fa){return _0x4d52fa[_0x164e('0x4f')](_0x352307['body'][_0x164e('0x50')],_[_0x164e('0x51')](_0x352307[_0x164e('0x47')],[_0x164e('0x50'),'id'])||{});}})[_0x164e('0x25')](respondWithResult(_0xd2254c,null))[_0x164e('0x45')](handleError(_0xd2254c,null));};exports[_0x164e('0x52')]=function(_0x5cd8be,_0x39c1e2,_0x28082b){var _0x3fc8db={};var _0x21d265={};var _0x53bf3b;var _0x38d6d3;return db[_0x164e('0x2d')][_0x164e('0x53')]({'where':{'id':_0x5cd8be[_0x164e('0x41')]['id']}})[_0x164e('0x25')](handleEntityNotFound(_0x39c1e2,null))['then'](function(_0x58ec7f){if(_0x58ec7f){_0x53bf3b=_0x58ec7f;_0x21d265[_0x164e('0x32')]=_[_0x164e('0x2f')](db[_0x164e('0x54')][_0x164e('0x42')]);_0x21d265[_0x164e('0x34')]=_[_0x164e('0x2f')](_0x5cd8be[_0x164e('0x34')]);_0x21d265[_0x164e('0x3b')]=_[_0x164e('0x30')](_0x21d265[_0x164e('0x32')],_0x21d265[_0x164e('0x34')]);_0x3fc8db[_0x164e('0x31')]=_[_0x164e('0x30')](_0x21d265[_0x164e('0x32')],qs['fields'](_0x5cd8be['query'][_0x164e('0x33')]));_0x3fc8db[_0x164e('0x31')]=_0x3fc8db[_0x164e('0x31')][_0x164e('0x35')]?_0x3fc8db[_0x164e('0x31')]:_0x21d265['model'];_0x3fc8db[_0x164e('0x38')]=qs[_0x164e('0x39')](_0x5cd8be[_0x164e('0x34')][_0x164e('0x39')]);_0x3fc8db[_0x164e('0x3a')]=qs[_0x164e('0x3b')](_[_0x164e('0x55')](_0x5cd8be[_0x164e('0x34')],_0x21d265[_0x164e('0x3b')]));if(_0x5cd8be[_0x164e('0x34')][_0x164e('0x3d')]){_0x3fc8db[_0x164e('0x3a')]=_[_0x164e('0x3c')](_0x3fc8db[_0x164e('0x3a')],{'$or':_[_0x164e('0x56')](_0x3fc8db[_0x164e('0x31')],function(_0x359c99){var _0x27d6df={};_0x27d6df[_0x359c99]={'$like':'%'+_0x5cd8be['query'][_0x164e('0x3d')]+'%'};return _0x27d6df;})});}_0x3fc8db=_[_0x164e('0x3c')]({},_0x3fc8db,_0x5cd8be[_0x164e('0x3e')]);return _0x53bf3b[_0x164e('0x52')](_0x3fc8db);}})[_0x164e('0x25')](function(_0x2a7652){if(_0x2a7652){_0x38d6d3=_0x2a7652[_0x164e('0x35')];if(!_0x5cd8be['query'][_0x164e('0x36')](_0x164e('0x37'))){_0x3fc8db['limit']=qs[_0x164e('0x1c')](_0x5cd8be['query'][_0x164e('0x1c')]);_0x3fc8db[_0x164e('0x1a')]=qs[_0x164e('0x1a')](_0x5cd8be[_0x164e('0x34')][_0x164e('0x1a')]);}return _0x53bf3b['getContacts'](_0x3fc8db);}})['then'](function(_0x4514f3){if(_0x4514f3){return _0x4514f3?{'count':_0x38d6d3,'rows':_0x4514f3}:null;}})[_0x164e('0x25')](respondWithResult(_0x39c1e2,null))[_0x164e('0x45')](handleError(_0x39c1e2,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 5c2c9ce..9726357 100644
--- a/server/api/cmCompany/cmCompany.model.js
+++ b/server/api/cmCompany/cmCompany.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd39f=['cm_companies','lodash','util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./cmCompany.attributes','exports'];(function(_0x4fa1d2,_0x5b071b){var _0x5d2fa8=function(_0x36e3d8){while(--_0x36e3d8){_0x4fa1d2['push'](_0x4fa1d2['shift']());}};_0x5d2fa8(++_0x5b071b);}(_0xd39f,0x1eb));var _0xfd39=function(_0x2defe7,_0x29d104){_0x2defe7=_0x2defe7-0x0;var _0x49993f=_0xd39f[_0x2defe7];return _0x49993f;};'use strict';var _=require(_0xfd39('0x0'));var util=require(_0xfd39('0x1'));var logger=require(_0xfd39('0x2'))('api');var moment=require(_0xfd39('0x3'));var BPromise=require(_0xfd39('0x4'));var rp=require(_0xfd39('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xfd39('0x6'));var attributes=require(_0xfd39('0x7'));module[_0xfd39('0x8')]=function(_0x205439,_0x34046a){return _0x205439['define']('CmCompany',attributes,{'tableName':_0xfd39('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9c4b=['../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x46de76,_0xe99c27){var _0x2d8b7b=function(_0x31c360){while(--_0x31c360){_0x46de76['push'](_0x46de76['shift']());}};_0x2d8b7b(++_0xe99c27);}(_0x9c4b,0x102));var _0xb9c4=function(_0x1dee0c,_0x13b016){_0x1dee0c=_0x1dee0c-0x0;var _0x12d97e=_0x9c4b[_0x1dee0c];return _0x12d97e;};'use strict';var _=require(_0xb9c4('0x0'));var util=require(_0xb9c4('0x1'));var logger=require(_0xb9c4('0x2'))(_0xb9c4('0x3'));var moment=require(_0xb9c4('0x4'));var BPromise=require(_0xb9c4('0x5'));var rp=require(_0xb9c4('0x6'));var fs=require('fs');var path=require(_0xb9c4('0x7'));var rimraf=require('rimraf');var config=require(_0xb9c4('0x8'));var attributes=require(_0xb9c4('0x9'));module[_0xb9c4('0xa')]=function(_0x5994b9,_0x25eb94){return _0x5994b9[_0xb9c4('0xb')](_0xb9c4('0xc'),attributes,{'tableName':_0xb9c4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js
index b58b068..8992048 100644
--- a/server/api/cmCompany/cmCompany.rpc.js
+++ b/server/api/cmCompany/cmCompany.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc5ea=['error','message','CmCompany,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','stringify'];(function(_0x3eb630,_0x552586){var _0x1b840d=function(_0x2594a8){while(--_0x2594a8){_0x3eb630['push'](_0x3eb630['shift']());}};_0x1b840d(++_0x552586);}(_0xc5ea,0x194));var _0xac5e=function(_0x264960,_0x36a3f2){_0x264960=_0x264960-0x0;var _0x580987=_0xc5ea[_0x264960];return _0x580987;};'use strict';var _=require('lodash');var util=require(_0xac5e('0x0'));var moment=require(_0xac5e('0x1'));var BPromise=require(_0xac5e('0x2'));var rs=require(_0xac5e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xac5e('0x4'))['db'];var utils=require(_0xac5e('0x5'));var logger=require(_0xac5e('0x6'))(_0xac5e('0x7'));var config=require(_0xac5e('0x8'));var jayson=require(_0xac5e('0x9'));var client=jayson[_0xac5e('0xa')][_0xac5e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3a0023,_0x2ba769,_0x24c33d){return new BPromise(function(_0x22d638,_0x22f91a){return client[_0xac5e('0xc')](_0x3a0023,_0x24c33d)['then'](function(_0x2ad9ad){logger[_0xac5e('0xd')]('CmCompany,\x20%s,\x20%s',_0x2ba769,'request\x20sent');logger['debug']('CmCompany,\x20%s,\x20%s,\x20%s',_0x2ba769,_0xac5e('0xe'),JSON[_0xac5e('0xf')](_0x2ad9ad));if(_0x2ad9ad['error']){if(_0x2ad9ad[_0xac5e('0x10')]['code']===0x1f4){logger[_0xac5e('0x10')]('CmCompany,\x20%s,\x20%s',_0x2ba769,_0x2ad9ad['error'][_0xac5e('0x11')]);return _0x22f91a(_0x2ad9ad[_0xac5e('0x10')][_0xac5e('0x11')]);}logger[_0xac5e('0x10')](_0xac5e('0x12'),_0x2ba769,_0x2ad9ad[_0xac5e('0x10')][_0xac5e('0x11')]);return _0x22d638(_0x2ad9ad[_0xac5e('0x10')][_0xac5e('0x11')]);}else{logger[_0xac5e('0xd')](_0xac5e('0x12'),_0x2ba769,_0xac5e('0xe'));_0x22d638(_0x2ad9ad[_0xac5e('0x13')][_0xac5e('0x11')]);}})[_0xac5e('0x14')](function(_0x3c8a10){logger[_0xac5e('0x10')](_0xac5e('0x12'),_0x2ba769,_0x3c8a10);_0x22f91a(_0x3c8a10);});});}
\ No newline at end of file
+var _0xf2f2=['request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmCompany,\x20%s,\x20%s'];(function(_0x31a2d1,_0x56b703){var _0x377212=function(_0x1284f8){while(--_0x1284f8){_0x31a2d1['push'](_0x31a2d1['shift']());}};_0x377212(++_0x56b703);}(_0xf2f2,0x167));var _0x2f2f=function(_0x269e23,_0x14d11c){_0x269e23=_0x269e23-0x0;var _0x69ad53=_0xf2f2[_0x269e23];return _0x69ad53;};'use strict';var _=require('lodash');var util=require(_0x2f2f('0x0'));var moment=require(_0x2f2f('0x1'));var BPromise=require(_0x2f2f('0x2'));var rs=require(_0x2f2f('0x3'));var fs=require('fs');var Redis=require(_0x2f2f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2f2f('0x5'));var logger=require(_0x2f2f('0x6'))(_0x2f2f('0x7'));var config=require(_0x2f2f('0x8'));var jayson=require(_0x2f2f('0x9'));var client=jayson['client'][_0x2f2f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e9480,_0x5b2656,_0x12be84){return new BPromise(function(_0x5e9531,_0x514e3b){return client[_0x2f2f('0xb')](_0x1e9480,_0x12be84)[_0x2f2f('0xc')](function(_0x186491){logger[_0x2f2f('0xd')](_0x2f2f('0xe'),_0x5b2656,_0x2f2f('0xf'));logger[_0x2f2f('0x10')](_0x2f2f('0x11'),_0x5b2656,_0x2f2f('0xf'),JSON[_0x2f2f('0x12')](_0x186491));if(_0x186491[_0x2f2f('0x13')]){if(_0x186491[_0x2f2f('0x13')]['code']===0x1f4){logger[_0x2f2f('0x13')](_0x2f2f('0xe'),_0x5b2656,_0x186491[_0x2f2f('0x13')][_0x2f2f('0x14')]);return _0x514e3b(_0x186491[_0x2f2f('0x13')][_0x2f2f('0x14')]);}logger[_0x2f2f('0x13')](_0x2f2f('0xe'),_0x5b2656,_0x186491[_0x2f2f('0x13')]['message']);return _0x5e9531(_0x186491[_0x2f2f('0x13')][_0x2f2f('0x14')]);}else{logger[_0x2f2f('0xd')](_0x2f2f('0xe'),_0x5b2656,_0x2f2f('0xf'));_0x5e9531(_0x186491['result'][_0x2f2f('0x14')]);}})[_0x2f2f('0x15')](function(_0x106f1f){logger[_0x2f2f('0x13')](_0x2f2f('0xe'),_0x5b2656,_0x106f1f);_0x514e3b(_0x106f1f);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 4f04043..5fcb47d 100644
--- a/server/api/cmCompany/index.js
+++ b/server/api/cmCompany/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7f9e=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','describe','/:id','show','/:id/contacts','getContacts','post','create','addContacts','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x1f978b,_0x4e6ba2){var _0x41d373=function(_0x59e9ea){while(--_0x59e9ea){_0x1f978b['push'](_0x1f978b['shift']());}};_0x41d373(++_0x4e6ba2);}(_0x7f9e,0x90));var _0xe7f9=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0x7f9e[_0x1b7368];return _0x25d54c;};'use strict';var multer=require(_0xe7f9('0x0'));var util=require(_0xe7f9('0x1'));var path=require(_0xe7f9('0x2'));var timeout=require(_0xe7f9('0x3'));var express=require('express');var router=express[_0xe7f9('0x4')]();var fs_extra=require(_0xe7f9('0x5'));var auth=require(_0xe7f9('0x6'));var interaction=require(_0xe7f9('0x7'));var config=require(_0xe7f9('0x8'));var controller=require(_0xe7f9('0x9'));router[_0xe7f9('0xa')]('/',auth[_0xe7f9('0xb')](),controller['index']);router[_0xe7f9('0xa')]('/describe',auth[_0xe7f9('0xb')](),controller[_0xe7f9('0xc')]);router['get'](_0xe7f9('0xd'),auth[_0xe7f9('0xb')](),controller[_0xe7f9('0xe')]);router[_0xe7f9('0xa')](_0xe7f9('0xf'),auth['isAuthenticated'](),controller[_0xe7f9('0x10')]);router[_0xe7f9('0x11')]('/',auth[_0xe7f9('0xb')](),controller[_0xe7f9('0x12')]);router[_0xe7f9('0x11')](_0xe7f9('0xf'),auth['isAuthenticated'](),controller[_0xe7f9('0x13')]);router[_0xe7f9('0x14')]('/:id',auth[_0xe7f9('0xb')](),controller[_0xe7f9('0x15')]);router[_0xe7f9('0x16')](_0xe7f9('0xd'),auth[_0xe7f9('0xb')](),controller[_0xe7f9('0x17')]);module[_0xe7f9('0x18')]=router;
\ No newline at end of file
+var _0xe562=['/:id/contacts','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','index','isAuthenticated','describe','get','/:id','show','getContacts','post'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xe562,0xf5));var _0x2e56=function(_0x4749de,_0x3dd428){_0x4749de=_0x4749de-0x0;var _0x316cc1=_0xe562[_0x4749de];return _0x316cc1;};'use strict';var multer=require(_0x2e56('0x0'));var util=require(_0x2e56('0x1'));var path=require(_0x2e56('0x2'));var timeout=require(_0x2e56('0x3'));var express=require(_0x2e56('0x4'));var router=express[_0x2e56('0x5')]();var fs_extra=require(_0x2e56('0x6'));var auth=require(_0x2e56('0x7'));var interaction=require(_0x2e56('0x8'));var config=require(_0x2e56('0x9'));var controller=require(_0x2e56('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0x2e56('0xb')]);router['get']('/describe',auth[_0x2e56('0xc')](),controller[_0x2e56('0xd')]);router[_0x2e56('0xe')](_0x2e56('0xf'),auth[_0x2e56('0xc')](),controller[_0x2e56('0x10')]);router[_0x2e56('0xe')]('/:id/contacts',auth[_0x2e56('0xc')](),controller[_0x2e56('0x11')]);router[_0x2e56('0x12')]('/',auth[_0x2e56('0xc')](),controller['create']);router[_0x2e56('0x12')](_0x2e56('0x13'),auth[_0x2e56('0xc')](),controller['addContacts']);router[_0x2e56('0x14')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x2e56('0x15')](_0x2e56('0xf'),auth[_0x2e56('0xc')](),controller[_0x2e56('0x16')]);module[_0x2e56('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 054725c..57aff73 100644
--- a/server/api/cmContact/cmContact.attributes.js
+++ b/server/api/cmContact/cmContact.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x468f=['exports','STRING','NOW','sequelize'];(function(_0x489b1f,_0x56af4a){var _0x5e5b1d=function(_0x358221){while(--_0x358221){_0x489b1f['push'](_0x489b1f['shift']());}};_0x5e5b1d(++_0x56af4a);}(_0x468f,0xeb));var _0xf468=function(_0x22b005,_0x2a6515){_0x22b005=_0x22b005-0x0;var _0x58bd11=_0x468f[_0x22b005];return _0x58bd11;};'use strict';var _=require('lodash');var Sequelize=require(_0xf468('0x0'));module[_0xf468('0x1')]={'firstName':{'type':Sequelize[_0xf468('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xf468('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xf468('0x2')]},'city':{'type':Sequelize[_0xf468('0x2')]},'country':{'type':Sequelize[_0xf468('0x2')]},'dateOfBirth':{'type':Sequelize[_0xf468('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0xf468('0x2')]},'mobile':{'type':Sequelize[_0xf468('0x2')]},'fax':{'type':Sequelize[_0xf468('0x2')]},'email':{'type':Sequelize[_0xf468('0x2')]},'url':{'type':Sequelize[_0xf468('0x2')]},'facebook':{'type':Sequelize[_0xf468('0x2')]},'fb_data':{'type':Sequelize[_0xf468('0x2')]},'twitter':{'type':Sequelize[_0xf468('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0xf468('0x2')]},'viber':{'type':Sequelize[_0xf468('0x2')]},'line':{'type':Sequelize[_0xf468('0x2')]},'wechat':{'type':Sequelize[_0xf468('0x2')]},'telegram':{'type':Sequelize[_0xf468('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0xf468('0x2')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0xf468('0x3')]},'dialTimezone':{'type':Sequelize[_0xf468('0x2')]},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xb210=['lodash','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW'];(function(_0x12d9d2,_0x41e830){var _0x14acd6=function(_0x22462f){while(--_0x22462f){_0x12d9d2['push'](_0x12d9d2['shift']());}};_0x14acd6(++_0x41e830);}(_0xb210,0x1c8));var _0x0b21=function(_0x1f3a20,_0x7c46de){_0x1f3a20=_0x1f3a20-0x0;var _0x5d5cf5=_0xb210[_0x1f3a20];return _0x5d5cf5;};'use strict';var _=require(_0x0b21('0x0'));var Sequelize=require('sequelize');module[_0x0b21('0x1')]={'firstName':{'type':Sequelize[_0x0b21('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x0b21('0x2')]},'street':{'type':Sequelize[_0x0b21('0x2')]},'postalCode':{'type':Sequelize[_0x0b21('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x0b21('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0b21('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x0b21('0x2')]},'fax':{'type':Sequelize[_0x0b21('0x2')]},'email':{'type':Sequelize[_0x0b21('0x2')]},'url':{'type':Sequelize[_0x0b21('0x2')]},'facebook':{'type':Sequelize[_0x0b21('0x2')]},'fb_data':{'type':Sequelize[_0x0b21('0x2')]},'twitter':{'type':Sequelize[_0x0b21('0x2')]},'skype':{'type':Sequelize[_0x0b21('0x2')]},'teams':{'type':Sequelize[_0x0b21('0x2')]},'viber':{'type':Sequelize[_0x0b21('0x2')]},'line':{'type':Sequelize[_0x0b21('0x2')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x0b21('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0x0b21('0x2')]},'priority':{'type':Sequelize[_0x0b21('0x4')](0x2)[_0x0b21('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x0b21('0x6')],'defaultValue':Sequelize[_0x0b21('0x7')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x0b21('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 6a4977d..4db2044 100644
--- a/server/api/cmContact/cmContact.controller.js
+++ b/server/api/cmContact/cmContact.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3c63=['length','get','mergeWith','isArray','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','from','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','join','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','push','where','ListId','findOrCreate','contact','all','show','Tag','color','tag','CmContactHasItem','Phones','ContactItemType','ItemType','sequelize','literal','Phones.OrderBy','$and','omit','map','cf_%d','pickBy','format','setFields','id\x20=\x20?','toParam','text','phone','getTags','findOne','model','rawAttributes','filters','intersection','fields','attributes','sort','pick','filter','options','setTags','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','PHONE','item','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','CmHopperAdditionalPhone','getAdditionalPhones','fromContactId','toContactId','rescheduleAdditionalPhones','hopperId','getHoppers','nolimit','order','ContactId','includeAll','include','rows','CmHopperFinal','getJscriptySessions','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','split','No\x20phone\x20column\x20specified','firstName','server/files/tmp','file','filename','chmodSync','0777','child_process','fork','CompanyId','File\x20uploaded\x20correctly!','send','upload','createReadStream','parse','meta','User','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','../../components/import/cm/csv2','stringify','start\x20child\x20process\x20correctly!','pid','error\x20child\x20process','binding','No\x20firstName\x20column\x20specified','../../components/import/cm/csvUpdates','exit','getJourney','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','Invalid\x20date\x20for\x20range\x20from\x20filter','isValid','Invalid\x20createdAt\x20filter','source','callerid','starttime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','findAndCountAll','chat','Website','Account','closed','closedAt','thirdDisposition','key','Tags','DESC','browserName','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingType','ratingValue','referer','mail','externalUrl','threadId','startCase','Interaction','Owner','flatten','sortBy','reverse','slice','moment','util','path','lodash','squel','ioredis','../../components/contacts','../../config/logger','api','../../config/environment','../../config/environment/shared','redis','defaults','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','set','Content-Range','json','update','then','end','sendStatus','error','name','index','describe','getOptions','findAll','user','catch','destroy','CmContact','find','params','tags','keys','startsWith','columnName','displayName','query','analytics','CmCustomField','cf_','alias','type','values','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','hasOwnProperty','merge','body'];(function(_0xe96487,_0x36c816){var _0x500779=function(_0x97b53f){while(--_0x97b53f){_0xe96487['push'](_0xe96487['shift']());}};_0x500779(++_0x36c816);}(_0x3c63,0x1c0));var _0x33c6=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x3c63[_0x47aa64];return _0x549c7a;};'use strict';var moment=require(_0x33c6('0x0'));var BPromise=require('bluebird');var util=require(_0x33c6('0x1'));var path=require(_0x33c6('0x2'));var fs=require('fs');var _=require(_0x33c6('0x3'));var squel=require(_0x33c6('0x4'));var Papa=require('papaparse');var Redis=require(_0x33c6('0x5'));var contacts=require(_0x33c6('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0x33c6('0x7'))(_0x33c6('0x8'));var config=require(_0x33c6('0x9'));var shared=require(_0x33c6('0xa'));var db=require('../../mysqldb')['db'];config[_0x33c6('0xb')]=_[_0x33c6('0xc')](config['redis'],{'host':_0x33c6('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x33c6('0xb')]));require(_0x33c6('0xe'))[_0x33c6('0xf')](socket);function respondWithResult(_0x345f10,_0xe20be6){_0xe20be6=_0xe20be6||0xc8;return function(_0x25b1b3){if(_0x25b1b3){return _0x345f10[_0x33c6('0x10')](_0xe20be6)['json'](_0x25b1b3);}};}function respondWithFilteredResult(_0x25cbe1,_0x27b773){return function(_0x1ed86f){if(_0x1ed86f){var _0x394e9d=typeof _0x27b773[_0x33c6('0x11')]===_0x33c6('0x12')&&typeof _0x27b773[_0x33c6('0x13')]===_0x33c6('0x12');var _0x122750=_0x1ed86f['count'];var _0x5a1be6=_0x394e9d?0x0:_0x27b773[_0x33c6('0x11')];var _0xa94506=_0x394e9d?_0x1ed86f[_0x33c6('0x14')]:_0x27b773[_0x33c6('0x11')]+_0x27b773[_0x33c6('0x13')];var _0x291ec0;if(_0xa94506>=_0x122750){_0xa94506=_0x122750;_0x291ec0=0xc8;}else{_0x291ec0=0xce;}_0x25cbe1[_0x33c6('0x10')](_0x291ec0);return _0x25cbe1[_0x33c6('0x15')](_0x33c6('0x16'),_0x5a1be6+'-'+_0xa94506+'/'+_0x122750)[_0x33c6('0x17')](_0x1ed86f);}return null;};}function saveUpdates(_0x1867c2){return function(_0x19f0f6){if(_0x19f0f6){return _0x19f0f6[_0x33c6('0x18')](_0x1867c2)[_0x33c6('0x19')](function(_0x58f8e3){return _0x58f8e3;});}return null;};}function removeEntity(_0x37bed2){return function(_0x31cda1){if(_0x31cda1){return _0x31cda1['destroy']()['then'](function(){_0x37bed2[_0x33c6('0x10')](0xcc)[_0x33c6('0x1a')]();});}};}function handleEntityNotFound(_0x170ae3){return function(_0x348ccb){if(!_0x348ccb){_0x170ae3[_0x33c6('0x1b')](0x194);}return _0x348ccb;};}function handleError(_0x10e66b,_0x48ed25){_0x48ed25=_0x48ed25||0x1f4;return function(_0x2b09e8){logger[_0x33c6('0x1c')](_0x2b09e8['stack']);if(_0x2b09e8[_0x33c6('0x1d')]){delete _0x2b09e8[_0x33c6('0x1d')];}_0x10e66b[_0x33c6('0x10')](_0x48ed25)['send'](_0x2b09e8);};}exports[_0x33c6('0x1e')]=function(_0x2629d0,_0x24aa33){var _0x38cd68={};return contacts[_0x33c6('0x1f')]()[_0x33c6('0x19')](function(_0x49471e){_0x38cd68=qs[_0x33c6('0x20')](_0x49471e,_0x2629d0);return contacts[_0x33c6('0x21')](_0x2629d0['query'],_0x2629d0[_0x33c6('0x22')],_0x38cd68,_0x49471e);})['then'](respondWithFilteredResult(_0x24aa33,_0x38cd68))[_0x33c6('0x23')](handleError(_0x24aa33,null));};exports[_0x33c6('0x24')]=function(_0x4c2aa9,_0x57cf25){return db[_0x33c6('0x25')][_0x33c6('0x26')]({'where':{'id':_0x4c2aa9[_0x33c6('0x27')]['id']}})[_0x33c6('0x19')](handleEntityNotFound(_0x57cf25,null))[_0x33c6('0x19')](removeEntity(_0x57cf25,null))['catch'](handleError(_0x57cf25,null));};exports[_0x33c6('0x1f')]=function(_0x5243cd,_0x5ef1f5){return db[_0x33c6('0x25')][_0x33c6('0x1f')]()['then'](function(_0x35d6c2){delete _0x35d6c2[_0x33c6('0x28')];for(var _0x44834c=0x0;_0x44834c
','Title','Data','user=','auth=Bearer\x20','utf-8','toString','lodash','moment','randomstring','util','node-tnef','email','../../../config/environment','head','value','address','generate','@xcally.com','name','substring','indexOf','split','slice','join','Anonymous','pop','length','isEmpty','anonymous','test','html','replace','includes','0x1?_0x273c22[_0xc68a('0x10')](0x0,-0x1)[_0xc68a('0x11')]('\x20'):_0x126525[_0xc68a('0xc')];}return _0xc68a('0x12');}function getLastName(_0x24f0e7){var _0x3beb1a=_[_0xc68a('0x7')](_0x24f0e7[_0xc68a('0x8')]);if(_0x3beb1a&&_0x3beb1a[_0xc68a('0xc')]){var _0x5d443e=_0x3beb1a[_0xc68a('0xc')][_0xc68a('0xf')](/\s+/);return _0x5d443e['length']>0x1?_0x5d443e[_0xc68a('0x13')]():'';}return'';}function getMails(_0x36334d,_0x18ab65){var _0x37b0c1='';for(var _0x24d739=0x0;_0x24d739<_0x18ab65[_0xc68a('0x8')][_0xc68a('0x14')];_0x24d739+=0x1){if(_0x18ab65[_0xc68a('0x8')][_0x24d739][_0xc68a('0x9')]!==_0x36334d){if(!_[_0xc68a('0x15')](_0x37b0c1)){_0x37b0c1+=',';}_0x37b0c1+=_0x18ab65[_0xc68a('0x8')][_0x24d739][_0xc68a('0xc')]||_0x18ab65['value'][_0x24d739][_0xc68a('0x9')]||'';_0x37b0c1+='\x20<';_0x37b0c1+=_0x18ab65[_0xc68a('0x8')][_0x24d739][_0xc68a('0x9')]?_0x18ab65[_0xc68a('0x8')][_0x24d739][_0xc68a('0x9')]:_0xc68a('0x16')+random[_0xc68a('0xa')](0x6)+_0xc68a('0xb');_0x37b0c1+='>';}}return _0x37b0c1;}function parseEmail(_0x1ebbae,_0x29bb64,_0x80d12d){if(_0x29bb64['html']){var _0x450381=/