From: Andrea Amorese
Date: Fri, 26 Nov 2021 13:49:48 +0000 (+0100)
Subject: Built motion from commit 0b90e591.|2.5.33
X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22javascript:;//%22angular-material.layout.css/%22?a=commitdiff_plain;h=2c4260b5ee18c04e9ab0b3b3e6d2a75dfee71c24;p=motion2.git
Built motion from commit 0b90e591.|2.5.33
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 065097a..f0697a7 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-11-26T13:23:55.785Z",
+ "time": "2021-11-26T13:39:26.592Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 4c74801..6405e0c 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-11-26T13:23:55.785Z",
+ "time": "2021-11-26T13:39:26.592Z",
"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 05e90b6..f4021de 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 _0x8349=['exports','VIRTUAL','getDataValue','action','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','STRING','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize'];(function(_0x245728,_0x1e8ca4){var _0x1be470=function(_0x580fce){while(--_0x580fce){_0x245728['push'](_0x245728['shift']());}};_0x1be470(++_0x1e8ca4);}(_0x8349,0x142));var _0x9834=function(_0x4da28f,_0x164324){_0x4da28f=_0x4da28f-0x0;var _0xe49192=_0x8349[_0x4da28f];return _0xe49192;};'use strict';var Sequelize=require(_0x9834('0x0'));module[_0x9834('0x1')]={'name':{'type':Sequelize[_0x9834('0x2')],'get':function(_0x35b192){return this[_0x9834('0x3')](_0x9834('0x4'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x9834('0x5'),_0x9834('0x6'),_0x9834('0x7'),_0x9834('0x8'),_0x9834('0x9'),_0x9834('0xa'),_0x9834('0xb'),_0x9834('0xc')]],'msg':_0x9834('0xd')}},'comment':_0x9834('0xd')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x9834('0xe')},'data2':{'type':Sequelize[_0x9834('0xf')](0x1000),'comment':_0x9834('0x10')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x9834('0x11')},'data4':{'type':Sequelize[_0x9834('0xf')](0x1000)},'data5':{'type':Sequelize[_0x9834('0xf')](0x1000)},'data6':{'type':Sequelize[_0x9834('0xf')]},'data7':{'type':Sequelize[_0x9834('0x12')]}};
\ No newline at end of file
+var _0xca66=['contactManager','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize','exports','VIRTUAL','action','STRING'];(function(_0x3c4f93,_0x24be5c){var _0x56d097=function(_0x30ad6e){while(--_0x30ad6e){_0x3c4f93['push'](_0x3c4f93['shift']());}};_0x56d097(++_0x24be5c);}(_0xca66,0x10b));var _0x6ca6=function(_0x2920a5,_0x455716){_0x2920a5=_0x2920a5-0x0;var _0x1bfa23=_0xca66[_0x2920a5];return _0x1bfa23;};'use strict';var Sequelize=require(_0x6ca6('0x0'));module[_0x6ca6('0x1')]={'name':{'type':Sequelize[_0x6ca6('0x2')],'get':function(_0x2f31dc){return this['getDataValue'](_0x6ca6('0x3'));}},'action':{'type':Sequelize[_0x6ca6('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x6ca6('0x5'),_0x6ca6('0x6'),_0x6ca6('0x7'),_0x6ca6('0x8'),_0x6ca6('0x9'),_0x6ca6('0xa'),_0x6ca6('0xb'),_0x6ca6('0xc')]],'msg':_0x6ca6('0xd')}},'comment':_0x6ca6('0xd')},'data1':{'type':Sequelize[_0x6ca6('0x4')](0x1000),'comment':_0x6ca6('0xe')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':'integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]'},'data3':{'type':Sequelize[_0x6ca6('0x4')](0x1000),'comment':_0x6ca6('0xf')},'data4':{'type':Sequelize[_0x6ca6('0x4')](0x1000)},'data5':{'type':Sequelize[_0x6ca6('0x4')](0x1000)},'data6':{'type':Sequelize[_0x6ca6('0x4')]},'data7':{'type':Sequelize[_0x6ca6('0x10')]}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 814cd17..3c0753e 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 _0x58a8=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','error','stack','name','update','Action','find','params','catch','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x5192de,_0x4e91cd){var _0x4e287e=function(_0x3639bc){while(--_0x3639bc){_0x5192de['push'](_0x5192de['shift']());}};_0x4e287e(++_0x4e91cd);}(_0x58a8,0x1e7));var _0x858a=function(_0x211dba,_0x487d76){_0x211dba=_0x211dba-0x0;var _0x217af2=_0x58a8[_0x211dba];return _0x217af2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x858a('0x0'));var zipdir=require(_0x858a('0x1'));var jsonpatch=require(_0x858a('0x2'));var rp=require(_0x858a('0x3'));var moment=require(_0x858a('0x4'));var BPromise=require(_0x858a('0x5'));var Mustache=require(_0x858a('0x6'));var util=require(_0x858a('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x858a('0x8'));var fs=require('fs');var fs_extra=require(_0x858a('0x9'));var _=require(_0x858a('0xa'));var squel=require(_0x858a('0xb'));var crypto=require(_0x858a('0xc'));var jsforce=require(_0x858a('0xd'));var deskjs=require(_0x858a('0xe'));var toCsv=require(_0x858a('0xf'));var querystring=require('querystring');var Papa=require(_0x858a('0x10'));var Redis=require(_0x858a('0x11'));var authService=require(_0x858a('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x858a('0x13'));var hardwareService=require(_0x858a('0x14'));var logger=require(_0x858a('0x15'))(_0x858a('0x16'));var utils=require('../../config/utils');var config=require(_0x858a('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x58399f,_0x4766c8){_0x4766c8=_0x4766c8||0xcc;return function(_0x358d21){if(_0x358d21){return _0x58399f['sendStatus'](_0x4766c8);}return _0x58399f[_0x858a('0x18')](_0x4766c8)[_0x858a('0x19')]();};}function respondWithResult(_0x28e222,_0x366d25){_0x366d25=_0x366d25||0xc8;return function(_0x13ff8c){if(_0x13ff8c){return _0x28e222[_0x858a('0x18')](_0x366d25)[_0x858a('0x1a')](_0x13ff8c);}};}function respondWithFilteredResult(_0x160c3c,_0x464cb7){return function(_0xb45d60){if(_0xb45d60){var _0x19f2df=typeof _0x464cb7[_0x858a('0x1b')]===_0x858a('0x1c')&&typeof _0x464cb7[_0x858a('0x1d')]===_0x858a('0x1c');var _0x47c416=_0xb45d60[_0x858a('0x1e')];var _0xda2f5d=_0x19f2df?0x0:_0x464cb7[_0x858a('0x1b')];var _0x18b6c7=_0x19f2df?_0xb45d60[_0x858a('0x1e')]:_0x464cb7[_0x858a('0x1b')]+_0x464cb7['limit'];var _0x213927;if(_0x18b6c7>=_0x47c416){_0x18b6c7=_0x47c416;_0x213927=0xc8;}else{_0x213927=0xce;}_0x160c3c[_0x858a('0x18')](_0x213927);return _0x160c3c[_0x858a('0x1f')](_0x858a('0x20'),_0xda2f5d+'-'+_0x18b6c7+'/'+_0x47c416)[_0x858a('0x1a')](_0xb45d60);}return null;};}function patchUpdates(_0x3a35e9){return function(_0x41e911){try{jsonpatch[_0x858a('0x21')](_0x41e911,_0x3a35e9,!![]);}catch(_0x98ebf6){return BPromise[_0x858a('0x22')](_0x98ebf6);}return _0x41e911['save']();};}function saveUpdates(_0x2b79f7,_0x14ef4a){return function(_0x4201cb){if(_0x4201cb){return _0x4201cb['update'](_0x2b79f7)[_0x858a('0x23')](function(_0x5f3011){return _0x5f3011;});}return null;};}function removeEntity(_0x97cbe8,_0x3824d3){return function(_0x45de68){if(_0x45de68){return _0x45de68['destroy']()[_0x858a('0x23')](function(){_0x97cbe8['status'](0xcc)[_0x858a('0x19')]();});}};}function handleEntityNotFound(_0x37882e,_0x11a7a1){return function(_0x3173e5){if(!_0x3173e5){_0x37882e['sendStatus'](0x194);}return _0x3173e5;};}function handleError(_0x44f500,_0x2596ea){_0x2596ea=_0x2596ea||0x1f4;return function(_0x21e1cf){logger[_0x858a('0x24')](_0x21e1cf[_0x858a('0x25')]);if(_0x21e1cf[_0x858a('0x26')]){delete _0x21e1cf[_0x858a('0x26')];}_0x44f500[_0x858a('0x18')](_0x2596ea)['send'](_0x21e1cf);};}exports[_0x858a('0x27')]=function(_0x33b459,_0x2f66d9){if(_0x33b459['body']['id']){delete _0x33b459['body']['id'];}return db[_0x858a('0x28')][_0x858a('0x29')]({'where':{'id':_0x33b459[_0x858a('0x2a')]['id']}})[_0x858a('0x23')](handleEntityNotFound(_0x2f66d9,null))['then'](saveUpdates(_0x33b459['body'],null))[_0x858a('0x23')](respondWithResult(_0x2f66d9,null))[_0x858a('0x2b')](handleError(_0x2f66d9,null));};exports[_0x858a('0x2c')]=function(_0x57a61f,_0x48880a){return db[_0x858a('0x28')]['find']({'where':{'id':_0x57a61f['params']['id']}})[_0x858a('0x23')](handleEntityNotFound(_0x48880a,null))[_0x858a('0x23')](removeEntity(_0x48880a,null))[_0x858a('0x2b')](handleError(_0x48880a,null));};
\ No newline at end of file
+var _0xb1c5=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','error','stack','name','body','Action','find','params','catch','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x103bb1,_0x55583e){var _0x37c7c0=function(_0x2c0c85){while(--_0x2c0c85){_0x103bb1['push'](_0x103bb1['shift']());}};_0x37c7c0(++_0x55583e);}(_0xb1c5,0x1c9));var _0x5b1c=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xb1c5[_0x2070da];return _0x4f9fe1;};'use strict';var emlformat=require(_0x5b1c('0x0'));var rimraf=require(_0x5b1c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5b1c('0x2'));var rp=require(_0x5b1c('0x3'));var moment=require(_0x5b1c('0x4'));var BPromise=require(_0x5b1c('0x5'));var Mustache=require(_0x5b1c('0x6'));var util=require(_0x5b1c('0x7'));var path=require(_0x5b1c('0x8'));var sox=require(_0x5b1c('0x9'));var csv=require(_0x5b1c('0xa'));var ejs=require(_0x5b1c('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5b1c('0xc'));var squel=require(_0x5b1c('0xd'));var crypto=require('crypto');var jsforce=require(_0x5b1c('0xe'));var deskjs=require(_0x5b1c('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5b1c('0x10'));var Redis=require(_0x5b1c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5b1c('0x12'));var as=require(_0x5b1c('0x13'));var hardwareService=require(_0x5b1c('0x14'));var logger=require(_0x5b1c('0x15'))(_0x5b1c('0x16'));var utils=require('../../config/utils');var config=require(_0x5b1c('0x17'));var licenseUtil=require(_0x5b1c('0x18'));var db=require(_0x5b1c('0x19'))['db'];function respondWithStatusCode(_0x4119c9,_0x130b44){_0x130b44=_0x130b44||0xcc;return function(_0x5a3351){if(_0x5a3351){return _0x4119c9[_0x5b1c('0x1a')](_0x130b44);}return _0x4119c9[_0x5b1c('0x1b')](_0x130b44)[_0x5b1c('0x1c')]();};}function respondWithResult(_0x233ffa,_0x2ae4ca){_0x2ae4ca=_0x2ae4ca||0xc8;return function(_0x1b1733){if(_0x1b1733){return _0x233ffa[_0x5b1c('0x1b')](_0x2ae4ca)[_0x5b1c('0x1d')](_0x1b1733);}};}function respondWithFilteredResult(_0x1758fb,_0x1794e8){return function(_0xd17b73){if(_0xd17b73){var _0x462d27=typeof _0x1794e8[_0x5b1c('0x1e')]===_0x5b1c('0x1f')&&typeof _0x1794e8[_0x5b1c('0x20')]===_0x5b1c('0x1f');var _0x1cce58=_0xd17b73[_0x5b1c('0x21')];var _0x48e196=_0x462d27?0x0:_0x1794e8['offset'];var _0x274df8=_0x462d27?_0xd17b73['count']:_0x1794e8[_0x5b1c('0x1e')]+_0x1794e8[_0x5b1c('0x20')];var _0x178bdb;if(_0x274df8>=_0x1cce58){_0x274df8=_0x1cce58;_0x178bdb=0xc8;}else{_0x178bdb=0xce;}_0x1758fb[_0x5b1c('0x1b')](_0x178bdb);return _0x1758fb['set'](_0x5b1c('0x22'),_0x48e196+'-'+_0x274df8+'/'+_0x1cce58)[_0x5b1c('0x1d')](_0xd17b73);}return null;};}function patchUpdates(_0x3e32e0){return function(_0x45df0e){try{jsonpatch['apply'](_0x45df0e,_0x3e32e0,!![]);}catch(_0x235a8d){return BPromise[_0x5b1c('0x23')](_0x235a8d);}return _0x45df0e[_0x5b1c('0x24')]();};}function saveUpdates(_0x6f02bb,_0x2ae196){return function(_0x2996fa){if(_0x2996fa){return _0x2996fa[_0x5b1c('0x25')](_0x6f02bb)[_0x5b1c('0x26')](function(_0x340a3e){return _0x340a3e;});}return null;};}function removeEntity(_0x24c3da,_0x1183e1){return function(_0x139c8a){if(_0x139c8a){return _0x139c8a[_0x5b1c('0x27')]()['then'](function(){_0x24c3da[_0x5b1c('0x1b')](0xcc)[_0x5b1c('0x1c')]();});}};}function handleEntityNotFound(_0x29ae72,_0x39e477){return function(_0x2312cf){if(!_0x2312cf){_0x29ae72[_0x5b1c('0x1a')](0x194);}return _0x2312cf;};}function handleError(_0x505991,_0x2dcc08){_0x2dcc08=_0x2dcc08||0x1f4;return function(_0x1a86f9){logger[_0x5b1c('0x28')](_0x1a86f9[_0x5b1c('0x29')]);if(_0x1a86f9[_0x5b1c('0x2a')]){delete _0x1a86f9[_0x5b1c('0x2a')];}_0x505991['status'](_0x2dcc08)['send'](_0x1a86f9);};}exports['update']=function(_0x479a59,_0x5e49bc){if(_0x479a59[_0x5b1c('0x2b')]['id']){delete _0x479a59[_0x5b1c('0x2b')]['id'];}return db[_0x5b1c('0x2c')][_0x5b1c('0x2d')]({'where':{'id':_0x479a59[_0x5b1c('0x2e')]['id']}})['then'](handleEntityNotFound(_0x5e49bc,null))[_0x5b1c('0x26')](saveUpdates(_0x479a59['body'],null))['then'](respondWithResult(_0x5e49bc,null))['catch'](handleError(_0x5e49bc,null));};exports['destroy']=function(_0x313410,_0x574b13){return db[_0x5b1c('0x2c')][_0x5b1c('0x2d')]({'where':{'id':_0x313410[_0x5b1c('0x2e')]['id']}})[_0x5b1c('0x26')](handleEntityNotFound(_0x574b13,null))[_0x5b1c('0x26')](removeEntity(_0x574b13,null))[_0x5b1c('0x2f')](handleError(_0x574b13,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 820c142..a19dfae 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 _0x342e=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./action.attributes','exports','Action','tools_actions','lodash'];(function(_0x30abff,_0x5f2c5f){var _0x4c571e=function(_0x43de9a){while(--_0x43de9a){_0x30abff['push'](_0x30abff['shift']());}};_0x4c571e(++_0x5f2c5f);}(_0x342e,0xa8));var _0xe342=function(_0x3f2a90,_0x50baf1){_0x3f2a90=_0x3f2a90-0x0;var _0xb46279=_0x342e[_0x3f2a90];return _0xb46279;};'use strict';var _=require(_0xe342('0x0'));var util=require(_0xe342('0x1'));var logger=require(_0xe342('0x2'))(_0xe342('0x3'));var moment=require(_0xe342('0x4'));var BPromise=require(_0xe342('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe342('0x6'));var rimraf=require(_0xe342('0x7'));var config=require(_0xe342('0x8'));var attributes=require(_0xe342('0x9'));module[_0xe342('0xa')]=function(_0xe4cc3a,_0x5b8cd4){return _0xe4cc3a['define'](_0xe342('0xb'),attributes,{'tableName':_0xe342('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x38c7=['exports','define','Action','tools_actions','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','./action.attributes'];(function(_0x2d460c,_0x4f08c0){var _0xf6fc4c=function(_0x4fb81c){while(--_0x4fb81c){_0x2d460c['push'](_0x2d460c['shift']());}};_0xf6fc4c(++_0x4f08c0);}(_0x38c7,0x88));var _0x738c=function(_0x34f11f,_0x137c32){_0x34f11f=_0x34f11f-0x0;var _0x1a09f7=_0x38c7[_0x34f11f];return _0x1a09f7;};'use strict';var _=require(_0x738c('0x0'));var util=require(_0x738c('0x1'));var logger=require(_0x738c('0x2'))(_0x738c('0x3'));var moment=require('moment');var BPromise=require(_0x738c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x738c('0x5'));var rimraf=require('rimraf');var config=require(_0x738c('0x6'));var attributes=require(_0x738c('0x7'));module[_0x738c('0x8')]=function(_0x1bec61,_0x572da0){return _0x1bec61[_0x738c('0x9')](_0x738c('0xa'),attributes,{'tableName':_0x738c('0xb'),'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 c4870d7..e3ffa13 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 _0x5fc3=['../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x403568,_0x3eb985){var _0x557ed4=function(_0x259521){while(--_0x259521){_0x403568['push'](_0x403568['shift']());}};_0x557ed4(++_0x3eb985);}(_0x5fc3,0xa8));var _0x35fc=function(_0x466bc5,_0x3a0f2a){_0x466bc5=_0x466bc5-0x0;var _0x138952=_0x5fc3[_0x466bc5];return _0x138952;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('Action,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('Action,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});}
\ No newline at end of file
+var _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x53ec,0x192));var _0xc53e=function(_0x2db3ce,_0x360607){_0x2db3ce=_0x2db3ce-0x0;var _0x4f45ec=_0x53ec[_0x2db3ce];return _0x4f45ec;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 7810636..9077f94 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 _0xcd65=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','isAuthenticated','update','delete','/:id','exports','util','path','connect-timeout','express'];(function(_0x32eef2,_0x5cf5e2){var _0x114321=function(_0x27c38a){while(--_0x27c38a){_0x32eef2['push'](_0x32eef2['shift']());}};_0x114321(++_0x5cf5e2);}(_0xcd65,0x128));var _0x5cd6=function(_0x323419,_0x2a6172){_0x323419=_0x323419-0x0;var _0x4c0be7=_0xcd65[_0x323419];return _0x4c0be7;};'use strict';var multer=require('multer');var util=require(_0x5cd6('0x0'));var path=require(_0x5cd6('0x1'));var timeout=require(_0x5cd6('0x2'));var express=require(_0x5cd6('0x3'));var router=express['Router']();var fs_extra=require(_0x5cd6('0x4'));var auth=require(_0x5cd6('0x5'));var interaction=require(_0x5cd6('0x6'));var config=require(_0x5cd6('0x7'));var controller=require(_0x5cd6('0x8'));router[_0x5cd6('0x9')]('/:id',auth[_0x5cd6('0xa')](),controller[_0x5cd6('0xb')]);router[_0x5cd6('0xc')](_0x5cd6('0xd'),auth[_0x5cd6('0xa')](),controller['destroy']);module[_0x5cd6('0xe')]=router;
\ No newline at end of file
+var _0xf705=['./action.controller','update','delete','isAuthenticated','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x4c4083,_0x11a683){var _0x31d635=function(_0x38d5f1){while(--_0x38d5f1){_0x4c4083['push'](_0x4c4083['shift']());}};_0x31d635(++_0x11a683);}(_0xf705,0xef));var _0x5f70=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xf705[_0x8c43de];return _0xa6591b;};'use strict';var multer=require(_0x5f70('0x0'));var util=require(_0x5f70('0x1'));var path=require('path');var timeout=require(_0x5f70('0x2'));var express=require(_0x5f70('0x3'));var router=express[_0x5f70('0x4')]();var fs_extra=require(_0x5f70('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5f70('0x6'));var config=require(_0x5f70('0x7'));var controller=require(_0x5f70('0x8'));router['put']('/:id',auth['isAuthenticated'](),controller[_0x5f70('0x9')]);router[_0x5f70('0xa')]('/:id',auth[_0x5f70('0xb')](),controller[_0x5f70('0xc')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 7f161c1..e63a015 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 _0x2eb2=['TEXT','exports','STRING'];(function(_0x3058b8,_0x5e12e1){var _0x282a80=function(_0x49bf6c){while(--_0x49bf6c){_0x3058b8['push'](_0x3058b8['shift']());}};_0x282a80(++_0x5e12e1);}(_0x2eb2,0x19f));var _0x22eb=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x2eb2[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require('sequelize');module[_0x22eb('0x0')]={'name':{'type':Sequelize[_0x22eb('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x22eb('0x1')]},'parent':{'type':Sequelize[_0x22eb('0x1')]},'table':{'type':Sequelize[_0x22eb('0x1')]},'conditions':{'type':Sequelize[_0x22eb('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x71ab=['TEXT','exports','STRING'];(function(_0x27a94f,_0x49bbf1){var _0x26c834=function(_0x20c7e4){while(--_0x20c7e4){_0x27a94f['push'](_0x27a94f['shift']());}};_0x26c834(++_0x49bbf1);}(_0x71ab,0x64));var _0xb71a=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x71ab[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require('sequelize');module[_0xb71a('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb71a('0x1')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xb71a('0x1')]},'conditions':{'type':Sequelize[_0xb71a('0x2')]},'joins':{'type':Sequelize[_0xb71a('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 17931b4..6905afa 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 _0x9ed0=['getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','select','from','table','MetricId','metric','function','replace','format','orderBy','DESC','alias','joins','parse','includes','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','clone','toString','sequelize','QueryTypes','SELECT','left_join','AVG(%s)','IS\x20NULL','operator','Sequelize','groupBy','web','%s-%s.%s','output','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','COUNT(*)','count','run','runReport','IS\x20NOT\x20EMPTY','keyBy','Limited\x20Query:','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','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','end','status','json','offset','undefined','limit','set','Content-Range','reject','save','then','get','CustomReports','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','rows','catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','field','condition','value'];(function(_0x119b4b,_0x322a87){var _0x2ca4d5=function(_0x45a93e){while(--_0x45a93e){_0x119b4b['push'](_0x119b4b['shift']());}};_0x2ca4d5(++_0x322a87);}(_0x9ed0,0xe1));var _0x09ed=function(_0x1e6aa7,_0x3282c6){_0x1e6aa7=_0x1e6aa7-0x0;var _0x5f20c3=_0x9ed0[_0x1e6aa7];return _0x5f20c3;};'use strict';var emlformat=require(_0x09ed('0x0'));var rimraf=require(_0x09ed('0x1'));var zipdir=require(_0x09ed('0x2'));var jsonpatch=require(_0x09ed('0x3'));var rp=require(_0x09ed('0x4'));var moment=require(_0x09ed('0x5'));var BPromise=require(_0x09ed('0x6'));var Mustache=require(_0x09ed('0x7'));var util=require('util');var path=require(_0x09ed('0x8'));var sox=require(_0x09ed('0x9'));var csv=require(_0x09ed('0xa'));var ejs=require(_0x09ed('0xb'));var fs=require('fs');var fs_extra=require(_0x09ed('0xc'));var _=require(_0x09ed('0xd'));var squel=require(_0x09ed('0xe'));var crypto=require(_0x09ed('0xf'));var jsforce=require(_0x09ed('0x10'));var deskjs=require(_0x09ed('0x11'));var toCsv=require(_0x09ed('0xa'));var querystring=require('querystring');var Papa=require(_0x09ed('0x12'));var Redis=require(_0x09ed('0x13'));var authService=require(_0x09ed('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x09ed('0x15'));var hardwareService=require(_0x09ed('0x16'));var logger=require(_0x09ed('0x17'))(_0x09ed('0x18'));var utils=require('../../config/utils');var config=require(_0x09ed('0x19'));var licenseUtil=require(_0x09ed('0x1a'));var db=require(_0x09ed('0x1b'))['db'];var dbH=require(_0x09ed('0x1b'))[_0x09ed('0x1c')];function respondWithStatusCode(_0x255179,_0x443466){_0x443466=_0x443466||0xcc;return function(_0x4c0cb7){if(_0x4c0cb7){return _0x255179['sendStatus'](_0x443466);}return _0x255179['status'](_0x443466)[_0x09ed('0x1d')]();};}function respondWithResult(_0x320d4b,_0x50c796){_0x50c796=_0x50c796||0xc8;return function(_0x4b41d5){if(_0x4b41d5){return _0x320d4b[_0x09ed('0x1e')](_0x50c796)[_0x09ed('0x1f')](_0x4b41d5);}};}function respondWithFilteredResult(_0x5a2786,_0x5de4da){return function(_0x43d212){if(_0x43d212){var _0x4df999=typeof _0x5de4da[_0x09ed('0x20')]===_0x09ed('0x21')&&typeof _0x5de4da[_0x09ed('0x22')]===_0x09ed('0x21');var _0x262daa=_0x43d212['count'];var _0x257007=_0x4df999?0x0:_0x5de4da['offset'];var _0x2effe0=_0x4df999?_0x43d212['count']:_0x5de4da[_0x09ed('0x20')]+_0x5de4da[_0x09ed('0x22')];var _0x1eec0e;if(_0x2effe0>=_0x262daa){_0x2effe0=_0x262daa;_0x1eec0e=0xc8;}else{_0x1eec0e=0xce;}_0x5a2786['status'](_0x1eec0e);return _0x5a2786[_0x09ed('0x23')](_0x09ed('0x24'),_0x257007+'-'+_0x2effe0+'/'+_0x262daa)[_0x09ed('0x1f')](_0x43d212);}return null;};}function patchUpdates(_0x27e440){return function(_0x477c4c){try{jsonpatch['apply'](_0x477c4c,_0x27e440,!![]);}catch(_0x21d632){return BPromise[_0x09ed('0x25')](_0x21d632);}return _0x477c4c[_0x09ed('0x26')]();};}function saveUpdates(_0x201963,_0x1db8d0){return function(_0x2a1b72){if(_0x2a1b72){return _0x2a1b72['update'](_0x201963)['then'](function(_0x24a05e){return _0x24a05e;});}return null;};}function removeEntity(_0xe9859d,_0x5248bc){return function(_0x8634c3){if(_0x8634c3){return _0x8634c3['destroy']()[_0x09ed('0x27')](function(){var _0x2f10e1=_0x8634c3[_0x09ed('0x28')]({'plain':!![]});var _0x3a4ed3=_0x09ed('0x29');return db[_0x09ed('0x2a')][_0x09ed('0x2b')]({'where':{'type':_0x3a4ed3,'resourceId':_0x2f10e1['id']}})[_0x09ed('0x27')](function(){return _0x8634c3;});})[_0x09ed('0x27')](function(){_0xe9859d[_0x09ed('0x1e')](0xcc)[_0x09ed('0x1d')]();});}};}function handleEntityNotFound(_0x4171df,_0x3bb7ad){return function(_0x24d820){if(!_0x24d820){_0x4171df[_0x09ed('0x2c')](0x194);}return _0x24d820;};}function handleError(_0x485931,_0x2aab77){_0x2aab77=_0x2aab77||0x1f4;return function(_0xfaa0e2){logger[_0x09ed('0x2d')](_0xfaa0e2[_0x09ed('0x2e')]);if(_0xfaa0e2['name']){delete _0xfaa0e2[_0x09ed('0x2f')];}_0x485931[_0x09ed('0x1e')](_0x2aab77)[_0x09ed('0x30')](_0xfaa0e2);};}exports[_0x09ed('0x31')]=function(_0x42bbc9,_0x3c3ae0){var _0x2e6750={},_0x3c73ea={},_0x1ec9b9={'count':0x0,'rows':[]};var _0x31081f=_[_0x09ed('0x32')](db[_0x09ed('0x33')][_0x09ed('0x34')],function(_0x3072f9){return{'name':_0x3072f9['fieldName'],'type':_0x3072f9['type'][_0x09ed('0x35')]};});_0x3c73ea[_0x09ed('0x36')]=_[_0x09ed('0x32')](_0x31081f,'name');_0x3c73ea['query']=_[_0x09ed('0x37')](_0x42bbc9[_0x09ed('0x38')]);_0x3c73ea[_0x09ed('0x39')]=_[_0x09ed('0x3a')](_0x3c73ea['model'],_0x3c73ea[_0x09ed('0x38')]);_0x2e6750[_0x09ed('0x3b')]=_[_0x09ed('0x3a')](_0x3c73ea[_0x09ed('0x36')],qs[_0x09ed('0x3c')](_0x42bbc9['query']['fields']));_0x2e6750[_0x09ed('0x3b')]=_0x2e6750[_0x09ed('0x3b')][_0x09ed('0x3d')]?_0x2e6750[_0x09ed('0x3b')]:_0x3c73ea[_0x09ed('0x36')];if(!_0x42bbc9[_0x09ed('0x38')]['hasOwnProperty']('nolimit')){_0x2e6750[_0x09ed('0x22')]=qs[_0x09ed('0x22')](_0x42bbc9['query'][_0x09ed('0x22')]);_0x2e6750[_0x09ed('0x20')]=qs[_0x09ed('0x20')](_0x42bbc9['query'][_0x09ed('0x20')]);}_0x2e6750[_0x09ed('0x3e')]=qs['sort'](_0x42bbc9[_0x09ed('0x38')][_0x09ed('0x3f')]);_0x2e6750[_0x09ed('0x40')]=qs[_0x09ed('0x39')](_[_0x09ed('0x41')](_0x42bbc9['query'],_0x3c73ea[_0x09ed('0x39')]),_0x31081f);if(_0x42bbc9[_0x09ed('0x38')][_0x09ed('0x42')]){_0x2e6750['where']=_[_0x09ed('0x43')](_0x2e6750['where'],{'$or':_[_0x09ed('0x32')](_0x31081f,function(_0x412c0b){if(_0x412c0b[_0x09ed('0x44')]!==_0x09ed('0x45')){var _0x2472bc={};_0x2472bc[_0x412c0b[_0x09ed('0x2f')]]={'$like':'%'+_0x42bbc9[_0x09ed('0x38')][_0x09ed('0x42')]+'%'};return _0x2472bc;}})});}_0x2e6750=_[_0x09ed('0x43')]({},_0x2e6750,_0x42bbc9[_0x09ed('0x46')]);var _0x44e1a7={'where':_0x2e6750[_0x09ed('0x40')]};return db[_0x09ed('0x33')]['count'](_0x44e1a7)[_0x09ed('0x27')](function(_0x3e2800){_0x1ec9b9['count']=_0x3e2800;if(_0x42bbc9['query'][_0x09ed('0x47')]){_0x2e6750['include']=[{'all':!![]}];}return db[_0x09ed('0x33')]['findAll'](_0x2e6750);})[_0x09ed('0x27')](function(_0x202261){_0x1ec9b9[_0x09ed('0x48')]=_0x202261;return _0x1ec9b9;})[_0x09ed('0x27')](respondWithFilteredResult(_0x3c3ae0,_0x2e6750))[_0x09ed('0x49')](handleError(_0x3c3ae0,null));};exports[_0x09ed('0x4a')]=function(_0x3ac483,_0xaf0e60){var _0x57f9dd={'raw':![],'where':{'id':_0x3ac483[_0x09ed('0x4b')]['id']}},_0xcf1fb1={};_0xcf1fb1['model']=_[_0x09ed('0x37')](db[_0x09ed('0x33')][_0x09ed('0x34')]);_0xcf1fb1[_0x09ed('0x38')]=_[_0x09ed('0x37')](_0x3ac483[_0x09ed('0x38')]);_0xcf1fb1[_0x09ed('0x39')]=_[_0x09ed('0x3a')](_0xcf1fb1[_0x09ed('0x36')],_0xcf1fb1[_0x09ed('0x38')]);_0x57f9dd['attributes']=_['intersection'](_0xcf1fb1[_0x09ed('0x36')],qs[_0x09ed('0x3c')](_0x3ac483[_0x09ed('0x38')]['fields']));_0x57f9dd[_0x09ed('0x3b')]=_0x57f9dd[_0x09ed('0x3b')][_0x09ed('0x3d')]?_0x57f9dd[_0x09ed('0x3b')]:_0xcf1fb1[_0x09ed('0x36')];if(_0x3ac483[_0x09ed('0x38')][_0x09ed('0x47')]){_0x57f9dd[_0x09ed('0x4c')]=[{'all':!![]}];}_0x57f9dd=_[_0x09ed('0x43')]({},_0x57f9dd,_0x3ac483[_0x09ed('0x46')]);return db['AnalyticCustomReport'][_0x09ed('0x4d')](_0x57f9dd)[_0x09ed('0x27')](handleEntityNotFound(_0xaf0e60,null))[_0x09ed('0x27')](respondWithResult(_0xaf0e60,null))[_0x09ed('0x49')](handleError(_0xaf0e60,null));};exports[_0x09ed('0x4e')]=function(_0x247a91,_0x18fc2f){return db['AnalyticCustomReport'][_0x09ed('0x4e')](_0x247a91[_0x09ed('0x4f')],{})['then'](function(_0x3f158a){var _0x544438=_0x247a91[_0x09ed('0x50')][_0x09ed('0x28')]({'plain':!![]});if(!_0x544438)throw new Error(_0x09ed('0x51'));if(_0x544438[_0x09ed('0x52')]===_0x09ed('0x50')){var _0x3b223e=_0x3f158a[_0x09ed('0x28')]({'plain':!![]});var _0xb59573=_0x09ed('0x53');return db['UserProfileSection'][_0x09ed('0x4d')]({'where':{'name':_0xb59573,'userProfileId':_0x544438['userProfileId']},'raw':!![]})[_0x09ed('0x27')](function(_0x2e5b0d){if(_0x2e5b0d&&_0x2e5b0d[_0x09ed('0x54')]===0x0){return db['UserProfileResource'][_0x09ed('0x4e')]({'name':_0x3b223e[_0x09ed('0x2f')],'resourceId':_0x3b223e['id'],'type':'CustomReports','sectionId':_0x2e5b0d['id']},{})[_0x09ed('0x27')](function(){return _0x3f158a;});}else{return _0x3f158a;}})[_0x09ed('0x49')](function(_0x3f9b71){logger[_0x09ed('0x2d')](_0x09ed('0x55'),_0x3f9b71);throw _0x3f9b71;});}return _0x3f158a;})['then'](respondWithResult(_0x18fc2f,0xc9))[_0x09ed('0x49')](handleError(_0x18fc2f,null));};exports[_0x09ed('0x56')]=function(_0x173f4f,_0x370d7c){if(_0x173f4f[_0x09ed('0x4f')]['id']){delete _0x173f4f[_0x09ed('0x4f')]['id'];}return db[_0x09ed('0x33')][_0x09ed('0x4d')]({'where':{'id':_0x173f4f[_0x09ed('0x4b')]['id']}})[_0x09ed('0x27')](handleEntityNotFound(_0x370d7c,null))[_0x09ed('0x27')](saveUpdates(_0x173f4f[_0x09ed('0x4f')],null))[_0x09ed('0x27')](respondWithResult(_0x370d7c,null))[_0x09ed('0x49')](handleError(_0x370d7c,null));};exports[_0x09ed('0x2b')]=function(_0x4d351b,_0x11aa22){return db[_0x09ed('0x33')][_0x09ed('0x4d')]({'where':{'id':_0x4d351b['params']['id']}})[_0x09ed('0x27')](handleEntityNotFound(_0x11aa22,null))[_0x09ed('0x27')](removeEntity(_0x11aa22,null))['catch'](handleError(_0x11aa22,null));};exports[_0x09ed('0x57')]=function(_0x518218,_0x1f0bc7){var _0x2ca01a=0xa;var _0x2b4ea9=[_0x09ed('0x58'),'left_join',_0x09ed('0x59'),_0x09ed('0x5a')];var _0x285cd9={'SUM':_0x09ed('0x5b'),'COUNT':_0x09ed('0x5c'),'COUNT DISTINCT':_0x09ed('0x5d'),'MAX':_0x09ed('0x5e'),'MIN':_0x09ed('0x5f'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x09ed('0x60'),'GROUP_CONCAT ASC':_0x09ed('0x61'),'GROUP_CONCAT DESC':_0x09ed('0x62')};var _0x397963={'SEC_TO_TIME':_0x09ed('0x63'),'DATE':_0x09ed('0x64'),'HOUR':_0x09ed('0x65'),'ROUND':_0x09ed('0x66'),'UNIX_TIMESTAMP':_0x09ed('0x67')};var _0x4882aa=function(_0x3967fa){return!_['includes'](['IS\x20NULL',_0x09ed('0x68'),_0x09ed('0x69'),'IS\x20NOT\x20EMPTY'],_0x3967fa);};var _0x544e02=function(_0x3b66a5){if(!_0x3b66a5||!_0x3b66a5[_0x09ed('0x6a')][_0x09ed('0x3d')]){return'';}for(var _0x2627b7='(',_0x26c03d=0x0;_0x26c03d<_0x3b66a5[_0x09ed('0x6a')]['length'];_0x26c03d+=0x1){_0x26c03d>0x0&&(_0x2627b7+='\x20'+_0x3b66a5['operator']+'\x20');_0x2627b7+=_0x3b66a5[_0x09ed('0x6a')][_0x26c03d][_0x09ed('0x6b')]?_0x544e02(_0x3b66a5[_0x09ed('0x6a')][_0x26c03d]['group']):_0x3b66a5[_0x09ed('0x6a')][_0x26c03d][_0x09ed('0x6c')]+'\x20'+_0x3b66a5[_0x09ed('0x6a')][_0x26c03d][_0x09ed('0x6d')]+(_0x4882aa(_0x3b66a5[_0x09ed('0x6a')][_0x26c03d][_0x09ed('0x6d')])?'\x20'+_0x3b66a5[_0x09ed('0x6a')][_0x26c03d][_0x09ed('0x6e')]:'');}return _0x2627b7+')';};var _0x57671f={'where':{'id':_0x518218[_0x09ed('0x4b')]['id']}},_0x4bcb9b,_0x4e3d7a,_0x267ba2,_0x5b0dd5,_0x300d1a;_0x57671f=_[_0x09ed('0x43')]({},_0x57671f,_0x518218[_0x09ed('0x46')]);return db[_0x09ed('0x33')][_0x09ed('0x4d')](_0x57671f)[_0x09ed('0x27')](function(_0x498d43){if(_0x498d43){_0x4bcb9b=_0x498d43;return _0x498d43[_0x09ed('0x6f')]();}return null;})[_0x09ed('0x27')](function(_0x4dca1e){if(_0x4dca1e){if(!_0x4dca1e[_0x09ed('0x3d')]){throw new db['Sequelize'][(_0x09ed('0x70'))](_0x09ed('0x71'),0x193);}_0x4e3d7a=_0x4dca1e;return db[_0x09ed('0x72')][_0x09ed('0x73')]({'raw':!![]});}return null;})[_0x09ed('0x27')](function(_0x492d89){if(_0x492d89){_0x267ba2=_['keyBy'](_0x492d89,'id');var _0x34548a;var _0x47af34=squel[_0x09ed('0x74')]();_0x47af34[_0x09ed('0x75')](_0x4bcb9b[_0x09ed('0x76')]);for(var _0x2267b7=0x0;_0x2267b7<_0x4e3d7a['length'];_0x2267b7+=0x1){_0x34548a=_0x4e3d7a[_0x2267b7][_0x09ed('0x77')]?_0x267ba2[_0x4e3d7a[_0x2267b7][_0x09ed('0x77')]][_0x09ed('0x78')]:_0x4e3d7a[_0x2267b7][_0x09ed('0x6c')];_0x34548a=_0x4e3d7a[_0x2267b7][_0x09ed('0x79')]?_[_0x09ed('0x7a')](_0x285cd9[_0x4e3d7a[_0x2267b7]['function']],'%s',_0x34548a):_0x34548a;_0x34548a=_0x4e3d7a[_0x2267b7][_0x09ed('0x7b')]?_['replace'](_0x397963[_0x4e3d7a[_0x2267b7][_0x09ed('0x7b')]],'%s',_0x34548a):_0x34548a;if(_0x4e3d7a[_0x2267b7]['groupBy']){_0x47af34[_0x09ed('0x6b')](_0x34548a);}_0x4e3d7a[_0x2267b7][_0x09ed('0x7c')]&&_0x47af34[_0x09ed('0x3e')](_0x34548a,_0x4e3d7a[_0x2267b7][_0x09ed('0x7c')]===_0x09ed('0x7d')?![]:!![]);_0x47af34[_0x09ed('0x6c')](_0x34548a,_0x4e3d7a[_0x2267b7][_0x09ed('0x7e')]||_0x34548a);}if(_0x4bcb9b[_0x09ed('0x7f')]){_0x4bcb9b[_0x09ed('0x7f')]=JSON[_0x09ed('0x80')](_0x4bcb9b[_0x09ed('0x7f')]);for(var _0x1d2779=0x0;_0x1d2779<_0x4bcb9b[_0x09ed('0x7f')]['length'];_0x1d2779+=0x1){if(_0x4bcb9b[_0x09ed('0x7f')][_0x1d2779][_0x09ed('0x44')]&&_[_0x09ed('0x81')](_0x2b4ea9,_0x4bcb9b[_0x09ed('0x7f')][_0x1d2779][_0x09ed('0x44')])&&_0x4bcb9b['joins'][_0x1d2779][_0x09ed('0x82')]&&_0x4bcb9b[_0x09ed('0x7f')][_0x1d2779][_0x09ed('0x83')]&&_0x4bcb9b[_0x09ed('0x7f')][_0x1d2779]['foreignKey']){_0x47af34[_0x4bcb9b[_0x09ed('0x7f')][_0x1d2779][_0x09ed('0x44')]](_0x4bcb9b[_0x09ed('0x7f')][_0x1d2779][_0x09ed('0x83')],null,util['format'](_0x09ed('0x84'),_0x4bcb9b[_0x09ed('0x76')],_0x4bcb9b[_0x09ed('0x7f')][_0x1d2779]['parentKey'],_0x4bcb9b['joins'][_0x1d2779][_0x09ed('0x83')],_0x4bcb9b[_0x09ed('0x7f')][_0x1d2779][_0x09ed('0x85')]));}}}if(_0x4bcb9b[_0x09ed('0x86')]){_0x4bcb9b[_0x09ed('0x86')]=JSON[_0x09ed('0x80')](_0x4bcb9b[_0x09ed('0x86')]);_0x47af34[_0x09ed('0x40')](_0x544e02(_0x4bcb9b['conditions'][_0x09ed('0x6b')]));}_0x300d1a=_0x47af34[_0x09ed('0x87')]();_0x47af34[_0x09ed('0x22')](_0x2ca01a);_0x47af34['offset'](0x0);logger['debug']('Limited\x20Query:',_0x47af34[_0x09ed('0x88')]());return dbH[_0x09ed('0x89')]['query'](_0x47af34[_0x09ed('0x88')](),{'type':dbH[_0x09ed('0x89')][_0x09ed('0x8a')][_0x09ed('0x8b')]});}})[_0x09ed('0x27')](respondWithResult(_0x1f0bc7,null))[_0x09ed('0x49')](handleError(_0x1f0bc7,null));};function runReport(_0x59c345,_0x175f0f,_0x469f5b){var _0x58594a=_0x175f0f[_0x09ed('0x2f')];var _0x259dee=0xa;var _0x26e4ac=[_0x09ed('0x58'),_0x09ed('0x8c'),_0x09ed('0x59'),_0x09ed('0x5a')];var _0x4f3458={'SUM':_0x09ed('0x5b'),'COUNT':_0x09ed('0x5c'),'COUNT DISTINCT':_0x09ed('0x5d'),'MAX':_0x09ed('0x5e'),'MIN':'MIN(%s)','AVG':_0x09ed('0x8d'),'GROUP_CONCAT':_0x09ed('0x60'),'GROUP_CONCAT ASC':_0x09ed('0x61'),'GROUP_CONCAT DESC':_0x09ed('0x62')};var _0x27e831={'SEC_TO_TIME':_0x09ed('0x63'),'DATE':_0x09ed('0x64'),'HOUR':_0x09ed('0x65'),'ROUND':_0x09ed('0x66'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5a1657=function(_0x27683a){return!_[_0x09ed('0x81')]([_0x09ed('0x8e'),_0x09ed('0x68'),_0x09ed('0x69'),'IS\x20NOT\x20EMPTY'],_0x27683a);};var _0x42508a=function(_0xe1bb43){if(!_0xe1bb43||!_0xe1bb43[_0x09ed('0x6a')][_0x09ed('0x3d')]){return'';}for(var _0x12b98f='(',_0x283992=0x0;_0x283992<_0xe1bb43['rules'][_0x09ed('0x3d')];_0x283992+=0x1){_0x283992>0x0&&(_0x12b98f+='\x20'+_0xe1bb43[_0x09ed('0x8f')]+'\x20');_0x12b98f+=_0xe1bb43[_0x09ed('0x6a')][_0x283992][_0x09ed('0x6b')]?_0x42508a(_0xe1bb43[_0x09ed('0x6a')][_0x283992][_0x09ed('0x6b')]):_0xe1bb43[_0x09ed('0x6a')][_0x283992]['field']+'\x20'+_0xe1bb43['rules'][_0x283992][_0x09ed('0x6d')]+(_0x5a1657(_0xe1bb43[_0x09ed('0x6a')][_0x283992][_0x09ed('0x6d')])?'\x20'+_0xe1bb43[_0x09ed('0x6a')][_0x283992]['value']:'');}return _0x12b98f+')';};var _0x387b96={'where':{'id':_0x59c345['id']}},_0x271b83,_0x2bf4ec,_0x4619c5,_0x43f365,_0x421ca2;_0x387b96=_['merge']({},_0x387b96,_0x469f5b);return db[_0x09ed('0x33')][_0x09ed('0x4d')](_0x387b96)[_0x09ed('0x27')](function(_0x3a3af9){if(_0x3a3af9){_0x271b83=_0x3a3af9;return _0x3a3af9['getFields']();}return null;})[_0x09ed('0x27')](function(_0x34deed){if(_0x34deed){if(!_0x34deed[_0x09ed('0x3d')]){throw new db[(_0x09ed('0x90'))][(_0x09ed('0x70'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2bf4ec=_0x34deed;return db[_0x09ed('0x72')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x66faa2){if(_0x66faa2){_0x4619c5=_['keyBy'](_0x66faa2,'id');var _0x1cddd9;var _0x282f0a=squel['select']();_0x282f0a[_0x09ed('0x75')](_0x271b83[_0x09ed('0x76')]);for(var _0x4fd105=0x0;_0x4fd105<_0x2bf4ec[_0x09ed('0x3d')];_0x4fd105+=0x1){_0x1cddd9=_0x2bf4ec[_0x4fd105][_0x09ed('0x77')]?_0x4619c5[_0x2bf4ec[_0x4fd105]['MetricId']][_0x09ed('0x78')]:_0x2bf4ec[_0x4fd105][_0x09ed('0x6c')];_0x1cddd9=_0x2bf4ec[_0x4fd105]['function']?_[_0x09ed('0x7a')](_0x4f3458[_0x2bf4ec[_0x4fd105][_0x09ed('0x79')]],'%s',_0x1cddd9):_0x1cddd9;_0x1cddd9=_0x2bf4ec[_0x4fd105][_0x09ed('0x7b')]?_[_0x09ed('0x7a')](_0x27e831[_0x2bf4ec[_0x4fd105][_0x09ed('0x7b')]],'%s',_0x1cddd9):_0x1cddd9;if(_0x2bf4ec[_0x4fd105][_0x09ed('0x91')]){_0x282f0a[_0x09ed('0x6b')](_0x1cddd9);}_0x2bf4ec[_0x4fd105]['orderBy']&&_0x282f0a[_0x09ed('0x3e')](_0x1cddd9,_0x2bf4ec[_0x4fd105][_0x09ed('0x7c')]===_0x09ed('0x7d')?![]:!![]);_0x282f0a['field'](_0x1cddd9,_0x2bf4ec[_0x4fd105][_0x09ed('0x7e')]||_0x1cddd9);}if(_0x271b83['joins']){_0x271b83[_0x09ed('0x7f')]=JSON['parse'](_0x271b83[_0x09ed('0x7f')]);for(var _0x192c80=0x0;_0x192c80<_0x271b83[_0x09ed('0x7f')][_0x09ed('0x3d')];_0x192c80+=0x1){if(_0x271b83[_0x09ed('0x7f')][_0x192c80][_0x09ed('0x44')]&&_['includes'](_0x26e4ac,_0x271b83[_0x09ed('0x7f')][_0x192c80][_0x09ed('0x44')])&&_0x271b83[_0x09ed('0x7f')][_0x192c80]['parentKey']&&_0x271b83[_0x09ed('0x7f')][_0x192c80]['foreignTable']&&_0x271b83[_0x09ed('0x7f')][_0x192c80][_0x09ed('0x85')]){_0x282f0a[_0x271b83[_0x09ed('0x7f')][_0x192c80][_0x09ed('0x44')]](_0x271b83[_0x09ed('0x7f')][_0x192c80][_0x09ed('0x83')],null,util[_0x09ed('0x7b')](_0x09ed('0x84'),_0x271b83[_0x09ed('0x76')],_0x271b83['joins'][_0x192c80][_0x09ed('0x82')],_0x271b83['joins'][_0x192c80][_0x09ed('0x83')],_0x271b83['joins'][_0x192c80][_0x09ed('0x85')]));}}}if(_0x271b83[_0x09ed('0x86')]){_0x271b83[_0x09ed('0x86')]=JSON[_0x09ed('0x80')](_0x271b83[_0x09ed('0x86')]);_0x282f0a[_0x09ed('0x40')](_0x42508a(_0x271b83['conditions'][_0x09ed('0x6b')]));}_0x421ca2=_0x282f0a[_0x09ed('0x87')]();_0x282f0a[_0x09ed('0x22')](_0x259dee);_0x282f0a[_0x09ed('0x20')](0x0);return;}})[_0x09ed('0x27')](function(){if(_0x175f0f['output']===_0x09ed('0x92')){return null;}var _0x252d4b=_['merge'](_0x175f0f,{'name':_0x175f0f['fullPath']||_0x175f0f[_0x09ed('0x2f')]||_0x271b83[_0x09ed('0x2f')],'basename':_0x58594a,'savename':util[_0x09ed('0x7b')](_0x09ed('0x93'),_0x175f0f[_0x09ed('0x2f')]||_0x271b83[_0x09ed('0x2f')],require('randomstring')['generate'](0x4),_0x175f0f[_0x09ed('0x94')]||'csv'),'reportId':_0x271b83['id'],'reportType':_0x09ed('0x95')});return db[_0x09ed('0x96')]['create'](_0x252d4b,{'raw':!![]});})[_0x09ed('0x27')](function(_0x7207){if(_0x271b83[_0x09ed('0x76')]==='cdr'){_0x421ca2['where'](_0x271b83[_0x09ed('0x76')]+_0x09ed('0x97'),_0x175f0f[_0x09ed('0x98')],_0x175f0f[_0x09ed('0x99')]);}else{_0x421ca2[_0x09ed('0x40')](_0x271b83[_0x09ed('0x76')]+_0x09ed('0x9a'),_0x175f0f[_0x09ed('0x98')],_0x175f0f[_0x09ed('0x99')]);}if(_0x7207){logger[_0x09ed('0x9b')](_0x09ed('0x9c'),_0x421ca2[_0x09ed('0x88')]());require(_0x09ed('0x9d'))['fork'](path[_0x09ed('0x58')](__dirname,_0x09ed('0x9e'),_0x7207[_0x09ed('0x94')]),[_0x7207['id'],_0x421ca2['toString'](),path['join'](__dirname,_0x09ed('0x9f'),_0x7207[_0x09ed('0xa0')]),_0x58594a]);return _0x7207;}else{var _0x3df215=squel[_0x09ed('0x74')]();_0x3df215[_0x09ed('0x75')]('('+_0x421ca2[_0x09ed('0x88')]()+')','countTable');_0x3df215[_0x09ed('0x6c')](_0x09ed('0xa1'),_0x09ed('0xa2'));_0x421ca2[_0x09ed('0x22')](_0x175f0f['limit']||_0x259dee);_0x421ca2[_0x09ed('0x20')](_0x175f0f['offset']||0x0);return dbH['sequelize'][_0x09ed('0x38')](_0x3df215[_0x09ed('0x88')](),{'type':dbH[_0x09ed('0x89')][_0x09ed('0x8a')]['SELECT']})['then'](function(_0x48a1af){if(!_0x48a1af[_0x09ed('0x3d')]){_0x43f365=0x0;}else{_0x43f365=_0x48a1af[0x0][_0x09ed('0xa2')]||0x0;}return dbH[_0x09ed('0x89')][_0x09ed('0x38')](_0x421ca2[_0x09ed('0x88')](),{'type':dbH[_0x09ed('0x89')][_0x09ed('0x8a')][_0x09ed('0x8b')]});})[_0x09ed('0x27')](function(_0x41e851){return{'rows':_0x41e851||[],'count':_0x43f365};});}});}exports[_0x09ed('0xa3')]=function(_0x2569ae,_0x4a827){return runReport(_0x2569ae[_0x09ed('0x4b')],_0x2569ae[_0x09ed('0x38')],_0x2569ae[_0x09ed('0x46')])[_0x09ed('0x27')](respondWithResult(_0x4a827,null))['catch'](handleError(_0x4a827,null));};exports[_0x09ed('0xa4')]=runReport;exports[_0x09ed('0x38')]=function(_0x459905,_0x5d80b7){var _0x46f2c9=0xa;var _0x569c79=[_0x09ed('0x58'),_0x09ed('0x8c'),_0x09ed('0x59'),_0x09ed('0x5a')];var _0x214a1f={'SUM':_0x09ed('0x5b'),'COUNT':_0x09ed('0x5c'),'COUNT DISTINCT':_0x09ed('0x5d'),'MAX':_0x09ed('0x5e'),'MIN':_0x09ed('0x5f'),'AVG':_0x09ed('0x8d'),'GROUP_CONCAT':_0x09ed('0x60'),'GROUP_CONCAT ASC':_0x09ed('0x61'),'GROUP_CONCAT DESC':_0x09ed('0x62')};var _0x120e88={'SEC_TO_TIME':_0x09ed('0x63'),'DATE':_0x09ed('0x64'),'HOUR':'HOUR(%s)','ROUND':_0x09ed('0x66'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x21bdd2=function(_0x1e9e7f){return!_[_0x09ed('0x81')]([_0x09ed('0x8e'),_0x09ed('0x68'),'IS\x20EMPTY',_0x09ed('0xa5')],_0x1e9e7f);};var _0x161f36=function(_0x26986d){if(!_0x26986d||!_0x26986d['rules'][_0x09ed('0x3d')]){return'';}for(var _0x390a98='(',_0x5416ad=0x0;_0x5416ad<_0x26986d[_0x09ed('0x6a')]['length'];_0x5416ad+=0x1){_0x5416ad>0x0&&(_0x390a98+='\x20'+_0x26986d[_0x09ed('0x8f')]+'\x20');_0x390a98+=_0x26986d[_0x09ed('0x6a')][_0x5416ad][_0x09ed('0x6b')]?_0x161f36(_0x26986d['rules'][_0x5416ad][_0x09ed('0x6b')]):_0x26986d[_0x09ed('0x6a')][_0x5416ad][_0x09ed('0x6c')]+'\x20'+_0x26986d[_0x09ed('0x6a')][_0x5416ad]['condition']+(_0x21bdd2(_0x26986d[_0x09ed('0x6a')][_0x5416ad][_0x09ed('0x6d')])?'\x20'+_0x26986d[_0x09ed('0x6a')][_0x5416ad][_0x09ed('0x6e')]:'');}return _0x390a98+')';};var _0x22da97={'where':{'id':_0x459905[_0x09ed('0x4b')]['id']}},_0x8360b2,_0x1f566e,_0x495839,_0x3b3e8b,_0x4f4e85;_0x22da97=_[_0x09ed('0x43')]({},_0x22da97,_0x459905[_0x09ed('0x46')]);return db['AnalyticCustomReport'][_0x09ed('0x4d')](_0x22da97)['then'](function(_0x546af0){if(_0x546af0){_0x8360b2=_0x546af0;return _0x546af0[_0x09ed('0x6f')]();}return null;})[_0x09ed('0x27')](function(_0x3b7ad2){if(_0x3b7ad2){if(!_0x3b7ad2[_0x09ed('0x3d')]){throw new db[(_0x09ed('0x90'))]['ValidationErrorItem'](_0x09ed('0x71'),0x193);}_0x1f566e=_0x3b7ad2;return db['AnalyticMetric'][_0x09ed('0x73')]({'raw':!![]});}return null;})[_0x09ed('0x27')](function(_0xff1d4){if(_0xff1d4){_0x495839=_[_0x09ed('0xa6')](_0xff1d4,'id');var _0x2991a1;var _0x543312=squel[_0x09ed('0x74')]();_0x543312['from'](_0x8360b2[_0x09ed('0x76')]);for(var _0x5ad66e=0x0;_0x5ad66e<_0x1f566e['length'];_0x5ad66e+=0x1){_0x2991a1=_0x1f566e[_0x5ad66e][_0x09ed('0x77')]?_0x495839[_0x1f566e[_0x5ad66e][_0x09ed('0x77')]][_0x09ed('0x78')]:_0x1f566e[_0x5ad66e][_0x09ed('0x6c')];_0x2991a1=_0x1f566e[_0x5ad66e][_0x09ed('0x79')]?_[_0x09ed('0x7a')](_0x214a1f[_0x1f566e[_0x5ad66e]['function']],'%s',_0x2991a1):_0x2991a1;_0x2991a1=_0x1f566e[_0x5ad66e][_0x09ed('0x7b')]?_[_0x09ed('0x7a')](_0x120e88[_0x1f566e[_0x5ad66e][_0x09ed('0x7b')]],'%s',_0x2991a1):_0x2991a1;if(_0x1f566e[_0x5ad66e][_0x09ed('0x91')]){_0x543312[_0x09ed('0x6b')](_0x2991a1);}_0x1f566e[_0x5ad66e][_0x09ed('0x7c')]&&_0x543312[_0x09ed('0x3e')](_0x2991a1,_0x1f566e[_0x5ad66e]['orderBy']===_0x09ed('0x7d')?![]:!![]);_0x543312['field'](_0x2991a1,_0x1f566e[_0x5ad66e][_0x09ed('0x7e')]||_0x2991a1);}if(_0x8360b2['joins']){_0x8360b2['joins']=JSON[_0x09ed('0x80')](_0x8360b2[_0x09ed('0x7f')]);for(var _0x345e82=0x0;_0x345e82<_0x8360b2['joins'][_0x09ed('0x3d')];_0x345e82+=0x1){if(_0x8360b2[_0x09ed('0x7f')][_0x345e82]['type']&&_[_0x09ed('0x81')](_0x569c79,_0x8360b2[_0x09ed('0x7f')][_0x345e82][_0x09ed('0x44')])&&_0x8360b2['joins'][_0x345e82][_0x09ed('0x82')]&&_0x8360b2['joins'][_0x345e82][_0x09ed('0x83')]&&_0x8360b2[_0x09ed('0x7f')][_0x345e82][_0x09ed('0x85')]){_0x543312[_0x8360b2[_0x09ed('0x7f')][_0x345e82]['type']](_0x8360b2['joins'][_0x345e82]['foreignTable'],null,util[_0x09ed('0x7b')](_0x09ed('0x84'),_0x8360b2[_0x09ed('0x76')],_0x8360b2[_0x09ed('0x7f')][_0x345e82]['parentKey'],_0x8360b2[_0x09ed('0x7f')][_0x345e82]['foreignTable'],_0x8360b2[_0x09ed('0x7f')][_0x345e82][_0x09ed('0x85')]));}}}if(_0x8360b2[_0x09ed('0x86')]){_0x8360b2['conditions']=JSON['parse'](_0x8360b2['conditions']);_0x543312['where'](_0x161f36(_0x8360b2['conditions'][_0x09ed('0x6b')]));}_0x4f4e85=_0x543312[_0x09ed('0x87')]();_0x543312[_0x09ed('0x22')](_0x46f2c9);_0x543312[_0x09ed('0x20')](0x0);logger['debug'](_0x09ed('0xa7'),_0x543312[_0x09ed('0x88')]());return dbH['sequelize'][_0x09ed('0x38')](_0x543312[_0x09ed('0x88')](),{'type':dbH[_0x09ed('0x89')][_0x09ed('0x8a')]['SELECT']});}})[_0x09ed('0x27')](function(){return{'sql':_0x4f4e85[_0x09ed('0x88')]()};})[_0x09ed('0x27')](respondWithResult(_0x5d80b7,null))[_0x09ed('0x49')](handleError(_0x5d80b7,null));};
\ No newline at end of file
+var _0x1121=['foreignKey','table','conditions','parse','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','SEC_TO_TIME(%s)','IS\x20NULL','Please\x20insert\x20at\x20least\x20one\x20field','from','DESC','alias','parentKey','clone','output','web','fullPath','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','Run\x20Query:','child_process','fork','../../files/reports','savename','COUNT(*)','run','runReport','IS\x20EMPTY','ValidationErrorItem','%s.%s\x20=\x20%s.%s','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','end','offset','undefined','limit','count','set','json','reject','then','destroy','CustomReports','UserProfileResource','sendStatus','error','stack','name','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','rows','catch','params','includeAll','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','AnalyticMetric','findAll','keyBy','select','MetricId','metric','field','function','replace','format','groupBy','orderBy','joins','foreignTable'];(function(_0x5a6644,_0x45d612){var _0x3a2a5d=function(_0x54159e){while(--_0x54159e){_0x5a6644['push'](_0x5a6644['shift']());}};_0x3a2a5d(++_0x45d612);}(_0x1121,0xc9));var _0x1112=function(_0x24600a,_0xab1618){_0x24600a=_0x24600a-0x0;var _0x100968=_0x1121[_0x24600a];return _0x100968;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1112('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1112('0x1'));var moment=require(_0x1112('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x1112('0x3'));var util=require(_0x1112('0x4'));var path=require(_0x1112('0x5'));var sox=require(_0x1112('0x6'));var csv=require(_0x1112('0x7'));var ejs=require(_0x1112('0x8'));var fs=require('fs');var fs_extra=require(_0x1112('0x9'));var _=require('lodash');var squel=require(_0x1112('0xa'));var crypto=require(_0x1112('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1112('0x7'));var querystring=require(_0x1112('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1112('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x1112('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1112('0xf'));var utils=require('../../config/utils');var config=require(_0x1112('0x10'));var licenseUtil=require(_0x1112('0x11'));var db=require(_0x1112('0x12'))['db'];var dbH=require('../../mysqldb')[_0x1112('0x13')];function respondWithStatusCode(_0x105258,_0x1adff7){_0x1adff7=_0x1adff7||0xcc;return function(_0x1a7b21){if(_0x1a7b21){return _0x105258['sendStatus'](_0x1adff7);}return _0x105258[_0x1112('0x14')](_0x1adff7)[_0x1112('0x15')]();};}function respondWithResult(_0x213f34,_0x3d5d5c){_0x3d5d5c=_0x3d5d5c||0xc8;return function(_0xde3db8){if(_0xde3db8){return _0x213f34[_0x1112('0x14')](_0x3d5d5c)['json'](_0xde3db8);}};}function respondWithFilteredResult(_0xb7f38d,_0x258ea7){return function(_0xbfc2bd){if(_0xbfc2bd){var _0x5eb6a4=typeof _0x258ea7[_0x1112('0x16')]===_0x1112('0x17')&&typeof _0x258ea7[_0x1112('0x18')]===_0x1112('0x17');var _0x426902=_0xbfc2bd['count'];var _0x5e53d1=_0x5eb6a4?0x0:_0x258ea7[_0x1112('0x16')];var _0x1124ed=_0x5eb6a4?_0xbfc2bd[_0x1112('0x19')]:_0x258ea7[_0x1112('0x16')]+_0x258ea7[_0x1112('0x18')];var _0x9ee5f9;if(_0x1124ed>=_0x426902){_0x1124ed=_0x426902;_0x9ee5f9=0xc8;}else{_0x9ee5f9=0xce;}_0xb7f38d[_0x1112('0x14')](_0x9ee5f9);return _0xb7f38d[_0x1112('0x1a')]('Content-Range',_0x5e53d1+'-'+_0x1124ed+'/'+_0x426902)[_0x1112('0x1b')](_0xbfc2bd);}return null;};}function patchUpdates(_0x13a89b){return function(_0x2f43b7){try{jsonpatch['apply'](_0x2f43b7,_0x13a89b,!![]);}catch(_0x36106e){return BPromise[_0x1112('0x1c')](_0x36106e);}return _0x2f43b7['save']();};}function saveUpdates(_0x23686e,_0x226c81){return function(_0x457914){if(_0x457914){return _0x457914['update'](_0x23686e)[_0x1112('0x1d')](function(_0x342928){return _0x342928;});}return null;};}function removeEntity(_0x267ae3,_0x41e807){return function(_0x3a574f){if(_0x3a574f){return _0x3a574f[_0x1112('0x1e')]()[_0x1112('0x1d')](function(){var _0x5f31a0=_0x3a574f['get']({'plain':!![]});var _0x572f5d=_0x1112('0x1f');return db[_0x1112('0x20')][_0x1112('0x1e')]({'where':{'type':_0x572f5d,'resourceId':_0x5f31a0['id']}})[_0x1112('0x1d')](function(){return _0x3a574f;});})[_0x1112('0x1d')](function(){_0x267ae3[_0x1112('0x14')](0xcc)[_0x1112('0x15')]();});}};}function handleEntityNotFound(_0x3645ec,_0x1e1e9e){return function(_0x3c7df7){if(!_0x3c7df7){_0x3645ec[_0x1112('0x21')](0x194);}return _0x3c7df7;};}function handleError(_0xd14503,_0x5ca322){_0x5ca322=_0x5ca322||0x1f4;return function(_0x152e47){logger[_0x1112('0x22')](_0x152e47[_0x1112('0x23')]);if(_0x152e47[_0x1112('0x24')]){delete _0x152e47[_0x1112('0x24')];}_0xd14503[_0x1112('0x14')](_0x5ca322)['send'](_0x152e47);};}exports[_0x1112('0x25')]=function(_0x47b422,_0x1b991b){var _0x3f3edd={},_0x35a617={},_0x13eef2={'count':0x0,'rows':[]};var _0x46a5a9=_[_0x1112('0x26')](db[_0x1112('0x27')][_0x1112('0x28')],function(_0x4edf75){return{'name':_0x4edf75[_0x1112('0x29')],'type':_0x4edf75[_0x1112('0x2a')][_0x1112('0x2b')]};});_0x35a617[_0x1112('0x2c')]=_['map'](_0x46a5a9,_0x1112('0x24'));_0x35a617[_0x1112('0x2d')]=_[_0x1112('0x2e')](_0x47b422['query']);_0x35a617[_0x1112('0x2f')]=_[_0x1112('0x30')](_0x35a617[_0x1112('0x2c')],_0x35a617['query']);_0x3f3edd[_0x1112('0x31')]=_[_0x1112('0x30')](_0x35a617[_0x1112('0x2c')],qs[_0x1112('0x32')](_0x47b422[_0x1112('0x2d')][_0x1112('0x32')]));_0x3f3edd[_0x1112('0x31')]=_0x3f3edd[_0x1112('0x31')][_0x1112('0x33')]?_0x3f3edd[_0x1112('0x31')]:_0x35a617[_0x1112('0x2c')];if(!_0x47b422[_0x1112('0x2d')][_0x1112('0x34')](_0x1112('0x35'))){_0x3f3edd[_0x1112('0x18')]=qs[_0x1112('0x18')](_0x47b422[_0x1112('0x2d')][_0x1112('0x18')]);_0x3f3edd['offset']=qs[_0x1112('0x16')](_0x47b422[_0x1112('0x2d')][_0x1112('0x16')]);}_0x3f3edd[_0x1112('0x36')]=qs['sort'](_0x47b422['query'][_0x1112('0x37')]);_0x3f3edd[_0x1112('0x38')]=qs[_0x1112('0x2f')](_['pick'](_0x47b422[_0x1112('0x2d')],_0x35a617['filters']),_0x46a5a9);if(_0x47b422[_0x1112('0x2d')][_0x1112('0x39')]){_0x3f3edd[_0x1112('0x38')]=_['merge'](_0x3f3edd[_0x1112('0x38')],{'$or':_[_0x1112('0x26')](_0x46a5a9,function(_0x1aab00){if(_0x1aab00[_0x1112('0x2a')]!=='VIRTUAL'){var _0x5ac479={};_0x5ac479[_0x1aab00[_0x1112('0x24')]]={'$like':'%'+_0x47b422['query'][_0x1112('0x39')]+'%'};return _0x5ac479;}})});}_0x3f3edd=_[_0x1112('0x3a')]({},_0x3f3edd,_0x47b422[_0x1112('0x3b')]);var _0x5db78f={'where':_0x3f3edd['where']};return db[_0x1112('0x27')][_0x1112('0x19')](_0x5db78f)[_0x1112('0x1d')](function(_0xef6d91){_0x13eef2[_0x1112('0x19')]=_0xef6d91;if(_0x47b422[_0x1112('0x2d')]['includeAll']){_0x3f3edd['include']=[{'all':!![]}];}return db['AnalyticCustomReport']['findAll'](_0x3f3edd);})[_0x1112('0x1d')](function(_0x19bfe9){_0x13eef2[_0x1112('0x3c')]=_0x19bfe9;return _0x13eef2;})[_0x1112('0x1d')](respondWithFilteredResult(_0x1b991b,_0x3f3edd))[_0x1112('0x3d')](handleError(_0x1b991b,null));};exports['show']=function(_0x192795,_0x179ff3){var _0x43adea={'raw':![],'where':{'id':_0x192795[_0x1112('0x3e')]['id']}},_0x4c9156={};_0x4c9156[_0x1112('0x2c')]=_['keys'](db[_0x1112('0x27')][_0x1112('0x28')]);_0x4c9156[_0x1112('0x2d')]=_[_0x1112('0x2e')](_0x192795['query']);_0x4c9156[_0x1112('0x2f')]=_[_0x1112('0x30')](_0x4c9156['model'],_0x4c9156[_0x1112('0x2d')]);_0x43adea['attributes']=_[_0x1112('0x30')](_0x4c9156[_0x1112('0x2c')],qs[_0x1112('0x32')](_0x192795['query'][_0x1112('0x32')]));_0x43adea[_0x1112('0x31')]=_0x43adea[_0x1112('0x31')]['length']?_0x43adea[_0x1112('0x31')]:_0x4c9156[_0x1112('0x2c')];if(_0x192795[_0x1112('0x2d')][_0x1112('0x3f')]){_0x43adea[_0x1112('0x40')]=[{'all':!![]}];}_0x43adea=_[_0x1112('0x3a')]({},_0x43adea,_0x192795[_0x1112('0x3b')]);return db['AnalyticCustomReport'][_0x1112('0x41')](_0x43adea)['then'](handleEntityNotFound(_0x179ff3,null))[_0x1112('0x1d')](respondWithResult(_0x179ff3,null))[_0x1112('0x3d')](handleError(_0x179ff3,null));};exports[_0x1112('0x42')]=function(_0xc8323a,_0x505dcc){return db[_0x1112('0x27')][_0x1112('0x42')](_0xc8323a[_0x1112('0x43')],{})[_0x1112('0x1d')](function(_0x34c181){var _0x303daa=_0xc8323a[_0x1112('0x44')][_0x1112('0x45')]({'plain':!![]});if(!_0x303daa)throw new Error(_0x1112('0x46'));if(_0x303daa[_0x1112('0x47')]===_0x1112('0x44')){var _0x1c805d=_0x34c181[_0x1112('0x45')]({'plain':!![]});var _0x1c2e50=_0x1112('0x48');return db[_0x1112('0x49')][_0x1112('0x41')]({'where':{'name':_0x1c2e50,'userProfileId':_0x303daa[_0x1112('0x4a')]},'raw':!![]})[_0x1112('0x1d')](function(_0x4168ae){if(_0x4168ae&&_0x4168ae[_0x1112('0x4b')]===0x0){return db['UserProfileResource']['create']({'name':_0x1c805d['name'],'resourceId':_0x1c805d['id'],'type':_0x1112('0x1f'),'sectionId':_0x4168ae['id']},{})[_0x1112('0x1d')](function(){return _0x34c181;});}else{return _0x34c181;}})['catch'](function(_0x2b12fd){logger[_0x1112('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2b12fd);throw _0x2b12fd;});}return _0x34c181;})[_0x1112('0x1d')](respondWithResult(_0x505dcc,0xc9))[_0x1112('0x3d')](handleError(_0x505dcc,null));};exports['update']=function(_0x15b925,_0x376ba6){if(_0x15b925[_0x1112('0x43')]['id']){delete _0x15b925[_0x1112('0x43')]['id'];}return db['AnalyticCustomReport']['find']({'where':{'id':_0x15b925[_0x1112('0x3e')]['id']}})[_0x1112('0x1d')](handleEntityNotFound(_0x376ba6,null))[_0x1112('0x1d')](saveUpdates(_0x15b925[_0x1112('0x43')],null))[_0x1112('0x1d')](respondWithResult(_0x376ba6,null))[_0x1112('0x3d')](handleError(_0x376ba6,null));};exports['destroy']=function(_0x342a3a,_0x3761eb){return db[_0x1112('0x27')][_0x1112('0x41')]({'where':{'id':_0x342a3a[_0x1112('0x3e')]['id']}})[_0x1112('0x1d')](handleEntityNotFound(_0x3761eb,null))[_0x1112('0x1d')](removeEntity(_0x3761eb,null))[_0x1112('0x3d')](handleError(_0x3761eb,null));};exports['preview']=function(_0x18c1b4,_0x19c1f6){var _0x1eec53=0xa;var _0x47d7f7=[_0x1112('0x4c'),_0x1112('0x4d'),_0x1112('0x4e'),_0x1112('0x4f')];var _0x5cdcd9={'SUM':_0x1112('0x50'),'COUNT':_0x1112('0x51'),'COUNT DISTINCT':_0x1112('0x52'),'MAX':_0x1112('0x53'),'MIN':_0x1112('0x54'),'AVG':_0x1112('0x55'),'GROUP_CONCAT':_0x1112('0x56'),'GROUP_CONCAT ASC':_0x1112('0x57'),'GROUP_CONCAT DESC':_0x1112('0x58')};var _0xdccd79={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x1112('0x59'),'HOUR':_0x1112('0x5a'),'ROUND':_0x1112('0x5b'),'UNIX_TIMESTAMP':_0x1112('0x5c')};var _0x19d4a7=function(_0x284a02){return!_[_0x1112('0x5d')](['IS\x20NULL',_0x1112('0x5e'),'IS\x20EMPTY',_0x1112('0x5f')],_0x284a02);};var _0x4465d0=function(_0x570604){if(!_0x570604||!_0x570604[_0x1112('0x60')]['length']){return'';}for(var _0x45c387='(',_0x31c85e=0x0;_0x31c85e<_0x570604[_0x1112('0x60')][_0x1112('0x33')];_0x31c85e+=0x1){_0x31c85e>0x0&&(_0x45c387+='\x20'+_0x570604[_0x1112('0x61')]+'\x20');_0x45c387+=_0x570604['rules'][_0x31c85e][_0x1112('0x62')]?_0x4465d0(_0x570604[_0x1112('0x60')][_0x31c85e][_0x1112('0x62')]):_0x570604['rules'][_0x31c85e]['field']+'\x20'+_0x570604['rules'][_0x31c85e][_0x1112('0x63')]+(_0x19d4a7(_0x570604['rules'][_0x31c85e][_0x1112('0x63')])?'\x20'+_0x570604[_0x1112('0x60')][_0x31c85e][_0x1112('0x64')]:'');}return _0x45c387+')';};var _0x435fcc={'where':{'id':_0x18c1b4[_0x1112('0x3e')]['id']}},_0x554f76,_0x5e0f97,_0x4b0b3d,_0x46eced,_0x532f5a;_0x435fcc=_[_0x1112('0x3a')]({},_0x435fcc,_0x18c1b4[_0x1112('0x3b')]);return db[_0x1112('0x27')][_0x1112('0x41')](_0x435fcc)[_0x1112('0x1d')](function(_0x4252ad){if(_0x4252ad){_0x554f76=_0x4252ad;return _0x4252ad[_0x1112('0x65')]();}return null;})[_0x1112('0x1d')](function(_0x44ce2f){if(_0x44ce2f){if(!_0x44ce2f[_0x1112('0x33')]){throw new db[(_0x1112('0x66'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5e0f97=_0x44ce2f;return db[_0x1112('0x67')][_0x1112('0x68')]({'raw':!![]});}return null;})[_0x1112('0x1d')](function(_0x32a881){if(_0x32a881){_0x4b0b3d=_[_0x1112('0x69')](_0x32a881,'id');var _0x53a7ff;var _0x3cad02=squel[_0x1112('0x6a')]();_0x3cad02['from'](_0x554f76['table']);for(var _0x107bcd=0x0;_0x107bcd<_0x5e0f97['length'];_0x107bcd+=0x1){_0x53a7ff=_0x5e0f97[_0x107bcd]['MetricId']?_0x4b0b3d[_0x5e0f97[_0x107bcd][_0x1112('0x6b')]][_0x1112('0x6c')]:_0x5e0f97[_0x107bcd][_0x1112('0x6d')];_0x53a7ff=_0x5e0f97[_0x107bcd][_0x1112('0x6e')]?_[_0x1112('0x6f')](_0x5cdcd9[_0x5e0f97[_0x107bcd]['function']],'%s',_0x53a7ff):_0x53a7ff;_0x53a7ff=_0x5e0f97[_0x107bcd][_0x1112('0x70')]?_[_0x1112('0x6f')](_0xdccd79[_0x5e0f97[_0x107bcd]['format']],'%s',_0x53a7ff):_0x53a7ff;if(_0x5e0f97[_0x107bcd][_0x1112('0x71')]){_0x3cad02[_0x1112('0x62')](_0x53a7ff);}_0x5e0f97[_0x107bcd][_0x1112('0x72')]&&_0x3cad02[_0x1112('0x36')](_0x53a7ff,_0x5e0f97[_0x107bcd][_0x1112('0x72')]==='DESC'?![]:!![]);_0x3cad02[_0x1112('0x6d')](_0x53a7ff,_0x5e0f97[_0x107bcd]['alias']||_0x53a7ff);}if(_0x554f76[_0x1112('0x73')]){_0x554f76[_0x1112('0x73')]=JSON['parse'](_0x554f76[_0x1112('0x73')]);for(var _0x5d5775=0x0;_0x5d5775<_0x554f76[_0x1112('0x73')]['length'];_0x5d5775+=0x1){if(_0x554f76[_0x1112('0x73')][_0x5d5775][_0x1112('0x2a')]&&_['includes'](_0x47d7f7,_0x554f76[_0x1112('0x73')][_0x5d5775][_0x1112('0x2a')])&&_0x554f76['joins'][_0x5d5775]['parentKey']&&_0x554f76[_0x1112('0x73')][_0x5d5775][_0x1112('0x74')]&&_0x554f76[_0x1112('0x73')][_0x5d5775][_0x1112('0x75')]){_0x3cad02[_0x554f76[_0x1112('0x73')][_0x5d5775][_0x1112('0x2a')]](_0x554f76[_0x1112('0x73')][_0x5d5775][_0x1112('0x74')],null,util[_0x1112('0x70')]('%s.%s\x20=\x20%s.%s',_0x554f76[_0x1112('0x76')],_0x554f76[_0x1112('0x73')][_0x5d5775]['parentKey'],_0x554f76[_0x1112('0x73')][_0x5d5775]['foreignTable'],_0x554f76[_0x1112('0x73')][_0x5d5775]['foreignKey']));}}}if(_0x554f76[_0x1112('0x77')]){_0x554f76[_0x1112('0x77')]=JSON[_0x1112('0x78')](_0x554f76[_0x1112('0x77')]);_0x3cad02[_0x1112('0x38')](_0x4465d0(_0x554f76[_0x1112('0x77')][_0x1112('0x62')]));}_0x532f5a=_0x3cad02['clone']();_0x3cad02[_0x1112('0x18')](_0x1eec53);_0x3cad02[_0x1112('0x16')](0x0);logger[_0x1112('0x79')](_0x1112('0x7a'),_0x3cad02[_0x1112('0x7b')]());return dbH['sequelize'][_0x1112('0x2d')](_0x3cad02[_0x1112('0x7b')](),{'type':dbH[_0x1112('0x7c')][_0x1112('0x7d')][_0x1112('0x7e')]});}})['then'](respondWithResult(_0x19c1f6,null))[_0x1112('0x3d')](handleError(_0x19c1f6,null));};function runReport(_0x10ca1f,_0x1784d1,_0x518419){var _0x457010=_0x1784d1['name'];var _0x2860d7=0xa;var _0x108079=[_0x1112('0x4c'),'left_join',_0x1112('0x4e'),_0x1112('0x4f')];var _0x149bde={'SUM':_0x1112('0x50'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x1112('0x52'),'MAX':'MAX(%s)','MIN':_0x1112('0x54'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x1112('0x56'),'GROUP_CONCAT ASC':_0x1112('0x57'),'GROUP_CONCAT DESC':_0x1112('0x58')};var _0x3013c3={'SEC_TO_TIME':_0x1112('0x7f'),'DATE':_0x1112('0x59'),'HOUR':_0x1112('0x5a'),'ROUND':_0x1112('0x5b'),'UNIX_TIMESTAMP':_0x1112('0x5c')};var _0x359fab=function(_0x39ef98){return!_['includes']([_0x1112('0x80'),_0x1112('0x5e'),'IS\x20EMPTY',_0x1112('0x5f')],_0x39ef98);};var _0x17cd21=function(_0x436380){if(!_0x436380||!_0x436380['rules'][_0x1112('0x33')]){return'';}for(var _0x594327='(',_0x194acf=0x0;_0x194acf<_0x436380[_0x1112('0x60')]['length'];_0x194acf+=0x1){_0x194acf>0x0&&(_0x594327+='\x20'+_0x436380['operator']+'\x20');_0x594327+=_0x436380['rules'][_0x194acf][_0x1112('0x62')]?_0x17cd21(_0x436380[_0x1112('0x60')][_0x194acf][_0x1112('0x62')]):_0x436380[_0x1112('0x60')][_0x194acf]['field']+'\x20'+_0x436380[_0x1112('0x60')][_0x194acf][_0x1112('0x63')]+(_0x359fab(_0x436380[_0x1112('0x60')][_0x194acf]['condition'])?'\x20'+_0x436380[_0x1112('0x60')][_0x194acf][_0x1112('0x64')]:'');}return _0x594327+')';};var _0x9cac92={'where':{'id':_0x10ca1f['id']}},_0x2609b8,_0x414f8b,_0x33a61d,_0x4ab164,_0x1c78fc;_0x9cac92=_['merge']({},_0x9cac92,_0x518419);return db[_0x1112('0x27')]['find'](_0x9cac92)[_0x1112('0x1d')](function(_0x2ebb71){if(_0x2ebb71){_0x2609b8=_0x2ebb71;return _0x2ebb71[_0x1112('0x65')]();}return null;})['then'](function(_0x448073){if(_0x448073){if(!_0x448073[_0x1112('0x33')]){throw new db[(_0x1112('0x66'))]['ValidationErrorItem'](_0x1112('0x81'),0x193);}_0x414f8b=_0x448073;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x1112('0x1d')](function(_0x5c83b1){if(_0x5c83b1){_0x33a61d=_[_0x1112('0x69')](_0x5c83b1,'id');var _0x36a42f;var _0x2c28c0=squel['select']();_0x2c28c0[_0x1112('0x82')](_0x2609b8['table']);for(var _0x42f6ef=0x0;_0x42f6ef<_0x414f8b['length'];_0x42f6ef+=0x1){_0x36a42f=_0x414f8b[_0x42f6ef][_0x1112('0x6b')]?_0x33a61d[_0x414f8b[_0x42f6ef][_0x1112('0x6b')]]['metric']:_0x414f8b[_0x42f6ef]['field'];_0x36a42f=_0x414f8b[_0x42f6ef][_0x1112('0x6e')]?_['replace'](_0x149bde[_0x414f8b[_0x42f6ef][_0x1112('0x6e')]],'%s',_0x36a42f):_0x36a42f;_0x36a42f=_0x414f8b[_0x42f6ef][_0x1112('0x70')]?_[_0x1112('0x6f')](_0x3013c3[_0x414f8b[_0x42f6ef][_0x1112('0x70')]],'%s',_0x36a42f):_0x36a42f;if(_0x414f8b[_0x42f6ef]['groupBy']){_0x2c28c0[_0x1112('0x62')](_0x36a42f);}_0x414f8b[_0x42f6ef][_0x1112('0x72')]&&_0x2c28c0[_0x1112('0x36')](_0x36a42f,_0x414f8b[_0x42f6ef][_0x1112('0x72')]===_0x1112('0x83')?![]:!![]);_0x2c28c0[_0x1112('0x6d')](_0x36a42f,_0x414f8b[_0x42f6ef][_0x1112('0x84')]||_0x36a42f);}if(_0x2609b8[_0x1112('0x73')]){_0x2609b8[_0x1112('0x73')]=JSON['parse'](_0x2609b8[_0x1112('0x73')]);for(var _0x5abdda=0x0;_0x5abdda<_0x2609b8[_0x1112('0x73')][_0x1112('0x33')];_0x5abdda+=0x1){if(_0x2609b8['joins'][_0x5abdda]['type']&&_['includes'](_0x108079,_0x2609b8[_0x1112('0x73')][_0x5abdda][_0x1112('0x2a')])&&_0x2609b8[_0x1112('0x73')][_0x5abdda][_0x1112('0x85')]&&_0x2609b8[_0x1112('0x73')][_0x5abdda][_0x1112('0x74')]&&_0x2609b8['joins'][_0x5abdda][_0x1112('0x75')]){_0x2c28c0[_0x2609b8[_0x1112('0x73')][_0x5abdda][_0x1112('0x2a')]](_0x2609b8[_0x1112('0x73')][_0x5abdda][_0x1112('0x74')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x2609b8[_0x1112('0x76')],_0x2609b8['joins'][_0x5abdda][_0x1112('0x85')],_0x2609b8[_0x1112('0x73')][_0x5abdda][_0x1112('0x74')],_0x2609b8['joins'][_0x5abdda][_0x1112('0x75')]));}}}if(_0x2609b8[_0x1112('0x77')]){_0x2609b8[_0x1112('0x77')]=JSON[_0x1112('0x78')](_0x2609b8['conditions']);_0x2c28c0[_0x1112('0x38')](_0x17cd21(_0x2609b8[_0x1112('0x77')][_0x1112('0x62')]));}_0x1c78fc=_0x2c28c0[_0x1112('0x86')]();_0x2c28c0[_0x1112('0x18')](_0x2860d7);_0x2c28c0['offset'](0x0);return;}})['then'](function(){if(_0x1784d1[_0x1112('0x87')]===_0x1112('0x88')){return null;}var _0x510061=_[_0x1112('0x3a')](_0x1784d1,{'name':_0x1784d1[_0x1112('0x89')]||_0x1784d1[_0x1112('0x24')]||_0x2609b8[_0x1112('0x24')],'basename':_0x457010,'savename':util[_0x1112('0x70')]('%s-%s.%s',_0x1784d1[_0x1112('0x24')]||_0x2609b8['name'],require(_0x1112('0x8a'))[_0x1112('0x8b')](0x4),_0x1784d1[_0x1112('0x87')]||_0x1112('0x8c')),'reportId':_0x2609b8['id'],'reportType':_0x1112('0x8d')});return db[_0x1112('0x8e')][_0x1112('0x42')](_0x510061,{'raw':!![]});})[_0x1112('0x1d')](function(_0x513a80){if(_0x2609b8[_0x1112('0x76')]===_0x1112('0x8f')){_0x1c78fc[_0x1112('0x38')](_0x2609b8['table']+_0x1112('0x90'),_0x1784d1['startDate'],_0x1784d1[_0x1112('0x91')]);}else{_0x1c78fc[_0x1112('0x38')](_0x2609b8[_0x1112('0x76')]+_0x1112('0x92'),_0x1784d1[_0x1112('0x93')],_0x1784d1[_0x1112('0x91')]);}if(_0x513a80){logger['info'](_0x1112('0x94'),_0x1c78fc[_0x1112('0x7b')]());require(_0x1112('0x95'))[_0x1112('0x96')](path[_0x1112('0x4c')](__dirname,'../../components/export/',_0x513a80['output']),[_0x513a80['id'],_0x1c78fc[_0x1112('0x7b')](),path['join'](__dirname,_0x1112('0x97'),_0x513a80[_0x1112('0x98')]),_0x457010]);return _0x513a80;}else{var _0x470474=squel[_0x1112('0x6a')]();_0x470474[_0x1112('0x82')]('('+_0x1c78fc[_0x1112('0x7b')]()+')','countTable');_0x470474['field'](_0x1112('0x99'),_0x1112('0x19'));_0x1c78fc[_0x1112('0x18')](_0x1784d1['limit']||_0x2860d7);_0x1c78fc[_0x1112('0x16')](_0x1784d1['offset']||0x0);return dbH['sequelize'][_0x1112('0x2d')](_0x470474[_0x1112('0x7b')](),{'type':dbH[_0x1112('0x7c')][_0x1112('0x7d')][_0x1112('0x7e')]})[_0x1112('0x1d')](function(_0x2ce3bc){if(!_0x2ce3bc[_0x1112('0x33')]){_0x4ab164=0x0;}else{_0x4ab164=_0x2ce3bc[0x0][_0x1112('0x19')]||0x0;}return dbH[_0x1112('0x7c')][_0x1112('0x2d')](_0x1c78fc[_0x1112('0x7b')](),{'type':dbH[_0x1112('0x7c')]['QueryTypes'][_0x1112('0x7e')]});})[_0x1112('0x1d')](function(_0x40cc3d){return{'rows':_0x40cc3d||[],'count':_0x4ab164};});}});}exports[_0x1112('0x9a')]=function(_0x1efb43,_0x499bd5){return runReport(_0x1efb43[_0x1112('0x3e')],_0x1efb43[_0x1112('0x2d')],_0x1efb43[_0x1112('0x3b')])[_0x1112('0x1d')](respondWithResult(_0x499bd5,null))[_0x1112('0x3d')](handleError(_0x499bd5,null));};exports[_0x1112('0x9b')]=runReport;exports[_0x1112('0x2d')]=function(_0x175900,_0x8dce9a){var _0x5e2c89=0xa;var _0x27dfd8=[_0x1112('0x4c'),_0x1112('0x4d'),_0x1112('0x4e'),_0x1112('0x4f')];var _0x24e4f3={'SUM':'SUM(%s)','COUNT':_0x1112('0x51'),'COUNT DISTINCT':_0x1112('0x52'),'MAX':_0x1112('0x53'),'MIN':_0x1112('0x54'),'AVG':_0x1112('0x55'),'GROUP_CONCAT':_0x1112('0x56'),'GROUP_CONCAT ASC':_0x1112('0x57'),'GROUP_CONCAT DESC':_0x1112('0x58')};var _0x544e9d={'SEC_TO_TIME':_0x1112('0x7f'),'DATE':_0x1112('0x59'),'HOUR':_0x1112('0x5a'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x1112('0x5c')};var _0x15f8b3=function(_0x12be79){return!_[_0x1112('0x5d')]([_0x1112('0x80'),_0x1112('0x5e'),_0x1112('0x9c'),'IS\x20NOT\x20EMPTY'],_0x12be79);};var _0x2a4b26=function(_0x19d51b){if(!_0x19d51b||!_0x19d51b[_0x1112('0x60')][_0x1112('0x33')]){return'';}for(var _0x1ddc0b='(',_0x101651=0x0;_0x101651<_0x19d51b[_0x1112('0x60')]['length'];_0x101651+=0x1){_0x101651>0x0&&(_0x1ddc0b+='\x20'+_0x19d51b[_0x1112('0x61')]+'\x20');_0x1ddc0b+=_0x19d51b[_0x1112('0x60')][_0x101651][_0x1112('0x62')]?_0x2a4b26(_0x19d51b[_0x1112('0x60')][_0x101651][_0x1112('0x62')]):_0x19d51b[_0x1112('0x60')][_0x101651][_0x1112('0x6d')]+'\x20'+_0x19d51b['rules'][_0x101651][_0x1112('0x63')]+(_0x15f8b3(_0x19d51b[_0x1112('0x60')][_0x101651][_0x1112('0x63')])?'\x20'+_0x19d51b[_0x1112('0x60')][_0x101651]['value']:'');}return _0x1ddc0b+')';};var _0x3c30b={'where':{'id':_0x175900['params']['id']}},_0x2e096b,_0x5c48fc,_0x40fef3,_0x2f745b,_0x2913d5;_0x3c30b=_['merge']({},_0x3c30b,_0x175900['options']);return db[_0x1112('0x27')][_0x1112('0x41')](_0x3c30b)[_0x1112('0x1d')](function(_0x3cd264){if(_0x3cd264){_0x2e096b=_0x3cd264;return _0x3cd264[_0x1112('0x65')]();}return null;})[_0x1112('0x1d')](function(_0x161475){if(_0x161475){if(!_0x161475[_0x1112('0x33')]){throw new db[(_0x1112('0x66'))][(_0x1112('0x9d'))](_0x1112('0x81'),0x193);}_0x5c48fc=_0x161475;return db[_0x1112('0x67')][_0x1112('0x68')]({'raw':!![]});}return null;})[_0x1112('0x1d')](function(_0x450499){if(_0x450499){_0x40fef3=_[_0x1112('0x69')](_0x450499,'id');var _0x278867;var _0x21394c=squel['select']();_0x21394c[_0x1112('0x82')](_0x2e096b[_0x1112('0x76')]);for(var _0xfb64c6=0x0;_0xfb64c6<_0x5c48fc[_0x1112('0x33')];_0xfb64c6+=0x1){_0x278867=_0x5c48fc[_0xfb64c6][_0x1112('0x6b')]?_0x40fef3[_0x5c48fc[_0xfb64c6]['MetricId']]['metric']:_0x5c48fc[_0xfb64c6][_0x1112('0x6d')];_0x278867=_0x5c48fc[_0xfb64c6][_0x1112('0x6e')]?_[_0x1112('0x6f')](_0x24e4f3[_0x5c48fc[_0xfb64c6][_0x1112('0x6e')]],'%s',_0x278867):_0x278867;_0x278867=_0x5c48fc[_0xfb64c6][_0x1112('0x70')]?_[_0x1112('0x6f')](_0x544e9d[_0x5c48fc[_0xfb64c6]['format']],'%s',_0x278867):_0x278867;if(_0x5c48fc[_0xfb64c6][_0x1112('0x71')]){_0x21394c['group'](_0x278867);}_0x5c48fc[_0xfb64c6][_0x1112('0x72')]&&_0x21394c[_0x1112('0x36')](_0x278867,_0x5c48fc[_0xfb64c6]['orderBy']===_0x1112('0x83')?![]:!![]);_0x21394c['field'](_0x278867,_0x5c48fc[_0xfb64c6][_0x1112('0x84')]||_0x278867);}if(_0x2e096b[_0x1112('0x73')]){_0x2e096b[_0x1112('0x73')]=JSON[_0x1112('0x78')](_0x2e096b[_0x1112('0x73')]);for(var _0x228aa1=0x0;_0x228aa1<_0x2e096b[_0x1112('0x73')][_0x1112('0x33')];_0x228aa1+=0x1){if(_0x2e096b[_0x1112('0x73')][_0x228aa1][_0x1112('0x2a')]&&_[_0x1112('0x5d')](_0x27dfd8,_0x2e096b[_0x1112('0x73')][_0x228aa1]['type'])&&_0x2e096b['joins'][_0x228aa1][_0x1112('0x85')]&&_0x2e096b['joins'][_0x228aa1][_0x1112('0x74')]&&_0x2e096b[_0x1112('0x73')][_0x228aa1][_0x1112('0x75')]){_0x21394c[_0x2e096b[_0x1112('0x73')][_0x228aa1][_0x1112('0x2a')]](_0x2e096b[_0x1112('0x73')][_0x228aa1]['foreignTable'],null,util[_0x1112('0x70')](_0x1112('0x9e'),_0x2e096b[_0x1112('0x76')],_0x2e096b[_0x1112('0x73')][_0x228aa1]['parentKey'],_0x2e096b[_0x1112('0x73')][_0x228aa1][_0x1112('0x74')],_0x2e096b[_0x1112('0x73')][_0x228aa1][_0x1112('0x75')]));}}}if(_0x2e096b['conditions']){_0x2e096b[_0x1112('0x77')]=JSON[_0x1112('0x78')](_0x2e096b[_0x1112('0x77')]);_0x21394c[_0x1112('0x38')](_0x2a4b26(_0x2e096b[_0x1112('0x77')][_0x1112('0x62')]));}_0x2913d5=_0x21394c[_0x1112('0x86')]();_0x21394c[_0x1112('0x18')](_0x5e2c89);_0x21394c[_0x1112('0x16')](0x0);logger[_0x1112('0x79')](_0x1112('0x7a'),_0x21394c[_0x1112('0x7b')]());return dbH[_0x1112('0x7c')][_0x1112('0x2d')](_0x21394c[_0x1112('0x7b')](),{'type':dbH[_0x1112('0x7c')][_0x1112('0x7d')][_0x1112('0x7e')]});}})[_0x1112('0x1d')](function(){return{'sql':_0x2913d5[_0x1112('0x7b')]()};})['then'](respondWithResult(_0x8dce9a,null))[_0x1112('0x3d')](handleError(_0x8dce9a,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 37fb60e..c99010f 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 _0x6faf=['exports','define','analytics_custom_reports','lodash','api','moment','request-promise','path','../../config/environment'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x6faf,0x1f2));var _0xf6fa=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x6faf[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xf6fa('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf6fa('0x1'));var moment=require(_0xf6fa('0x2'));var BPromise=require('bluebird');var rp=require(_0xf6fa('0x3'));var fs=require('fs');var path=require(_0xf6fa('0x4'));var rimraf=require('rimraf');var config=require(_0xf6fa('0x5'));var attributes=require('./analyticCustomReport.attributes');module[_0xf6fa('0x6')]=function(_0x5bb903,_0x556dbd){return _0x5bb903[_0xf6fa('0x7')]('AnalyticCustomReport',attributes,{'tableName':_0xf6fa('0x8'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x041f=['../../config/environment','./analyticCustomReport.attributes','exports','analytics_custom_reports','lodash','api','moment','request-promise','path','rimraf'];(function(_0x5f3e48,_0x1fcfe7){var _0x487ea7=function(_0x389ee2){while(--_0x389ee2){_0x5f3e48['push'](_0x5f3e48['shift']());}};_0x487ea7(++_0x1fcfe7);}(_0x041f,0x144));var _0xf041=function(_0x587823,_0x4a07d9){_0x587823=_0x587823-0x0;var _0x4b456c=_0x041f[_0x587823];return _0x4b456c;};'use strict';var _=require(_0xf041('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf041('0x1'));var moment=require(_0xf041('0x2'));var BPromise=require('bluebird');var rp=require(_0xf041('0x3'));var fs=require('fs');var path=require(_0xf041('0x4'));var rimraf=require(_0xf041('0x5'));var config=require(_0xf041('0x6'));var attributes=require(_0xf041('0x7'));module[_0xf041('0x8')]=function(_0x13b067,_0x20c1e6){return _0x13b067['define']('AnalyticCustomReport',attributes,{'tableName':_0xf041('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index af60264..11831db 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 _0xc75b=['rpc','jayson/promise','client','request','then','info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','message','AnalyticCustomReport,\x20%s,\x20%s','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x10fc0e,_0x3b68d1){var _0x1f47b6=function(_0x20f622){while(--_0x20f622){_0x10fc0e['push'](_0x10fc0e['shift']());}};_0x1f47b6(++_0x3b68d1);}(_0xc75b,0xdf));var _0xbc75=function(_0x23d39d,_0x68a19f){_0x23d39d=_0x23d39d-0x0;var _0x4e0cdf=_0xc75b[_0x23d39d];return _0x4e0cdf;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbc75('0x0'));var BPromise=require(_0xbc75('0x1'));var rs=require(_0xbc75('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbc75('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xbc75('0x4'))(_0xbc75('0x5'));var config=require('../../config/environment');var jayson=require(_0xbc75('0x6'));var client=jayson[_0xbc75('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a9873,_0x1fe8c4,_0x56372f){return new BPromise(function(_0x297327,_0x34f05b){return client[_0xbc75('0x8')](_0x1a9873,_0x56372f)[_0xbc75('0x9')](function(_0x3b3cdf){logger[_0xbc75('0xa')]('AnalyticCustomReport,\x20%s,\x20%s',_0x1fe8c4,_0xbc75('0xb'));logger[_0xbc75('0xc')](_0xbc75('0xd'),_0x1fe8c4,_0xbc75('0xb'),JSON['stringify'](_0x3b3cdf));if(_0x3b3cdf[_0xbc75('0xe')]){if(_0x3b3cdf['error']['code']===0x1f4){logger[_0xbc75('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0x1fe8c4,_0x3b3cdf[_0xbc75('0xe')][_0xbc75('0xf')]);return _0x34f05b(_0x3b3cdf[_0xbc75('0xe')][_0xbc75('0xf')]);}logger[_0xbc75('0xe')](_0xbc75('0x10'),_0x1fe8c4,_0x3b3cdf[_0xbc75('0xe')][_0xbc75('0xf')]);return _0x297327(_0x3b3cdf[_0xbc75('0xe')][_0xbc75('0xf')]);}else{logger[_0xbc75('0xa')](_0xbc75('0x10'),_0x1fe8c4,'request\x20sent');_0x297327(_0x3b3cdf[_0xbc75('0x11')][_0xbc75('0xf')]);}})[_0xbc75('0x12')](function(_0x47edd4){logger['error'](_0xbc75('0x10'),_0x1fe8c4,_0x47edd4);_0x34f05b(_0x47edd4);});});}
\ No newline at end of file
+var _0x6c0c=['randomstring','ioredis','../../config/logger','rpc','jayson/promise','http','request','then','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','AnalyticCustomReport,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment'];(function(_0x5c1ef2,_0x419ad6){var _0x1600b8=function(_0x5801e9){while(--_0x5801e9){_0x5c1ef2['push'](_0x5c1ef2['shift']());}};_0x1600b8(++_0x419ad6);}(_0x6c0c,0x14d));var _0xc6c0=function(_0x5ce7a0,_0x2fccb8){_0x5ce7a0=_0x5ce7a0-0x0;var _0xc4425a=_0x6c0c[_0x5ce7a0];return _0xc4425a;};'use strict';var _=require(_0xc6c0('0x0'));var util=require(_0xc6c0('0x1'));var moment=require(_0xc6c0('0x2'));var BPromise=require('bluebird');var rs=require(_0xc6c0('0x3'));var fs=require('fs');var Redis=require(_0xc6c0('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc6c0('0x5'))(_0xc6c0('0x6'));var config=require('../../config/environment');var jayson=require(_0xc6c0('0x7'));var client=jayson['client'][_0xc6c0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3a7bc7,_0x4c56ee,_0x35c6b4){return new BPromise(function(_0x5cb1f3,_0xe5e780){return client[_0xc6c0('0x9')](_0x3a7bc7,_0x35c6b4)[_0xc6c0('0xa')](function(_0x2d2e31){logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x4c56ee,'request\x20sent');logger['debug'](_0xc6c0('0xb'),_0x4c56ee,_0xc6c0('0xc'),JSON[_0xc6c0('0xd')](_0x2d2e31));if(_0x2d2e31[_0xc6c0('0xe')]){if(_0x2d2e31[_0xc6c0('0xe')][_0xc6c0('0xf')]===0x1f4){logger[_0xc6c0('0xe')](_0xc6c0('0x10'),_0x4c56ee,_0x2d2e31[_0xc6c0('0xe')][_0xc6c0('0x11')]);return _0xe5e780(_0x2d2e31[_0xc6c0('0xe')][_0xc6c0('0x11')]);}logger[_0xc6c0('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4c56ee,_0x2d2e31[_0xc6c0('0xe')][_0xc6c0('0x11')]);return _0x5cb1f3(_0x2d2e31[_0xc6c0('0xe')][_0xc6c0('0x11')]);}else{logger[_0xc6c0('0x12')](_0xc6c0('0x10'),_0x4c56ee,_0xc6c0('0xc'));_0x5cb1f3(_0x2d2e31[_0xc6c0('0x13')][_0xc6c0('0x11')]);}})[_0xc6c0('0x14')](function(_0x583cc6){logger['error'](_0xc6c0('0x10'),_0x4c56ee,_0x583cc6);_0xe5e780(_0x583cc6);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index ad89b7e..2ae9d33 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 _0xd143=['create','put','delete','destroy','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd143,0x138));var _0x3d14=function(_0x2fb049,_0x2a4364){_0x2fb049=_0x2fb049-0x0;var _0x22af82=_0xd143[_0x2fb049];return _0x22af82;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x3d14('0x0'));var express=require('express');var router=express[_0x3d14('0x1')]();var fs_extra=require(_0x3d14('0x2'));var auth=require(_0x3d14('0x3'));var interaction=require(_0x3d14('0x4'));var config=require(_0x3d14('0x5'));var controller=require(_0x3d14('0x6'));router[_0x3d14('0x7')]('/',auth[_0x3d14('0x8')](),controller[_0x3d14('0x9')]);router[_0x3d14('0x7')](_0x3d14('0xa'),auth['isAuthenticated'](),controller[_0x3d14('0xb')]);router[_0x3d14('0x7')](_0x3d14('0xc'),auth[_0x3d14('0x8')](),controller[_0x3d14('0xd')]);router['get'](_0x3d14('0xe'),auth[_0x3d14('0x8')](),controller[_0x3d14('0xf')]);router['get'](_0x3d14('0x10'),auth['isAuthenticated'](),controller[_0x3d14('0x11')]);router['post']('/',auth[_0x3d14('0x8')](),controller[_0x3d14('0x12')]);router[_0x3d14('0x13')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x3d14('0x14')]('/:id',auth[_0x3d14('0x8')](),controller[_0x3d14('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x1dc0=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','/:id','show','get','preview','/:id/run','run','post','create','put','update','destroy','multer','util','connect-timeout','Router','fs-extra'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x1dc0,0xe2));var _0x01dc=function(_0x16651f,_0x1beebd){_0x16651f=_0x16651f-0x0;var _0x1b7748=_0x1dc0[_0x16651f];return _0x1b7748;};'use strict';var multer=require(_0x01dc('0x0'));var util=require(_0x01dc('0x1'));var path=require('path');var timeout=require(_0x01dc('0x2'));var express=require('express');var router=express[_0x01dc('0x3')]();var fs_extra=require(_0x01dc('0x4'));var auth=require(_0x01dc('0x5'));var interaction=require(_0x01dc('0x6'));var config=require(_0x01dc('0x7'));var controller=require(_0x01dc('0x8'));router['get']('/',auth[_0x01dc('0x9')](),controller['index']);router['get'](_0x01dc('0xa'),auth[_0x01dc('0x9')](),controller[_0x01dc('0xb')]);router[_0x01dc('0xc')]('/:id/preview',auth[_0x01dc('0x9')](),controller[_0x01dc('0xd')]);router[_0x01dc('0xc')](_0x01dc('0xe'),auth[_0x01dc('0x9')](),controller[_0x01dc('0xf')]);router['get']('/:id/query',auth[_0x01dc('0x9')](),controller['query']);router[_0x01dc('0x10')]('/',auth['isAuthenticated'](),controller[_0x01dc('0x11')]);router[_0x01dc('0x12')](_0x01dc('0xa'),auth['isAuthenticated'](),controller[_0x01dc('0x13')]);router['delete'](_0x01dc('0xa'),auth[_0x01dc('0x9')](),controller[_0x01dc('0x14')]);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 3f38b6c..b662ae0 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 _0x1cb9=['TEXT','sequelize','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1cb9,0x14e));var _0x91cb=function(_0x284540,_0x207799){_0x284540=_0x284540-0x0;var _0xaabefd=_0x1cb9[_0x284540];return _0xaabefd;};'use strict';var Sequelize=require(_0x91cb('0x0'));module['exports']={'name':{'type':Sequelize[_0x91cb('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x91cb('0x1')]},'parent':{'type':Sequelize[_0x91cb('0x1')]},'table':{'type':Sequelize[_0x91cb('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x91cb('0x2')]}};
\ No newline at end of file
+var _0xafc4=['sequelize','STRING','TEXT'];(function(_0x4c184d,_0x4278ab){var _0x23d997=function(_0x22d068){while(--_0x22d068){_0x4c184d['push'](_0x4c184d['shift']());}};_0x23d997(++_0x4278ab);}(_0xafc4,0x69));var _0x4afc=function(_0x3f76a8,_0x16d1bb){_0x3f76a8=_0x3f76a8-0x0;var _0x4dd90d=_0xafc4[_0x3f76a8];return _0x4dd90d;};'use strict';var Sequelize=require(_0x4afc('0x0'));module['exports']={'name':{'type':Sequelize[_0x4afc('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x4afc('0x1')]},'table':{'type':Sequelize[_0x4afc('0x1')]},'conditions':{'type':Sequelize[_0x4afc('0x2')]},'joins':{'type':Sequelize[_0x4afc('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 8e4c93e..6cce05a 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 _0x2ef3=['Sequelize','from','foreignKey','output','web','fullPath','generate','csv','cdr','startDate','endDate','info','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','runReport','IS\x20NULL','IS\x20NOT\x20EMPTY','metric','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','get','DefaultReports','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','type','key','model','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','AnalyticDefaultReport','includeAll','include','findAll','rows','catch','show','params','keys','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','autoAssociation','update','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20EMPTY','operator','rules','group','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','MetricId','field','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','conditions','parse','clone','debug','toString','sequelize','QueryTypes','SELECT','join','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x2ef3,0xba));var _0x32ef=function(_0x8670b9,_0x168af2){_0x8670b9=_0x8670b9-0x0;var _0x564460=_0x2ef3[_0x8670b9];return _0x564460;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];var dbH=require(_0x32ef('0x18'))['dbH'];function respondWithStatusCode(_0x3e98df,_0x1ef1ae){_0x1ef1ae=_0x1ef1ae||0xcc;return function(_0x5c3eb9){if(_0x5c3eb9){return _0x3e98df['sendStatus'](_0x1ef1ae);}return _0x3e98df[_0x32ef('0x19')](_0x1ef1ae)['end']();};}function respondWithResult(_0x326fce,_0x40a6e6){_0x40a6e6=_0x40a6e6||0xc8;return function(_0x93d492){if(_0x93d492){return _0x326fce[_0x32ef('0x19')](_0x40a6e6)['json'](_0x93d492);}};}function respondWithFilteredResult(_0x55bf0b,_0x531e30){return function(_0x13db1a){if(_0x13db1a){var _0x3950e6=typeof _0x531e30[_0x32ef('0x1a')]==='undefined'&&typeof _0x531e30['limit']===_0x32ef('0x1b');var _0x1a9476=_0x13db1a[_0x32ef('0x1c')];var _0x57863c=_0x3950e6?0x0:_0x531e30[_0x32ef('0x1a')];var _0x33e230=_0x3950e6?_0x13db1a['count']:_0x531e30[_0x32ef('0x1a')]+_0x531e30[_0x32ef('0x1d')];var _0x26aff3;if(_0x33e230>=_0x1a9476){_0x33e230=_0x1a9476;_0x26aff3=0xc8;}else{_0x26aff3=0xce;}_0x55bf0b[_0x32ef('0x19')](_0x26aff3);return _0x55bf0b[_0x32ef('0x1e')](_0x32ef('0x1f'),_0x57863c+'-'+_0x33e230+'/'+_0x1a9476)['json'](_0x13db1a);}return null;};}function patchUpdates(_0x3c5b78){return function(_0x5cc3ef){try{jsonpatch[_0x32ef('0x20')](_0x5cc3ef,_0x3c5b78,!![]);}catch(_0x3a20ca){return BPromise['reject'](_0x3a20ca);}return _0x5cc3ef[_0x32ef('0x21')]();};}function saveUpdates(_0x97780,_0x5e8898){return function(_0x55f7f2){if(_0x55f7f2){return _0x55f7f2['update'](_0x97780)[_0x32ef('0x22')](function(_0xb30fab){return _0xb30fab;});}return null;};}function removeEntity(_0x225feb,_0x478bef){return function(_0x59585f){if(_0x59585f){return _0x59585f[_0x32ef('0x23')]()['then'](function(){var _0x51a412=_0x59585f[_0x32ef('0x24')]({'plain':!![]});var _0x14d4b3=_0x32ef('0x25');return db[_0x32ef('0x26')][_0x32ef('0x23')]({'where':{'type':_0x14d4b3,'resourceId':_0x51a412['id']}})[_0x32ef('0x22')](function(){return _0x59585f;});})[_0x32ef('0x22')](function(){_0x225feb[_0x32ef('0x19')](0xcc)[_0x32ef('0x27')]();});}};}function handleEntityNotFound(_0x2f52d7,_0x1335e2){return function(_0xba4b3f){if(!_0xba4b3f){_0x2f52d7['sendStatus'](0x194);}return _0xba4b3f;};}function handleError(_0xd65fde,_0x2f5d06){_0x2f5d06=_0x2f5d06||0x1f4;return function(_0x5a04cd){logger[_0x32ef('0x28')](_0x5a04cd[_0x32ef('0x29')]);if(_0x5a04cd[_0x32ef('0x2a')]){delete _0x5a04cd[_0x32ef('0x2a')];}_0xd65fde['status'](_0x2f5d06)[_0x32ef('0x2b')](_0x5a04cd);};}exports[_0x32ef('0x2c')]=function(_0x31dbc3,_0x2ac686){var _0x1b668a={},_0x1a6ed2={},_0x1a122d={'count':0x0,'rows':[]};var _0x575f3e=_[_0x32ef('0x2d')](db['AnalyticDefaultReport'][_0x32ef('0x2e')],function(_0x2b6c6a){return{'name':_0x2b6c6a['fieldName'],'type':_0x2b6c6a[_0x32ef('0x2f')][_0x32ef('0x30')]};});_0x1a6ed2[_0x32ef('0x31')]=_[_0x32ef('0x2d')](_0x575f3e,_0x32ef('0x2a'));_0x1a6ed2['query']=_['keys'](_0x31dbc3[_0x32ef('0x32')]);_0x1a6ed2['filters']=_[_0x32ef('0x33')](_0x1a6ed2[_0x32ef('0x31')],_0x1a6ed2[_0x32ef('0x32')]);_0x1b668a[_0x32ef('0x34')]=_[_0x32ef('0x33')](_0x1a6ed2[_0x32ef('0x31')],qs['fields'](_0x31dbc3['query']['fields']));_0x1b668a[_0x32ef('0x34')]=_0x1b668a[_0x32ef('0x34')][_0x32ef('0x35')]?_0x1b668a['attributes']:_0x1a6ed2['model'];if(!_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x36')](_0x32ef('0x37'))){_0x1b668a['limit']=qs['limit'](_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x1d')]);_0x1b668a[_0x32ef('0x1a')]=qs[_0x32ef('0x1a')](_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x1a')]);}_0x1b668a[_0x32ef('0x38')]=qs[_0x32ef('0x39')](_0x31dbc3[_0x32ef('0x32')]['sort']);_0x1b668a[_0x32ef('0x3a')]=qs[_0x32ef('0x3b')](_[_0x32ef('0x3c')](_0x31dbc3['query'],_0x1a6ed2[_0x32ef('0x3b')]),_0x575f3e);if(_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x3d')]){_0x1b668a[_0x32ef('0x3a')]=_[_0x32ef('0x3e')](_0x1b668a[_0x32ef('0x3a')],{'$or':_[_0x32ef('0x2d')](_0x575f3e,function(_0x1cebed){if(_0x1cebed[_0x32ef('0x2f')]!==_0x32ef('0x3f')){var _0xb4db74={};_0xb4db74[_0x1cebed[_0x32ef('0x2a')]]={'$like':'%'+_0x31dbc3['query'][_0x32ef('0x3d')]+'%'};return _0xb4db74;}})});}_0x1b668a=_[_0x32ef('0x3e')]({},_0x1b668a,_0x31dbc3[_0x32ef('0x40')]);var _0x1733e3={'where':_0x1b668a[_0x32ef('0x3a')]};return db[_0x32ef('0x41')][_0x32ef('0x1c')](_0x1733e3)['then'](function(_0x538758){_0x1a122d[_0x32ef('0x1c')]=_0x538758;if(_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x42')]){_0x1b668a[_0x32ef('0x43')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x32ef('0x44')](_0x1b668a);})[_0x32ef('0x22')](function(_0x5d2f06){_0x1a122d[_0x32ef('0x45')]=_0x5d2f06;return _0x1a122d;})['then'](respondWithFilteredResult(_0x2ac686,_0x1b668a))[_0x32ef('0x46')](handleError(_0x2ac686,null));};exports[_0x32ef('0x47')]=function(_0x37a497,_0x3be46d){var _0x2c2b62={'raw':!![],'where':{'id':_0x37a497[_0x32ef('0x48')]['id']}},_0x2310ae={};_0x2310ae[_0x32ef('0x31')]=_[_0x32ef('0x49')](db[_0x32ef('0x41')]['rawAttributes']);_0x2310ae[_0x32ef('0x32')]=_['keys'](_0x37a497[_0x32ef('0x32')]);_0x2310ae[_0x32ef('0x3b')]=_[_0x32ef('0x33')](_0x2310ae['model'],_0x2310ae[_0x32ef('0x32')]);_0x2c2b62[_0x32ef('0x34')]=_[_0x32ef('0x33')](_0x2310ae[_0x32ef('0x31')],qs[_0x32ef('0x4a')](_0x37a497[_0x32ef('0x32')][_0x32ef('0x4a')]));_0x2c2b62['attributes']=_0x2c2b62['attributes'][_0x32ef('0x35')]?_0x2c2b62[_0x32ef('0x34')]:_0x2310ae[_0x32ef('0x31')];if(_0x37a497[_0x32ef('0x32')][_0x32ef('0x42')]){_0x2c2b62[_0x32ef('0x43')]=[{'all':!![]}];}_0x2c2b62=_[_0x32ef('0x3e')]({},_0x2c2b62,_0x37a497[_0x32ef('0x40')]);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x2c2b62)[_0x32ef('0x22')](handleEntityNotFound(_0x3be46d,null))[_0x32ef('0x22')](respondWithResult(_0x3be46d,null))[_0x32ef('0x46')](handleError(_0x3be46d,null));};exports['create']=function(_0x420f00,_0x12fbd7){return db[_0x32ef('0x41')][_0x32ef('0x4c')](_0x420f00[_0x32ef('0x4d')],{})[_0x32ef('0x22')](function(_0x278696){var _0x1acded=_0x420f00[_0x32ef('0x4e')][_0x32ef('0x24')]({'plain':!![]});if(!_0x1acded)throw new Error(_0x32ef('0x4f'));if(_0x1acded[_0x32ef('0x50')]===_0x32ef('0x4e')){var _0x326445=_0x278696[_0x32ef('0x24')]({'plain':!![]});var _0x3fb4d8=_0x32ef('0x51');return db[_0x32ef('0x52')]['find']({'where':{'name':_0x3fb4d8,'userProfileId':_0x1acded['userProfileId']},'raw':!![]})[_0x32ef('0x22')](function(_0x259c32){if(_0x259c32&&_0x259c32[_0x32ef('0x53')]===0x0){return db[_0x32ef('0x26')][_0x32ef('0x4c')]({'name':_0x326445[_0x32ef('0x2a')],'resourceId':_0x326445['id'],'type':_0x32ef('0x25'),'sectionId':_0x259c32['id']},{})[_0x32ef('0x22')](function(){return _0x278696;});}else{return _0x278696;}})[_0x32ef('0x46')](function(_0x368bf1){logger[_0x32ef('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x368bf1);throw _0x368bf1;});}return _0x278696;})[_0x32ef('0x22')](respondWithResult(_0x12fbd7,0xc9))[_0x32ef('0x46')](handleError(_0x12fbd7,null));};exports[_0x32ef('0x54')]=function(_0x3fe01f,_0x38314a){if(_0x3fe01f[_0x32ef('0x4d')]['id']){delete _0x3fe01f['body']['id'];}return db[_0x32ef('0x41')][_0x32ef('0x4b')]({'where':{'id':_0x3fe01f[_0x32ef('0x48')]['id']}})['then'](handleEntityNotFound(_0x38314a,null))[_0x32ef('0x22')](saveUpdates(_0x3fe01f['body'],null))[_0x32ef('0x22')](respondWithResult(_0x38314a,null))[_0x32ef('0x46')](handleError(_0x38314a,null));};exports['destroy']=function(_0x206ad5,_0x59e5f9){return db[_0x32ef('0x41')][_0x32ef('0x4b')]({'where':{'id':_0x206ad5[_0x32ef('0x48')]['id']}})[_0x32ef('0x22')](handleEntityNotFound(_0x59e5f9,null))[_0x32ef('0x22')](removeEntity(_0x59e5f9,null))[_0x32ef('0x46')](handleError(_0x59e5f9,null));};exports[_0x32ef('0x55')]=function(_0x56260f,_0x56cc75){var _0xdfa103=0xa;var _0x52232a=['join',_0x32ef('0x56'),_0x32ef('0x57'),_0x32ef('0x58')];var _0x6aae59={'SUM':_0x32ef('0x59'),'COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':_0x32ef('0x5d'),'AVG':_0x32ef('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x32ef('0x5f')};var _0xbd059e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2ac877=function(_0x3c31d0){return!_[_0x32ef('0x63')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x32ef('0x64'),'IS\x20NOT\x20EMPTY'],_0x3c31d0);};var _0x17f447=function(_0x5bb114){if(!_0x5bb114||!_0x5bb114['rules'][_0x32ef('0x35')]){return'';}for(var _0x208989='(',_0x10cb37=0x0;_0x10cb37<_0x5bb114['rules'][_0x32ef('0x35')];_0x10cb37+=0x1){_0x10cb37>0x0&&(_0x208989+='\x20'+_0x5bb114[_0x32ef('0x65')]+'\x20');_0x208989+=_0x5bb114[_0x32ef('0x66')][_0x10cb37]['group']?_0x17f447(_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x67')]):_0x5bb114['rules'][_0x10cb37]['field']+'\x20'+_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x68')]+(_0x2ac877(_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x68')])?'\x20'+_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x69')]:'');}return _0x208989+')';};var _0x4c89e8={'where':{'id':_0x56260f[_0x32ef('0x48')]['id']}},_0x285330,_0x63b65,_0x25b6d6,_0x36ed97,_0x21e930;_0x4c89e8=_[_0x32ef('0x3e')]({},_0x4c89e8,_0x56260f[_0x32ef('0x40')]);return db[_0x32ef('0x41')]['find'](_0x4c89e8)[_0x32ef('0x22')](function(_0x29ff58){if(_0x29ff58){_0x285330=_0x29ff58;return _0x29ff58[_0x32ef('0x6a')]();}return null;})[_0x32ef('0x22')](function(_0x79ae28){if(_0x79ae28){if(!_0x79ae28['length']){throw new db['Sequelize'][(_0x32ef('0x6b'))](_0x32ef('0x6c'),0x193);}_0x63b65=_0x79ae28;return db[_0x32ef('0x6d')][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x526fb1){if(_0x526fb1){_0x25b6d6=_[_0x32ef('0x6e')](_0x526fb1,'id');var _0x544045;var _0x216e2f=squel[_0x32ef('0x6f')]();_0x216e2f['from'](_0x285330['table']);for(var _0x2c9f7a=0x0;_0x2c9f7a<_0x63b65[_0x32ef('0x35')];_0x2c9f7a+=0x1){_0x544045=_0x63b65[_0x2c9f7a][_0x32ef('0x70')]?_0x25b6d6[_0x63b65[_0x2c9f7a]['MetricId']]['metric']:_0x63b65[_0x2c9f7a][_0x32ef('0x71')];_0x544045=_0x63b65[_0x2c9f7a][_0x32ef('0x72')]?_[_0x32ef('0x73')](_0x6aae59[_0x63b65[_0x2c9f7a][_0x32ef('0x72')]],'%s',_0x544045):_0x544045;_0x544045=_0x63b65[_0x2c9f7a]['format']?_[_0x32ef('0x73')](_0xbd059e[_0x63b65[_0x2c9f7a][_0x32ef('0x74')]],'%s',_0x544045):_0x544045;if(_0x63b65[_0x2c9f7a][_0x32ef('0x75')]){_0x216e2f[_0x32ef('0x67')](_0x544045);}_0x63b65[_0x2c9f7a][_0x32ef('0x76')]&&_0x216e2f[_0x32ef('0x38')](_0x544045,_0x63b65[_0x2c9f7a][_0x32ef('0x76')]===_0x32ef('0x77')?![]:!![]);_0x216e2f[_0x32ef('0x71')](_0x544045,_0x63b65[_0x2c9f7a][_0x32ef('0x78')]||_0x544045);}if(_0x285330[_0x32ef('0x79')]){_0x285330[_0x32ef('0x79')]=JSON['parse'](_0x285330['joins']);for(var _0x3a9c97=0x0;_0x3a9c97<_0x285330[_0x32ef('0x79')]['length'];_0x3a9c97+=0x1){if(_0x285330[_0x32ef('0x79')][_0x3a9c97]['type']&&_[_0x32ef('0x63')](_0x52232a,_0x285330[_0x32ef('0x79')][_0x3a9c97][_0x32ef('0x2f')])&&_0x285330['joins'][_0x3a9c97][_0x32ef('0x7a')]&&_0x285330['joins'][_0x3a9c97][_0x32ef('0x7b')]&&_0x285330[_0x32ef('0x79')][_0x3a9c97]['foreignKey']){_0x216e2f[_0x285330['joins'][_0x3a9c97][_0x32ef('0x2f')]](_0x285330['joins'][_0x3a9c97][_0x32ef('0x7b')],null,util['format'](_0x32ef('0x7c'),_0x285330[_0x32ef('0x7d')],_0x285330[_0x32ef('0x79')][_0x3a9c97]['parentKey'],_0x285330['joins'][_0x3a9c97]['foreignTable'],_0x285330[_0x32ef('0x79')][_0x3a9c97]['foreignKey']));}}}if(_0x285330[_0x32ef('0x7e')]){_0x285330[_0x32ef('0x7e')]=JSON[_0x32ef('0x7f')](_0x285330[_0x32ef('0x7e')]);_0x216e2f[_0x32ef('0x3a')](_0x17f447(_0x285330[_0x32ef('0x7e')]['group']));}_0x21e930=_0x216e2f[_0x32ef('0x80')]();_0x216e2f['limit'](_0xdfa103);_0x216e2f['offset'](0x0);logger[_0x32ef('0x81')]('Limited\x20Query:',_0x216e2f[_0x32ef('0x82')]());return dbH[_0x32ef('0x83')]['query'](_0x216e2f[_0x32ef('0x82')](),{'type':dbH[_0x32ef('0x83')][_0x32ef('0x84')][_0x32ef('0x85')]});}})[_0x32ef('0x22')](respondWithResult(_0x56cc75,null))[_0x32ef('0x46')](handleError(_0x56cc75,null));};function runReport(_0x4b5506,_0x51736f,_0x35b10d){var _0x5e0b55=_0x51736f[_0x32ef('0x2a')];var _0x266688=0xa;var _0x114d8e=[_0x32ef('0x86'),_0x32ef('0x56'),_0x32ef('0x57'),'cross_join'];var _0x3232ca={'SUM':_0x32ef('0x59'),'COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x32ef('0x87'),'GROUP_CONCAT ASC':_0x32ef('0x88'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x211fb1={'SEC_TO_TIME':_0x32ef('0x89'),'DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':_0x32ef('0x8a')};var _0xfb4845=function(_0x21067e){return!_[_0x32ef('0x63')](['IS\x20NULL',_0x32ef('0x8b'),_0x32ef('0x64'),'IS\x20NOT\x20EMPTY'],_0x21067e);};var _0x35653b=function(_0x5ea727){if(!_0x5ea727||!_0x5ea727[_0x32ef('0x66')]['length']){return'';}for(var _0x43f36e='(',_0x39300f=0x0;_0x39300f<_0x5ea727[_0x32ef('0x66')][_0x32ef('0x35')];_0x39300f+=0x1){_0x39300f>0x0&&(_0x43f36e+='\x20'+_0x5ea727['operator']+'\x20');_0x43f36e+=_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x67')]?_0x35653b(_0x5ea727[_0x32ef('0x66')][_0x39300f]['group']):_0x5ea727['rules'][_0x39300f]['field']+'\x20'+_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x68')]+(_0xfb4845(_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x68')])?'\x20'+_0x5ea727[_0x32ef('0x66')][_0x39300f]['value']:'');}return _0x43f36e+')';};var _0x2678e3={'where':{'id':_0x4b5506['id']}},_0x5b3deb,_0x471de6,_0x7b0ea5,_0xc43e1,_0x4baa7a;_0x2678e3=_[_0x32ef('0x3e')]({},_0x2678e3,_0x35b10d);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x2678e3)[_0x32ef('0x22')](function(_0x28bebb){if(_0x28bebb){_0x5b3deb=_0x28bebb;return _0x28bebb['getFields']();}return null;})[_0x32ef('0x22')](function(_0x484df0){if(_0x484df0){if(!_0x484df0[_0x32ef('0x35')]){throw new db[(_0x32ef('0x8c'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x471de6=_0x484df0;return db[_0x32ef('0x6d')][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x3b9896){if(_0x3b9896){_0x7b0ea5=_['keyBy'](_0x3b9896,'id');var _0x356fd4;var _0x51ca6e=squel['select']();_0x51ca6e[_0x32ef('0x8d')](_0x5b3deb['table']);for(var _0x2237cf=0x0;_0x2237cf<_0x471de6[_0x32ef('0x35')];_0x2237cf+=0x1){_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x70')]?_0x7b0ea5[_0x471de6[_0x2237cf]['MetricId']]['metric']:_0x471de6[_0x2237cf][_0x32ef('0x71')];_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x72')]?_[_0x32ef('0x73')](_0x3232ca[_0x471de6[_0x2237cf][_0x32ef('0x72')]],'%s',_0x356fd4):_0x356fd4;_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x74')]?_[_0x32ef('0x73')](_0x211fb1[_0x471de6[_0x2237cf][_0x32ef('0x74')]],'%s',_0x356fd4):_0x356fd4;if(_0x471de6[_0x2237cf]['groupBy']){_0x51ca6e[_0x32ef('0x67')](_0x356fd4);}_0x471de6[_0x2237cf][_0x32ef('0x76')]&&_0x51ca6e[_0x32ef('0x38')](_0x356fd4,_0x471de6[_0x2237cf][_0x32ef('0x76')]==='DESC'?![]:!![]);_0x51ca6e['field'](_0x356fd4,_0x471de6[_0x2237cf][_0x32ef('0x78')]||_0x356fd4);}if(_0x5b3deb['joins']){_0x5b3deb[_0x32ef('0x79')]=JSON[_0x32ef('0x7f')](_0x5b3deb['joins']);for(var _0x5c7594=0x0;_0x5c7594<_0x5b3deb['joins'][_0x32ef('0x35')];_0x5c7594+=0x1){if(_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x2f')]&&_[_0x32ef('0x63')](_0x114d8e,_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x2f')])&&_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7a')]&&_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x7b')]&&_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x8e')]){_0x51ca6e[_0x5b3deb[_0x32ef('0x79')][_0x5c7594]['type']](_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x7b')],null,util[_0x32ef('0x74')](_0x32ef('0x7c'),_0x5b3deb[_0x32ef('0x7d')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7a')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7b')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594]['foreignKey']));}}}if(_0x5b3deb[_0x32ef('0x7e')]){_0x5b3deb['conditions']=JSON[_0x32ef('0x7f')](_0x5b3deb[_0x32ef('0x7e')]);_0x51ca6e[_0x32ef('0x3a')](_0x35653b(_0x5b3deb[_0x32ef('0x7e')][_0x32ef('0x67')]));}_0x4baa7a=_0x51ca6e['clone']();_0x51ca6e[_0x32ef('0x1d')](_0x266688);_0x51ca6e[_0x32ef('0x1a')](0x0);return;}})[_0x32ef('0x22')](function(){if(_0x51736f[_0x32ef('0x8f')]===_0x32ef('0x90')){return null;}var _0x1cfdd8=_[_0x32ef('0x3e')](_0x51736f,{'name':_0x51736f[_0x32ef('0x91')]||_0x51736f[_0x32ef('0x2a')]||_0x5b3deb['name'],'basename':_0x5e0b55,'savename':util['format']('%s-%s.%s',_0x51736f[_0x32ef('0x2a')]||_0x5b3deb[_0x32ef('0x2a')],require('randomstring')[_0x32ef('0x92')](0x4),_0x51736f['output']||_0x32ef('0x93')),'reportId':_0x5b3deb['id'],'reportType':'default'});return db['AnalyticExtractedReport'][_0x32ef('0x4c')](_0x1cfdd8,{'raw':!![]});})[_0x32ef('0x22')](function(_0x118d2e){if(_0x5b3deb[_0x32ef('0x7d')]===_0x32ef('0x94')){_0x4baa7a['where'](_0x5b3deb[_0x32ef('0x7d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x51736f[_0x32ef('0x95')],_0x51736f['endDate']);}else{_0x4baa7a['where'](_0x5b3deb['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x51736f['startDate'],_0x51736f[_0x32ef('0x96')]);}if(_0x118d2e){logger[_0x32ef('0x97')]('Run\x20Query:',_0x4baa7a[_0x32ef('0x82')]());require(_0x32ef('0x98'))[_0x32ef('0x99')](path[_0x32ef('0x86')](__dirname,_0x32ef('0x9a'),_0x118d2e[_0x32ef('0x8f')]),[_0x118d2e['id'],_0x4baa7a['toString'](),path[_0x32ef('0x86')](__dirname,'../../files/reports',_0x118d2e[_0x32ef('0x9b')]),_0x5e0b55]);return _0x118d2e;}else{var _0x1be713=squel['select']();_0x1be713[_0x32ef('0x8d')]('('+_0x4baa7a['toString']()+')',_0x32ef('0x9c'));_0x1be713[_0x32ef('0x71')](_0x32ef('0x9d'),_0x32ef('0x1c'));_0x4baa7a['limit'](_0x51736f[_0x32ef('0x1d')]||_0x266688);_0x4baa7a[_0x32ef('0x1a')](_0x51736f[_0x32ef('0x1a')]||0x0);return dbH[_0x32ef('0x83')]['query'](_0x1be713[_0x32ef('0x82')](),{'type':dbH['sequelize'][_0x32ef('0x84')][_0x32ef('0x85')]})[_0x32ef('0x22')](function(_0x28ef17){if(!_0x28ef17[_0x32ef('0x35')]){_0xc43e1=0x0;}else{_0xc43e1=_0x28ef17[0x0][_0x32ef('0x1c')]||0x0;}return dbH['sequelize'][_0x32ef('0x32')](_0x4baa7a['toString'](),{'type':dbH['sequelize'][_0x32ef('0x84')][_0x32ef('0x85')]});})[_0x32ef('0x22')](function(_0x3956e7){return{'rows':_0x3956e7||[],'count':_0xc43e1};});}});}exports['run']=function(_0x8d3b24,_0x642716){return runReport(_0x8d3b24[_0x32ef('0x48')],_0x8d3b24[_0x32ef('0x32')],_0x8d3b24['options'])['then'](respondWithResult(_0x642716,null))['catch'](handleError(_0x642716,null));};exports[_0x32ef('0x9e')]=runReport;exports[_0x32ef('0x32')]=function(_0x4454f3,_0xc92dcc){var _0x3d18b9=0xa;var _0x9233cb=[_0x32ef('0x86'),_0x32ef('0x56'),_0x32ef('0x57'),_0x32ef('0x58')];var _0xa76912={'SUM':'SUM(%s)','COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':_0x32ef('0x5d'),'AVG':_0x32ef('0x5e'),'GROUP_CONCAT':_0x32ef('0x87'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x32ef('0x5f')};var _0x1526a1={'SEC_TO_TIME':_0x32ef('0x89'),'DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':_0x32ef('0x8a')};var _0x2d4d2f=function(_0x292488){return!_[_0x32ef('0x63')]([_0x32ef('0x9f'),_0x32ef('0x8b'),_0x32ef('0x64'),_0x32ef('0xa0')],_0x292488);};var _0x50b674=function(_0x379d40){if(!_0x379d40||!_0x379d40[_0x32ef('0x66')][_0x32ef('0x35')]){return'';}for(var _0x4b7a4d='(',_0x16525b=0x0;_0x16525b<_0x379d40['rules'][_0x32ef('0x35')];_0x16525b+=0x1){_0x16525b>0x0&&(_0x4b7a4d+='\x20'+_0x379d40[_0x32ef('0x65')]+'\x20');_0x4b7a4d+=_0x379d40[_0x32ef('0x66')][_0x16525b]['group']?_0x50b674(_0x379d40[_0x32ef('0x66')][_0x16525b]['group']):_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x71')]+'\x20'+_0x379d40['rules'][_0x16525b][_0x32ef('0x68')]+(_0x2d4d2f(_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x68')])?'\x20'+_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x69')]:'');}return _0x4b7a4d+')';};var _0x264075={'where':{'id':_0x4454f3[_0x32ef('0x48')]['id']}},_0x3798d1,_0x4befa9,_0x493ae9,_0x143d39,_0x497948;_0x264075=_[_0x32ef('0x3e')]({},_0x264075,_0x4454f3['options']);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x264075)['then'](function(_0x1200c9){if(_0x1200c9){_0x3798d1=_0x1200c9;return _0x1200c9[_0x32ef('0x6a')]();}return null;})[_0x32ef('0x22')](function(_0xa5f787){if(_0xa5f787){if(!_0xa5f787[_0x32ef('0x35')]){throw new db['Sequelize'][(_0x32ef('0x6b'))](_0x32ef('0x6c'),0x193);}_0x4befa9=_0xa5f787;return db['AnalyticMetric'][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x55ad11){if(_0x55ad11){_0x493ae9=_[_0x32ef('0x6e')](_0x55ad11,'id');var _0x2971a8;var _0x522c22=squel[_0x32ef('0x6f')]();_0x522c22[_0x32ef('0x8d')](_0x3798d1['table']);for(var _0xb41a01=0x0;_0xb41a01<_0x4befa9[_0x32ef('0x35')];_0xb41a01+=0x1){_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x70')]?_0x493ae9[_0x4befa9[_0xb41a01][_0x32ef('0x70')]][_0x32ef('0xa1')]:_0x4befa9[_0xb41a01][_0x32ef('0x71')];_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x72')]?_['replace'](_0xa76912[_0x4befa9[_0xb41a01]['function']],'%s',_0x2971a8):_0x2971a8;_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x74')]?_[_0x32ef('0x73')](_0x1526a1[_0x4befa9[_0xb41a01][_0x32ef('0x74')]],'%s',_0x2971a8):_0x2971a8;if(_0x4befa9[_0xb41a01]['groupBy']){_0x522c22[_0x32ef('0x67')](_0x2971a8);}_0x4befa9[_0xb41a01][_0x32ef('0x76')]&&_0x522c22['order'](_0x2971a8,_0x4befa9[_0xb41a01][_0x32ef('0x76')]===_0x32ef('0x77')?![]:!![]);_0x522c22['field'](_0x2971a8,_0x4befa9[_0xb41a01]['alias']||_0x2971a8);}if(_0x3798d1[_0x32ef('0x79')]){_0x3798d1[_0x32ef('0x79')]=JSON[_0x32ef('0x7f')](_0x3798d1['joins']);for(var _0x5f4eab=0x0;_0x5f4eab<_0x3798d1['joins'][_0x32ef('0x35')];_0x5f4eab+=0x1){if(_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x2f')]&&_['includes'](_0x9233cb,_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x2f')])&&_0x3798d1[_0x32ef('0x79')][_0x5f4eab]['parentKey']&&_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')]&&_0x3798d1['joins'][_0x5f4eab]['foreignKey']){_0x522c22[_0x3798d1[_0x32ef('0x79')][_0x5f4eab]['type']](_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3798d1[_0x32ef('0x7d')],_0x3798d1['joins'][_0x5f4eab][_0x32ef('0x7a')],_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')],_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x8e')]));}}}if(_0x3798d1[_0x32ef('0x7e')]){_0x3798d1[_0x32ef('0x7e')]=JSON[_0x32ef('0x7f')](_0x3798d1[_0x32ef('0x7e')]);_0x522c22[_0x32ef('0x3a')](_0x50b674(_0x3798d1['conditions']['group']));}_0x497948=_0x522c22[_0x32ef('0x80')]();_0x522c22[_0x32ef('0x1d')](_0x3d18b9);_0x522c22[_0x32ef('0x1a')](0x0);logger[_0x32ef('0x81')](_0x32ef('0xa2'),_0x522c22[_0x32ef('0x82')]());return dbH[_0x32ef('0x83')][_0x32ef('0x32')](_0x522c22[_0x32ef('0x82')](),{'type':dbH[_0x32ef('0x83')]['QueryTypes'][_0x32ef('0x85')]});}})[_0x32ef('0x22')](function(){return{'sql':_0x497948[_0x32ef('0x82')]()};})[_0x32ef('0x22')](respondWithResult(_0xc92dcc,null))[_0x32ef('0x46')](handleError(_0xc92dcc,null));};
\ No newline at end of file
+var _0x5fab=['debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(DISTINCT\x20%s)','from','function','order','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','run','params','runReport','AVG(%s)','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','end','limit','undefined','count','offset','Content-Range','apply','save','update','then','destroy','get','DefaultReports','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','query','where','pick','filters','filter','VIRTUAL','merge','options','include','findAll','rows','catch','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone'];(function(_0x590b95,_0x4c93de){var _0x1aa83f=function(_0x5cb8be){while(--_0x5cb8be){_0x590b95['push'](_0x590b95['shift']());}};_0x1aa83f(++_0x4c93de);}(_0x5fab,0x177));var _0xb5fa=function(_0x11ead2,_0x70de8a){_0x11ead2=_0x11ead2-0x0;var _0x3cac96=_0x5fab[_0x11ead2];return _0x3cac96;};'use strict';var emlformat=require(_0xb5fa('0x0'));var rimraf=require(_0xb5fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb5fa('0x2'));var rp=require(_0xb5fa('0x3'));var moment=require(_0xb5fa('0x4'));var BPromise=require(_0xb5fa('0x5'));var Mustache=require(_0xb5fa('0x6'));var util=require(_0xb5fa('0x7'));var path=require(_0xb5fa('0x8'));var sox=require(_0xb5fa('0x9'));var csv=require(_0xb5fa('0xa'));var ejs=require(_0xb5fa('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb5fa('0xc'));var crypto=require(_0xb5fa('0xd'));var jsforce=require(_0xb5fa('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb5fa('0xa'));var querystring=require(_0xb5fa('0xf'));var Papa=require(_0xb5fa('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb5fa('0x11'));var as=require(_0xb5fa('0x12'));var hardwareService=require(_0xb5fa('0x13'));var logger=require(_0xb5fa('0x14'))(_0xb5fa('0x15'));var utils=require(_0xb5fa('0x16'));var config=require(_0xb5fa('0x17'));var licenseUtil=require(_0xb5fa('0x18'));var db=require(_0xb5fa('0x19'))['db'];var dbH=require('../../mysqldb')[_0xb5fa('0x1a')];function respondWithStatusCode(_0x3dad4d,_0x56e8b0){_0x56e8b0=_0x56e8b0||0xcc;return function(_0x116849){if(_0x116849){return _0x3dad4d['sendStatus'](_0x56e8b0);}return _0x3dad4d[_0xb5fa('0x1b')](_0x56e8b0)[_0xb5fa('0x1c')]();};}function respondWithResult(_0x40c914,_0xca8d82){_0xca8d82=_0xca8d82||0xc8;return function(_0x8e9d1c){if(_0x8e9d1c){return _0x40c914['status'](_0xca8d82)['json'](_0x8e9d1c);}};}function respondWithFilteredResult(_0x38e964,_0x587043){return function(_0x31f252){if(_0x31f252){var _0x27c8f7=typeof _0x587043['offset']==='undefined'&&typeof _0x587043[_0xb5fa('0x1d')]===_0xb5fa('0x1e');var _0x32e9e5=_0x31f252[_0xb5fa('0x1f')];var _0x324ba5=_0x27c8f7?0x0:_0x587043[_0xb5fa('0x20')];var _0x3b0f69=_0x27c8f7?_0x31f252[_0xb5fa('0x1f')]:_0x587043[_0xb5fa('0x20')]+_0x587043[_0xb5fa('0x1d')];var _0x3c8d53;if(_0x3b0f69>=_0x32e9e5){_0x3b0f69=_0x32e9e5;_0x3c8d53=0xc8;}else{_0x3c8d53=0xce;}_0x38e964[_0xb5fa('0x1b')](_0x3c8d53);return _0x38e964['set'](_0xb5fa('0x21'),_0x324ba5+'-'+_0x3b0f69+'/'+_0x32e9e5)['json'](_0x31f252);}return null;};}function patchUpdates(_0x37ae06){return function(_0x4a6c04){try{jsonpatch[_0xb5fa('0x22')](_0x4a6c04,_0x37ae06,!![]);}catch(_0x43c09f){return BPromise['reject'](_0x43c09f);}return _0x4a6c04[_0xb5fa('0x23')]();};}function saveUpdates(_0x3a2ab9,_0x283a56){return function(_0x47f71a){if(_0x47f71a){return _0x47f71a[_0xb5fa('0x24')](_0x3a2ab9)[_0xb5fa('0x25')](function(_0x444237){return _0x444237;});}return null;};}function removeEntity(_0x542348,_0x224ec8){return function(_0x5d55f7){if(_0x5d55f7){return _0x5d55f7[_0xb5fa('0x26')]()[_0xb5fa('0x25')](function(){var _0x11053a=_0x5d55f7[_0xb5fa('0x27')]({'plain':!![]});var _0x2dbd22=_0xb5fa('0x28');return db[_0xb5fa('0x29')][_0xb5fa('0x26')]({'where':{'type':_0x2dbd22,'resourceId':_0x11053a['id']}})['then'](function(){return _0x5d55f7;});})['then'](function(){_0x542348['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x28a350,_0x460b54){return function(_0x12c0d4){if(!_0x12c0d4){_0x28a350[_0xb5fa('0x2a')](0x194);}return _0x12c0d4;};}function handleError(_0x534884,_0x3506a4){_0x3506a4=_0x3506a4||0x1f4;return function(_0x358549){logger[_0xb5fa('0x2b')](_0x358549[_0xb5fa('0x2c')]);if(_0x358549[_0xb5fa('0x2d')]){delete _0x358549[_0xb5fa('0x2d')];}_0x534884[_0xb5fa('0x1b')](_0x3506a4)[_0xb5fa('0x2e')](_0x358549);};}exports[_0xb5fa('0x2f')]=function(_0xed02e,_0x116773){var _0x5a0152={},_0x3fd1fb={},_0x21fc7e={'count':0x0,'rows':[]};var _0x319c48=_[_0xb5fa('0x30')](db[_0xb5fa('0x31')][_0xb5fa('0x32')],function(_0x25fc7c){return{'name':_0x25fc7c['fieldName'],'type':_0x25fc7c[_0xb5fa('0x33')]['key']};});_0x3fd1fb['model']=_['map'](_0x319c48,_0xb5fa('0x2d'));_0x3fd1fb['query']=_[_0xb5fa('0x34')](_0xed02e['query']);_0x3fd1fb['filters']=_[_0xb5fa('0x35')](_0x3fd1fb[_0xb5fa('0x36')],_0x3fd1fb['query']);_0x5a0152['attributes']=_[_0xb5fa('0x35')](_0x3fd1fb[_0xb5fa('0x36')],qs[_0xb5fa('0x37')](_0xed02e['query'][_0xb5fa('0x37')]));_0x5a0152[_0xb5fa('0x38')]=_0x5a0152['attributes'][_0xb5fa('0x39')]?_0x5a0152[_0xb5fa('0x38')]:_0x3fd1fb[_0xb5fa('0x36')];if(!_0xed02e['query'][_0xb5fa('0x3a')](_0xb5fa('0x3b'))){_0x5a0152[_0xb5fa('0x1d')]=qs['limit'](_0xed02e[_0xb5fa('0x3c')][_0xb5fa('0x1d')]);_0x5a0152[_0xb5fa('0x20')]=qs[_0xb5fa('0x20')](_0xed02e['query']['offset']);}_0x5a0152['order']=qs['sort'](_0xed02e['query']['sort']);_0x5a0152[_0xb5fa('0x3d')]=qs['filters'](_[_0xb5fa('0x3e')](_0xed02e[_0xb5fa('0x3c')],_0x3fd1fb[_0xb5fa('0x3f')]),_0x319c48);if(_0xed02e[_0xb5fa('0x3c')][_0xb5fa('0x40')]){_0x5a0152[_0xb5fa('0x3d')]=_['merge'](_0x5a0152['where'],{'$or':_['map'](_0x319c48,function(_0x534b38){if(_0x534b38['type']!==_0xb5fa('0x41')){var _0x5addd5={};_0x5addd5[_0x534b38['name']]={'$like':'%'+_0xed02e[_0xb5fa('0x3c')][_0xb5fa('0x40')]+'%'};return _0x5addd5;}})});}_0x5a0152=_[_0xb5fa('0x42')]({},_0x5a0152,_0xed02e[_0xb5fa('0x43')]);var _0x5bc93f={'where':_0x5a0152[_0xb5fa('0x3d')]};return db[_0xb5fa('0x31')][_0xb5fa('0x1f')](_0x5bc93f)[_0xb5fa('0x25')](function(_0x402a68){_0x21fc7e['count']=_0x402a68;if(_0xed02e[_0xb5fa('0x3c')]['includeAll']){_0x5a0152[_0xb5fa('0x44')]=[{'all':!![]}];}return db[_0xb5fa('0x31')][_0xb5fa('0x45')](_0x5a0152);})[_0xb5fa('0x25')](function(_0x1c706b){_0x21fc7e[_0xb5fa('0x46')]=_0x1c706b;return _0x21fc7e;})[_0xb5fa('0x25')](respondWithFilteredResult(_0x116773,_0x5a0152))[_0xb5fa('0x47')](handleError(_0x116773,null));};exports['show']=function(_0x1c3c2c,_0xc03e44){var _0x59ae64={'raw':!![],'where':{'id':_0x1c3c2c['params']['id']}},_0x293c19={};_0x293c19[_0xb5fa('0x36')]=_[_0xb5fa('0x34')](db['AnalyticDefaultReport']['rawAttributes']);_0x293c19[_0xb5fa('0x3c')]=_[_0xb5fa('0x34')](_0x1c3c2c[_0xb5fa('0x3c')]);_0x293c19[_0xb5fa('0x3f')]=_[_0xb5fa('0x35')](_0x293c19[_0xb5fa('0x36')],_0x293c19[_0xb5fa('0x3c')]);_0x59ae64[_0xb5fa('0x38')]=_['intersection'](_0x293c19[_0xb5fa('0x36')],qs[_0xb5fa('0x37')](_0x1c3c2c['query'][_0xb5fa('0x37')]));_0x59ae64[_0xb5fa('0x38')]=_0x59ae64[_0xb5fa('0x38')][_0xb5fa('0x39')]?_0x59ae64[_0xb5fa('0x38')]:_0x293c19[_0xb5fa('0x36')];if(_0x1c3c2c[_0xb5fa('0x3c')][_0xb5fa('0x48')]){_0x59ae64[_0xb5fa('0x44')]=[{'all':!![]}];}_0x59ae64=_[_0xb5fa('0x42')]({},_0x59ae64,_0x1c3c2c[_0xb5fa('0x43')]);return db[_0xb5fa('0x31')][_0xb5fa('0x49')](_0x59ae64)[_0xb5fa('0x25')](handleEntityNotFound(_0xc03e44,null))[_0xb5fa('0x25')](respondWithResult(_0xc03e44,null))[_0xb5fa('0x47')](handleError(_0xc03e44,null));};exports['create']=function(_0x56dceb,_0x46194d){return db['AnalyticDefaultReport'][_0xb5fa('0x4a')](_0x56dceb[_0xb5fa('0x4b')],{})['then'](function(_0x4ef1d0){var _0x2931a7=_0x56dceb[_0xb5fa('0x4c')][_0xb5fa('0x27')]({'plain':!![]});if(!_0x2931a7)throw new Error(_0xb5fa('0x4d'));if(_0x2931a7[_0xb5fa('0x4e')]==='user'){var _0x27a651=_0x4ef1d0['get']({'plain':!![]});var _0x251d36=_0xb5fa('0x4f');return db[_0xb5fa('0x50')]['find']({'where':{'name':_0x251d36,'userProfileId':_0x2931a7[_0xb5fa('0x51')]},'raw':!![]})[_0xb5fa('0x25')](function(_0x4dea87){if(_0x4dea87&&_0x4dea87['autoAssociation']===0x0){return db[_0xb5fa('0x29')][_0xb5fa('0x4a')]({'name':_0x27a651[_0xb5fa('0x2d')],'resourceId':_0x27a651['id'],'type':_0xb5fa('0x28'),'sectionId':_0x4dea87['id']},{})[_0xb5fa('0x25')](function(){return _0x4ef1d0;});}else{return _0x4ef1d0;}})[_0xb5fa('0x47')](function(_0x31c91f){logger[_0xb5fa('0x2b')](_0xb5fa('0x52'),_0x31c91f);throw _0x31c91f;});}return _0x4ef1d0;})[_0xb5fa('0x25')](respondWithResult(_0x46194d,0xc9))[_0xb5fa('0x47')](handleError(_0x46194d,null));};exports[_0xb5fa('0x24')]=function(_0x3ccfd1,_0x2799e7){if(_0x3ccfd1[_0xb5fa('0x4b')]['id']){delete _0x3ccfd1[_0xb5fa('0x4b')]['id'];}return db[_0xb5fa('0x31')][_0xb5fa('0x49')]({'where':{'id':_0x3ccfd1['params']['id']}})[_0xb5fa('0x25')](handleEntityNotFound(_0x2799e7,null))[_0xb5fa('0x25')](saveUpdates(_0x3ccfd1[_0xb5fa('0x4b')],null))[_0xb5fa('0x25')](respondWithResult(_0x2799e7,null))[_0xb5fa('0x47')](handleError(_0x2799e7,null));};exports[_0xb5fa('0x26')]=function(_0x4224cf,_0x24117e){return db[_0xb5fa('0x31')][_0xb5fa('0x49')]({'where':{'id':_0x4224cf['params']['id']}})['then'](handleEntityNotFound(_0x24117e,null))[_0xb5fa('0x25')](removeEntity(_0x24117e,null))[_0xb5fa('0x47')](handleError(_0x24117e,null));};exports[_0xb5fa('0x53')]=function(_0x5caf84,_0x441c41){var _0x367f7a=0xa;var _0x1572fb=[_0xb5fa('0x54'),_0xb5fa('0x55'),_0xb5fa('0x56'),_0xb5fa('0x57')];var _0x4f82f0={'SUM':_0xb5fa('0x58'),'COUNT':_0xb5fa('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xb5fa('0x5a'),'MIN':_0xb5fa('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb5fa('0x5c'),'GROUP_CONCAT ASC':_0xb5fa('0x5d'),'GROUP_CONCAT DESC':_0xb5fa('0x5e')};var _0x2b9a45={'SEC_TO_TIME':_0xb5fa('0x5f'),'DATE':_0xb5fa('0x60'),'HOUR':_0xb5fa('0x61'),'ROUND':_0xb5fa('0x62'),'UNIX_TIMESTAMP':_0xb5fa('0x63')};var _0x1c24e3=function(_0xfb88cc){return!_[_0xb5fa('0x64')]([_0xb5fa('0x65'),_0xb5fa('0x66'),_0xb5fa('0x67'),_0xb5fa('0x68')],_0xfb88cc);};var _0x41cce9=function(_0x23fb01){if(!_0x23fb01||!_0x23fb01[_0xb5fa('0x69')][_0xb5fa('0x39')]){return'';}for(var _0x421a93='(',_0x36fc0f=0x0;_0x36fc0f<_0x23fb01['rules'][_0xb5fa('0x39')];_0x36fc0f+=0x1){_0x36fc0f>0x0&&(_0x421a93+='\x20'+_0x23fb01[_0xb5fa('0x6a')]+'\x20');_0x421a93+=_0x23fb01[_0xb5fa('0x69')][_0x36fc0f]['group']?_0x41cce9(_0x23fb01[_0xb5fa('0x69')][_0x36fc0f][_0xb5fa('0x6b')]):_0x23fb01['rules'][_0x36fc0f][_0xb5fa('0x6c')]+'\x20'+_0x23fb01[_0xb5fa('0x69')][_0x36fc0f][_0xb5fa('0x6d')]+(_0x1c24e3(_0x23fb01['rules'][_0x36fc0f]['condition'])?'\x20'+_0x23fb01[_0xb5fa('0x69')][_0x36fc0f][_0xb5fa('0x6e')]:'');}return _0x421a93+')';};var _0x432f04={'where':{'id':_0x5caf84['params']['id']}},_0x57d8b7,_0x597206,_0x30d53b,_0x199555,_0x12b0a2;_0x432f04=_['merge']({},_0x432f04,_0x5caf84['options']);return db[_0xb5fa('0x31')][_0xb5fa('0x49')](_0x432f04)[_0xb5fa('0x25')](function(_0x4ce1bd){if(_0x4ce1bd){_0x57d8b7=_0x4ce1bd;return _0x4ce1bd[_0xb5fa('0x6f')]();}return null;})[_0xb5fa('0x25')](function(_0x13ef3a){if(_0x13ef3a){if(!_0x13ef3a[_0xb5fa('0x39')]){throw new db[(_0xb5fa('0x70'))][(_0xb5fa('0x71'))](_0xb5fa('0x72'),0x193);}_0x597206=_0x13ef3a;return db[_0xb5fa('0x73')][_0xb5fa('0x45')]({'raw':!![]});}return null;})[_0xb5fa('0x25')](function(_0x3a1db9){if(_0x3a1db9){_0x30d53b=_[_0xb5fa('0x74')](_0x3a1db9,'id');var _0xecdff3;var _0x38faa6=squel[_0xb5fa('0x75')]();_0x38faa6['from'](_0x57d8b7[_0xb5fa('0x76')]);for(var _0x5a6f74=0x0;_0x5a6f74<_0x597206[_0xb5fa('0x39')];_0x5a6f74+=0x1){_0xecdff3=_0x597206[_0x5a6f74][_0xb5fa('0x77')]?_0x30d53b[_0x597206[_0x5a6f74][_0xb5fa('0x77')]][_0xb5fa('0x78')]:_0x597206[_0x5a6f74][_0xb5fa('0x6c')];_0xecdff3=_0x597206[_0x5a6f74]['function']?_[_0xb5fa('0x79')](_0x4f82f0[_0x597206[_0x5a6f74]['function']],'%s',_0xecdff3):_0xecdff3;_0xecdff3=_0x597206[_0x5a6f74][_0xb5fa('0x7a')]?_[_0xb5fa('0x79')](_0x2b9a45[_0x597206[_0x5a6f74][_0xb5fa('0x7a')]],'%s',_0xecdff3):_0xecdff3;if(_0x597206[_0x5a6f74][_0xb5fa('0x7b')]){_0x38faa6['group'](_0xecdff3);}_0x597206[_0x5a6f74]['orderBy']&&_0x38faa6['order'](_0xecdff3,_0x597206[_0x5a6f74][_0xb5fa('0x7c')]===_0xb5fa('0x7d')?![]:!![]);_0x38faa6[_0xb5fa('0x6c')](_0xecdff3,_0x597206[_0x5a6f74][_0xb5fa('0x7e')]||_0xecdff3);}if(_0x57d8b7[_0xb5fa('0x7f')]){_0x57d8b7[_0xb5fa('0x7f')]=JSON['parse'](_0x57d8b7[_0xb5fa('0x7f')]);for(var _0x5c08e1=0x0;_0x5c08e1<_0x57d8b7['joins'][_0xb5fa('0x39')];_0x5c08e1+=0x1){if(_0x57d8b7['joins'][_0x5c08e1]['type']&&_['includes'](_0x1572fb,_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1]['type'])&&_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x80')]&&_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1]['foreignTable']&&_0x57d8b7['joins'][_0x5c08e1][_0xb5fa('0x81')]){_0x38faa6[_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1]['type']](_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x82')],null,util[_0xb5fa('0x7a')](_0xb5fa('0x83'),_0x57d8b7['table'],_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x80')],_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x82')],_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x81')]));}}}if(_0x57d8b7[_0xb5fa('0x84')]){_0x57d8b7['conditions']=JSON[_0xb5fa('0x85')](_0x57d8b7['conditions']);_0x38faa6[_0xb5fa('0x3d')](_0x41cce9(_0x57d8b7[_0xb5fa('0x84')]['group']));}_0x12b0a2=_0x38faa6[_0xb5fa('0x86')]();_0x38faa6[_0xb5fa('0x1d')](_0x367f7a);_0x38faa6[_0xb5fa('0x20')](0x0);logger[_0xb5fa('0x87')](_0xb5fa('0x88'),_0x38faa6[_0xb5fa('0x89')]());return dbH[_0xb5fa('0x8a')][_0xb5fa('0x3c')](_0x38faa6['toString'](),{'type':dbH[_0xb5fa('0x8a')][_0xb5fa('0x8b')][_0xb5fa('0x8c')]});}})[_0xb5fa('0x25')](respondWithResult(_0x441c41,null))['catch'](handleError(_0x441c41,null));};function runReport(_0x593386,_0x47d72b,_0x5557a3){var _0x1c60bd=_0x47d72b[_0xb5fa('0x2d')];var _0xff504d=0xa;var _0x188e66=['join','left_join',_0xb5fa('0x56'),'cross_join'];var _0x32eebd={'SUM':_0xb5fa('0x58'),'COUNT':_0xb5fa('0x59'),'COUNT DISTINCT':_0xb5fa('0x8d'),'MAX':'MAX(%s)','MIN':_0xb5fa('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb5fa('0x5c'),'GROUP_CONCAT ASC':_0xb5fa('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5e6852={'SEC_TO_TIME':_0xb5fa('0x5f'),'DATE':_0xb5fa('0x60'),'HOUR':_0xb5fa('0x61'),'ROUND':_0xb5fa('0x62'),'UNIX_TIMESTAMP':_0xb5fa('0x63')};var _0xa7fd3b=function(_0x42e210){return!_[_0xb5fa('0x64')]([_0xb5fa('0x65'),_0xb5fa('0x66'),_0xb5fa('0x67'),_0xb5fa('0x68')],_0x42e210);};var _0x86dfe9=function(_0x53c7b5){if(!_0x53c7b5||!_0x53c7b5['rules'][_0xb5fa('0x39')]){return'';}for(var _0x52384b='(',_0x1cb113=0x0;_0x1cb113<_0x53c7b5[_0xb5fa('0x69')]['length'];_0x1cb113+=0x1){_0x1cb113>0x0&&(_0x52384b+='\x20'+_0x53c7b5[_0xb5fa('0x6a')]+'\x20');_0x52384b+=_0x53c7b5[_0xb5fa('0x69')][_0x1cb113]['group']?_0x86dfe9(_0x53c7b5[_0xb5fa('0x69')][_0x1cb113][_0xb5fa('0x6b')]):_0x53c7b5['rules'][_0x1cb113][_0xb5fa('0x6c')]+'\x20'+_0x53c7b5[_0xb5fa('0x69')][_0x1cb113][_0xb5fa('0x6d')]+(_0xa7fd3b(_0x53c7b5['rules'][_0x1cb113]['condition'])?'\x20'+_0x53c7b5[_0xb5fa('0x69')][_0x1cb113][_0xb5fa('0x6e')]:'');}return _0x52384b+')';};var _0x3b5e1d={'where':{'id':_0x593386['id']}},_0x3d18a9,_0x397830,_0x234d9d,_0x10222c,_0x1eec65;_0x3b5e1d=_[_0xb5fa('0x42')]({},_0x3b5e1d,_0x5557a3);return db[_0xb5fa('0x31')]['find'](_0x3b5e1d)['then'](function(_0x3c5563){if(_0x3c5563){_0x3d18a9=_0x3c5563;return _0x3c5563[_0xb5fa('0x6f')]();}return null;})[_0xb5fa('0x25')](function(_0x18498d){if(_0x18498d){if(!_0x18498d['length']){throw new db[(_0xb5fa('0x70'))][(_0xb5fa('0x71'))](_0xb5fa('0x72'),0x193);}_0x397830=_0x18498d;return db['AnalyticMetric'][_0xb5fa('0x45')]({'raw':!![]});}return null;})[_0xb5fa('0x25')](function(_0x109dd9){if(_0x109dd9){_0x234d9d=_[_0xb5fa('0x74')](_0x109dd9,'id');var _0x5ba2e7;var _0x1175da=squel[_0xb5fa('0x75')]();_0x1175da[_0xb5fa('0x8e')](_0x3d18a9[_0xb5fa('0x76')]);for(var _0x19717a=0x0;_0x19717a<_0x397830[_0xb5fa('0x39')];_0x19717a+=0x1){_0x5ba2e7=_0x397830[_0x19717a][_0xb5fa('0x77')]?_0x234d9d[_0x397830[_0x19717a][_0xb5fa('0x77')]][_0xb5fa('0x78')]:_0x397830[_0x19717a][_0xb5fa('0x6c')];_0x5ba2e7=_0x397830[_0x19717a][_0xb5fa('0x8f')]?_[_0xb5fa('0x79')](_0x32eebd[_0x397830[_0x19717a][_0xb5fa('0x8f')]],'%s',_0x5ba2e7):_0x5ba2e7;_0x5ba2e7=_0x397830[_0x19717a][_0xb5fa('0x7a')]?_[_0xb5fa('0x79')](_0x5e6852[_0x397830[_0x19717a]['format']],'%s',_0x5ba2e7):_0x5ba2e7;if(_0x397830[_0x19717a][_0xb5fa('0x7b')]){_0x1175da[_0xb5fa('0x6b')](_0x5ba2e7);}_0x397830[_0x19717a][_0xb5fa('0x7c')]&&_0x1175da[_0xb5fa('0x90')](_0x5ba2e7,_0x397830[_0x19717a][_0xb5fa('0x7c')]===_0xb5fa('0x7d')?![]:!![]);_0x1175da[_0xb5fa('0x6c')](_0x5ba2e7,_0x397830[_0x19717a][_0xb5fa('0x7e')]||_0x5ba2e7);}if(_0x3d18a9['joins']){_0x3d18a9['joins']=JSON[_0xb5fa('0x85')](_0x3d18a9['joins']);for(var _0x5d0ca8=0x0;_0x5d0ca8<_0x3d18a9[_0xb5fa('0x7f')][_0xb5fa('0x39')];_0x5d0ca8+=0x1){if(_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8]['type']&&_[_0xb5fa('0x64')](_0x188e66,_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x33')])&&_0x3d18a9['joins'][_0x5d0ca8][_0xb5fa('0x80')]&&_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8]['foreignTable']&&_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x81')]){_0x1175da[_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x33')]](_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x82')],null,util[_0xb5fa('0x7a')]('%s.%s\x20=\x20%s.%s',_0x3d18a9[_0xb5fa('0x76')],_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x80')],_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8]['foreignTable'],_0x3d18a9['joins'][_0x5d0ca8][_0xb5fa('0x81')]));}}}if(_0x3d18a9[_0xb5fa('0x84')]){_0x3d18a9[_0xb5fa('0x84')]=JSON[_0xb5fa('0x85')](_0x3d18a9['conditions']);_0x1175da['where'](_0x86dfe9(_0x3d18a9['conditions']['group']));}_0x1eec65=_0x1175da[_0xb5fa('0x86')]();_0x1175da[_0xb5fa('0x1d')](_0xff504d);_0x1175da[_0xb5fa('0x20')](0x0);return;}})[_0xb5fa('0x25')](function(){if(_0x47d72b[_0xb5fa('0x91')]===_0xb5fa('0x92')){return null;}var _0x3c36a8=_[_0xb5fa('0x42')](_0x47d72b,{'name':_0x47d72b[_0xb5fa('0x93')]||_0x47d72b[_0xb5fa('0x2d')]||_0x3d18a9[_0xb5fa('0x2d')],'basename':_0x1c60bd,'savename':util['format'](_0xb5fa('0x94'),_0x47d72b[_0xb5fa('0x2d')]||_0x3d18a9['name'],require(_0xb5fa('0x95'))[_0xb5fa('0x96')](0x4),_0x47d72b['output']||_0xb5fa('0x97')),'reportId':_0x3d18a9['id'],'reportType':_0xb5fa('0x98')});return db[_0xb5fa('0x99')][_0xb5fa('0x4a')](_0x3c36a8,{'raw':!![]});})[_0xb5fa('0x25')](function(_0x2b449a){if(_0x3d18a9[_0xb5fa('0x76')]===_0xb5fa('0x9a')){_0x1eec65[_0xb5fa('0x3d')](_0x3d18a9['table']+_0xb5fa('0x9b'),_0x47d72b[_0xb5fa('0x9c')],_0x47d72b[_0xb5fa('0x9d')]);}else{_0x1eec65[_0xb5fa('0x3d')](_0x3d18a9[_0xb5fa('0x76')]+_0xb5fa('0x9e'),_0x47d72b[_0xb5fa('0x9c')],_0x47d72b[_0xb5fa('0x9d')]);}if(_0x2b449a){logger['info'](_0xb5fa('0x9f'),_0x1eec65['toString']());require(_0xb5fa('0xa0'))[_0xb5fa('0xa1')](path[_0xb5fa('0x54')](__dirname,_0xb5fa('0xa2'),_0x2b449a[_0xb5fa('0x91')]),[_0x2b449a['id'],_0x1eec65[_0xb5fa('0x89')](),path[_0xb5fa('0x54')](__dirname,_0xb5fa('0xa3'),_0x2b449a[_0xb5fa('0xa4')]),_0x1c60bd]);return _0x2b449a;}else{var _0x4bb9b4=squel['select']();_0x4bb9b4[_0xb5fa('0x8e')]('('+_0x1eec65[_0xb5fa('0x89')]()+')',_0xb5fa('0xa5'));_0x4bb9b4[_0xb5fa('0x6c')]('COUNT(*)',_0xb5fa('0x1f'));_0x1eec65['limit'](_0x47d72b[_0xb5fa('0x1d')]||_0xff504d);_0x1eec65[_0xb5fa('0x20')](_0x47d72b['offset']||0x0);return dbH[_0xb5fa('0x8a')]['query'](_0x4bb9b4[_0xb5fa('0x89')](),{'type':dbH['sequelize'][_0xb5fa('0x8b')][_0xb5fa('0x8c')]})[_0xb5fa('0x25')](function(_0x70e4ae){if(!_0x70e4ae[_0xb5fa('0x39')]){_0x10222c=0x0;}else{_0x10222c=_0x70e4ae[0x0][_0xb5fa('0x1f')]||0x0;}return dbH[_0xb5fa('0x8a')][_0xb5fa('0x3c')](_0x1eec65[_0xb5fa('0x89')](),{'type':dbH[_0xb5fa('0x8a')][_0xb5fa('0x8b')]['SELECT']});})[_0xb5fa('0x25')](function(_0x284b34){return{'rows':_0x284b34||[],'count':_0x10222c};});}});}exports[_0xb5fa('0xa6')]=function(_0x497931,_0x2145d8){return runReport(_0x497931[_0xb5fa('0xa7')],_0x497931[_0xb5fa('0x3c')],_0x497931[_0xb5fa('0x43')])[_0xb5fa('0x25')](respondWithResult(_0x2145d8,null))[_0xb5fa('0x47')](handleError(_0x2145d8,null));};exports[_0xb5fa('0xa8')]=runReport;exports[_0xb5fa('0x3c')]=function(_0x59fd75,_0x245ee1){var _0x5c1e1f=0xa;var _0x3ba723=[_0xb5fa('0x54'),_0xb5fa('0x55'),_0xb5fa('0x56'),_0xb5fa('0x57')];var _0x105c0f={'SUM':_0xb5fa('0x58'),'COUNT':_0xb5fa('0x59'),'COUNT DISTINCT':_0xb5fa('0x8d'),'MAX':_0xb5fa('0x5a'),'MIN':_0xb5fa('0x5b'),'AVG':_0xb5fa('0xa9'),'GROUP_CONCAT':_0xb5fa('0x5c'),'GROUP_CONCAT ASC':_0xb5fa('0x5d'),'GROUP_CONCAT DESC':_0xb5fa('0x5e')};var _0x41e086={'SEC_TO_TIME':_0xb5fa('0x5f'),'DATE':'DATE(%s)','HOUR':_0xb5fa('0x61'),'ROUND':_0xb5fa('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xd34c31=function(_0x2e614e){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL',_0xb5fa('0x67'),_0xb5fa('0x68')],_0x2e614e);};var _0x1aae82=function(_0x474bb){if(!_0x474bb||!_0x474bb[_0xb5fa('0x69')][_0xb5fa('0x39')]){return'';}for(var _0x17ae50='(',_0x51c9ba=0x0;_0x51c9ba<_0x474bb['rules']['length'];_0x51c9ba+=0x1){_0x51c9ba>0x0&&(_0x17ae50+='\x20'+_0x474bb[_0xb5fa('0x6a')]+'\x20');_0x17ae50+=_0x474bb['rules'][_0x51c9ba]['group']?_0x1aae82(_0x474bb[_0xb5fa('0x69')][_0x51c9ba]['group']):_0x474bb[_0xb5fa('0x69')][_0x51c9ba][_0xb5fa('0x6c')]+'\x20'+_0x474bb[_0xb5fa('0x69')][_0x51c9ba][_0xb5fa('0x6d')]+(_0xd34c31(_0x474bb[_0xb5fa('0x69')][_0x51c9ba]['condition'])?'\x20'+_0x474bb[_0xb5fa('0x69')][_0x51c9ba][_0xb5fa('0x6e')]:'');}return _0x17ae50+')';};var _0x2fe715={'where':{'id':_0x59fd75[_0xb5fa('0xa7')]['id']}},_0x3c5ac4,_0x23b70f,_0x488818,_0x15b228,_0x42fd84;_0x2fe715=_[_0xb5fa('0x42')]({},_0x2fe715,_0x59fd75[_0xb5fa('0x43')]);return db[_0xb5fa('0x31')]['find'](_0x2fe715)[_0xb5fa('0x25')](function(_0x390043){if(_0x390043){_0x3c5ac4=_0x390043;return _0x390043[_0xb5fa('0x6f')]();}return null;})[_0xb5fa('0x25')](function(_0x32c191){if(_0x32c191){if(!_0x32c191[_0xb5fa('0x39')]){throw new db[(_0xb5fa('0x70'))][(_0xb5fa('0x71'))](_0xb5fa('0x72'),0x193);}_0x23b70f=_0x32c191;return db[_0xb5fa('0x73')][_0xb5fa('0x45')]({'raw':!![]});}return null;})[_0xb5fa('0x25')](function(_0x1d307c){if(_0x1d307c){_0x488818=_[_0xb5fa('0x74')](_0x1d307c,'id');var _0x3347eb;var _0x349e0b=squel[_0xb5fa('0x75')]();_0x349e0b[_0xb5fa('0x8e')](_0x3c5ac4[_0xb5fa('0x76')]);for(var _0x2b1c3f=0x0;_0x2b1c3f<_0x23b70f[_0xb5fa('0x39')];_0x2b1c3f+=0x1){_0x3347eb=_0x23b70f[_0x2b1c3f][_0xb5fa('0x77')]?_0x488818[_0x23b70f[_0x2b1c3f]['MetricId']]['metric']:_0x23b70f[_0x2b1c3f][_0xb5fa('0x6c')];_0x3347eb=_0x23b70f[_0x2b1c3f][_0xb5fa('0x8f')]?_[_0xb5fa('0x79')](_0x105c0f[_0x23b70f[_0x2b1c3f][_0xb5fa('0x8f')]],'%s',_0x3347eb):_0x3347eb;_0x3347eb=_0x23b70f[_0x2b1c3f][_0xb5fa('0x7a')]?_[_0xb5fa('0x79')](_0x41e086[_0x23b70f[_0x2b1c3f]['format']],'%s',_0x3347eb):_0x3347eb;if(_0x23b70f[_0x2b1c3f]['groupBy']){_0x349e0b['group'](_0x3347eb);}_0x23b70f[_0x2b1c3f][_0xb5fa('0x7c')]&&_0x349e0b[_0xb5fa('0x90')](_0x3347eb,_0x23b70f[_0x2b1c3f]['orderBy']===_0xb5fa('0x7d')?![]:!![]);_0x349e0b[_0xb5fa('0x6c')](_0x3347eb,_0x23b70f[_0x2b1c3f]['alias']||_0x3347eb);}if(_0x3c5ac4[_0xb5fa('0x7f')]){_0x3c5ac4[_0xb5fa('0x7f')]=JSON[_0xb5fa('0x85')](_0x3c5ac4[_0xb5fa('0x7f')]);for(var _0x10dbdf=0x0;_0x10dbdf<_0x3c5ac4[_0xb5fa('0x7f')][_0xb5fa('0x39')];_0x10dbdf+=0x1){if(_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['type']&&_[_0xb5fa('0x64')](_0x3ba723,_0x3c5ac4['joins'][_0x10dbdf][_0xb5fa('0x33')])&&_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x80')]&&_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['foreignTable']&&_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x81')]){_0x349e0b[_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x33')]](_0x3c5ac4['joins'][_0x10dbdf][_0xb5fa('0x82')],null,util[_0xb5fa('0x7a')](_0xb5fa('0x83'),_0x3c5ac4[_0xb5fa('0x76')],_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x80')],_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['foreignTable'],_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['foreignKey']));}}}if(_0x3c5ac4[_0xb5fa('0x84')]){_0x3c5ac4[_0xb5fa('0x84')]=JSON[_0xb5fa('0x85')](_0x3c5ac4[_0xb5fa('0x84')]);_0x349e0b[_0xb5fa('0x3d')](_0x1aae82(_0x3c5ac4[_0xb5fa('0x84')][_0xb5fa('0x6b')]));}_0x42fd84=_0x349e0b['clone']();_0x349e0b['limit'](_0x5c1e1f);_0x349e0b[_0xb5fa('0x20')](0x0);logger[_0xb5fa('0x87')](_0xb5fa('0x88'),_0x349e0b[_0xb5fa('0x89')]());return dbH[_0xb5fa('0x8a')][_0xb5fa('0x3c')](_0x349e0b[_0xb5fa('0x89')](),{'type':dbH[_0xb5fa('0x8a')]['QueryTypes'][_0xb5fa('0x8c')]});}})[_0xb5fa('0x25')](function(){return{'sql':_0x42fd84[_0xb5fa('0x89')]()};})[_0xb5fa('0x25')](respondWithResult(_0x245ee1,null))[_0xb5fa('0x47')](handleError(_0x245ee1,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 0a3b37d..0ad6b65 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 _0x9fe9=['util','../../config/logger','api','request-promise','rimraf','./analyticDefaultReport.attributes','define','AnalyticDefaultReport','analytics_default_reports','lodash'];(function(_0x25c38f,_0x1538b4){var _0x2de94e=function(_0x3b836d){while(--_0x3b836d){_0x25c38f['push'](_0x25c38f['shift']());}};_0x2de94e(++_0x1538b4);}(_0x9fe9,0x1c1));var _0x99fe=function(_0x3baa05,_0x207228){_0x3baa05=_0x3baa05-0x0;var _0x3b2b8d=_0x9fe9[_0x3baa05];return _0x3b2b8d;};'use strict';var _=require(_0x99fe('0x0'));var util=require(_0x99fe('0x1'));var logger=require(_0x99fe('0x2'))(_0x99fe('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x99fe('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x99fe('0x5'));var config=require('../../config/environment');var attributes=require(_0x99fe('0x6'));module['exports']=function(_0x25f9ed,_0xd96fb9){return _0x25f9ed[_0x99fe('0x7')](_0x99fe('0x8'),attributes,{'tableName':_0x99fe('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5402=['util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','AnalyticDefaultReport','analytics_default_reports'];(function(_0x5b6a55,_0xd81f6b){var _0x362e73=function(_0x3c293d){while(--_0x3c293d){_0x5b6a55['push'](_0x5b6a55['shift']());}};_0x362e73(++_0xd81f6b);}(_0x5402,0xf2));var _0x2540=function(_0x4b6b65,_0xdbdfd2){_0x4b6b65=_0x4b6b65-0x0;var _0x3207ed=_0x5402[_0x4b6b65];return _0x3207ed;};'use strict';var _=require('lodash');var util=require(_0x2540('0x0'));var logger=require(_0x2540('0x1'))('api');var moment=require(_0x2540('0x2'));var BPromise=require('bluebird');var rp=require(_0x2540('0x3'));var fs=require('fs');var path=require(_0x2540('0x4'));var rimraf=require(_0x2540('0x5'));var config=require(_0x2540('0x6'));var attributes=require(_0x2540('0x7'));module[_0x2540('0x8')]=function(_0x14154f,_0x424cd5){return _0x14154f['define'](_0x2540('0x9'),attributes,{'tableName':_0x2540('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 f34db5f..c665eb0 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 _0x86e0=['rpc','jayson/promise','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2f5b04,_0x56202c){var _0x2b587c=function(_0x18479c){while(--_0x18479c){_0x2f5b04['push'](_0x2f5b04['shift']());}};_0x2b587c(++_0x56202c);}(_0x86e0,0x1f3));var _0x086e=function(_0x189cef,_0x515130){_0x189cef=_0x189cef-0x0;var _0x332a74=_0x86e0[_0x189cef];return _0x332a74;};'use strict';var _=require(_0x086e('0x0'));var util=require('util');var moment=require(_0x086e('0x1'));var BPromise=require('bluebird');var rs=require(_0x086e('0x2'));var fs=require('fs');var Redis=require(_0x086e('0x3'));var db=require(_0x086e('0x4'))['db'];var utils=require(_0x086e('0x5'));var logger=require(_0x086e('0x6'))(_0x086e('0x7'));var config=require('../../config/environment');var jayson=require(_0x086e('0x8'));var client=jayson['client'][_0x086e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x576c1f,_0x3aa423,_0x2f32cf){return new BPromise(function(_0x454d2d,_0x30b38c){return client[_0x086e('0xa')](_0x576c1f,_0x2f32cf)[_0x086e('0xb')](function(_0xefffdb){logger[_0x086e('0xc')](_0x086e('0xd'),_0x3aa423,_0x086e('0xe'));logger[_0x086e('0xf')](_0x086e('0x10'),_0x3aa423,_0x086e('0xe'),JSON[_0x086e('0x11')](_0xefffdb));if(_0xefffdb[_0x086e('0x12')]){if(_0xefffdb['error'][_0x086e('0x13')]===0x1f4){logger[_0x086e('0x12')](_0x086e('0xd'),_0x3aa423,_0xefffdb[_0x086e('0x12')][_0x086e('0x14')]);return _0x30b38c(_0xefffdb[_0x086e('0x12')][_0x086e('0x14')]);}logger['error'](_0x086e('0xd'),_0x3aa423,_0xefffdb[_0x086e('0x12')][_0x086e('0x14')]);return _0x454d2d(_0xefffdb[_0x086e('0x12')]['message']);}else{logger[_0x086e('0xc')](_0x086e('0xd'),_0x3aa423,_0x086e('0xe'));_0x454d2d(_0xefffdb[_0x086e('0x15')][_0x086e('0x14')]);}})[_0x086e('0x16')](function(_0x241758){logger[_0x086e('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3aa423,_0x241758);_0x30b38c(_0x241758);});});}
\ No newline at end of file
+var _0xc8aa=['stringify','error','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s'];(function(_0x25c988,_0xce8221){var _0x45fcc2=function(_0x47fba5){while(--_0x47fba5){_0x25c988['push'](_0x25c988['shift']());}};_0x45fcc2(++_0xce8221);}(_0xc8aa,0x14e));var _0xac8a=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xc8aa[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xac8a('0x0'));var util=require(_0xac8a('0x1'));var moment=require(_0xac8a('0x2'));var BPromise=require(_0xac8a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xac8a('0x4'));var db=require(_0xac8a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xac8a('0x6'))(_0xac8a('0x7'));var config=require(_0xac8a('0x8'));var jayson=require(_0xac8a('0x9'));var client=jayson[_0xac8a('0xa')][_0xac8a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b4b1c,_0x5d83f7,_0x29b0e7){return new BPromise(function(_0x21fc5b,_0x1f7ea2){return client['request'](_0x1b4b1c,_0x29b0e7)[_0xac8a('0xc')](function(_0xf7a48c){logger[_0xac8a('0xd')](_0xac8a('0xe'),_0x5d83f7,_0xac8a('0xf'));logger[_0xac8a('0x10')](_0xac8a('0x11'),_0x5d83f7,'request\x20sent',JSON[_0xac8a('0x12')](_0xf7a48c));if(_0xf7a48c[_0xac8a('0x13')]){if(_0xf7a48c[_0xac8a('0x13')]['code']===0x1f4){logger[_0xac8a('0x13')](_0xac8a('0xe'),_0x5d83f7,_0xf7a48c[_0xac8a('0x13')][_0xac8a('0x14')]);return _0x1f7ea2(_0xf7a48c[_0xac8a('0x13')][_0xac8a('0x14')]);}logger['error'](_0xac8a('0xe'),_0x5d83f7,_0xf7a48c[_0xac8a('0x13')][_0xac8a('0x14')]);return _0x21fc5b(_0xf7a48c[_0xac8a('0x13')]['message']);}else{logger[_0xac8a('0xd')](_0xac8a('0xe'),_0x5d83f7,_0xac8a('0xf'));_0x21fc5b(_0xf7a48c[_0xac8a('0x15')]['message']);}})['catch'](function(_0x238641){logger['error'](_0xac8a('0xe'),_0x5d83f7,_0x238641);_0x1f7ea2(_0x238641);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index e3c7318..125f5c3 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 _0xc6a2=['get','isAuthenticated','index','/:id','/:id/preview','preview','/:id/run','run','query','post','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0xc6a2,0x69));var _0x2c6a=function(_0x4c7ce9,_0x3428df){_0x4c7ce9=_0x4c7ce9-0x0;var _0x37eee2=_0xc6a2[_0x4c7ce9];return _0x37eee2;};'use strict';var multer=require(_0x2c6a('0x0'));var util=require(_0x2c6a('0x1'));var path=require('path');var timeout=require(_0x2c6a('0x2'));var express=require(_0x2c6a('0x3'));var router=express[_0x2c6a('0x4')]();var fs_extra=require(_0x2c6a('0x5'));var auth=require(_0x2c6a('0x6'));var interaction=require(_0x2c6a('0x7'));var config=require(_0x2c6a('0x8'));var controller=require(_0x2c6a('0x9'));router[_0x2c6a('0xa')]('/',auth[_0x2c6a('0xb')](),controller[_0x2c6a('0xc')]);router[_0x2c6a('0xa')](_0x2c6a('0xd'),auth[_0x2c6a('0xb')](),controller['show']);router[_0x2c6a('0xa')](_0x2c6a('0xe'),auth[_0x2c6a('0xb')](),controller[_0x2c6a('0xf')]);router[_0x2c6a('0xa')](_0x2c6a('0x10'),auth[_0x2c6a('0xb')](),controller[_0x2c6a('0x11')]);router['get']('/:id/query',auth[_0x2c6a('0xb')](),controller[_0x2c6a('0x12')]);router[_0x2c6a('0x13')]('/',auth[_0x2c6a('0xb')](),controller['create']);router['put'](_0x2c6a('0xd'),auth[_0x2c6a('0xb')](),controller[_0x2c6a('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x2c6a('0x15')]);module[_0x2c6a('0x16')]=router;
\ No newline at end of file
+var _0x4b95=['/:id/preview','/:id/run','run','/:id/query','query','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index'];(function(_0x372129,_0x539547){var _0x2385b4=function(_0x17969f){while(--_0x17969f){_0x372129['push'](_0x372129['shift']());}};_0x2385b4(++_0x539547);}(_0x4b95,0x1d7));var _0x54b9=function(_0x36f051,_0x34b4ab){_0x36f051=_0x36f051-0x0;var _0x32bed7=_0x4b95[_0x36f051];return _0x32bed7;};'use strict';var multer=require(_0x54b9('0x0'));var util=require(_0x54b9('0x1'));var path=require(_0x54b9('0x2'));var timeout=require(_0x54b9('0x3'));var express=require('express');var router=express[_0x54b9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x54b9('0x5'));var interaction=require(_0x54b9('0x6'));var config=require(_0x54b9('0x7'));var controller=require(_0x54b9('0x8'));router[_0x54b9('0x9')]('/',auth[_0x54b9('0xa')](),controller[_0x54b9('0xb')]);router[_0x54b9('0x9')]('/:id',auth[_0x54b9('0xa')](),controller['show']);router[_0x54b9('0x9')](_0x54b9('0xc'),auth['isAuthenticated'](),controller['preview']);router[_0x54b9('0x9')](_0x54b9('0xd'),auth[_0x54b9('0xa')](),controller[_0x54b9('0xe')]);router['get'](_0x54b9('0xf'),auth[_0x54b9('0xa')](),controller[_0x54b9('0x10')]);router['post']('/',auth[_0x54b9('0xa')](),controller[_0x54b9('0x11')]);router[_0x54b9('0x12')](_0x54b9('0x13'),auth[_0x54b9('0xa')](),controller[_0x54b9('0x14')]);router[_0x54b9('0x15')](_0x54b9('0x13'),auth[_0x54b9('0xa')](),controller[_0x54b9('0x16')]);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 0211e30..1c99979 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 _0x1b4d=['moment','exports','STRING','csv','pdf','DATE','Loading','ENUM','scheduled','manual','UNSIGNED'];(function(_0x2841d8,_0x32296e){var _0x4e2df3=function(_0x31003e){while(--_0x31003e){_0x2841d8['push'](_0x2841d8['shift']());}};_0x4e2df3(++_0x32296e);}(_0x1b4d,0x1ef));var _0xd1b4=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x1b4d[_0x28947d];return _0x12d2ee;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xd1b4('0x0'));module[_0xd1b4('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0xd1b4('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xd1b4('0x3'),_0xd1b4('0x4'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0xd1b4('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xd1b4('0x5')]},'endDate':{'type':Sequelize[_0xd1b4('0x5')]},'status':{'type':Sequelize[_0xd1b4('0x2')],'defaultValue':_0xd1b4('0x6')},'type':{'type':Sequelize[_0xd1b4('0x7')]('manual',_0xd1b4('0x8')),'allowNull':![],'defaultValue':_0xd1b4('0x9')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0xd1b4('0xa')]},'reportType':{'type':Sequelize[_0xd1b4('0x2')]}};
\ No newline at end of file
+var _0xc05e=['UNSIGNED','sequelize','moment','exports','STRING','ENUM','pdf','DATE','Loading','manual','INTEGER'];(function(_0x24eb35,_0x4209a5){var _0x4c2f13=function(_0x5b222d){while(--_0x5b222d){_0x24eb35['push'](_0x24eb35['shift']());}};_0x4c2f13(++_0x4209a5);}(_0xc05e,0x64));var _0xec05=function(_0xc34199,_0xebd421){_0xc34199=_0xc34199-0x0;var _0xb0fa0c=_0xc05e[_0xc34199];return _0xb0fa0c;};'use strict';var Sequelize=require(_0xec05('0x0'));var moment=require(_0xec05('0x1'));module[_0xec05('0x2')]={'name':{'type':Sequelize[_0xec05('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0xec05('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0xec05('0x4')]('csv',_0xec05('0x5'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0xec05('0x3')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0xec05('0x6')]},'status':{'type':Sequelize[_0xec05('0x3')],'defaultValue':_0xec05('0x7')},'type':{'type':Sequelize[_0xec05('0x4')](_0xec05('0x8'),'scheduled'),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xec05('0x9')](0xb)[_0xec05('0xa')]},'reportType':{'type':Sequelize[_0xec05('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 2ce4d5f..08cfce6 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 _0x016a=['keys','model','attributes','intersection','fields','hasOwnProperty','nolimit','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','rows','show','params','length','include','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','basename','output','existsSync','join','root','server/files/reports','Sequelize','exists','download','savename','format','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','set','Content-Range','reject','update','then','get','ExtractedReports','UserProfileResource','error','name','send','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','query'];(function(_0x2f599f,_0x111228){var _0x42efc6=function(_0x573b99){while(--_0x573b99){_0x2f599f['push'](_0x2f599f['shift']());}};_0x42efc6(++_0x111228);}(_0x016a,0xee));var _0xa016=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0x016a[_0x373dee];return _0x46798f;};'use strict';var emlformat=require(_0xa016('0x0'));var rimraf=require(_0xa016('0x1'));var zipdir=require(_0xa016('0x2'));var jsonpatch=require(_0xa016('0x3'));var rp=require(_0xa016('0x4'));var moment=require(_0xa016('0x5'));var BPromise=require(_0xa016('0x6'));var Mustache=require(_0xa016('0x7'));var util=require(_0xa016('0x8'));var path=require(_0xa016('0x9'));var sox=require(_0xa016('0xa'));var csv=require(_0xa016('0xb'));var ejs=require(_0xa016('0xc'));var fs=require('fs');var fs_extra=require(_0xa016('0xd'));var _=require(_0xa016('0xe'));var squel=require(_0xa016('0xf'));var crypto=require(_0xa016('0x10'));var jsforce=require('jsforce');var deskjs=require(_0xa016('0x11'));var toCsv=require(_0xa016('0xb'));var querystring=require(_0xa016('0x12'));var Papa=require(_0xa016('0x13'));var Redis=require(_0xa016('0x14'));var authService=require(_0xa016('0x15'));var qs=require(_0xa016('0x16'));var as=require(_0xa016('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa016('0x18'))(_0xa016('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa016('0x1a'));var db=require(_0xa016('0x1b'))['db'];function respondWithStatusCode(_0x53512f,_0x1ce96c){_0x1ce96c=_0x1ce96c||0xcc;return function(_0x56836d){if(_0x56836d){return _0x53512f[_0xa016('0x1c')](_0x1ce96c);}return _0x53512f[_0xa016('0x1d')](_0x1ce96c)[_0xa016('0x1e')]();};}function respondWithResult(_0x232cd4,_0x3567b4){_0x3567b4=_0x3567b4||0xc8;return function(_0x5b0d11){if(_0x5b0d11){return _0x232cd4['status'](_0x3567b4)[_0xa016('0x1f')](_0x5b0d11);}};}function respondWithFilteredResult(_0x18361e,_0x5ceb21){return function(_0x4c6187){if(_0x4c6187){var _0x450f4d=typeof _0x5ceb21['offset']===_0xa016('0x20')&&typeof _0x5ceb21[_0xa016('0x21')]===_0xa016('0x20');var _0x40a7d2=_0x4c6187['count'];var _0x303b9a=_0x450f4d?0x0:_0x5ceb21[_0xa016('0x22')];var _0x3c8bd7=_0x450f4d?_0x4c6187['count']:_0x5ceb21[_0xa016('0x22')]+_0x5ceb21[_0xa016('0x21')];var _0x2ad233;if(_0x3c8bd7>=_0x40a7d2){_0x3c8bd7=_0x40a7d2;_0x2ad233=0xc8;}else{_0x2ad233=0xce;}_0x18361e[_0xa016('0x1d')](_0x2ad233);return _0x18361e[_0xa016('0x23')](_0xa016('0x24'),_0x303b9a+'-'+_0x3c8bd7+'/'+_0x40a7d2)[_0xa016('0x1f')](_0x4c6187);}return null;};}function patchUpdates(_0x1c1286){return function(_0x577a85){try{jsonpatch['apply'](_0x577a85,_0x1c1286,!![]);}catch(_0x5381ef){return BPromise[_0xa016('0x25')](_0x5381ef);}return _0x577a85['save']();};}function saveUpdates(_0x5a1093,_0x427652){return function(_0x3002bb){if(_0x3002bb){return _0x3002bb[_0xa016('0x26')](_0x5a1093)[_0xa016('0x27')](function(_0x1d610b){return _0x1d610b;});}return null;};}function removeEntity(_0x2da0d8,_0xcebaea){return function(_0x2a2971){if(_0x2a2971){return _0x2a2971['destroy']()['then'](function(){var _0xf1309=_0x2a2971[_0xa016('0x28')]({'plain':!![]});var _0x444bdf=_0xa016('0x29');return db[_0xa016('0x2a')]['destroy']({'where':{'type':_0x444bdf,'resourceId':_0xf1309['id']}})[_0xa016('0x27')](function(){return _0x2a2971;});})[_0xa016('0x27')](function(){_0x2da0d8[_0xa016('0x1d')](0xcc)[_0xa016('0x1e')]();});}};}function handleEntityNotFound(_0x15d297,_0x2da888){return function(_0x185732){if(!_0x185732){_0x15d297[_0xa016('0x1c')](0x194);}return _0x185732;};}function handleError(_0xe9bd65,_0x3e2db7){_0x3e2db7=_0x3e2db7||0x1f4;return function(_0x6597a8){logger[_0xa016('0x2b')](_0x6597a8['stack']);if(_0x6597a8[_0xa016('0x2c')]){delete _0x6597a8[_0xa016('0x2c')];}_0xe9bd65[_0xa016('0x1d')](_0x3e2db7)[_0xa016('0x2d')](_0x6597a8);};}exports['index']=function(_0x406da2,_0x7794fe){var _0x2e5b94={},_0xfcf6ad={},_0x16000a={'count':0x0,'rows':[]};var _0x498483=_[_0xa016('0x2e')](db[_0xa016('0x2f')][_0xa016('0x30')],function(_0x2c9e24){return{'name':_0x2c9e24[_0xa016('0x31')],'type':_0x2c9e24[_0xa016('0x32')][_0xa016('0x33')]};});_0xfcf6ad['model']=_[_0xa016('0x2e')](_0x498483,_0xa016('0x2c'));_0xfcf6ad[_0xa016('0x34')]=_[_0xa016('0x35')](_0x406da2[_0xa016('0x34')]);_0xfcf6ad['filters']=_['intersection'](_0xfcf6ad[_0xa016('0x36')],_0xfcf6ad[_0xa016('0x34')]);_0x2e5b94[_0xa016('0x37')]=_[_0xa016('0x38')](_0xfcf6ad['model'],qs[_0xa016('0x39')](_0x406da2['query'][_0xa016('0x39')]));_0x2e5b94[_0xa016('0x37')]=_0x2e5b94[_0xa016('0x37')]['length']?_0x2e5b94[_0xa016('0x37')]:_0xfcf6ad[_0xa016('0x36')];if(!_0x406da2[_0xa016('0x34')][_0xa016('0x3a')](_0xa016('0x3b'))){_0x2e5b94[_0xa016('0x21')]=qs[_0xa016('0x21')](_0x406da2[_0xa016('0x34')][_0xa016('0x21')]);_0x2e5b94['offset']=qs[_0xa016('0x22')](_0x406da2[_0xa016('0x34')][_0xa016('0x22')]);}_0x2e5b94['order']=qs['sort'](_0x406da2[_0xa016('0x34')]['sort']);_0x2e5b94[_0xa016('0x3c')]=qs[_0xa016('0x3d')](_[_0xa016('0x3e')](_0x406da2[_0xa016('0x34')],_0xfcf6ad[_0xa016('0x3d')]),_0x498483);if(_0x406da2[_0xa016('0x34')][_0xa016('0x3f')]){_0x2e5b94[_0xa016('0x3c')]=_[_0xa016('0x40')](_0x2e5b94['where'],{'$or':_[_0xa016('0x2e')](_0x498483,function(_0x2981d3){if(_0x2981d3[_0xa016('0x32')]!==_0xa016('0x41')){var _0x4d4ceb={};_0x4d4ceb[_0x2981d3['name']]={'$like':'%'+_0x406da2[_0xa016('0x34')]['filter']+'%'};return _0x4d4ceb;}})});}_0x2e5b94=_[_0xa016('0x40')]({},_0x2e5b94,_0x406da2[_0xa016('0x42')]);var _0x28f6dd={'where':_0x2e5b94[_0xa016('0x3c')]};return db[_0xa016('0x2f')]['count'](_0x28f6dd)['then'](function(_0x16cf10){_0x16000a[_0xa016('0x43')]=_0x16cf10;if(_0x406da2[_0xa016('0x34')][_0xa016('0x44')]){_0x2e5b94['include']=[{'all':!![]}];}return db[_0xa016('0x2f')]['findAll'](_0x2e5b94);})[_0xa016('0x27')](function(_0x11d64c){_0x16000a[_0xa016('0x45')]=_0x11d64c;return _0x16000a;})[_0xa016('0x27')](respondWithFilteredResult(_0x7794fe,_0x2e5b94))['catch'](handleError(_0x7794fe,null));};exports[_0xa016('0x46')]=function(_0x1d6fff,_0x5c3420){var _0x387277={'raw':!![],'where':{'id':_0x1d6fff[_0xa016('0x47')]['id']}},_0x256d68={};_0x256d68['model']=_['keys'](db[_0xa016('0x2f')][_0xa016('0x30')]);_0x256d68['query']=_[_0xa016('0x35')](_0x1d6fff['query']);_0x256d68['filters']=_[_0xa016('0x38')](_0x256d68['model'],_0x256d68[_0xa016('0x34')]);_0x387277[_0xa016('0x37')]=_[_0xa016('0x38')](_0x256d68[_0xa016('0x36')],qs[_0xa016('0x39')](_0x1d6fff[_0xa016('0x34')][_0xa016('0x39')]));_0x387277[_0xa016('0x37')]=_0x387277['attributes'][_0xa016('0x48')]?_0x387277[_0xa016('0x37')]:_0x256d68[_0xa016('0x36')];if(_0x1d6fff[_0xa016('0x34')][_0xa016('0x44')]){_0x387277[_0xa016('0x49')]=[{'all':!![]}];}_0x387277=_[_0xa016('0x40')]({},_0x387277,_0x1d6fff['options']);return db['AnalyticExtractedReport'][_0xa016('0x4a')](_0x387277)['then'](handleEntityNotFound(_0x5c3420,null))[_0xa016('0x27')](respondWithResult(_0x5c3420,null))[_0xa016('0x4b')](handleError(_0x5c3420,null));};exports[_0xa016('0x4c')]=function(_0x25e9fe,_0x18874d){return db[_0xa016('0x2f')]['create'](_0x25e9fe['body'],{})['then'](function(_0xfca099){var _0x157c30=_0x25e9fe[_0xa016('0x4d')]['get']({'plain':!![]});if(!_0x157c30)throw new Error(_0xa016('0x4e'));if(_0x157c30[_0xa016('0x4f')]===_0xa016('0x4d')){var _0x41b612=_0xfca099[_0xa016('0x28')]({'plain':!![]});var _0x247072=_0xa016('0x29');return db[_0xa016('0x50')][_0xa016('0x4a')]({'where':{'name':_0x247072,'userProfileId':_0x157c30[_0xa016('0x51')]},'raw':!![]})[_0xa016('0x27')](function(_0x5b12ba){if(_0x5b12ba&&_0x5b12ba[_0xa016('0x52')]===0x0){return db[_0xa016('0x2a')]['create']({'name':_0x41b612[_0xa016('0x2c')],'resourceId':_0x41b612['id'],'type':_0x5b12ba[_0xa016('0x2c')],'sectionId':_0x5b12ba['id']},{})['then'](function(){return _0xfca099;});}else{return _0xfca099;}})[_0xa016('0x4b')](function(_0x3fd966){logger[_0xa016('0x2b')](_0xa016('0x53'),_0x3fd966);throw _0x3fd966;});}return _0xfca099;})[_0xa016('0x27')](respondWithResult(_0x18874d,0xc9))[_0xa016('0x4b')](handleError(_0x18874d,null));};exports[_0xa016('0x26')]=function(_0xaf174f,_0x16ab90){if(_0xaf174f[_0xa016('0x54')]['id']){delete _0xaf174f[_0xa016('0x54')]['id'];}return db[_0xa016('0x2f')][_0xa016('0x4a')]({'where':{'id':_0xaf174f['params']['id']}})[_0xa016('0x27')](handleEntityNotFound(_0x16ab90,null))[_0xa016('0x27')](saveUpdates(_0xaf174f[_0xa016('0x54')],null))[_0xa016('0x27')](respondWithResult(_0x16ab90,null))[_0xa016('0x4b')](handleError(_0x16ab90,null));};exports['destroy']=function(_0xb0215a,_0x5bf83e){return db[_0xa016('0x2f')][_0xa016('0x4a')]({'where':{'id':_0xb0215a[_0xa016('0x47')]['id']}})[_0xa016('0x27')](handleEntityNotFound(_0x5bf83e,null))[_0xa016('0x27')](removeEntity(_0x5bf83e,null))[_0xa016('0x4b')](handleError(_0x5bf83e,null));};exports['download']=function(_0x15ffdf,_0x7826f8,_0x375a68){return db[_0xa016('0x2f')][_0xa016('0x4a')]({'where':{'id':_0x15ffdf[_0xa016('0x47')]['id']},'attributes':[_0xa016('0x2c'),_0xa016('0x55'),'savename',_0xa016('0x56')],'raw':!![]})[_0xa016('0x27')](handleEntityNotFound(_0x7826f8,null))[_0xa016('0x27')](function(_0x12ccf1){if(_0x12ccf1){if(!fs[_0xa016('0x57')](path[_0xa016('0x58')](config[_0xa016('0x59')],_0xa016('0x5a'),_0x12ccf1['savename']))){throw new db[(_0xa016('0x5b'))]['ValidationError']('Report\x20not\x20found\x20or\x20empty');}if(_0x15ffdf['query'][_0xa016('0x5c')]){return _0x7826f8[_0xa016('0x1c')](0xc8);}return _0x7826f8[_0xa016('0x5d')](path['join'](config[_0xa016('0x59')],_0xa016('0x5a'),_0x12ccf1[_0xa016('0x5e')]),util[_0xa016('0x5f')]('%s.%s',_0x12ccf1['basename']||_0x12ccf1['name'],_0x12ccf1[_0xa016('0x56')][_0xa016('0x60')]()));}})[_0xa016('0x4b')](handleError(_0x7826f8,null));};
\ No newline at end of file
+var _0x1d03=['desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','get','ExtractedReports','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','options','AnalyticExtractedReport','includeAll','include','findAll','rows','catch','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','update','params','download','savename','existsSync','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','output','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce'];(function(_0xcd0918,_0x56bdf9){var _0x250704=function(_0x56788e){while(--_0x56788e){_0xcd0918['push'](_0xcd0918['shift']());}};_0x250704(++_0x56bdf9);}(_0x1d03,0x1d2));var _0x31d0=function(_0x4113e3,_0x33283e){_0x4113e3=_0x4113e3-0x0;var _0x57b3df=_0x1d03[_0x4113e3];return _0x57b3df;};'use strict';var emlformat=require(_0x31d0('0x0'));var rimraf=require(_0x31d0('0x1'));var zipdir=require(_0x31d0('0x2'));var jsonpatch=require(_0x31d0('0x3'));var rp=require('request-promise');var moment=require(_0x31d0('0x4'));var BPromise=require(_0x31d0('0x5'));var Mustache=require(_0x31d0('0x6'));var util=require(_0x31d0('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x31d0('0x8'));var ejs=require(_0x31d0('0x9'));var fs=require('fs');var fs_extra=require(_0x31d0('0xa'));var _=require(_0x31d0('0xb'));var squel=require(_0x31d0('0xc'));var crypto=require('crypto');var jsforce=require(_0x31d0('0xd'));var deskjs=require(_0x31d0('0xe'));var toCsv=require('to-csv');var querystring=require(_0x31d0('0xf'));var Papa=require('papaparse');var Redis=require(_0x31d0('0x10'));var authService=require(_0x31d0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x31d0('0x12'));var hardwareService=require(_0x31d0('0x13'));var logger=require(_0x31d0('0x14'))(_0x31d0('0x15'));var utils=require('../../config/utils');var config=require(_0x31d0('0x16'));var licenseUtil=require(_0x31d0('0x17'));var db=require(_0x31d0('0x18'))['db'];function respondWithStatusCode(_0x203d06,_0x4df6d0){_0x4df6d0=_0x4df6d0||0xcc;return function(_0x41319e){if(_0x41319e){return _0x203d06['sendStatus'](_0x4df6d0);}return _0x203d06[_0x31d0('0x19')](_0x4df6d0)[_0x31d0('0x1a')]();};}function respondWithResult(_0x56724c,_0x673378){_0x673378=_0x673378||0xc8;return function(_0x147a0c){if(_0x147a0c){return _0x56724c['status'](_0x673378)[_0x31d0('0x1b')](_0x147a0c);}};}function respondWithFilteredResult(_0x4f4587,_0x4f0a4d){return function(_0x4228b5){if(_0x4228b5){var _0x1705b2=typeof _0x4f0a4d[_0x31d0('0x1c')]==='undefined'&&typeof _0x4f0a4d[_0x31d0('0x1d')]===_0x31d0('0x1e');var _0x9baa4b=_0x4228b5['count'];var _0x30bf9a=_0x1705b2?0x0:_0x4f0a4d[_0x31d0('0x1c')];var _0x5d05c6=_0x1705b2?_0x4228b5[_0x31d0('0x1f')]:_0x4f0a4d[_0x31d0('0x1c')]+_0x4f0a4d['limit'];var _0x4c09d1;if(_0x5d05c6>=_0x9baa4b){_0x5d05c6=_0x9baa4b;_0x4c09d1=0xc8;}else{_0x4c09d1=0xce;}_0x4f4587[_0x31d0('0x19')](_0x4c09d1);return _0x4f4587[_0x31d0('0x20')](_0x31d0('0x21'),_0x30bf9a+'-'+_0x5d05c6+'/'+_0x9baa4b)[_0x31d0('0x1b')](_0x4228b5);}return null;};}function patchUpdates(_0x4fad2c){return function(_0x14b5d3){try{jsonpatch[_0x31d0('0x22')](_0x14b5d3,_0x4fad2c,!![]);}catch(_0x4c7560){return BPromise[_0x31d0('0x23')](_0x4c7560);}return _0x14b5d3[_0x31d0('0x24')]();};}function saveUpdates(_0x315d3f,_0x59c22d){return function(_0x454d22){if(_0x454d22){return _0x454d22['update'](_0x315d3f)[_0x31d0('0x25')](function(_0x125424){return _0x125424;});}return null;};}function removeEntity(_0x16997b,_0x5322e9){return function(_0x2cf86a){if(_0x2cf86a){return _0x2cf86a[_0x31d0('0x26')]()[_0x31d0('0x25')](function(){var _0x144db6=_0x2cf86a[_0x31d0('0x27')]({'plain':!![]});var _0x19fe71=_0x31d0('0x28');return db['UserProfileResource'][_0x31d0('0x26')]({'where':{'type':_0x19fe71,'resourceId':_0x144db6['id']}})['then'](function(){return _0x2cf86a;});})['then'](function(){_0x16997b[_0x31d0('0x19')](0xcc)[_0x31d0('0x1a')]();});}};}function handleEntityNotFound(_0xf49873,_0xa936a1){return function(_0x43a15c){if(!_0x43a15c){_0xf49873[_0x31d0('0x29')](0x194);}return _0x43a15c;};}function handleError(_0x3589df,_0x2cdeb2){_0x2cdeb2=_0x2cdeb2||0x1f4;return function(_0x5d62a2){logger[_0x31d0('0x2a')](_0x5d62a2[_0x31d0('0x2b')]);if(_0x5d62a2[_0x31d0('0x2c')]){delete _0x5d62a2[_0x31d0('0x2c')];}_0x3589df[_0x31d0('0x19')](_0x2cdeb2)[_0x31d0('0x2d')](_0x5d62a2);};}exports[_0x31d0('0x2e')]=function(_0x32487c,_0x5878ec){var _0x540bb1={},_0x4f8ce6={},_0x518ada={'count':0x0,'rows':[]};var _0x559210=_[_0x31d0('0x2f')](db['AnalyticExtractedReport'][_0x31d0('0x30')],function(_0x43a390){return{'name':_0x43a390[_0x31d0('0x31')],'type':_0x43a390['type']['key']};});_0x4f8ce6[_0x31d0('0x32')]=_['map'](_0x559210,_0x31d0('0x2c'));_0x4f8ce6[_0x31d0('0x33')]=_[_0x31d0('0x34')](_0x32487c['query']);_0x4f8ce6[_0x31d0('0x35')]=_[_0x31d0('0x36')](_0x4f8ce6[_0x31d0('0x32')],_0x4f8ce6[_0x31d0('0x33')]);_0x540bb1[_0x31d0('0x37')]=_[_0x31d0('0x36')](_0x4f8ce6['model'],qs[_0x31d0('0x38')](_0x32487c[_0x31d0('0x33')][_0x31d0('0x38')]));_0x540bb1['attributes']=_0x540bb1[_0x31d0('0x37')][_0x31d0('0x39')]?_0x540bb1[_0x31d0('0x37')]:_0x4f8ce6[_0x31d0('0x32')];if(!_0x32487c[_0x31d0('0x33')][_0x31d0('0x3a')]('nolimit')){_0x540bb1[_0x31d0('0x1d')]=qs[_0x31d0('0x1d')](_0x32487c[_0x31d0('0x33')]['limit']);_0x540bb1[_0x31d0('0x1c')]=qs['offset'](_0x32487c[_0x31d0('0x33')][_0x31d0('0x1c')]);}_0x540bb1[_0x31d0('0x3b')]=qs[_0x31d0('0x3c')](_0x32487c['query'][_0x31d0('0x3c')]);_0x540bb1[_0x31d0('0x3d')]=qs[_0x31d0('0x35')](_['pick'](_0x32487c[_0x31d0('0x33')],_0x4f8ce6[_0x31d0('0x35')]),_0x559210);if(_0x32487c[_0x31d0('0x33')][_0x31d0('0x3e')]){_0x540bb1[_0x31d0('0x3d')]=_[_0x31d0('0x3f')](_0x540bb1[_0x31d0('0x3d')],{'$or':_[_0x31d0('0x2f')](_0x559210,function(_0x1f6093){if(_0x1f6093[_0x31d0('0x40')]!==_0x31d0('0x41')){var _0xc3a5c5={};_0xc3a5c5[_0x1f6093[_0x31d0('0x2c')]]={'$like':'%'+_0x32487c[_0x31d0('0x33')][_0x31d0('0x3e')]+'%'};return _0xc3a5c5;}})});}_0x540bb1=_[_0x31d0('0x3f')]({},_0x540bb1,_0x32487c[_0x31d0('0x42')]);var _0x4ab6cc={'where':_0x540bb1[_0x31d0('0x3d')]};return db[_0x31d0('0x43')][_0x31d0('0x1f')](_0x4ab6cc)['then'](function(_0x3e3949){_0x518ada[_0x31d0('0x1f')]=_0x3e3949;if(_0x32487c['query'][_0x31d0('0x44')]){_0x540bb1[_0x31d0('0x45')]=[{'all':!![]}];}return db[_0x31d0('0x43')][_0x31d0('0x46')](_0x540bb1);})['then'](function(_0xdf5020){_0x518ada[_0x31d0('0x47')]=_0xdf5020;return _0x518ada;})[_0x31d0('0x25')](respondWithFilteredResult(_0x5878ec,_0x540bb1))[_0x31d0('0x48')](handleError(_0x5878ec,null));};exports['show']=function(_0x1f38dd,_0x37b63b){var _0x3e7665={'raw':!![],'where':{'id':_0x1f38dd['params']['id']}},_0x2bbb1d={};_0x2bbb1d['model']=_['keys'](db[_0x31d0('0x43')][_0x31d0('0x30')]);_0x2bbb1d[_0x31d0('0x33')]=_[_0x31d0('0x34')](_0x1f38dd[_0x31d0('0x33')]);_0x2bbb1d[_0x31d0('0x35')]=_[_0x31d0('0x36')](_0x2bbb1d['model'],_0x2bbb1d[_0x31d0('0x33')]);_0x3e7665[_0x31d0('0x37')]=_[_0x31d0('0x36')](_0x2bbb1d[_0x31d0('0x32')],qs[_0x31d0('0x38')](_0x1f38dd['query'][_0x31d0('0x38')]));_0x3e7665[_0x31d0('0x37')]=_0x3e7665[_0x31d0('0x37')][_0x31d0('0x39')]?_0x3e7665[_0x31d0('0x37')]:_0x2bbb1d[_0x31d0('0x32')];if(_0x1f38dd['query'][_0x31d0('0x44')]){_0x3e7665[_0x31d0('0x45')]=[{'all':!![]}];}_0x3e7665=_[_0x31d0('0x3f')]({},_0x3e7665,_0x1f38dd[_0x31d0('0x42')]);return db['AnalyticExtractedReport'][_0x31d0('0x49')](_0x3e7665)['then'](handleEntityNotFound(_0x37b63b,null))[_0x31d0('0x25')](respondWithResult(_0x37b63b,null))[_0x31d0('0x48')](handleError(_0x37b63b,null));};exports[_0x31d0('0x4a')]=function(_0x3869de,_0x554558){return db[_0x31d0('0x43')][_0x31d0('0x4a')](_0x3869de[_0x31d0('0x4b')],{})[_0x31d0('0x25')](function(_0xa71de1){var _0x1f8fcb=_0x3869de['user'][_0x31d0('0x27')]({'plain':!![]});if(!_0x1f8fcb)throw new Error(_0x31d0('0x4c'));if(_0x1f8fcb[_0x31d0('0x4d')]===_0x31d0('0x4e')){var _0x2b6e88=_0xa71de1[_0x31d0('0x27')]({'plain':!![]});var _0x3770fb='ExtractedReports';return db[_0x31d0('0x4f')][_0x31d0('0x49')]({'where':{'name':_0x3770fb,'userProfileId':_0x1f8fcb[_0x31d0('0x50')]},'raw':!![]})[_0x31d0('0x25')](function(_0x406cf0){if(_0x406cf0&&_0x406cf0['autoAssociation']===0x0){return db['UserProfileResource'][_0x31d0('0x4a')]({'name':_0x2b6e88[_0x31d0('0x2c')],'resourceId':_0x2b6e88['id'],'type':_0x406cf0[_0x31d0('0x2c')],'sectionId':_0x406cf0['id']},{})[_0x31d0('0x25')](function(){return _0xa71de1;});}else{return _0xa71de1;}})[_0x31d0('0x48')](function(_0x5b8a87){logger[_0x31d0('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b8a87);throw _0x5b8a87;});}return _0xa71de1;})[_0x31d0('0x25')](respondWithResult(_0x554558,0xc9))[_0x31d0('0x48')](handleError(_0x554558,null));};exports[_0x31d0('0x51')]=function(_0x28be45,_0x528b65){if(_0x28be45['body']['id']){delete _0x28be45[_0x31d0('0x4b')]['id'];}return db[_0x31d0('0x43')][_0x31d0('0x49')]({'where':{'id':_0x28be45[_0x31d0('0x52')]['id']}})['then'](handleEntityNotFound(_0x528b65,null))[_0x31d0('0x25')](saveUpdates(_0x28be45['body'],null))[_0x31d0('0x25')](respondWithResult(_0x528b65,null))[_0x31d0('0x48')](handleError(_0x528b65,null));};exports[_0x31d0('0x26')]=function(_0x41db31,_0x292141){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x41db31['params']['id']}})[_0x31d0('0x25')](handleEntityNotFound(_0x292141,null))[_0x31d0('0x25')](removeEntity(_0x292141,null))['catch'](handleError(_0x292141,null));};exports[_0x31d0('0x53')]=function(_0x2a40e9,_0x4e7a61,_0x42a1b4){return db[_0x31d0('0x43')][_0x31d0('0x49')]({'where':{'id':_0x2a40e9[_0x31d0('0x52')]['id']},'attributes':[_0x31d0('0x2c'),'basename',_0x31d0('0x54'),'output'],'raw':!![]})[_0x31d0('0x25')](handleEntityNotFound(_0x4e7a61,null))[_0x31d0('0x25')](function(_0x4bde05){if(_0x4bde05){if(!fs[_0x31d0('0x55')](path['join'](config[_0x31d0('0x56')],_0x31d0('0x57'),_0x4bde05[_0x31d0('0x54')]))){throw new db[(_0x31d0('0x58'))][(_0x31d0('0x59'))](_0x31d0('0x5a'));}if(_0x2a40e9[_0x31d0('0x33')][_0x31d0('0x5b')]){return _0x4e7a61[_0x31d0('0x29')](0xc8);}return _0x4e7a61[_0x31d0('0x53')](path['join'](config[_0x31d0('0x56')],_0x31d0('0x57'),_0x4bde05[_0x31d0('0x54')]),util[_0x31d0('0x5c')](_0x31d0('0x5d'),_0x4bde05['basename']||_0x4bde05[_0x31d0('0x2c')],_0x4bde05[_0x31d0('0x5e')][_0x31d0('0x5f')]()));}})['catch'](handleError(_0x4e7a61,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index db045b0..4950106 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 _0xa121=['analytics_extracted_reports','lodash','util','../../config/logger','moment','bluebird','path','rimraf','define','AnalyticExtractedReport'];(function(_0x2621e7,_0x3323f0){var _0x216828=function(_0x581cb3){while(--_0x581cb3){_0x2621e7['push'](_0x2621e7['shift']());}};_0x216828(++_0x3323f0);}(_0xa121,0xc9));var _0x1a12=function(_0x53f940,_0x1e4088){_0x53f940=_0x53f940-0x0;var _0x365769=_0xa121[_0x53f940];return _0x365769;};'use strict';var _=require(_0x1a12('0x0'));var util=require(_0x1a12('0x1'));var logger=require(_0x1a12('0x2'))('api');var moment=require(_0x1a12('0x3'));var BPromise=require(_0x1a12('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1a12('0x5'));var rimraf=require(_0x1a12('0x6'));var config=require('../../config/environment');var attributes=require('./analyticExtractedReport.attributes');module['exports']=function(_0x5cc6f4,_0x2b6777){return _0x5cc6f4[_0x1a12('0x7')](_0x1a12('0x8'),attributes,{'tableName':_0x1a12('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x03c5=['path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','AnalyticExtractedReport','analytics_extracted_reports','util','../../config/logger','request-promise'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x03c5,0x129));var _0x503c=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0x03c5[_0x1ae5ab];return _0x1ce001;};'use strict';var _=require('lodash');var util=require(_0x503c('0x0'));var logger=require(_0x503c('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x503c('0x2'));var fs=require('fs');var path=require(_0x503c('0x3'));var rimraf=require(_0x503c('0x4'));var config=require(_0x503c('0x5'));var attributes=require(_0x503c('0x6'));module[_0x503c('0x7')]=function(_0x19d14d,_0x3d8946){return _0x19d14d['define'](_0x503c('0x8'),attributes,{'tableName':_0x503c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index 83c70c2..ce703ba 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 _0xa1ab=['message','result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s'];(function(_0x2cade4,_0x4bf38f){var _0x5bafa8=function(_0x59edd4){while(--_0x59edd4){_0x2cade4['push'](_0x2cade4['shift']());}};_0x5bafa8(++_0x4bf38f);}(_0xa1ab,0x1a1));var _0xba1a=function(_0x1e3a63,_0x154185){_0x1e3a63=_0x1e3a63-0x0;var _0x4a7209=_0xa1ab[_0x1e3a63];return _0x4a7209;};'use strict';var _=require('lodash');var util=require(_0xba1a('0x0'));var moment=require(_0xba1a('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xba1a('0x2'));var db=require(_0xba1a('0x3'))['db'];var utils=require(_0xba1a('0x4'));var logger=require(_0xba1a('0x5'))(_0xba1a('0x6'));var config=require(_0xba1a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xba1a('0x8')][_0xba1a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x19b3bc,_0x35ba1f,_0x40e1fa){return new BPromise(function(_0x1a2cd3,_0x3384b8){return client[_0xba1a('0xa')](_0x19b3bc,_0x40e1fa)[_0xba1a('0xb')](function(_0x213554){logger[_0xba1a('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x35ba1f,_0xba1a('0xd'));logger[_0xba1a('0xe')](_0xba1a('0xf'),_0x35ba1f,_0xba1a('0xd'),JSON[_0xba1a('0x10')](_0x213554));if(_0x213554['error']){if(_0x213554[_0xba1a('0x11')][_0xba1a('0x12')]===0x1f4){logger[_0xba1a('0x11')](_0xba1a('0x13'),_0x35ba1f,_0x213554[_0xba1a('0x11')][_0xba1a('0x14')]);return _0x3384b8(_0x213554[_0xba1a('0x11')][_0xba1a('0x14')]);}logger[_0xba1a('0x11')](_0xba1a('0x13'),_0x35ba1f,_0x213554['error'][_0xba1a('0x14')]);return _0x1a2cd3(_0x213554[_0xba1a('0x11')][_0xba1a('0x14')]);}else{logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x35ba1f,'request\x20sent');_0x1a2cd3(_0x213554[_0xba1a('0x15')][_0xba1a('0x14')]);}})[_0xba1a('0x16')](function(_0x13cd4e){logger[_0xba1a('0x11')](_0xba1a('0x13'),_0x35ba1f,_0x13cd4e);_0x3384b8(_0x13cd4e);});});}
\ No newline at end of file
+var _0x7317=['then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x276f3b,_0x3718e9){var _0x1aa18e=function(_0x2ce604){while(--_0x2ce604){_0x276f3b['push'](_0x276f3b['shift']());}};_0x1aa18e(++_0x3718e9);}(_0x7317,0xac));var _0x7731=function(_0xac876e,_0x497c9d){_0xac876e=_0xac876e-0x0;var _0x318ae5=_0x7317[_0xac876e];return _0x318ae5;};'use strict';var _=require(_0x7731('0x0'));var util=require(_0x7731('0x1'));var moment=require(_0x7731('0x2'));var BPromise=require('bluebird');var rs=require(_0x7731('0x3'));var fs=require('fs');var Redis=require(_0x7731('0x4'));var db=require(_0x7731('0x5'))['db'];var utils=require(_0x7731('0x6'));var logger=require('../../config/logger')(_0x7731('0x7'));var config=require(_0x7731('0x8'));var jayson=require(_0x7731('0x9'));var client=jayson[_0x7731('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27f2d1,_0x41c8af,_0x16095c){return new BPromise(function(_0x336fef,_0x2c0a7e){return client[_0x7731('0xb')](_0x27f2d1,_0x16095c)[_0x7731('0xc')](function(_0x86abe4){logger[_0x7731('0xd')](_0x7731('0xe'),_0x41c8af,_0x7731('0xf'));logger[_0x7731('0x10')](_0x7731('0x11'),_0x41c8af,_0x7731('0xf'),JSON['stringify'](_0x86abe4));if(_0x86abe4[_0x7731('0x12')]){if(_0x86abe4[_0x7731('0x12')][_0x7731('0x13')]===0x1f4){logger['error'](_0x7731('0xe'),_0x41c8af,_0x86abe4['error'][_0x7731('0x14')]);return _0x2c0a7e(_0x86abe4[_0x7731('0x12')][_0x7731('0x14')]);}logger['error'](_0x7731('0xe'),_0x41c8af,_0x86abe4[_0x7731('0x12')][_0x7731('0x14')]);return _0x336fef(_0x86abe4[_0x7731('0x12')][_0x7731('0x14')]);}else{logger[_0x7731('0xd')](_0x7731('0xe'),_0x41c8af,_0x7731('0xf'));_0x336fef(_0x86abe4[_0x7731('0x15')][_0x7731('0x14')]);}})[_0x7731('0x16')](function(_0x587a4c){logger[_0x7731('0x12')](_0x7731('0xe'),_0x41c8af,_0x587a4c);_0x2c0a7e(_0x587a4c);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index d297b4e..681f758 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 _0x77d4=['destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated','get','/:id','/:id/download','download','post','create','put','update','delete'];(function(_0x5cc8,_0x1faa02){var _0x450661=function(_0x237b05){while(--_0x237b05){_0x5cc8['push'](_0x5cc8['shift']());}};_0x450661(++_0x1faa02);}(_0x77d4,0x152));var _0x477d=function(_0x5dca60,_0x2b2eeb){_0x5dca60=_0x5dca60-0x0;var _0xb2e3a9=_0x77d4[_0x5dca60];return _0xb2e3a9;};'use strict';var multer=require(_0x477d('0x0'));var util=require('util');var path=require(_0x477d('0x1'));var timeout=require('connect-timeout');var express=require(_0x477d('0x2'));var router=express[_0x477d('0x3')]();var fs_extra=require(_0x477d('0x4'));var auth=require(_0x477d('0x5'));var interaction=require(_0x477d('0x6'));var config=require(_0x477d('0x7'));var controller=require(_0x477d('0x8'));router['get']('/',auth[_0x477d('0x9')](),controller['index']);router[_0x477d('0xa')](_0x477d('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x477d('0xa')](_0x477d('0xc'),auth[_0x477d('0x9')](),controller[_0x477d('0xd')]);router[_0x477d('0xe')]('/',auth['isAuthenticated'](),controller[_0x477d('0xf')]);router[_0x477d('0x10')](_0x477d('0xb'),auth[_0x477d('0x9')](),controller[_0x477d('0x11')]);router[_0x477d('0x12')](_0x477d('0xb'),auth['isAuthenticated'](),controller[_0x477d('0x13')]);module[_0x477d('0x14')]=router;
\ No newline at end of file
+var _0x8887=['../../config/environment','index','/:id','isAuthenticated','get','/:id/download','download','post','put','update','destroy','util','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3163a0,_0xb631ed){var _0x39c168=function(_0x4acf4f){while(--_0x4acf4f){_0x3163a0['push'](_0x3163a0['shift']());}};_0x39c168(++_0xb631ed);}(_0x8887,0x164));var _0x7888=function(_0x10cfdd,_0x5eff47){_0x10cfdd=_0x10cfdd-0x0;var _0x158961=_0x8887[_0x10cfdd];return _0x158961;};'use strict';var multer=require('multer');var util=require(_0x7888('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x7888('0x1'));var auth=require(_0x7888('0x2'));var interaction=require(_0x7888('0x3'));var config=require(_0x7888('0x4'));var controller=require('./analyticExtractedReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x7888('0x5')]);router['get'](_0x7888('0x6'),auth[_0x7888('0x7')](),controller['show']);router[_0x7888('0x8')](_0x7888('0x9'),auth[_0x7888('0x7')](),controller[_0x7888('0xa')]);router[_0x7888('0xb')]('/',auth[_0x7888('0x7')](),controller['create']);router[_0x7888('0xc')](_0x7888('0x6'),auth[_0x7888('0x7')](),controller[_0x7888('0xd')]);router['delete'](_0x7888('0x6'),auth[_0x7888('0x7')](),controller[_0x7888('0xe')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 9e4fba8..803cb08 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 _0x8d12=['exports','TEXT','STRING','BOOLEAN'];(function(_0x598b78,_0xf4ee7e){var _0x6392fa=function(_0x810353){while(--_0x810353){_0x598b78['push'](_0x598b78['shift']());}};_0x6392fa(++_0xf4ee7e);}(_0x8d12,0x70));var _0x28d1=function(_0x20c9b2,_0x55d7b1){_0x20c9b2=_0x20c9b2-0x0;var _0x2c6030=_0x8d12[_0x20c9b2];return _0x2c6030;};'use strict';var Sequelize=require('sequelize');module[_0x28d1('0x0')]={'field':{'type':Sequelize[_0x28d1('0x1')]},'alias':{'type':Sequelize[_0x28d1('0x2')]},'function':{'type':Sequelize[_0x28d1('0x2')]},'format':{'type':Sequelize[_0x28d1('0x2')]},'groupBy':{'type':Sequelize[_0x28d1('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x79c0=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x2927e0,_0xcedf35){var _0x42c54a=function(_0x566cff){while(--_0x566cff){_0x2927e0['push'](_0x2927e0['shift']());}};_0x42c54a(++_0xcedf35);}(_0x79c0,0xc6));var _0x079c=function(_0x1b3322,_0xec8ce7){_0x1b3322=_0x1b3322-0x0;var _0x2467a1=_0x79c0[_0x1b3322];return _0x2467a1;};'use strict';var Sequelize=require(_0x079c('0x0'));module[_0x079c('0x1')]={'field':{'type':Sequelize[_0x079c('0x2')]},'alias':{'type':Sequelize[_0x079c('0x3')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x079c('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x079c('0x4')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 7510168..43042a6 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 _0x037b=['sox','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','AnalyticFieldReport','includeAll','include','findAll','rows','catch','show','params','options','find','create','bulkCreate','body','destroy','bulkDestroy','addFields','AnalyticCustomReport','findOne','transaction','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path'];(function(_0x1f7330,_0x13e6c4){var _0x16ec2e=function(_0xa925b1){while(--_0xa925b1){_0x1f7330['push'](_0x1f7330['shift']());}};_0x16ec2e(++_0x13e6c4);}(_0x037b,0x19c));var _0xb037=function(_0x1d16e8,_0x14d94e){_0x1d16e8=_0x1d16e8-0x0;var _0x8d6085=_0x037b[_0x1d16e8];return _0x8d6085;};'use strict';var emlformat=require(_0xb037('0x0'));var rimraf=require(_0xb037('0x1'));var zipdir=require(_0xb037('0x2'));var jsonpatch=require(_0xb037('0x3'));var rp=require(_0xb037('0x4'));var moment=require(_0xb037('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb037('0x6'));var path=require(_0xb037('0x7'));var sox=require(_0xb037('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb037('0x9'));var squel=require(_0xb037('0xa'));var crypto=require(_0xb037('0xb'));var jsforce=require(_0xb037('0xc'));var deskjs=require(_0xb037('0xd'));var toCsv=require(_0xb037('0xe'));var querystring=require('querystring');var Papa=require(_0xb037('0xf'));var Redis=require(_0xb037('0x10'));var authService=require(_0xb037('0x11'));var qs=require(_0xb037('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb037('0x13'));var logger=require(_0xb037('0x14'))(_0xb037('0x15'));var utils=require('../../config/utils');var config=require(_0xb037('0x16'));var licenseUtil=require(_0xb037('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5287a5,_0x56b843){_0x56b843=_0x56b843||0xcc;return function(_0x3cd18a){if(_0x3cd18a){return _0x5287a5['sendStatus'](_0x56b843);}return _0x5287a5[_0xb037('0x18')](_0x56b843)[_0xb037('0x19')]();};}function respondWithResult(_0x594534,_0xcf9645){_0xcf9645=_0xcf9645||0xc8;return function(_0x2fa2e6){if(_0x2fa2e6){return _0x594534[_0xb037('0x18')](_0xcf9645)[_0xb037('0x1a')](_0x2fa2e6);}};}function respondWithFilteredResult(_0x3757fa,_0x414ba0){return function(_0x24cc65){if(_0x24cc65){var _0x18005b=typeof _0x414ba0[_0xb037('0x1b')]===_0xb037('0x1c')&&typeof _0x414ba0[_0xb037('0x1d')]===_0xb037('0x1c');var _0x281b56=_0x24cc65[_0xb037('0x1e')];var _0x1b9dd5=_0x18005b?0x0:_0x414ba0[_0xb037('0x1b')];var _0x46695e=_0x18005b?_0x24cc65[_0xb037('0x1e')]:_0x414ba0[_0xb037('0x1b')]+_0x414ba0[_0xb037('0x1d')];var _0x1129b3;if(_0x46695e>=_0x281b56){_0x46695e=_0x281b56;_0x1129b3=0xc8;}else{_0x1129b3=0xce;}_0x3757fa['status'](_0x1129b3);return _0x3757fa['set'](_0xb037('0x1f'),_0x1b9dd5+'-'+_0x46695e+'/'+_0x281b56)['json'](_0x24cc65);}return null;};}function patchUpdates(_0xc0e6ab){return function(_0x1ae27c){try{jsonpatch[_0xb037('0x20')](_0x1ae27c,_0xc0e6ab,!![]);}catch(_0x5a686c){return BPromise[_0xb037('0x21')](_0x5a686c);}return _0x1ae27c[_0xb037('0x22')]();};}function saveUpdates(_0x1302a7,_0x3376d2){return function(_0x54cbc1){if(_0x54cbc1){return _0x54cbc1[_0xb037('0x23')](_0x1302a7)[_0xb037('0x24')](function(_0x3e7f31){return _0x3e7f31;});}return null;};}function removeEntity(_0x291bbc,_0x3b38a2){return function(_0x4dc61a){if(_0x4dc61a){return _0x4dc61a['destroy']()['then'](function(){_0x291bbc['status'](0xcc)[_0xb037('0x19')]();});}};}function handleEntityNotFound(_0x302c67,_0x548cfb){return function(_0x23f716){if(!_0x23f716){_0x302c67[_0xb037('0x25')](0x194);}return _0x23f716;};}function handleError(_0x89e2c1,_0x526b1f){_0x526b1f=_0x526b1f||0x1f4;return function(_0x477c15){logger[_0xb037('0x26')](_0x477c15[_0xb037('0x27')]);if(_0x477c15['name']){delete _0x477c15[_0xb037('0x28')];}_0x89e2c1[_0xb037('0x18')](_0x526b1f)[_0xb037('0x29')](_0x477c15);};}exports[_0xb037('0x2a')]=function(_0x57254a,_0x2560ab){var _0x221797={},_0x5f04fc={},_0x504ac7={'count':0x0,'rows':[]};var _0x10d96a=_['map'](db['AnalyticFieldReport'][_0xb037('0x2b')],function(_0x50cb69){return{'name':_0x50cb69[_0xb037('0x2c')],'type':_0x50cb69[_0xb037('0x2d')][_0xb037('0x2e')]};});_0x5f04fc[_0xb037('0x2f')]=_['map'](_0x10d96a,_0xb037('0x28'));_0x5f04fc[_0xb037('0x30')]=_[_0xb037('0x31')](_0x57254a[_0xb037('0x30')]);_0x5f04fc[_0xb037('0x32')]=_[_0xb037('0x33')](_0x5f04fc[_0xb037('0x2f')],_0x5f04fc[_0xb037('0x30')]);_0x221797[_0xb037('0x34')]=_[_0xb037('0x33')](_0x5f04fc[_0xb037('0x2f')],qs['fields'](_0x57254a[_0xb037('0x30')][_0xb037('0x35')]));_0x221797[_0xb037('0x34')]=_0x221797[_0xb037('0x34')][_0xb037('0x36')]?_0x221797['attributes']:_0x5f04fc[_0xb037('0x2f')];if(!_0x57254a[_0xb037('0x30')][_0xb037('0x37')](_0xb037('0x38'))){_0x221797[_0xb037('0x1d')]=qs[_0xb037('0x1d')](_0x57254a['query'][_0xb037('0x1d')]);_0x221797['offset']=qs[_0xb037('0x1b')](_0x57254a[_0xb037('0x30')]['offset']);}_0x221797[_0xb037('0x39')]=qs[_0xb037('0x3a')](_0x57254a[_0xb037('0x30')][_0xb037('0x3a')]);_0x221797[_0xb037('0x3b')]=qs[_0xb037('0x32')](_[_0xb037('0x3c')](_0x57254a[_0xb037('0x30')],_0x5f04fc['filters']),_0x10d96a);if(_0x57254a['query'][_0xb037('0x3d')]){_0x221797[_0xb037('0x3b')]=_[_0xb037('0x3e')](_0x221797[_0xb037('0x3b')],{'$or':_[_0xb037('0x3f')](_0x10d96a,function(_0x33ba05){if(_0x33ba05[_0xb037('0x2d')]!==_0xb037('0x40')){var _0x4e7911={};_0x4e7911[_0x33ba05['name']]={'$like':'%'+_0x57254a['query'][_0xb037('0x3d')]+'%'};return _0x4e7911;}})});}_0x221797=_[_0xb037('0x3e')]({},_0x221797,_0x57254a['options']);var _0x1d5cf4={'where':_0x221797[_0xb037('0x3b')]};return db[_0xb037('0x41')][_0xb037('0x1e')](_0x1d5cf4)[_0xb037('0x24')](function(_0x434690){_0x504ac7[_0xb037('0x1e')]=_0x434690;if(_0x57254a[_0xb037('0x30')][_0xb037('0x42')]){_0x221797[_0xb037('0x43')]=[{'all':!![]}];}return db[_0xb037('0x41')][_0xb037('0x44')](_0x221797);})[_0xb037('0x24')](function(_0x8cf7fe){_0x504ac7[_0xb037('0x45')]=_0x8cf7fe;return _0x504ac7;})['then'](respondWithFilteredResult(_0x2560ab,_0x221797))[_0xb037('0x46')](handleError(_0x2560ab,null));};exports[_0xb037('0x47')]=function(_0x49d902,_0xceb0bd){var _0x4364c5={'raw':![],'where':{'id':_0x49d902[_0xb037('0x48')]['id']}},_0x38f8af={};_0x38f8af['model']=_['keys'](db[_0xb037('0x41')][_0xb037('0x2b')]);_0x38f8af[_0xb037('0x30')]=_['keys'](_0x49d902[_0xb037('0x30')]);_0x38f8af[_0xb037('0x32')]=_[_0xb037('0x33')](_0x38f8af[_0xb037('0x2f')],_0x38f8af[_0xb037('0x30')]);_0x4364c5[_0xb037('0x34')]=_['intersection'](_0x38f8af['model'],qs[_0xb037('0x35')](_0x49d902[_0xb037('0x30')]['fields']));_0x4364c5[_0xb037('0x34')]=_0x4364c5['attributes'][_0xb037('0x36')]?_0x4364c5[_0xb037('0x34')]:_0x38f8af[_0xb037('0x2f')];if(_0x49d902['query'][_0xb037('0x42')]){_0x4364c5[_0xb037('0x43')]=[{'all':!![]}];}_0x4364c5=_[_0xb037('0x3e')]({},_0x4364c5,_0x49d902[_0xb037('0x49')]);return db[_0xb037('0x41')][_0xb037('0x4a')](_0x4364c5)[_0xb037('0x24')](handleEntityNotFound(_0xceb0bd,null))[_0xb037('0x24')](respondWithResult(_0xceb0bd,null))[_0xb037('0x46')](handleError(_0xceb0bd,null));};exports[_0xb037('0x4b')]=function(_0x319c48,_0x4f3aef){return db[_0xb037('0x41')][_0xb037('0x4b')](_0x319c48['body'],{})[_0xb037('0x24')](respondWithResult(_0x4f3aef,0xc9))[_0xb037('0x46')](handleError(_0x4f3aef,null));};exports[_0xb037('0x4c')]=function(_0x58d1c5,_0x1df94f){return db[_0xb037('0x41')][_0xb037('0x4c')](_0x58d1c5['body'],{'raw':![],'individualHooks':!![]})[_0xb037('0x24')](respondWithResult(_0x1df94f,0xc9))[_0xb037('0x46')](handleError(_0x1df94f,null));};exports[_0xb037('0x23')]=function(_0x4fd0cd,_0x5ee22f){if(_0x4fd0cd['body']['id']){delete _0x4fd0cd[_0xb037('0x4d')]['id'];}return db[_0xb037('0x41')][_0xb037('0x4a')]({'where':{'id':_0x4fd0cd['params']['id']}})['then'](handleEntityNotFound(_0x5ee22f,null))[_0xb037('0x24')](saveUpdates(_0x4fd0cd[_0xb037('0x4d')],null))[_0xb037('0x24')](respondWithResult(_0x5ee22f,null))[_0xb037('0x46')](handleError(_0x5ee22f,null));};exports[_0xb037('0x4e')]=function(_0x5c6b76,_0x166de5){return db[_0xb037('0x41')]['find']({'where':{'id':_0x5c6b76['params']['id']}})[_0xb037('0x24')](handleEntityNotFound(_0x166de5,null))['then'](removeEntity(_0x166de5,null))[_0xb037('0x46')](handleError(_0x166de5,null));};exports[_0xb037('0x4f')]=function(_0x50d35a,_0x3f2072){return db[_0xb037('0x41')][_0xb037('0x4e')]({'where':{'id':_0x50d35a['query']['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x3f2072,0xcc))[_0xb037('0x46')](handleError(_0x3f2072,null));};exports[_0xb037('0x50')]=function(_0xf04815,_0x830a5d,_0x483ca4){return db[_0xb037('0x51')][_0xb037('0x52')]({'where':{'id':_0xf04815[_0xb037('0x48')]['id']}})[_0xb037('0x24')](handleEntityNotFound(_0x830a5d,null))[_0xb037('0x24')](function(_0x1fc0c0){if(_0x1fc0c0){return db['sequelize'][_0xb037('0x53')](function(_0x2217f4){return db[_0xb037('0x41')][_0xb037('0x4e')]({'where':{'CustomReportId':_0xf04815['params']['id']},'transaction':_0x2217f4})[_0xb037('0x24')](function(_0xb5d70c){var _0x4db1eb=_[_0xb037('0x3f')](_0xf04815[_0xb037('0x4d')],function(_0x574cde){delete _0x574cde['id'];_0x574cde['CustomReportId']=_0xf04815[_0xb037('0x48')]['id'];return _0x574cde;});return db['AnalyticFieldReport'][_0xb037('0x4c')](_0x4db1eb,{'transaction':_0x2217f4});});})[_0xb037('0x24')](function(){return db['AnalyticFieldReport'][_0xb037('0x44')]({'where':{'CustomReportId':_0xf04815[_0xb037('0x48')]['id']}});});}})[_0xb037('0x24')](respondWithResult(_0x830a5d,null))['catch'](handleError(_0x830a5d,null));};
\ No newline at end of file
+var _0xe307=['fields','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','params','rawAttributes','length','include','find','create','body','bulkCreate','bulkDestroy','ids','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','error','name','index','map','AnalyticFieldReport','fieldName','type','key','model','query','keys','intersection','attributes'];(function(_0x1a071c,_0x55ee5d){var _0x4f7b06=function(_0x809015){while(--_0x809015){_0x1a071c['push'](_0x1a071c['shift']());}};_0x4f7b06(++_0x55ee5d);}(_0xe307,0x6f));var _0x7e30=function(_0x3ae159,_0xa19777){_0x3ae159=_0x3ae159-0x0;var _0x45938e=_0xe307[_0x3ae159];return _0x45938e;};'use strict';var emlformat=require(_0x7e30('0x0'));var rimraf=require(_0x7e30('0x1'));var zipdir=require(_0x7e30('0x2'));var jsonpatch=require(_0x7e30('0x3'));var rp=require(_0x7e30('0x4'));var moment=require(_0x7e30('0x5'));var BPromise=require(_0x7e30('0x6'));var Mustache=require('mustache');var util=require(_0x7e30('0x7'));var path=require(_0x7e30('0x8'));var sox=require(_0x7e30('0x9'));var csv=require(_0x7e30('0xa'));var ejs=require(_0x7e30('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7e30('0xc'));var squel=require(_0x7e30('0xd'));var crypto=require('crypto');var jsforce=require(_0x7e30('0xe'));var deskjs=require(_0x7e30('0xf'));var toCsv=require(_0x7e30('0xa'));var querystring=require(_0x7e30('0x10'));var Papa=require(_0x7e30('0x11'));var Redis=require(_0x7e30('0x12'));var authService=require(_0x7e30('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7e30('0x14'));var hardwareService=require(_0x7e30('0x15'));var logger=require(_0x7e30('0x16'))('api');var utils=require(_0x7e30('0x17'));var config=require(_0x7e30('0x18'));var licenseUtil=require(_0x7e30('0x19'));var db=require(_0x7e30('0x1a'))['db'];function respondWithStatusCode(_0x1341d4,_0x5c452b){_0x5c452b=_0x5c452b||0xcc;return function(_0x273e75){if(_0x273e75){return _0x1341d4[_0x7e30('0x1b')](_0x5c452b);}return _0x1341d4[_0x7e30('0x1c')](_0x5c452b)[_0x7e30('0x1d')]();};}function respondWithResult(_0x349ad1,_0x5e3a33){_0x5e3a33=_0x5e3a33||0xc8;return function(_0x15a518){if(_0x15a518){return _0x349ad1['status'](_0x5e3a33)[_0x7e30('0x1e')](_0x15a518);}};}function respondWithFilteredResult(_0x302500,_0x2eafbd){return function(_0xb013a9){if(_0xb013a9){var _0x327336=typeof _0x2eafbd[_0x7e30('0x1f')]===_0x7e30('0x20')&&typeof _0x2eafbd[_0x7e30('0x21')]===_0x7e30('0x20');var _0x17d3c0=_0xb013a9[_0x7e30('0x22')];var _0x499b60=_0x327336?0x0:_0x2eafbd[_0x7e30('0x1f')];var _0x429e9e=_0x327336?_0xb013a9['count']:_0x2eafbd['offset']+_0x2eafbd['limit'];var _0x364aca;if(_0x429e9e>=_0x17d3c0){_0x429e9e=_0x17d3c0;_0x364aca=0xc8;}else{_0x364aca=0xce;}_0x302500[_0x7e30('0x1c')](_0x364aca);return _0x302500[_0x7e30('0x23')](_0x7e30('0x24'),_0x499b60+'-'+_0x429e9e+'/'+_0x17d3c0)[_0x7e30('0x1e')](_0xb013a9);}return null;};}function patchUpdates(_0x18ac6f){return function(_0x2e790b){try{jsonpatch['apply'](_0x2e790b,_0x18ac6f,!![]);}catch(_0x2e869f){return BPromise[_0x7e30('0x25')](_0x2e869f);}return _0x2e790b['save']();};}function saveUpdates(_0x15839e,_0x6ccafa){return function(_0x4574c8){if(_0x4574c8){return _0x4574c8[_0x7e30('0x26')](_0x15839e)[_0x7e30('0x27')](function(_0xcf569b){return _0xcf569b;});}return null;};}function removeEntity(_0xea8bbe,_0x3dcf72){return function(_0x4d3bb7){if(_0x4d3bb7){return _0x4d3bb7['destroy']()['then'](function(){_0xea8bbe[_0x7e30('0x1c')](0xcc)[_0x7e30('0x1d')]();});}};}function handleEntityNotFound(_0x164637,_0x1f37b3){return function(_0x4766d8){if(!_0x4766d8){_0x164637['sendStatus'](0x194);}return _0x4766d8;};}function handleError(_0x567f37,_0x57ffe2){_0x57ffe2=_0x57ffe2||0x1f4;return function(_0xc6658e){logger[_0x7e30('0x28')](_0xc6658e['stack']);if(_0xc6658e[_0x7e30('0x29')]){delete _0xc6658e[_0x7e30('0x29')];}_0x567f37[_0x7e30('0x1c')](_0x57ffe2)['send'](_0xc6658e);};}exports[_0x7e30('0x2a')]=function(_0x1fb532,_0x8984b8){var _0x39b6ac={},_0x4f4ba2={},_0x137826={'count':0x0,'rows':[]};var _0x3087d3=_[_0x7e30('0x2b')](db[_0x7e30('0x2c')]['rawAttributes'],function(_0x3b8760){return{'name':_0x3b8760[_0x7e30('0x2d')],'type':_0x3b8760[_0x7e30('0x2e')][_0x7e30('0x2f')]};});_0x4f4ba2[_0x7e30('0x30')]=_[_0x7e30('0x2b')](_0x3087d3,'name');_0x4f4ba2[_0x7e30('0x31')]=_[_0x7e30('0x32')](_0x1fb532[_0x7e30('0x31')]);_0x4f4ba2['filters']=_[_0x7e30('0x33')](_0x4f4ba2[_0x7e30('0x30')],_0x4f4ba2['query']);_0x39b6ac[_0x7e30('0x34')]=_['intersection'](_0x4f4ba2[_0x7e30('0x30')],qs[_0x7e30('0x35')](_0x1fb532[_0x7e30('0x31')][_0x7e30('0x35')]));_0x39b6ac[_0x7e30('0x34')]=_0x39b6ac[_0x7e30('0x34')]['length']?_0x39b6ac[_0x7e30('0x34')]:_0x4f4ba2['model'];if(!_0x1fb532[_0x7e30('0x31')]['hasOwnProperty'](_0x7e30('0x36'))){_0x39b6ac[_0x7e30('0x21')]=qs[_0x7e30('0x21')](_0x1fb532[_0x7e30('0x31')]['limit']);_0x39b6ac[_0x7e30('0x1f')]=qs[_0x7e30('0x1f')](_0x1fb532[_0x7e30('0x31')][_0x7e30('0x1f')]);}_0x39b6ac['order']=qs[_0x7e30('0x37')](_0x1fb532[_0x7e30('0x31')][_0x7e30('0x37')]);_0x39b6ac[_0x7e30('0x38')]=qs[_0x7e30('0x39')](_[_0x7e30('0x3a')](_0x1fb532[_0x7e30('0x31')],_0x4f4ba2[_0x7e30('0x39')]),_0x3087d3);if(_0x1fb532[_0x7e30('0x31')][_0x7e30('0x3b')]){_0x39b6ac[_0x7e30('0x38')]=_[_0x7e30('0x3c')](_0x39b6ac['where'],{'$or':_[_0x7e30('0x2b')](_0x3087d3,function(_0x2823fb){if(_0x2823fb[_0x7e30('0x2e')]!==_0x7e30('0x3d')){var _0x21149d={};_0x21149d[_0x2823fb['name']]={'$like':'%'+_0x1fb532[_0x7e30('0x31')][_0x7e30('0x3b')]+'%'};return _0x21149d;}})});}_0x39b6ac=_['merge']({},_0x39b6ac,_0x1fb532[_0x7e30('0x3e')]);var _0x34dd97={'where':_0x39b6ac[_0x7e30('0x38')]};return db[_0x7e30('0x2c')]['count'](_0x34dd97)['then'](function(_0x4557e9){_0x137826[_0x7e30('0x22')]=_0x4557e9;if(_0x1fb532[_0x7e30('0x31')][_0x7e30('0x3f')]){_0x39b6ac['include']=[{'all':!![]}];}return db[_0x7e30('0x2c')]['findAll'](_0x39b6ac);})[_0x7e30('0x27')](function(_0x3849d7){_0x137826[_0x7e30('0x40')]=_0x3849d7;return _0x137826;})[_0x7e30('0x27')](respondWithFilteredResult(_0x8984b8,_0x39b6ac))[_0x7e30('0x41')](handleError(_0x8984b8,null));};exports['show']=function(_0x3a3cf8,_0x2337f4){var _0x320acc={'raw':![],'where':{'id':_0x3a3cf8[_0x7e30('0x42')]['id']}},_0x1582f8={};_0x1582f8['model']=_[_0x7e30('0x32')](db[_0x7e30('0x2c')][_0x7e30('0x43')]);_0x1582f8['query']=_[_0x7e30('0x32')](_0x3a3cf8[_0x7e30('0x31')]);_0x1582f8[_0x7e30('0x39')]=_['intersection'](_0x1582f8[_0x7e30('0x30')],_0x1582f8[_0x7e30('0x31')]);_0x320acc[_0x7e30('0x34')]=_[_0x7e30('0x33')](_0x1582f8['model'],qs[_0x7e30('0x35')](_0x3a3cf8[_0x7e30('0x31')]['fields']));_0x320acc[_0x7e30('0x34')]=_0x320acc[_0x7e30('0x34')][_0x7e30('0x44')]?_0x320acc['attributes']:_0x1582f8['model'];if(_0x3a3cf8[_0x7e30('0x31')]['includeAll']){_0x320acc[_0x7e30('0x45')]=[{'all':!![]}];}_0x320acc=_['merge']({},_0x320acc,_0x3a3cf8[_0x7e30('0x3e')]);return db[_0x7e30('0x2c')][_0x7e30('0x46')](_0x320acc)[_0x7e30('0x27')](handleEntityNotFound(_0x2337f4,null))[_0x7e30('0x27')](respondWithResult(_0x2337f4,null))[_0x7e30('0x41')](handleError(_0x2337f4,null));};exports[_0x7e30('0x47')]=function(_0x5ae487,_0x149456){return db['AnalyticFieldReport'][_0x7e30('0x47')](_0x5ae487[_0x7e30('0x48')],{})['then'](respondWithResult(_0x149456,0xc9))[_0x7e30('0x41')](handleError(_0x149456,null));};exports['bulkCreate']=function(_0x29484f,_0xc5672f){return db[_0x7e30('0x2c')][_0x7e30('0x49')](_0x29484f['body'],{'raw':![],'individualHooks':!![]})[_0x7e30('0x27')](respondWithResult(_0xc5672f,0xc9))[_0x7e30('0x41')](handleError(_0xc5672f,null));};exports[_0x7e30('0x26')]=function(_0x2dd364,_0x1a57c2){if(_0x2dd364[_0x7e30('0x48')]['id']){delete _0x2dd364[_0x7e30('0x48')]['id'];}return db[_0x7e30('0x2c')][_0x7e30('0x46')]({'where':{'id':_0x2dd364['params']['id']}})[_0x7e30('0x27')](handleEntityNotFound(_0x1a57c2,null))[_0x7e30('0x27')](saveUpdates(_0x2dd364['body'],null))[_0x7e30('0x27')](respondWithResult(_0x1a57c2,null))[_0x7e30('0x41')](handleError(_0x1a57c2,null));};exports['destroy']=function(_0x332b9a,_0x1300b2){return db[_0x7e30('0x2c')][_0x7e30('0x46')]({'where':{'id':_0x332b9a[_0x7e30('0x42')]['id']}})[_0x7e30('0x27')](handleEntityNotFound(_0x1300b2,null))['then'](removeEntity(_0x1300b2,null))['catch'](handleError(_0x1300b2,null));};exports[_0x7e30('0x4a')]=function(_0x2cc041,_0x11617e){return db[_0x7e30('0x2c')]['destroy']({'where':{'id':_0x2cc041['query'][_0x7e30('0x4b')]||[]},'raw':![],'individualHooks':!![]})[_0x7e30('0x27')](respondWithResult(_0x11617e,0xcc))[_0x7e30('0x41')](handleError(_0x11617e,null));};exports['addFields']=function(_0x4fc6b5,_0x5ac83c,_0x407c62){return db[_0x7e30('0x4c')][_0x7e30('0x4d')]({'where':{'id':_0x4fc6b5[_0x7e30('0x42')]['id']}})[_0x7e30('0x27')](handleEntityNotFound(_0x5ac83c,null))[_0x7e30('0x27')](function(_0x5d4e1e){if(_0x5d4e1e){return db[_0x7e30('0x4e')][_0x7e30('0x4f')](function(_0x5f25fa){return db[_0x7e30('0x2c')]['destroy']({'where':{'CustomReportId':_0x4fc6b5[_0x7e30('0x42')]['id']},'transaction':_0x5f25fa})['then'](function(_0x4f8b94){var _0x3e1b42=_['map'](_0x4fc6b5[_0x7e30('0x48')],function(_0x3cdc00){delete _0x3cdc00['id'];_0x3cdc00[_0x7e30('0x50')]=_0x4fc6b5[_0x7e30('0x42')]['id'];return _0x3cdc00;});return db[_0x7e30('0x2c')][_0x7e30('0x49')](_0x3e1b42,{'transaction':_0x5f25fa});});})[_0x7e30('0x27')](function(){return db['AnalyticFieldReport'][_0x7e30('0x51')]({'where':{'CustomReportId':_0x4fc6b5[_0x7e30('0x42')]['id']}});});}})[_0x7e30('0x27')](respondWithResult(_0x5ac83c,null))['catch'](handleError(_0x5ac83c,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 8ce0668..5288347 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 _0xe320=['../../config/logger','moment','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport'];(function(_0x2694a4,_0x46b7cb){var _0x113c52=function(_0x500d3b){while(--_0x500d3b){_0x2694a4['push'](_0x2694a4['shift']());}};_0x113c52(++_0x46b7cb);}(_0xe320,0x13b));var _0x0e32=function(_0x3ad25e,_0x5d80a6){_0x3ad25e=_0x3ad25e-0x0;var _0x156775=_0xe320[_0x3ad25e];return _0x156775;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0e32('0x0'))('api');var moment=require(_0x0e32('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0e32('0x2'));var rimraf=require(_0x0e32('0x3'));var config=require(_0x0e32('0x4'));var attributes=require(_0x0e32('0x5'));module[_0x0e32('0x6')]=function(_0x43d378,_0x3bf241){return _0x43d378[_0x0e32('0x7')](_0x0e32('0x8'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4564=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields'];(function(_0x317257,_0x1677dc){var _0x1f235d=function(_0xda0ccf){while(--_0xda0ccf){_0x317257['push'](_0x317257['shift']());}};_0x1f235d(++_0x1677dc);}(_0x4564,0x1c7));var _0x4456=function(_0x3486f2,_0x1153b5){_0x3486f2=_0x3486f2-0x0;var _0x2bb12c=_0x4564[_0x3486f2];return _0x2bb12c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4456('0x0'))(_0x4456('0x1'));var moment=require(_0x4456('0x2'));var BPromise=require(_0x4456('0x3'));var rp=require(_0x4456('0x4'));var fs=require('fs');var path=require(_0x4456('0x5'));var rimraf=require(_0x4456('0x6'));var config=require(_0x4456('0x7'));var attributes=require(_0x4456('0x8'));module[_0x4456('0x9')]=function(_0xf3c9d8,_0x3ff424){return _0xf3c9d8[_0x4456('0xa')](_0x4456('0xb'),attributes,{'tableName':_0x4456('0xc'),'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 bf30447..704e9bd 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 _0xcf90=['util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x36f641,_0x1a3063){var _0x39b299=function(_0x20c0a3){while(--_0x20c0a3){_0x36f641['push'](_0x36f641['shift']());}};_0x39b299(++_0x1a3063);}(_0xcf90,0x175));var _0x0cf9=function(_0x1b514f,_0x30fba3){_0x1b514f=_0x1b514f-0x0;var _0x3d5c97=_0xcf90[_0x1b514f];return _0x3d5c97;};'use strict';var _=require(_0x0cf9('0x0'));var util=require(_0x0cf9('0x1'));var moment=require('moment');var BPromise=require(_0x0cf9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0cf9('0x3'));var db=require(_0x0cf9('0x4'))['db'];var utils=require(_0x0cf9('0x5'));var logger=require(_0x0cf9('0x6'))(_0x0cf9('0x7'));var config=require('../../config/environment');var jayson=require(_0x0cf9('0x8'));var client=jayson[_0x0cf9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25973d,_0x20e17d,_0x51a0cb){return new BPromise(function(_0x5a1046,_0x34915){return client[_0x0cf9('0xa')](_0x25973d,_0x51a0cb)[_0x0cf9('0xb')](function(_0x418068){logger[_0x0cf9('0xc')](_0x0cf9('0xd'),_0x20e17d,_0x0cf9('0xe'));logger[_0x0cf9('0xf')](_0x0cf9('0x10'),_0x20e17d,_0x0cf9('0xe'),JSON[_0x0cf9('0x11')](_0x418068));if(_0x418068['error']){if(_0x418068[_0x0cf9('0x12')][_0x0cf9('0x13')]===0x1f4){logger[_0x0cf9('0x12')](_0x0cf9('0xd'),_0x20e17d,_0x418068['error'][_0x0cf9('0x14')]);return _0x34915(_0x418068['error'][_0x0cf9('0x14')]);}logger[_0x0cf9('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x20e17d,_0x418068[_0x0cf9('0x12')][_0x0cf9('0x14')]);return _0x5a1046(_0x418068[_0x0cf9('0x12')][_0x0cf9('0x14')]);}else{logger[_0x0cf9('0xc')](_0x0cf9('0xd'),_0x20e17d,_0x0cf9('0xe'));_0x5a1046(_0x418068[_0x0cf9('0x15')][_0x0cf9('0x14')]);}})['catch'](function(_0x5dbda8){logger['error'](_0x0cf9('0xd'),_0x20e17d,_0x5dbda8);_0x34915(_0x5dbda8);});});}
\ No newline at end of file
+var _0x7fef=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment'];(function(_0x1d7d58,_0x2bbefb){var _0x21a6cb=function(_0x2aa61c){while(--_0x2aa61c){_0x1d7d58['push'](_0x1d7d58['shift']());}};_0x21a6cb(++_0x2bbefb);}(_0x7fef,0xbd));var _0xf7fe=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7fef[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xf7fe('0x0'));var util=require(_0xf7fe('0x1'));var moment=require(_0xf7fe('0x2'));var BPromise=require(_0xf7fe('0x3'));var rs=require(_0xf7fe('0x4'));var fs=require('fs');var Redis=require(_0xf7fe('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf7fe('0x6'));var logger=require(_0xf7fe('0x7'))(_0xf7fe('0x8'));var config=require(_0xf7fe('0x9'));var jayson=require(_0xf7fe('0xa'));var client=jayson[_0xf7fe('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56f17e,_0x1a7633,_0x168a73){return new BPromise(function(_0xd149ae,_0x257952){return client[_0xf7fe('0xc')](_0x56f17e,_0x168a73)[_0xf7fe('0xd')](function(_0x333f5f){logger[_0xf7fe('0xe')](_0xf7fe('0xf'),_0x1a7633,'request\x20sent');logger[_0xf7fe('0x10')](_0xf7fe('0x11'),_0x1a7633,_0xf7fe('0x12'),JSON[_0xf7fe('0x13')](_0x333f5f));if(_0x333f5f['error']){if(_0x333f5f[_0xf7fe('0x14')][_0xf7fe('0x15')]===0x1f4){logger[_0xf7fe('0x14')](_0xf7fe('0xf'),_0x1a7633,_0x333f5f['error'][_0xf7fe('0x16')]);return _0x257952(_0x333f5f[_0xf7fe('0x14')][_0xf7fe('0x16')]);}logger[_0xf7fe('0x14')](_0xf7fe('0xf'),_0x1a7633,_0x333f5f[_0xf7fe('0x14')][_0xf7fe('0x16')]);return _0xd149ae(_0x333f5f[_0xf7fe('0x14')][_0xf7fe('0x16')]);}else{logger['info'](_0xf7fe('0xf'),_0x1a7633,_0xf7fe('0x12'));_0xd149ae(_0x333f5f[_0xf7fe('0x17')][_0xf7fe('0x16')]);}})['catch'](function(_0x54abbc){logger[_0xf7fe('0x14')](_0xf7fe('0xf'),_0x1a7633,_0x54abbc);_0x257952(_0x54abbc);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 378dd4e..74c97c7 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(_0x1c7033,_0x895853){var _0xf93472=function(_0x54d328){while(--_0x54d328){_0x1c7033['push'](_0x1c7033['shift']());}};_0xf93472(++_0x895853);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'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(_0x24882d,_0x3fdc21){var _0x5885e9=function(_0x5e105f){while(--_0x5e105f){_0x24882d['push'](_0x24882d['shift']());}};_0x5885e9(++_0x3fdc21);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'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 0f00c70..73668bd 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 _0xaf1d=['exports','STRING','name','TEXT','sequelize'];(function(_0x1b96f2,_0x14f728){var _0x53eace=function(_0x3eee42){while(--_0x3eee42){_0x1b96f2['push'](_0x1b96f2['shift']());}};_0x53eace(++_0x14f728);}(_0xaf1d,0x9f));var _0xdaf1=function(_0x526cde,_0x505ef0){_0x526cde=_0x526cde-0x0;var _0x489274=_0xaf1d[_0x526cde];return _0x489274;};'use strict';var Sequelize=require(_0xdaf1('0x0'));module[_0xdaf1('0x1')]={'name':{'type':Sequelize[_0xdaf1('0x2')],'allowNull':![],'unique':_0xdaf1('0x3')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xdaf1('0x4')]},'description':{'type':Sequelize[_0xdaf1('0x2')]}};
\ No newline at end of file
+var _0x3f19=['sequelize','STRING'];(function(_0x53e3de,_0x13da7b){var _0x7b905b=function(_0x29b56a){while(--_0x29b56a){_0x53e3de['push'](_0x53e3de['shift']());}};_0x7b905b(++_0x13da7b);}(_0x3f19,0xc0));var _0x93f1=function(_0x53db91,_0x29a9c0){_0x53db91=_0x53db91-0x0;var _0x5ccf61=_0x3f19[_0x53db91];return _0x5ccf61;};'use strict';var Sequelize=require(_0x93f1('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x93f1('0x1')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x93f1('0x1')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 050d849..6028521 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 _0x00bb=['create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','json','undefined','limit','offset','apply','reject','update','destroy','get','Metrics','then','stack','name','send','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','count','includeAll','include','findAll','rows','catch','show','params','keys','find'];(function(_0x3a0f4b,_0x365b6e){var _0x1238c8=function(_0x182d57){while(--_0x182d57){_0x3a0f4b['push'](_0x3a0f4b['shift']());}};_0x1238c8(++_0x365b6e);}(_0x00bb,0x1d8));var _0xb00b=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x00bb[_0x3054be];return _0x3df150;};'use strict';var emlformat=require(_0xb00b('0x0'));var rimraf=require(_0xb00b('0x1'));var zipdir=require(_0xb00b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb00b('0x3'));var moment=require('moment');var BPromise=require(_0xb00b('0x4'));var Mustache=require(_0xb00b('0x5'));var util=require('util');var path=require(_0xb00b('0x6'));var sox=require(_0xb00b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb00b('0x8'));var squel=require(_0xb00b('0x9'));var crypto=require(_0xb00b('0xa'));var jsforce=require(_0xb00b('0xb'));var deskjs=require(_0xb00b('0xc'));var toCsv=require(_0xb00b('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb00b('0xe'));var authService=require(_0xb00b('0xf'));var qs=require(_0xb00b('0x10'));var as=require(_0xb00b('0x11'));var hardwareService=require(_0xb00b('0x12'));var logger=require('../../config/logger')(_0xb00b('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb00b('0x14'))['db'];function respondWithStatusCode(_0x2d8ddf,_0x1be8aa){_0x1be8aa=_0x1be8aa||0xcc;return function(_0x466b9b){if(_0x466b9b){return _0x2d8ddf[_0xb00b('0x15')](_0x1be8aa);}return _0x2d8ddf[_0xb00b('0x16')](_0x1be8aa)['end']();};}function respondWithResult(_0x218de2,_0xb0d42e){_0xb0d42e=_0xb0d42e||0xc8;return function(_0x482fe6){if(_0x482fe6){return _0x218de2[_0xb00b('0x16')](_0xb0d42e)[_0xb00b('0x17')](_0x482fe6);}};}function respondWithFilteredResult(_0x540b79,_0x5da36b){return function(_0x9b471e){if(_0x9b471e){var _0x4dcd45=typeof _0x5da36b['offset']===_0xb00b('0x18')&&typeof _0x5da36b[_0xb00b('0x19')]===_0xb00b('0x18');var _0xbb72fc=_0x9b471e['count'];var _0x2a7231=_0x4dcd45?0x0:_0x5da36b['offset'];var _0x415f91=_0x4dcd45?_0x9b471e['count']:_0x5da36b[_0xb00b('0x1a')]+_0x5da36b['limit'];var _0xb26ebb;if(_0x415f91>=_0xbb72fc){_0x415f91=_0xbb72fc;_0xb26ebb=0xc8;}else{_0xb26ebb=0xce;}_0x540b79[_0xb00b('0x16')](_0xb26ebb);return _0x540b79['set']('Content-Range',_0x2a7231+'-'+_0x415f91+'/'+_0xbb72fc)[_0xb00b('0x17')](_0x9b471e);}return null;};}function patchUpdates(_0x4a334b){return function(_0x1344c4){try{jsonpatch[_0xb00b('0x1b')](_0x1344c4,_0x4a334b,!![]);}catch(_0x2fe48d){return BPromise[_0xb00b('0x1c')](_0x2fe48d);}return _0x1344c4['save']();};}function saveUpdates(_0x362ee0,_0x4df284){return function(_0x25a973){if(_0x25a973){return _0x25a973[_0xb00b('0x1d')](_0x362ee0)['then'](function(_0x231293){return _0x231293;});}return null;};}function removeEntity(_0x2896d1,_0x520444){return function(_0x3ab3cc){if(_0x3ab3cc){return _0x3ab3cc[_0xb00b('0x1e')]()['then'](function(){var _0x44efe5=_0x3ab3cc[_0xb00b('0x1f')]({'plain':!![]});var _0x3c9500=_0xb00b('0x20');return db['UserProfileResource']['destroy']({'where':{'type':_0x3c9500,'resourceId':_0x44efe5['id']}})[_0xb00b('0x21')](function(){return _0x3ab3cc;});})['then'](function(){_0x2896d1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x16ac55,_0x73b6b0){return function(_0x2592cf){if(!_0x2592cf){_0x16ac55[_0xb00b('0x15')](0x194);}return _0x2592cf;};}function handleError(_0x1f14fa,_0x197379){_0x197379=_0x197379||0x1f4;return function(_0x15d3b9){logger['error'](_0x15d3b9[_0xb00b('0x22')]);if(_0x15d3b9['name']){delete _0x15d3b9[_0xb00b('0x23')];}_0x1f14fa[_0xb00b('0x16')](_0x197379)[_0xb00b('0x24')](_0x15d3b9);};}exports['index']=function(_0x2fc11a,_0x280ed3){var _0x16fbd5={},_0x183233={},_0x303625={'count':0x0,'rows':[]};var _0x2b9824=_[_0xb00b('0x25')](db[_0xb00b('0x26')][_0xb00b('0x27')],function(_0x54e247){return{'name':_0x54e247[_0xb00b('0x28')],'type':_0x54e247[_0xb00b('0x29')]['key']};});_0x183233[_0xb00b('0x2a')]=_[_0xb00b('0x25')](_0x2b9824,'name');_0x183233[_0xb00b('0x2b')]=_['keys'](_0x2fc11a[_0xb00b('0x2b')]);_0x183233[_0xb00b('0x2c')]=_[_0xb00b('0x2d')](_0x183233[_0xb00b('0x2a')],_0x183233[_0xb00b('0x2b')]);_0x16fbd5[_0xb00b('0x2e')]=_[_0xb00b('0x2d')](_0x183233['model'],qs['fields'](_0x2fc11a['query'][_0xb00b('0x2f')]));_0x16fbd5[_0xb00b('0x2e')]=_0x16fbd5[_0xb00b('0x2e')][_0xb00b('0x30')]?_0x16fbd5['attributes']:_0x183233[_0xb00b('0x2a')];if(!_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x31')](_0xb00b('0x32'))){_0x16fbd5[_0xb00b('0x19')]=qs[_0xb00b('0x19')](_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x19')]);_0x16fbd5['offset']=qs['offset'](_0x2fc11a[_0xb00b('0x2b')]['offset']);}_0x16fbd5[_0xb00b('0x33')]=qs[_0xb00b('0x34')](_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x34')]);_0x16fbd5[_0xb00b('0x35')]=qs[_0xb00b('0x2c')](_[_0xb00b('0x36')](_0x2fc11a['query'],_0x183233[_0xb00b('0x2c')]),_0x2b9824);if(_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x37')]){_0x16fbd5[_0xb00b('0x35')]=_[_0xb00b('0x38')](_0x16fbd5[_0xb00b('0x35')],{'$or':_['map'](_0x2b9824,function(_0x36980a){if(_0x36980a[_0xb00b('0x29')]!=='VIRTUAL'){var _0x17ff34={};_0x17ff34[_0x36980a[_0xb00b('0x23')]]={'$like':'%'+_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x37')]+'%'};return _0x17ff34;}})});}_0x16fbd5=_[_0xb00b('0x38')]({},_0x16fbd5,_0x2fc11a['options']);var _0x14ff6a={'where':_0x16fbd5[_0xb00b('0x35')]};return db[_0xb00b('0x26')][_0xb00b('0x39')](_0x14ff6a)['then'](function(_0x4867fe){_0x303625[_0xb00b('0x39')]=_0x4867fe;if(_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x3a')]){_0x16fbd5[_0xb00b('0x3b')]=[{'all':!![]}];}return db[_0xb00b('0x26')][_0xb00b('0x3c')](_0x16fbd5);})[_0xb00b('0x21')](function(_0x493841){_0x303625[_0xb00b('0x3d')]=_0x493841;return _0x303625;})[_0xb00b('0x21')](respondWithFilteredResult(_0x280ed3,_0x16fbd5))[_0xb00b('0x3e')](handleError(_0x280ed3,null));};exports[_0xb00b('0x3f')]=function(_0x302ded,_0x1dc4c5){var _0x2e3d83={'raw':!![],'where':{'id':_0x302ded[_0xb00b('0x40')]['id']}},_0x974a29={};_0x974a29[_0xb00b('0x2a')]=_[_0xb00b('0x41')](db[_0xb00b('0x26')]['rawAttributes']);_0x974a29[_0xb00b('0x2b')]=_[_0xb00b('0x41')](_0x302ded[_0xb00b('0x2b')]);_0x974a29[_0xb00b('0x2c')]=_[_0xb00b('0x2d')](_0x974a29[_0xb00b('0x2a')],_0x974a29[_0xb00b('0x2b')]);_0x2e3d83[_0xb00b('0x2e')]=_[_0xb00b('0x2d')](_0x974a29[_0xb00b('0x2a')],qs[_0xb00b('0x2f')](_0x302ded[_0xb00b('0x2b')]['fields']));_0x2e3d83['attributes']=_0x2e3d83['attributes'][_0xb00b('0x30')]?_0x2e3d83[_0xb00b('0x2e')]:_0x974a29['model'];if(_0x302ded[_0xb00b('0x2b')][_0xb00b('0x3a')]){_0x2e3d83[_0xb00b('0x3b')]=[{'all':!![]}];}_0x2e3d83=_[_0xb00b('0x38')]({},_0x2e3d83,_0x302ded['options']);return db['AnalyticMetric'][_0xb00b('0x42')](_0x2e3d83)[_0xb00b('0x21')](handleEntityNotFound(_0x1dc4c5,null))['then'](respondWithResult(_0x1dc4c5,null))['catch'](handleError(_0x1dc4c5,null));};exports[_0xb00b('0x43')]=function(_0x3a205d,_0x4e0be4){return db[_0xb00b('0x26')]['create'](_0x3a205d['body'],{})['then'](function(_0x465d90){var _0x481515=_0x3a205d[_0xb00b('0x44')][_0xb00b('0x1f')]({'plain':!![]});if(!_0x481515)throw new Error(_0xb00b('0x45'));if(_0x481515[_0xb00b('0x46')]===_0xb00b('0x44')){var _0xda60ca=_0x465d90['get']({'plain':!![]});var _0x5bd40c=_0xb00b('0x20');return db[_0xb00b('0x47')]['find']({'where':{'name':_0x5bd40c,'userProfileId':_0x481515[_0xb00b('0x48')]},'raw':!![]})[_0xb00b('0x21')](function(_0x57f6ab){if(_0x57f6ab&&_0x57f6ab[_0xb00b('0x49')]===0x0){return db[_0xb00b('0x4a')][_0xb00b('0x43')]({'name':_0xda60ca['name'],'resourceId':_0xda60ca['id'],'type':_0x57f6ab['name'],'sectionId':_0x57f6ab['id']},{})[_0xb00b('0x21')](function(){return _0x465d90;});}else{return _0x465d90;}})[_0xb00b('0x3e')](function(_0x12737d){logger[_0xb00b('0x4b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x12737d);throw _0x12737d;});}return _0x465d90;})[_0xb00b('0x21')](respondWithResult(_0x4e0be4,0xc9))[_0xb00b('0x3e')](handleError(_0x4e0be4,null));};exports['update']=function(_0x4cd9fd,_0x160965){if(_0x4cd9fd['body']['id']){delete _0x4cd9fd[_0xb00b('0x4c')]['id'];}return db[_0xb00b('0x26')][_0xb00b('0x42')]({'where':{'id':_0x4cd9fd[_0xb00b('0x40')]['id']}})[_0xb00b('0x21')](handleEntityNotFound(_0x160965,null))[_0xb00b('0x21')](saveUpdates(_0x4cd9fd['body'],null))[_0xb00b('0x21')](respondWithResult(_0x160965,null))['catch'](handleError(_0x160965,null));};exports[_0xb00b('0x1e')]=function(_0x98caa9,_0x4129ba){return db['AnalyticMetric'][_0xb00b('0x42')]({'where':{'id':_0x98caa9[_0xb00b('0x40')]['id']}})[_0xb00b('0x21')](handleEntityNotFound(_0x4129ba,null))['then'](removeEntity(_0x4129ba,null))[_0xb00b('0x3e')](handleError(_0x4129ba,null));};
\ No newline at end of file
+var _0x4b84=['status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','sendStatus','stack','name','map','AnalyticMetric','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','mustache','util','path','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x41a60b,_0xc398d){var _0x10c95a=function(_0x2b8bd9){while(--_0x2b8bd9){_0x41a60b['push'](_0x41a60b['shift']());}};_0x10c95a(++_0xc398d);}(_0x4b84,0x1cc));var _0x44b8=function(_0x7b173,_0x539d7f){_0x7b173=_0x7b173-0x0;var _0x1c598c=_0x4b84[_0x7b173];return _0x1c598c;};'use strict';var emlformat=require(_0x44b8('0x0'));var rimraf=require(_0x44b8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x44b8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x44b8('0x3'));var util=require(_0x44b8('0x4'));var path=require(_0x44b8('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x44b8('0x6'));var _=require('lodash');var squel=require(_0x44b8('0x7'));var crypto=require('crypto');var jsforce=require(_0x44b8('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x44b8('0x9'));var Papa=require(_0x44b8('0xa'));var Redis=require(_0x44b8('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x44b8('0xc'));var as=require(_0x44b8('0xd'));var hardwareService=require(_0x44b8('0xe'));var logger=require(_0x44b8('0xf'))(_0x44b8('0x10'));var utils=require(_0x44b8('0x11'));var config=require(_0x44b8('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x44b8('0x13'))['db'];function respondWithStatusCode(_0x4301a6,_0x4bcc43){_0x4bcc43=_0x4bcc43||0xcc;return function(_0x194230){if(_0x194230){return _0x4301a6['sendStatus'](_0x4bcc43);}return _0x4301a6[_0x44b8('0x14')](_0x4bcc43)[_0x44b8('0x15')]();};}function respondWithResult(_0x4df670,_0x63e8f6){_0x63e8f6=_0x63e8f6||0xc8;return function(_0x4be54c){if(_0x4be54c){return _0x4df670['status'](_0x63e8f6)[_0x44b8('0x16')](_0x4be54c);}};}function respondWithFilteredResult(_0x2af0ad,_0x1722da){return function(_0x41ab46){if(_0x41ab46){var _0x5e52f2=typeof _0x1722da['offset']==='undefined'&&typeof _0x1722da[_0x44b8('0x17')]==='undefined';var _0x28ef36=_0x41ab46[_0x44b8('0x18')];var _0x55e258=_0x5e52f2?0x0:_0x1722da[_0x44b8('0x19')];var _0xe3de8f=_0x5e52f2?_0x41ab46['count']:_0x1722da[_0x44b8('0x19')]+_0x1722da[_0x44b8('0x17')];var _0x4b600f;if(_0xe3de8f>=_0x28ef36){_0xe3de8f=_0x28ef36;_0x4b600f=0xc8;}else{_0x4b600f=0xce;}_0x2af0ad[_0x44b8('0x14')](_0x4b600f);return _0x2af0ad[_0x44b8('0x1a')](_0x44b8('0x1b'),_0x55e258+'-'+_0xe3de8f+'/'+_0x28ef36)[_0x44b8('0x16')](_0x41ab46);}return null;};}function patchUpdates(_0x102ef9){return function(_0x369c09){try{jsonpatch[_0x44b8('0x1c')](_0x369c09,_0x102ef9,!![]);}catch(_0x9b0536){return BPromise[_0x44b8('0x1d')](_0x9b0536);}return _0x369c09[_0x44b8('0x1e')]();};}function saveUpdates(_0x1d642b,_0x14996c){return function(_0x48327e){if(_0x48327e){return _0x48327e[_0x44b8('0x1f')](_0x1d642b)[_0x44b8('0x20')](function(_0x416b34){return _0x416b34;});}return null;};}function removeEntity(_0x1418db,_0x305a5c){return function(_0x51a34a){if(_0x51a34a){return _0x51a34a[_0x44b8('0x21')]()['then'](function(){var _0x41a922=_0x51a34a[_0x44b8('0x22')]({'plain':!![]});var _0x25a0c1=_0x44b8('0x23');return db[_0x44b8('0x24')]['destroy']({'where':{'type':_0x25a0c1,'resourceId':_0x41a922['id']}})[_0x44b8('0x20')](function(){return _0x51a34a;});})['then'](function(){_0x1418db[_0x44b8('0x14')](0xcc)[_0x44b8('0x15')]();});}};}function handleEntityNotFound(_0x549a26,_0x17ac44){return function(_0x470f49){if(!_0x470f49){_0x549a26[_0x44b8('0x25')](0x194);}return _0x470f49;};}function handleError(_0x59c1bf,_0xb22107){_0xb22107=_0xb22107||0x1f4;return function(_0x242342){logger['error'](_0x242342[_0x44b8('0x26')]);if(_0x242342['name']){delete _0x242342[_0x44b8('0x27')];}_0x59c1bf['status'](_0xb22107)['send'](_0x242342);};}exports['index']=function(_0x387293,_0x29b18d){var _0x44ce5a={},_0x1bd1be={},_0x38cd17={'count':0x0,'rows':[]};var _0xc3f667=_[_0x44b8('0x28')](db[_0x44b8('0x29')][_0x44b8('0x2a')],function(_0x28f918){return{'name':_0x28f918[_0x44b8('0x2b')],'type':_0x28f918[_0x44b8('0x2c')][_0x44b8('0x2d')]};});_0x1bd1be['model']=_[_0x44b8('0x28')](_0xc3f667,'name');_0x1bd1be[_0x44b8('0x2e')]=_[_0x44b8('0x2f')](_0x387293[_0x44b8('0x2e')]);_0x1bd1be[_0x44b8('0x30')]=_[_0x44b8('0x31')](_0x1bd1be['model'],_0x1bd1be[_0x44b8('0x2e')]);_0x44ce5a[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x1bd1be[_0x44b8('0x33')],qs[_0x44b8('0x34')](_0x387293['query'][_0x44b8('0x34')]));_0x44ce5a[_0x44b8('0x32')]=_0x44ce5a[_0x44b8('0x32')][_0x44b8('0x35')]?_0x44ce5a[_0x44b8('0x32')]:_0x1bd1be[_0x44b8('0x33')];if(!_0x387293[_0x44b8('0x2e')][_0x44b8('0x36')](_0x44b8('0x37'))){_0x44ce5a[_0x44b8('0x17')]=qs[_0x44b8('0x17')](_0x387293[_0x44b8('0x2e')][_0x44b8('0x17')]);_0x44ce5a[_0x44b8('0x19')]=qs[_0x44b8('0x19')](_0x387293[_0x44b8('0x2e')][_0x44b8('0x19')]);}_0x44ce5a[_0x44b8('0x38')]=qs[_0x44b8('0x39')](_0x387293[_0x44b8('0x2e')][_0x44b8('0x39')]);_0x44ce5a[_0x44b8('0x3a')]=qs['filters'](_[_0x44b8('0x3b')](_0x387293[_0x44b8('0x2e')],_0x1bd1be['filters']),_0xc3f667);if(_0x387293[_0x44b8('0x2e')][_0x44b8('0x3c')]){_0x44ce5a[_0x44b8('0x3a')]=_[_0x44b8('0x3d')](_0x44ce5a['where'],{'$or':_[_0x44b8('0x28')](_0xc3f667,function(_0x11e4e3){if(_0x11e4e3[_0x44b8('0x2c')]!==_0x44b8('0x3e')){var _0x9cb2a={};_0x9cb2a[_0x11e4e3[_0x44b8('0x27')]]={'$like':'%'+_0x387293[_0x44b8('0x2e')][_0x44b8('0x3c')]+'%'};return _0x9cb2a;}})});}_0x44ce5a=_[_0x44b8('0x3d')]({},_0x44ce5a,_0x387293[_0x44b8('0x3f')]);var _0x1c9983={'where':_0x44ce5a[_0x44b8('0x3a')]};return db[_0x44b8('0x29')][_0x44b8('0x18')](_0x1c9983)[_0x44b8('0x20')](function(_0x29b43f){_0x38cd17['count']=_0x29b43f;if(_0x387293[_0x44b8('0x2e')][_0x44b8('0x40')]){_0x44ce5a[_0x44b8('0x41')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x44b8('0x42')](_0x44ce5a);})[_0x44b8('0x20')](function(_0x229cc9){_0x38cd17['rows']=_0x229cc9;return _0x38cd17;})[_0x44b8('0x20')](respondWithFilteredResult(_0x29b18d,_0x44ce5a))[_0x44b8('0x43')](handleError(_0x29b18d,null));};exports[_0x44b8('0x44')]=function(_0x334f86,_0xfd590a){var _0x499a3e={'raw':!![],'where':{'id':_0x334f86[_0x44b8('0x45')]['id']}},_0x5ae5f9={};_0x5ae5f9[_0x44b8('0x33')]=_[_0x44b8('0x2f')](db[_0x44b8('0x29')][_0x44b8('0x2a')]);_0x5ae5f9[_0x44b8('0x2e')]=_[_0x44b8('0x2f')](_0x334f86[_0x44b8('0x2e')]);_0x5ae5f9[_0x44b8('0x30')]=_[_0x44b8('0x31')](_0x5ae5f9[_0x44b8('0x33')],_0x5ae5f9[_0x44b8('0x2e')]);_0x499a3e[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x5ae5f9[_0x44b8('0x33')],qs[_0x44b8('0x34')](_0x334f86[_0x44b8('0x2e')][_0x44b8('0x34')]));_0x499a3e[_0x44b8('0x32')]=_0x499a3e['attributes']['length']?_0x499a3e[_0x44b8('0x32')]:_0x5ae5f9[_0x44b8('0x33')];if(_0x334f86[_0x44b8('0x2e')][_0x44b8('0x40')]){_0x499a3e[_0x44b8('0x41')]=[{'all':!![]}];}_0x499a3e=_[_0x44b8('0x3d')]({},_0x499a3e,_0x334f86[_0x44b8('0x3f')]);return db['AnalyticMetric'][_0x44b8('0x46')](_0x499a3e)['then'](handleEntityNotFound(_0xfd590a,null))[_0x44b8('0x20')](respondWithResult(_0xfd590a,null))[_0x44b8('0x43')](handleError(_0xfd590a,null));};exports[_0x44b8('0x47')]=function(_0x9207bf,_0x103d57){return db[_0x44b8('0x29')]['create'](_0x9207bf[_0x44b8('0x48')],{})[_0x44b8('0x20')](function(_0x10602c){var _0x25d266=_0x9207bf['user'][_0x44b8('0x22')]({'plain':!![]});if(!_0x25d266)throw new Error(_0x44b8('0x49'));if(_0x25d266[_0x44b8('0x4a')]===_0x44b8('0x4b')){var _0x44ec23=_0x10602c[_0x44b8('0x22')]({'plain':!![]});var _0x500bad=_0x44b8('0x23');return db[_0x44b8('0x4c')][_0x44b8('0x46')]({'where':{'name':_0x500bad,'userProfileId':_0x25d266[_0x44b8('0x4d')]},'raw':!![]})[_0x44b8('0x20')](function(_0x57d0e2){if(_0x57d0e2&&_0x57d0e2['autoAssociation']===0x0){return db[_0x44b8('0x24')]['create']({'name':_0x44ec23[_0x44b8('0x27')],'resourceId':_0x44ec23['id'],'type':_0x57d0e2['name'],'sectionId':_0x57d0e2['id']},{})[_0x44b8('0x20')](function(){return _0x10602c;});}else{return _0x10602c;}})[_0x44b8('0x43')](function(_0x1a29f6){logger[_0x44b8('0x4e')](_0x44b8('0x4f'),_0x1a29f6);throw _0x1a29f6;});}return _0x10602c;})[_0x44b8('0x20')](respondWithResult(_0x103d57,0xc9))[_0x44b8('0x43')](handleError(_0x103d57,null));};exports['update']=function(_0x3ad278,_0x37b2c2){if(_0x3ad278[_0x44b8('0x48')]['id']){delete _0x3ad278['body']['id'];}return db[_0x44b8('0x29')][_0x44b8('0x46')]({'where':{'id':_0x3ad278[_0x44b8('0x45')]['id']}})[_0x44b8('0x20')](handleEntityNotFound(_0x37b2c2,null))['then'](saveUpdates(_0x3ad278[_0x44b8('0x48')],null))[_0x44b8('0x20')](respondWithResult(_0x37b2c2,null))['catch'](handleError(_0x37b2c2,null));};exports[_0x44b8('0x21')]=function(_0x19f22b,_0x35136e){return db[_0x44b8('0x29')][_0x44b8('0x46')]({'where':{'id':_0x19f22b['params']['id']}})['then'](handleEntityNotFound(_0x35136e,null))[_0x44b8('0x20')](removeEntity(_0x35136e,null))[_0x44b8('0x43')](handleError(_0x35136e,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 4b89328..d60d316 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 _0x482d=['path','../../config/environment','./analyticMetric.attributes','exports','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x84d8fb,_0x107be4){var _0x4de1fb=function(_0x28a4b1){while(--_0x28a4b1){_0x84d8fb['push'](_0x84d8fb['shift']());}};_0x4de1fb(++_0x107be4);}(_0x482d,0x16c));var _0xd482=function(_0x3b71e2,_0x35c979){_0x3b71e2=_0x3b71e2-0x0;var _0x1bd52e=_0x482d[_0x3b71e2];return _0x1bd52e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd482('0x0'))(_0xd482('0x1'));var moment=require(_0xd482('0x2'));var BPromise=require(_0xd482('0x3'));var rp=require(_0xd482('0x4'));var fs=require('fs');var path=require(_0xd482('0x5'));var rimraf=require('rimraf');var config=require(_0xd482('0x6'));var attributes=require(_0xd482('0x7'));module[_0xd482('0x8')]=function(_0x57cd2c,_0x3b9989){return _0x57cd2c['define']('AnalyticMetric',attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0f4d=['api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0x0f4d,0x12c));var _0xd0f4=function(_0x3ff530,_0x1c1ee1){_0x3ff530=_0x3ff530-0x0;var _0x278bb0=_0x0f4d[_0x3ff530];return _0x278bb0;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xd0f4('0x0'));var moment=require('moment');var BPromise=require(_0xd0f4('0x1'));var rp=require(_0xd0f4('0x2'));var fs=require('fs');var path=require(_0xd0f4('0x3'));var rimraf=require(_0xd0f4('0x4'));var config=require(_0xd0f4('0x5'));var attributes=require(_0xd0f4('0x6'));module[_0xd0f4('0x7')]=function(_0x1d9a9d,_0x531f85){return _0x1d9a9d[_0xd0f4('0x8')](_0xd0f4('0x9'),attributes,{'tableName':'analytics_metrics','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 433f1b3..820e7e4 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 _0x2e39=['jayson/promise','client','http','then','info','AnalyticMetric,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','rpc','../../config/environment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2e39,0x1c5));var _0x92e3=function(_0x319a63,_0x3a7d3f){_0x319a63=_0x319a63-0x0;var _0x353bca=_0x2e39[_0x319a63];return _0x353bca;};'use strict';var _=require(_0x92e3('0x0'));var util=require(_0x92e3('0x1'));var moment=require('moment');var BPromise=require(_0x92e3('0x2'));var rs=require(_0x92e3('0x3'));var fs=require('fs');var Redis=require(_0x92e3('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x92e3('0x5'));var config=require(_0x92e3('0x6'));var jayson=require(_0x92e3('0x7'));var client=jayson[_0x92e3('0x8')][_0x92e3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x14f09a,_0x33e336,_0x4d9789){return new BPromise(function(_0x374696,_0x25dc98){return client['request'](_0x14f09a,_0x4d9789)[_0x92e3('0xa')](function(_0x2f4ca2){logger[_0x92e3('0xb')](_0x92e3('0xc'),_0x33e336,'request\x20sent');logger[_0x92e3('0xd')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x33e336,_0x92e3('0xe'),JSON[_0x92e3('0xf')](_0x2f4ca2));if(_0x2f4ca2[_0x92e3('0x10')]){if(_0x2f4ca2[_0x92e3('0x10')][_0x92e3('0x11')]===0x1f4){logger[_0x92e3('0x10')](_0x92e3('0xc'),_0x33e336,_0x2f4ca2[_0x92e3('0x10')]['message']);return _0x25dc98(_0x2f4ca2[_0x92e3('0x10')][_0x92e3('0x12')]);}logger[_0x92e3('0x10')](_0x92e3('0xc'),_0x33e336,_0x2f4ca2['error'][_0x92e3('0x12')]);return _0x374696(_0x2f4ca2[_0x92e3('0x10')][_0x92e3('0x12')]);}else{logger[_0x92e3('0xb')](_0x92e3('0xc'),_0x33e336,_0x92e3('0xe'));_0x374696(_0x2f4ca2['result'][_0x92e3('0x12')]);}})[_0x92e3('0x13')](function(_0x5051c4){logger['error'](_0x92e3('0xc'),_0x33e336,_0x5051c4);_0x25dc98(_0x5051c4);});});}
\ No newline at end of file
+var _0x999e=['request','then','info','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4c649b,_0x1eb725){var _0x5d7983=function(_0x34026f){while(--_0x34026f){_0x4c649b['push'](_0x4c649b['shift']());}};_0x5d7983(++_0x1eb725);}(_0x999e,0x9e));var _0xe999=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x999e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe999('0x0'));var util=require(_0xe999('0x1'));var moment=require(_0xe999('0x2'));var BPromise=require('bluebird');var rs=require(_0xe999('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe999('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe999('0x5'))(_0xe999('0x6'));var config=require(_0xe999('0x7'));var jayson=require(_0xe999('0x8'));var client=jayson[_0xe999('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x319604,_0x260d16,_0x197559){return new BPromise(function(_0x1f6b48,_0x16b877){return client[_0xe999('0xa')](_0x319604,_0x197559)[_0xe999('0xb')](function(_0x1e239b){logger[_0xe999('0xc')](_0xe999('0xd'),_0x260d16,'request\x20sent');logger[_0xe999('0xe')](_0xe999('0xf'),_0x260d16,'request\x20sent',JSON[_0xe999('0x10')](_0x1e239b));if(_0x1e239b[_0xe999('0x11')]){if(_0x1e239b['error']['code']===0x1f4){logger[_0xe999('0x11')](_0xe999('0xd'),_0x260d16,_0x1e239b[_0xe999('0x11')]['message']);return _0x16b877(_0x1e239b[_0xe999('0x11')][_0xe999('0x12')]);}logger[_0xe999('0x11')](_0xe999('0xd'),_0x260d16,_0x1e239b[_0xe999('0x11')][_0xe999('0x12')]);return _0x1f6b48(_0x1e239b['error'][_0xe999('0x12')]);}else{logger[_0xe999('0xc')](_0xe999('0xd'),_0x260d16,_0xe999('0x13'));_0x1f6b48(_0x1e239b['result'][_0xe999('0x12')]);}})[_0xe999('0x14')](function(_0xde5867){logger[_0xe999('0x11')](_0xe999('0xd'),_0x260d16,_0xde5867);_0x16b877(_0xde5867);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 06ee8a6..bc33391 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 _0x5398=['create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x1abeb2,_0x79f462){var _0x48da20=function(_0x42a90b){while(--_0x42a90b){_0x1abeb2['push'](_0x1abeb2['shift']());}};_0x48da20(++_0x79f462);}(_0x5398,0xe2));var _0x8539=function(_0xf771fe,_0x1d1fa8){_0xf771fe=_0xf771fe-0x0;var _0x27eecc=_0x5398[_0xf771fe];return _0x27eecc;};'use strict';var multer=require('multer');var util=require(_0x8539('0x0'));var path=require(_0x8539('0x1'));var timeout=require(_0x8539('0x2'));var express=require(_0x8539('0x3'));var router=express[_0x8539('0x4')]();var fs_extra=require(_0x8539('0x5'));var auth=require(_0x8539('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8539('0x7'));router[_0x8539('0x8')]('/',auth[_0x8539('0x9')](),controller[_0x8539('0xa')]);router[_0x8539('0x8')](_0x8539('0xb'),auth['isAuthenticated'](),controller[_0x8539('0xc')]);router[_0x8539('0xd')]('/',auth[_0x8539('0x9')](),controller[_0x8539('0xe')]);router[_0x8539('0xf')](_0x8539('0xb'),auth[_0x8539('0x9')](),controller[_0x8539('0x10')]);router[_0x8539('0x11')](_0x8539('0xb'),auth['isAuthenticated'](),controller[_0x8539('0x12')]);module[_0x8539('0x13')]=router;
\ No newline at end of file
+var _0x37c5=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','isAuthenticated','index','get','show','post','put','/:id','delete','destroy','util','path','connect-timeout','express'];(function(_0x21a3f2,_0x97377d){var _0x30212c=function(_0xf748f4){while(--_0xf748f4){_0x21a3f2['push'](_0x21a3f2['shift']());}};_0x30212c(++_0x97377d);}(_0x37c5,0xa7));var _0x537c=function(_0x174cb3,_0x333a86){_0x174cb3=_0x174cb3-0x0;var _0x41f0c4=_0x37c5[_0x174cb3];return _0x41f0c4;};'use strict';var multer=require('multer');var util=require(_0x537c('0x0'));var path=require(_0x537c('0x1'));var timeout=require(_0x537c('0x2'));var express=require(_0x537c('0x3'));var router=express[_0x537c('0x4')]();var fs_extra=require(_0x537c('0x5'));var auth=require(_0x537c('0x6'));var interaction=require(_0x537c('0x7'));var config=require(_0x537c('0x8'));var controller=require(_0x537c('0x9'));router['get']('/',auth[_0x537c('0xa')](),controller[_0x537c('0xb')]);router[_0x537c('0xc')]('/:id',auth[_0x537c('0xa')](),controller[_0x537c('0xd')]);router[_0x537c('0xe')]('/',auth[_0x537c('0xa')](),controller['create']);router[_0x537c('0xf')](_0x537c('0x10'),auth[_0x537c('0xa')](),controller['update']);router[_0x537c('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x537c('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 6f3e560..c67152a 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 _0x32ac=['TEXT','sequelize'];(function(_0x313866,_0x3ecd92){var _0x5a818f=function(_0x507e58){while(--_0x507e58){_0x313866['push'](_0x313866['shift']());}};_0x5a818f(++_0x3ecd92);}(_0x32ac,0x113));var _0xc32a=function(_0x4ad9cd,_0x43e881){_0x4ad9cd=_0x4ad9cd-0x0;var _0x5e34b1=_0x32ac[_0x4ad9cd];return _0x5e34b1;};'use strict';var Sequelize=require(_0xc32a('0x0'));module['exports']={'tree':{'type':Sequelize[_0xc32a('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0xb6b1=['TEXT','sequelize'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0xb6b1,0x17b));var _0x1b6b=function(_0x313c96,_0x3cee6e){_0x313c96=_0x313c96-0x0;var _0x522f53=_0xb6b1[_0x313c96];return _0x522f53;};'use strict';var Sequelize=require(_0x1b6b('0x0'));module['exports']={'tree':{'type':Sequelize[_0x1b6b('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 8c7fd34..fa495fb 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 _0x4cf3=['moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','index','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','options','include','rows','catch','show','includeAll','create','body','find','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x275d47,_0x2e98e6){var _0x2e09e2=function(_0x3d46bb){while(--_0x3d46bb){_0x275d47['push'](_0x275d47['shift']());}};_0x2e09e2(++_0x2e98e6);}(_0x4cf3,0x13f));var _0x34cf=function(_0x2a5950,_0x12cadf){_0x2a5950=_0x2a5950-0x0;var _0x1bc546=_0x4cf3[_0x2a5950];return _0x1bc546;};'use strict';var emlformat=require(_0x34cf('0x0'));var rimraf=require(_0x34cf('0x1'));var zipdir=require(_0x34cf('0x2'));var jsonpatch=require(_0x34cf('0x3'));var rp=require(_0x34cf('0x4'));var moment=require(_0x34cf('0x5'));var BPromise=require(_0x34cf('0x6'));var Mustache=require(_0x34cf('0x7'));var util=require(_0x34cf('0x8'));var path=require(_0x34cf('0x9'));var sox=require(_0x34cf('0xa'));var csv=require('to-csv');var ejs=require(_0x34cf('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x34cf('0xc'));var squel=require(_0x34cf('0xd'));var crypto=require(_0x34cf('0xe'));var jsforce=require(_0x34cf('0xf'));var deskjs=require(_0x34cf('0x10'));var toCsv=require(_0x34cf('0x11'));var querystring=require(_0x34cf('0x12'));var Papa=require(_0x34cf('0x13'));var Redis=require(_0x34cf('0x14'));var authService=require(_0x34cf('0x15'));var qs=require(_0x34cf('0x16'));var as=require(_0x34cf('0x17'));var hardwareService=require(_0x34cf('0x18'));var logger=require(_0x34cf('0x19'))(_0x34cf('0x1a'));var utils=require(_0x34cf('0x1b'));var config=require('../../config/environment');var licenseUtil=require(_0x34cf('0x1c'));var db=require(_0x34cf('0x1d'))['db'];function respondWithStatusCode(_0xee105d,_0x4cbbeb){_0x4cbbeb=_0x4cbbeb||0xcc;return function(_0x443bd6){if(_0x443bd6){return _0xee105d[_0x34cf('0x1e')](_0x4cbbeb);}return _0xee105d[_0x34cf('0x1f')](_0x4cbbeb)['end']();};}function respondWithResult(_0x631798,_0x251de0){_0x251de0=_0x251de0||0xc8;return function(_0x1e5056){if(_0x1e5056){return _0x631798[_0x34cf('0x1f')](_0x251de0)[_0x34cf('0x20')](_0x1e5056);}};}function respondWithFilteredResult(_0xf79b44,_0xdb1e64){return function(_0x1212e1){if(_0x1212e1){var _0x28086d=typeof _0xdb1e64[_0x34cf('0x21')]==='undefined'&&typeof _0xdb1e64['limit']===_0x34cf('0x22');var _0x4e3380=_0x1212e1[_0x34cf('0x23')];var _0x5ba400=_0x28086d?0x0:_0xdb1e64[_0x34cf('0x21')];var _0x56e976=_0x28086d?_0x1212e1[_0x34cf('0x23')]:_0xdb1e64[_0x34cf('0x21')]+_0xdb1e64['limit'];var _0x146267;if(_0x56e976>=_0x4e3380){_0x56e976=_0x4e3380;_0x146267=0xc8;}else{_0x146267=0xce;}_0xf79b44[_0x34cf('0x1f')](_0x146267);return _0xf79b44[_0x34cf('0x24')](_0x34cf('0x25'),_0x5ba400+'-'+_0x56e976+'/'+_0x4e3380)[_0x34cf('0x20')](_0x1212e1);}return null;};}function patchUpdates(_0x3f47e5){return function(_0x12031b){try{jsonpatch[_0x34cf('0x26')](_0x12031b,_0x3f47e5,!![]);}catch(_0x43cc6f){return BPromise[_0x34cf('0x27')](_0x43cc6f);}return _0x12031b[_0x34cf('0x28')]();};}function saveUpdates(_0x5f5af1,_0x590aae){return function(_0x11cc35){if(_0x11cc35){return _0x11cc35[_0x34cf('0x29')](_0x5f5af1)[_0x34cf('0x2a')](function(_0x94055c){return _0x94055c;});}return null;};}function removeEntity(_0x27ea20,_0x52fd70){return function(_0x3e69f6){if(_0x3e69f6){return _0x3e69f6['destroy']()['then'](function(){_0x27ea20[_0x34cf('0x1f')](0xcc)[_0x34cf('0x2b')]();});}};}function handleEntityNotFound(_0x489cc5,_0x126a6d){return function(_0x3afffb){if(!_0x3afffb){_0x489cc5[_0x34cf('0x1e')](0x194);}return _0x3afffb;};}function handleError(_0x5c8a7e,_0x1888c6){_0x1888c6=_0x1888c6||0x1f4;return function(_0x3bafd6){logger[_0x34cf('0x2c')](_0x3bafd6[_0x34cf('0x2d')]);if(_0x3bafd6[_0x34cf('0x2e')]){delete _0x3bafd6['name'];}_0x5c8a7e['status'](_0x1888c6)['send'](_0x3bafd6);};}exports[_0x34cf('0x2f')]=function(_0x3c241d,_0x41d01a){var _0x514848={},_0x2379ce={},_0x1beb03={'count':0x0,'rows':[]};var _0x531704=_['map'](db[_0x34cf('0x30')][_0x34cf('0x31')],function(_0x559b2e){return{'name':_0x559b2e[_0x34cf('0x32')],'type':_0x559b2e[_0x34cf('0x33')][_0x34cf('0x34')]};});_0x2379ce[_0x34cf('0x35')]=_[_0x34cf('0x36')](_0x531704,_0x34cf('0x2e'));_0x2379ce[_0x34cf('0x37')]=_[_0x34cf('0x38')](_0x3c241d['query']);_0x2379ce[_0x34cf('0x39')]=_[_0x34cf('0x3a')](_0x2379ce[_0x34cf('0x35')],_0x2379ce['query']);_0x514848[_0x34cf('0x3b')]=_[_0x34cf('0x3a')](_0x2379ce[_0x34cf('0x35')],qs['fields'](_0x3c241d[_0x34cf('0x37')][_0x34cf('0x3c')]));_0x514848[_0x34cf('0x3b')]=_0x514848[_0x34cf('0x3b')][_0x34cf('0x3d')]?_0x514848[_0x34cf('0x3b')]:_0x2379ce[_0x34cf('0x35')];if(!_0x3c241d[_0x34cf('0x37')]['hasOwnProperty'](_0x34cf('0x3e'))){_0x514848[_0x34cf('0x3f')]=qs[_0x34cf('0x3f')](_0x3c241d[_0x34cf('0x37')]['limit']);_0x514848[_0x34cf('0x21')]=qs[_0x34cf('0x21')](_0x3c241d['query'][_0x34cf('0x21')]);}_0x514848[_0x34cf('0x40')]=qs[_0x34cf('0x41')](_0x3c241d[_0x34cf('0x37')][_0x34cf('0x41')]);_0x514848[_0x34cf('0x42')]=qs[_0x34cf('0x39')](_[_0x34cf('0x43')](_0x3c241d[_0x34cf('0x37')],_0x2379ce['filters']),_0x531704);if(_0x3c241d[_0x34cf('0x37')][_0x34cf('0x44')]){_0x514848[_0x34cf('0x42')]=_['merge'](_0x514848[_0x34cf('0x42')],{'$or':_[_0x34cf('0x36')](_0x531704,function(_0x3f4402){if(_0x3f4402[_0x34cf('0x33')]!=='VIRTUAL'){var _0x49a9fd={};_0x49a9fd[_0x3f4402['name']]={'$like':'%'+_0x3c241d[_0x34cf('0x37')][_0x34cf('0x44')]+'%'};return _0x49a9fd;}})});}_0x514848=_[_0x34cf('0x45')]({},_0x514848,_0x3c241d[_0x34cf('0x46')]);var _0x5634ec={'where':_0x514848[_0x34cf('0x42')]};return db[_0x34cf('0x30')][_0x34cf('0x23')](_0x5634ec)[_0x34cf('0x2a')](function(_0x345dc5){_0x1beb03['count']=_0x345dc5;if(_0x3c241d['query']['includeAll']){_0x514848[_0x34cf('0x47')]=[{'all':!![]}];}return db['AnalyticTreeReport']['findAll'](_0x514848);})[_0x34cf('0x2a')](function(_0x45c597){_0x1beb03[_0x34cf('0x48')]=_0x45c597;return _0x1beb03;})['then'](respondWithFilteredResult(_0x41d01a,_0x514848))[_0x34cf('0x49')](handleError(_0x41d01a,null));};exports[_0x34cf('0x4a')]=function(_0x327044,_0x16fe28){var _0x36da12={'raw':!![],'where':{'id':_0x327044['params']['id']}},_0x3641aa={};_0x3641aa[_0x34cf('0x35')]=_[_0x34cf('0x38')](db[_0x34cf('0x30')]['rawAttributes']);_0x3641aa['query']=_[_0x34cf('0x38')](_0x327044[_0x34cf('0x37')]);_0x3641aa[_0x34cf('0x39')]=_['intersection'](_0x3641aa[_0x34cf('0x35')],_0x3641aa[_0x34cf('0x37')]);_0x36da12[_0x34cf('0x3b')]=_[_0x34cf('0x3a')](_0x3641aa['model'],qs['fields'](_0x327044[_0x34cf('0x37')][_0x34cf('0x3c')]));_0x36da12['attributes']=_0x36da12['attributes'][_0x34cf('0x3d')]?_0x36da12['attributes']:_0x3641aa['model'];if(_0x327044[_0x34cf('0x37')][_0x34cf('0x4b')]){_0x36da12['include']=[{'all':!![]}];}_0x36da12=_['merge']({},_0x36da12,_0x327044[_0x34cf('0x46')]);return db[_0x34cf('0x30')]['find'](_0x36da12)[_0x34cf('0x2a')](handleEntityNotFound(_0x16fe28,null))[_0x34cf('0x2a')](respondWithResult(_0x16fe28,null))['catch'](handleError(_0x16fe28,null));};exports['create']=function(_0x397b44,_0x472969){return db[_0x34cf('0x30')][_0x34cf('0x4c')](_0x397b44[_0x34cf('0x4d')],{})[_0x34cf('0x2a')](respondWithResult(_0x472969,0xc9))[_0x34cf('0x49')](handleError(_0x472969,null));};exports[_0x34cf('0x29')]=function(_0x14bfdf,_0x198f73){if(_0x14bfdf[_0x34cf('0x4d')]['id']){delete _0x14bfdf[_0x34cf('0x4d')]['id'];}return db[_0x34cf('0x30')][_0x34cf('0x4e')]({'where':{'id':_0x14bfdf[_0x34cf('0x4f')]['id']}})[_0x34cf('0x2a')](handleEntityNotFound(_0x198f73,null))[_0x34cf('0x2a')](saveUpdates(_0x14bfdf[_0x34cf('0x4d')],null))[_0x34cf('0x2a')](respondWithResult(_0x198f73,null))[_0x34cf('0x49')](handleError(_0x198f73,null));};exports[_0x34cf('0x50')]=function(_0x39cc72,_0xac54fb){return db[_0x34cf('0x30')][_0x34cf('0x4e')]({'where':{'id':_0x39cc72[_0x34cf('0x4f')]['id']}})[_0x34cf('0x2a')](handleEntityNotFound(_0xac54fb,null))['then'](removeEntity(_0xac54fb,null))[_0x34cf('0x49')](handleError(_0xac54fb,null));};
\ No newline at end of file
+var _0xd152=['send','index','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','create','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','stack','name'];(function(_0x5bf46c,_0x1fe508){var _0x5a37c4=function(_0x2cf2c3){while(--_0x2cf2c3){_0x5bf46c['push'](_0x5bf46c['shift']());}};_0x5a37c4(++_0x1fe508);}(_0xd152,0x6c));var _0x2d15=function(_0x4f2b2d,_0x4f2aa5){_0x4f2b2d=_0x4f2b2d-0x0;var _0xc3def7=_0xd152[_0x4f2b2d];return _0xc3def7;};'use strict';var emlformat=require(_0x2d15('0x0'));var rimraf=require(_0x2d15('0x1'));var zipdir=require(_0x2d15('0x2'));var jsonpatch=require(_0x2d15('0x3'));var rp=require(_0x2d15('0x4'));var moment=require(_0x2d15('0x5'));var BPromise=require(_0x2d15('0x6'));var Mustache=require(_0x2d15('0x7'));var util=require(_0x2d15('0x8'));var path=require('path');var sox=require(_0x2d15('0x9'));var csv=require(_0x2d15('0xa'));var ejs=require(_0x2d15('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2d15('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2d15('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2d15('0xa'));var querystring=require(_0x2d15('0xe'));var Papa=require(_0x2d15('0xf'));var Redis=require(_0x2d15('0x10'));var authService=require(_0x2d15('0x11'));var qs=require(_0x2d15('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2d15('0x13'));var logger=require(_0x2d15('0x14'))('api');var utils=require(_0x2d15('0x15'));var config=require(_0x2d15('0x16'));var licenseUtil=require(_0x2d15('0x17'));var db=require(_0x2d15('0x18'))['db'];function respondWithStatusCode(_0x5c9d39,_0x5097be){_0x5097be=_0x5097be||0xcc;return function(_0x53e372){if(_0x53e372){return _0x5c9d39[_0x2d15('0x19')](_0x5097be);}return _0x5c9d39['status'](_0x5097be)[_0x2d15('0x1a')]();};}function respondWithResult(_0x40cc15,_0x479cad){_0x479cad=_0x479cad||0xc8;return function(_0x10ade8){if(_0x10ade8){return _0x40cc15[_0x2d15('0x1b')](_0x479cad)[_0x2d15('0x1c')](_0x10ade8);}};}function respondWithFilteredResult(_0x326882,_0x5820ef){return function(_0x354dd6){if(_0x354dd6){var _0x549f9d=typeof _0x5820ef[_0x2d15('0x1d')]==='undefined'&&typeof _0x5820ef[_0x2d15('0x1e')]===_0x2d15('0x1f');var _0x20239d=_0x354dd6['count'];var _0x263e37=_0x549f9d?0x0:_0x5820ef['offset'];var _0x24ee42=_0x549f9d?_0x354dd6[_0x2d15('0x20')]:_0x5820ef[_0x2d15('0x1d')]+_0x5820ef[_0x2d15('0x1e')];var _0x511cb0;if(_0x24ee42>=_0x20239d){_0x24ee42=_0x20239d;_0x511cb0=0xc8;}else{_0x511cb0=0xce;}_0x326882[_0x2d15('0x1b')](_0x511cb0);return _0x326882[_0x2d15('0x21')](_0x2d15('0x22'),_0x263e37+'-'+_0x24ee42+'/'+_0x20239d)[_0x2d15('0x1c')](_0x354dd6);}return null;};}function patchUpdates(_0x1a56ca){return function(_0x530f30){try{jsonpatch[_0x2d15('0x23')](_0x530f30,_0x1a56ca,!![]);}catch(_0x6c227f){return BPromise[_0x2d15('0x24')](_0x6c227f);}return _0x530f30[_0x2d15('0x25')]();};}function saveUpdates(_0xbac71c,_0x3e938d){return function(_0x2c62ee){if(_0x2c62ee){return _0x2c62ee[_0x2d15('0x26')](_0xbac71c)['then'](function(_0x5d470c){return _0x5d470c;});}return null;};}function removeEntity(_0x50dc72,_0x1dead6){return function(_0x3cae3d){if(_0x3cae3d){return _0x3cae3d['destroy']()[_0x2d15('0x27')](function(){_0x50dc72[_0x2d15('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12b164,_0x2e1e13){return function(_0x1a10ff){if(!_0x1a10ff){_0x12b164['sendStatus'](0x194);}return _0x1a10ff;};}function handleError(_0x19d854,_0x1bc0fb){_0x1bc0fb=_0x1bc0fb||0x1f4;return function(_0x373fba){logger['error'](_0x373fba[_0x2d15('0x28')]);if(_0x373fba[_0x2d15('0x29')]){delete _0x373fba[_0x2d15('0x29')];}_0x19d854[_0x2d15('0x1b')](_0x1bc0fb)[_0x2d15('0x2a')](_0x373fba);};}exports[_0x2d15('0x2b')]=function(_0x5b8947,_0x1eecbc){var _0x5b994d={},_0x52871f={},_0x4d10b0={'count':0x0,'rows':[]};var _0x472389=_['map'](db[_0x2d15('0x2c')][_0x2d15('0x2d')],function(_0x191000){return{'name':_0x191000[_0x2d15('0x2e')],'type':_0x191000[_0x2d15('0x2f')][_0x2d15('0x30')]};});_0x52871f[_0x2d15('0x31')]=_[_0x2d15('0x32')](_0x472389,_0x2d15('0x29'));_0x52871f[_0x2d15('0x33')]=_[_0x2d15('0x34')](_0x5b8947['query']);_0x52871f['filters']=_[_0x2d15('0x35')](_0x52871f[_0x2d15('0x31')],_0x52871f[_0x2d15('0x33')]);_0x5b994d[_0x2d15('0x36')]=_[_0x2d15('0x35')](_0x52871f[_0x2d15('0x31')],qs[_0x2d15('0x37')](_0x5b8947[_0x2d15('0x33')][_0x2d15('0x37')]));_0x5b994d[_0x2d15('0x36')]=_0x5b994d[_0x2d15('0x36')][_0x2d15('0x38')]?_0x5b994d[_0x2d15('0x36')]:_0x52871f['model'];if(!_0x5b8947[_0x2d15('0x33')]['hasOwnProperty']('nolimit')){_0x5b994d[_0x2d15('0x1e')]=qs[_0x2d15('0x1e')](_0x5b8947[_0x2d15('0x33')][_0x2d15('0x1e')]);_0x5b994d[_0x2d15('0x1d')]=qs[_0x2d15('0x1d')](_0x5b8947[_0x2d15('0x33')][_0x2d15('0x1d')]);}_0x5b994d['order']=qs[_0x2d15('0x39')](_0x5b8947[_0x2d15('0x33')][_0x2d15('0x39')]);_0x5b994d[_0x2d15('0x3a')]=qs[_0x2d15('0x3b')](_[_0x2d15('0x3c')](_0x5b8947[_0x2d15('0x33')],_0x52871f[_0x2d15('0x3b')]),_0x472389);if(_0x5b8947['query'][_0x2d15('0x3d')]){_0x5b994d['where']=_[_0x2d15('0x3e')](_0x5b994d[_0x2d15('0x3a')],{'$or':_[_0x2d15('0x32')](_0x472389,function(_0x3b8ab4){if(_0x3b8ab4[_0x2d15('0x2f')]!==_0x2d15('0x3f')){var _0x45c7cb={};_0x45c7cb[_0x3b8ab4[_0x2d15('0x29')]]={'$like':'%'+_0x5b8947[_0x2d15('0x33')][_0x2d15('0x3d')]+'%'};return _0x45c7cb;}})});}_0x5b994d=_[_0x2d15('0x3e')]({},_0x5b994d,_0x5b8947[_0x2d15('0x40')]);var _0xa2440f={'where':_0x5b994d[_0x2d15('0x3a')]};return db['AnalyticTreeReport'][_0x2d15('0x20')](_0xa2440f)[_0x2d15('0x27')](function(_0x2a8585){_0x4d10b0[_0x2d15('0x20')]=_0x2a8585;if(_0x5b8947['query'][_0x2d15('0x41')]){_0x5b994d[_0x2d15('0x42')]=[{'all':!![]}];}return db[_0x2d15('0x2c')][_0x2d15('0x43')](_0x5b994d);})[_0x2d15('0x27')](function(_0x129c7c){_0x4d10b0[_0x2d15('0x44')]=_0x129c7c;return _0x4d10b0;})[_0x2d15('0x27')](respondWithFilteredResult(_0x1eecbc,_0x5b994d))[_0x2d15('0x45')](handleError(_0x1eecbc,null));};exports['show']=function(_0x2ee42b,_0x12afcf){var _0x4244d3={'raw':!![],'where':{'id':_0x2ee42b['params']['id']}},_0x32cf43={};_0x32cf43[_0x2d15('0x31')]=_[_0x2d15('0x34')](db[_0x2d15('0x2c')][_0x2d15('0x2d')]);_0x32cf43['query']=_[_0x2d15('0x34')](_0x2ee42b[_0x2d15('0x33')]);_0x32cf43['filters']=_[_0x2d15('0x35')](_0x32cf43['model'],_0x32cf43['query']);_0x4244d3[_0x2d15('0x36')]=_[_0x2d15('0x35')](_0x32cf43[_0x2d15('0x31')],qs[_0x2d15('0x37')](_0x2ee42b['query'][_0x2d15('0x37')]));_0x4244d3[_0x2d15('0x36')]=_0x4244d3[_0x2d15('0x36')][_0x2d15('0x38')]?_0x4244d3['attributes']:_0x32cf43[_0x2d15('0x31')];if(_0x2ee42b[_0x2d15('0x33')][_0x2d15('0x41')]){_0x4244d3['include']=[{'all':!![]}];}_0x4244d3=_[_0x2d15('0x3e')]({},_0x4244d3,_0x2ee42b[_0x2d15('0x40')]);return db[_0x2d15('0x2c')][_0x2d15('0x46')](_0x4244d3)[_0x2d15('0x27')](handleEntityNotFound(_0x12afcf,null))['then'](respondWithResult(_0x12afcf,null))[_0x2d15('0x45')](handleError(_0x12afcf,null));};exports['create']=function(_0x1becbe,_0x3b2426){return db['AnalyticTreeReport'][_0x2d15('0x47')](_0x1becbe[_0x2d15('0x48')],{})[_0x2d15('0x27')](respondWithResult(_0x3b2426,0xc9))[_0x2d15('0x45')](handleError(_0x3b2426,null));};exports[_0x2d15('0x26')]=function(_0x2f067a,_0x1b3b1c){if(_0x2f067a[_0x2d15('0x48')]['id']){delete _0x2f067a[_0x2d15('0x48')]['id'];}return db[_0x2d15('0x2c')]['find']({'where':{'id':_0x2f067a[_0x2d15('0x49')]['id']}})['then'](handleEntityNotFound(_0x1b3b1c,null))[_0x2d15('0x27')](saveUpdates(_0x2f067a[_0x2d15('0x48')],null))[_0x2d15('0x27')](respondWithResult(_0x1b3b1c,null))[_0x2d15('0x45')](handleError(_0x1b3b1c,null));};exports[_0x2d15('0x4a')]=function(_0x5c7b31,_0x324a02){return db[_0x2d15('0x2c')][_0x2d15('0x46')]({'where':{'id':_0x5c7b31[_0x2d15('0x49')]['id']}})[_0x2d15('0x27')](handleEntityNotFound(_0x324a02,null))[_0x2d15('0x27')](removeEntity(_0x324a02,null))[_0x2d15('0x45')](handleError(_0x324a02,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 140423d..88b6def 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 _0x743c=['request-promise','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','api','moment','bluebird'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x743c,0x14d));var _0xc743=function(_0x8e6768,_0x997aad){_0x8e6768=_0x8e6768-0x0;var _0x4db9e9=_0x743c[_0x8e6768];return _0x4db9e9;};'use strict';var _=require(_0xc743('0x0'));var util=require(_0xc743('0x1'));var logger=require('../../config/logger')(_0xc743('0x2'));var moment=require(_0xc743('0x3'));var BPromise=require(_0xc743('0x4'));var rp=require(_0xc743('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc743('0x6'));var config=require(_0xc743('0x7'));var attributes=require(_0xc743('0x8'));module[_0xc743('0x9')]=function(_0x958b03,_0x521ebf){return _0x958b03[_0xc743('0xa')](_0xc743('0xb'),attributes,{'tableName':_0xc743('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x69ad=['analytics_report_trees','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','AnalyticTreeReport'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0x69ad,0x1da));var _0xd69a=function(_0x335234,_0x12407a){_0x335234=_0x335234-0x0;var _0x150368=_0x69ad[_0x335234];return _0x150368;};'use strict';var _=require(_0xd69a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd69a('0x1'));var moment=require(_0xd69a('0x2'));var BPromise=require(_0xd69a('0x3'));var rp=require(_0xd69a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd69a('0x5'));var config=require(_0xd69a('0x6'));var attributes=require('./analyticTreeReport.attributes');module[_0xd69a('0x7')]=function(_0x357f5b,_0x3ae418){return _0x357f5b[_0xd69a('0x8')](_0xd69a('0x9'),attributes,{'tableName':_0xd69a('0xa'),'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 9f06527..e381f5c 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 _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x18a669,_0x3e97f7){var _0x57cd6f=function(_0x5de55b){while(--_0x5de55b){_0x18a669['push'](_0x18a669['shift']());}};_0x57cd6f(++_0x3e97f7);}(_0xdb28,0x106));var _0x8db2=function(_0x565777,_0x169f59){_0x565777=_0x565777-0x0;var _0x56d505=_0xdb28[_0x565777];return _0x56d505;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}
\ No newline at end of file
+var _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x2895d7,_0x49d277){var _0x21e801=function(_0x42059f){while(--_0x42059f){_0x2895d7['push'](_0x2895d7['shift']());}};_0x21e801(++_0x49d277);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x5f66[_0x5d4607];return _0x5e4a86;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('AnalyticTreeReport,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 88b64a4..8066bd1 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 _0x2220=['path','express','Router','fs-extra','get','isAuthenticated','index','show','post','put','/:id','delete','destroy','util'];(function(_0x553dca,_0x3dcc0c){var _0x4ecbdf=function(_0x21e89b){while(--_0x21e89b){_0x553dca['push'](_0x553dca['shift']());}};_0x4ecbdf(++_0x3dcc0c);}(_0x2220,0xdf));var _0x0222=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x2220[_0x5f3f88];return _0xd08119;};'use strict';var multer=require('multer');var util=require(_0x0222('0x0'));var path=require(_0x0222('0x1'));var timeout=require('connect-timeout');var express=require(_0x0222('0x2'));var router=express[_0x0222('0x3')]();var fs_extra=require(_0x0222('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticTreeReport.controller');router[_0x0222('0x5')]('/',auth[_0x0222('0x6')](),controller[_0x0222('0x7')]);router[_0x0222('0x5')]('/:id',auth[_0x0222('0x6')](),controller[_0x0222('0x8')]);router[_0x0222('0x9')]('/',auth[_0x0222('0x6')](),controller['create']);router[_0x0222('0xa')](_0x0222('0xb'),auth[_0x0222('0x6')](),controller['update']);router[_0x0222('0xc')]('/:id',auth[_0x0222('0x6')](),controller[_0x0222('0xd')]);module['exports']=router;
\ No newline at end of file
+var _0xa75c=['delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','get','isAuthenticated','create','/:id','update'];(function(_0x337c8c,_0x905c4b){var _0x2de675=function(_0x68a8e5){while(--_0x68a8e5){_0x337c8c['push'](_0x337c8c['shift']());}};_0x2de675(++_0x905c4b);}(_0xa75c,0x103));var _0xca75=function(_0x53e3de,_0x13da7b){_0x53e3de=_0x53e3de-0x0;var _0x7b905b=_0xa75c[_0x53e3de];return _0x7b905b;};'use strict';var multer=require('multer');var util=require(_0xca75('0x0'));var path=require(_0xca75('0x1'));var timeout=require(_0xca75('0x2'));var express=require(_0xca75('0x3'));var router=express[_0xca75('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xca75('0x5'));var interaction=require(_0xca75('0x6'));var config=require('../../config/environment');var controller=require(_0xca75('0x7'));router[_0xca75('0x8')]('/',auth[_0xca75('0x9')](),controller['index']);router['get']('/:id',auth[_0xca75('0x9')](),controller['show']);router['post']('/',auth[_0xca75('0x9')](),controller[_0xca75('0xa')]);router['put'](_0xca75('0xb'),auth[_0xca75('0x9')](),controller[_0xca75('0xc')]);router[_0xca75('0xd')](_0xca75('0xb'),auth['isAuthenticated'](),controller[_0xca75('0xe')]);module[_0xca75('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 28c3deb..3bf2580 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 _0x2cc1=['STRING','sequelize','exports'];(function(_0x5a4e76,_0x11f33f){var _0x38b339=function(_0x41bfac){while(--_0x41bfac){_0x5a4e76['push'](_0x5a4e76['shift']());}};_0x38b339(++_0x11f33f);}(_0x2cc1,0x1bd));var _0x12cc=function(_0x31f5ce,_0x379d01){_0x31f5ce=_0x31f5ce-0x0;var _0x156662=_0x2cc1[_0x31f5ce];return _0x156662;};'use strict';var Sequelize=require(_0x12cc('0x0'));module[_0x12cc('0x1')]={'name':{'type':Sequelize[_0x12cc('0x2')]},'basename':{'type':Sequelize[_0x12cc('0x2')]},'type':{'type':Sequelize[_0x12cc('0x2')]}};
\ No newline at end of file
+var _0x3e74=['STRING','sequelize'];(function(_0x216494,_0x21a0b4){var _0x3fce22=function(_0x510bbd){while(--_0x510bbd){_0x216494['push'](_0x216494['shift']());}};_0x3fce22(++_0x21a0b4);}(_0x3e74,0x175));var _0x43e7=function(_0x54bc76,_0x53bc22){_0x54bc76=_0x54bc76-0x0;var _0x4aa3f6=_0x3e74[_0x54bc76];return _0x4aa3f6;};'use strict';var Sequelize=require(_0x43e7('0x0'));module['exports']={'name':{'type':Sequelize[_0x43e7('0x1')]},'basename':{'type':Sequelize[_0x43e7('0x1')]},'type':{'type':Sequelize[_0x43e7('0x1')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index aa1ab11..1f2a598 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 _0x490c=['clone','get','createdAt','updatedAt','body','omit','create','file','originalname','basename','filename','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','index','map','Attachment','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','rows','catch','params','include','find'];(function(_0x5a5395,_0x5361f6){var _0x4da43d=function(_0x149941){while(--_0x149941){_0x5a5395['push'](_0x5a5395['shift']());}};_0x4da43d(++_0x5361f6);}(_0x490c,0x11c));var _0xc490=function(_0x58f245,_0x3e4f31){_0x58f245=_0x58f245-0x0;var _0x1f0cfb=_0x490c[_0x58f245];return _0x1f0cfb;};'use strict';var emlformat=require(_0xc490('0x0'));var rimraf=require(_0xc490('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc490('0x2'));var rp=require(_0xc490('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc490('0x4'));var util=require(_0xc490('0x5'));var path=require('path');var sox=require(_0xc490('0x6'));var csv=require(_0xc490('0x7'));var ejs=require(_0xc490('0x8'));var fs=require('fs');var fs_extra=require(_0xc490('0x9'));var _=require(_0xc490('0xa'));var squel=require(_0xc490('0xb'));var crypto=require(_0xc490('0xc'));var jsforce=require(_0xc490('0xd'));var deskjs=require(_0xc490('0xe'));var toCsv=require(_0xc490('0x7'));var querystring=require(_0xc490('0xf'));var Papa=require('papaparse');var Redis=require(_0xc490('0x10'));var authService=require(_0xc490('0x11'));var qs=require(_0xc490('0x12'));var as=require(_0xc490('0x13'));var hardwareService=require(_0xc490('0x14'));var logger=require('../../config/logger')(_0xc490('0x15'));var utils=require('../../config/utils');var config=require(_0xc490('0x16'));var licenseUtil=require(_0xc490('0x17'));var db=require(_0xc490('0x18'))['db'];function respondWithStatusCode(_0x13d053,_0x1239c9){_0x1239c9=_0x1239c9||0xcc;return function(_0x19a16a){if(_0x19a16a){return _0x13d053['sendStatus'](_0x1239c9);}return _0x13d053[_0xc490('0x19')](_0x1239c9)[_0xc490('0x1a')]();};}function respondWithResult(_0x259221,_0x11b794){_0x11b794=_0x11b794||0xc8;return function(_0x572e8e){if(_0x572e8e){return _0x259221[_0xc490('0x19')](_0x11b794)[_0xc490('0x1b')](_0x572e8e);}};}function respondWithFilteredResult(_0x18e5d4,_0x241ff3){return function(_0x35e024){if(_0x35e024){var _0x4a9bbf=typeof _0x241ff3[_0xc490('0x1c')]===_0xc490('0x1d')&&typeof _0x241ff3['limit']===_0xc490('0x1d');var _0x19c66d=_0x35e024[_0xc490('0x1e')];var _0x372dca=_0x4a9bbf?0x0:_0x241ff3['offset'];var _0x2ca73a=_0x4a9bbf?_0x35e024[_0xc490('0x1e')]:_0x241ff3['offset']+_0x241ff3[_0xc490('0x1f')];var _0x5f52b5;if(_0x2ca73a>=_0x19c66d){_0x2ca73a=_0x19c66d;_0x5f52b5=0xc8;}else{_0x5f52b5=0xce;}_0x18e5d4[_0xc490('0x19')](_0x5f52b5);return _0x18e5d4[_0xc490('0x20')](_0xc490('0x21'),_0x372dca+'-'+_0x2ca73a+'/'+_0x19c66d)[_0xc490('0x1b')](_0x35e024);}return null;};}function patchUpdates(_0x4eebc0){return function(_0x4fa1c5){try{jsonpatch[_0xc490('0x22')](_0x4fa1c5,_0x4eebc0,!![]);}catch(_0x54a37f){return BPromise[_0xc490('0x23')](_0x54a37f);}return _0x4fa1c5['save']();};}function saveUpdates(_0x3d5c17,_0x5db2f9){return function(_0x315445){if(_0x315445){return _0x315445[_0xc490('0x24')](_0x3d5c17)[_0xc490('0x25')](function(_0x5e24c1){return _0x5e24c1;});}return null;};}function removeEntity(_0x3b5891,_0x50030d){return function(_0x333030){if(_0x333030){return _0x333030[_0xc490('0x26')]()['then'](function(){_0x3b5891[_0xc490('0x19')](0xcc)[_0xc490('0x1a')]();});}};}function handleEntityNotFound(_0x1146fd,_0x17f80b){return function(_0x3c64c3){if(!_0x3c64c3){_0x1146fd[_0xc490('0x27')](0x194);}return _0x3c64c3;};}function handleError(_0x1bc904,_0x20aa0d){_0x20aa0d=_0x20aa0d||0x1f4;return function(_0x51430a){logger[_0xc490('0x28')](_0x51430a[_0xc490('0x29')]);if(_0x51430a['name']){delete _0x51430a[_0xc490('0x2a')];}_0x1bc904[_0xc490('0x19')](_0x20aa0d)['send'](_0x51430a);};}exports[_0xc490('0x2b')]=function(_0x3ea7a2,_0x25a007){var _0x45cb07={},_0x46c13f={},_0x382ebb={'count':0x0,'rows':[]};var _0x27587b=_[_0xc490('0x2c')](db[_0xc490('0x2d')][_0xc490('0x2e')],function(_0x37f80c){return{'name':_0x37f80c[_0xc490('0x2f')],'type':_0x37f80c[_0xc490('0x30')][_0xc490('0x31')]};});_0x46c13f[_0xc490('0x32')]=_[_0xc490('0x2c')](_0x27587b,_0xc490('0x2a'));_0x46c13f['query']=_[_0xc490('0x33')](_0x3ea7a2[_0xc490('0x34')]);_0x46c13f['filters']=_['intersection'](_0x46c13f[_0xc490('0x32')],_0x46c13f[_0xc490('0x34')]);_0x45cb07[_0xc490('0x35')]=_[_0xc490('0x36')](_0x46c13f[_0xc490('0x32')],qs[_0xc490('0x37')](_0x3ea7a2[_0xc490('0x34')][_0xc490('0x37')]));_0x45cb07[_0xc490('0x35')]=_0x45cb07[_0xc490('0x35')][_0xc490('0x38')]?_0x45cb07['attributes']:_0x46c13f['model'];if(!_0x3ea7a2[_0xc490('0x34')][_0xc490('0x39')]('nolimit')){_0x45cb07[_0xc490('0x1f')]=qs['limit'](_0x3ea7a2[_0xc490('0x34')][_0xc490('0x1f')]);_0x45cb07[_0xc490('0x1c')]=qs['offset'](_0x3ea7a2[_0xc490('0x34')][_0xc490('0x1c')]);}_0x45cb07[_0xc490('0x3a')]=qs[_0xc490('0x3b')](_0x3ea7a2[_0xc490('0x34')][_0xc490('0x3b')]);_0x45cb07[_0xc490('0x3c')]=qs[_0xc490('0x3d')](_['pick'](_0x3ea7a2[_0xc490('0x34')],_0x46c13f[_0xc490('0x3d')]),_0x27587b);if(_0x3ea7a2[_0xc490('0x34')][_0xc490('0x3e')]){_0x45cb07[_0xc490('0x3c')]=_[_0xc490('0x3f')](_0x45cb07[_0xc490('0x3c')],{'$or':_[_0xc490('0x2c')](_0x27587b,function(_0x4516f3){if(_0x4516f3['type']!==_0xc490('0x40')){var _0x5930a7={};_0x5930a7[_0x4516f3[_0xc490('0x2a')]]={'$like':'%'+_0x3ea7a2['query'][_0xc490('0x3e')]+'%'};return _0x5930a7;}})});}_0x45cb07=_[_0xc490('0x3f')]({},_0x45cb07,_0x3ea7a2[_0xc490('0x41')]);var _0x5ac065={'where':_0x45cb07[_0xc490('0x3c')]};return db[_0xc490('0x2d')][_0xc490('0x1e')](_0x5ac065)[_0xc490('0x25')](function(_0x381d0f){_0x382ebb[_0xc490('0x1e')]=_0x381d0f;if(_0x3ea7a2[_0xc490('0x34')][_0xc490('0x42')]){_0x45cb07['include']=[{'all':!![]}];}return db[_0xc490('0x2d')]['findAll'](_0x45cb07);})[_0xc490('0x25')](function(_0x48ba3f){_0x382ebb[_0xc490('0x43')]=_0x48ba3f;return _0x382ebb;})[_0xc490('0x25')](respondWithFilteredResult(_0x25a007,_0x45cb07))[_0xc490('0x44')](handleError(_0x25a007,null));};exports['show']=function(_0x1b9637,_0x93ebbe){var _0x588fce={'raw':!![],'where':{'id':_0x1b9637[_0xc490('0x45')]['id']}},_0xd8c8ed={};_0xd8c8ed['model']=_[_0xc490('0x33')](db[_0xc490('0x2d')]['rawAttributes']);_0xd8c8ed['query']=_[_0xc490('0x33')](_0x1b9637['query']);_0xd8c8ed[_0xc490('0x3d')]=_[_0xc490('0x36')](_0xd8c8ed[_0xc490('0x32')],_0xd8c8ed[_0xc490('0x34')]);_0x588fce[_0xc490('0x35')]=_[_0xc490('0x36')](_0xd8c8ed[_0xc490('0x32')],qs[_0xc490('0x37')](_0x1b9637['query']['fields']));_0x588fce[_0xc490('0x35')]=_0x588fce[_0xc490('0x35')][_0xc490('0x38')]?_0x588fce['attributes']:_0xd8c8ed[_0xc490('0x32')];if(_0x1b9637[_0xc490('0x34')][_0xc490('0x42')]){_0x588fce[_0xc490('0x46')]=[{'all':!![]}];}_0x588fce=_['merge']({},_0x588fce,_0x1b9637[_0xc490('0x41')]);return db[_0xc490('0x2d')][_0xc490('0x47')](_0x588fce)['then'](handleEntityNotFound(_0x93ebbe,null))[_0xc490('0x25')](respondWithResult(_0x93ebbe,null))[_0xc490('0x44')](handleError(_0x93ebbe,null));};exports[_0xc490('0x48')]=function(_0x1777e0,_0x31d7c4){var _0x232df8={'where':{'id':_0x1777e0[_0xc490('0x45')]['id']}},_0x3025ea={};_0x3025ea[_0xc490('0x32')]=_[_0xc490('0x33')](db[_0xc490('0x2d')][_0xc490('0x2e')]);_0x232df8['attributes']=_[_0xc490('0x36')](_0x3025ea[_0xc490('0x32')],qs[_0xc490('0x37')](_0x1777e0[_0xc490('0x34')][_0xc490('0x37')]));_0x232df8[_0xc490('0x35')]=_0x232df8['attributes'][_0xc490('0x38')]?_0x232df8[_0xc490('0x35')]:_0x3025ea['model'];if(_0x1777e0[_0xc490('0x34')][_0xc490('0x42')]){_0x232df8[_0xc490('0x46')]=[{'all':!![]}];}_0x232df8=_['merge']({},_0x232df8,_0x1777e0[_0xc490('0x41')]);return db[_0xc490('0x2d')]['find'](_0x232df8)[_0xc490('0x25')](handleEntityNotFound(_0x31d7c4,null))['then'](function(_0x2bc600){if(_0x2bc600){var _0x26523a=_0x2bc600[_0xc490('0x49')]({'plain':!![]});_0x26523a=qs['omit'](_0x26523a,['id',_0xc490('0x4a'),_0xc490('0x4b')]);_0x1777e0[_0xc490('0x4c')]=_[_0xc490('0x4d')](_0x1777e0['body'],['id',_0xc490('0x4a'),_0xc490('0x4b')]);return db['Attachment'][_0xc490('0x4e')](_[_0xc490('0x3f')](_0x26523a,_0x1777e0[_0xc490('0x4c')]),{'include':_0x1777e0[_0xc490('0x34')][_0xc490('0x42')]?[{'all':!![]}]:undefined});}})[_0xc490('0x25')](respondWithResult(_0x31d7c4,0xc9))[_0xc490('0x44')](handleError(_0x31d7c4,null));};exports[_0xc490('0x24')]=function(_0x1d1432,_0xb71699){if(_0x1d1432[_0xc490('0x4c')]['id']){delete _0x1d1432[_0xc490('0x4c')]['id'];}return db[_0xc490('0x2d')]['find']({'where':{'id':_0x1d1432['params']['id']}})[_0xc490('0x25')](handleEntityNotFound(_0xb71699,null))[_0xc490('0x25')](saveUpdates(_0x1d1432['body'],null))['then'](respondWithResult(_0xb71699,null))[_0xc490('0x44')](handleError(_0xb71699,null));};exports[_0xc490('0x26')]=function(_0x3b09ae,_0x51ba3e){return db[_0xc490('0x2d')][_0xc490('0x47')]({'where':{'id':_0x3b09ae[_0xc490('0x45')]['id']}})[_0xc490('0x25')](handleEntityNotFound(_0x51ba3e,null))[_0xc490('0x25')](removeEntity(_0x51ba3e,null))[_0xc490('0x44')](handleError(_0x51ba3e,null));};exports[_0xc490('0x4e')]=function(_0x275937,_0x735f56,_0x358ad4){_0x275937[_0xc490('0x4c')][_0xc490('0x2a')]=_0x275937[_0xc490('0x4f')][_0xc490('0x50')];_0x275937[_0xc490('0x4c')][_0xc490('0x51')]=_0x275937[_0xc490('0x4f')][_0xc490('0x52')];_0x275937['body'][_0xc490('0x30')]=_0x275937['file']['mimetype'];return db['Attachment'][_0xc490('0x4e')](_0x275937[_0xc490('0x4c')])[_0xc490('0x25')](respondWithResult(_0x735f56,0xc9))[_0xc490('0x44')](handleError(_0x735f56,null));};exports[_0xc490('0x53')]=function(_0x1c8f8a,_0x3150a4,_0x2d9a07){return db[_0xc490('0x2d')][_0xc490('0x54')]({'where':{'id':_0x1c8f8a[_0xc490('0x45')]['id']},'raw':!![]})[_0xc490('0x25')](handleEntityNotFound(_0x3150a4,null))[_0xc490('0x25')](function(_0x35aa66){if(_0x35aa66){var _0x426998=_0x35aa66[_0xc490('0x55')]!==null;var _0x1d6fdd=path[_0xc490('0x56')](config[_0xc490('0x57')],_0xc490('0x58'));if(_0x426998){_0x1d6fdd=path[_0xc490('0x56')](_0x1d6fdd,'offline-chat/');}var _0x5b72ac=path['join'](_0x1d6fdd,_0x35aa66[_0xc490('0x51')]);return _0x3150a4['download'](_0x5b72ac);}})[_0xc490('0x44')](handleError(_0x3150a4,null));};
\ No newline at end of file
+var _0xc1e1=['hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','then','include','catch','params','length','includeAll','find','clone','get','createdAt','body','omit','create','originalname','basename','file','filename','mimetype','findOne','ChatOfflineMessageId','join','root','offline-chat/','download','rimraf','zip-dir','fast-json-patch','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','error','stack','name','map','Attachment','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x2cff4f,_0x21e344){var _0x3df848=function(_0x49474b){while(--_0x49474b){_0x2cff4f['push'](_0x2cff4f['shift']());}};_0x3df848(++_0x21e344);}(_0xc1e1,0x120));var _0x1c1e=function(_0x1c2a5a,_0x284bb5){_0x1c2a5a=_0x1c2a5a-0x0;var _0x3b6846=_0xc1e1[_0x1c2a5a];return _0x3b6846;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1c1e('0x0'));var zipdir=require(_0x1c1e('0x1'));var jsonpatch=require(_0x1c1e('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1c1e('0x3'));var util=require(_0x1c1e('0x4'));var path=require('path');var sox=require(_0x1c1e('0x5'));var csv=require(_0x1c1e('0x6'));var ejs=require(_0x1c1e('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1c1e('0x8'));var squel=require(_0x1c1e('0x9'));var crypto=require(_0x1c1e('0xa'));var jsforce=require(_0x1c1e('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1c1e('0x6'));var querystring=require(_0x1c1e('0xc'));var Papa=require(_0x1c1e('0xd'));var Redis=require(_0x1c1e('0xe'));var authService=require(_0x1c1e('0xf'));var qs=require(_0x1c1e('0x10'));var as=require(_0x1c1e('0x11'));var hardwareService=require(_0x1c1e('0x12'));var logger=require(_0x1c1e('0x13'))('api');var utils=require(_0x1c1e('0x14'));var config=require(_0x1c1e('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x1c1e('0x16'))['db'];function respondWithStatusCode(_0x28a9b9,_0x5687c2){_0x5687c2=_0x5687c2||0xcc;return function(_0x6525a2){if(_0x6525a2){return _0x28a9b9[_0x1c1e('0x17')](_0x5687c2);}return _0x28a9b9[_0x1c1e('0x18')](_0x5687c2)[_0x1c1e('0x19')]();};}function respondWithResult(_0x33e047,_0x46f1c5){_0x46f1c5=_0x46f1c5||0xc8;return function(_0x1becba){if(_0x1becba){return _0x33e047[_0x1c1e('0x18')](_0x46f1c5)[_0x1c1e('0x1a')](_0x1becba);}};}function respondWithFilteredResult(_0x42f03c,_0x291d3e){return function(_0x253f08){if(_0x253f08){var _0x47e13e=typeof _0x291d3e[_0x1c1e('0x1b')]===_0x1c1e('0x1c')&&typeof _0x291d3e[_0x1c1e('0x1d')]===_0x1c1e('0x1c');var _0x43c4bc=_0x253f08['count'];var _0x4bf6a8=_0x47e13e?0x0:_0x291d3e[_0x1c1e('0x1b')];var _0x1bbab8=_0x47e13e?_0x253f08[_0x1c1e('0x1e')]:_0x291d3e[_0x1c1e('0x1b')]+_0x291d3e['limit'];var _0x5ddd70;if(_0x1bbab8>=_0x43c4bc){_0x1bbab8=_0x43c4bc;_0x5ddd70=0xc8;}else{_0x5ddd70=0xce;}_0x42f03c['status'](_0x5ddd70);return _0x42f03c[_0x1c1e('0x1f')](_0x1c1e('0x20'),_0x4bf6a8+'-'+_0x1bbab8+'/'+_0x43c4bc)['json'](_0x253f08);}return null;};}function patchUpdates(_0x2b6c9c){return function(_0x4a7595){try{jsonpatch[_0x1c1e('0x21')](_0x4a7595,_0x2b6c9c,!![]);}catch(_0x300d91){return BPromise['reject'](_0x300d91);}return _0x4a7595[_0x1c1e('0x22')]();};}function saveUpdates(_0xe40cec,_0x50549c){return function(_0x3c16ce){if(_0x3c16ce){return _0x3c16ce[_0x1c1e('0x23')](_0xe40cec)['then'](function(_0x3e533e){return _0x3e533e;});}return null;};}function removeEntity(_0x305298,_0x1eb34d){return function(_0x105a20){if(_0x105a20){return _0x105a20[_0x1c1e('0x24')]()['then'](function(){_0x305298[_0x1c1e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f5b9b,_0x1dc820){return function(_0x3df363){if(!_0x3df363){_0x2f5b9b[_0x1c1e('0x17')](0x194);}return _0x3df363;};}function handleError(_0x3b19fd,_0x37ab8c){_0x37ab8c=_0x37ab8c||0x1f4;return function(_0x4a1c7d){logger[_0x1c1e('0x25')](_0x4a1c7d[_0x1c1e('0x26')]);if(_0x4a1c7d['name']){delete _0x4a1c7d[_0x1c1e('0x27')];}_0x3b19fd[_0x1c1e('0x18')](_0x37ab8c)['send'](_0x4a1c7d);};}exports['index']=function(_0x4a2c95,_0x5e776d){var _0x4795de={},_0x1e32f1={},_0x566af0={'count':0x0,'rows':[]};var _0x3cb111=_[_0x1c1e('0x28')](db[_0x1c1e('0x29')][_0x1c1e('0x2a')],function(_0x3af440){return{'name':_0x3af440['fieldName'],'type':_0x3af440[_0x1c1e('0x2b')][_0x1c1e('0x2c')]};});_0x1e32f1[_0x1c1e('0x2d')]=_[_0x1c1e('0x28')](_0x3cb111,_0x1c1e('0x27'));_0x1e32f1[_0x1c1e('0x2e')]=_[_0x1c1e('0x2f')](_0x4a2c95['query']);_0x1e32f1[_0x1c1e('0x30')]=_[_0x1c1e('0x31')](_0x1e32f1[_0x1c1e('0x2d')],_0x1e32f1[_0x1c1e('0x2e')]);_0x4795de[_0x1c1e('0x32')]=_[_0x1c1e('0x31')](_0x1e32f1[_0x1c1e('0x2d')],qs[_0x1c1e('0x33')](_0x4a2c95[_0x1c1e('0x2e')][_0x1c1e('0x33')]));_0x4795de[_0x1c1e('0x32')]=_0x4795de[_0x1c1e('0x32')]['length']?_0x4795de[_0x1c1e('0x32')]:_0x1e32f1[_0x1c1e('0x2d')];if(!_0x4a2c95[_0x1c1e('0x2e')][_0x1c1e('0x34')](_0x1c1e('0x35'))){_0x4795de[_0x1c1e('0x1d')]=qs['limit'](_0x4a2c95['query'][_0x1c1e('0x1d')]);_0x4795de['offset']=qs['offset'](_0x4a2c95[_0x1c1e('0x2e')][_0x1c1e('0x1b')]);}_0x4795de[_0x1c1e('0x36')]=qs[_0x1c1e('0x37')](_0x4a2c95[_0x1c1e('0x2e')][_0x1c1e('0x37')]);_0x4795de[_0x1c1e('0x38')]=qs['filters'](_['pick'](_0x4a2c95[_0x1c1e('0x2e')],_0x1e32f1[_0x1c1e('0x30')]),_0x3cb111);if(_0x4a2c95[_0x1c1e('0x2e')][_0x1c1e('0x39')]){_0x4795de[_0x1c1e('0x38')]=_[_0x1c1e('0x3a')](_0x4795de[_0x1c1e('0x38')],{'$or':_[_0x1c1e('0x28')](_0x3cb111,function(_0x171f2e){if(_0x171f2e['type']!==_0x1c1e('0x3b')){var _0x135236={};_0x135236[_0x171f2e[_0x1c1e('0x27')]]={'$like':'%'+_0x4a2c95[_0x1c1e('0x2e')][_0x1c1e('0x39')]+'%'};return _0x135236;}})});}_0x4795de=_['merge']({},_0x4795de,_0x4a2c95[_0x1c1e('0x3c')]);var _0x308295={'where':_0x4795de[_0x1c1e('0x38')]};return db[_0x1c1e('0x29')][_0x1c1e('0x1e')](_0x308295)[_0x1c1e('0x3d')](function(_0x32982d){_0x566af0[_0x1c1e('0x1e')]=_0x32982d;if(_0x4a2c95[_0x1c1e('0x2e')]['includeAll']){_0x4795de[_0x1c1e('0x3e')]=[{'all':!![]}];}return db[_0x1c1e('0x29')]['findAll'](_0x4795de);})['then'](function(_0x3cd382){_0x566af0['rows']=_0x3cd382;return _0x566af0;})[_0x1c1e('0x3d')](respondWithFilteredResult(_0x5e776d,_0x4795de))[_0x1c1e('0x3f')](handleError(_0x5e776d,null));};exports['show']=function(_0x248cdc,_0x209304){var _0x3bcc77={'raw':!![],'where':{'id':_0x248cdc[_0x1c1e('0x40')]['id']}},_0x463503={};_0x463503[_0x1c1e('0x2d')]=_['keys'](db[_0x1c1e('0x29')][_0x1c1e('0x2a')]);_0x463503['query']=_[_0x1c1e('0x2f')](_0x248cdc[_0x1c1e('0x2e')]);_0x463503['filters']=_['intersection'](_0x463503['model'],_0x463503[_0x1c1e('0x2e')]);_0x3bcc77[_0x1c1e('0x32')]=_[_0x1c1e('0x31')](_0x463503[_0x1c1e('0x2d')],qs['fields'](_0x248cdc['query']['fields']));_0x3bcc77['attributes']=_0x3bcc77[_0x1c1e('0x32')][_0x1c1e('0x41')]?_0x3bcc77[_0x1c1e('0x32')]:_0x463503['model'];if(_0x248cdc[_0x1c1e('0x2e')][_0x1c1e('0x42')]){_0x3bcc77[_0x1c1e('0x3e')]=[{'all':!![]}];}_0x3bcc77=_[_0x1c1e('0x3a')]({},_0x3bcc77,_0x248cdc[_0x1c1e('0x3c')]);return db['Attachment'][_0x1c1e('0x43')](_0x3bcc77)['then'](handleEntityNotFound(_0x209304,null))[_0x1c1e('0x3d')](respondWithResult(_0x209304,null))[_0x1c1e('0x3f')](handleError(_0x209304,null));};exports[_0x1c1e('0x44')]=function(_0x408cd6,_0x208262){var _0x296ffa={'where':{'id':_0x408cd6[_0x1c1e('0x40')]['id']}},_0xa9a1d3={};_0xa9a1d3[_0x1c1e('0x2d')]=_['keys'](db[_0x1c1e('0x29')][_0x1c1e('0x2a')]);_0x296ffa[_0x1c1e('0x32')]=_[_0x1c1e('0x31')](_0xa9a1d3[_0x1c1e('0x2d')],qs[_0x1c1e('0x33')](_0x408cd6[_0x1c1e('0x2e')][_0x1c1e('0x33')]));_0x296ffa[_0x1c1e('0x32')]=_0x296ffa[_0x1c1e('0x32')][_0x1c1e('0x41')]?_0x296ffa[_0x1c1e('0x32')]:_0xa9a1d3[_0x1c1e('0x2d')];if(_0x408cd6[_0x1c1e('0x2e')][_0x1c1e('0x42')]){_0x296ffa[_0x1c1e('0x3e')]=[{'all':!![]}];}_0x296ffa=_[_0x1c1e('0x3a')]({},_0x296ffa,_0x408cd6[_0x1c1e('0x3c')]);return db[_0x1c1e('0x29')]['find'](_0x296ffa)['then'](handleEntityNotFound(_0x208262,null))[_0x1c1e('0x3d')](function(_0x4cb043){if(_0x4cb043){var _0x32792c=_0x4cb043[_0x1c1e('0x45')]({'plain':!![]});_0x32792c=qs['omit'](_0x32792c,['id',_0x1c1e('0x46'),'updatedAt']);_0x408cd6[_0x1c1e('0x47')]=_[_0x1c1e('0x48')](_0x408cd6[_0x1c1e('0x47')],['id',_0x1c1e('0x46'),'updatedAt']);return db[_0x1c1e('0x29')][_0x1c1e('0x49')](_[_0x1c1e('0x3a')](_0x32792c,_0x408cd6[_0x1c1e('0x47')]),{'include':_0x408cd6[_0x1c1e('0x2e')][_0x1c1e('0x42')]?[{'all':!![]}]:undefined});}})[_0x1c1e('0x3d')](respondWithResult(_0x208262,0xc9))[_0x1c1e('0x3f')](handleError(_0x208262,null));};exports[_0x1c1e('0x23')]=function(_0x1d3be0,_0x329f33){if(_0x1d3be0[_0x1c1e('0x47')]['id']){delete _0x1d3be0[_0x1c1e('0x47')]['id'];}return db[_0x1c1e('0x29')][_0x1c1e('0x43')]({'where':{'id':_0x1d3be0[_0x1c1e('0x40')]['id']}})[_0x1c1e('0x3d')](handleEntityNotFound(_0x329f33,null))[_0x1c1e('0x3d')](saveUpdates(_0x1d3be0['body'],null))[_0x1c1e('0x3d')](respondWithResult(_0x329f33,null))[_0x1c1e('0x3f')](handleError(_0x329f33,null));};exports['destroy']=function(_0x3e4b36,_0x11da55){return db[_0x1c1e('0x29')][_0x1c1e('0x43')]({'where':{'id':_0x3e4b36[_0x1c1e('0x40')]['id']}})[_0x1c1e('0x3d')](handleEntityNotFound(_0x11da55,null))[_0x1c1e('0x3d')](removeEntity(_0x11da55,null))[_0x1c1e('0x3f')](handleError(_0x11da55,null));};exports[_0x1c1e('0x49')]=function(_0x3665b2,_0x105a2e,_0x25014f){_0x3665b2['body'][_0x1c1e('0x27')]=_0x3665b2['file'][_0x1c1e('0x4a')];_0x3665b2[_0x1c1e('0x47')][_0x1c1e('0x4b')]=_0x3665b2[_0x1c1e('0x4c')][_0x1c1e('0x4d')];_0x3665b2[_0x1c1e('0x47')][_0x1c1e('0x2b')]=_0x3665b2[_0x1c1e('0x4c')][_0x1c1e('0x4e')];return db['Attachment']['create'](_0x3665b2[_0x1c1e('0x47')])[_0x1c1e('0x3d')](respondWithResult(_0x105a2e,0xc9))[_0x1c1e('0x3f')](handleError(_0x105a2e,null));};exports['download']=function(_0x532401,_0x6d98da,_0x1f1ca8){return db[_0x1c1e('0x29')][_0x1c1e('0x4f')]({'where':{'id':_0x532401['params']['id']},'raw':!![]})[_0x1c1e('0x3d')](handleEntityNotFound(_0x6d98da,null))[_0x1c1e('0x3d')](function(_0x47c900){if(_0x47c900){var _0x5036b3=_0x47c900[_0x1c1e('0x50')]!==null;var _0x29ae35=path[_0x1c1e('0x51')](config[_0x1c1e('0x52')],'server/files/attachments/');if(_0x5036b3){_0x29ae35=path[_0x1c1e('0x51')](_0x29ae35,_0x1c1e('0x53'));}var _0x3ad8f5=path[_0x1c1e('0x51')](_0x29ae35,_0x47c900[_0x1c1e('0x4b')]);return _0x6d98da[_0x1c1e('0x54')](_0x3ad8f5);}})[_0x1c1e('0x3f')](handleError(_0x6d98da,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 49a5534..5bdeba8 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 _0x233b=['rimraf','../../config/environment','./attachment.attributes','exports','define','../../config/logger','api','moment','bluebird','path'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x233b,0x1a9));var _0xb233=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x233b[_0x4ff09b];return _0x3f5c2e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb233('0x0'))(_0xb233('0x1'));var moment=require(_0xb233('0x2'));var BPromise=require(_0xb233('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb233('0x4'));var rimraf=require(_0xb233('0x5'));var config=require(_0xb233('0x6'));var attributes=require(_0xb233('0x7'));module[_0xb233('0x8')]=function(_0x45fdc9,_0x49a7fa){return _0x45fdc9[_0xb233('0x9')]('Attachment',attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6aea=['api','moment','bluebird','path','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash','util','../../config/logger'];(function(_0x4c7fb5,_0x2548ef){var _0x2e10ac=function(_0xf7e27c){while(--_0xf7e27c){_0x4c7fb5['push'](_0x4c7fb5['shift']());}};_0x2e10ac(++_0x2548ef);}(_0x6aea,0xdd));var _0xa6ae=function(_0x5ceb68,_0x1aa3bc){_0x5ceb68=_0x5ceb68-0x0;var _0x3d9ae8=_0x6aea[_0x5ceb68];return _0x3d9ae8;};'use strict';var _=require(_0xa6ae('0x0'));var util=require(_0xa6ae('0x1'));var logger=require(_0xa6ae('0x2'))(_0xa6ae('0x3'));var moment=require(_0xa6ae('0x4'));var BPromise=require(_0xa6ae('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa6ae('0x6'));var rimraf=require(_0xa6ae('0x7'));var config=require(_0xa6ae('0x8'));var attributes=require(_0xa6ae('0x9'));module[_0xa6ae('0xa')]=function(_0x1d5cc4,_0x193a80){return _0x1d5cc4[_0xa6ae('0xb')](_0xa6ae('0xc'),attributes,{'tableName':_0xa6ae('0xd'),'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 f430c54..fd2e13f 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 _0x032a=['result','catch','CreateAttachment','Attachment','create','options','raw','then','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x32a884,_0x183853){var _0x242f9b=function(_0x556c63){while(--_0x556c63){_0x32a884['push'](_0x32a884['shift']());}};_0x242f9b(++_0x183853);}(_0x032a,0xf0));var _0xa032=function(_0x50e7e0,_0x5affce){_0x50e7e0=_0x50e7e0-0x0;var _0x1a0307=_0x032a[_0x50e7e0];return _0x1a0307;};'use strict';var _=require('lodash');var util=require(_0xa032('0x0'));var moment=require('moment');var BPromise=require(_0xa032('0x1'));var rs=require(_0xa032('0x2'));var fs=require('fs');var Redis=require(_0xa032('0x3'));var db=require(_0xa032('0x4'))['db'];var utils=require(_0xa032('0x5'));var logger=require(_0xa032('0x6'))(_0xa032('0x7'));var config=require(_0xa032('0x8'));var jayson=require(_0xa032('0x9'));var client=jayson[_0xa032('0xa')][_0xa032('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x40128a,_0x54275c,_0x616437){return new BPromise(function(_0x4a5d8e,_0x5d0744){return client[_0xa032('0xc')](_0x40128a,_0x616437)['then'](function(_0x18283a){logger[_0xa032('0xd')](_0xa032('0xe'),_0x54275c,_0xa032('0xf'));logger[_0xa032('0x10')]('Attachment,\x20%s,\x20%s,\x20%s',_0x54275c,_0xa032('0xf'),JSON[_0xa032('0x11')](_0x18283a));if(_0x18283a['error']){if(_0x18283a[_0xa032('0x12')][_0xa032('0x13')]===0x1f4){logger[_0xa032('0x12')](_0xa032('0xe'),_0x54275c,_0x18283a[_0xa032('0x12')]['message']);return _0x5d0744(_0x18283a[_0xa032('0x12')][_0xa032('0x14')]);}logger[_0xa032('0x12')](_0xa032('0xe'),_0x54275c,_0x18283a[_0xa032('0x12')][_0xa032('0x14')]);return _0x4a5d8e(_0x18283a[_0xa032('0x12')][_0xa032('0x14')]);}else{logger[_0xa032('0xd')](_0xa032('0xe'),_0x54275c,'request\x20sent');_0x4a5d8e(_0x18283a[_0xa032('0x15')][_0xa032('0x14')]);}})[_0xa032('0x16')](function(_0x2caacd){logger[_0xa032('0x12')](_0xa032('0xe'),_0x54275c,_0x2caacd);_0x5d0744(_0x2caacd);});});}exports[_0xa032('0x17')]=function(_0x577406){var _0xff6817=this;return new Promise(function(_0x54fba7,_0x1d8cf4){return db[_0xa032('0x18')][_0xa032('0x19')](_0x577406['body'],{'raw':_0x577406[_0xa032('0x1a')]?_0x577406['options'][_0xa032('0x1b')]===undefined?!![]:![]:!![]})[_0xa032('0x1c')](function(_0x471757){logger[_0xa032('0xd')](_0xa032('0x17'),_0x577406);logger[_0xa032('0x10')]('CreateAttachment',_0x577406,JSON[_0xa032('0x11')](_0x471757));_0x54fba7(_0x471757);})[_0xa032('0x16')](function(_0x5a817b){logger[_0xa032('0x12')]('CreateAttachment',_0x5a817b[_0xa032('0x14')],_0x577406);_0x1d8cf4(_0xff6817['error'](0x1f4,_0x5a817b[_0xa032('0x14')]));});});};
\ No newline at end of file
+var _0x8cfd=['options','raw','info','CreateAttachment','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Attachment','create','body'];(function(_0x2114e3,_0x2c3028){var _0x6bff25=function(_0x197a39){while(--_0x197a39){_0x2114e3['push'](_0x2114e3['shift']());}};_0x6bff25(++_0x2c3028);}(_0x8cfd,0xe4));var _0xd8cf=function(_0x271060,_0x3f86b1){_0x271060=_0x271060-0x0;var _0x40540b=_0x8cfd[_0x271060];return _0x40540b;};'use strict';var _=require(_0xd8cf('0x0'));var util=require(_0xd8cf('0x1'));var moment=require(_0xd8cf('0x2'));var BPromise=require(_0xd8cf('0x3'));var rs=require(_0xd8cf('0x4'));var fs=require('fs');var Redis=require(_0xd8cf('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd8cf('0x6'));var logger=require(_0xd8cf('0x7'))(_0xd8cf('0x8'));var config=require(_0xd8cf('0x9'));var jayson=require(_0xd8cf('0xa'));var client=jayson[_0xd8cf('0xb')][_0xd8cf('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4b41b7,_0x5cfd20,_0x3fe2d2){return new BPromise(function(_0xa5b446,_0x37b91b){return client[_0xd8cf('0xd')](_0x4b41b7,_0x3fe2d2)[_0xd8cf('0xe')](function(_0x668d6c){logger['info'](_0xd8cf('0xf'),_0x5cfd20,_0xd8cf('0x10'));logger[_0xd8cf('0x11')](_0xd8cf('0x12'),_0x5cfd20,_0xd8cf('0x10'),JSON[_0xd8cf('0x13')](_0x668d6c));if(_0x668d6c[_0xd8cf('0x14')]){if(_0x668d6c[_0xd8cf('0x14')][_0xd8cf('0x15')]===0x1f4){logger[_0xd8cf('0x14')](_0xd8cf('0xf'),_0x5cfd20,_0x668d6c[_0xd8cf('0x14')]['message']);return _0x37b91b(_0x668d6c[_0xd8cf('0x14')]['message']);}logger[_0xd8cf('0x14')](_0xd8cf('0xf'),_0x5cfd20,_0x668d6c['error'][_0xd8cf('0x16')]);return _0xa5b446(_0x668d6c[_0xd8cf('0x14')][_0xd8cf('0x16')]);}else{logger['info'](_0xd8cf('0xf'),_0x5cfd20,'request\x20sent');_0xa5b446(_0x668d6c[_0xd8cf('0x17')][_0xd8cf('0x16')]);}})[_0xd8cf('0x18')](function(_0x55018c){logger[_0xd8cf('0x14')](_0xd8cf('0xf'),_0x5cfd20,_0x55018c);_0x37b91b(_0x55018c);});});}exports['CreateAttachment']=function(_0xecd444){var _0x73e7c3=this;return new Promise(function(_0x3bee85,_0xf8732e){return db[_0xd8cf('0x19')][_0xd8cf('0x1a')](_0xecd444[_0xd8cf('0x1b')],{'raw':_0xecd444[_0xd8cf('0x1c')]?_0xecd444[_0xd8cf('0x1c')][_0xd8cf('0x1d')]===undefined?!![]:![]:!![]})[_0xd8cf('0xe')](function(_0x2f8e8a){logger[_0xd8cf('0x1e')](_0xd8cf('0x1f'),_0xecd444);logger['debug'](_0xd8cf('0x1f'),_0xecd444,JSON[_0xd8cf('0x13')](_0x2f8e8a));_0x3bee85(_0x2f8e8a);})[_0xd8cf('0x18')](function(_0x182613){logger[_0xd8cf('0x14')]('CreateAttachment',_0x182613[_0xd8cf('0x16')],_0xecd444);_0xf8732e(_0x73e7c3['error'](0x1f4,_0x182613['message']));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 54e5ff7..e071f14 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(_0x30e43f,_0x418ef7){var _0x571e18=function(_0x41d3df){while(--_0x41d3df){_0x30e43f['push'](_0x30e43f['shift']());}};_0x571e18(++_0x418ef7);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1c802c,_0x177ac9){_0x1c802c=_0x1c802c-0x0;var _0x1e53da=_0x5f2f[_0x1c802c];return _0x1e53da;};'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 _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xdb28,0x106));var _0x8db2=function(_0x1d0549,_0x141420){_0x1d0549=_0x1d0549-0x0;var _0x4cea46=_0xdb28[_0x1d0549];return _0x4cea46;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index fe4a83c..4e2cfe6 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 _0x0983=['email','use','clientID','secret','callbackURL','Setting','findOne','allowedLoginAttempts','blockDuration','then','User','map','emails','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','clearBlockUser','getLicense','catch','lodash','passport-google-oauth20','Strategy','moment','../../mysqldb','../../config/environment','../../components/auth/service','../../config/utils','login','authenticate','google','/login','profile'];(function(_0x21a1a6,_0x1474bf){var _0x5cec0e=function(_0x13abb9){while(--_0x13abb9){_0x21a1a6['push'](_0x21a1a6['shift']());}};_0x5cec0e(++_0x1474bf);}(_0x0983,0x151));var _0x3098=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x0983[_0x36eaaa];return _0x461349;};'use strict';var _=require(_0x3098('0x0'));var passport=require('passport');var GoogleStrategy=require(_0x3098('0x1'))[_0x3098('0x2')];var moment=require(_0x3098('0x3'));var db=require(_0x3098('0x4'))['db'];var config=require(_0x3098('0x5'));var signToken=require(_0x3098('0x6'))['signToken'];var utils=require(_0x3098('0x7'));exports[_0x3098('0x8')]=passport[_0x3098('0x9')](_0x3098('0xa'),{'failureRedirect':_0x3098('0xb'),'scope':[_0x3098('0xc'),_0x3098('0xd')],'session':![]});exports['callback']=passport[_0x3098('0x9')]('google',{'failureRedirect':_0x3098('0xb'),'session':![]});passport[_0x3098('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x3098('0xa')][_0x3098('0xf')]:'id','clientSecret':config[_0x3098('0xa')]?config[_0x3098('0xa')]['clientSecret']:_0x3098('0x10'),'callbackURL':config['google']?config[_0x3098('0xa')][_0x3098('0x11')]:''},function(_0x4b3b3c,_0x37a2c4,_0x567748,_0x1d3cf2){var _0x522c66,_0x4ce235;return db[_0x3098('0x12')][_0x3098('0x13')]({'where':{'id':0x1},'attributes':[_0x3098('0x14'),_0x3098('0x15')],'raw':!![]})[_0x3098('0x16')](function(_0x58a6fe){_0x522c66=_0x58a6fe;return db[_0x3098('0x17')]['find']({'where':{'email':_[_0x3098('0x18')](_0x567748[_0x3098('0x19')],'value'),'role':{'$or':['admin',_0x3098('0x1a'),_0x3098('0x1b')]}}});})[_0x3098('0x16')](function(_0x869728){_0x4ce235=_0x869728;if(_0x4ce235){if(_0x4ce235[_0x3098('0x1c')]){return _0x1d3cf2(_0x3098('0x1d'));}else if(_0x522c66[_0x3098('0x15')]>0x0){if(_0x4ce235[_0x3098('0x1e')]){if(moment(_0x4ce235[_0x3098('0x1f')])['add'](_0x522c66['blockDuration'],'minutes')>moment()){return _0x1d3cf2(_0x3098('0x1d'));}else{return utils[_0x3098('0x20')](_0x4ce235,0x0,![],null)[_0x3098('0x16')](function(){return utils[_0x3098('0x21')](_0x4ce235);})[_0x3098('0x16')](function(){return _0x1d3cf2(null,_0x4ce235);});}}else{return utils['getLicense'](_0x4ce235)[_0x3098('0x16')](function(){return _0x1d3cf2(null,_0x4ce235);});}}else{return utils['getLicense'](_0x4ce235)[_0x3098('0x16')](function(){return _0x1d3cf2(null,_0x4ce235);});}}return _0x1d3cf2('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0x3098('0x22')](function(_0x16a087){_0x1d3cf2(_0x16a087);});}));
\ No newline at end of file
+var _0x170f=['authenticate','google','/login','profile','email','callback','use','secret','callbackURL','Setting','findOne','blockDuration','then','find','map','emails','value','admin','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','minutes','clearBlockUser','getLicense','lodash','passport','passport-google-oauth20','Strategy','moment','../../mysqldb','../../components/auth/service','signToken','../../config/utils','login'];(function(_0x393a89,_0x2781fe){var _0x5c2c06=function(_0x9c539e){while(--_0x9c539e){_0x393a89['push'](_0x393a89['shift']());}};_0x5c2c06(++_0x2781fe);}(_0x170f,0x14c));var _0xf170=function(_0x236c89,_0xd76ba9){_0x236c89=_0x236c89-0x0;var _0x3b2a15=_0x170f[_0x236c89];return _0x3b2a15;};'use strict';var _=require(_0xf170('0x0'));var passport=require(_0xf170('0x1'));var GoogleStrategy=require(_0xf170('0x2'))[_0xf170('0x3')];var moment=require(_0xf170('0x4'));var db=require(_0xf170('0x5'))['db'];var config=require('../../config/environment');var signToken=require(_0xf170('0x6'))[_0xf170('0x7')];var utils=require(_0xf170('0x8'));exports[_0xf170('0x9')]=passport[_0xf170('0xa')](_0xf170('0xb'),{'failureRedirect':_0xf170('0xc'),'scope':[_0xf170('0xd'),_0xf170('0xe')],'session':![]});exports[_0xf170('0xf')]=passport[_0xf170('0xa')](_0xf170('0xb'),{'failureRedirect':'/login','session':![]});passport[_0xf170('0x10')](new GoogleStrategy({'clientID':config[_0xf170('0xb')]?config[_0xf170('0xb')]['clientID']:'id','clientSecret':config['google']?config['google']['clientSecret']:_0xf170('0x11'),'callbackURL':config[_0xf170('0xb')]?config[_0xf170('0xb')][_0xf170('0x12')]:''},function(_0x429465,_0x21c4d9,_0x5abe66,_0x19e2d8){var _0x9917f3,_0x1ef495;return db[_0xf170('0x13')][_0xf170('0x14')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xf170('0x15')],'raw':!![]})[_0xf170('0x16')](function(_0x168154){_0x9917f3=_0x168154;return db['User'][_0xf170('0x17')]({'where':{'email':_[_0xf170('0x18')](_0x5abe66[_0xf170('0x19')],_0xf170('0x1a')),'role':{'$or':[_0xf170('0x1b'),_0xf170('0x1c'),_0xf170('0x1d')]}}});})['then'](function(_0x1374a1){_0x1ef495=_0x1374a1;if(_0x1ef495){if(_0x1ef495[_0xf170('0x1e')]){return _0x19e2d8(_0xf170('0x1f'));}else if(_0x9917f3[_0xf170('0x15')]>0x0){if(_0x1ef495[_0xf170('0x20')]){if(moment(_0x1ef495[_0xf170('0x21')])[_0xf170('0x22')](_0x9917f3[_0xf170('0x15')],_0xf170('0x23'))>moment()){return _0x19e2d8(_0xf170('0x1f'));}else{return utils[_0xf170('0x24')](_0x1ef495,0x0,![],null)[_0xf170('0x16')](function(){return utils[_0xf170('0x25')](_0x1ef495);})['then'](function(){return _0x19e2d8(null,_0x1ef495);});}}else{return utils[_0xf170('0x25')](_0x1ef495)[_0xf170('0x16')](function(){return _0x19e2d8(null,_0x1ef495);});}}else{return utils[_0xf170('0x25')](_0x1ef495)[_0xf170('0x16')](function(){return _0x19e2d8(null,_0x1ef495);});}}return _0x19e2d8(_0xf170('0x1f'));})['catch'](function(_0x2d6207){_0x19e2d8(_0x2d6207);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 9feafa2..8ed8f1a 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 _0x1d99=['login','callback','isMiddleware','setTokenCookie','exports','express','passport','Router','../user/user.controller.js','../../components/auth/service','get'];(function(_0x3553cb,_0x16f3db){var _0x47f419=function(_0x398197){while(--_0x398197){_0x3553cb['push'](_0x3553cb['shift']());}};_0x47f419(++_0x16f3db);}(_0x1d99,0xaa));var _0x91d9=function(_0xe289f7,_0x5f21cb){_0xe289f7=_0xe289f7-0x0;var _0x45314c=_0x1d99[_0xe289f7];return _0x45314c;};'use strict';var express=require(_0x91d9('0x0'));var passport=require(_0x91d9('0x1'));var router=express[_0x91d9('0x2')]();var controller=require('./authGoogle.controller');var userController=require(_0x91d9('0x3'));var authService=require(_0x91d9('0x4'));router[_0x91d9('0x5')]('/',controller[_0x91d9('0x6')]);router[_0x91d9('0x5')]('/callback',controller[_0x91d9('0x7')],authService[_0x91d9('0x8')],userController[_0x91d9('0x6')],authService[_0x91d9('0x9')]);module[_0x91d9('0xa')]=router;
\ No newline at end of file
+var _0x9fe9=['login','/callback','callback','exports','passport','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get'];(function(_0x2a6e4c,_0x5eef27){var _0x153fce=function(_0x37c2ef){while(--_0x37c2ef){_0x2a6e4c['push'](_0x2a6e4c['shift']());}};_0x153fce(++_0x5eef27);}(_0x9fe9,0x1e1));var _0x99fe=function(_0x2d1785,_0x27fc1b){_0x2d1785=_0x2d1785-0x0;var _0x275a55=_0x9fe9[_0x2d1785];return _0x275a55;};'use strict';var express=require('express');var passport=require(_0x99fe('0x0'));var router=express['Router']();var controller=require(_0x99fe('0x1'));var userController=require(_0x99fe('0x2'));var authService=require(_0x99fe('0x3'));router[_0x99fe('0x4')]('/',controller[_0x99fe('0x5')]);router[_0x99fe('0x4')](_0x99fe('0x6'),controller[_0x99fe('0x7')],authService['isMiddleware'],userController['login'],authService['setTokenCookie']);module[_0x99fe('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 84e52b9..bd7922f 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 _0x5d44=['error','message','stringify','status','login','signToken','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','Setting','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','Reset\x20Email\x20sent!','reset','User','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','Password\x20reset!','util','passport','passport-local','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','http','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','disabled','add','minutes','clearBlockUser','getLicense','catch','MailAccount','email','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','pass','format'];(function(_0x560a6d,_0x42c234){var _0x4b29aa=function(_0x24309c){while(--_0x24309c){_0x560a6d['push'](_0x560a6d['shift']());}};_0x4b29aa(++_0x42c234);}(_0x5d44,0xd1));var _0x45d4=function(_0x20b91e,_0xe4e682){_0x20b91e=_0x20b91e-0x0;var _0x41d214=_0x5d44[_0x20b91e];return _0x41d214;};'use strict';var util=require(_0x45d4('0x0'));var passport=require(_0x45d4('0x1'));var LocalStrategy=require(_0x45d4('0x2'))['Strategy'];var jayson=require(_0x45d4('0x3'));var _=require(_0x45d4('0x4'));var rs=require(_0x45d4('0x5'));var moment=require(_0x45d4('0x6'));var db=require(_0x45d4('0x7'))['db'];var authService=require(_0x45d4('0x8'));var utils=require(_0x45d4('0x9'));var client=jayson['client'][_0x45d4('0xa')]({'port':0x232b});function localAuthenticate(_0x17e99c,_0x32d570,_0x56fe0b,_0x2717b2){var _0x4ecf33,_0x102cbe;return db['Setting'][_0x45d4('0xb')]({'where':{'id':0x1},'attributes':[_0x45d4('0xc'),_0x45d4('0xd')],'raw':!![]})[_0x45d4('0xe')](function(_0x4d9bae){_0x4ecf33=_0x4d9bae;return _0x17e99c[_0x45d4('0xb')]({'attributes':['id',_0x45d4('0xf'),_0x45d4('0x10'),_0x45d4('0x11'),_0x45d4('0x12'),'disabled',_0x45d4('0x13'),_0x45d4('0x14'),_0x45d4('0x15')],'where':{'name':_0x32d570,'role':{'$or':[_0x45d4('0x16'),_0x45d4('0x17'),_0x45d4('0x18')]}}});})[_0x45d4('0xe')](function(_0x45eb36){if(!_0x45eb36||_0x45eb36&&_0x45eb36[_0x45d4('0xf')]!==_0x32d570){throw new Error(_0x45d4('0x19'));}else{_0x102cbe=_0x45eb36;return _0x102cbe;}})[_0x45d4('0xe')](function(){_0x102cbe[_0x45d4('0x1a')](_0x56fe0b,function(_0x152ecb,_0x1adc55){var _0x2ba0e0=_0x102cbe[_0x45d4('0x15')]+0x1;if(_0x152ecb){return _0x2717b2(_0x152ecb);}else if(!_0x1adc55){if(_0x102cbe[_0x45d4('0x1b')]){return _0x2717b2(null,![],{'message':_0x45d4('0x19')});}else if(_0x4ecf33[_0x45d4('0xc')]>0x0){if(_0x102cbe['blocked']){if(_0x4ecf33[_0x45d4('0xd')]>0x0){if(moment(_0x102cbe[_0x45d4('0x14')])[_0x45d4('0x1c')](_0x4ecf33['blockDuration'],_0x45d4('0x1d'))>moment()){return _0x2717b2(null,![],{'message':_0x45d4('0x19')});}else{return utils['clearBlockUser'](_0x102cbe,_0x2ba0e0,![],null)['then'](function(){return _0x2717b2(null,![],{'message':_0x45d4('0x19')});});}}else{return _0x2717b2(null,![],{'message':_0x45d4('0x19')});}}else{if(_0x2ba0e0>=_0x4ecf33[_0x45d4('0xc')]){return utils[_0x45d4('0x1e')](_0x102cbe,0x0,!![],moment())[_0x45d4('0xe')](function(){return _0x2717b2(null,![],{'message':_0x45d4('0x19')});});}else{return utils[_0x45d4('0x1e')](_0x102cbe,_0x2ba0e0,![],null)[_0x45d4('0xe')](function(){return _0x2717b2(null,![],{'message':_0x45d4('0x19')});});}}}else{return _0x2717b2(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x102cbe[_0x45d4('0x1b')]){return _0x2717b2(null,![],{'message':_0x45d4('0x19')});}else if(_0x4ecf33['allowedLoginAttempts']>0x0){if(_0x102cbe['blocked']){if(_0x4ecf33['blockDuration']>0x0){if(moment(_0x102cbe[_0x45d4('0x14')])[_0x45d4('0x1c')](_0x4ecf33[_0x45d4('0xd')],'minutes')>moment()){return _0x2717b2(null,![],{'message':_0x45d4('0x19')});}else{return utils['clearBlockUser'](_0x102cbe,0x0,![],null)[_0x45d4('0xe')](function(){return utils[_0x45d4('0x1f')](_0x102cbe);})[_0x45d4('0xe')](function(){return _0x2717b2(null,_0x102cbe);});}}else{return _0x2717b2(null,![],{'message':_0x45d4('0x19')});}}else{return utils[_0x45d4('0x1e')](_0x102cbe,0x0,![],null)[_0x45d4('0xe')](function(){return utils[_0x45d4('0x1f')](_0x102cbe);})[_0x45d4('0xe')](function(){return _0x2717b2(null,_0x102cbe);})[_0x45d4('0x20')](function(_0x30781e){return _0x2717b2(null,![],_0x30781e);});}}else{if(_0x102cbe[_0x45d4('0x13')]){return _0x2717b2(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x45d4('0x1f')](_0x102cbe)[_0x45d4('0xe')](function(){return _0x2717b2(null,_0x102cbe);});}}}});})['catch'](function(_0x3cf0c1){return _0x2717b2(null,![],_0x3cf0c1);});}function sendServiceMail(_0x6bc17b){return db[_0x45d4('0x21')]['find']({'where':{'service':!![]},'attributes':['id',_0x45d4('0xf'),_0x45d4('0x22')],'include':[{'model':db['MailServerOut'],'as':_0x45d4('0x23')}]})[_0x45d4('0xe')](function(_0x23bd4c){if(!_0x23bd4c){throw new Error(_0x45d4('0x24'));}var _0x4cbdd2={'tls':{'rejectUnauthorized':![]}};if(_0x23bd4c[_0x45d4('0x23')][_0x45d4('0x25')]){_0x4cbdd2[_0x45d4('0x25')]=_0x23bd4c['Smtp'][_0x45d4('0x25')];}else{_0x4cbdd2[_0x45d4('0x26')]=_0x23bd4c[_0x45d4('0x23')][_0x45d4('0x26')];_0x4cbdd2[_0x45d4('0x27')]=_0x23bd4c[_0x45d4('0x23')][_0x45d4('0x27')];_0x4cbdd2[_0x45d4('0x28')]=_0x23bd4c[_0x45d4('0x23')][_0x45d4('0x28')];}if(_0x23bd4c[_0x45d4('0x23')]['authentication']){_0x4cbdd2['auth']={'user':_0x23bd4c[_0x45d4('0x23')][_0x45d4('0x17')],'pass':_0x23bd4c[_0x45d4('0x23')][_0x45d4('0x29')]};}var _0x282f61={'account':_0x4cbdd2,'message':_['merge']({'from':util[_0x45d4('0x2a')]('\x22%s\x22\x20<%s>',_0x23bd4c[_0x45d4('0xf')],_0x23bd4c['email']||_0x23bd4c[_0x45d4('0x23')][_0x45d4('0x17')])},_0x6bc17b)};return client['request']('SendMail',_0x282f61);})[_0x45d4('0xe')](function(_0x2889db){if(_0x2889db[_0x45d4('0x2b')]){throw new Error(util['format']('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x2889db['error'][_0x45d4('0x2c')]||JSON[_0x45d4('0x2d')](_0x2889db[_0x45d4('0x2b')])));}return!![];});}function handleError(_0x3cc141,_0x15f3e5,_0xe02fb2){return _0x3cc141[_0x45d4('0x2e')](_0x15f3e5||0x1f4)['send']({'message':_0xe02fb2?_0xe02fb2[_0x45d4('0x2c')]||_0xe02fb2:''});}exports[_0x45d4('0x2f')]=function(_0x26aa1f,_0x2e7491,_0x41eba8){passport['authenticate']('local',function(_0x23db01,_0x399f78,_0x569e9d){var _0x139859=_0x23db01||_0x569e9d;if(_0x139859){return handleError(_0x2e7491,0x191,_0x139859);}if(!_0x399f78){return handleError(_0x2e7491,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x55d270={'payload':{'id':_0x399f78['id'],'role':_0x399f78[_0x45d4('0x12')]},'options':{'expiresIn':0x15180}};return authService[_0x45d4('0x30')](_0x55d270)[_0x45d4('0xe')](function(_0xfafe6a){_0x2e7491['json']({'id':_0x399f78['id'],'token':_0xfafe6a,'statusCall':'','isAlreadyLogged':_0x399f78[_0x45d4('0x31')]});});}})(_0x26aa1f,_0x2e7491,_0x41eba8);};exports[_0x45d4('0x32')]=function(_0x3be779,_0x2616dd,_0xb51b99){if(!_0x3be779[_0x45d4('0x33')]['email']){return handleError(_0x2616dd,0x1f4,{'message':_0x45d4('0x34')});}var _0x39920e=rs[_0x45d4('0x35')]();_0x3be779[_0x45d4('0x33')][_0x45d4('0x22')]=_0x3be779['body'][_0x45d4('0x22')][_0x45d4('0x36')]()[_0x45d4('0x37')]();var _0x59df68;return db[_0x45d4('0x38')][_0x45d4('0xb')]({'where':{'id':0x1},'attributes':[_0x45d4('0xc'),_0x45d4('0xd')],'raw':!![]})[_0x45d4('0xe')](function(_0x199bf6){_0x59df68=_0x199bf6;return db['User'][_0x45d4('0x39')]({'where':{'email':_0x3be779['body'][_0x45d4('0x22')]}});})[_0x45d4('0xe')](function(_0x16ed41){if(!_0x16ed41){throw new Error(_0x45d4('0x3a'));}if(_0x16ed41[_0x45d4('0x1b')]){throw new Error(_0x45d4('0x3b'));}if(_0x16ed41[_0x45d4('0x13')]){if(moment(_0x16ed41[_0x45d4('0x14')])[_0x45d4('0x1c')](_0x59df68[_0x45d4('0xd')],_0x45d4('0x1d'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x16ed41['blocked']=![];_0x16ed41[_0x45d4('0x14')]=null;}}_0x16ed41[_0x45d4('0x3c')]=_0x39920e;_0x16ed41[_0x45d4('0x3d')]=Date[_0x45d4('0x3e')]()+0x36ee80;return _0x16ed41[_0x45d4('0x3f')]();})[_0x45d4('0xe')](function(){return sendServiceMail({'to':_0x3be779[_0x45d4('0x33')][_0x45d4('0x22')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x45d4('0x40')+_0x45d4('0x41')+_0x45d4('0x42')+_0x3be779[_0x45d4('0x43')][_0x45d4('0x26')]+_0x45d4('0x44')+_0x39920e+'\x0a\x0a'+_0x45d4('0x45')});})[_0x45d4('0xe')](function(){_0x2616dd['status'](0xc8)[_0x45d4('0x46')]({'message':_0x45d4('0x47')});})[_0x45d4('0x20')](function(_0x14ef5d){return handleError(_0x2616dd,0x1f4,_0x14ef5d);});};exports[_0x45d4('0x48')]=function(_0x5d56da,_0x206e2c,_0x48e552){return db[_0x45d4('0x49')][_0x45d4('0x39')]({'where':{'resetPasswordToken':_0x5d56da[_0x45d4('0x4a')][_0x45d4('0x4b')],'resetPasswordExpires':{'$gt':Date[_0x45d4('0x3e')]()}}})[_0x45d4('0xe')](function(_0x3a76eb){if(!_0x3a76eb){throw new Error(_0x45d4('0x4c'));}return db[_0x45d4('0x38')]['findOne']({'attributes':['id',_0x45d4('0x4d'),_0x45d4('0x4e'),_0x45d4('0x4f')]})['then'](function(_0xb9bc4f){if(_0xb9bc4f[_0x45d4('0x4d')])authService[_0x45d4('0x50')](_0x5d56da['body'][_0x45d4('0x10')]);if(!_0xb9bc4f[_0x45d4('0x4e')]||!_0x3a76eb[_0x45d4('0x51')])return _0x3a76eb;authService[_0x45d4('0x52')](_0x5d56da['body'][_0x45d4('0x10')],_0x3a76eb['previousPasswords'],_0xb9bc4f[_0x45d4('0x4f')]);return _0x3a76eb;})[_0x45d4('0xe')](function(){_0x3a76eb[_0x45d4('0x10')]=_0x5d56da[_0x45d4('0x33')][_0x45d4('0x10')];_0x3a76eb[_0x45d4('0x3c')]=null;_0x3a76eb[_0x45d4('0x3d')]=null;return _0x3a76eb[_0x45d4('0x3f')]();});})[_0x45d4('0xe')](function(){_0x206e2c[_0x45d4('0x2e')](0xc8)['send']({'message':_0x45d4('0x53')});})[_0x45d4('0x20')](function(_0x59a201){return handleError(_0x206e2c,0x1f4,_0x59a201);});};passport['use'](new LocalStrategy({'usernameField':_0x45d4('0xf'),'passwordField':_0x45d4('0x10')},function(_0x5a1889,_0x115804,_0x51eb90){return localAuthenticate(db[_0x45d4('0x49')],_0x5a1889,_0x115804,_0x51eb90);}));
\ No newline at end of file
+var _0x8b6b=['loginAttempts','admin','user','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','clearBlockUser','add','minutes','getLicense','catch','MailAccount','find','email','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','host','port','secure','authentication','auth','pass','merge','\x22%s\x22\x20<%s>','request','SendMail','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','status','send','local','signToken','json','online','forgot','body','trim','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','params','passwordHistoryLimit','securePassword','validatePasswordPattern','previousPasswords','Password\x20reset!','use','util','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','password','salt','role','disabled','blocked','blockedAt'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x8b6b,0x8e));var _0xb8b6=function(_0x12d274,_0x26ee13){_0x12d274=_0x12d274-0x0;var _0x4fe54b=_0x8b6b[_0x12d274];return _0x4fe54b;};'use strict';var util=require(_0xb8b6('0x0'));var passport=require('passport');var LocalStrategy=require(_0xb8b6('0x1'))[_0xb8b6('0x2')];var jayson=require(_0xb8b6('0x3'));var _=require(_0xb8b6('0x4'));var rs=require(_0xb8b6('0x5'));var moment=require(_0xb8b6('0x6'));var db=require('../../mysqldb')['db'];var authService=require(_0xb8b6('0x7'));var utils=require(_0xb8b6('0x8'));var client=jayson[_0xb8b6('0x9')][_0xb8b6('0xa')]({'port':0x232b});function localAuthenticate(_0x2fc941,_0x5bfc67,_0x8db467,_0x5b64ad){var _0x4c4590,_0x4bfd6b;return db[_0xb8b6('0xb')][_0xb8b6('0xc')]({'where':{'id':0x1},'attributes':[_0xb8b6('0xd'),_0xb8b6('0xe')],'raw':!![]})[_0xb8b6('0xf')](function(_0x152ae1){_0x4c4590=_0x152ae1;return _0x2fc941['findOne']({'attributes':['id','name',_0xb8b6('0x10'),_0xb8b6('0x11'),_0xb8b6('0x12'),_0xb8b6('0x13'),_0xb8b6('0x14'),_0xb8b6('0x15'),_0xb8b6('0x16')],'where':{'name':_0x5bfc67,'role':{'$or':[_0xb8b6('0x17'),_0xb8b6('0x18'),_0xb8b6('0x19')]}}});})[_0xb8b6('0xf')](function(_0x34e1b9){if(!_0x34e1b9||_0x34e1b9&&_0x34e1b9[_0xb8b6('0x1a')]!==_0x5bfc67){throw new Error(_0xb8b6('0x1b'));}else{_0x4bfd6b=_0x34e1b9;return _0x4bfd6b;}})[_0xb8b6('0xf')](function(){_0x4bfd6b[_0xb8b6('0x1c')](_0x8db467,function(_0x49e5c6,_0x3deb37){var _0x4fca3a=_0x4bfd6b[_0xb8b6('0x16')]+0x1;if(_0x49e5c6){return _0x5b64ad(_0x49e5c6);}else if(!_0x3deb37){if(_0x4bfd6b[_0xb8b6('0x13')]){return _0x5b64ad(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x4c4590[_0xb8b6('0xd')]>0x0){if(_0x4bfd6b[_0xb8b6('0x14')]){if(_0x4c4590[_0xb8b6('0xe')]>0x0){if(moment(_0x4bfd6b[_0xb8b6('0x15')])['add'](_0x4c4590[_0xb8b6('0xe')],'minutes')>moment()){return _0x5b64ad(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x4bfd6b,_0x4fca3a,![],null)[_0xb8b6('0xf')](function(){return _0x5b64ad(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x5b64ad(null,![],{'message':_0xb8b6('0x1b')});}}else{if(_0x4fca3a>=_0x4c4590[_0xb8b6('0xd')]){return utils[_0xb8b6('0x1d')](_0x4bfd6b,0x0,!![],moment())[_0xb8b6('0xf')](function(){return _0x5b64ad(null,![],{'message':_0xb8b6('0x1b')});});}else{return utils['clearBlockUser'](_0x4bfd6b,_0x4fca3a,![],null)[_0xb8b6('0xf')](function(){return _0x5b64ad(null,![],{'message':_0xb8b6('0x1b')});});}}}else{return _0x5b64ad(null,![],{'message':_0xb8b6('0x1b')});}}else{if(_0x4bfd6b[_0xb8b6('0x13')]){return _0x5b64ad(null,![],{'message':_0xb8b6('0x1b')});}else if(_0x4c4590[_0xb8b6('0xd')]>0x0){if(_0x4bfd6b[_0xb8b6('0x14')]){if(_0x4c4590['blockDuration']>0x0){if(moment(_0x4bfd6b[_0xb8b6('0x15')])[_0xb8b6('0x1e')](_0x4c4590['blockDuration'],_0xb8b6('0x1f'))>moment()){return _0x5b64ad(null,![],{'message':_0xb8b6('0x1b')});}else{return utils[_0xb8b6('0x1d')](_0x4bfd6b,0x0,![],null)[_0xb8b6('0xf')](function(){return utils[_0xb8b6('0x20')](_0x4bfd6b);})[_0xb8b6('0xf')](function(){return _0x5b64ad(null,_0x4bfd6b);});}}else{return _0x5b64ad(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0xb8b6('0x1d')](_0x4bfd6b,0x0,![],null)[_0xb8b6('0xf')](function(){return utils[_0xb8b6('0x20')](_0x4bfd6b);})['then'](function(){return _0x5b64ad(null,_0x4bfd6b);})[_0xb8b6('0x21')](function(_0x4cedf1){return _0x5b64ad(null,![],_0x4cedf1);});}}else{if(_0x4bfd6b[_0xb8b6('0x14')]){return _0x5b64ad(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xb8b6('0x20')](_0x4bfd6b)[_0xb8b6('0xf')](function(){return _0x5b64ad(null,_0x4bfd6b);});}}}});})[_0xb8b6('0x21')](function(_0x3e945a){return _0x5b64ad(null,![],_0x3e945a);});}function sendServiceMail(_0x123aed){return db[_0xb8b6('0x22')][_0xb8b6('0x23')]({'where':{'service':!![]},'attributes':['id',_0xb8b6('0x1a'),_0xb8b6('0x24')],'include':[{'model':db[_0xb8b6('0x25')],'as':'Smtp'}]})['then'](function(_0x25395b){if(!_0x25395b){throw new Error(_0xb8b6('0x26'));}var _0x5c578e={'tls':{'rejectUnauthorized':![]}};if(_0x25395b[_0xb8b6('0x27')][_0xb8b6('0x28')]){_0x5c578e[_0xb8b6('0x28')]=_0x25395b[_0xb8b6('0x27')][_0xb8b6('0x28')];}else{_0x5c578e['host']=_0x25395b[_0xb8b6('0x27')][_0xb8b6('0x29')];_0x5c578e[_0xb8b6('0x2a')]=_0x25395b['Smtp'][_0xb8b6('0x2a')];_0x5c578e[_0xb8b6('0x2b')]=_0x25395b[_0xb8b6('0x27')][_0xb8b6('0x2b')];}if(_0x25395b[_0xb8b6('0x27')][_0xb8b6('0x2c')]){_0x5c578e[_0xb8b6('0x2d')]={'user':_0x25395b[_0xb8b6('0x27')][_0xb8b6('0x18')],'pass':_0x25395b[_0xb8b6('0x27')][_0xb8b6('0x2e')]};}var _0x4df9b8={'account':_0x5c578e,'message':_[_0xb8b6('0x2f')]({'from':util['format'](_0xb8b6('0x30'),_0x25395b[_0xb8b6('0x1a')],_0x25395b[_0xb8b6('0x24')]||_0x25395b[_0xb8b6('0x27')][_0xb8b6('0x18')])},_0x123aed)};return client[_0xb8b6('0x31')](_0xb8b6('0x32'),_0x4df9b8);})[_0xb8b6('0xf')](function(_0xdc233a){if(_0xdc233a[_0xb8b6('0x33')]){throw new Error(util[_0xb8b6('0x34')](_0xb8b6('0x35'),_0xdc233a['error'][_0xb8b6('0x36')]||JSON['stringify'](_0xdc233a['error'])));}return!![];});}function handleError(_0x40a9fa,_0x7dd06b,_0x1f8556){return _0x40a9fa[_0xb8b6('0x37')](_0x7dd06b||0x1f4)[_0xb8b6('0x38')]({'message':_0x1f8556?_0x1f8556['message']||_0x1f8556:''});}exports['login']=function(_0x335b59,_0x9604c1,_0x5538f7){passport[_0xb8b6('0x1c')](_0xb8b6('0x39'),function(_0x42bb3d,_0x1a2b0d,_0x458d24){var _0x2a2ad5=_0x42bb3d||_0x458d24;if(_0x2a2ad5){return handleError(_0x9604c1,0x191,_0x2a2ad5);}if(!_0x1a2b0d){return handleError(_0x9604c1,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x485dc6={'payload':{'id':_0x1a2b0d['id'],'role':_0x1a2b0d[_0xb8b6('0x12')]},'options':{'expiresIn':0x15180}};return authService[_0xb8b6('0x3a')](_0x485dc6)['then'](function(_0x38aedc){_0x9604c1[_0xb8b6('0x3b')]({'id':_0x1a2b0d['id'],'token':_0x38aedc,'statusCall':'','isAlreadyLogged':_0x1a2b0d[_0xb8b6('0x3c')]});});}})(_0x335b59,_0x9604c1,_0x5538f7);};exports[_0xb8b6('0x3d')]=function(_0x58a0d9,_0x2ea90e,_0x3e00bf){if(!_0x58a0d9[_0xb8b6('0x3e')]['email']){return handleError(_0x2ea90e,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x7f76ff=rs['generate']();_0x58a0d9['body'][_0xb8b6('0x24')]=_0x58a0d9[_0xb8b6('0x3e')][_0xb8b6('0x24')][_0xb8b6('0x3f')]()['toLowerCase']();var _0x41c853;return db[_0xb8b6('0xb')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xb8b6('0xe')],'raw':!![]})[_0xb8b6('0xf')](function(_0x2724b0){_0x41c853=_0x2724b0;return db[_0xb8b6('0x40')]['find']({'where':{'email':_0x58a0d9[_0xb8b6('0x3e')]['email']}});})[_0xb8b6('0xf')](function(_0x52c9d9){if(!_0x52c9d9){throw new Error(_0xb8b6('0x41'));}if(_0x52c9d9[_0xb8b6('0x13')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x52c9d9[_0xb8b6('0x14')]){if(moment(_0x52c9d9[_0xb8b6('0x15')])[_0xb8b6('0x1e')](_0x41c853['blockDuration'],_0xb8b6('0x1f'))>moment()){throw new Error(_0xb8b6('0x42'));}else{_0x52c9d9[_0xb8b6('0x14')]=![];_0x52c9d9[_0xb8b6('0x15')]=null;}}_0x52c9d9[_0xb8b6('0x43')]=_0x7f76ff;_0x52c9d9[_0xb8b6('0x44')]=Date[_0xb8b6('0x45')]()+0x36ee80;return _0x52c9d9[_0xb8b6('0x46')]();})[_0xb8b6('0xf')](function(){return sendServiceMail({'to':_0x58a0d9['body'][_0xb8b6('0x24')],'subject':_0xb8b6('0x47'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0xb8b6('0x48')+'https://'+_0x58a0d9['headers'][_0xb8b6('0x29')]+_0xb8b6('0x49')+_0x7f76ff+'\x0a\x0a'+_0xb8b6('0x4a')});})[_0xb8b6('0xf')](function(){_0x2ea90e['status'](0xc8)['send']({'message':'Reset\x20Email\x20sent!'});})[_0xb8b6('0x21')](function(_0x22cc7f){return handleError(_0x2ea90e,0x1f4,_0x22cc7f);});};exports['reset']=function(_0x5da0d9,_0xa51814,_0x2d4ff1){return db[_0xb8b6('0x40')][_0xb8b6('0x23')]({'where':{'resetPasswordToken':_0x5da0d9[_0xb8b6('0x4b')]['token'],'resetPasswordExpires':{'$gt':Date['now']()}}})['then'](function(_0x2c05c3){if(!_0x2c05c3){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0xb8b6('0xb')]['findOne']({'attributes':['id','securePassword','enforcePasswordHistory',_0xb8b6('0x4c')]})[_0xb8b6('0xf')](function(_0x52939d){if(_0x52939d[_0xb8b6('0x4d')])authService[_0xb8b6('0x4e')](_0x5da0d9[_0xb8b6('0x3e')][_0xb8b6('0x10')]);if(!_0x52939d['enforcePasswordHistory']||!_0x2c05c3[_0xb8b6('0x4f')])return _0x2c05c3;authService['validatePasswordHistory'](_0x5da0d9[_0xb8b6('0x3e')][_0xb8b6('0x10')],_0x2c05c3[_0xb8b6('0x4f')],_0x52939d['passwordHistoryLimit']);return _0x2c05c3;})[_0xb8b6('0xf')](function(){_0x2c05c3[_0xb8b6('0x10')]=_0x5da0d9[_0xb8b6('0x3e')][_0xb8b6('0x10')];_0x2c05c3[_0xb8b6('0x43')]=null;_0x2c05c3[_0xb8b6('0x44')]=null;return _0x2c05c3[_0xb8b6('0x46')]();});})[_0xb8b6('0xf')](function(){_0xa51814[_0xb8b6('0x37')](0xc8)[_0xb8b6('0x38')]({'message':_0xb8b6('0x50')});})[_0xb8b6('0x21')](function(_0x4e7731){return handleError(_0xa51814,0x1f4,_0x4e7731);});};passport[_0xb8b6('0x51')](new LocalStrategy({'usernameField':_0xb8b6('0x1a'),'passwordField':_0xb8b6('0x10')},function(_0xc4d60a,_0x225faa,_0x49c09b){return localAuthenticate(db['User'],_0xc4d60a,_0x225faa,_0x49c09b);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index b145197..b08e337 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 _0x8a1a=['login','forgot','./authLocal.controller','post'];(function(_0x155116,_0x27df78){var _0x403b73=function(_0x2eb7b4){while(--_0x2eb7b4){_0x155116['push'](_0x155116['shift']());}};_0x403b73(++_0x27df78);}(_0x8a1a,0x96));var _0xa8a1=function(_0x1168a1,_0xa0d8c9){_0x1168a1=_0x1168a1-0x0;var _0xcc5ad8=_0x8a1a[_0x1168a1];return _0xcc5ad8;};'use strict';var express=require('express');var router=express['Router']();var controller=require(_0xa8a1('0x0'));router[_0xa8a1('0x1')]('/',controller[_0xa8a1('0x2')]);router[_0xa8a1('0x1')]('/forgot',controller[_0xa8a1('0x3')]);router[_0xa8a1('0x1')]('/reset/:token',controller['reset']);module['exports']=router;
\ No newline at end of file
+var _0x6d04=['exports','express','./authLocal.controller','post','login','/reset/:token','reset'];(function(_0x42f941,_0x133f4a){var _0x90a769=function(_0xfaf3d){while(--_0xfaf3d){_0x42f941['push'](_0x42f941['shift']());}};_0x90a769(++_0x133f4a);}(_0x6d04,0x127));var _0x46d0=function(_0x20eb01,_0x59ae21){_0x20eb01=_0x20eb01-0x0;var _0x5c5e37=_0x6d04[_0x20eb01];return _0x5c5e37;};'use strict';var express=require(_0x46d0('0x0'));var router=express['Router']();var controller=require(_0x46d0('0x1'));router[_0x46d0('0x2')]('/',controller[_0x46d0('0x3')]);router[_0x46d0('0x2')]('/forgot',controller['forgot']);router['post'](_0x46d0('0x4'),controller[_0x46d0('0x5')]);module[_0x46d0('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 adfbbde..aee3b41 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 _0x84b8=['BOOLEAN','INTEGER','sequelize','exports','STRING'];(function(_0x267556,_0x293028){var _0x1ec0b1=function(_0xf02080){while(--_0xf02080){_0x267556['push'](_0x267556['shift']());}};_0x1ec0b1(++_0x293028);}(_0x84b8,0x174));var _0x884b=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0x84b8[_0x5e36d1];return _0x950b9e;};'use strict';var Sequelize=require(_0x884b('0x0'));module[_0x884b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x884b('0x2')]},'status':{'type':Sequelize[_0x884b('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x884b('0x4')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x1ea2=['exports','STRING','INTEGER','sequelize'];(function(_0x299316,_0x13e283){var _0x35698=function(_0x5d2172){while(--_0x5d2172){_0x299316['push'](_0x299316['shift']());}};_0x35698(++_0x13e283);}(_0x1ea2,0x113));var _0x21ea=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0x1ea2[_0x3305de];return _0x3b5a84;};'use strict';var Sequelize=require(_0x21ea('0x0'));module[_0x21ea('0x1')]={'name':{'type':Sequelize[_0x21ea('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x21ea('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x21ea('0x3')],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index 3273ced..87da2f4 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 _0x7ca7=['findOne','Condition','order','pick','getConditions','Action','addActions','getActions','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','fields','length','options','find','body','addConditions','ids','omit'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7ca7,0x164));var _0x77ca=function(_0x238671,_0x34aea0){_0x238671=_0x238671-0x0;var _0x474844=_0x7ca7[_0x238671];return _0x474844;};'use strict';var emlformat=require(_0x77ca('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x77ca('0x1'));var rp=require(_0x77ca('0x2'));var moment=require(_0x77ca('0x3'));var BPromise=require(_0x77ca('0x4'));var Mustache=require('mustache');var util=require(_0x77ca('0x5'));var path=require(_0x77ca('0x6'));var sox=require(_0x77ca('0x7'));var csv=require('to-csv');var ejs=require(_0x77ca('0x8'));var fs=require('fs');var fs_extra=require(_0x77ca('0x9'));var _=require(_0x77ca('0xa'));var squel=require(_0x77ca('0xb'));var crypto=require('crypto');var jsforce=require(_0x77ca('0xc'));var deskjs=require(_0x77ca('0xd'));var toCsv=require(_0x77ca('0xe'));var querystring=require('querystring');var Papa=require(_0x77ca('0xf'));var Redis=require(_0x77ca('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x77ca('0x11'));var as=require(_0x77ca('0x12'));var hardwareService=require(_0x77ca('0x13'));var logger=require(_0x77ca('0x14'))(_0x77ca('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x77ca('0x16'));var db=require(_0x77ca('0x17'))['db'];function respondWithStatusCode(_0x27d5f9,_0xdb00b5){_0xdb00b5=_0xdb00b5||0xcc;return function(_0x30dc9c){if(_0x30dc9c){return _0x27d5f9[_0x77ca('0x18')](_0xdb00b5);}return _0x27d5f9[_0x77ca('0x19')](_0xdb00b5)[_0x77ca('0x1a')]();};}function respondWithResult(_0xacb434,_0x1e2600){_0x1e2600=_0x1e2600||0xc8;return function(_0x5f1ccb){if(_0x5f1ccb){return _0xacb434['status'](_0x1e2600)[_0x77ca('0x1b')](_0x5f1ccb);}};}function respondWithFilteredResult(_0x5313fe,_0x52614a){return function(_0x119b53){if(_0x119b53){var _0x68daf8=typeof _0x52614a['offset']==='undefined'&&typeof _0x52614a[_0x77ca('0x1c')]===_0x77ca('0x1d');var _0x1c4faf=_0x119b53[_0x77ca('0x1e')];var _0x2e4a87=_0x68daf8?0x0:_0x52614a['offset'];var _0x56905b=_0x68daf8?_0x119b53['count']:_0x52614a[_0x77ca('0x1f')]+_0x52614a[_0x77ca('0x1c')];var _0x41e27b;if(_0x56905b>=_0x1c4faf){_0x56905b=_0x1c4faf;_0x41e27b=0xc8;}else{_0x41e27b=0xce;}_0x5313fe[_0x77ca('0x19')](_0x41e27b);return _0x5313fe[_0x77ca('0x20')](_0x77ca('0x21'),_0x2e4a87+'-'+_0x56905b+'/'+_0x1c4faf)[_0x77ca('0x1b')](_0x119b53);}return null;};}function patchUpdates(_0x4d8655){return function(_0x34ab02){try{jsonpatch[_0x77ca('0x22')](_0x34ab02,_0x4d8655,!![]);}catch(_0x4af6dc){return BPromise[_0x77ca('0x23')](_0x4af6dc);}return _0x34ab02[_0x77ca('0x24')]();};}function saveUpdates(_0xe9d25f,_0x59be2e){return function(_0x42ed21){if(_0x42ed21){return _0x42ed21[_0x77ca('0x25')](_0xe9d25f)['then'](function(_0x1a8e36){return _0x1a8e36;});}return null;};}function removeEntity(_0x10dba5,_0x592483){return function(_0x4b01ea){if(_0x4b01ea){return _0x4b01ea[_0x77ca('0x26')]()[_0x77ca('0x27')](function(){_0x10dba5[_0x77ca('0x19')](0xcc)[_0x77ca('0x1a')]();});}};}function handleEntityNotFound(_0x271b12,_0x571db9){return function(_0x5e5c12){if(!_0x5e5c12){_0x271b12['sendStatus'](0x194);}return _0x5e5c12;};}function handleError(_0x17188f,_0x3bfb29){_0x3bfb29=_0x3bfb29||0x1f4;return function(_0x5a7d44){logger[_0x77ca('0x28')](_0x5a7d44[_0x77ca('0x29')]);if(_0x5a7d44[_0x77ca('0x2a')]){delete _0x5a7d44[_0x77ca('0x2a')];}_0x17188f[_0x77ca('0x19')](_0x3bfb29)[_0x77ca('0x2b')](_0x5a7d44);};}exports[_0x77ca('0x2c')]=function(_0x2f67cc,_0x82a6cd){var _0x358086={},_0xb868a8={},_0x4ac1a2={'count':0x0,'rows':[]};var _0xbfc35a=_[_0x77ca('0x2d')](db[_0x77ca('0x2e')][_0x77ca('0x2f')],function(_0x2c9f69){return{'name':_0x2c9f69[_0x77ca('0x30')],'type':_0x2c9f69[_0x77ca('0x31')][_0x77ca('0x32')]};});_0xb868a8[_0x77ca('0x33')]=_[_0x77ca('0x2d')](_0xbfc35a,_0x77ca('0x2a'));_0xb868a8[_0x77ca('0x34')]=_['keys'](_0x2f67cc['query']);_0xb868a8[_0x77ca('0x35')]=_[_0x77ca('0x36')](_0xb868a8[_0x77ca('0x33')],_0xb868a8[_0x77ca('0x34')]);_0x358086[_0x77ca('0x37')]=_[_0x77ca('0x36')](_0xb868a8[_0x77ca('0x33')],qs['fields'](_0x2f67cc['query']['fields']));_0x358086[_0x77ca('0x37')]=_0x358086[_0x77ca('0x37')]['length']?_0x358086[_0x77ca('0x37')]:_0xb868a8[_0x77ca('0x33')];if(!_0x2f67cc['query'][_0x77ca('0x38')](_0x77ca('0x39'))){_0x358086['limit']=qs[_0x77ca('0x1c')](_0x2f67cc[_0x77ca('0x34')][_0x77ca('0x1c')]);_0x358086[_0x77ca('0x1f')]=qs[_0x77ca('0x1f')](_0x2f67cc[_0x77ca('0x34')][_0x77ca('0x1f')]);}_0x358086['order']=qs[_0x77ca('0x3a')](_0x2f67cc['query'][_0x77ca('0x3a')]);_0x358086[_0x77ca('0x3b')]=qs[_0x77ca('0x35')](_['pick'](_0x2f67cc[_0x77ca('0x34')],_0xb868a8['filters']),_0xbfc35a);if(_0x2f67cc['query'][_0x77ca('0x3c')]){_0x358086[_0x77ca('0x3b')]=_[_0x77ca('0x3d')](_0x358086['where'],{'$or':_[_0x77ca('0x2d')](_0xbfc35a,function(_0x12a9ef){if(_0x12a9ef['type']!==_0x77ca('0x3e')){var _0x30af40={};_0x30af40[_0x12a9ef[_0x77ca('0x2a')]]={'$like':'%'+_0x2f67cc['query']['filter']+'%'};return _0x30af40;}})});}_0x358086=_[_0x77ca('0x3d')]({},_0x358086,_0x2f67cc['options']);var _0x4c3cec={'where':_0x358086[_0x77ca('0x3b')]};return db['Automation'][_0x77ca('0x1e')](_0x4c3cec)['then'](function(_0x2d5e53){_0x4ac1a2[_0x77ca('0x1e')]=_0x2d5e53;if(_0x2f67cc[_0x77ca('0x34')][_0x77ca('0x3f')]){_0x358086[_0x77ca('0x40')]=[{'all':!![]}];}return db[_0x77ca('0x2e')][_0x77ca('0x41')](_0x358086);})[_0x77ca('0x27')](function(_0x5b04bd){_0x4ac1a2[_0x77ca('0x42')]=_0x5b04bd;return _0x4ac1a2;})[_0x77ca('0x27')](respondWithFilteredResult(_0x82a6cd,_0x358086))[_0x77ca('0x43')](handleError(_0x82a6cd,null));};exports[_0x77ca('0x44')]=function(_0x13c9fc,_0x2f62cc){var _0x27d739={'raw':![],'where':{'id':_0x13c9fc[_0x77ca('0x45')]['id']}},_0x18366b={};_0x18366b[_0x77ca('0x33')]=_['keys'](db['Automation'][_0x77ca('0x2f')]);_0x18366b[_0x77ca('0x34')]=_[_0x77ca('0x46')](_0x13c9fc['query']);_0x18366b['filters']=_[_0x77ca('0x36')](_0x18366b[_0x77ca('0x33')],_0x18366b[_0x77ca('0x34')]);_0x27d739['attributes']=_[_0x77ca('0x36')](_0x18366b[_0x77ca('0x33')],qs[_0x77ca('0x47')](_0x13c9fc[_0x77ca('0x34')][_0x77ca('0x47')]));_0x27d739[_0x77ca('0x37')]=_0x27d739[_0x77ca('0x37')][_0x77ca('0x48')]?_0x27d739[_0x77ca('0x37')]:_0x18366b[_0x77ca('0x33')];if(_0x13c9fc['query']['includeAll']){_0x27d739['include']=[{'all':!![]}];}_0x27d739=_[_0x77ca('0x3d')]({},_0x27d739,_0x13c9fc[_0x77ca('0x49')]);return db[_0x77ca('0x2e')][_0x77ca('0x4a')](_0x27d739)[_0x77ca('0x27')](handleEntityNotFound(_0x2f62cc,null))['then'](respondWithResult(_0x2f62cc,null))['catch'](handleError(_0x2f62cc,null));};exports['create']=function(_0x25e635,_0x9e8bcf){return db['Automation']['create'](_0x25e635['body'],{})['then'](respondWithResult(_0x9e8bcf,0xc9))[_0x77ca('0x43')](handleError(_0x9e8bcf,null));};exports['update']=function(_0x3f0279,_0x54a55c){if(_0x3f0279[_0x77ca('0x4b')]['id']){delete _0x3f0279['body']['id'];}return db[_0x77ca('0x2e')]['find']({'where':{'id':_0x3f0279[_0x77ca('0x45')]['id']}})[_0x77ca('0x27')](handleEntityNotFound(_0x54a55c,null))[_0x77ca('0x27')](saveUpdates(_0x3f0279['body'],null))[_0x77ca('0x27')](respondWithResult(_0x54a55c,null))[_0x77ca('0x43')](handleError(_0x54a55c,null));};exports[_0x77ca('0x26')]=function(_0x4bd644,_0x3901a4){return db['Automation'][_0x77ca('0x4a')]({'where':{'id':_0x4bd644[_0x77ca('0x45')]['id']}})[_0x77ca('0x27')](handleEntityNotFound(_0x3901a4,null))[_0x77ca('0x27')](removeEntity(_0x3901a4,null))[_0x77ca('0x43')](handleError(_0x3901a4,null));};exports[_0x77ca('0x4c')]=function(_0x4fec2c,_0x118fea,_0x515d27){return db['Condition'][_0x77ca('0x4a')]({'where':{'id':_0x4fec2c[_0x77ca('0x45')]['id']}})[_0x77ca('0x27')](handleEntityNotFound(_0x118fea,null))[_0x77ca('0x27')](function(_0x5b0e75){if(_0x5b0e75){return _0x5b0e75[_0x77ca('0x4c')](_0x4fec2c['body'][_0x77ca('0x4d')],_[_0x77ca('0x4e')](_0x4fec2c[_0x77ca('0x4b')],[_0x77ca('0x4d'),'id'])||{});}})[_0x77ca('0x27')](respondWithResult(_0x118fea,null))[_0x77ca('0x43')](handleError(_0x118fea,null));};exports['getConditions']=function(_0x3caf44,_0x2eb218,_0x1da7c6){var _0x26212f={};var _0x4a0fdf={};var _0x40f590;var _0x24d8c8;return db[_0x77ca('0x2e')][_0x77ca('0x4f')]({'where':{'id':_0x3caf44[_0x77ca('0x45')]['id']}})['then'](handleEntityNotFound(_0x2eb218,null))['then'](function(_0x19601e){if(_0x19601e){_0x40f590=_0x19601e;_0x4a0fdf[_0x77ca('0x33')]=_['keys'](db[_0x77ca('0x50')][_0x77ca('0x2f')]);_0x4a0fdf[_0x77ca('0x34')]=_[_0x77ca('0x46')](_0x3caf44[_0x77ca('0x34')]);_0x4a0fdf[_0x77ca('0x35')]=_[_0x77ca('0x36')](_0x4a0fdf[_0x77ca('0x33')],_0x4a0fdf['query']);_0x26212f['attributes']=_['intersection'](_0x4a0fdf['model'],qs[_0x77ca('0x47')](_0x3caf44[_0x77ca('0x34')][_0x77ca('0x47')]));_0x26212f[_0x77ca('0x37')]=_0x26212f[_0x77ca('0x37')][_0x77ca('0x48')]?_0x26212f['attributes']:_0x4a0fdf['model'];_0x26212f[_0x77ca('0x51')]=qs[_0x77ca('0x3a')](_0x3caf44[_0x77ca('0x34')][_0x77ca('0x3a')]);_0x26212f[_0x77ca('0x3b')]=qs[_0x77ca('0x35')](_[_0x77ca('0x52')](_0x3caf44[_0x77ca('0x34')],_0x4a0fdf['filters']));if(_0x3caf44[_0x77ca('0x34')][_0x77ca('0x3c')]){_0x26212f['where']=_['merge'](_0x26212f['where'],{'$or':_['map'](_0x26212f['attributes'],function(_0xaa62f4){var _0x5734d1={};_0x5734d1[_0xaa62f4]={'$like':'%'+_0x3caf44[_0x77ca('0x34')]['filter']+'%'};return _0x5734d1;})});}_0x26212f=_[_0x77ca('0x3d')]({},_0x26212f,_0x3caf44['options']);return _0x40f590[_0x77ca('0x53')](_0x26212f);}})[_0x77ca('0x27')](function(_0x50030f){if(_0x50030f){_0x24d8c8=_0x50030f[_0x77ca('0x48')];if(!_0x3caf44[_0x77ca('0x34')][_0x77ca('0x38')]('nolimit')){_0x26212f[_0x77ca('0x1c')]=qs[_0x77ca('0x1c')](_0x3caf44[_0x77ca('0x34')][_0x77ca('0x1c')]);_0x26212f['offset']=qs[_0x77ca('0x1f')](_0x3caf44[_0x77ca('0x34')][_0x77ca('0x1f')]);}return _0x40f590[_0x77ca('0x53')](_0x26212f);}})[_0x77ca('0x27')](function(_0x24602c){if(_0x24602c){return _0x24602c?{'count':_0x24d8c8,'rows':_0x24602c}:null;}})[_0x77ca('0x27')](respondWithResult(_0x2eb218,null))['catch'](handleError(_0x2eb218,null));};exports['addActions']=function(_0x4213fe,_0x28bcfe,_0x73d048){return db[_0x77ca('0x54')][_0x77ca('0x4a')]({'where':{'id':_0x4213fe[_0x77ca('0x45')]['id']}})[_0x77ca('0x27')](handleEntityNotFound(_0x28bcfe,null))[_0x77ca('0x27')](function(_0x3f2724){if(_0x3f2724){return _0x3f2724[_0x77ca('0x55')](_0x4213fe['body'][_0x77ca('0x4d')],_[_0x77ca('0x4e')](_0x4213fe[_0x77ca('0x4b')],[_0x77ca('0x4d'),'id'])||{});}})[_0x77ca('0x27')](respondWithResult(_0x28bcfe,null))[_0x77ca('0x43')](handleError(_0x28bcfe,null));};exports['getActions']=function(_0x395457,_0x2a4ba4,_0x2f5489){var _0x1f73ea={};var _0x5e0505={};var _0x3bf12a;var _0x47c23c;return db[_0x77ca('0x2e')]['findOne']({'where':{'id':_0x395457[_0x77ca('0x45')]['id']}})[_0x77ca('0x27')](handleEntityNotFound(_0x2a4ba4,null))[_0x77ca('0x27')](function(_0x6ec020){if(_0x6ec020){_0x3bf12a=_0x6ec020;_0x5e0505[_0x77ca('0x33')]=_[_0x77ca('0x46')](db['Action'][_0x77ca('0x2f')]);_0x5e0505[_0x77ca('0x34')]=_[_0x77ca('0x46')](_0x395457[_0x77ca('0x34')]);_0x5e0505['filters']=_['intersection'](_0x5e0505[_0x77ca('0x33')],_0x5e0505[_0x77ca('0x34')]);_0x1f73ea['attributes']=_[_0x77ca('0x36')](_0x5e0505['model'],qs[_0x77ca('0x47')](_0x395457[_0x77ca('0x34')][_0x77ca('0x47')]));_0x1f73ea['attributes']=_0x1f73ea[_0x77ca('0x37')]['length']?_0x1f73ea[_0x77ca('0x37')]:_0x5e0505[_0x77ca('0x33')];_0x1f73ea[_0x77ca('0x51')]=qs['sort'](_0x395457[_0x77ca('0x34')][_0x77ca('0x3a')]);_0x1f73ea['where']=qs[_0x77ca('0x35')](_['pick'](_0x395457['query'],_0x5e0505[_0x77ca('0x35')]));if(_0x395457[_0x77ca('0x34')][_0x77ca('0x3c')]){_0x1f73ea[_0x77ca('0x3b')]=_['merge'](_0x1f73ea[_0x77ca('0x3b')],{'$or':_[_0x77ca('0x2d')](_0x1f73ea[_0x77ca('0x37')],function(_0x26db94){var _0x4b8e5f={};_0x4b8e5f[_0x26db94]={'$like':'%'+_0x395457[_0x77ca('0x34')][_0x77ca('0x3c')]+'%'};return _0x4b8e5f;})});}_0x1f73ea=_[_0x77ca('0x3d')]({},_0x1f73ea,_0x395457['options']);return _0x3bf12a['getActions'](_0x1f73ea);}})['then'](function(_0x58d232){if(_0x58d232){_0x47c23c=_0x58d232[_0x77ca('0x48')];if(!_0x395457['query']['hasOwnProperty'](_0x77ca('0x39'))){_0x1f73ea[_0x77ca('0x1c')]=qs['limit'](_0x395457[_0x77ca('0x34')][_0x77ca('0x1c')]);_0x1f73ea[_0x77ca('0x1f')]=qs['offset'](_0x395457[_0x77ca('0x34')][_0x77ca('0x1f')]);}return _0x3bf12a[_0x77ca('0x56')](_0x1f73ea);}})['then'](function(_0x4e5907){if(_0x4e5907){return _0x4e5907?{'count':_0x47c23c,'rows':_0x4e5907}:null;}})[_0x77ca('0x27')](respondWithResult(_0x2a4ba4,null))[_0x77ca('0x43')](handleError(_0x2a4ba4,null));};
\ No newline at end of file
+var _0xe833=['../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','Automation','type','key','model','query','intersection','attributes','fields','length','nolimit','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','keys','include','find','catch','body','addConditions','ids','omit','findOne','Condition','rawAttributes','order','sort','getConditions','hasOwnProperty','Action','getActions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xe833,0x182));var _0x3e83=function(_0x34311c,_0x52a317){_0x34311c=_0x34311c-0x0;var _0x4b8b35=_0xe833[_0x34311c];return _0x4b8b35;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e83('0x0'));var zipdir=require(_0x3e83('0x1'));var jsonpatch=require(_0x3e83('0x2'));var rp=require(_0x3e83('0x3'));var moment=require(_0x3e83('0x4'));var BPromise=require(_0x3e83('0x5'));var Mustache=require(_0x3e83('0x6'));var util=require(_0x3e83('0x7'));var path=require('path');var sox=require(_0x3e83('0x8'));var csv=require(_0x3e83('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e83('0xa'));var _=require(_0x3e83('0xb'));var squel=require('squel');var crypto=require(_0x3e83('0xc'));var jsforce=require(_0x3e83('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3e83('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3e83('0xe'));var qs=require(_0x3e83('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3e83('0x10'));var logger=require(_0x3e83('0x11'))(_0x3e83('0x12'));var utils=require(_0x3e83('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x3e83('0x14'));var db=require(_0x3e83('0x15'))['db'];function respondWithStatusCode(_0x1e3aa7,_0x5b7acf){_0x5b7acf=_0x5b7acf||0xcc;return function(_0x265f68){if(_0x265f68){return _0x1e3aa7['sendStatus'](_0x5b7acf);}return _0x1e3aa7['status'](_0x5b7acf)[_0x3e83('0x16')]();};}function respondWithResult(_0x3a04f1,_0x21c2c7){_0x21c2c7=_0x21c2c7||0xc8;return function(_0x5481f7){if(_0x5481f7){return _0x3a04f1[_0x3e83('0x17')](_0x21c2c7)[_0x3e83('0x18')](_0x5481f7);}};}function respondWithFilteredResult(_0x48e4e2,_0x1da5dc){return function(_0x15acd4){if(_0x15acd4){var _0x5f3c86=typeof _0x1da5dc[_0x3e83('0x19')]===_0x3e83('0x1a')&&typeof _0x1da5dc[_0x3e83('0x1b')]===_0x3e83('0x1a');var _0x177661=_0x15acd4[_0x3e83('0x1c')];var _0x1029c8=_0x5f3c86?0x0:_0x1da5dc[_0x3e83('0x19')];var _0xa44b85=_0x5f3c86?_0x15acd4[_0x3e83('0x1c')]:_0x1da5dc[_0x3e83('0x19')]+_0x1da5dc[_0x3e83('0x1b')];var _0x13cf27;if(_0xa44b85>=_0x177661){_0xa44b85=_0x177661;_0x13cf27=0xc8;}else{_0x13cf27=0xce;}_0x48e4e2[_0x3e83('0x17')](_0x13cf27);return _0x48e4e2[_0x3e83('0x1d')](_0x3e83('0x1e'),_0x1029c8+'-'+_0xa44b85+'/'+_0x177661)[_0x3e83('0x18')](_0x15acd4);}return null;};}function patchUpdates(_0x17f81f){return function(_0x53faa5){try{jsonpatch[_0x3e83('0x1f')](_0x53faa5,_0x17f81f,!![]);}catch(_0x2e19b1){return BPromise[_0x3e83('0x20')](_0x2e19b1);}return _0x53faa5[_0x3e83('0x21')]();};}function saveUpdates(_0x2de4b3,_0x273603){return function(_0x2441a6){if(_0x2441a6){return _0x2441a6[_0x3e83('0x22')](_0x2de4b3)[_0x3e83('0x23')](function(_0x1fc69e){return _0x1fc69e;});}return null;};}function removeEntity(_0x551b14,_0x205e4d){return function(_0x247c29){if(_0x247c29){return _0x247c29[_0x3e83('0x24')]()['then'](function(){_0x551b14[_0x3e83('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f19a6,_0x560931){return function(_0x60534c){if(!_0x60534c){_0x3f19a6['sendStatus'](0x194);}return _0x60534c;};}function handleError(_0x275658,_0x4a6974){_0x4a6974=_0x4a6974||0x1f4;return function(_0x4cb034){logger['error'](_0x4cb034[_0x3e83('0x25')]);if(_0x4cb034[_0x3e83('0x26')]){delete _0x4cb034[_0x3e83('0x26')];}_0x275658[_0x3e83('0x17')](_0x4a6974)[_0x3e83('0x27')](_0x4cb034);};}exports[_0x3e83('0x28')]=function(_0x36956a,_0x1abb27){var _0x1d09cd={},_0x5e0fce={},_0x2e745d={'count':0x0,'rows':[]};var _0x480a38=_[_0x3e83('0x29')](db[_0x3e83('0x2a')]['rawAttributes'],function(_0x23bfb0){return{'name':_0x23bfb0['fieldName'],'type':_0x23bfb0[_0x3e83('0x2b')][_0x3e83('0x2c')]};});_0x5e0fce[_0x3e83('0x2d')]=_[_0x3e83('0x29')](_0x480a38,'name');_0x5e0fce[_0x3e83('0x2e')]=_['keys'](_0x36956a[_0x3e83('0x2e')]);_0x5e0fce['filters']=_[_0x3e83('0x2f')](_0x5e0fce[_0x3e83('0x2d')],_0x5e0fce[_0x3e83('0x2e')]);_0x1d09cd[_0x3e83('0x30')]=_['intersection'](_0x5e0fce['model'],qs[_0x3e83('0x31')](_0x36956a[_0x3e83('0x2e')]['fields']));_0x1d09cd[_0x3e83('0x30')]=_0x1d09cd[_0x3e83('0x30')][_0x3e83('0x32')]?_0x1d09cd[_0x3e83('0x30')]:_0x5e0fce[_0x3e83('0x2d')];if(!_0x36956a[_0x3e83('0x2e')]['hasOwnProperty'](_0x3e83('0x33'))){_0x1d09cd['limit']=qs[_0x3e83('0x1b')](_0x36956a[_0x3e83('0x2e')][_0x3e83('0x1b')]);_0x1d09cd[_0x3e83('0x19')]=qs[_0x3e83('0x19')](_0x36956a[_0x3e83('0x2e')][_0x3e83('0x19')]);}_0x1d09cd['order']=qs['sort'](_0x36956a[_0x3e83('0x2e')]['sort']);_0x1d09cd[_0x3e83('0x34')]=qs['filters'](_[_0x3e83('0x35')](_0x36956a[_0x3e83('0x2e')],_0x5e0fce[_0x3e83('0x36')]),_0x480a38);if(_0x36956a[_0x3e83('0x2e')][_0x3e83('0x37')]){_0x1d09cd['where']=_['merge'](_0x1d09cd[_0x3e83('0x34')],{'$or':_['map'](_0x480a38,function(_0x516cc9){if(_0x516cc9['type']!==_0x3e83('0x38')){var _0x15abed={};_0x15abed[_0x516cc9['name']]={'$like':'%'+_0x36956a[_0x3e83('0x2e')][_0x3e83('0x37')]+'%'};return _0x15abed;}})});}_0x1d09cd=_[_0x3e83('0x39')]({},_0x1d09cd,_0x36956a[_0x3e83('0x3a')]);var _0x5bd1bc={'where':_0x1d09cd['where']};return db[_0x3e83('0x2a')][_0x3e83('0x1c')](_0x5bd1bc)[_0x3e83('0x23')](function(_0x333cf9){_0x2e745d['count']=_0x333cf9;if(_0x36956a[_0x3e83('0x2e')][_0x3e83('0x3b')]){_0x1d09cd['include']=[{'all':!![]}];}return db[_0x3e83('0x2a')][_0x3e83('0x3c')](_0x1d09cd);})['then'](function(_0xbc27c4){_0x2e745d[_0x3e83('0x3d')]=_0xbc27c4;return _0x2e745d;})[_0x3e83('0x23')](respondWithFilteredResult(_0x1abb27,_0x1d09cd))['catch'](handleError(_0x1abb27,null));};exports[_0x3e83('0x3e')]=function(_0x1ce6ec,_0x26f0b7){var _0x427c73={'raw':![],'where':{'id':_0x1ce6ec[_0x3e83('0x3f')]['id']}},_0xac2026={};_0xac2026[_0x3e83('0x2d')]=_[_0x3e83('0x40')](db[_0x3e83('0x2a')]['rawAttributes']);_0xac2026[_0x3e83('0x2e')]=_[_0x3e83('0x40')](_0x1ce6ec[_0x3e83('0x2e')]);_0xac2026[_0x3e83('0x36')]=_[_0x3e83('0x2f')](_0xac2026[_0x3e83('0x2d')],_0xac2026[_0x3e83('0x2e')]);_0x427c73[_0x3e83('0x30')]=_[_0x3e83('0x2f')](_0xac2026[_0x3e83('0x2d')],qs[_0x3e83('0x31')](_0x1ce6ec[_0x3e83('0x2e')]['fields']));_0x427c73[_0x3e83('0x30')]=_0x427c73[_0x3e83('0x30')][_0x3e83('0x32')]?_0x427c73[_0x3e83('0x30')]:_0xac2026[_0x3e83('0x2d')];if(_0x1ce6ec[_0x3e83('0x2e')][_0x3e83('0x3b')]){_0x427c73[_0x3e83('0x41')]=[{'all':!![]}];}_0x427c73=_['merge']({},_0x427c73,_0x1ce6ec['options']);return db[_0x3e83('0x2a')][_0x3e83('0x42')](_0x427c73)[_0x3e83('0x23')](handleEntityNotFound(_0x26f0b7,null))[_0x3e83('0x23')](respondWithResult(_0x26f0b7,null))[_0x3e83('0x43')](handleError(_0x26f0b7,null));};exports['create']=function(_0x8ccb5b,_0x1e2e15){return db[_0x3e83('0x2a')]['create'](_0x8ccb5b[_0x3e83('0x44')],{})[_0x3e83('0x23')](respondWithResult(_0x1e2e15,0xc9))[_0x3e83('0x43')](handleError(_0x1e2e15,null));};exports[_0x3e83('0x22')]=function(_0x42c095,_0x2df3f3){if(_0x42c095[_0x3e83('0x44')]['id']){delete _0x42c095[_0x3e83('0x44')]['id'];}return db[_0x3e83('0x2a')][_0x3e83('0x42')]({'where':{'id':_0x42c095[_0x3e83('0x3f')]['id']}})[_0x3e83('0x23')](handleEntityNotFound(_0x2df3f3,null))[_0x3e83('0x23')](saveUpdates(_0x42c095[_0x3e83('0x44')],null))[_0x3e83('0x23')](respondWithResult(_0x2df3f3,null))[_0x3e83('0x43')](handleError(_0x2df3f3,null));};exports[_0x3e83('0x24')]=function(_0x423379,_0x467cf8){return db['Automation'][_0x3e83('0x42')]({'where':{'id':_0x423379['params']['id']}})[_0x3e83('0x23')](handleEntityNotFound(_0x467cf8,null))['then'](removeEntity(_0x467cf8,null))['catch'](handleError(_0x467cf8,null));};exports[_0x3e83('0x45')]=function(_0x5e8fde,_0x320cc6,_0x338667){return db['Condition'][_0x3e83('0x42')]({'where':{'id':_0x5e8fde[_0x3e83('0x3f')]['id']}})[_0x3e83('0x23')](handleEntityNotFound(_0x320cc6,null))['then'](function(_0xd474c7){if(_0xd474c7){return _0xd474c7[_0x3e83('0x45')](_0x5e8fde['body'][_0x3e83('0x46')],_[_0x3e83('0x47')](_0x5e8fde[_0x3e83('0x44')],['ids','id'])||{});}})[_0x3e83('0x23')](respondWithResult(_0x320cc6,null))[_0x3e83('0x43')](handleError(_0x320cc6,null));};exports['getConditions']=function(_0x527397,_0x348b5f,_0x3eef74){var _0xac78={};var _0x238fef={};var _0x209023;var _0x3d2b14;return db[_0x3e83('0x2a')][_0x3e83('0x48')]({'where':{'id':_0x527397[_0x3e83('0x3f')]['id']}})[_0x3e83('0x23')](handleEntityNotFound(_0x348b5f,null))['then'](function(_0x1281fe){if(_0x1281fe){_0x209023=_0x1281fe;_0x238fef[_0x3e83('0x2d')]=_[_0x3e83('0x40')](db[_0x3e83('0x49')][_0x3e83('0x4a')]);_0x238fef[_0x3e83('0x2e')]=_[_0x3e83('0x40')](_0x527397['query']);_0x238fef[_0x3e83('0x36')]=_[_0x3e83('0x2f')](_0x238fef[_0x3e83('0x2d')],_0x238fef['query']);_0xac78[_0x3e83('0x30')]=_[_0x3e83('0x2f')](_0x238fef[_0x3e83('0x2d')],qs['fields'](_0x527397[_0x3e83('0x2e')][_0x3e83('0x31')]));_0xac78['attributes']=_0xac78[_0x3e83('0x30')][_0x3e83('0x32')]?_0xac78[_0x3e83('0x30')]:_0x238fef[_0x3e83('0x2d')];_0xac78[_0x3e83('0x4b')]=qs['sort'](_0x527397[_0x3e83('0x2e')][_0x3e83('0x4c')]);_0xac78['where']=qs['filters'](_[_0x3e83('0x35')](_0x527397[_0x3e83('0x2e')],_0x238fef[_0x3e83('0x36')]));if(_0x527397['query'][_0x3e83('0x37')]){_0xac78[_0x3e83('0x34')]=_[_0x3e83('0x39')](_0xac78['where'],{'$or':_['map'](_0xac78[_0x3e83('0x30')],function(_0x3885e8){var _0xfcf80c={};_0xfcf80c[_0x3885e8]={'$like':'%'+_0x527397[_0x3e83('0x2e')][_0x3e83('0x37')]+'%'};return _0xfcf80c;})});}_0xac78=_[_0x3e83('0x39')]({},_0xac78,_0x527397[_0x3e83('0x3a')]);return _0x209023[_0x3e83('0x4d')](_0xac78);}})['then'](function(_0x2179c4){if(_0x2179c4){_0x3d2b14=_0x2179c4[_0x3e83('0x32')];if(!_0x527397[_0x3e83('0x2e')][_0x3e83('0x4e')](_0x3e83('0x33'))){_0xac78['limit']=qs[_0x3e83('0x1b')](_0x527397['query'][_0x3e83('0x1b')]);_0xac78[_0x3e83('0x19')]=qs[_0x3e83('0x19')](_0x527397[_0x3e83('0x2e')][_0x3e83('0x19')]);}return _0x209023[_0x3e83('0x4d')](_0xac78);}})[_0x3e83('0x23')](function(_0x3bb25d){if(_0x3bb25d){return _0x3bb25d?{'count':_0x3d2b14,'rows':_0x3bb25d}:null;}})[_0x3e83('0x23')](respondWithResult(_0x348b5f,null))['catch'](handleError(_0x348b5f,null));};exports['addActions']=function(_0x479014,_0x39def2,_0x2f97f3){return db[_0x3e83('0x4f')]['find']({'where':{'id':_0x479014[_0x3e83('0x3f')]['id']}})['then'](handleEntityNotFound(_0x39def2,null))[_0x3e83('0x23')](function(_0x284188){if(_0x284188){return _0x284188['addActions'](_0x479014[_0x3e83('0x44')][_0x3e83('0x46')],_['omit'](_0x479014['body'],['ids','id'])||{});}})[_0x3e83('0x23')](respondWithResult(_0x39def2,null))[_0x3e83('0x43')](handleError(_0x39def2,null));};exports[_0x3e83('0x50')]=function(_0x4a8156,_0x9739d5,_0x1b19be){var _0x5e8c03={};var _0xe3ab05={};var _0x22a243;var _0x3c0528;return db[_0x3e83('0x2a')][_0x3e83('0x48')]({'where':{'id':_0x4a8156[_0x3e83('0x3f')]['id']}})[_0x3e83('0x23')](handleEntityNotFound(_0x9739d5,null))[_0x3e83('0x23')](function(_0x101e1f){if(_0x101e1f){_0x22a243=_0x101e1f;_0xe3ab05[_0x3e83('0x2d')]=_['keys'](db['Action'][_0x3e83('0x4a')]);_0xe3ab05[_0x3e83('0x2e')]=_['keys'](_0x4a8156[_0x3e83('0x2e')]);_0xe3ab05[_0x3e83('0x36')]=_[_0x3e83('0x2f')](_0xe3ab05[_0x3e83('0x2d')],_0xe3ab05[_0x3e83('0x2e')]);_0x5e8c03[_0x3e83('0x30')]=_['intersection'](_0xe3ab05[_0x3e83('0x2d')],qs['fields'](_0x4a8156[_0x3e83('0x2e')][_0x3e83('0x31')]));_0x5e8c03[_0x3e83('0x30')]=_0x5e8c03[_0x3e83('0x30')]['length']?_0x5e8c03['attributes']:_0xe3ab05[_0x3e83('0x2d')];_0x5e8c03[_0x3e83('0x4b')]=qs[_0x3e83('0x4c')](_0x4a8156[_0x3e83('0x2e')][_0x3e83('0x4c')]);_0x5e8c03[_0x3e83('0x34')]=qs[_0x3e83('0x36')](_[_0x3e83('0x35')](_0x4a8156['query'],_0xe3ab05[_0x3e83('0x36')]));if(_0x4a8156['query'][_0x3e83('0x37')]){_0x5e8c03[_0x3e83('0x34')]=_[_0x3e83('0x39')](_0x5e8c03[_0x3e83('0x34')],{'$or':_[_0x3e83('0x29')](_0x5e8c03[_0x3e83('0x30')],function(_0x1e22a2){var _0x50b1f0={};_0x50b1f0[_0x1e22a2]={'$like':'%'+_0x4a8156[_0x3e83('0x2e')][_0x3e83('0x37')]+'%'};return _0x50b1f0;})});}_0x5e8c03=_[_0x3e83('0x39')]({},_0x5e8c03,_0x4a8156['options']);return _0x22a243[_0x3e83('0x50')](_0x5e8c03);}})[_0x3e83('0x23')](function(_0x27a7cd){if(_0x27a7cd){_0x3c0528=_0x27a7cd[_0x3e83('0x32')];if(!_0x4a8156[_0x3e83('0x2e')]['hasOwnProperty'](_0x3e83('0x33'))){_0x5e8c03[_0x3e83('0x1b')]=qs[_0x3e83('0x1b')](_0x4a8156[_0x3e83('0x2e')][_0x3e83('0x1b')]);_0x5e8c03[_0x3e83('0x19')]=qs[_0x3e83('0x19')](_0x4a8156[_0x3e83('0x2e')][_0x3e83('0x19')]);}return _0x22a243['getActions'](_0x5e8c03);}})[_0x3e83('0x23')](function(_0x558187){if(_0x558187){return _0x558187?{'count':_0x3c0528,'rows':_0x558187}:null;}})[_0x3e83('0x23')](respondWithResult(_0x9739d5,null))[_0x3e83('0x43')](handleError(_0x9739d5,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index c52220b..a0ad701 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 _0xb7a4=['define','Automation','lodash','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x1ed116,_0x23bc80){var _0x574066=function(_0x424f9e){while(--_0x424f9e){_0x1ed116['push'](_0x1ed116['shift']());}};_0x574066(++_0x23bc80);}(_0xb7a4,0xe2));var _0x4b7a=function(_0x258a9f,_0xdd62ce){_0x258a9f=_0x258a9f-0x0;var _0xd06cb8=_0xb7a4[_0x258a9f];return _0xd06cb8;};'use strict';var _=require(_0x4b7a('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x4b7a('0x1'));var BPromise=require(_0x4b7a('0x2'));var rp=require(_0x4b7a('0x3'));var fs=require('fs');var path=require(_0x4b7a('0x4'));var rimraf=require('rimraf');var config=require(_0x4b7a('0x5'));var attributes=require('./automation.attributes');module['exports']=function(_0x120f07,_0x144416){return _0x120f07[_0x4b7a('0x6')](_0x4b7a('0x7'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6523=['tools_automations','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','define'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6523,0x1bb));var _0x3652=function(_0xd46227,_0x18477f){_0xd46227=_0xd46227-0x0;var _0x2a980d=_0x6523[_0xd46227];return _0x2a980d;};'use strict';var _=require(_0x3652('0x0'));var util=require(_0x3652('0x1'));var logger=require(_0x3652('0x2'))('api');var moment=require(_0x3652('0x3'));var BPromise=require(_0x3652('0x4'));var rp=require(_0x3652('0x5'));var fs=require('fs');var path=require(_0x3652('0x6'));var rimraf=require(_0x3652('0x7'));var config=require(_0x3652('0x8'));var attributes=require(_0x3652('0x9'));module[_0x3652('0xa')]=function(_0x29fb1d,_0x2e4370){return _0x29fb1d[_0x3652('0xb')]('Automation',attributes,{'tableName':_0x3652('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index d3d443d..2fac7ec 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 _0xb79a=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash'];(function(_0x689cd7,_0x596cb1){var _0x1da31d=function(_0x132cac){while(--_0x132cac){_0x689cd7['push'](_0x689cd7['shift']());}};_0x1da31d(++_0x596cb1);}(_0xb79a,0x18e));var _0xab79=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xb79a[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xab79('0x0'));var util=require(_0xab79('0x1'));var moment=require('moment');var BPromise=require(_0xab79('0x2'));var rs=require(_0xab79('0x3'));var fs=require('fs');var Redis=require(_0xab79('0x4'));var db=require(_0xab79('0x5'))['db'];var utils=require(_0xab79('0x6'));var logger=require(_0xab79('0x7'))(_0xab79('0x8'));var config=require(_0xab79('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xab79('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe8ba5a,_0x10d402,_0x11ceb3){return new BPromise(function(_0x7eabd1,_0x4585fe){return client[_0xab79('0xb')](_0xe8ba5a,_0x11ceb3)[_0xab79('0xc')](function(_0x426cb9){logger[_0xab79('0xd')](_0xab79('0xe'),_0x10d402,_0xab79('0xf'));logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0x10d402,_0xab79('0xf'),JSON[_0xab79('0x10')](_0x426cb9));if(_0x426cb9[_0xab79('0x11')]){if(_0x426cb9[_0xab79('0x11')][_0xab79('0x12')]===0x1f4){logger[_0xab79('0x11')]('Automation,\x20%s,\x20%s',_0x10d402,_0x426cb9['error'][_0xab79('0x13')]);return _0x4585fe(_0x426cb9['error'][_0xab79('0x13')]);}logger[_0xab79('0x11')](_0xab79('0xe'),_0x10d402,_0x426cb9['error']['message']);return _0x7eabd1(_0x426cb9['error']['message']);}else{logger[_0xab79('0xd')](_0xab79('0xe'),_0x10d402,'request\x20sent');_0x7eabd1(_0x426cb9['result']['message']);}})[_0xab79('0x14')](function(_0xc9650d){logger['error'](_0xab79('0xe'),_0x10d402,_0xc9650d);_0x4585fe(_0xc9650d);});});}
\ No newline at end of file
+var _0x4fc2=['bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x270adf,_0x1daaa3){var _0x29eda9=function(_0x40afec){while(--_0x40afec){_0x270adf['push'](_0x270adf['shift']());}};_0x29eda9(++_0x1daaa3);}(_0x4fc2,0x111));var _0x24fc=function(_0x47de9a,_0x40cf23){_0x47de9a=_0x47de9a-0x0;var _0x4b9d6c=_0x4fc2[_0x47de9a];return _0x4b9d6c;};'use strict';var _=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var moment=require(_0x24fc('0x2'));var BPromise=require(_0x24fc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x24fc('0x4'));var db=require(_0x24fc('0x5'))['db'];var utils=require(_0x24fc('0x6'));var logger=require('../../config/logger')(_0x24fc('0x7'));var config=require(_0x24fc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x24fc('0x9')][_0x24fc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4889f4,_0x115851,_0x22a0c8){return new BPromise(function(_0x220f9a,_0x123eff){return client[_0x24fc('0xb')](_0x4889f4,_0x22a0c8)[_0x24fc('0xc')](function(_0x5afdf1){logger[_0x24fc('0xd')](_0x24fc('0xe'),_0x115851,_0x24fc('0xf'));logger[_0x24fc('0x10')](_0x24fc('0x11'),_0x115851,_0x24fc('0xf'),JSON[_0x24fc('0x12')](_0x5afdf1));if(_0x5afdf1[_0x24fc('0x13')]){if(_0x5afdf1['error'][_0x24fc('0x14')]===0x1f4){logger[_0x24fc('0x13')]('Automation,\x20%s,\x20%s',_0x115851,_0x5afdf1[_0x24fc('0x13')][_0x24fc('0x15')]);return _0x123eff(_0x5afdf1[_0x24fc('0x13')][_0x24fc('0x15')]);}logger[_0x24fc('0x13')](_0x24fc('0xe'),_0x115851,_0x5afdf1['error'][_0x24fc('0x15')]);return _0x220f9a(_0x5afdf1[_0x24fc('0x13')][_0x24fc('0x15')]);}else{logger[_0x24fc('0xd')]('Automation,\x20%s,\x20%s',_0x115851,_0x24fc('0xf'));_0x220f9a(_0x5afdf1['result'][_0x24fc('0x15')]);}})[_0x24fc('0x16')](function(_0x218fb6){logger[_0x24fc('0x13')](_0x24fc('0xe'),_0x115851,_0x218fb6);_0x123eff(_0x218fb6);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 5731bab..8221887 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 _0x833b=['get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions','addActions','put','update','delete','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller'];(function(_0x2fcf18,_0x10009a){var _0x4c68cc=function(_0x444002){while(--_0x444002){_0x2fcf18['push'](_0x2fcf18['shift']());}};_0x4c68cc(++_0x10009a);}(_0x833b,0x131));var _0xb833=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x833b[_0x5d6456];return _0x4d66c1;};'use strict';var multer=require('multer');var util=require(_0xb833('0x0'));var path=require('path');var timeout=require(_0xb833('0x1'));var express=require('express');var router=express[_0xb833('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xb833('0x3'));var interaction=require(_0xb833('0x4'));var config=require(_0xb833('0x5'));var controller=require(_0xb833('0x6'));router[_0xb833('0x7')]('/',auth[_0xb833('0x8')](),controller[_0xb833('0x9')]);router['get'](_0xb833('0xa'),auth[_0xb833('0x8')](),controller[_0xb833('0xb')]);router[_0xb833('0x7')](_0xb833('0xc'),auth[_0xb833('0x8')](),controller[_0xb833('0xd')]);router['get'](_0xb833('0xe'),auth['isAuthenticated'](),controller[_0xb833('0xf')]);router[_0xb833('0x10')]('/',auth[_0xb833('0x8')](),controller[_0xb833('0x11')]);router['post']('/:id/conditions',auth[_0xb833('0x8')](),controller[_0xb833('0x12')]);router['post'](_0xb833('0xe'),auth['isAuthenticated'](),controller[_0xb833('0x13')]);router[_0xb833('0x14')](_0xb833('0xa'),auth[_0xb833('0x8')](),controller[_0xb833('0x15')]);router[_0xb833('0x16')](_0xb833('0xa'),auth[_0xb833('0x8')](),controller['destroy']);module[_0xb833('0x17')]=router;
\ No newline at end of file
+var _0x4536=['../../config/environment','./automation.controller','isAuthenticated','index','/:id','get','/:id/conditions','getConditions','/:id/actions','getActions','post','addConditions','addActions','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4536,0xe9));var _0x6453=function(_0x3f8ca7,_0x1cfd75){_0x3f8ca7=_0x3f8ca7-0x0;var _0x2ef97e=_0x4536[_0x3f8ca7];return _0x2ef97e;};'use strict';var multer=require(_0x6453('0x0'));var util=require(_0x6453('0x1'));var path=require(_0x6453('0x2'));var timeout=require(_0x6453('0x3'));var express=require('express');var router=express[_0x6453('0x4')]();var fs_extra=require(_0x6453('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6453('0x6'));var config=require(_0x6453('0x7'));var controller=require(_0x6453('0x8'));router['get']('/',auth[_0x6453('0x9')](),controller[_0x6453('0xa')]);router['get'](_0x6453('0xb'),auth[_0x6453('0x9')](),controller['show']);router[_0x6453('0xc')](_0x6453('0xd'),auth[_0x6453('0x9')](),controller[_0x6453('0xe')]);router[_0x6453('0xc')](_0x6453('0xf'),auth['isAuthenticated'](),controller[_0x6453('0x10')]);router[_0x6453('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6453('0x11')](_0x6453('0xd'),auth[_0x6453('0x9')](),controller[_0x6453('0x12')]);router[_0x6453('0x11')]('/:id/actions',auth[_0x6453('0x9')](),controller[_0x6453('0x13')]);router[_0x6453('0x14')](_0x6453('0xb'),auth[_0x6453('0x9')](),controller[_0x6453('0x15')]);router['delete']('/:id',auth[_0x6453('0x9')](),controller[_0x6453('0x16')]);module[_0x6453('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index f7d3d96..a8c8da4 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 _0x62a8=['Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','onlyIfOpen','BOOLEAN','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','Active/Disactive\x20Campaign','UNSIGNED','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x62a8,0x16b));var _0x862a=function(_0x49be98,_0x441f1c){_0x49be98=_0x49be98-0x0;var _0x5053b2=_0x62a8[_0x49be98];return _0x5053b2;};'use strict';var Sequelize=require(_0x862a('0x0'));module[_0x862a('0x1')]={'name':{'type':Sequelize[_0x862a('0x2')],'unique':_0x862a('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x862a('0x4')]('ivr'),'allowNull':![],'defaultValue':_0x862a('0x5')},'description':{'type':Sequelize[_0x862a('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x862a('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x862a('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x862a('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x862a('0x8')](0x3)[_0x862a('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x862a('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x862a('0x8')](0x3)[_0x862a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x862a('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x862a('0x8')](0x5)[_0x862a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x862a('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x862a('0x8')](0x3)[_0x862a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x862a('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0x862a('0x8')](0x5)[_0x862a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x862a('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x862a('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x862a('0x8')](0x5)[_0x862a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x862a('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0x862a('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x862a('0xf')},'dialTimezone':{'type':Sequelize[_0x862a('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x862a('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x862a('0x4')](_0x862a('0x10'),'never',_0x862a('0x11')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x862a('0x12')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x862a('0x8')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x862a('0x13')},'dialAMDGreeting':{'type':Sequelize[_0x862a('0x8')](0x9)[_0x862a('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x862a('0x8')](0x9)[_0x862a('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x862a('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x862a('0x8')](0x9)[_0x862a('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x862a('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0x862a('0x8')](0x9)[_0x862a('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x862a('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x862a('0x8')](0x9)[_0x862a('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x862a('0x8')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x862a('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x862a('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x862a('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x862a('0x8')](0x9)[_0x862a('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x862a('0x19')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x862a('0x1a'),'ASC'),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x862a('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x862a('0x8')](0x3)[_0x862a('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x862a('0x8')](0x3)[_0x862a('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x862a('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x862a('0x8')](0x3)[_0x862a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x862a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x862a('0x1c')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x862a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x862a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x862a('0x1d')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x862a('0x8')](0x3)[_0x862a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x862a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x862a('0x1e')},'dialMachineMaxRetry':{'type':Sequelize[_0x862a('0x8')](0x3)[_0x862a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x862a('0x1f')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x862a('0x8')](0x3)[_0x862a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x862a('0x20')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x862a('0x8')](0x5)[_0x862a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x862a('0x21')}};
\ No newline at end of file
+var _0x89d3=['#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','BOOLEAN','UNSIGNED','Max\x20200\x20calls.','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','never','always','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence'];(function(_0x7a011e,_0x3a24bd){var _0x13d75b=function(_0x38deeb){while(--_0x38deeb){_0x7a011e['push'](_0x7a011e['shift']());}};_0x13d75b(++_0x3a24bd);}(_0x89d3,0x13f));var _0x389d=function(_0x239b31,_0x44a64d){_0x239b31=_0x239b31-0x0;var _0x41c8be=_0x89d3[_0x239b31];return _0x41c8be;};'use strict';var Sequelize=require(_0x389d('0x0'));module[_0x389d('0x1')]={'name':{'type':Sequelize[_0x389d('0x2')],'unique':_0x389d('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('ivr'),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x389d('0x2')]},'active':{'type':Sequelize[_0x389d('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x389d('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x389d('0x6')},'dialOriginateCallerIdName':{'type':Sequelize[_0x389d('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x389d('0x7')](0x3)[_0x389d('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x389d('0x8')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x389d('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x389d('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x389d('0x7')](0x5)[_0x389d('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x389d('0xa')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x389d('0x7')](0x5)[_0x389d('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x389d('0x7')](0x3)[_0x389d('0x5')],'defaultValue':0x3,'comment':_0x389d('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x389d('0x7')](0x5)[_0x389d('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x389d('0x7')](0x3)[_0x389d('0x5')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x389d('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x389d('0x2')],'defaultValue':_0x389d('0xc')},'dialCheckDuplicateType':{'type':Sequelize[_0x389d('0xd')]('always',_0x389d('0xe'),'onlyIfOpen'),'defaultValue':_0x389d('0xf')},'dialAMDActive':{'type':Sequelize[_0x389d('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x389d('0x5')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x389d('0x10')},'dialAMDGreeting':{'type':Sequelize[_0x389d('0x7')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x389d('0x11')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x389d('0x5')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x389d('0x7')](0x9)[_0x389d('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x389d('0x12')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x389d('0x5')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x389d('0x13')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x389d('0x5')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x389d('0x14')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x389d('0x7')](0x9)[_0x389d('0x5')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x389d('0x15')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x389d('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x389d('0x16')},'dialOrderByScheduledAt':{'type':Sequelize[_0x389d('0xd')](_0x389d('0x17'),_0x389d('0x18')),'defaultValue':_0x389d('0x17')},'dialPrefix':{'type':Sequelize[_0x389d('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x389d('0x7')](0x3)[_0x389d('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x389d('0x7')](0x3)[_0x389d('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x389d('0x19')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x389d('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x389d('0x1a')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x389d('0x7')](0x5)[_0x389d('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x389d('0x1b')},'dialDropMaxRetry':{'type':Sequelize[_0x389d('0x7')](0x3)[_0x389d('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x389d('0x1c')},'dialDropRetryFrequency':{'type':Sequelize[_0x389d('0x7')](0x5)[_0x389d('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x389d('0x1d')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x389d('0x7')](0x3)[_0x389d('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x389d('0x7')](0x5)[_0x389d('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x389d('0x1e')},'dialMachineMaxRetry':{'type':Sequelize[_0x389d('0x7')](0x3)[_0x389d('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x389d('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x389d('0x1f')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x389d('0x7')](0x3)[_0x389d('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x389d('0x20')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x389d('0x7')](0x5)[_0x389d('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x389d('0x21')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 486f150..eb2d550 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 _0x60d7=['phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','fromQuery','from','cm_hopper_additional_phones','OrderBy','cm_contact_has_items','join','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','ids','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','error','stack','name','index','map','Campaign','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','catch','show','params','options','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','updatedAt','omit','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','findOne','CmHopper','hasOwnProperty','nolimit','CampaignId','CmHopperHistory','findAll','rows','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','spread','dialCheckDuplicateType','always','insert','into','phone','scheduledAt','ContactId','ListId','select','field','NOW()','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x60d7,0x139));var _0x760d=function(_0x238e2d,_0x3fc80c){_0x238e2d=_0x238e2d-0x0;var _0x51eb18=_0x60d7[_0x238e2d];return _0x51eb18;};'use strict';var emlformat=require(_0x760d('0x0'));var rimraf=require(_0x760d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x760d('0x2'));var rp=require('request-promise');var moment=require(_0x760d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x760d('0x4'));var util=require(_0x760d('0x5'));var path=require(_0x760d('0x6'));var sox=require(_0x760d('0x7'));var csv=require('to-csv');var ejs=require(_0x760d('0x8'));var fs=require('fs');var fs_extra=require(_0x760d('0x9'));var _=require(_0x760d('0xa'));var squel=require(_0x760d('0xb'));var crypto=require(_0x760d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x760d('0xd'));var toCsv=require(_0x760d('0xe'));var querystring=require(_0x760d('0xf'));var Papa=require('papaparse');var Redis=require(_0x760d('0x10'));var authService=require(_0x760d('0x11'));var qs=require(_0x760d('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x760d('0x13'));var logger=require(_0x760d('0x14'))('api');var utils=require(_0x760d('0x15'));var config=require(_0x760d('0x16'));var licenseUtil=require(_0x760d('0x17'));var db=require(_0x760d('0x18'))['db'];function respondWithStatusCode(_0x1c6d0d,_0x40b3ee){_0x40b3ee=_0x40b3ee||0xcc;return function(_0xffb1f9){if(_0xffb1f9){return _0x1c6d0d[_0x760d('0x19')](_0x40b3ee);}return _0x1c6d0d[_0x760d('0x1a')](_0x40b3ee)[_0x760d('0x1b')]();};}function respondWithResult(_0x28bd1b,_0x543d6e){_0x543d6e=_0x543d6e||0xc8;return function(_0x1fed3a){if(_0x1fed3a){return _0x28bd1b['status'](_0x543d6e)[_0x760d('0x1c')](_0x1fed3a);}};}function respondWithFilteredResult(_0x62b5e9,_0x13118d){return function(_0x86e62a){if(_0x86e62a){var _0x49c0d4=typeof _0x13118d['offset']===_0x760d('0x1d')&&typeof _0x13118d[_0x760d('0x1e')]===_0x760d('0x1d');var _0x436bbd=_0x86e62a[_0x760d('0x1f')];var _0x1bed8=_0x49c0d4?0x0:_0x13118d['offset'];var _0x49cac3=_0x49c0d4?_0x86e62a[_0x760d('0x1f')]:_0x13118d[_0x760d('0x20')]+_0x13118d[_0x760d('0x1e')];var _0x2bbf82;if(_0x49cac3>=_0x436bbd){_0x49cac3=_0x436bbd;_0x2bbf82=0xc8;}else{_0x2bbf82=0xce;}_0x62b5e9[_0x760d('0x1a')](_0x2bbf82);return _0x62b5e9[_0x760d('0x21')](_0x760d('0x22'),_0x1bed8+'-'+_0x49cac3+'/'+_0x436bbd)[_0x760d('0x1c')](_0x86e62a);}return null;};}function patchUpdates(_0x37d5a5){return function(_0x2f74b5){try{jsonpatch['apply'](_0x2f74b5,_0x37d5a5,!![]);}catch(_0xf3c65f){return BPromise[_0x760d('0x23')](_0xf3c65f);}return _0x2f74b5[_0x760d('0x24')]();};}function saveUpdates(_0x2797bf,_0x234934){return function(_0x57dcea){if(_0x57dcea){return _0x57dcea[_0x760d('0x25')](_0x2797bf)[_0x760d('0x26')](function(_0x1fac3c){return _0x1fac3c;});}return null;};}function removeEntity(_0x516133,_0x55b45a){return function(_0x44b653){if(_0x44b653){return _0x44b653[_0x760d('0x27')]()[_0x760d('0x26')](function(){var _0x19cd53=_0x44b653[_0x760d('0x28')]({'plain':!![]});var _0x16bbdb=_0x760d('0x29');return db[_0x760d('0x2a')]['destroy']({'where':{'type':_0x16bbdb,'resourceId':_0x19cd53['id']}})[_0x760d('0x26')](function(){return _0x44b653;});})[_0x760d('0x26')](function(){_0x516133[_0x760d('0x1a')](0xcc)[_0x760d('0x1b')]();});}};}function handleEntityNotFound(_0x47c5e6,_0x2b2251){return function(_0x58b4fb){if(!_0x58b4fb){_0x47c5e6['sendStatus'](0x194);}return _0x58b4fb;};}function handleError(_0x10696b,_0x4619ed){_0x4619ed=_0x4619ed||0x1f4;return function(_0x3bb676){logger[_0x760d('0x2b')](_0x3bb676[_0x760d('0x2c')]);if(_0x3bb676[_0x760d('0x2d')]){delete _0x3bb676[_0x760d('0x2d')];}_0x10696b[_0x760d('0x1a')](_0x4619ed)['send'](_0x3bb676);};}exports[_0x760d('0x2e')]=function(_0xc4fec8,_0x27cb58){var _0x149732={},_0x4b5bfb={},_0x5584c7={'count':0x0,'rows':[]};var _0x47ef8f=_[_0x760d('0x2f')](db[_0x760d('0x30')][_0x760d('0x31')],function(_0x3cd782){return{'name':_0x3cd782[_0x760d('0x32')],'type':_0x3cd782[_0x760d('0x33')][_0x760d('0x34')]};});_0x4b5bfb[_0x760d('0x35')]=_[_0x760d('0x2f')](_0x47ef8f,_0x760d('0x2d'));_0x4b5bfb[_0x760d('0x36')]=_[_0x760d('0x37')](_0xc4fec8['query']);_0x4b5bfb[_0x760d('0x38')]=_[_0x760d('0x39')](_0x4b5bfb['model'],_0x4b5bfb['query']);_0x149732[_0x760d('0x3a')]=_[_0x760d('0x39')](_0x4b5bfb['model'],qs[_0x760d('0x3b')](_0xc4fec8['query']['fields']));_0x149732[_0x760d('0x3a')]=_0x149732[_0x760d('0x3a')][_0x760d('0x3c')]?_0x149732[_0x760d('0x3a')]:_0x4b5bfb[_0x760d('0x35')];if(!_0xc4fec8['query']['hasOwnProperty']('nolimit')){_0x149732['limit']=qs[_0x760d('0x1e')](_0xc4fec8[_0x760d('0x36')][_0x760d('0x1e')]);_0x149732[_0x760d('0x20')]=qs[_0x760d('0x20')](_0xc4fec8[_0x760d('0x36')]['offset']);}_0x149732[_0x760d('0x3d')]=qs[_0x760d('0x3e')](_0xc4fec8[_0x760d('0x36')][_0x760d('0x3e')]);_0x149732[_0x760d('0x3f')]=qs[_0x760d('0x38')](_[_0x760d('0x40')](_0xc4fec8[_0x760d('0x36')],_0x4b5bfb['filters']),_0x47ef8f);if(_0xc4fec8[_0x760d('0x36')]['filter']){_0x149732[_0x760d('0x3f')]=_[_0x760d('0x41')](_0x149732['where'],{'$or':_[_0x760d('0x2f')](_0x47ef8f,function(_0x551e9d){if(_0x551e9d['type']!==_0x760d('0x42')){var _0x4ef63f={};_0x4ef63f[_0x551e9d['name']]={'$like':'%'+_0xc4fec8[_0x760d('0x36')][_0x760d('0x43')]+'%'};return _0x4ef63f;}})});}_0x149732=_[_0x760d('0x41')]({},_0x149732,_0xc4fec8['options']);var _0x57d950={'where':_0x149732['where']};return db[_0x760d('0x30')][_0x760d('0x1f')](_0x57d950)[_0x760d('0x26')](function(_0x3be521){_0x5584c7[_0x760d('0x1f')]=_0x3be521;if(_0xc4fec8[_0x760d('0x36')][_0x760d('0x44')]){_0x149732[_0x760d('0x45')]=[{'all':!![]}];}return db[_0x760d('0x30')]['findAll'](_0x149732);})['then'](function(_0x3dbc36){_0x5584c7['rows']=_0x3dbc36;return _0x5584c7;})[_0x760d('0x26')](respondWithFilteredResult(_0x27cb58,_0x149732))[_0x760d('0x46')](handleError(_0x27cb58,null));};exports[_0x760d('0x47')]=function(_0xe11b50,_0x2e4df3){var _0x974af2={'raw':![],'where':{'id':_0xe11b50[_0x760d('0x48')]['id']}},_0x18d132={};_0x18d132[_0x760d('0x35')]=_[_0x760d('0x37')](db[_0x760d('0x30')][_0x760d('0x31')]);_0x18d132[_0x760d('0x36')]=_[_0x760d('0x37')](_0xe11b50[_0x760d('0x36')]);_0x18d132[_0x760d('0x38')]=_[_0x760d('0x39')](_0x18d132['model'],_0x18d132['query']);_0x974af2['attributes']=_['intersection'](_0x18d132[_0x760d('0x35')],qs[_0x760d('0x3b')](_0xe11b50[_0x760d('0x36')]['fields']));_0x974af2[_0x760d('0x3a')]=_0x974af2[_0x760d('0x3a')][_0x760d('0x3c')]?_0x974af2[_0x760d('0x3a')]:_0x18d132[_0x760d('0x35')];if(_0xe11b50[_0x760d('0x36')]['includeAll']){_0x974af2[_0x760d('0x45')]=[{'all':!![]}];}_0x974af2=_[_0x760d('0x41')]({},_0x974af2,_0xe11b50[_0x760d('0x49')]);return db[_0x760d('0x30')][_0x760d('0x4a')](_0x974af2)[_0x760d('0x26')](handleEntityNotFound(_0x2e4df3,null))[_0x760d('0x26')](respondWithResult(_0x2e4df3,null))[_0x760d('0x46')](handleError(_0x2e4df3,null));};exports[_0x760d('0x4b')]=function(_0x823b7b,_0x5b7555){return db['Campaign'][_0x760d('0x4b')](_0x823b7b[_0x760d('0x4c')],{})['then'](function(_0xa211d6){var _0x5f1e09=_0x823b7b[_0x760d('0x4d')]['get']({'plain':!![]});if(!_0x5f1e09)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5f1e09[_0x760d('0x4e')]===_0x760d('0x4d')){var _0x3dbfa5=_0xa211d6[_0x760d('0x28')]({'plain':!![]});var _0x5d6426=_0x760d('0x29');return db[_0x760d('0x4f')]['find']({'where':{'name':_0x5d6426,'userProfileId':_0x5f1e09[_0x760d('0x50')]},'raw':!![]})['then'](function(_0x453582){if(_0x453582&&_0x453582[_0x760d('0x51')]===0x0){return db[_0x760d('0x2a')]['create']({'name':_0x3dbfa5[_0x760d('0x2d')],'resourceId':_0x3dbfa5['id'],'type':_0x453582[_0x760d('0x2d')],'sectionId':_0x453582['id']},{})[_0x760d('0x26')](function(){return _0xa211d6;});}else{return _0xa211d6;}})[_0x760d('0x46')](function(_0x102e7d){logger[_0x760d('0x2b')](_0x760d('0x52'),_0x102e7d);throw _0x102e7d;});}return _0xa211d6;})['then'](respondWithResult(_0x5b7555,0xc9))[_0x760d('0x46')](handleError(_0x5b7555,null));};exports[_0x760d('0x53')]=function(_0x6dbc5b,_0xc7610d){var _0x187e28={'where':{'id':_0x6dbc5b['params']['id']}},_0x83749a={};_0x83749a['model']=_[_0x760d('0x37')](db[_0x760d('0x30')]['rawAttributes']);_0x187e28[_0x760d('0x3a')]=_[_0x760d('0x39')](_0x83749a['model'],qs[_0x760d('0x3b')](_0x6dbc5b['query'][_0x760d('0x3b')]));_0x187e28[_0x760d('0x3a')]=_0x187e28[_0x760d('0x3a')][_0x760d('0x3c')]?_0x187e28[_0x760d('0x3a')]:_0x83749a['model'];if(_0x6dbc5b[_0x760d('0x36')][_0x760d('0x44')]){_0x187e28[_0x760d('0x45')]=[{'all':!![]}];}_0x187e28=_[_0x760d('0x41')]({},_0x187e28,_0x6dbc5b[_0x760d('0x49')]);return db[_0x760d('0x30')][_0x760d('0x4a')](_0x187e28)[_0x760d('0x26')](handleEntityNotFound(_0xc7610d,null))[_0x760d('0x26')](function(_0x23fc40){if(_0x23fc40){var _0x42b713=_0x23fc40[_0x760d('0x28')]({'plain':!![]});_0x42b713=qs['omit'](_0x42b713,['id','createdAt',_0x760d('0x54')]);_0x6dbc5b[_0x760d('0x4c')]=_[_0x760d('0x55')](_0x6dbc5b[_0x760d('0x4c')],['id',_0x760d('0x56'),_0x760d('0x54')]);return db[_0x760d('0x30')][_0x760d('0x4b')](_[_0x760d('0x41')](_0x42b713,_0x6dbc5b[_0x760d('0x4c')]),{'include':_0x6dbc5b[_0x760d('0x36')][_0x760d('0x44')]?[{'all':!![]}]:undefined})[_0x760d('0x26')](function(_0x4084a8){var _0x322be2=_0x6dbc5b[_0x760d('0x4d')]['get']({'plain':!![]});if(!_0x322be2)throw new Error(_0x760d('0x57'));if(_0x322be2[_0x760d('0x4e')]===_0x760d('0x4d')){var _0x36dfa0=_0x4084a8[_0x760d('0x28')]({'plain':!![]});var _0x5ca3f7=_0x760d('0x29');return db['UserProfileSection'][_0x760d('0x4a')]({'where':{'name':_0x5ca3f7,'userProfileId':_0x322be2[_0x760d('0x50')]},'raw':!![]})[_0x760d('0x26')](function(_0x1fddbe){if(_0x1fddbe&&_0x1fddbe['autoAssociation']===0x0){return db[_0x760d('0x2a')][_0x760d('0x4b')]({'name':_0x36dfa0['name'],'resourceId':_0x36dfa0['id'],'type':_0x1fddbe[_0x760d('0x2d')],'sectionId':_0x1fddbe['id']},{})[_0x760d('0x26')](function(){return _0x4084a8;});}else{return _0x4084a8;}})[_0x760d('0x46')](function(_0x30d6ec){logger[_0x760d('0x2b')](_0x760d('0x52'),_0x30d6ec);throw _0x30d6ec;});}return _0x4084a8;});}})[_0x760d('0x26')](respondWithResult(_0xc7610d,0xc9))['catch'](handleError(_0xc7610d,null));};exports[_0x760d('0x25')]=function(_0x509100,_0x3ad4bc){if(_0x509100[_0x760d('0x4c')]['id']){delete _0x509100[_0x760d('0x4c')]['id'];}return db['Campaign'][_0x760d('0x4a')]({'where':{'id':_0x509100['params']['id']}})[_0x760d('0x26')](handleEntityNotFound(_0x3ad4bc,null))[_0x760d('0x26')](saveUpdates(_0x509100[_0x760d('0x4c')],null))[_0x760d('0x26')](respondWithResult(_0x3ad4bc,null))[_0x760d('0x46')](handleError(_0x3ad4bc,null));};exports['destroy']=function(_0x1c52f5,_0x17baa4){return db[_0x760d('0x30')]['find']({'where':{'id':_0x1c52f5[_0x760d('0x48')]['id']}})[_0x760d('0x26')](handleEntityNotFound(_0x17baa4,null))[_0x760d('0x26')](removeEntity(_0x17baa4,null))['catch'](handleError(_0x17baa4,null));};exports['getHoppers']=function(_0x5aea04,_0x292b0f,_0x356959){var _0x56b2c2={'raw':!![],'where':{}};var _0x55bd28={};var _0x2ccd9b={'count':0x0,'rows':[]};return db[_0x760d('0x30')][_0x760d('0x58')]({'where':{'id':_0x5aea04[_0x760d('0x48')]['id']}})[_0x760d('0x26')](handleEntityNotFound(_0x292b0f,null))[_0x760d('0x26')](function(_0x1483db){if(_0x1483db){_0x55bd28[_0x760d('0x35')]=_[_0x760d('0x37')](db[_0x760d('0x59')]['rawAttributes']);_0x55bd28[_0x760d('0x36')]=_[_0x760d('0x37')](_0x5aea04['query']);_0x55bd28['filters']=_[_0x760d('0x39')](_0x55bd28[_0x760d('0x35')],_0x55bd28['query']);_0x56b2c2[_0x760d('0x3a')]=_[_0x760d('0x39')](_0x55bd28['model'],qs[_0x760d('0x3b')](_0x5aea04['query'][_0x760d('0x3b')]));_0x56b2c2['attributes']=_0x56b2c2[_0x760d('0x3a')][_0x760d('0x3c')]?_0x56b2c2['attributes']:_0x55bd28['model'];if(!_0x5aea04[_0x760d('0x36')][_0x760d('0x5a')](_0x760d('0x5b'))){_0x56b2c2['limit']=qs[_0x760d('0x1e')](_0x5aea04['query']['limit']);_0x56b2c2[_0x760d('0x20')]=qs[_0x760d('0x20')](_0x5aea04[_0x760d('0x36')]['offset']);}_0x56b2c2['order']=qs[_0x760d('0x3e')](_0x5aea04[_0x760d('0x36')][_0x760d('0x3e')]);_0x56b2c2[_0x760d('0x3f')]=qs[_0x760d('0x38')](_[_0x760d('0x40')](_0x5aea04['query'],_0x55bd28[_0x760d('0x38')]));_0x56b2c2[_0x760d('0x3f')][_0x760d('0x5c')]=_0x1483db['id'];if(_0x5aea04[_0x760d('0x36')]['filter']){_0x56b2c2[_0x760d('0x3f')]=_[_0x760d('0x41')](_0x56b2c2['where'],{'$or':_[_0x760d('0x2f')](_0x56b2c2['attributes'],function(_0xee30f9){var _0x3702b2={};_0x3702b2[_0xee30f9]={'$like':'%'+_0x5aea04[_0x760d('0x36')][_0x760d('0x43')]+'%'};return _0x3702b2;})});}_0x56b2c2=_[_0x760d('0x41')]({},_0x56b2c2,_0x5aea04['options']);return db['CmHopper'][_0x760d('0x1f')]({'where':_0x56b2c2[_0x760d('0x3f')]})['then'](function(_0x33cb84){_0x2ccd9b[_0x760d('0x1f')]=_0x33cb84;if(_0x5aea04['query'][_0x760d('0x44')]){_0x56b2c2[_0x760d('0x45')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x56b2c2);})[_0x760d('0x26')](function(_0x10de79){_0x2ccd9b['rows']=_0x10de79;return _0x2ccd9b;});}})[_0x760d('0x26')](respondWithFilteredResult(_0x292b0f,_0x56b2c2))[_0x760d('0x46')](handleError(_0x292b0f,null));};exports['getHopperHistories']=function(_0x28e84a,_0x571519,_0x45804b){var _0x3c6431={'raw':!![],'where':{}};var _0x4dbb24={};var _0x429579={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x28e84a[_0x760d('0x48')]['id']}})['then'](handleEntityNotFound(_0x571519,null))['then'](function(_0x5d7a8e){if(_0x5d7a8e){_0x4dbb24['model']=_[_0x760d('0x37')](db[_0x760d('0x5d')][_0x760d('0x31')]);_0x4dbb24[_0x760d('0x36')]=_[_0x760d('0x37')](_0x28e84a[_0x760d('0x36')]);_0x4dbb24['filters']=_['intersection'](_0x4dbb24[_0x760d('0x35')],_0x4dbb24['query']);_0x3c6431[_0x760d('0x3a')]=_[_0x760d('0x39')](_0x4dbb24[_0x760d('0x35')],qs['fields'](_0x28e84a[_0x760d('0x36')][_0x760d('0x3b')]));_0x3c6431[_0x760d('0x3a')]=_0x3c6431[_0x760d('0x3a')][_0x760d('0x3c')]?_0x3c6431[_0x760d('0x3a')]:_0x4dbb24[_0x760d('0x35')];if(!_0x28e84a[_0x760d('0x36')][_0x760d('0x5a')](_0x760d('0x5b'))){_0x3c6431[_0x760d('0x1e')]=qs[_0x760d('0x1e')](_0x28e84a[_0x760d('0x36')][_0x760d('0x1e')]);_0x3c6431[_0x760d('0x20')]=qs[_0x760d('0x20')](_0x28e84a['query']['offset']);}_0x3c6431[_0x760d('0x3d')]=qs[_0x760d('0x3e')](_0x28e84a[_0x760d('0x36')][_0x760d('0x3e')]);_0x3c6431['where']=qs[_0x760d('0x38')](_['pick'](_0x28e84a['query'],_0x4dbb24[_0x760d('0x38')]));_0x3c6431[_0x760d('0x3f')][_0x760d('0x5c')]=_0x5d7a8e['id'];if(_0x28e84a['query'][_0x760d('0x43')]){_0x3c6431[_0x760d('0x3f')]=_[_0x760d('0x41')](_0x3c6431[_0x760d('0x3f')],{'$or':_[_0x760d('0x2f')](_0x3c6431[_0x760d('0x3a')],function(_0x211a08){var _0x31d6ee={};_0x31d6ee[_0x211a08]={'$like':'%'+_0x28e84a[_0x760d('0x36')]['filter']+'%'};return _0x31d6ee;})});}_0x3c6431=_[_0x760d('0x41')]({},_0x3c6431,_0x28e84a[_0x760d('0x49')]);return db['CmHopperHistory'][_0x760d('0x1f')]({'where':_0x3c6431[_0x760d('0x3f')]})[_0x760d('0x26')](function(_0x27e44b){_0x429579['count']=_0x27e44b;if(_0x28e84a[_0x760d('0x36')][_0x760d('0x44')]){_0x3c6431['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x760d('0x5e')](_0x3c6431);})[_0x760d('0x26')](function(_0x7ce645){_0x429579[_0x760d('0x5f')]=_0x7ce645;return _0x429579;});}})['then'](respondWithFilteredResult(_0x571519,_0x3c6431))[_0x760d('0x46')](handleError(_0x571519,null));};exports[_0x760d('0x60')]=function(_0x282c3b,_0x4dd845,_0x48f562){var _0x5f24c3={'raw':!![],'where':{}};var _0x135544={};var _0x29219d={'count':0x0,'rows':[]};return db[_0x760d('0x30')][_0x760d('0x58')]({'where':{'id':_0x282c3b[_0x760d('0x48')]['id']}})[_0x760d('0x26')](handleEntityNotFound(_0x4dd845,null))[_0x760d('0x26')](function(_0x18bc64){if(_0x18bc64){_0x135544[_0x760d('0x35')]=_['keys'](db['CmHopperFinal'][_0x760d('0x31')]);_0x135544[_0x760d('0x36')]=_[_0x760d('0x37')](_0x282c3b[_0x760d('0x36')]);_0x135544[_0x760d('0x38')]=_[_0x760d('0x39')](_0x135544[_0x760d('0x35')],_0x135544[_0x760d('0x36')]);_0x5f24c3[_0x760d('0x3a')]=_[_0x760d('0x39')](_0x135544[_0x760d('0x35')],qs[_0x760d('0x3b')](_0x282c3b[_0x760d('0x36')]['fields']));_0x5f24c3['attributes']=_0x5f24c3[_0x760d('0x3a')][_0x760d('0x3c')]?_0x5f24c3['attributes']:_0x135544['model'];if(!_0x282c3b[_0x760d('0x36')][_0x760d('0x5a')](_0x760d('0x5b'))){_0x5f24c3[_0x760d('0x1e')]=qs['limit'](_0x282c3b['query'][_0x760d('0x1e')]);_0x5f24c3[_0x760d('0x20')]=qs[_0x760d('0x20')](_0x282c3b[_0x760d('0x36')]['offset']);}_0x5f24c3[_0x760d('0x3d')]=qs[_0x760d('0x3e')](_0x282c3b[_0x760d('0x36')][_0x760d('0x3e')]);_0x5f24c3[_0x760d('0x3f')]=qs['filters'](_[_0x760d('0x40')](_0x282c3b[_0x760d('0x36')],_0x135544['filters']));_0x5f24c3[_0x760d('0x3f')][_0x760d('0x5c')]=_0x18bc64['id'];if(_0x282c3b[_0x760d('0x36')][_0x760d('0x43')]){_0x5f24c3[_0x760d('0x3f')]=_['merge'](_0x5f24c3[_0x760d('0x3f')],{'$or':_[_0x760d('0x2f')](_0x5f24c3[_0x760d('0x3a')],function(_0x3265d3){var _0x275662={};_0x275662[_0x3265d3]={'$like':'%'+_0x282c3b[_0x760d('0x36')][_0x760d('0x43')]+'%'};return _0x275662;})});}_0x5f24c3=_[_0x760d('0x41')]({},_0x5f24c3,_0x282c3b['options']);return db[_0x760d('0x61')][_0x760d('0x1f')]({'where':_0x5f24c3[_0x760d('0x3f')]})['then'](function(_0x26ffbe){_0x29219d[_0x760d('0x1f')]=_0x26ffbe;if(_0x282c3b[_0x760d('0x36')]['includeAll']){_0x5f24c3[_0x760d('0x45')]=[{'all':!![]}];}return db[_0x760d('0x61')]['findAll'](_0x5f24c3);})[_0x760d('0x26')](function(_0x189885){_0x29219d[_0x760d('0x5f')]=_0x189885;return _0x29219d;});}})['then'](respondWithFilteredResult(_0x4dd845,_0x5f24c3))[_0x760d('0x46')](handleError(_0x4dd845,null));};exports[_0x760d('0x62')]=function(_0x3ff551,_0x35116b,_0x52e16a){var _0x356602={'raw':!![],'where':{}};var _0x28576f={};var _0x165985={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x3ff551[_0x760d('0x48')]['id']}})[_0x760d('0x26')](handleEntityNotFound(_0x35116b,null))['then'](function(_0x364036){if(_0x364036){_0x28576f[_0x760d('0x35')]=_['keys'](db[_0x760d('0x63')][_0x760d('0x31')]);_0x28576f[_0x760d('0x36')]=_['keys'](_0x3ff551[_0x760d('0x36')]);_0x28576f[_0x760d('0x38')]=_[_0x760d('0x39')](_0x28576f['model'],_0x28576f[_0x760d('0x36')]);_0x356602['attributes']=_[_0x760d('0x39')](_0x28576f[_0x760d('0x35')],qs[_0x760d('0x3b')](_0x3ff551[_0x760d('0x36')][_0x760d('0x3b')]));_0x356602[_0x760d('0x3a')]=_0x356602[_0x760d('0x3a')]['length']?_0x356602[_0x760d('0x3a')]:_0x28576f[_0x760d('0x35')];if(!_0x3ff551[_0x760d('0x36')]['hasOwnProperty'](_0x760d('0x5b'))){_0x356602[_0x760d('0x1e')]=qs[_0x760d('0x1e')](_0x3ff551[_0x760d('0x36')][_0x760d('0x1e')]);_0x356602[_0x760d('0x20')]=qs['offset'](_0x3ff551[_0x760d('0x36')]['offset']);}_0x356602[_0x760d('0x3d')]=qs[_0x760d('0x3e')](_0x3ff551['query']['sort']);_0x356602[_0x760d('0x3f')]=qs[_0x760d('0x38')](_[_0x760d('0x40')](_0x3ff551[_0x760d('0x36')],_0x28576f['filters']));_0x356602['where']['CampaignId']=_0x364036['id'];if(_0x3ff551[_0x760d('0x36')][_0x760d('0x43')]){_0x356602[_0x760d('0x3f')]=_['merge'](_0x356602[_0x760d('0x3f')],{'$or':_[_0x760d('0x2f')](_0x356602[_0x760d('0x3a')],function(_0x5e13e5){var _0x6a2688={};_0x6a2688[_0x5e13e5]={'$like':'%'+_0x3ff551[_0x760d('0x36')]['filter']+'%'};return _0x6a2688;})});}_0x356602=_['merge']({},_0x356602,_0x3ff551['options']);return db[_0x760d('0x63')][_0x760d('0x1f')]({'where':_0x356602[_0x760d('0x3f')]})[_0x760d('0x26')](function(_0x4ccd36){_0x165985[_0x760d('0x1f')]=_0x4ccd36;if(_0x3ff551[_0x760d('0x36')][_0x760d('0x44')]){_0x356602['include']=[{'all':!![]}];}return db[_0x760d('0x63')][_0x760d('0x5e')](_0x356602);})[_0x760d('0x26')](function(_0x24006a){_0x165985[_0x760d('0x5f')]=_0x24006a;return _0x165985;});}})['then'](respondWithFilteredResult(_0x35116b,_0x356602))[_0x760d('0x46')](handleError(_0x35116b,null));};exports[_0x760d('0x64')]=function(_0x3082ed,_0x4c2377,_0x49085c){var _0x18a1ef={};var _0x2b3fb9={};var _0x2eef8e;var _0x8e8791;return db[_0x760d('0x30')][_0x760d('0x58')]({'where':{'id':_0x3082ed[_0x760d('0x48')]['id']}})['then'](handleEntityNotFound(_0x4c2377,null))[_0x760d('0x26')](function(_0x2a6b76){if(_0x2a6b76){_0x2eef8e=_0x2a6b76;_0x2b3fb9[_0x760d('0x35')]=_[_0x760d('0x37')](db['CmList'][_0x760d('0x31')]);_0x2b3fb9['query']=_[_0x760d('0x37')](_0x3082ed[_0x760d('0x36')]);_0x2b3fb9[_0x760d('0x38')]=_[_0x760d('0x39')](_0x2b3fb9[_0x760d('0x35')],_0x2b3fb9[_0x760d('0x36')]);_0x18a1ef[_0x760d('0x3a')]=_[_0x760d('0x39')](_0x2b3fb9['model'],qs[_0x760d('0x3b')](_0x3082ed[_0x760d('0x36')][_0x760d('0x3b')]));_0x18a1ef[_0x760d('0x3a')]=_0x18a1ef[_0x760d('0x3a')][_0x760d('0x3c')]?_0x18a1ef[_0x760d('0x3a')]:_0x2b3fb9[_0x760d('0x35')];_0x18a1ef[_0x760d('0x3d')]=qs['sort'](_0x3082ed[_0x760d('0x36')][_0x760d('0x3e')]);_0x18a1ef[_0x760d('0x3f')]=qs[_0x760d('0x38')](_[_0x760d('0x40')](_0x3082ed['query'],_0x2b3fb9[_0x760d('0x38')]));if(_0x3082ed['query']['filter']){_0x18a1ef[_0x760d('0x3f')]=_[_0x760d('0x41')](_0x18a1ef[_0x760d('0x3f')],{'$or':_[_0x760d('0x2f')](_0x18a1ef['attributes'],function(_0x463d20){var _0x4b96fd={};_0x4b96fd[_0x463d20]={'$like':'%'+_0x3082ed[_0x760d('0x36')]['filter']+'%'};return _0x4b96fd;})});}_0x18a1ef=_[_0x760d('0x41')]({},_0x18a1ef,_0x3082ed[_0x760d('0x49')]);return _0x2eef8e[_0x760d('0x64')](_0x18a1ef);}})[_0x760d('0x26')](function(_0x58835d){if(_0x58835d){_0x8e8791=_0x58835d['length'];if(!_0x3082ed[_0x760d('0x36')][_0x760d('0x5a')](_0x760d('0x5b'))){_0x18a1ef[_0x760d('0x1e')]=qs[_0x760d('0x1e')](_0x3082ed[_0x760d('0x36')]['limit']);_0x18a1ef['offset']=qs[_0x760d('0x20')](_0x3082ed[_0x760d('0x36')]['offset']);}return _0x2eef8e['getLists'](_0x18a1ef);}})[_0x760d('0x26')](function(_0x475940){if(_0x475940){return _0x475940?{'count':_0x8e8791,'rows':_0x475940}:null;}})[_0x760d('0x26')](respondWithResult(_0x4c2377,null))[_0x760d('0x46')](handleError(_0x4c2377,null));};exports[_0x760d('0x65')]=function(_0x35bb84,_0x5f5aa3,_0x151416){var _0xbbfbde,_0x440539;var _0x4525a0=[];var _0x6cf52=moment()[_0x760d('0x66')](_0x760d('0x67'));return db[_0x760d('0x30')]['find']({'where':{'id':_0x35bb84['params']['id']}})[_0x760d('0x26')](handleEntityNotFound(_0x5f5aa3,null))[_0x760d('0x26')](function(_0x5d6d3c){if(_0x5d6d3c){_0x440539=_0x5d6d3c;return _0x5d6d3c['addLists'](_0x35bb84[_0x760d('0x4c')]['ids'],_[_0x760d('0x55')](_0x35bb84[_0x760d('0x4c')],['ids','id'])||{});}return null;})[_0x760d('0x68')](function(_0x26c5c8){var _0x260404;var _0x589503;_0xbbfbde=_0x26c5c8||[];var _0x213958=[];if(_0x26c5c8){for(var _0x55c677=0x0;_0x55c677<_0x26c5c8['length'];_0x55c677+=0x1){var _0x1b8928=_0x26c5c8[_0x55c677][_0x760d('0x28')]({'plain':!![]});_0x440539[_0x760d('0x69')]=_0x35bb84[_0x760d('0x4c')][_0x760d('0x69')]?_0x35bb84[_0x760d('0x4c')][_0x760d('0x69')]:_0x440539[_0x760d('0x69')];switch(_0x440539[_0x760d('0x69')]){case _0x760d('0x6a'):_0x260404=squel[_0x760d('0x6b')]()[_0x760d('0x6c')]('cm_hopper')['fromQuery']([_0x760d('0x6d'),_0x760d('0x6e'),_0x760d('0x6f'),_0x760d('0x70'),_0x760d('0x5c'),'createdAt',_0x760d('0x54')],squel[_0x760d('0x71')]()[_0x760d('0x72')]('phone',_0x760d('0x6d'))[_0x760d('0x72')](_0x760d('0x73'),'scheduledAt')[_0x760d('0x72')]('id',_0x760d('0x6f'))['field'](_0x1b8928['CmListId'][_0x760d('0x74')](),'ListId')[_0x760d('0x72')](_0x35bb84['params']['id'][_0x760d('0x74')](),_0x760d('0x5c'))[_0x760d('0x72')]('\x27'+_0x6cf52+'\x27','createdAt')['field']('\x27'+_0x6cf52+'\x27',_0x760d('0x54'))['from'](_0x760d('0x75'))[_0x760d('0x3f')](_0x760d('0x76'))[_0x760d('0x3f')](_0x760d('0x77'),_0x1b8928[_0x760d('0x78')][_0x760d('0x74')]())[_0x760d('0x3f')](_0x760d('0x79'))[_0x760d('0x3f')](_0x760d('0x7a'),squel[_0x760d('0x71')]()[_0x760d('0x72')](_0x760d('0x7b'))['from']('cm_hopper_final')[_0x760d('0x3f')](_0x760d('0x7c'),_0x35bb84[_0x760d('0x48')]['id'][_0x760d('0x74')]()))['where'](_0x760d('0x7a'),squel[_0x760d('0x71')]()['field'](_0x760d('0x7d'))['from'](_0x760d('0x7e'))[_0x760d('0x3f')](_0x760d('0x7c'),_0x35bb84[_0x760d('0x48')]['id']['toString']())))[_0x760d('0x74')]();break;case _0x760d('0x7f'):_0x260404=squel['insert']()[_0x760d('0x6c')](_0x760d('0x7e'))[_0x760d('0x80')]([_0x760d('0x6d'),_0x760d('0x6e'),_0x760d('0x6f'),'ListId',_0x760d('0x5c'),_0x760d('0x56'),_0x760d('0x54')],squel['select']()['field'](_0x760d('0x6d'),_0x760d('0x6d'))['field'](_0x760d('0x73'),'scheduledAt')[_0x760d('0x72')]('id',_0x760d('0x6f'))[_0x760d('0x72')](_0x1b8928[_0x760d('0x78')][_0x760d('0x74')](),_0x760d('0x70'))['field'](_0x35bb84[_0x760d('0x48')]['id'][_0x760d('0x74')](),_0x760d('0x5c'))['field']('\x27'+_0x6cf52+'\x27','createdAt')[_0x760d('0x72')]('\x27'+_0x6cf52+'\x27',_0x760d('0x54'))['from']('cm_contacts')['where'](_0x760d('0x76'))[_0x760d('0x3f')](_0x760d('0x77'),_0x1b8928['CmListId']['toString']())[_0x760d('0x3f')](_0x760d('0x79'))[_0x760d('0x3f')](_0x760d('0x7a'),squel[_0x760d('0x71')]()[_0x760d('0x72')](_0x760d('0x7d'))[_0x760d('0x81')]('cm_hopper')['where'](_0x760d('0x7c'),_0x35bb84[_0x760d('0x48')]['id']['toString']())))[_0x760d('0x74')]();break;default:_0x260404=squel['insert']()[_0x760d('0x6c')](_0x760d('0x7e'))['fromQuery']([_0x760d('0x6d'),_0x760d('0x6e'),_0x760d('0x6f'),'ListId','CampaignId',_0x760d('0x56'),_0x760d('0x54')],squel['select']()[_0x760d('0x72')](_0x760d('0x6d'),_0x760d('0x6d'))[_0x760d('0x72')](_0x760d('0x73'),_0x760d('0x6e'))[_0x760d('0x72')]('id',_0x760d('0x6f'))['field'](_0x1b8928[_0x760d('0x78')][_0x760d('0x74')](),_0x760d('0x70'))[_0x760d('0x72')](_0x35bb84[_0x760d('0x48')]['id']['toString'](),_0x760d('0x5c'))['field']('\x27'+_0x6cf52+'\x27',_0x760d('0x56'))[_0x760d('0x72')]('\x27'+_0x6cf52+'\x27',_0x760d('0x54'))['from'](_0x760d('0x75'))['where'](_0x760d('0x76'))[_0x760d('0x3f')](_0x760d('0x77'),_0x1b8928['CmListId'][_0x760d('0x74')]())[_0x760d('0x3f')](_0x760d('0x79')))['toString']();}_0x589503=squel['insert']()['into'](_0x760d('0x82'))[_0x760d('0x80')](['cmHopperId','scheduledAt',_0x760d('0x6d'),'OrderBy','createdAt',_0x760d('0x54')],squel['select']()[_0x760d('0x72')]('h.id','id')[_0x760d('0x72')](_0x760d('0x73'),_0x760d('0x6e'))[_0x760d('0x72')]('ci.item',_0x760d('0x6d'))[_0x760d('0x72')]('ci.OrderBY',_0x760d('0x83'))['field']('\x27'+_0x6cf52+'\x27',_0x760d('0x56'))[_0x760d('0x72')]('\x27'+_0x6cf52+'\x27',_0x760d('0x54'))[_0x760d('0x81')](_0x760d('0x84'),'ci')[_0x760d('0x85')](_0x760d('0x7e'),'h','h.ContactId\x20=\x20ci.CmContactId')[_0x760d('0x3f')]('h.ListId\x20=\x20?',_0x1b8928[_0x760d('0x78')][_0x760d('0x74')]())[_0x760d('0x3f')](_0x760d('0x86'),_0x35bb84['params']['id'][_0x760d('0x74')]())[_0x760d('0x3f')](_0x760d('0x87'),_0x6cf52))[_0x760d('0x74')]();_0x213958[_0x760d('0x88')](db[_0x760d('0x89')][_0x760d('0x36')](_0x260404));_0x4525a0[_0x760d('0x88')](db[_0x760d('0x89')][_0x760d('0x36')](_0x589503));}return BPromise[_0x760d('0x8a')](_0x213958);}})[_0x760d('0x26')](function(){return BPromise[_0x760d('0x8a')](_0x4525a0);})[_0x760d('0x26')](function(){return _0xbbfbde;})['then'](respondWithResult(_0x5f5aa3,null))[_0x760d('0x46')](handleError(_0x5f5aa3,null));};exports[_0x760d('0x8b')]=function(_0x5a3dd0,_0x13e10c,_0x1e02d2){return db['Campaign'][_0x760d('0x4a')]({'where':{'id':_0x5a3dd0['params']['id']}})[_0x760d('0x26')](handleEntityNotFound(_0x13e10c,null))[_0x760d('0x26')](function(_0x56db54){if(_0x56db54){return _0x56db54[_0x760d('0x8b')](_0x5a3dd0['query'][_0x760d('0x8c')]);}})['then'](function(_0x434173){if(_0x434173){return db['CmHopper']['destroy']({'where':{'ListId':_0x5a3dd0['query'][_0x760d('0x8c')],'CampaignId':_0x5a3dd0[_0x760d('0x48')]['id']}})['then'](function(){return _0x434173;});}})['then'](respondWithStatusCode(_0x13e10c,null))[_0x760d('0x46')](handleError(_0x13e10c,null));};exports[_0x760d('0x8d')]=function(_0xeac13,_0x56e2ae,_0x559f2e){var _0x56f9cf={};var _0x176814={};var _0x3dc8ad;var _0x25927b;return db[_0x760d('0x30')][_0x760d('0x58')]({'where':{'id':_0xeac13['params']['id']}})['then'](handleEntityNotFound(_0x56e2ae,null))['then'](function(_0x519188){if(_0x519188){_0x3dc8ad=_0x519188;_0x176814[_0x760d('0x35')]=_[_0x760d('0x37')](db['CmList'][_0x760d('0x31')]);_0x176814[_0x760d('0x36')]=_[_0x760d('0x37')](_0xeac13['query']);_0x176814[_0x760d('0x38')]=_[_0x760d('0x39')](_0x176814['model'],_0x176814[_0x760d('0x36')]);_0x56f9cf[_0x760d('0x3a')]=_[_0x760d('0x39')](_0x176814['model'],qs[_0x760d('0x3b')](_0xeac13[_0x760d('0x36')]['fields']));_0x56f9cf[_0x760d('0x3a')]=_0x56f9cf[_0x760d('0x3a')][_0x760d('0x3c')]?_0x56f9cf[_0x760d('0x3a')]:_0x176814[_0x760d('0x35')];_0x56f9cf[_0x760d('0x3d')]=qs['sort'](_0xeac13[_0x760d('0x36')][_0x760d('0x3e')]);_0x56f9cf[_0x760d('0x3f')]=qs[_0x760d('0x38')](_[_0x760d('0x40')](_0xeac13[_0x760d('0x36')],_0x176814[_0x760d('0x38')]));if(_0xeac13['query'][_0x760d('0x43')]){_0x56f9cf[_0x760d('0x3f')]=_[_0x760d('0x41')](_0x56f9cf[_0x760d('0x3f')],{'$or':_[_0x760d('0x2f')](_0x56f9cf[_0x760d('0x3a')],function(_0x5ae107){var _0xf38411={};_0xf38411[_0x5ae107]={'$like':'%'+_0xeac13['query']['filter']+'%'};return _0xf38411;})});}_0x56f9cf=_[_0x760d('0x41')]({},_0x56f9cf,_0xeac13[_0x760d('0x49')]);return _0x3dc8ad[_0x760d('0x8d')](_0x56f9cf);}})['then'](function(_0x53369d){if(_0x53369d){_0x25927b=_0x53369d[_0x760d('0x3c')];if(!_0xeac13[_0x760d('0x36')][_0x760d('0x5a')](_0x760d('0x5b'))){_0x56f9cf[_0x760d('0x1e')]=qs[_0x760d('0x1e')](_0xeac13['query'][_0x760d('0x1e')]);_0x56f9cf[_0x760d('0x20')]=qs[_0x760d('0x20')](_0xeac13[_0x760d('0x36')][_0x760d('0x20')]);}return _0x3dc8ad[_0x760d('0x8d')](_0x56f9cf);}})['then'](function(_0x1e241f){if(_0x1e241f){return _0x1e241f?{'count':_0x25927b,'rows':_0x1e241f}:null;}})[_0x760d('0x26')](respondWithResult(_0x56e2ae,null))[_0x760d('0x46')](handleError(_0x56e2ae,null));};exports['addBlackLists']=function(_0xecae35,_0xf3cd8b,_0x59b57b){var _0x5aa429,_0xfcb74e;var _0x5b8487=[];var _0x4ecd17=moment()['format'](_0x760d('0x67'));return db[_0x760d('0x30')][_0x760d('0x4a')]({'where':{'id':_0xecae35[_0x760d('0x48')]['id']}})[_0x760d('0x26')](handleEntityNotFound(_0xf3cd8b,null))['then'](function(_0x2117ad){if(_0x2117ad){_0xfcb74e=_0x2117ad;return _0x2117ad[_0x760d('0x8e')](_0xecae35[_0x760d('0x4c')][_0x760d('0x8c')],_[_0x760d('0x55')](_0xecae35['body'],[_0x760d('0x8c'),'id'])||{});}return null;})['spread'](function(_0x3bd7ba){var _0x391200;var _0x228c03;_0x5aa429=_0x3bd7ba||[];var _0x2bdbfe=[];if(_0x3bd7ba){for(var _0x10d180=0x0;_0x10d180<_0x3bd7ba[_0x760d('0x3c')];_0x10d180+=0x1){var _0x3c1c13=_0x3bd7ba[_0x10d180][_0x760d('0x28')]({'plain':!![]});_0x391200=squel['insert']()[_0x760d('0x6c')](_0x760d('0x8f'))[_0x760d('0x80')](['phone',_0x760d('0x6f'),'ListId','CampaignId',_0x760d('0x56'),'updatedAt'],squel['select']()[_0x760d('0x72')](_0x760d('0x6d'),_0x760d('0x6d'))[_0x760d('0x72')]('id','ContactId')[_0x760d('0x72')](_0x3c1c13[_0x760d('0x78')]['toString'](),_0x760d('0x70'))[_0x760d('0x72')](_0xecae35[_0x760d('0x48')]['id'][_0x760d('0x74')](),_0x760d('0x5c'))[_0x760d('0x72')](_0x760d('0x73'),_0x760d('0x56'))['field'](_0x760d('0x73'),_0x760d('0x54'))[_0x760d('0x81')]('cm_contacts')[_0x760d('0x3f')](_0x760d('0x76'))[_0x760d('0x3f')](_0x760d('0x77'),_0x3c1c13['CmListId'][_0x760d('0x74')]())[_0x760d('0x3f')](_0x760d('0x79')))['toString']();_0x2bdbfe[_0x760d('0x88')](db[_0x760d('0x89')][_0x760d('0x36')](_0x391200));}return BPromise[_0x760d('0x8a')](_0x2bdbfe);}})[_0x760d('0x26')](function(){return _0x5aa429;})[_0x760d('0x26')](respondWithResult(_0xf3cd8b,null))[_0x760d('0x46')](handleError(_0xf3cd8b,null));};exports[_0x760d('0x90')]=function(_0x58bb24,_0x3e7f75,_0x428f7f){return db[_0x760d('0x30')][_0x760d('0x4a')]({'where':{'id':_0x58bb24['params']['id']}})[_0x760d('0x26')](handleEntityNotFound(_0x3e7f75,null))[_0x760d('0x26')](function(_0x3b8ad3){if(_0x3b8ad3){return _0x3b8ad3[_0x760d('0x90')](_0x58bb24['query'][_0x760d('0x8c')]);}})[_0x760d('0x26')](function(_0x4a9598){if(_0x4a9598){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x58bb24[_0x760d('0x36')][_0x760d('0x8c')],'CampaignId':_0x58bb24[_0x760d('0x48')]['id']}})[_0x760d('0x26')](function(){return _0x4a9598;});}})['then'](respondWithStatusCode(_0x3e7f75,null))[_0x760d('0x46')](handleError(_0x3e7f75,null));};
\ No newline at end of file
+var _0xa503=['COALESCE(phone,\x27\x27)','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','YYYY-MM-DD\x20HH:mm:ss','addBlackLists','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','IvrCampaigns','UserProfileResource','end','stack','name','index','map','Campaign','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','create','user','role','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','getHoppers','findOne','pick','CampaignId','CmHopper','findAll','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','ids','spread','dialCheckDuplicateType','insert','cm_hopper','fromQuery','scheduledAt','ListId','field','phone','NOW()','ContactId','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','onlyIfOpen','into'];(function(_0x5d2288,_0x352f6c){var _0x633f73=function(_0x4c26cf){while(--_0x4c26cf){_0x5d2288['push'](_0x5d2288['shift']());}};_0x633f73(++_0x352f6c);}(_0xa503,0x143));var _0x3a50=function(_0x4da373,_0x186d75){_0x4da373=_0x4da373-0x0;var _0x50e48d=_0xa503[_0x4da373];return _0x50e48d;};'use strict';var emlformat=require(_0x3a50('0x0'));var rimraf=require(_0x3a50('0x1'));var zipdir=require(_0x3a50('0x2'));var jsonpatch=require(_0x3a50('0x3'));var rp=require(_0x3a50('0x4'));var moment=require(_0x3a50('0x5'));var BPromise=require(_0x3a50('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3a50('0x7'));var sox=require(_0x3a50('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3a50('0x9'));var _=require(_0x3a50('0xa'));var squel=require(_0x3a50('0xb'));var crypto=require(_0x3a50('0xc'));var jsforce=require(_0x3a50('0xd'));var deskjs=require(_0x3a50('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3a50('0xf'));var Papa=require(_0x3a50('0x10'));var Redis=require(_0x3a50('0x11'));var authService=require(_0x3a50('0x12'));var qs=require(_0x3a50('0x13'));var as=require(_0x3a50('0x14'));var hardwareService=require(_0x3a50('0x15'));var logger=require('../../config/logger')(_0x3a50('0x16'));var utils=require(_0x3a50('0x17'));var config=require(_0x3a50('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x3a50('0x19'))['db'];function respondWithStatusCode(_0x4e9a5a,_0x1719c8){_0x1719c8=_0x1719c8||0xcc;return function(_0x401060){if(_0x401060){return _0x4e9a5a[_0x3a50('0x1a')](_0x1719c8);}return _0x4e9a5a[_0x3a50('0x1b')](_0x1719c8)['end']();};}function respondWithResult(_0x4762e2,_0x54cb88){_0x54cb88=_0x54cb88||0xc8;return function(_0x2aeba7){if(_0x2aeba7){return _0x4762e2[_0x3a50('0x1b')](_0x54cb88)[_0x3a50('0x1c')](_0x2aeba7);}};}function respondWithFilteredResult(_0x260374,_0x51aa93){return function(_0x55365e){if(_0x55365e){var _0x4b8971=typeof _0x51aa93[_0x3a50('0x1d')]===_0x3a50('0x1e')&&typeof _0x51aa93['limit']==='undefined';var _0x49f294=_0x55365e['count'];var _0x176e85=_0x4b8971?0x0:_0x51aa93[_0x3a50('0x1d')];var _0xaa2e18=_0x4b8971?_0x55365e[_0x3a50('0x1f')]:_0x51aa93['offset']+_0x51aa93[_0x3a50('0x20')];var _0x4d9c37;if(_0xaa2e18>=_0x49f294){_0xaa2e18=_0x49f294;_0x4d9c37=0xc8;}else{_0x4d9c37=0xce;}_0x260374[_0x3a50('0x1b')](_0x4d9c37);return _0x260374[_0x3a50('0x21')](_0x3a50('0x22'),_0x176e85+'-'+_0xaa2e18+'/'+_0x49f294)[_0x3a50('0x1c')](_0x55365e);}return null;};}function patchUpdates(_0x1871df){return function(_0x231a24){try{jsonpatch[_0x3a50('0x23')](_0x231a24,_0x1871df,!![]);}catch(_0x42c445){return BPromise[_0x3a50('0x24')](_0x42c445);}return _0x231a24[_0x3a50('0x25')]();};}function saveUpdates(_0x4081ba,_0x505bdc){return function(_0x3d2b0c){if(_0x3d2b0c){return _0x3d2b0c[_0x3a50('0x26')](_0x4081ba)['then'](function(_0x219f34){return _0x219f34;});}return null;};}function removeEntity(_0x33333f,_0x51f153){return function(_0x1e7f1c){if(_0x1e7f1c){return _0x1e7f1c[_0x3a50('0x27')]()[_0x3a50('0x28')](function(){var _0xbd8b18=_0x1e7f1c[_0x3a50('0x29')]({'plain':!![]});var _0xc4adc7=_0x3a50('0x2a');return db[_0x3a50('0x2b')][_0x3a50('0x27')]({'where':{'type':_0xc4adc7,'resourceId':_0xbd8b18['id']}})[_0x3a50('0x28')](function(){return _0x1e7f1c;});})[_0x3a50('0x28')](function(){_0x33333f[_0x3a50('0x1b')](0xcc)[_0x3a50('0x2c')]();});}};}function handleEntityNotFound(_0x267e0b,_0x357298){return function(_0xca5e99){if(!_0xca5e99){_0x267e0b[_0x3a50('0x1a')](0x194);}return _0xca5e99;};}function handleError(_0x253b13,_0x232efd){_0x232efd=_0x232efd||0x1f4;return function(_0x4dc6c8){logger['error'](_0x4dc6c8[_0x3a50('0x2d')]);if(_0x4dc6c8[_0x3a50('0x2e')]){delete _0x4dc6c8[_0x3a50('0x2e')];}_0x253b13['status'](_0x232efd)['send'](_0x4dc6c8);};}exports[_0x3a50('0x2f')]=function(_0x235e7b,_0x7e3dff){var _0x5ae379={},_0x202abc={},_0x119bb7={'count':0x0,'rows':[]};var _0x5f179a=_[_0x3a50('0x30')](db[_0x3a50('0x31')]['rawAttributes'],function(_0xaf4f0f){return{'name':_0xaf4f0f[_0x3a50('0x32')],'type':_0xaf4f0f['type'][_0x3a50('0x33')]};});_0x202abc[_0x3a50('0x34')]=_['map'](_0x5f179a,'name');_0x202abc[_0x3a50('0x35')]=_[_0x3a50('0x36')](_0x235e7b[_0x3a50('0x35')]);_0x202abc[_0x3a50('0x37')]=_['intersection'](_0x202abc['model'],_0x202abc[_0x3a50('0x35')]);_0x5ae379[_0x3a50('0x38')]=_[_0x3a50('0x39')](_0x202abc[_0x3a50('0x34')],qs['fields'](_0x235e7b[_0x3a50('0x35')][_0x3a50('0x3a')]));_0x5ae379[_0x3a50('0x38')]=_0x5ae379[_0x3a50('0x38')][_0x3a50('0x3b')]?_0x5ae379[_0x3a50('0x38')]:_0x202abc['model'];if(!_0x235e7b[_0x3a50('0x35')][_0x3a50('0x3c')](_0x3a50('0x3d'))){_0x5ae379[_0x3a50('0x20')]=qs['limit'](_0x235e7b[_0x3a50('0x35')][_0x3a50('0x20')]);_0x5ae379[_0x3a50('0x1d')]=qs[_0x3a50('0x1d')](_0x235e7b[_0x3a50('0x35')]['offset']);}_0x5ae379[_0x3a50('0x3e')]=qs[_0x3a50('0x3f')](_0x235e7b[_0x3a50('0x35')][_0x3a50('0x3f')]);_0x5ae379['where']=qs['filters'](_['pick'](_0x235e7b[_0x3a50('0x35')],_0x202abc[_0x3a50('0x37')]),_0x5f179a);if(_0x235e7b[_0x3a50('0x35')][_0x3a50('0x40')]){_0x5ae379[_0x3a50('0x41')]=_[_0x3a50('0x42')](_0x5ae379['where'],{'$or':_[_0x3a50('0x30')](_0x5f179a,function(_0x4fee36){if(_0x4fee36[_0x3a50('0x43')]!==_0x3a50('0x44')){var _0x55ddd5={};_0x55ddd5[_0x4fee36[_0x3a50('0x2e')]]={'$like':'%'+_0x235e7b[_0x3a50('0x35')]['filter']+'%'};return _0x55ddd5;}})});}_0x5ae379=_[_0x3a50('0x42')]({},_0x5ae379,_0x235e7b[_0x3a50('0x45')]);var _0x2552b5={'where':_0x5ae379[_0x3a50('0x41')]};return db['Campaign'][_0x3a50('0x1f')](_0x2552b5)[_0x3a50('0x28')](function(_0xd48e4b){_0x119bb7[_0x3a50('0x1f')]=_0xd48e4b;if(_0x235e7b[_0x3a50('0x35')][_0x3a50('0x46')]){_0x5ae379[_0x3a50('0x47')]=[{'all':!![]}];}return db[_0x3a50('0x31')]['findAll'](_0x5ae379);})[_0x3a50('0x28')](function(_0x403b8c){_0x119bb7[_0x3a50('0x48')]=_0x403b8c;return _0x119bb7;})[_0x3a50('0x28')](respondWithFilteredResult(_0x7e3dff,_0x5ae379))[_0x3a50('0x49')](handleError(_0x7e3dff,null));};exports[_0x3a50('0x4a')]=function(_0x5a881b,_0x189f05){var _0x280a75={'raw':![],'where':{'id':_0x5a881b[_0x3a50('0x4b')]['id']}},_0x54c9f9={};_0x54c9f9[_0x3a50('0x34')]=_[_0x3a50('0x36')](db[_0x3a50('0x31')][_0x3a50('0x4c')]);_0x54c9f9[_0x3a50('0x35')]=_['keys'](_0x5a881b[_0x3a50('0x35')]);_0x54c9f9[_0x3a50('0x37')]=_[_0x3a50('0x39')](_0x54c9f9['model'],_0x54c9f9['query']);_0x280a75[_0x3a50('0x38')]=_[_0x3a50('0x39')](_0x54c9f9['model'],qs[_0x3a50('0x3a')](_0x5a881b[_0x3a50('0x35')][_0x3a50('0x3a')]));_0x280a75[_0x3a50('0x38')]=_0x280a75['attributes'][_0x3a50('0x3b')]?_0x280a75[_0x3a50('0x38')]:_0x54c9f9[_0x3a50('0x34')];if(_0x5a881b[_0x3a50('0x35')][_0x3a50('0x46')]){_0x280a75[_0x3a50('0x47')]=[{'all':!![]}];}_0x280a75=_['merge']({},_0x280a75,_0x5a881b[_0x3a50('0x45')]);return db[_0x3a50('0x31')]['find'](_0x280a75)[_0x3a50('0x28')](handleEntityNotFound(_0x189f05,null))[_0x3a50('0x28')](respondWithResult(_0x189f05,null))[_0x3a50('0x49')](handleError(_0x189f05,null));};exports['create']=function(_0x139e7e,_0x341d99){return db['Campaign'][_0x3a50('0x4d')](_0x139e7e['body'],{})[_0x3a50('0x28')](function(_0x241569){var _0x3757d9=_0x139e7e[_0x3a50('0x4e')]['get']({'plain':!![]});if(!_0x3757d9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3757d9[_0x3a50('0x4f')]===_0x3a50('0x4e')){var _0x453901=_0x241569[_0x3a50('0x29')]({'plain':!![]});var _0x78a968='IvrCampaigns';return db[_0x3a50('0x50')][_0x3a50('0x51')]({'where':{'name':_0x78a968,'userProfileId':_0x3757d9[_0x3a50('0x52')]},'raw':!![]})[_0x3a50('0x28')](function(_0x39ce27){if(_0x39ce27&&_0x39ce27[_0x3a50('0x53')]===0x0){return db['UserProfileResource'][_0x3a50('0x4d')]({'name':_0x453901[_0x3a50('0x2e')],'resourceId':_0x453901['id'],'type':_0x39ce27['name'],'sectionId':_0x39ce27['id']},{})[_0x3a50('0x28')](function(){return _0x241569;});}else{return _0x241569;}})[_0x3a50('0x49')](function(_0x5a9a5e){logger[_0x3a50('0x54')](_0x3a50('0x55'),_0x5a9a5e);throw _0x5a9a5e;});}return _0x241569;})[_0x3a50('0x28')](respondWithResult(_0x341d99,0xc9))['catch'](handleError(_0x341d99,null));};exports['clone']=function(_0x33ebad,_0x38535a){var _0x1de526={'where':{'id':_0x33ebad[_0x3a50('0x4b')]['id']}},_0x194529={};_0x194529[_0x3a50('0x34')]=_[_0x3a50('0x36')](db[_0x3a50('0x31')][_0x3a50('0x4c')]);_0x1de526['attributes']=_['intersection'](_0x194529[_0x3a50('0x34')],qs[_0x3a50('0x3a')](_0x33ebad[_0x3a50('0x35')][_0x3a50('0x3a')]));_0x1de526['attributes']=_0x1de526[_0x3a50('0x38')][_0x3a50('0x3b')]?_0x1de526[_0x3a50('0x38')]:_0x194529['model'];if(_0x33ebad[_0x3a50('0x35')][_0x3a50('0x46')]){_0x1de526[_0x3a50('0x47')]=[{'all':!![]}];}_0x1de526=_[_0x3a50('0x42')]({},_0x1de526,_0x33ebad[_0x3a50('0x45')]);return db['Campaign'][_0x3a50('0x51')](_0x1de526)['then'](handleEntityNotFound(_0x38535a,null))[_0x3a50('0x28')](function(_0x4bd89f){if(_0x4bd89f){var _0x5204c5=_0x4bd89f['get']({'plain':!![]});_0x5204c5=qs[_0x3a50('0x56')](_0x5204c5,['id',_0x3a50('0x57'),_0x3a50('0x58')]);_0x33ebad[_0x3a50('0x59')]=_[_0x3a50('0x56')](_0x33ebad[_0x3a50('0x59')],['id',_0x3a50('0x57'),'updatedAt']);return db[_0x3a50('0x31')][_0x3a50('0x4d')](_[_0x3a50('0x42')](_0x5204c5,_0x33ebad[_0x3a50('0x59')]),{'include':_0x33ebad[_0x3a50('0x35')]['includeAll']?[{'all':!![]}]:undefined})[_0x3a50('0x28')](function(_0x2128b8){var _0x710df3=_0x33ebad[_0x3a50('0x4e')]['get']({'plain':!![]});if(!_0x710df3)throw new Error(_0x3a50('0x5a'));if(_0x710df3['role']===_0x3a50('0x4e')){var _0x3d246e=_0x2128b8[_0x3a50('0x29')]({'plain':!![]});var _0x45cc4d=_0x3a50('0x2a');return db['UserProfileSection'][_0x3a50('0x51')]({'where':{'name':_0x45cc4d,'userProfileId':_0x710df3[_0x3a50('0x52')]},'raw':!![]})[_0x3a50('0x28')](function(_0x3eb6f2){if(_0x3eb6f2&&_0x3eb6f2['autoAssociation']===0x0){return db[_0x3a50('0x2b')]['create']({'name':_0x3d246e['name'],'resourceId':_0x3d246e['id'],'type':_0x3eb6f2[_0x3a50('0x2e')],'sectionId':_0x3eb6f2['id']},{})[_0x3a50('0x28')](function(){return _0x2128b8;});}else{return _0x2128b8;}})['catch'](function(_0x4a7d82){logger['error'](_0x3a50('0x55'),_0x4a7d82);throw _0x4a7d82;});}return _0x2128b8;});}})['then'](respondWithResult(_0x38535a,0xc9))[_0x3a50('0x49')](handleError(_0x38535a,null));};exports[_0x3a50('0x26')]=function(_0x2cb0c6,_0x42065a){if(_0x2cb0c6[_0x3a50('0x59')]['id']){delete _0x2cb0c6[_0x3a50('0x59')]['id'];}return db[_0x3a50('0x31')]['find']({'where':{'id':_0x2cb0c6[_0x3a50('0x4b')]['id']}})[_0x3a50('0x28')](handleEntityNotFound(_0x42065a,null))['then'](saveUpdates(_0x2cb0c6[_0x3a50('0x59')],null))[_0x3a50('0x28')](respondWithResult(_0x42065a,null))[_0x3a50('0x49')](handleError(_0x42065a,null));};exports[_0x3a50('0x27')]=function(_0x5b3133,_0x32eb86){return db[_0x3a50('0x31')]['find']({'where':{'id':_0x5b3133['params']['id']}})[_0x3a50('0x28')](handleEntityNotFound(_0x32eb86,null))[_0x3a50('0x28')](removeEntity(_0x32eb86,null))[_0x3a50('0x49')](handleError(_0x32eb86,null));};exports[_0x3a50('0x5b')]=function(_0x4ed915,_0x374795,_0x5071e7){var _0x2fd2ed={'raw':!![],'where':{}};var _0x4b9049={};var _0x21ee47={'count':0x0,'rows':[]};return db['Campaign'][_0x3a50('0x5c')]({'where':{'id':_0x4ed915[_0x3a50('0x4b')]['id']}})['then'](handleEntityNotFound(_0x374795,null))[_0x3a50('0x28')](function(_0x3a688d){if(_0x3a688d){_0x4b9049['model']=_[_0x3a50('0x36')](db['CmHopper'][_0x3a50('0x4c')]);_0x4b9049[_0x3a50('0x35')]=_[_0x3a50('0x36')](_0x4ed915[_0x3a50('0x35')]);_0x4b9049['filters']=_['intersection'](_0x4b9049[_0x3a50('0x34')],_0x4b9049['query']);_0x2fd2ed[_0x3a50('0x38')]=_[_0x3a50('0x39')](_0x4b9049[_0x3a50('0x34')],qs[_0x3a50('0x3a')](_0x4ed915[_0x3a50('0x35')]['fields']));_0x2fd2ed[_0x3a50('0x38')]=_0x2fd2ed[_0x3a50('0x38')][_0x3a50('0x3b')]?_0x2fd2ed[_0x3a50('0x38')]:_0x4b9049[_0x3a50('0x34')];if(!_0x4ed915[_0x3a50('0x35')][_0x3a50('0x3c')](_0x3a50('0x3d'))){_0x2fd2ed[_0x3a50('0x20')]=qs[_0x3a50('0x20')](_0x4ed915[_0x3a50('0x35')]['limit']);_0x2fd2ed[_0x3a50('0x1d')]=qs[_0x3a50('0x1d')](_0x4ed915[_0x3a50('0x35')][_0x3a50('0x1d')]);}_0x2fd2ed[_0x3a50('0x3e')]=qs[_0x3a50('0x3f')](_0x4ed915[_0x3a50('0x35')][_0x3a50('0x3f')]);_0x2fd2ed['where']=qs[_0x3a50('0x37')](_[_0x3a50('0x5d')](_0x4ed915[_0x3a50('0x35')],_0x4b9049[_0x3a50('0x37')]));_0x2fd2ed[_0x3a50('0x41')][_0x3a50('0x5e')]=_0x3a688d['id'];if(_0x4ed915[_0x3a50('0x35')][_0x3a50('0x40')]){_0x2fd2ed['where']=_[_0x3a50('0x42')](_0x2fd2ed[_0x3a50('0x41')],{'$or':_[_0x3a50('0x30')](_0x2fd2ed[_0x3a50('0x38')],function(_0x47ae49){var _0x3a0752={};_0x3a0752[_0x47ae49]={'$like':'%'+_0x4ed915[_0x3a50('0x35')][_0x3a50('0x40')]+'%'};return _0x3a0752;})});}_0x2fd2ed=_[_0x3a50('0x42')]({},_0x2fd2ed,_0x4ed915[_0x3a50('0x45')]);return db[_0x3a50('0x5f')][_0x3a50('0x1f')]({'where':_0x2fd2ed['where']})[_0x3a50('0x28')](function(_0x4a11a3){_0x21ee47[_0x3a50('0x1f')]=_0x4a11a3;if(_0x4ed915[_0x3a50('0x35')][_0x3a50('0x46')]){_0x2fd2ed['include']=[{'all':!![]}];}return db['CmHopper'][_0x3a50('0x60')](_0x2fd2ed);})[_0x3a50('0x28')](function(_0x3d1070){_0x21ee47[_0x3a50('0x48')]=_0x3d1070;return _0x21ee47;});}})[_0x3a50('0x28')](respondWithFilteredResult(_0x374795,_0x2fd2ed))[_0x3a50('0x49')](handleError(_0x374795,null));};exports[_0x3a50('0x61')]=function(_0x5bf52a,_0x39a017,_0x3216c9){var _0x3f9e3f={'raw':!![],'where':{}};var _0x38cbf9={};var _0x8c5094={'count':0x0,'rows':[]};return db[_0x3a50('0x31')][_0x3a50('0x5c')]({'where':{'id':_0x5bf52a['params']['id']}})[_0x3a50('0x28')](handleEntityNotFound(_0x39a017,null))['then'](function(_0x3dafd1){if(_0x3dafd1){_0x38cbf9[_0x3a50('0x34')]=_[_0x3a50('0x36')](db['CmHopperHistory'][_0x3a50('0x4c')]);_0x38cbf9[_0x3a50('0x35')]=_[_0x3a50('0x36')](_0x5bf52a[_0x3a50('0x35')]);_0x38cbf9[_0x3a50('0x37')]=_['intersection'](_0x38cbf9[_0x3a50('0x34')],_0x38cbf9['query']);_0x3f9e3f[_0x3a50('0x38')]=_['intersection'](_0x38cbf9['model'],qs[_0x3a50('0x3a')](_0x5bf52a[_0x3a50('0x35')]['fields']));_0x3f9e3f['attributes']=_0x3f9e3f[_0x3a50('0x38')][_0x3a50('0x3b')]?_0x3f9e3f['attributes']:_0x38cbf9['model'];if(!_0x5bf52a[_0x3a50('0x35')]['hasOwnProperty'](_0x3a50('0x3d'))){_0x3f9e3f['limit']=qs[_0x3a50('0x20')](_0x5bf52a['query'][_0x3a50('0x20')]);_0x3f9e3f[_0x3a50('0x1d')]=qs['offset'](_0x5bf52a[_0x3a50('0x35')][_0x3a50('0x1d')]);}_0x3f9e3f['order']=qs[_0x3a50('0x3f')](_0x5bf52a[_0x3a50('0x35')][_0x3a50('0x3f')]);_0x3f9e3f[_0x3a50('0x41')]=qs[_0x3a50('0x37')](_['pick'](_0x5bf52a[_0x3a50('0x35')],_0x38cbf9['filters']));_0x3f9e3f['where'][_0x3a50('0x5e')]=_0x3dafd1['id'];if(_0x5bf52a[_0x3a50('0x35')][_0x3a50('0x40')]){_0x3f9e3f[_0x3a50('0x41')]=_[_0x3a50('0x42')](_0x3f9e3f[_0x3a50('0x41')],{'$or':_[_0x3a50('0x30')](_0x3f9e3f[_0x3a50('0x38')],function(_0x88e0c8){var _0x581223={};_0x581223[_0x88e0c8]={'$like':'%'+_0x5bf52a[_0x3a50('0x35')][_0x3a50('0x40')]+'%'};return _0x581223;})});}_0x3f9e3f=_['merge']({},_0x3f9e3f,_0x5bf52a['options']);return db[_0x3a50('0x62')][_0x3a50('0x1f')]({'where':_0x3f9e3f['where']})['then'](function(_0x1bdcf3){_0x8c5094[_0x3a50('0x1f')]=_0x1bdcf3;if(_0x5bf52a[_0x3a50('0x35')][_0x3a50('0x46')]){_0x3f9e3f[_0x3a50('0x47')]=[{'all':!![]}];}return db[_0x3a50('0x62')][_0x3a50('0x60')](_0x3f9e3f);})['then'](function(_0x44af97){_0x8c5094[_0x3a50('0x48')]=_0x44af97;return _0x8c5094;});}})[_0x3a50('0x28')](respondWithFilteredResult(_0x39a017,_0x3f9e3f))['catch'](handleError(_0x39a017,null));};exports[_0x3a50('0x63')]=function(_0x1e5057,_0x4009ba,_0x4da9b5){var _0x3a48b3={'raw':!![],'where':{}};var _0x279747={};var _0x557314={'count':0x0,'rows':[]};return db[_0x3a50('0x31')][_0x3a50('0x5c')]({'where':{'id':_0x1e5057['params']['id']}})['then'](handleEntityNotFound(_0x4009ba,null))[_0x3a50('0x28')](function(_0x58454e){if(_0x58454e){_0x279747[_0x3a50('0x34')]=_['keys'](db[_0x3a50('0x64')][_0x3a50('0x4c')]);_0x279747[_0x3a50('0x35')]=_[_0x3a50('0x36')](_0x1e5057[_0x3a50('0x35')]);_0x279747[_0x3a50('0x37')]=_[_0x3a50('0x39')](_0x279747[_0x3a50('0x34')],_0x279747['query']);_0x3a48b3[_0x3a50('0x38')]=_['intersection'](_0x279747[_0x3a50('0x34')],qs[_0x3a50('0x3a')](_0x1e5057[_0x3a50('0x35')]['fields']));_0x3a48b3[_0x3a50('0x38')]=_0x3a48b3['attributes'][_0x3a50('0x3b')]?_0x3a48b3[_0x3a50('0x38')]:_0x279747[_0x3a50('0x34')];if(!_0x1e5057['query'][_0x3a50('0x3c')]('nolimit')){_0x3a48b3[_0x3a50('0x20')]=qs[_0x3a50('0x20')](_0x1e5057[_0x3a50('0x35')][_0x3a50('0x20')]);_0x3a48b3['offset']=qs[_0x3a50('0x1d')](_0x1e5057['query'][_0x3a50('0x1d')]);}_0x3a48b3[_0x3a50('0x3e')]=qs['sort'](_0x1e5057['query'][_0x3a50('0x3f')]);_0x3a48b3[_0x3a50('0x41')]=qs[_0x3a50('0x37')](_[_0x3a50('0x5d')](_0x1e5057[_0x3a50('0x35')],_0x279747[_0x3a50('0x37')]));_0x3a48b3['where'][_0x3a50('0x5e')]=_0x58454e['id'];if(_0x1e5057['query'][_0x3a50('0x40')]){_0x3a48b3[_0x3a50('0x41')]=_[_0x3a50('0x42')](_0x3a48b3[_0x3a50('0x41')],{'$or':_[_0x3a50('0x30')](_0x3a48b3['attributes'],function(_0x5ee7ae){var _0x20fba1={};_0x20fba1[_0x5ee7ae]={'$like':'%'+_0x1e5057[_0x3a50('0x35')][_0x3a50('0x40')]+'%'};return _0x20fba1;})});}_0x3a48b3=_[_0x3a50('0x42')]({},_0x3a48b3,_0x1e5057[_0x3a50('0x45')]);return db[_0x3a50('0x64')][_0x3a50('0x1f')]({'where':_0x3a48b3['where']})['then'](function(_0x2b1fbe){_0x557314['count']=_0x2b1fbe;if(_0x1e5057[_0x3a50('0x35')][_0x3a50('0x46')]){_0x3a48b3[_0x3a50('0x47')]=[{'all':!![]}];}return db[_0x3a50('0x64')][_0x3a50('0x60')](_0x3a48b3);})[_0x3a50('0x28')](function(_0x4e9ab8){_0x557314[_0x3a50('0x48')]=_0x4e9ab8;return _0x557314;});}})[_0x3a50('0x28')](respondWithFilteredResult(_0x4009ba,_0x3a48b3))['catch'](handleError(_0x4009ba,null));};exports[_0x3a50('0x65')]=function(_0x5f4062,_0x21ecc8,_0x2e34b8){var _0x53a62f={'raw':!![],'where':{}};var _0x243890={};var _0x2e8ee6={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x5f4062[_0x3a50('0x4b')]['id']}})[_0x3a50('0x28')](handleEntityNotFound(_0x21ecc8,null))[_0x3a50('0x28')](function(_0x365c8d){if(_0x365c8d){_0x243890[_0x3a50('0x34')]=_[_0x3a50('0x36')](db[_0x3a50('0x66')]['rawAttributes']);_0x243890[_0x3a50('0x35')]=_[_0x3a50('0x36')](_0x5f4062[_0x3a50('0x35')]);_0x243890[_0x3a50('0x37')]=_[_0x3a50('0x39')](_0x243890[_0x3a50('0x34')],_0x243890['query']);_0x53a62f[_0x3a50('0x38')]=_[_0x3a50('0x39')](_0x243890[_0x3a50('0x34')],qs[_0x3a50('0x3a')](_0x5f4062[_0x3a50('0x35')][_0x3a50('0x3a')]));_0x53a62f[_0x3a50('0x38')]=_0x53a62f['attributes'][_0x3a50('0x3b')]?_0x53a62f[_0x3a50('0x38')]:_0x243890[_0x3a50('0x34')];if(!_0x5f4062[_0x3a50('0x35')][_0x3a50('0x3c')](_0x3a50('0x3d'))){_0x53a62f[_0x3a50('0x20')]=qs[_0x3a50('0x20')](_0x5f4062[_0x3a50('0x35')][_0x3a50('0x20')]);_0x53a62f[_0x3a50('0x1d')]=qs['offset'](_0x5f4062[_0x3a50('0x35')][_0x3a50('0x1d')]);}_0x53a62f[_0x3a50('0x3e')]=qs[_0x3a50('0x3f')](_0x5f4062[_0x3a50('0x35')][_0x3a50('0x3f')]);_0x53a62f[_0x3a50('0x41')]=qs[_0x3a50('0x37')](_[_0x3a50('0x5d')](_0x5f4062[_0x3a50('0x35')],_0x243890[_0x3a50('0x37')]));_0x53a62f[_0x3a50('0x41')][_0x3a50('0x5e')]=_0x365c8d['id'];if(_0x5f4062[_0x3a50('0x35')][_0x3a50('0x40')]){_0x53a62f[_0x3a50('0x41')]=_['merge'](_0x53a62f[_0x3a50('0x41')],{'$or':_[_0x3a50('0x30')](_0x53a62f['attributes'],function(_0x538deb){var _0x15c5e6={};_0x15c5e6[_0x538deb]={'$like':'%'+_0x5f4062[_0x3a50('0x35')]['filter']+'%'};return _0x15c5e6;})});}_0x53a62f=_['merge']({},_0x53a62f,_0x5f4062[_0x3a50('0x45')]);return db[_0x3a50('0x66')][_0x3a50('0x1f')]({'where':_0x53a62f[_0x3a50('0x41')]})[_0x3a50('0x28')](function(_0x3d647f){_0x2e8ee6[_0x3a50('0x1f')]=_0x3d647f;if(_0x5f4062[_0x3a50('0x35')][_0x3a50('0x46')]){_0x53a62f['include']=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x53a62f);})['then'](function(_0x155b65){_0x2e8ee6[_0x3a50('0x48')]=_0x155b65;return _0x2e8ee6;});}})[_0x3a50('0x28')](respondWithFilteredResult(_0x21ecc8,_0x53a62f))['catch'](handleError(_0x21ecc8,null));};exports[_0x3a50('0x67')]=function(_0x128de7,_0x566136,_0x9463db){var _0x46d253={};var _0x226fa1={};var _0x4ba626;var _0x18ae63;return db['Campaign']['findOne']({'where':{'id':_0x128de7[_0x3a50('0x4b')]['id']}})[_0x3a50('0x28')](handleEntityNotFound(_0x566136,null))['then'](function(_0x414165){if(_0x414165){_0x4ba626=_0x414165;_0x226fa1['model']=_[_0x3a50('0x36')](db[_0x3a50('0x68')]['rawAttributes']);_0x226fa1[_0x3a50('0x35')]=_[_0x3a50('0x36')](_0x128de7[_0x3a50('0x35')]);_0x226fa1['filters']=_['intersection'](_0x226fa1[_0x3a50('0x34')],_0x226fa1[_0x3a50('0x35')]);_0x46d253[_0x3a50('0x38')]=_[_0x3a50('0x39')](_0x226fa1[_0x3a50('0x34')],qs[_0x3a50('0x3a')](_0x128de7[_0x3a50('0x35')][_0x3a50('0x3a')]));_0x46d253['attributes']=_0x46d253[_0x3a50('0x38')][_0x3a50('0x3b')]?_0x46d253[_0x3a50('0x38')]:_0x226fa1['model'];_0x46d253['order']=qs[_0x3a50('0x3f')](_0x128de7['query'][_0x3a50('0x3f')]);_0x46d253[_0x3a50('0x41')]=qs['filters'](_[_0x3a50('0x5d')](_0x128de7[_0x3a50('0x35')],_0x226fa1[_0x3a50('0x37')]));if(_0x128de7[_0x3a50('0x35')][_0x3a50('0x40')]){_0x46d253[_0x3a50('0x41')]=_[_0x3a50('0x42')](_0x46d253[_0x3a50('0x41')],{'$or':_[_0x3a50('0x30')](_0x46d253[_0x3a50('0x38')],function(_0x36da64){var _0x4bbb7a={};_0x4bbb7a[_0x36da64]={'$like':'%'+_0x128de7[_0x3a50('0x35')][_0x3a50('0x40')]+'%'};return _0x4bbb7a;})});}_0x46d253=_[_0x3a50('0x42')]({},_0x46d253,_0x128de7[_0x3a50('0x45')]);return _0x4ba626[_0x3a50('0x67')](_0x46d253);}})[_0x3a50('0x28')](function(_0x35950f){if(_0x35950f){_0x18ae63=_0x35950f[_0x3a50('0x3b')];if(!_0x128de7['query'][_0x3a50('0x3c')](_0x3a50('0x3d'))){_0x46d253[_0x3a50('0x20')]=qs[_0x3a50('0x20')](_0x128de7['query'][_0x3a50('0x20')]);_0x46d253[_0x3a50('0x1d')]=qs[_0x3a50('0x1d')](_0x128de7['query'][_0x3a50('0x1d')]);}return _0x4ba626[_0x3a50('0x67')](_0x46d253);}})['then'](function(_0x17e6fb){if(_0x17e6fb){return _0x17e6fb?{'count':_0x18ae63,'rows':_0x17e6fb}:null;}})['then'](respondWithResult(_0x566136,null))[_0x3a50('0x49')](handleError(_0x566136,null));};exports[_0x3a50('0x69')]=function(_0x4d8efe,_0x526ee7,_0x1861e4){var _0x192855,_0x5d1c7a;var _0x37cfdd=[];var _0x1ae0d1=moment()[_0x3a50('0x6a')]('YYYY-MM-DD\x20HH:mm:ss');return db['Campaign'][_0x3a50('0x51')]({'where':{'id':_0x4d8efe['params']['id']}})[_0x3a50('0x28')](handleEntityNotFound(_0x526ee7,null))[_0x3a50('0x28')](function(_0x392e20){if(_0x392e20){_0x5d1c7a=_0x392e20;return _0x392e20['addLists'](_0x4d8efe[_0x3a50('0x59')][_0x3a50('0x6b')],_['omit'](_0x4d8efe[_0x3a50('0x59')],[_0x3a50('0x6b'),'id'])||{});}return null;})[_0x3a50('0x6c')](function(_0x246d26){var _0x12f4df;var _0x29a628;_0x192855=_0x246d26||[];var _0x281c68=[];if(_0x246d26){for(var _0x3e6922=0x0;_0x3e6922<_0x246d26[_0x3a50('0x3b')];_0x3e6922+=0x1){var _0xc1c7f9=_0x246d26[_0x3e6922][_0x3a50('0x29')]({'plain':!![]});_0x5d1c7a[_0x3a50('0x6d')]=_0x4d8efe[_0x3a50('0x59')][_0x3a50('0x6d')]?_0x4d8efe[_0x3a50('0x59')][_0x3a50('0x6d')]:_0x5d1c7a[_0x3a50('0x6d')];switch(_0x5d1c7a[_0x3a50('0x6d')]){case'always':_0x12f4df=squel[_0x3a50('0x6e')]()['into'](_0x3a50('0x6f'))[_0x3a50('0x70')](['phone',_0x3a50('0x71'),'ContactId',_0x3a50('0x72'),_0x3a50('0x5e'),_0x3a50('0x57'),_0x3a50('0x58')],squel['select']()[_0x3a50('0x73')](_0x3a50('0x74'),_0x3a50('0x74'))['field'](_0x3a50('0x75'),_0x3a50('0x71'))[_0x3a50('0x73')]('id',_0x3a50('0x76'))[_0x3a50('0x73')](_0xc1c7f9[_0x3a50('0x77')]['toString'](),_0x3a50('0x72'))[_0x3a50('0x73')](_0x4d8efe[_0x3a50('0x4b')]['id'][_0x3a50('0x78')](),_0x3a50('0x5e'))[_0x3a50('0x73')]('\x27'+_0x1ae0d1+'\x27',_0x3a50('0x57'))[_0x3a50('0x73')]('\x27'+_0x1ae0d1+'\x27',_0x3a50('0x58'))[_0x3a50('0x79')](_0x3a50('0x7a'))[_0x3a50('0x41')](_0x3a50('0x7b'))[_0x3a50('0x41')](_0x3a50('0x7c'),_0xc1c7f9['CmListId'][_0x3a50('0x78')]())[_0x3a50('0x41')](_0x3a50('0x7d'))[_0x3a50('0x41')](_0x3a50('0x7e'),squel[_0x3a50('0x7f')]()[_0x3a50('0x73')](_0x3a50('0x80'))[_0x3a50('0x79')](_0x3a50('0x81'))['where'](_0x3a50('0x82'),_0x4d8efe[_0x3a50('0x4b')]['id']['toString']()))[_0x3a50('0x41')]('phone\x20NOT\x20IN\x20(?)',squel[_0x3a50('0x7f')]()[_0x3a50('0x73')]('COALESCE(phone,\x27\x27)')[_0x3a50('0x79')](_0x3a50('0x6f'))['where'](_0x3a50('0x82'),_0x4d8efe[_0x3a50('0x4b')]['id']['toString']())))[_0x3a50('0x78')]();break;case _0x3a50('0x83'):_0x12f4df=squel['insert']()[_0x3a50('0x84')](_0x3a50('0x6f'))[_0x3a50('0x70')]([_0x3a50('0x74'),_0x3a50('0x71'),_0x3a50('0x76'),_0x3a50('0x72'),'CampaignId',_0x3a50('0x57'),_0x3a50('0x58')],squel[_0x3a50('0x7f')]()['field'](_0x3a50('0x74'),_0x3a50('0x74'))['field'](_0x3a50('0x75'),'scheduledAt')[_0x3a50('0x73')]('id','ContactId')[_0x3a50('0x73')](_0xc1c7f9['CmListId'][_0x3a50('0x78')](),'ListId')[_0x3a50('0x73')](_0x4d8efe[_0x3a50('0x4b')]['id'][_0x3a50('0x78')](),'CampaignId')[_0x3a50('0x73')]('\x27'+_0x1ae0d1+'\x27',_0x3a50('0x57'))[_0x3a50('0x73')]('\x27'+_0x1ae0d1+'\x27',_0x3a50('0x58'))['from'](_0x3a50('0x7a'))[_0x3a50('0x41')](_0x3a50('0x7b'))[_0x3a50('0x41')](_0x3a50('0x7c'),_0xc1c7f9[_0x3a50('0x77')][_0x3a50('0x78')]())[_0x3a50('0x41')](_0x3a50('0x7d'))[_0x3a50('0x41')](_0x3a50('0x7e'),squel['select']()[_0x3a50('0x73')](_0x3a50('0x85'))[_0x3a50('0x79')](_0x3a50('0x6f'))['where']('CampaignId\x20=\x20?',_0x4d8efe[_0x3a50('0x4b')]['id'][_0x3a50('0x78')]())))['toString']();break;default:_0x12f4df=squel[_0x3a50('0x6e')]()['into']('cm_hopper')[_0x3a50('0x70')]([_0x3a50('0x74'),_0x3a50('0x71'),_0x3a50('0x76'),_0x3a50('0x72'),_0x3a50('0x5e'),_0x3a50('0x57'),_0x3a50('0x58')],squel[_0x3a50('0x7f')]()[_0x3a50('0x73')](_0x3a50('0x74'),'phone')[_0x3a50('0x73')](_0x3a50('0x75'),_0x3a50('0x71'))[_0x3a50('0x73')]('id',_0x3a50('0x76'))[_0x3a50('0x73')](_0xc1c7f9[_0x3a50('0x77')]['toString'](),'ListId')['field'](_0x4d8efe[_0x3a50('0x4b')]['id'][_0x3a50('0x78')](),_0x3a50('0x5e'))['field']('\x27'+_0x1ae0d1+'\x27',_0x3a50('0x57'))[_0x3a50('0x73')]('\x27'+_0x1ae0d1+'\x27',_0x3a50('0x58'))[_0x3a50('0x79')](_0x3a50('0x7a'))[_0x3a50('0x41')](_0x3a50('0x7b'))['where']('ListId\x20=\x20?',_0xc1c7f9[_0x3a50('0x77')][_0x3a50('0x78')]())[_0x3a50('0x41')](_0x3a50('0x7d')))[_0x3a50('0x78')]();}_0x29a628=squel[_0x3a50('0x6e')]()['into'](_0x3a50('0x86'))[_0x3a50('0x70')]([_0x3a50('0x87'),_0x3a50('0x71'),'phone',_0x3a50('0x88'),_0x3a50('0x57'),'updatedAt'],squel[_0x3a50('0x7f')]()['field'](_0x3a50('0x89'),'id')[_0x3a50('0x73')]('NOW()','scheduledAt')[_0x3a50('0x73')](_0x3a50('0x8a'),_0x3a50('0x74'))['field'](_0x3a50('0x8b'),_0x3a50('0x88'))[_0x3a50('0x73')]('\x27'+_0x1ae0d1+'\x27','createdAt')[_0x3a50('0x73')]('\x27'+_0x1ae0d1+'\x27','updatedAt')[_0x3a50('0x79')]('cm_contact_has_items','ci')[_0x3a50('0x8c')](_0x3a50('0x6f'),'h',_0x3a50('0x8d'))[_0x3a50('0x41')](_0x3a50('0x8e'),_0xc1c7f9[_0x3a50('0x77')][_0x3a50('0x78')]())[_0x3a50('0x41')](_0x3a50('0x8f'),_0x4d8efe['params']['id'][_0x3a50('0x78')]())[_0x3a50('0x41')](_0x3a50('0x90'),_0x1ae0d1))[_0x3a50('0x78')]();_0x281c68[_0x3a50('0x91')](db[_0x3a50('0x92')]['query'](_0x12f4df));_0x37cfdd[_0x3a50('0x91')](db['sequelize'][_0x3a50('0x35')](_0x29a628));}return BPromise[_0x3a50('0x93')](_0x281c68);}})['then'](function(){return BPromise[_0x3a50('0x93')](_0x37cfdd);})[_0x3a50('0x28')](function(){return _0x192855;})[_0x3a50('0x28')](respondWithResult(_0x526ee7,null))[_0x3a50('0x49')](handleError(_0x526ee7,null));};exports[_0x3a50('0x94')]=function(_0x516089,_0x31cad4,_0x4188d4){return db['Campaign']['find']({'where':{'id':_0x516089[_0x3a50('0x4b')]['id']}})[_0x3a50('0x28')](handleEntityNotFound(_0x31cad4,null))[_0x3a50('0x28')](function(_0x46c2da){if(_0x46c2da){return _0x46c2da[_0x3a50('0x94')](_0x516089[_0x3a50('0x35')][_0x3a50('0x6b')]);}})[_0x3a50('0x28')](function(_0xa45573){if(_0xa45573){return db[_0x3a50('0x5f')][_0x3a50('0x27')]({'where':{'ListId':_0x516089[_0x3a50('0x35')][_0x3a50('0x6b')],'CampaignId':_0x516089[_0x3a50('0x4b')]['id']}})['then'](function(){return _0xa45573;});}})[_0x3a50('0x28')](respondWithStatusCode(_0x31cad4,null))[_0x3a50('0x49')](handleError(_0x31cad4,null));};exports['getBlackLists']=function(_0xab39df,_0x59a14f,_0x26018e){var _0x4bbb39={};var _0x4b552d={};var _0x4af0db;var _0x6f29cc;return db[_0x3a50('0x31')][_0x3a50('0x5c')]({'where':{'id':_0xab39df[_0x3a50('0x4b')]['id']}})[_0x3a50('0x28')](handleEntityNotFound(_0x59a14f,null))[_0x3a50('0x28')](function(_0x4da73c){if(_0x4da73c){_0x4af0db=_0x4da73c;_0x4b552d[_0x3a50('0x34')]=_[_0x3a50('0x36')](db[_0x3a50('0x68')][_0x3a50('0x4c')]);_0x4b552d['query']=_['keys'](_0xab39df['query']);_0x4b552d['filters']=_[_0x3a50('0x39')](_0x4b552d['model'],_0x4b552d[_0x3a50('0x35')]);_0x4bbb39[_0x3a50('0x38')]=_['intersection'](_0x4b552d[_0x3a50('0x34')],qs[_0x3a50('0x3a')](_0xab39df[_0x3a50('0x35')]['fields']));_0x4bbb39['attributes']=_0x4bbb39[_0x3a50('0x38')][_0x3a50('0x3b')]?_0x4bbb39['attributes']:_0x4b552d[_0x3a50('0x34')];_0x4bbb39[_0x3a50('0x3e')]=qs[_0x3a50('0x3f')](_0xab39df[_0x3a50('0x35')][_0x3a50('0x3f')]);_0x4bbb39[_0x3a50('0x41')]=qs[_0x3a50('0x37')](_[_0x3a50('0x5d')](_0xab39df[_0x3a50('0x35')],_0x4b552d[_0x3a50('0x37')]));if(_0xab39df[_0x3a50('0x35')][_0x3a50('0x40')]){_0x4bbb39[_0x3a50('0x41')]=_['merge'](_0x4bbb39[_0x3a50('0x41')],{'$or':_[_0x3a50('0x30')](_0x4bbb39[_0x3a50('0x38')],function(_0x10ea04){var _0x303e64={};_0x303e64[_0x10ea04]={'$like':'%'+_0xab39df['query'][_0x3a50('0x40')]+'%'};return _0x303e64;})});}_0x4bbb39=_[_0x3a50('0x42')]({},_0x4bbb39,_0xab39df[_0x3a50('0x45')]);return _0x4af0db['getBlackLists'](_0x4bbb39);}})[_0x3a50('0x28')](function(_0x4ce299){if(_0x4ce299){_0x6f29cc=_0x4ce299[_0x3a50('0x3b')];if(!_0xab39df[_0x3a50('0x35')][_0x3a50('0x3c')](_0x3a50('0x3d'))){_0x4bbb39[_0x3a50('0x20')]=qs['limit'](_0xab39df[_0x3a50('0x35')][_0x3a50('0x20')]);_0x4bbb39['offset']=qs['offset'](_0xab39df['query'][_0x3a50('0x1d')]);}return _0x4af0db['getBlackLists'](_0x4bbb39);}})[_0x3a50('0x28')](function(_0x29ecb7){if(_0x29ecb7){return _0x29ecb7?{'count':_0x6f29cc,'rows':_0x29ecb7}:null;}})[_0x3a50('0x28')](respondWithResult(_0x59a14f,null))['catch'](handleError(_0x59a14f,null));};exports['addBlackLists']=function(_0xd90324,_0x442703,_0x4bd5d8){var _0x355594,_0x4bdd23;var _0x3a8dc1=[];var _0x4a2d08=moment()[_0x3a50('0x6a')](_0x3a50('0x95'));return db['Campaign']['find']({'where':{'id':_0xd90324[_0x3a50('0x4b')]['id']}})['then'](handleEntityNotFound(_0x442703,null))[_0x3a50('0x28')](function(_0x320e34){if(_0x320e34){_0x4bdd23=_0x320e34;return _0x320e34[_0x3a50('0x96')](_0xd90324[_0x3a50('0x59')][_0x3a50('0x6b')],_[_0x3a50('0x56')](_0xd90324[_0x3a50('0x59')],[_0x3a50('0x6b'),'id'])||{});}return null;})[_0x3a50('0x6c')](function(_0x16f4e2){var _0x251423;var _0x5d54b6;_0x355594=_0x16f4e2||[];var _0x5888d2=[];if(_0x16f4e2){for(var _0x53e4e2=0x0;_0x53e4e2<_0x16f4e2[_0x3a50('0x3b')];_0x53e4e2+=0x1){var _0x4b493d=_0x16f4e2[_0x53e4e2]['get']({'plain':!![]});_0x251423=squel['insert']()[_0x3a50('0x84')]('cm_hopper_black')[_0x3a50('0x70')](['phone',_0x3a50('0x76'),_0x3a50('0x72'),_0x3a50('0x5e'),_0x3a50('0x57'),_0x3a50('0x58')],squel[_0x3a50('0x7f')]()[_0x3a50('0x73')](_0x3a50('0x74'),_0x3a50('0x74'))[_0x3a50('0x73')]('id',_0x3a50('0x76'))[_0x3a50('0x73')](_0x4b493d[_0x3a50('0x77')]['toString'](),_0x3a50('0x72'))[_0x3a50('0x73')](_0xd90324[_0x3a50('0x4b')]['id'][_0x3a50('0x78')](),_0x3a50('0x5e'))['field'](_0x3a50('0x75'),_0x3a50('0x57'))['field'](_0x3a50('0x75'),_0x3a50('0x58'))[_0x3a50('0x79')]('cm_contacts')[_0x3a50('0x41')](_0x3a50('0x7b'))[_0x3a50('0x41')](_0x3a50('0x7c'),_0x4b493d[_0x3a50('0x77')]['toString']())[_0x3a50('0x41')]('phone\x20IS\x20NOT\x20NULL'))[_0x3a50('0x78')]();_0x5888d2[_0x3a50('0x91')](db[_0x3a50('0x92')][_0x3a50('0x35')](_0x251423));}return BPromise[_0x3a50('0x93')](_0x5888d2);}})[_0x3a50('0x28')](function(){return _0x355594;})[_0x3a50('0x28')](respondWithResult(_0x442703,null))[_0x3a50('0x49')](handleError(_0x442703,null));};exports[_0x3a50('0x97')]=function(_0x3582cd,_0x288de7,_0x368d0a){return db['Campaign'][_0x3a50('0x51')]({'where':{'id':_0x3582cd[_0x3a50('0x4b')]['id']}})[_0x3a50('0x28')](handleEntityNotFound(_0x288de7,null))['then'](function(_0x30e8de){if(_0x30e8de){return _0x30e8de['removeBlackLists'](_0x3582cd[_0x3a50('0x35')][_0x3a50('0x6b')]);}})['then'](function(_0x3a151e){if(_0x3a151e){return db['CmHopperBlack'][_0x3a50('0x27')]({'where':{'ListId':_0x3582cd['query'][_0x3a50('0x6b')],'CampaignId':_0x3582cd[_0x3a50('0x4b')]['id']}})[_0x3a50('0x28')](function(){return _0x3a151e;});}})[_0x3a50('0x28')](respondWithStatusCode(_0x288de7,null))['catch'](handleError(_0x288de7,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index d945f9b..7ac9983 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(_0x59f638,_0x45a5d0){var _0x348cfc=function(_0x5a5760){while(--_0x5a5760){_0x59f638['push'](_0x59f638['shift']());}};_0x348cfc(++_0x45a5d0);}(_0x7a54,0x106));var _0x47a5=function(_0xd3f3f4,_0x4ebd90){_0xd3f3f4=_0xd3f3f4-0x0;var _0x1b27d9=_0x7a54[_0xd3f3f4];return _0x1b27d9;};'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 _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index 8ebd6ed..3e8f37f 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 _0x80c7=['result','catch','GetCampaign','Campaign','findAll','options','raw','attributes','limit','include','map','model','info','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','Campaign,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x2583a8,_0x4130a5){var _0x51b92a=function(_0x3c6ba0){while(--_0x3c6ba0){_0x2583a8['push'](_0x2583a8['shift']());}};_0x51b92a(++_0x4130a5);}(_0x80c7,0x8d));var _0x780c=function(_0x444a1f,_0x22127b){_0x444a1f=_0x444a1f-0x0;var _0x5dec75=_0x80c7[_0x444a1f];return _0x5dec75;};'use strict';var _=require(_0x780c('0x0'));var util=require(_0x780c('0x1'));var moment=require(_0x780c('0x2'));var BPromise=require(_0x780c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x780c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x780c('0x5'))(_0x780c('0x6'));var config=require(_0x780c('0x7'));var jayson=require(_0x780c('0x8'));var client=jayson[_0x780c('0x9')][_0x780c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4170ef,_0x269976,_0x4041cb){return new BPromise(function(_0x2d858f,_0x1d87ca){return client['request'](_0x4170ef,_0x4041cb)[_0x780c('0xb')](function(_0x3411de){logger['info'](_0x780c('0xc'),_0x269976,_0x780c('0xd'));logger[_0x780c('0xe')]('Campaign,\x20%s,\x20%s,\x20%s',_0x269976,_0x780c('0xd'),JSON[_0x780c('0xf')](_0x3411de));if(_0x3411de[_0x780c('0x10')]){if(_0x3411de[_0x780c('0x10')][_0x780c('0x11')]===0x1f4){logger[_0x780c('0x10')](_0x780c('0xc'),_0x269976,_0x3411de[_0x780c('0x10')][_0x780c('0x12')]);return _0x1d87ca(_0x3411de[_0x780c('0x10')][_0x780c('0x12')]);}logger[_0x780c('0x10')]('Campaign,\x20%s,\x20%s',_0x269976,_0x3411de['error'][_0x780c('0x12')]);return _0x2d858f(_0x3411de[_0x780c('0x10')]['message']);}else{logger['info'](_0x780c('0xc'),_0x269976,_0x780c('0xd'));_0x2d858f(_0x3411de[_0x780c('0x13')][_0x780c('0x12')]);}})[_0x780c('0x14')](function(_0x33c514){logger['error'](_0x780c('0xc'),_0x269976,_0x33c514);_0x1d87ca(_0x33c514);});});}exports[_0x780c('0x15')]=function(_0x2127e2){var _0x2dbcd8=this;return new Promise(function(_0x48e6fe,_0xcd171e){return db[_0x780c('0x16')][_0x780c('0x17')]({'raw':_0x2127e2[_0x780c('0x18')]?_0x2127e2['options'][_0x780c('0x19')]===undefined?!![]:![]:!![],'where':_0x2127e2[_0x780c('0x18')]?_0x2127e2['options']['where']||null:null,'attributes':_0x2127e2['options']?_0x2127e2[_0x780c('0x18')][_0x780c('0x1a')]||null:null,'limit':_0x2127e2[_0x780c('0x18')]?_0x2127e2[_0x780c('0x18')][_0x780c('0x1b')]||null:null,'include':_0x2127e2[_0x780c('0x18')]?_0x2127e2[_0x780c('0x18')][_0x780c('0x1c')]?_[_0x780c('0x1d')](_0x2127e2[_0x780c('0x18')][_0x780c('0x1c')],function(_0x55fc81){return{'model':db[_0x55fc81[_0x780c('0x1e')]],'as':_0x55fc81['as'],'attributes':_0x55fc81[_0x780c('0x1a')],'include':_0x55fc81[_0x780c('0x1c')]?_['map'](_0x55fc81[_0x780c('0x1c')],function(_0x121199){return{'model':db[_0x121199[_0x780c('0x1e')]],'as':_0x121199['as'],'attributes':_0x121199[_0x780c('0x1a')],'include':_0x121199[_0x780c('0x1c')]?_[_0x780c('0x1d')](_0x121199['include'],function(_0x1cb65e){return{'model':db[_0x1cb65e[_0x780c('0x1e')]],'as':_0x1cb65e['as'],'attributes':_0x1cb65e[_0x780c('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2d9702){logger[_0x780c('0x1f')](_0x780c('0x15'),_0x2127e2);logger[_0x780c('0xe')](_0x780c('0x15'),_0x2127e2,JSON[_0x780c('0xf')](_0x2d9702));_0x48e6fe(_0x2d9702);})[_0x780c('0x14')](function(_0x35b97a){logger[_0x780c('0x10')](_0x780c('0x15'),_0x35b97a[_0x780c('0x12')],_0x2127e2);_0xcd171e(_0x2dbcd8[_0x780c('0x10')](0x1f4,_0x35b97a[_0x780c('0x12')]));});});};
\ No newline at end of file
+var _0x2a41=['Campaign,\x20%s,\x20%s','message','result','catch','GetCampaign','Campaign','options','raw','where','limit','map','include','attributes','model','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x56ed36,_0x266cef){var _0x28e12f=function(_0x26d8ed){while(--_0x26d8ed){_0x56ed36['push'](_0x56ed36['shift']());}};_0x28e12f(++_0x266cef);}(_0x2a41,0x126));var _0x12a4=function(_0x51fb3c,_0x28a763){_0x51fb3c=_0x51fb3c-0x0;var _0x941d96=_0x2a41[_0x51fb3c];return _0x941d96;};'use strict';var _=require(_0x12a4('0x0'));var util=require('util');var moment=require(_0x12a4('0x1'));var BPromise=require(_0x12a4('0x2'));var rs=require(_0x12a4('0x3'));var fs=require('fs');var Redis=require(_0x12a4('0x4'));var db=require(_0x12a4('0x5'))['db'];var utils=require(_0x12a4('0x6'));var logger=require(_0x12a4('0x7'))(_0x12a4('0x8'));var config=require(_0x12a4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x12a4('0xa')][_0x12a4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x58fffc,_0x5d2353,_0x2042cc){return new BPromise(function(_0x5ae867,_0x23bb59){return client[_0x12a4('0xc')](_0x58fffc,_0x2042cc)[_0x12a4('0xd')](function(_0x38d894){logger[_0x12a4('0xe')]('Campaign,\x20%s,\x20%s',_0x5d2353,_0x12a4('0xf'));logger[_0x12a4('0x10')](_0x12a4('0x11'),_0x5d2353,_0x12a4('0xf'),JSON[_0x12a4('0x12')](_0x38d894));if(_0x38d894[_0x12a4('0x13')]){if(_0x38d894[_0x12a4('0x13')][_0x12a4('0x14')]===0x1f4){logger[_0x12a4('0x13')](_0x12a4('0x15'),_0x5d2353,_0x38d894[_0x12a4('0x13')][_0x12a4('0x16')]);return _0x23bb59(_0x38d894['error'][_0x12a4('0x16')]);}logger[_0x12a4('0x13')](_0x12a4('0x15'),_0x5d2353,_0x38d894[_0x12a4('0x13')][_0x12a4('0x16')]);return _0x5ae867(_0x38d894['error']['message']);}else{logger[_0x12a4('0xe')](_0x12a4('0x15'),_0x5d2353,_0x12a4('0xf'));_0x5ae867(_0x38d894[_0x12a4('0x17')]['message']);}})[_0x12a4('0x18')](function(_0x28d311){logger[_0x12a4('0x13')](_0x12a4('0x15'),_0x5d2353,_0x28d311);_0x23bb59(_0x28d311);});});}exports[_0x12a4('0x19')]=function(_0xe274e1){var _0x4d7c49=this;return new Promise(function(_0x1a6bbe,_0x3a783c){return db[_0x12a4('0x1a')]['findAll']({'raw':_0xe274e1['options']?_0xe274e1[_0x12a4('0x1b')][_0x12a4('0x1c')]===undefined?!![]:![]:!![],'where':_0xe274e1[_0x12a4('0x1b')]?_0xe274e1[_0x12a4('0x1b')][_0x12a4('0x1d')]||null:null,'attributes':_0xe274e1['options']?_0xe274e1[_0x12a4('0x1b')]['attributes']||null:null,'limit':_0xe274e1[_0x12a4('0x1b')]?_0xe274e1[_0x12a4('0x1b')][_0x12a4('0x1e')]||null:null,'include':_0xe274e1[_0x12a4('0x1b')]?_0xe274e1[_0x12a4('0x1b')]['include']?_[_0x12a4('0x1f')](_0xe274e1[_0x12a4('0x1b')][_0x12a4('0x20')],function(_0x1c4255){return{'model':db[_0x1c4255['model']],'as':_0x1c4255['as'],'attributes':_0x1c4255[_0x12a4('0x21')],'include':_0x1c4255[_0x12a4('0x20')]?_[_0x12a4('0x1f')](_0x1c4255['include'],function(_0x395749){return{'model':db[_0x395749[_0x12a4('0x22')]],'as':_0x395749['as'],'attributes':_0x395749['attributes'],'include':_0x395749[_0x12a4('0x20')]?_[_0x12a4('0x1f')](_0x395749['include'],function(_0x5e952f){return{'model':db[_0x5e952f['model']],'as':_0x5e952f['as'],'attributes':_0x5e952f[_0x12a4('0x21')]};}):[]};}):[]};}):[]:[]})[_0x12a4('0xd')](function(_0x3314da){logger[_0x12a4('0xe')]('GetCampaign',_0xe274e1);logger[_0x12a4('0x10')]('GetCampaign',_0xe274e1,JSON[_0x12a4('0x12')](_0x3314da));_0x1a6bbe(_0x3314da);})[_0x12a4('0x18')](function(_0x377466){logger[_0x12a4('0x13')]('GetCampaign',_0x377466[_0x12a4('0x16')],_0xe274e1);_0x3a783c(_0x4d7c49[_0x12a4('0x13')](0x1f4,_0x377466['message']));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 20c5f5b..43e8ac3 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 _0xce5c=['getHopperBlacks','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','/:id/lists','addLists','addBlackLists','update','delete','destroy','removeLists','exports','multer','path','Router','fs-extra','../../components/auth/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black'];(function(_0x41b1fa,_0x19c954){var _0x1c4822=function(_0xb9e25d){while(--_0xb9e25d){_0x41b1fa['push'](_0x41b1fa['shift']());}};_0x1c4822(++_0x19c954);}(_0xce5c,0x79));var _0xcce5=function(_0x5a60ce,_0x48f080){_0x5a60ce=_0x5a60ce-0x0;var _0x393e5e=_0xce5c[_0x5a60ce];return _0x393e5e;};'use strict';var multer=require(_0xcce5('0x0'));var util=require('util');var path=require(_0xcce5('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xcce5('0x2')]();var fs_extra=require(_0xcce5('0x3'));var auth=require(_0xcce5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xcce5('0x5'));var controller=require(_0xcce5('0x6'));router[_0xcce5('0x7')]('/',auth[_0xcce5('0x8')](),controller[_0xcce5('0x9')]);router[_0xcce5('0x7')](_0xcce5('0xa'),auth[_0xcce5('0x8')](),controller[_0xcce5('0xb')]);router['get'](_0xcce5('0xc'),auth[_0xcce5('0x8')](),controller[_0xcce5('0xd')]);router[_0xcce5('0x7')](_0xcce5('0xe'),auth[_0xcce5('0x8')](),controller[_0xcce5('0xf')]);router[_0xcce5('0x7')](_0xcce5('0x10'),auth[_0xcce5('0x8')](),controller[_0xcce5('0x11')]);router[_0xcce5('0x7')](_0xcce5('0x12'),auth['isAuthenticated'](),controller[_0xcce5('0x13')]);router['get']('/:id/lists',auth[_0xcce5('0x8')](),controller[_0xcce5('0x14')]);router['get'](_0xcce5('0x15'),auth[_0xcce5('0x8')](),controller[_0xcce5('0x16')]);router[_0xcce5('0x17')]('/',auth['isAuthenticated'](),controller[_0xcce5('0x18')]);router[_0xcce5('0x17')](_0xcce5('0x19'),auth[_0xcce5('0x8')](),controller[_0xcce5('0x1a')]);router[_0xcce5('0x17')](_0xcce5('0x1b'),auth[_0xcce5('0x8')](),controller[_0xcce5('0x1c')]);router[_0xcce5('0x17')]('/:id/blacklists',auth[_0xcce5('0x8')](),controller[_0xcce5('0x1d')]);router['put'](_0xcce5('0xa'),auth[_0xcce5('0x8')](),controller[_0xcce5('0x1e')]);router[_0xcce5('0x1f')]('/:id',auth[_0xcce5('0x8')](),controller[_0xcce5('0x20')]);router['delete'](_0xcce5('0x1b'),auth[_0xcce5('0x8')](),controller[_0xcce5('0x21')]);router[_0xcce5('0x1f')](_0xcce5('0x15'),auth[_0xcce5('0x8')](),controller['removeBlackLists']);module[_0xcce5('0x22')]=router;
\ No newline at end of file
+var _0xa16a=['connect-timeout','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','update','delete','destroy','removeLists','/:id/blacklists','removeBlackLists','multer','util','path'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa16a,0x1aa));var _0xaa16=function(_0x8af54b,_0x280be5){_0x8af54b=_0x8af54b-0x0;var _0x27d8f0=_0xa16a[_0x8af54b];return _0x27d8f0;};'use strict';var multer=require(_0xaa16('0x0'));var util=require(_0xaa16('0x1'));var path=require(_0xaa16('0x2'));var timeout=require(_0xaa16('0x3'));var express=require('express');var router=express[_0xaa16('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xaa16('0x5'));var config=require(_0xaa16('0x6'));var controller=require('./campaign.controller');router[_0xaa16('0x7')]('/',auth[_0xaa16('0x8')](),controller[_0xaa16('0x9')]);router['get'](_0xaa16('0xa'),auth[_0xaa16('0x8')](),controller[_0xaa16('0xb')]);router['get'](_0xaa16('0xc'),auth[_0xaa16('0x8')](),controller[_0xaa16('0xd')]);router[_0xaa16('0x7')]('/:id/hopper_histories',auth[_0xaa16('0x8')](),controller['getHopperHistories']);router['get'](_0xaa16('0xe'),auth[_0xaa16('0x8')](),controller[_0xaa16('0xf')]);router[_0xaa16('0x7')](_0xaa16('0x10'),auth[_0xaa16('0x8')](),controller[_0xaa16('0x11')]);router['get'](_0xaa16('0x12'),auth['isAuthenticated'](),controller[_0xaa16('0x13')]);router[_0xaa16('0x7')]('/:id/blacklists',auth[_0xaa16('0x8')](),controller[_0xaa16('0x14')]);router[_0xaa16('0x15')]('/',auth[_0xaa16('0x8')](),controller[_0xaa16('0x16')]);router[_0xaa16('0x15')](_0xaa16('0x17'),auth[_0xaa16('0x8')](),controller[_0xaa16('0x18')]);router[_0xaa16('0x15')]('/:id/lists',auth[_0xaa16('0x8')](),controller[_0xaa16('0x19')]);router[_0xaa16('0x15')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0xaa16('0x1a')]);router['put'](_0xaa16('0xa'),auth[_0xaa16('0x8')](),controller[_0xaa16('0x1b')]);router[_0xaa16('0x1c')](_0xaa16('0xa'),auth['isAuthenticated'](),controller[_0xaa16('0x1d')]);router[_0xaa16('0x1c')]('/:id/lists',auth[_0xaa16('0x8')](),controller[_0xaa16('0x1e')]);router[_0xaa16('0x1c')](_0xaa16('0x1f'),auth[_0xaa16('0x8')](),controller[_0xaa16('0x20')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index bb7c5a9..037c9b7 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 _0x5288=['exports','STRING','TEXT','VIRTUAL','key','sequelize'];(function(_0x5276c6,_0x252a1a){var _0x5825d8=function(_0x1f61cf){while(--_0x1f61cf){_0x5276c6['push'](_0x5276c6['shift']());}};_0x5825d8(++_0x252a1a);}(_0x5288,0x197));var _0x8528=function(_0x59d89e,_0x55edf5){_0x59d89e=_0x59d89e-0x0;var _0x554e93=_0x5288[_0x59d89e];return _0x554e93;};'use strict';var Sequelize=require(_0x8528('0x0'));module[_0x8528('0x1')]={'key':{'type':Sequelize[_0x8528('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x8528('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x8528('0x2')]},'name':{'type':Sequelize[_0x8528('0x4')],'get':function(){return this['getDataValue'](_0x8528('0x5'));}}};
\ No newline at end of file
+var _0x9dcb=['STRING','TEXT','getDataValue','key','sequelize'];(function(_0x2cf2fb,_0x12ab1b){var _0x3d61a4=function(_0x4aa564){while(--_0x4aa564){_0x2cf2fb['push'](_0x2cf2fb['shift']());}};_0x3d61a4(++_0x12ab1b);}(_0x9dcb,0x7c));var _0xb9dc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9dcb[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xb9dc('0x0'));module['exports']={'key':{'type':Sequelize[_0xb9dc('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0xb9dc('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb9dc('0x1')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xb9dc('0x3')](_0xb9dc('0x4'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 08ccf42..3621d7d 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 _0xe7f3=['status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','CannedAnswers','end','error','stack','name','send','index','CannedAnswer','rawAttributes','fieldName','type','model','map','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','includeAll','include','findAll','rows','catch','show','params','keys','find','body','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','get','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus'];(function(_0x15882b,_0xc30d9d){var _0x59612d=function(_0x774f8){while(--_0x774f8){_0x15882b['push'](_0x15882b['shift']());}};_0x59612d(++_0xc30d9d);}(_0xe7f3,0x97));var _0x3e7f=function(_0x492039,_0x487df3){_0x492039=_0x492039-0x0;var _0xf1a5a2=_0xe7f3[_0x492039];return _0xf1a5a2;};'use strict';var emlformat=require(_0x3e7f('0x0'));var rimraf=require(_0x3e7f('0x1'));var zipdir=require(_0x3e7f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3e7f('0x3'));var moment=require('moment');var BPromise=require(_0x3e7f('0x4'));var Mustache=require('mustache');var util=require(_0x3e7f('0x5'));var path=require('path');var sox=require(_0x3e7f('0x6'));var csv=require(_0x3e7f('0x7'));var ejs=require(_0x3e7f('0x8'));var fs=require('fs');var fs_extra=require(_0x3e7f('0x9'));var _=require(_0x3e7f('0xa'));var squel=require(_0x3e7f('0xb'));var crypto=require(_0x3e7f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3e7f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3e7f('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3e7f('0xf'));var qs=require(_0x3e7f('0x10'));var as=require(_0x3e7f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3e7f('0x12'))('api');var utils=require(_0x3e7f('0x13'));var config=require(_0x3e7f('0x14'));var licenseUtil=require(_0x3e7f('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51e0e3,_0x542a5a){_0x542a5a=_0x542a5a||0xcc;return function(_0x3e122f){if(_0x3e122f){return _0x51e0e3[_0x3e7f('0x16')](_0x542a5a);}return _0x51e0e3[_0x3e7f('0x17')](_0x542a5a)['end']();};}function respondWithResult(_0x4d8c34,_0x510d08){_0x510d08=_0x510d08||0xc8;return function(_0xa44d8f){if(_0xa44d8f){return _0x4d8c34[_0x3e7f('0x17')](_0x510d08)[_0x3e7f('0x18')](_0xa44d8f);}};}function respondWithFilteredResult(_0x13a887,_0x45b57e){return function(_0x1b4bd1){if(_0x1b4bd1){var _0x39929b=typeof _0x45b57e['offset']===_0x3e7f('0x19')&&typeof _0x45b57e['limit']===_0x3e7f('0x19');var _0x5c8e4a=_0x1b4bd1[_0x3e7f('0x1a')];var _0x199f83=_0x39929b?0x0:_0x45b57e['offset'];var _0x5e0638=_0x39929b?_0x1b4bd1['count']:_0x45b57e[_0x3e7f('0x1b')]+_0x45b57e[_0x3e7f('0x1c')];var _0x26021a;if(_0x5e0638>=_0x5c8e4a){_0x5e0638=_0x5c8e4a;_0x26021a=0xc8;}else{_0x26021a=0xce;}_0x13a887[_0x3e7f('0x17')](_0x26021a);return _0x13a887[_0x3e7f('0x1d')](_0x3e7f('0x1e'),_0x199f83+'-'+_0x5e0638+'/'+_0x5c8e4a)[_0x3e7f('0x18')](_0x1b4bd1);}return null;};}function patchUpdates(_0x17302d){return function(_0x5e7246){try{jsonpatch[_0x3e7f('0x1f')](_0x5e7246,_0x17302d,!![]);}catch(_0x328edb){return BPromise[_0x3e7f('0x20')](_0x328edb);}return _0x5e7246[_0x3e7f('0x21')]();};}function saveUpdates(_0x2d04b,_0x3c0301){return function(_0x26d477){if(_0x26d477){return _0x26d477[_0x3e7f('0x22')](_0x2d04b)[_0x3e7f('0x23')](function(_0x2b185e){return _0x2b185e;});}return null;};}function removeEntity(_0xdbcce6,_0x5db45c){return function(_0x3ccdfe){if(_0x3ccdfe){return _0x3ccdfe[_0x3e7f('0x24')]()['then'](function(){var _0x660f11=_0x3ccdfe['get']({'plain':!![]});var _0x33e901=_0x3e7f('0x25');return db['UserProfileResource'][_0x3e7f('0x24')]({'where':{'type':_0x33e901,'resourceId':_0x660f11['id']}})[_0x3e7f('0x23')](function(){return _0x3ccdfe;});})[_0x3e7f('0x23')](function(){_0xdbcce6[_0x3e7f('0x17')](0xcc)[_0x3e7f('0x26')]();});}};}function handleEntityNotFound(_0x1cd40c,_0x4c7e30){return function(_0x28eb8e){if(!_0x28eb8e){_0x1cd40c[_0x3e7f('0x16')](0x194);}return _0x28eb8e;};}function handleError(_0x8638ca,_0x55a939){_0x55a939=_0x55a939||0x1f4;return function(_0xe1a67b){logger[_0x3e7f('0x27')](_0xe1a67b[_0x3e7f('0x28')]);if(_0xe1a67b[_0x3e7f('0x29')]){delete _0xe1a67b[_0x3e7f('0x29')];}_0x8638ca[_0x3e7f('0x17')](_0x55a939)[_0x3e7f('0x2a')](_0xe1a67b);};}exports[_0x3e7f('0x2b')]=function(_0xff948f,_0x32109f){var _0x362acc={},_0xeee457={},_0x159aea={'count':0x0,'rows':[]};var _0x51fdb3=_['map'](db[_0x3e7f('0x2c')][_0x3e7f('0x2d')],function(_0x57074d){return{'name':_0x57074d[_0x3e7f('0x2e')],'type':_0x57074d[_0x3e7f('0x2f')]['key']};});_0xeee457[_0x3e7f('0x30')]=_[_0x3e7f('0x31')](_0x51fdb3,_0x3e7f('0x29'));_0xeee457['query']=_['keys'](_0xff948f['query']);_0xeee457['filters']=_[_0x3e7f('0x32')](_0xeee457[_0x3e7f('0x30')],_0xeee457[_0x3e7f('0x33')]);_0x362acc[_0x3e7f('0x34')]=_[_0x3e7f('0x32')](_0xeee457[_0x3e7f('0x30')],qs[_0x3e7f('0x35')](_0xff948f['query'][_0x3e7f('0x35')]));_0x362acc['attributes']=_0x362acc[_0x3e7f('0x34')][_0x3e7f('0x36')]?_0x362acc['attributes']:_0xeee457[_0x3e7f('0x30')];if(!_0xff948f[_0x3e7f('0x33')][_0x3e7f('0x37')](_0x3e7f('0x38'))){_0x362acc[_0x3e7f('0x1c')]=qs['limit'](_0xff948f[_0x3e7f('0x33')]['limit']);_0x362acc[_0x3e7f('0x1b')]=qs[_0x3e7f('0x1b')](_0xff948f['query'][_0x3e7f('0x1b')]);}_0x362acc[_0x3e7f('0x39')]=qs[_0x3e7f('0x3a')](_0xff948f['query'][_0x3e7f('0x3a')]);_0x362acc['where']=qs[_0x3e7f('0x3b')](_['pick'](_0xff948f[_0x3e7f('0x33')],_0xeee457[_0x3e7f('0x3b')]),_0x51fdb3);if(_0xff948f[_0x3e7f('0x33')][_0x3e7f('0x3c')]){_0x362acc[_0x3e7f('0x3d')]=_[_0x3e7f('0x3e')](_0x362acc[_0x3e7f('0x3d')],{'$or':[{'key':{'$like':'%'+_0xff948f[_0x3e7f('0x33')]['filter']+'%'}},{'value':{'$like':'%'+_0xff948f[_0x3e7f('0x33')][_0x3e7f('0x3c')]+'%'}}]});}_0x362acc=_[_0x3e7f('0x3e')]({},_0x362acc,_0xff948f['options']);var _0x1344f4={'where':_0x362acc[_0x3e7f('0x3d')]};return db[_0x3e7f('0x2c')]['count'](_0x1344f4)[_0x3e7f('0x23')](function(_0x201cac){_0x159aea[_0x3e7f('0x1a')]=_0x201cac;if(_0xff948f[_0x3e7f('0x33')][_0x3e7f('0x3f')]){_0x362acc[_0x3e7f('0x40')]=[{'all':!![]}];}return db[_0x3e7f('0x2c')][_0x3e7f('0x41')](_0x362acc);})[_0x3e7f('0x23')](function(_0x17ad0a){_0x159aea[_0x3e7f('0x42')]=_0x17ad0a;return _0x159aea;})[_0x3e7f('0x23')](respondWithFilteredResult(_0x32109f,_0x362acc))[_0x3e7f('0x43')](handleError(_0x32109f,null));};exports[_0x3e7f('0x44')]=function(_0x3e7c08,_0x22cfb0){var _0x52b81b={'raw':!![],'where':{'id':_0x3e7c08[_0x3e7f('0x45')]['id']}},_0x227842={};_0x227842['model']=_['keys'](db[_0x3e7f('0x2c')]['rawAttributes']);_0x227842['query']=_[_0x3e7f('0x46')](_0x3e7c08[_0x3e7f('0x33')]);_0x227842[_0x3e7f('0x3b')]=_['intersection'](_0x227842['model'],_0x227842['query']);_0x52b81b[_0x3e7f('0x34')]=_[_0x3e7f('0x32')](_0x227842[_0x3e7f('0x30')],qs[_0x3e7f('0x35')](_0x3e7c08['query']['fields']));_0x52b81b['attributes']=_0x52b81b[_0x3e7f('0x34')][_0x3e7f('0x36')]?_0x52b81b[_0x3e7f('0x34')]:_0x227842[_0x3e7f('0x30')];if(_0x3e7c08[_0x3e7f('0x33')][_0x3e7f('0x3f')]){_0x52b81b['include']=[{'all':!![]}];}_0x52b81b=_[_0x3e7f('0x3e')]({},_0x52b81b,_0x3e7c08['options']);return db['CannedAnswer'][_0x3e7f('0x47')](_0x52b81b)[_0x3e7f('0x23')](handleEntityNotFound(_0x22cfb0,null))[_0x3e7f('0x23')](respondWithResult(_0x22cfb0,null))['catch'](handleError(_0x22cfb0,null));};exports['update']=function(_0x44f1ec,_0x14a122){if(_0x44f1ec[_0x3e7f('0x48')]['id']){delete _0x44f1ec[_0x3e7f('0x48')]['id'];}return db['CannedAnswer'][_0x3e7f('0x47')]({'where':{'id':_0x44f1ec[_0x3e7f('0x45')]['id']}})[_0x3e7f('0x23')](handleEntityNotFound(_0x14a122,null))['then'](saveUpdates(_0x44f1ec[_0x3e7f('0x48')],null))['then'](respondWithResult(_0x14a122,null))[_0x3e7f('0x43')](handleError(_0x14a122,null));};exports['destroy']=function(_0x515a60,_0x4d83b3){return db[_0x3e7f('0x2c')][_0x3e7f('0x47')]({'where':{'id':_0x515a60['params']['id']}})[_0x3e7f('0x23')](handleEntityNotFound(_0x4d83b3,null))[_0x3e7f('0x23')](removeEntity(_0x4d83b3,null))[_0x3e7f('0x43')](handleError(_0x4d83b3,null));};exports[_0x3e7f('0x49')]=function(_0x42a44c,_0x46a443){var _0x538e37={'key':_0x42a44c[_0x3e7f('0x48')][_0x3e7f('0x4a')]};if(_0x42a44c[_0x3e7f('0x48')][_0x3e7f('0x4b')]){_0x538e37['MailAccountId']=_0x42a44c['body'][_0x3e7f('0x4b')];}else if(_0x42a44c[_0x3e7f('0x48')][_0x3e7f('0x4c')]){_0x538e37[_0x3e7f('0x4c')]=_0x42a44c[_0x3e7f('0x48')]['SmsAccountId'];}else if(_0x42a44c[_0x3e7f('0x48')][_0x3e7f('0x4d')]){_0x538e37[_0x3e7f('0x4d')]=_0x42a44c[_0x3e7f('0x48')]['OpenchannelAccountId'];}else if(_0x42a44c[_0x3e7f('0x48')][_0x3e7f('0x4e')]){_0x538e37[_0x3e7f('0x4e')]=_0x42a44c[_0x3e7f('0x48')][_0x3e7f('0x4e')];}return db[_0x3e7f('0x2c')][_0x3e7f('0x47')]({'where':_0x538e37})[_0x3e7f('0x23')](function(_0x139ae2){if(_0x139ae2){throw new db['Sequelize'][(_0x3e7f('0x4f'))](_0x3e7f('0x50'));}return db[_0x3e7f('0x2c')][_0x3e7f('0x49')](_0x42a44c['body']);})[_0x3e7f('0x23')](function(_0x5a624a){var _0x4bda60=_0x42a44c[_0x3e7f('0x51')][_0x3e7f('0x52')]({'plain':!![]});if(!_0x4bda60)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4bda60[_0x3e7f('0x53')]===_0x3e7f('0x51')){var _0x4ba8e1=_0x5a624a[_0x3e7f('0x52')]({'plain':!![]});return db[_0x3e7f('0x54')]['find']({'where':{'name':_0x3e7f('0x25'),'userProfileId':_0x4bda60[_0x3e7f('0x55')]},'raw':!![]})[_0x3e7f('0x23')](function(_0x2df04e){if(_0x2df04e&&_0x2df04e['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x4ba8e1['name'],'resourceId':_0x4ba8e1['id'],'type':_0x2df04e['name'],'sectionId':_0x2df04e['id']},{})[_0x3e7f('0x23')](function(){return _0x5a624a;});}else{return _0x5a624a;}})[_0x3e7f('0x43')](function(_0x4db259){logger[_0x3e7f('0x27')](_0x3e7f('0x56'),_0x4db259);throw _0x4db259;});}return _0x5a624a;})[_0x3e7f('0x23')](respondWithResult(_0x46a443,0xc9))['catch'](handleError(_0x46a443,null));};
\ No newline at end of file
+var _0xba61=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','get','CannedAnswers','UserProfileResource','destroy','stack','name','send','index','CannedAnswer','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','body','find','catch','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError'];(function(_0x1b00c4,_0x2dbab6){var _0x4dd3d5=function(_0x34e5b7){while(--_0x34e5b7){_0x1b00c4['push'](_0x1b00c4['shift']());}};_0x4dd3d5(++_0x2dbab6);}(_0xba61,0x115));var _0x1ba6=function(_0x46be00,_0x439bbf){_0x46be00=_0x46be00-0x0;var _0x46ec29=_0xba61[_0x46be00];return _0x46ec29;};'use strict';var emlformat=require(_0x1ba6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1ba6('0x1'));var jsonpatch=require(_0x1ba6('0x2'));var rp=require(_0x1ba6('0x3'));var moment=require(_0x1ba6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1ba6('0x5'));var util=require(_0x1ba6('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x1ba6('0x7'));var ejs=require(_0x1ba6('0x8'));var fs=require('fs');var fs_extra=require(_0x1ba6('0x9'));var _=require(_0x1ba6('0xa'));var squel=require('squel');var crypto=require(_0x1ba6('0xb'));var jsforce=require(_0x1ba6('0xc'));var deskjs=require(_0x1ba6('0xd'));var toCsv=require(_0x1ba6('0x7'));var querystring=require('querystring');var Papa=require(_0x1ba6('0xe'));var Redis=require('ioredis');var authService=require(_0x1ba6('0xf'));var qs=require(_0x1ba6('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1ba6('0x11'));var logger=require(_0x1ba6('0x12'))(_0x1ba6('0x13'));var utils=require(_0x1ba6('0x14'));var config=require(_0x1ba6('0x15'));var licenseUtil=require(_0x1ba6('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x58d6e5,_0xaf3307){_0xaf3307=_0xaf3307||0xcc;return function(_0x5493d3){if(_0x5493d3){return _0x58d6e5['sendStatus'](_0xaf3307);}return _0x58d6e5[_0x1ba6('0x17')](_0xaf3307)[_0x1ba6('0x18')]();};}function respondWithResult(_0x4e8438,_0xdcf6f4){_0xdcf6f4=_0xdcf6f4||0xc8;return function(_0x1ac1a9){if(_0x1ac1a9){return _0x4e8438[_0x1ba6('0x17')](_0xdcf6f4)[_0x1ba6('0x19')](_0x1ac1a9);}};}function respondWithFilteredResult(_0x362a48,_0x254460){return function(_0x1a25ef){if(_0x1a25ef){var _0x1f995e=typeof _0x254460[_0x1ba6('0x1a')]===_0x1ba6('0x1b')&&typeof _0x254460['limit']===_0x1ba6('0x1b');var _0x4bc451=_0x1a25ef['count'];var _0x3d7958=_0x1f995e?0x0:_0x254460['offset'];var _0x30999f=_0x1f995e?_0x1a25ef[_0x1ba6('0x1c')]:_0x254460[_0x1ba6('0x1a')]+_0x254460[_0x1ba6('0x1d')];var _0x108203;if(_0x30999f>=_0x4bc451){_0x30999f=_0x4bc451;_0x108203=0xc8;}else{_0x108203=0xce;}_0x362a48[_0x1ba6('0x17')](_0x108203);return _0x362a48[_0x1ba6('0x1e')](_0x1ba6('0x1f'),_0x3d7958+'-'+_0x30999f+'/'+_0x4bc451)[_0x1ba6('0x19')](_0x1a25ef);}return null;};}function patchUpdates(_0x57c21c){return function(_0x3e849e){try{jsonpatch[_0x1ba6('0x20')](_0x3e849e,_0x57c21c,!![]);}catch(_0x3ef371){return BPromise[_0x1ba6('0x21')](_0x3ef371);}return _0x3e849e[_0x1ba6('0x22')]();};}function saveUpdates(_0x228351,_0xfbdae8){return function(_0x1152b6){if(_0x1152b6){return _0x1152b6['update'](_0x228351)['then'](function(_0x5a6c79){return _0x5a6c79;});}return null;};}function removeEntity(_0x6153f8,_0x26dab9){return function(_0xff88e4){if(_0xff88e4){return _0xff88e4['destroy']()[_0x1ba6('0x23')](function(){var _0xc969b8=_0xff88e4[_0x1ba6('0x24')]({'plain':!![]});var _0x4f227d=_0x1ba6('0x25');return db[_0x1ba6('0x26')][_0x1ba6('0x27')]({'where':{'type':_0x4f227d,'resourceId':_0xc969b8['id']}})['then'](function(){return _0xff88e4;});})[_0x1ba6('0x23')](function(){_0x6153f8[_0x1ba6('0x17')](0xcc)[_0x1ba6('0x18')]();});}};}function handleEntityNotFound(_0x4ace8d,_0x2e3bf9){return function(_0x58b8bd){if(!_0x58b8bd){_0x4ace8d['sendStatus'](0x194);}return _0x58b8bd;};}function handleError(_0x2ccaf8,_0x5912a7){_0x5912a7=_0x5912a7||0x1f4;return function(_0x20b996){logger['error'](_0x20b996[_0x1ba6('0x28')]);if(_0x20b996[_0x1ba6('0x29')]){delete _0x20b996[_0x1ba6('0x29')];}_0x2ccaf8['status'](_0x5912a7)[_0x1ba6('0x2a')](_0x20b996);};}exports[_0x1ba6('0x2b')]=function(_0x2a38eb,_0x3578e3){var _0x5cfdb2={},_0x566a76={},_0x12d699={'count':0x0,'rows':[]};var _0x300ac7=_['map'](db[_0x1ba6('0x2c')][_0x1ba6('0x2d')],function(_0x5a805b){return{'name':_0x5a805b[_0x1ba6('0x2e')],'type':_0x5a805b[_0x1ba6('0x2f')][_0x1ba6('0x30')]};});_0x566a76[_0x1ba6('0x31')]=_[_0x1ba6('0x32')](_0x300ac7,_0x1ba6('0x29'));_0x566a76[_0x1ba6('0x33')]=_[_0x1ba6('0x34')](_0x2a38eb[_0x1ba6('0x33')]);_0x566a76[_0x1ba6('0x35')]=_[_0x1ba6('0x36')](_0x566a76['model'],_0x566a76[_0x1ba6('0x33')]);_0x5cfdb2['attributes']=_['intersection'](_0x566a76['model'],qs[_0x1ba6('0x37')](_0x2a38eb['query'][_0x1ba6('0x37')]));_0x5cfdb2[_0x1ba6('0x38')]=_0x5cfdb2[_0x1ba6('0x38')][_0x1ba6('0x39')]?_0x5cfdb2[_0x1ba6('0x38')]:_0x566a76['model'];if(!_0x2a38eb[_0x1ba6('0x33')][_0x1ba6('0x3a')](_0x1ba6('0x3b'))){_0x5cfdb2['limit']=qs[_0x1ba6('0x1d')](_0x2a38eb[_0x1ba6('0x33')][_0x1ba6('0x1d')]);_0x5cfdb2[_0x1ba6('0x1a')]=qs[_0x1ba6('0x1a')](_0x2a38eb[_0x1ba6('0x33')][_0x1ba6('0x1a')]);}_0x5cfdb2[_0x1ba6('0x3c')]=qs[_0x1ba6('0x3d')](_0x2a38eb[_0x1ba6('0x33')][_0x1ba6('0x3d')]);_0x5cfdb2[_0x1ba6('0x3e')]=qs[_0x1ba6('0x35')](_[_0x1ba6('0x3f')](_0x2a38eb[_0x1ba6('0x33')],_0x566a76[_0x1ba6('0x35')]),_0x300ac7);if(_0x2a38eb[_0x1ba6('0x33')][_0x1ba6('0x40')]){_0x5cfdb2['where']=_[_0x1ba6('0x41')](_0x5cfdb2[_0x1ba6('0x3e')],{'$or':[{'key':{'$like':'%'+_0x2a38eb[_0x1ba6('0x33')][_0x1ba6('0x40')]+'%'}},{'value':{'$like':'%'+_0x2a38eb['query']['filter']+'%'}}]});}_0x5cfdb2=_['merge']({},_0x5cfdb2,_0x2a38eb[_0x1ba6('0x42')]);var _0x1e1fd8={'where':_0x5cfdb2[_0x1ba6('0x3e')]};return db[_0x1ba6('0x2c')][_0x1ba6('0x1c')](_0x1e1fd8)[_0x1ba6('0x23')](function(_0x575bd1){_0x12d699['count']=_0x575bd1;if(_0x2a38eb[_0x1ba6('0x33')][_0x1ba6('0x43')]){_0x5cfdb2[_0x1ba6('0x44')]=[{'all':!![]}];}return db['CannedAnswer'][_0x1ba6('0x45')](_0x5cfdb2);})[_0x1ba6('0x23')](function(_0x40dc16){_0x12d699[_0x1ba6('0x46')]=_0x40dc16;return _0x12d699;})[_0x1ba6('0x23')](respondWithFilteredResult(_0x3578e3,_0x5cfdb2))['catch'](handleError(_0x3578e3,null));};exports[_0x1ba6('0x47')]=function(_0x3af051,_0x12ecd2){var _0xc5b64d={'raw':!![],'where':{'id':_0x3af051[_0x1ba6('0x48')]['id']}},_0x53cb6f={};_0x53cb6f[_0x1ba6('0x31')]=_[_0x1ba6('0x34')](db[_0x1ba6('0x2c')][_0x1ba6('0x2d')]);_0x53cb6f[_0x1ba6('0x33')]=_[_0x1ba6('0x34')](_0x3af051[_0x1ba6('0x33')]);_0x53cb6f[_0x1ba6('0x35')]=_[_0x1ba6('0x36')](_0x53cb6f[_0x1ba6('0x31')],_0x53cb6f[_0x1ba6('0x33')]);_0xc5b64d[_0x1ba6('0x38')]=_[_0x1ba6('0x36')](_0x53cb6f['model'],qs[_0x1ba6('0x37')](_0x3af051['query'][_0x1ba6('0x37')]));_0xc5b64d[_0x1ba6('0x38')]=_0xc5b64d[_0x1ba6('0x38')][_0x1ba6('0x39')]?_0xc5b64d['attributes']:_0x53cb6f[_0x1ba6('0x31')];if(_0x3af051[_0x1ba6('0x33')][_0x1ba6('0x43')]){_0xc5b64d[_0x1ba6('0x44')]=[{'all':!![]}];}_0xc5b64d=_[_0x1ba6('0x41')]({},_0xc5b64d,_0x3af051[_0x1ba6('0x42')]);return db[_0x1ba6('0x2c')]['find'](_0xc5b64d)[_0x1ba6('0x23')](handleEntityNotFound(_0x12ecd2,null))[_0x1ba6('0x23')](respondWithResult(_0x12ecd2,null))['catch'](handleError(_0x12ecd2,null));};exports['update']=function(_0x45c1a0,_0x30f519){if(_0x45c1a0[_0x1ba6('0x49')]['id']){delete _0x45c1a0[_0x1ba6('0x49')]['id'];}return db[_0x1ba6('0x2c')][_0x1ba6('0x4a')]({'where':{'id':_0x45c1a0[_0x1ba6('0x48')]['id']}})[_0x1ba6('0x23')](handleEntityNotFound(_0x30f519,null))['then'](saveUpdates(_0x45c1a0['body'],null))[_0x1ba6('0x23')](respondWithResult(_0x30f519,null))[_0x1ba6('0x4b')](handleError(_0x30f519,null));};exports[_0x1ba6('0x27')]=function(_0x1605e2,_0xa6339f){return db['CannedAnswer'][_0x1ba6('0x4a')]({'where':{'id':_0x1605e2[_0x1ba6('0x48')]['id']}})[_0x1ba6('0x23')](handleEntityNotFound(_0xa6339f,null))[_0x1ba6('0x23')](removeEntity(_0xa6339f,null))[_0x1ba6('0x4b')](handleError(_0xa6339f,null));};exports[_0x1ba6('0x4c')]=function(_0x5592ff,_0x18d728){var _0x3f5efa={'key':_0x5592ff[_0x1ba6('0x49')][_0x1ba6('0x30')]};if(_0x5592ff['body'][_0x1ba6('0x4d')]){_0x3f5efa['MailAccountId']=_0x5592ff[_0x1ba6('0x49')]['MailAccountId'];}else if(_0x5592ff[_0x1ba6('0x49')][_0x1ba6('0x4e')]){_0x3f5efa[_0x1ba6('0x4e')]=_0x5592ff[_0x1ba6('0x49')][_0x1ba6('0x4e')];}else if(_0x5592ff['body'][_0x1ba6('0x4f')]){_0x3f5efa[_0x1ba6('0x4f')]=_0x5592ff[_0x1ba6('0x49')][_0x1ba6('0x4f')];}else if(_0x5592ff[_0x1ba6('0x49')]['ChatWebsiteId']){_0x3f5efa[_0x1ba6('0x50')]=_0x5592ff[_0x1ba6('0x49')][_0x1ba6('0x50')];}return db[_0x1ba6('0x2c')]['find']({'where':_0x3f5efa})['then'](function(_0x23e750){if(_0x23e750){throw new db[(_0x1ba6('0x51'))][(_0x1ba6('0x52'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x1ba6('0x2c')][_0x1ba6('0x4c')](_0x5592ff[_0x1ba6('0x49')]);})['then'](function(_0x3c98a8){var _0x1e277a=_0x5592ff[_0x1ba6('0x53')]['get']({'plain':!![]});if(!_0x1e277a)throw new Error(_0x1ba6('0x54'));if(_0x1e277a[_0x1ba6('0x55')]===_0x1ba6('0x53')){var _0x292cd9=_0x3c98a8[_0x1ba6('0x24')]({'plain':!![]});return db[_0x1ba6('0x56')][_0x1ba6('0x4a')]({'where':{'name':_0x1ba6('0x25'),'userProfileId':_0x1e277a[_0x1ba6('0x57')]},'raw':!![]})[_0x1ba6('0x23')](function(_0x57ef5){if(_0x57ef5&&_0x57ef5[_0x1ba6('0x58')]===0x0){return db[_0x1ba6('0x26')][_0x1ba6('0x4c')]({'name':_0x292cd9[_0x1ba6('0x29')],'resourceId':_0x292cd9['id'],'type':_0x57ef5['name'],'sectionId':_0x57ef5['id']},{})['then'](function(){return _0x3c98a8;});}else{return _0x3c98a8;}})['catch'](function(_0x47e6dd){logger['error'](_0x1ba6('0x59'),_0x47e6dd);throw _0x47e6dd;});}return _0x3c98a8;})[_0x1ba6('0x23')](respondWithResult(_0x18d728,0xc9))[_0x1ba6('0x4b')](handleError(_0x18d728,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 34ba175..e0fe474 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 _0x5e29=['./cannedAnswer.attributes','exports','CannedAnswer','tools_canned_answers','utf8mb4','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x5e29,0x149));var _0x95e2=function(_0x57caf0,_0x1fe145){_0x57caf0=_0x57caf0-0x0;var _0x65d871=_0x5e29[_0x57caf0];return _0x65d871;};'use strict';var _=require(_0x95e2('0x0'));var util=require('util');var logger=require(_0x95e2('0x1'))('api');var moment=require(_0x95e2('0x2'));var BPromise=require(_0x95e2('0x3'));var rp=require(_0x95e2('0x4'));var fs=require('fs');var path=require(_0x95e2('0x5'));var rimraf=require(_0x95e2('0x6'));var config=require('../../config/environment');var attributes=require(_0x95e2('0x7'));module[_0x95e2('0x8')]=function(_0x3ba9d3,_0x1373d6){return _0x3ba9d3['define'](_0x95e2('0x9'),attributes,{'tableName':_0x95e2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x95e2('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xb139=['lodash','util','api','moment','bluebird','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci'];(function(_0x441f7a,_0x576321){var _0x4821da=function(_0x5c5b52){while(--_0x5c5b52){_0x441f7a['push'](_0x441f7a['shift']());}};_0x4821da(++_0x576321);}(_0xb139,0x1ba));var _0x9b13=function(_0xf27012,_0x94a86f){_0xf27012=_0xf27012-0x0;var _0x23ce26=_0xb139[_0xf27012];return _0x23ce26;};'use strict';var _=require(_0x9b13('0x0'));var util=require(_0x9b13('0x1'));var logger=require('../../config/logger')(_0x9b13('0x2'));var moment=require(_0x9b13('0x3'));var BPromise=require(_0x9b13('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9b13('0x5'));var attributes=require(_0x9b13('0x6'));module[_0x9b13('0x7')]=function(_0x57c7a5,_0x3cb126){return _0x57c7a5[_0x9b13('0x8')](_0x9b13('0x9'),attributes,{'tableName':_0x9b13('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9b13('0xb'),'collate':_0x9b13('0xc')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 39d4ae1..9407ba5 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(_0x1ad31b,_0x50da64){var _0x17f2f0=function(_0x5483b6){while(--_0x5483b6){_0x1ad31b['push'](_0x1ad31b['shift']());}};_0x17f2f0(++_0x50da64);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'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(_0x5822bc,_0x39d45e){var _0x4fa8ca=function(_0x17cffa){while(--_0x17cffa){_0x5822bc['push'](_0x5822bc['shift']());}};_0x4fa8ca(++_0x39d45e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js
index a92e274..9f019d9 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 _0x9dbc=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x938c4e,_0x2fa5ca){var _0x2bb9a9=function(_0x3a2a61){while(--_0x3a2a61){_0x938c4e['push'](_0x938c4e['shift']());}};_0x2bb9a9(++_0x2fa5ca);}(_0x9dbc,0xc1));var _0xc9db=function(_0xcc1266,_0x27ba6d){_0xcc1266=_0xcc1266-0x0;var _0x34e46a=_0x9dbc[_0xcc1266];return _0x34e46a;};'use strict';var multer=require(_0xc9db('0x0'));var util=require(_0xc9db('0x1'));var path=require(_0xc9db('0x2'));var timeout=require(_0xc9db('0x3'));var express=require(_0xc9db('0x4'));var router=express[_0xc9db('0x5')]();var fs_extra=require(_0xc9db('0x6'));var auth=require(_0xc9db('0x7'));var interaction=require(_0xc9db('0x8'));var config=require(_0xc9db('0x9'));var controller=require('./cannedAnswer.controller');router[_0xc9db('0xa')]('/',auth[_0xc9db('0xb')](),controller[_0xc9db('0xc')]);router[_0xc9db('0xa')](_0xc9db('0xd'),auth[_0xc9db('0xb')](),controller['show']);router[_0xc9db('0xe')]('/',auth[_0xc9db('0xb')](),controller[_0xc9db('0xf')]);router[_0xc9db('0x10')]('/:id',auth[_0xc9db('0xb')](),controller[_0xc9db('0x11')]);router['delete']('/:id',auth[_0xc9db('0xb')](),controller[_0xc9db('0x12')]);module[_0xc9db('0x13')]=router;
\ No newline at end of file
+var _0x4a49=['post','put','update','delete','destroy','exports','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show'];(function(_0x577c7c,_0x314381){var _0x56b1d4=function(_0xf97b2d){while(--_0xf97b2d){_0x577c7c['push'](_0x577c7c['shift']());}};_0x56b1d4(++_0x314381);}(_0x4a49,0x180));var _0x94a4=function(_0x10d99f,_0x2a560b){_0x10d99f=_0x10d99f-0x0;var _0x1afb16=_0x4a49[_0x10d99f];return _0x1afb16;};'use strict';var multer=require('multer');var util=require(_0x94a4('0x0'));var path=require(_0x94a4('0x1'));var timeout=require(_0x94a4('0x2'));var express=require(_0x94a4('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x94a4('0x4'));var config=require(_0x94a4('0x5'));var controller=require(_0x94a4('0x6'));router[_0x94a4('0x7')]('/',auth[_0x94a4('0x8')](),controller[_0x94a4('0x9')]);router[_0x94a4('0x7')](_0x94a4('0xa'),auth['isAuthenticated'](),controller[_0x94a4('0xb')]);router[_0x94a4('0xc')]('/',auth[_0x94a4('0x8')](),controller['create']);router[_0x94a4('0xd')](_0x94a4('0xa'),auth['isAuthenticated'](),controller[_0x94a4('0xe')]);router[_0x94a4('0xf')](_0x94a4('0xa'),auth[_0x94a4('0x8')](),controller[_0x94a4('0x10')]);module[_0x94a4('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index bca494b..f7597a7 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 _0x7217=['INTEGER','DATE','STRING'];(function(_0x2fe487,_0x2b78f6){var _0x250916=function(_0x4b9a0c){while(--_0x4b9a0c){_0x2fe487['push'](_0x2fe487['shift']());}};_0x250916(++_0x2b78f6);}(_0x7217,0xa9));var _0x7721=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x7217[_0x187ee1];return _0x388160;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize[_0x7721('0x0')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x7721('0x1')]},'src':{'type':Sequelize[_0x7721('0x1')]},'dst':{'type':Sequelize[_0x7721('0x1')]},'dcontext':{'type':Sequelize[_0x7721('0x1')]},'channel':{'type':Sequelize[_0x7721('0x1')]},'dstchannel':{'type':Sequelize[_0x7721('0x1')]},'lastapp':{'type':Sequelize[_0x7721('0x1')]},'lastdata':{'type':Sequelize[_0x7721('0x1')]},'duration':{'type':Sequelize[_0x7721('0x2')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x7721('0x2')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x7721('0x2')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x7721('0x1')]},'userfield':{'type':Sequelize[_0x7721('0x1')]},'uniqueid':{'type':Sequelize[_0x7721('0x1')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x7721('0x1')]},'peeraccount':{'type':Sequelize[_0x7721('0x1')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x7721('0x1')]}};
\ No newline at end of file
+var _0x47c0=['INTEGER','sequelize','exports','DATE','STRING'];(function(_0x342700,_0x569f75){var _0x53406f=function(_0x3b3c32){while(--_0x3b3c32){_0x342700['push'](_0x342700['shift']());}};_0x53406f(++_0x569f75);}(_0x47c0,0x1dc));var _0x047c=function(_0x255083,_0x3d687f){_0x255083=_0x255083-0x0;var _0x3fc668=_0x47c0[_0x255083];return _0x3fc668;};'use strict';var Sequelize=require(_0x047c('0x0'));module[_0x047c('0x1')]={'calldate':{'type':Sequelize[_0x047c('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x047c('0x3')]},'src':{'type':Sequelize[_0x047c('0x3')]},'dst':{'type':Sequelize[_0x047c('0x3')]},'dcontext':{'type':Sequelize[_0x047c('0x3')]},'channel':{'type':Sequelize[_0x047c('0x3')]},'dstchannel':{'type':Sequelize[_0x047c('0x3')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x047c('0x3')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x047c('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x047c('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x047c('0x3')]},'userfield':{'type':Sequelize[_0x047c('0x3')]},'uniqueid':{'type':Sequelize[_0x047c('0x3')]},'linkedid':{'type':Sequelize[_0x047c('0x3')]},'sequence':{'type':Sequelize[_0x047c('0x3')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x047c('0x3')]},'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 d8cca91..00b94fb 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 _0xcb81=['save','then','destroy','error','stack','name','send','index','Cdr','rawAttributes','type','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','create','body','update','params','describe','eml-format','rimraf','fast-json-patch','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject'];(function(_0x57e648,_0x2d8f7e){var _0x3edc8f=function(_0x426502){while(--_0x426502){_0x57e648['push'](_0x57e648['shift']());}};_0x3edc8f(++_0x2d8f7e);}(_0xcb81,0x154));var _0x1cb8=function(_0x2440fe,_0x281a11){_0x2440fe=_0x2440fe-0x0;var _0x5cf734=_0xcb81[_0x2440fe];return _0x5cf734;};'use strict';var emlformat=require(_0x1cb8('0x0'));var rimraf=require(_0x1cb8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1cb8('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1cb8('0x3'));var util=require(_0x1cb8('0x4'));var path=require(_0x1cb8('0x5'));var sox=require(_0x1cb8('0x6'));var csv=require(_0x1cb8('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1cb8('0x8'));var _=require(_0x1cb8('0x9'));var squel=require('squel');var crypto=require(_0x1cb8('0xa'));var jsforce=require(_0x1cb8('0xb'));var deskjs=require(_0x1cb8('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1cb8('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1cb8('0xe'));var qs=require(_0x1cb8('0xf'));var as=require(_0x1cb8('0x10'));var hardwareService=require(_0x1cb8('0x11'));var logger=require(_0x1cb8('0x12'))(_0x1cb8('0x13'));var utils=require(_0x1cb8('0x14'));var config=require(_0x1cb8('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x1cb8('0x16'))['db'];function respondWithStatusCode(_0x1ffe94,_0x1938ee){_0x1938ee=_0x1938ee||0xcc;return function(_0x299eea){if(_0x299eea){return _0x1ffe94[_0x1cb8('0x17')](_0x1938ee);}return _0x1ffe94['status'](_0x1938ee)[_0x1cb8('0x18')]();};}function respondWithResult(_0x2c600,_0xcb6ad1){_0xcb6ad1=_0xcb6ad1||0xc8;return function(_0x14d84d){if(_0x14d84d){return _0x2c600[_0x1cb8('0x19')](_0xcb6ad1)[_0x1cb8('0x1a')](_0x14d84d);}};}function respondWithFilteredResult(_0x339ad0,_0x243930){return function(_0x5af4a3){if(_0x5af4a3){var _0x17a95d=typeof _0x243930['offset']===_0x1cb8('0x1b')&&typeof _0x243930[_0x1cb8('0x1c')]===_0x1cb8('0x1b');var _0x46abd0=_0x5af4a3[_0x1cb8('0x1d')];var _0x308088=_0x17a95d?0x0:_0x243930[_0x1cb8('0x1e')];var _0x9f0adb=_0x17a95d?_0x5af4a3[_0x1cb8('0x1d')]:_0x243930[_0x1cb8('0x1e')]+_0x243930[_0x1cb8('0x1c')];var _0x3cda27;if(_0x9f0adb>=_0x46abd0){_0x9f0adb=_0x46abd0;_0x3cda27=0xc8;}else{_0x3cda27=0xce;}_0x339ad0['status'](_0x3cda27);return _0x339ad0[_0x1cb8('0x1f')](_0x1cb8('0x20'),_0x308088+'-'+_0x9f0adb+'/'+_0x46abd0)[_0x1cb8('0x1a')](_0x5af4a3);}return null;};}function patchUpdates(_0x3d1682){return function(_0x4abf3a){try{jsonpatch[_0x1cb8('0x21')](_0x4abf3a,_0x3d1682,!![]);}catch(_0x4f9220){return BPromise[_0x1cb8('0x22')](_0x4f9220);}return _0x4abf3a[_0x1cb8('0x23')]();};}function saveUpdates(_0x40b914,_0x38ff3a){return function(_0x559916){if(_0x559916){return _0x559916['update'](_0x40b914)[_0x1cb8('0x24')](function(_0x4040be){return _0x4040be;});}return null;};}function removeEntity(_0x22dafe,_0x44a00d){return function(_0x2473b8){if(_0x2473b8){return _0x2473b8[_0x1cb8('0x25')]()[_0x1cb8('0x24')](function(){_0x22dafe['status'](0xcc)[_0x1cb8('0x18')]();});}};}function handleEntityNotFound(_0x4554d5,_0x35c890){return function(_0xeeb21d){if(!_0xeeb21d){_0x4554d5[_0x1cb8('0x17')](0x194);}return _0xeeb21d;};}function handleError(_0x41ab56,_0x4ca3be){_0x4ca3be=_0x4ca3be||0x1f4;return function(_0x1ec995){logger[_0x1cb8('0x26')](_0x1ec995[_0x1cb8('0x27')]);if(_0x1ec995[_0x1cb8('0x28')]){delete _0x1ec995[_0x1cb8('0x28')];}_0x41ab56['status'](_0x4ca3be)[_0x1cb8('0x29')](_0x1ec995);};}exports[_0x1cb8('0x2a')]=function(_0x3a8b53,_0x21c17a){var _0x4fda96={},_0x2a79e0={},_0x2ba8c8={'count':0x0,'rows':[]};var _0x3a6a67=_['map'](db[_0x1cb8('0x2b')][_0x1cb8('0x2c')],function(_0x17abe1){return{'name':_0x17abe1['fieldName'],'type':_0x17abe1[_0x1cb8('0x2d')][_0x1cb8('0x2e')]};});_0x2a79e0[_0x1cb8('0x2f')]=_[_0x1cb8('0x30')](_0x3a6a67,_0x1cb8('0x28'));_0x2a79e0['query']=_[_0x1cb8('0x31')](_0x3a8b53[_0x1cb8('0x32')]);_0x2a79e0[_0x1cb8('0x33')]=_[_0x1cb8('0x34')](_0x2a79e0[_0x1cb8('0x2f')],_0x2a79e0[_0x1cb8('0x32')]);_0x4fda96[_0x1cb8('0x35')]=_[_0x1cb8('0x34')](_0x2a79e0[_0x1cb8('0x2f')],qs['fields'](_0x3a8b53['query'][_0x1cb8('0x36')]));_0x4fda96[_0x1cb8('0x35')]=_0x4fda96[_0x1cb8('0x35')]['length']?_0x4fda96['attributes']:_0x2a79e0[_0x1cb8('0x2f')];if(!_0x3a8b53[_0x1cb8('0x32')][_0x1cb8('0x37')](_0x1cb8('0x38'))){_0x4fda96[_0x1cb8('0x1c')]=qs[_0x1cb8('0x1c')](_0x3a8b53[_0x1cb8('0x32')][_0x1cb8('0x1c')]);_0x4fda96['offset']=qs[_0x1cb8('0x1e')](_0x3a8b53[_0x1cb8('0x32')][_0x1cb8('0x1e')]);}_0x4fda96[_0x1cb8('0x39')]=qs[_0x1cb8('0x3a')](_0x3a8b53[_0x1cb8('0x32')][_0x1cb8('0x3a')]);_0x4fda96[_0x1cb8('0x3b')]=qs[_0x1cb8('0x33')](_['pick'](_0x3a8b53[_0x1cb8('0x32')],_0x2a79e0[_0x1cb8('0x33')]),_0x3a6a67);if(_0x3a8b53['query'][_0x1cb8('0x3c')]){_0x4fda96[_0x1cb8('0x3b')]=_[_0x1cb8('0x3d')](_0x4fda96[_0x1cb8('0x3b')],{'$or':_[_0x1cb8('0x30')](_0x3a6a67,function(_0x5dc4c0){if(_0x5dc4c0[_0x1cb8('0x2d')]!==_0x1cb8('0x3e')){var _0x2989c6={};_0x2989c6[_0x5dc4c0['name']]={'$like':'%'+_0x3a8b53['query']['filter']+'%'};return _0x2989c6;}})});}_0x4fda96=_[_0x1cb8('0x3d')]({},_0x4fda96,_0x3a8b53[_0x1cb8('0x3f')]);var _0x328f7e={'where':_0x4fda96[_0x1cb8('0x3b')]};return db['Cdr']['count'](_0x328f7e)[_0x1cb8('0x24')](function(_0x25f0a3){_0x2ba8c8[_0x1cb8('0x1d')]=_0x25f0a3;if(_0x3a8b53[_0x1cb8('0x32')][_0x1cb8('0x40')]){_0x4fda96[_0x1cb8('0x41')]=[{'all':!![]}];}return db[_0x1cb8('0x2b')][_0x1cb8('0x42')](_0x4fda96);})['then'](function(_0x2044d1){_0x2ba8c8[_0x1cb8('0x43')]=_0x2044d1;return _0x2ba8c8;})[_0x1cb8('0x24')](respondWithFilteredResult(_0x21c17a,_0x4fda96))[_0x1cb8('0x44')](handleError(_0x21c17a,null));};exports['show']=function(_0x156298,_0x47c18a){var _0x2060a6={'raw':!![],'where':{'id':_0x156298['params']['id']}},_0x37230e={};_0x37230e[_0x1cb8('0x2f')]=_[_0x1cb8('0x31')](db[_0x1cb8('0x2b')]['rawAttributes']);_0x37230e['query']=_[_0x1cb8('0x31')](_0x156298['query']);_0x37230e[_0x1cb8('0x33')]=_[_0x1cb8('0x34')](_0x37230e[_0x1cb8('0x2f')],_0x37230e[_0x1cb8('0x32')]);_0x2060a6[_0x1cb8('0x35')]=_[_0x1cb8('0x34')](_0x37230e[_0x1cb8('0x2f')],qs['fields'](_0x156298[_0x1cb8('0x32')][_0x1cb8('0x36')]));_0x2060a6[_0x1cb8('0x35')]=_0x2060a6[_0x1cb8('0x35')]['length']?_0x2060a6[_0x1cb8('0x35')]:_0x37230e[_0x1cb8('0x2f')];if(_0x156298[_0x1cb8('0x32')][_0x1cb8('0x40')]){_0x2060a6[_0x1cb8('0x41')]=[{'all':!![]}];}_0x2060a6=_['merge']({},_0x2060a6,_0x156298[_0x1cb8('0x3f')]);return db[_0x1cb8('0x2b')][_0x1cb8('0x45')](_0x2060a6)[_0x1cb8('0x24')](handleEntityNotFound(_0x47c18a,null))[_0x1cb8('0x24')](respondWithResult(_0x47c18a,null))['catch'](handleError(_0x47c18a,null));};exports[_0x1cb8('0x46')]=function(_0x3a4ec4,_0x5598b1){return db[_0x1cb8('0x2b')][_0x1cb8('0x46')](_0x3a4ec4[_0x1cb8('0x47')],{})[_0x1cb8('0x24')](respondWithResult(_0x5598b1,0xc9))[_0x1cb8('0x44')](handleError(_0x5598b1,null));};exports[_0x1cb8('0x48')]=function(_0x3b063c,_0x219541){if(_0x3b063c[_0x1cb8('0x47')]['id']){delete _0x3b063c[_0x1cb8('0x47')]['id'];}return db[_0x1cb8('0x2b')][_0x1cb8('0x45')]({'where':{'id':_0x3b063c[_0x1cb8('0x49')]['id']}})[_0x1cb8('0x24')](handleEntityNotFound(_0x219541,null))['then'](saveUpdates(_0x3b063c[_0x1cb8('0x47')],null))[_0x1cb8('0x24')](respondWithResult(_0x219541,null))[_0x1cb8('0x44')](handleError(_0x219541,null));};exports[_0x1cb8('0x25')]=function(_0x21aba7,_0x15f0ba){return db[_0x1cb8('0x2b')]['find']({'where':{'id':_0x21aba7[_0x1cb8('0x49')]['id']}})[_0x1cb8('0x24')](handleEntityNotFound(_0x15f0ba,null))[_0x1cb8('0x24')](removeEntity(_0x15f0ba,null))['catch'](handleError(_0x15f0ba,null));};exports['describe']=function(_0x1c12aa,_0x42cc81){return db[_0x1cb8('0x2b')][_0x1cb8('0x4a')]()[_0x1cb8('0x24')](respondWithResult(_0x42cc81,null))['catch'](handleError(_0x42cc81,null));};
\ No newline at end of file
+var _0xda19=['rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','Cdr','includeAll','findAll','catch','show','body','find','params','describe'];(function(_0x3fd9ce,_0x4b1fbe){var _0x3618d9=function(_0x35438d){while(--_0x35438d){_0x3fd9ce['push'](_0x3fd9ce['shift']());}};_0x3618d9(++_0x4b1fbe);}(_0xda19,0xd5));var _0x9da1=function(_0xbbcd48,_0x287535){_0xbbcd48=_0xbbcd48-0x0;var _0x4f4c00=_0xda19[_0xbbcd48];return _0x4f4c00;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9da1('0x0'));var zipdir=require(_0x9da1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9da1('0x2'));var moment=require('moment');var BPromise=require(_0x9da1('0x3'));var Mustache=require('mustache');var util=require(_0x9da1('0x4'));var path=require(_0x9da1('0x5'));var sox=require(_0x9da1('0x6'));var csv=require(_0x9da1('0x7'));var ejs=require(_0x9da1('0x8'));var fs=require('fs');var fs_extra=require(_0x9da1('0x9'));var _=require(_0x9da1('0xa'));var squel=require(_0x9da1('0xb'));var crypto=require(_0x9da1('0xc'));var jsforce=require(_0x9da1('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9da1('0xe'));var Redis=require('ioredis');var authService=require(_0x9da1('0xf'));var qs=require(_0x9da1('0x10'));var as=require(_0x9da1('0x11'));var hardwareService=require(_0x9da1('0x12'));var logger=require(_0x9da1('0x13'))(_0x9da1('0x14'));var utils=require(_0x9da1('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9da1('0x16'))['db'];function respondWithStatusCode(_0x596b6b,_0x4735c7){_0x4735c7=_0x4735c7||0xcc;return function(_0x1d93f8){if(_0x1d93f8){return _0x596b6b[_0x9da1('0x17')](_0x4735c7);}return _0x596b6b[_0x9da1('0x18')](_0x4735c7)['end']();};}function respondWithResult(_0x2837e3,_0x535a13){_0x535a13=_0x535a13||0xc8;return function(_0x4d17e1){if(_0x4d17e1){return _0x2837e3[_0x9da1('0x18')](_0x535a13)['json'](_0x4d17e1);}};}function respondWithFilteredResult(_0x433ff4,_0x43c093){return function(_0x37653d){if(_0x37653d){var _0x1a1a6b=typeof _0x43c093[_0x9da1('0x19')]==='undefined'&&typeof _0x43c093[_0x9da1('0x1a')]===_0x9da1('0x1b');var _0xf83bf8=_0x37653d[_0x9da1('0x1c')];var _0xfb278d=_0x1a1a6b?0x0:_0x43c093[_0x9da1('0x19')];var _0x497676=_0x1a1a6b?_0x37653d['count']:_0x43c093[_0x9da1('0x19')]+_0x43c093[_0x9da1('0x1a')];var _0x1b0e7f;if(_0x497676>=_0xf83bf8){_0x497676=_0xf83bf8;_0x1b0e7f=0xc8;}else{_0x1b0e7f=0xce;}_0x433ff4[_0x9da1('0x18')](_0x1b0e7f);return _0x433ff4[_0x9da1('0x1d')](_0x9da1('0x1e'),_0xfb278d+'-'+_0x497676+'/'+_0xf83bf8)[_0x9da1('0x1f')](_0x37653d);}return null;};}function patchUpdates(_0x47e5cf){return function(_0x1a459c){try{jsonpatch[_0x9da1('0x20')](_0x1a459c,_0x47e5cf,!![]);}catch(_0x9c3b37){return BPromise[_0x9da1('0x21')](_0x9c3b37);}return _0x1a459c[_0x9da1('0x22')]();};}function saveUpdates(_0x4e9d7d,_0x5454d3){return function(_0x14793b){if(_0x14793b){return _0x14793b[_0x9da1('0x23')](_0x4e9d7d)[_0x9da1('0x24')](function(_0x330219){return _0x330219;});}return null;};}function removeEntity(_0x32eb55,_0x165b73){return function(_0x4c60aa){if(_0x4c60aa){return _0x4c60aa[_0x9da1('0x25')]()[_0x9da1('0x24')](function(){_0x32eb55['status'](0xcc)[_0x9da1('0x26')]();});}};}function handleEntityNotFound(_0x3f5680,_0x534210){return function(_0x2fd49c){if(!_0x2fd49c){_0x3f5680[_0x9da1('0x17')](0x194);}return _0x2fd49c;};}function handleError(_0x4b1152,_0x36b87a){_0x36b87a=_0x36b87a||0x1f4;return function(_0x1d6af5){logger['error'](_0x1d6af5['stack']);if(_0x1d6af5[_0x9da1('0x27')]){delete _0x1d6af5[_0x9da1('0x27')];}_0x4b1152['status'](_0x36b87a)[_0x9da1('0x28')](_0x1d6af5);};}exports['index']=function(_0x5a6f2d,_0x5a59c2){var _0x31b826={},_0x404b86={},_0x24c6d5={'count':0x0,'rows':[]};var _0x26dd58=_[_0x9da1('0x29')](db['Cdr'][_0x9da1('0x2a')],function(_0x4e6083){return{'name':_0x4e6083[_0x9da1('0x2b')],'type':_0x4e6083[_0x9da1('0x2c')]['key']};});_0x404b86[_0x9da1('0x2d')]=_[_0x9da1('0x29')](_0x26dd58,'name');_0x404b86[_0x9da1('0x2e')]=_[_0x9da1('0x2f')](_0x5a6f2d[_0x9da1('0x2e')]);_0x404b86[_0x9da1('0x30')]=_['intersection'](_0x404b86['model'],_0x404b86[_0x9da1('0x2e')]);_0x31b826[_0x9da1('0x31')]=_[_0x9da1('0x32')](_0x404b86[_0x9da1('0x2d')],qs[_0x9da1('0x33')](_0x5a6f2d['query'][_0x9da1('0x33')]));_0x31b826[_0x9da1('0x31')]=_0x31b826[_0x9da1('0x31')][_0x9da1('0x34')]?_0x31b826[_0x9da1('0x31')]:_0x404b86[_0x9da1('0x2d')];if(!_0x5a6f2d['query'][_0x9da1('0x35')]('nolimit')){_0x31b826['limit']=qs[_0x9da1('0x1a')](_0x5a6f2d['query'][_0x9da1('0x1a')]);_0x31b826[_0x9da1('0x19')]=qs[_0x9da1('0x19')](_0x5a6f2d[_0x9da1('0x2e')][_0x9da1('0x19')]);}_0x31b826[_0x9da1('0x36')]=qs[_0x9da1('0x37')](_0x5a6f2d[_0x9da1('0x2e')]['sort']);_0x31b826[_0x9da1('0x38')]=qs['filters'](_[_0x9da1('0x39')](_0x5a6f2d['query'],_0x404b86['filters']),_0x26dd58);if(_0x5a6f2d[_0x9da1('0x2e')]['filter']){_0x31b826[_0x9da1('0x38')]=_[_0x9da1('0x3a')](_0x31b826['where'],{'$or':_[_0x9da1('0x29')](_0x26dd58,function(_0x1b750f){if(_0x1b750f[_0x9da1('0x2c')]!==_0x9da1('0x3b')){var _0x56bd49={};_0x56bd49[_0x1b750f[_0x9da1('0x27')]]={'$like':'%'+_0x5a6f2d['query'][_0x9da1('0x3c')]+'%'};return _0x56bd49;}})});}_0x31b826=_['merge']({},_0x31b826,_0x5a6f2d[_0x9da1('0x3d')]);var _0x46c176={'where':_0x31b826['where']};return db[_0x9da1('0x3e')][_0x9da1('0x1c')](_0x46c176)[_0x9da1('0x24')](function(_0x4e9af3){_0x24c6d5['count']=_0x4e9af3;if(_0x5a6f2d['query'][_0x9da1('0x3f')]){_0x31b826['include']=[{'all':!![]}];}return db[_0x9da1('0x3e')][_0x9da1('0x40')](_0x31b826);})[_0x9da1('0x24')](function(_0x43c064){_0x24c6d5['rows']=_0x43c064;return _0x24c6d5;})[_0x9da1('0x24')](respondWithFilteredResult(_0x5a59c2,_0x31b826))[_0x9da1('0x41')](handleError(_0x5a59c2,null));};exports[_0x9da1('0x42')]=function(_0x173dc6,_0x28fc88){var _0x26c225={'raw':!![],'where':{'id':_0x173dc6['params']['id']}},_0x28e0b2={};_0x28e0b2[_0x9da1('0x2d')]=_['keys'](db[_0x9da1('0x3e')]['rawAttributes']);_0x28e0b2[_0x9da1('0x2e')]=_[_0x9da1('0x2f')](_0x173dc6['query']);_0x28e0b2[_0x9da1('0x30')]=_[_0x9da1('0x32')](_0x28e0b2['model'],_0x28e0b2[_0x9da1('0x2e')]);_0x26c225['attributes']=_[_0x9da1('0x32')](_0x28e0b2[_0x9da1('0x2d')],qs['fields'](_0x173dc6['query'][_0x9da1('0x33')]));_0x26c225[_0x9da1('0x31')]=_0x26c225[_0x9da1('0x31')][_0x9da1('0x34')]?_0x26c225[_0x9da1('0x31')]:_0x28e0b2[_0x9da1('0x2d')];if(_0x173dc6[_0x9da1('0x2e')][_0x9da1('0x3f')]){_0x26c225['include']=[{'all':!![]}];}_0x26c225=_[_0x9da1('0x3a')]({},_0x26c225,_0x173dc6[_0x9da1('0x3d')]);return db[_0x9da1('0x3e')]['find'](_0x26c225)[_0x9da1('0x24')](handleEntityNotFound(_0x28fc88,null))[_0x9da1('0x24')](respondWithResult(_0x28fc88,null))[_0x9da1('0x41')](handleError(_0x28fc88,null));};exports['create']=function(_0x336fc3,_0x351d4d){return db[_0x9da1('0x3e')]['create'](_0x336fc3[_0x9da1('0x43')],{})['then'](respondWithResult(_0x351d4d,0xc9))['catch'](handleError(_0x351d4d,null));};exports[_0x9da1('0x23')]=function(_0x43c47d,_0x5afbc7){if(_0x43c47d[_0x9da1('0x43')]['id']){delete _0x43c47d[_0x9da1('0x43')]['id'];}return db['Cdr'][_0x9da1('0x44')]({'where':{'id':_0x43c47d[_0x9da1('0x45')]['id']}})[_0x9da1('0x24')](handleEntityNotFound(_0x5afbc7,null))[_0x9da1('0x24')](saveUpdates(_0x43c47d[_0x9da1('0x43')],null))[_0x9da1('0x24')](respondWithResult(_0x5afbc7,null))[_0x9da1('0x41')](handleError(_0x5afbc7,null));};exports[_0x9da1('0x25')]=function(_0x3889f4,_0x5c9b46){return db[_0x9da1('0x3e')][_0x9da1('0x44')]({'where':{'id':_0x3889f4[_0x9da1('0x45')]['id']}})[_0x9da1('0x24')](handleEntityNotFound(_0x5c9b46,null))['then'](removeEntity(_0x5c9b46,null))['catch'](handleError(_0x5c9b46,null));};exports[_0x9da1('0x46')]=function(_0x6ca1ac,_0x3870dd){return db[_0x9da1('0x3e')][_0x9da1('0x46')]()[_0x9da1('0x24')](respondWithResult(_0x3870dd,null))[_0x9da1('0x41')](handleError(_0x3870dd,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index d2c887a..923a772 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x52c27d,_0xda4996){var _0x3e712a=function(_0x4bc790){while(--_0x4bc790){_0x52c27d['push'](_0x52c27d['shift']());}};_0x3e712a(++_0xda4996);}(_0x7a54,0x106));var _0x47a5=function(_0x1ffa19,_0x143952){_0x1ffa19=_0x1ffa19-0x0;var _0x125b11=_0x7a54[_0x1ffa19];return _0x125b11;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x36965d,_0x370b7c){var _0x461fec=function(_0x5e8d04){while(--_0x5e8d04){_0x36965d['push'](_0x36965d['shift']());}};_0x461fec(++_0x370b7c);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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 10dc045..a9e9a05 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 _0xecdd=['Cdr,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info'];(function(_0x2a1445,_0x5d2b8d){var _0x5ec7f4=function(_0x54492a){while(--_0x54492a){_0x2a1445['push'](_0x2a1445['shift']());}};_0x5ec7f4(++_0x5d2b8d);}(_0xecdd,0x169));var _0xdecd=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xecdd[_0x4ea69d];return _0x5318e0;};'use strict';var _=require('lodash');var util=require(_0xdecd('0x0'));var moment=require(_0xdecd('0x1'));var BPromise=require('bluebird');var rs=require(_0xdecd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdecd('0x3'))['db'];var utils=require(_0xdecd('0x4'));var logger=require(_0xdecd('0x5'))(_0xdecd('0x6'));var config=require(_0xdecd('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xdecd('0x8')][_0xdecd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x28537c,_0x535609,_0x213407){return new BPromise(function(_0x582899,_0x4302e8){return client[_0xdecd('0xa')](_0x28537c,_0x213407)[_0xdecd('0xb')](function(_0x122a36){logger[_0xdecd('0xc')](_0xdecd('0xd'),_0x535609,_0xdecd('0xe'));logger[_0xdecd('0xf')]('Cdr,\x20%s,\x20%s,\x20%s',_0x535609,_0xdecd('0xe'),JSON[_0xdecd('0x10')](_0x122a36));if(_0x122a36['error']){if(_0x122a36[_0xdecd('0x11')][_0xdecd('0x12')]===0x1f4){logger[_0xdecd('0x11')]('Cdr,\x20%s,\x20%s',_0x535609,_0x122a36[_0xdecd('0x11')]['message']);return _0x4302e8(_0x122a36[_0xdecd('0x11')][_0xdecd('0x13')]);}logger['error'](_0xdecd('0xd'),_0x535609,_0x122a36[_0xdecd('0x11')]['message']);return _0x582899(_0x122a36[_0xdecd('0x11')][_0xdecd('0x13')]);}else{logger[_0xdecd('0xc')](_0xdecd('0xd'),_0x535609,_0xdecd('0xe'));_0x582899(_0x122a36[_0xdecd('0x14')][_0xdecd('0x13')]);}})[_0xdecd('0x15')](function(_0xc014a3){logger[_0xdecd('0x11')](_0xdecd('0xd'),_0x535609,_0xc014a3);_0x4302e8(_0xc014a3);});});}
\ No newline at end of file
+var _0xbfb4=['error','Cdr,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x16c996,_0x23b8b5){var _0x43e961=function(_0x5dec9d){while(--_0x5dec9d){_0x16c996['push'](_0x16c996['shift']());}};_0x43e961(++_0x23b8b5);}(_0xbfb4,0x165));var _0x4bfb=function(_0x40a778,_0x298f10){_0x40a778=_0x40a778-0x0;var _0x4ee87e=_0xbfb4[_0x40a778];return _0x4ee87e;};'use strict';var _=require('lodash');var util=require(_0x4bfb('0x0'));var moment=require(_0x4bfb('0x1'));var BPromise=require('bluebird');var rs=require(_0x4bfb('0x2'));var fs=require('fs');var Redis=require(_0x4bfb('0x3'));var db=require(_0x4bfb('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4bfb('0x5'))(_0x4bfb('0x6'));var config=require(_0x4bfb('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4bfb('0x8')][_0x4bfb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55562f,_0xa93e38,_0x37b8f8){return new BPromise(function(_0x1bcfd7,_0x5c28d1){return client[_0x4bfb('0xa')](_0x55562f,_0x37b8f8)[_0x4bfb('0xb')](function(_0x51a243){logger[_0x4bfb('0xc')]('Cdr,\x20%s,\x20%s',_0xa93e38,_0x4bfb('0xd'));logger[_0x4bfb('0xe')](_0x4bfb('0xf'),_0xa93e38,'request\x20sent',JSON[_0x4bfb('0x10')](_0x51a243));if(_0x51a243[_0x4bfb('0x11')]){if(_0x51a243['error']['code']===0x1f4){logger[_0x4bfb('0x11')](_0x4bfb('0x12'),_0xa93e38,_0x51a243[_0x4bfb('0x11')][_0x4bfb('0x13')]);return _0x5c28d1(_0x51a243['error']['message']);}logger[_0x4bfb('0x11')](_0x4bfb('0x12'),_0xa93e38,_0x51a243[_0x4bfb('0x11')][_0x4bfb('0x13')]);return _0x1bcfd7(_0x51a243[_0x4bfb('0x11')][_0x4bfb('0x13')]);}else{logger['info'](_0x4bfb('0x12'),_0xa93e38,'request\x20sent');_0x1bcfd7(_0x51a243[_0x4bfb('0x14')]['message']);}})[_0x4bfb('0x15')](function(_0x230256){logger[_0x4bfb('0x11')](_0x4bfb('0x12'),_0xa93e38,_0x230256);_0x5c28d1(_0x230256);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index e322466..bdfd412 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(_0x1f808f,_0x172b10){var _0x282348=function(_0xfa8c2){while(--_0xfa8c2){_0x1f808f['push'](_0x1f808f['shift']());}};_0x282348(++_0x172b10);}(_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 _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 10536ea..cd0db5c 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 _0xbd13=['*,*,*,*','sequelize','exports','noop','TEXT','STRING'];(function(_0x352d28,_0x444033){var _0x387d7e=function(_0x40be0e){while(--_0x40be0e){_0x352d28['push'](_0x352d28['shift']());}};_0x387d7e(++_0x444033);}(_0xbd13,0xc7));var _0x3bd1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbd13[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3bd1('0x0'));module[_0x3bd1('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3bd1('0x2')},'appdata':{'type':Sequelize[_0x3bd1('0x3')]()},'description':{'type':Sequelize[_0x3bd1('0x4')]},'interval':{'type':Sequelize[_0x3bd1('0x4')],'defaultValue':_0x3bd1('0x5')}};
\ No newline at end of file
+var _0x6e8f=['exports','INTEGER','STRING','noop','TEXT'];(function(_0x4ef7d7,_0x5b971f){var _0x2ca766=function(_0x420507){while(--_0x420507){_0x4ef7d7['push'](_0x4ef7d7['shift']());}};_0x2ca766(++_0x5b971f);}(_0x6e8f,0x181));var _0xf6e8=function(_0x555bef,_0x3dda60){_0x555bef=_0x555bef-0x0;var _0x317ace=_0x6e8f[_0x555bef];return _0x317ace;};'use strict';var Sequelize=require('sequelize');module[_0xf6e8('0x0')]={'priority':{'type':Sequelize[_0xf6e8('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xf6e8('0x2')],'allowNull':![],'defaultValue':_0xf6e8('0x3')},'appdata':{'type':Sequelize[_0xf6e8('0x4')]()},'description':{'type':Sequelize[_0xf6e8('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index edf1ff2..3e8bbe9 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 _0xeea4=['../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','destroy','error','stack','name','send','keys','rawAttributes','query','filters','intersection','model','attributes','fields','length','include','options','find','then','catch','body','ChatApplication','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x4d1ee9,_0x394a78){var _0x9a5456=function(_0x224f3b){while(--_0x224f3b){_0x4d1ee9['push'](_0x4d1ee9['shift']());}};_0x9a5456(++_0x394a78);}(_0xeea4,0x19e));var _0x4eea=function(_0x34bea7,_0x36c7f7){_0x34bea7=_0x34bea7-0x0;var _0x33cf81=_0xeea4[_0x34bea7];return _0x33cf81;};'use strict';var emlformat=require(_0x4eea('0x0'));var rimraf=require(_0x4eea('0x1'));var zipdir=require(_0x4eea('0x2'));var jsonpatch=require(_0x4eea('0x3'));var rp=require(_0x4eea('0x4'));var moment=require(_0x4eea('0x5'));var BPromise=require(_0x4eea('0x6'));var Mustache=require(_0x4eea('0x7'));var util=require(_0x4eea('0x8'));var path=require('path');var sox=require(_0x4eea('0x9'));var csv=require('to-csv');var ejs=require(_0x4eea('0xa'));var fs=require('fs');var fs_extra=require(_0x4eea('0xb'));var _=require(_0x4eea('0xc'));var squel=require('squel');var crypto=require(_0x4eea('0xd'));var jsforce=require(_0x4eea('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4eea('0xf'));var querystring=require(_0x4eea('0x10'));var Papa=require(_0x4eea('0x11'));var Redis=require(_0x4eea('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x4eea('0x13'));var as=require(_0x4eea('0x14'));var hardwareService=require(_0x4eea('0x15'));var logger=require(_0x4eea('0x16'))(_0x4eea('0x17'));var utils=require(_0x4eea('0x18'));var config=require(_0x4eea('0x19'));var licenseUtil=require(_0x4eea('0x1a'));var db=require(_0x4eea('0x1b'))['db'];function respondWithStatusCode(_0x130507,_0x47b971){_0x47b971=_0x47b971||0xcc;return function(_0x54fa8c){if(_0x54fa8c){return _0x130507[_0x4eea('0x1c')](_0x47b971);}return _0x130507[_0x4eea('0x1d')](_0x47b971)[_0x4eea('0x1e')]();};}function respondWithResult(_0x238405,_0x3327e0){_0x3327e0=_0x3327e0||0xc8;return function(_0x328275){if(_0x328275){return _0x238405[_0x4eea('0x1d')](_0x3327e0)[_0x4eea('0x1f')](_0x328275);}};}function respondWithFilteredResult(_0x5828e0,_0x1654c0){return function(_0x34ce09){if(_0x34ce09){var _0x150d60=typeof _0x1654c0[_0x4eea('0x20')]==='undefined'&&typeof _0x1654c0[_0x4eea('0x21')]===_0x4eea('0x22');var _0x3fbe8b=_0x34ce09[_0x4eea('0x23')];var _0x27a227=_0x150d60?0x0:_0x1654c0['offset'];var _0x1571f3=_0x150d60?_0x34ce09[_0x4eea('0x23')]:_0x1654c0['offset']+_0x1654c0[_0x4eea('0x21')];var _0x325185;if(_0x1571f3>=_0x3fbe8b){_0x1571f3=_0x3fbe8b;_0x325185=0xc8;}else{_0x325185=0xce;}_0x5828e0[_0x4eea('0x1d')](_0x325185);return _0x5828e0[_0x4eea('0x24')](_0x4eea('0x25'),_0x27a227+'-'+_0x1571f3+'/'+_0x3fbe8b)[_0x4eea('0x1f')](_0x34ce09);}return null;};}function patchUpdates(_0x56fefc){return function(_0xf054a7){try{jsonpatch[_0x4eea('0x26')](_0xf054a7,_0x56fefc,!![]);}catch(_0x24f371){return BPromise[_0x4eea('0x27')](_0x24f371);}return _0xf054a7[_0x4eea('0x28')]();};}function saveUpdates(_0x496ab6,_0x4898e8){return function(_0x3b7513){if(_0x3b7513){return _0x3b7513['update'](_0x496ab6)['then'](function(_0x5a2722){return _0x5a2722;});}return null;};}function removeEntity(_0x37f024,_0x3be3f3){return function(_0x505e50){if(_0x505e50){return _0x505e50[_0x4eea('0x29')]()['then'](function(){_0x37f024[_0x4eea('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x111e65,_0x5a1ec7){return function(_0x1e8f29){if(!_0x1e8f29){_0x111e65[_0x4eea('0x1c')](0x194);}return _0x1e8f29;};}function handleError(_0x22f706,_0x430a46){_0x430a46=_0x430a46||0x1f4;return function(_0xd09e64){logger[_0x4eea('0x2a')](_0xd09e64[_0x4eea('0x2b')]);if(_0xd09e64[_0x4eea('0x2c')]){delete _0xd09e64[_0x4eea('0x2c')];}_0x22f706[_0x4eea('0x1d')](_0x430a46)[_0x4eea('0x2d')](_0xd09e64);};}exports['show']=function(_0x58c0df,_0x3e602c){var _0x3eeb41={'raw':!![],'where':{'id':_0x58c0df['params']['id']}},_0x591b2f={};_0x591b2f['model']=_[_0x4eea('0x2e')](db['ChatApplication'][_0x4eea('0x2f')]);_0x591b2f[_0x4eea('0x30')]=_[_0x4eea('0x2e')](_0x58c0df['query']);_0x591b2f[_0x4eea('0x31')]=_[_0x4eea('0x32')](_0x591b2f[_0x4eea('0x33')],_0x591b2f['query']);_0x3eeb41[_0x4eea('0x34')]=_[_0x4eea('0x32')](_0x591b2f[_0x4eea('0x33')],qs['fields'](_0x58c0df['query'][_0x4eea('0x35')]));_0x3eeb41[_0x4eea('0x34')]=_0x3eeb41['attributes'][_0x4eea('0x36')]?_0x3eeb41[_0x4eea('0x34')]:_0x591b2f[_0x4eea('0x33')];if(_0x58c0df[_0x4eea('0x30')]['includeAll']){_0x3eeb41[_0x4eea('0x37')]=[{'all':!![]}];}_0x3eeb41=_['merge']({},_0x3eeb41,_0x58c0df[_0x4eea('0x38')]);return db['ChatApplication'][_0x4eea('0x39')](_0x3eeb41)[_0x4eea('0x3a')](handleEntityNotFound(_0x3e602c,null))['then'](respondWithResult(_0x3e602c,null))[_0x4eea('0x3b')](handleError(_0x3e602c,null));};exports['update']=function(_0x1df208,_0x2e7b37){if(_0x1df208['body']['id']){delete _0x1df208[_0x4eea('0x3c')]['id'];}return db[_0x4eea('0x3d')][_0x4eea('0x39')]({'where':{'id':_0x1df208['params']['id']}})[_0x4eea('0x3a')](handleEntityNotFound(_0x2e7b37,null))['then'](saveUpdates(_0x1df208['body'],null))[_0x4eea('0x3a')](respondWithResult(_0x2e7b37,null))[_0x4eea('0x3b')](handleError(_0x2e7b37,null));};exports[_0x4eea('0x29')]=function(_0x4c8dd2,_0x57e9b6){return db[_0x4eea('0x3d')][_0x4eea('0x39')]({'where':{'id':_0x4c8dd2[_0x4eea('0x3e')]['id']}})[_0x4eea('0x3a')](handleEntityNotFound(_0x57e9b6,null))[_0x4eea('0x3a')](removeEntity(_0x57e9b6,null))['catch'](handleError(_0x57e9b6,null));};
\ No newline at end of file
+var _0x0d74=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','save','update','then','destroy','error','stack','name','show','params','model','ChatApplication','rawAttributes','query','keys','intersection','attributes','fields','includeAll','include','merge','options','find','catch','body','eml-format','rimraf','request-promise','moment','util','path','sox','to-csv','squel','jsforce'];(function(_0x272156,_0x5e4b0d){var _0x1071d0=function(_0x5f1f6b){while(--_0x5f1f6b){_0x272156['push'](_0x272156['shift']());}};_0x1071d0(++_0x5e4b0d);}(_0x0d74,0x146));var _0x40d7=function(_0x211533,_0x11e508){_0x211533=_0x211533-0x0;var _0x4fa6e7=_0x0d74[_0x211533];return _0x4fa6e7;};'use strict';var emlformat=require(_0x40d7('0x0'));var rimraf=require(_0x40d7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x40d7('0x2'));var moment=require(_0x40d7('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x40d7('0x4'));var path=require(_0x40d7('0x5'));var sox=require(_0x40d7('0x6'));var csv=require(_0x40d7('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x40d7('0x8'));var crypto=require('crypto');var jsforce=require(_0x40d7('0x9'));var deskjs=require(_0x40d7('0xa'));var toCsv=require('to-csv');var querystring=require(_0x40d7('0xb'));var Papa=require(_0x40d7('0xc'));var Redis=require(_0x40d7('0xd'));var authService=require(_0x40d7('0xe'));var qs=require(_0x40d7('0xf'));var as=require(_0x40d7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x40d7('0x11'))(_0x40d7('0x12'));var utils=require(_0x40d7('0x13'));var config=require(_0x40d7('0x14'));var licenseUtil=require(_0x40d7('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x43f1d8,_0xa08fd6){_0xa08fd6=_0xa08fd6||0xcc;return function(_0x3723a4){if(_0x3723a4){return _0x43f1d8[_0x40d7('0x16')](_0xa08fd6);}return _0x43f1d8['status'](_0xa08fd6)[_0x40d7('0x17')]();};}function respondWithResult(_0x4cb402,_0x14c12b){_0x14c12b=_0x14c12b||0xc8;return function(_0x2acc5b){if(_0x2acc5b){return _0x4cb402[_0x40d7('0x18')](_0x14c12b)[_0x40d7('0x19')](_0x2acc5b);}};}function respondWithFilteredResult(_0x1acc2f,_0x67d691){return function(_0x473fea){if(_0x473fea){var _0x55a7e0=typeof _0x67d691['offset']==='undefined'&&typeof _0x67d691[_0x40d7('0x1a')]===_0x40d7('0x1b');var _0x486d75=_0x473fea['count'];var _0x120964=_0x55a7e0?0x0:_0x67d691['offset'];var _0x4ed97e=_0x55a7e0?_0x473fea[_0x40d7('0x1c')]:_0x67d691[_0x40d7('0x1d')]+_0x67d691[_0x40d7('0x1a')];var _0x44fa91;if(_0x4ed97e>=_0x486d75){_0x4ed97e=_0x486d75;_0x44fa91=0xc8;}else{_0x44fa91=0xce;}_0x1acc2f[_0x40d7('0x18')](_0x44fa91);return _0x1acc2f[_0x40d7('0x1e')](_0x40d7('0x1f'),_0x120964+'-'+_0x4ed97e+'/'+_0x486d75)[_0x40d7('0x19')](_0x473fea);}return null;};}function patchUpdates(_0x5eb3c1){return function(_0x4c47cf){try{jsonpatch['apply'](_0x4c47cf,_0x5eb3c1,!![]);}catch(_0x34ea1d){return BPromise['reject'](_0x34ea1d);}return _0x4c47cf[_0x40d7('0x20')]();};}function saveUpdates(_0x145422,_0x985914){return function(_0x1a441a){if(_0x1a441a){return _0x1a441a[_0x40d7('0x21')](_0x145422)[_0x40d7('0x22')](function(_0xfec685){return _0xfec685;});}return null;};}function removeEntity(_0x3ccae9,_0x51180d){return function(_0x1cb3b2){if(_0x1cb3b2){return _0x1cb3b2[_0x40d7('0x23')]()['then'](function(){_0x3ccae9[_0x40d7('0x18')](0xcc)[_0x40d7('0x17')]();});}};}function handleEntityNotFound(_0x38276c,_0x29c62b){return function(_0x528ab5){if(!_0x528ab5){_0x38276c['sendStatus'](0x194);}return _0x528ab5;};}function handleError(_0x4889df,_0x4e7d84){_0x4e7d84=_0x4e7d84||0x1f4;return function(_0x539985){logger[_0x40d7('0x24')](_0x539985[_0x40d7('0x25')]);if(_0x539985[_0x40d7('0x26')]){delete _0x539985[_0x40d7('0x26')];}_0x4889df['status'](_0x4e7d84)['send'](_0x539985);};}exports[_0x40d7('0x27')]=function(_0x2b5f11,_0x4503cc){var _0x532ed5={'raw':!![],'where':{'id':_0x2b5f11[_0x40d7('0x28')]['id']}},_0x4fdf53={};_0x4fdf53[_0x40d7('0x29')]=_['keys'](db[_0x40d7('0x2a')][_0x40d7('0x2b')]);_0x4fdf53[_0x40d7('0x2c')]=_[_0x40d7('0x2d')](_0x2b5f11['query']);_0x4fdf53['filters']=_[_0x40d7('0x2e')](_0x4fdf53[_0x40d7('0x29')],_0x4fdf53[_0x40d7('0x2c')]);_0x532ed5[_0x40d7('0x2f')]=_[_0x40d7('0x2e')](_0x4fdf53[_0x40d7('0x29')],qs[_0x40d7('0x30')](_0x2b5f11['query'][_0x40d7('0x30')]));_0x532ed5[_0x40d7('0x2f')]=_0x532ed5[_0x40d7('0x2f')]['length']?_0x532ed5[_0x40d7('0x2f')]:_0x4fdf53[_0x40d7('0x29')];if(_0x2b5f11[_0x40d7('0x2c')][_0x40d7('0x31')]){_0x532ed5[_0x40d7('0x32')]=[{'all':!![]}];}_0x532ed5=_[_0x40d7('0x33')]({},_0x532ed5,_0x2b5f11[_0x40d7('0x34')]);return db['ChatApplication'][_0x40d7('0x35')](_0x532ed5)[_0x40d7('0x22')](handleEntityNotFound(_0x4503cc,null))[_0x40d7('0x22')](respondWithResult(_0x4503cc,null))[_0x40d7('0x36')](handleError(_0x4503cc,null));};exports[_0x40d7('0x21')]=function(_0x2d1ee6,_0x1e6f08){if(_0x2d1ee6[_0x40d7('0x37')]['id']){delete _0x2d1ee6['body']['id'];}return db['ChatApplication'][_0x40d7('0x35')]({'where':{'id':_0x2d1ee6[_0x40d7('0x28')]['id']}})['then'](handleEntityNotFound(_0x1e6f08,null))['then'](saveUpdates(_0x2d1ee6['body'],null))[_0x40d7('0x22')](respondWithResult(_0x1e6f08,null))['catch'](handleError(_0x1e6f08,null));};exports[_0x40d7('0x23')]=function(_0x56b17c,_0x798ba7){return db[_0x40d7('0x2a')][_0x40d7('0x35')]({'where':{'id':_0x56b17c[_0x40d7('0x28')]['id']}})[_0x40d7('0x22')](handleEntityNotFound(_0x798ba7,null))['then'](removeEntity(_0x798ba7,null))[_0x40d7('0x36')](handleError(_0x798ba7,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 5105a8d..50f7627 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 _0xdb90=['../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','request-promise','path','rimraf'];(function(_0x2ca94e,_0xd97864){var _0x1c6718=function(_0x44c561){while(--_0x44c561){_0x2ca94e['push'](_0x2ca94e['shift']());}};_0x1c6718(++_0xd97864);}(_0xdb90,0xcb));var _0x0db9=function(_0xc889e1,_0x438415){_0xc889e1=_0xc889e1-0x0;var _0x17ab9e=_0xdb90[_0xc889e1];return _0x17ab9e;};'use strict';var _=require(_0x0db9('0x0'));var util=require(_0x0db9('0x1'));var logger=require('../../config/logger')(_0x0db9('0x2'));var moment=require(_0x0db9('0x3'));var BPromise=require('bluebird');var rp=require(_0x0db9('0x4'));var fs=require('fs');var path=require(_0x0db9('0x5'));var rimraf=require(_0x0db9('0x6'));var config=require(_0x0db9('0x7'));var attributes=require(_0x0db9('0x8'));module[_0x0db9('0x9')]=function(_0x227647,_0x513a01){return _0x227647[_0x0db9('0xa')](_0x0db9('0xb'),attributes,{'tableName':_0x0db9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0db9('0xd'),'collate':_0x0db9('0xe')});};
\ No newline at end of file
+var _0x95f4=['utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','utf8mb4'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x95f4,0xf1));var _0x495f=function(_0x27ff37,_0x2d4e0f){_0x27ff37=_0x27ff37-0x0;var _0x4681d7=_0x95f4[_0x27ff37];return _0x4681d7;};'use strict';var _=require(_0x495f('0x0'));var util=require(_0x495f('0x1'));var logger=require(_0x495f('0x2'))('api');var moment=require('moment');var BPromise=require(_0x495f('0x3'));var rp=require(_0x495f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x495f('0x5'));var attributes=require(_0x495f('0x6'));module[_0x495f('0x7')]=function(_0x4a56a5,_0x704a46){return _0x4a56a5[_0x495f('0x8')](_0x495f('0x9'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x495f('0xa'),'collate':_0x495f('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index da4eda1..f46b2d9 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 _0xd6f8=['result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0x11aee6,_0x18af38){var _0x5094cd=function(_0x4d70fe){while(--_0x4d70fe){_0x11aee6['push'](_0x11aee6['shift']());}};_0x5094cd(++_0x18af38);}(_0xd6f8,0x1e4));var _0x8d6f=function(_0x1966f3,_0x210ea3){_0x1966f3=_0x1966f3-0x0;var _0x17575f=_0xd6f8[_0x1966f3];return _0x17575f;};'use strict';var _=require(_0x8d6f('0x0'));var util=require(_0x8d6f('0x1'));var moment=require(_0x8d6f('0x2'));var BPromise=require(_0x8d6f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8d6f('0x4'));var db=require(_0x8d6f('0x5'))['db'];var utils=require(_0x8d6f('0x6'));var logger=require(_0x8d6f('0x7'))(_0x8d6f('0x8'));var config=require('../../config/environment');var jayson=require(_0x8d6f('0x9'));var client=jayson[_0x8d6f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x738815,_0x459349,_0x383b05){return new BPromise(function(_0x6608f,_0xa86649){return client[_0x8d6f('0xb')](_0x738815,_0x383b05)[_0x8d6f('0xc')](function(_0x238a42){logger[_0x8d6f('0xd')](_0x8d6f('0xe'),_0x459349,_0x8d6f('0xf'));logger[_0x8d6f('0x10')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x459349,_0x8d6f('0xf'),JSON['stringify'](_0x238a42));if(_0x238a42[_0x8d6f('0x11')]){if(_0x238a42[_0x8d6f('0x11')][_0x8d6f('0x12')]===0x1f4){logger[_0x8d6f('0x11')](_0x8d6f('0xe'),_0x459349,_0x238a42[_0x8d6f('0x11')][_0x8d6f('0x13')]);return _0xa86649(_0x238a42['error'][_0x8d6f('0x13')]);}logger['error'](_0x8d6f('0xe'),_0x459349,_0x238a42[_0x8d6f('0x11')]['message']);return _0x6608f(_0x238a42[_0x8d6f('0x11')]['message']);}else{logger[_0x8d6f('0xd')](_0x8d6f('0xe'),_0x459349,_0x8d6f('0xf'));_0x6608f(_0x238a42[_0x8d6f('0x14')]['message']);}})['catch'](function(_0x507b82){logger[_0x8d6f('0x11')](_0x8d6f('0xe'),_0x459349,_0x507b82);_0xa86649(_0x507b82);});});}
\ No newline at end of file
+var _0x0569=['ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x2bb3a0,_0x33cf48){var _0x7b2fb5=function(_0xdba234){while(--_0xdba234){_0x2bb3a0['push'](_0x2bb3a0['shift']());}};_0x7b2fb5(++_0x33cf48);}(_0x0569,0x6e));var _0x9056=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0x0569[_0x344a3f];return _0x264712;};'use strict';var _=require(_0x9056('0x0'));var util=require(_0x9056('0x1'));var moment=require('moment');var BPromise=require(_0x9056('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9056('0x3'));var db=require(_0x9056('0x4'))['db'];var utils=require(_0x9056('0x5'));var logger=require(_0x9056('0x6'))(_0x9056('0x7'));var config=require(_0x9056('0x8'));var jayson=require(_0x9056('0x9'));var client=jayson[_0x9056('0xa')][_0x9056('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x58f779,_0x1fe675,_0x941b5f){return new BPromise(function(_0xdd408f,_0x442dc1){return client[_0x9056('0xc')](_0x58f779,_0x941b5f)[_0x9056('0xd')](function(_0x4ab054){logger[_0x9056('0xe')](_0x9056('0xf'),_0x1fe675,_0x9056('0x10'));logger[_0x9056('0x11')](_0x9056('0x12'),_0x1fe675,_0x9056('0x10'),JSON[_0x9056('0x13')](_0x4ab054));if(_0x4ab054[_0x9056('0x14')]){if(_0x4ab054['error'][_0x9056('0x15')]===0x1f4){logger['error'](_0x9056('0xf'),_0x1fe675,_0x4ab054[_0x9056('0x14')][_0x9056('0x16')]);return _0x442dc1(_0x4ab054[_0x9056('0x14')][_0x9056('0x16')]);}logger['error'](_0x9056('0xf'),_0x1fe675,_0x4ab054['error'][_0x9056('0x16')]);return _0xdd408f(_0x4ab054[_0x9056('0x14')][_0x9056('0x16')]);}else{logger[_0x9056('0xe')](_0x9056('0xf'),_0x1fe675,_0x9056('0x10'));_0xdd408f(_0x4ab054[_0x9056('0x17')][_0x9056('0x16')]);}})[_0x9056('0x18')](function(_0xc8cce8){logger[_0x9056('0x14')](_0x9056('0xf'),_0x1fe675,_0xc8cce8);_0x442dc1(_0xc8cce8);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 9120d0a..77a36e1 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 _0x74be=['isAuthenticated','show','put','update','delete','destroy','exports','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x74be,0x67));var _0xe74b=function(_0x548b6,_0x5e84a4){_0x548b6=_0x548b6-0x0;var _0x169764=_0x74be[_0x548b6];return _0x169764;};'use strict';var multer=require('multer');var util=require(_0xe74b('0x0'));var path=require(_0xe74b('0x1'));var timeout=require('connect-timeout');var express=require(_0xe74b('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe74b('0x3'));var interaction=require(_0xe74b('0x4'));var config=require(_0xe74b('0x5'));var controller=require(_0xe74b('0x6'));router[_0xe74b('0x7')](_0xe74b('0x8'),auth[_0xe74b('0x9')](),controller[_0xe74b('0xa')]);router[_0xe74b('0xb')](_0xe74b('0x8'),auth['isAuthenticated'](),controller[_0xe74b('0xc')]);router[_0xe74b('0xd')](_0xe74b('0x8'),auth[_0xe74b('0x9')](),controller[_0xe74b('0xe')]);module[_0xe74b('0xf')]=router;
\ No newline at end of file
+var _0x7228=['/:id','isAuthenticated','show','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get'];(function(_0x1d426f,_0x37e919){var _0x17f71a=function(_0x3bf60c){while(--_0x3bf60c){_0x1d426f['push'](_0x1d426f['shift']());}};_0x17f71a(++_0x37e919);}(_0x7228,0x1c9));var _0x8722=function(_0xbeab9,_0x37ec4a){_0xbeab9=_0xbeab9-0x0;var _0x27650c=_0x7228[_0xbeab9];return _0x27650c;};'use strict';var multer=require(_0x8722('0x0'));var util=require(_0x8722('0x1'));var path=require(_0x8722('0x2'));var timeout=require(_0x8722('0x3'));var express=require(_0x8722('0x4'));var router=express['Router']();var fs_extra=require(_0x8722('0x5'));var auth=require(_0x8722('0x6'));var interaction=require(_0x8722('0x7'));var config=require(_0x8722('0x8'));var controller=require(_0x8722('0x9'));router[_0x8722('0xa')](_0x8722('0xb'),auth[_0x8722('0xc')](),controller[_0x8722('0xd')]);router[_0x8722('0xe')](_0x8722('0xb'),auth['isAuthenticated'](),controller[_0x8722('0xf')]);router['delete'](_0x8722('0xb'),auth[_0x8722('0xc')](),controller[_0x8722('0x10')]);module[_0x8722('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 0ab73e3..f5eba6a 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 _0xba6e=['sequelize','exports','STRING'];(function(_0x2433e3,_0x28ac1e){var _0x3e5feb=function(_0x47f203){while(--_0x47f203){_0x2433e3['push'](_0x2433e3['shift']());}};_0x3e5feb(++_0x28ac1e);}(_0xba6e,0x168));var _0xeba6=function(_0x3b1252,_0x43691c){_0x3b1252=_0x3b1252-0x0;var _0x1af329=_0xba6e[_0x3b1252];return _0x1af329;};'use strict';var Sequelize=require(_0xeba6('0x0'));module[_0xeba6('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xeba6('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0xcf58=['STRING','BOOLEAN','sequelize','exports'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xcf58,0x1be));var _0x8cf5=function(_0x579f79,_0x1f1bab){_0x579f79=_0x579f79-0x0;var _0x4c52f9=_0xcf58[_0x579f79];return _0x4c52f9;};'use strict';var Sequelize=require(_0x8cf5('0x0'));module[_0x8cf5('0x1')]={'name':{'type':Sequelize[_0x8cf5('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x8cf5('0x3')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index cf53e00..7c46737 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 _0x46b9=['map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','ChatGroup','includeAll','include','rows','show','params','rawAttributes','find','catch','create','body','describe','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','order','removeMembers','ChatGroupId','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index'];(function(_0x435eac,_0x459918){var _0x436f53=function(_0x450946){while(--_0x450946){_0x435eac['push'](_0x435eac['shift']());}};_0x436f53(++_0x459918);}(_0x46b9,0x90));var _0x946b=function(_0x5c4273,_0x46315e){_0x5c4273=_0x5c4273-0x0;var _0x4a0173=_0x46b9[_0x5c4273];return _0x4a0173;};'use strict';var emlformat=require(_0x946b('0x0'));var rimraf=require(_0x946b('0x1'));var zipdir=require(_0x946b('0x2'));var jsonpatch=require(_0x946b('0x3'));var rp=require(_0x946b('0x4'));var moment=require(_0x946b('0x5'));var BPromise=require(_0x946b('0x6'));var Mustache=require(_0x946b('0x7'));var util=require(_0x946b('0x8'));var path=require('path');var sox=require(_0x946b('0x9'));var csv=require(_0x946b('0xa'));var ejs=require(_0x946b('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x946b('0xc'));var squel=require('squel');var crypto=require(_0x946b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x946b('0xe'));var toCsv=require(_0x946b('0xa'));var querystring=require(_0x946b('0xf'));var Papa=require('papaparse');var Redis=require(_0x946b('0x10'));var authService=require(_0x946b('0x11'));var qs=require(_0x946b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x946b('0x13'));var logger=require(_0x946b('0x14'))('api');var utils=require(_0x946b('0x15'));var config=require(_0x946b('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x946b('0x17'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x946b('0x18'),'port':0x18eb});var socket=require(_0x946b('0x19'))(new Redis(config['redis']));require(_0x946b('0x1a'))[_0x946b('0x1b')](socket);function respondWithStatusCode(_0x34e3dd,_0x35424d){_0x35424d=_0x35424d||0xcc;return function(_0x101e8e){if(_0x101e8e){return _0x34e3dd[_0x946b('0x1c')](_0x35424d);}return _0x34e3dd[_0x946b('0x1d')](_0x35424d)[_0x946b('0x1e')]();};}function respondWithResult(_0x68854d,_0x27e07d){_0x27e07d=_0x27e07d||0xc8;return function(_0x16a27e){if(_0x16a27e){return _0x68854d['status'](_0x27e07d)[_0x946b('0x1f')](_0x16a27e);}};}function respondWithFilteredResult(_0x44e54d,_0x59d005){return function(_0x5e8742){if(_0x5e8742){var _0x248af4=typeof _0x59d005[_0x946b('0x20')]===_0x946b('0x21')&&typeof _0x59d005['limit']===_0x946b('0x21');var _0x38f4fc=_0x5e8742[_0x946b('0x22')];var _0x2dc652=_0x248af4?0x0:_0x59d005[_0x946b('0x20')];var _0x1965ad=_0x248af4?_0x5e8742[_0x946b('0x22')]:_0x59d005[_0x946b('0x20')]+_0x59d005[_0x946b('0x23')];var _0x16134b;if(_0x1965ad>=_0x38f4fc){_0x1965ad=_0x38f4fc;_0x16134b=0xc8;}else{_0x16134b=0xce;}_0x44e54d[_0x946b('0x1d')](_0x16134b);return _0x44e54d[_0x946b('0x24')](_0x946b('0x25'),_0x2dc652+'-'+_0x1965ad+'/'+_0x38f4fc)[_0x946b('0x1f')](_0x5e8742);}return null;};}function patchUpdates(_0x240f88){return function(_0x40d956){try{jsonpatch[_0x946b('0x26')](_0x40d956,_0x240f88,!![]);}catch(_0xe80bd9){return BPromise[_0x946b('0x27')](_0xe80bd9);}return _0x40d956[_0x946b('0x28')]();};}function saveUpdates(_0x401c92,_0x9e3d69){return function(_0x22db9d){if(_0x22db9d){return _0x22db9d[_0x946b('0x29')](_0x401c92)['then'](function(_0x3ed6aa){return _0x3ed6aa;});}return null;};}function removeEntity(_0xceee59,_0x33e298){return function(_0x205237){if(_0x205237){return _0x205237['destroy']()[_0x946b('0x2a')](function(){_0xceee59['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f91da,_0x296646){return function(_0x583897){if(!_0x583897){_0x1f91da[_0x946b('0x1c')](0x194);}return _0x583897;};}function handleError(_0x3f0ddb,_0x564817){_0x564817=_0x564817||0x1f4;return function(_0x5c01db){logger[_0x946b('0x2b')](_0x5c01db[_0x946b('0x2c')]);if(_0x5c01db[_0x946b('0x2d')]){delete _0x5c01db['name'];}_0x3f0ddb[_0x946b('0x1d')](_0x564817)[_0x946b('0x2e')](_0x5c01db);};}exports[_0x946b('0x2f')]=function(_0x3f5318,_0x52cb74){var _0x1b0a8a={},_0x39bdb7={},_0x4debd9={'count':0x0,'rows':[]};var _0x14c88f=_[_0x946b('0x30')](db['ChatGroup']['rawAttributes'],function(_0x53b2aa){return{'name':_0x53b2aa[_0x946b('0x31')],'type':_0x53b2aa[_0x946b('0x32')][_0x946b('0x33')]};});_0x39bdb7[_0x946b('0x34')]=_[_0x946b('0x30')](_0x14c88f,_0x946b('0x2d'));_0x39bdb7[_0x946b('0x35')]=_[_0x946b('0x36')](_0x3f5318[_0x946b('0x35')]);_0x39bdb7[_0x946b('0x37')]=_[_0x946b('0x38')](_0x39bdb7['model'],_0x39bdb7[_0x946b('0x35')]);_0x1b0a8a[_0x946b('0x39')]=_[_0x946b('0x38')](_0x39bdb7['model'],qs[_0x946b('0x3a')](_0x3f5318['query'][_0x946b('0x3a')]));_0x1b0a8a[_0x946b('0x39')]=_0x1b0a8a[_0x946b('0x39')][_0x946b('0x3b')]?_0x1b0a8a[_0x946b('0x39')]:_0x39bdb7[_0x946b('0x34')];if(!_0x3f5318[_0x946b('0x35')][_0x946b('0x3c')](_0x946b('0x3d'))){_0x1b0a8a[_0x946b('0x23')]=qs[_0x946b('0x23')](_0x3f5318['query']['limit']);_0x1b0a8a[_0x946b('0x20')]=qs[_0x946b('0x20')](_0x3f5318[_0x946b('0x35')][_0x946b('0x20')]);}_0x1b0a8a['order']=qs[_0x946b('0x3e')](_0x3f5318[_0x946b('0x35')][_0x946b('0x3e')]);_0x1b0a8a['where']=qs['filters'](_[_0x946b('0x3f')](_0x3f5318[_0x946b('0x35')],_0x39bdb7[_0x946b('0x37')]),_0x14c88f);if(_0x3f5318[_0x946b('0x35')][_0x946b('0x40')]){_0x1b0a8a[_0x946b('0x41')]=_[_0x946b('0x42')](_0x1b0a8a[_0x946b('0x41')],{'$or':_[_0x946b('0x30')](_0x14c88f,function(_0x7e24da){if(_0x7e24da[_0x946b('0x32')]!==_0x946b('0x43')){var _0x3e4489={};_0x3e4489[_0x7e24da[_0x946b('0x2d')]]={'$like':'%'+_0x3f5318['query'][_0x946b('0x40')]+'%'};return _0x3e4489;}})});}_0x1b0a8a=_[_0x946b('0x42')]({},_0x1b0a8a,_0x3f5318[_0x946b('0x44')]);var _0x1fffd5={'where':_0x1b0a8a[_0x946b('0x41')]};return db[_0x946b('0x45')][_0x946b('0x22')](_0x1fffd5)[_0x946b('0x2a')](function(_0x261eb4){_0x4debd9['count']=_0x261eb4;if(_0x3f5318[_0x946b('0x35')][_0x946b('0x46')]){_0x1b0a8a[_0x946b('0x47')]=[{'all':!![]}];}return db[_0x946b('0x45')]['findAll'](_0x1b0a8a);})['then'](function(_0x3a44ab){_0x4debd9[_0x946b('0x48')]=_0x3a44ab;return _0x4debd9;})[_0x946b('0x2a')](respondWithFilteredResult(_0x52cb74,_0x1b0a8a))['catch'](handleError(_0x52cb74,null));};exports[_0x946b('0x49')]=function(_0xd2c78f,_0x4afcc2){var _0xe8cc82={'raw':!![],'where':{'id':_0xd2c78f[_0x946b('0x4a')]['id']}},_0x4a9749={};_0x4a9749[_0x946b('0x34')]=_[_0x946b('0x36')](db['ChatGroup'][_0x946b('0x4b')]);_0x4a9749[_0x946b('0x35')]=_[_0x946b('0x36')](_0xd2c78f[_0x946b('0x35')]);_0x4a9749[_0x946b('0x37')]=_['intersection'](_0x4a9749[_0x946b('0x34')],_0x4a9749['query']);_0xe8cc82[_0x946b('0x39')]=_[_0x946b('0x38')](_0x4a9749[_0x946b('0x34')],qs[_0x946b('0x3a')](_0xd2c78f[_0x946b('0x35')][_0x946b('0x3a')]));_0xe8cc82[_0x946b('0x39')]=_0xe8cc82[_0x946b('0x39')]['length']?_0xe8cc82[_0x946b('0x39')]:_0x4a9749[_0x946b('0x34')];if(_0xd2c78f[_0x946b('0x35')][_0x946b('0x46')]){_0xe8cc82[_0x946b('0x47')]=[{'all':!![]}];}_0xe8cc82=_[_0x946b('0x42')]({},_0xe8cc82,_0xd2c78f[_0x946b('0x44')]);return db['ChatGroup'][_0x946b('0x4c')](_0xe8cc82)[_0x946b('0x2a')](handleEntityNotFound(_0x4afcc2,null))['then'](respondWithResult(_0x4afcc2,null))[_0x946b('0x4d')](handleError(_0x4afcc2,null));};exports['create']=function(_0x56f56e,_0x167d80){return db['ChatGroup'][_0x946b('0x4e')](_0x56f56e[_0x946b('0x4f')],{})[_0x946b('0x2a')](respondWithResult(_0x167d80,0xc9))[_0x946b('0x4d')](handleError(_0x167d80,null));};exports[_0x946b('0x29')]=function(_0x138646,_0x3b3ce7){if(_0x138646[_0x946b('0x4f')]['id']){delete _0x138646[_0x946b('0x4f')]['id'];}return db[_0x946b('0x45')][_0x946b('0x4c')]({'where':{'id':_0x138646[_0x946b('0x4a')]['id']}})[_0x946b('0x2a')](handleEntityNotFound(_0x3b3ce7,null))[_0x946b('0x2a')](saveUpdates(_0x138646[_0x946b('0x4f')],null))['then'](respondWithResult(_0x3b3ce7,null))[_0x946b('0x4d')](handleError(_0x3b3ce7,null));};exports['destroy']=function(_0x5bda76,_0x493c06){return db[_0x946b('0x45')][_0x946b('0x4c')]({'where':{'id':_0x5bda76[_0x946b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x493c06,null))[_0x946b('0x2a')](removeEntity(_0x493c06,null))[_0x946b('0x4d')](handleError(_0x493c06,null));};exports[_0x946b('0x50')]=function(_0x44979c,_0x1df06a){return db[_0x946b('0x45')][_0x946b('0x50')]()[_0x946b('0x2a')](respondWithResult(_0x1df06a,null))[_0x946b('0x4d')](handleError(_0x1df06a,null));};exports['getUnread']=function(_0x88f55c,_0x2060e2,_0xce24fe){return db[_0x946b('0x51')][_0x946b('0x22')]({'where':{'ChatGroupId':_0x88f55c[_0x946b('0x4a')]['id'],'ToId':_0x88f55c[_0x946b('0x52')]['id'],'read':![]}})[_0x946b('0x2a')](function(_0x4bcfc5){return{'id':_[_0x946b('0x53')](_0x88f55c[_0x946b('0x4a')]['id']),'count':_0x4bcfc5};})[_0x946b('0x2a')](respondWithResult(_0x2060e2,null))['catch'](handleError(_0x2060e2,null));};exports[_0x946b('0x54')]=function(_0x284d9f,_0xaec05,_0x1cbcf5){return db[_0x946b('0x45')][_0x946b('0x4c')]({'where':{'id':_0x284d9f[_0x946b('0x4a')]['id']}})['then'](handleEntityNotFound(_0xaec05,null))[_0x946b('0x2a')](function(_0x4112a4){if(_0x4112a4){return _0x4112a4[_0x946b('0x54')](_0x284d9f['body'][_0x946b('0x55')],_[_0x946b('0x56')](_0x284d9f[_0x946b('0x4f')],[_0x946b('0x55'),'id'])||{});}})[_0x946b('0x2a')](respondWithResult(_0xaec05,null))[_0x946b('0x4d')](handleError(_0xaec05,null));};exports[_0x946b('0x57')]=function(_0x5c6c66,_0x49c926,_0x4b84dd){var _0x3553c6={};var _0x269a7={};var _0x592793;var _0x201f78;return db[_0x946b('0x45')][_0x946b('0x58')]({'where':{'id':_0x5c6c66[_0x946b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x49c926,null))[_0x946b('0x2a')](function(_0x3b0008){if(_0x3b0008){_0x592793=_0x3b0008;_0x269a7[_0x946b('0x34')]=_['keys'](db['User']['rawAttributes']);_0x269a7[_0x946b('0x35')]=_[_0x946b('0x36')](_0x5c6c66[_0x946b('0x35')]);_0x269a7[_0x946b('0x37')]=_[_0x946b('0x38')](_0x269a7[_0x946b('0x34')],_0x269a7[_0x946b('0x35')]);_0x3553c6['attributes']=_[_0x946b('0x38')](_0x269a7[_0x946b('0x34')],qs[_0x946b('0x3a')](_0x5c6c66[_0x946b('0x35')][_0x946b('0x3a')]));_0x3553c6[_0x946b('0x39')]=_0x3553c6[_0x946b('0x39')][_0x946b('0x3b')]?_0x3553c6['attributes']:_0x269a7[_0x946b('0x34')];_0x3553c6[_0x946b('0x59')]=qs['sort'](_0x5c6c66[_0x946b('0x35')][_0x946b('0x3e')]);_0x3553c6['where']=qs['filters'](_[_0x946b('0x3f')](_0x5c6c66['query'],_0x269a7['filters']));if(_0x5c6c66[_0x946b('0x35')][_0x946b('0x40')]){_0x3553c6['where']=_['merge'](_0x3553c6[_0x946b('0x41')],{'$or':_['map'](_0x3553c6[_0x946b('0x39')],function(_0x5d402f){var _0x5e8ea4={};_0x5e8ea4[_0x5d402f]={'$like':'%'+_0x5c6c66[_0x946b('0x35')][_0x946b('0x40')]+'%'};return _0x5e8ea4;})});}_0x3553c6=_[_0x946b('0x42')]({},_0x3553c6,_0x5c6c66[_0x946b('0x44')]);return _0x592793[_0x946b('0x57')](_0x3553c6);}})[_0x946b('0x2a')](function(_0x4b45eb){if(_0x4b45eb){_0x201f78=_0x4b45eb[_0x946b('0x3b')];if(!_0x5c6c66['query'][_0x946b('0x3c')](_0x946b('0x3d'))){_0x3553c6[_0x946b('0x23')]=qs[_0x946b('0x23')](_0x5c6c66['query']['limit']);_0x3553c6['offset']=qs[_0x946b('0x20')](_0x5c6c66['query'][_0x946b('0x20')]);}return _0x592793[_0x946b('0x57')](_0x3553c6);}})[_0x946b('0x2a')](function(_0x41dd58){if(_0x41dd58){return _0x41dd58?{'count':_0x201f78,'rows':_0x41dd58}:null;}})[_0x946b('0x2a')](respondWithResult(_0x49c926,null))[_0x946b('0x4d')](handleError(_0x49c926,null));};exports[_0x946b('0x5a')]=function(_0x1e8b58,_0x26ef7e,_0xe0f6c8){return db[_0x946b('0x45')][_0x946b('0x4c')]({'where':{'id':_0x1e8b58['params']['id']}})[_0x946b('0x2a')](handleEntityNotFound(_0x26ef7e,null))['then'](function(_0x257400){if(_0x257400){return _0x257400[_0x946b('0x5a')](_0x1e8b58['query'][_0x946b('0x55')]);}})[_0x946b('0x2a')](respondWithStatusCode(_0x26ef7e,null))['catch'](handleError(_0x26ef7e,null));};exports['addMessage']=function(_0x46479f,_0x2b6c98,_0x2e6790){if(_0x46479f[_0x946b('0x4f')]['id']){delete _0x46479f[_0x946b('0x4f')]['id'];}return db[_0x946b('0x45')][_0x946b('0x4c')]({'where':{'id':_0x46479f[_0x946b('0x4a')]['id']}})[_0x946b('0x2a')](handleEntityNotFound(_0x2b6c98,null))[_0x946b('0x2a')](function(_0x3ed570){if(_0x3ed570){_0x46479f[_0x946b('0x4f')][_0x946b('0x5b')]=_0x3ed570['id'];return db[_0x946b('0x51')][_0x946b('0x4e')](_0x46479f[_0x946b('0x4f')]);}})[_0x946b('0x2a')](respondWithResult(_0x2b6c98,null))[_0x946b('0x4d')](handleError(_0x2b6c98,null));};exports[_0x946b('0x5c')]=function(_0x468e60,_0x4973b7,_0x1eccda){var _0x3a1cb1={};var _0x3190ed={};var _0x190b95;var _0xd15be3;return db[_0x946b('0x45')][_0x946b('0x58')]({'where':{'id':_0x468e60[_0x946b('0x4a')]['id']}})[_0x946b('0x2a')](handleEntityNotFound(_0x4973b7,null))[_0x946b('0x2a')](function(_0x66f599){if(_0x66f599){_0x190b95=_0x66f599;_0x3190ed[_0x946b('0x34')]=_[_0x946b('0x36')](db[_0x946b('0x51')]['rawAttributes']);_0x3190ed[_0x946b('0x35')]=_['keys'](_0x468e60['query']);_0x3190ed[_0x946b('0x37')]=_['intersection'](_0x3190ed[_0x946b('0x34')],_0x3190ed[_0x946b('0x35')]);_0x3a1cb1[_0x946b('0x39')]=_['intersection'](_0x3190ed[_0x946b('0x34')],qs[_0x946b('0x3a')](_0x468e60[_0x946b('0x35')]['fields']));_0x3a1cb1[_0x946b('0x39')]=_0x3a1cb1[_0x946b('0x39')][_0x946b('0x3b')]?_0x3a1cb1[_0x946b('0x39')]:_0x3190ed[_0x946b('0x34')];_0x3a1cb1[_0x946b('0x59')]=qs[_0x946b('0x3e')](_0x468e60['query'][_0x946b('0x3e')]);_0x3a1cb1[_0x946b('0x41')]=qs[_0x946b('0x37')](_[_0x946b('0x3f')](_0x468e60[_0x946b('0x35')],_0x3190ed[_0x946b('0x37')]));if(_0x468e60['query'][_0x946b('0x40')]){_0x3a1cb1[_0x946b('0x41')]=_[_0x946b('0x42')](_0x3a1cb1[_0x946b('0x41')],{'$or':_['map'](_0x3a1cb1[_0x946b('0x39')],function(_0xb96e5b){var _0x42b899={};_0x42b899[_0xb96e5b]={'$like':'%'+_0x468e60[_0x946b('0x35')][_0x946b('0x40')]+'%'};return _0x42b899;})});}if(_0x468e60[_0x946b('0x35')][_0x946b('0x5d')]){var _0x3ab846=_0x468e60[_0x946b('0x35')][_0x946b('0x5d')]['split'](',');var _0x447b87={};_0x447b87[_0x3ab846[0x0]]={'$gte':moment(_0x3ab846[0x1])[_0x946b('0x5e')](_0x946b('0x5f'))};_0x3a1cb1[_0x946b('0x41')]=_[_0x946b('0x42')](_0x3a1cb1[_0x946b('0x41')],_0x447b87);}_0x3a1cb1=_[_0x946b('0x42')]({},_0x3a1cb1,_0x468e60[_0x946b('0x44')]);return _0x190b95['getMessages'](_0x3a1cb1);}})[_0x946b('0x2a')](function(_0x33f872){if(_0x33f872){_0xd15be3=_0x33f872[_0x946b('0x3b')];if(!_0x468e60[_0x946b('0x35')][_0x946b('0x3c')]('nolimit')){_0x3a1cb1[_0x946b('0x23')]=qs[_0x946b('0x23')](_0x468e60[_0x946b('0x35')]['limit']);_0x3a1cb1[_0x946b('0x20')]=qs[_0x946b('0x20')](_0x468e60[_0x946b('0x35')][_0x946b('0x20')]);}return _0x190b95[_0x946b('0x5c')](_0x3a1cb1);}})['then'](function(_0x2fb860){if(_0x2fb860){return _0x2fb860?{'count':_0xd15be3,'rows':_0x2fb860}:null;}})[_0x946b('0x2a')](respondWithResult(_0x4973b7,null))['catch'](handleError(_0x4973b7,null));};
\ No newline at end of file
+var _0xf9db=['removeMembers','addMessage','ChatGroupId','getMessages','findOne','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','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','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','register','sendStatus','end','json','limit','offset','count','status','set','apply','reject','save','then','error','name','send','map','ChatGroup','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','create','body','update','destroy','find','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','omit','getMembers','filter'];(function(_0x31c19c,_0xbe4b70){var _0x1a87f7=function(_0x23cf92){while(--_0x23cf92){_0x31c19c['push'](_0x31c19c['shift']());}};_0x1a87f7(++_0xbe4b70);}(_0xf9db,0x6b));var _0xbf9d=function(_0x33c69b,_0x3ffbcd){_0x33c69b=_0x33c69b-0x0;var _0x160012=_0xf9db[_0x33c69b];return _0x160012;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbf9d('0x0'));var zipdir=require(_0xbf9d('0x1'));var jsonpatch=require(_0xbf9d('0x2'));var rp=require(_0xbf9d('0x3'));var moment=require(_0xbf9d('0x4'));var BPromise=require(_0xbf9d('0x5'));var Mustache=require(_0xbf9d('0x6'));var util=require(_0xbf9d('0x7'));var path=require(_0xbf9d('0x8'));var sox=require(_0xbf9d('0x9'));var csv=require(_0xbf9d('0xa'));var ejs=require(_0xbf9d('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbf9d('0xc'));var squel=require('squel');var crypto=require(_0xbf9d('0xd'));var jsforce=require(_0xbf9d('0xe'));var deskjs=require(_0xbf9d('0xf'));var toCsv=require(_0xbf9d('0xa'));var querystring=require(_0xbf9d('0x10'));var Papa=require(_0xbf9d('0x11'));var Redis=require(_0xbf9d('0x12'));var authService=require(_0xbf9d('0x13'));var qs=require(_0xbf9d('0x14'));var as=require(_0xbf9d('0x15'));var hardwareService=require(_0xbf9d('0x16'));var logger=require(_0xbf9d('0x17'))('api');var utils=require(_0xbf9d('0x18'));var config=require(_0xbf9d('0x19'));var licenseUtil=require(_0xbf9d('0x1a'));var db=require('../../mysqldb')['db'];config[_0xbf9d('0x1b')]=_['defaults'](config['redis'],{'host':_0xbf9d('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbf9d('0x1b')]));require('./chatGroup.socket')[_0xbf9d('0x1d')](socket);function respondWithStatusCode(_0x343aec,_0x160cb7){_0x160cb7=_0x160cb7||0xcc;return function(_0x116022){if(_0x116022){return _0x343aec[_0xbf9d('0x1e')](_0x160cb7);}return _0x343aec['status'](_0x160cb7)[_0xbf9d('0x1f')]();};}function respondWithResult(_0x16b089,_0x1d2083){_0x1d2083=_0x1d2083||0xc8;return function(_0x212da7){if(_0x212da7){return _0x16b089['status'](_0x1d2083)[_0xbf9d('0x20')](_0x212da7);}};}function respondWithFilteredResult(_0x49a443,_0x3feca7){return function(_0x4c9a4a){if(_0x4c9a4a){var _0x2620dd=typeof _0x3feca7['offset']==='undefined'&&typeof _0x3feca7[_0xbf9d('0x21')]==='undefined';var _0x4978d6=_0x4c9a4a['count'];var _0x2816b5=_0x2620dd?0x0:_0x3feca7[_0xbf9d('0x22')];var _0x5c8541=_0x2620dd?_0x4c9a4a[_0xbf9d('0x23')]:_0x3feca7[_0xbf9d('0x22')]+_0x3feca7[_0xbf9d('0x21')];var _0x39ad69;if(_0x5c8541>=_0x4978d6){_0x5c8541=_0x4978d6;_0x39ad69=0xc8;}else{_0x39ad69=0xce;}_0x49a443[_0xbf9d('0x24')](_0x39ad69);return _0x49a443[_0xbf9d('0x25')]('Content-Range',_0x2816b5+'-'+_0x5c8541+'/'+_0x4978d6)['json'](_0x4c9a4a);}return null;};}function patchUpdates(_0x3733e7){return function(_0x41978f){try{jsonpatch[_0xbf9d('0x26')](_0x41978f,_0x3733e7,!![]);}catch(_0x2412a3){return BPromise[_0xbf9d('0x27')](_0x2412a3);}return _0x41978f[_0xbf9d('0x28')]();};}function saveUpdates(_0xf73c5b,_0x46725f){return function(_0x32601e){if(_0x32601e){return _0x32601e['update'](_0xf73c5b)[_0xbf9d('0x29')](function(_0x1aee9e){return _0x1aee9e;});}return null;};}function removeEntity(_0x2880b5,_0x467f9a){return function(_0x1a7986){if(_0x1a7986){return _0x1a7986['destroy']()[_0xbf9d('0x29')](function(){_0x2880b5[_0xbf9d('0x24')](0xcc)[_0xbf9d('0x1f')]();});}};}function handleEntityNotFound(_0x4c0830,_0x1c5a18){return function(_0x39fca6){if(!_0x39fca6){_0x4c0830[_0xbf9d('0x1e')](0x194);}return _0x39fca6;};}function handleError(_0x4be7ff,_0x18f42b){_0x18f42b=_0x18f42b||0x1f4;return function(_0x34a6d6){logger[_0xbf9d('0x2a')](_0x34a6d6['stack']);if(_0x34a6d6['name']){delete _0x34a6d6[_0xbf9d('0x2b')];}_0x4be7ff[_0xbf9d('0x24')](_0x18f42b)[_0xbf9d('0x2c')](_0x34a6d6);};}exports['index']=function(_0x412ba9,_0xf8c497){var _0x27b22f={},_0x59850c={},_0xfb8799={'count':0x0,'rows':[]};var _0x1aa726=_[_0xbf9d('0x2d')](db[_0xbf9d('0x2e')][_0xbf9d('0x2f')],function(_0x22ad39){return{'name':_0x22ad39[_0xbf9d('0x30')],'type':_0x22ad39[_0xbf9d('0x31')][_0xbf9d('0x32')]};});_0x59850c[_0xbf9d('0x33')]=_[_0xbf9d('0x2d')](_0x1aa726,_0xbf9d('0x2b'));_0x59850c[_0xbf9d('0x34')]=_[_0xbf9d('0x35')](_0x412ba9[_0xbf9d('0x34')]);_0x59850c[_0xbf9d('0x36')]=_[_0xbf9d('0x37')](_0x59850c[_0xbf9d('0x33')],_0x59850c[_0xbf9d('0x34')]);_0x27b22f[_0xbf9d('0x38')]=_[_0xbf9d('0x37')](_0x59850c[_0xbf9d('0x33')],qs['fields'](_0x412ba9[_0xbf9d('0x34')][_0xbf9d('0x39')]));_0x27b22f['attributes']=_0x27b22f[_0xbf9d('0x38')]['length']?_0x27b22f[_0xbf9d('0x38')]:_0x59850c[_0xbf9d('0x33')];if(!_0x412ba9[_0xbf9d('0x34')][_0xbf9d('0x3a')](_0xbf9d('0x3b'))){_0x27b22f[_0xbf9d('0x21')]=qs['limit'](_0x412ba9['query'][_0xbf9d('0x21')]);_0x27b22f[_0xbf9d('0x22')]=qs[_0xbf9d('0x22')](_0x412ba9[_0xbf9d('0x34')]['offset']);}_0x27b22f[_0xbf9d('0x3c')]=qs[_0xbf9d('0x3d')](_0x412ba9[_0xbf9d('0x34')][_0xbf9d('0x3d')]);_0x27b22f[_0xbf9d('0x3e')]=qs[_0xbf9d('0x36')](_[_0xbf9d('0x3f')](_0x412ba9[_0xbf9d('0x34')],_0x59850c[_0xbf9d('0x36')]),_0x1aa726);if(_0x412ba9[_0xbf9d('0x34')]['filter']){_0x27b22f[_0xbf9d('0x3e')]=_[_0xbf9d('0x40')](_0x27b22f[_0xbf9d('0x3e')],{'$or':_[_0xbf9d('0x2d')](_0x1aa726,function(_0x351208){if(_0x351208[_0xbf9d('0x31')]!==_0xbf9d('0x41')){var _0x1a0ad3={};_0x1a0ad3[_0x351208[_0xbf9d('0x2b')]]={'$like':'%'+_0x412ba9[_0xbf9d('0x34')]['filter']+'%'};return _0x1a0ad3;}})});}_0x27b22f=_[_0xbf9d('0x40')]({},_0x27b22f,_0x412ba9[_0xbf9d('0x42')]);var _0x5d7bc8={'where':_0x27b22f[_0xbf9d('0x3e')]};return db[_0xbf9d('0x2e')][_0xbf9d('0x23')](_0x5d7bc8)[_0xbf9d('0x29')](function(_0x30a497){_0xfb8799[_0xbf9d('0x23')]=_0x30a497;if(_0x412ba9[_0xbf9d('0x34')][_0xbf9d('0x43')]){_0x27b22f['include']=[{'all':!![]}];}return db[_0xbf9d('0x2e')][_0xbf9d('0x44')](_0x27b22f);})[_0xbf9d('0x29')](function(_0xbfca1b){_0xfb8799[_0xbf9d('0x45')]=_0xbfca1b;return _0xfb8799;})[_0xbf9d('0x29')](respondWithFilteredResult(_0xf8c497,_0x27b22f))[_0xbf9d('0x46')](handleError(_0xf8c497,null));};exports[_0xbf9d('0x47')]=function(_0x8b9db4,_0x58862f){var _0x522670={'raw':!![],'where':{'id':_0x8b9db4[_0xbf9d('0x48')]['id']}},_0xdbda2c={};_0xdbda2c[_0xbf9d('0x33')]=_[_0xbf9d('0x35')](db['ChatGroup'][_0xbf9d('0x2f')]);_0xdbda2c[_0xbf9d('0x34')]=_[_0xbf9d('0x35')](_0x8b9db4[_0xbf9d('0x34')]);_0xdbda2c['filters']=_[_0xbf9d('0x37')](_0xdbda2c[_0xbf9d('0x33')],_0xdbda2c[_0xbf9d('0x34')]);_0x522670[_0xbf9d('0x38')]=_['intersection'](_0xdbda2c[_0xbf9d('0x33')],qs[_0xbf9d('0x39')](_0x8b9db4['query']['fields']));_0x522670[_0xbf9d('0x38')]=_0x522670[_0xbf9d('0x38')][_0xbf9d('0x49')]?_0x522670[_0xbf9d('0x38')]:_0xdbda2c[_0xbf9d('0x33')];if(_0x8b9db4['query'][_0xbf9d('0x43')]){_0x522670[_0xbf9d('0x4a')]=[{'all':!![]}];}_0x522670=_[_0xbf9d('0x40')]({},_0x522670,_0x8b9db4[_0xbf9d('0x42')]);return db[_0xbf9d('0x2e')]['find'](_0x522670)[_0xbf9d('0x29')](handleEntityNotFound(_0x58862f,null))['then'](respondWithResult(_0x58862f,null))[_0xbf9d('0x46')](handleError(_0x58862f,null));};exports[_0xbf9d('0x4b')]=function(_0x3f807b,_0x5ee722){return db[_0xbf9d('0x2e')][_0xbf9d('0x4b')](_0x3f807b[_0xbf9d('0x4c')],{})['then'](respondWithResult(_0x5ee722,0xc9))[_0xbf9d('0x46')](handleError(_0x5ee722,null));};exports[_0xbf9d('0x4d')]=function(_0x12fd47,_0xb5d910){if(_0x12fd47[_0xbf9d('0x4c')]['id']){delete _0x12fd47[_0xbf9d('0x4c')]['id'];}return db[_0xbf9d('0x2e')]['find']({'where':{'id':_0x12fd47['params']['id']}})[_0xbf9d('0x29')](handleEntityNotFound(_0xb5d910,null))[_0xbf9d('0x29')](saveUpdates(_0x12fd47[_0xbf9d('0x4c')],null))['then'](respondWithResult(_0xb5d910,null))[_0xbf9d('0x46')](handleError(_0xb5d910,null));};exports[_0xbf9d('0x4e')]=function(_0x2798d0,_0x597c5c){return db[_0xbf9d('0x2e')][_0xbf9d('0x4f')]({'where':{'id':_0x2798d0[_0xbf9d('0x48')]['id']}})[_0xbf9d('0x29')](handleEntityNotFound(_0x597c5c,null))[_0xbf9d('0x29')](removeEntity(_0x597c5c,null))[_0xbf9d('0x46')](handleError(_0x597c5c,null));};exports[_0xbf9d('0x50')]=function(_0x58d4d6,_0x5d98e4){return db[_0xbf9d('0x2e')]['describe']()['then'](respondWithResult(_0x5d98e4,null))[_0xbf9d('0x46')](handleError(_0x5d98e4,null));};exports[_0xbf9d('0x51')]=function(_0x389184,_0x3461d2,_0xccd720){return db[_0xbf9d('0x52')][_0xbf9d('0x23')]({'where':{'ChatGroupId':_0x389184['params']['id'],'ToId':_0x389184['user']['id'],'read':![]}})['then'](function(_0x204383){return{'id':_[_0xbf9d('0x53')](_0x389184[_0xbf9d('0x48')]['id']),'count':_0x204383};})[_0xbf9d('0x29')](respondWithResult(_0x3461d2,null))[_0xbf9d('0x46')](handleError(_0x3461d2,null));};exports[_0xbf9d('0x54')]=function(_0x564dd8,_0x742d8a,_0x2b0c93){return db[_0xbf9d('0x2e')][_0xbf9d('0x4f')]({'where':{'id':_0x564dd8[_0xbf9d('0x48')]['id']}})[_0xbf9d('0x29')](handleEntityNotFound(_0x742d8a,null))[_0xbf9d('0x29')](function(_0x1c8523){if(_0x1c8523){return _0x1c8523[_0xbf9d('0x54')](_0x564dd8[_0xbf9d('0x4c')][_0xbf9d('0x55')],_[_0xbf9d('0x56')](_0x564dd8['body'],[_0xbf9d('0x55'),'id'])||{});}})[_0xbf9d('0x29')](respondWithResult(_0x742d8a,null))[_0xbf9d('0x46')](handleError(_0x742d8a,null));};exports[_0xbf9d('0x57')]=function(_0x21d89a,_0x5c65e5,_0x3d8842){var _0x34be0f={};var _0x3d2e1c={};var _0x31b6b7;var _0x252b20;return db[_0xbf9d('0x2e')]['findOne']({'where':{'id':_0x21d89a['params']['id']}})[_0xbf9d('0x29')](handleEntityNotFound(_0x5c65e5,null))['then'](function(_0x52f267){if(_0x52f267){_0x31b6b7=_0x52f267;_0x3d2e1c[_0xbf9d('0x33')]=_[_0xbf9d('0x35')](db['User'][_0xbf9d('0x2f')]);_0x3d2e1c['query']=_[_0xbf9d('0x35')](_0x21d89a['query']);_0x3d2e1c[_0xbf9d('0x36')]=_['intersection'](_0x3d2e1c[_0xbf9d('0x33')],_0x3d2e1c['query']);_0x34be0f[_0xbf9d('0x38')]=_['intersection'](_0x3d2e1c[_0xbf9d('0x33')],qs[_0xbf9d('0x39')](_0x21d89a[_0xbf9d('0x34')][_0xbf9d('0x39')]));_0x34be0f[_0xbf9d('0x38')]=_0x34be0f[_0xbf9d('0x38')][_0xbf9d('0x49')]?_0x34be0f[_0xbf9d('0x38')]:_0x3d2e1c[_0xbf9d('0x33')];_0x34be0f[_0xbf9d('0x3c')]=qs[_0xbf9d('0x3d')](_0x21d89a[_0xbf9d('0x34')]['sort']);_0x34be0f[_0xbf9d('0x3e')]=qs['filters'](_[_0xbf9d('0x3f')](_0x21d89a[_0xbf9d('0x34')],_0x3d2e1c[_0xbf9d('0x36')]));if(_0x21d89a[_0xbf9d('0x34')][_0xbf9d('0x58')]){_0x34be0f[_0xbf9d('0x3e')]=_[_0xbf9d('0x40')](_0x34be0f[_0xbf9d('0x3e')],{'$or':_[_0xbf9d('0x2d')](_0x34be0f[_0xbf9d('0x38')],function(_0x30f369){var _0x3d60da={};_0x3d60da[_0x30f369]={'$like':'%'+_0x21d89a[_0xbf9d('0x34')]['filter']+'%'};return _0x3d60da;})});}_0x34be0f=_[_0xbf9d('0x40')]({},_0x34be0f,_0x21d89a[_0xbf9d('0x42')]);return _0x31b6b7[_0xbf9d('0x57')](_0x34be0f);}})[_0xbf9d('0x29')](function(_0x230b25){if(_0x230b25){_0x252b20=_0x230b25[_0xbf9d('0x49')];if(!_0x21d89a[_0xbf9d('0x34')][_0xbf9d('0x3a')]('nolimit')){_0x34be0f[_0xbf9d('0x21')]=qs[_0xbf9d('0x21')](_0x21d89a['query'][_0xbf9d('0x21')]);_0x34be0f['offset']=qs[_0xbf9d('0x22')](_0x21d89a[_0xbf9d('0x34')][_0xbf9d('0x22')]);}return _0x31b6b7[_0xbf9d('0x57')](_0x34be0f);}})[_0xbf9d('0x29')](function(_0x66aa3d){if(_0x66aa3d){return _0x66aa3d?{'count':_0x252b20,'rows':_0x66aa3d}:null;}})[_0xbf9d('0x29')](respondWithResult(_0x5c65e5,null))[_0xbf9d('0x46')](handleError(_0x5c65e5,null));};exports[_0xbf9d('0x59')]=function(_0x494f6c,_0x443e07,_0x95ebf){return db[_0xbf9d('0x2e')][_0xbf9d('0x4f')]({'where':{'id':_0x494f6c['params']['id']}})[_0xbf9d('0x29')](handleEntityNotFound(_0x443e07,null))[_0xbf9d('0x29')](function(_0x5ae527){if(_0x5ae527){return _0x5ae527[_0xbf9d('0x59')](_0x494f6c[_0xbf9d('0x34')][_0xbf9d('0x55')]);}})[_0xbf9d('0x29')](respondWithStatusCode(_0x443e07,null))[_0xbf9d('0x46')](handleError(_0x443e07,null));};exports[_0xbf9d('0x5a')]=function(_0x4bab02,_0x51cbd7,_0x239bca){if(_0x4bab02['body']['id']){delete _0x4bab02['body']['id'];}return db[_0xbf9d('0x2e')]['find']({'where':{'id':_0x4bab02['params']['id']}})['then'](handleEntityNotFound(_0x51cbd7,null))[_0xbf9d('0x29')](function(_0x41d69e){if(_0x41d69e){_0x4bab02[_0xbf9d('0x4c')][_0xbf9d('0x5b')]=_0x41d69e['id'];return db[_0xbf9d('0x52')]['create'](_0x4bab02[_0xbf9d('0x4c')]);}})[_0xbf9d('0x29')](respondWithResult(_0x51cbd7,null))['catch'](handleError(_0x51cbd7,null));};exports[_0xbf9d('0x5c')]=function(_0x173c01,_0x1dcee2,_0x42103e){var _0x13ea25={};var _0x5c643d={};var _0xc198db;var _0x51a9e6;return db['ChatGroup'][_0xbf9d('0x5d')]({'where':{'id':_0x173c01[_0xbf9d('0x48')]['id']}})[_0xbf9d('0x29')](handleEntityNotFound(_0x1dcee2,null))[_0xbf9d('0x29')](function(_0x1529a7){if(_0x1529a7){_0xc198db=_0x1529a7;_0x5c643d['model']=_[_0xbf9d('0x35')](db[_0xbf9d('0x52')][_0xbf9d('0x2f')]);_0x5c643d[_0xbf9d('0x34')]=_[_0xbf9d('0x35')](_0x173c01[_0xbf9d('0x34')]);_0x5c643d[_0xbf9d('0x36')]=_[_0xbf9d('0x37')](_0x5c643d['model'],_0x5c643d[_0xbf9d('0x34')]);_0x13ea25[_0xbf9d('0x38')]=_[_0xbf9d('0x37')](_0x5c643d[_0xbf9d('0x33')],qs[_0xbf9d('0x39')](_0x173c01[_0xbf9d('0x34')][_0xbf9d('0x39')]));_0x13ea25['attributes']=_0x13ea25[_0xbf9d('0x38')]['length']?_0x13ea25[_0xbf9d('0x38')]:_0x5c643d['model'];_0x13ea25[_0xbf9d('0x3c')]=qs['sort'](_0x173c01[_0xbf9d('0x34')][_0xbf9d('0x3d')]);_0x13ea25[_0xbf9d('0x3e')]=qs[_0xbf9d('0x36')](_['pick'](_0x173c01['query'],_0x5c643d[_0xbf9d('0x36')]));if(_0x173c01[_0xbf9d('0x34')][_0xbf9d('0x58')]){_0x13ea25[_0xbf9d('0x3e')]=_[_0xbf9d('0x40')](_0x13ea25[_0xbf9d('0x3e')],{'$or':_[_0xbf9d('0x2d')](_0x13ea25[_0xbf9d('0x38')],function(_0x2ca957){var _0x4d55e1={};_0x4d55e1[_0x2ca957]={'$like':'%'+_0x173c01[_0xbf9d('0x34')][_0xbf9d('0x58')]+'%'};return _0x4d55e1;})});}if(_0x173c01[_0xbf9d('0x34')][_0xbf9d('0x5e')]){var _0x40409e=_0x173c01[_0xbf9d('0x34')][_0xbf9d('0x5e')][_0xbf9d('0x5f')](',');var _0x6ebc90={};_0x6ebc90[_0x40409e[0x0]]={'$gte':moment(_0x40409e[0x1])[_0xbf9d('0x60')](_0xbf9d('0x61'))};_0x13ea25[_0xbf9d('0x3e')]=_[_0xbf9d('0x40')](_0x13ea25['where'],_0x6ebc90);}_0x13ea25=_['merge']({},_0x13ea25,_0x173c01[_0xbf9d('0x42')]);return _0xc198db[_0xbf9d('0x5c')](_0x13ea25);}})[_0xbf9d('0x29')](function(_0x2d37b6){if(_0x2d37b6){_0x51a9e6=_0x2d37b6['length'];if(!_0x173c01[_0xbf9d('0x34')][_0xbf9d('0x3a')](_0xbf9d('0x3b'))){_0x13ea25['limit']=qs[_0xbf9d('0x21')](_0x173c01['query'][_0xbf9d('0x21')]);_0x13ea25[_0xbf9d('0x22')]=qs[_0xbf9d('0x22')](_0x173c01[_0xbf9d('0x34')][_0xbf9d('0x22')]);}return _0xc198db[_0xbf9d('0x5c')](_0x13ea25);}})[_0xbf9d('0x29')](function(_0x4ef2be){if(_0x4ef2be){return _0x4ef2be?{'count':_0x51a9e6,'rows':_0x4ef2be}:null;}})[_0xbf9d('0x29')](respondWithResult(_0x1dcee2,null))['catch'](handleError(_0x1dcee2,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 6849f7b..a35eac1 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 _0xe3cf=['hasOwnProperty','hook','exports','events','ChatGroup','remove','emit'];(function(_0x53cf1c,_0x2c2b16){var _0x27221a=function(_0x104d7c){while(--_0x104d7c){_0x53cf1c['push'](_0x53cf1c['shift']());}};_0x27221a(++_0x2c2b16);}(_0xe3cf,0x16f));var _0xfe3c=function(_0x112df4,_0x14bb3d){_0x112df4=_0x112df4-0x0;var _0x4c2a76=_0xe3cf[_0x112df4];return _0x4c2a76;};'use strict';var EventEmitter=require(_0xfe3c('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0xfe3c('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xfe3c('0x2')};function emitEvent(_0x2fc7c5){return function(_0x1e474a,_0x32bb6b,_0x1ced6d){ChatGroupEvents[_0xfe3c('0x3')](_0x2fc7c5+':'+_0x1e474a['id'],_0x1e474a);ChatGroupEvents['emit'](_0x2fc7c5,_0x1e474a);_0x1ced6d(null);};}for(var e in events){if(events[_0xfe3c('0x4')](e)){var event=events[e];ChatGroup[_0xfe3c('0x5')](e,emitEvent(event));}}module[_0xfe3c('0x6')]=ChatGroupEvents;
\ No newline at end of file
+var _0x3d49=['emit','../../mysqldb','ChatGroup','setMaxListeners','save','remove'];(function(_0x53a738,_0x363a12){var _0x28b643=function(_0x517a08){while(--_0x517a08){_0x53a738['push'](_0x53a738['shift']());}};_0x28b643(++_0x363a12);}(_0x3d49,0x151));var _0x93d4=function(_0x4e90e3,_0x570a1d){_0x4e90e3=_0x4e90e3-0x0;var _0x295e5b=_0x3d49[_0x4e90e3];return _0x295e5b;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x93d4('0x0'))['db'][_0x93d4('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x93d4('0x2')](0x0);var events={'afterCreate':_0x93d4('0x3'),'afterUpdate':'update','afterDestroy':_0x93d4('0x4')};function emitEvent(_0x9846c2){return function(_0xa1de2e,_0x41313a,_0x20e6c7){ChatGroupEvents[_0x93d4('0x5')](_0x9846c2+':'+_0xa1de2e['id'],_0xa1de2e);ChatGroupEvents['emit'](_0x9846c2,_0xa1de2e);_0x20e6c7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index fd0a534..3d91dd7 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 _0x6d5e=['request-promise','path','rimraf','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1bbb91,_0xc65ae3){var _0x46053a=function(_0x3e174e){while(--_0x3e174e){_0x1bbb91['push'](_0x1bbb91['shift']());}};_0x46053a(++_0xc65ae3);}(_0x6d5e,0x190));var _0xe6d5=function(_0x4f8196,_0x6ce644){_0x4f8196=_0x4f8196-0x0;var _0x1d62b3=_0x6d5e[_0x4f8196];return _0x1d62b3;};'use strict';var _=require(_0xe6d5('0x0'));var util=require(_0xe6d5('0x1'));var logger=require(_0xe6d5('0x2'))(_0xe6d5('0x3'));var moment=require(_0xe6d5('0x4'));var BPromise=require(_0xe6d5('0x5'));var rp=require(_0xe6d5('0x6'));var fs=require('fs');var path=require(_0xe6d5('0x7'));var rimraf=require(_0xe6d5('0x8'));var config=require('../../config/environment');var attributes=require(_0xe6d5('0x9'));module[_0xe6d5('0xa')]=function(_0x42afed,_0x10206e){return _0x42afed[_0xe6d5('0xb')](_0xe6d5('0xc'),attributes,{'tableName':_0xe6d5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd026=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','define','ChatGroup','chat_groups','lodash','../../config/logger','api'];(function(_0x142531,_0x2c3f6f){var _0x4df971=function(_0x5c80b2){while(--_0x5c80b2){_0x142531['push'](_0x142531['shift']());}};_0x4df971(++_0x2c3f6f);}(_0xd026,0xa6));var _0x6d02=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xd026[_0x4fc9e6];return _0x551d28;};'use strict';var _=require(_0x6d02('0x0'));var util=require('util');var logger=require(_0x6d02('0x1'))(_0x6d02('0x2'));var moment=require(_0x6d02('0x3'));var BPromise=require(_0x6d02('0x4'));var rp=require(_0x6d02('0x5'));var fs=require('fs');var path=require(_0x6d02('0x6'));var rimraf=require(_0x6d02('0x7'));var config=require(_0x6d02('0x8'));var attributes=require(_0x6d02('0x9'));module['exports']=function(_0x47d8ef,_0x401e07){return _0x47d8ef[_0x6d02('0xa')](_0x6d02('0xb'),attributes,{'tableName':_0x6d02('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 a4ffe8e..f96966e 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 _0xa37e=['ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./chatGroup.socket','request','then','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','moment','bluebird','randomstring'];(function(_0x45961f,_0x40c9ba){var _0x57d209=function(_0x2f0c03){while(--_0x2f0c03){_0x45961f['push'](_0x45961f['shift']());}};_0x57d209(++_0x40c9ba);}(_0xa37e,0x97));var _0xea37=function(_0x5723f9,_0x294319){_0x5723f9=_0x5723f9-0x0;var _0x1c021c=_0xa37e[_0x5723f9];return _0x1c021c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xea37('0x0'));var BPromise=require(_0xea37('0x1'));var rs=require(_0xea37('0x2'));var fs=require('fs');var Redis=require(_0xea37('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xea37('0x4'));var logger=require('../../config/logger')(_0xea37('0x5'));var config=require(_0xea37('0x6'));var jayson=require(_0xea37('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0xea37('0x8')]=_['defaults'](config['redis'],{'host':_0xea37('0x9'),'port':0x18eb});var socket=require(_0xea37('0xa'))(new Redis(config[_0xea37('0x8')]));require(_0xea37('0xb'))['register'](socket);function respondWithRpcPromise(_0x315e5f,_0x37ca45,_0x8371a){return new BPromise(function(_0x55d4de,_0x5060cd){return client[_0xea37('0xc')](_0x315e5f,_0x8371a)[_0xea37('0xd')](function(_0x3cd18b){logger['info'](_0xea37('0xe'),_0x37ca45,_0xea37('0xf'));logger[_0xea37('0x10')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x37ca45,_0xea37('0xf'),JSON[_0xea37('0x11')](_0x3cd18b));if(_0x3cd18b['error']){if(_0x3cd18b[_0xea37('0x12')]['code']===0x1f4){logger[_0xea37('0x12')]('ChatGroup,\x20%s,\x20%s',_0x37ca45,_0x3cd18b[_0xea37('0x12')][_0xea37('0x13')]);return _0x5060cd(_0x3cd18b[_0xea37('0x12')][_0xea37('0x13')]);}logger['error'](_0xea37('0xe'),_0x37ca45,_0x3cd18b['error']['message']);return _0x55d4de(_0x3cd18b[_0xea37('0x12')]['message']);}else{logger[_0xea37('0x14')](_0xea37('0xe'),_0x37ca45,'request\x20sent');_0x55d4de(_0x3cd18b[_0xea37('0x15')][_0xea37('0x13')]);}})['catch'](function(_0x786ee5){logger[_0xea37('0x12')](_0xea37('0xe'),_0x37ca45,_0x786ee5);_0x5060cd(_0x786ee5);});});}
\ No newline at end of file
+var _0xfef2=['message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','request\x20sent','debug','error','code','ChatGroup,\x20%s,\x20%s'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0xfef2,0x1e0));var _0x2fef=function(_0x606fe8,_0x10b084){_0x606fe8=_0x606fe8-0x0;var _0x28b517=_0xfef2[_0x606fe8];return _0x28b517;};'use strict';var _=require(_0x2fef('0x0'));var util=require(_0x2fef('0x1'));var moment=require(_0x2fef('0x2'));var BPromise=require('bluebird');var rs=require(_0x2fef('0x3'));var fs=require('fs');var Redis=require(_0x2fef('0x4'));var db=require(_0x2fef('0x5'))['db'];var utils=require(_0x2fef('0x6'));var logger=require('../../config/logger')(_0x2fef('0x7'));var config=require('../../config/environment');var jayson=require(_0x2fef('0x8'));var client=jayson[_0x2fef('0x9')][_0x2fef('0xa')]({'port':0x232a});config[_0x2fef('0xb')]=_[_0x2fef('0xc')](config[_0x2fef('0xb')],{'host':_0x2fef('0xd'),'port':0x18eb});var socket=require(_0x2fef('0xe'))(new Redis(config[_0x2fef('0xb')]));require(_0x2fef('0xf'))[_0x2fef('0x10')](socket);function respondWithRpcPromise(_0x4bce8d,_0x2042f5,_0x52982b){return new BPromise(function(_0x23a632,_0x389501){return client[_0x2fef('0x11')](_0x4bce8d,_0x52982b)[_0x2fef('0x12')](function(_0x3ac314){logger['info']('ChatGroup,\x20%s,\x20%s',_0x2042f5,_0x2fef('0x13'));logger[_0x2fef('0x14')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x2042f5,_0x2fef('0x13'),JSON['stringify'](_0x3ac314));if(_0x3ac314['error']){if(_0x3ac314[_0x2fef('0x15')][_0x2fef('0x16')]===0x1f4){logger[_0x2fef('0x15')](_0x2fef('0x17'),_0x2042f5,_0x3ac314[_0x2fef('0x15')][_0x2fef('0x18')]);return _0x389501(_0x3ac314[_0x2fef('0x15')]['message']);}logger['error'](_0x2fef('0x17'),_0x2042f5,_0x3ac314[_0x2fef('0x15')]['message']);return _0x23a632(_0x3ac314['error'][_0x2fef('0x18')]);}else{logger[_0x2fef('0x19')](_0x2fef('0x17'),_0x2042f5,_0x2fef('0x13'));_0x23a632(_0x3ac314[_0x2fef('0x1a')][_0x2fef('0x18')]);}})[_0x2fef('0x1b')](function(_0x394a20){logger[_0x2fef('0x15')](_0x2fef('0x17'),_0x2042f5,_0x394a20);_0x389501(_0x394a20);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index e1ce1a9..0fbd663 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 _0x577c=['register','length','./chatGroup.events','save','remove','update','removeListener'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x577c,0x9c));var _0xc577=function(_0x1d5ff0,_0x251781){_0x1d5ff0=_0x1d5ff0-0x0;var _0x9003ac=_0x577c[_0x1d5ff0];return _0x9003ac;};'use strict';var ChatGroupEvents=require(_0xc577('0x0'));var events=[_0xc577('0x1'),_0xc577('0x2'),_0xc577('0x3')];function createListener(_0x2c1dbe,_0x370e17){return function(_0x2e0e2a){_0x370e17['emit'](_0x2c1dbe,_0x2e0e2a);};}function removeListener(_0x47f25c,_0x5c6f7a){return function(){ChatGroupEvents[_0xc577('0x4')](_0x47f25c,_0x5c6f7a);};}exports[_0xc577('0x5')]=function(_0x4627b4){for(var _0x4fdcbd=0x0,_0x1c31d3=events[_0xc577('0x6')];_0x4fdcbd<_0x1c31d3;_0x4fdcbd++){var _0x258d69=events[_0x4fdcbd];var _0x7be767=createListener('chatGroup:'+_0x258d69,_0x4627b4);ChatGroupEvents['on'](_0x258d69,_0x7be767);}};
\ No newline at end of file
+var _0xe399=['remove','update','removeListener','register','length','./chatGroup.events','save'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0xe399,0x16a));var _0x9e39=function(_0x205afc,_0x16f412){_0x205afc=_0x205afc-0x0;var _0x4dae5a=_0xe399[_0x205afc];return _0x4dae5a;};'use strict';var ChatGroupEvents=require(_0x9e39('0x0'));var events=[_0x9e39('0x1'),_0x9e39('0x2'),_0x9e39('0x3')];function createListener(_0x28a01e,_0x195654){return function(_0x49dcde){_0x195654['emit'](_0x28a01e,_0x49dcde);};}function removeListener(_0x53b590,_0x3f9ca6){return function(){ChatGroupEvents[_0x9e39('0x4')](_0x53b590,_0x3f9ca6);};}exports[_0x9e39('0x5')]=function(_0x328a86){for(var _0x292caa=0x0,_0x271cde=events[_0x9e39('0x6')];_0x292caa<_0x271cde;_0x292caa++){var _0x5935fb=events[_0x292caa];var _0x25cff1=createListener('chatGroup:'+_0x5935fb,_0x328a86);ChatGroupEvents['on'](_0x5935fb,_0x25cff1);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 8bad05b..75b08de 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 _0x5a3b=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/unread','getUnread','/:id/members','/:id/messages','getMessages','post','create','addMessage','put','update'];(function(_0x427127,_0x3a4a16){var _0x22d8e7=function(_0x210c9f){while(--_0x210c9f){_0x427127['push'](_0x427127['shift']());}};_0x22d8e7(++_0x3a4a16);}(_0x5a3b,0x1bd));var _0xb5a3=function(_0x4682eb,_0x2bfc64){_0x4682eb=_0x4682eb-0x0;var _0x25ee36=_0x5a3b[_0x4682eb];return _0x25ee36;};'use strict';var multer=require(_0xb5a3('0x0'));var util=require(_0xb5a3('0x1'));var path=require(_0xb5a3('0x2'));var timeout=require(_0xb5a3('0x3'));var express=require(_0xb5a3('0x4'));var router=express[_0xb5a3('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb5a3('0x6'));var controller=require('./chatGroup.controller');router[_0xb5a3('0x7')]('/',auth[_0xb5a3('0x8')](),controller[_0xb5a3('0x9')]);router[_0xb5a3('0x7')]('/describe',auth[_0xb5a3('0x8')](),controller[_0xb5a3('0xa')]);router['get'](_0xb5a3('0xb'),auth['isAuthenticated'](),controller[_0xb5a3('0xc')]);router[_0xb5a3('0x7')](_0xb5a3('0xd'),auth[_0xb5a3('0x8')](),controller[_0xb5a3('0xe')]);router[_0xb5a3('0x7')](_0xb5a3('0xf'),auth[_0xb5a3('0x8')](),controller['getMembers']);router[_0xb5a3('0x7')](_0xb5a3('0x10'),auth['isAuthenticated'](),controller[_0xb5a3('0x11')]);router[_0xb5a3('0x12')]('/',auth[_0xb5a3('0x8')](),controller[_0xb5a3('0x13')]);router[_0xb5a3('0x12')]('/:id/members',auth[_0xb5a3('0x8')](),controller['addMembers']);router[_0xb5a3('0x12')](_0xb5a3('0x10'),auth[_0xb5a3('0x8')](),controller[_0xb5a3('0x14')]);router[_0xb5a3('0x15')](_0xb5a3('0xb'),auth['isAuthenticated'](),controller[_0xb5a3('0x16')]);router[_0xb5a3('0x17')](_0xb5a3('0xb'),auth['isAuthenticated'](),controller[_0xb5a3('0x18')]);router[_0xb5a3('0x17')]('/:id/members',auth[_0xb5a3('0x8')](),controller['removeMembers']);module[_0xb5a3('0x19')]=router;
\ No newline at end of file
+var _0xaffb=['post','create','put','delete','destroy','removeMembers','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','describe','/:id','isAuthenticated','getUnread','/:id/members','/:id/messages','getMessages'];(function(_0x26f3df,_0x19cb5e){var _0x551ae3=function(_0xb69a7e){while(--_0xb69a7e){_0x26f3df['push'](_0x26f3df['shift']());}};_0x551ae3(++_0x19cb5e);}(_0xaffb,0xa7));var _0xbaff=function(_0x187399,_0x40c56d){_0x187399=_0x187399-0x0;var _0x40fa92=_0xaffb[_0x187399];return _0x40fa92;};'use strict';var multer=require(_0xbaff('0x0'));var util=require(_0xbaff('0x1'));var path=require(_0xbaff('0x2'));var timeout=require(_0xbaff('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xbaff('0x4'));var auth=require(_0xbaff('0x5'));var interaction=require(_0xbaff('0x6'));var config=require(_0xbaff('0x7'));var controller=require('./chatGroup.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xbaff('0x8')](_0xbaff('0x9'),auth['isAuthenticated'](),controller[_0xbaff('0xa')]);router[_0xbaff('0x8')](_0xbaff('0xb'),auth[_0xbaff('0xc')](),controller['show']);router[_0xbaff('0x8')]('/:id/unread',auth[_0xbaff('0xc')](),controller[_0xbaff('0xd')]);router[_0xbaff('0x8')](_0xbaff('0xe'),auth[_0xbaff('0xc')](),controller['getMembers']);router['get'](_0xbaff('0xf'),auth[_0xbaff('0xc')](),controller[_0xbaff('0x10')]);router[_0xbaff('0x11')]('/',auth[_0xbaff('0xc')](),controller[_0xbaff('0x12')]);router['post'](_0xbaff('0xe'),auth[_0xbaff('0xc')](),controller['addMembers']);router[_0xbaff('0x11')]('/:id/messages',auth[_0xbaff('0xc')](),controller['addMessage']);router[_0xbaff('0x13')](_0xbaff('0xb'),auth[_0xbaff('0xc')](),controller['update']);router[_0xbaff('0x14')](_0xbaff('0xb'),auth[_0xbaff('0xc')](),controller[_0xbaff('0x15')]);router[_0xbaff('0x14')](_0xbaff('0xe'),auth[_0xbaff('0xc')](),controller[_0xbaff('0x16')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index f44714a..365c4cc 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 _0x9e6b=['star','TEXT','DATE','STRING','long','ENUM','out','BOOLEAN','sequelize','exports','INTEGER','thumb'];(function(_0x4472b6,_0x3768b6){var _0x153531=function(_0x517b02){while(--_0x517b02){_0x4472b6['push'](_0x4472b6['shift']());}};_0x153531(++_0x3768b6);}(_0x9e6b,0x11c));var _0xb9e6=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x9e6b[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0xb9e6('0x0'));module[_0xb9e6('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xb9e6('0x2')]},'ratingType':{'type':Sequelize['ENUM']('star',_0xb9e6('0x3')),'defaultValue':_0xb9e6('0x4')},'ratingMessage':{'type':Sequelize[_0xb9e6('0x5')]},'pathTranscript':{'type':Sequelize[_0xb9e6('0x5')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xb9e6('0x6')]},'disposition':{'type':Sequelize[_0xb9e6('0x7')]},'secondDisposition':{'type':Sequelize[_0xb9e6('0x7')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xb9e6('0x7')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0xb9e6('0x7')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0xb9e6('0x7')]},'deviceType':{'type':Sequelize[_0xb9e6('0x7')]},'referer':{'type':Sequelize[_0xb9e6('0x5')]},'customerIp':{'type':Sequelize[_0xb9e6('0x7')]},'formData':{'type':Sequelize[_0xb9e6('0x5')](_0xb9e6('0x8'))},'read1stAt':{'type':Sequelize[_0xb9e6('0x6')]},'lastMsgAt':{'type':Sequelize[_0xb9e6('0x6')]},'lastMsgDirection':{'type':Sequelize[_0xb9e6('0x9')]('in',_0xb9e6('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0xb9e6('0x7')]},'vidaooSessionId':{'type':Sequelize[_0xb9e6('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0xb9e6('0xb')],'defaultValue':![]}};
\ No newline at end of file
+var _0xeffd=['ENUM','star','thumb','TEXT','STRING','DATE','long','out','sequelize','BOOLEAN','INTEGER'];(function(_0x35f83e,_0x30ec55){var _0x249b05=function(_0x2c2fcc){while(--_0x2c2fcc){_0x35f83e['push'](_0x35f83e['shift']());}};_0x249b05(++_0x30ec55);}(_0xeffd,0x6b));var _0xdeff=function(_0x4ab6bb,_0x4f6c90){_0x4ab6bb=_0x4ab6bb-0x0;var _0x451c7e=_0xeffd[_0x4ab6bb];return _0x451c7e;};'use strict';var Sequelize=require(_0xdeff('0x0'));module['exports']={'closed':{'type':Sequelize[_0xdeff('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xdeff('0x2')]},'ratingType':{'type':Sequelize[_0xdeff('0x3')](_0xdeff('0x4'),_0xdeff('0x5')),'defaultValue':_0xdeff('0x4')},'ratingMessage':{'type':Sequelize[_0xdeff('0x6')]},'pathTranscript':{'type':Sequelize[_0xdeff('0x6')]},'mailTranscript':{'type':Sequelize[_0xdeff('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xdeff('0x8')]},'disposition':{'type':Sequelize[_0xdeff('0x7')]},'secondDisposition':{'type':Sequelize[_0xdeff('0x7')]},'thirdDisposition':{'type':Sequelize[_0xdeff('0x7')]},'note':{'type':Sequelize[_0xdeff('0x7')]},'browserName':{'type':Sequelize[_0xdeff('0x7')]},'browserVersion':{'type':Sequelize[_0xdeff('0x7')]},'osName':{'type':Sequelize[_0xdeff('0x7')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xdeff('0x7')]},'deviceVendor':{'type':Sequelize[_0xdeff('0x7')]},'deviceType':{'type':Sequelize[_0xdeff('0x7')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0xdeff('0x7')]},'formData':{'type':Sequelize[_0xdeff('0x6')](_0xdeff('0x9'))},'read1stAt':{'type':Sequelize[_0xdeff('0x8')]},'lastMsgAt':{'type':Sequelize[_0xdeff('0x8')]},'lastMsgDirection':{'type':Sequelize[_0xdeff('0x3')]('in',_0xdeff('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xdeff('0x7')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0xdeff('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xdeff('0x1')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index a678ab4..3e99bfa 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 _0x66fa=['error','code','message','catch','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','body','contact','agent','interaction','TagIds','Tags','split','forEach','push','map','ChatInteraction','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','field','from','tools_tags','select','u.id','u.fullname','ui.ChatInteractionId','left_join','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','users','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','some','compact','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','contactName','DESC','isEmpty','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','all','rows','params','includeAll','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','account','https://api-vidaoo.xcally.com/api/v1/meetings','follow','isNull','metadata','ValidationError','join_url','out','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','attachmentUpload','file','originalname','filename','mimetype','Attachment','attachmentDownload','Unauthorized','ChatOfflineMessageId','root','offline-chat/','join','basename','close','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','User','CmContact','ContactId','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','direction','MailServerOut','Smtp','service','host','port','secure','auth','pass','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','ChatMessage','addMessage','omit','ids','getMessages','merge','YYYY-MM-DD\x20HH:mm:ss','options','getMyMessages','include','includeAgent','alias','addTags','setTags','findAll','color','emit','chatInteractionTags:save','removeTags','download','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','createdAt','secret','read','Account','Owner','mkdirSync','Chat','N.A.','closedAt','browserName','osName','customerIp','customerPort','tail','existsSync','createReadStream','createWriteStream','renderFile','downloadInteraction.ejs','transcript-','createPdfFromHTML','log','err','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/export/pdf','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','jayson/promise','client','http','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4772f7,_0x7ca703){var _0x13c46d=function(_0x3342b6){while(--_0x3342b6){_0x4772f7['push'](_0x4772f7['shift']());}};_0x13c46d(++_0x7ca703);}(_0x66fa,0x117));var _0xa66f=function(_0x55cf68,_0x49959b){_0x55cf68=_0x55cf68-0x0;var _0x1c5151=_0x66fa[_0x55cf68];return _0x1c5151;};'use strict';var emlformat=require(_0xa66f('0x0'));var rimraf=require(_0xa66f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa66f('0x2'));var rp=require(_0xa66f('0x3'));var moment=require(_0xa66f('0x4'));var BPromise=require(_0xa66f('0x5'));var Mustache=require(_0xa66f('0x6'));var util=require(_0xa66f('0x7'));var path=require(_0xa66f('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa66f('0x9'));var fs=require('fs');var fs_extra=require(_0xa66f('0xa'));var _=require(_0xa66f('0xb'));var squel=require(_0xa66f('0xc'));var crypto=require(_0xa66f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa66f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa66f('0xf'));var Papa=require('papaparse');var Redis=require(_0xa66f('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xa66f('0x11'));var hardwareService=require(_0xa66f('0x12'));var logger=require('../../config/logger')(_0xa66f('0x13'));var utils=require('../../config/utils');var config=require(_0xa66f('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xa66f('0x15'))['db'];config[_0xa66f('0x16')]=_[_0xa66f('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa66f('0x18'))(new Redis(config['redis']));require('./chatInteraction.socket')['register'](socket);var jayson=require(_0xa66f('0x19'));var client=jayson[_0xa66f('0x1a')][_0xa66f('0x1b')]({'port':0x232b});var client9004=jayson[_0xa66f('0x1a')][_0xa66f('0x1b')]({'port':0x232c});function respondWithRpcPromise(_0x567d4f,_0x5510dc,_0x19b5ac,_0x32d338){return new BPromise(function(_0x295acf,_0x403f4d){var _0x5c67f5=_0x32d338||client;return _0x5c67f5[_0xa66f('0x1c')](_0x567d4f,_0x19b5ac)['then'](function(_0x4a28d4){logger[_0xa66f('0x1d')](_0xa66f('0x1e'),_0x5510dc,_0xa66f('0x1f'));logger[_0xa66f('0x20')](_0xa66f('0x21'),_0x5510dc,_0xa66f('0x1f'),JSON[_0xa66f('0x22')](_0x4a28d4));if(_0x4a28d4[_0xa66f('0x23')]){if(_0x4a28d4[_0xa66f('0x23')][_0xa66f('0x24')]===0x1f4){logger[_0xa66f('0x23')](_0xa66f('0x1e'),_0x5510dc,_0x4a28d4[_0xa66f('0x23')][_0xa66f('0x25')]);return _0x403f4d(_0x4a28d4[_0xa66f('0x23')]['message']);}logger[_0xa66f('0x23')](_0xa66f('0x1e'),_0x5510dc,_0x4a28d4[_0xa66f('0x23')][_0xa66f('0x25')]);return _0x295acf(_0x4a28d4['error'][_0xa66f('0x25')]);}else{logger[_0xa66f('0x1d')](_0xa66f('0x1e'),_0x5510dc,_0xa66f('0x1f'));_0x295acf(_0x4a28d4['result']['message']);}})[_0xa66f('0x26')](function(_0x598942){logger[_0xa66f('0x23')](_0xa66f('0x1e'),_0x5510dc,_0x598942);_0x403f4d(_0x598942);});});}function respondWithStatusCode(_0x384164,_0x57da7f){_0x57da7f=_0x57da7f||0xcc;return function(_0x4683c7){if(_0x4683c7){return _0x384164[_0xa66f('0x27')](_0x57da7f);}return _0x384164[_0xa66f('0x28')](_0x57da7f)[_0xa66f('0x29')]();};}function respondWithResult(_0x17c103,_0x236046){_0x236046=_0x236046||0xc8;return function(_0x1eb86a){if(_0x1eb86a){return _0x17c103[_0xa66f('0x28')](_0x236046)[_0xa66f('0x2a')](_0x1eb86a);}};}function respondWithFilteredResult(_0x117d03,_0x45f71c){return function(_0x63650b){if(_0x63650b){var _0x42b966=typeof _0x45f71c[_0xa66f('0x2b')]==='undefined'&&typeof _0x45f71c['limit']===_0xa66f('0x2c');var _0x27ceae=_0x63650b['count'];var _0x44c79a=_0x42b966?0x0:_0x45f71c[_0xa66f('0x2b')];var _0x4cd7f2=_0x42b966?_0x63650b[_0xa66f('0x2d')]:_0x45f71c[_0xa66f('0x2b')]+_0x45f71c[_0xa66f('0x2e')];var _0x2c2ace;if(_0x4cd7f2>=_0x27ceae){_0x4cd7f2=_0x27ceae;_0x2c2ace=0xc8;}else{_0x2c2ace=0xce;}_0x117d03[_0xa66f('0x28')](_0x2c2ace);return _0x117d03['set'](_0xa66f('0x2f'),_0x44c79a+'-'+_0x4cd7f2+'/'+_0x27ceae)['json'](_0x63650b);}return null;};}function patchUpdates(_0x306b35){return function(_0x35a0a7){try{jsonpatch[_0xa66f('0x30')](_0x35a0a7,_0x306b35,!![]);}catch(_0x486e4e){return BPromise[_0xa66f('0x31')](_0x486e4e);}return _0x35a0a7[_0xa66f('0x32')]();};}function saveUpdates(_0x4f1668,_0x1a5d4a){return function(_0x35a847){if(_0x35a847){return _0x35a847[_0xa66f('0x33')](_0x4f1668)[_0xa66f('0x34')](function(_0x10a782){return _0x10a782;});}return null;};}function removeEntity(_0x2452d2,_0x25c74c){return function(_0x41303c){if(_0x41303c){return _0x41303c[_0xa66f('0x35')]()[_0xa66f('0x34')](function(){_0x2452d2['status'](0xcc)[_0xa66f('0x29')]();});}};}function handleEntityNotFound(_0x5bf736,_0x1c7eda){return function(_0x46f6cc){if(!_0x46f6cc){_0x5bf736[_0xa66f('0x27')](0x194);}return _0x46f6cc;};}function handleError(_0x3b9261,_0x3722d3){_0x3722d3=_0x3722d3||0x1f4;return function(_0x201432){logger[_0xa66f('0x23')](_0x201432[_0xa66f('0x36')]);if(_0x201432['name']){delete _0x201432[_0xa66f('0x37')];}_0x3b9261['status'](_0x3722d3)[_0xa66f('0x38')](_0x201432);};}function getMustacheRender(_0x45eeb8,_0x2ed1fb){return Mustache['render'](_0x45eeb8,_['merge'](_0x2ed1fb[_0xa66f('0x39')],{'contact':_0x2ed1fb[_0xa66f('0x3a')],'message':_0x2ed1fb[_0xa66f('0x25')],'agent':_0x2ed1fb[_0xa66f('0x3b')],'interaction':_0x2ed1fb[_0xa66f('0x3c')],'account':_0x2ed1fb['account']}))||'';}function getInteractionUsers(_0x5cb0a9,_0x49b869){return new BPromise(function(_0x30f7de,_0x4aeeb4){try{if(_0x49b869[_0x5cb0a9['id']]){_0x5cb0a9['Users']=_['map'](_0x49b869[_0x5cb0a9['id']],function(_0x5fdc3e){return{'id':_0x5fdc3e['id'],'fullname':_0x5fdc3e['fullname']};});}}catch(_0x8965d3){_0x4aeeb4(_0x8965d3);}_0x30f7de(_0x5cb0a9);});}function getInteractionTags(_0x17d942,_0x23a546){return new BPromise(function(_0x1647a0,_0xd65c5d){try{if(_0x17d942[_0xa66f('0x3d')]){_0x17d942[_0xa66f('0x3e')]=[];_0x17d942[_0xa66f('0x3d')][_0xa66f('0x3f')](',')[_0xa66f('0x40')](function(_0x3a7929){_0x17d942[_0xa66f('0x3e')][_0xa66f('0x41')](_0x23a546[_0x3a7929]);});}delete _0x17d942[_0xa66f('0x3d')];}catch(_0x4f01b9){_0xd65c5d(_0x4f01b9);}_0x1647a0(_0x17d942);});}function updateChatInteraction(_0x36037c,_0x25c2cb,_0x58c1f2){return new BPromise(function(_0x248587,_0x4b6e6b){return getInteractionUsers(_0x36037c,_0x58c1f2)[_0xa66f('0x34')](function(_0x27adf4){return getInteractionTags(_0x27adf4,_0x25c2cb);})['then'](function(_0x1ddd2f){_0x248587(_0x1ddd2f);})[_0xa66f('0x26')](function(_0x2126e8){_0x4b6e6b(_0x2126e8);});});}exports['index']=function(_0x394b1e,_0x5cdfe2){var _0x276cd5={},_0x33ed23={},_0xb52cc6={'count':0x0,'rows':[]};var _0x3a499e=_[_0xa66f('0x42')](db[_0xa66f('0x43')][_0xa66f('0x44')],function(_0x50cc47){return{'name':_0x50cc47[_0xa66f('0x45')],'type':_0x50cc47[_0xa66f('0x46')][_0xa66f('0x47')]};});_0x33ed23[_0xa66f('0x48')]=_[_0xa66f('0x42')](_0x3a499e,'name');_0x33ed23['query']=_[_0xa66f('0x49')](_0x394b1e[_0xa66f('0x4a')]);_0x33ed23[_0xa66f('0x4b')]=_[_0xa66f('0x4c')](_0x33ed23[_0xa66f('0x48')],_0x33ed23[_0xa66f('0x4a')]);_0x276cd5['attributes']=_[_0xa66f('0x4c')](_0x33ed23[_0xa66f('0x48')],qs[_0xa66f('0x4d')](_0x394b1e['query']['fields']));_0x276cd5[_0xa66f('0x4e')]=_0x276cd5[_0xa66f('0x4e')][_0xa66f('0x4f')]?_0x276cd5['attributes']:_0x33ed23['model'];if(!_0x394b1e['query'][_0xa66f('0x50')](_0xa66f('0x51'))){_0x276cd5[_0xa66f('0x2e')]=qs[_0xa66f('0x2e')](_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x2e')]);_0x276cd5[_0xa66f('0x2b')]=qs[_0xa66f('0x2b')](_0x394b1e['query'][_0xa66f('0x2b')]);}_0x276cd5[_0xa66f('0x52')]=qs[_0xa66f('0x53')](_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x53')]);_0x276cd5[_0xa66f('0x54')]=qs['filters'](_[_0xa66f('0x55')](_0x394b1e[_0xa66f('0x4a')],_0x33ed23[_0xa66f('0x4b')]),_0x3a499e);var _0x13848d=[];var _0x20d6be=squel['select']()[_0xa66f('0x56')]('id')['field'](_0xa66f('0x37'))['field']('color')[_0xa66f('0x57')](_0xa66f('0x58'));var _0x12271d=squel[_0xa66f('0x59')]()[_0xa66f('0x56')](_0xa66f('0x5a'))['field'](_0xa66f('0x5b'))[_0xa66f('0x56')](_0xa66f('0x5c'))[_0xa66f('0x57')]('user_has_chat_interactions','ui')[_0xa66f('0x5d')]('users','u',_0xa66f('0x5e'));var _0x10fc75=squel[_0xa66f('0x59')]()[_0xa66f('0x57')](_0xa66f('0x5f'),'i')[_0xa66f('0x5d')](_0xa66f('0x60'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xa66f('0x5d')](_0xa66f('0x61'),'o',_0xa66f('0x62'))[_0xa66f('0x5d')](_0xa66f('0x63'),'a',_0xa66f('0x64'))[_0xa66f('0x5d')](_0xa66f('0x65'),'me',_0xa66f('0x66'))['left_join']('chat_interaction_has_tags','it',_0xa66f('0x67'))[_0xa66f('0x5d')](_0xa66f('0x58'),'t',_0xa66f('0x68'));var _0x2f1f1e=squel[_0xa66f('0x69')]();var _0x8bea2b=[];var _0x4b10cf=squel[_0xa66f('0x69')]();var _0x11c89e;if(_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x6a')]){_0x11c89e=as['parseSearch'](_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x6a')]);var _0x19ff30=_0x11c89e[_0xa66f('0x6b')];for(var _0x19f4b5=0x0;_0x19f4b5<_0x11c89e[_0xa66f('0x6c')]['length'];_0x19f4b5++){var _0x4b31f7=_0x11c89e[_0xa66f('0x6c')][_0x19f4b5];var _0x31b81b='i';var _0x174aad=_['find'](_0x3a499e,[_0xa66f('0x37'),_0x4b31f7[_0xa66f('0x56')]]);if(!_0x174aad){switch(_0x4b31f7[_0xa66f('0x56')]){case _0xa66f('0x6d'):if(_0x4b31f7[_0xa66f('0x6e')]==0x1){_0x10fc75[_0xa66f('0x6f')]('`'+_0x4b31f7[_0xa66f('0x56')]+_0xa66f('0x70'));}else{_0x10fc75[_0xa66f('0x6f')]('`'+_0x4b31f7['field']+_0xa66f('0x71'));}break;case _0xa66f('0x72'):if(_0x4b31f7[_0xa66f('0x73')]===_0xa66f('0x74')){if(_0x4b31f7[_0xa66f('0x6e')][_0xa66f('0x3f')]('\x20')[_0xa66f('0x4f')]>0x1){_0x2f1f1e[_0x19ff30](_0xa66f('0x75'),qs['getFullTextValue'](_0x4b31f7['value']),null);}else{var _0x46327d='%'+_0x4b31f7[_0xa66f('0x6e')]+'%';_0x2f1f1e[_0x19ff30](_0xa66f('0x76'),_0x46327d,_0x46327d,_0x46327d);}}else{_0x174aad=_[_0xa66f('0x77')](_0x3a499e,[_0xa66f('0x37'),'ContactId']);_0x4b31f7[_0xa66f('0x56')]='ContactId';_0x53b01b=as[_0xa66f('0x78')](_0x31b81b,_0x174aad[_0xa66f('0x46')],_0x4b31f7);_0x2f1f1e[_0x19ff30](_0x53b01b[_0xa66f('0x79')],_0x53b01b[_0xa66f('0x6e')]['start'],_0x53b01b[_0xa66f('0x6e')][_0xa66f('0x29')]);}break;case _0xa66f('0x7a'):var _0x46ea11=_0x4b31f7[_0xa66f('0x6e')][_0xa66f('0x3f')](',')[_0xa66f('0x42')](function(_0x2bdb18){return Number(_0x2bdb18);});_0x46ea11[_0xa66f('0x40')](function(_0x36b92f){_0x4b10cf['or'](_0xa66f('0x7b'),'%,'+_0x36b92f+',%');});_0x8bea2b=_[_0xa66f('0x7c')](_0x8bea2b,_0x46ea11);break;case'User':if(_0x4b31f7[_0xa66f('0x73')]===_0xa66f('0x74')){_0x2f1f1e[_0x19ff30](_0xa66f('0x7d'),'%'+_0x4b31f7[_0xa66f('0x6e')]+'%',null);}else{_0x174aad=_[_0xa66f('0x77')](_0x3a499e,[_0xa66f('0x37'),_0xa66f('0x7e')]);_0x4b31f7[_0xa66f('0x56')]='UserId';_0x53b01b=as[_0xa66f('0x78')](_0x31b81b,_0x174aad[_0xa66f('0x46')],_0x4b31f7);_0x2f1f1e[_0x19ff30](_0x53b01b[_0xa66f('0x79')],_0x53b01b[_0xa66f('0x6e')][_0xa66f('0x7f')],_0x53b01b[_0xa66f('0x6e')][_0xa66f('0x29')]);}break;case _0xa66f('0x39'):_0x53b01b=as['buildExpression']('me',null,_0x4b31f7);_0x2f1f1e[_0x19ff30](_0x53b01b['text'],_0x53b01b[_0xa66f('0x6e')][_0xa66f('0x7f')],_0x53b01b[_0xa66f('0x6e')]['end']);break;}}else{var _0x53b01b=as[_0xa66f('0x78')](_0x31b81b,_0x174aad[_0xa66f('0x46')],_0x4b31f7);_0x2f1f1e[_0x19ff30](_0x53b01b[_0xa66f('0x79')],_0x53b01b[_0xa66f('0x6e')]['start'],_0x53b01b[_0xa66f('0x6e')][_0xa66f('0x29')]);}}}else{var _0x1d4642=_(_0x394b1e[_0xa66f('0x4a')])[_0xa66f('0x49')]()[_0xa66f('0x42')](function(_0x218128){return _[_0xa66f('0x80')](_0x3a499e,['name',_0x218128])?_0x218128:undefined;})[_0xa66f('0x81')]()[_0xa66f('0x6e')]();if(!_['isEmpty'](_0x1d4642)){_0x1d4642['forEach'](function(_0x183155){if(_0x183155===_0xa66f('0x82')){_0x10fc75['where'](_0xa66f('0x83'),[]['concat'](_0x394b1e[_0xa66f('0x4a')][_0x183155]));}else if(_0x183155==='createdAt'){var _0x4feda0=JSON['parse'](_0x394b1e[_0xa66f('0x4a')][_0x183155])[_0xa66f('0x84')];var _0x1f05bb=JSON[_0xa66f('0x85')](_0x394b1e[_0xa66f('0x4a')][_0x183155])[_0xa66f('0x86')];_0x10fc75[_0xa66f('0x54')](_0xa66f('0x87'),_0x4feda0,_0x1f05bb);}else{if(_0x394b1e[_0xa66f('0x4a')][_0x183155]===_0xa66f('0x88')){_0x10fc75[_0xa66f('0x54')]('i.'+_0x183155+_0xa66f('0x89'));}else{_0x10fc75[_0xa66f('0x54')]('i.'+_0x183155+_0xa66f('0x8a'),_0x394b1e[_0xa66f('0x4a')][_0x183155]);}}});}if(_0x394b1e[_0xa66f('0x4a')]['read']){if(_0x394b1e[_0xa66f('0x4a')]['read']==0x1){_0x10fc75[_0xa66f('0x6f')]('`unreadMessages`\x20=\x200');}else{_0x10fc75[_0xa66f('0x6f')](_0xa66f('0x8b'));}}if(_0x394b1e[_0xa66f('0x4a')]['tag']){_0x8bea2b=_['isArray'](_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x8c')])?_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x8c')]:new Array(_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x8c')]);_0x8bea2b[_0xa66f('0x40')](function(_0x578bff){_0x4b10cf['or'](_0xa66f('0x7b'),'%,'+_0x578bff+',%');});}if(_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x8d')]){var _0x4426d2=_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x8d')][_0xa66f('0x8e')]('\x5c','\x5c\x5c')[_0xa66f('0x8e')](/'/g,'\x27\x27');if(qs[_0xa66f('0x8f')](_0x4426d2)){_0x2f1f1e['or'](_0xa66f('0x90'),_0x4426d2+'%');}else{_0x2f1f1e['or'](_0xa66f('0x91'),qs[_0xa66f('0x92')](_0x4426d2))['or'](_0xa66f('0x93'),_0x4426d2+'%');}}}_0x10fc75['where'](_0x2f1f1e);_0x10fc75[_0xa66f('0x94')](_0xa66f('0x95'));var _0x34ebfd={'type':db[_0xa66f('0x96')][_0xa66f('0x97')][_0xa66f('0x98')],'raw':!![]};var _0x3058aa=_0x10fc75[_0xa66f('0x99')]();_0x3058aa[_0xa66f('0x56')]('i.id');_0x3058aa[_0xa66f('0x56')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xa66f('0x6d'));if(_0x276cd5['order']){_0x276cd5[_0xa66f('0x52')]['forEach'](function(_0x298bd8){var _0x5a1750=_0x298bd8[0x0]===_0xa66f('0x9a')?_0x298bd8[0x0]:'i.'+_0x298bd8[0x0];_0x10fc75[_0xa66f('0x52')](_0x5a1750,_0x298bd8[0x1]===_0xa66f('0x9b')?![]:!![]);});}if(!_[_0xa66f('0x9c')](_0x8bea2b)){_0x10fc75[_0xa66f('0x6f')](_0x4b10cf);_0x3058aa[_0xa66f('0x54')]('t.id\x20IN\x20?',_0x8bea2b);}BPromise[_0xa66f('0x9d')]()[_0xa66f('0x34')](function(){if(!_0x11c89e){if(_0x394b1e[_0xa66f('0x4a')]['ChatWebsiteId'])return;_0x3058aa[_0xa66f('0x54')](_0xa66f('0x9e'));_0x10fc75['where'](_0xa66f('0x9e'));return;}if(_0x394b1e[_0xa66f('0x9f')]['role']!=='agent')return;return _0x394b1e[_0xa66f('0x9f')][_0xa66f('0xa0')]({'attributes':['id'],'raw':!![]})[_0xa66f('0x34')](function(_0x2929fe){if(_[_0xa66f('0x9c')](_0x2929fe)){_0x3058aa['where'](_0xa66f('0xa1'));_0x10fc75[_0xa66f('0x54')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x3058aa[_0xa66f('0x54')](_0xa66f('0x83'),_['map'](_0x2929fe,'id'));_0x10fc75[_0xa66f('0x54')](_0xa66f('0x83'),_[_0xa66f('0x42')](_0x2929fe,'id'));}});})[_0xa66f('0x34')](function(){if(_0x394b1e[_0xa66f('0x9f')]['role']===_0xa66f('0x3b')&&!_0x11c89e&&!_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x82')])return[];return db[_0xa66f('0xa2')][_0xa66f('0x4a')](_0x3058aa[_0xa66f('0xa3')](),_0x34ebfd);})['then'](function(_0x2b2c54){_0xb52cc6[_0xa66f('0x2d')]=_0x2b2c54[_0xa66f('0x4f')];if(_0xb52cc6[_0xa66f('0x2d')]===0x0)return[];return db[_0xa66f('0xa2')][_0xa66f('0x4a')](_0x20d6be[_0xa66f('0xa3')](),_0x34ebfd)['then'](function(_0x5ec355){_0x13848d=_[_0xa66f('0xa4')](_0x5ec355,'id');_0x34ebfd=_['merge'](_0x34ebfd,{'model':db[_0xa66f('0x43')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x394b1e[_0xa66f('0x4a')]['fields']){_0x276cd5[_0xa66f('0x4e')][_0xa66f('0x40')](function(_0x3f84f9){_0x10fc75['field']('i.'+_0x3f84f9);});}else{_0x10fc75['field'](_0xa66f('0xa5'),'unreadMessages');_0x10fc75[_0xa66f('0x56')](_0xa66f('0xa6'),_0xa66f('0xa7'));_0x10fc75['field'](_0xa66f('0xa8'),'Account.mandatoryDisposition');_0x10fc75[_0xa66f('0x56')](_0xa66f('0xa9'),_0xa66f('0x9a'));_0x10fc75[_0xa66f('0x56')]('i.*');_0x10fc75[_0xa66f('0x56')](_0xa66f('0xaa'),_0xa66f('0xab'));_0x10fc75[_0xa66f('0x56')](_0xa66f('0xac'),_0xa66f('0xad'));_0x10fc75['field'](_0xa66f('0xae'),_0xa66f('0xaf'));_0x10fc75[_0xa66f('0x56')](_0xa66f('0xb0'),_0xa66f('0xb1'));_0x10fc75['field']('c.mobile',_0xa66f('0xb2'));_0x10fc75[_0xa66f('0x56')](_0xa66f('0xb3'),_0xa66f('0xb4'));_0x10fc75[_0xa66f('0x56')](_0xa66f('0xb5'),_0xa66f('0xb6'));_0x10fc75[_0xa66f('0x56')](_0xa66f('0xb7'),_0xa66f('0xb8'));_0x10fc75[_0xa66f('0x56')](_0xa66f('0xb9'),'TagIds');}if(_0x276cd5[_0xa66f('0x2e')])_0x10fc75[_0xa66f('0x2e')](_0x276cd5['limit']);if(_0x276cd5[_0xa66f('0x2b')])_0x10fc75[_0xa66f('0x2b')](_0x276cd5[_0xa66f('0x2b')]);return db['sequelize']['query'](_0x10fc75[_0xa66f('0xa3')](),_0x34ebfd);})['then'](function(_0x3520e1){if(_0x3520e1[_0xa66f('0x4f')]>0x0)_0x12271d['where'](_0xa66f('0xba'),_[_0xa66f('0x42')](_0x3520e1,'id'));return db['sequelize'][_0xa66f('0x4a')](_0x12271d[_0xa66f('0xa3')](),_0x34ebfd)[_0xa66f('0x34')](function(_0x176b30){var _0x4bc36d=_['groupBy'](_0x176b30,_0xa66f('0xbb'));var _0xdd2d09=[];_0x3520e1[_0xa66f('0x40')](function(_0x1bab2b){_0xdd2d09[_0xa66f('0x41')](updateChatInteraction(_0x1bab2b,_0x13848d,_0x4bc36d));});return BPromise[_0xa66f('0xbc')](_0xdd2d09);});});})[_0xa66f('0x34')](function(_0xac0e98){_0xb52cc6[_0xa66f('0xbd')]=_0xac0e98;return _0xb52cc6;})[_0xa66f('0x34')](respondWithFilteredResult(_0x5cdfe2,_0x276cd5))['catch'](handleError(_0x5cdfe2,null));};exports['show']=function(_0x1d472d,_0x3cbbb6){var _0x3cf40f={'raw':![],'where':{'id':_0x1d472d[_0xa66f('0xbe')]['id']}},_0x4298ca={};_0x4298ca['model']=_[_0xa66f('0x49')](db[_0xa66f('0x43')][_0xa66f('0x44')]);_0x4298ca['query']=_['keys'](_0x1d472d['query']);_0x4298ca[_0xa66f('0x4b')]=_['intersection'](_0x4298ca[_0xa66f('0x48')],_0x4298ca[_0xa66f('0x4a')]);_0x3cf40f[_0xa66f('0x4e')]=_[_0xa66f('0x4c')](_0x4298ca['model'],qs[_0xa66f('0x4d')](_0x1d472d[_0xa66f('0x4a')]['fields']));_0x3cf40f[_0xa66f('0x4e')]=_0x3cf40f[_0xa66f('0x4e')]['length']?_0x3cf40f['attributes']:_0x4298ca[_0xa66f('0x48')];if(_0x1d472d[_0xa66f('0x4a')][_0xa66f('0xbf')]){_0x3cf40f['include']=[{'all':!![]}];}_0x3cf40f=_['merge']({},_0x3cf40f,_0x1d472d['options']);return db['ChatInteraction'][_0xa66f('0x77')](_0x3cf40f)[_0xa66f('0x34')](handleEntityNotFound(_0x3cbbb6,null))[_0xa66f('0x34')](respondWithResult(_0x3cbbb6,null))[_0xa66f('0x26')](handleError(_0x3cbbb6,null));};exports[_0xa66f('0xc0')]=function(_0x46c9b2,_0x580eb7){return db[_0xa66f('0x43')][_0xa66f('0xc0')](_0x46c9b2[_0xa66f('0x39')],{})[_0xa66f('0x34')](respondWithResult(_0x580eb7,0xc9))['catch'](handleError(_0x580eb7,null));};exports['update']=function(_0xd78ede,_0xe11c2d){if(_0xd78ede[_0xa66f('0x39')]['id']){delete _0xd78ede[_0xa66f('0x39')]['id'];}return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0xd78ede[_0xa66f('0xbe')]['id']}})[_0xa66f('0x34')](handleEntityNotFound(_0xe11c2d,null))[_0xa66f('0x34')](saveUpdates(_0xd78ede[_0xa66f('0x39')],null))[_0xa66f('0x34')](respondWithResult(_0xe11c2d,null))['catch'](handleError(_0xe11c2d,null));};exports[_0xa66f('0x35')]=function(_0x597ae3,_0x1b93e0){return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0x597ae3[_0xa66f('0xbe')]['id']}})[_0xa66f('0x34')](handleEntityNotFound(_0x1b93e0,null))['then'](removeEntity(_0x1b93e0,null))['catch'](handleError(_0x1b93e0,null));};exports['describe']=function(_0x484c8e,_0x728faa){return db[_0xa66f('0x43')][_0xa66f('0xc1')]()[_0xa66f('0x34')](respondWithResult(_0x728faa,null))['catch'](handleError(_0x728faa,null));};exports[_0xa66f('0xc2')]=function(_0x174510,_0x4f3985){var _0x348e6b=_0x174510[_0xa66f('0xbe')]['id'];var _0x4ed950;var _0xe43d63;var _0x3c2367;return db['ChatInteraction'][_0xa66f('0xc3')]({'where':{'id':_0x348e6b}})[_0xa66f('0x34')](function(_0x32bea5){_0x4ed950=_0x32bea5;return db[_0xa66f('0xc4')][_0xa66f('0xc3')]({'where':{'id':_0x32bea5[_0xa66f('0x82')]},'attributes':['id',_0xa66f('0xc5'),_0xa66f('0xc6'),_0xa66f('0xc7'),_0xa66f('0xc8'),_0xa66f('0xc9')],'raw':!![]});})['then'](function(_0x4c8386){if(_0x4c8386&&_0x4c8386[_0xa66f('0xc5')]&&_0x4c8386[_0xa66f('0xc6')]){_0xe43d63=_0x4c8386;var _0x12278e={'interaction':{'id':_0x348e6b},'agent':{'id':_0x174510['user']['id'],'name':_0x174510['user'][_0xa66f('0x37')],'fullname':_0x174510[_0xa66f('0x9f')][_0xa66f('0xca')],'email':_0x174510[_0xa66f('0x9f')][_0xa66f('0xcb')]},'contact':_0x174510['body'][_0xa66f('0x3a')],'account':_0x174510[_0xa66f('0x39')][_0xa66f('0xcc')]};var _0xfc01d7={'rejectUnauthorized':![],'method':'POST','url':_0xa66f('0xcd'),'headers':{'X-APIKEY':_0x4c8386[_0xa66f('0xc5')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x174510['user'][_0xa66f('0xcb')]],'buttons':null,'topic':_0xe43d63[_0xa66f('0xc7')],'note':_['isNull'](_0xe43d63[_0xa66f('0xc8')])?null:getMustacheRender(_0xe43d63[_0xa66f('0xc8')],_0x12278e),'metadata':null},'redirect':_0xa66f('0xce'),'json':!![]};try{if(!_[_0xa66f('0xcf')](_0xe43d63[_0xa66f('0xc9')])){var _0x3c73cc=getMustacheRender(_0xe43d63[_0xa66f('0xc9')],_0x12278e);var _0x4885bb=JSON['parse'](_0x3c73cc);_0xfc01d7[_0xa66f('0x39')][_0xa66f('0xd0')]=_0x4885bb;}}catch(_0x2e7c26){throw new db[(_0xa66f('0x96'))][(_0xa66f('0xd1'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0xfc01d7);}else{throw new db[(_0xa66f('0x96'))][(_0xa66f('0xd1'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xa66f('0x34')](function(_0x56198a){_0x3c2367=_0x56198a;if(_0x3c2367['id']){var _0x41ef9a={'body':_0x3c2367[_0xa66f('0xd2')],'ChatWebsiteId':_0xe43d63['id'],'ChatInteractionId':_0x4ed950['id'],'direction':_0xa66f('0xd3'),'UserId':_0x174510[_0xa66f('0x9f')]['id']};return db['ChatMessage']['create'](_0x41ef9a,{});}else{throw new db['Sequelize'][(_0xa66f('0xd1'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xa66f('0x34')](function(){return _0x4ed950['updateAttributes']({'vidaooSessionId':_0x3c2367['id']});})[_0xa66f('0x34')](respondWithResult(_0x4f3985,null))[_0xa66f('0x26')](handleError(_0x4f3985,null));};exports['customUpdate']=function(_0x35a2ce,_0x2d3bca){if(_0x35a2ce[_0xa66f('0x39')]['id']){delete _0x35a2ce[_0xa66f('0x39')]['id'];}return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0x35a2ce[_0xa66f('0xbe')]['id']},'include':[{'model':db['CmContact'],'as':_0xa66f('0x72')}]})[_0xa66f('0x34')](handleEntityNotFound(_0x2d3bca,null))[_0xa66f('0x34')](saveUpdates(_0x35a2ce[_0xa66f('0x39')],null))[_0xa66f('0x34')](respondWithResult(_0x2d3bca,null))[_0xa66f('0x26')](handleError(_0x2d3bca,null));};exports[_0xa66f('0xd4')]=function(_0x3a2c2c,_0x179953,_0x5dcf9d){if(_0x3a2c2c[_0xa66f('0x39')]['id']){delete _0x3a2c2c['body']['id'];}return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0x3a2c2c[_0xa66f('0xbe')]['id']}})[_0xa66f('0x34')](function(_0x1f4bc4){if(!_0x1f4bc4){logger['error'](_0xa66f('0xd5'),_0xa66f('0xd4'),0x194,_0xa66f('0xd6'));_0x179953[_0xa66f('0x27')](0x194);}else{if(_0x1f4bc4['UserId']){throw new db['Sequelize']['ValidationError'](_0xa66f('0xd7'));}}return _0x1f4bc4;})[_0xa66f('0x34')](function(_0x4be9ae){if(_0x4be9ae){return _0x4be9ae['update']({'closed':_0x3a2c2c[_0xa66f('0x39')][_0xa66f('0xd8')],'disposition':_0x3a2c2c['body'][_0xa66f('0xd9')]})[_0xa66f('0x34')](function(_0x17dc7d){return _0x17dc7d;});}})[_0xa66f('0x34')](function(_0x551c09){return respondWithRpcPromise('AbandonInteraction','abandon',_0x3a2c2c[_0xa66f('0x39')],client9004);})[_0xa66f('0x34')](respondWithResult(_0x179953,null))[_0xa66f('0x26')](handleError(_0x179953,null));};exports[_0xa66f('0xda')]=function(_0x377764,_0x434764,_0x315b27){_0x377764[_0xa66f('0x39')]['name']=_0x377764[_0xa66f('0xdb')][_0xa66f('0xdc')];_0x377764[_0xa66f('0x39')]['basename']=_0x377764[_0xa66f('0xdb')][_0xa66f('0xdd')];_0x377764[_0xa66f('0x39')]['type']=_0x377764['file'][_0xa66f('0xde')];return db[_0xa66f('0xdf')][_0xa66f('0xc0')](_0x377764[_0xa66f('0x39')])[_0xa66f('0x34')](respondWithResult(_0x434764,0xc9))[_0xa66f('0x26')](handleError(_0x434764,null));};exports[_0xa66f('0xe0')]=function(_0x5c5550,_0x383ce6,_0x4b2702){return db[_0xa66f('0x43')][_0xa66f('0xc3')]({'where':{'id':_0x5c5550[_0xa66f('0xbe')]['id']},'raw':!![]})[_0xa66f('0x34')](handleEntityNotFound(_0x383ce6,null))[_0xa66f('0x34')](function(_0x32f7ab){if(_0x32f7ab){if(_0x32f7ab[_0xa66f('0xd8')]){return _0x383ce6[_0xa66f('0x28')](0x193)[_0xa66f('0x2a')]({'status':0x193,'message':_0xa66f('0xe1')});}return db[_0xa66f('0xdf')][_0xa66f('0xc3')]({'where':{'id':_0x5c5550['query']['attachId']},'raw':!![]})[_0xa66f('0x34')](handleEntityNotFound(_0x383ce6,null));}})[_0xa66f('0x34')](function(_0x29ce7f){if(_0x29ce7f){var _0x1248c9=_0x29ce7f[_0xa66f('0xe2')]!==null;var _0x13948a=path['join'](config[_0xa66f('0xe3')],'server/files/attachments/');if(_0x1248c9){_0x13948a=path['join'](_0x13948a,_0xa66f('0xe4'));}var _0x1ce936=path[_0xa66f('0xe5')](_0x13948a,_0x29ce7f[_0xa66f('0xe6')]);return _0x383ce6['download'](_0x1ce936);}})[_0xa66f('0x26')](handleError(_0x383ce6,null));};exports[_0xa66f('0xe7')]=function(_0x1686df,_0x1889f4){var _0x2a03c8=null;var _0x48b16d=null;var _0x5a05e4=null;var _0x1b78fa=null;if(_0x1686df[_0xa66f('0x39')]['id']){delete _0x1686df[_0xa66f('0x39')]['id'];}if(_0x1686df[_0xa66f('0x39')]['mailTranscript']){_0x1b78fa=path[_0xa66f('0xe5')](config[_0xa66f('0xe3')],_0xa66f('0xe8'),util[_0xa66f('0xe9')](_0xa66f('0xea'),Date[_0xa66f('0xeb')]()));_0x1686df[_0xa66f('0x39')][_0xa66f('0xec')]=_0x1b78fa;}return db['ChatInteraction'][_0xa66f('0x77')]({'where':{'id':_0x1686df[_0xa66f('0xbe')]['id']},'include':[{'model':db['ChatMessage'],'as':_0xa66f('0xed'),'include':[{'model':db[_0xa66f('0xee')],'as':_0xa66f('0xee')}]}]})[_0xa66f('0x34')](handleEntityNotFound(_0x1889f4,null))[_0xa66f('0x34')](saveUpdates(_0x1686df['body'],null))[_0xa66f('0x34')](function(_0x4153a0){if(_0x4153a0){_0x2a03c8=_0x4153a0;return db[_0xa66f('0xc4')][_0xa66f('0x77')]({'where':{'id':_0x2a03c8[_0xa66f('0x82')]}});}})['then'](function(_0x820ac1){if(_0x820ac1){_0x5a05e4=_0x820ac1;return db[_0xa66f('0xef')]['find']({'where':{'id':_0x2a03c8[_0xa66f('0xf0')]}});}})[_0xa66f('0x34')](function(_0x22d154){if(_0x22d154){_0x48b16d=_0x22d154;if(_0x1b78fa){var _0x31959f=null;for(var _0x2d3123=0x1;_0x2d3123<_0x2a03c8['Messages'][_0xa66f('0x4f')];++_0x2d3123){_0x31959f=_0x2a03c8[_0xa66f('0xed')][_0x2d3123];var _0x207ea2=_0x31959f[_0xa66f('0x7e')]?util['format'](_0xa66f('0xf1'),_0x5a05e4[_0xa66f('0xf2')],_0x31959f['UserId']):_0xa66f('0xf3');var _0x19fabd=_0x1686df[_0xa66f('0x39')][_0xa66f('0xf4')]||util['format'](_0xa66f('0xf1'),_0xa66f('0xf5'),_0x31959f['ContactId']);switch(_0x5a05e4[_0xa66f('0xf6')]){case _0xa66f('0xf7'):_0x207ea2=_0x31959f[_0xa66f('0x7e')]?util['format'](_0xa66f('0xf1'),_0x5a05e4[_0xa66f('0xf2')],_0x31959f[_0xa66f('0x7e')]):'System';break;case _0xa66f('0xf8'):_0x207ea2=_0x31959f[_0xa66f('0x7e')]?_0x31959f['User']['alias']||_0x31959f[_0xa66f('0xee')][_0xa66f('0xca')]:'System';break;case _0xa66f('0xf9'):_0x207ea2=_0x31959f[_0xa66f('0x7e')]?_0x31959f[_0xa66f('0xee')][_0xa66f('0xca')]:_0xa66f('0xf3');break;default:_0x207ea2=_0x31959f['UserId']?util[_0xa66f('0xe9')](_0xa66f('0xf1'),_0x5a05e4['agentAlias'],_0x31959f[_0xa66f('0x7e')]):'System';}var _0x506797=util[_0xa66f('0xe9')](_0xa66f('0xfa'),moment(_0x31959f['createdAt'])[_0xa66f('0xe9')]('MM/DD/YYYY\x20HH:mm:ss'),_0x31959f[_0xa66f('0xfb')]==='in'?_0x19fabd:_0x207ea2,_0x31959f[_0xa66f('0x39')]);if(!_0x31959f['secret']){fs['appendFileSync'](_0x1b78fa,_0x506797);}}return db['MailAccount'][_0xa66f('0xc3')]({'where':{'service':!![]},'include':[{'model':db[_0xa66f('0xfc')],'as':_0xa66f('0xfd'),'raw':!![]}]});}}})[_0xa66f('0x34')](function(_0x168d31){if(_0x168d31&&_0x168d31[_0xa66f('0xfd')]&&_0x1686df[_0xa66f('0x39')]){var _0x5a762d={'tls':{'rejectUnauthorized':![]}};if(_0x168d31['Smtp'][_0xa66f('0xfe')]){_0x5a762d[_0xa66f('0xfe')]=_0x168d31[_0xa66f('0xfd')][_0xa66f('0xfe')];}else{_0x5a762d[_0xa66f('0xff')]=_0x168d31[_0xa66f('0xfd')]['host'];_0x5a762d[_0xa66f('0x100')]=_0x168d31[_0xa66f('0xfd')]['port'];_0x5a762d[_0xa66f('0x101')]=_0x168d31['Smtp'][_0xa66f('0x101')];}if(_0x168d31['Smtp']['authentication']){_0x5a762d[_0xa66f('0x102')]={'user':_0x168d31[_0xa66f('0xfd')][_0xa66f('0x9f')],'pass':_0x168d31[_0xa66f('0xfd')][_0xa66f('0x103')]};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0x5a762d,'message':{'from':util[_0xa66f('0xe9')](_0xa66f('0x104'),_0x168d31[_0xa66f('0x37')],_0x168d31['email']||_0x168d31['Smtp']['user']),'to':_0x1686df[_0xa66f('0x39')][_0xa66f('0x105')],'subject':_0xa66f('0x106'),'text':util[_0xa66f('0xe9')](_0xa66f('0x107'),_0x1686df[_0xa66f('0x39')]['mailTranscript']),'attachments':[{'path':_0x1b78fa}]}})[_0xa66f('0x34')](function(){return _0x2a03c8;})[_0xa66f('0x26')](function(_0x3215af){console['error'](_0x3215af);});}else{return _0x2a03c8;}})[_0xa66f('0x34')](respondWithStatusCode(_0x1889f4,0xc8))[_0xa66f('0x26')](handleError(_0x1889f4,null));};exports['addMessage']=function(_0x4e4b66,_0x2aaaab,_0x75d882){return db[_0xa66f('0x108')][_0xa66f('0x77')]({'where':{'id':_0x4e4b66['params']['id']}})[_0xa66f('0x34')](handleEntityNotFound(_0x2aaaab,null))[_0xa66f('0x34')](function(_0x21e1d1){if(_0x21e1d1){return _0x21e1d1[_0xa66f('0x109')](_0x4e4b66[_0xa66f('0x39')]['ids'],_[_0xa66f('0x10a')](_0x4e4b66[_0xa66f('0x39')],[_0xa66f('0x10b'),'id'])||{});}})['then'](respondWithResult(_0x2aaaab,null))[_0xa66f('0x26')](handleError(_0x2aaaab,null));};exports[_0xa66f('0x10c')]=function(_0x53170d,_0x5d1e51,_0x3c3aff){var _0x3fb295={'raw':![],'where':{}};var _0x57c403={};var _0x31832f={'count':0x0,'rows':[]};return db[_0xa66f('0x43')][_0xa66f('0xc3')]({'where':{'id':_0x53170d[_0xa66f('0xbe')]['id']}})['then'](handleEntityNotFound(_0x5d1e51,null))[_0xa66f('0x34')](function(_0x43cc99){if(_0x43cc99){_0x57c403['model']=_[_0xa66f('0x49')](db[_0xa66f('0x108')]['rawAttributes']);_0x57c403['query']=_['keys'](_0x53170d[_0xa66f('0x4a')]);_0x57c403[_0xa66f('0x4b')]=_[_0xa66f('0x4c')](_0x57c403[_0xa66f('0x48')],_0x57c403[_0xa66f('0x4a')]);_0x3fb295['attributes']=_[_0xa66f('0x4c')](_0x57c403[_0xa66f('0x48')],qs['fields'](_0x53170d['query']['fields']));_0x3fb295[_0xa66f('0x4e')]=_0x3fb295[_0xa66f('0x4e')][_0xa66f('0x4f')]?_0x3fb295['attributes']:_0x57c403[_0xa66f('0x48')];if(!_0x53170d[_0xa66f('0x4a')][_0xa66f('0x50')]('nolimit')){_0x3fb295[_0xa66f('0x2e')]=qs[_0xa66f('0x2e')](_0x53170d[_0xa66f('0x4a')]['limit']);_0x3fb295[_0xa66f('0x2b')]=qs[_0xa66f('0x2b')](_0x53170d[_0xa66f('0x4a')][_0xa66f('0x2b')]);}_0x3fb295[_0xa66f('0x52')]=qs[_0xa66f('0x53')](_0x53170d[_0xa66f('0x4a')][_0xa66f('0x53')]);_0x3fb295['where']=qs[_0xa66f('0x4b')](_[_0xa66f('0x55')](_0x53170d[_0xa66f('0x4a')],_0x57c403[_0xa66f('0x4b')]));_0x3fb295[_0xa66f('0x54')][_0xa66f('0xbb')]=_0x43cc99['id'];if(_0x53170d[_0xa66f('0x4a')][_0xa66f('0x8d')]){_0x3fb295[_0xa66f('0x54')]=_[_0xa66f('0x10d')](_0x3fb295[_0xa66f('0x54')],{'$or':_[_0xa66f('0x42')](_0x3fb295[_0xa66f('0x4e')],function(_0x2b9a3c){var _0x1d688a={};_0x1d688a[_0x2b9a3c]={'$like':'%'+_0x53170d[_0xa66f('0x4a')][_0xa66f('0x8d')]+'%'};return _0x1d688a;})});}if(_0x53170d['query'][_0xa66f('0x84')]){var _0x570a01=_0x53170d['query']['$gte'][_0xa66f('0x3f')](',');var _0x35919e={};_0x35919e[_0x570a01[0x0]]={'$gte':moment(_0x570a01[0x1])[_0xa66f('0xe9')](_0xa66f('0x10e'))};_0x3fb295[_0xa66f('0x54')]=_['merge'](_0x3fb295[_0xa66f('0x54')],_0x35919e);}_0x3fb295=_['merge']({},_0x3fb295,_0x53170d[_0xa66f('0x10f')]);return db[_0xa66f('0x108')]['count']({'where':_0x3fb295['where']})[_0xa66f('0x34')](function(_0x3517eb){_0x31832f[_0xa66f('0x2d')]=_0x3517eb;if(_0x53170d[_0xa66f('0x4a')][_0xa66f('0xbf')]){_0x3fb295['include']=[{'all':!![]}];}return db[_0xa66f('0x108')]['findAll'](_0x3fb295);})[_0xa66f('0x34')](function(_0x24c209){_0x31832f[_0xa66f('0xbd')]=_0x24c209;return _0x31832f;});}})[_0xa66f('0x34')](respondWithFilteredResult(_0x5d1e51,_0x3fb295))[_0xa66f('0x26')](handleError(_0x5d1e51,null));};exports[_0xa66f('0x110')]=function(_0x1ef4c2,_0x21ec7f,_0x32b1c1){var _0x4ee9a3={'where':{}},_0x12889f={},_0xc813ad={'count':0x0,'rows':[]};return db[_0xa66f('0x43')]['findOne']({'where':{'id':_0x1ef4c2['params']['id']}})[_0xa66f('0x34')](handleEntityNotFound(_0x21ec7f,null))[_0xa66f('0x34')](function(_0x3a1e4a){if(_0x3a1e4a){_0x12889f['model']=_[_0xa66f('0x49')](db[_0xa66f('0x108')]['rawAttributes']);_0x12889f[_0xa66f('0x4a')]=_[_0xa66f('0x49')](_0x1ef4c2[_0xa66f('0x4a')]);_0x12889f[_0xa66f('0x4b')]=_[_0xa66f('0x4c')](_0x12889f[_0xa66f('0x48')],_0x12889f[_0xa66f('0x4a')]);_0x4ee9a3[_0xa66f('0x4e')]=_[_0xa66f('0x4c')](_0x12889f[_0xa66f('0x48')],qs[_0xa66f('0x4d')](_0x1ef4c2[_0xa66f('0x4a')]['fields']));_0x4ee9a3[_0xa66f('0x4e')]=_0x4ee9a3[_0xa66f('0x4e')][_0xa66f('0x4f')]?_0x4ee9a3[_0xa66f('0x4e')]:_0x12889f['model'];if(!_0x1ef4c2[_0xa66f('0x4a')]['hasOwnProperty'](_0xa66f('0x51'))){_0x4ee9a3[_0xa66f('0x2e')]=qs['limit'](_0x1ef4c2['query'][_0xa66f('0x2e')]);_0x4ee9a3[_0xa66f('0x2b')]=qs[_0xa66f('0x2b')](_0x1ef4c2[_0xa66f('0x4a')][_0xa66f('0x2b')]);}_0x4ee9a3[_0xa66f('0x52')]=qs['sort'](_0x1ef4c2['query']['sort']);_0x4ee9a3[_0xa66f('0x54')]=qs[_0xa66f('0x4b')](_[_0xa66f('0x55')](_0x1ef4c2[_0xa66f('0x4a')],_0x12889f[_0xa66f('0x4b')]));_0x4ee9a3['where'][_0xa66f('0xbb')]=_0x3a1e4a['id'];if(_0x1ef4c2['query'][_0xa66f('0x8d')]){_0x4ee9a3[_0xa66f('0x54')]=_[_0xa66f('0x10d')](_0x4ee9a3['where'],{'$or':_['map'](_0x4ee9a3[_0xa66f('0x4e')],function(_0x2bf349){var _0x211ac6={};_0x211ac6[_0x2bf349]={'$like':'%'+_0x1ef4c2[_0xa66f('0x4a')][_0xa66f('0x8d')]+'%'};return _0x211ac6;})});}_0x4ee9a3[_0xa66f('0x54')]['secret']=![];if(_0x1ef4c2[_0xa66f('0x4a')]['id']){_0x4ee9a3['where']['id']={'$gt':_0x1ef4c2['query']['id']};}_0x4ee9a3=_[_0xa66f('0x10d')]({},_0x4ee9a3,_0x1ef4c2[_0xa66f('0x10f')]);return db[_0xa66f('0x108')]['count']({'where':_0x4ee9a3['where']})['then'](function(_0x533dc1){_0xc813ad[_0xa66f('0x2d')]=_0x533dc1;_0x4ee9a3[_0xa66f('0x111')]=[];if(_0x1ef4c2[_0xa66f('0x4a')][_0xa66f('0x112')]){_0x4ee9a3[_0xa66f('0x111')][_0xa66f('0x41')]({'model':db[_0xa66f('0xee')],'as':_0xa66f('0xee'),'attributes':['id',_0xa66f('0xca'),_0xa66f('0x113')]});}if(_0x1ef4c2[_0xa66f('0x4a')][_0xa66f('0xbf')]){_0x4ee9a3[_0xa66f('0x111')]=[{'all':!![]}];}return db[_0xa66f('0x108')]['findAll'](_0x4ee9a3);})['then'](function(_0x554ba6){_0xc813ad[_0xa66f('0xbd')]=_0x554ba6;return _0xc813ad;});}})[_0xa66f('0x34')](respondWithFilteredResult(_0x21ec7f,_0x4ee9a3))[_0xa66f('0x26')](handleError(_0x21ec7f,null));};exports[_0xa66f('0x114')]=function(_0x1a3bac,_0x44649c,_0x5e4fbc){return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0x1a3bac[_0xa66f('0xbe')]['id']}})['then'](handleEntityNotFound(_0x44649c,null))[_0xa66f('0x34')](function(_0x1d2967){if(_0x1d2967){return _0x1d2967[_0xa66f('0x115')](_0x1a3bac[_0xa66f('0x39')][_0xa66f('0x10b')],_[_0xa66f('0x10a')](_0x1a3bac[_0xa66f('0x39')],[_0xa66f('0x10b'),'id'])||{})['spread'](function(){return db[_0xa66f('0x7a')][_0xa66f('0x116')]({'attributes':['id','name',_0xa66f('0x117')],'where':{'id':_0x1a3bac[_0xa66f('0x39')][_0xa66f('0x10b')]}});})['then'](function(_0x367549){socket[_0xa66f('0x118')](_0xa66f('0x119'),{'id':Number(_0x1a3bac['params']['id']),'tags':_0x367549||[]});return{'id':Number(_0x1a3bac[_0xa66f('0xbe')]['id']),'tags':_0x367549||[]};});}})[_0xa66f('0x34')](respondWithResult(_0x44649c,null))[_0xa66f('0x26')](handleError(_0x44649c,null));};exports[_0xa66f('0x11a')]=function(_0x4a1613,_0x324b7e,_0x1d3395){return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0x4a1613[_0xa66f('0xbe')]['id']}})[_0xa66f('0x34')](handleEntityNotFound(_0x324b7e,null))[_0xa66f('0x34')](function(_0x33f1ea){if(_0x33f1ea){return _0x33f1ea[_0xa66f('0x11a')](_0x4a1613[_0xa66f('0x4a')]['ids']);}})[_0xa66f('0x34')](respondWithStatusCode(_0x324b7e,null))['catch'](handleError(_0x324b7e,null));};exports[_0xa66f('0x11b')]=function(_0xd7dccf,_0x2b4238){var _0x321fa1=moment()['unix']()['toString']();var _0x254599=path[_0xa66f('0xe5')](config[_0xa66f('0xe3')],_0xa66f('0x11c'),_0xa66f('0x11d'),_0xa66f('0x11e'));var _0x3b9ff3=path['join'](config[_0xa66f('0xe3')],_0xa66f('0x11c'),'files',_0xa66f('0x11f'));var _0x5206a5=path['join'](_0x254599,_0x321fa1);var _0x6b60bd=util[_0xa66f('0xe9')](_0xa66f('0x120'),_0xd7dccf['params']['id'],_0x321fa1);var _0x3709b6=path['join'](_0x254599,_0x6b60bd);var _0x21bda3=[];_0x21bda3[_0xa66f('0x41')]({'model':db['User'],'as':_0xa66f('0xee'),'attributes':['id',_0xa66f('0xca')],'raw':!![]});_0x21bda3[_0xa66f('0x41')]({'model':db[_0xa66f('0xef')],'as':_0xa66f('0x72'),'attributes':['id',_0xa66f('0x121'),_0xa66f('0x122')],'raw':!![]});if(_0xd7dccf['query'][_0xa66f('0x11f')]){_0x21bda3[_0xa66f('0x41')]({'model':db['Attachment'],'as':_0xa66f('0xdf'),'raw':!![]});}var _0x22e7a6=[{'model':db[_0xa66f('0x108')],'as':_0xa66f('0xed'),'attributes':['id',_0xa66f('0x39'),_0xa66f('0x123'),_0xa66f('0xfb'),_0xa66f('0x124'),_0xa66f('0x125')],'include':_0x21bda3}];_0x22e7a6[_0xa66f('0x41')]({'model':db[_0xa66f('0xc4')],'as':_0xa66f('0x126'),'attributes':['id','name']});_0x22e7a6[_0xa66f('0x41')]({'model':db['User'],'as':_0xa66f('0x127'),'attributes':['id',_0xa66f('0xca')]});return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0xd7dccf[_0xa66f('0xbe')]['id']},'include':_0x22e7a6})[_0xa66f('0x34')](handleEntityNotFound(_0x2b4238,null))[_0xa66f('0x34')](function(_0x5efd6c){if(_0x5efd6c){var _0x24ee72=_0x5efd6c['get']({'plain':!![]});fs[_0xa66f('0x128')](_0x5206a5);var _0xdbb792={'channel':_0xa66f('0x129'),'account':_0x24ee72['Account'][_0xa66f('0x37')],'agent':_0x24ee72[_0xa66f('0x127')]?_0x24ee72['Owner']['fullname']:_0xa66f('0x12a'),'createdAt':moment(_0x24ee72[_0xa66f('0x123')])[_0xa66f('0xe9')]('YYYY-MM-DD\x20HH:mm:ss')[_0xa66f('0xa3')](),'closedAt':_0x24ee72[_0xa66f('0xd8')]?moment(_0x24ee72[_0xa66f('0x12b')])['format'](_0xa66f('0x10e'))[_0xa66f('0xa3')]():'','disposition':_0x24ee72[_0xa66f('0xd9')],'chatInfo':{'browser':_0x24ee72[_0xa66f('0x12c')],'os':_0x24ee72[_0xa66f('0x12d')],'referer':_0x24ee72['referer'],'customerIp':_0x24ee72[_0xa66f('0x12e')],'customerPort':_0x24ee72[_0xa66f('0x12f')]?_0x24ee72[_0xa66f('0x12f')]:_0xa66f('0x12a')},'messages':_(_0x24ee72[_0xa66f('0xed')])[_0xa66f('0x130')]()['filter']({'secret':![]})[_0xa66f('0x42')](function(_0x31cc20){if(_0x31cc20['Attachment']){var _0x10a611=path[_0xa66f('0xe5')](_0x3b9ff3,_0x31cc20['Attachment'][_0xa66f('0xe6')]);if(fs[_0xa66f('0x131')](_0x10a611)){fs[_0xa66f('0x132')](_0x10a611)['pipe'](fs[_0xa66f('0x133')](path['join'](_0x5206a5,_0x31cc20['Attachment']['basename'])));}}return{'date':moment(_0x31cc20['createdAt'])['format'](_0xa66f('0x10e'))['toString'](),'sender':_0x31cc20[_0xa66f('0xfb')]===_0xa66f('0xd3')?_0x31cc20[_0xa66f('0xee')]?_0x31cc20[_0xa66f('0xee')][_0xa66f('0xca')]:_0xa66f('0xf3'):_0x31cc20[_0xa66f('0x72')][_0xa66f('0x121')]+(_0x31cc20[_0xa66f('0x72')][_0xa66f('0x122')]?'\x20'+_0x31cc20[_0xa66f('0x72')][_0xa66f('0x122')]:''),'body':_0x31cc20[_0xa66f('0xdf')]?_0x31cc20[_0xa66f('0xdf')][_0xa66f('0xe6')]:_0x31cc20[_0xa66f('0x39')],'direction':_0x31cc20[_0xa66f('0xfb')]==='out'?'A':'C','secret':_0x31cc20['secret'],'read':_0x31cc20[_0xa66f('0x125')],'attachment':_0x31cc20[_0xa66f('0xdf')]};})[_0xa66f('0x6e')]()};return ejs[_0xa66f('0x134')](path[_0xa66f('0xe5')](config[_0xa66f('0xe3')],_0xa66f('0x11c'),'views',_0xa66f('0x135')),{'interaction':_0xdbb792})['then'](function(_0x12024d){var _0x4baf59=path[_0xa66f('0xe5')](_0x5206a5,_0xa66f('0x136')+_0x24ee72['id']+'-'+_0x321fa1+'.pdf');var _0x33198c={'path':_0x4baf59,'channel':_0xa66f('0x129'),'interactionId':_0x24ee72['id']};return pdf[_0xa66f('0x137')](_0x12024d,_0x33198c);})[_0xa66f('0x34')](function(){return new BPromise(function(_0x3792b2,_0x5101f8){zipdir(_0x5206a5,{'saveTo':_0x3709b6},function(_0x4ac4b4,_0x171111){if(_0x4ac4b4)return _0x5101f8(_0x4ac4b4);return _0x3792b2(_0x171111);});})[_0xa66f('0x34')](function(){return new BPromise(function(_0x46691d,_0x136518){rimraf(_0x5206a5,function(_0x1404df){if(_0x1404df)_0x136518(_0x1404df);return _0x46691d();});});})[_0xa66f('0x34')](function(){return _0x2b4238[_0xa66f('0x11b')](_0x3709b6,_0x6b60bd,function(_0x58f445){if(_0x58f445){console[_0xa66f('0x138')](_0xa66f('0x139'),_0x58f445);}else{fs['unlinkSync'](_0x3709b6);}});});});}else{return _0x2b4238[_0xa66f('0x27')](0xc8);}})['catch'](handleError(_0x2b4238,null));};
\ No newline at end of file
+var _0x7880=['parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','ChatWebsiteId','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','agent','sequelize','toString','keyBy','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','show','params','include','options','create','destroy','describe','createVidaooSession','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','update','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','findOne','attachId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','transcript-%s.txt','now','Messages','%s%d','agentAlias','customer','format','website_alias','System','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','appendFileSync','MailServerOut','Smtp','service','host','port','secure','pass','SendMail','\x22%s\x22\x20<%s>','email','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','nolimit','pick','YYYY-MM-DD\x20HH:mm:ss','includeAll','getMyMessages','secret','includeAgent','findAll','addTags','spread','emit','chatInteractionTags:save','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','Owner','get','mkdirSync','Account','closedAt','browserName','customerPort','N.A.','tail','createReadStream','createWriteStream','direction','renderFile','downloadInteraction.ejs','transcript-','.pdf','Chat','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','jayson/promise','http','client','then','info','request\x20sent','debug','error','code','ChatInteraction,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','name','send','merge','contact','interaction','account','fullname','Tags','TagIds','split','forEach','push','index','map','ChatInteraction','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','select','field','color','from','tools_tags','u.id','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','chat_websites','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','body','some','isEmpty','concat','createdAt'];(function(_0x2db099,_0x5d96d2){var _0x1e25d8=function(_0x38b6f0){while(--_0x38b6f0){_0x2db099['push'](_0x2db099['shift']());}};_0x1e25d8(++_0x5d96d2);}(_0x7880,0x1f4));var _0x0788=function(_0x706091,_0x5e07d9){_0x706091=_0x706091-0x0;var _0x4aee6f=_0x7880[_0x706091];return _0x4aee6f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0788('0x0'));var zipdir=require(_0x0788('0x1'));var jsonpatch=require(_0x0788('0x2'));var rp=require(_0x0788('0x3'));var moment=require(_0x0788('0x4'));var BPromise=require(_0x0788('0x5'));var Mustache=require('mustache');var util=require(_0x0788('0x6'));var path=require(_0x0788('0x7'));var sox=require(_0x0788('0x8'));var csv=require(_0x0788('0x9'));var ejs=require(_0x0788('0xa'));var fs=require('fs');var fs_extra=require(_0x0788('0xb'));var _=require(_0x0788('0xc'));var squel=require(_0x0788('0xd'));var crypto=require(_0x0788('0xe'));var jsforce=require(_0x0788('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0788('0x9'));var querystring=require('querystring');var Papa=require(_0x0788('0x10'));var Redis=require('ioredis');var authService=require(_0x0788('0x11'));var qs=require(_0x0788('0x12'));var as=require(_0x0788('0x13'));var pdf=require(_0x0788('0x14'));var hardwareService=require(_0x0788('0x15'));var logger=require('../../config/logger')(_0x0788('0x16'));var utils=require(_0x0788('0x17'));var config=require(_0x0788('0x18'));var licenseUtil=require(_0x0788('0x19'));var db=require(_0x0788('0x1a'))['db'];config[_0x0788('0x1b')]=_[_0x0788('0x1c')](config['redis'],{'host':_0x0788('0x1d'),'port':0x18eb});var socket=require(_0x0788('0x1e'))(new Redis(config[_0x0788('0x1b')]));require(_0x0788('0x1f'))['register'](socket);var jayson=require(_0x0788('0x20'));var client=jayson['client'][_0x0788('0x21')]({'port':0x232b});var client9004=jayson[_0x0788('0x22')][_0x0788('0x21')]({'port':0x232c});function respondWithRpcPromise(_0xb406fb,_0x2ddd1a,_0x430e34,_0x5e1a29){return new BPromise(function(_0x573822,_0x17d805){var _0x461d9d=_0x5e1a29||client;return _0x461d9d['request'](_0xb406fb,_0x430e34)[_0x0788('0x23')](function(_0x415f19){logger[_0x0788('0x24')]('ChatInteraction,\x20%s,\x20%s',_0x2ddd1a,_0x0788('0x25'));logger[_0x0788('0x26')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x2ddd1a,_0x0788('0x25'),JSON['stringify'](_0x415f19));if(_0x415f19[_0x0788('0x27')]){if(_0x415f19['error'][_0x0788('0x28')]===0x1f4){logger[_0x0788('0x27')](_0x0788('0x29'),_0x2ddd1a,_0x415f19[_0x0788('0x27')][_0x0788('0x2a')]);return _0x17d805(_0x415f19['error']['message']);}logger[_0x0788('0x27')](_0x0788('0x29'),_0x2ddd1a,_0x415f19[_0x0788('0x27')][_0x0788('0x2a')]);return _0x573822(_0x415f19['error']['message']);}else{logger[_0x0788('0x24')](_0x0788('0x29'),_0x2ddd1a,_0x0788('0x25'));_0x573822(_0x415f19['result']['message']);}})[_0x0788('0x2b')](function(_0xa1f7dc){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x2ddd1a,_0xa1f7dc);_0x17d805(_0xa1f7dc);});});}function respondWithStatusCode(_0x5a54a5,_0x44798c){_0x44798c=_0x44798c||0xcc;return function(_0x57fda1){if(_0x57fda1){return _0x5a54a5[_0x0788('0x2c')](_0x44798c);}return _0x5a54a5[_0x0788('0x2d')](_0x44798c)[_0x0788('0x2e')]();};}function respondWithResult(_0x18fc0e,_0xf9ba32){_0xf9ba32=_0xf9ba32||0xc8;return function(_0xb2f4a5){if(_0xb2f4a5){return _0x18fc0e[_0x0788('0x2d')](_0xf9ba32)[_0x0788('0x2f')](_0xb2f4a5);}};}function respondWithFilteredResult(_0x5b7594,_0x5a5178){return function(_0x3c5246){if(_0x3c5246){var _0x40d345=typeof _0x5a5178['offset']==='undefined'&&typeof _0x5a5178[_0x0788('0x30')]===_0x0788('0x31');var _0x20fcd8=_0x3c5246[_0x0788('0x32')];var _0x44cbfb=_0x40d345?0x0:_0x5a5178[_0x0788('0x33')];var _0x327d67=_0x40d345?_0x3c5246[_0x0788('0x32')]:_0x5a5178[_0x0788('0x33')]+_0x5a5178[_0x0788('0x30')];var _0x5ec0ed;if(_0x327d67>=_0x20fcd8){_0x327d67=_0x20fcd8;_0x5ec0ed=0xc8;}else{_0x5ec0ed=0xce;}_0x5b7594[_0x0788('0x2d')](_0x5ec0ed);return _0x5b7594[_0x0788('0x34')](_0x0788('0x35'),_0x44cbfb+'-'+_0x327d67+'/'+_0x20fcd8)[_0x0788('0x2f')](_0x3c5246);}return null;};}function patchUpdates(_0xce4534){return function(_0x458193){try{jsonpatch[_0x0788('0x36')](_0x458193,_0xce4534,!![]);}catch(_0x15d67a){return BPromise[_0x0788('0x37')](_0x15d67a);}return _0x458193[_0x0788('0x38')]();};}function saveUpdates(_0x4fa055,_0x4ae132){return function(_0x5947d3){if(_0x5947d3){return _0x5947d3['update'](_0x4fa055)['then'](function(_0x586a06){return _0x586a06;});}return null;};}function removeEntity(_0x208a89,_0x38a4ae){return function(_0x2130e3){if(_0x2130e3){return _0x2130e3['destroy']()[_0x0788('0x23')](function(){_0x208a89[_0x0788('0x2d')](0xcc)[_0x0788('0x2e')]();});}};}function handleEntityNotFound(_0xaea11d,_0x57c4d8){return function(_0x2ed940){if(!_0x2ed940){_0xaea11d['sendStatus'](0x194);}return _0x2ed940;};}function handleError(_0x322465,_0x4fcde3){_0x4fcde3=_0x4fcde3||0x1f4;return function(_0x9d1edb){logger[_0x0788('0x27')](_0x9d1edb['stack']);if(_0x9d1edb[_0x0788('0x39')]){delete _0x9d1edb[_0x0788('0x39')];}_0x322465['status'](_0x4fcde3)[_0x0788('0x3a')](_0x9d1edb);};}function getMustacheRender(_0x5eb693,_0x295024){return Mustache['render'](_0x5eb693,_[_0x0788('0x3b')](_0x295024['body'],{'contact':_0x295024[_0x0788('0x3c')],'message':_0x295024['message'],'agent':_0x295024['agent'],'interaction':_0x295024[_0x0788('0x3d')],'account':_0x295024[_0x0788('0x3e')]}))||'';}function getInteractionUsers(_0x2e48cf,_0x2d17b0){return new BPromise(function(_0x8cfffc,_0x53da74){try{if(_0x2d17b0[_0x2e48cf['id']]){_0x2e48cf['Users']=_['map'](_0x2d17b0[_0x2e48cf['id']],function(_0x4d539a){return{'id':_0x4d539a['id'],'fullname':_0x4d539a[_0x0788('0x3f')]};});}}catch(_0x1202c4){_0x53da74(_0x1202c4);}_0x8cfffc(_0x2e48cf);});}function getInteractionTags(_0x45b247,_0x358a22){return new BPromise(function(_0x362c49,_0x5993ad){try{if(_0x45b247['TagIds']){_0x45b247[_0x0788('0x40')]=[];_0x45b247[_0x0788('0x41')][_0x0788('0x42')](',')[_0x0788('0x43')](function(_0x236b63){_0x45b247[_0x0788('0x40')][_0x0788('0x44')](_0x358a22[_0x236b63]);});}delete _0x45b247[_0x0788('0x41')];}catch(_0x347984){_0x5993ad(_0x347984);}_0x362c49(_0x45b247);});}function updateChatInteraction(_0x50e8f5,_0x5581e6,_0x441aec){return new BPromise(function(_0x1d579d,_0x9e8ee){return getInteractionUsers(_0x50e8f5,_0x441aec)['then'](function(_0x5ab353){return getInteractionTags(_0x5ab353,_0x5581e6);})['then'](function(_0x172424){_0x1d579d(_0x172424);})[_0x0788('0x2b')](function(_0x25501b){_0x9e8ee(_0x25501b);});});}exports[_0x0788('0x45')]=function(_0x2737d8,_0x1928f3){var _0x1ab634={},_0x15b90c={},_0x4bd0d9={'count':0x0,'rows':[]};var _0x15c618=_[_0x0788('0x46')](db[_0x0788('0x47')][_0x0788('0x48')],function(_0x58eb04){return{'name':_0x58eb04[_0x0788('0x49')],'type':_0x58eb04[_0x0788('0x4a')]['key']};});_0x15b90c['model']=_['map'](_0x15c618,_0x0788('0x39'));_0x15b90c['query']=_[_0x0788('0x4b')](_0x2737d8[_0x0788('0x4c')]);_0x15b90c[_0x0788('0x4d')]=_[_0x0788('0x4e')](_0x15b90c[_0x0788('0x4f')],_0x15b90c[_0x0788('0x4c')]);_0x1ab634[_0x0788('0x50')]=_[_0x0788('0x4e')](_0x15b90c['model'],qs['fields'](_0x2737d8[_0x0788('0x4c')][_0x0788('0x51')]));_0x1ab634[_0x0788('0x50')]=_0x1ab634['attributes'][_0x0788('0x52')]?_0x1ab634[_0x0788('0x50')]:_0x15b90c[_0x0788('0x4f')];if(!_0x2737d8[_0x0788('0x4c')][_0x0788('0x53')]('nolimit')){_0x1ab634['limit']=qs[_0x0788('0x30')](_0x2737d8[_0x0788('0x4c')]['limit']);_0x1ab634[_0x0788('0x33')]=qs['offset'](_0x2737d8[_0x0788('0x4c')][_0x0788('0x33')]);}_0x1ab634[_0x0788('0x54')]=qs[_0x0788('0x55')](_0x2737d8[_0x0788('0x4c')][_0x0788('0x55')]);_0x1ab634[_0x0788('0x56')]=qs[_0x0788('0x4d')](_['pick'](_0x2737d8[_0x0788('0x4c')],_0x15b90c[_0x0788('0x4d')]),_0x15c618);var _0x3f2f1b=[];var _0x5ef557=squel[_0x0788('0x57')]()[_0x0788('0x58')]('id')['field'](_0x0788('0x39'))[_0x0788('0x58')](_0x0788('0x59'))[_0x0788('0x5a')](_0x0788('0x5b'));var _0x347cc8=squel['select']()['field'](_0x0788('0x5c'))[_0x0788('0x58')]('u.fullname')[_0x0788('0x58')](_0x0788('0x5d'))[_0x0788('0x5a')](_0x0788('0x5e'),'ui')[_0x0788('0x5f')](_0x0788('0x60'),'u',_0x0788('0x61'));var _0xeedd30=squel[_0x0788('0x57')]()[_0x0788('0x5a')](_0x0788('0x62'),'i')[_0x0788('0x5f')]('cm_contacts','c',_0x0788('0x63'))[_0x0788('0x5f')](_0x0788('0x60'),'o','o.id\x20=\x20i.UserId')[_0x0788('0x5f')](_0x0788('0x64'),'a','a.id\x20=\x20i.ChatWebsiteId')['left_join'](_0x0788('0x65'),'me',_0x0788('0x66'))[_0x0788('0x5f')](_0x0788('0x67'),'it',_0x0788('0x68'))[_0x0788('0x5f')]('tools_tags','t',_0x0788('0x69'));var _0x3be076=squel[_0x0788('0x6a')]();var _0x47be71=[];var _0x533f71=squel[_0x0788('0x6a')]();var _0x5419d9;if(_0x2737d8[_0x0788('0x4c')][_0x0788('0x6b')]){_0x5419d9=as[_0x0788('0x6c')](_0x2737d8[_0x0788('0x4c')][_0x0788('0x6b')]);var _0x348d25=_0x5419d9[_0x0788('0x6d')];for(var _0x29c912=0x0;_0x29c912<_0x5419d9[_0x0788('0x6e')][_0x0788('0x52')];_0x29c912++){var _0x59fcbc=_0x5419d9[_0x0788('0x6e')][_0x29c912];var _0x446170='i';var _0x602e3b=_[_0x0788('0x6f')](_0x15c618,['name',_0x59fcbc[_0x0788('0x58')]]);if(!_0x602e3b){switch(_0x59fcbc[_0x0788('0x58')]){case _0x0788('0x70'):if(_0x59fcbc[_0x0788('0x71')]==0x1){_0xeedd30[_0x0788('0x72')]('`'+_0x59fcbc['field']+_0x0788('0x73'));}else{_0xeedd30['having']('`'+_0x59fcbc[_0x0788('0x58')]+_0x0788('0x74'));}break;case _0x0788('0x75'):if(_0x59fcbc[_0x0788('0x76')]===_0x0788('0x77')){if(_0x59fcbc[_0x0788('0x71')][_0x0788('0x42')]('\x20')[_0x0788('0x52')]>0x1){_0x3be076[_0x348d25](_0x0788('0x78'),qs['getFullTextValue'](_0x59fcbc[_0x0788('0x71')]),null);}else{var _0x2dea6c='%'+_0x59fcbc[_0x0788('0x71')]+'%';_0x3be076[_0x348d25]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x2dea6c,_0x2dea6c,_0x2dea6c);}}else{_0x602e3b=_['find'](_0x15c618,[_0x0788('0x39'),_0x0788('0x79')]);_0x59fcbc[_0x0788('0x58')]='ContactId';_0x35c612=as[_0x0788('0x7a')](_0x446170,_0x602e3b[_0x0788('0x4a')],_0x59fcbc);_0x3be076[_0x348d25](_0x35c612[_0x0788('0x7b')],_0x35c612[_0x0788('0x71')]['start'],_0x35c612['value']['end']);}break;case _0x0788('0x7c'):var _0x2a55f2=_0x59fcbc[_0x0788('0x71')]['split'](',')['map'](function(_0xaa2d4d){return Number(_0xaa2d4d);});_0x2a55f2['forEach'](function(_0x955bfa){_0x533f71['or'](_0x0788('0x7d'),'%,'+_0x955bfa+',%');});_0x47be71=_[_0x0788('0x7e')](_0x47be71,_0x2a55f2);break;case _0x0788('0x7f'):if(_0x59fcbc[_0x0788('0x76')]===_0x0788('0x77')){_0x3be076[_0x348d25](_0x0788('0x80'),'%'+_0x59fcbc[_0x0788('0x71')]+'%',null);}else{_0x602e3b=_[_0x0788('0x6f')](_0x15c618,[_0x0788('0x39'),'UserId']);_0x59fcbc[_0x0788('0x58')]=_0x0788('0x81');_0x35c612=as['buildExpression'](_0x446170,_0x602e3b['type'],_0x59fcbc);_0x3be076[_0x348d25](_0x35c612[_0x0788('0x7b')],_0x35c612[_0x0788('0x71')][_0x0788('0x82')],_0x35c612[_0x0788('0x71')][_0x0788('0x2e')]);}break;case _0x0788('0x83'):_0x35c612=as['buildExpression']('me',null,_0x59fcbc);_0x3be076[_0x348d25](_0x35c612[_0x0788('0x7b')],_0x35c612[_0x0788('0x71')][_0x0788('0x82')],_0x35c612[_0x0788('0x71')]['end']);break;}}else{var _0x35c612=as[_0x0788('0x7a')](_0x446170,_0x602e3b[_0x0788('0x4a')],_0x59fcbc);_0x3be076[_0x348d25](_0x35c612[_0x0788('0x7b')],_0x35c612['value']['start'],_0x35c612[_0x0788('0x71')][_0x0788('0x2e')]);}}}else{var _0x5513f7=_(_0x2737d8[_0x0788('0x4c')])[_0x0788('0x4b')]()[_0x0788('0x46')](function(_0x2b10fe){return _[_0x0788('0x84')](_0x15c618,[_0x0788('0x39'),_0x2b10fe])?_0x2b10fe:undefined;})['compact']()[_0x0788('0x71')]();if(!_[_0x0788('0x85')](_0x5513f7)){_0x5513f7[_0x0788('0x43')](function(_0x515dd8){if(_0x515dd8==='ChatWebsiteId'){_0xeedd30[_0x0788('0x56')]('i.ChatWebsiteId\x20IN\x20?',[][_0x0788('0x86')](_0x2737d8[_0x0788('0x4c')][_0x515dd8]));}else if(_0x515dd8===_0x0788('0x87')){var _0xa4b3f8=JSON[_0x0788('0x88')](_0x2737d8[_0x0788('0x4c')][_0x515dd8])[_0x0788('0x89')];var _0x216ea9=JSON[_0x0788('0x88')](_0x2737d8['query'][_0x515dd8])[_0x0788('0x8a')];_0xeedd30[_0x0788('0x56')](_0x0788('0x8b'),_0xa4b3f8,_0x216ea9);}else{if(_0x2737d8['query'][_0x515dd8]===_0x0788('0x8c')){_0xeedd30[_0x0788('0x56')]('i.'+_0x515dd8+_0x0788('0x8d'));}else{_0xeedd30['where']('i.'+_0x515dd8+_0x0788('0x8e'),_0x2737d8[_0x0788('0x4c')][_0x515dd8]);}}});}if(_0x2737d8[_0x0788('0x4c')][_0x0788('0x8f')]){if(_0x2737d8[_0x0788('0x4c')][_0x0788('0x8f')]==0x1){_0xeedd30[_0x0788('0x72')](_0x0788('0x90'));}else{_0xeedd30[_0x0788('0x72')]('`unreadMessages`\x20>\x200');}}if(_0x2737d8[_0x0788('0x4c')][_0x0788('0x91')]){_0x47be71=_[_0x0788('0x92')](_0x2737d8[_0x0788('0x4c')][_0x0788('0x91')])?_0x2737d8['query'][_0x0788('0x91')]:new Array(_0x2737d8[_0x0788('0x4c')][_0x0788('0x91')]);_0x47be71['forEach'](function(_0x1788d1){_0x533f71['or'](_0x0788('0x7d'),'%,'+_0x1788d1+',%');});}if(_0x2737d8[_0x0788('0x4c')][_0x0788('0x93')]){var _0x2b74df=_0x2737d8['query'][_0x0788('0x93')][_0x0788('0x94')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x0788('0x95')](_0x2b74df)){_0x3be076['or'](_0x0788('0x96'),_0x2b74df+'%');}else{_0x3be076['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0788('0x97')](_0x2b74df))['or'](_0x0788('0x98'),_0x2b74df+'%');}}}_0xeedd30[_0x0788('0x56')](_0x3be076);_0xeedd30['group'](_0x0788('0x99'));var _0x42c537={'type':db[_0x0788('0x9a')]['QueryTypes'][_0x0788('0x9b')],'raw':!![]};var _0x1b3046=_0xeedd30[_0x0788('0x9c')]();_0x1b3046[_0x0788('0x58')](_0x0788('0x99'));_0x1b3046[_0x0788('0x58')](_0x0788('0x9d'),_0x0788('0x70'));if(_0x1ab634['order']){_0x1ab634[_0x0788('0x54')][_0x0788('0x43')](function(_0x121f1d){var _0x31c921=_0x121f1d[0x0]==='contactName'?_0x121f1d[0x0]:'i.'+_0x121f1d[0x0];_0xeedd30['order'](_0x31c921,_0x121f1d[0x1]===_0x0788('0x9e')?![]:!![]);});}if(!_[_0x0788('0x85')](_0x47be71)){_0xeedd30['having'](_0x533f71);_0x1b3046[_0x0788('0x56')](_0x0788('0x9f'),_0x47be71);}BPromise[_0x0788('0xa0')]()['then'](function(){if(!_0x5419d9){if(_0x2737d8['query'][_0x0788('0xa1')])return;_0x1b3046[_0x0788('0x56')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0xeedd30['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x2737d8[_0x0788('0xa2')][_0x0788('0xa3')]!=='agent')return;return _0x2737d8[_0x0788('0xa2')][_0x0788('0xa4')]({'attributes':['id'],'raw':!![]})[_0x0788('0x23')](function(_0x41fe7a){if(_[_0x0788('0x85')](_0x41fe7a)){_0x1b3046['where'](_0x0788('0xa5'));_0xeedd30['where'](_0x0788('0xa5'));}else{_0x1b3046['where'](_0x0788('0xa6'),_[_0x0788('0x46')](_0x41fe7a,'id'));_0xeedd30[_0x0788('0x56')](_0x0788('0xa6'),_[_0x0788('0x46')](_0x41fe7a,'id'));}});})[_0x0788('0x23')](function(){if(_0x2737d8[_0x0788('0xa2')][_0x0788('0xa3')]===_0x0788('0xa7')&&!_0x5419d9&&!_0x2737d8[_0x0788('0x4c')][_0x0788('0xa1')])return[];return db[_0x0788('0xa8')][_0x0788('0x4c')](_0x1b3046['toString'](),_0x42c537);})['then'](function(_0x50363e){_0x4bd0d9[_0x0788('0x32')]=_0x50363e[_0x0788('0x52')];if(_0x4bd0d9[_0x0788('0x32')]===0x0)return[];return db[_0x0788('0xa8')][_0x0788('0x4c')](_0x5ef557[_0x0788('0xa9')](),_0x42c537)[_0x0788('0x23')](function(_0x16838d){_0x3f2f1b=_[_0x0788('0xaa')](_0x16838d,'id');_0x42c537=_[_0x0788('0x3b')](_0x42c537,{'model':db[_0x0788('0x47')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2737d8['query']['fields']){_0x1ab634[_0x0788('0x50')][_0x0788('0x43')](function(_0x104a70){_0xeedd30[_0x0788('0x58')]('i.'+_0x104a70);});}else{_0xeedd30[_0x0788('0x58')](_0x0788('0x9d'),_0x0788('0x70'));_0xeedd30[_0x0788('0x58')]('a.key','Account.key');_0xeedd30[_0x0788('0x58')](_0x0788('0xab'),_0x0788('0xac'));_0xeedd30[_0x0788('0x58')](_0x0788('0xad'),_0x0788('0xae'));_0xeedd30['field'](_0x0788('0xaf'));_0xeedd30[_0x0788('0x58')](_0x0788('0xb0'),_0x0788('0xb1'));_0xeedd30[_0x0788('0x58')](_0x0788('0xb2'),_0x0788('0xb3'));_0xeedd30[_0x0788('0x58')](_0x0788('0xb4'),'Contact.email');_0xeedd30[_0x0788('0x58')](_0x0788('0xb5'),_0x0788('0xb6'));_0xeedd30[_0x0788('0x58')](_0x0788('0xb7'),_0x0788('0xb8'));_0xeedd30['field'](_0x0788('0xb9'),_0x0788('0xba'));_0xeedd30[_0x0788('0x58')](_0x0788('0xbb'),_0x0788('0xbc'));_0xeedd30[_0x0788('0x58')](_0x0788('0xbd'),_0x0788('0xbe'));_0xeedd30[_0x0788('0x58')](_0x0788('0xbf'),'TagIds');}if(_0x1ab634[_0x0788('0x30')])_0xeedd30['limit'](_0x1ab634[_0x0788('0x30')]);if(_0x1ab634['offset'])_0xeedd30[_0x0788('0x33')](_0x1ab634['offset']);return db[_0x0788('0xa8')][_0x0788('0x4c')](_0xeedd30[_0x0788('0xa9')](),_0x42c537);})[_0x0788('0x23')](function(_0x5242eb){if(_0x5242eb[_0x0788('0x52')]>0x0)_0x347cc8[_0x0788('0x56')](_0x0788('0xc0'),_['map'](_0x5242eb,'id'));return db[_0x0788('0xa8')][_0x0788('0x4c')](_0x347cc8['toString'](),_0x42c537)[_0x0788('0x23')](function(_0x4645aa){var _0x37e9a9=_[_0x0788('0xc1')](_0x4645aa,_0x0788('0xc2'));var _0xab471b=[];_0x5242eb[_0x0788('0x43')](function(_0x563533){_0xab471b[_0x0788('0x44')](updateChatInteraction(_0x563533,_0x3f2f1b,_0x37e9a9));});return BPromise[_0x0788('0xc3')](_0xab471b);});});})[_0x0788('0x23')](function(_0x3f3e06){_0x4bd0d9[_0x0788('0xc4')]=_0x3f3e06;return _0x4bd0d9;})[_0x0788('0x23')](respondWithFilteredResult(_0x1928f3,_0x1ab634))[_0x0788('0x2b')](handleError(_0x1928f3,null));};exports[_0x0788('0xc5')]=function(_0x5761b1,_0x5130c4){var _0x26233b={'raw':![],'where':{'id':_0x5761b1[_0x0788('0xc6')]['id']}},_0x42f6df={};_0x42f6df[_0x0788('0x4f')]=_[_0x0788('0x4b')](db[_0x0788('0x47')][_0x0788('0x48')]);_0x42f6df['query']=_[_0x0788('0x4b')](_0x5761b1['query']);_0x42f6df['filters']=_[_0x0788('0x4e')](_0x42f6df[_0x0788('0x4f')],_0x42f6df['query']);_0x26233b[_0x0788('0x50')]=_[_0x0788('0x4e')](_0x42f6df[_0x0788('0x4f')],qs[_0x0788('0x51')](_0x5761b1[_0x0788('0x4c')][_0x0788('0x51')]));_0x26233b['attributes']=_0x26233b[_0x0788('0x50')][_0x0788('0x52')]?_0x26233b['attributes']:_0x42f6df[_0x0788('0x4f')];if(_0x5761b1[_0x0788('0x4c')]['includeAll']){_0x26233b[_0x0788('0xc7')]=[{'all':!![]}];}_0x26233b=_[_0x0788('0x3b')]({},_0x26233b,_0x5761b1[_0x0788('0xc8')]);return db[_0x0788('0x47')][_0x0788('0x6f')](_0x26233b)[_0x0788('0x23')](handleEntityNotFound(_0x5130c4,null))[_0x0788('0x23')](respondWithResult(_0x5130c4,null))['catch'](handleError(_0x5130c4,null));};exports[_0x0788('0xc9')]=function(_0x2e0529,_0x1f9944){return db[_0x0788('0x47')]['create'](_0x2e0529[_0x0788('0x83')],{})[_0x0788('0x23')](respondWithResult(_0x1f9944,0xc9))['catch'](handleError(_0x1f9944,null));};exports['update']=function(_0x691225,_0x15a70b){if(_0x691225[_0x0788('0x83')]['id']){delete _0x691225[_0x0788('0x83')]['id'];}return db[_0x0788('0x47')][_0x0788('0x6f')]({'where':{'id':_0x691225['params']['id']}})[_0x0788('0x23')](handleEntityNotFound(_0x15a70b,null))[_0x0788('0x23')](saveUpdates(_0x691225[_0x0788('0x83')],null))[_0x0788('0x23')](respondWithResult(_0x15a70b,null))[_0x0788('0x2b')](handleError(_0x15a70b,null));};exports[_0x0788('0xca')]=function(_0xc5e64a,_0x3539d4){return db[_0x0788('0x47')][_0x0788('0x6f')]({'where':{'id':_0xc5e64a[_0x0788('0xc6')]['id']}})[_0x0788('0x23')](handleEntityNotFound(_0x3539d4,null))[_0x0788('0x23')](removeEntity(_0x3539d4,null))[_0x0788('0x2b')](handleError(_0x3539d4,null));};exports[_0x0788('0xcb')]=function(_0x150a05,_0x1e0fb7){return db['ChatInteraction'][_0x0788('0xcb')]()[_0x0788('0x23')](respondWithResult(_0x1e0fb7,null))[_0x0788('0x2b')](handleError(_0x1e0fb7,null));};exports[_0x0788('0xcc')]=function(_0x57b44e,_0x191e15){var _0x5d0919=_0x57b44e[_0x0788('0xc6')]['id'];var _0x563e4c;var _0x51da2c;var _0x34a12a;return db[_0x0788('0x47')]['findOne']({'where':{'id':_0x5d0919}})[_0x0788('0x23')](function(_0x522e02){_0x563e4c=_0x522e02;return db[_0x0788('0xcd')]['findOne']({'where':{'id':_0x522e02[_0x0788('0xa1')]},'attributes':['id',_0x0788('0xce'),_0x0788('0xcf'),_0x0788('0xd0'),_0x0788('0xd1'),_0x0788('0xd2')],'raw':!![]});})['then'](function(_0x473491){if(_0x473491&&_0x473491['vidaooApiKey']&&_0x473491[_0x0788('0xcf')]){_0x51da2c=_0x473491;var _0x1222f8={'interaction':{'id':_0x5d0919},'agent':{'id':_0x57b44e['user']['id'],'name':_0x57b44e['user']['name'],'fullname':_0x57b44e[_0x0788('0xa2')]['fullname'],'email':_0x57b44e['user']['email']},'contact':_0x57b44e['body']['contact'],'account':_0x57b44e['body'][_0x0788('0x3e')]};var _0x3c2aa3={'rejectUnauthorized':![],'method':'POST','url':_0x0788('0xd3'),'headers':{'X-APIKEY':_0x473491['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x57b44e[_0x0788('0xa2')]['email']],'buttons':null,'topic':_0x51da2c[_0x0788('0xd0')],'note':_[_0x0788('0xd4')](_0x51da2c[_0x0788('0xd1')])?null:getMustacheRender(_0x51da2c[_0x0788('0xd1')],_0x1222f8),'metadata':null},'redirect':_0x0788('0xd5'),'json':!![]};try{if(!_[_0x0788('0xd4')](_0x51da2c[_0x0788('0xd2')])){var _0x37439f=getMustacheRender(_0x51da2c[_0x0788('0xd2')],_0x1222f8);var _0xf87649=JSON['parse'](_0x37439f);_0x3c2aa3[_0x0788('0x83')]['metadata']=_0xf87649;}}catch(_0x3bd7f3){throw new db['Sequelize']['ValidationError'](_0x0788('0xd6'));}return rp(_0x3c2aa3);}else{throw new db[(_0x0788('0x9a'))][(_0x0788('0xd7'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x0788('0x23')](function(_0x1b52f6){_0x34a12a=_0x1b52f6;if(_0x34a12a['id']){var _0x5be647={'body':_0x34a12a['join_url'],'ChatWebsiteId':_0x51da2c['id'],'ChatInteractionId':_0x563e4c['id'],'direction':_0x0788('0xd8'),'UserId':_0x57b44e[_0x0788('0xa2')]['id']};return db[_0x0788('0xd9')]['create'](_0x5be647,{});}else{throw new db['Sequelize'][(_0x0788('0xd7'))](_0x0788('0xda'));}})[_0x0788('0x23')](function(){return _0x563e4c[_0x0788('0xdb')]({'vidaooSessionId':_0x34a12a['id']});})[_0x0788('0x23')](respondWithResult(_0x191e15,null))[_0x0788('0x2b')](handleError(_0x191e15,null));};exports[_0x0788('0xdc')]=function(_0x252780,_0x3d3272){if(_0x252780['body']['id']){delete _0x252780[_0x0788('0x83')]['id'];}return db['ChatInteraction'][_0x0788('0x6f')]({'where':{'id':_0x252780[_0x0788('0xc6')]['id']},'include':[{'model':db[_0x0788('0xdd')],'as':_0x0788('0x75')}]})[_0x0788('0x23')](handleEntityNotFound(_0x3d3272,null))['then'](saveUpdates(_0x252780[_0x0788('0x83')],null))[_0x0788('0x23')](respondWithResult(_0x3d3272,null))['catch'](handleError(_0x3d3272,null));};exports[_0x0788('0xde')]=function(_0x881d27,_0x47ce3c,_0x1c9b6f){if(_0x881d27['body']['id']){delete _0x881d27[_0x0788('0x83')]['id'];}return db[_0x0788('0x47')]['find']({'where':{'id':_0x881d27[_0x0788('0xc6')]['id']}})[_0x0788('0x23')](function(_0x207b55){if(!_0x207b55){logger[_0x0788('0x27')](_0x0788('0xdf'),_0x0788('0xde'),0x194,_0x0788('0xe0'));_0x47ce3c[_0x0788('0x2c')](0x194);}else{if(_0x207b55['UserId']){throw new db[(_0x0788('0x9a'))][(_0x0788('0xd7'))](_0x0788('0xe1'));}}return _0x207b55;})['then'](function(_0x5ac0bc){if(_0x5ac0bc){return _0x5ac0bc[_0x0788('0xe2')]({'closed':_0x881d27[_0x0788('0x83')][_0x0788('0xe3')],'disposition':_0x881d27[_0x0788('0x83')][_0x0788('0xe4')]})[_0x0788('0x23')](function(_0x48e56d){return _0x48e56d;});}})[_0x0788('0x23')](function(_0x227eaf){return respondWithRpcPromise(_0x0788('0xe5'),_0x0788('0xde'),_0x881d27[_0x0788('0x83')],client9004);})[_0x0788('0x23')](respondWithResult(_0x47ce3c,null))[_0x0788('0x2b')](handleError(_0x47ce3c,null));};exports[_0x0788('0xe6')]=function(_0x1fc335,_0x27c428,_0x1ce4f2){_0x1fc335[_0x0788('0x83')][_0x0788('0x39')]=_0x1fc335[_0x0788('0xe7')][_0x0788('0xe8')];_0x1fc335[_0x0788('0x83')][_0x0788('0xe9')]=_0x1fc335[_0x0788('0xe7')][_0x0788('0xea')];_0x1fc335[_0x0788('0x83')][_0x0788('0x4a')]=_0x1fc335['file'][_0x0788('0xeb')];return db[_0x0788('0xec')][_0x0788('0xc9')](_0x1fc335[_0x0788('0x83')])['then'](respondWithResult(_0x27c428,0xc9))[_0x0788('0x2b')](handleError(_0x27c428,null));};exports[_0x0788('0xed')]=function(_0x5eb3f1,_0xb63553,_0x4a34e2){return db['ChatInteraction']['findOne']({'where':{'id':_0x5eb3f1['params']['id']},'raw':!![]})[_0x0788('0x23')](handleEntityNotFound(_0xb63553,null))[_0x0788('0x23')](function(_0x4cc536){if(_0x4cc536){if(_0x4cc536[_0x0788('0xe3')]){return _0xb63553[_0x0788('0x2d')](0x193)[_0x0788('0x2f')]({'status':0x193,'message':_0x0788('0xee')});}return db[_0x0788('0xec')][_0x0788('0xef')]({'where':{'id':_0x5eb3f1[_0x0788('0x4c')][_0x0788('0xf0')]},'raw':!![]})[_0x0788('0x23')](handleEntityNotFound(_0xb63553,null));}})['then'](function(_0x2047bc){if(_0x2047bc){var _0x38fd71=_0x2047bc['ChatOfflineMessageId']!==null;var _0x224ef9=path[_0x0788('0xf1')](config[_0x0788('0xf2')],_0x0788('0xf3'));if(_0x38fd71){_0x224ef9=path[_0x0788('0xf1')](_0x224ef9,_0x0788('0xf4'));}var _0x2399b9=path[_0x0788('0xf1')](_0x224ef9,_0x2047bc[_0x0788('0xe9')]);return _0xb63553[_0x0788('0xf5')](_0x2399b9);}})[_0x0788('0x2b')](handleError(_0xb63553,null));};exports[_0x0788('0xf6')]=function(_0x31c746,_0x4f696c){var _0x11de9c=null;var _0xf690e0=null;var _0x4a492c=null;var _0x523faa=null;if(_0x31c746[_0x0788('0x83')]['id']){delete _0x31c746[_0x0788('0x83')]['id'];}if(_0x31c746['body'][_0x0788('0xf7')]){_0x523faa=path[_0x0788('0xf1')](config[_0x0788('0xf2')],'server/files/chat/upload/',util['format'](_0x0788('0xf8'),Date[_0x0788('0xf9')]()));_0x31c746['body']['pathTranscript']=_0x523faa;}return db[_0x0788('0x47')][_0x0788('0x6f')]({'where':{'id':_0x31c746['params']['id']},'include':[{'model':db['ChatMessage'],'as':_0x0788('0xfa'),'include':[{'model':db[_0x0788('0x7f')],'as':'User'}]}]})[_0x0788('0x23')](handleEntityNotFound(_0x4f696c,null))[_0x0788('0x23')](saveUpdates(_0x31c746['body'],null))[_0x0788('0x23')](function(_0x21be45){if(_0x21be45){_0x11de9c=_0x21be45;return db[_0x0788('0xcd')][_0x0788('0x6f')]({'where':{'id':_0x11de9c[_0x0788('0xa1')]}});}})['then'](function(_0x36acad){if(_0x36acad){_0x4a492c=_0x36acad;return db[_0x0788('0xdd')][_0x0788('0x6f')]({'where':{'id':_0x11de9c[_0x0788('0x79')]}});}})[_0x0788('0x23')](function(_0x569b4d){if(_0x569b4d){_0xf690e0=_0x569b4d;if(_0x523faa){var _0x31ffc7=null;for(var _0x59aece=0x1;_0x59aece<_0x11de9c['Messages'][_0x0788('0x52')];++_0x59aece){_0x31ffc7=_0x11de9c[_0x0788('0xfa')][_0x59aece];var _0x3787d3=_0x31ffc7[_0x0788('0x81')]?util['format'](_0x0788('0xfb'),_0x4a492c[_0x0788('0xfc')],_0x31ffc7[_0x0788('0x81')]):'System';var _0x3ea229=_0x31c746[_0x0788('0x83')][_0x0788('0xfd')]||util[_0x0788('0xfe')](_0x0788('0xfb'),'Visitor',_0x31ffc7[_0x0788('0x79')]);switch(_0x4a492c['agentIdentifier']){case _0x0788('0xff'):_0x3787d3=_0x31ffc7[_0x0788('0x81')]?util[_0x0788('0xfe')](_0x0788('0xfb'),_0x4a492c[_0x0788('0xfc')],_0x31ffc7['UserId']):_0x0788('0x100');break;case'agent_alias':_0x3787d3=_0x31ffc7[_0x0788('0x81')]?_0x31ffc7['User'][_0x0788('0x101')]||_0x31ffc7[_0x0788('0x7f')]['fullname']:_0x0788('0x100');break;case _0x0788('0x102'):_0x3787d3=_0x31ffc7[_0x0788('0x81')]?_0x31ffc7[_0x0788('0x7f')][_0x0788('0x3f')]:_0x0788('0x100');break;default:_0x3787d3=_0x31ffc7[_0x0788('0x81')]?util[_0x0788('0xfe')](_0x0788('0xfb'),_0x4a492c[_0x0788('0xfc')],_0x31ffc7[_0x0788('0x81')]):'System';}var _0x303d5=util['format'](_0x0788('0x103'),moment(_0x31ffc7['createdAt'])[_0x0788('0xfe')](_0x0788('0x104')),_0x31ffc7['direction']==='in'?_0x3ea229:_0x3787d3,_0x31ffc7['body']);if(!_0x31ffc7['secret']){fs[_0x0788('0x105')](_0x523faa,_0x303d5);}}return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x0788('0x106')],'as':_0x0788('0x107'),'raw':!![]}]});}}})[_0x0788('0x23')](function(_0x5c5464){if(_0x5c5464&&_0x5c5464[_0x0788('0x107')]&&_0x31c746[_0x0788('0x83')]){var _0x14420b={'tls':{'rejectUnauthorized':![]}};if(_0x5c5464['Smtp']['service']){_0x14420b[_0x0788('0x108')]=_0x5c5464[_0x0788('0x107')][_0x0788('0x108')];}else{_0x14420b['host']=_0x5c5464[_0x0788('0x107')][_0x0788('0x109')];_0x14420b[_0x0788('0x10a')]=_0x5c5464['Smtp']['port'];_0x14420b[_0x0788('0x10b')]=_0x5c5464['Smtp'][_0x0788('0x10b')];}if(_0x5c5464[_0x0788('0x107')]['authentication']){_0x14420b['auth']={'user':_0x5c5464[_0x0788('0x107')][_0x0788('0xa2')],'pass':_0x5c5464['Smtp'][_0x0788('0x10c')]};}return respondWithRpcPromise(_0x0788('0x10d'),'sendMail',{'account':_0x14420b,'message':{'from':util[_0x0788('0xfe')](_0x0788('0x10e'),_0x5c5464[_0x0788('0x39')],_0x5c5464[_0x0788('0x10f')]||_0x5c5464['Smtp'][_0x0788('0xa2')]),'to':_0x31c746[_0x0788('0x83')][_0x0788('0xf7')],'subject':_0x0788('0x110'),'text':util[_0x0788('0xfe')](_0x0788('0x111'),_0x31c746[_0x0788('0x83')][_0x0788('0xf7')]),'attachments':[{'path':_0x523faa}]}})[_0x0788('0x23')](function(){return _0x11de9c;})['catch'](function(_0x1b5b80){console[_0x0788('0x27')](_0x1b5b80);});}else{return _0x11de9c;}})['then'](respondWithStatusCode(_0x4f696c,0xc8))[_0x0788('0x2b')](handleError(_0x4f696c,null));};exports[_0x0788('0x112')]=function(_0x5522e3,_0x5f1a46,_0x248f60){return db[_0x0788('0xd9')][_0x0788('0x6f')]({'where':{'id':_0x5522e3['params']['id']}})[_0x0788('0x23')](handleEntityNotFound(_0x5f1a46,null))[_0x0788('0x23')](function(_0x36d7f9){if(_0x36d7f9){return _0x36d7f9['addMessage'](_0x5522e3[_0x0788('0x83')][_0x0788('0x113')],_['omit'](_0x5522e3['body'],['ids','id'])||{});}})[_0x0788('0x23')](respondWithResult(_0x5f1a46,null))[_0x0788('0x2b')](handleError(_0x5f1a46,null));};exports[_0x0788('0x114')]=function(_0x20f429,_0x364f26,_0x351665){var _0x1ba9fb={'raw':![],'where':{}};var _0x56b11c={};var _0x4f36bd={'count':0x0,'rows':[]};return db[_0x0788('0x47')][_0x0788('0xef')]({'where':{'id':_0x20f429[_0x0788('0xc6')]['id']}})['then'](handleEntityNotFound(_0x364f26,null))[_0x0788('0x23')](function(_0x1c7980){if(_0x1c7980){_0x56b11c[_0x0788('0x4f')]=_[_0x0788('0x4b')](db['ChatMessage']['rawAttributes']);_0x56b11c[_0x0788('0x4c')]=_[_0x0788('0x4b')](_0x20f429[_0x0788('0x4c')]);_0x56b11c[_0x0788('0x4d')]=_[_0x0788('0x4e')](_0x56b11c[_0x0788('0x4f')],_0x56b11c[_0x0788('0x4c')]);_0x1ba9fb[_0x0788('0x50')]=_[_0x0788('0x4e')](_0x56b11c['model'],qs[_0x0788('0x51')](_0x20f429[_0x0788('0x4c')][_0x0788('0x51')]));_0x1ba9fb[_0x0788('0x50')]=_0x1ba9fb[_0x0788('0x50')][_0x0788('0x52')]?_0x1ba9fb[_0x0788('0x50')]:_0x56b11c['model'];if(!_0x20f429[_0x0788('0x4c')][_0x0788('0x53')](_0x0788('0x115'))){_0x1ba9fb['limit']=qs[_0x0788('0x30')](_0x20f429[_0x0788('0x4c')][_0x0788('0x30')]);_0x1ba9fb[_0x0788('0x33')]=qs[_0x0788('0x33')](_0x20f429['query']['offset']);}_0x1ba9fb['order']=qs[_0x0788('0x55')](_0x20f429[_0x0788('0x4c')][_0x0788('0x55')]);_0x1ba9fb[_0x0788('0x56')]=qs[_0x0788('0x4d')](_[_0x0788('0x116')](_0x20f429[_0x0788('0x4c')],_0x56b11c['filters']));_0x1ba9fb[_0x0788('0x56')][_0x0788('0xc2')]=_0x1c7980['id'];if(_0x20f429[_0x0788('0x4c')][_0x0788('0x93')]){_0x1ba9fb['where']=_[_0x0788('0x3b')](_0x1ba9fb[_0x0788('0x56')],{'$or':_[_0x0788('0x46')](_0x1ba9fb[_0x0788('0x50')],function(_0xccb2e6){var _0x4cc769={};_0x4cc769[_0xccb2e6]={'$like':'%'+_0x20f429[_0x0788('0x4c')][_0x0788('0x93')]+'%'};return _0x4cc769;})});}if(_0x20f429[_0x0788('0x4c')][_0x0788('0x89')]){var _0x4785ac=_0x20f429[_0x0788('0x4c')][_0x0788('0x89')][_0x0788('0x42')](',');var _0x4455dc={};_0x4455dc[_0x4785ac[0x0]]={'$gte':moment(_0x4785ac[0x1])['format'](_0x0788('0x117'))};_0x1ba9fb['where']=_[_0x0788('0x3b')](_0x1ba9fb[_0x0788('0x56')],_0x4455dc);}_0x1ba9fb=_[_0x0788('0x3b')]({},_0x1ba9fb,_0x20f429[_0x0788('0xc8')]);return db[_0x0788('0xd9')][_0x0788('0x32')]({'where':_0x1ba9fb[_0x0788('0x56')]})['then'](function(_0x3eb474){_0x4f36bd[_0x0788('0x32')]=_0x3eb474;if(_0x20f429['query'][_0x0788('0x118')]){_0x1ba9fb[_0x0788('0xc7')]=[{'all':!![]}];}return db[_0x0788('0xd9')]['findAll'](_0x1ba9fb);})['then'](function(_0x1aa86f){_0x4f36bd[_0x0788('0xc4')]=_0x1aa86f;return _0x4f36bd;});}})['then'](respondWithFilteredResult(_0x364f26,_0x1ba9fb))['catch'](handleError(_0x364f26,null));};exports[_0x0788('0x119')]=function(_0x4d6a60,_0x114658,_0x4b11b9){var _0x9af662={'where':{}},_0x257e1c={},_0x35a6bc={'count':0x0,'rows':[]};return db[_0x0788('0x47')]['findOne']({'where':{'id':_0x4d6a60['params']['id']}})[_0x0788('0x23')](handleEntityNotFound(_0x114658,null))[_0x0788('0x23')](function(_0x278a6f){if(_0x278a6f){_0x257e1c[_0x0788('0x4f')]=_['keys'](db[_0x0788('0xd9')][_0x0788('0x48')]);_0x257e1c[_0x0788('0x4c')]=_[_0x0788('0x4b')](_0x4d6a60['query']);_0x257e1c[_0x0788('0x4d')]=_[_0x0788('0x4e')](_0x257e1c['model'],_0x257e1c[_0x0788('0x4c')]);_0x9af662[_0x0788('0x50')]=_[_0x0788('0x4e')](_0x257e1c[_0x0788('0x4f')],qs[_0x0788('0x51')](_0x4d6a60[_0x0788('0x4c')]['fields']));_0x9af662[_0x0788('0x50')]=_0x9af662[_0x0788('0x50')][_0x0788('0x52')]?_0x9af662[_0x0788('0x50')]:_0x257e1c['model'];if(!_0x4d6a60[_0x0788('0x4c')]['hasOwnProperty'](_0x0788('0x115'))){_0x9af662['limit']=qs['limit'](_0x4d6a60[_0x0788('0x4c')][_0x0788('0x30')]);_0x9af662[_0x0788('0x33')]=qs[_0x0788('0x33')](_0x4d6a60[_0x0788('0x4c')][_0x0788('0x33')]);}_0x9af662[_0x0788('0x54')]=qs[_0x0788('0x55')](_0x4d6a60[_0x0788('0x4c')][_0x0788('0x55')]);_0x9af662['where']=qs['filters'](_['pick'](_0x4d6a60[_0x0788('0x4c')],_0x257e1c[_0x0788('0x4d')]));_0x9af662[_0x0788('0x56')][_0x0788('0xc2')]=_0x278a6f['id'];if(_0x4d6a60[_0x0788('0x4c')][_0x0788('0x93')]){_0x9af662[_0x0788('0x56')]=_[_0x0788('0x3b')](_0x9af662['where'],{'$or':_[_0x0788('0x46')](_0x9af662[_0x0788('0x50')],function(_0x4a4297){var _0x1fb846={};_0x1fb846[_0x4a4297]={'$like':'%'+_0x4d6a60[_0x0788('0x4c')][_0x0788('0x93')]+'%'};return _0x1fb846;})});}_0x9af662['where'][_0x0788('0x11a')]=![];if(_0x4d6a60[_0x0788('0x4c')]['id']){_0x9af662[_0x0788('0x56')]['id']={'$gt':_0x4d6a60[_0x0788('0x4c')]['id']};}_0x9af662=_[_0x0788('0x3b')]({},_0x9af662,_0x4d6a60[_0x0788('0xc8')]);return db[_0x0788('0xd9')][_0x0788('0x32')]({'where':_0x9af662[_0x0788('0x56')]})[_0x0788('0x23')](function(_0x292d07){_0x35a6bc[_0x0788('0x32')]=_0x292d07;_0x9af662[_0x0788('0xc7')]=[];if(_0x4d6a60[_0x0788('0x4c')][_0x0788('0x11b')]){_0x9af662['include'][_0x0788('0x44')]({'model':db[_0x0788('0x7f')],'as':_0x0788('0x7f'),'attributes':['id','fullname',_0x0788('0x101')]});}if(_0x4d6a60[_0x0788('0x4c')][_0x0788('0x118')]){_0x9af662['include']=[{'all':!![]}];}return db[_0x0788('0xd9')][_0x0788('0x11c')](_0x9af662);})['then'](function(_0xa44dc3){_0x35a6bc[_0x0788('0xc4')]=_0xa44dc3;return _0x35a6bc;});}})[_0x0788('0x23')](respondWithFilteredResult(_0x114658,_0x9af662))['catch'](handleError(_0x114658,null));};exports[_0x0788('0x11d')]=function(_0x5b0417,_0x4d5e94,_0x1fb141){return db[_0x0788('0x47')][_0x0788('0x6f')]({'where':{'id':_0x5b0417[_0x0788('0xc6')]['id']}})['then'](handleEntityNotFound(_0x4d5e94,null))[_0x0788('0x23')](function(_0x5bf415){if(_0x5bf415){return _0x5bf415['setTags'](_0x5b0417['body'][_0x0788('0x113')],_['omit'](_0x5b0417['body'],['ids','id'])||{})[_0x0788('0x11e')](function(){return db[_0x0788('0x7c')][_0x0788('0x11c')]({'attributes':['id',_0x0788('0x39'),_0x0788('0x59')],'where':{'id':_0x5b0417[_0x0788('0x83')][_0x0788('0x113')]}});})[_0x0788('0x23')](function(_0x109d90){socket[_0x0788('0x11f')](_0x0788('0x120'),{'id':Number(_0x5b0417[_0x0788('0xc6')]['id']),'tags':_0x109d90||[]});return{'id':Number(_0x5b0417[_0x0788('0xc6')]['id']),'tags':_0x109d90||[]};});}})['then'](respondWithResult(_0x4d5e94,null))[_0x0788('0x2b')](handleError(_0x4d5e94,null));};exports['removeTags']=function(_0x26343c,_0x30334c,_0x1d18bc){return db[_0x0788('0x47')][_0x0788('0x6f')]({'where':{'id':_0x26343c[_0x0788('0xc6')]['id']}})['then'](handleEntityNotFound(_0x30334c,null))[_0x0788('0x23')](function(_0x10266b){if(_0x10266b){return _0x10266b[_0x0788('0x121')](_0x26343c[_0x0788('0x4c')][_0x0788('0x113')]);}})[_0x0788('0x23')](respondWithStatusCode(_0x30334c,null))['catch'](handleError(_0x30334c,null));};exports['download']=function(_0x1fb76f,_0x17ca71){var _0xbae24f=moment()[_0x0788('0x122')]()[_0x0788('0xa9')]();var _0x525754=path['join'](config['root'],_0x0788('0x123'),_0x0788('0x124'),_0x0788('0x125'));var _0x2d51ef=path[_0x0788('0xf1')](config[_0x0788('0xf2')],_0x0788('0x123'),_0x0788('0x124'),_0x0788('0x126'));var _0x5ecd59=path['join'](_0x525754,_0xbae24f);var _0xf63471=util[_0x0788('0xfe')](_0x0788('0x127'),_0x1fb76f[_0x0788('0xc6')]['id'],_0xbae24f);var _0x390cdf=path[_0x0788('0xf1')](_0x525754,_0xf63471);var _0x40a75d=[];_0x40a75d[_0x0788('0x44')]({'model':db[_0x0788('0x7f')],'as':_0x0788('0x7f'),'attributes':['id',_0x0788('0x3f')],'raw':!![]});_0x40a75d[_0x0788('0x44')]({'model':db[_0x0788('0xdd')],'as':'Contact','attributes':['id',_0x0788('0x128'),_0x0788('0x129')],'raw':!![]});if(_0x1fb76f[_0x0788('0x4c')][_0x0788('0x126')]){_0x40a75d[_0x0788('0x44')]({'model':db[_0x0788('0xec')],'as':_0x0788('0xec'),'raw':!![]});}var _0x4cf323=[{'model':db[_0x0788('0xd9')],'as':_0x0788('0xfa'),'attributes':['id','body',_0x0788('0x87'),'direction',_0x0788('0x11a'),_0x0788('0x8f')],'include':_0x40a75d}];_0x4cf323['push']({'model':db[_0x0788('0xcd')],'as':'Account','attributes':['id',_0x0788('0x39')]});_0x4cf323[_0x0788('0x44')]({'model':db[_0x0788('0x7f')],'as':_0x0788('0x12a'),'attributes':['id',_0x0788('0x3f')]});return db['ChatInteraction'][_0x0788('0x6f')]({'where':{'id':_0x1fb76f['params']['id']},'include':_0x4cf323})['then'](handleEntityNotFound(_0x17ca71,null))[_0x0788('0x23')](function(_0x1fa39f){if(_0x1fa39f){var _0x19b030=_0x1fa39f[_0x0788('0x12b')]({'plain':!![]});fs[_0x0788('0x12c')](_0x5ecd59);var _0x35fc5b={'channel':'Chat','account':_0x19b030[_0x0788('0x12d')]['name'],'agent':_0x19b030[_0x0788('0x12a')]?_0x19b030[_0x0788('0x12a')][_0x0788('0x3f')]:'N.A.','createdAt':moment(_0x19b030['createdAt'])[_0x0788('0xfe')](_0x0788('0x117'))['toString'](),'closedAt':_0x19b030[_0x0788('0xe3')]?moment(_0x19b030[_0x0788('0x12e')])[_0x0788('0xfe')](_0x0788('0x117'))[_0x0788('0xa9')]():'','disposition':_0x19b030[_0x0788('0xe4')],'chatInfo':{'browser':_0x19b030[_0x0788('0x12f')],'os':_0x19b030['osName'],'referer':_0x19b030['referer'],'customerIp':_0x19b030['customerIp'],'customerPort':_0x19b030[_0x0788('0x130')]?_0x19b030['customerPort']:_0x0788('0x131')},'messages':_(_0x19b030[_0x0788('0xfa')])[_0x0788('0x132')]()[_0x0788('0x93')]({'secret':![]})[_0x0788('0x46')](function(_0x3ff416){if(_0x3ff416[_0x0788('0xec')]){var _0x7d6cf9=path[_0x0788('0xf1')](_0x2d51ef,_0x3ff416[_0x0788('0xec')][_0x0788('0xe9')]);if(fs['existsSync'](_0x7d6cf9)){fs[_0x0788('0x133')](_0x7d6cf9)['pipe'](fs[_0x0788('0x134')](path[_0x0788('0xf1')](_0x5ecd59,_0x3ff416[_0x0788('0xec')][_0x0788('0xe9')])));}}return{'date':moment(_0x3ff416[_0x0788('0x87')])[_0x0788('0xfe')](_0x0788('0x117'))[_0x0788('0xa9')](),'sender':_0x3ff416[_0x0788('0x135')]===_0x0788('0xd8')?_0x3ff416['User']?_0x3ff416[_0x0788('0x7f')][_0x0788('0x3f')]:_0x0788('0x100'):_0x3ff416[_0x0788('0x75')]['firstName']+(_0x3ff416[_0x0788('0x75')][_0x0788('0x129')]?'\x20'+_0x3ff416['Contact'][_0x0788('0x129')]:''),'body':_0x3ff416['Attachment']?_0x3ff416[_0x0788('0xec')]['basename']:_0x3ff416[_0x0788('0x83')],'direction':_0x3ff416[_0x0788('0x135')]===_0x0788('0xd8')?'A':'C','secret':_0x3ff416['secret'],'read':_0x3ff416[_0x0788('0x8f')],'attachment':_0x3ff416['Attachment']};})[_0x0788('0x71')]()};return ejs[_0x0788('0x136')](path[_0x0788('0xf1')](config[_0x0788('0xf2')],'server','views',_0x0788('0x137')),{'interaction':_0x35fc5b})['then'](function(_0x45962d){var _0x4cc133=path[_0x0788('0xf1')](_0x5ecd59,_0x0788('0x138')+_0x19b030['id']+'-'+_0xbae24f+_0x0788('0x139'));var _0x52452f={'path':_0x4cc133,'channel':_0x0788('0x13a'),'interactionId':_0x19b030['id']};return pdf[_0x0788('0x13b')](_0x45962d,_0x52452f);})[_0x0788('0x23')](function(){return new BPromise(function(_0xe2d72d,_0x5401a8){zipdir(_0x5ecd59,{'saveTo':_0x390cdf},function(_0x5b289e,_0x4191b4){if(_0x5b289e)return _0x5401a8(_0x5b289e);return _0xe2d72d(_0x4191b4);});})[_0x0788('0x23')](function(){return new BPromise(function(_0x5440c6,_0x2dbb74){rimraf(_0x5ecd59,function(_0x8a89c0){if(_0x8a89c0)_0x2dbb74(_0x8a89c0);return _0x5440c6();});});})['then'](function(){return _0x17ca71['download'](_0x390cdf,_0xf63471,function(_0x2487db){if(_0x2487db){console['log'](_0x0788('0x13c'),_0x2487db);}else{fs[_0x0788('0x13d')](_0x390cdf);}});});});}else{return _0x17ca71[_0x0788('0x2c')](0xc8);}})['catch'](handleError(_0x17ca71,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 243fce2..ef342e0 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 _0xca31=['save','update','remove','getUsers','then','setDataValue','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','ChatMessage','setMaxListeners'];(function(_0x56f552,_0x374061){var _0x21a33a=function(_0x38a83d){while(--_0x38a83d){_0x56f552['push'](_0x56f552['shift']());}};_0x21a33a(++_0x374061);}(_0xca31,0xd5));var _0x1ca3=function(_0x129259,_0x3c39ec){_0x129259=_0x129259-0x0;var _0x110f34=_0xca31[_0x129259];return _0x110f34;};'use strict';var EventEmitter=require(_0x1ca3('0x0'));var ChatInteraction=require('../../mysqldb')['db']['ChatInteraction'];var ChatMessage=require('../../mysqldb')['db'][_0x1ca3('0x1')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x1ca3('0x2')](0x0);var events={'afterCreate':_0x1ca3('0x3'),'afterUpdate':_0x1ca3('0x4'),'afterDestroy':_0x1ca3('0x5')};function emitEvent(_0x75f7a3){return function(_0x341fae,_0x4e3bbc,_0x4df219){_0x341fae[_0x1ca3('0x6')]({'attributes':['id'],'raw':!![]})[_0x1ca3('0x7')](function(_0x4f131e){_0x341fae[_0x1ca3('0x8')]('Users',_0x4f131e[_0x1ca3('0x9')](function(_0x158da0){return{'id':_0x158da0['id']};}));return ChatMessage[_0x1ca3('0xa')]({'where':{'ChatInteractionId':_0x341fae['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1ca3('0x7')](function(_0x39469b){_0x341fae[_0x1ca3('0x8')](_0x1ca3('0xb'),_0x39469b[_0x1ca3('0xc')]);ChatInteractionEvents[_0x1ca3('0xd')](_0x75f7a3+':'+_0x341fae['id'],_0x341fae);ChatInteractionEvents[_0x1ca3('0xd')](_0x75f7a3,_0x341fae);_0x4df219(null);})[_0x1ca3('0xe')](_0x4df219(null));};}for(var e in events){if(events[_0x1ca3('0xf')](e)){var event=events[e];ChatInteraction[_0x1ca3('0x10')](e,emitEvent(event));}}module[_0x1ca3('0x11')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x8339=['map','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','update','remove','then','setDataValue','Users'];(function(_0x16d3a4,_0xfcd64b){var _0xbd7a0c=function(_0xa0c4f7){while(--_0xa0c4f7){_0x16d3a4['push'](_0x16d3a4['shift']());}};_0xbd7a0c(++_0xfcd64b);}(_0x8339,0x1e3));var _0x9833=function(_0x22b368,_0xb71c40){_0x22b368=_0x22b368-0x0;var _0x161d41=_0x8339[_0x22b368];return _0x161d41;};'use strict';var EventEmitter=require(_0x9833('0x0'));var ChatInteraction=require(_0x9833('0x1'))['db'][_0x9833('0x2')];var ChatMessage=require(_0x9833('0x1'))['db'][_0x9833('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x9833('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9833('0x5'),'afterDestroy':_0x9833('0x6')};function emitEvent(_0x533619){return function(_0x30f75e,_0x3e3c36,_0x43449c){_0x30f75e['getUsers']({'attributes':['id'],'raw':!![]})[_0x9833('0x7')](function(_0x3bcd01){_0x30f75e[_0x9833('0x8')](_0x9833('0x9'),_0x3bcd01[_0x9833('0xa')](function(_0x287040){return{'id':_0x287040['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x30f75e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9833('0x7')](function(_0x895df1){_0x30f75e[_0x9833('0x8')](_0x9833('0xb'),_0x895df1[_0x9833('0xc')]);ChatInteractionEvents[_0x9833('0xd')](_0x533619+':'+_0x30f75e['id'],_0x30f75e);ChatInteractionEvents['emit'](_0x533619,_0x30f75e);_0x43449c(null);})[_0x9833('0xe')](_0x43449c(null));};}for(var e in events){if(events[_0x9833('0xf')](e)){var event=events[e];ChatInteraction[_0x9833('0x10')](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 ac984a7..cc18c10 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 _0xec4f=['closedAt','format','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','closed'];(function(_0x1962a7,_0x14784d){var _0x2a7571=function(_0x278c1d){while(--_0x278c1d){_0x1962a7['push'](_0x1962a7['shift']());}};_0x2a7571(++_0x14784d);}(_0xec4f,0x1cc));var _0xfec4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xec4f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfec4('0x0'));var util=require(_0xfec4('0x1'));var logger=require(_0xfec4('0x2'))('api');var moment=require(_0xfec4('0x3'));var BPromise=require(_0xfec4('0x4'));var rp=require(_0xfec4('0x5'));var fs=require('fs');var path=require(_0xfec4('0x6'));var rimraf=require(_0xfec4('0x7'));var config=require(_0xfec4('0x8'));var attributes=require(_0xfec4('0x9'));module[_0xfec4('0xa')]=function(_0xc2a126,_0x256c15){return _0xc2a126[_0xfec4('0xb')](_0xfec4('0xc'),attributes,{'tableName':_0xfec4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5fea63,_0x404b37,_0x162402){if(_0x5fea63['changed'](_0xfec4('0xe'))){_0x5fea63[_0xfec4('0xf')]=moment()[_0xfec4('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x162402(null,_0x5fea63);}},'charset':_0xfec4('0x11'),'collate':_0xfec4('0x12')});};
\ No newline at end of file
+var _0xc50c=['../../config/environment','exports','define','ChatInteraction','chat_interactions','closed','closedAt','format','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x4ba508,_0x5244a5){var _0x45db96=function(_0x3a50b9){while(--_0x3a50b9){_0x4ba508['push'](_0x4ba508['shift']());}};_0x45db96(++_0x5244a5);}(_0xc50c,0x70));var _0xcc50=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0xc50c[_0x1589dd];return _0x1bddd1;};'use strict';var _=require(_0xcc50('0x0'));var util=require(_0xcc50('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xcc50('0x2'));var BPromise=require(_0xcc50('0x3'));var rp=require(_0xcc50('0x4'));var fs=require('fs');var path=require(_0xcc50('0x5'));var rimraf=require(_0xcc50('0x6'));var config=require(_0xcc50('0x7'));var attributes=require('./chatInteraction.attributes');module[_0xcc50('0x8')]=function(_0x1d4afd,_0x426bbb){return _0x1d4afd[_0xcc50('0x9')](_0xcc50('0xa'),attributes,{'tableName':_0xcc50('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1dc72b,_0x181310,_0x1f853e){if(_0x1dc72b['changed'](_0xcc50('0xc'))){_0x1dc72b[_0xcc50('0xd')]=moment()[_0xcc50('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1f853e(null,_0x1dc72b);}},'charset':_0xcc50('0xf'),'collate':_0xcc50('0x10')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 8570ef2..71c8724 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 _0xc8f8=['find','then','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','socket.io-emitter','redis','register','request','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','AddTagsToChatInteraction'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0xc8f8,0xcf));var _0x8c8f=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0xc8f8[_0x500419];return _0x241c1a;};'use strict';var _=require(_0x8c8f('0x0'));var util=require('util');var moment=require(_0x8c8f('0x1'));var BPromise=require(_0x8c8f('0x2'));var rs=require(_0x8c8f('0x3'));var fs=require('fs');var Redis=require(_0x8c8f('0x4'));var db=require(_0x8c8f('0x5'))['db'];var utils=require(_0x8c8f('0x6'));var logger=require(_0x8c8f('0x7'))(_0x8c8f('0x8'));var config=require(_0x8c8f('0x9'));var jayson=require(_0x8c8f('0xa'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x8c8f('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8c8f('0xc'))(new Redis(config[_0x8c8f('0xd')]));require('./chatInteraction.socket')[_0x8c8f('0xe')](socket);function respondWithRpcPromise(_0x36e20a,_0x4c35e4,_0x1b1391){return new BPromise(function(_0x20eca8,_0x279527){return client[_0x8c8f('0xf')](_0x36e20a,_0x1b1391)['then'](function(_0xbf8cad){logger[_0x8c8f('0x10')](_0x8c8f('0x11'),_0x4c35e4,'request\x20sent');logger[_0x8c8f('0x12')](_0x8c8f('0x13'),_0x4c35e4,'request\x20sent',JSON[_0x8c8f('0x14')](_0xbf8cad));if(_0xbf8cad['error']){if(_0xbf8cad[_0x8c8f('0x15')]['code']===0x1f4){logger['error'](_0x8c8f('0x11'),_0x4c35e4,_0xbf8cad['error'][_0x8c8f('0x16')]);return _0x279527(_0xbf8cad['error'][_0x8c8f('0x16')]);}logger[_0x8c8f('0x15')](_0x8c8f('0x11'),_0x4c35e4,_0xbf8cad[_0x8c8f('0x15')][_0x8c8f('0x16')]);return _0x20eca8(_0xbf8cad[_0x8c8f('0x15')][_0x8c8f('0x16')]);}else{logger['info'](_0x8c8f('0x11'),_0x4c35e4,_0x8c8f('0x17'));_0x20eca8(_0xbf8cad['result'][_0x8c8f('0x16')]);}})[_0x8c8f('0x18')](function(_0x2903fc){logger[_0x8c8f('0x15')](_0x8c8f('0x11'),_0x4c35e4,_0x2903fc);_0x279527(_0x2903fc);});});}exports[_0x8c8f('0x19')]=function(_0x2f09fd){var _0x131d06=this;return new Promise(function(_0x6afd41,_0x36bb19){return db[_0x8c8f('0x1a')][_0x8c8f('0x1b')](_0x2f09fd[_0x8c8f('0x1c')],{'raw':_0x2f09fd[_0x8c8f('0x1d')]?_0x2f09fd['options'][_0x8c8f('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f09fd[_0x8c8f('0x1d')]?_0x2f09fd[_0x8c8f('0x1d')][_0x8c8f('0x1f')]||null:null,'attributes':_0x2f09fd[_0x8c8f('0x1d')]?_0x2f09fd[_0x8c8f('0x1d')]['attributes']||null:null,'limit':_0x2f09fd[_0x8c8f('0x1d')]?_0x2f09fd['options']['limit']||null:null})['then'](function(_0x274e25){logger[_0x8c8f('0x10')](_0x8c8f('0x19'),_0x2f09fd);logger[_0x8c8f('0x12')]('UpdateChatInteraction',_0x2f09fd,JSON[_0x8c8f('0x14')](_0x274e25));_0x6afd41(_0x274e25);})[_0x8c8f('0x18')](function(_0x2270f9){logger[_0x8c8f('0x15')](_0x8c8f('0x19'),_0x2270f9['message'],_0x2f09fd);_0x36bb19(_0x131d06[_0x8c8f('0x15')](0x1f4,_0x2270f9['message']));});});};exports[_0x8c8f('0x20')]=function(_0x41e386){return new Promise(function(_0xc5bed1,_0x321144){return db[_0x8c8f('0x1a')][_0x8c8f('0x21')]({'where':_0x41e386[_0x8c8f('0x1d')]?_0x41e386[_0x8c8f('0x1d')][_0x8c8f('0x1f')]||null:null})[_0x8c8f('0x22')](function(_0x1f8cd8){if(_0x1f8cd8){return _0x1f8cd8[_0x8c8f('0x23')](_0x41e386[_0x8c8f('0x1c')][_0x8c8f('0x24')],_[_0x8c8f('0x25')](_0x41e386[_0x8c8f('0x1c')],[_0x8c8f('0x24'),'id'])||{});}})[_0x8c8f('0x26')](function(_0x2f825b){logger[_0x8c8f('0x10')](_0x8c8f('0x27'),_0x41e386);logger[_0x8c8f('0x12')](_0x8c8f('0x27'),_0x41e386,JSON[_0x8c8f('0x14')](_0x2f825b));_0xc5bed1(_0x2f825b);})['catch'](function(_0x2c8630){logger[_0x8c8f('0x15')](_0x8c8f('0x27'),_0x2c8630[_0x8c8f('0x16')],_0x41e386);_0x321144(_this[_0x8c8f('0x15')](0x1f4,_0x2c8630[_0x8c8f('0x16')]));});});};
\ No newline at end of file
+var _0x2b8f=['UpdateChatInteraction','ChatInteraction','update','body','options','where','limit','AddTagsToChatInteraction','ids','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','jayson/promise','client','http','redis','localhost','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x1e235e,_0x994b77){var _0x1e8e94=function(_0x4a9e2c){while(--_0x4a9e2c){_0x1e235e['push'](_0x1e235e['shift']());}};_0x1e8e94(++_0x994b77);}(_0x2b8f,0x1bb));var _0xf2b8=function(_0x2d8fb9,_0x519390){_0x2d8fb9=_0x2d8fb9-0x0;var _0x42475e=_0x2b8f[_0x2d8fb9];return _0x42475e;};'use strict';var _=require(_0xf2b8('0x0'));var util=require(_0xf2b8('0x1'));var moment=require(_0xf2b8('0x2'));var BPromise=require('bluebird');var rs=require(_0xf2b8('0x3'));var fs=require('fs');var Redis=require(_0xf2b8('0x4'));var db=require(_0xf2b8('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xf2b8('0x6'));var client=jayson[_0xf2b8('0x7')][_0xf2b8('0x8')]({'port':0x232a});config[_0xf2b8('0x9')]=_['defaults'](config[_0xf2b8('0x9')],{'host':_0xf2b8('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf2b8('0x9')]));require(_0xf2b8('0xb'))[_0xf2b8('0xc')](socket);function respondWithRpcPromise(_0x2e3772,_0x5d6556,_0x805ee){return new BPromise(function(_0x847219,_0x4b19a1){return client['request'](_0x2e3772,_0x805ee)[_0xf2b8('0xd')](function(_0x418d81){logger[_0xf2b8('0xe')](_0xf2b8('0xf'),_0x5d6556,_0xf2b8('0x10'));logger[_0xf2b8('0x11')](_0xf2b8('0x12'),_0x5d6556,_0xf2b8('0x10'),JSON[_0xf2b8('0x13')](_0x418d81));if(_0x418d81['error']){if(_0x418d81[_0xf2b8('0x14')][_0xf2b8('0x15')]===0x1f4){logger['error'](_0xf2b8('0xf'),_0x5d6556,_0x418d81[_0xf2b8('0x14')]['message']);return _0x4b19a1(_0x418d81['error'][_0xf2b8('0x16')]);}logger[_0xf2b8('0x14')](_0xf2b8('0xf'),_0x5d6556,_0x418d81['error'][_0xf2b8('0x16')]);return _0x847219(_0x418d81['error'][_0xf2b8('0x16')]);}else{logger[_0xf2b8('0xe')](_0xf2b8('0xf'),_0x5d6556,_0xf2b8('0x10'));_0x847219(_0x418d81[_0xf2b8('0x17')]['message']);}})[_0xf2b8('0x18')](function(_0x325699){logger[_0xf2b8('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x5d6556,_0x325699);_0x4b19a1(_0x325699);});});}exports[_0xf2b8('0x19')]=function(_0x3fb404){var _0x175c59=this;return new Promise(function(_0x229a87,_0x3f0b05){return db[_0xf2b8('0x1a')][_0xf2b8('0x1b')](_0x3fb404[_0xf2b8('0x1c')],{'raw':_0x3fb404[_0xf2b8('0x1d')]?_0x3fb404[_0xf2b8('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3fb404['options']?_0x3fb404[_0xf2b8('0x1d')][_0xf2b8('0x1e')]||null:null,'attributes':_0x3fb404[_0xf2b8('0x1d')]?_0x3fb404['options']['attributes']||null:null,'limit':_0x3fb404[_0xf2b8('0x1d')]?_0x3fb404[_0xf2b8('0x1d')][_0xf2b8('0x1f')]||null:null})['then'](function(_0x3ef13a){logger[_0xf2b8('0xe')](_0xf2b8('0x19'),_0x3fb404);logger[_0xf2b8('0x11')](_0xf2b8('0x19'),_0x3fb404,JSON[_0xf2b8('0x13')](_0x3ef13a));_0x229a87(_0x3ef13a);})['catch'](function(_0xa5b4dd){logger[_0xf2b8('0x14')](_0xf2b8('0x19'),_0xa5b4dd[_0xf2b8('0x16')],_0x3fb404);_0x3f0b05(_0x175c59[_0xf2b8('0x14')](0x1f4,_0xa5b4dd[_0xf2b8('0x16')]));});});};exports[_0xf2b8('0x20')]=function(_0x1fc478){return new Promise(function(_0x552d2b,_0x2b32ae){return db[_0xf2b8('0x1a')]['find']({'where':_0x1fc478['options']?_0x1fc478[_0xf2b8('0x1d')][_0xf2b8('0x1e')]||null:null})[_0xf2b8('0xd')](function(_0x18579f){if(_0x18579f){return _0x18579f['addTags'](_0x1fc478[_0xf2b8('0x1c')][_0xf2b8('0x21')],_['omit'](_0x1fc478['body'],['ids','id'])||{});}})[_0xf2b8('0x22')](function(_0x3ad876){logger[_0xf2b8('0xe')]('AddTags',_0x1fc478);logger['debug'](_0xf2b8('0x23'),_0x1fc478,JSON[_0xf2b8('0x13')](_0x3ad876));_0x552d2b(_0x3ad876);})[_0xf2b8('0x18')](function(_0x2505d6){logger[_0xf2b8('0x14')](_0xf2b8('0x23'),_0x2505d6['message'],_0x1fc478);_0x2b32ae(_this[_0xf2b8('0x14')](0x1f4,_0x2505d6[_0xf2b8('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 41b253a..acd83f4 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 _0x9daa=['remove','update','emit','removeListener','register','chatInteraction:','./chatInteraction.events','save'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x9daa,0x146));var _0xa9da=function(_0x28430d,_0x45523a){_0x28430d=_0x28430d-0x0;var _0x5cae1b=_0x9daa[_0x28430d];return _0x5cae1b;};'use strict';var ChatInteractionEvents=require(_0xa9da('0x0'));var events=[_0xa9da('0x1'),_0xa9da('0x2'),_0xa9da('0x3')];function createListener(_0x54105a,_0xa817d9){return function(_0x112851){_0xa817d9[_0xa9da('0x4')](_0x54105a,_0x112851);};}function removeListener(_0xee9072,_0x347ed7){return function(){ChatInteractionEvents[_0xa9da('0x5')](_0xee9072,_0x347ed7);};}exports[_0xa9da('0x6')]=function(_0x56a8fc){for(var _0x4dbf12=0x0,_0x4ef8e6=events['length'];_0x4dbf12<_0x4ef8e6;_0x4dbf12++){var _0x2840df=events[_0x4dbf12];var _0x5e588c=createListener(_0xa9da('0x7')+_0x2840df,_0x56a8fc);ChatInteractionEvents['on'](_0x2840df,_0x5e588c);}};
\ No newline at end of file
+var _0x1ef3=['chatInteraction:','./chatInteraction.events','save','update','emit','removeListener','register','length'];(function(_0x5a53a0,_0x11f000){var _0x51779d=function(_0x28d19a){while(--_0x28d19a){_0x5a53a0['push'](_0x5a53a0['shift']());}};_0x51779d(++_0x11f000);}(_0x1ef3,0x69));var _0x31ef=function(_0x460bd6,_0x43f145){_0x460bd6=_0x460bd6-0x0;var _0x564c38=_0x1ef3[_0x460bd6];return _0x564c38;};'use strict';var ChatInteractionEvents=require(_0x31ef('0x0'));var events=[_0x31ef('0x1'),'remove',_0x31ef('0x2')];function createListener(_0x24447b,_0x30dbd7){return function(_0x4df75f){_0x30dbd7[_0x31ef('0x3')](_0x24447b,_0x4df75f);};}function removeListener(_0x58388a,_0x49ce87){return function(){ChatInteractionEvents[_0x31ef('0x4')](_0x58388a,_0x49ce87);};}exports[_0x31ef('0x5')]=function(_0x81db4){for(var _0x454b60=0x0,_0x185f8c=events[_0x31ef('0x6')];_0x454b60<_0x185f8c;_0x454b60++){var _0x554347=events[_0x454b60];var _0xf94594=createListener(_0x31ef('0x7')+_0x554347,_0x81db4);ChatInteractionEvents['on'](_0x554347,_0xf94594);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index bae2273..9506dd4 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 _0x0fbc=['post','single','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','/:id/custom_update','/:id/close','close','delete','destroy','removeTags','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','isAuthenticated','createVidaooSession','diskStorage','join','server/files/attachments/','format','now'];(function(_0x37835e,_0x3c2095){var _0x46e6f2=function(_0x3956ea){while(--_0x3956ea){_0x37835e['push'](_0x37835e['shift']());}};_0x46e6f2(++_0x3c2095);}(_0x0fbc,0x99));var _0xc0fb=function(_0x350360,_0x36b354){_0x350360=_0x350360-0x0;var _0x4f755c=_0x0fbc[_0x350360];return _0x4f755c;};'use strict';var multer=require(_0xc0fb('0x0'));var util=require(_0xc0fb('0x1'));var path=require('path');var timeout=require(_0xc0fb('0x2'));var express=require(_0xc0fb('0x3'));var router=express[_0xc0fb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc0fb('0x5'));var interaction=require(_0xc0fb('0x6'));var config=require('../../config/environment');var controller=require(_0xc0fb('0x7'));router[_0xc0fb('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc0fb('0x8')](_0xc0fb('0x9'),auth['isAuthenticated'](),controller[_0xc0fb('0xa')]);router['get'](_0xc0fb('0xb'),auth[_0xc0fb('0xc')](),controller[_0xc0fb('0xd')]);router[_0xc0fb('0x8')](_0xc0fb('0xe'),auth[_0xc0fb('0xc')](),controller[_0xc0fb('0xf')]);router[_0xc0fb('0x8')](_0xc0fb('0x10'),auth['isAuthenticated'](),controller[_0xc0fb('0x11')]);router[_0xc0fb('0x8')](_0xc0fb('0x12'),auth[_0xc0fb('0xc')](),controller[_0xc0fb('0x13')]);router['get']('/:id/download',auth[_0xc0fb('0x14')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/vidaoo',auth['isAuthenticated'](),controller[_0xc0fb('0x15')]);var upload=multer({'storage':multer[_0xc0fb('0x16')]({'destination':function(_0x4143fb,_0x236e5d,_0x71a10a){_0x71a10a(null,path[_0xc0fb('0x17')](config['root'],_0xc0fb('0x18')));},'filename':function(_0x10cc2a,_0x37fc76,_0x12b20a){_0x12b20a(null,util[_0xc0fb('0x19')]('%s-%s',Date[_0xc0fb('0x1a')](),_0x37fc76['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xc0fb('0x1b')]('/:id/attachment_upload',upload[_0xc0fb('0x1c')]('file'),controller[_0xc0fb('0x1d')]);router[_0xc0fb('0x1b')](_0xc0fb('0x10'),auth[_0xc0fb('0xc')](),controller[_0xc0fb('0x1e')]);router[_0xc0fb('0x1b')](_0xc0fb('0x1f'),auth[_0xc0fb('0x14')](),interaction[_0xc0fb('0x20')](_0xc0fb('0x21'),_0xc0fb('0x22')),controller[_0xc0fb('0x23')]);router[_0xc0fb('0x24')](_0xc0fb('0xb'),auth[_0xc0fb('0x14')](),interaction['tracked'](_0xc0fb('0x21'),_0xc0fb('0x25')),controller[_0xc0fb('0x26')]);router[_0xc0fb('0x24')](_0xc0fb('0x27'),controller['customUpdate']);router['put']('/:id/abandon',auth[_0xc0fb('0xc')](),controller['abandon']);router['put'](_0xc0fb('0x28'),controller[_0xc0fb('0x29')]);router[_0xc0fb('0x2a')](_0xc0fb('0xb'),auth[_0xc0fb('0x14')](),interaction[_0xc0fb('0x20')](_0xc0fb('0x21'),'chatinteraction:destroy'),controller[_0xc0fb('0x2b')]);router['delete'](_0xc0fb('0x1f'),auth[_0xc0fb('0x14')](),controller[_0xc0fb('0x2c')]);module['exports']=router;
\ No newline at end of file
+var _0xe782=['diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','put','chatinteraction:update','update','/:id/custom_update','customUpdate','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','describe','/:id','isChatInteractionAuthorized','show','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe782,0x15a));var _0x2e78=function(_0x2e0bac,_0x56796d){_0x2e0bac=_0x2e0bac-0x0;var _0x14c25f=_0xe782[_0x2e0bac];return _0x14c25f;};'use strict';var multer=require(_0x2e78('0x0'));var util=require(_0x2e78('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2e78('0x2'));var router=express[_0x2e78('0x3')]();var fs_extra=require(_0x2e78('0x4'));var auth=require(_0x2e78('0x5'));var interaction=require(_0x2e78('0x6'));var config=require('../../config/environment');var controller=require(_0x2e78('0x7'));router[_0x2e78('0x8')]('/',auth[_0x2e78('0x9')](),controller['index']);router['get']('/describe',auth[_0x2e78('0x9')](),controller[_0x2e78('0xa')]);router[_0x2e78('0x8')](_0x2e78('0xb'),auth[_0x2e78('0xc')](),controller[_0x2e78('0xd')]);router[_0x2e78('0x8')]('/:id/attachment_download',auth[_0x2e78('0xc')](),controller[_0x2e78('0xe')]);router[_0x2e78('0x8')](_0x2e78('0xf'),auth[_0x2e78('0x9')](),controller[_0x2e78('0x10')]);router['get'](_0x2e78('0x11'),auth['isChatInteractionAuthorized'](),controller[_0x2e78('0x12')]);router[_0x2e78('0x8')](_0x2e78('0x13'),auth[_0x2e78('0x9')](),controller[_0x2e78('0x14')]);router[_0x2e78('0x15')]('/',auth['isAuthenticated'](),controller[_0x2e78('0x16')]);router[_0x2e78('0x15')](_0x2e78('0x17'),auth[_0x2e78('0x9')](),controller[_0x2e78('0x18')]);var upload=multer({'storage':multer[_0x2e78('0x19')]({'destination':function(_0x22fd55,_0x642d3b,_0x5e83b4){_0x5e83b4(null,path[_0x2e78('0x1a')](config[_0x2e78('0x1b')],_0x2e78('0x1c')));},'filename':function(_0x2c9624,_0x1aaba3,_0x47fab4){_0x47fab4(null,util[_0x2e78('0x1d')](_0x2e78('0x1e'),Date[_0x2e78('0x1f')](),_0x1aaba3[_0x2e78('0x20')][_0x2e78('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x2e78('0x22'),upload['single'](_0x2e78('0x23')),controller[_0x2e78('0x24')]);router[_0x2e78('0x15')](_0x2e78('0xf'),auth[_0x2e78('0xc')](),controller[_0x2e78('0x25')]);router['post'](_0x2e78('0x26'),auth[_0x2e78('0x9')](),interaction[_0x2e78('0x27')](_0x2e78('0x28'),'chatinteraction:addtags'),controller['addTags']);router[_0x2e78('0x29')]('/:id',auth['isAuthenticated'](),interaction[_0x2e78('0x27')](_0x2e78('0x28'),_0x2e78('0x2a')),controller[_0x2e78('0x2b')]);router[_0x2e78('0x29')](_0x2e78('0x2c'),controller[_0x2e78('0x2d')]);router[_0x2e78('0x29')]('/:id/abandon',auth[_0x2e78('0xc')](),controller[_0x2e78('0x2e')]);router[_0x2e78('0x29')](_0x2e78('0x2f'),controller[_0x2e78('0x30')]);router[_0x2e78('0x31')]('/:id',auth[_0x2e78('0x9')](),interaction[_0x2e78('0x27')](_0x2e78('0x28'),_0x2e78('0x32')),controller[_0x2e78('0x33')]);router[_0x2e78('0x31')]('/:id/tags',auth[_0x2e78('0x9')](),controller['removeTags']);module[_0x2e78('0x34')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 4086d50..841d8f3 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 _0xbf04=['exports','TEXT','sequelize'];(function(_0x3eee56,_0x176daf){var _0x506bcd=function(_0x3cfe8b){while(--_0x3cfe8b){_0x3eee56['push'](_0x3eee56['shift']());}};_0x506bcd(++_0x176daf);}(_0xbf04,0x158));var _0x4bf0=function(_0xde1348,_0x5205b6){_0xde1348=_0xde1348-0x0;var _0x32c5e0=_0xbf04[_0xde1348];return _0x32c5e0;};'use strict';var Sequelize=require(_0x4bf0('0x0'));module[_0x4bf0('0x1')]={'body':{'type':Sequelize[_0x4bf0('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xc666=['medium','BOOLEAN','INTEGER','exports'];(function(_0x38c0b2,_0x6a67a5){var _0x283c00=function(_0x259f03){while(--_0x259f03){_0x38c0b2['push'](_0x38c0b2['shift']());}};_0x283c00(++_0x6a67a5);}(_0xc666,0x1bb));var _0x6c66=function(_0x4e5592,_0x2a483e){_0x4e5592=_0x4e5592-0x0;var _0x2b8962=_0xc666[_0x4e5592];return _0x2b8962;};'use strict';var Sequelize=require('sequelize');module[_0x6c66('0x0')]={'body':{'type':Sequelize['TEXT'](_0x6c66('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x6c66('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x6c66('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 9b5210b..dcf7846 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 _0x76ce=['push','createdAt','ToId','read','-createdAt','all','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','map','ChatInternalMessage','fieldName','type','model','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','options','catch','show','fields','includeAll','include','merge','create','body','find','params','describe','messages','lastMessageAt','lastMessage','format','getUsers','User','findAll','agent','admin','user','role','userpic','internal','lastLoginAt','allowmessenger','VoiceQueue','VoiceQueues','get','UserProfileSection','autoAssociation','isEmpty','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x76ce,0x6d));var _0xe76c=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x76ce[_0xae7c2f];return _0x5d7001;};'use strict';var emlformat=require(_0xe76c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe76c('0x1'));var jsonpatch=require(_0xe76c('0x2'));var rp=require('request-promise');var moment=require(_0xe76c('0x3'));var BPromise=require(_0xe76c('0x4'));var Mustache=require(_0xe76c('0x5'));var util=require('util');var path=require('path');var sox=require(_0xe76c('0x6'));var csv=require(_0xe76c('0x7'));var ejs=require(_0xe76c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe76c('0x9'));var crypto=require(_0xe76c('0xa'));var jsforce=require(_0xe76c('0xb'));var deskjs=require(_0xe76c('0xc'));var toCsv=require(_0xe76c('0x7'));var querystring=require(_0xe76c('0xd'));var Papa=require(_0xe76c('0xe'));var Redis=require(_0xe76c('0xf'));var authService=require(_0xe76c('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe76c('0x11'))(_0xe76c('0x12'));var utils=require(_0xe76c('0x13'));var config=require(_0xe76c('0x14'));var licenseUtil=require(_0xe76c('0x15'));var db=require(_0xe76c('0x16'))['db'];config['redis']=_['defaults'](config[_0xe76c('0x17')],{'host':_0xe76c('0x18'),'port':0x18eb});var socket=require(_0xe76c('0x19'))(new Redis(config['redis']));require(_0xe76c('0x1a'))[_0xe76c('0x1b')](socket);function respondWithStatusCode(_0x4ef71c,_0x3f8e3f){_0x3f8e3f=_0x3f8e3f||0xcc;return function(_0x47b2da){if(_0x47b2da){return _0x4ef71c[_0xe76c('0x1c')](_0x3f8e3f);}return _0x4ef71c['status'](_0x3f8e3f)[_0xe76c('0x1d')]();};}function respondWithResult(_0x5f0b99,_0x24bbad){_0x24bbad=_0x24bbad||0xc8;return function(_0x2519f3){if(_0x2519f3){return _0x5f0b99[_0xe76c('0x1e')](_0x24bbad)['json'](_0x2519f3);}};}function respondWithFilteredResult(_0x25b6ef,_0x4ba9fe){return function(_0x5a0bd8){if(_0x5a0bd8){var _0x128ad7=typeof _0x4ba9fe[_0xe76c('0x1f')]===_0xe76c('0x20')&&typeof _0x4ba9fe[_0xe76c('0x21')]===_0xe76c('0x20');var _0x4d2dcb=_0x5a0bd8[_0xe76c('0x22')];var _0xc6c9f8=_0x128ad7?0x0:_0x4ba9fe[_0xe76c('0x1f')];var _0x4f5094=_0x128ad7?_0x5a0bd8[_0xe76c('0x22')]:_0x4ba9fe[_0xe76c('0x1f')]+_0x4ba9fe[_0xe76c('0x21')];var _0x405b2e;if(_0x4f5094>=_0x4d2dcb){_0x4f5094=_0x4d2dcb;_0x405b2e=0xc8;}else{_0x405b2e=0xce;}_0x25b6ef[_0xe76c('0x1e')](_0x405b2e);return _0x25b6ef['set'](_0xe76c('0x23'),_0xc6c9f8+'-'+_0x4f5094+'/'+_0x4d2dcb)[_0xe76c('0x24')](_0x5a0bd8);}return null;};}function patchUpdates(_0x4cadd2){return function(_0x3982c4){try{jsonpatch[_0xe76c('0x25')](_0x3982c4,_0x4cadd2,!![]);}catch(_0x4b24a1){return BPromise[_0xe76c('0x26')](_0x4b24a1);}return _0x3982c4['save']();};}function saveUpdates(_0x5e478c,_0x4e033c){return function(_0x36eb07){if(_0x36eb07){return _0x36eb07[_0xe76c('0x27')](_0x5e478c)[_0xe76c('0x28')](function(_0x29ee32){return _0x29ee32;});}return null;};}function removeEntity(_0x4994f6,_0x26aa6d){return function(_0x15f63a){if(_0x15f63a){return _0x15f63a[_0xe76c('0x29')]()[_0xe76c('0x28')](function(){_0x4994f6[_0xe76c('0x1e')](0xcc)[_0xe76c('0x1d')]();});}};}function handleEntityNotFound(_0xa2bc4f,_0x52605e){return function(_0x1905d1){if(!_0x1905d1){_0xa2bc4f['sendStatus'](0x194);}return _0x1905d1;};}function handleError(_0x54d736,_0x377638){_0x377638=_0x377638||0x1f4;return function(_0x29809d){logger[_0xe76c('0x2a')](_0x29809d[_0xe76c('0x2b')]);if(_0x29809d[_0xe76c('0x2c')]){delete _0x29809d[_0xe76c('0x2c')];}_0x54d736[_0xe76c('0x1e')](_0x377638)[_0xe76c('0x2d')](_0x29809d);};}exports['index']=function(_0x8a5b1c,_0x1c5aa7){var _0x3c1929={},_0x179f9d={},_0x4657cf={'count':0x0,'rows':[]};var _0x4af313=_[_0xe76c('0x2e')](db[_0xe76c('0x2f')]['rawAttributes'],function(_0x24c03b){return{'name':_0x24c03b[_0xe76c('0x30')],'type':_0x24c03b[_0xe76c('0x31')]['key']};});_0x179f9d[_0xe76c('0x32')]=_['map'](_0x4af313,'name');_0x179f9d['query']=_[_0xe76c('0x33')](_0x8a5b1c[_0xe76c('0x34')]);_0x179f9d[_0xe76c('0x35')]=_[_0xe76c('0x36')](_0x179f9d[_0xe76c('0x32')],_0x179f9d[_0xe76c('0x34')]);_0x3c1929[_0xe76c('0x37')]=_[_0xe76c('0x36')](_0x179f9d[_0xe76c('0x32')],qs['fields'](_0x8a5b1c[_0xe76c('0x34')]['fields']));_0x3c1929[_0xe76c('0x37')]=_0x3c1929[_0xe76c('0x37')]['length']?_0x3c1929[_0xe76c('0x37')]:_0x179f9d[_0xe76c('0x32')];if(!_0x8a5b1c['query'][_0xe76c('0x38')](_0xe76c('0x39'))){_0x3c1929[_0xe76c('0x21')]=qs[_0xe76c('0x21')](_0x8a5b1c[_0xe76c('0x34')][_0xe76c('0x21')]);_0x3c1929[_0xe76c('0x1f')]=qs['offset'](_0x8a5b1c[_0xe76c('0x34')]['offset']);}_0x3c1929['order']=qs[_0xe76c('0x3a')](_0x8a5b1c['query']['sort']);_0x3c1929[_0xe76c('0x3b')]=qs['filters'](_[_0xe76c('0x3c')](_0x8a5b1c[_0xe76c('0x34')],_0x179f9d[_0xe76c('0x35')]),_0x4af313);if(_0x8a5b1c[_0xe76c('0x34')]['filter']){_0x3c1929[_0xe76c('0x3b')]=_['merge'](_0x3c1929[_0xe76c('0x3b')],{'$or':_[_0xe76c('0x2e')](_0x4af313,function(_0x32cf0a){if(_0x32cf0a['type']!==_0xe76c('0x3d')){var _0x26c98d={};_0x26c98d[_0x32cf0a[_0xe76c('0x2c')]]={'$like':'%'+_0x8a5b1c[_0xe76c('0x34')][_0xe76c('0x3e')]+'%'};return _0x26c98d;}})});}_0x3c1929=_['merge']({},_0x3c1929,_0x8a5b1c[_0xe76c('0x3f')]);var _0x451ffc={'where':_0x3c1929[_0xe76c('0x3b')]};return db['ChatInternalMessage'][_0xe76c('0x22')](_0x451ffc)[_0xe76c('0x28')](function(_0x2cbf28){_0x4657cf[_0xe76c('0x22')]=_0x2cbf28;if(_0x8a5b1c[_0xe76c('0x34')]['includeAll']){_0x3c1929['include']=[{'all':!![]}];}return db[_0xe76c('0x2f')]['findAll'](_0x3c1929);})[_0xe76c('0x28')](function(_0x5f4e12){_0x4657cf['rows']=_0x5f4e12;return _0x4657cf;})[_0xe76c('0x28')](respondWithFilteredResult(_0x1c5aa7,_0x3c1929))[_0xe76c('0x40')](handleError(_0x1c5aa7,null));};exports[_0xe76c('0x41')]=function(_0x5a254d,_0x31128a){var _0x313115={'raw':!![],'where':{'id':_0x5a254d['params']['id']}},_0x50739a={};_0x50739a[_0xe76c('0x32')]=_['keys'](db[_0xe76c('0x2f')]['rawAttributes']);_0x50739a['query']=_[_0xe76c('0x33')](_0x5a254d[_0xe76c('0x34')]);_0x50739a[_0xe76c('0x35')]=_['intersection'](_0x50739a[_0xe76c('0x32')],_0x50739a[_0xe76c('0x34')]);_0x313115[_0xe76c('0x37')]=_[_0xe76c('0x36')](_0x50739a[_0xe76c('0x32')],qs['fields'](_0x5a254d[_0xe76c('0x34')][_0xe76c('0x42')]));_0x313115[_0xe76c('0x37')]=_0x313115[_0xe76c('0x37')]['length']?_0x313115[_0xe76c('0x37')]:_0x50739a[_0xe76c('0x32')];if(_0x5a254d[_0xe76c('0x34')][_0xe76c('0x43')]){_0x313115[_0xe76c('0x44')]=[{'all':!![]}];}_0x313115=_[_0xe76c('0x45')]({},_0x313115,_0x5a254d[_0xe76c('0x3f')]);return db[_0xe76c('0x2f')]['find'](_0x313115)[_0xe76c('0x28')](handleEntityNotFound(_0x31128a,null))[_0xe76c('0x28')](respondWithResult(_0x31128a,null))[_0xe76c('0x40')](handleError(_0x31128a,null));};exports[_0xe76c('0x46')]=function(_0x5f46a0,_0x504daf){return db[_0xe76c('0x2f')][_0xe76c('0x46')](_0x5f46a0['body'],{})[_0xe76c('0x28')](respondWithResult(_0x504daf,0xc9))['catch'](handleError(_0x504daf,null));};exports[_0xe76c('0x27')]=function(_0xdd704f,_0xea772){if(_0xdd704f[_0xe76c('0x47')]['id']){delete _0xdd704f[_0xe76c('0x47')]['id'];}return db['ChatInternalMessage'][_0xe76c('0x48')]({'where':{'id':_0xdd704f[_0xe76c('0x49')]['id']}})[_0xe76c('0x28')](handleEntityNotFound(_0xea772,null))['then'](saveUpdates(_0xdd704f[_0xe76c('0x47')],null))['then'](respondWithResult(_0xea772,null))[_0xe76c('0x40')](handleError(_0xea772,null));};exports[_0xe76c('0x29')]=function(_0x5daee7,_0x3be4ea){return db[_0xe76c('0x2f')][_0xe76c('0x48')]({'where':{'id':_0x5daee7['params']['id']}})[_0xe76c('0x28')](handleEntityNotFound(_0x3be4ea,null))[_0xe76c('0x28')](removeEntity(_0x3be4ea,null))[_0xe76c('0x40')](handleError(_0x3be4ea,null));};exports[_0xe76c('0x4a')]=function(_0x26f5ca,_0x219af1){return db[_0xe76c('0x2f')]['describe']()[_0xe76c('0x28')](respondWithResult(_0x219af1,null))['catch'](handleError(_0x219af1,null));};function wrapUser(_0x30060e){return function(_0x2f2f77){var _0x334204=_0x30060e['get']({'plain':!![]});_0x334204[_0xe76c('0x4b')]=[];if(_0x2f2f77){_0x334204[_0xe76c('0x4c')]=_0x2f2f77['createdAt'];_0x334204[_0xe76c('0x4d')]=_0x2f2f77;}else{_0x334204[_0xe76c('0x4c')]=moment(0x0)[_0xe76c('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');_0x334204[_0xe76c('0x4d')]={};}return _0x334204;};}exports[_0xe76c('0x4f')]=function(_0x18953c,_0x296bed,_0x51f9aa){var _0x98fb02=[];return db[_0xe76c('0x50')][_0xe76c('0x51')]({'where':{'role':[_0xe76c('0x52'),_0xe76c('0x53'),_0xe76c('0x54')]},'attributes':['id','fullname',_0xe76c('0x2c'),_0xe76c('0x55'),_0xe76c('0x56'),_0xe76c('0x57'),'online',_0xe76c('0x58'),_0xe76c('0x59'),'showWebBar'],'order':qs[_0xe76c('0x3a')]('-online'),'include':[{'model':db[_0xe76c('0x5a')],'as':_0xe76c('0x5b'),'attributes':['id',_0xe76c('0x2c'),_0xe76c('0x31')],'through':{'attributes':[]}}]})[_0xe76c('0x28')](function(_0x1698b3){if(_0x1698b3){var _0x449d61=_0x18953c[_0xe76c('0x54')][_0xe76c('0x5c')]({'plain':!![]});if(!_0x449d61)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x449d61['role']===_0xe76c('0x54')){return db[_0xe76c('0x5d')][_0xe76c('0x48')]({'where':{'name':'Agents','userProfileId':_0x449d61['userProfileId']},'raw':!![]})[_0xe76c('0x28')](function(_0x1c534f){if(_0x1c534f){if(_0x1c534f[_0xe76c('0x5e')]===0x0){return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x1c534f['id']},'raw':!![]})[_0xe76c('0x28')](function(_0x4238d4){var _0x31cc28=[];if(_[_0xe76c('0x5f')](_0x4238d4)){_0x31cc28=_[_0xe76c('0x3e')](_0x1698b3,function(_0x3ca00d){if(_0x3ca00d[_0xe76c('0x55')]!==_0xe76c('0x52')){return _0x3ca00d;}});return _0x31cc28;}else{for(var _0x1b29a5=0x0;_0x1b29a5<_0x1698b3[_0xe76c('0x60')];_0x1b29a5++){var _0xaa41ba=_0x1698b3[_0x1b29a5];if(_0xaa41ba[_0xe76c('0x55')]===_0xe76c('0x52')){var _0x1cc837=_[_0xe76c('0x48')](_0x4238d4,function(_0x1dac22){return _0x1dac22['resourceId']===_0xaa41ba['id'];});if(_0x1cc837)_0x31cc28[_0xe76c('0x61')](_0xaa41ba);}else{_0x31cc28[_0xe76c('0x61')](_0xaa41ba);}}return _0x31cc28;}});}else{return _0x1698b3;}}else{var _0x11825c=_[_0xe76c('0x3e')](_0x1698b3,function(_0x2f52f6){if(_0x2f52f6[_0xe76c('0x55')]!==_0xe76c('0x52')){return _0x2f52f6;}});return _0x11825c;}});}else{return _0x1698b3;}}})[_0xe76c('0x28')](function(_0x17bd49){var _0x50fd55=[];if(_0x17bd49){_0x98fb02=_0x17bd49;for(var _0x139a9c=0x0;_0x139a9c<_0x17bd49[_0xe76c('0x60')];_0x139a9c+=0x1){_0x98fb02[_0x139a9c][_0xe76c('0x4b')]=[];_0x50fd55[_0xe76c('0x61')](db[_0xe76c('0x2f')][_0xe76c('0x48')]({'where':{'FromId':[_0x18953c[_0xe76c('0x54')]['id'],_0x17bd49[_0x139a9c]['id']],'ToId':[_0x18953c[_0xe76c('0x54')]['id'],_0x17bd49[_0x139a9c]['id']],'ChatGroupId':null},'attributes':['id',_0xe76c('0x62'),'FromId',_0xe76c('0x63'),_0xe76c('0x64'),'body'],'order':qs['sort'](_0xe76c('0x65')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xe76c('0x28')](wrapUser(_0x17bd49[_0x139a9c])));}return BPromise[_0xe76c('0x66')](_0x50fd55);}return[];})[_0xe76c('0x28')](function(_0xa4de4d){return{'rows':_0xa4de4d,'count':_0xa4de4d[_0xe76c('0x60')]};})['then'](respondWithResult(_0x296bed,null))['catch'](handleError(_0x296bed,null));};
\ No newline at end of file
+var _0xa7f7=['catch','params','rawAttributes','find','create','body','update','describe','get','lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','agent','admin','online','lastLoginAt','allowmessenger','-online','VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','resourceId','push','messages','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','lodash','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','save','then','destroy','stack','name','send','index','map','ChatInternalMessage','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows'];(function(_0x13cf7a,_0x479809){var _0x5cb678=function(_0x267d4a){while(--_0x267d4a){_0x13cf7a['push'](_0x13cf7a['shift']());}};_0x5cb678(++_0x479809);}(_0xa7f7,0x8a));var _0x7a7f=function(_0x487ab4,_0x1e24e8){_0x487ab4=_0x487ab4-0x0;var _0x3bef77=_0xa7f7[_0x487ab4];return _0x3bef77;};'use strict';var emlformat=require(_0x7a7f('0x0'));var rimraf=require(_0x7a7f('0x1'));var zipdir=require(_0x7a7f('0x2'));var jsonpatch=require(_0x7a7f('0x3'));var rp=require(_0x7a7f('0x4'));var moment=require(_0x7a7f('0x5'));var BPromise=require(_0x7a7f('0x6'));var Mustache=require('mustache');var util=require(_0x7a7f('0x7'));var path=require(_0x7a7f('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7a7f('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7a7f('0xa'));var deskjs=require(_0x7a7f('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7a7f('0xc'));var Redis=require(_0x7a7f('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x7a7f('0xe'));var as=require(_0x7a7f('0xf'));var hardwareService=require(_0x7a7f('0x10'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x7a7f('0x11'));var licenseUtil=require(_0x7a7f('0x12'));var db=require(_0x7a7f('0x13'))['db'];config[_0x7a7f('0x14')]=_[_0x7a7f('0x15')](config[_0x7a7f('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0x7a7f('0x16'))(new Redis(config[_0x7a7f('0x14')]));require(_0x7a7f('0x17'))[_0x7a7f('0x18')](socket);function respondWithStatusCode(_0x2de9f9,_0x2d6ec9){_0x2d6ec9=_0x2d6ec9||0xcc;return function(_0x237095){if(_0x237095){return _0x2de9f9[_0x7a7f('0x19')](_0x2d6ec9);}return _0x2de9f9[_0x7a7f('0x1a')](_0x2d6ec9)[_0x7a7f('0x1b')]();};}function respondWithResult(_0x2090f0,_0x50ec2b){_0x50ec2b=_0x50ec2b||0xc8;return function(_0x33ef4b){if(_0x33ef4b){return _0x2090f0['status'](_0x50ec2b)[_0x7a7f('0x1c')](_0x33ef4b);}};}function respondWithFilteredResult(_0x1781c4,_0x5ba334){return function(_0x54dd4e){if(_0x54dd4e){var _0x17a4e5=typeof _0x5ba334[_0x7a7f('0x1d')]===_0x7a7f('0x1e')&&typeof _0x5ba334['limit']===_0x7a7f('0x1e');var _0x45af28=_0x54dd4e[_0x7a7f('0x1f')];var _0x13dc8a=_0x17a4e5?0x0:_0x5ba334[_0x7a7f('0x1d')];var _0x3a3de3=_0x17a4e5?_0x54dd4e[_0x7a7f('0x1f')]:_0x5ba334[_0x7a7f('0x1d')]+_0x5ba334[_0x7a7f('0x20')];var _0x18cc03;if(_0x3a3de3>=_0x45af28){_0x3a3de3=_0x45af28;_0x18cc03=0xc8;}else{_0x18cc03=0xce;}_0x1781c4['status'](_0x18cc03);return _0x1781c4[_0x7a7f('0x21')]('Content-Range',_0x13dc8a+'-'+_0x3a3de3+'/'+_0x45af28)[_0x7a7f('0x1c')](_0x54dd4e);}return null;};}function patchUpdates(_0x16d54b){return function(_0x586ace){try{jsonpatch[_0x7a7f('0x22')](_0x586ace,_0x16d54b,!![]);}catch(_0x71d29){return BPromise['reject'](_0x71d29);}return _0x586ace[_0x7a7f('0x23')]();};}function saveUpdates(_0x3fb517,_0x11f494){return function(_0x3216e6){if(_0x3216e6){return _0x3216e6['update'](_0x3fb517)[_0x7a7f('0x24')](function(_0x2bfdfd){return _0x2bfdfd;});}return null;};}function removeEntity(_0x280d16,_0x135243){return function(_0x2e2ab0){if(_0x2e2ab0){return _0x2e2ab0[_0x7a7f('0x25')]()['then'](function(){_0x280d16[_0x7a7f('0x1a')](0xcc)[_0x7a7f('0x1b')]();});}};}function handleEntityNotFound(_0x454e13,_0x20b070){return function(_0x5e69b6){if(!_0x5e69b6){_0x454e13['sendStatus'](0x194);}return _0x5e69b6;};}function handleError(_0x4b35c5,_0x57651d){_0x57651d=_0x57651d||0x1f4;return function(_0x36e4e5){logger['error'](_0x36e4e5[_0x7a7f('0x26')]);if(_0x36e4e5[_0x7a7f('0x27')]){delete _0x36e4e5[_0x7a7f('0x27')];}_0x4b35c5['status'](_0x57651d)[_0x7a7f('0x28')](_0x36e4e5);};}exports[_0x7a7f('0x29')]=function(_0x22ea30,_0x115572){var _0x3f0781={},_0x37b691={},_0xa1b3a1={'count':0x0,'rows':[]};var _0x1896b8=_[_0x7a7f('0x2a')](db[_0x7a7f('0x2b')]['rawAttributes'],function(_0x377427){return{'name':_0x377427[_0x7a7f('0x2c')],'type':_0x377427[_0x7a7f('0x2d')][_0x7a7f('0x2e')]};});_0x37b691['model']=_[_0x7a7f('0x2a')](_0x1896b8,'name');_0x37b691[_0x7a7f('0x2f')]=_['keys'](_0x22ea30['query']);_0x37b691[_0x7a7f('0x30')]=_[_0x7a7f('0x31')](_0x37b691[_0x7a7f('0x32')],_0x37b691[_0x7a7f('0x2f')]);_0x3f0781['attributes']=_['intersection'](_0x37b691[_0x7a7f('0x32')],qs[_0x7a7f('0x33')](_0x22ea30['query'][_0x7a7f('0x33')]));_0x3f0781[_0x7a7f('0x34')]=_0x3f0781[_0x7a7f('0x34')][_0x7a7f('0x35')]?_0x3f0781[_0x7a7f('0x34')]:_0x37b691[_0x7a7f('0x32')];if(!_0x22ea30[_0x7a7f('0x2f')]['hasOwnProperty'](_0x7a7f('0x36'))){_0x3f0781[_0x7a7f('0x20')]=qs['limit'](_0x22ea30[_0x7a7f('0x2f')][_0x7a7f('0x20')]);_0x3f0781[_0x7a7f('0x1d')]=qs[_0x7a7f('0x1d')](_0x22ea30[_0x7a7f('0x2f')][_0x7a7f('0x1d')]);}_0x3f0781[_0x7a7f('0x37')]=qs[_0x7a7f('0x38')](_0x22ea30[_0x7a7f('0x2f')]['sort']);_0x3f0781[_0x7a7f('0x39')]=qs[_0x7a7f('0x30')](_[_0x7a7f('0x3a')](_0x22ea30[_0x7a7f('0x2f')],_0x37b691[_0x7a7f('0x30')]),_0x1896b8);if(_0x22ea30[_0x7a7f('0x2f')][_0x7a7f('0x3b')]){_0x3f0781[_0x7a7f('0x39')]=_[_0x7a7f('0x3c')](_0x3f0781[_0x7a7f('0x39')],{'$or':_['map'](_0x1896b8,function(_0x2097ac){if(_0x2097ac['type']!==_0x7a7f('0x3d')){var _0x2b1dd0={};_0x2b1dd0[_0x2097ac[_0x7a7f('0x27')]]={'$like':'%'+_0x22ea30[_0x7a7f('0x2f')][_0x7a7f('0x3b')]+'%'};return _0x2b1dd0;}})});}_0x3f0781=_['merge']({},_0x3f0781,_0x22ea30[_0x7a7f('0x3e')]);var _0x167c22={'where':_0x3f0781['where']};return db[_0x7a7f('0x2b')][_0x7a7f('0x1f')](_0x167c22)[_0x7a7f('0x24')](function(_0x6ce5c1){_0xa1b3a1[_0x7a7f('0x1f')]=_0x6ce5c1;if(_0x22ea30[_0x7a7f('0x2f')]['includeAll']){_0x3f0781[_0x7a7f('0x3f')]=[{'all':!![]}];}return db[_0x7a7f('0x2b')][_0x7a7f('0x40')](_0x3f0781);})[_0x7a7f('0x24')](function(_0x54df45){_0xa1b3a1[_0x7a7f('0x41')]=_0x54df45;return _0xa1b3a1;})[_0x7a7f('0x24')](respondWithFilteredResult(_0x115572,_0x3f0781))[_0x7a7f('0x42')](handleError(_0x115572,null));};exports['show']=function(_0x49e40f,_0x5bcbd3){var _0x169f53={'raw':!![],'where':{'id':_0x49e40f[_0x7a7f('0x43')]['id']}},_0x2ff8d4={};_0x2ff8d4[_0x7a7f('0x32')]=_['keys'](db[_0x7a7f('0x2b')][_0x7a7f('0x44')]);_0x2ff8d4[_0x7a7f('0x2f')]=_['keys'](_0x49e40f[_0x7a7f('0x2f')]);_0x2ff8d4[_0x7a7f('0x30')]=_[_0x7a7f('0x31')](_0x2ff8d4[_0x7a7f('0x32')],_0x2ff8d4[_0x7a7f('0x2f')]);_0x169f53['attributes']=_[_0x7a7f('0x31')](_0x2ff8d4[_0x7a7f('0x32')],qs[_0x7a7f('0x33')](_0x49e40f[_0x7a7f('0x2f')][_0x7a7f('0x33')]));_0x169f53[_0x7a7f('0x34')]=_0x169f53[_0x7a7f('0x34')][_0x7a7f('0x35')]?_0x169f53[_0x7a7f('0x34')]:_0x2ff8d4[_0x7a7f('0x32')];if(_0x49e40f[_0x7a7f('0x2f')]['includeAll']){_0x169f53[_0x7a7f('0x3f')]=[{'all':!![]}];}_0x169f53=_[_0x7a7f('0x3c')]({},_0x169f53,_0x49e40f[_0x7a7f('0x3e')]);return db[_0x7a7f('0x2b')][_0x7a7f('0x45')](_0x169f53)['then'](handleEntityNotFound(_0x5bcbd3,null))['then'](respondWithResult(_0x5bcbd3,null))['catch'](handleError(_0x5bcbd3,null));};exports[_0x7a7f('0x46')]=function(_0x2afe9c,_0x1c2509){return db[_0x7a7f('0x2b')][_0x7a7f('0x46')](_0x2afe9c[_0x7a7f('0x47')],{})[_0x7a7f('0x24')](respondWithResult(_0x1c2509,0xc9))[_0x7a7f('0x42')](handleError(_0x1c2509,null));};exports[_0x7a7f('0x48')]=function(_0x438ecf,_0x2dd401){if(_0x438ecf[_0x7a7f('0x47')]['id']){delete _0x438ecf[_0x7a7f('0x47')]['id'];}return db[_0x7a7f('0x2b')][_0x7a7f('0x45')]({'where':{'id':_0x438ecf[_0x7a7f('0x43')]['id']}})[_0x7a7f('0x24')](handleEntityNotFound(_0x2dd401,null))[_0x7a7f('0x24')](saveUpdates(_0x438ecf[_0x7a7f('0x47')],null))[_0x7a7f('0x24')](respondWithResult(_0x2dd401,null))[_0x7a7f('0x42')](handleError(_0x2dd401,null));};exports[_0x7a7f('0x25')]=function(_0x46d142,_0x1def4a){return db[_0x7a7f('0x2b')][_0x7a7f('0x45')]({'where':{'id':_0x46d142[_0x7a7f('0x43')]['id']}})['then'](handleEntityNotFound(_0x1def4a,null))[_0x7a7f('0x24')](removeEntity(_0x1def4a,null))[_0x7a7f('0x42')](handleError(_0x1def4a,null));};exports[_0x7a7f('0x49')]=function(_0xc820d9,_0x37a9f4){return db['ChatInternalMessage']['describe']()[_0x7a7f('0x24')](respondWithResult(_0x37a9f4,null))[_0x7a7f('0x42')](handleError(_0x37a9f4,null));};function wrapUser(_0x205b97){return function(_0x21125d){var _0x32d29d=_0x205b97[_0x7a7f('0x4a')]({'plain':!![]});_0x32d29d['messages']=[];if(_0x21125d){_0x32d29d['lastMessageAt']=_0x21125d['createdAt'];_0x32d29d[_0x7a7f('0x4b')]=_0x21125d;}else{_0x32d29d[_0x7a7f('0x4c')]=moment(0x0)[_0x7a7f('0x4d')](_0x7a7f('0x4e'));_0x32d29d['lastMessage']={};}return _0x32d29d;};}exports[_0x7a7f('0x4f')]=function(_0x5ceea9,_0x2fcf17,_0x3c9f9d){var _0xabbdba=[];return db['User'][_0x7a7f('0x40')]({'where':{'role':[_0x7a7f('0x50'),_0x7a7f('0x51'),'user']},'attributes':['id','fullname',_0x7a7f('0x27'),'role','userpic','internal',_0x7a7f('0x52'),_0x7a7f('0x53'),_0x7a7f('0x54'),'showWebBar'],'order':qs[_0x7a7f('0x38')](_0x7a7f('0x55')),'include':[{'model':db['VoiceQueue'],'as':_0x7a7f('0x56'),'attributes':['id',_0x7a7f('0x27'),_0x7a7f('0x2d')],'through':{'attributes':[]}}]})['then'](function(_0x5a440b){if(_0x5a440b){var _0x5909d9=_0x5ceea9[_0x7a7f('0x57')][_0x7a7f('0x4a')]({'plain':!![]});if(!_0x5909d9)throw new Error(_0x7a7f('0x58'));if(_0x5909d9[_0x7a7f('0x59')]==='user'){return db[_0x7a7f('0x5a')][_0x7a7f('0x45')]({'where':{'name':_0x7a7f('0x5b'),'userProfileId':_0x5909d9[_0x7a7f('0x5c')]},'raw':!![]})[_0x7a7f('0x24')](function(_0x3a1aec){if(_0x3a1aec){if(_0x3a1aec[_0x7a7f('0x5d')]===0x0){return db[_0x7a7f('0x5e')][_0x7a7f('0x40')]({'where':{'sectionId':_0x3a1aec['id']},'raw':!![]})[_0x7a7f('0x24')](function(_0xff8a92){var _0x545121=[];if(_['isEmpty'](_0xff8a92)){_0x545121=_[_0x7a7f('0x3b')](_0x5a440b,function(_0xc865cf){if(_0xc865cf['role']!==_0x7a7f('0x50')){return _0xc865cf;}});return _0x545121;}else{for(var _0x34aa3a=0x0;_0x34aa3a<_0x5a440b[_0x7a7f('0x35')];_0x34aa3a++){var _0x53997e=_0x5a440b[_0x34aa3a];if(_0x53997e[_0x7a7f('0x59')]===_0x7a7f('0x50')){var _0xbdc853=_[_0x7a7f('0x45')](_0xff8a92,function(_0x5b0eb6){return _0x5b0eb6[_0x7a7f('0x5f')]===_0x53997e['id'];});if(_0xbdc853)_0x545121[_0x7a7f('0x60')](_0x53997e);}else{_0x545121[_0x7a7f('0x60')](_0x53997e);}}return _0x545121;}});}else{return _0x5a440b;}}else{var _0x486459=_['filter'](_0x5a440b,function(_0x5ce3d0){if(_0x5ce3d0[_0x7a7f('0x59')]!==_0x7a7f('0x50')){return _0x5ce3d0;}});return _0x486459;}});}else{return _0x5a440b;}}})[_0x7a7f('0x24')](function(_0x5005af){var _0x19f5ce=[];if(_0x5005af){_0xabbdba=_0x5005af;for(var _0x417bd1=0x0;_0x417bd1<_0x5005af[_0x7a7f('0x35')];_0x417bd1+=0x1){_0xabbdba[_0x417bd1][_0x7a7f('0x61')]=[];_0x19f5ce[_0x7a7f('0x60')](db['ChatInternalMessage'][_0x7a7f('0x45')]({'where':{'FromId':[_0x5ceea9[_0x7a7f('0x57')]['id'],_0x5005af[_0x417bd1]['id']],'ToId':[_0x5ceea9[_0x7a7f('0x57')]['id'],_0x5005af[_0x417bd1]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId',_0x7a7f('0x62'),_0x7a7f('0x63'),_0x7a7f('0x47')],'order':qs[_0x7a7f('0x38')](_0x7a7f('0x64')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x7a7f('0x24')](wrapUser(_0x5005af[_0x417bd1])));}return BPromise[_0x7a7f('0x65')](_0x19f5ce);}return[];})[_0x7a7f('0x24')](function(_0xf2cdbf){return{'rows':_0xf2cdbf,'count':_0xf2cdbf['length']};})[_0x7a7f('0x24')](respondWithResult(_0x2fcf17,null))[_0x7a7f('0x42')](handleError(_0x2fcf17,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 4750aeb..e3eea1e 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 _0x6356=['hook','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x4c983b,_0x16d315){var _0x3d0ff0=function(_0x3939ef){while(--_0x3939ef){_0x4c983b['push'](_0x4c983b['shift']());}};_0x3d0ff0(++_0x16d315);}(_0x6356,0xc7));var _0x6635=function(_0x207114,_0x25902e){_0x207114=_0x207114-0x0;var _0x14d3b4=_0x6356[_0x207114];return _0x14d3b4;};'use strict';var EventEmitter=require(_0x6635('0x0'));var ChatInternalMessage=require(_0x6635('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x6635('0x2')](0x0);var events={'afterCreate':_0x6635('0x3'),'afterUpdate':_0x6635('0x4'),'afterDestroy':_0x6635('0x5')};function emitEvent(_0x42bf57){return function(_0x521df7,_0x684e9a,_0x44e99e){ChatInternalMessageEvents[_0x6635('0x6')](_0x42bf57+':'+_0x521df7['id'],_0x521df7);ChatInternalMessageEvents[_0x6635('0x6')](_0x42bf57,_0x521df7);_0x44e99e(null);};}for(var e in events){if(events[_0x6635('0x7')](e)){var event=events[e];ChatInternalMessage[_0x6635('0x8')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x7ae6=['remove','emit','hasOwnProperty','hook','../../mysqldb','setMaxListeners','save','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7ae6,0x94));var _0x67ae=function(_0x3e8e85,_0xadecee){_0x3e8e85=_0x3e8e85-0x0;var _0xc42eab=_0x7ae6[_0x3e8e85];return _0xc42eab;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x67ae('0x0'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x67ae('0x1')](0x0);var events={'afterCreate':_0x67ae('0x2'),'afterUpdate':_0x67ae('0x3'),'afterDestroy':_0x67ae('0x4')};function emitEvent(_0x118b8b){return function(_0x45c5a5,_0x55f2cc,_0x18d44c){ChatInternalMessageEvents[_0x67ae('0x5')](_0x118b8b+':'+_0x45c5a5['id'],_0x45c5a5);ChatInternalMessageEvents[_0x67ae('0x5')](_0x118b8b,_0x45c5a5);_0x18d44c(null);};}for(var e in events){if(events[_0x67ae('0x6')](e)){var event=events[e];ChatInternalMessage[_0x67ae('0x7')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index d2c8d55..d12e747 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 _0xd94e=['request-promise','rimraf','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird'];(function(_0x3be2e2,_0x5c166d){var _0x53b9c5=function(_0x248aa7){while(--_0x248aa7){_0x3be2e2['push'](_0x3be2e2['shift']());}};_0x53b9c5(++_0x5c166d);}(_0xd94e,0xc8));var _0xed94=function(_0x35559,_0x36ab81){_0x35559=_0x35559-0x0;var _0x368237=_0xd94e[_0x35559];return _0x368237;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xed94('0x0'))(_0xed94('0x1'));var moment=require(_0xed94('0x2'));var BPromise=require(_0xed94('0x3'));var rp=require(_0xed94('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xed94('0x5'));var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module[_0xed94('0x6')]=function(_0xa776a3,_0x2740ca){return _0xa776a3[_0xed94('0x7')](_0xed94('0x8'),attributes,{'tableName':_0xed94('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xed94('0xa'),'collate':_0xed94('0xb')});};
\ No newline at end of file
+var _0x9dec=['../../config/environment','exports','ChatInternalMessage','utf8mb4','lodash','api','bluebird'];(function(_0x216251,_0x230823){var _0x5821af=function(_0x33a575){while(--_0x33a575){_0x216251['push'](_0x216251['shift']());}};_0x5821af(++_0x230823);}(_0x9dec,0x13f));var _0xc9de=function(_0x3be5dd,_0x2a47e1){_0x3be5dd=_0x3be5dd-0x0;var _0x45a15c=_0x9dec[_0x3be5dd];return _0x45a15c;};'use strict';var _=require(_0xc9de('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc9de('0x1'));var moment=require('moment');var BPromise=require(_0xc9de('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc9de('0x3'));var attributes=require('./chatInternalMessage.attributes');module[_0xc9de('0x4')]=function(_0x1be64d,_0x42d76c){return _0x1be64d['define'](_0xc9de('0x5'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc9de('0x6'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 6853b90..56a2865 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 _0x83ea=['http','redis','./chatInternalMessage.socket','register','request','then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','client'];(function(_0x5ace3b,_0x5aeac0){var _0x762c23=function(_0x4b66a3){while(--_0x4b66a3){_0x5ace3b['push'](_0x5ace3b['shift']());}};_0x762c23(++_0x5aeac0);}(_0x83ea,0x158));var _0xa83e=function(_0x327bc7,_0x10fcc5){_0x327bc7=_0x327bc7-0x0;var _0x47e71f=_0x83ea[_0x327bc7];return _0x47e71f;};'use strict';var _=require(_0xa83e('0x0'));var util=require(_0xa83e('0x1'));var moment=require('moment');var BPromise=require(_0xa83e('0x2'));var rs=require(_0xa83e('0x3'));var fs=require('fs');var Redis=require(_0xa83e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa83e('0x5'));var logger=require('../../config/logger')(_0xa83e('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa83e('0x7')][_0xa83e('0x8')]({'port':0x232a});config[_0xa83e('0x9')]=_['defaults'](config[_0xa83e('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa83e('0x9')]));require(_0xa83e('0xa'))[_0xa83e('0xb')](socket);function respondWithRpcPromise(_0x2b59a1,_0x1b3ae2,_0x47ab2b){return new BPromise(function(_0x2a19a5,_0xea8495){return client[_0xa83e('0xc')](_0x2b59a1,_0x47ab2b)[_0xa83e('0xd')](function(_0x42dfd6){logger['info'](_0xa83e('0xe'),_0x1b3ae2,_0xa83e('0xf'));logger[_0xa83e('0x10')](_0xa83e('0x11'),_0x1b3ae2,'request\x20sent',JSON[_0xa83e('0x12')](_0x42dfd6));if(_0x42dfd6[_0xa83e('0x13')]){if(_0x42dfd6[_0xa83e('0x13')]['code']===0x1f4){logger['error'](_0xa83e('0xe'),_0x1b3ae2,_0x42dfd6[_0xa83e('0x13')]['message']);return _0xea8495(_0x42dfd6[_0xa83e('0x13')][_0xa83e('0x14')]);}logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x1b3ae2,_0x42dfd6[_0xa83e('0x13')][_0xa83e('0x14')]);return _0x2a19a5(_0x42dfd6[_0xa83e('0x13')][_0xa83e('0x14')]);}else{logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x1b3ae2,_0xa83e('0xf'));_0x2a19a5(_0x42dfd6['result'][_0xa83e('0x14')]);}})[_0xa83e('0x15')](function(_0x1c7b7f){logger[_0xa83e('0x13')](_0xa83e('0xe'),_0x1b3ae2,_0x1c7b7f);_0xea8495(_0x1c7b7f);});});}
\ No newline at end of file
+var _0xac94=['ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','rpc','jayson/promise','client','http','redis','register','request','info'];(function(_0x4f6732,_0xb4f108){var _0x5db1c4=function(_0x31e8a0){while(--_0x31e8a0){_0x4f6732['push'](_0x4f6732['shift']());}};_0x5db1c4(++_0xb4f108);}(_0xac94,0x11b));var _0x4ac9=function(_0x26b77c,_0x641f1d){_0x26b77c=_0x26b77c-0x0;var _0x3fb1d6=_0xac94[_0x26b77c];return _0x3fb1d6;};'use strict';var _=require(_0x4ac9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4ac9('0x1'));var rs=require(_0x4ac9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4ac9('0x3'));var config=require('../../config/environment');var jayson=require(_0x4ac9('0x4'));var client=jayson[_0x4ac9('0x5')][_0x4ac9('0x6')]({'port':0x232a});config[_0x4ac9('0x7')]=_['defaults'](config[_0x4ac9('0x7')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4ac9('0x7')]));require('./chatInternalMessage.socket')[_0x4ac9('0x8')](socket);function respondWithRpcPromise(_0x36122a,_0x4ded57,_0x3af754){return new BPromise(function(_0x1f1bb3,_0x8a2a4e){return client[_0x4ac9('0x9')](_0x36122a,_0x3af754)['then'](function(_0x4730a2){logger[_0x4ac9('0xa')](_0x4ac9('0xb'),_0x4ded57,_0x4ac9('0xc'));logger[_0x4ac9('0xd')](_0x4ac9('0xe'),_0x4ded57,_0x4ac9('0xc'),JSON[_0x4ac9('0xf')](_0x4730a2));if(_0x4730a2[_0x4ac9('0x10')]){if(_0x4730a2[_0x4ac9('0x10')][_0x4ac9('0x11')]===0x1f4){logger[_0x4ac9('0x10')]('ChatInternalMessage,\x20%s,\x20%s',_0x4ded57,_0x4730a2[_0x4ac9('0x10')]['message']);return _0x8a2a4e(_0x4730a2[_0x4ac9('0x10')]['message']);}logger['error'](_0x4ac9('0xb'),_0x4ded57,_0x4730a2[_0x4ac9('0x10')]['message']);return _0x1f1bb3(_0x4730a2[_0x4ac9('0x10')][_0x4ac9('0x12')]);}else{logger['info'](_0x4ac9('0xb'),_0x4ded57,_0x4ac9('0xc'));_0x1f1bb3(_0x4730a2[_0x4ac9('0x13')][_0x4ac9('0x12')]);}})[_0x4ac9('0x14')](function(_0x5e2b78){logger[_0x4ac9('0x10')]('ChatInternalMessage,\x20%s,\x20%s',_0x4ded57,_0x5e2b78);_0x8a2a4e(_0x5e2b78);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 05dcd0c..63bcf65 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 _0x849e=['./chatInternalMessage.events','save','remove','update','length','chatInternalMessage:'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x849e,0xb4));var _0xe849=function(_0x374cbc,_0x37460){_0x374cbc=_0x374cbc-0x0;var _0x45e20b=_0x849e[_0x374cbc];return _0x45e20b;};'use strict';var ChatInternalMessageEvents=require(_0xe849('0x0'));var events=[_0xe849('0x1'),_0xe849('0x2'),_0xe849('0x3')];function createListener(_0x6ce360,_0x1aed09){return function(_0x41f4e4){_0x1aed09['emit'](_0x6ce360,_0x41f4e4);};}function removeListener(_0x5bac9a,_0x5c87ce){return function(){ChatInternalMessageEvents['removeListener'](_0x5bac9a,_0x5c87ce);};}exports['register']=function(_0x3e4ec1){for(var _0x1a5757=0x0,_0x519c27=events[_0xe849('0x4')];_0x1a5757<_0x519c27;_0x1a5757++){var _0x562d16=events[_0x1a5757];var _0x3020ef=createListener(_0xe849('0x5')+_0x562d16,_0x3e4ec1);ChatInternalMessageEvents['on'](_0x562d16,_0x3020ef);}};
\ No newline at end of file
+var _0x3429=['save','remove','update','emit','register','length','chatInternalMessage:'];(function(_0x48eb64,_0x551a7e){var _0x2bdd58=function(_0xb5dd56){while(--_0xb5dd56){_0x48eb64['push'](_0x48eb64['shift']());}};_0x2bdd58(++_0x551a7e);}(_0x3429,0x19d));var _0x9342=function(_0x48949c,_0x3b80b7){_0x48949c=_0x48949c-0x0;var _0x127aaa=_0x3429[_0x48949c];return _0x127aaa;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x9342('0x0'),_0x9342('0x1'),_0x9342('0x2')];function createListener(_0x238cb2,_0x3b6914){return function(_0x16cbeb){_0x3b6914[_0x9342('0x3')](_0x238cb2,_0x16cbeb);};}function removeListener(_0x3eb499,_0x7cf3de){return function(){ChatInternalMessageEvents['removeListener'](_0x3eb499,_0x7cf3de);};}exports[_0x9342('0x4')]=function(_0x3b661f){for(var _0x468cac=0x0,_0x57710b=events[_0x9342('0x5')];_0x468cac<_0x57710b;_0x468cac++){var _0x31a3df=events[_0x468cac];var _0x138c10=createListener(_0x9342('0x6')+_0x31a3df,_0x3b661f);ChatInternalMessageEvents['on'](_0x31a3df,_0x138c10);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 44394e1..449436e 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 _0x51e4=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','/describe','/users','/:id','show','put','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x5761b8,_0x27fbf9){var _0x1e7ae0=function(_0xc26727){while(--_0xc26727){_0x5761b8['push'](_0x5761b8['shift']());}};_0x1e7ae0(++_0x27fbf9);}(_0x51e4,0x18b));var _0x451e=function(_0x180fcb,_0x208b94){_0x180fcb=_0x180fcb-0x0;var _0x515f0d=_0x51e4[_0x180fcb];return _0x515f0d;};'use strict';var multer=require(_0x451e('0x0'));var util=require(_0x451e('0x1'));var path=require(_0x451e('0x2'));var timeout=require(_0x451e('0x3'));var express=require(_0x451e('0x4'));var router=express[_0x451e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x451e('0x6'));var interaction=require(_0x451e('0x7'));var config=require(_0x451e('0x8'));var controller=require(_0x451e('0x9'));router[_0x451e('0xa')]('/',auth[_0x451e('0xb')](),controller['index']);router[_0x451e('0xa')](_0x451e('0xc'),auth[_0x451e('0xb')](),controller['describe']);router['get'](_0x451e('0xd'),auth[_0x451e('0xb')](),controller['getUsers']);router[_0x451e('0xa')](_0x451e('0xe'),auth['isAuthenticated'](),controller[_0x451e('0xf')]);router['post']('/',auth[_0x451e('0xb')](),controller['create']);router[_0x451e('0x10')](_0x451e('0xe'),controller[_0x451e('0x11')]);router[_0x451e('0x12')]('/:id',auth[_0x451e('0xb')](),controller[_0x451e('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x6076=['../../config/environment','isAuthenticated','describe','/users','getUsers','get','/:id','show','post','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x372417,_0x176da3){var _0x508ec9=function(_0x157fd1){while(--_0x157fd1){_0x372417['push'](_0x372417['shift']());}};_0x508ec9(++_0x176da3);}(_0x6076,0x71));var _0x6607=function(_0x40d6f5,_0x2bf845){_0x40d6f5=_0x40d6f5-0x0;var _0x1d651e=_0x6076[_0x40d6f5];return _0x1d651e;};'use strict';var multer=require(_0x6607('0x0'));var util=require(_0x6607('0x1'));var path=require(_0x6607('0x2'));var timeout=require('connect-timeout');var express=require(_0x6607('0x3'));var router=express['Router']();var fs_extra=require(_0x6607('0x4'));var auth=require(_0x6607('0x5'));var interaction=require(_0x6607('0x6'));var config=require(_0x6607('0x7'));var controller=require('./chatInternalMessage.controller');router['get']('/',auth[_0x6607('0x8')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0x6607('0x9')]);router['get'](_0x6607('0xa'),auth['isAuthenticated'](),controller[_0x6607('0xb')]);router[_0x6607('0xc')](_0x6607('0xd'),auth[_0x6607('0x8')](),controller[_0x6607('0xe')]);router[_0x6607('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x6607('0xd'),controller[_0x6607('0x10')]);router[_0x6607('0x11')](_0x6607('0xd'),auth[_0x6607('0x8')](),controller[_0x6607('0x12')]);module[_0x6607('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 6aa23c7..5bed910 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 _0x9e5e=['exports','medium','BOOLEAN','out','DATE','STRING','sequelize'];(function(_0x3c7cca,_0x3f9621){var _0x5c08cd=function(_0x21a761){while(--_0x21a761){_0x3c7cca['push'](_0x3c7cca['shift']());}};_0x5c08cd(++_0x3f9621);}(_0x9e5e,0x1e2));var _0xe9e5=function(_0x56916d,_0x37b935){_0x56916d=_0x56916d-0x0;var _0x2b7f1f=_0x9e5e[_0x56916d];return _0x2b7f1f;};'use strict';var Sequelize=require(_0xe9e5('0x0'));module[_0xe9e5('0x1')]={'body':{'type':Sequelize['TEXT'](_0xe9e5('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xe9e5('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xe9e5('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xe9e5('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xe9e5('0x5')]},'providerName':{'type':Sequelize[_0xe9e5('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x337f=['BOOLEAN','ENUM','out','DATE','sequelize','exports','TEXT'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0x337f,0x11c));var _0xf337=function(_0x2f229a,_0x542731){_0x2f229a=_0x2f229a-0x0;var _0xdd2c1f=_0x337f[_0x2f229a];return _0xdd2c1f;};'use strict';var Sequelize=require(_0xf337('0x0'));module[_0xf337('0x1')]={'body':{'type':Sequelize[_0xf337('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xf337('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xf337('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xf337('0x4')]('in','out'),'defaultValue':_0xf337('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xf337('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xf337('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 11113c9..ae8f211 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 _0xa9e0=['interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','chat-interactions','chat','ChatInteraction','RejectMessage','rejectMessage','Sequelize','QueryTypes','SELECT','fullname','rejectmessage','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','map','ChatMessage','fieldName','type','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','body','find','describe','../../config/logger','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteractionId','isNil','read1stAt','format'];(function(_0x5cb7b0,_0x3b5793){var _0x448a44=function(_0x429bee){while(--_0x429bee){_0x5cb7b0['push'](_0x5cb7b0['shift']());}};_0x448a44(++_0x3b5793);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0x0a9e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5d0880,_0x1985b6,_0x519dfd,_0x16033c){return new BPromise(function(_0x12066b,_0x48f32d){var _0x225616=_0x16033c||client;return _0x225616['request'](_0x5d0880,_0x519dfd)[_0x0a9e('0x1d')](function(_0x478723){logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));logger[_0x0a9e('0x21')](_0x0a9e('0x22'),_0x1985b6,_0x0a9e('0x20'),JSON[_0x0a9e('0x23')](_0x478723));if(_0x478723[_0x0a9e('0x24')]){if(_0x478723[_0x0a9e('0x24')][_0x0a9e('0x25')]===0x1f4){logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')]['message']);return _0x48f32d(_0x478723[_0x0a9e('0x24')]['message']);}logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')][_0x0a9e('0x26')]);return _0x12066b(_0x478723[_0x0a9e('0x24')]['message']);}else{logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));_0x12066b(_0x478723[_0x0a9e('0x27')][_0x0a9e('0x26')]);}})[_0x0a9e('0x28')](function(_0x16b1ca){logger['error']('ChatMessage,\x20%s,\x20%s',_0x1985b6,_0x16b1ca);_0x48f32d(_0x16b1ca);});});}function respondWithStatusCode(_0x197ec0,_0x3a8e58){_0x3a8e58=_0x3a8e58||0xcc;return function(_0x40c424){if(_0x40c424){return _0x197ec0[_0x0a9e('0x29')](_0x3a8e58);}return _0x197ec0['status'](_0x3a8e58)[_0x0a9e('0x2a')]();};}function respondWithResult(_0x479bc4,_0x45a1e7){_0x45a1e7=_0x45a1e7||0xc8;return function(_0x5bfb33){if(_0x5bfb33){return _0x479bc4[_0x0a9e('0x2b')](_0x45a1e7)[_0x0a9e('0x2c')](_0x5bfb33);}};}function respondWithFilteredResult(_0x25fba9,_0x14433c){return function(_0x140511){if(_0x140511){var _0x1538a4=typeof _0x14433c[_0x0a9e('0x2d')]===_0x0a9e('0x2e')&&typeof _0x14433c['limit']===_0x0a9e('0x2e');var _0x468813=_0x140511[_0x0a9e('0x2f')];var _0x2ec755=_0x1538a4?0x0:_0x14433c['offset'];var _0x15b200=_0x1538a4?_0x140511[_0x0a9e('0x2f')]:_0x14433c[_0x0a9e('0x2d')]+_0x14433c[_0x0a9e('0x30')];var _0x58b06f;if(_0x15b200>=_0x468813){_0x15b200=_0x468813;_0x58b06f=0xc8;}else{_0x58b06f=0xce;}_0x25fba9[_0x0a9e('0x2b')](_0x58b06f);return _0x25fba9[_0x0a9e('0x31')](_0x0a9e('0x32'),_0x2ec755+'-'+_0x15b200+'/'+_0x468813)[_0x0a9e('0x2c')](_0x140511);}return null;};}function patchUpdates(_0x540530){return function(_0x426950){try{jsonpatch['apply'](_0x426950,_0x540530,!![]);}catch(_0x2407f9){return BPromise[_0x0a9e('0x33')](_0x2407f9);}return _0x426950[_0x0a9e('0x34')]();};}function saveUpdates(_0x33bdb7,_0x25ce3a){return function(_0x5180f1){if(_0x5180f1){return _0x5180f1[_0x0a9e('0x35')](_0x33bdb7)[_0x0a9e('0x1d')](function(_0x40cb85){return _0x40cb85;});}return null;};}function removeEntity(_0x2da5c0,_0x2b45ea){return function(_0x409319){if(_0x409319){return _0x409319[_0x0a9e('0x36')]()[_0x0a9e('0x1d')](function(){_0x2da5c0['status'](0xcc)[_0x0a9e('0x2a')]();});}};}function handleEntityNotFound(_0x5e7238,_0x2cc7a0){return function(_0x14b13f){if(!_0x14b13f){_0x5e7238[_0x0a9e('0x29')](0x194);}return _0x14b13f;};}function handleError(_0x3f3d41,_0x567193){_0x567193=_0x567193||0x1f4;return function(_0x191e91){logger[_0x0a9e('0x24')](_0x191e91[_0x0a9e('0x37')]);if(_0x191e91[_0x0a9e('0x38')]){delete _0x191e91['name'];}_0x3f3d41['status'](_0x567193)[_0x0a9e('0x39')](_0x191e91);};}exports['index']=function(_0x24936a,_0x3d9717){var _0x381c37={},_0x1ef87a={},_0x4f41ae={'count':0x0,'rows':[]};var _0x31916f=_[_0x0a9e('0x3a')](db[_0x0a9e('0x3b')]['rawAttributes'],function(_0x1dbf74){return{'name':_0x1dbf74[_0x0a9e('0x3c')],'type':_0x1dbf74[_0x0a9e('0x3d')]['key']};});_0x1ef87a['model']=_[_0x0a9e('0x3a')](_0x31916f,_0x0a9e('0x38'));_0x1ef87a['query']=_[_0x0a9e('0x3e')](_0x24936a[_0x0a9e('0x3f')]);_0x1ef87a[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],_0x1ef87a['query']);_0x381c37[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],qs[_0x0a9e('0x43')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x43')]));_0x381c37['attributes']=_0x381c37[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x381c37[_0x0a9e('0x42')]:_0x1ef87a[_0x0a9e('0x45')];if(!_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x46')](_0x0a9e('0x47'))){_0x381c37[_0x0a9e('0x30')]=qs[_0x0a9e('0x30')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x30')]);_0x381c37[_0x0a9e('0x2d')]=qs[_0x0a9e('0x2d')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x2d')]);}_0x381c37['order']=qs['sort'](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x48')]);_0x381c37[_0x0a9e('0x49')]=qs[_0x0a9e('0x40')](_[_0x0a9e('0x4a')](_0x24936a[_0x0a9e('0x3f')],_0x1ef87a[_0x0a9e('0x40')]),_0x31916f);if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]){_0x381c37[_0x0a9e('0x49')]=_[_0x0a9e('0x4c')](_0x381c37[_0x0a9e('0x49')],{'$or':_['map'](_0x31916f,function(_0x117c99){if(_0x117c99[_0x0a9e('0x3d')]!==_0x0a9e('0x4d')){var _0xfbd5ad={};_0xfbd5ad[_0x117c99[_0x0a9e('0x38')]]={'$like':'%'+_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]+'%'};return _0xfbd5ad;}})});}_0x381c37=_[_0x0a9e('0x4c')]({},_0x381c37,_0x24936a['options']);var _0x2e9d90={'where':_0x381c37['where']};return db[_0x0a9e('0x3b')][_0x0a9e('0x2f')](_0x2e9d90)[_0x0a9e('0x1d')](function(_0x562fb4){_0x4f41ae[_0x0a9e('0x2f')]=_0x562fb4;if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4e')]){_0x381c37[_0x0a9e('0x4f')]=[{'all':!![]}];}return db[_0x0a9e('0x3b')][_0x0a9e('0x50')](_0x381c37);})[_0x0a9e('0x1d')](function(_0x5bbcde){_0x4f41ae[_0x0a9e('0x51')]=_0x5bbcde;return _0x4f41ae;})[_0x0a9e('0x1d')](respondWithFilteredResult(_0x3d9717,_0x381c37))[_0x0a9e('0x28')](handleError(_0x3d9717,null));};exports[_0x0a9e('0x52')]=function(_0x409789,_0x992c77){var _0x6054ee={'raw':!![],'where':{'id':_0x409789[_0x0a9e('0x53')]['id']}},_0x19383e={};_0x19383e['model']=_[_0x0a9e('0x3e')](db[_0x0a9e('0x3b')]['rawAttributes']);_0x19383e['query']=_['keys'](_0x409789[_0x0a9e('0x3f')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],_0x19383e[_0x0a9e('0x3f')]);_0x6054ee[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],qs['fields'](_0x409789['query']['fields']));_0x6054ee[_0x0a9e('0x42')]=_0x6054ee[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x6054ee['attributes']:_0x19383e[_0x0a9e('0x45')];if(_0x409789[_0x0a9e('0x3f')]['includeAll']){_0x6054ee['include']=[{'all':!![]}];}_0x6054ee=_[_0x0a9e('0x4c')]({},_0x6054ee,_0x409789['options']);return db[_0x0a9e('0x3b')]['find'](_0x6054ee)[_0x0a9e('0x1d')](handleEntityNotFound(_0x992c77,null))[_0x0a9e('0x1d')](respondWithResult(_0x992c77,null))[_0x0a9e('0x28')](handleError(_0x992c77,null));};exports['create']=function(_0x2f82da,_0x1bf38a){return db['ChatMessage']['create'](_0x2f82da[_0x0a9e('0x54')],{})[_0x0a9e('0x1d')](respondWithResult(_0x1bf38a,0xc9))['catch'](handleError(_0x1bf38a,null));};exports[_0x0a9e('0x35')]=function(_0x5ce9ac,_0x211ef9){if(_0x5ce9ac['body']['id']){delete _0x5ce9ac[_0x0a9e('0x54')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x5ce9ac['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x211ef9,null))['then'](saveUpdates(_0x5ce9ac[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](respondWithResult(_0x211ef9,null))[_0x0a9e('0x28')](handleError(_0x211ef9,null));};exports[_0x0a9e('0x36')]=function(_0x232830,_0x272738){return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x232830['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x272738,null))[_0x0a9e('0x1d')](removeEntity(_0x272738,null))[_0x0a9e('0x28')](handleError(_0x272738,null));};exports[_0x0a9e('0x56')]=function(_0xb83dfd,_0x156662){return db['ChatMessage'][_0x0a9e('0x56')]()[_0x0a9e('0x1d')](respondWithResult(_0x156662,null))['catch'](handleError(_0x156662,null));};var interaction_log=require(_0x0a9e('0x57'))('chat-interactions');exports[_0x0a9e('0x58')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee){var _0x273cb5={'agent':{},'channel':'chat'};if(_0x5ba1f9[_0x0a9e('0x54')]['id']){delete _0x5ba1f9[_0x0a9e('0x54')]['id'];}_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x59')]=!![];_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5a')]=moment()['format'](_0x0a9e('0x5b'));_0x5ba1f9['body'][_0x0a9e('0x5c')]=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')]||_0x5ba1f9['user']['id'];_0x273cb5[_0x0a9e('0x5d')]['id']=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')];return db[_0x0a9e('0x3b')]['find']({'where':{'id':_0x5ba1f9[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](saveUpdates(_0x5ba1f9[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](function(_0x88dcbf){if(_0x88dcbf){_0x273cb5[_0x0a9e('0x26')]=_0x88dcbf[_0x0a9e('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0x0a9e('0x55')]({'where':{'id':_0x88dcbf[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](function(_0x3528b7){if(_0x3528b7){return _0x3528b7['update']({'UserId':_0x5ba1f9['body'][_0x0a9e('0x5c')],'read1stAt':_[_0x0a9e('0x60')](_0x3528b7[_0x0a9e('0x61')])?moment()[_0x0a9e('0x62')](_0x0a9e('0x5b')):undefined});}return null;})[_0x0a9e('0x1d')](function(_0x387489){if(_0x387489){_0x273cb5[_0x0a9e('0x63')]=_0x387489[_0x0a9e('0x5e')]({'plain':!![]});interaction_log[_0x0a9e('0x1e')](_0x0a9e('0x64'),_0x5ba1f9[_0x0a9e('0x65')]['id'],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x66')],_0x273cb5[_0x0a9e('0x63')]['id'],_0x5ba1f9[_0x0a9e('0x54')]?JSON['stringify'](_0x5ba1f9[_0x0a9e('0x54')]):_0x0a9e('0x67'));return respondWithRpcPromise(_0x0a9e('0x68'),'acceptMessage',_0x273cb5);}return null;})[_0x0a9e('0x1d')](function(_0x30944e){var _0x4b341d=_0x0a9e('0x69')+_0x30944e[_0x0a9e('0x26')][_0x0a9e('0x6a')];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0x4b341d,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x0a9e('0x1d')](function(_0x18bf5d){return _0x18bf5d;});})[_0x0a9e('0x1d')](function(_0x23a7d3){if(_0x23a7d3){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x23a7d3[0x0];if(!_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),'fullname',_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})['then'](function(_0x2ed01e){if(!_0x2ed01e)return null;_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x2ed01e;return _0x273cb5;})[_0x0a9e('0x1d')](function(_0x542ece){if(_0x542ece){if(_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x6f')]){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x70')]=util['format'](_0x0a9e('0x71'),_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')]);_0x273cb5[_0x0a9e('0x26')]['channel']=_0x273cb5[_0x0a9e('0x72')];_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x58');return respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x75'),'message':_[_0x0a9e('0x4c')](_0x273cb5[_0x0a9e('0x26')],JSON[_0x0a9e('0x76')](_0x273cb5[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002)[_0x0a9e('0x1d')](function(){return _0x273cb5;});}return _0x273cb5;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x4b3c1a,null))['catch'](handleError(_0x4b3c1a,null));};var interaction_log=require(_0x0a9e('0x57'))(_0x0a9e('0x78'));exports[_0x0a9e('0x33')]=function(_0x563627,_0x3736e0,_0x33dda0){var _0x8cea96={'agent':{},'channel':_0x0a9e('0x79')};if(_0x563627['body']['id']){delete _0x563627['body']['id'];}_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')]=_0x563627['body'][_0x0a9e('0x5c')]||_0x563627['user']['id'];_0x8cea96[_0x0a9e('0x5d')]['id']=_0x563627[_0x0a9e('0x54')]['UserId'];return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))[_0x0a9e('0x1d')](function(_0x1f42a0){if(_0x1f42a0){_0x8cea96[_0x0a9e('0x26')]=_0x1f42a0['get']({'plain':!![]});return db[_0x0a9e('0x7a')][_0x0a9e('0x55')]({'where':{'id':_0x1f42a0[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))['then'](function(_0xf51744){if(_0xf51744){_0x8cea96[_0x0a9e('0x63')]=_0xf51744['get']({'plain':!![]});interaction_log[_0x0a9e('0x1e')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x563627[_0x0a9e('0x65')]['id'],_0x563627[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x563627[_0x0a9e('0x65')]['role'],_0x8cea96['interaction']['id'],_0x563627[_0x0a9e('0x54')]?JSON[_0x0a9e('0x23')](_0x563627[_0x0a9e('0x54')]):'null');return respondWithRpcPromise(_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x8cea96);}return null;})['then'](function(_0x4e46b2){var _0xf0a802='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4e46b2['message']['ContactId'];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0xf0a802,{'type':db[_0x0a9e('0x7d')][_0x0a9e('0x7e')][_0x0a9e('0x7f')],'raw':!![]})[_0x0a9e('0x1d')](function(_0x5a8854){return _0x5a8854;});})[_0x0a9e('0x1d')](function(_0x5955f1){if(_0x5955f1){_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x5955f1[0x0];if(!_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),_0x0a9e('0x80'),_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})[_0x0a9e('0x1d')](function(_0x1910bf){if(!_0x1910bf)return null;_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x1910bf;return _0x8cea96;})['then'](function(_0x2645d6){if(_0x2645d6){_0x2645d6[_0x0a9e('0x26')]['interface']=util[_0x0a9e('0x62')](_0x0a9e('0x71'),_0x563627[_0x0a9e('0x65')]['name']);_0x2645d6[_0x0a9e('0x26')]['channel']=_0x8cea96[_0x0a9e('0x72')];_0x2645d6[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x33');respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x81'),'message':_[_0x0a9e('0x4c')](_0x8cea96['message'],JSON[_0x0a9e('0x76')](_0x8cea96[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002);return _0x8cea96;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x3736e0,null))[_0x0a9e('0x28')](handleError(_0x3736e0,null));};
\ No newline at end of file
+var _0xa9e0=['interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','chat-interactions','chat','ChatInteraction','RejectMessage','rejectMessage','Sequelize','QueryTypes','SELECT','fullname','rejectmessage','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','map','ChatMessage','fieldName','type','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','body','find','describe','../../config/logger','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteractionId','isNil','read1stAt','format'];(function(_0x3da312,_0x391ccd){var _0x28fb08=function(_0x1792bf){while(--_0x1792bf){_0x3da312['push'](_0x3da312['shift']());}};_0x28fb08(++_0x391ccd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0x0a9e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5d0880,_0x1985b6,_0x519dfd,_0x16033c){return new BPromise(function(_0x12066b,_0x48f32d){var _0x225616=_0x16033c||client;return _0x225616['request'](_0x5d0880,_0x519dfd)[_0x0a9e('0x1d')](function(_0x478723){logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));logger[_0x0a9e('0x21')](_0x0a9e('0x22'),_0x1985b6,_0x0a9e('0x20'),JSON[_0x0a9e('0x23')](_0x478723));if(_0x478723[_0x0a9e('0x24')]){if(_0x478723[_0x0a9e('0x24')][_0x0a9e('0x25')]===0x1f4){logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')]['message']);return _0x48f32d(_0x478723[_0x0a9e('0x24')]['message']);}logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')][_0x0a9e('0x26')]);return _0x12066b(_0x478723[_0x0a9e('0x24')]['message']);}else{logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));_0x12066b(_0x478723[_0x0a9e('0x27')][_0x0a9e('0x26')]);}})[_0x0a9e('0x28')](function(_0x16b1ca){logger['error']('ChatMessage,\x20%s,\x20%s',_0x1985b6,_0x16b1ca);_0x48f32d(_0x16b1ca);});});}function respondWithStatusCode(_0x197ec0,_0x3a8e58){_0x3a8e58=_0x3a8e58||0xcc;return function(_0x40c424){if(_0x40c424){return _0x197ec0[_0x0a9e('0x29')](_0x3a8e58);}return _0x197ec0['status'](_0x3a8e58)[_0x0a9e('0x2a')]();};}function respondWithResult(_0x479bc4,_0x45a1e7){_0x45a1e7=_0x45a1e7||0xc8;return function(_0x5bfb33){if(_0x5bfb33){return _0x479bc4[_0x0a9e('0x2b')](_0x45a1e7)[_0x0a9e('0x2c')](_0x5bfb33);}};}function respondWithFilteredResult(_0x25fba9,_0x14433c){return function(_0x140511){if(_0x140511){var _0x1538a4=typeof _0x14433c[_0x0a9e('0x2d')]===_0x0a9e('0x2e')&&typeof _0x14433c['limit']===_0x0a9e('0x2e');var _0x468813=_0x140511[_0x0a9e('0x2f')];var _0x2ec755=_0x1538a4?0x0:_0x14433c['offset'];var _0x15b200=_0x1538a4?_0x140511[_0x0a9e('0x2f')]:_0x14433c[_0x0a9e('0x2d')]+_0x14433c[_0x0a9e('0x30')];var _0x58b06f;if(_0x15b200>=_0x468813){_0x15b200=_0x468813;_0x58b06f=0xc8;}else{_0x58b06f=0xce;}_0x25fba9[_0x0a9e('0x2b')](_0x58b06f);return _0x25fba9[_0x0a9e('0x31')](_0x0a9e('0x32'),_0x2ec755+'-'+_0x15b200+'/'+_0x468813)[_0x0a9e('0x2c')](_0x140511);}return null;};}function patchUpdates(_0x540530){return function(_0x426950){try{jsonpatch['apply'](_0x426950,_0x540530,!![]);}catch(_0x2407f9){return BPromise[_0x0a9e('0x33')](_0x2407f9);}return _0x426950[_0x0a9e('0x34')]();};}function saveUpdates(_0x33bdb7,_0x25ce3a){return function(_0x5180f1){if(_0x5180f1){return _0x5180f1[_0x0a9e('0x35')](_0x33bdb7)[_0x0a9e('0x1d')](function(_0x40cb85){return _0x40cb85;});}return null;};}function removeEntity(_0x2da5c0,_0x2b45ea){return function(_0x409319){if(_0x409319){return _0x409319[_0x0a9e('0x36')]()[_0x0a9e('0x1d')](function(){_0x2da5c0['status'](0xcc)[_0x0a9e('0x2a')]();});}};}function handleEntityNotFound(_0x5e7238,_0x2cc7a0){return function(_0x14b13f){if(!_0x14b13f){_0x5e7238[_0x0a9e('0x29')](0x194);}return _0x14b13f;};}function handleError(_0x3f3d41,_0x567193){_0x567193=_0x567193||0x1f4;return function(_0x191e91){logger[_0x0a9e('0x24')](_0x191e91[_0x0a9e('0x37')]);if(_0x191e91[_0x0a9e('0x38')]){delete _0x191e91['name'];}_0x3f3d41['status'](_0x567193)[_0x0a9e('0x39')](_0x191e91);};}exports['index']=function(_0x24936a,_0x3d9717){var _0x381c37={},_0x1ef87a={},_0x4f41ae={'count':0x0,'rows':[]};var _0x31916f=_[_0x0a9e('0x3a')](db[_0x0a9e('0x3b')]['rawAttributes'],function(_0x1dbf74){return{'name':_0x1dbf74[_0x0a9e('0x3c')],'type':_0x1dbf74[_0x0a9e('0x3d')]['key']};});_0x1ef87a['model']=_[_0x0a9e('0x3a')](_0x31916f,_0x0a9e('0x38'));_0x1ef87a['query']=_[_0x0a9e('0x3e')](_0x24936a[_0x0a9e('0x3f')]);_0x1ef87a[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],_0x1ef87a['query']);_0x381c37[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],qs[_0x0a9e('0x43')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x43')]));_0x381c37['attributes']=_0x381c37[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x381c37[_0x0a9e('0x42')]:_0x1ef87a[_0x0a9e('0x45')];if(!_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x46')](_0x0a9e('0x47'))){_0x381c37[_0x0a9e('0x30')]=qs[_0x0a9e('0x30')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x30')]);_0x381c37[_0x0a9e('0x2d')]=qs[_0x0a9e('0x2d')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x2d')]);}_0x381c37['order']=qs['sort'](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x48')]);_0x381c37[_0x0a9e('0x49')]=qs[_0x0a9e('0x40')](_[_0x0a9e('0x4a')](_0x24936a[_0x0a9e('0x3f')],_0x1ef87a[_0x0a9e('0x40')]),_0x31916f);if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]){_0x381c37[_0x0a9e('0x49')]=_[_0x0a9e('0x4c')](_0x381c37[_0x0a9e('0x49')],{'$or':_['map'](_0x31916f,function(_0x117c99){if(_0x117c99[_0x0a9e('0x3d')]!==_0x0a9e('0x4d')){var _0xfbd5ad={};_0xfbd5ad[_0x117c99[_0x0a9e('0x38')]]={'$like':'%'+_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]+'%'};return _0xfbd5ad;}})});}_0x381c37=_[_0x0a9e('0x4c')]({},_0x381c37,_0x24936a['options']);var _0x2e9d90={'where':_0x381c37['where']};return db[_0x0a9e('0x3b')][_0x0a9e('0x2f')](_0x2e9d90)[_0x0a9e('0x1d')](function(_0x562fb4){_0x4f41ae[_0x0a9e('0x2f')]=_0x562fb4;if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4e')]){_0x381c37[_0x0a9e('0x4f')]=[{'all':!![]}];}return db[_0x0a9e('0x3b')][_0x0a9e('0x50')](_0x381c37);})[_0x0a9e('0x1d')](function(_0x5bbcde){_0x4f41ae[_0x0a9e('0x51')]=_0x5bbcde;return _0x4f41ae;})[_0x0a9e('0x1d')](respondWithFilteredResult(_0x3d9717,_0x381c37))[_0x0a9e('0x28')](handleError(_0x3d9717,null));};exports[_0x0a9e('0x52')]=function(_0x409789,_0x992c77){var _0x6054ee={'raw':!![],'where':{'id':_0x409789[_0x0a9e('0x53')]['id']}},_0x19383e={};_0x19383e['model']=_[_0x0a9e('0x3e')](db[_0x0a9e('0x3b')]['rawAttributes']);_0x19383e['query']=_['keys'](_0x409789[_0x0a9e('0x3f')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],_0x19383e[_0x0a9e('0x3f')]);_0x6054ee[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],qs['fields'](_0x409789['query']['fields']));_0x6054ee[_0x0a9e('0x42')]=_0x6054ee[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x6054ee['attributes']:_0x19383e[_0x0a9e('0x45')];if(_0x409789[_0x0a9e('0x3f')]['includeAll']){_0x6054ee['include']=[{'all':!![]}];}_0x6054ee=_[_0x0a9e('0x4c')]({},_0x6054ee,_0x409789['options']);return db[_0x0a9e('0x3b')]['find'](_0x6054ee)[_0x0a9e('0x1d')](handleEntityNotFound(_0x992c77,null))[_0x0a9e('0x1d')](respondWithResult(_0x992c77,null))[_0x0a9e('0x28')](handleError(_0x992c77,null));};exports['create']=function(_0x2f82da,_0x1bf38a){return db['ChatMessage']['create'](_0x2f82da[_0x0a9e('0x54')],{})[_0x0a9e('0x1d')](respondWithResult(_0x1bf38a,0xc9))['catch'](handleError(_0x1bf38a,null));};exports[_0x0a9e('0x35')]=function(_0x5ce9ac,_0x211ef9){if(_0x5ce9ac['body']['id']){delete _0x5ce9ac[_0x0a9e('0x54')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x5ce9ac['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x211ef9,null))['then'](saveUpdates(_0x5ce9ac[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](respondWithResult(_0x211ef9,null))[_0x0a9e('0x28')](handleError(_0x211ef9,null));};exports[_0x0a9e('0x36')]=function(_0x232830,_0x272738){return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x232830['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x272738,null))[_0x0a9e('0x1d')](removeEntity(_0x272738,null))[_0x0a9e('0x28')](handleError(_0x272738,null));};exports[_0x0a9e('0x56')]=function(_0xb83dfd,_0x156662){return db['ChatMessage'][_0x0a9e('0x56')]()[_0x0a9e('0x1d')](respondWithResult(_0x156662,null))['catch'](handleError(_0x156662,null));};var interaction_log=require(_0x0a9e('0x57'))('chat-interactions');exports[_0x0a9e('0x58')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee){var _0x273cb5={'agent':{},'channel':'chat'};if(_0x5ba1f9[_0x0a9e('0x54')]['id']){delete _0x5ba1f9[_0x0a9e('0x54')]['id'];}_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x59')]=!![];_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5a')]=moment()['format'](_0x0a9e('0x5b'));_0x5ba1f9['body'][_0x0a9e('0x5c')]=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')]||_0x5ba1f9['user']['id'];_0x273cb5[_0x0a9e('0x5d')]['id']=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')];return db[_0x0a9e('0x3b')]['find']({'where':{'id':_0x5ba1f9[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](saveUpdates(_0x5ba1f9[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](function(_0x88dcbf){if(_0x88dcbf){_0x273cb5[_0x0a9e('0x26')]=_0x88dcbf[_0x0a9e('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0x0a9e('0x55')]({'where':{'id':_0x88dcbf[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](function(_0x3528b7){if(_0x3528b7){return _0x3528b7['update']({'UserId':_0x5ba1f9['body'][_0x0a9e('0x5c')],'read1stAt':_[_0x0a9e('0x60')](_0x3528b7[_0x0a9e('0x61')])?moment()[_0x0a9e('0x62')](_0x0a9e('0x5b')):undefined});}return null;})[_0x0a9e('0x1d')](function(_0x387489){if(_0x387489){_0x273cb5[_0x0a9e('0x63')]=_0x387489[_0x0a9e('0x5e')]({'plain':!![]});interaction_log[_0x0a9e('0x1e')](_0x0a9e('0x64'),_0x5ba1f9[_0x0a9e('0x65')]['id'],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x66')],_0x273cb5[_0x0a9e('0x63')]['id'],_0x5ba1f9[_0x0a9e('0x54')]?JSON['stringify'](_0x5ba1f9[_0x0a9e('0x54')]):_0x0a9e('0x67'));return respondWithRpcPromise(_0x0a9e('0x68'),'acceptMessage',_0x273cb5);}return null;})[_0x0a9e('0x1d')](function(_0x30944e){var _0x4b341d=_0x0a9e('0x69')+_0x30944e[_0x0a9e('0x26')][_0x0a9e('0x6a')];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0x4b341d,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x0a9e('0x1d')](function(_0x18bf5d){return _0x18bf5d;});})[_0x0a9e('0x1d')](function(_0x23a7d3){if(_0x23a7d3){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x23a7d3[0x0];if(!_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),'fullname',_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})['then'](function(_0x2ed01e){if(!_0x2ed01e)return null;_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x2ed01e;return _0x273cb5;})[_0x0a9e('0x1d')](function(_0x542ece){if(_0x542ece){if(_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x6f')]){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x70')]=util['format'](_0x0a9e('0x71'),_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')]);_0x273cb5[_0x0a9e('0x26')]['channel']=_0x273cb5[_0x0a9e('0x72')];_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x58');return respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x75'),'message':_[_0x0a9e('0x4c')](_0x273cb5[_0x0a9e('0x26')],JSON[_0x0a9e('0x76')](_0x273cb5[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002)[_0x0a9e('0x1d')](function(){return _0x273cb5;});}return _0x273cb5;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x4b3c1a,null))['catch'](handleError(_0x4b3c1a,null));};var interaction_log=require(_0x0a9e('0x57'))(_0x0a9e('0x78'));exports[_0x0a9e('0x33')]=function(_0x563627,_0x3736e0,_0x33dda0){var _0x8cea96={'agent':{},'channel':_0x0a9e('0x79')};if(_0x563627['body']['id']){delete _0x563627['body']['id'];}_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')]=_0x563627['body'][_0x0a9e('0x5c')]||_0x563627['user']['id'];_0x8cea96[_0x0a9e('0x5d')]['id']=_0x563627[_0x0a9e('0x54')]['UserId'];return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))[_0x0a9e('0x1d')](function(_0x1f42a0){if(_0x1f42a0){_0x8cea96[_0x0a9e('0x26')]=_0x1f42a0['get']({'plain':!![]});return db[_0x0a9e('0x7a')][_0x0a9e('0x55')]({'where':{'id':_0x1f42a0[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))['then'](function(_0xf51744){if(_0xf51744){_0x8cea96[_0x0a9e('0x63')]=_0xf51744['get']({'plain':!![]});interaction_log[_0x0a9e('0x1e')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x563627[_0x0a9e('0x65')]['id'],_0x563627[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x563627[_0x0a9e('0x65')]['role'],_0x8cea96['interaction']['id'],_0x563627[_0x0a9e('0x54')]?JSON[_0x0a9e('0x23')](_0x563627[_0x0a9e('0x54')]):'null');return respondWithRpcPromise(_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x8cea96);}return null;})['then'](function(_0x4e46b2){var _0xf0a802='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4e46b2['message']['ContactId'];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0xf0a802,{'type':db[_0x0a9e('0x7d')][_0x0a9e('0x7e')][_0x0a9e('0x7f')],'raw':!![]})[_0x0a9e('0x1d')](function(_0x5a8854){return _0x5a8854;});})[_0x0a9e('0x1d')](function(_0x5955f1){if(_0x5955f1){_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x5955f1[0x0];if(!_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),_0x0a9e('0x80'),_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})[_0x0a9e('0x1d')](function(_0x1910bf){if(!_0x1910bf)return null;_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x1910bf;return _0x8cea96;})['then'](function(_0x2645d6){if(_0x2645d6){_0x2645d6[_0x0a9e('0x26')]['interface']=util[_0x0a9e('0x62')](_0x0a9e('0x71'),_0x563627[_0x0a9e('0x65')]['name']);_0x2645d6[_0x0a9e('0x26')]['channel']=_0x8cea96[_0x0a9e('0x72')];_0x2645d6[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x33');respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x81'),'message':_[_0x0a9e('0x4c')](_0x8cea96['message'],JSON[_0x0a9e('0x76')](_0x8cea96[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002);return _0x8cea96;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x3736e0,null))[_0x0a9e('0x28')](handleError(_0x3736e0,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 7477e9e..73a5420 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 _0x1c11=['ChatMessage','setMaxListeners','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x119ffd,_0x15bd2f){var _0x264e2c=function(_0x5b978f){while(--_0x5b978f){_0x119ffd['push'](_0x119ffd['shift']());}};_0x264e2c(++_0x15bd2f);}(_0x1c11,0xbf));var _0x11c1=function(_0xce923d,_0x1e1168){_0xce923d=_0xce923d-0x0;var _0x10d7a5=_0x1c11[_0xce923d];return _0x10d7a5;};'use strict';var EventEmitter=require(_0x11c1('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x11c1('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x11c1('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x11c1('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3cbbd3){return function(_0x217438,_0x362aa5,_0x2f1537){ChatMessageEvents[_0x11c1('0x4')](_0x3cbbd3+':'+_0x217438['id'],_0x217438);ChatMessageEvents['emit'](_0x3cbbd3,_0x217438);_0x2f1537(null);};}for(var e in events){if(events[_0x11c1('0x5')](e)){var event=events[e];ChatMessage[_0x11c1('0x6')](e,emitEvent(event));}}module[_0x11c1('0x7')]=ChatMessageEvents;
\ No newline at end of file
+var _0xcd12=['exports','ChatMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x30f333,_0x1aeeea){var _0x479f1c=function(_0x306ad9){while(--_0x306ad9){_0x30f333['push'](_0x30f333['shift']());}};_0x479f1c(++_0x1aeeea);}(_0xcd12,0x169));var _0x2cd1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcd12[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var ChatMessage=require('../../mysqldb')['db'][_0x2cd1('0x0')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x2cd1('0x1')](0x0);var events={'afterCreate':_0x2cd1('0x2'),'afterUpdate':_0x2cd1('0x3'),'afterDestroy':_0x2cd1('0x4')};function emitEvent(_0x3d36ca){return function(_0x36fc3b,_0x4c516e,_0x5adeeb){ChatMessageEvents[_0x2cd1('0x5')](_0x3d36ca+':'+_0x36fc3b['id'],_0x36fc3b);ChatMessageEvents[_0x2cd1('0x5')](_0x3d36ca,_0x36fc3b);_0x5adeeb(null);};}for(var e in events){if(events[_0x2cd1('0x6')](e)){var event=events[e];ChatMessage[_0x2cd1('0x7')](e,emitEvent(event));}}module[_0x2cd1('0x8')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index cc880b8..cb1b961 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 _0xa8fc=['catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','define','ChatMessage','chat_messages','fti_chat_messages','body','models','get','direction','toLowerCase','out','secret','isNil','ChatInteraction','findOne','then','update','createdAt'];(function(_0x2fc113,_0x45ec6e){var _0x5144ce=function(_0x47fd29){while(--_0x47fd29){_0x2fc113['push'](_0x2fc113['shift']());}};_0x5144ce(++_0x45ec6e);}(_0xa8fc,0x144));var _0xca8f=function(_0x10cf4e,_0x3290e9){_0x10cf4e=_0x10cf4e-0x0;var _0x238609=_0xa8fc[_0x10cf4e];return _0x238609;};'use strict';var _=require(_0xca8f('0x0'));var util=require(_0xca8f('0x1'));var logger=require(_0xca8f('0x2'))(_0xca8f('0x3'));var moment=require(_0xca8f('0x4'));var BPromise=require(_0xca8f('0x5'));var rp=require(_0xca8f('0x6'));var fs=require('fs');var path=require(_0xca8f('0x7'));var rimraf=require(_0xca8f('0x8'));var config=require(_0xca8f('0x9'));var attributes=require(_0xca8f('0xa'));module['exports']=function(_0x412862,_0x2bef4e){return _0x412862[_0xca8f('0xb')](_0xca8f('0xc'),attributes,{'tableName':_0xca8f('0xd'),'paranoid':![],'indexes':[{'name':_0xca8f('0xe'),'fields':[_0xca8f('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x29f6bb,_0x5895a9,_0x40c26d){var _0xc5645d=_0x412862[_0xca8f('0x10')];var _0x5ac313=_0x29f6bb[_0xca8f('0x11')]({'plain':!![]});if(_0x5ac313[_0xca8f('0x12')][_0xca8f('0x13')]()==='in'||_0x5ac313[_0xca8f('0x12')][_0xca8f('0x13')]()===_0xca8f('0x14')&&!_0x5ac313[_0xca8f('0x15')]&&!_[_0xca8f('0x16')](_0x5ac313['UserId'])){_0xc5645d[_0xca8f('0x17')][_0xca8f('0x18')]({'where':{'id':_0x5ac313['ChatInteractionId']}})[_0xca8f('0x19')](function(_0x488d63){if(_0x488d63){_0x488d63[_0xca8f('0x1a')]({'lastMsgAt':_0x5ac313[_0xca8f('0x1b')],'lastMsgDirection':_0x5ac313[_0xca8f('0x12')]['toLowerCase']()});}})[_0xca8f('0x1c')](function(_0x514aec){console[_0xca8f('0x1d')](_0x514aec);});}_0x40c26d();}},'charset':_0xca8f('0x1e'),'collate':_0xca8f('0x1f')});};
\ No newline at end of file
+var _0xb5fc=['body','FULLTEXT','models','get','toLowerCase','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','direction','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages'];(function(_0x43f842,_0x130257){var _0x22b965=function(_0x53e057){while(--_0x53e057){_0x43f842['push'](_0x43f842['shift']());}};_0x22b965(++_0x130257);}(_0xb5fc,0x1e3));var _0xcb5f=function(_0x4a3513,_0x49a288){_0x4a3513=_0x4a3513-0x0;var _0x32fdcb=_0xb5fc[_0x4a3513];return _0x32fdcb;};'use strict';var _=require(_0xcb5f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xcb5f('0x1'));var moment=require(_0xcb5f('0x2'));var BPromise=require(_0xcb5f('0x3'));var rp=require(_0xcb5f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcb5f('0x5'));var config=require(_0xcb5f('0x6'));var attributes=require(_0xcb5f('0x7'));module[_0xcb5f('0x8')]=function(_0x366cf3,_0xc97300){return _0x366cf3[_0xcb5f('0x9')](_0xcb5f('0xa'),attributes,{'tableName':_0xcb5f('0xb'),'paranoid':![],'indexes':[{'name':_0xcb5f('0xc'),'fields':[_0xcb5f('0xd')],'type':_0xcb5f('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x247f26,_0xe4607,_0x332876){var _0x31bed4=_0x366cf3[_0xcb5f('0xf')];var _0x2bbee8=_0x247f26[_0xcb5f('0x10')]({'plain':!![]});if(_0x2bbee8['direction'][_0xcb5f('0x11')]()==='in'||_0x2bbee8['direction'][_0xcb5f('0x11')]()==='out'&&!_0x2bbee8[_0xcb5f('0x12')]&&!_[_0xcb5f('0x13')](_0x2bbee8[_0xcb5f('0x14')])){_0x31bed4[_0xcb5f('0x15')][_0xcb5f('0x16')]({'where':{'id':_0x2bbee8[_0xcb5f('0x17')]}})[_0xcb5f('0x18')](function(_0x544732){if(_0x544732){_0x544732[_0xcb5f('0x19')]({'lastMsgAt':_0x2bbee8['createdAt'],'lastMsgDirection':_0x2bbee8[_0xcb5f('0x1a')][_0xcb5f('0x11')]()});}})[_0xcb5f('0x1b')](function(_0x2ccee3){console[_0xcb5f('0x1c')](_0x2ccee3);});}_0x332876();}},'charset':_0xcb5f('0x1d'),'collate':_0xcb5f('0x1e')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 739d018..2d08975 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 _0x1e8f=['socket.io-emitter','register','request','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','ChatMessage,\x20%s,\x20%s','info','result','catch','CreateChatMessage','ChatMessage','body','options','then','debug','stringify','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost'];(function(_0x11d326,_0x3d48f6){var _0x304839=function(_0x352267){while(--_0x352267){_0x11d326['push'](_0x11d326['shift']());}};_0x304839(++_0x3d48f6);}(_0x1e8f,0x149));var _0xf1e8=function(_0x31fee1,_0x8d0b5){_0x31fee1=_0x31fee1-0x0;var _0x834e13=_0x1e8f[_0x31fee1];return _0x834e13;};'use strict';var _=require('lodash');var util=require(_0xf1e8('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf1e8('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf1e8('0x2'))['db'];var utils=require(_0xf1e8('0x3'));var logger=require(_0xf1e8('0x4'))(_0xf1e8('0x5'));var config=require(_0xf1e8('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf1e8('0x7')][_0xf1e8('0x8')]({'port':0x232a});config[_0xf1e8('0x9')]=_[_0xf1e8('0xa')](config[_0xf1e8('0x9')],{'host':_0xf1e8('0xb'),'port':0x18eb});var socket=require(_0xf1e8('0xc'))(new Redis(config[_0xf1e8('0x9')]));require('./chatMessage.socket')[_0xf1e8('0xd')](socket);function respondWithRpcPromise(_0x411f33,_0x1251b4,_0x2dfc0d){return new BPromise(function(_0x2b3ee4,_0x42f9fe){return client[_0xf1e8('0xe')](_0x411f33,_0x2dfc0d)['then'](function(_0x582529){logger['info']('ChatMessage,\x20%s,\x20%s',_0x1251b4,_0xf1e8('0xf'));logger['debug'](_0xf1e8('0x10'),_0x1251b4,_0xf1e8('0xf'),JSON['stringify'](_0x582529));if(_0x582529[_0xf1e8('0x11')]){if(_0x582529[_0xf1e8('0x11')][_0xf1e8('0x12')]===0x1f4){logger[_0xf1e8('0x11')]('ChatMessage,\x20%s,\x20%s',_0x1251b4,_0x582529[_0xf1e8('0x11')][_0xf1e8('0x13')]);return _0x42f9fe(_0x582529['error']['message']);}logger['error'](_0xf1e8('0x14'),_0x1251b4,_0x582529['error'][_0xf1e8('0x13')]);return _0x2b3ee4(_0x582529[_0xf1e8('0x11')][_0xf1e8('0x13')]);}else{logger[_0xf1e8('0x15')](_0xf1e8('0x14'),_0x1251b4,_0xf1e8('0xf'));_0x2b3ee4(_0x582529[_0xf1e8('0x16')][_0xf1e8('0x13')]);}})[_0xf1e8('0x17')](function(_0x27c3e4){logger[_0xf1e8('0x11')](_0xf1e8('0x14'),_0x1251b4,_0x27c3e4);_0x42f9fe(_0x27c3e4);});});}exports[_0xf1e8('0x18')]=function(_0x23051c){var _0x175a7b=this;return new Promise(function(_0x277943,_0x19c91a){return db[_0xf1e8('0x19')]['create'](_0x23051c[_0xf1e8('0x1a')],{'raw':_0x23051c[_0xf1e8('0x1b')]?_0x23051c[_0xf1e8('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0xf1e8('0x1c')](function(_0x2988b7){logger[_0xf1e8('0x15')]('CreateChatMessage',_0x23051c);logger[_0xf1e8('0x1d')]('CreateChatMessage',_0x23051c,JSON[_0xf1e8('0x1e')](_0x2988b7));_0x277943(_0x2988b7);})[_0xf1e8('0x17')](function(_0x2f149d){logger['error'](_0xf1e8('0x18'),_0x2f149d['message'],_0x23051c);_0x19c91a(_0x175a7b['error'](0x1f4,_0x2f149d[_0xf1e8('0x13')]));});});};
\ No newline at end of file
+var _0xfaf1=['register','then','debug','request\x20sent','error','ChatMessage,\x20%s,\x20%s','message','info','catch','CreateChatMessage','ChatMessage','create','body','options','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','redis','defaults','localhost','./chatMessage.socket'];(function(_0x4d2d63,_0x213bd3){var _0x5a9e05=function(_0x286f80){while(--_0x286f80){_0x4d2d63['push'](_0x4d2d63['shift']());}};_0x5a9e05(++_0x213bd3);}(_0xfaf1,0xd3));var _0x1faf=function(_0x2228a9,_0x396716){_0x2228a9=_0x2228a9-0x0;var _0x25de40=_0xfaf1[_0x2228a9];return _0x25de40;};'use strict';var _=require(_0x1faf('0x0'));var util=require(_0x1faf('0x1'));var moment=require(_0x1faf('0x2'));var BPromise=require(_0x1faf('0x3'));var rs=require(_0x1faf('0x4'));var fs=require('fs');var Redis=require(_0x1faf('0x5'));var db=require(_0x1faf('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x1faf('0x7'));var jayson=require(_0x1faf('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x1faf('0x9')]=_[_0x1faf('0xa')](config[_0x1faf('0x9')],{'host':_0x1faf('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1faf('0x9')]));require(_0x1faf('0xc'))[_0x1faf('0xd')](socket);function respondWithRpcPromise(_0x20fa9f,_0x9cefb5,_0x47c636){return new BPromise(function(_0x33295e,_0x1fe352){return client['request'](_0x20fa9f,_0x47c636)[_0x1faf('0xe')](function(_0x4a00ba){logger['info']('ChatMessage,\x20%s,\x20%s',_0x9cefb5,'request\x20sent');logger[_0x1faf('0xf')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x9cefb5,_0x1faf('0x10'),JSON['stringify'](_0x4a00ba));if(_0x4a00ba[_0x1faf('0x11')]){if(_0x4a00ba[_0x1faf('0x11')]['code']===0x1f4){logger[_0x1faf('0x11')](_0x1faf('0x12'),_0x9cefb5,_0x4a00ba[_0x1faf('0x11')][_0x1faf('0x13')]);return _0x1fe352(_0x4a00ba[_0x1faf('0x11')][_0x1faf('0x13')]);}logger[_0x1faf('0x11')](_0x1faf('0x12'),_0x9cefb5,_0x4a00ba[_0x1faf('0x11')][_0x1faf('0x13')]);return _0x33295e(_0x4a00ba[_0x1faf('0x11')][_0x1faf('0x13')]);}else{logger[_0x1faf('0x14')]('ChatMessage,\x20%s,\x20%s',_0x9cefb5,_0x1faf('0x10'));_0x33295e(_0x4a00ba['result'][_0x1faf('0x13')]);}})[_0x1faf('0x15')](function(_0x342610){logger['error'](_0x1faf('0x12'),_0x9cefb5,_0x342610);_0x1fe352(_0x342610);});});}exports[_0x1faf('0x16')]=function(_0x9932de){var _0x39b526=this;return new Promise(function(_0x1bdef0,_0x509f9e){return db[_0x1faf('0x17')][_0x1faf('0x18')](_0x9932de[_0x1faf('0x19')],{'raw':_0x9932de[_0x1faf('0x1a')]?_0x9932de['options']['raw']===undefined?!![]:![]:!![]})[_0x1faf('0xe')](function(_0x1e8144){logger[_0x1faf('0x14')](_0x1faf('0x16'),_0x9932de);logger[_0x1faf('0xf')](_0x1faf('0x16'),_0x9932de,JSON[_0x1faf('0x1b')](_0x1e8144));_0x1bdef0(_0x1e8144);})['catch'](function(_0x2fe35b){logger[_0x1faf('0x11')](_0x1faf('0x16'),_0x2fe35b['message'],_0x9932de);_0x509f9e(_0x39b526[_0x1faf('0x11')](0x1f4,_0x2fe35b[_0x1faf('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 7b6befe..ee11327 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 _0x8c52=['./chatMessage.events','remove','update','emit','removeListener','register','chatMessage:'];(function(_0x4dc46a,_0x47fbd7){var _0x29fbcb=function(_0xeb2ae1){while(--_0xeb2ae1){_0x4dc46a['push'](_0x4dc46a['shift']());}};_0x29fbcb(++_0x47fbd7);}(_0x8c52,0x7e));var _0x28c5=function(_0x3e961c,_0x5747e7){_0x3e961c=_0x3e961c-0x0;var _0x474f9c=_0x8c52[_0x3e961c];return _0x474f9c;};'use strict';var ChatMessageEvents=require(_0x28c5('0x0'));var events=['save',_0x28c5('0x1'),_0x28c5('0x2')];function createListener(_0x3d994a,_0x37c10f){return function(_0x398f22){_0x37c10f[_0x28c5('0x3')](_0x3d994a,_0x398f22);};}function removeListener(_0x412a0a,_0x3b6b48){return function(){ChatMessageEvents[_0x28c5('0x4')](_0x412a0a,_0x3b6b48);};}exports[_0x28c5('0x5')]=function(_0x209f3d){for(var _0x3b5c38=0x0,_0x53584d=events['length'];_0x3b5c38<_0x53584d;_0x3b5c38++){var _0x5d9299=events[_0x3b5c38];var _0x5099e8=createListener(_0x28c5('0x6')+_0x5d9299,_0x209f3d);ChatMessageEvents['on'](_0x5d9299,_0x5099e8);}};
\ No newline at end of file
+var _0x5577=['length','chatMessage:','./chatMessage.events','remove','update','emit','removeListener'];(function(_0x4250b3,_0x45209d){var _0x5e66a2=function(_0x14d123){while(--_0x14d123){_0x4250b3['push'](_0x4250b3['shift']());}};_0x5e66a2(++_0x45209d);}(_0x5577,0x1b4));var _0x7557=function(_0x5c61d3,_0x2ffe64){_0x5c61d3=_0x5c61d3-0x0;var _0x44d5cc=_0x5577[_0x5c61d3];return _0x44d5cc;};'use strict';var ChatMessageEvents=require(_0x7557('0x0'));var events=['save',_0x7557('0x1'),_0x7557('0x2')];function createListener(_0x52a8c6,_0x34636a){return function(_0x289758){_0x34636a[_0x7557('0x3')](_0x52a8c6,_0x289758);};}function removeListener(_0x3c4697,_0x1274d5){return function(){ChatMessageEvents[_0x7557('0x4')](_0x3c4697,_0x1274d5);};}exports['register']=function(_0x7bb8c){for(var _0x41a4a5=0x0,_0x3da895=events[_0x7557('0x5')];_0x41a4a5<_0x3da895;_0x41a4a5++){var _0x33e9aa=events[_0x41a4a5];var _0x37f335=createListener(_0x7557('0x6')+_0x33e9aa,_0x7bb8c);ChatMessageEvents['on'](_0x33e9aa,_0x37f335);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 51a4781..0819e4f 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 _0x75b7=['/:id','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','show','post','tracked','chat','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete'];(function(_0x3ef526,_0x2cb29d){var _0x257f66=function(_0x52f25f){while(--_0x52f25f){_0x3ef526['push'](_0x3ef526['shift']());}};_0x257f66(++_0x2cb29d);}(_0x75b7,0x1cc));var _0x775b=function(_0x5ae3e5,_0x4561e7){_0x5ae3e5=_0x5ae3e5-0x0;var _0x3c93c7=_0x75b7[_0x5ae3e5];return _0x3c93c7;};'use strict';var multer=require(_0x775b('0x0'));var util=require(_0x775b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x775b('0x2')]();var fs_extra=require(_0x775b('0x3'));var auth=require(_0x775b('0x4'));var interaction=require(_0x775b('0x5'));var config=require(_0x775b('0x6'));var controller=require(_0x775b('0x7'));router[_0x775b('0x8')]('/',auth[_0x775b('0x9')](),controller[_0x775b('0xa')]);router[_0x775b('0x8')](_0x775b('0xb'),auth['isAuthenticated'](),controller[_0x775b('0xc')]);router['get']('/:id',auth[_0x775b('0x9')](),controller[_0x775b('0xd')]);router[_0x775b('0xe')]('/',auth[_0x775b('0x9')](),interaction[_0x775b('0xf')](_0x775b('0x10'),_0x775b('0x11')),controller[_0x775b('0x12')]);router[_0x775b('0x13')]('/:id',controller[_0x775b('0x14')]);router[_0x775b('0x13')](_0x775b('0x15'),auth[_0x775b('0x9')](),controller[_0x775b('0x16')]);router['put'](_0x775b('0x17'),auth['isAuthenticated'](),controller[_0x775b('0x18')]);router[_0x775b('0x19')](_0x775b('0x1a'),auth[_0x775b('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x72ad=['chatmessage:create','put','update','/:id/reject','reject','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./chatMessage.controller','get','index','describe','/:id','isAuthenticated','post'];(function(_0x2be661,_0x50de17){var _0x2cce43=function(_0x4f694){while(--_0x4f694){_0x2be661['push'](_0x2be661['shift']());}};_0x2cce43(++_0x50de17);}(_0x72ad,0x1e6));var _0xd72a=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0x72ad[_0x2576d7];return _0x16a08c;};'use strict';var multer=require(_0xd72a('0x0'));var util=require('util');var path=require(_0xd72a('0x1'));var timeout=require(_0xd72a('0x2'));var express=require(_0xd72a('0x3'));var router=express[_0xd72a('0x4')]();var fs_extra=require(_0xd72a('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd72a('0x6'));var controller=require(_0xd72a('0x7'));router[_0xd72a('0x8')]('/',auth['isAuthenticated'](),controller[_0xd72a('0x9')]);router[_0xd72a('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xd72a('0xa')]);router[_0xd72a('0x8')](_0xd72a('0xb'),auth[_0xd72a('0xc')](),controller['show']);router[_0xd72a('0xd')]('/',auth['isAuthenticated'](),interaction['tracked']('chat',_0xd72a('0xe')),controller['create']);router[_0xd72a('0xf')](_0xd72a('0xb'),controller[_0xd72a('0x10')]);router[_0xd72a('0xf')]('/:id/accept',auth[_0xd72a('0xc')](),controller['accept']);router[_0xd72a('0xf')](_0xd72a('0x11'),auth[_0xd72a('0xc')](),controller[_0xd72a('0x12')]);router['delete'](_0xd72a('0xb'),auth[_0xd72a('0xc')](),controller[_0xd72a('0x13')]);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 cdd77a8..04901ac 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 _0xa192=['exports','TEXT'];(function(_0x2b0690,_0x4f742f){var _0x82be1=function(_0x1e1084){while(--_0x1e1084){_0x2b0690['push'](_0x2b0690['shift']());}};_0x82be1(++_0x4f742f);}(_0xa192,0x12e));var _0x2a19=function(_0x45b3ed,_0x192e1a){_0x45b3ed=_0x45b3ed-0x0;var _0x5502a5=_0xa192[_0x45b3ed];return _0x5502a5;};'use strict';var Sequelize=require('sequelize');module[_0x2a19('0x0')]={'body':{'type':Sequelize[_0x2a19('0x1')]('medium'),'allowNull':![]}};
\ No newline at end of file
+var _0x9d3a=['TEXT'];(function(_0x4350c2,_0x112f3c){var _0x8b6406=function(_0x49e845){while(--_0x49e845){_0x4350c2['push'](_0x4350c2['shift']());}};_0x8b6406(++_0x112f3c);}(_0x9d3a,0x9f));var _0xa9d3=function(_0x4c0b26,_0x4853ee){_0x4c0b26=_0x4c0b26-0x0;var _0x363dea=_0x9d3a[_0x4c0b26];return _0x363dea;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xa9d3('0x0')]('medium'),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index e87ea0f..3cedaa8 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(_0x35cad5,_0x36c77a){var _0x213ddc=function(_0x20dfac){while(--_0x20dfac){_0x35cad5['push'](_0x35cad5['shift']());}};_0x213ddc(++_0x36c77a);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'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(_0x5412cb,_0x29b1c4){var _0x3f916e=function(_0x3d1eaf){while(--_0x3d1eaf){_0x5412cb['push'](_0x5412cb['shift']());}};_0x3f916e(++_0x29b1c4);}(_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.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index a5799d8..5547d03 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 _0x8690=['request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','api','bluebird'];(function(_0xe609de,_0x1ef5fc){var _0x5aafbd=function(_0x2510c){while(--_0x2510c){_0xe609de['push'](_0xe609de['shift']());}};_0x5aafbd(++_0x1ef5fc);}(_0x8690,0x1df));var _0x0869=function(_0x334d1e,_0x28a488){_0x334d1e=_0x334d1e-0x0;var _0x3b33ba=_0x8690[_0x334d1e];return _0x3b33ba;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x0869('0x0'));var moment=require('moment');var BPromise=require(_0x0869('0x1'));var rp=require(_0x0869('0x2'));var fs=require('fs');var path=require(_0x0869('0x3'));var rimraf=require(_0x0869('0x4'));var config=require(_0x0869('0x5'));var attributes=require(_0x0869('0x6'));module[_0x0869('0x7')]=function(_0x174c88,_0x53fdb9){return _0x174c88[_0x0869('0x8')](_0x0869('0x9'),attributes,{'tableName':_0x0869('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0869('0xb'),'collate':_0x0869('0xc')});};
\ No newline at end of file
+var _0x0963=['define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','path','rimraf','./chatOfflineMessage.attributes','exports'];(function(_0x5a5395,_0x5361f6){var _0x4da43d=function(_0x149941){while(--_0x149941){_0x5a5395['push'](_0x5a5395['shift']());}};_0x4da43d(++_0x5361f6);}(_0x0963,0x10f));var _0x3096=function(_0x1ce4d1,_0xea0bcb){_0x1ce4d1=_0x1ce4d1-0x0;var _0x1b270e=_0x0963[_0x1ce4d1];return _0x1b270e;};'use strict';var _=require(_0x3096('0x0'));var util=require(_0x3096('0x1'));var logger=require('../../config/logger')(_0x3096('0x2'));var moment=require(_0x3096('0x3'));var BPromise=require(_0x3096('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3096('0x5'));var rimraf=require(_0x3096('0x6'));var config=require('../../config/environment');var attributes=require(_0x3096('0x7'));module[_0x3096('0x8')]=function(_0x5d6b09,_0xfcf8fa){return _0x5d6b09[_0x3096('0x9')](_0x3096('0xa'),attributes,{'tableName':_0x3096('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3096('0xc'),'collate':_0x3096('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 019700a..2cedebb 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 _0xf670=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','error','code','message','result'];(function(_0x221952,_0x55ec08){var _0x51e994=function(_0x323927){while(--_0x323927){_0x221952['push'](_0x221952['shift']());}};_0x51e994(++_0x55ec08);}(_0xf670,0x8d));var _0x0f67=function(_0x57643b,_0x1706fe){_0x57643b=_0x57643b-0x0;var _0x53a35b=_0xf670[_0x57643b];return _0x53a35b;};'use strict';var _=require('lodash');var util=require(_0x0f67('0x0'));var moment=require(_0x0f67('0x1'));var BPromise=require(_0x0f67('0x2'));var rs=require(_0x0f67('0x3'));var fs=require('fs');var Redis=require(_0x0f67('0x4'));var db=require(_0x0f67('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0f67('0x6'))(_0x0f67('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0f67('0x8')][_0x0f67('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xd6248b,_0x248449,_0x4fc325){return new BPromise(function(_0x5f2f5d,_0x369cf8){return client[_0x0f67('0xa')](_0xd6248b,_0x4fc325)[_0x0f67('0xb')](function(_0x41cf31){logger[_0x0f67('0xc')](_0x0f67('0xd'),_0x248449,_0x0f67('0xe'));logger['debug']('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x248449,_0x0f67('0xe'),JSON['stringify'](_0x41cf31));if(_0x41cf31[_0x0f67('0xf')]){if(_0x41cf31['error'][_0x0f67('0x10')]===0x1f4){logger['error'](_0x0f67('0xd'),_0x248449,_0x41cf31[_0x0f67('0xf')][_0x0f67('0x11')]);return _0x369cf8(_0x41cf31['error'][_0x0f67('0x11')]);}logger[_0x0f67('0xf')](_0x0f67('0xd'),_0x248449,_0x41cf31[_0x0f67('0xf')][_0x0f67('0x11')]);return _0x5f2f5d(_0x41cf31[_0x0f67('0xf')][_0x0f67('0x11')]);}else{logger[_0x0f67('0xc')]('ChatOfflineMessage,\x20%s,\x20%s',_0x248449,_0x0f67('0xe'));_0x5f2f5d(_0x41cf31[_0x0f67('0x12')][_0x0f67('0x11')]);}})[_0x0f67('0x13')](function(_0x4f4f9f){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x248449,_0x4f4f9f);_0x369cf8(_0x4f4f9f);});});}
\ No newline at end of file
+var _0x13c6=['ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','client','request','then','info'];(function(_0x385ac4,_0x9c7883){var _0x49a74c=function(_0x35762e){while(--_0x35762e){_0x385ac4['push'](_0x385ac4['shift']());}};_0x49a74c(++_0x9c7883);}(_0x13c6,0x94));var _0x613c=function(_0x458ffc,_0x1afbc5){_0x458ffc=_0x458ffc-0x0;var _0x56fc17=_0x13c6[_0x458ffc];return _0x56fc17;};'use strict';var _=require(_0x613c('0x0'));var util=require(_0x613c('0x1'));var moment=require(_0x613c('0x2'));var BPromise=require(_0x613c('0x3'));var rs=require(_0x613c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x613c('0x5'));var logger=require('../../config/logger')(_0x613c('0x6'));var config=require(_0x613c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x613c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x411bda,_0x266b12,_0x2d3865){return new BPromise(function(_0x2d99df,_0x3306ec){return client[_0x613c('0x9')](_0x411bda,_0x2d3865)[_0x613c('0xa')](function(_0x1dfa38){logger[_0x613c('0xb')](_0x613c('0xc'),_0x266b12,_0x613c('0xd'));logger[_0x613c('0xe')](_0x613c('0xf'),_0x266b12,'request\x20sent',JSON['stringify'](_0x1dfa38));if(_0x1dfa38['error']){if(_0x1dfa38[_0x613c('0x10')][_0x613c('0x11')]===0x1f4){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x266b12,_0x1dfa38[_0x613c('0x10')]['message']);return _0x3306ec(_0x1dfa38[_0x613c('0x10')][_0x613c('0x12')]);}logger[_0x613c('0x10')](_0x613c('0xc'),_0x266b12,_0x1dfa38[_0x613c('0x10')][_0x613c('0x12')]);return _0x2d99df(_0x1dfa38[_0x613c('0x10')][_0x613c('0x12')]);}else{logger['info'](_0x613c('0xc'),_0x266b12,_0x613c('0xd'));_0x2d99df(_0x1dfa38[_0x613c('0x13')][_0x613c('0x12')]);}})['catch'](function(_0x23e600){logger[_0x613c('0x10')](_0x613c('0xc'),_0x266b12,_0x23e600);_0x3306ec(_0x23e600);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 93de6ad..85fbb55 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 _0x7b9d=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','post','create','put','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x7b9d,0x119));var _0xd7b9=function(_0x592416,_0x2c75e9){_0x592416=_0x592416-0x0;var _0x3005fa=_0x7b9d[_0x592416];return _0x3005fa;};'use strict';var multer=require(_0xd7b9('0x0'));var util=require(_0xd7b9('0x1'));var path=require(_0xd7b9('0x2'));var timeout=require(_0xd7b9('0x3'));var express=require(_0xd7b9('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd7b9('0x5'));var interaction=require(_0xd7b9('0x6'));var config=require(_0xd7b9('0x7'));var controller=require('./chatOfflineMessage.controller');router[_0xd7b9('0x8')]('/',auth[_0xd7b9('0x9')](),controller['index']);router[_0xd7b9('0x8')](_0xd7b9('0xa'),auth[_0xd7b9('0x9')](),controller[_0xd7b9('0xb')]);router['get'](_0xd7b9('0xc'),auth[_0xd7b9('0x9')](),controller['show']);router[_0xd7b9('0xd')]('/',auth[_0xd7b9('0x9')](),controller[_0xd7b9('0xe')]);router[_0xd7b9('0xf')](_0xd7b9('0xc'),auth[_0xd7b9('0x9')](),controller[_0xd7b9('0x10')]);router[_0xd7b9('0x11')](_0xd7b9('0xc'),auth['isAuthenticated'](),controller[_0xd7b9('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0xb7ff=['multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','describe','show','post','put','/:id','update','delete','destroy','exports'];(function(_0x356107,_0x3bb13c){var _0x2f9d2b=function(_0x5279c4){while(--_0x5279c4){_0x356107['push'](_0x356107['shift']());}};_0x2f9d2b(++_0x3bb13c);}(_0xb7ff,0x1a4));var _0xfb7f=function(_0x465aab,_0x7d2a65){_0x465aab=_0x465aab-0x0;var _0x5e2500=_0xb7ff[_0x465aab];return _0x5e2500;};'use strict';var multer=require(_0xfb7f('0x0'));var util=require(_0xfb7f('0x1'));var path=require(_0xfb7f('0x2'));var timeout=require(_0xfb7f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xfb7f('0x4'));var interaction=require(_0xfb7f('0x5'));var config=require(_0xfb7f('0x6'));var controller=require('./chatOfflineMessage.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xfb7f('0x7')]);router[_0xfb7f('0x8')](_0xfb7f('0x9'),auth[_0xfb7f('0xa')](),controller[_0xfb7f('0xb')]);router[_0xfb7f('0x8')]('/:id',auth[_0xfb7f('0xa')](),controller[_0xfb7f('0xc')]);router[_0xfb7f('0xd')]('/',auth[_0xfb7f('0xa')](),controller['create']);router[_0xfb7f('0xe')](_0xfb7f('0xf'),auth['isAuthenticated'](),controller[_0xfb7f('0x10')]);router[_0xfb7f('0x11')](_0xfb7f('0xf'),auth[_0xfb7f('0xa')](),controller[_0xfb7f('0x12')]);module[_0xfb7f('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 95b1a2d..6b938de 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 _0x405e=['sequelize','exports','STRING','ENUM','mouseOver','timeout','INTEGER'];(function(_0x4afa89,_0x1b9ed3){var _0x151c58=function(_0x406491){while(--_0x406491){_0x4afa89['push'](_0x4afa89['shift']());}};_0x151c58(++_0x1b9ed3);}(_0x405e,0x111));var _0xe405=function(_0x2ebb5c,_0x5efe37){_0x2ebb5c=_0x2ebb5c-0x0;var _0x5d965f=_0x405e[_0x2ebb5c];return _0x5d965f;};'use strict';var Sequelize=require(_0xe405('0x0'));module[_0xe405('0x1')]={'name':{'type':Sequelize[_0xe405('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xe405('0x3')](_0xe405('0x4'),_0xe405('0x5')),'defaultValue':_0xe405('0x4')},'selector':{'type':Sequelize[_0xe405('0x2')]},'timeout':{'type':Sequelize[_0xe405('0x6')]}};
\ No newline at end of file
+var _0xed0d=['INTEGER','exports','STRING','ENUM','mouseOver'];(function(_0x4e317b,_0x46b419){var _0x103371=function(_0x8a800e){while(--_0x8a800e){_0x4e317b['push'](_0x4e317b['shift']());}};_0x103371(++_0x46b419);}(_0xed0d,0x92));var _0xded0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xed0d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xded0('0x0')]={'name':{'type':Sequelize[_0xded0('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xded0('0x2')](_0xded0('0x3'),'timeout'),'defaultValue':_0xded0('0x3')},'selector':{'type':Sequelize[_0xded0('0x1')]},'timeout':{'type':Sequelize[_0xded0('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 2b60135..7c0c750 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 _0xc0a4=['intersection','attributes','fields','length','includeAll','include','merge','options','find','create','body','catch','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','end','name','send','params','model','ChatProactiveAction','rawAttributes','query','keys','filters'];(function(_0x5ca04c,_0x27f8db){var _0x5e227e=function(_0x5d256e){while(--_0x5d256e){_0x5ca04c['push'](_0x5ca04c['shift']());}};_0x5e227e(++_0x27f8db);}(_0xc0a4,0x147));var _0x4c0a=function(_0x4a7cb9,_0x4e0fa2){_0x4a7cb9=_0x4a7cb9-0x0;var _0x4cde3b=_0xc0a4[_0x4a7cb9];return _0x4cde3b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4c0a('0x0'));var zipdir=require(_0x4c0a('0x1'));var jsonpatch=require(_0x4c0a('0x2'));var rp=require('request-promise');var moment=require(_0x4c0a('0x3'));var BPromise=require(_0x4c0a('0x4'));var Mustache=require(_0x4c0a('0x5'));var util=require(_0x4c0a('0x6'));var path=require(_0x4c0a('0x7'));var sox=require('sox');var csv=require(_0x4c0a('0x8'));var ejs=require(_0x4c0a('0x9'));var fs=require('fs');var fs_extra=require(_0x4c0a('0xa'));var _=require(_0x4c0a('0xb'));var squel=require(_0x4c0a('0xc'));var crypto=require(_0x4c0a('0xd'));var jsforce=require(_0x4c0a('0xe'));var deskjs=require(_0x4c0a('0xf'));var toCsv=require(_0x4c0a('0x8'));var querystring=require('querystring');var Papa=require(_0x4c0a('0x10'));var Redis=require(_0x4c0a('0x11'));var authService=require(_0x4c0a('0x12'));var qs=require(_0x4c0a('0x13'));var as=require(_0x4c0a('0x14'));var hardwareService=require(_0x4c0a('0x15'));var logger=require(_0x4c0a('0x16'))(_0x4c0a('0x17'));var utils=require(_0x4c0a('0x18'));var config=require(_0x4c0a('0x19'));var licenseUtil=require(_0x4c0a('0x1a'));var db=require(_0x4c0a('0x1b'))['db'];function respondWithStatusCode(_0x55b124,_0x1ff4d3){_0x1ff4d3=_0x1ff4d3||0xcc;return function(_0xef01ab){if(_0xef01ab){return _0x55b124[_0x4c0a('0x1c')](_0x1ff4d3);}return _0x55b124[_0x4c0a('0x1d')](_0x1ff4d3)['end']();};}function respondWithResult(_0x437513,_0x223c2a){_0x223c2a=_0x223c2a||0xc8;return function(_0x16d852){if(_0x16d852){return _0x437513[_0x4c0a('0x1d')](_0x223c2a)[_0x4c0a('0x1e')](_0x16d852);}};}function respondWithFilteredResult(_0x8055cc,_0x31e574){return function(_0xe6569b){if(_0xe6569b){var _0x22bc77=typeof _0x31e574[_0x4c0a('0x1f')]===_0x4c0a('0x20')&&typeof _0x31e574[_0x4c0a('0x21')]===_0x4c0a('0x20');var _0x1ebf5e=_0xe6569b[_0x4c0a('0x22')];var _0x7e7d4b=_0x22bc77?0x0:_0x31e574['offset'];var _0x251c7f=_0x22bc77?_0xe6569b['count']:_0x31e574[_0x4c0a('0x1f')]+_0x31e574[_0x4c0a('0x21')];var _0x324469;if(_0x251c7f>=_0x1ebf5e){_0x251c7f=_0x1ebf5e;_0x324469=0xc8;}else{_0x324469=0xce;}_0x8055cc[_0x4c0a('0x1d')](_0x324469);return _0x8055cc[_0x4c0a('0x23')]('Content-Range',_0x7e7d4b+'-'+_0x251c7f+'/'+_0x1ebf5e)[_0x4c0a('0x1e')](_0xe6569b);}return null;};}function patchUpdates(_0x5e7cf1){return function(_0x2cd240){try{jsonpatch[_0x4c0a('0x24')](_0x2cd240,_0x5e7cf1,!![]);}catch(_0x33a3c5){return BPromise[_0x4c0a('0x25')](_0x33a3c5);}return _0x2cd240['save']();};}function saveUpdates(_0x2fef66,_0x19705f){return function(_0x271e58){if(_0x271e58){return _0x271e58[_0x4c0a('0x26')](_0x2fef66)[_0x4c0a('0x27')](function(_0x2cbb8b){return _0x2cbb8b;});}return null;};}function removeEntity(_0x18019d,_0x5bd479){return function(_0x5116ee){if(_0x5116ee){return _0x5116ee[_0x4c0a('0x28')]()['then'](function(){_0x18019d[_0x4c0a('0x1d')](0xcc)[_0x4c0a('0x29')]();});}};}function handleEntityNotFound(_0x22a3ad,_0x319b6f){return function(_0x117ac7){if(!_0x117ac7){_0x22a3ad['sendStatus'](0x194);}return _0x117ac7;};}function handleError(_0x241e91,_0xf239ed){_0xf239ed=_0xf239ed||0x1f4;return function(_0x5b91e2){logger['error'](_0x5b91e2['stack']);if(_0x5b91e2[_0x4c0a('0x2a')]){delete _0x5b91e2['name'];}_0x241e91['status'](_0xf239ed)[_0x4c0a('0x2b')](_0x5b91e2);};}exports['show']=function(_0x23bee2,_0x25a139){var _0x167604={'raw':!![],'where':{'id':_0x23bee2[_0x4c0a('0x2c')]['id']}},_0x5baa4b={};_0x5baa4b[_0x4c0a('0x2d')]=_['keys'](db[_0x4c0a('0x2e')][_0x4c0a('0x2f')]);_0x5baa4b[_0x4c0a('0x30')]=_[_0x4c0a('0x31')](_0x23bee2['query']);_0x5baa4b[_0x4c0a('0x32')]=_[_0x4c0a('0x33')](_0x5baa4b['model'],_0x5baa4b[_0x4c0a('0x30')]);_0x167604[_0x4c0a('0x34')]=_[_0x4c0a('0x33')](_0x5baa4b[_0x4c0a('0x2d')],qs[_0x4c0a('0x35')](_0x23bee2[_0x4c0a('0x30')][_0x4c0a('0x35')]));_0x167604['attributes']=_0x167604[_0x4c0a('0x34')][_0x4c0a('0x36')]?_0x167604[_0x4c0a('0x34')]:_0x5baa4b[_0x4c0a('0x2d')];if(_0x23bee2[_0x4c0a('0x30')][_0x4c0a('0x37')]){_0x167604[_0x4c0a('0x38')]=[{'all':!![]}];}_0x167604=_[_0x4c0a('0x39')]({},_0x167604,_0x23bee2[_0x4c0a('0x3a')]);return db['ChatProactiveAction'][_0x4c0a('0x3b')](_0x167604)[_0x4c0a('0x27')](handleEntityNotFound(_0x25a139,null))['then'](respondWithResult(_0x25a139,null))['catch'](handleError(_0x25a139,null));};exports[_0x4c0a('0x3c')]=function(_0x48ed41,_0x484d0a){return db[_0x4c0a('0x2e')][_0x4c0a('0x3c')](_0x48ed41[_0x4c0a('0x3d')],{})[_0x4c0a('0x27')](respondWithResult(_0x484d0a,0xc9))[_0x4c0a('0x3e')](handleError(_0x484d0a,null));};exports['update']=function(_0x36bd3c,_0x44887f){if(_0x36bd3c[_0x4c0a('0x3d')]['id']){delete _0x36bd3c[_0x4c0a('0x3d')]['id'];}return db[_0x4c0a('0x2e')]['find']({'where':{'id':_0x36bd3c[_0x4c0a('0x2c')]['id']}})[_0x4c0a('0x27')](handleEntityNotFound(_0x44887f,null))['then'](saveUpdates(_0x36bd3c[_0x4c0a('0x3d')],null))[_0x4c0a('0x27')](respondWithResult(_0x44887f,null))[_0x4c0a('0x3e')](handleError(_0x44887f,null));};exports[_0x4c0a('0x28')]=function(_0xb03bce,_0x4aa44c){return db[_0x4c0a('0x2e')][_0x4c0a('0x3b')]({'where':{'id':_0xb03bce[_0x4c0a('0x2c')]['id']}})[_0x4c0a('0x27')](handleEntityNotFound(_0x4aa44c,null))['then'](removeEntity(_0x4aa44c,null))[_0x4c0a('0x3e')](handleError(_0x4aa44c,null));};
\ No newline at end of file
+var _0x5ed2=['status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','params','model','keys','rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','include','merge','options','ChatProactiveAction','find','catch','create','body','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end'];(function(_0x433439,_0x2483b5){var _0x4e8348=function(_0x1218d5){while(--_0x1218d5){_0x433439['push'](_0x433439['shift']());}};_0x4e8348(++_0x2483b5);}(_0x5ed2,0x114));var _0x25ed=function(_0x4b2693,_0x29f874){_0x4b2693=_0x4b2693-0x0;var _0x1957d7=_0x5ed2[_0x4b2693];return _0x1957d7;};'use strict';var emlformat=require(_0x25ed('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x25ed('0x1'));var jsonpatch=require(_0x25ed('0x2'));var rp=require('request-promise');var moment=require(_0x25ed('0x3'));var BPromise=require(_0x25ed('0x4'));var Mustache=require('mustache');var util=require(_0x25ed('0x5'));var path=require(_0x25ed('0x6'));var sox=require(_0x25ed('0x7'));var csv=require(_0x25ed('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x25ed('0x9'));var _=require(_0x25ed('0xa'));var squel=require(_0x25ed('0xb'));var crypto=require(_0x25ed('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x25ed('0xd'));var Redis=require(_0x25ed('0xe'));var authService=require(_0x25ed('0xf'));var qs=require(_0x25ed('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x25ed('0x11'));var logger=require(_0x25ed('0x12'))(_0x25ed('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x25ed('0x14'));var db=require(_0x25ed('0x15'))['db'];function respondWithStatusCode(_0x1530e0,_0x623120){_0x623120=_0x623120||0xcc;return function(_0x187a10){if(_0x187a10){return _0x1530e0[_0x25ed('0x16')](_0x623120);}return _0x1530e0['status'](_0x623120)[_0x25ed('0x17')]();};}function respondWithResult(_0xbdc943,_0x4730c5){_0x4730c5=_0x4730c5||0xc8;return function(_0x54c37c){if(_0x54c37c){return _0xbdc943[_0x25ed('0x18')](_0x4730c5)['json'](_0x54c37c);}};}function respondWithFilteredResult(_0x3e9b5e,_0x7244b7){return function(_0x43e295){if(_0x43e295){var _0x551342=typeof _0x7244b7[_0x25ed('0x19')]===_0x25ed('0x1a')&&typeof _0x7244b7[_0x25ed('0x1b')]===_0x25ed('0x1a');var _0x405667=_0x43e295[_0x25ed('0x1c')];var _0x576378=_0x551342?0x0:_0x7244b7[_0x25ed('0x19')];var _0x3a86ae=_0x551342?_0x43e295['count']:_0x7244b7[_0x25ed('0x19')]+_0x7244b7[_0x25ed('0x1b')];var _0x3ec467;if(_0x3a86ae>=_0x405667){_0x3a86ae=_0x405667;_0x3ec467=0xc8;}else{_0x3ec467=0xce;}_0x3e9b5e['status'](_0x3ec467);return _0x3e9b5e[_0x25ed('0x1d')](_0x25ed('0x1e'),_0x576378+'-'+_0x3a86ae+'/'+_0x405667)[_0x25ed('0x1f')](_0x43e295);}return null;};}function patchUpdates(_0x2fb6ba){return function(_0xc04e54){try{jsonpatch[_0x25ed('0x20')](_0xc04e54,_0x2fb6ba,!![]);}catch(_0x257d6d){return BPromise[_0x25ed('0x21')](_0x257d6d);}return _0xc04e54[_0x25ed('0x22')]();};}function saveUpdates(_0x3414ac,_0x3bc398){return function(_0x4a8135){if(_0x4a8135){return _0x4a8135[_0x25ed('0x23')](_0x3414ac)[_0x25ed('0x24')](function(_0x402010){return _0x402010;});}return null;};}function removeEntity(_0x453181,_0x1e33f1){return function(_0x5d72ed){if(_0x5d72ed){return _0x5d72ed[_0x25ed('0x25')]()[_0x25ed('0x24')](function(){_0x453181[_0x25ed('0x18')](0xcc)[_0x25ed('0x17')]();});}};}function handleEntityNotFound(_0x561288,_0x2f5d93){return function(_0x225916){if(!_0x225916){_0x561288[_0x25ed('0x16')](0x194);}return _0x225916;};}function handleError(_0x5cd61f,_0x524736){_0x524736=_0x524736||0x1f4;return function(_0x35b206){logger['error'](_0x35b206[_0x25ed('0x26')]);if(_0x35b206[_0x25ed('0x27')]){delete _0x35b206['name'];}_0x5cd61f[_0x25ed('0x18')](_0x524736)[_0x25ed('0x28')](_0x35b206);};}exports['show']=function(_0x26456f,_0x30b096){var _0x31bde0={'raw':!![],'where':{'id':_0x26456f[_0x25ed('0x29')]['id']}},_0x6f3d9={};_0x6f3d9[_0x25ed('0x2a')]=_[_0x25ed('0x2b')](db['ChatProactiveAction'][_0x25ed('0x2c')]);_0x6f3d9['query']=_[_0x25ed('0x2b')](_0x26456f[_0x25ed('0x2d')]);_0x6f3d9[_0x25ed('0x2e')]=_['intersection'](_0x6f3d9[_0x25ed('0x2a')],_0x6f3d9['query']);_0x31bde0[_0x25ed('0x2f')]=_[_0x25ed('0x30')](_0x6f3d9[_0x25ed('0x2a')],qs[_0x25ed('0x31')](_0x26456f['query'][_0x25ed('0x31')]));_0x31bde0[_0x25ed('0x2f')]=_0x31bde0[_0x25ed('0x2f')][_0x25ed('0x32')]?_0x31bde0[_0x25ed('0x2f')]:_0x6f3d9['model'];if(_0x26456f[_0x25ed('0x2d')][_0x25ed('0x33')]){_0x31bde0[_0x25ed('0x34')]=[{'all':!![]}];}_0x31bde0=_[_0x25ed('0x35')]({},_0x31bde0,_0x26456f[_0x25ed('0x36')]);return db[_0x25ed('0x37')][_0x25ed('0x38')](_0x31bde0)[_0x25ed('0x24')](handleEntityNotFound(_0x30b096,null))[_0x25ed('0x24')](respondWithResult(_0x30b096,null))[_0x25ed('0x39')](handleError(_0x30b096,null));};exports[_0x25ed('0x3a')]=function(_0x287b92,_0x57310c){return db[_0x25ed('0x37')]['create'](_0x287b92[_0x25ed('0x3b')],{})[_0x25ed('0x24')](respondWithResult(_0x57310c,0xc9))['catch'](handleError(_0x57310c,null));};exports[_0x25ed('0x23')]=function(_0x1fd0d7,_0x4639ff){if(_0x1fd0d7[_0x25ed('0x3b')]['id']){delete _0x1fd0d7[_0x25ed('0x3b')]['id'];}return db[_0x25ed('0x37')]['find']({'where':{'id':_0x1fd0d7[_0x25ed('0x29')]['id']}})['then'](handleEntityNotFound(_0x4639ff,null))[_0x25ed('0x24')](saveUpdates(_0x1fd0d7['body'],null))[_0x25ed('0x24')](respondWithResult(_0x4639ff,null))[_0x25ed('0x39')](handleError(_0x4639ff,null));};exports[_0x25ed('0x25')]=function(_0x4ce418,_0x403867){return db[_0x25ed('0x37')][_0x25ed('0x38')]({'where':{'id':_0x4ce418[_0x25ed('0x29')]['id']}})['then'](handleEntityNotFound(_0x403867,null))[_0x25ed('0x24')](removeEntity(_0x403867,null))[_0x25ed('0x39')](handleError(_0x403867,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 2363a15..9488d43 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 _0x4363=['ChatProactiveAction','chat_proactive_actions','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatProactiveAction.attributes'];(function(_0x37db95,_0x4f2cca){var _0x28070c=function(_0x5712b6){while(--_0x5712b6){_0x37db95['push'](_0x37db95['shift']());}};_0x28070c(++_0x4f2cca);}(_0x4363,0x18e));var _0x3436=function(_0x53c37a,_0x5b1dd4){_0x53c37a=_0x53c37a-0x0;var _0x283edf=_0x4363[_0x53c37a];return _0x283edf;};'use strict';var _=require(_0x3436('0x0'));var util=require('util');var logger=require(_0x3436('0x1'))(_0x3436('0x2'));var moment=require(_0x3436('0x3'));var BPromise=require(_0x3436('0x4'));var rp=require(_0x3436('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3436('0x6'));var config=require(_0x3436('0x7'));var attributes=require(_0x3436('0x8'));module['exports']=function(_0x58d084,_0x1a5ab2){return _0x58d084['define'](_0x3436('0x9'),attributes,{'tableName':_0x3436('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf012=['api','moment','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','define','chat_proactive_actions','lodash','util'];(function(_0x2c0529,_0x5ec1ca){var _0x3d990f=function(_0x2dc8f2){while(--_0x2dc8f2){_0x2c0529['push'](_0x2c0529['shift']());}};_0x3d990f(++_0x5ec1ca);}(_0xf012,0x82));var _0x2f01=function(_0x3c3d59,_0x369b04){_0x3c3d59=_0x3c3d59-0x0;var _0x25d467=_0xf012[_0x3c3d59];return _0x25d467;};'use strict';var _=require(_0x2f01('0x0'));var util=require(_0x2f01('0x1'));var logger=require('../../config/logger')(_0x2f01('0x2'));var moment=require(_0x2f01('0x3'));var BPromise=require('bluebird');var rp=require(_0x2f01('0x4'));var fs=require('fs');var path=require(_0x2f01('0x5'));var rimraf=require(_0x2f01('0x6'));var config=require(_0x2f01('0x7'));var attributes=require(_0x2f01('0x8'));module['exports']=function(_0x217128,_0x199060){return _0x217128[_0x2f01('0x9')]('ChatProactiveAction',attributes,{'tableName':_0x2f01('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 be05d8f..6ac1bf2 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 _0xc0d8=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x9996d7,_0x36a17b){var _0x3b0dca=function(_0x510c76){while(--_0x510c76){_0x9996d7['push'](_0x9996d7['shift']());}};_0x3b0dca(++_0x36a17b);}(_0xc0d8,0xa8));var _0x8c0d=function(_0x148670,_0x2b0db3){_0x148670=_0x148670-0x0;var _0x5f52f7=_0xc0d8[_0x148670];return _0x5f52f7;};'use strict';var _=require(_0x8c0d('0x0'));var util=require(_0x8c0d('0x1'));var moment=require(_0x8c0d('0x2'));var BPromise=require(_0x8c0d('0x3'));var rs=require(_0x8c0d('0x4'));var fs=require('fs');var Redis=require(_0x8c0d('0x5'));var db=require(_0x8c0d('0x6'))['db'];var utils=require(_0x8c0d('0x7'));var logger=require(_0x8c0d('0x8'))(_0x8c0d('0x9'));var config=require('../../config/environment');var jayson=require(_0x8c0d('0xa'));var client=jayson[_0x8c0d('0xb')][_0x8c0d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x273063,_0x3d3b26,_0x2ae784){return new BPromise(function(_0x34d5de,_0x4f85a8){return client[_0x8c0d('0xd')](_0x273063,_0x2ae784)[_0x8c0d('0xe')](function(_0x32b6a8){logger[_0x8c0d('0xf')](_0x8c0d('0x10'),_0x3d3b26,'request\x20sent');logger[_0x8c0d('0x11')](_0x8c0d('0x12'),_0x3d3b26,_0x8c0d('0x13'),JSON[_0x8c0d('0x14')](_0x32b6a8));if(_0x32b6a8[_0x8c0d('0x15')]){if(_0x32b6a8[_0x8c0d('0x15')][_0x8c0d('0x16')]===0x1f4){logger['error'](_0x8c0d('0x10'),_0x3d3b26,_0x32b6a8[_0x8c0d('0x15')][_0x8c0d('0x17')]);return _0x4f85a8(_0x32b6a8[_0x8c0d('0x15')][_0x8c0d('0x17')]);}logger['error'](_0x8c0d('0x10'),_0x3d3b26,_0x32b6a8[_0x8c0d('0x15')][_0x8c0d('0x17')]);return _0x34d5de(_0x32b6a8['error'][_0x8c0d('0x17')]);}else{logger[_0x8c0d('0xf')](_0x8c0d('0x10'),_0x3d3b26,_0x8c0d('0x13'));_0x34d5de(_0x32b6a8['result'][_0x8c0d('0x17')]);}})[_0x8c0d('0x18')](function(_0x1ded10){logger[_0x8c0d('0x15')]('ChatProactiveAction,\x20%s,\x20%s',_0x3d3b26,_0x1ded10);_0x4f85a8(_0x1ded10);});});}
\ No newline at end of file
+var _0xa9b2=['info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x43c8b8,_0x5e8934){var _0x413be3=function(_0x23969c){while(--_0x23969c){_0x43c8b8['push'](_0x43c8b8['shift']());}};_0x413be3(++_0x5e8934);}(_0xa9b2,0x1e5));var _0x2a9b=function(_0x314a8c,_0x1c2e8d){_0x314a8c=_0x314a8c-0x0;var _0x1d4607=_0xa9b2[_0x314a8c];return _0x1d4607;};'use strict';var _=require(_0x2a9b('0x0'));var util=require(_0x2a9b('0x1'));var moment=require(_0x2a9b('0x2'));var BPromise=require(_0x2a9b('0x3'));var rs=require(_0x2a9b('0x4'));var fs=require('fs');var Redis=require(_0x2a9b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2a9b('0x6'));var logger=require('../../config/logger')(_0x2a9b('0x7'));var config=require(_0x2a9b('0x8'));var jayson=require(_0x2a9b('0x9'));var client=jayson[_0x2a9b('0xa')][_0x2a9b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2dafb4,_0x20b12c,_0x53c156){return new BPromise(function(_0x577525,_0x3748a0){return client[_0x2a9b('0xc')](_0x2dafb4,_0x53c156)['then'](function(_0x4891d2){logger['info'](_0x2a9b('0xd'),_0x20b12c,_0x2a9b('0xe'));logger[_0x2a9b('0xf')](_0x2a9b('0x10'),_0x20b12c,_0x2a9b('0xe'),JSON[_0x2a9b('0x11')](_0x4891d2));if(_0x4891d2['error']){if(_0x4891d2[_0x2a9b('0x12')][_0x2a9b('0x13')]===0x1f4){logger[_0x2a9b('0x12')](_0x2a9b('0xd'),_0x20b12c,_0x4891d2[_0x2a9b('0x12')]['message']);return _0x3748a0(_0x4891d2[_0x2a9b('0x12')]['message']);}logger[_0x2a9b('0x12')](_0x2a9b('0xd'),_0x20b12c,_0x4891d2[_0x2a9b('0x12')][_0x2a9b('0x14')]);return _0x577525(_0x4891d2[_0x2a9b('0x12')][_0x2a9b('0x14')]);}else{logger[_0x2a9b('0x15')](_0x2a9b('0xd'),_0x20b12c,_0x2a9b('0xe'));_0x577525(_0x4891d2['result'][_0x2a9b('0x14')]);}})[_0x2a9b('0x16')](function(_0x53ce4b){logger[_0x2a9b('0x12')](_0x2a9b('0xd'),_0x20b12c,_0x53ce4b);_0x3748a0(_0x53ce4b);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index d93ed59..c2e600d 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 _0xfdbd=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','/:id','isAuthenticated'];(function(_0x1b698d,_0x1aae30){var _0x49042b=function(_0xae9203){while(--_0xae9203){_0x1b698d['push'](_0x1b698d['shift']());}};_0x49042b(++_0x1aae30);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x19159d,_0x3d05c8){_0x19159d=_0x19159d-0x0;var _0x35884a=_0xfdbd[_0x19159d];return _0x35884a;};'use strict';var multer=require(_0xdfdb('0x0'));var util=require(_0xdfdb('0x1'));var path=require(_0xdfdb('0x2'));var timeout=require(_0xdfdb('0x3'));var express=require(_0xdfdb('0x4'));var router=express[_0xdfdb('0x5')]();var fs_extra=require(_0xdfdb('0x6'));var auth=require(_0xdfdb('0x7'));var interaction=require(_0xdfdb('0x8'));var config=require('../../config/environment');var controller=require(_0xdfdb('0x9'));router['get'](_0xdfdb('0xa'),auth[_0xdfdb('0xb')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xdfdb('0xc')]);router[_0xdfdb('0xd')]('/:id',auth[_0xdfdb('0xb')](),controller[_0xdfdb('0xe')]);router[_0xdfdb('0xf')](_0xdfdb('0xa'),auth[_0xdfdb('0xb')](),controller[_0xdfdb('0x10')]);module[_0xdfdb('0x11')]=router;
\ No newline at end of file
+var _0x9c5a=['/:id','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','create','put','update'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x189afd,_0x41d640){_0x189afd=_0x189afd-0x0;var _0x33f028=_0x9c5a[_0x189afd];return _0x33f028;};'use strict';var multer=require(_0xa9c5('0x0'));var util=require(_0xa9c5('0x1'));var path=require('path');var timeout=require(_0xa9c5('0x2'));var express=require(_0xa9c5('0x3'));var router=express[_0xa9c5('0x4')]();var fs_extra=require(_0xa9c5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa9c5('0x6'));var config=require(_0xa9c5('0x7'));var controller=require('./chatProactiveAction.controller');router[_0xa9c5('0x8')]('/:id',auth[_0xa9c5('0x9')](),controller[_0xa9c5('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa9c5('0xb')]);router[_0xa9c5('0xc')]('/:id',auth[_0xa9c5('0x9')](),controller[_0xa9c5('0xd')]);router['delete'](_0xa9c5('0xe'),auth[_0xa9c5('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index d603629..057f286 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 _0x1324=['INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','STRING','name'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0x1324,0x9d));var _0x4132=function(_0x5a6f32,_0x55b359){_0x5a6f32=_0x5a6f32-0x0;var _0x512785=_0x1324[_0x5a6f32];return _0x512785;};'use strict';var Sequelize=require(_0x4132('0x0'));module['exports']={'name':{'type':Sequelize[_0x4132('0x1')],'unique':_0x4132('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4132('0x1')]},'timeout':{'type':Sequelize[_0x4132('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4132('0x4')](_0x4132('0x5'),_0x4132('0x6'),_0x4132('0x7'))}};
\ No newline at end of file
+var _0xbe4c=['INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','STRING'];(function(_0x5f0f7a,_0x244c53){var _0x8742e7=function(_0x48ff6e){while(--_0x48ff6e){_0x5f0f7a['push'](_0x5f0f7a['shift']());}};_0x8742e7(++_0x244c53);}(_0xbe4c,0x1e8));var _0xcbe4=function(_0x27dd62,_0x4cc168){_0x27dd62=_0x27dd62-0x0;var _0x3a2a72=_0xbe4c[_0x27dd62];return _0x3a2a72;};'use strict';var Sequelize=require(_0xcbe4('0x0'));module['exports']={'name':{'type':Sequelize[_0xcbe4('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xcbe4('0x1')]},'timeout':{'type':Sequelize[_0xcbe4('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xcbe4('0x3')](_0xcbe4('0x4'),_0xcbe4('0x5'),_0xcbe4('0x6'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 70cc93a..25ec7a3 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 _0x43f2=['request-promise','moment','bluebird','mustache','path','sox','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatQueue.socket','register','client','http','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','ChatQueues','UserProfileResource','end','stack','name','index','map','ChatQueue','fieldName','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge','type','options','includeAll','include','findAll','rows','params','keys','rawAttributes','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','body','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','order','pick','ChatQueueId','findAndCountAll','UserId','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','User','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','userChatQueue:remove','addAgents','omit','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x40ebff,_0x1dd15e){var _0x40122a=function(_0xae6174){while(--_0xae6174){_0x40ebff['push'](_0x40ebff['shift']());}};_0x40122a(++_0x1dd15e);}(_0x43f2,0x97));var _0x243f=function(_0x5aecfb,_0x4a149d){_0x5aecfb=_0x5aecfb-0x0;var _0x34b827=_0x43f2[_0x5aecfb];return _0x34b827;};'use strict';var emlformat=require(_0x243f('0x0'));var rimraf=require(_0x243f('0x1'));var zipdir=require(_0x243f('0x2'));var jsonpatch=require(_0x243f('0x3'));var rp=require(_0x243f('0x4'));var moment=require(_0x243f('0x5'));var BPromise=require(_0x243f('0x6'));var Mustache=require(_0x243f('0x7'));var util=require('util');var path=require(_0x243f('0x8'));var sox=require(_0x243f('0x9'));var csv=require('to-csv');var ejs=require(_0x243f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x243f('0xb'));var crypto=require(_0x243f('0xc'));var jsforce=require(_0x243f('0xd'));var deskjs=require(_0x243f('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x243f('0xf'));var Redis=require('ioredis');var authService=require(_0x243f('0x10'));var qs=require(_0x243f('0x11'));var as=require(_0x243f('0x12'));var hardwareService=require(_0x243f('0x13'));var logger=require(_0x243f('0x14'))(_0x243f('0x15'));var utils=require(_0x243f('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x243f('0x17'));var db=require(_0x243f('0x18'))['db'];config[_0x243f('0x19')]=_[_0x243f('0x1a')](config[_0x243f('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x243f('0x1b'))(new Redis(config[_0x243f('0x19')]));require(_0x243f('0x1c'))[_0x243f('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x243f('0x1e')][_0x243f('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0xce6dc6,_0x545782,_0x20b5fb,_0x55f3f0){return new BPromise(function(_0x408f22,_0x22a92c){var _0x5de166=_0x55f3f0||client;return _0x5de166['request'](_0xce6dc6,_0x20b5fb)['then'](function(_0x1a115f){logger[_0x243f('0x20')](_0x243f('0x21'),_0x545782,'request\x20sent');logger[_0x243f('0x22')](_0x243f('0x23'),_0x545782,_0x243f('0x24'),JSON[_0x243f('0x25')](_0x1a115f));if(_0x1a115f[_0x243f('0x26')]){if(_0x1a115f[_0x243f('0x26')][_0x243f('0x27')]===0x1f4){logger[_0x243f('0x26')]('ChatQueue,\x20%s,\x20%s',_0x545782,_0x1a115f[_0x243f('0x26')]['message']);return _0x22a92c(_0x1a115f[_0x243f('0x26')][_0x243f('0x28')]);}logger[_0x243f('0x26')](_0x243f('0x21'),_0x545782,_0x1a115f[_0x243f('0x26')]['message']);return _0x408f22(_0x1a115f[_0x243f('0x26')][_0x243f('0x28')]);}else{logger[_0x243f('0x20')]('ChatQueue,\x20%s,\x20%s',_0x545782,_0x243f('0x24'));_0x408f22(_0x1a115f[_0x243f('0x29')]['message']);}})[_0x243f('0x2a')](function(_0x19c4a1){logger[_0x243f('0x26')](_0x243f('0x21'),_0x545782,_0x19c4a1);_0x22a92c(_0x19c4a1);});});}function respondWithStatusCode(_0x776b3,_0x548ac0){_0x548ac0=_0x548ac0||0xcc;return function(_0x3bb3de){if(_0x3bb3de){return _0x776b3[_0x243f('0x2b')](_0x548ac0);}return _0x776b3[_0x243f('0x2c')](_0x548ac0)['end']();};}function respondWithResult(_0x305be2,_0x543c57){_0x543c57=_0x543c57||0xc8;return function(_0x19cb67){if(_0x19cb67){return _0x305be2[_0x243f('0x2c')](_0x543c57)[_0x243f('0x2d')](_0x19cb67);}};}function respondWithFilteredResult(_0x2c6aa1,_0x1c889f){return function(_0x4754e1){if(_0x4754e1){var _0x436ade=typeof _0x1c889f['offset']===_0x243f('0x2e')&&typeof _0x1c889f[_0x243f('0x2f')]==='undefined';var _0x4ddd69=_0x4754e1[_0x243f('0x30')];var _0x380146=_0x436ade?0x0:_0x1c889f['offset'];var _0xc43768=_0x436ade?_0x4754e1['count']:_0x1c889f[_0x243f('0x31')]+_0x1c889f[_0x243f('0x2f')];var _0x4bcc98;if(_0xc43768>=_0x4ddd69){_0xc43768=_0x4ddd69;_0x4bcc98=0xc8;}else{_0x4bcc98=0xce;}_0x2c6aa1[_0x243f('0x2c')](_0x4bcc98);return _0x2c6aa1['set'](_0x243f('0x32'),_0x380146+'-'+_0xc43768+'/'+_0x4ddd69)[_0x243f('0x2d')](_0x4754e1);}return null;};}function patchUpdates(_0x124cdc){return function(_0x5c923b){try{jsonpatch[_0x243f('0x33')](_0x5c923b,_0x124cdc,!![]);}catch(_0x162cb2){return BPromise[_0x243f('0x34')](_0x162cb2);}return _0x5c923b[_0x243f('0x35')]();};}function saveUpdates(_0x480d7b,_0x1d3a11){return function(_0x1ee370){if(_0x1ee370){return _0x1ee370[_0x243f('0x36')](_0x480d7b)[_0x243f('0x37')](function(_0x5a1b14){return _0x5a1b14;});}return null;};}function removeEntity(_0x199405,_0x38fe37){return function(_0x1f1f95){if(_0x1f1f95){return _0x1f1f95[_0x243f('0x38')]()['then'](function(){var _0x24b21c=_0x1f1f95['get']({'plain':!![]});var _0x499312=_0x243f('0x39');return db[_0x243f('0x3a')][_0x243f('0x38')]({'where':{'type':_0x499312,'resourceId':_0x24b21c['id']}})[_0x243f('0x37')](function(){return _0x1f1f95;});})['then'](function(){_0x199405['status'](0xcc)[_0x243f('0x3b')]();});}};}function handleEntityNotFound(_0x5856f5,_0x43a848){return function(_0x179f66){if(!_0x179f66){_0x5856f5[_0x243f('0x2b')](0x194);}return _0x179f66;};}function handleError(_0x31f6f5,_0x8eaee0){_0x8eaee0=_0x8eaee0||0x1f4;return function(_0x4be4ad){logger[_0x243f('0x26')](_0x4be4ad[_0x243f('0x3c')]);if(_0x4be4ad[_0x243f('0x3d')]){delete _0x4be4ad[_0x243f('0x3d')];}_0x31f6f5[_0x243f('0x2c')](_0x8eaee0)['send'](_0x4be4ad);};}exports[_0x243f('0x3e')]=function(_0x53985c,_0x4ad269){var _0x4038fd={},_0xd4130a={},_0x517359={'count':0x0,'rows':[]};var _0x2221e3=_[_0x243f('0x3f')](db[_0x243f('0x40')]['rawAttributes'],function(_0x272887){return{'name':_0x272887[_0x243f('0x41')],'type':_0x272887['type'][_0x243f('0x42')]};});_0xd4130a[_0x243f('0x43')]=_['map'](_0x2221e3,_0x243f('0x3d'));_0xd4130a[_0x243f('0x44')]=_['keys'](_0x53985c['query']);_0xd4130a[_0x243f('0x45')]=_[_0x243f('0x46')](_0xd4130a[_0x243f('0x43')],_0xd4130a['query']);_0x4038fd[_0x243f('0x47')]=_['intersection'](_0xd4130a[_0x243f('0x43')],qs[_0x243f('0x48')](_0x53985c['query']['fields']));_0x4038fd[_0x243f('0x47')]=_0x4038fd['attributes'][_0x243f('0x49')]?_0x4038fd[_0x243f('0x47')]:_0xd4130a['model'];if(!_0x53985c['query']['hasOwnProperty'](_0x243f('0x4a'))){_0x4038fd[_0x243f('0x2f')]=qs['limit'](_0x53985c['query'][_0x243f('0x2f')]);_0x4038fd['offset']=qs['offset'](_0x53985c[_0x243f('0x44')]['offset']);}_0x4038fd['order']=qs[_0x243f('0x4b')](_0x53985c[_0x243f('0x44')][_0x243f('0x4b')]);_0x4038fd[_0x243f('0x4c')]=qs['filters'](_['pick'](_0x53985c['query'],_0xd4130a[_0x243f('0x45')]),_0x2221e3);if(_0x53985c['query'][_0x243f('0x4d')]){_0x4038fd[_0x243f('0x4c')]=_[_0x243f('0x4e')](_0x4038fd[_0x243f('0x4c')],{'$or':_[_0x243f('0x3f')](_0x2221e3,function(_0x591466){if(_0x591466[_0x243f('0x4f')]!=='VIRTUAL'){var _0x1ce528={};_0x1ce528[_0x591466['name']]={'$like':'%'+_0x53985c[_0x243f('0x44')][_0x243f('0x4d')]+'%'};return _0x1ce528;}})});}_0x4038fd=_[_0x243f('0x4e')]({},_0x4038fd,_0x53985c[_0x243f('0x50')]);var _0x414d6e={'where':_0x4038fd['where']};return db[_0x243f('0x40')][_0x243f('0x30')](_0x414d6e)[_0x243f('0x37')](function(_0x408023){_0x517359[_0x243f('0x30')]=_0x408023;if(_0x53985c[_0x243f('0x44')][_0x243f('0x51')]){_0x4038fd[_0x243f('0x52')]=[{'all':!![]}];}return db[_0x243f('0x40')][_0x243f('0x53')](_0x4038fd);})[_0x243f('0x37')](function(_0x3ad657){_0x517359[_0x243f('0x54')]=_0x3ad657;return _0x517359;})['then'](respondWithFilteredResult(_0x4ad269,_0x4038fd))['catch'](handleError(_0x4ad269,null));};exports['show']=function(_0x371c55,_0x42d122){var _0x37a288={'raw':!![],'where':{'id':_0x371c55[_0x243f('0x55')]['id']}},_0x4afcc3={};_0x4afcc3[_0x243f('0x43')]=_[_0x243f('0x56')](db[_0x243f('0x40')][_0x243f('0x57')]);_0x4afcc3[_0x243f('0x44')]=_['keys'](_0x371c55[_0x243f('0x44')]);_0x4afcc3[_0x243f('0x45')]=_[_0x243f('0x46')](_0x4afcc3[_0x243f('0x43')],_0x4afcc3[_0x243f('0x44')]);_0x37a288[_0x243f('0x47')]=_[_0x243f('0x46')](_0x4afcc3[_0x243f('0x43')],qs[_0x243f('0x48')](_0x371c55[_0x243f('0x44')][_0x243f('0x48')]));_0x37a288[_0x243f('0x47')]=_0x37a288[_0x243f('0x47')]['length']?_0x37a288[_0x243f('0x47')]:_0x4afcc3['model'];if(_0x371c55['query'][_0x243f('0x51')]){_0x37a288[_0x243f('0x52')]=[{'all':!![]}];}_0x37a288=_[_0x243f('0x4e')]({},_0x37a288,_0x371c55[_0x243f('0x50')]);return db['ChatQueue'][_0x243f('0x58')](_0x37a288)[_0x243f('0x37')](handleEntityNotFound(_0x42d122,null))[_0x243f('0x37')](respondWithResult(_0x42d122,null))[_0x243f('0x2a')](handleError(_0x42d122,null));};exports[_0x243f('0x59')]=function(_0x13a02e,_0x38a588){return db['ChatQueue'][_0x243f('0x59')](_0x13a02e['body'],{})['then'](function(_0xb05f7f){var _0x16c148=_0x13a02e[_0x243f('0x5a')][_0x243f('0x5b')]({'plain':!![]});if(!_0x16c148)throw new Error(_0x243f('0x5c'));if(_0x16c148[_0x243f('0x5d')]===_0x243f('0x5a')){var _0x5e8b90=_0xb05f7f[_0x243f('0x5b')]({'plain':!![]});var _0x17f49d=_0x243f('0x39');return db[_0x243f('0x5e')][_0x243f('0x58')]({'where':{'name':_0x17f49d,'userProfileId':_0x16c148[_0x243f('0x5f')]},'raw':!![]})[_0x243f('0x37')](function(_0xc829b3){if(_0xc829b3&&_0xc829b3[_0x243f('0x60')]===0x0){return db['UserProfileResource'][_0x243f('0x59')]({'name':_0x5e8b90[_0x243f('0x3d')],'resourceId':_0x5e8b90['id'],'type':_0xc829b3[_0x243f('0x3d')],'sectionId':_0xc829b3['id']},{})[_0x243f('0x37')](function(){return _0xb05f7f;});}else{return _0xb05f7f;}})[_0x243f('0x2a')](function(_0x152f30){logger[_0x243f('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x152f30);throw _0x152f30;});}return _0xb05f7f;})[_0x243f('0x37')](respondWithResult(_0x38a588,0xc9))[_0x243f('0x2a')](handleError(_0x38a588,null));};exports[_0x243f('0x36')]=function(_0x5383f2,_0x5b1873){if(_0x5383f2[_0x243f('0x61')]['id']){delete _0x5383f2[_0x243f('0x61')]['id'];}return db[_0x243f('0x40')][_0x243f('0x58')]({'where':{'id':_0x5383f2['params']['id']}})[_0x243f('0x37')](handleEntityNotFound(_0x5b1873,null))[_0x243f('0x37')](saveUpdates(_0x5383f2['body'],null))[_0x243f('0x37')](respondWithResult(_0x5b1873,null))[_0x243f('0x2a')](handleError(_0x5b1873,null));};exports[_0x243f('0x38')]=function(_0x4ac4db,_0x1b7a67){return db['ChatQueue']['find']({'where':{'id':_0x4ac4db[_0x243f('0x55')]['id']}})[_0x243f('0x37')](handleEntityNotFound(_0x1b7a67,null))['then'](removeEntity(_0x1b7a67,null))[_0x243f('0x2a')](handleError(_0x1b7a67,null));};exports[_0x243f('0x62')]=function(_0x45d7dc,_0x6f1b59){return db['ChatQueue'][_0x243f('0x62')]()['then'](respondWithResult(_0x6f1b59,null))[_0x243f('0x2a')](handleError(_0x6f1b59,null));};exports[_0x243f('0x63')]=function(_0x56ad7d,_0x3421ef,_0x312e63){var _0xfc36e5={'raw':!![],'where':{}},_0x2221ec={},_0x2764e3;return db['ChatQueue'][_0x243f('0x64')]({'where':{'id':_0x56ad7d[_0x243f('0x55')]['id']}})[_0x243f('0x37')](handleEntityNotFound(_0x3421ef,null))[_0x243f('0x37')](function(_0x54fca3){if(_0x54fca3){_0x2764e3=_0x54fca3['get']({'plain':!![]});_0x2221ec['model']=_[_0x243f('0x56')](db[_0x243f('0x65')][_0x243f('0x57')]);_0x2221ec[_0x243f('0x44')]=_[_0x243f('0x56')](_0x56ad7d[_0x243f('0x44')]);_0x2221ec[_0x243f('0x45')]=_[_0x243f('0x46')](_0x2221ec['model'],_0x2221ec['query']);_0xfc36e5[_0x243f('0x47')]=_[_0x243f('0x46')](_0x2221ec[_0x243f('0x43')],qs['fields'](_0x56ad7d[_0x243f('0x44')]['fields']));_0xfc36e5[_0x243f('0x47')]=_0xfc36e5[_0x243f('0x47')][_0x243f('0x49')]?_0xfc36e5[_0x243f('0x47')]:_0x2221ec['model'];if(!_0x56ad7d[_0x243f('0x44')][_0x243f('0x66')](_0x243f('0x4a'))){_0xfc36e5[_0x243f('0x2f')]=qs[_0x243f('0x2f')](_0x56ad7d[_0x243f('0x44')]['limit']);_0xfc36e5['offset']=qs[_0x243f('0x31')](_0x56ad7d[_0x243f('0x44')][_0x243f('0x31')]);}_0xfc36e5[_0x243f('0x67')]=qs[_0x243f('0x4b')](_0x56ad7d['query'][_0x243f('0x4b')]);_0xfc36e5[_0x243f('0x4c')]=qs[_0x243f('0x45')](_[_0x243f('0x68')](_0x56ad7d['query'],_0x2221ec[_0x243f('0x45')]));_0xfc36e5[_0x243f('0x4c')][_0x243f('0x69')]=_0x54fca3['id'];if(_0x56ad7d[_0x243f('0x44')][_0x243f('0x4d')]){_0xfc36e5[_0x243f('0x4c')]=_[_0x243f('0x4e')](_0xfc36e5['where'],{'$or':_[_0x243f('0x3f')](_0xfc36e5['attributes'],function(_0x53948e){var _0x4610df={};_0x4610df[_0x53948e]={'$like':'%'+_0x56ad7d['query']['filter']+'%'};return _0x4610df;})});}_0xfc36e5=_[_0x243f('0x4e')]({},_0xfc36e5,_0x56ad7d[_0x243f('0x50')]);return db[_0x243f('0x65')]['findAll'](_0xfc36e5);}})['then'](function(_0x47d078){if(_0x47d078){return db['User'][_0x243f('0x6a')]({'where':{'id':_[_0x243f('0x3f')](_0x47d078,_0x243f('0x6b')),'role':'agent'},'attributes':['id',_0x243f('0x3d'),'chatPause',_0x243f('0x6c'),_0x243f('0x6d')]});}})['then'](function(_0x419c39){if(_0x419c39){return{'count':_0x419c39[_0x243f('0x30')],'rows':_['map'](_0x419c39[_0x243f('0x54')],function(_0x55acbc){return{'membername':_0x55acbc['name'],'UserId':_0x55acbc['id'],'queue_name':_0x2764e3[_0x243f('0x3d')],'ChatQueueId':_0x2764e3['id'],'interface':util[_0x243f('0x6e')](_0x243f('0x6f'),_0x243f('0x70'),_0x55acbc[_0x243f('0x3d')]),'penalty':0x0,'paused':_0x55acbc['chatPause'],'createdAt':_0x55acbc[_0x243f('0x6d')],'updatedAt':_0x55acbc[_0x243f('0x6c')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3421ef,_0xfc36e5))[_0x243f('0x2a')](handleError(_0x3421ef,null));};exports[_0x243f('0x71')]=function(_0x825b5f,_0x268be6,_0x330501){var _0x566a56={};var _0x4fcf5f={};var _0xf7520e;var _0x1d4841;return db[_0x243f('0x40')][_0x243f('0x64')]({'where':{'id':_0x825b5f[_0x243f('0x55')]['id']}})[_0x243f('0x37')](handleEntityNotFound(_0x268be6,null))[_0x243f('0x37')](function(_0x264188){if(_0x264188){_0xf7520e=_0x264188;_0x4fcf5f['model']=_[_0x243f('0x56')](db[_0x243f('0x72')]['rawAttributes']);_0x4fcf5f[_0x243f('0x44')]=_['keys'](_0x825b5f[_0x243f('0x44')]);_0x4fcf5f[_0x243f('0x45')]=_[_0x243f('0x46')](_0x4fcf5f[_0x243f('0x43')],_0x4fcf5f[_0x243f('0x44')]);_0x566a56['attributes']=_[_0x243f('0x46')](_0x4fcf5f['model'],qs['fields'](_0x825b5f[_0x243f('0x44')][_0x243f('0x48')]));_0x566a56['attributes']=_0x566a56[_0x243f('0x47')]['length']?_0x566a56[_0x243f('0x47')]:_0x4fcf5f['model'];_0x566a56[_0x243f('0x67')]=qs[_0x243f('0x4b')](_0x825b5f['query'][_0x243f('0x4b')]);_0x566a56[_0x243f('0x4c')]=qs[_0x243f('0x45')](_[_0x243f('0x68')](_0x825b5f[_0x243f('0x44')],_0x4fcf5f[_0x243f('0x45')]));if(_0x825b5f[_0x243f('0x44')]['filter']){_0x566a56['where']=_[_0x243f('0x4e')](_0x566a56[_0x243f('0x4c')],{'$or':_[_0x243f('0x3f')](_0x566a56[_0x243f('0x47')],function(_0x23f59b){var _0x38bfd9={};_0x38bfd9[_0x23f59b]={'$like':'%'+_0x825b5f[_0x243f('0x44')][_0x243f('0x4d')]+'%'};return _0x38bfd9;})});}_0x566a56=_[_0x243f('0x4e')]({},_0x566a56,_0x825b5f['options']);return _0xf7520e[_0x243f('0x71')](_0x566a56);}})['then'](function(_0x54bdd2){if(_0x54bdd2){_0x1d4841=_0x54bdd2['length'];if(!_0x825b5f[_0x243f('0x44')][_0x243f('0x66')](_0x243f('0x4a'))){_0x566a56[_0x243f('0x2f')]=qs[_0x243f('0x2f')](_0x825b5f[_0x243f('0x44')]['limit']);_0x566a56['offset']=qs['offset'](_0x825b5f[_0x243f('0x44')]['offset']);}return _0xf7520e[_0x243f('0x71')](_0x566a56);}})['then'](function(_0x185534){if(_0x185534){return _0x185534?{'count':_0x1d4841,'rows':_0x185534}:null;}})[_0x243f('0x37')](respondWithResult(_0x268be6,null))[_0x243f('0x2a')](handleError(_0x268be6,null));};exports[_0x243f('0x73')]=function(_0x573645,_0x346899,_0x4748b6){var _0x495cbd=_0x573645[_0x243f('0x61')][_0x243f('0x74')];return db[_0x243f('0x72')]['findAll']({'where':{'id':_0x495cbd},'attributes':['id'],'include':[{'model':db[_0x243f('0x75')],'as':'Agents','attributes':['id',_0x243f('0x3d'),_0x243f('0x76'),_0x243f('0x77'),_0x243f('0x78')],'raw':!![]}]})[_0x243f('0x37')](function(_0x206a3e){if(_0x206a3e){var _0xd02535=_[_0x243f('0x79')](_0x206a3e,function(_0x3eb9a9){var _0x4bf5be=_0x3eb9a9[_0x243f('0x5b')]({'plain':!![]});return _0x4bf5be[_0x243f('0x7a')];});return db['ChatQueue'][_0x243f('0x58')]({'where':{'id':_0x573645[_0x243f('0x55')]['id']}})[_0x243f('0x37')](function(_0xda7872){return db[_0x243f('0x7b')][_0x243f('0x7c')](function(_0x3fff63){return _0xda7872['addTeams'](_0x495cbd,{'transaction':_0x3fff63})['then'](function(){return BPromise[_0x243f('0x7d')](_0xd02535,function(_0x80a2d9){return db['UserChatQueue'][_0x243f('0x7e')]({'where':{'UserId':_0x80a2d9['id'],'ChatQueueId':_0x573645[_0x243f('0x55')]['id']},'transaction':_0x3fff63});});})[_0x243f('0x37')](function(){_0xd02535[_0x243f('0x7f')](function(_0x46b827){socket[_0x243f('0x80')](_0x243f('0x81'),{'UserId':_0x46b827['id'],'ChatQueueId':_0xda7872['id']});});});});});}})[_0x243f('0x37')](respondWithStatusCode(_0x346899,null))[_0x243f('0x2a')](handleError(_0x346899,null));};exports[_0x243f('0x82')]=function(_0x5c02cd,_0x162f8d,_0x49942f){return db['Team'][_0x243f('0x53')]({'where':{'id':_0x5c02cd['query'][_0x243f('0x74')]},'attributes':['id'],'include':[{'model':db[_0x243f('0x75')],'as':_0x243f('0x7a'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x162f8d,null))['then'](function(_0x54e46b){var _0x86f2cc=_[_0x243f('0x3f')](_0x54e46b,'id');var _0x184235=[];var _0x383120=[];var _0x556155=squel[_0x243f('0x83')]();_0x556155[_0x243f('0x84')](_0x243f('0x85'))['from'](_0x243f('0x86'),'tq')[_0x243f('0x87')](_0x243f('0x88'),'ut',_0x243f('0x89'))['where']('ChatQueueId\x20=\x20?',_0x5c02cd[_0x243f('0x55')]['id']);for(var _0x5bb5ed=0x0;_0x5bb5ed<_0x54e46b[_0x243f('0x49')];_0x5bb5ed+=0x1){let _0x13e070=_0x54e46b[_0x5bb5ed];for(var _0x443147=0x0;_0x443147<_0x13e070[_0x243f('0x7a')][_0x243f('0x49')];_0x443147+=0x1){let _0x3e117b=_0x13e070['Agents'][_0x443147];var _0x51d2b5=_0x556155['clone']();_0x51d2b5[_0x243f('0x4c')]('ut.UserId\x20=\x20?',_0x3e117b['id']);_0x383120['push'](db['sequelize']['query'](_0x51d2b5[_0x243f('0x8a')](),{'type':db[_0x243f('0x7b')][_0x243f('0x8b')][_0x243f('0x8c')]})[_0x243f('0x37')](function(_0x38ce34){if(_0x38ce34[_0x243f('0x49')]===0x1){return _0x3e117b['id'];}else{var _0x394ff8=_[_0x243f('0x8d')](_['map'](_0x38ce34,_0x243f('0x8e')),function(_0x31709e){return _[_0x243f('0x8f')](_0x86f2cc,_0x31709e);});if(_0x394ff8){return _0x3e117b['id'];}}}));}}return BPromise[_0x243f('0x90')](_0x383120)[_0x243f('0x37')](function(_0x305cf8){_0x184235=_(_0x184235)[_0x243f('0x91')](_0x305cf8)[_0x243f('0x92')]()[_0x243f('0x93')]();return db[_0x243f('0x40')][_0x243f('0x58')]({'where':{'id':_0x5c02cd['params']['id']}})[_0x243f('0x37')](function(_0x2e4599){return db['sequelize']['transaction'](function(_0x16a592){return _0x2e4599['removeTeams'](_0x5c02cd['query'][_0x243f('0x74')],{'transaction':_0x16a592})[_0x243f('0x37')](function(){if(!_[_0x243f('0x94')](_0x184235)){return _0x2e4599['removeAgents'](_0x184235,{'transaction':_0x16a592});}})[_0x243f('0x37')](function(){_0x184235['forEach'](function(_0x1eb1c1){socket[_0x243f('0x80')](_0x243f('0x95'),{'UserId':_0x1eb1c1,'ChatQueueId':_0x2e4599['id']});});});});});});})[_0x243f('0x37')](respondWithStatusCode(_0x162f8d,null))[_0x243f('0x2a')](handleError(_0x162f8d,null));};exports[_0x243f('0x96')]=function(_0x30b216,_0x2e9f4a,_0x1c3ec8){return db[_0x243f('0x40')][_0x243f('0x58')]({'where':{'id':_0x30b216['params']['id']}})['then'](handleEntityNotFound(_0x2e9f4a,null))[_0x243f('0x37')](function(_0x244cd5){if(_0x244cd5){return _0x244cd5['addAgents'](_0x30b216['body'][_0x243f('0x74')],_[_0x243f('0x97')](_0x30b216[_0x243f('0x61')],['ids','id'])||{})['spread'](function(_0x58c738){for(var _0x13c11c=0x0;_0x13c11c<_0x30b216[_0x243f('0x61')][_0x243f('0x74')][_0x243f('0x49')];_0x13c11c+=0x1){socket[_0x243f('0x80')](_0x243f('0x81'),{'UserId':Number(_0x30b216[_0x243f('0x61')]['ids'][_0x13c11c]),'ChatQueueId':Number(_0x30b216['params']['id'])});}return _0x58c738;});}})['then'](respondWithResult(_0x2e9f4a,null))[_0x243f('0x2a')](handleError(_0x2e9f4a,null));};exports[_0x243f('0x98')]=function(_0x4305b6,_0x167eaa,_0x1031bd){return db['ChatQueue'][_0x243f('0x58')]({'where':{'id':_0x4305b6[_0x243f('0x55')]['id']}})[_0x243f('0x37')](handleEntityNotFound(_0x167eaa,null))[_0x243f('0x37')](function(_0x3d0439){if(_0x3d0439){return _0x3d0439[_0x243f('0x98')](_0x4305b6[_0x243f('0x44')]['ids'])['then'](function(){if(_[_0x243f('0x99')](_0x4305b6[_0x243f('0x44')][_0x243f('0x74')])){for(var _0x706e34=0x0;_0x706e34<_0x4305b6[_0x243f('0x44')][_0x243f('0x74')]['length'];_0x706e34+=0x1){socket[_0x243f('0x80')](_0x243f('0x95'),{'UserId':Number(_0x4305b6[_0x243f('0x44')][_0x243f('0x74')][_0x706e34]),'ChatQueueId':Number(_0x4305b6[_0x243f('0x55')]['id'])});}}else{socket[_0x243f('0x80')](_0x243f('0x95'),{'UserId':Number(_0x4305b6['query']['ids']),'ChatQueueId':Number(_0x4305b6[_0x243f('0x55')]['id'])});}});}})['then'](respondWithStatusCode(_0x167eaa,null))[_0x243f('0x2a')](handleError(_0x167eaa,null));};exports['getAgents']=function(_0x432d62,_0x2778bb,_0x3ca30d){var _0x5753eb={};var _0x1b289c={};var _0x51f830;var _0x1c76ce;return db[_0x243f('0x40')][_0x243f('0x64')]({'where':{'id':_0x432d62[_0x243f('0x55')]['id']}})[_0x243f('0x37')](handleEntityNotFound(_0x2778bb,null))[_0x243f('0x37')](function(_0x4c5e7e){if(_0x4c5e7e){_0x51f830=_0x4c5e7e;_0x1b289c[_0x243f('0x43')]=_[_0x243f('0x56')](db[_0x243f('0x75')]['rawAttributes']);_0x1b289c['query']=_[_0x243f('0x56')](_0x432d62[_0x243f('0x44')]);_0x1b289c[_0x243f('0x45')]=_['intersection'](_0x1b289c[_0x243f('0x43')],_0x1b289c[_0x243f('0x44')]);_0x5753eb[_0x243f('0x47')]=_['intersection'](_0x1b289c[_0x243f('0x43')],qs[_0x243f('0x48')](_0x432d62[_0x243f('0x44')][_0x243f('0x48')]));_0x5753eb[_0x243f('0x47')]=_0x5753eb[_0x243f('0x47')]['length']?_0x5753eb['attributes']:_0x1b289c['model'];_0x5753eb[_0x243f('0x67')]=qs[_0x243f('0x4b')](_0x432d62[_0x243f('0x44')][_0x243f('0x4b')]);_0x5753eb[_0x243f('0x4c')]=qs[_0x243f('0x45')](_[_0x243f('0x68')](_0x432d62[_0x243f('0x44')],_0x1b289c[_0x243f('0x45')]));if(_0x432d62[_0x243f('0x44')][_0x243f('0x4d')]){_0x5753eb[_0x243f('0x4c')]=_[_0x243f('0x4e')](_0x5753eb['where'],{'$or':_[_0x243f('0x3f')](_0x5753eb[_0x243f('0x47')],function(_0x2f0737){var _0x5330ca={};_0x5330ca[_0x2f0737]={'$like':'%'+_0x432d62[_0x243f('0x44')][_0x243f('0x4d')]+'%'};return _0x5330ca;})});}_0x5753eb=_[_0x243f('0x4e')]({},_0x5753eb,_0x432d62['options']);return _0x51f830['getAgents'](_0x5753eb);}})[_0x243f('0x37')](function(_0x2a0607){if(_0x2a0607){_0x1c76ce=_0x2a0607[_0x243f('0x49')];if(!_0x432d62[_0x243f('0x44')][_0x243f('0x66')](_0x243f('0x4a'))){_0x5753eb[_0x243f('0x2f')]=qs['limit'](_0x432d62[_0x243f('0x44')][_0x243f('0x2f')]);_0x5753eb[_0x243f('0x31')]=qs['offset'](_0x432d62[_0x243f('0x44')][_0x243f('0x31')]);}return _0x51f830[_0x243f('0x9a')](_0x5753eb);}})[_0x243f('0x37')](function(_0x5b49fa){if(_0x5b49fa){return _0x5b49fa?{'count':_0x1c76ce,'rows':_0x5b49fa}:null;}})['then'](respondWithResult(_0x2778bb,null))[_0x243f('0x2a')](handleError(_0x2778bb,null));};
\ No newline at end of file
+var _0x9702=['message','result','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','get','ChatQueues','UserProfileResource','destroy','stack','name','send','map','ChatQueue','rawAttributes','fieldName','key','keys','query','model','attributes','intersection','fields','length','hasOwnProperty','order','where','filters','pick','merge','VIRTUAL','options','includeAll','include','rows','catch','params','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','nolimit','sort','ChatQueueId','filter','UserChatQueue','findAll','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','ids','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','SELECT','union','compact','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x529595,_0x2177e9){var _0x1ef41b=function(_0x381faf){while(--_0x381faf){_0x529595['push'](_0x529595['shift']());}};_0x1ef41b(++_0x2177e9);}(_0x9702,0x1a7));var _0x2970=function(_0x1d7106,_0x16ae3a){_0x1d7106=_0x1d7106-0x0;var _0x34305a=_0x9702[_0x1d7106];return _0x34305a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2970('0x0'));var zipdir=require(_0x2970('0x1'));var jsonpatch=require(_0x2970('0x2'));var rp=require('request-promise');var moment=require(_0x2970('0x3'));var BPromise=require(_0x2970('0x4'));var Mustache=require(_0x2970('0x5'));var util=require(_0x2970('0x6'));var path=require(_0x2970('0x7'));var sox=require(_0x2970('0x8'));var csv=require(_0x2970('0x9'));var ejs=require(_0x2970('0xa'));var fs=require('fs');var fs_extra=require(_0x2970('0xb'));var _=require(_0x2970('0xc'));var squel=require(_0x2970('0xd'));var crypto=require('crypto');var jsforce=require(_0x2970('0xe'));var deskjs=require(_0x2970('0xf'));var toCsv=require(_0x2970('0x9'));var querystring=require(_0x2970('0x10'));var Papa=require(_0x2970('0x11'));var Redis=require(_0x2970('0x12'));var authService=require(_0x2970('0x13'));var qs=require(_0x2970('0x14'));var as=require(_0x2970('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2970('0x16'))('api');var utils=require(_0x2970('0x17'));var config=require(_0x2970('0x18'));var licenseUtil=require(_0x2970('0x19'));var db=require('../../mysqldb')['db'];config[_0x2970('0x1a')]=_[_0x2970('0x1b')](config[_0x2970('0x1a')],{'host':_0x2970('0x1c'),'port':0x18eb});var socket=require(_0x2970('0x1d'))(new Redis(config[_0x2970('0x1a')]));require(_0x2970('0x1e'))[_0x2970('0x1f')](socket);var jayson=require(_0x2970('0x20'));var client=jayson[_0x2970('0x21')][_0x2970('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x112e31,_0x1118a4,_0x57d92d,_0x2be803){return new BPromise(function(_0x471716,_0xe508c8){var _0xc26061=_0x2be803||client;return _0xc26061['request'](_0x112e31,_0x57d92d)[_0x2970('0x23')](function(_0x3b44b3){logger[_0x2970('0x24')](_0x2970('0x25'),_0x1118a4,_0x2970('0x26'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x1118a4,_0x2970('0x26'),JSON[_0x2970('0x27')](_0x3b44b3));if(_0x3b44b3[_0x2970('0x28')]){if(_0x3b44b3[_0x2970('0x28')][_0x2970('0x29')]===0x1f4){logger[_0x2970('0x28')](_0x2970('0x25'),_0x1118a4,_0x3b44b3[_0x2970('0x28')][_0x2970('0x2a')]);return _0xe508c8(_0x3b44b3[_0x2970('0x28')][_0x2970('0x2a')]);}logger['error'](_0x2970('0x25'),_0x1118a4,_0x3b44b3[_0x2970('0x28')][_0x2970('0x2a')]);return _0x471716(_0x3b44b3[_0x2970('0x28')][_0x2970('0x2a')]);}else{logger[_0x2970('0x24')](_0x2970('0x25'),_0x1118a4,_0x2970('0x26'));_0x471716(_0x3b44b3[_0x2970('0x2b')][_0x2970('0x2a')]);}})['catch'](function(_0x588aad){logger[_0x2970('0x28')]('ChatQueue,\x20%s,\x20%s',_0x1118a4,_0x588aad);_0xe508c8(_0x588aad);});});}function respondWithStatusCode(_0x3b26b2,_0x49da6b){_0x49da6b=_0x49da6b||0xcc;return function(_0x1f9a75){if(_0x1f9a75){return _0x3b26b2[_0x2970('0x2c')](_0x49da6b);}return _0x3b26b2[_0x2970('0x2d')](_0x49da6b)[_0x2970('0x2e')]();};}function respondWithResult(_0x16491c,_0x2b6318){_0x2b6318=_0x2b6318||0xc8;return function(_0x2d9a0c){if(_0x2d9a0c){return _0x16491c[_0x2970('0x2d')](_0x2b6318)[_0x2970('0x2f')](_0x2d9a0c);}};}function respondWithFilteredResult(_0x43f921,_0x5cc5fd){return function(_0x4d7437){if(_0x4d7437){var _0x17fa0e=typeof _0x5cc5fd['offset']===_0x2970('0x30')&&typeof _0x5cc5fd[_0x2970('0x31')]===_0x2970('0x30');var _0x347033=_0x4d7437[_0x2970('0x32')];var _0x1943a6=_0x17fa0e?0x0:_0x5cc5fd[_0x2970('0x33')];var _0xdced9f=_0x17fa0e?_0x4d7437[_0x2970('0x32')]:_0x5cc5fd['offset']+_0x5cc5fd[_0x2970('0x31')];var _0x2dd88a;if(_0xdced9f>=_0x347033){_0xdced9f=_0x347033;_0x2dd88a=0xc8;}else{_0x2dd88a=0xce;}_0x43f921[_0x2970('0x2d')](_0x2dd88a);return _0x43f921[_0x2970('0x34')](_0x2970('0x35'),_0x1943a6+'-'+_0xdced9f+'/'+_0x347033)[_0x2970('0x2f')](_0x4d7437);}return null;};}function patchUpdates(_0x41fb9e){return function(_0x4cdf45){try{jsonpatch[_0x2970('0x36')](_0x4cdf45,_0x41fb9e,!![]);}catch(_0x3cd246){return BPromise[_0x2970('0x37')](_0x3cd246);}return _0x4cdf45[_0x2970('0x38')]();};}function saveUpdates(_0x5d7b14,_0x461042){return function(_0x2f415c){if(_0x2f415c){return _0x2f415c[_0x2970('0x39')](_0x5d7b14)[_0x2970('0x23')](function(_0x1f1825){return _0x1f1825;});}return null;};}function removeEntity(_0x4fba93,_0x4addd8){return function(_0x484208){if(_0x484208){return _0x484208['destroy']()[_0x2970('0x23')](function(){var _0x9852aa=_0x484208[_0x2970('0x3a')]({'plain':!![]});var _0x4792a5=_0x2970('0x3b');return db[_0x2970('0x3c')][_0x2970('0x3d')]({'where':{'type':_0x4792a5,'resourceId':_0x9852aa['id']}})['then'](function(){return _0x484208;});})[_0x2970('0x23')](function(){_0x4fba93['status'](0xcc)[_0x2970('0x2e')]();});}};}function handleEntityNotFound(_0x5e0b1a,_0x193346){return function(_0x52ebdd){if(!_0x52ebdd){_0x5e0b1a['sendStatus'](0x194);}return _0x52ebdd;};}function handleError(_0x19193f,_0x10333c){_0x10333c=_0x10333c||0x1f4;return function(_0x2accac){logger[_0x2970('0x28')](_0x2accac[_0x2970('0x3e')]);if(_0x2accac[_0x2970('0x3f')]){delete _0x2accac['name'];}_0x19193f[_0x2970('0x2d')](_0x10333c)[_0x2970('0x40')](_0x2accac);};}exports['index']=function(_0x4432ef,_0x540336){var _0xdbb5d5={},_0x3197c2={},_0x37ae46={'count':0x0,'rows':[]};var _0x5a281c=_[_0x2970('0x41')](db[_0x2970('0x42')][_0x2970('0x43')],function(_0x22494b){return{'name':_0x22494b[_0x2970('0x44')],'type':_0x22494b['type'][_0x2970('0x45')]};});_0x3197c2['model']=_[_0x2970('0x41')](_0x5a281c,_0x2970('0x3f'));_0x3197c2['query']=_[_0x2970('0x46')](_0x4432ef[_0x2970('0x47')]);_0x3197c2['filters']=_['intersection'](_0x3197c2[_0x2970('0x48')],_0x3197c2[_0x2970('0x47')]);_0xdbb5d5[_0x2970('0x49')]=_[_0x2970('0x4a')](_0x3197c2[_0x2970('0x48')],qs[_0x2970('0x4b')](_0x4432ef[_0x2970('0x47')][_0x2970('0x4b')]));_0xdbb5d5[_0x2970('0x49')]=_0xdbb5d5[_0x2970('0x49')][_0x2970('0x4c')]?_0xdbb5d5[_0x2970('0x49')]:_0x3197c2['model'];if(!_0x4432ef[_0x2970('0x47')][_0x2970('0x4d')]('nolimit')){_0xdbb5d5['limit']=qs[_0x2970('0x31')](_0x4432ef[_0x2970('0x47')][_0x2970('0x31')]);_0xdbb5d5[_0x2970('0x33')]=qs[_0x2970('0x33')](_0x4432ef[_0x2970('0x47')]['offset']);}_0xdbb5d5[_0x2970('0x4e')]=qs['sort'](_0x4432ef[_0x2970('0x47')]['sort']);_0xdbb5d5[_0x2970('0x4f')]=qs[_0x2970('0x50')](_[_0x2970('0x51')](_0x4432ef[_0x2970('0x47')],_0x3197c2[_0x2970('0x50')]),_0x5a281c);if(_0x4432ef[_0x2970('0x47')]['filter']){_0xdbb5d5['where']=_[_0x2970('0x52')](_0xdbb5d5[_0x2970('0x4f')],{'$or':_['map'](_0x5a281c,function(_0x46bff2){if(_0x46bff2['type']!==_0x2970('0x53')){var _0x458311={};_0x458311[_0x46bff2['name']]={'$like':'%'+_0x4432ef[_0x2970('0x47')]['filter']+'%'};return _0x458311;}})});}_0xdbb5d5=_[_0x2970('0x52')]({},_0xdbb5d5,_0x4432ef[_0x2970('0x54')]);var _0x1117b4={'where':_0xdbb5d5[_0x2970('0x4f')]};return db['ChatQueue'][_0x2970('0x32')](_0x1117b4)[_0x2970('0x23')](function(_0x332f7a){_0x37ae46[_0x2970('0x32')]=_0x332f7a;if(_0x4432ef[_0x2970('0x47')][_0x2970('0x55')]){_0xdbb5d5[_0x2970('0x56')]=[{'all':!![]}];}return db[_0x2970('0x42')]['findAll'](_0xdbb5d5);})['then'](function(_0x419235){_0x37ae46[_0x2970('0x57')]=_0x419235;return _0x37ae46;})[_0x2970('0x23')](respondWithFilteredResult(_0x540336,_0xdbb5d5))[_0x2970('0x58')](handleError(_0x540336,null));};exports['show']=function(_0x150b47,_0x4f26c3){var _0x13d74a={'raw':!![],'where':{'id':_0x150b47[_0x2970('0x59')]['id']}},_0x49de2d={};_0x49de2d[_0x2970('0x48')]=_[_0x2970('0x46')](db['ChatQueue'][_0x2970('0x43')]);_0x49de2d['query']=_[_0x2970('0x46')](_0x150b47[_0x2970('0x47')]);_0x49de2d[_0x2970('0x50')]=_['intersection'](_0x49de2d['model'],_0x49de2d['query']);_0x13d74a[_0x2970('0x49')]=_[_0x2970('0x4a')](_0x49de2d[_0x2970('0x48')],qs[_0x2970('0x4b')](_0x150b47[_0x2970('0x47')]['fields']));_0x13d74a['attributes']=_0x13d74a['attributes'][_0x2970('0x4c')]?_0x13d74a[_0x2970('0x49')]:_0x49de2d[_0x2970('0x48')];if(_0x150b47[_0x2970('0x47')][_0x2970('0x55')]){_0x13d74a[_0x2970('0x56')]=[{'all':!![]}];}_0x13d74a=_[_0x2970('0x52')]({},_0x13d74a,_0x150b47[_0x2970('0x54')]);return db['ChatQueue'][_0x2970('0x5a')](_0x13d74a)[_0x2970('0x23')](handleEntityNotFound(_0x4f26c3,null))[_0x2970('0x23')](respondWithResult(_0x4f26c3,null))[_0x2970('0x58')](handleError(_0x4f26c3,null));};exports['create']=function(_0x344188,_0x45972a){return db['ChatQueue'][_0x2970('0x5b')](_0x344188['body'],{})[_0x2970('0x23')](function(_0x5f2b04){var _0x2c1e9c=_0x344188[_0x2970('0x5c')][_0x2970('0x3a')]({'plain':!![]});if(!_0x2c1e9c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2c1e9c[_0x2970('0x5d')]===_0x2970('0x5c')){var _0x1f855d=_0x5f2b04[_0x2970('0x3a')]({'plain':!![]});var _0x4feca5=_0x2970('0x3b');return db[_0x2970('0x5e')][_0x2970('0x5a')]({'where':{'name':_0x4feca5,'userProfileId':_0x2c1e9c[_0x2970('0x5f')]},'raw':!![]})[_0x2970('0x23')](function(_0x48cb06){if(_0x48cb06&&_0x48cb06[_0x2970('0x60')]===0x0){return db[_0x2970('0x3c')][_0x2970('0x5b')]({'name':_0x1f855d[_0x2970('0x3f')],'resourceId':_0x1f855d['id'],'type':_0x48cb06[_0x2970('0x3f')],'sectionId':_0x48cb06['id']},{})[_0x2970('0x23')](function(){return _0x5f2b04;});}else{return _0x5f2b04;}})[_0x2970('0x58')](function(_0x317c9e){logger[_0x2970('0x28')](_0x2970('0x61'),_0x317c9e);throw _0x317c9e;});}return _0x5f2b04;})[_0x2970('0x23')](respondWithResult(_0x45972a,0xc9))[_0x2970('0x58')](handleError(_0x45972a,null));};exports[_0x2970('0x39')]=function(_0x37d8f5,_0x30a05c){if(_0x37d8f5[_0x2970('0x62')]['id']){delete _0x37d8f5[_0x2970('0x62')]['id'];}return db[_0x2970('0x42')][_0x2970('0x5a')]({'where':{'id':_0x37d8f5['params']['id']}})[_0x2970('0x23')](handleEntityNotFound(_0x30a05c,null))[_0x2970('0x23')](saveUpdates(_0x37d8f5[_0x2970('0x62')],null))[_0x2970('0x23')](respondWithResult(_0x30a05c,null))[_0x2970('0x58')](handleError(_0x30a05c,null));};exports[_0x2970('0x3d')]=function(_0x383af5,_0x5d8b25){return db[_0x2970('0x42')][_0x2970('0x5a')]({'where':{'id':_0x383af5[_0x2970('0x59')]['id']}})[_0x2970('0x23')](handleEntityNotFound(_0x5d8b25,null))['then'](removeEntity(_0x5d8b25,null))['catch'](handleError(_0x5d8b25,null));};exports[_0x2970('0x63')]=function(_0x25ed9a,_0x1fd62d){return db[_0x2970('0x42')][_0x2970('0x63')]()[_0x2970('0x23')](respondWithResult(_0x1fd62d,null))['catch'](handleError(_0x1fd62d,null));};exports[_0x2970('0x64')]=function(_0x33e729,_0x2ddac2,_0x2273f9){var _0x25646b={'raw':!![],'where':{}},_0x109d86={},_0x23b1ff;return db[_0x2970('0x42')][_0x2970('0x65')]({'where':{'id':_0x33e729['params']['id']}})['then'](handleEntityNotFound(_0x2ddac2,null))[_0x2970('0x23')](function(_0x172e7f){if(_0x172e7f){_0x23b1ff=_0x172e7f['get']({'plain':!![]});_0x109d86['model']=_[_0x2970('0x46')](db['UserChatQueue'][_0x2970('0x43')]);_0x109d86[_0x2970('0x47')]=_['keys'](_0x33e729[_0x2970('0x47')]);_0x109d86[_0x2970('0x50')]=_[_0x2970('0x4a')](_0x109d86[_0x2970('0x48')],_0x109d86[_0x2970('0x47')]);_0x25646b[_0x2970('0x49')]=_[_0x2970('0x4a')](_0x109d86['model'],qs[_0x2970('0x4b')](_0x33e729[_0x2970('0x47')][_0x2970('0x4b')]));_0x25646b[_0x2970('0x49')]=_0x25646b[_0x2970('0x49')][_0x2970('0x4c')]?_0x25646b['attributes']:_0x109d86[_0x2970('0x48')];if(!_0x33e729[_0x2970('0x47')][_0x2970('0x4d')](_0x2970('0x66'))){_0x25646b[_0x2970('0x31')]=qs[_0x2970('0x31')](_0x33e729[_0x2970('0x47')]['limit']);_0x25646b['offset']=qs[_0x2970('0x33')](_0x33e729[_0x2970('0x47')][_0x2970('0x33')]);}_0x25646b[_0x2970('0x4e')]=qs[_0x2970('0x67')](_0x33e729[_0x2970('0x47')][_0x2970('0x67')]);_0x25646b['where']=qs[_0x2970('0x50')](_['pick'](_0x33e729[_0x2970('0x47')],_0x109d86[_0x2970('0x50')]));_0x25646b[_0x2970('0x4f')][_0x2970('0x68')]=_0x172e7f['id'];if(_0x33e729[_0x2970('0x47')]['filter']){_0x25646b['where']=_[_0x2970('0x52')](_0x25646b[_0x2970('0x4f')],{'$or':_[_0x2970('0x41')](_0x25646b['attributes'],function(_0x5981e1){var _0x5ef203={};_0x5ef203[_0x5981e1]={'$like':'%'+_0x33e729[_0x2970('0x47')][_0x2970('0x69')]+'%'};return _0x5ef203;})});}_0x25646b=_['merge']({},_0x25646b,_0x33e729[_0x2970('0x54')]);return db[_0x2970('0x6a')][_0x2970('0x6b')](_0x25646b);}})[_0x2970('0x23')](function(_0x18d61b){if(_0x18d61b){return db['User'][_0x2970('0x6c')]({'where':{'id':_[_0x2970('0x41')](_0x18d61b,_0x2970('0x6d')),'role':_0x2970('0x6e')},'attributes':['id','name',_0x2970('0x6f'),_0x2970('0x70'),_0x2970('0x71')]});}})['then'](function(_0x265ab3){if(_0x265ab3){return{'count':_0x265ab3[_0x2970('0x32')],'rows':_[_0x2970('0x41')](_0x265ab3[_0x2970('0x57')],function(_0x2ff8a3){return{'membername':_0x2ff8a3[_0x2970('0x3f')],'UserId':_0x2ff8a3['id'],'queue_name':_0x23b1ff['name'],'ChatQueueId':_0x23b1ff['id'],'interface':util['format'](_0x2970('0x72'),_0x2970('0x73'),_0x2ff8a3[_0x2970('0x3f')]),'penalty':0x0,'paused':_0x2ff8a3['chatPause'],'createdAt':_0x2ff8a3[_0x2970('0x71')],'updatedAt':_0x2ff8a3[_0x2970('0x70')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x2970('0x23')](respondWithFilteredResult(_0x2ddac2,_0x25646b))[_0x2970('0x58')](handleError(_0x2ddac2,null));};exports[_0x2970('0x74')]=function(_0x330e69,_0x3619ff,_0x1c5f09){var _0x37ebe0={};var _0x12f7c3={};var _0x2ad2a6;var _0x13e413;return db[_0x2970('0x42')][_0x2970('0x65')]({'where':{'id':_0x330e69['params']['id']}})[_0x2970('0x23')](handleEntityNotFound(_0x3619ff,null))[_0x2970('0x23')](function(_0x589b16){if(_0x589b16){_0x2ad2a6=_0x589b16;_0x12f7c3['model']=_[_0x2970('0x46')](db[_0x2970('0x75')][_0x2970('0x43')]);_0x12f7c3[_0x2970('0x47')]=_['keys'](_0x330e69[_0x2970('0x47')]);_0x12f7c3[_0x2970('0x50')]=_[_0x2970('0x4a')](_0x12f7c3[_0x2970('0x48')],_0x12f7c3[_0x2970('0x47')]);_0x37ebe0['attributes']=_[_0x2970('0x4a')](_0x12f7c3['model'],qs[_0x2970('0x4b')](_0x330e69[_0x2970('0x47')][_0x2970('0x4b')]));_0x37ebe0['attributes']=_0x37ebe0[_0x2970('0x49')]['length']?_0x37ebe0[_0x2970('0x49')]:_0x12f7c3[_0x2970('0x48')];_0x37ebe0[_0x2970('0x4e')]=qs[_0x2970('0x67')](_0x330e69[_0x2970('0x47')][_0x2970('0x67')]);_0x37ebe0[_0x2970('0x4f')]=qs[_0x2970('0x50')](_[_0x2970('0x51')](_0x330e69[_0x2970('0x47')],_0x12f7c3[_0x2970('0x50')]));if(_0x330e69[_0x2970('0x47')]['filter']){_0x37ebe0[_0x2970('0x4f')]=_[_0x2970('0x52')](_0x37ebe0[_0x2970('0x4f')],{'$or':_[_0x2970('0x41')](_0x37ebe0[_0x2970('0x49')],function(_0x509fc3){var _0x3c7696={};_0x3c7696[_0x509fc3]={'$like':'%'+_0x330e69[_0x2970('0x47')][_0x2970('0x69')]+'%'};return _0x3c7696;})});}_0x37ebe0=_['merge']({},_0x37ebe0,_0x330e69[_0x2970('0x54')]);return _0x2ad2a6[_0x2970('0x74')](_0x37ebe0);}})[_0x2970('0x23')](function(_0x2ab51d){if(_0x2ab51d){_0x13e413=_0x2ab51d[_0x2970('0x4c')];if(!_0x330e69[_0x2970('0x47')]['hasOwnProperty'](_0x2970('0x66'))){_0x37ebe0[_0x2970('0x31')]=qs[_0x2970('0x31')](_0x330e69[_0x2970('0x47')][_0x2970('0x31')]);_0x37ebe0[_0x2970('0x33')]=qs['offset'](_0x330e69[_0x2970('0x47')][_0x2970('0x33')]);}return _0x2ad2a6[_0x2970('0x74')](_0x37ebe0);}})[_0x2970('0x23')](function(_0x2e79ed){if(_0x2e79ed){return _0x2e79ed?{'count':_0x13e413,'rows':_0x2e79ed}:null;}})[_0x2970('0x23')](respondWithResult(_0x3619ff,null))['catch'](handleError(_0x3619ff,null));};exports['addTeams']=function(_0x5eb40b,_0x1f8106,_0x749daa){var _0x586e7e=_0x5eb40b[_0x2970('0x62')]['ids'];return db[_0x2970('0x75')][_0x2970('0x6b')]({'where':{'id':_0x586e7e},'attributes':['id'],'include':[{'model':db[_0x2970('0x76')],'as':_0x2970('0x77'),'attributes':['id',_0x2970('0x3f'),_0x2970('0x78'),_0x2970('0x79'),_0x2970('0x7a')],'raw':!![]}]})[_0x2970('0x23')](function(_0x14d56a){if(_0x14d56a){var _0x3ed3a1=_[_0x2970('0x7b')](_0x14d56a,function(_0x116699){var _0x3ed50b=_0x116699[_0x2970('0x3a')]({'plain':!![]});return _0x3ed50b['Agents'];});return db['ChatQueue'][_0x2970('0x5a')]({'where':{'id':_0x5eb40b[_0x2970('0x59')]['id']}})[_0x2970('0x23')](function(_0x4a48cc){return db[_0x2970('0x7c')][_0x2970('0x7d')](function(_0x337f6c){return _0x4a48cc[_0x2970('0x7e')](_0x586e7e,{'transaction':_0x337f6c})['then'](function(){return BPromise[_0x2970('0x7f')](_0x3ed3a1,function(_0x5165e5){return db[_0x2970('0x6a')][_0x2970('0x80')]({'where':{'UserId':_0x5165e5['id'],'ChatQueueId':_0x5eb40b[_0x2970('0x59')]['id']},'transaction':_0x337f6c});});})[_0x2970('0x23')](function(){_0x3ed3a1[_0x2970('0x81')](function(_0x36d11c){socket[_0x2970('0x82')](_0x2970('0x83'),{'UserId':_0x36d11c['id'],'ChatQueueId':_0x4a48cc['id']});});});});});}})['then'](respondWithStatusCode(_0x1f8106,null))['catch'](handleError(_0x1f8106,null));};exports[_0x2970('0x84')]=function(_0x40a0c3,_0x25a838,_0x9e659a){return db['Team']['findAll']({'where':{'id':_0x40a0c3[_0x2970('0x47')][_0x2970('0x85')]},'attributes':['id'],'include':[{'model':db[_0x2970('0x76')],'as':_0x2970('0x77'),'attributes':['id'],'raw':!![]}]})[_0x2970('0x23')](handleEntityNotFound(_0x25a838,null))['then'](function(_0x392400){var _0x58822f=_[_0x2970('0x41')](_0x392400,'id');var _0x534854=[];var _0x474e11=[];var _0x1b01f3=squel[_0x2970('0x86')]();_0x1b01f3[_0x2970('0x87')](_0x2970('0x88'))[_0x2970('0x89')]('team_has_chat_queues','tq')[_0x2970('0x8a')](_0x2970('0x8b'),'ut',_0x2970('0x8c'))['where']('ChatQueueId\x20=\x20?',_0x40a0c3[_0x2970('0x59')]['id']);for(var _0x325e72=0x0;_0x325e72<_0x392400[_0x2970('0x4c')];_0x325e72+=0x1){let _0x4bd324=_0x392400[_0x325e72];for(var _0x5c1c30=0x0;_0x5c1c30<_0x4bd324[_0x2970('0x77')]['length'];_0x5c1c30+=0x1){let _0x2f7091=_0x4bd324[_0x2970('0x77')][_0x5c1c30];var _0x15b715=_0x1b01f3[_0x2970('0x8d')]();_0x15b715[_0x2970('0x4f')](_0x2970('0x8e'),_0x2f7091['id']);_0x474e11['push'](db['sequelize'][_0x2970('0x47')](_0x15b715[_0x2970('0x8f')](),{'type':db[_0x2970('0x7c')]['QueryTypes'][_0x2970('0x90')]})[_0x2970('0x23')](function(_0x399b52){if(_0x399b52[_0x2970('0x4c')]===0x1){return _0x2f7091['id'];}else{var _0xabfc70=_['every'](_[_0x2970('0x41')](_0x399b52,'TeamId'),function(_0x456802){return _['includes'](_0x58822f,_0x456802);});if(_0xabfc70){return _0x2f7091['id'];}}}));}}return BPromise['all'](_0x474e11)[_0x2970('0x23')](function(_0x46e414){_0x534854=_(_0x534854)[_0x2970('0x91')](_0x46e414)[_0x2970('0x92')]()['value']();return db[_0x2970('0x42')]['find']({'where':{'id':_0x40a0c3[_0x2970('0x59')]['id']}})[_0x2970('0x23')](function(_0x4ff908){return db[_0x2970('0x7c')][_0x2970('0x7d')](function(_0x28f51f){return _0x4ff908[_0x2970('0x84')](_0x40a0c3[_0x2970('0x47')][_0x2970('0x85')],{'transaction':_0x28f51f})['then'](function(){if(!_[_0x2970('0x93')](_0x534854)){return _0x4ff908[_0x2970('0x94')](_0x534854,{'transaction':_0x28f51f});}})['then'](function(){_0x534854[_0x2970('0x81')](function(_0x2f5623){socket[_0x2970('0x82')](_0x2970('0x95'),{'UserId':_0x2f5623,'ChatQueueId':_0x4ff908['id']});});});});});});})['then'](respondWithStatusCode(_0x25a838,null))[_0x2970('0x58')](handleError(_0x25a838,null));};exports['addAgents']=function(_0x424ec9,_0x584d90,_0x359a0b){return db[_0x2970('0x42')][_0x2970('0x5a')]({'where':{'id':_0x424ec9[_0x2970('0x59')]['id']}})['then'](handleEntityNotFound(_0x584d90,null))[_0x2970('0x23')](function(_0x417c48){if(_0x417c48){return _0x417c48[_0x2970('0x96')](_0x424ec9[_0x2970('0x62')]['ids'],_[_0x2970('0x97')](_0x424ec9['body'],['ids','id'])||{})[_0x2970('0x98')](function(_0x1d643c){for(var _0x3fd4ad=0x0;_0x3fd4ad<_0x424ec9[_0x2970('0x62')][_0x2970('0x85')][_0x2970('0x4c')];_0x3fd4ad+=0x1){socket[_0x2970('0x82')](_0x2970('0x83'),{'UserId':Number(_0x424ec9[_0x2970('0x62')][_0x2970('0x85')][_0x3fd4ad]),'ChatQueueId':Number(_0x424ec9[_0x2970('0x59')]['id'])});}return _0x1d643c;});}})[_0x2970('0x23')](respondWithResult(_0x584d90,null))[_0x2970('0x58')](handleError(_0x584d90,null));};exports[_0x2970('0x94')]=function(_0x4d19a7,_0x7b432,_0x510824){return db[_0x2970('0x42')][_0x2970('0x5a')]({'where':{'id':_0x4d19a7[_0x2970('0x59')]['id']}})[_0x2970('0x23')](handleEntityNotFound(_0x7b432,null))[_0x2970('0x23')](function(_0x1fb4d0){if(_0x1fb4d0){return _0x1fb4d0[_0x2970('0x94')](_0x4d19a7['query'][_0x2970('0x85')])[_0x2970('0x23')](function(){if(_[_0x2970('0x99')](_0x4d19a7[_0x2970('0x47')][_0x2970('0x85')])){for(var _0x404a40=0x0;_0x404a40<_0x4d19a7['query'][_0x2970('0x85')][_0x2970('0x4c')];_0x404a40+=0x1){socket[_0x2970('0x82')](_0x2970('0x95'),{'UserId':Number(_0x4d19a7[_0x2970('0x47')][_0x2970('0x85')][_0x404a40]),'ChatQueueId':Number(_0x4d19a7[_0x2970('0x59')]['id'])});}}else{socket['emit'](_0x2970('0x95'),{'UserId':Number(_0x4d19a7['query']['ids']),'ChatQueueId':Number(_0x4d19a7[_0x2970('0x59')]['id'])});}});}})[_0x2970('0x23')](respondWithStatusCode(_0x7b432,null))[_0x2970('0x58')](handleError(_0x7b432,null));};exports[_0x2970('0x9a')]=function(_0x221452,_0x43c44a,_0x3122d7){var _0x2eb8b8={};var _0x2c0016={};var _0x1dcd22;var _0x2b4325;return db[_0x2970('0x42')][_0x2970('0x65')]({'where':{'id':_0x221452[_0x2970('0x59')]['id']}})[_0x2970('0x23')](handleEntityNotFound(_0x43c44a,null))[_0x2970('0x23')](function(_0xd40089){if(_0xd40089){_0x1dcd22=_0xd40089;_0x2c0016[_0x2970('0x48')]=_[_0x2970('0x46')](db[_0x2970('0x76')][_0x2970('0x43')]);_0x2c0016['query']=_['keys'](_0x221452[_0x2970('0x47')]);_0x2c0016[_0x2970('0x50')]=_[_0x2970('0x4a')](_0x2c0016[_0x2970('0x48')],_0x2c0016[_0x2970('0x47')]);_0x2eb8b8[_0x2970('0x49')]=_[_0x2970('0x4a')](_0x2c0016['model'],qs['fields'](_0x221452[_0x2970('0x47')]['fields']));_0x2eb8b8['attributes']=_0x2eb8b8[_0x2970('0x49')][_0x2970('0x4c')]?_0x2eb8b8[_0x2970('0x49')]:_0x2c0016[_0x2970('0x48')];_0x2eb8b8['order']=qs['sort'](_0x221452[_0x2970('0x47')][_0x2970('0x67')]);_0x2eb8b8[_0x2970('0x4f')]=qs['filters'](_['pick'](_0x221452[_0x2970('0x47')],_0x2c0016['filters']));if(_0x221452[_0x2970('0x47')][_0x2970('0x69')]){_0x2eb8b8[_0x2970('0x4f')]=_[_0x2970('0x52')](_0x2eb8b8[_0x2970('0x4f')],{'$or':_[_0x2970('0x41')](_0x2eb8b8['attributes'],function(_0x517d01){var _0x193cd4={};_0x193cd4[_0x517d01]={'$like':'%'+_0x221452[_0x2970('0x47')][_0x2970('0x69')]+'%'};return _0x193cd4;})});}_0x2eb8b8=_[_0x2970('0x52')]({},_0x2eb8b8,_0x221452[_0x2970('0x54')]);return _0x1dcd22[_0x2970('0x9a')](_0x2eb8b8);}})[_0x2970('0x23')](function(_0x5f4d4b){if(_0x5f4d4b){_0x2b4325=_0x5f4d4b[_0x2970('0x4c')];if(!_0x221452[_0x2970('0x47')][_0x2970('0x4d')](_0x2970('0x66'))){_0x2eb8b8[_0x2970('0x31')]=qs[_0x2970('0x31')](_0x221452[_0x2970('0x47')][_0x2970('0x31')]);_0x2eb8b8[_0x2970('0x33')]=qs[_0x2970('0x33')](_0x221452['query']['offset']);}return _0x1dcd22['getAgents'](_0x2eb8b8);}})[_0x2970('0x23')](function(_0x306efb){if(_0x306efb){return _0x306efb?{'count':_0x2b4325,'rows':_0x306efb}:null;}})[_0x2970('0x23')](respondWithResult(_0x43c44a,null))[_0x2970('0x58')](handleError(_0x43c44a,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 0807f8a..c6287ba 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 _0x1c06=['hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x20c522,_0x50e1d2){var _0x346df6=function(_0x2ef44c){while(--_0x2ef44c){_0x20c522['push'](_0x20c522['shift']());}};_0x346df6(++_0x50e1d2);}(_0x1c06,0xc0));var _0x61c0=function(_0x4e90e3,_0x570a1d){_0x4e90e3=_0x4e90e3-0x0;var _0x295e5b=_0x1c06[_0x4e90e3];return _0x295e5b;};'use strict';var EventEmitter=require(_0x61c0('0x0'));var ChatQueue=require(_0x61c0('0x1'))['db'][_0x61c0('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x61c0('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x61c0('0x4'),'afterDestroy':_0x61c0('0x5')};function emitEvent(_0x5a1865){return function(_0x3ccc01,_0xf4617f,_0x3dfe21){ChatQueueEvents[_0x61c0('0x6')](_0x5a1865+':'+_0x3ccc01['id'],_0x3ccc01);ChatQueueEvents[_0x61c0('0x6')](_0x5a1865,_0x3ccc01);_0x3dfe21(null);};}for(var e in events){if(events[_0x61c0('0x7')](e)){var event=events[e];ChatQueue[_0x61c0('0x8')](e,emitEvent(event));}}module[_0x61c0('0x9')]=ChatQueueEvents;
\ No newline at end of file
+var _0xc4c1=['hook','exports','events','ChatQueue','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x2583a8,_0x55f4ff){var _0x33efed=function(_0x4d2ec8){while(--_0x4d2ec8){_0x2583a8['push'](_0x2583a8['shift']());}};_0x33efed(++_0x55f4ff);}(_0xc4c1,0x1ea));var _0x1c4c=function(_0x2a26f2,_0x35a965){_0x2a26f2=_0x2a26f2-0x0;var _0x2c3f1b=_0xc4c1[_0x2a26f2];return _0x2c3f1b;};'use strict';var EventEmitter=require(_0x1c4c('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x1c4c('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x1c4c('0x2')](0x0);var events={'afterCreate':_0x1c4c('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x7bd058){return function(_0x592b56,_0x251132,_0x447b61){ChatQueueEvents[_0x1c4c('0x4')](_0x7bd058+':'+_0x592b56['id'],_0x592b56);ChatQueueEvents[_0x1c4c('0x4')](_0x7bd058,_0x592b56);_0x447b61(null);};}for(var e in events){if(events[_0x1c4c('0x5')](e)){var event=events[e];ChatQueue[_0x1c4c('0x6')](e,emitEvent(event));}}module[_0x1c4c('0x7')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 20d9775..c1dc8ba 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 _0xe819=['api','moment','bluebird','path','rimraf','../../config/environment','./chatQueue.attributes','ChatQueue','chat_queues','lodash','../../config/logger'];(function(_0x5ac1e5,_0x4b5012){var _0x1bccc6=function(_0x102562){while(--_0x102562){_0x5ac1e5['push'](_0x5ac1e5['shift']());}};_0x1bccc6(++_0x4b5012);}(_0xe819,0x17f));var _0x9e81=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xe819[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x9e81('0x0'));var util=require('util');var logger=require(_0x9e81('0x1'))(_0x9e81('0x2'));var moment=require(_0x9e81('0x3'));var BPromise=require(_0x9e81('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9e81('0x5'));var rimraf=require(_0x9e81('0x6'));var config=require(_0x9e81('0x7'));var attributes=require(_0x9e81('0x8'));module['exports']=function(_0x1ad12d,_0x30a50b){return _0x1ad12d['define'](_0x9e81('0x9'),attributes,{'tableName':_0x9e81('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xedd6=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatQueue.attributes','ChatQueue','chat_queues'];(function(_0x314025,_0x4a899c){var _0x1bef69=function(_0x162422){while(--_0x162422){_0x314025['push'](_0x314025['shift']());}};_0x1bef69(++_0x4a899c);}(_0xedd6,0x108));var _0x6edd=function(_0x19d9a4,_0x195086){_0x19d9a4=_0x19d9a4-0x0;var _0x46397a=_0xedd6[_0x19d9a4];return _0x46397a;};'use strict';var _=require('lodash');var util=require(_0x6edd('0x0'));var logger=require(_0x6edd('0x1'))(_0x6edd('0x2'));var moment=require(_0x6edd('0x3'));var BPromise=require(_0x6edd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6edd('0x5'));var rimraf=require(_0x6edd('0x6'));var config=require(_0x6edd('0x7'));var attributes=require(_0x6edd('0x8'));module['exports']=function(_0x54fbec,_0x11a75b){return _0x54fbec['define'](_0x6edd('0x9'),attributes,{'tableName':_0x6edd('0xa'),'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 acc5c96..0bd4eb2 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 _0x30d6=['ChatQueue','options','raw','attributes','limit','map','include','model','GetChatQueue','stringify','ShowChatQueue','find','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','redis','defaults','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch'];(function(_0x5802bb,_0x4bef35){var _0x4b02b7=function(_0x3502a1){while(--_0x3502a1){_0x5802bb['push'](_0x5802bb['shift']());}};_0x4b02b7(++_0x4bef35);}(_0x30d6,0x1b0));var _0x630d=function(_0x3ee5df,_0x583073){_0x3ee5df=_0x3ee5df-0x0;var _0x446d24=_0x30d6[_0x3ee5df];return _0x446d24;};'use strict';var _=require(_0x630d('0x0'));var util=require(_0x630d('0x1'));var moment=require('moment');var BPromise=require(_0x630d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x630d('0x3'));var db=require(_0x630d('0x4'))['db'];var utils=require(_0x630d('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x630d('0x6'));var jayson=require(_0x630d('0x7'));var client=jayson[_0x630d('0x8')]['http']({'port':0x232a});config[_0x630d('0x9')]=_[_0x630d('0xa')](config[_0x630d('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x630d('0x9')]));require(_0x630d('0xb'))[_0x630d('0xc')](socket);function respondWithRpcPromise(_0x382760,_0x4d4f13,_0xc5bc63){return new BPromise(function(_0x43ea98,_0x2f88fb){return client[_0x630d('0xd')](_0x382760,_0xc5bc63)[_0x630d('0xe')](function(_0x4294d0){logger[_0x630d('0xf')](_0x630d('0x10'),_0x4d4f13,_0x630d('0x11'));logger[_0x630d('0x12')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x4d4f13,_0x630d('0x11'),JSON['stringify'](_0x4294d0));if(_0x4294d0[_0x630d('0x13')]){if(_0x4294d0[_0x630d('0x13')]['code']===0x1f4){logger[_0x630d('0x13')](_0x630d('0x10'),_0x4d4f13,_0x4294d0[_0x630d('0x13')][_0x630d('0x14')]);return _0x2f88fb(_0x4294d0[_0x630d('0x13')][_0x630d('0x14')]);}logger[_0x630d('0x13')](_0x630d('0x10'),_0x4d4f13,_0x4294d0['error'][_0x630d('0x14')]);return _0x43ea98(_0x4294d0['error'][_0x630d('0x14')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x4d4f13,_0x630d('0x11'));_0x43ea98(_0x4294d0[_0x630d('0x15')]['message']);}})[_0x630d('0x16')](function(_0x18e685){logger['error'](_0x630d('0x10'),_0x4d4f13,_0x18e685);_0x2f88fb(_0x18e685);});});}exports['GetChatQueue']=function(_0x4df27f){var _0x456b07=this;return new Promise(function(_0x53498b,_0x2d960f){return db[_0x630d('0x17')]['findAll']({'raw':_0x4df27f[_0x630d('0x18')]?_0x4df27f[_0x630d('0x18')][_0x630d('0x19')]===undefined?!![]:![]:!![],'where':_0x4df27f[_0x630d('0x18')]?_0x4df27f['options']['where']||null:null,'attributes':_0x4df27f[_0x630d('0x18')]?_0x4df27f[_0x630d('0x18')][_0x630d('0x1a')]||null:null,'limit':_0x4df27f['options']?_0x4df27f[_0x630d('0x18')][_0x630d('0x1b')]||null:null,'include':_0x4df27f[_0x630d('0x18')]?_0x4df27f[_0x630d('0x18')]['include']?_[_0x630d('0x1c')](_0x4df27f[_0x630d('0x18')][_0x630d('0x1d')],function(_0x2ba2c9){return{'model':db[_0x2ba2c9[_0x630d('0x1e')]],'as':_0x2ba2c9['as'],'attributes':_0x2ba2c9[_0x630d('0x1a')],'include':_0x2ba2c9[_0x630d('0x1d')]?_['map'](_0x2ba2c9[_0x630d('0x1d')],function(_0x5c5d36){return{'model':db[_0x5c5d36[_0x630d('0x1e')]],'as':_0x5c5d36['as'],'attributes':_0x5c5d36['attributes'],'include':_0x5c5d36['include']?_[_0x630d('0x1c')](_0x5c5d36[_0x630d('0x1d')],function(_0x3d62dd){return{'model':db[_0x3d62dd['model']],'as':_0x3d62dd['as'],'attributes':_0x3d62dd[_0x630d('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2bed85){logger[_0x630d('0xf')](_0x630d('0x1f'),_0x4df27f);logger[_0x630d('0x12')](_0x630d('0x1f'),_0x4df27f,JSON[_0x630d('0x20')](_0x2bed85));_0x53498b(_0x2bed85);})[_0x630d('0x16')](function(_0x2d6d26){logger[_0x630d('0x13')](_0x630d('0x1f'),_0x2d6d26['message'],_0x4df27f);_0x2d960f(_0x456b07[_0x630d('0x13')](0x1f4,_0x2d6d26[_0x630d('0x14')]));});});};exports[_0x630d('0x21')]=function(_0x789005){var _0x25cf85=this;return new Promise(function(_0x18c8a2,_0x58e392){return db[_0x630d('0x17')][_0x630d('0x22')]({'raw':_0x789005[_0x630d('0x18')]?_0x789005[_0x630d('0x18')][_0x630d('0x19')]===undefined?!![]:![]:!![],'where':_0x789005['options']?_0x789005[_0x630d('0x18')]['where']||null:null,'attributes':_0x789005[_0x630d('0x18')]?_0x789005[_0x630d('0x18')][_0x630d('0x1a')]||null:null,'include':_0x789005[_0x630d('0x18')]?_0x789005['options'][_0x630d('0x1d')]?_['map'](_0x789005[_0x630d('0x18')][_0x630d('0x1d')],function(_0x63c194){return{'model':db[_0x63c194[_0x630d('0x1e')]],'as':_0x63c194['as'],'attributes':_0x63c194['attributes'],'include':_0x63c194[_0x630d('0x1d')]?_[_0x630d('0x1c')](_0x63c194['include'],function(_0xa10a79){return{'model':db[_0xa10a79[_0x630d('0x1e')]],'as':_0xa10a79['as'],'attributes':_0xa10a79[_0x630d('0x1a')],'include':_0xa10a79['include']?_[_0x630d('0x1c')](_0xa10a79[_0x630d('0x1d')],function(_0x22ae2c){return{'model':db[_0x22ae2c['model']],'as':_0x22ae2c['as'],'attributes':_0x22ae2c[_0x630d('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x630d('0xe')](function(_0x598a60){logger[_0x630d('0xf')](_0x630d('0x21'),_0x789005);logger[_0x630d('0x12')](_0x630d('0x21'),_0x789005,JSON[_0x630d('0x20')](_0x598a60));_0x18c8a2(_0x598a60);})[_0x630d('0x16')](function(_0x4609ce){logger[_0x630d('0x13')](_0x630d('0x21'),_0x4609ce['message'],_0x789005);_0x58e392(_0x25cf85[_0x630d('0x13')](0x1f4,_0x4609ce['message']));});});};
\ No newline at end of file
+var _0xdc9c=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','attributes','limit','include','map','model','debug','ShowChatQueue','find','where','bluebird','ioredis'];(function(_0x47f89c,_0x16325e){var _0x499805=function(_0x3dcc15){while(--_0x3dcc15){_0x47f89c['push'](_0x47f89c['shift']());}};_0x499805(++_0x16325e);}(_0xdc9c,0xe2));var _0xcdc9=function(_0x4f72bb,_0x32a014){_0x4f72bb=_0x4f72bb-0x0;var _0x4b4a32=_0xdc9c[_0x4f72bb];return _0x4b4a32;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xcdc9('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcdc9('0x1'));var db=require(_0xcdc9('0x2'))['db'];var utils=require(_0xcdc9('0x3'));var logger=require(_0xcdc9('0x4'))('rpc');var config=require(_0xcdc9('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xcdc9('0x6')][_0xcdc9('0x7')]({'port':0x232a});config[_0xcdc9('0x8')]=_[_0xcdc9('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xcdc9('0xa'))[_0xcdc9('0xb')](socket);function respondWithRpcPromise(_0x1efa14,_0x3feb96,_0x3ee1a5){return new BPromise(function(_0x1afa92,_0x3a7cb4){return client[_0xcdc9('0xc')](_0x1efa14,_0x3ee1a5)[_0xcdc9('0xd')](function(_0x5db48d){logger[_0xcdc9('0xe')](_0xcdc9('0xf'),_0x3feb96,_0xcdc9('0x10'));logger['debug'](_0xcdc9('0x11'),_0x3feb96,_0xcdc9('0x10'),JSON[_0xcdc9('0x12')](_0x5db48d));if(_0x5db48d[_0xcdc9('0x13')]){if(_0x5db48d[_0xcdc9('0x13')][_0xcdc9('0x14')]===0x1f4){logger[_0xcdc9('0x13')](_0xcdc9('0xf'),_0x3feb96,_0x5db48d[_0xcdc9('0x13')][_0xcdc9('0x15')]);return _0x3a7cb4(_0x5db48d[_0xcdc9('0x13')][_0xcdc9('0x15')]);}logger[_0xcdc9('0x13')](_0xcdc9('0xf'),_0x3feb96,_0x5db48d[_0xcdc9('0x13')]['message']);return _0x1afa92(_0x5db48d[_0xcdc9('0x13')][_0xcdc9('0x15')]);}else{logger['info'](_0xcdc9('0xf'),_0x3feb96,_0xcdc9('0x10'));_0x1afa92(_0x5db48d[_0xcdc9('0x16')]['message']);}})[_0xcdc9('0x17')](function(_0x39667e){logger[_0xcdc9('0x13')](_0xcdc9('0xf'),_0x3feb96,_0x39667e);_0x3a7cb4(_0x39667e);});});}exports[_0xcdc9('0x18')]=function(_0x216a90){var _0x36c0db=this;return new Promise(function(_0x12e828,_0x22a5fe){return db[_0xcdc9('0x19')][_0xcdc9('0x1a')]({'raw':_0x216a90[_0xcdc9('0x1b')]?_0x216a90[_0xcdc9('0x1b')][_0xcdc9('0x1c')]===undefined?!![]:![]:!![],'where':_0x216a90[_0xcdc9('0x1b')]?_0x216a90[_0xcdc9('0x1b')]['where']||null:null,'attributes':_0x216a90[_0xcdc9('0x1b')]?_0x216a90['options'][_0xcdc9('0x1d')]||null:null,'limit':_0x216a90[_0xcdc9('0x1b')]?_0x216a90[_0xcdc9('0x1b')][_0xcdc9('0x1e')]||null:null,'include':_0x216a90[_0xcdc9('0x1b')]?_0x216a90['options'][_0xcdc9('0x1f')]?_[_0xcdc9('0x20')](_0x216a90[_0xcdc9('0x1b')]['include'],function(_0x2c565c){return{'model':db[_0x2c565c[_0xcdc9('0x21')]],'as':_0x2c565c['as'],'attributes':_0x2c565c[_0xcdc9('0x1d')],'include':_0x2c565c[_0xcdc9('0x1f')]?_[_0xcdc9('0x20')](_0x2c565c['include'],function(_0x55545e){return{'model':db[_0x55545e[_0xcdc9('0x21')]],'as':_0x55545e['as'],'attributes':_0x55545e[_0xcdc9('0x1d')],'include':_0x55545e[_0xcdc9('0x1f')]?_[_0xcdc9('0x20')](_0x55545e[_0xcdc9('0x1f')],function(_0x2d8c91){return{'model':db[_0x2d8c91[_0xcdc9('0x21')]],'as':_0x2d8c91['as'],'attributes':_0x2d8c91[_0xcdc9('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xcdc9('0xd')](function(_0x464058){logger['info'](_0xcdc9('0x18'),_0x216a90);logger[_0xcdc9('0x22')](_0xcdc9('0x18'),_0x216a90,JSON[_0xcdc9('0x12')](_0x464058));_0x12e828(_0x464058);})['catch'](function(_0x1fb964){logger[_0xcdc9('0x13')](_0xcdc9('0x18'),_0x1fb964[_0xcdc9('0x15')],_0x216a90);_0x22a5fe(_0x36c0db[_0xcdc9('0x13')](0x1f4,_0x1fb964['message']));});});};exports[_0xcdc9('0x23')]=function(_0x2a30da){var _0x511d2c=this;return new Promise(function(_0x50137c,_0x329a91){return db['ChatQueue'][_0xcdc9('0x24')]({'raw':_0x2a30da[_0xcdc9('0x1b')]?_0x2a30da['options'][_0xcdc9('0x1c')]===undefined?!![]:![]:!![],'where':_0x2a30da[_0xcdc9('0x1b')]?_0x2a30da[_0xcdc9('0x1b')][_0xcdc9('0x25')]||null:null,'attributes':_0x2a30da[_0xcdc9('0x1b')]?_0x2a30da[_0xcdc9('0x1b')][_0xcdc9('0x1d')]||null:null,'include':_0x2a30da[_0xcdc9('0x1b')]?_0x2a30da[_0xcdc9('0x1b')][_0xcdc9('0x1f')]?_['map'](_0x2a30da[_0xcdc9('0x1b')][_0xcdc9('0x1f')],function(_0x23040f){return{'model':db[_0x23040f[_0xcdc9('0x21')]],'as':_0x23040f['as'],'attributes':_0x23040f['attributes'],'include':_0x23040f[_0xcdc9('0x1f')]?_['map'](_0x23040f['include'],function(_0x50205c){return{'model':db[_0x50205c['model']],'as':_0x50205c['as'],'attributes':_0x50205c[_0xcdc9('0x1d')],'include':_0x50205c['include']?_[_0xcdc9('0x20')](_0x50205c[_0xcdc9('0x1f')],function(_0x20b75a){return{'model':db[_0x20b75a[_0xcdc9('0x21')]],'as':_0x20b75a['as'],'attributes':_0x20b75a[_0xcdc9('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xcdc9('0xd')](function(_0x51fded){logger['info'](_0xcdc9('0x23'),_0x2a30da);logger[_0xcdc9('0x22')](_0xcdc9('0x23'),_0x2a30da,JSON['stringify'](_0x51fded));_0x50137c(_0x51fded);})[_0xcdc9('0x17')](function(_0x27d4ce){logger[_0xcdc9('0x13')]('ShowChatQueue',_0x27d4ce[_0xcdc9('0x15')],_0x2a30da);_0x329a91(_0x511d2c['error'](0x1f4,_0x27d4ce[_0xcdc9('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 87a39a7..7fea399 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 _0xe13a=['update','emit','removeListener','register','chatQueue:','save','remove'];(function(_0x462fe4,_0x394d3e){var _0x82b23a=function(_0x2c071f){while(--_0x2c071f){_0x462fe4['push'](_0x462fe4['shift']());}};_0x82b23a(++_0x394d3e);}(_0xe13a,0x178));var _0xae13=function(_0x859e7b,_0x560c8a){_0x859e7b=_0x859e7b-0x0;var _0xb9c8a8=_0xe13a[_0x859e7b];return _0xb9c8a8;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0xae13('0x0'),_0xae13('0x1'),_0xae13('0x2')];function createListener(_0x6066c0,_0x4cf961){return function(_0x3aaf90){_0x4cf961[_0xae13('0x3')](_0x6066c0,_0x3aaf90);};}function removeListener(_0x3ebbfe,_0x10abd7){return function(){ChatQueueEvents[_0xae13('0x4')](_0x3ebbfe,_0x10abd7);};}exports[_0xae13('0x5')]=function(_0x412a07){for(var _0x3379ed=0x0,_0x341ba4=events['length'];_0x3379ed<_0x341ba4;_0x3379ed++){var _0x2f6d10=events[_0x3379ed];var _0x2b2e1f=createListener(_0xae13('0x6')+_0x2f6d10,_0x412a07);ChatQueueEvents['on'](_0x2f6d10,_0x2b2e1f);}};
\ No newline at end of file
+var _0xbd50=['length','./chatQueue.events','save','remove','emit'];(function(_0x57aad4,_0x108f28){var _0x26b886=function(_0x222c41){while(--_0x222c41){_0x57aad4['push'](_0x57aad4['shift']());}};_0x26b886(++_0x108f28);}(_0xbd50,0x196));var _0x0bd5=function(_0xd97d5d,_0x26bfca){_0xd97d5d=_0xd97d5d-0x0;var _0x3f34be=_0xbd50[_0xd97d5d];return _0x3f34be;};'use strict';var ChatQueueEvents=require(_0x0bd5('0x0'));var events=[_0x0bd5('0x1'),_0x0bd5('0x2'),'update'];function createListener(_0x44fcb9,_0x167372){return function(_0x37acba){_0x167372[_0x0bd5('0x3')](_0x44fcb9,_0x37acba);};}function removeListener(_0x15620d,_0x4c17ee){return function(){ChatQueueEvents['removeListener'](_0x15620d,_0x4c17ee);};}exports['register']=function(_0x376024){for(var _0x2ef1d0=0x0,_0xcc6cfa=events[_0x0bd5('0x4')];_0x2ef1d0<_0xcc6cfa;_0x2ef1d0++){var _0x1b99f3=events[_0x2ef1d0];var _0x5ebe64=createListener('chatQueue:'+_0x1b99f3,_0x376024);ChatQueueEvents['on'](_0x1b99f3,_0x5ebe64);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index e0f1c57..449a597 100644
--- a/server/api/chatQueue/index.js
+++ b/server/api/chatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x266494,_0x34269f){var _0x446c0d=function(_0x438258){while(--_0x438258){_0x266494['push'](_0x266494['shift']());}};_0x446c0d(++_0x34269f);}(_0xe14b,0x93));var _0xbe14=function(_0x13fe04,_0x261b1c){_0x13fe04=_0x13fe04-0x0;var _0x45867b=_0xe14b[_0x13fe04];return _0x45867b;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router;
\ No newline at end of file
+var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0xa19c53,_0x188f53){var _0x447226=function(_0x1406e1){while(--_0x1406e1){_0xa19c53['push'](_0xa19c53['shift']());}};_0x447226(++_0x188f53);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index b98935d..ad15d68 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 _0xee26=['sequelize','exports','STRING','DATE'];(function(_0x5a685a,_0x14937e){var _0x19db1c=function(_0xa06c44){while(--_0xa06c44){_0x5a685a['push'](_0x5a685a['shift']());}};_0x19db1c(++_0x14937e);}(_0xee26,0x9c));var _0x6ee2=function(_0xef338e,_0x22256e){_0xef338e=_0xef338e-0x0;var _0x3a3dde=_0xee26[_0xef338e];return _0x3a3dde;};'use strict';var moment=require('moment');var Sequelize=require(_0x6ee2('0x0'));module[_0x6ee2('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x6ee2('0x2')]},'joinAt':{'type':Sequelize[_0x6ee2('0x3')]},'leaveAt':{'type':Sequelize[_0x6ee2('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x6ee2('0x3')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x58df=['DATE','moment','sequelize','exports','STRING'];(function(_0x1d25a0,_0x48c1ed){var _0x416b2d=function(_0xe79a39){while(--_0xe79a39){_0x1d25a0['push'](_0x1d25a0['shift']());}};_0x416b2d(++_0x48c1ed);}(_0x58df,0x1cd));var _0xf58d=function(_0x5bbe81,_0x17eaea){_0x5bbe81=_0x5bbe81-0x0;var _0x5cc670=_0x58df[_0x5bbe81];return _0x5cc670;};'use strict';var moment=require(_0xf58d('0x0'));var Sequelize=require(_0xf58d('0x1'));module[_0xf58d('0x2')]={'uniqueid':{'type':Sequelize[_0xf58d('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xf58d('0x4')]},'leaveAt':{'type':Sequelize[_0xf58d('0x4')]},'acceptAt':{'type':Sequelize[_0xf58d('0x4')]},'exitAt':{'type':Sequelize[_0xf58d('0x4')]},'reason':{'type':Sequelize[_0xf58d('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 9e5a593..00b2e63 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 _0x46cb=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','end','error','stack','name','send','index','ChatQueueReport','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','include','rows','catch','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x46cb,0x84));var _0xb46c=function(_0x1d5a32,_0x47974a){_0x1d5a32=_0x1d5a32-0x0;var _0x361ca0=_0x46cb[_0x1d5a32];return _0x361ca0;};'use strict';var emlformat=require(_0xb46c('0x0'));var rimraf=require(_0xb46c('0x1'));var zipdir=require(_0xb46c('0x2'));var jsonpatch=require(_0xb46c('0x3'));var rp=require('request-promise');var moment=require(_0xb46c('0x4'));var BPromise=require(_0xb46c('0x5'));var Mustache=require(_0xb46c('0x6'));var util=require(_0xb46c('0x7'));var path=require('path');var sox=require(_0xb46c('0x8'));var csv=require(_0xb46c('0x9'));var ejs=require(_0xb46c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb46c('0xb'));var squel=require('squel');var crypto=require(_0xb46c('0xc'));var jsforce=require(_0xb46c('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb46c('0xe'));var Papa=require(_0xb46c('0xf'));var Redis=require(_0xb46c('0x10'));var authService=require(_0xb46c('0x11'));var qs=require(_0xb46c('0x12'));var as=require(_0xb46c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb46c('0x14'))(_0xb46c('0x15'));var utils=require(_0xb46c('0x16'));var config=require(_0xb46c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb46c('0x18'))['db'];function respondWithStatusCode(_0x3059da,_0x1dd251){_0x1dd251=_0x1dd251||0xcc;return function(_0x4a3399){if(_0x4a3399){return _0x3059da[_0xb46c('0x19')](_0x1dd251);}return _0x3059da[_0xb46c('0x1a')](_0x1dd251)['end']();};}function respondWithResult(_0x18f1d0,_0x213f4a){_0x213f4a=_0x213f4a||0xc8;return function(_0x967278){if(_0x967278){return _0x18f1d0[_0xb46c('0x1a')](_0x213f4a)[_0xb46c('0x1b')](_0x967278);}};}function respondWithFilteredResult(_0x45c3e1,_0x172bb8){return function(_0x5d431b){if(_0x5d431b){var _0xe4261a=typeof _0x172bb8[_0xb46c('0x1c')]===_0xb46c('0x1d')&&typeof _0x172bb8[_0xb46c('0x1e')]===_0xb46c('0x1d');var _0x2437a0=_0x5d431b['count'];var _0x572860=_0xe4261a?0x0:_0x172bb8[_0xb46c('0x1c')];var _0x4c7ef6=_0xe4261a?_0x5d431b[_0xb46c('0x1f')]:_0x172bb8[_0xb46c('0x1c')]+_0x172bb8[_0xb46c('0x1e')];var _0x32ade3;if(_0x4c7ef6>=_0x2437a0){_0x4c7ef6=_0x2437a0;_0x32ade3=0xc8;}else{_0x32ade3=0xce;}_0x45c3e1['status'](_0x32ade3);return _0x45c3e1[_0xb46c('0x20')]('Content-Range',_0x572860+'-'+_0x4c7ef6+'/'+_0x2437a0)['json'](_0x5d431b);}return null;};}function patchUpdates(_0x87d31d){return function(_0x1b8c8d){try{jsonpatch[_0xb46c('0x21')](_0x1b8c8d,_0x87d31d,!![]);}catch(_0x43ae7c){return BPromise[_0xb46c('0x22')](_0x43ae7c);}return _0x1b8c8d[_0xb46c('0x23')]();};}function saveUpdates(_0x5f3cfb,_0x4d68b1){return function(_0x184038){if(_0x184038){return _0x184038[_0xb46c('0x24')](_0x5f3cfb)[_0xb46c('0x25')](function(_0x11b121){return _0x11b121;});}return null;};}function removeEntity(_0x1e40ed,_0x2b4412){return function(_0x8d71cd){if(_0x8d71cd){return _0x8d71cd['destroy']()[_0xb46c('0x25')](function(){_0x1e40ed[_0xb46c('0x1a')](0xcc)[_0xb46c('0x26')]();});}};}function handleEntityNotFound(_0x47960b,_0x4e822a){return function(_0x20fc36){if(!_0x20fc36){_0x47960b[_0xb46c('0x19')](0x194);}return _0x20fc36;};}function handleError(_0x3ff2a6,_0x2585c6){_0x2585c6=_0x2585c6||0x1f4;return function(_0x463a71){logger[_0xb46c('0x27')](_0x463a71[_0xb46c('0x28')]);if(_0x463a71[_0xb46c('0x29')]){delete _0x463a71[_0xb46c('0x29')];}_0x3ff2a6[_0xb46c('0x1a')](_0x2585c6)[_0xb46c('0x2a')](_0x463a71);};}exports[_0xb46c('0x2b')]=function(_0x4220a9,_0x2c8956){var _0x3cd6e0={},_0x3fab04={},_0x56310b={'count':0x0,'rows':[]};var _0x2412a7=_['map'](db[_0xb46c('0x2c')]['rawAttributes'],function(_0x4dd0bd){return{'name':_0x4dd0bd[_0xb46c('0x2d')],'type':_0x4dd0bd[_0xb46c('0x2e')][_0xb46c('0x2f')]};});_0x3fab04[_0xb46c('0x30')]=_['map'](_0x2412a7,_0xb46c('0x29'));_0x3fab04[_0xb46c('0x31')]=_[_0xb46c('0x32')](_0x4220a9['query']);_0x3fab04[_0xb46c('0x33')]=_['intersection'](_0x3fab04[_0xb46c('0x30')],_0x3fab04['query']);_0x3cd6e0[_0xb46c('0x34')]=_[_0xb46c('0x35')](_0x3fab04[_0xb46c('0x30')],qs[_0xb46c('0x36')](_0x4220a9[_0xb46c('0x31')][_0xb46c('0x36')]));_0x3cd6e0[_0xb46c('0x34')]=_0x3cd6e0[_0xb46c('0x34')][_0xb46c('0x37')]?_0x3cd6e0[_0xb46c('0x34')]:_0x3fab04[_0xb46c('0x30')];if(!_0x4220a9[_0xb46c('0x31')]['hasOwnProperty'](_0xb46c('0x38'))){_0x3cd6e0[_0xb46c('0x1e')]=qs['limit'](_0x4220a9['query']['limit']);_0x3cd6e0['offset']=qs[_0xb46c('0x1c')](_0x4220a9['query'][_0xb46c('0x1c')]);}_0x3cd6e0[_0xb46c('0x39')]=qs[_0xb46c('0x3a')](_0x4220a9[_0xb46c('0x31')]['sort']);_0x3cd6e0[_0xb46c('0x3b')]=qs[_0xb46c('0x33')](_['pick'](_0x4220a9[_0xb46c('0x31')],_0x3fab04[_0xb46c('0x33')]),_0x2412a7);if(_0x4220a9['query'][_0xb46c('0x3c')]){_0x3cd6e0['where']=_[_0xb46c('0x3d')](_0x3cd6e0[_0xb46c('0x3b')],{'$or':_[_0xb46c('0x3e')](_0x2412a7,function(_0x302580){if(_0x302580['type']!==_0xb46c('0x3f')){var _0x4c9db1={};_0x4c9db1[_0x302580[_0xb46c('0x29')]]={'$like':'%'+_0x4220a9[_0xb46c('0x31')]['filter']+'%'};return _0x4c9db1;}})});}_0x3cd6e0=_[_0xb46c('0x3d')]({},_0x3cd6e0,_0x4220a9[_0xb46c('0x40')]);var _0xfa2a48={'where':_0x3cd6e0['where']};return db['ChatQueueReport'][_0xb46c('0x1f')](_0xfa2a48)[_0xb46c('0x25')](function(_0x4e4169){_0x56310b[_0xb46c('0x1f')]=_0x4e4169;if(_0x4220a9['query'][_0xb46c('0x41')]){_0x3cd6e0[_0xb46c('0x42')]=[{'all':!![]}];}return db['ChatQueueReport']['findAll'](_0x3cd6e0);})[_0xb46c('0x25')](function(_0x1c38fe){_0x56310b[_0xb46c('0x43')]=_0x1c38fe;return _0x56310b;})[_0xb46c('0x25')](respondWithFilteredResult(_0x2c8956,_0x3cd6e0))[_0xb46c('0x44')](handleError(_0x2c8956,null));};exports['show']=function(_0x1b9af7,_0x7e15f3){var _0x4fd0d9={'raw':!![],'where':{'id':_0x1b9af7['params']['id']}},_0x20d2e5={};_0x20d2e5[_0xb46c('0x30')]=_[_0xb46c('0x32')](db[_0xb46c('0x2c')]['rawAttributes']);_0x20d2e5[_0xb46c('0x31')]=_['keys'](_0x1b9af7[_0xb46c('0x31')]);_0x20d2e5[_0xb46c('0x33')]=_[_0xb46c('0x35')](_0x20d2e5[_0xb46c('0x30')],_0x20d2e5[_0xb46c('0x31')]);_0x4fd0d9[_0xb46c('0x34')]=_[_0xb46c('0x35')](_0x20d2e5['model'],qs[_0xb46c('0x36')](_0x1b9af7['query'][_0xb46c('0x36')]));_0x4fd0d9[_0xb46c('0x34')]=_0x4fd0d9['attributes'][_0xb46c('0x37')]?_0x4fd0d9[_0xb46c('0x34')]:_0x20d2e5[_0xb46c('0x30')];if(_0x1b9af7['query']['includeAll']){_0x4fd0d9['include']=[{'all':!![]}];}_0x4fd0d9=_['merge']({},_0x4fd0d9,_0x1b9af7['options']);return db[_0xb46c('0x2c')][_0xb46c('0x45')](_0x4fd0d9)[_0xb46c('0x25')](handleEntityNotFound(_0x7e15f3,null))[_0xb46c('0x25')](respondWithResult(_0x7e15f3,null))[_0xb46c('0x44')](handleError(_0x7e15f3,null));};exports[_0xb46c('0x46')]=function(_0x40ca97,_0x44b792){return db[_0xb46c('0x2c')][_0xb46c('0x46')](_0x40ca97['body'],{})[_0xb46c('0x25')](respondWithResult(_0x44b792,0xc9))[_0xb46c('0x44')](handleError(_0x44b792,null));};exports['update']=function(_0x4db28a,_0x63d0d6){if(_0x4db28a['body']['id']){delete _0x4db28a[_0xb46c('0x47')]['id'];}return db[_0xb46c('0x2c')][_0xb46c('0x45')]({'where':{'id':_0x4db28a[_0xb46c('0x48')]['id']}})[_0xb46c('0x25')](handleEntityNotFound(_0x63d0d6,null))[_0xb46c('0x25')](saveUpdates(_0x4db28a[_0xb46c('0x47')],null))[_0xb46c('0x25')](respondWithResult(_0x63d0d6,null))[_0xb46c('0x44')](handleError(_0x63d0d6,null));};exports['destroy']=function(_0x1e0ffe,_0x841649){return db[_0xb46c('0x2c')][_0xb46c('0x45')]({'where':{'id':_0x1e0ffe[_0xb46c('0x48')]['id']}})[_0xb46c('0x25')](handleEntityNotFound(_0x841649,null))[_0xb46c('0x25')](removeEntity(_0x841649,null))[_0xb46c('0x44')](handleError(_0x841649,null));};exports[_0xb46c('0x49')]=function(_0xa6800d,_0x191054){return db['ChatQueueReport'][_0xb46c('0x49')]()[_0xb46c('0x25')](respondWithResult(_0x191054,null))['catch'](handleError(_0x191054,null));};
\ No newline at end of file
+var _0x374c=['../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','status','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','nolimit','order','where','pick','filter','merge','VIRTUAL','ChatQueueReport','includeAll','include','findAll','show','params','options','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x374c,0x1e3));var _0xc374=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x374c[_0x2aec52];return _0x3b8835;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc374('0x0'));var zipdir=require(_0xc374('0x1'));var jsonpatch=require(_0xc374('0x2'));var rp=require(_0xc374('0x3'));var moment=require(_0xc374('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc374('0x5'));var util=require('util');var path=require(_0xc374('0x6'));var sox=require(_0xc374('0x7'));var csv=require('to-csv');var ejs=require(_0xc374('0x8'));var fs=require('fs');var fs_extra=require(_0xc374('0x9'));var _=require(_0xc374('0xa'));var squel=require(_0xc374('0xb'));var crypto=require(_0xc374('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc374('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc374('0xe'));var Redis=require(_0xc374('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xc374('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc374('0x11'));var logger=require(_0xc374('0x12'))(_0xc374('0x13'));var utils=require('../../config/utils');var config=require(_0xc374('0x14'));var licenseUtil=require(_0xc374('0x15'));var db=require(_0xc374('0x16'))['db'];function respondWithStatusCode(_0x5e0f82,_0x44eba3){_0x44eba3=_0x44eba3||0xcc;return function(_0x30bde){if(_0x30bde){return _0x5e0f82[_0xc374('0x17')](_0x44eba3);}return _0x5e0f82['status'](_0x44eba3)[_0xc374('0x18')]();};}function respondWithResult(_0x47a7bf,_0xae92ab){_0xae92ab=_0xae92ab||0xc8;return function(_0x1f472b){if(_0x1f472b){return _0x47a7bf['status'](_0xae92ab)[_0xc374('0x19')](_0x1f472b);}};}function respondWithFilteredResult(_0x3f868a,_0x4109ec){return function(_0x198919){if(_0x198919){var _0x1178a1=typeof _0x4109ec[_0xc374('0x1a')]===_0xc374('0x1b')&&typeof _0x4109ec[_0xc374('0x1c')]===_0xc374('0x1b');var _0x1c3784=_0x198919[_0xc374('0x1d')];var _0x5957c5=_0x1178a1?0x0:_0x4109ec[_0xc374('0x1a')];var _0x3553bb=_0x1178a1?_0x198919[_0xc374('0x1d')]:_0x4109ec['offset']+_0x4109ec[_0xc374('0x1c')];var _0x16c7de;if(_0x3553bb>=_0x1c3784){_0x3553bb=_0x1c3784;_0x16c7de=0xc8;}else{_0x16c7de=0xce;}_0x3f868a['status'](_0x16c7de);return _0x3f868a['set'](_0xc374('0x1e'),_0x5957c5+'-'+_0x3553bb+'/'+_0x1c3784)[_0xc374('0x19')](_0x198919);}return null;};}function patchUpdates(_0x4110bf){return function(_0x2beb98){try{jsonpatch['apply'](_0x2beb98,_0x4110bf,!![]);}catch(_0xa65465){return BPromise[_0xc374('0x1f')](_0xa65465);}return _0x2beb98[_0xc374('0x20')]();};}function saveUpdates(_0x16959d,_0x3cbbad){return function(_0x33c61d){if(_0x33c61d){return _0x33c61d[_0xc374('0x21')](_0x16959d)[_0xc374('0x22')](function(_0x2b7fa6){return _0x2b7fa6;});}return null;};}function removeEntity(_0x18699e,_0x4110a5){return function(_0x5b92c6){if(_0x5b92c6){return _0x5b92c6[_0xc374('0x23')]()[_0xc374('0x22')](function(){_0x18699e[_0xc374('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x460fe1,_0x3d4fb3){return function(_0x19c668){if(!_0x19c668){_0x460fe1[_0xc374('0x17')](0x194);}return _0x19c668;};}function handleError(_0x52d69c,_0x5c6d3e){_0x5c6d3e=_0x5c6d3e||0x1f4;return function(_0x4ad849){logger[_0xc374('0x25')](_0x4ad849[_0xc374('0x26')]);if(_0x4ad849[_0xc374('0x27')]){delete _0x4ad849['name'];}_0x52d69c[_0xc374('0x24')](_0x5c6d3e)['send'](_0x4ad849);};}exports[_0xc374('0x28')]=function(_0xbd1d3d,_0x434c44){var _0x31ae09={},_0x2a87f2={},_0xb7cc5={'count':0x0,'rows':[]};var _0x10b1a0=_[_0xc374('0x29')](db['ChatQueueReport'][_0xc374('0x2a')],function(_0x48aa6f){return{'name':_0x48aa6f[_0xc374('0x2b')],'type':_0x48aa6f[_0xc374('0x2c')][_0xc374('0x2d')]};});_0x2a87f2[_0xc374('0x2e')]=_['map'](_0x10b1a0,_0xc374('0x27'));_0x2a87f2['query']=_[_0xc374('0x2f')](_0xbd1d3d[_0xc374('0x30')]);_0x2a87f2[_0xc374('0x31')]=_[_0xc374('0x32')](_0x2a87f2[_0xc374('0x2e')],_0x2a87f2[_0xc374('0x30')]);_0x31ae09[_0xc374('0x33')]=_[_0xc374('0x32')](_0x2a87f2[_0xc374('0x2e')],qs[_0xc374('0x34')](_0xbd1d3d[_0xc374('0x30')][_0xc374('0x34')]));_0x31ae09['attributes']=_0x31ae09[_0xc374('0x33')]['length']?_0x31ae09[_0xc374('0x33')]:_0x2a87f2[_0xc374('0x2e')];if(!_0xbd1d3d[_0xc374('0x30')]['hasOwnProperty'](_0xc374('0x35'))){_0x31ae09[_0xc374('0x1c')]=qs['limit'](_0xbd1d3d[_0xc374('0x30')][_0xc374('0x1c')]);_0x31ae09[_0xc374('0x1a')]=qs[_0xc374('0x1a')](_0xbd1d3d[_0xc374('0x30')][_0xc374('0x1a')]);}_0x31ae09[_0xc374('0x36')]=qs['sort'](_0xbd1d3d['query']['sort']);_0x31ae09[_0xc374('0x37')]=qs[_0xc374('0x31')](_[_0xc374('0x38')](_0xbd1d3d[_0xc374('0x30')],_0x2a87f2['filters']),_0x10b1a0);if(_0xbd1d3d[_0xc374('0x30')][_0xc374('0x39')]){_0x31ae09[_0xc374('0x37')]=_[_0xc374('0x3a')](_0x31ae09['where'],{'$or':_['map'](_0x10b1a0,function(_0x53cc84){if(_0x53cc84[_0xc374('0x2c')]!==_0xc374('0x3b')){var _0x5c4011={};_0x5c4011[_0x53cc84[_0xc374('0x27')]]={'$like':'%'+_0xbd1d3d[_0xc374('0x30')]['filter']+'%'};return _0x5c4011;}})});}_0x31ae09=_[_0xc374('0x3a')]({},_0x31ae09,_0xbd1d3d['options']);var _0x5baff8={'where':_0x31ae09[_0xc374('0x37')]};return db[_0xc374('0x3c')][_0xc374('0x1d')](_0x5baff8)[_0xc374('0x22')](function(_0x39b59f){_0xb7cc5['count']=_0x39b59f;if(_0xbd1d3d[_0xc374('0x30')][_0xc374('0x3d')]){_0x31ae09[_0xc374('0x3e')]=[{'all':!![]}];}return db[_0xc374('0x3c')][_0xc374('0x3f')](_0x31ae09);})[_0xc374('0x22')](function(_0x39225c){_0xb7cc5['rows']=_0x39225c;return _0xb7cc5;})[_0xc374('0x22')](respondWithFilteredResult(_0x434c44,_0x31ae09))['catch'](handleError(_0x434c44,null));};exports[_0xc374('0x40')]=function(_0x4f5e44,_0x59e86d){var _0x3abfe5={'raw':!![],'where':{'id':_0x4f5e44[_0xc374('0x41')]['id']}},_0xb4b71b={};_0xb4b71b['model']=_[_0xc374('0x2f')](db[_0xc374('0x3c')]['rawAttributes']);_0xb4b71b[_0xc374('0x30')]=_[_0xc374('0x2f')](_0x4f5e44[_0xc374('0x30')]);_0xb4b71b[_0xc374('0x31')]=_[_0xc374('0x32')](_0xb4b71b[_0xc374('0x2e')],_0xb4b71b[_0xc374('0x30')]);_0x3abfe5[_0xc374('0x33')]=_['intersection'](_0xb4b71b['model'],qs[_0xc374('0x34')](_0x4f5e44[_0xc374('0x30')]['fields']));_0x3abfe5[_0xc374('0x33')]=_0x3abfe5[_0xc374('0x33')]['length']?_0x3abfe5[_0xc374('0x33')]:_0xb4b71b[_0xc374('0x2e')];if(_0x4f5e44[_0xc374('0x30')][_0xc374('0x3d')]){_0x3abfe5[_0xc374('0x3e')]=[{'all':!![]}];}_0x3abfe5=_[_0xc374('0x3a')]({},_0x3abfe5,_0x4f5e44[_0xc374('0x42')]);return db[_0xc374('0x3c')][_0xc374('0x43')](_0x3abfe5)[_0xc374('0x22')](handleEntityNotFound(_0x59e86d,null))['then'](respondWithResult(_0x59e86d,null))[_0xc374('0x44')](handleError(_0x59e86d,null));};exports['create']=function(_0x45a599,_0x423d05){return db['ChatQueueReport'][_0xc374('0x45')](_0x45a599[_0xc374('0x46')],{})[_0xc374('0x22')](respondWithResult(_0x423d05,0xc9))[_0xc374('0x44')](handleError(_0x423d05,null));};exports[_0xc374('0x21')]=function(_0x549b95,_0x42d0cc){if(_0x549b95[_0xc374('0x46')]['id']){delete _0x549b95[_0xc374('0x46')]['id'];}return db['ChatQueueReport'][_0xc374('0x43')]({'where':{'id':_0x549b95['params']['id']}})[_0xc374('0x22')](handleEntityNotFound(_0x42d0cc,null))[_0xc374('0x22')](saveUpdates(_0x549b95[_0xc374('0x46')],null))['then'](respondWithResult(_0x42d0cc,null))[_0xc374('0x44')](handleError(_0x42d0cc,null));};exports['destroy']=function(_0x1cf1cf,_0x3d001b){return db[_0xc374('0x3c')][_0xc374('0x43')]({'where':{'id':_0x1cf1cf[_0xc374('0x41')]['id']}})[_0xc374('0x22')](handleEntityNotFound(_0x3d001b,null))['then'](removeEntity(_0x3d001b,null))[_0xc374('0x44')](handleError(_0x3d001b,null));};exports['describe']=function(_0x3dba84,_0x3b63e5){return db[_0xc374('0x3c')][_0xc374('0x47')]()[_0xc374('0x22')](respondWithResult(_0x3b63e5,null))['catch'](handleError(_0x3b63e5,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index c60a4a3..239cadd 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 _0xcb91=['path','rimraf','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x435b13,_0x43f5b9){var _0x1309a3=function(_0xfe6e8a){while(--_0xfe6e8a){_0x435b13['push'](_0x435b13['shift']());}};_0x1309a3(++_0x43f5b9);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x44a64f,_0x38475c){_0x44a64f=_0x44a64f-0x0;var _0x52024b=_0xcb91[_0x44a64f];return _0x52024b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('ChatQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x4066ef,_0x87236d){var _0x195d64=function(_0x3d4870){while(--_0x3d4870){_0x4066ef['push'](_0x4066ef['shift']());}};_0x195d64(++_0x87236d);}(_0xbaf0,0x12a));var _0x0baf=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xbaf0[_0x4cf98e];return _0x1623ac;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 1b69600..415fdfa 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 _0x0cce=['message','result','CreateChatQueueReport','ChatQueueReport','create','options','raw','catch','UpdateChatQueueReport','update','body','where','attributes','limit','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5c81c2,_0x3e18a2){var _0x16a5a4=function(_0x3d60ec){while(--_0x3d60ec){_0x5c81c2['push'](_0x5c81c2['shift']());}};_0x16a5a4(++_0x3e18a2);}(_0x0cce,0xf6));var _0xe0cc=function(_0x3e0dc4,_0x13971b){_0x3e0dc4=_0x3e0dc4-0x0;var _0x586111=_0x0cce[_0x3e0dc4];return _0x586111;};'use strict';var _=require(_0xe0cc('0x0'));var util=require(_0xe0cc('0x1'));var moment=require(_0xe0cc('0x2'));var BPromise=require(_0xe0cc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe0cc('0x4'));var db=require(_0xe0cc('0x5'))['db'];var utils=require(_0xe0cc('0x6'));var logger=require('../../config/logger')(_0xe0cc('0x7'));var config=require(_0xe0cc('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe0cc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x437d77,_0x2c06bb,_0x2d0a0d){return new BPromise(function(_0x1354e6,_0x1a48ab){return client[_0xe0cc('0xa')](_0x437d77,_0x2d0a0d)[_0xe0cc('0xb')](function(_0x353b76){logger[_0xe0cc('0xc')](_0xe0cc('0xd'),_0x2c06bb,_0xe0cc('0xe'));logger['debug'](_0xe0cc('0xf'),_0x2c06bb,'request\x20sent',JSON[_0xe0cc('0x10')](_0x353b76));if(_0x353b76[_0xe0cc('0x11')]){if(_0x353b76[_0xe0cc('0x11')]['code']===0x1f4){logger[_0xe0cc('0x11')](_0xe0cc('0xd'),_0x2c06bb,_0x353b76[_0xe0cc('0x11')][_0xe0cc('0x12')]);return _0x1a48ab(_0x353b76[_0xe0cc('0x11')][_0xe0cc('0x12')]);}logger['error'](_0xe0cc('0xd'),_0x2c06bb,_0x353b76[_0xe0cc('0x11')][_0xe0cc('0x12')]);return _0x1354e6(_0x353b76[_0xe0cc('0x11')][_0xe0cc('0x12')]);}else{logger['info'](_0xe0cc('0xd'),_0x2c06bb,_0xe0cc('0xe'));_0x1354e6(_0x353b76[_0xe0cc('0x13')][_0xe0cc('0x12')]);}})['catch'](function(_0x5708be){logger[_0xe0cc('0x11')](_0xe0cc('0xd'),_0x2c06bb,_0x5708be);_0x1a48ab(_0x5708be);});});}exports[_0xe0cc('0x14')]=function(_0x5777e3){var _0x2ea767=this;return new Promise(function(_0x585760,_0x1e2bf9){return db[_0xe0cc('0x15')][_0xe0cc('0x16')](_0x5777e3['body'],{'raw':_0x5777e3[_0xe0cc('0x17')]?_0x5777e3['options'][_0xe0cc('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x597136){logger[_0xe0cc('0xc')](_0xe0cc('0x14'),_0x5777e3);logger['debug'](_0xe0cc('0x14'),_0x5777e3,JSON[_0xe0cc('0x10')](_0x597136));_0x585760(_0x597136);})[_0xe0cc('0x19')](function(_0x4aca44){logger[_0xe0cc('0x11')](_0xe0cc('0x14'),_0x4aca44[_0xe0cc('0x12')],_0x5777e3);_0x1e2bf9(_0x2ea767[_0xe0cc('0x11')](0x1f4,_0x4aca44['message']));});});};exports[_0xe0cc('0x1a')]=function(_0x1c45af){var _0x24c006=this;return new Promise(function(_0x5c9382,_0x28b7ac){return db[_0xe0cc('0x15')][_0xe0cc('0x1b')](_0x1c45af[_0xe0cc('0x1c')],{'raw':_0x1c45af[_0xe0cc('0x17')]?_0x1c45af[_0xe0cc('0x17')][_0xe0cc('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c45af['options']?_0x1c45af['options'][_0xe0cc('0x1d')]||null:null,'attributes':_0x1c45af[_0xe0cc('0x17')]?_0x1c45af[_0xe0cc('0x17')][_0xe0cc('0x1e')]||null:null,'limit':_0x1c45af[_0xe0cc('0x17')]?_0x1c45af[_0xe0cc('0x17')][_0xe0cc('0x1f')]||null:null})['then'](function(_0x5ef449){logger[_0xe0cc('0xc')](_0xe0cc('0x1a'),_0x1c45af);logger[_0xe0cc('0x20')](_0xe0cc('0x1a'),_0x1c45af,JSON[_0xe0cc('0x10')](_0x5ef449));_0x5c9382(_0x5ef449);})['catch'](function(_0x2b8aa9){logger[_0xe0cc('0x11')]('UpdateChatQueueReport',_0x2b8aa9[_0xe0cc('0x12')],_0x1c45af);_0x28b7ac(_0x24c006[_0xe0cc('0x11')](0x1f4,_0x2b8aa9[_0xe0cc('0x12')]));});});};
\ No newline at end of file
+var _0x11ad=['ChatQueueReport','body','where','limit','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateChatQueueReport','create','options','raw','UpdateChatQueueReport'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x11ad,0x13a));var _0xd11a=function(_0x522775,_0x40d0b2){_0x522775=_0x522775-0x0;var _0x333780=_0x11ad[_0x522775];return _0x333780;};'use strict';var _=require(_0xd11a('0x0'));var util=require(_0xd11a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd11a('0x2'));var fs=require('fs');var Redis=require(_0xd11a('0x3'));var db=require(_0xd11a('0x4'))['db'];var utils=require(_0xd11a('0x5'));var logger=require('../../config/logger')(_0xd11a('0x6'));var config=require(_0xd11a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd11a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a08dd,_0x367925,_0x3965e6){return new BPromise(function(_0x4871ee,_0x3e5859){return client[_0xd11a('0x9')](_0x2a08dd,_0x3965e6)[_0xd11a('0xa')](function(_0x547afd){logger[_0xd11a('0xb')](_0xd11a('0xc'),_0x367925,'request\x20sent');logger[_0xd11a('0xd')](_0xd11a('0xe'),_0x367925,_0xd11a('0xf'),JSON[_0xd11a('0x10')](_0x547afd));if(_0x547afd[_0xd11a('0x11')]){if(_0x547afd[_0xd11a('0x11')][_0xd11a('0x12')]===0x1f4){logger['error'](_0xd11a('0xc'),_0x367925,_0x547afd[_0xd11a('0x11')][_0xd11a('0x13')]);return _0x3e5859(_0x547afd[_0xd11a('0x11')][_0xd11a('0x13')]);}logger[_0xd11a('0x11')](_0xd11a('0xc'),_0x367925,_0x547afd[_0xd11a('0x11')][_0xd11a('0x13')]);return _0x4871ee(_0x547afd[_0xd11a('0x11')][_0xd11a('0x13')]);}else{logger[_0xd11a('0xb')](_0xd11a('0xc'),_0x367925,_0xd11a('0xf'));_0x4871ee(_0x547afd[_0xd11a('0x14')][_0xd11a('0x13')]);}})[_0xd11a('0x15')](function(_0x2fc782){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x367925,_0x2fc782);_0x3e5859(_0x2fc782);});});}exports[_0xd11a('0x16')]=function(_0x37ff0c){var _0x3843fc=this;return new Promise(function(_0x175c18,_0x153ac0){return db['ChatQueueReport'][_0xd11a('0x17')](_0x37ff0c['body'],{'raw':_0x37ff0c[_0xd11a('0x18')]?_0x37ff0c[_0xd11a('0x18')][_0xd11a('0x19')]===undefined?!![]:![]:!![]})[_0xd11a('0xa')](function(_0xf6cdcf){logger['info'](_0xd11a('0x16'),_0x37ff0c);logger[_0xd11a('0xd')](_0xd11a('0x16'),_0x37ff0c,JSON[_0xd11a('0x10')](_0xf6cdcf));_0x175c18(_0xf6cdcf);})['catch'](function(_0x249e64){logger['error'](_0xd11a('0x16'),_0x249e64['message'],_0x37ff0c);_0x153ac0(_0x3843fc[_0xd11a('0x11')](0x1f4,_0x249e64[_0xd11a('0x13')]));});});};exports[_0xd11a('0x1a')]=function(_0x412ee6){var _0x37fa60=this;return new Promise(function(_0x446e35,_0x53ddd1){return db[_0xd11a('0x1b')]['update'](_0x412ee6[_0xd11a('0x1c')],{'raw':_0x412ee6[_0xd11a('0x18')]?_0x412ee6[_0xd11a('0x18')][_0xd11a('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x412ee6['options']?_0x412ee6[_0xd11a('0x18')][_0xd11a('0x1d')]||null:null,'attributes':_0x412ee6[_0xd11a('0x18')]?_0x412ee6['options']['attributes']||null:null,'limit':_0x412ee6[_0xd11a('0x18')]?_0x412ee6[_0xd11a('0x18')][_0xd11a('0x1e')]||null:null})[_0xd11a('0xa')](function(_0x2ebbaa){logger[_0xd11a('0xb')]('UpdateChatQueueReport',_0x412ee6);logger[_0xd11a('0xd')](_0xd11a('0x1a'),_0x412ee6,JSON[_0xd11a('0x10')](_0x2ebbaa));_0x446e35(_0x2ebbaa);})[_0xd11a('0x15')](function(_0x224f15){logger[_0xd11a('0x11')](_0xd11a('0x1a'),_0x224f15[_0xd11a('0x13')],_0x412ee6);_0x53ddd1(_0x37fa60[_0xd11a('0x11')](0x1f4,_0x224f15['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 4300b84..c91343c 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 _0xc5df=['util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','index','/describe','isAuthenticated','describe','/:id','show','post','create','update','delete','multer'];(function(_0x32dce6,_0x23f570){var _0x1191ba=function(_0x58efa8){while(--_0x58efa8){_0x32dce6['push'](_0x32dce6['shift']());}};_0x1191ba(++_0x23f570);}(_0xc5df,0x143));var _0xfc5d=function(_0x2d0b33,_0x13b6d3){_0x2d0b33=_0x2d0b33-0x0;var _0x5ceb77=_0xc5df[_0x2d0b33];return _0x5ceb77;};'use strict';var multer=require(_0xfc5d('0x0'));var util=require(_0xfc5d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfc5d('0x2'));var router=express[_0xfc5d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xfc5d('0x4'));var interaction=require(_0xfc5d('0x5'));var config=require(_0xfc5d('0x6'));var controller=require(_0xfc5d('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xfc5d('0x8')]);router['get'](_0xfc5d('0x9'),auth[_0xfc5d('0xa')](),controller[_0xfc5d('0xb')]);router['get'](_0xfc5d('0xc'),auth[_0xfc5d('0xa')](),controller[_0xfc5d('0xd')]);router[_0xfc5d('0xe')]('/',auth[_0xfc5d('0xa')](),controller[_0xfc5d('0xf')]);router['put'](_0xfc5d('0xc'),auth[_0xfc5d('0xa')](),controller[_0xfc5d('0x10')]);router[_0xfc5d('0x11')](_0xfc5d('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x3b99=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','delete','exports','multer','util','path','connect-timeout'];(function(_0x488bdb,_0x3de599){var _0xefb0b0=function(_0x5b390a){while(--_0x5b390a){_0x488bdb['push'](_0x488bdb['shift']());}};_0xefb0b0(++_0x3de599);}(_0x3b99,0x80));var _0x93b9=function(_0x491ea4,_0x30b0e7){_0x491ea4=_0x491ea4-0x0;var _0x225362=_0x3b99[_0x491ea4];return _0x225362;};'use strict';var multer=require(_0x93b9('0x0'));var util=require(_0x93b9('0x1'));var path=require(_0x93b9('0x2'));var timeout=require(_0x93b9('0x3'));var express=require(_0x93b9('0x4'));var router=express[_0x93b9('0x5')]();var fs_extra=require(_0x93b9('0x6'));var auth=require(_0x93b9('0x7'));var interaction=require(_0x93b9('0x8'));var config=require('../../config/environment');var controller=require(_0x93b9('0x9'));router['get']('/',auth[_0x93b9('0xa')](),controller[_0x93b9('0xb')]);router[_0x93b9('0xc')](_0x93b9('0xd'),auth[_0x93b9('0xa')](),controller[_0x93b9('0xe')]);router[_0x93b9('0xc')](_0x93b9('0xf'),auth['isAuthenticated'](),controller[_0x93b9('0x10')]);router[_0x93b9('0x11')]('/',auth[_0x93b9('0xa')](),controller[_0x93b9('0x12')]);router[_0x93b9('0x13')](_0x93b9('0xf'),auth[_0x93b9('0xa')](),controller['update']);router[_0x93b9('0x14')](_0x93b9('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x93b9('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 253c1f8..98efe13 100644
--- a/server/api/chatTransferReport/chatTransferReport.attributes.js
+++ b/server/api/chatTransferReport/chatTransferReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x2d8f6c,_0x44db4c){var _0x3a00f6=function(_0x1b16ea){while(--_0x1b16ea){_0x2d8f6c['push'](_0x2d8f6c['shift']());}};_0x3a00f6(++_0x44db4c);}(_0x34e8,0x12c));var _0x834e=function(_0x3528b4,_0x3b1fa1){_0x3528b4=_0x3528b4-0x0;var _0x45462a=_0x34e8[_0x3528b4];return _0x45462a;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}};
\ No newline at end of file
+var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x37978d,_0x3aa658){var _0x7ad95e=function(_0xaa5d17){while(--_0xaa5d17){_0x37978d['push'](_0x37978d['shift']());}};_0x7ad95e(++_0x3aa658);}(_0x70e0,0x17b));var _0x070e=function(_0x4b340d,_0x157994){_0x4b340d=_0x4b340d-0x0;var _0x34f211=_0x70e0[_0x4b340d];return _0x34f211;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 7d7e0b2..9107856 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 _0x5227=['../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','stack','name','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatTransferReport','include','rows','catch','params','rawAttributes','includeAll','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5227,0x113));var _0x7522=function(_0x3ec751,_0x3009cd){_0x3ec751=_0x3ec751-0x0;var _0x252150=_0x5227[_0x3ec751];return _0x252150;};'use strict';var emlformat=require(_0x7522('0x0'));var rimraf=require(_0x7522('0x1'));var zipdir=require(_0x7522('0x2'));var jsonpatch=require(_0x7522('0x3'));var rp=require('request-promise');var moment=require(_0x7522('0x4'));var BPromise=require(_0x7522('0x5'));var Mustache=require(_0x7522('0x6'));var util=require(_0x7522('0x7'));var path=require('path');var sox=require(_0x7522('0x8'));var csv=require(_0x7522('0x9'));var ejs=require(_0x7522('0xa'));var fs=require('fs');var fs_extra=require(_0x7522('0xb'));var _=require(_0x7522('0xc'));var squel=require(_0x7522('0xd'));var crypto=require(_0x7522('0xe'));var jsforce=require(_0x7522('0xf'));var deskjs=require(_0x7522('0x10'));var toCsv=require(_0x7522('0x9'));var querystring=require(_0x7522('0x11'));var Papa=require('papaparse');var Redis=require(_0x7522('0x12'));var authService=require(_0x7522('0x13'));var qs=require(_0x7522('0x14'));var as=require(_0x7522('0x15'));var hardwareService=require(_0x7522('0x16'));var logger=require(_0x7522('0x17'))(_0x7522('0x18'));var utils=require('../../config/utils');var config=require(_0x7522('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x7522('0x1a'))['db'];function respondWithStatusCode(_0x826b2e,_0x35597d){_0x35597d=_0x35597d||0xcc;return function(_0x5eaa4d){if(_0x5eaa4d){return _0x826b2e[_0x7522('0x1b')](_0x35597d);}return _0x826b2e[_0x7522('0x1c')](_0x35597d)[_0x7522('0x1d')]();};}function respondWithResult(_0x32ccda,_0x327b52){_0x327b52=_0x327b52||0xc8;return function(_0x51f7c2){if(_0x51f7c2){return _0x32ccda['status'](_0x327b52)['json'](_0x51f7c2);}};}function respondWithFilteredResult(_0x5f51d2,_0x4e1916){return function(_0x271f6c){if(_0x271f6c){var _0x2c4950=typeof _0x4e1916[_0x7522('0x1e')]===_0x7522('0x1f')&&typeof _0x4e1916[_0x7522('0x20')]===_0x7522('0x1f');var _0x33255a=_0x271f6c[_0x7522('0x21')];var _0x78048=_0x2c4950?0x0:_0x4e1916[_0x7522('0x1e')];var _0x132b6c=_0x2c4950?_0x271f6c['count']:_0x4e1916[_0x7522('0x1e')]+_0x4e1916[_0x7522('0x20')];var _0xf50ab0;if(_0x132b6c>=_0x33255a){_0x132b6c=_0x33255a;_0xf50ab0=0xc8;}else{_0xf50ab0=0xce;}_0x5f51d2[_0x7522('0x1c')](_0xf50ab0);return _0x5f51d2['set'](_0x7522('0x22'),_0x78048+'-'+_0x132b6c+'/'+_0x33255a)['json'](_0x271f6c);}return null;};}function patchUpdates(_0x34c76d){return function(_0x3d432e){try{jsonpatch['apply'](_0x3d432e,_0x34c76d,!![]);}catch(_0x4ccbbd){return BPromise[_0x7522('0x23')](_0x4ccbbd);}return _0x3d432e[_0x7522('0x24')]();};}function saveUpdates(_0x4a9cac,_0x29586a){return function(_0x25699f){if(_0x25699f){return _0x25699f[_0x7522('0x25')](_0x4a9cac)[_0x7522('0x26')](function(_0x91311e){return _0x91311e;});}return null;};}function removeEntity(_0x3ece42,_0x1f3a5f){return function(_0x5d1b4e){if(_0x5d1b4e){return _0x5d1b4e[_0x7522('0x27')]()['then'](function(){_0x3ece42['status'](0xcc)[_0x7522('0x1d')]();});}};}function handleEntityNotFound(_0x3ef256,_0x123044){return function(_0x53c8c7){if(!_0x53c8c7){_0x3ef256[_0x7522('0x1b')](0x194);}return _0x53c8c7;};}function handleError(_0xbb4d8c,_0x33afa9){_0x33afa9=_0x33afa9||0x1f4;return function(_0x4af7b0){logger['error'](_0x4af7b0[_0x7522('0x28')]);if(_0x4af7b0['name']){delete _0x4af7b0[_0x7522('0x29')];}_0xbb4d8c['status'](_0x33afa9)['send'](_0x4af7b0);};}exports[_0x7522('0x2a')]=function(_0x36a61d,_0x54154c){var _0x82adfe={},_0x4d64b3={},_0x30c834={'count':0x0,'rows':[]};var _0x5d3611=_[_0x7522('0x2b')](db['ChatTransferReport']['rawAttributes'],function(_0x1c34e8){return{'name':_0x1c34e8[_0x7522('0x2c')],'type':_0x1c34e8[_0x7522('0x2d')][_0x7522('0x2e')]};});_0x4d64b3[_0x7522('0x2f')]=_[_0x7522('0x2b')](_0x5d3611,_0x7522('0x29'));_0x4d64b3[_0x7522('0x30')]=_[_0x7522('0x31')](_0x36a61d[_0x7522('0x30')]);_0x4d64b3[_0x7522('0x32')]=_[_0x7522('0x33')](_0x4d64b3['model'],_0x4d64b3[_0x7522('0x30')]);_0x82adfe[_0x7522('0x34')]=_['intersection'](_0x4d64b3[_0x7522('0x2f')],qs['fields'](_0x36a61d[_0x7522('0x30')][_0x7522('0x35')]));_0x82adfe[_0x7522('0x34')]=_0x82adfe[_0x7522('0x34')][_0x7522('0x36')]?_0x82adfe[_0x7522('0x34')]:_0x4d64b3[_0x7522('0x2f')];if(!_0x36a61d[_0x7522('0x30')]['hasOwnProperty'](_0x7522('0x37'))){_0x82adfe[_0x7522('0x20')]=qs[_0x7522('0x20')](_0x36a61d[_0x7522('0x30')][_0x7522('0x20')]);_0x82adfe['offset']=qs[_0x7522('0x1e')](_0x36a61d['query'][_0x7522('0x1e')]);}_0x82adfe[_0x7522('0x38')]=qs[_0x7522('0x39')](_0x36a61d['query']['sort']);_0x82adfe[_0x7522('0x3a')]=qs[_0x7522('0x32')](_[_0x7522('0x3b')](_0x36a61d[_0x7522('0x30')],_0x4d64b3[_0x7522('0x32')]),_0x5d3611);if(_0x36a61d[_0x7522('0x30')][_0x7522('0x3c')]){_0x82adfe[_0x7522('0x3a')]=_[_0x7522('0x3d')](_0x82adfe[_0x7522('0x3a')],{'$or':_['map'](_0x5d3611,function(_0x131eaf){if(_0x131eaf['type']!==_0x7522('0x3e')){var _0x45d82e={};_0x45d82e[_0x131eaf['name']]={'$like':'%'+_0x36a61d[_0x7522('0x30')][_0x7522('0x3c')]+'%'};return _0x45d82e;}})});}_0x82adfe=_[_0x7522('0x3d')]({},_0x82adfe,_0x36a61d[_0x7522('0x3f')]);var _0x11367a={'where':_0x82adfe[_0x7522('0x3a')]};return db[_0x7522('0x40')][_0x7522('0x21')](_0x11367a)['then'](function(_0x232822){_0x30c834[_0x7522('0x21')]=_0x232822;if(_0x36a61d['query']['includeAll']){_0x82adfe[_0x7522('0x41')]=[{'all':!![]}];}return db[_0x7522('0x40')]['findAll'](_0x82adfe);})['then'](function(_0xb2c8da){_0x30c834[_0x7522('0x42')]=_0xb2c8da;return _0x30c834;})[_0x7522('0x26')](respondWithFilteredResult(_0x54154c,_0x82adfe))[_0x7522('0x43')](handleError(_0x54154c,null));};exports['show']=function(_0x3e0c7d,_0x564f61){var _0x34a7b2={'raw':!![],'where':{'id':_0x3e0c7d[_0x7522('0x44')]['id']}},_0x2ca2e7={};_0x2ca2e7['model']=_['keys'](db[_0x7522('0x40')][_0x7522('0x45')]);_0x2ca2e7[_0x7522('0x30')]=_['keys'](_0x3e0c7d[_0x7522('0x30')]);_0x2ca2e7['filters']=_['intersection'](_0x2ca2e7['model'],_0x2ca2e7[_0x7522('0x30')]);_0x34a7b2['attributes']=_[_0x7522('0x33')](_0x2ca2e7['model'],qs[_0x7522('0x35')](_0x3e0c7d[_0x7522('0x30')]['fields']));_0x34a7b2[_0x7522('0x34')]=_0x34a7b2[_0x7522('0x34')][_0x7522('0x36')]?_0x34a7b2[_0x7522('0x34')]:_0x2ca2e7[_0x7522('0x2f')];if(_0x3e0c7d[_0x7522('0x30')][_0x7522('0x46')]){_0x34a7b2[_0x7522('0x41')]=[{'all':!![]}];}_0x34a7b2=_['merge']({},_0x34a7b2,_0x3e0c7d['options']);return db[_0x7522('0x40')]['find'](_0x34a7b2)[_0x7522('0x26')](handleEntityNotFound(_0x564f61,null))[_0x7522('0x26')](respondWithResult(_0x564f61,null))[_0x7522('0x43')](handleError(_0x564f61,null));};exports[_0x7522('0x47')]=function(_0xd6c4c2,_0x282df1){return db[_0x7522('0x40')][_0x7522('0x47')](_0xd6c4c2[_0x7522('0x48')],{})[_0x7522('0x26')](respondWithResult(_0x282df1,0xc9))[_0x7522('0x43')](handleError(_0x282df1,null));};exports[_0x7522('0x25')]=function(_0x4a2784,_0xe7d0c5){if(_0x4a2784[_0x7522('0x48')]['id']){delete _0x4a2784['body']['id'];}return db[_0x7522('0x40')][_0x7522('0x49')]({'where':{'id':_0x4a2784['params']['id']}})[_0x7522('0x26')](handleEntityNotFound(_0xe7d0c5,null))[_0x7522('0x26')](saveUpdates(_0x4a2784[_0x7522('0x48')],null))[_0x7522('0x26')](respondWithResult(_0xe7d0c5,null))[_0x7522('0x43')](handleError(_0xe7d0c5,null));};exports['destroy']=function(_0x39775b,_0x57fd8c){return db[_0x7522('0x40')][_0x7522('0x49')]({'where':{'id':_0x39775b[_0x7522('0x44')]['id']}})[_0x7522('0x26')](handleEntityNotFound(_0x57fd8c,null))[_0x7522('0x26')](removeEntity(_0x57fd8c,null))[_0x7522('0x43')](handleError(_0x57fd8c,null));};exports['describe']=function(_0x46673e,_0x1bce7f){return db[_0x7522('0x40')][_0x7522('0x4a')]()[_0x7522('0x26')](respondWithResult(_0x1bce7f,null))[_0x7522('0x43')](handleError(_0x1bce7f,null));};
\ No newline at end of file
+var _0xc57e=['filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','options','ChatTransferReport','findAll','rows','catch','show','include','create','body','find','params','describe','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','save','then','destroy','error','name','send','map','rawAttributes','fieldName','type','key','model','keys','query'];(function(_0x215231,_0x3b67de){var _0x41c203=function(_0x306841){while(--_0x306841){_0x215231['push'](_0x215231['shift']());}};_0x41c203(++_0x3b67de);}(_0xc57e,0xa3));var _0xec57=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xc57e[_0x2c91e9];return _0x13f0ff;};'use strict';var emlformat=require(_0xec57('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xec57('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xec57('0x2'));var Mustache=require(_0xec57('0x3'));var util=require(_0xec57('0x4'));var path=require(_0xec57('0x5'));var sox=require(_0xec57('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xec57('0x7'));var _=require(_0xec57('0x8'));var squel=require(_0xec57('0x9'));var crypto=require(_0xec57('0xa'));var jsforce=require(_0xec57('0xb'));var deskjs=require(_0xec57('0xc'));var toCsv=require('to-csv');var querystring=require(_0xec57('0xd'));var Papa=require(_0xec57('0xe'));var Redis=require(_0xec57('0xf'));var authService=require(_0xec57('0x10'));var qs=require(_0xec57('0x11'));var as=require(_0xec57('0x12'));var hardwareService=require(_0xec57('0x13'));var logger=require('../../config/logger')(_0xec57('0x14'));var utils=require(_0xec57('0x15'));var config=require(_0xec57('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xec57('0x17'))['db'];function respondWithStatusCode(_0x349f47,_0x5666e0){_0x5666e0=_0x5666e0||0xcc;return function(_0x56c82e){if(_0x56c82e){return _0x349f47[_0xec57('0x18')](_0x5666e0);}return _0x349f47[_0xec57('0x19')](_0x5666e0)[_0xec57('0x1a')]();};}function respondWithResult(_0x17ab7c,_0x5ddeb4){_0x5ddeb4=_0x5ddeb4||0xc8;return function(_0x7394a1){if(_0x7394a1){return _0x17ab7c[_0xec57('0x19')](_0x5ddeb4)[_0xec57('0x1b')](_0x7394a1);}};}function respondWithFilteredResult(_0x2967ec,_0x5c8e9b){return function(_0x225b5a){if(_0x225b5a){var _0x4a79dd=typeof _0x5c8e9b[_0xec57('0x1c')]==='undefined'&&typeof _0x5c8e9b[_0xec57('0x1d')]===_0xec57('0x1e');var _0x15a3a7=_0x225b5a[_0xec57('0x1f')];var _0x2d3480=_0x4a79dd?0x0:_0x5c8e9b[_0xec57('0x1c')];var _0x1c3e5b=_0x4a79dd?_0x225b5a[_0xec57('0x1f')]:_0x5c8e9b['offset']+_0x5c8e9b[_0xec57('0x1d')];var _0xade45;if(_0x1c3e5b>=_0x15a3a7){_0x1c3e5b=_0x15a3a7;_0xade45=0xc8;}else{_0xade45=0xce;}_0x2967ec['status'](_0xade45);return _0x2967ec['set'](_0xec57('0x20'),_0x2d3480+'-'+_0x1c3e5b+'/'+_0x15a3a7)['json'](_0x225b5a);}return null;};}function patchUpdates(_0x1e42b3){return function(_0x3d1a59){try{jsonpatch['apply'](_0x3d1a59,_0x1e42b3,!![]);}catch(_0x1137bf){return BPromise['reject'](_0x1137bf);}return _0x3d1a59[_0xec57('0x21')]();};}function saveUpdates(_0x1cb341,_0x2069da){return function(_0x2fb28e){if(_0x2fb28e){return _0x2fb28e['update'](_0x1cb341)[_0xec57('0x22')](function(_0x57bbad){return _0x57bbad;});}return null;};}function removeEntity(_0x266a80,_0x484de0){return function(_0xf6e24c){if(_0xf6e24c){return _0xf6e24c[_0xec57('0x23')]()[_0xec57('0x22')](function(){_0x266a80[_0xec57('0x19')](0xcc)[_0xec57('0x1a')]();});}};}function handleEntityNotFound(_0x32128c,_0x371b10){return function(_0x5debaf){if(!_0x5debaf){_0x32128c[_0xec57('0x18')](0x194);}return _0x5debaf;};}function handleError(_0x3ad81a,_0x3cdce){_0x3cdce=_0x3cdce||0x1f4;return function(_0xd72b9){logger[_0xec57('0x24')](_0xd72b9['stack']);if(_0xd72b9[_0xec57('0x25')]){delete _0xd72b9[_0xec57('0x25')];}_0x3ad81a[_0xec57('0x19')](_0x3cdce)[_0xec57('0x26')](_0xd72b9);};}exports['index']=function(_0x49425e,_0x39a201){var _0x30bbee={},_0x42a11d={},_0x438aa6={'count':0x0,'rows':[]};var _0x54ee71=_[_0xec57('0x27')](db['ChatTransferReport'][_0xec57('0x28')],function(_0x3c6635){return{'name':_0x3c6635[_0xec57('0x29')],'type':_0x3c6635[_0xec57('0x2a')][_0xec57('0x2b')]};});_0x42a11d[_0xec57('0x2c')]=_[_0xec57('0x27')](_0x54ee71,'name');_0x42a11d['query']=_[_0xec57('0x2d')](_0x49425e[_0xec57('0x2e')]);_0x42a11d[_0xec57('0x2f')]=_[_0xec57('0x30')](_0x42a11d[_0xec57('0x2c')],_0x42a11d[_0xec57('0x2e')]);_0x30bbee[_0xec57('0x31')]=_[_0xec57('0x30')](_0x42a11d['model'],qs['fields'](_0x49425e[_0xec57('0x2e')][_0xec57('0x32')]));_0x30bbee[_0xec57('0x31')]=_0x30bbee[_0xec57('0x31')][_0xec57('0x33')]?_0x30bbee[_0xec57('0x31')]:_0x42a11d[_0xec57('0x2c')];if(!_0x49425e[_0xec57('0x2e')]['hasOwnProperty'](_0xec57('0x34'))){_0x30bbee['limit']=qs[_0xec57('0x1d')](_0x49425e[_0xec57('0x2e')]['limit']);_0x30bbee[_0xec57('0x1c')]=qs['offset'](_0x49425e[_0xec57('0x2e')][_0xec57('0x1c')]);}_0x30bbee['order']=qs[_0xec57('0x35')](_0x49425e[_0xec57('0x2e')][_0xec57('0x35')]);_0x30bbee[_0xec57('0x36')]=qs['filters'](_[_0xec57('0x37')](_0x49425e['query'],_0x42a11d['filters']),_0x54ee71);if(_0x49425e[_0xec57('0x2e')][_0xec57('0x38')]){_0x30bbee['where']=_[_0xec57('0x39')](_0x30bbee[_0xec57('0x36')],{'$or':_[_0xec57('0x27')](_0x54ee71,function(_0x2a8d99){if(_0x2a8d99[_0xec57('0x2a')]!=='VIRTUAL'){var _0x320cb5={};_0x320cb5[_0x2a8d99[_0xec57('0x25')]]={'$like':'%'+_0x49425e[_0xec57('0x2e')][_0xec57('0x38')]+'%'};return _0x320cb5;}})});}_0x30bbee=_[_0xec57('0x39')]({},_0x30bbee,_0x49425e[_0xec57('0x3a')]);var _0x4a39={'where':_0x30bbee[_0xec57('0x36')]};return db['ChatTransferReport'][_0xec57('0x1f')](_0x4a39)[_0xec57('0x22')](function(_0x22e6a1){_0x438aa6[_0xec57('0x1f')]=_0x22e6a1;if(_0x49425e[_0xec57('0x2e')]['includeAll']){_0x30bbee['include']=[{'all':!![]}];}return db[_0xec57('0x3b')][_0xec57('0x3c')](_0x30bbee);})[_0xec57('0x22')](function(_0x2143c9){_0x438aa6[_0xec57('0x3d')]=_0x2143c9;return _0x438aa6;})[_0xec57('0x22')](respondWithFilteredResult(_0x39a201,_0x30bbee))[_0xec57('0x3e')](handleError(_0x39a201,null));};exports[_0xec57('0x3f')]=function(_0x4f5053,_0x126064){var _0x184576={'raw':!![],'where':{'id':_0x4f5053['params']['id']}},_0x286c8a={};_0x286c8a[_0xec57('0x2c')]=_['keys'](db[_0xec57('0x3b')][_0xec57('0x28')]);_0x286c8a[_0xec57('0x2e')]=_[_0xec57('0x2d')](_0x4f5053[_0xec57('0x2e')]);_0x286c8a[_0xec57('0x2f')]=_[_0xec57('0x30')](_0x286c8a[_0xec57('0x2c')],_0x286c8a[_0xec57('0x2e')]);_0x184576[_0xec57('0x31')]=_['intersection'](_0x286c8a[_0xec57('0x2c')],qs[_0xec57('0x32')](_0x4f5053[_0xec57('0x2e')]['fields']));_0x184576[_0xec57('0x31')]=_0x184576[_0xec57('0x31')][_0xec57('0x33')]?_0x184576[_0xec57('0x31')]:_0x286c8a[_0xec57('0x2c')];if(_0x4f5053[_0xec57('0x2e')]['includeAll']){_0x184576[_0xec57('0x40')]=[{'all':!![]}];}_0x184576=_['merge']({},_0x184576,_0x4f5053[_0xec57('0x3a')]);return db[_0xec57('0x3b')]['find'](_0x184576)[_0xec57('0x22')](handleEntityNotFound(_0x126064,null))[_0xec57('0x22')](respondWithResult(_0x126064,null))[_0xec57('0x3e')](handleError(_0x126064,null));};exports[_0xec57('0x41')]=function(_0x383727,_0x51e8f2){return db[_0xec57('0x3b')][_0xec57('0x41')](_0x383727['body'],{})[_0xec57('0x22')](respondWithResult(_0x51e8f2,0xc9))[_0xec57('0x3e')](handleError(_0x51e8f2,null));};exports['update']=function(_0x487fff,_0x6962fb){if(_0x487fff[_0xec57('0x42')]['id']){delete _0x487fff[_0xec57('0x42')]['id'];}return db[_0xec57('0x3b')][_0xec57('0x43')]({'where':{'id':_0x487fff[_0xec57('0x44')]['id']}})[_0xec57('0x22')](handleEntityNotFound(_0x6962fb,null))[_0xec57('0x22')](saveUpdates(_0x487fff[_0xec57('0x42')],null))[_0xec57('0x22')](respondWithResult(_0x6962fb,null))[_0xec57('0x3e')](handleError(_0x6962fb,null));};exports[_0xec57('0x23')]=function(_0x3f2003,_0x5c52e1){return db[_0xec57('0x3b')][_0xec57('0x43')]({'where':{'id':_0x3f2003['params']['id']}})[_0xec57('0x22')](handleEntityNotFound(_0x5c52e1,null))[_0xec57('0x22')](removeEntity(_0x5c52e1,null))[_0xec57('0x3e')](handleError(_0x5c52e1,null));};exports[_0xec57('0x45')]=function(_0x57f82b,_0x18ed54){return db[_0xec57('0x3b')][_0xec57('0x45')]()[_0xec57('0x22')](respondWithResult(_0x18ed54,null))[_0xec57('0x3e')](handleError(_0x18ed54,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 6602f68..3956cb0 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 _0x9a76=['define','ChatTransferReport','uniqueid','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes'];(function(_0xc17d60,_0x4d3616){var _0x462396=function(_0x23d12e){while(--_0x23d12e){_0xc17d60['push'](_0xc17d60['shift']());}};_0x462396(++_0x4d3616);}(_0x9a76,0x7b));var _0x69a7=function(_0x38d5ee,_0x17438c){_0x38d5ee=_0x38d5ee-0x0;var _0x37c2e4=_0x9a76[_0x38d5ee];return _0x37c2e4;};'use strict';var _=require(_0x69a7('0x0'));var util=require('util');var logger=require(_0x69a7('0x1'))(_0x69a7('0x2'));var moment=require(_0x69a7('0x3'));var BPromise=require('bluebird');var rp=require(_0x69a7('0x4'));var fs=require('fs');var path=require(_0x69a7('0x5'));var rimraf=require(_0x69a7('0x6'));var config=require(_0x69a7('0x7'));var attributes=require(_0x69a7('0x8'));module['exports']=function(_0x36e6fb,_0x9bbfd4){return _0x36e6fb[_0x69a7('0x9')](_0x69a7('0xa'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x69a7('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb106=['./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0xb106,0x1f4));var _0x6b10=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0xb106[_0x1ccdf7];return _0x52a0ae;};'use strict';var _=require('lodash');var util=require(_0x6b10('0x0'));var logger=require(_0x6b10('0x1'))('api');var moment=require('moment');var BPromise=require(_0x6b10('0x2'));var rp=require(_0x6b10('0x3'));var fs=require('fs');var path=require(_0x6b10('0x4'));var rimraf=require(_0x6b10('0x5'));var config=require(_0x6b10('0x6'));var attributes=require(_0x6b10('0x7'));module[_0x6b10('0x8')]=function(_0x2081bb,_0x29b57b){return _0x2081bb[_0x6b10('0x9')](_0x6b10('0xa'),attributes,{'tableName':_0x6b10('0xb'),'paranoid':![],'indexes':[{'name':_0x6b10('0xc'),'fields':[_0x6b10('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index cc1cd17..2de2dc9 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 _0xbdca=['jayson/promise','client','http','request','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x35cb5d,_0x2039d9){var _0x1da2db=function(_0x4172d5){while(--_0x4172d5){_0x35cb5d['push'](_0x35cb5d['shift']());}};_0x1da2db(++_0x2039d9);}(_0xbdca,0x177));var _0xabdc=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xbdca[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0xabdc('0x0'));var util=require(_0xabdc('0x1'));var moment=require(_0xabdc('0x2'));var BPromise=require(_0xabdc('0x3'));var rs=require(_0xabdc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xabdc('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xabdc('0x6'))(_0xabdc('0x7'));var config=require(_0xabdc('0x8'));var jayson=require(_0xabdc('0x9'));var client=jayson[_0xabdc('0xa')][_0xabdc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x38ab68,_0x20930a,_0x314f7c){return new BPromise(function(_0x297da5,_0x47bf1e){return client[_0xabdc('0xc')](_0x38ab68,_0x314f7c)['then'](function(_0x5d7bc1){logger[_0xabdc('0xd')](_0xabdc('0xe'),_0x20930a,_0xabdc('0xf'));logger[_0xabdc('0x10')](_0xabdc('0x11'),_0x20930a,_0xabdc('0xf'),JSON[_0xabdc('0x12')](_0x5d7bc1));if(_0x5d7bc1[_0xabdc('0x13')]){if(_0x5d7bc1[_0xabdc('0x13')][_0xabdc('0x14')]===0x1f4){logger[_0xabdc('0x13')](_0xabdc('0xe'),_0x20930a,_0x5d7bc1[_0xabdc('0x13')][_0xabdc('0x15')]);return _0x47bf1e(_0x5d7bc1['error'][_0xabdc('0x15')]);}logger[_0xabdc('0x13')](_0xabdc('0xe'),_0x20930a,_0x5d7bc1[_0xabdc('0x13')][_0xabdc('0x15')]);return _0x297da5(_0x5d7bc1[_0xabdc('0x13')][_0xabdc('0x15')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x20930a,_0xabdc('0xf'));_0x297da5(_0x5d7bc1[_0xabdc('0x16')][_0xabdc('0x15')]);}})[_0xabdc('0x17')](function(_0x1640a5){logger[_0xabdc('0x13')](_0xabdc('0xe'),_0x20930a,_0x1640a5);_0x47bf1e(_0x1640a5);});});}
\ No newline at end of file
+var _0xd1f5=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','message','catch','util','moment','bluebird','randomstring'];(function(_0x1ed95c,_0xf05dff){var _0x4601b3=function(_0xdcfbc){while(--_0xdcfbc){_0x1ed95c['push'](_0x1ed95c['shift']());}};_0x4601b3(++_0xf05dff);}(_0xd1f5,0x12c));var _0x5d1f=function(_0x1ef9a4,_0x1ca6de){_0x1ef9a4=_0x1ef9a4-0x0;var _0xd46714=_0xd1f5[_0x1ef9a4];return _0xd46714;};'use strict';var _=require('lodash');var util=require(_0x5d1f('0x0'));var moment=require(_0x5d1f('0x1'));var BPromise=require(_0x5d1f('0x2'));var rs=require(_0x5d1f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5d1f('0x4'))['db'];var utils=require(_0x5d1f('0x5'));var logger=require(_0x5d1f('0x6'))(_0x5d1f('0x7'));var config=require(_0x5d1f('0x8'));var jayson=require(_0x5d1f('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xedec45,_0x2d8c97,_0x491f11){return new BPromise(function(_0xf34fcb,_0x14c745){return client[_0x5d1f('0xa')](_0xedec45,_0x491f11)[_0x5d1f('0xb')](function(_0x55d49e){logger[_0x5d1f('0xc')](_0x5d1f('0xd'),_0x2d8c97,'request\x20sent');logger[_0x5d1f('0xe')](_0x5d1f('0xf'),_0x2d8c97,'request\x20sent',JSON['stringify'](_0x55d49e));if(_0x55d49e[_0x5d1f('0x10')]){if(_0x55d49e[_0x5d1f('0x10')]['code']===0x1f4){logger[_0x5d1f('0x10')](_0x5d1f('0xd'),_0x2d8c97,_0x55d49e[_0x5d1f('0x10')][_0x5d1f('0x11')]);return _0x14c745(_0x55d49e[_0x5d1f('0x10')][_0x5d1f('0x11')]);}logger[_0x5d1f('0x10')](_0x5d1f('0xd'),_0x2d8c97,_0x55d49e[_0x5d1f('0x10')][_0x5d1f('0x11')]);return _0xf34fcb(_0x55d49e['error']['message']);}else{logger['info'](_0x5d1f('0xd'),_0x2d8c97,'request\x20sent');_0xf34fcb(_0x55d49e['result'][_0x5d1f('0x11')]);}})[_0x5d1f('0x12')](function(_0xf5868e){logger[_0x5d1f('0x10')](_0x5d1f('0xd'),_0x2d8c97,_0xf5868e);_0x14c745(_0xf5868e);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 2d67c41..1235831 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 _0xbdbb=['isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get'];(function(_0x5aba30,_0x41a5e0){var _0x227541=function(_0x3a0a52){while(--_0x3a0a52){_0x5aba30['push'](_0x5aba30['shift']());}};_0x227541(++_0x41a5e0);}(_0xbdbb,0x17c));var _0xbbdb=function(_0x26371f,_0x3529d6){_0x26371f=_0x26371f-0x0;var _0x7bf77f=_0xbdbb[_0x26371f];return _0x7bf77f;};'use strict';var multer=require(_0xbbdb('0x0'));var util=require(_0xbbdb('0x1'));var path=require(_0xbbdb('0x2'));var timeout=require(_0xbbdb('0x3'));var express=require(_0xbbdb('0x4'));var router=express[_0xbbdb('0x5')]();var fs_extra=require(_0xbbdb('0x6'));var auth=require(_0xbbdb('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xbbdb('0x8'));var controller=require(_0xbbdb('0x9'));router[_0xbbdb('0xa')]('/',auth[_0xbbdb('0xb')](),controller[_0xbbdb('0xc')]);router['get'](_0xbbdb('0xd'),auth['isAuthenticated'](),controller[_0xbbdb('0xe')]);router['get'](_0xbbdb('0xf'),auth['isAuthenticated'](),controller[_0xbbdb('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbbdb('0x11')]);router[_0xbbdb('0x12')](_0xbbdb('0xf'),auth[_0xbbdb('0xb')](),controller[_0xbbdb('0x13')]);router[_0xbbdb('0x14')](_0xbbdb('0xf'),auth[_0xbbdb('0xb')](),controller[_0xbbdb('0x15')]);module[_0xbbdb('0x16')]=router;
\ No newline at end of file
+var _0x19bb=['get','isAuthenticated','index','/describe','/:id','put','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../config/environment','./chatTransferReport.controller'];(function(_0x4cd782,_0x2f1f68){var _0x34d61c=function(_0x47d915){while(--_0x47d915){_0x4cd782['push'](_0x4cd782['shift']());}};_0x34d61c(++_0x2f1f68);}(_0x19bb,0x119));var _0xb19b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x19bb[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0xb19b('0x0'));var util=require('util');var path=require(_0xb19b('0x1'));var timeout=require(_0xb19b('0x2'));var express=require('express');var router=express[_0xb19b('0x3')]();var fs_extra=require(_0xb19b('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb19b('0x5'));var controller=require(_0xb19b('0x6'));router[_0xb19b('0x7')]('/',auth[_0xb19b('0x8')](),controller[_0xb19b('0x9')]);router[_0xb19b('0x7')](_0xb19b('0xa'),auth[_0xb19b('0x8')](),controller['describe']);router[_0xb19b('0x7')](_0xb19b('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xb19b('0x8')](),controller['create']);router[_0xb19b('0xc')]('/:id',auth[_0xb19b('0x8')](),controller['update']);router[_0xb19b('0xd')](_0xb19b('0xb'),auth[_0xb19b('0x8')](),controller[_0xb19b('0xe')]);module[_0xb19b('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index a98382f..ab3f501 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 _0x583b=['Skip','Feedback','ENUM','star','thumb','stringify','input','text','name','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','alternate','System','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','STRING','address','email','#011F6A','#ffffff','INTEGER','BOOLEAN','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Type\x20a\x20message'];(function(_0x51f47b,_0x597006){var _0x35718c=function(_0x151950){while(--_0x151950){_0x51f47b['push'](_0x51f47b['shift']());}};_0x35718c(++_0x597006);}(_0x583b,0xe5));var _0xb583=function(_0x209403,_0x27d3d7){_0x209403=_0x209403-0x0;var _0x2fd163=_0x583b[_0x209403];return _0x2fd163;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xb583('0x0'));module[_0xb583('0x1')]={'name':{'type':Sequelize[_0xb583('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xb583('0x2')],'allowNull':![],'unique':_0xb583('0x3')},'description':{'type':Sequelize[_0xb583('0x2')]},'mapKey':{'type':Sequelize[_0xb583('0x2')],'defaultValue':_0xb583('0x4')},'mapKeyOffline':{'type':Sequelize[_0xb583('0x2')],'defaultValue':_0xb583('0x4')},'key':{'type':Sequelize[_0xb583('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xb583('0x2')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0xb583('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xb583('0x2')],'allowNull':![],'defaultValue':_0xb583('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xb583('0x2')],'allowNull':![],'defaultValue':_0xb583('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xb583('0x2')],'allowNull':![],'defaultValue':_0xb583('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xb583('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xb583('0x2')]},'animation':{'type':Sequelize[_0xb583('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0xb583('0x9'),_0xb583('0xa')),'defaultValue':_0xb583('0x9')},'header_online':{'type':Sequelize[_0xb583('0x2')],'defaultValue':_0xb583('0xb')},'start_chat_button':{'type':Sequelize[_0xb583('0x2')],'defaultValue':_0xb583('0xc')},'offline_chat_button':{'type':Sequelize[_0xb583('0x2')],'defaultValue':_0xb583('0xd')},'header_offline':{'type':Sequelize[_0xb583('0x2')],'defaultValue':_0xb583('0xe')},'download_transcript':{'type':Sequelize[_0xb583('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xb583('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xb583('0x2')],'defaultValue':_0xb583('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0xb583('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xb583('0x10')]},'closingQuestion':{'type':Sequelize[_0xb583('0x2')],'defaultValue':_0xb583('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0xb583('0x2')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0xb583('0x2')],'defaultValue':_0xb583('0x12')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0xb583('0x13')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0xb583('0x14')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xb583('0x2')],'defaultValue':_0xb583('0xd')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xb583('0x15')},'conditionAgreement':{'type':Sequelize[_0xb583('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xb583('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xb583('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xb583('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xb583('0x2')],'defaultValue':_0xb583('0x16')},'ratingType':{'type':Sequelize[_0xb583('0x17')](_0xb583('0x18'),_0xb583('0x19')),'defaultValue':_0xb583('0x18')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xb583('0x10')],'defaultValue':function(){return JSON[_0xb583('0x1a')]({'items':[{'type':_0xb583('0x1b'),'variable':null,'config':{'placeholder':'name','type':_0xb583('0x1c'),'required':!![]},'props':{'title':_0xb583('0x1d'),'helpText':''}},{'type':_0xb583('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xb583('0x4'),'type':_0xb583('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xb583('0x1e')](_0xb583('0x1f'))?JSON[_0xb583('0x20')](this[_0xb583('0x1e')](_0xb583('0x1f'))):{};},'set':function(_0x5040fa){return this[_0xb583('0x21')]('onlineForm',JSON[_0xb583('0x1a')](_0x5040fa));}},'offlineForm':{'type':Sequelize[_0xb583('0x10')],'defaultValue':function(){return JSON[_0xb583('0x1a')]({'items':[{'type':'input','props':{'title':_0xb583('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xb583('0x4'),'type':_0xb583('0x4')},'variable':null},{'type':_0xb583('0x22'),'config':{'placeholder':_0xb583('0x23')},'props':{'title':_0xb583('0x23'),'helpText':_0xb583('0x24')}}],'fromKey':0x0});},'get':function(){return this[_0xb583('0x1e')](_0xb583('0x25'))?JSON['parse'](this[_0xb583('0x1e')]('offlineForm')):{};},'set':function(_0x573452){return this[_0xb583('0x21')](_0xb583('0x25'),JSON['stringify'](_0x573452));}},'token':{'type':Sequelize[_0xb583('0x2')],'defaultValue':function(){return rs[_0xb583('0x26')]();}},'autoclose':{'type':Sequelize[_0xb583('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xb583('0x2')]},'forwardOffline':{'type':Sequelize[_0xb583('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xb583('0x2')]},'waitingTitle':{'type':Sequelize[_0xb583('0x2')],'defaultValue':_0xb583('0x27')},'waitingMessage':{'type':Sequelize[_0xb583('0x2')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0xb583('0x28')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xb583('0x29')},'enableUnmanagedNote':{'type':Sequelize[_0xb583('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xb583('0x2')],'defaultValue':_0xb583('0x2a')},'skipUnmanaged':{'type':Sequelize[_0xb583('0x2')],'defaultValue':_0xb583('0x15')},'sendUnmanaged':{'type':Sequelize[_0xb583('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0xb583('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xb583('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xb583('0x10')]},'showAgentAvatar':{'type':Sequelize[_0xb583('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xb583('0x10')],'defaultValue':function(){return _0xb583('0x2b');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb583('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xb583('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0xb583('0x2c')},'verticalAlignment':{'type':Sequelize[_0xb583('0x7')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xb583('0x2')],'defaultValue':_0xb583('0x2d')},'defaultTitle':{'type':Sequelize[_0xb583('0x2')]},'customerAvatar':{'type':Sequelize[_0xb583('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0xb583('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xb583('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xb583('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb583('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb583('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xb583('0x2e')},'systemAvatar':{'type':Sequelize[_0xb583('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb583('0x7')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xb583('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x51ae5f){if(!_0x51ae5f)this[_0xb583('0x21')](_0xb583('0x2f'),null);this[_0xb583('0x21')]('mandatoryDisposition',_0x51ae5f);}},'vidaooEscalation':{'type':Sequelize[_0xb583('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xb583('0x2')]},'vidaooTopic':{'type':Sequelize[_0xb583('0x2')],'allowNull':![],'defaultValue':_0xb583('0x30')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xb583('0x31');}},'vidaooMetadata':{'type':Sequelize[_0xb583('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xb583('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xb583('0x10')]}};
\ No newline at end of file
+var _0xf61c=['address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','squared','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Feedback','thumb','TEXT','stringify','input','name','text','getDataValue','onlineForm','setDataValue','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','bottom_right','alternate','#fafafa','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','exports','STRING'];(function(_0x592df4,_0x4e719b){var _0x3b4fe4=function(_0x5ebf53){while(--_0x5ebf53){_0x592df4['push'](_0x592df4['shift']());}};_0x3b4fe4(++_0x4e719b);}(_0xf61c,0x195));var _0xcf61=function(_0xa04e45,_0x3e2c31){_0xa04e45=_0xa04e45-0x0;var _0x2cd452=_0xf61c[_0xa04e45];return _0x2cd452;};'use strict';var Sequelize=require(_0xcf61('0x0'));var rs=require('randomstring');module[_0xcf61('0x1')]={'name':{'type':Sequelize[_0xcf61('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xcf61('0x2')],'allowNull':![],'unique':_0xcf61('0x3')},'description':{'type':Sequelize[_0xcf61('0x2')]},'mapKey':{'type':Sequelize[_0xcf61('0x2')],'defaultValue':_0xcf61('0x4')},'mapKeyOffline':{'type':Sequelize[_0xcf61('0x2')],'defaultValue':_0xcf61('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xcf61('0x5')},'customerAlias':{'type':Sequelize[_0xcf61('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xcf61('0x2')],'allowNull':![],'defaultValue':_0xcf61('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xcf61('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xcf61('0x2')],'allowNull':![],'defaultValue':_0xcf61('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xcf61('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xcf61('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xcf61('0xa')]('rounded',_0xcf61('0xb')),'defaultValue':_0xcf61('0xc')},'header_online':{'type':Sequelize[_0xcf61('0x2')],'defaultValue':_0xcf61('0xd')},'start_chat_button':{'type':Sequelize[_0xcf61('0x2')],'defaultValue':_0xcf61('0xe')},'offline_chat_button':{'type':Sequelize[_0xcf61('0x2')],'defaultValue':_0xcf61('0xf')},'header_offline':{'type':Sequelize[_0xcf61('0x2')],'defaultValue':_0xcf61('0x10')},'download_transcript':{'type':Sequelize[_0xcf61('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xcf61('0x2')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xcf61('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xcf61('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xcf61('0x2')],'defaultValue':_0xcf61('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0xcf61('0x2')],'defaultValue':_0xcf61('0x12')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0xcf61('0x13')},'placeholderMessage':{'type':Sequelize[_0xcf61('0x2')],'defaultValue':_0xcf61('0x14')},'closingMessage':{'type':Sequelize[_0xcf61('0x2')],'defaultValue':_0xcf61('0x15')},'closingMessageButton':{'type':Sequelize[_0xcf61('0x2')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0xcf61('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xcf61('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0xcf61('0x16')},'ratingType':{'type':Sequelize[_0xcf61('0xa')]('star',_0xcf61('0x17')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xcf61('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xcf61('0x18')],'defaultValue':function(){return JSON[_0xcf61('0x19')]({'items':[{'type':_0xcf61('0x1a'),'variable':null,'config':{'placeholder':_0xcf61('0x1b'),'type':_0xcf61('0x1c'),'required':!![]},'props':{'title':_0xcf61('0x1b'),'helpText':''}},{'type':'input','props':{'title':_0xcf61('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xcf61('0x4'),'type':_0xcf61('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xcf61('0x1d')](_0xcf61('0x1e'))?JSON['parse'](this['getDataValue'](_0xcf61('0x1e'))):{};},'set':function(_0x3fad3d){return this[_0xcf61('0x1f')]('onlineForm',JSON[_0xcf61('0x19')](_0x3fad3d));}},'offlineForm':{'type':Sequelize[_0xcf61('0x18')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xcf61('0x1a'),'props':{'title':_0xcf61('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xcf61('0x4'),'type':_0xcf61('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':_0xcf61('0x20')},'props':{'title':_0xcf61('0x20'),'helpText':_0xcf61('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0xcf61('0x1d')](_0xcf61('0x22'))?JSON['parse'](this['getDataValue'](_0xcf61('0x22'))):{};},'set':function(_0x5d12e1){return this['setDataValue'](_0xcf61('0x22'),JSON['stringify'](_0x5d12e1));}},'token':{'type':Sequelize[_0xcf61('0x2')],'defaultValue':function(){return rs[_0xcf61('0x23')]();}},'autoclose':{'type':Sequelize[_0xcf61('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xcf61('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xcf61('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0xcf61('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xcf61('0x24')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xcf61('0x25')},'offlineMessageSubject':{'type':Sequelize[_0xcf61('0x2')],'defaultValue':_0xcf61('0x26')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xcf61('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0xcf61('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xcf61('0x2')],'defaultValue':_0xcf61('0x28')},'skipUnmanaged':{'type':Sequelize[_0xcf61('0x2')],'defaultValue':_0xcf61('0x29')},'sendUnmanaged':{'type':Sequelize[_0xcf61('0x2')],'defaultValue':_0xcf61('0xf')},'enableCustomerAttachment':{'type':Sequelize[_0xcf61('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xcf61('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0xcf61('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xcf61('0x2')]},'notificationTemplate':{'type':Sequelize[_0xcf61('0x18')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xcf61('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xcf61('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xcf61('0x2')],'defaultValue':_0xcf61('0x2a')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xcf61('0x2')],'defaultValue':_0xcf61('0x2b')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0xcf61('0x18')]},'showCustomerAvatar':{'type':Sequelize[_0xcf61('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xcf61('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xcf61('0x2')],'allowNull':![],'defaultValue':_0xcf61('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xcf61('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xcf61('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xcf61('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xcf61('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xcf61('0x2')],'defaultValue':_0xcf61('0x2d')},'systemAvatar':{'type':Sequelize[_0xcf61('0x18')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xcf61('0x8')],'comment':_0xcf61('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0xcf61('0x9')],'defaultValue':![],'comment':_0xcf61('0x2f'),'set':function(_0x34c938){if(!_0x34c938)this['setDataValue'](_0xcf61('0x30'),null);this[_0xcf61('0x1f')]('mandatoryDisposition',_0x34c938);}},'vidaooEscalation':{'type':Sequelize[_0xcf61('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xcf61('0x2')]},'vidaooTopic':{'type':Sequelize[_0xcf61('0x2')],'allowNull':![],'defaultValue':_0xcf61('0x31')},'vidaooNote':{'type':Sequelize[_0xcf61('0x2')],'defaultValue':function(){return _0xcf61('0x32');}},'vidaooMetadata':{'type':Sequelize[_0xcf61('0x18')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xcf61('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xcf61('0x18')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index cb252af..8c6e94e 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 _0xfe33=['waitForTheAssignedAgent','forcedOwnership','Start','EventManager','notify','offline','files','createdAt','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','ChatOfflineMessage','originalname','mimetype','server','attachments','offline-chat','basename','transaction','Attachment','MailAccount','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','openNewInteraction','MailAccountId','toPairsIn','mapValues','subjectOffline','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','Owner','fullname','internal','Tags','color','tag','findAll','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','inspect','Interval','Intervals','getProactiveActions','getLicense','License','chatLicenseExceeded','push','all','some','server/files/chat/iframe.ejs','remote','connection','remoteAddress','virtual','render','verticalAlignment','textColor','color_button','backgroundColor','sequelize','ChatApplication','bulkCreate','findAndCountAll','getApplications','chatProactiveAction','addProactiveActions','ChatProactiveAction','getFields','online','false','onlineForm','items','fromKey','Attachments','addAgents','omit','emit','removeAgents','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','sox','to-csv','ejs','fs-extra','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./chatWebsite.socket','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','rows','show','params','keys','merge','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','Disposition','getDispositions','findOne','ChatWebsiteId','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addLogo','sitepic','file','addAvatar','agentAvatar','customerAvatar','filename','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','custom','isNil','existsSync','join','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','setUA','headers','getResult','chat','CmContact','ValidationError','no\x20available\x20attributes','difference','updatedAt','CompanyId','ListId','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','Contacts','DESC','account','applications','Applications','list','orderBy','priority','asc','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','referer','browser','version','format','%s\x20%s','unknown','device','vendor','stringify','threadId','externalUrl','ChatInteraction','ContactId','interaction','spread','lastName','messageId','created','autoclose','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','User','UserId','unshift'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xfe33,0x6e));var _0x3fe3=function(_0x1d32ac,_0x16f800){_0x1d32ac=_0x1d32ac-0x0;var _0x2e15e4=_0xfe33[_0x1d32ac];return _0x2e15e4;};'use strict';var emlformat=require(_0x3fe3('0x0'));var rimraf=require(_0x3fe3('0x1'));var zipdir=require(_0x3fe3('0x2'));var jsonpatch=require(_0x3fe3('0x3'));var rp=require(_0x3fe3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x3fe3('0x5'));var csv=require(_0x3fe3('0x6'));var ejs=require(_0x3fe3('0x7'));var fs=require('fs');var fs_extra=require(_0x3fe3('0x8'));var _=require('lodash');var squel=require(_0x3fe3('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3fe3('0xa'));var toCsv=require(_0x3fe3('0x6'));var querystring=require('querystring');var Papa=require(_0x3fe3('0xb'));var Redis=require('ioredis');var authService=require(_0x3fe3('0xc'));var qs=require(_0x3fe3('0xd'));var as=require(_0x3fe3('0xe'));var hardwareService=require(_0x3fe3('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0x3fe3('0x10'));var config=require(_0x3fe3('0x11'));var licenseUtil=require(_0x3fe3('0x12'));var db=require(_0x3fe3('0x13'))['db'];config['redis']=_[_0x3fe3('0x14')](config[_0x3fe3('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x3fe3('0x16'))(new Redis(config['redis']));require(_0x3fe3('0x17'))['register'](socket);var jayson=require(_0x3fe3('0x18'));var client=jayson[_0x3fe3('0x19')]['http']({'port':0x232c});var client9002=jayson[_0x3fe3('0x19')][_0x3fe3('0x1a')]({'port':0x232a});var client9003=jayson[_0x3fe3('0x19')][_0x3fe3('0x1a')]({'port':0x232b});var client9001=jayson['client'][_0x3fe3('0x1a')]({'port':0x2329});function respondWithRpcPromise(_0x32765f,_0x341524,_0x28478d,_0x5d5526){return new BPromise(function(_0x589f2a,_0xdc2fe3){var _0x36af23=_0x5d5526||client;return _0x36af23[_0x3fe3('0x1b')](_0x32765f,_0x28478d)[_0x3fe3('0x1c')](function(_0x57a784){logger[_0x3fe3('0x1d')](_0x3fe3('0x1e'),_0x341524,_0x3fe3('0x1f'));logger[_0x3fe3('0x20')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x341524,_0x3fe3('0x1f'),JSON['stringify'](_0x57a784));if(_0x57a784[_0x3fe3('0x21')]){if(_0x57a784['error'][_0x3fe3('0x22')]===0x1f4){logger[_0x3fe3('0x21')](_0x3fe3('0x1e'),_0x341524,_0x57a784['error']['message']);return _0xdc2fe3(_0x57a784[_0x3fe3('0x21')][_0x3fe3('0x23')]);}logger[_0x3fe3('0x21')](_0x3fe3('0x1e'),_0x341524,_0x57a784['error'][_0x3fe3('0x23')]);return _0x589f2a(_0x57a784[_0x3fe3('0x21')]['message']);}else{logger[_0x3fe3('0x1d')](_0x3fe3('0x1e'),_0x341524,'request\x20sent');_0x589f2a(_0x57a784[_0x3fe3('0x24')][_0x3fe3('0x23')]);}})[_0x3fe3('0x25')](function(_0x1c731d){logger[_0x3fe3('0x21')](_0x3fe3('0x1e'),_0x341524,_0x1c731d);_0xdc2fe3(_0x1c731d);});});}function respondWithStatusCode(_0x2b5e33,_0xf9a689){_0xf9a689=_0xf9a689||0xcc;return function(_0x9bf9ed){if(_0x9bf9ed){return _0x2b5e33[_0x3fe3('0x26')](_0xf9a689);}return _0x2b5e33[_0x3fe3('0x27')](_0xf9a689)[_0x3fe3('0x28')]();};}function respondWithResult(_0x4aef2e,_0x1e243c){_0x1e243c=_0x1e243c||0xc8;return function(_0x48e7f7){if(_0x48e7f7){return _0x4aef2e[_0x3fe3('0x27')](_0x1e243c)[_0x3fe3('0x29')](_0x48e7f7);}};}function respondWithFilteredResult(_0x3db9b3,_0x3ec7f5){return function(_0x59e27d){if(_0x59e27d){var _0x242701=typeof _0x3ec7f5[_0x3fe3('0x2a')]===_0x3fe3('0x2b')&&typeof _0x3ec7f5[_0x3fe3('0x2c')]===_0x3fe3('0x2b');var _0x54934a=_0x59e27d[_0x3fe3('0x2d')];var _0xa423bd=_0x242701?0x0:_0x3ec7f5[_0x3fe3('0x2a')];var _0xe68adb=_0x242701?_0x59e27d[_0x3fe3('0x2d')]:_0x3ec7f5['offset']+_0x3ec7f5[_0x3fe3('0x2c')];var _0xfea885;if(_0xe68adb>=_0x54934a){_0xe68adb=_0x54934a;_0xfea885=0xc8;}else{_0xfea885=0xce;}_0x3db9b3[_0x3fe3('0x27')](_0xfea885);return _0x3db9b3[_0x3fe3('0x2e')](_0x3fe3('0x2f'),_0xa423bd+'-'+_0xe68adb+'/'+_0x54934a)[_0x3fe3('0x29')](_0x59e27d);}return null;};}function patchUpdates(_0x13b9e3){return function(_0xf5da50){try{jsonpatch[_0x3fe3('0x30')](_0xf5da50,_0x13b9e3,!![]);}catch(_0x40dc5d){return BPromise['reject'](_0x40dc5d);}return _0xf5da50['save']();};}function saveUpdates(_0x45828c,_0x3f8f49){return function(_0x5e8b03){if(_0x5e8b03){return _0x5e8b03[_0x3fe3('0x31')](_0x45828c)[_0x3fe3('0x1c')](function(_0xe03238){return _0xe03238;});}return null;};}function removeEntity(_0x379a4b,_0x520ea9){return function(_0x58b018){if(_0x58b018){return _0x58b018[_0x3fe3('0x32')]()[_0x3fe3('0x1c')](function(){var _0xb46c34=_0x58b018[_0x3fe3('0x33')]({'plain':!![]});var _0xcafc68=_0x3fe3('0x34');return db[_0x3fe3('0x35')][_0x3fe3('0x32')]({'where':{'type':_0xcafc68,'resourceId':_0xb46c34['id']}})[_0x3fe3('0x1c')](function(){return _0x58b018;});})['then'](function(){_0x379a4b[_0x3fe3('0x27')](0xcc)[_0x3fe3('0x28')]();});}};}function handleEntityNotFound(_0x3e2f64,_0x4f9f85){return function(_0x302f18){if(!_0x302f18){_0x3e2f64['sendStatus'](0x194);}return _0x302f18;};}function handleError(_0x2e2738,_0x4b3f30){_0x4b3f30=_0x4b3f30||0x1f4;return function(_0x4c05ca){logger['error'](_0x4c05ca[_0x3fe3('0x36')]);if(_0x4c05ca[_0x3fe3('0x37')]){delete _0x4c05ca['name'];}_0x2e2738[_0x3fe3('0x27')](_0x4b3f30)[_0x3fe3('0x38')](_0x4c05ca);};}exports[_0x3fe3('0x39')]=function(_0x4946b3,_0x1fbb55){var _0x242037={'include':[{'model':db[_0x3fe3('0x3a')],'as':_0x3fe3('0x3b')}]},_0x3f15af={},_0xb447d3={'count':0x0,'rows':[]};var _0x5a4593=_['map'](db[_0x3fe3('0x3c')][_0x3fe3('0x3d')],function(_0x3e6f7d){return{'name':_0x3e6f7d[_0x3fe3('0x3e')],'type':_0x3e6f7d[_0x3fe3('0x3f')][_0x3fe3('0x40')]};});_0x3f15af[_0x3fe3('0x41')]=_[_0x3fe3('0x42')](_0x5a4593,_0x3fe3('0x37'));_0x3f15af[_0x3fe3('0x43')]=_['keys'](_0x4946b3[_0x3fe3('0x43')]);_0x3f15af[_0x3fe3('0x44')]=_['intersection'](_0x3f15af['model'],_0x3f15af[_0x3fe3('0x43')]);_0x242037['attributes']=_[_0x3fe3('0x45')](_0x3f15af['model'],qs[_0x3fe3('0x46')](_0x4946b3['query'][_0x3fe3('0x46')]));_0x242037['attributes']=_0x242037[_0x3fe3('0x47')][_0x3fe3('0x48')]?_0x242037['attributes']:_0x3f15af['model'];if(!_0x4946b3[_0x3fe3('0x43')][_0x3fe3('0x49')](_0x3fe3('0x4a'))){_0x242037[_0x3fe3('0x2c')]=qs['limit'](_0x4946b3['query'][_0x3fe3('0x2c')]);_0x242037['offset']=qs[_0x3fe3('0x2a')](_0x4946b3[_0x3fe3('0x43')][_0x3fe3('0x2a')]);}_0x242037[_0x3fe3('0x4b')]=qs['sort'](_0x4946b3[_0x3fe3('0x43')][_0x3fe3('0x4c')]);_0x242037[_0x3fe3('0x4d')]=qs['filters'](_[_0x3fe3('0x4e')](_0x4946b3[_0x3fe3('0x43')],_0x3f15af[_0x3fe3('0x44')]),_0x5a4593);if(_0x4946b3['query'][_0x3fe3('0x4f')]){_0x242037[_0x3fe3('0x4d')]=_['merge'](_0x242037[_0x3fe3('0x4d')],{'$or':_[_0x3fe3('0x42')](_0x5a4593,function(_0x45d719){if(_0x45d719[_0x3fe3('0x3f')]!==_0x3fe3('0x50')){var _0xc960f6={};_0xc960f6[_0x45d719[_0x3fe3('0x37')]]={'$like':'%'+_0x4946b3[_0x3fe3('0x43')]['filter']+'%'};return _0xc960f6;}})});}_0x242037=_['merge']({},_0x242037,_0x4946b3[_0x3fe3('0x51')]);var _0x38443d={'where':_0x242037['where']};return db[_0x3fe3('0x3c')][_0x3fe3('0x2d')](_0x38443d)[_0x3fe3('0x1c')](function(_0x1130d7){_0xb447d3['count']=_0x1130d7;if(_0x4946b3[_0x3fe3('0x43')][_0x3fe3('0x52')]){_0x242037[_0x3fe3('0x53')]=[{'all':!![]}];}return db[_0x3fe3('0x3c')]['findAll'](_0x242037);})[_0x3fe3('0x1c')](function(_0x57d9e6){_0xb447d3[_0x3fe3('0x54')]=_0x57d9e6;return _0xb447d3;})[_0x3fe3('0x1c')](respondWithFilteredResult(_0x1fbb55,_0x242037))[_0x3fe3('0x25')](handleError(_0x1fbb55,null));};exports[_0x3fe3('0x55')]=function(_0xe70851,_0x16937a){var _0x2c990f={'raw':![],'where':{'id':_0xe70851[_0x3fe3('0x56')]['id']},'include':[{'model':db[_0x3fe3('0x3a')],'as':'mandatoryDispositionPause'}]},_0x58ff4b={};_0x58ff4b[_0x3fe3('0x41')]=_['keys'](db[_0x3fe3('0x3c')]['rawAttributes']);_0x58ff4b[_0x3fe3('0x43')]=_[_0x3fe3('0x57')](_0xe70851[_0x3fe3('0x43')]);_0x58ff4b[_0x3fe3('0x44')]=_[_0x3fe3('0x45')](_0x58ff4b[_0x3fe3('0x41')],_0x58ff4b[_0x3fe3('0x43')]);_0x2c990f['attributes']=_[_0x3fe3('0x45')](_0x58ff4b[_0x3fe3('0x41')],qs['fields'](_0xe70851[_0x3fe3('0x43')]['fields']));_0x2c990f[_0x3fe3('0x47')]=_0x2c990f['attributes'][_0x3fe3('0x48')]?_0x2c990f[_0x3fe3('0x47')]:_0x58ff4b['model'];if(_0xe70851[_0x3fe3('0x43')][_0x3fe3('0x52')]){_0x2c990f[_0x3fe3('0x53')]=[{'all':!![]}];}_0x2c990f=_[_0x3fe3('0x58')]({},_0x2c990f,_0xe70851[_0x3fe3('0x51')]);return db[_0x3fe3('0x3c')][_0x3fe3('0x59')](_0x2c990f)[_0x3fe3('0x1c')](handleEntityNotFound(_0x16937a,null))[_0x3fe3('0x1c')](respondWithResult(_0x16937a,null))[_0x3fe3('0x25')](handleError(_0x16937a,null));};exports[_0x3fe3('0x5a')]=function(_0x5724e8,_0xba56e){return db[_0x3fe3('0x3c')][_0x3fe3('0x5a')](_0x5724e8['body'],{})[_0x3fe3('0x1c')](function(_0x421ffb){var _0x33b1e4=_0x5724e8[_0x3fe3('0x5b')][_0x3fe3('0x33')]({'plain':!![]});if(!_0x33b1e4)throw new Error(_0x3fe3('0x5c'));if(_0x33b1e4['role']===_0x3fe3('0x5b')){var _0x285c8b=_0x421ffb['get']({'plain':!![]});var _0x508b57='ChatWebsites';return db[_0x3fe3('0x5d')]['find']({'where':{'name':_0x508b57,'userProfileId':_0x33b1e4[_0x3fe3('0x5e')]},'raw':!![]})['then'](function(_0x1cdcad){if(_0x1cdcad&&_0x1cdcad[_0x3fe3('0x5f')]===0x0){return db[_0x3fe3('0x35')][_0x3fe3('0x5a')]({'name':_0x285c8b[_0x3fe3('0x37')],'resourceId':_0x285c8b['id'],'type':_0x1cdcad[_0x3fe3('0x37')],'sectionId':_0x1cdcad['id']},{})[_0x3fe3('0x1c')](function(){return _0x421ffb;});}else{return _0x421ffb;}})['catch'](function(_0x56e3b9){logger[_0x3fe3('0x21')](_0x3fe3('0x60'),_0x56e3b9);throw _0x56e3b9;});}return _0x421ffb;})[_0x3fe3('0x1c')](respondWithResult(_0xba56e,0xc9))[_0x3fe3('0x25')](handleError(_0xba56e,null));};exports['update']=function(_0x22ab38,_0x496a77){if(_0x22ab38['body']['id']){delete _0x22ab38[_0x3fe3('0x61')]['id'];}return db[_0x3fe3('0x3c')][_0x3fe3('0x59')]({'where':{'id':_0x22ab38[_0x3fe3('0x56')]['id']},'include':[{'model':db[_0x3fe3('0x3a')],'as':_0x3fe3('0x3b')}]})[_0x3fe3('0x1c')](handleEntityNotFound(_0x496a77,null))[_0x3fe3('0x1c')](saveUpdates(_0x22ab38[_0x3fe3('0x61')],null))[_0x3fe3('0x1c')](respondWithResult(_0x496a77,null))[_0x3fe3('0x25')](handleError(_0x496a77,null));};exports[_0x3fe3('0x32')]=function(_0x4ff239,_0x2b1fa0){return db[_0x3fe3('0x3c')][_0x3fe3('0x59')]({'where':{'id':_0x4ff239[_0x3fe3('0x56')]['id']}})['then'](handleEntityNotFound(_0x2b1fa0,null))['then'](removeEntity(_0x2b1fa0,null))[_0x3fe3('0x25')](handleError(_0x2b1fa0,null));};exports[_0x3fe3('0x62')]=function(_0x3007e6,_0x39a557){return db[_0x3fe3('0x3c')]['describe']()[_0x3fe3('0x1c')](respondWithResult(_0x39a557,null))[_0x3fe3('0x25')](handleError(_0x39a557,null));};exports[_0x3fe3('0x63')]=function(_0x469d06,_0x229132,_0x5f3e18){if(_0x469d06['body']['id']){delete _0x469d06[_0x3fe3('0x61')]['id'];}return db[_0x3fe3('0x3c')]['find']({'where':{'id':_0x469d06['params']['id']}})[_0x3fe3('0x1c')](handleEntityNotFound(_0x229132,null))[_0x3fe3('0x1c')](function(_0x11bbdd){if(_0x11bbdd){_0x469d06[_0x3fe3('0x61')]['ChatWebsiteId']=_0x11bbdd['id'];return db[_0x3fe3('0x64')][_0x3fe3('0x5a')](_0x469d06[_0x3fe3('0x61')]);}})[_0x3fe3('0x1c')](respondWithResult(_0x229132,null))[_0x3fe3('0x25')](handleError(_0x229132,null));};exports[_0x3fe3('0x65')]=function(_0x35ecc7,_0x58b242,_0x695b26){var _0x44d88f={'raw':![],'where':{}};var _0x27646a={};var _0x22785d={'count':0x0,'rows':[]};return db[_0x3fe3('0x3c')][_0x3fe3('0x66')]({'where':{'id':_0x35ecc7['params']['id']}})[_0x3fe3('0x1c')](handleEntityNotFound(_0x58b242,null))['then'](function(_0x5d8e6b){if(_0x5d8e6b){_0x27646a[_0x3fe3('0x41')]=_['keys'](db[_0x3fe3('0x64')][_0x3fe3('0x3d')]);_0x27646a[_0x3fe3('0x43')]=_[_0x3fe3('0x57')](_0x35ecc7[_0x3fe3('0x43')]);_0x27646a[_0x3fe3('0x44')]=_[_0x3fe3('0x45')](_0x27646a[_0x3fe3('0x41')],_0x27646a[_0x3fe3('0x43')]);_0x44d88f[_0x3fe3('0x47')]=_[_0x3fe3('0x45')](_0x27646a[_0x3fe3('0x41')],qs[_0x3fe3('0x46')](_0x35ecc7['query']['fields']));_0x44d88f[_0x3fe3('0x47')]=_0x44d88f[_0x3fe3('0x47')][_0x3fe3('0x48')]?_0x44d88f[_0x3fe3('0x47')]:_0x27646a[_0x3fe3('0x41')];if(!_0x35ecc7[_0x3fe3('0x43')][_0x3fe3('0x49')](_0x3fe3('0x4a'))){_0x44d88f[_0x3fe3('0x2c')]=qs['limit'](_0x35ecc7[_0x3fe3('0x43')][_0x3fe3('0x2c')]);_0x44d88f[_0x3fe3('0x2a')]=qs[_0x3fe3('0x2a')](_0x35ecc7[_0x3fe3('0x43')][_0x3fe3('0x2a')]);}_0x44d88f[_0x3fe3('0x4b')]=qs[_0x3fe3('0x4c')](_0x35ecc7['query'][_0x3fe3('0x4c')]);_0x44d88f[_0x3fe3('0x4d')]=qs[_0x3fe3('0x44')](_[_0x3fe3('0x4e')](_0x35ecc7[_0x3fe3('0x43')],_0x27646a['filters']));_0x44d88f['where'][_0x3fe3('0x67')]=_0x5d8e6b['id'];if(_0x35ecc7['query']['filter']){_0x44d88f[_0x3fe3('0x4d')]=_[_0x3fe3('0x58')](_0x44d88f[_0x3fe3('0x4d')],{'$or':_[_0x3fe3('0x42')](_0x44d88f[_0x3fe3('0x47')],function(_0x1ae1a5){var _0x4b917e={};_0x4b917e[_0x1ae1a5]={'$like':'%'+_0x35ecc7[_0x3fe3('0x43')][_0x3fe3('0x4f')]+'%'};return _0x4b917e;})});}_0x44d88f=_['merge']({},_0x44d88f,_0x35ecc7[_0x3fe3('0x51')]);return db['Disposition'][_0x3fe3('0x2d')]({'where':_0x44d88f[_0x3fe3('0x4d')]})[_0x3fe3('0x1c')](function(_0x3ceb8b){_0x22785d[_0x3fe3('0x2d')]=_0x3ceb8b;if(_0x35ecc7[_0x3fe3('0x43')][_0x3fe3('0x52')]){_0x44d88f['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x44d88f);})[_0x3fe3('0x1c')](function(_0x3f77bb){_0x22785d['rows']=_0x3f77bb;return _0x22785d;});}})[_0x3fe3('0x1c')](respondWithFilteredResult(_0x58b242,_0x44d88f))[_0x3fe3('0x25')](handleError(_0x58b242,null));};exports[_0x3fe3('0x68')]=function(_0x57643f,_0x29b240,_0x1c11c7){return db[_0x3fe3('0x3c')][_0x3fe3('0x59')]({'where':{'id':_0x57643f['params']['id']}})[_0x3fe3('0x1c')](handleEntityNotFound(_0x29b240,null))[_0x3fe3('0x1c')](function(_0x122247){if(_0x122247){return _0x122247[_0x3fe3('0x68')](_0x57643f['query'][_0x3fe3('0x69')]);}})[_0x3fe3('0x1c')](respondWithStatusCode(_0x29b240,null))['catch'](handleError(_0x29b240,null));};exports[_0x3fe3('0x6a')]=function(_0xabb2fc,_0x16a922,_0x15c379){if(_0xabb2fc['body']['id']){delete _0xabb2fc[_0x3fe3('0x61')]['id'];}return db[_0x3fe3('0x3c')][_0x3fe3('0x59')]({'where':{'id':_0xabb2fc['params']['id']}})['then'](handleEntityNotFound(_0x16a922,null))[_0x3fe3('0x1c')](function(_0x4f1c8d){if(_0x4f1c8d){_0xabb2fc[_0x3fe3('0x61')][_0x3fe3('0x67')]=_0x4f1c8d['id'];return db['CannedAnswer'][_0x3fe3('0x5a')](_0xabb2fc[_0x3fe3('0x61')]);}})[_0x3fe3('0x1c')](respondWithResult(_0x16a922,null))['catch'](handleError(_0x16a922,null));};exports[_0x3fe3('0x6b')]=function(_0xf0bca4,_0x1e4df7,_0x53c7ca){var _0x865f4b={'raw':![],'where':{}};var _0x111b45={};var _0x3f0cf2={'count':0x0,'rows':[]};return db[_0x3fe3('0x3c')][_0x3fe3('0x66')]({'where':{'id':_0xf0bca4[_0x3fe3('0x56')]['id']}})[_0x3fe3('0x1c')](handleEntityNotFound(_0x1e4df7,null))[_0x3fe3('0x1c')](function(_0x103c3f){if(_0x103c3f){_0x111b45[_0x3fe3('0x41')]=_[_0x3fe3('0x57')](db[_0x3fe3('0x6c')][_0x3fe3('0x3d')]);_0x111b45[_0x3fe3('0x43')]=_[_0x3fe3('0x57')](_0xf0bca4['query']);_0x111b45['filters']=_[_0x3fe3('0x45')](_0x111b45['model'],_0x111b45[_0x3fe3('0x43')]);_0x865f4b['attributes']=_[_0x3fe3('0x45')](_0x111b45[_0x3fe3('0x41')],qs[_0x3fe3('0x46')](_0xf0bca4[_0x3fe3('0x43')][_0x3fe3('0x46')]));_0x865f4b[_0x3fe3('0x47')]=_0x865f4b[_0x3fe3('0x47')][_0x3fe3('0x48')]?_0x865f4b[_0x3fe3('0x47')]:_0x111b45[_0x3fe3('0x41')];if(!_0xf0bca4['query'][_0x3fe3('0x49')](_0x3fe3('0x4a'))){_0x865f4b[_0x3fe3('0x2c')]=qs[_0x3fe3('0x2c')](_0xf0bca4['query'][_0x3fe3('0x2c')]);_0x865f4b['offset']=qs[_0x3fe3('0x2a')](_0xf0bca4[_0x3fe3('0x43')][_0x3fe3('0x2a')]);}_0x865f4b[_0x3fe3('0x4b')]=qs['sort'](_0xf0bca4[_0x3fe3('0x43')][_0x3fe3('0x4c')]);_0x865f4b['where']=qs[_0x3fe3('0x44')](_['pick'](_0xf0bca4[_0x3fe3('0x43')],_0x111b45['filters']));_0x865f4b['where'][_0x3fe3('0x67')]=_0x103c3f['id'];if(_0xf0bca4[_0x3fe3('0x43')][_0x3fe3('0x4f')]){_0x865f4b[_0x3fe3('0x4d')]=_['merge'](_0x865f4b[_0x3fe3('0x4d')],{'$or':_[_0x3fe3('0x42')](_0x865f4b[_0x3fe3('0x47')],function(_0x3b5d8d){var _0x3ec497={};_0x3ec497[_0x3b5d8d]={'$like':'%'+_0xf0bca4['query'][_0x3fe3('0x4f')]+'%'};return _0x3ec497;})});}_0x865f4b=_[_0x3fe3('0x58')]({},_0x865f4b,_0xf0bca4['options']);return db[_0x3fe3('0x6c')][_0x3fe3('0x2d')]({'where':_0x865f4b[_0x3fe3('0x4d')]})[_0x3fe3('0x1c')](function(_0x4a438e){_0x3f0cf2[_0x3fe3('0x2d')]=_0x4a438e;if(_0xf0bca4['query']['includeAll']){_0x865f4b[_0x3fe3('0x53')]=[{'all':!![]}];}return db[_0x3fe3('0x6c')]['findAll'](_0x865f4b);})[_0x3fe3('0x1c')](function(_0x365ec9){_0x3f0cf2[_0x3fe3('0x54')]=_0x365ec9;return _0x3f0cf2;});}})['then'](respondWithFilteredResult(_0x1e4df7,_0x865f4b))[_0x3fe3('0x25')](handleError(_0x1e4df7,null));};exports[_0x3fe3('0x6d')]=function(_0x4b61ea,_0x4c3f4f,_0x6a99eb){return db['ChatWebsite'][_0x3fe3('0x59')]({'where':{'id':_0x4b61ea['params']['id']}})[_0x3fe3('0x1c')](handleEntityNotFound(_0x4c3f4f,null))[_0x3fe3('0x1c')](function(_0x378fea){if(_0x378fea){return _0x378fea['removeAnswers'](_0x4b61ea[_0x3fe3('0x43')][_0x3fe3('0x69')]);}})[_0x3fe3('0x1c')](respondWithStatusCode(_0x4c3f4f,null))[_0x3fe3('0x25')](handleError(_0x4c3f4f,null));};exports[_0x3fe3('0x6e')]=function(_0x5d8e3b,_0x3448e6,_0x4bb9d3){_0x5d8e3b['body'][_0x3fe3('0x6f')]=_0x5d8e3b[_0x3fe3('0x70')]['filename'];return db[_0x3fe3('0x3c')]['find']({'where':{'id':_0x5d8e3b[_0x3fe3('0x56')]['id']}})['then'](handleEntityNotFound(_0x3448e6,null))[_0x3fe3('0x1c')](saveUpdates(_0x5d8e3b[_0x3fe3('0x61')],null))[_0x3fe3('0x1c')](respondWithResult(_0x3448e6,null))['catch'](handleError(_0x3448e6,null));};exports[_0x3fe3('0x71')]=function(_0x28bcb8,_0x33a892,_0x321a32){_0x28bcb8[_0x3fe3('0x61')][_0x3fe3('0x72')]=_0x28bcb8[_0x3fe3('0x70')]['filename'];return db[_0x3fe3('0x3c')]['find']({'where':{'id':_0x28bcb8[_0x3fe3('0x56')]['id']}})['then'](handleEntityNotFound(_0x33a892,null))[_0x3fe3('0x1c')](saveUpdates(_0x28bcb8[_0x3fe3('0x61')],null))[_0x3fe3('0x1c')](respondWithResult(_0x33a892,null))[_0x3fe3('0x25')](handleError(_0x33a892,null));};exports['addCustomerAvatar']=function(_0x1845dd,_0x15408b,_0x219cb9){_0x1845dd[_0x3fe3('0x61')][_0x3fe3('0x73')]=_0x1845dd['file'][_0x3fe3('0x74')];return db['ChatWebsite'][_0x3fe3('0x59')]({'where':{'id':_0x1845dd[_0x3fe3('0x56')]['id']}})[_0x3fe3('0x1c')](handleEntityNotFound(_0x15408b,null))['then'](saveUpdates(_0x1845dd[_0x3fe3('0x61')],null))[_0x3fe3('0x1c')](respondWithResult(_0x15408b,null))['catch'](handleError(_0x15408b,null));};exports['addSystemAvatar']=function(_0x57ac0f,_0x4eb740,_0x56f0ae){_0x57ac0f[_0x3fe3('0x61')][_0x3fe3('0x75')]=_0x57ac0f['file'][_0x3fe3('0x74')];return db['ChatWebsite']['find']({'where':{'id':_0x57ac0f[_0x3fe3('0x56')]['id']}})['then'](handleEntityNotFound(_0x4eb740,null))[_0x3fe3('0x1c')](saveUpdates(_0x57ac0f[_0x3fe3('0x61')],null))[_0x3fe3('0x1c')](respondWithResult(_0x4eb740,null))[_0x3fe3('0x25')](handleError(_0x4eb740,null));};exports[_0x3fe3('0x76')]=function(_0x6245cd,_0x44c754,_0x2a2cca){var _0x8eae21=path['join'](config[_0x3fe3('0x77')],_0x3fe3('0x78'));var _0x250101={'where':{'id':_0x6245cd[_0x3fe3('0x56')]['id']},'attributes':['id',_0x3fe3('0x6f')],'raw':!![]};var _0x4c59c5=![];return require(_0x3fe3('0x12'))['getLicense']()['then'](function(_0x573578){if(_0x573578){_0x4c59c5=_0x573578[_0x3fe3('0x79')];}})[_0x3fe3('0x1c')](function(){return db[_0x3fe3('0x3c')][_0x3fe3('0x59')](_0x250101);})[_0x3fe3('0x1c')](handleEntityNotFound(_0x44c754,null))[_0x3fe3('0x1c')](function(_0x5e590b){if(_0x5e590b){if(!_[_0x3fe3('0x7a')](_0x5e590b['sitepic'])){if(fs[_0x3fe3('0x7b')](path[_0x3fe3('0x7c')](config[_0x3fe3('0x77')],_0x3fe3('0x7d'),_0x5e590b[_0x3fe3('0x6f')]))&&_0x4c59c5){_0x8eae21=path[_0x3fe3('0x7c')](config[_0x3fe3('0x77')],_0x3fe3('0x7d'),_0x5e590b[_0x3fe3('0x6f')]);}}return _0x44c754[_0x3fe3('0x7e')](_0x8eae21);}})[_0x3fe3('0x25')](handleError(_0x44c754,null));};exports['getAvatar']=function(_0x203f60,_0x5581d7,_0x6284f9){var _0x3c71d5=path['join'](config['root'],_0x3fe3('0x7f'));var _0x2b86e8={'where':{'id':_0x203f60[_0x3fe3('0x56')]['id']},'attributes':['id',_0x3fe3('0x72')],'raw':!![]};return db[_0x3fe3('0x3c')][_0x3fe3('0x59')](_0x2b86e8)[_0x3fe3('0x1c')](handleEntityNotFound(_0x5581d7,null))[_0x3fe3('0x1c')](function(_0x19f25e){if(_0x19f25e){if(!_['isNil'](_0x19f25e['agentAvatar'])){if(fs[_0x3fe3('0x7b')](path[_0x3fe3('0x7c')](config[_0x3fe3('0x77')],_0x3fe3('0x80'),_0x19f25e['agentAvatar']))){_0x3c71d5=path[_0x3fe3('0x7c')](config[_0x3fe3('0x77')],_0x3fe3('0x80'),_0x19f25e[_0x3fe3('0x72')]);}}return _0x5581d7[_0x3fe3('0x7e')](_0x3c71d5);}})[_0x3fe3('0x25')](handleError(_0x5581d7,null));};exports[_0x3fe3('0x81')]=function(_0x46bb9d,_0x15b981,_0x27803d){var _0x3bf029=path[_0x3fe3('0x7c')](config[_0x3fe3('0x77')],_0x3fe3('0x82'));var _0x1a0a6d={'where':{'id':_0x46bb9d[_0x3fe3('0x56')]['id']},'attributes':['id',_0x3fe3('0x73'),'showCustomerAvatar'],'raw':!![]};return db[_0x3fe3('0x3c')][_0x3fe3('0x59')](_0x1a0a6d)[_0x3fe3('0x1c')](handleEntityNotFound(_0x15b981,null))[_0x3fe3('0x1c')](function(_0x35d384){if(_0x35d384){if(!_[_0x3fe3('0x7a')](_0x35d384[_0x3fe3('0x73')])){if(fs[_0x3fe3('0x7b')](path[_0x3fe3('0x7c')](config['root'],_0x3fe3('0x80'),_0x35d384['customerAvatar']))&&_0x35d384[_0x3fe3('0x83')]){_0x3bf029=path['join'](config[_0x3fe3('0x77')],'server/files/images/avatars/',_0x35d384[_0x3fe3('0x73')]);}}return _0x15b981[_0x3fe3('0x7e')](_0x3bf029);}})[_0x3fe3('0x25')](handleError(_0x15b981,null));};exports[_0x3fe3('0x84')]=function(_0x2b8eb8,_0x2bf28f,_0x24f160){var _0x512d61=path[_0x3fe3('0x7c')](config[_0x3fe3('0x77')],_0x3fe3('0x85'));var _0x53c285={'where':{'id':_0x2b8eb8[_0x3fe3('0x56')]['id']},'attributes':['id',_0x3fe3('0x75')],'raw':!![]};return db[_0x3fe3('0x3c')][_0x3fe3('0x59')](_0x53c285)[_0x3fe3('0x1c')](handleEntityNotFound(_0x2bf28f,null))[_0x3fe3('0x1c')](function(_0x1c81cf){if(_0x1c81cf){if(!_[_0x3fe3('0x7a')](_0x1c81cf['systemAvatar'])){if(fs[_0x3fe3('0x7b')](path['join'](config[_0x3fe3('0x77')],_0x3fe3('0x80'),_0x1c81cf[_0x3fe3('0x75')]))){_0x512d61=path[_0x3fe3('0x7c')](config[_0x3fe3('0x77')],_0x3fe3('0x80'),_0x1c81cf[_0x3fe3('0x75')]);}}return _0x2bf28f['download'](_0x512d61);}})[_0x3fe3('0x25')](handleError(_0x2bf28f,null));};exports['notify']=function(_0x50743b,_0x217f32,_0x2026c4){var _0x17d825=require(_0x3fe3('0x86'));var _0x50500d=new _0x17d825();var _0x344c85=_0x50500d[_0x3fe3('0x87')](_0x50743b[_0x3fe3('0x88')]['user-agent'])[_0x3fe3('0x89')]();var _0x4dfd69={'body':_0x50743b['body'],'channel':_0x3fe3('0x8a')};var _0x4c2c21=[];var _0x4daecd=[];var _0x411d13={};var _0x1e9122=![];return db[_0x3fe3('0x8b')][_0x3fe3('0x62')]()['then'](function(_0xa4fcfd){if(!_0xa4fcfd){throw new db['Sequelize'][(_0x3fe3('0x8c'))](_0x3fe3('0x8d'));}_0x4c2c21=_[_0x3fe3('0x8e')](_[_0x3fe3('0x57')](_0xa4fcfd),['createdAt',_0x3fe3('0x8f')]);_0x4daecd=_['difference'](_[_0x3fe3('0x57')](_0xa4fcfd),['createdAt',_0x3fe3('0x8f'),_0x3fe3('0x90'),_0x3fe3('0x91')]);if(_0x50743b['body']['id']){delete _0x50743b[_0x3fe3('0x61')]['id'];}if(_[_0x3fe3('0x7a')](_0x50743b[_0x3fe3('0x61')]['from'])){throw new db[(_0x3fe3('0x92'))][(_0x3fe3('0x8c'))](_0x3fe3('0x93'));}if(_[_0x3fe3('0x7a')](_0x50743b[_0x3fe3('0x61')]['body'])||_0x50743b['body'][_0x3fe3('0x61')]===''){throw new db['Sequelize'][(_0x3fe3('0x8c'))](_0x3fe3('0x94'));}if(_['isNil'](_0x50743b[_0x3fe3('0x61')][_0x3fe3('0x95')])){throw new db[(_0x3fe3('0x92'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4daecd);}if(!_['includes'](_0x4daecd,_0x50743b[_0x3fe3('0x61')][_0x3fe3('0x95')])){throw new db[(_0x3fe3('0x92'))]['ValidationError'](_0x3fe3('0x96')+_0x4daecd);}_0x411d13[_0x50743b[_0x3fe3('0x61')][_0x3fe3('0x95')]]=_0x50743b['body'][_0x3fe3('0x97')];})[_0x3fe3('0x1c')](function(){return db['ChatWebsite'][_0x3fe3('0x59')]({'where':{'id':_0x50743b[_0x3fe3('0x56')]['id']},'include':[{'model':db[_0x3fe3('0x98')],'as':_0x3fe3('0x99'),'include':[{'model':db[_0x3fe3('0x8b')],'as':_0x3fe3('0x9a'),'where':_0x411d13,'limit':0x1,'order':[[_0x3fe3('0x8f'),_0x3fe3('0x9b')]]}]},{'model':db['ChatApplication'],'as':'Applications'}]});})[_0x3fe3('0x1c')](handleEntityNotFound(_0x217f32,null))[_0x3fe3('0x1c')](function(_0x59b703){if(_0x59b703&&_0x59b703[_0x3fe3('0x99')]){_0x4dfd69[_0x3fe3('0x9c')]=_0x59b703;_0x4dfd69[_0x3fe3('0x9d')]=_0x59b703[_0x3fe3('0x9e')];_0x4dfd69[_0x3fe3('0x9f')]=_0x59b703[_0x3fe3('0x99')];_0x4dfd69[_0x3fe3('0x9d')]=_[_0x3fe3('0xa0')](_0x4dfd69[_0x3fe3('0x9d')],[_0x3fe3('0xa1')],[_0x3fe3('0xa2')]);if(_0x4dfd69[_0x3fe3('0x9c')]['Applications']){delete _0x4dfd69['account'][_0x3fe3('0x9e')];}if(_0x4dfd69['account'][_0x3fe3('0x99')]&&_0x4dfd69[_0x3fe3('0x9c')][_0x3fe3('0x99')][_0x3fe3('0x9a')][_0x3fe3('0x48')]){return _0x4dfd69['account']['List'][_0x3fe3('0x9a')][0x0];}var _0xb252ec=_['defaults'](_0x50743b['body'],{'firstName':_0x50743b[_0x3fe3('0x61')][_0x3fe3('0x97')],'ListId':_0x59b703[_0x3fe3('0x91')]});_0xb252ec[_0x50743b['body']['mapKey']]=_0x50743b[_0x3fe3('0x61')][_0x3fe3('0x97')];return db['CmContact'][_0x3fe3('0x5a')](_0xb252ec,{'fields':_0x4c2c21,'raw':!![]});}})[_0x3fe3('0x1c')](handleEntityNotFound(_0x217f32,null))[_0x3fe3('0x1c')](function(_0xd17ec2){_0x4dfd69[_0x3fe3('0xa3')]=_0xd17ec2;var _0x1f9b5c=_0x50743b[_0x3fe3('0x61')][_0x3fe3('0xa4')];if(_0x50743b[_0x3fe3('0x88')][_0x3fe3('0xa5')]){_0x1f9b5c=_0x50743b[_0x3fe3('0x88')]['cf-connecting-ip'];}else if(_0x50743b['headers'][_0x3fe3('0xa6')]){_0x1f9b5c=_[_0x3fe3('0xa7')](_0x50743b[_0x3fe3('0x88')][_0x3fe3('0xa6')][_0x3fe3('0xa8')](','));}if(_0xd17ec2){var _0x1c9f96={'ContactId':_0xd17ec2['id'],'ChatWebsiteId':_0x50743b[_0x3fe3('0x56')]['id'],'from':(_0xd17ec2[_0x3fe3('0xa9')]||'')+'\x20'+(_0xd17ec2['lastName']||''),'customerIp':_0x1f9b5c,'customerPort':_0x50743b[_0x3fe3('0x88')]['x-real-port']?_0x50743b['headers']['x-real-port']:null,'referer':_0x50743b[_0x3fe3('0x61')][_0x3fe3('0xaa')],'browserName':_0x344c85[_0x3fe3('0xab')][_0x3fe3('0x37')]&&_0x344c85[_0x3fe3('0xab')][_0x3fe3('0xac')]?util[_0x3fe3('0xad')](_0x3fe3('0xae'),_0x344c85[_0x3fe3('0xab')][_0x3fe3('0x37')],_0x344c85[_0x3fe3('0xab')][_0x3fe3('0xac')]):_0x3fe3('0xaf'),'browserVersion':_0x344c85[_0x3fe3('0xab')][_0x3fe3('0xac')]||_0x3fe3('0xaf'),'osName':util['format']('%s\x20%s',_0x344c85['os'][_0x3fe3('0x37')],_0x344c85['os'][_0x3fe3('0xac')]),'osVersion':_0x344c85['os'][_0x3fe3('0xac')],'deviceModel':_0x344c85[_0x3fe3('0xb0')][_0x3fe3('0x41')]&&_0x344c85[_0x3fe3('0xb0')]['vendor']?util[_0x3fe3('0xad')]('%s\x20%s\x20%s',_0x344c85[_0x3fe3('0xb0')][_0x3fe3('0x41')],_0x344c85[_0x3fe3('0xb0')]['vendor'],_0x344c85[_0x3fe3('0xb0')][_0x3fe3('0x3f')]):null,'deviceVendor':_0x344c85['device'][_0x3fe3('0xb1')],'deviceType':_0x344c85[_0x3fe3('0xb0')][_0x3fe3('0x3f')],'formData':JSON[_0x3fe3('0xb2')](_0x50743b[_0x3fe3('0x61')])};var _0x511746={'ChatWebsiteId':_0x50743b[_0x3fe3('0x56')]['id'],'closed':![]};if(_0x50743b['body'][_0x3fe3('0xb3')]){_0x511746['threadId']=_0x50743b['body']['threadId'];return db['ChatInteraction'][_0x3fe3('0x59')]({'where':_0x511746})[_0x3fe3('0x1c')](function(_0xd158f1){if(_0xd158f1){return[_0xd158f1,![]];}_0x1c9f96[_0x3fe3('0xb3')]=_0x50743b[_0x3fe3('0x61')][_0x3fe3('0xb3')];_0x1c9f96[_0x3fe3('0xb4')]=_0x50743b[_0x3fe3('0x61')][_0x3fe3('0xb4')];return db[_0x3fe3('0xb5')]['create'](_0x1c9f96)[_0x3fe3('0x1c')](function(_0x138561){return[_0x138561,!![]];});});}_0x511746[_0x3fe3('0xb6')]=_0xd17ec2['id'];if(_0x50743b[_0x3fe3('0x61')][_0x3fe3('0xb7')]&&_0x50743b[_0x3fe3('0x61')]['interaction']['id']){_0x511746['id']=_0x50743b[_0x3fe3('0x61')][_0x3fe3('0xb7')]['id'];return db['ChatInteraction'][_0x3fe3('0x59')]({'where':_0x511746})['then'](function(_0x4b8ca1){if(_0x4b8ca1){return[_0x4b8ca1,![]];}return db['ChatInteraction'][_0x3fe3('0x5a')](_0x1c9f96)[_0x3fe3('0x1c')](function(_0x562264){return[_0x562264,!![]];});});}return db[_0x3fe3('0xb5')][_0x3fe3('0x5a')](_0x1c9f96)['then'](function(_0x305b67){return[_0x305b67,!![]];});}})[_0x3fe3('0xb8')](function(_0x2befc8,_0x59e5c7){if(_0x2befc8){_0x1e9122=_0x59e5c7;if(!_0x59e5c7){var _0x3467e1={'from':(_0x4dfd69[_0x3fe3('0xa3')][_0x3fe3('0xa9')]||'')+'\x20'+(_0x4dfd69[_0x3fe3('0xa3')][_0x3fe3('0xb9')]||'')};if(_0x50743b[_0x3fe3('0x61')]['threadId']&&_0x50743b['body'][_0x3fe3('0xba')]&&_0x50743b[_0x3fe3('0x61')][_0x3fe3('0xb3')]!=_0x50743b[_0x3fe3('0x61')]['messageId']){_0x3467e1['threadId']=_0x50743b[_0x3fe3('0x61')]['messageId'];}return _0x2befc8[_0x3fe3('0x31')](_0x3467e1);}else{return _0x2befc8;}}})[_0x3fe3('0x1c')](function(_0x474e26){_0x4dfd69['interaction']=_0x474e26[_0x3fe3('0x33')]({'plain':!![]});_0x4dfd69[_0x3fe3('0xb7')][_0x3fe3('0xbb')]=_0x1e9122;if(_0x4dfd69[_0x3fe3('0xb7')]['created']){if(_0x4dfd69[_0x3fe3('0x9c')][_0x3fe3('0xbc')]){_0x4dfd69['applications']['push']({'id':0x0,'priority':_0x4dfd69[_0x3fe3('0x9d')]['length']+0x1,'app':_0x3fe3('0xbd'),'appdata':_0x3fe3('0xbe'),'interval':_0x3fe3('0xbf')});}}return db[_0x3fe3('0xc0')]['create']({'body':_0x50743b[_0x3fe3('0x61')][_0x3fe3('0x61')],'ChatWebsiteId':_0x50743b[_0x3fe3('0x56')]['id'],'ChatInteractionId':_0x474e26['id'],'direction':'in','ContactId':_0x4dfd69[_0x3fe3('0xa3')]['id'],'AttachmentId':_0x50743b['body'][_0x3fe3('0xc1')]});})[_0x3fe3('0x1c')](function(_0x369912){_0x4dfd69[_0x3fe3('0x23')]=_0x369912;if(_0x4dfd69['interaction']['UserId']){return db[_0x3fe3('0xc2')][_0x3fe3('0x59')]({'attributes':['id',_0x3fe3('0x37')],'where':{'id':_0x4dfd69[_0x3fe3('0xb7')][_0x3fe3('0xc3')]}})[_0x3fe3('0x1c')](function(_0x403f02){if(_0x403f02){_0x4dfd69[_0x3fe3('0x9d')][_0x3fe3('0xc4')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x403f02[_0x3fe3('0x37')]+','+(_0x4dfd69['account'][_0x3fe3('0xc5')]||0xa),'interval':_0x3fe3('0xbf')});_0x4dfd69[_0x3fe3('0xc6')]=!![];}return respondWithRpcPromise(_0x3fe3('0xc7'),'startRouting',_0x4dfd69);});}return respondWithRpcPromise(_0x3fe3('0xc7'),'startRouting',_0x4dfd69);})[_0x3fe3('0x1c')](function(_0x444fe9){respondWithRpcPromise('EventManager',_0x3fe3('0xc8'),{'event':_0x3fe3('0xc9'),'message':_0x444fe9},client9002);return _0x444fe9;})[_0x3fe3('0x1c')](respondWithResult(_0x217f32,null))[_0x3fe3('0x25')](handleError(_0x217f32,null));};exports[_0x3fe3('0xca')]=function(_0x399100,_0x3857c6,_0x56d3d3){var _0x2215e2,_0x2e075a,_0x2d3a89;var _0x8cddf4=[];var _0x5b04a0=[];var _0x158444={};var _0x2bd590=_0x399100[_0x3fe3('0xcb')]||[];var _0x314763=[];var _0x501707;return db[_0x3fe3('0x8b')][_0x3fe3('0x62')]()[_0x3fe3('0x1c')](function(_0x1357cd){if(!_0x1357cd){throw new db['Sequelize'][(_0x3fe3('0x8c'))](_0x3fe3('0x8d'));}_0x5b04a0=_[_0x3fe3('0x8e')](_[_0x3fe3('0x57')](_0x1357cd),[_0x3fe3('0xcc'),_0x3fe3('0x8f')]);_0x8cddf4=_[_0x3fe3('0x8e')](_[_0x3fe3('0x57')](_0x1357cd),[_0x3fe3('0xcc'),'updatedAt','CompanyId','ListId']);if(_0x399100['body']['id']){delete _0x399100['body']['id'];}if(_[_0x3fe3('0x7a')](_0x399100[_0x3fe3('0x61')][_0x3fe3('0x97')])){throw _0x3857c6['status'](0x1f4)[_0x3fe3('0x38')](new db[(_0x3fe3('0x92'))]['ValidationError'](_0x3fe3('0x93')));}if(_[_0x3fe3('0x7a')](_0x399100['body'][_0x3fe3('0x61')])||_0x399100[_0x3fe3('0x61')][_0x3fe3('0x61')]===''){throw _0x3857c6[_0x3fe3('0x27')](0x1f4)[_0x3fe3('0x38')](new db['Sequelize'][(_0x3fe3('0x8c'))](_0x3fe3('0x94')));}if(_[_0x3fe3('0x7a')](_0x399100[_0x3fe3('0x61')][_0x3fe3('0xcd')])){throw _0x3857c6[_0x3fe3('0x27')](0x1f4)[_0x3fe3('0x38')](new db[(_0x3fe3('0x92'))]['ValidationError'](_0x3fe3('0xce')+_0x8cddf4));}if(!_[_0x3fe3('0xcf')](_0x8cddf4,_0x399100[_0x3fe3('0x61')][_0x3fe3('0xcd')])){throw _0x3857c6[_0x3fe3('0x27')](0x1f4)[_0x3fe3('0x38')](new db[(_0x3fe3('0x92'))][(_0x3fe3('0x8c'))](_0x3fe3('0xd0')+_0x8cddf4));}_0x158444[_0x399100[_0x3fe3('0x61')][_0x3fe3('0xcd')]]=_0x399100['body'][_0x3fe3('0x97')];})[_0x3fe3('0x1c')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x399100[_0x3fe3('0x56')]['id']},'include':[{'model':db[_0x3fe3('0x98')],'as':'List'},{'model':db['MailAccount'],'as':'MailAccount'}]});})[_0x3fe3('0x1c')](handleEntityNotFound(_0x3857c6,null))['then'](function(_0x1b4f47){if(_0x1b4f47&&_0x1b4f47[_0x3fe3('0x99')]){_0x2e075a=_0x1b4f47;var _0xe3f278=_['defaults'](_0x399100[_0x3fe3('0x61')],{'firstName':_0x399100[_0x3fe3('0x61')]['from'],'phone':_0x399100['body'][_0x3fe3('0x97')],'ListId':_0x1b4f47[_0x3fe3('0x91')]});_0xe3f278[_0x399100[_0x3fe3('0x61')]['mapKeyOffline']]=_0x399100['body'][_0x3fe3('0x97')];return db[_0x3fe3('0x8b')]['findOrCreate']({'where':_0x158444,'defaults':_0xe3f278});}})[_0x3fe3('0xb8')](function(_0x363519){if(_0x363519){_0x2d3a89=_0x363519;var _0x5a1d14=fs[_0x3fe3('0xd1')](path['join'](config[_0x3fe3('0x77')],_0x3fe3('0xd2')),_0x3fe3('0xd3'));var _0x304d96=ejs['render'](_0x5a1d14,{'body':_[_0x3fe3('0xd4')](_0x399100['body']['body']),'bodyTitle':_0x2e075a['offlineMessageBody']});return db[_0x3fe3('0xd5')]['create']({'body':_0x304d96,'ContactId':_0x363519['id'],'ChatWebsiteId':_0x2e075a['id']});}})[_0x3fe3('0x1c')](function(_0x46ba1f){_0x501707=_0x46ba1f;if(_0x2bd590['length']){var _0x1de25f=_0x2bd590[_0x3fe3('0x42')](function(_0x2e89b1){return{'name':_0x2e89b1[_0x3fe3('0xd6')],'basename':_0x2e89b1['filename'],'type':_0x2e89b1[_0x3fe3('0xd7')],'ChatOfflineMessageId':_0x46ba1f['id']};});_0x314763=_0x1de25f[_0x3fe3('0x42')](_0x1a1e31=>{var _0x2e93e3={'filename':_0x1a1e31[_0x3fe3('0x37')],'path':path[_0x3fe3('0x7c')](config[_0x3fe3('0x77')],_0x3fe3('0xd8'),'files',_0x3fe3('0xd9'),_0x3fe3('0xda'),_0x1a1e31[_0x3fe3('0xdb')])};return _0x2e93e3;});if(!_0x2e075a['openNewInteraction']){return db['sequelize'][_0x3fe3('0xdc')](function(_0x1a9e1a){return db[_0x3fe3('0xdd')]['bulkCreate'](_0x1de25f,{'transaction':_0x1a9e1a});});}}})[_0x3fe3('0x1c')](function(){if(_0x501707){_0x2215e2=_0x501707;return db[_0x3fe3('0xde')][_0x3fe3('0x66')]({'where':{'active':!![]},'include':[{'model':db[_0x3fe3('0xdf')],'as':_0x3fe3('0xe0'),'raw':!![]}]});}})[_0x3fe3('0x1c')](function(_0x119488){if(_0x119488&&_0x119488[_0x3fe3('0xe0')]&&_0x2e075a[_0x3fe3('0xe1')]&&_0x2e075a[_0x3fe3('0xe2')]){var _0x19abf5={'tls':{'rejectUnauthorized':![]}};if(_0x119488[_0x3fe3('0xe0')][_0x3fe3('0xe3')]){_0x19abf5[_0x3fe3('0xe3')]=_0x119488[_0x3fe3('0xe0')][_0x3fe3('0xe3')];}else{_0x19abf5[_0x3fe3('0xe4')]=_0x119488[_0x3fe3('0xe0')][_0x3fe3('0xe4')];_0x19abf5['port']=_0x119488[_0x3fe3('0xe0')][_0x3fe3('0xe5')];_0x19abf5[_0x3fe3('0xe6')]=_0x119488[_0x3fe3('0xe0')][_0x3fe3('0xe6')];}if(_0x119488[_0x3fe3('0xe0')]['authentication']){_0x19abf5[_0x3fe3('0xe7')]={'user':_0x119488['Smtp'][_0x3fe3('0x5b')],'pass':_0x119488[_0x3fe3('0xe0')][_0x3fe3('0xe8')]};}return respondWithRpcPromise(_0x3fe3('0xe9'),_0x3fe3('0xea'),{'account':_0x19abf5,'message':{'from':util['format'](_0x3fe3('0xeb'),_0x119488[_0x3fe3('0x37')],_0x119488[_0x3fe3('0xec')]||_0x119488[_0x3fe3('0xe0')][_0x3fe3('0x5b')]),'to':_0x2e075a[_0x3fe3('0xe2')],'subject':_0x2e075a[_0x3fe3('0xed')],'html':_0x2215e2[_0x3fe3('0x61')],'attachments':_0x314763}},client9003)['then'](function(){return _0x2215e2;})[_0x3fe3('0x25')](function(_0x508de8){console['error'](_0x508de8);});}})['then'](function(){if(_0x2e075a&&_0x2e075a[_0x3fe3('0xee')]&&_0x2e075a[_0x3fe3('0xef')]){var _0x54c642=[];if(_0x2bd590[_0x3fe3('0x48')]){_0x54c642=_0x2bd590[_0x3fe3('0x42')](function(_0x47b509){return{'name':_0x47b509[_0x3fe3('0xd6')],'basename':_0x47b509['filename'],'type':_0x47b509[_0x3fe3('0xd7')],'ChatOfflineMessageId':_0x501707['id']};});}var _0x90f0ad;if(!_[_0x3fe3('0x7a')](_0x2e075a['subjectOffline'])){var _0x397af7=_[_0x3fe3('0x42')](_0x399100[_0x3fe3('0x61')],function(_0x2de4fa){return _0x2de4fa;});var _0x3cb069=_[_0x3fe3('0xf0')](_0x397af7)[0x0];var _0x73c122=_[_0x3fe3('0xf1')](_0x3cb069,function(_0x70272){return _0x70272;});_0x90f0ad=_0x73c122[0x1][_0x2e075a[_0x3fe3('0xf2')]];}var _0x52d2b4={'from':_0x2d3a89['email'],'firstName':_0x2d3a89[_0x3fe3('0xa9')],'lastName':_0x2d3a89[_0x3fe3('0xb9')],'mapKey':'email','message':{'from':_0x2d3a89[_0x3fe3('0xec')],'to':_0x2e075a[_0x3fe3('0xde')][_0x3fe3('0xec')],'cc':'','subject':_['isNil'](_0x90f0ad)?_0x2e075a[_0x3fe3('0xed')]:_0x90f0ad,'messageId':'','sentAt':new Date(),'attach':_0x54c642[_0x3fe3('0x48')],'attachments':_0x54c642,'originChannel':_0x3fe3('0xf3'),'ChatWebsiteId':_0x2e075a['id'],'ChatOfflineMessageId':_0x2215e2['id'],'originTo':_0x2e075a[_0x3fe3('0xde')][_0x3fe3('0xec')]},'body':_0x2215e2[_0x3fe3('0x61')]};var _0x424ca3={'account':{'id':_0x2e075a[_0x3fe3('0xef')]},'body':_0x52d2b4,'log':_0x3fe3('0xf4')};return respondWithRpcPromise(_0x3fe3('0xf4'),_0x3fe3('0xf5'),_0x424ca3,client9001)['then'](function(){return _0x2215e2;})[_0x3fe3('0x25')](function(_0x15e907){console[_0x3fe3('0x21')](_0x15e907);});}return;})[_0x3fe3('0x1c')](function(){if(_0x2215e2){return _0x2215e2;}})[_0x3fe3('0x1c')](respondWithResult(_0x3857c6,null))['catch'](function(_0x135ef3){console['error'](_0x3fe3('0x25'),_0x135ef3);for(var _0x37f2ce of _0x2bd590){var _0x5acbb7=path[_0x3fe3('0x7c')](config['root'],_0x3fe3('0xd8'),_0x3fe3('0xcb'),'attachments',_0x3fe3('0xda'),_0x37f2ce[_0x3fe3('0x74')]);fs_extra[_0x3fe3('0xf6')](_0x5acbb7)[_0x3fe3('0x25')](function(_0x36e0f8){console[_0x3fe3('0x21')](_0x3fe3('0xf7'),_0x5acbb7,_0x36e0f8);});}});};exports[_0x3fe3('0xf8')]=function(_0x24c859,_0x2e74cf,_0x406d54){return db['ChatInteraction'][_0x3fe3('0x59')]({'where':{'id':_0x24c859[_0x3fe3('0x56')]['id']}})[_0x3fe3('0x1c')](handleEntityNotFound(_0x2e74cf,null))[_0x3fe3('0x1c')](function(_0x851102){if(_0x851102){return _0x851102[_0x3fe3('0xf8')](_0x24c859[_0x3fe3('0x61')][_0x3fe3('0x69')],_['omit'](_0x24c859[_0x3fe3('0x61')],[_0x3fe3('0x69'),'id'])||{});}})[_0x3fe3('0x1c')](respondWithResult(_0x2e74cf,null))[_0x3fe3('0x25')](handleError(_0x2e74cf,null));};exports[_0x3fe3('0xf9')]=function(_0x68e6e5,_0x45c71e,_0x2b6aa9){var _0xab4aac={'raw':![],'where':{}};var _0x511bcf={};var _0x1bc35e={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x68e6e5[_0x3fe3('0x56')]['id']}})['then'](handleEntityNotFound(_0x45c71e,null))[_0x3fe3('0x1c')](function(_0x4700d2){if(_0x4700d2){_0x511bcf[_0x3fe3('0x41')]=_[_0x3fe3('0x57')](db['ChatInteraction'][_0x3fe3('0x3d')]);_0x511bcf[_0x3fe3('0x43')]=_['keys'](_0x68e6e5[_0x3fe3('0x43')]);_0x511bcf[_0x3fe3('0x44')]=_[_0x3fe3('0x45')](_0x511bcf[_0x3fe3('0x41')],_0x511bcf[_0x3fe3('0x43')]);_0xab4aac[_0x3fe3('0x47')]=_[_0x3fe3('0x45')](_0x511bcf[_0x3fe3('0x41')],qs['fields'](_0x68e6e5['query'][_0x3fe3('0x46')]));_0xab4aac[_0x3fe3('0x47')]=_0xab4aac[_0x3fe3('0x47')][_0x3fe3('0x48')]?_0xab4aac['attributes']:_0x511bcf[_0x3fe3('0x41')];if(!_0x68e6e5['query'][_0x3fe3('0x49')](_0x3fe3('0x4a'))){_0xab4aac[_0x3fe3('0x2c')]=qs['limit'](_0x68e6e5[_0x3fe3('0x43')][_0x3fe3('0x2c')]);_0xab4aac[_0x3fe3('0x2a')]=qs['offset'](_0x68e6e5['query'][_0x3fe3('0x2a')]);}_0xab4aac[_0x3fe3('0x4b')]=qs['sort'](_0x68e6e5[_0x3fe3('0x43')][_0x3fe3('0x4c')]);_0xab4aac[_0x3fe3('0x4d')]=qs[_0x3fe3('0x44')](_[_0x3fe3('0x4e')](_0x68e6e5[_0x3fe3('0x43')],_0x511bcf['filters']));_0xab4aac[_0x3fe3('0x4d')][_0x3fe3('0x67')]=_0x4700d2['id'];if(_0x68e6e5[_0x3fe3('0x43')][_0x3fe3('0x4f')]){_0xab4aac['where']=_[_0x3fe3('0x58')](_0xab4aac[_0x3fe3('0x4d')],{'$or':_[_0x3fe3('0x42')](_0xab4aac['attributes'],function(_0x48377b){var _0x128ebd={};_0x128ebd[_0x48377b]={'$like':'%'+_0x68e6e5['query'][_0x3fe3('0x4f')]+'%'};return _0x128ebd;})});}_0xab4aac=_[_0x3fe3('0x58')]({},_0xab4aac,_0x68e6e5['options']);return db[_0x3fe3('0xb5')][_0x3fe3('0x2d')]({'where':_0xab4aac[_0x3fe3('0x4d')]})[_0x3fe3('0x1c')](function(_0x4f9c27){_0x1bc35e[_0x3fe3('0x2d')]=_0x4f9c27;if(_0x68e6e5[_0x3fe3('0x43')][_0x3fe3('0x52')]){_0xab4aac[_0x3fe3('0x53')]=[{'model':db['CmContact'],'as':_0x3fe3('0xfa'),'required':![]},{'model':db[_0x3fe3('0xc2')],'as':_0x3fe3('0xfb'),'attributes':[_0x3fe3('0x37'),_0x3fe3('0xfc'),_0x3fe3('0xfd')],'required':![]},{'model':db['Tag'],'as':_0x3fe3('0xfe'),'attributes':['id','name',_0x3fe3('0xff')],'where':_0x68e6e5[_0x3fe3('0x43')]['tag']?{'id':_0x68e6e5[_0x3fe3('0x43')]['tag']}:undefined,'required':_0x68e6e5[_0x3fe3('0x43')][_0x3fe3('0x100')]?!![]:![]}];}return db['ChatInteraction'][_0x3fe3('0x101')](_0xab4aac);})[_0x3fe3('0x1c')](function(_0x576d9e){_0x1bc35e[_0x3fe3('0x54')]=_0x576d9e;return _0x1bc35e;});}})[_0x3fe3('0x1c')](respondWithFilteredResult(_0x45c71e,_0xab4aac))[_0x3fe3('0x25')](handleError(_0x45c71e,null));};function iftimePromise(_0x42f9ae,_0x1f5dd1){return respondWithRpcPromise('Command',_0x3fe3('0x102'),{'command':_0x1f5dd1[_0x3fe3('0x103')]?util[_0x3fe3('0xad')](_0x3fe3('0x104'),_0x42f9ae[_0x3fe3('0x105')],_0x1f5dd1[_0x3fe3('0x103')]):util[_0x3fe3('0xad')](_0x3fe3('0x106'),_0x42f9ae[_0x3fe3('0x105')])},client9002)[_0x3fe3('0x1c')](function(_0x2b6d88){var _0x4028dc=_0x2b6d88&&_0x2b6d88['indexOf']('true')>=0x0?!![]:![];logger[_0x3fe3('0x1d')](_0x3fe3('0x107'),_0x1f5dd1['id'],_0x42f9ae['id'],_0x42f9ae[_0x3fe3('0x105')],_0x4028dc?_0x3fe3('0x108'):_0x3fe3('0x109'),_0x1f5dd1[_0x3fe3('0x103')]?_0x1f5dd1[_0x3fe3('0x103')]:'No\x20timezone');return _0x4028dc;})[_0x3fe3('0x25')](function(_0xa5746c){logger[_0x3fe3('0x21')](_0x3fe3('0x107'),_0x1f5dd1['id'],_0x42f9ae['id'],_0x42f9ae[_0x3fe3('0x105')],util[_0x3fe3('0x10a')](_0xa5746c,{'showHidden':![],'depth':null}),_0x1f5dd1['timezone']?_0x1f5dd1['timezone']:'No\x20timezone');return![];});}exports[_0x3fe3('0x102')]=function(_0x3a28f8,_0xbc6d2a,_0x1e1622){var _0x34ba1a=0x0;var _0x31179d=0x0;var _0x2dc4e1=![];var _0x4325b2;var _0x4c2a77;return db['ChatWebsite']['find']({'where':{'id':_0x3a28f8[_0x3fe3('0x56')]['id']},'include':[{'model':db['Interval'],'as':_0x3fe3('0x10b'),'include':[{'model':db['Interval'],'as':_0x3fe3('0x10c'),'attributes':['id',_0x3fe3('0x105')],'raw':!![]}]}]})[_0x3fe3('0x1c')](handleEntityNotFound(_0xbc6d2a,null))['then'](function(_0x383efd){if(_0x383efd){_0x4325b2=_0x383efd;return _0x383efd[_0x3fe3('0x10d')]({'raw':!![]});}})['then'](function(_0x360a3e){if(_0x4325b2){if(_0x360a3e){_0x4c2a77=_0x360a3e;}}return require(_0x3fe3('0x12'))[_0x3fe3('0x10e')]();})[_0x3fe3('0x1c')](function(_0x453891){if(_0x453891){_0x31179d=_0x453891['virtual'];_0x2dc4e1=_0x453891[_0x3fe3('0x79')];}})[_0x3fe3('0x1c')](function(){return db['ChatInteraction'][_0x3fe3('0x2d')]({'where':{'closed':![]}});})[_0x3fe3('0x1c')](function(_0x5f5de4){_0x34ba1a=_0x5f5de4;if(_0x31179d&&_0x5f5de4>_0x31179d){return db[_0x3fe3('0x10f')][_0x3fe3('0x66')]({'where':{'id':0x1}})['then'](function(_0x18ceef){if(_0x18ceef){_0x18ceef['increment'](_0x3fe3('0x110'));}});}})['then'](function(){if(_0x4325b2['Interval']&&_0x4325b2[_0x3fe3('0x10b')]['Intervals']){var _0x43fe11=[];for(var _0x4744db=0x0;_0x4744db<_0x4325b2[_0x3fe3('0x10b')][_0x3fe3('0x10c')][_0x3fe3('0x48')];_0x4744db++){var _0x2cccb6=_0x4325b2[_0x3fe3('0x10b')][_0x3fe3('0x10c')][_0x4744db][_0x3fe3('0x33')]({'plain':!![]});_0x43fe11[_0x3fe3('0x111')](iftimePromise(_0x2cccb6,_0x4325b2));}return BPromise[_0x3fe3('0x112')](_0x43fe11)[_0x3fe3('0x1c')](function(_0x4af8a2){return _[_0x3fe3('0x113')](_0x4af8a2);});}else{return!![];}})['then'](function(_0x411e42){var _0x4e7aad=fs[_0x3fe3('0xd1')](path[_0x3fe3('0x7c')](config['root'],_0x3fe3('0x114')),'utf8');var _0xfbbab8={'remote':_0x4325b2[_0x3fe3('0x115')],'query':querystring['stringify'](_['merge'](_0x4325b2[_0x3fe3('0x33')]({'plain':!![]}),{'customerIp':_0x3a28f8[_0x3fe3('0x88')]['x-forwarded-for']||_0x3a28f8[_0x3fe3('0x88')]['x-real-ip']||_0x3a28f8[_0x3fe3('0x116')][_0x3fe3('0x117')]||_0x3a28f8['ip'],'referer':_0x3a28f8['headers'][_0x3fe3('0xaa')],'openedInteractions':_0x34ba1a,'maxInteractions':_0x31179d,'virtual':_0x2dc4e1[_0x3fe3('0x118')],'online':_0x411e42,'custom':_0x2dc4e1}))['replace'](/'/g,'\x5c\x27')};_0xbc6d2a['send'](ejs[_0x3fe3('0x119')](Mustache[_0x3fe3('0x119')](_0x4e7aad,_0xfbbab8),{'proactiveActions':_0x4c2a77,'alignment':_0x4325b2['alignment'],'verticalAlignment':_0x4325b2[_0x3fe3('0x11a')],'div_color':_0x4325b2[_0x3fe3('0xff')],'text_color':_0x4325b2[_0x3fe3('0x11b')],'button_color':_0x4325b2[_0x3fe3('0x11c')],'background_color':_0x4325b2[_0x3fe3('0x11d')]}));})[_0x3fe3('0x25')](handleError(_0xbc6d2a,null));};exports['addApplications']=function(_0x5237c0,_0x1dd617,_0x327a1d){return db[_0x3fe3('0x3c')][_0x3fe3('0x66')]({'where':{'id':_0x5237c0[_0x3fe3('0x56')]['id']}})[_0x3fe3('0x1c')](handleEntityNotFound(_0x1dd617,null))[_0x3fe3('0x1c')](function(_0x4f7b09){if(_0x4f7b09){return db[_0x3fe3('0x11e')][_0x3fe3('0xdc')](function(_0x1a903a){return db['ChatApplication'][_0x3fe3('0x32')]({'where':{'ChatWebsiteId':_0x5237c0[_0x3fe3('0x56')]['id']},'transaction':_0x1a903a})[_0x3fe3('0x1c')](function(_0x1dfe0a){var _0x32957c=_['map'](_0x5237c0[_0x3fe3('0x61')],function(_0x4be523){_0x4be523[_0x3fe3('0x67')]=_0x5237c0[_0x3fe3('0x56')]['id'];return _0x4be523;});return db[_0x3fe3('0x11f')][_0x3fe3('0x120')](_0x32957c,{'transaction':_0x1a903a});});})[_0x3fe3('0x1c')](function(){return db[_0x3fe3('0x11f')][_0x3fe3('0x121')]({'where':{'ChatWebsiteId':_0x5237c0['params']['id']},'order':_0x3fe3('0xa1')});});}})[_0x3fe3('0x1c')](respondWithResult(_0x1dd617,null))[_0x3fe3('0x25')](handleError(_0x1dd617,null));};exports['getApplications']=function(_0x51ef55,_0x4dde8b,_0x232f07){var _0x1ecd85={};var _0x204396={};var _0x3e7f07;var _0x25349;return db[_0x3fe3('0x3c')][_0x3fe3('0x66')]({'where':{'id':_0x51ef55[_0x3fe3('0x56')]['id']}})[_0x3fe3('0x1c')](handleEntityNotFound(_0x4dde8b,null))[_0x3fe3('0x1c')](function(_0x4dcbda){if(_0x4dcbda){_0x3e7f07=_0x4dcbda;_0x204396[_0x3fe3('0x41')]=_['keys'](db[_0x3fe3('0x11f')][_0x3fe3('0x3d')]);_0x204396[_0x3fe3('0x43')]=_[_0x3fe3('0x57')](_0x51ef55[_0x3fe3('0x43')]);_0x204396[_0x3fe3('0x44')]=_['intersection'](_0x204396[_0x3fe3('0x41')],_0x204396[_0x3fe3('0x43')]);_0x1ecd85[_0x3fe3('0x47')]=_[_0x3fe3('0x45')](_0x204396[_0x3fe3('0x41')],qs[_0x3fe3('0x46')](_0x51ef55['query'][_0x3fe3('0x46')]));_0x1ecd85[_0x3fe3('0x47')]=_0x1ecd85['attributes'][_0x3fe3('0x48')]?_0x1ecd85[_0x3fe3('0x47')]:_0x204396[_0x3fe3('0x41')];_0x1ecd85[_0x3fe3('0x4b')]=qs[_0x3fe3('0x4c')](_0x51ef55[_0x3fe3('0x43')][_0x3fe3('0x4c')]);_0x1ecd85[_0x3fe3('0x4d')]=qs[_0x3fe3('0x44')](_['pick'](_0x51ef55[_0x3fe3('0x43')],_0x204396[_0x3fe3('0x44')]));if(_0x51ef55[_0x3fe3('0x43')]['filter']){_0x1ecd85[_0x3fe3('0x4d')]=_[_0x3fe3('0x58')](_0x1ecd85[_0x3fe3('0x4d')],{'$or':_[_0x3fe3('0x42')](_0x1ecd85[_0x3fe3('0x47')],function(_0x5bf79f){var _0x1976ba={};_0x1976ba[_0x5bf79f]={'$like':'%'+_0x51ef55[_0x3fe3('0x43')][_0x3fe3('0x4f')]+'%'};return _0x1976ba;})});}_0x1ecd85=_[_0x3fe3('0x58')]({},_0x1ecd85,_0x51ef55['options']);return _0x3e7f07[_0x3fe3('0x122')](_0x1ecd85);}})[_0x3fe3('0x1c')](function(_0x4ff7d3){if(_0x4ff7d3){_0x25349=_0x4ff7d3['length'];if(!_0x51ef55[_0x3fe3('0x43')][_0x3fe3('0x49')]('nolimit')){_0x1ecd85[_0x3fe3('0x2c')]=qs[_0x3fe3('0x2c')](_0x51ef55[_0x3fe3('0x43')][_0x3fe3('0x2c')]);_0x1ecd85[_0x3fe3('0x2a')]=qs[_0x3fe3('0x2a')](_0x51ef55['query']['offset']);}return _0x3e7f07[_0x3fe3('0x122')](_0x1ecd85);}})[_0x3fe3('0x1c')](function(_0x189e49){if(_0x189e49){return _0x189e49?{'count':_0x25349,'rows':_0x189e49}:null;}})[_0x3fe3('0x1c')](respondWithResult(_0x4dde8b,null))['catch'](handleError(_0x4dde8b,null));};exports['addProactiveActions']=function(_0x459192,_0x3789a2,_0x3c1083){return db[_0x3fe3('0x123')]['find']({'where':{'id':_0x459192[_0x3fe3('0x56')]['id']}})[_0x3fe3('0x1c')](handleEntityNotFound(_0x3789a2,null))[_0x3fe3('0x1c')](function(_0x1a15e9){if(_0x1a15e9){return _0x1a15e9[_0x3fe3('0x124')](_0x459192[_0x3fe3('0x61')][_0x3fe3('0x69')],_['omit'](_0x459192[_0x3fe3('0x61')],[_0x3fe3('0x69'),'id'])||{});}})['then'](respondWithResult(_0x3789a2,null))['catch'](handleError(_0x3789a2,null));};exports[_0x3fe3('0x10d')]=function(_0x5d29e3,_0x2240d9,_0x286186){var _0x24182d={};var _0x4e1422={};var _0x3ba0b1;var _0x3c7898;return db[_0x3fe3('0x3c')][_0x3fe3('0x66')]({'where':{'id':_0x5d29e3[_0x3fe3('0x56')]['id']}})[_0x3fe3('0x1c')](handleEntityNotFound(_0x2240d9,null))[_0x3fe3('0x1c')](function(_0x2eec8a){if(_0x2eec8a){_0x3ba0b1=_0x2eec8a;_0x4e1422[_0x3fe3('0x41')]=_[_0x3fe3('0x57')](db[_0x3fe3('0x125')][_0x3fe3('0x3d')]);_0x4e1422[_0x3fe3('0x43')]=_[_0x3fe3('0x57')](_0x5d29e3['query']);_0x4e1422['filters']=_[_0x3fe3('0x45')](_0x4e1422[_0x3fe3('0x41')],_0x4e1422[_0x3fe3('0x43')]);_0x24182d[_0x3fe3('0x47')]=_['intersection'](_0x4e1422[_0x3fe3('0x41')],qs[_0x3fe3('0x46')](_0x5d29e3[_0x3fe3('0x43')][_0x3fe3('0x46')]));_0x24182d[_0x3fe3('0x47')]=_0x24182d[_0x3fe3('0x47')]['length']?_0x24182d[_0x3fe3('0x47')]:_0x4e1422['model'];_0x24182d['order']=qs['sort'](_0x5d29e3['query'][_0x3fe3('0x4c')]);_0x24182d[_0x3fe3('0x4d')]=qs[_0x3fe3('0x44')](_[_0x3fe3('0x4e')](_0x5d29e3[_0x3fe3('0x43')],_0x4e1422[_0x3fe3('0x44')]));if(_0x5d29e3[_0x3fe3('0x43')][_0x3fe3('0x4f')]){_0x24182d[_0x3fe3('0x4d')]=_[_0x3fe3('0x58')](_0x24182d[_0x3fe3('0x4d')],{'$or':_[_0x3fe3('0x42')](_0x24182d[_0x3fe3('0x47')],function(_0x472bd9){var _0x1340f4={};_0x1340f4[_0x472bd9]={'$like':'%'+_0x5d29e3[_0x3fe3('0x43')]['filter']+'%'};return _0x1340f4;})});}_0x24182d=_[_0x3fe3('0x58')]({},_0x24182d,_0x5d29e3[_0x3fe3('0x51')]);return _0x3ba0b1['getProactiveActions'](_0x24182d);}})[_0x3fe3('0x1c')](function(_0x556f86){if(_0x556f86){_0x3c7898=_0x556f86[_0x3fe3('0x48')];if(!_0x5d29e3['query'][_0x3fe3('0x49')](_0x3fe3('0x4a'))){_0x24182d[_0x3fe3('0x2c')]=qs['limit'](_0x5d29e3[_0x3fe3('0x43')][_0x3fe3('0x2c')]);_0x24182d['offset']=qs[_0x3fe3('0x2a')](_0x5d29e3[_0x3fe3('0x43')][_0x3fe3('0x2a')]);}return _0x3ba0b1[_0x3fe3('0x10d')](_0x24182d);}})['then'](function(_0x514d53){if(_0x514d53){return _0x514d53?{'count':_0x3c7898,'rows':_0x514d53}:null;}})[_0x3fe3('0x1c')](respondWithResult(_0x2240d9,null))['catch'](handleError(_0x2240d9,null));};exports[_0x3fe3('0x126')]=function(_0x513053,_0x258fc9,_0x1a0d4e){var _0xdfd02b=_0x513053[_0x3fe3('0x43')][_0x3fe3('0x127')]===_0x3fe3('0x128')?'offlineForm':_0x3fe3('0x129');return db['ChatWebsite']['find']({'attributes':['id',_0xdfd02b],'where':{'id':_0x513053['params']['id']}})[_0x3fe3('0x1c')](handleEntityNotFound(_0x258fc9,null))[_0x3fe3('0x1c')](function(_0x575e34){if(_0x575e34){var _0x2d7c82=_0x575e34[_0xdfd02b];var _0x205777=_0x2d7c82&&_0x2d7c82[_0x3fe3('0x12a')]?_0x2d7c82['items']:[];_0x258fc9[_0x3fe3('0x38')]({'fromKey':_['isNil'](_0x2d7c82[_0x3fe3('0x12b')])?undefined:_0x2d7c82[_0x3fe3('0x12b')],'count':_0x205777[_0x3fe3('0x48')],'rows':_0x205777});}})['catch'](handleError(_0x258fc9,null));};exports['getOfflineMessages']=function(_0x4a4992,_0xbafff3,_0x171396){var _0x130569={'raw':![],'where':{}};var _0x7c1b4b={};var _0x2e0754={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x3fe3('0x66')]({'where':{'id':_0x4a4992[_0x3fe3('0x56')]['id']}})['then'](handleEntityNotFound(_0xbafff3,null))[_0x3fe3('0x1c')](function(_0x33af9d){if(_0x33af9d){_0x7c1b4b[_0x3fe3('0x41')]=_[_0x3fe3('0x57')](db[_0x3fe3('0xd5')]['rawAttributes']);_0x7c1b4b[_0x3fe3('0x43')]=_[_0x3fe3('0x57')](_0x4a4992[_0x3fe3('0x43')]);_0x7c1b4b['filters']=_[_0x3fe3('0x45')](_0x7c1b4b[_0x3fe3('0x41')],_0x7c1b4b[_0x3fe3('0x43')]);_0x130569[_0x3fe3('0x47')]=_[_0x3fe3('0x45')](_0x7c1b4b[_0x3fe3('0x41')],qs[_0x3fe3('0x46')](_0x4a4992[_0x3fe3('0x43')][_0x3fe3('0x46')]));_0x130569[_0x3fe3('0x47')]=_0x130569['attributes'][_0x3fe3('0x48')]?_0x130569[_0x3fe3('0x47')]:_0x7c1b4b[_0x3fe3('0x41')];if(!_0x4a4992[_0x3fe3('0x43')][_0x3fe3('0x49')](_0x3fe3('0x4a'))){_0x130569[_0x3fe3('0x2c')]=qs['limit'](_0x4a4992[_0x3fe3('0x43')]['limit']);_0x130569[_0x3fe3('0x2a')]=qs['offset'](_0x4a4992['query'][_0x3fe3('0x2a')]);}_0x130569[_0x3fe3('0x4b')]=qs['sort'](_0x4a4992[_0x3fe3('0x43')][_0x3fe3('0x4c')]);_0x130569['where']=qs[_0x3fe3('0x44')](_[_0x3fe3('0x4e')](_0x4a4992[_0x3fe3('0x43')],_0x7c1b4b[_0x3fe3('0x44')]));_0x130569[_0x3fe3('0x4d')][_0x3fe3('0x67')]=_0x33af9d['id'];if(_0x4a4992[_0x3fe3('0x43')][_0x3fe3('0x4f')]){_0x130569['where']=_[_0x3fe3('0x58')](_0x130569[_0x3fe3('0x4d')],{'$or':_[_0x3fe3('0x42')](_0x130569[_0x3fe3('0x47')],function(_0xfbcf0f){var _0x4eb31c={};_0x4eb31c[_0xfbcf0f]={'$like':'%'+_0x4a4992['query'][_0x3fe3('0x4f')]+'%'};return _0x4eb31c;})});}_0x130569=_['merge']({},_0x130569,_0x4a4992[_0x3fe3('0x51')]);return db['ChatOfflineMessage']['count']({'where':_0x130569['where']})['then'](function(_0x2a0886){_0x2e0754[_0x3fe3('0x2d')]=_0x2a0886;if(_0x4a4992[_0x3fe3('0x43')][_0x3fe3('0x52')]){_0x130569[_0x3fe3('0x53')]=[{'all':!![]}];}else{_0x130569[_0x3fe3('0x53')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x3fe3('0xdd')],'as':_0x3fe3('0x12c'),'required':![]}];}return db[_0x3fe3('0xd5')][_0x3fe3('0x101')](_0x130569);})[_0x3fe3('0x1c')](function(_0x3f7516){_0x2e0754[_0x3fe3('0x54')]=_0x3f7516;return _0x2e0754;});}})[_0x3fe3('0x1c')](respondWithFilteredResult(_0xbafff3,_0x130569))['catch'](handleError(_0xbafff3,null));};exports[_0x3fe3('0x12d')]=function(_0x55aa16,_0x118c4a,_0x365910){return db[_0x3fe3('0x3c')][_0x3fe3('0x59')]({'where':{'id':_0x55aa16[_0x3fe3('0x56')]['id']}})[_0x3fe3('0x1c')](handleEntityNotFound(_0x118c4a,null))['then'](function(_0x19db34){if(_0x19db34){return _0x19db34[_0x3fe3('0x12d')](_0x55aa16['body'][_0x3fe3('0x69')],_[_0x3fe3('0x12e')](_0x55aa16['body'],[_0x3fe3('0x69'),'id'])||{})[_0x3fe3('0xb8')](function(_0x817a2){for(var _0x316431=0x0;_0x316431<_0x55aa16[_0x3fe3('0x61')][_0x3fe3('0x69')][_0x3fe3('0x48')];_0x316431+=0x1){socket[_0x3fe3('0x12f')]('userChatWebsite:save',{'UserId':Number(_0x55aa16[_0x3fe3('0x61')][_0x3fe3('0x69')][_0x316431]),'ChatWebsiteId':Number(_0x55aa16[_0x3fe3('0x56')]['id'])});}return _0x817a2;});}})[_0x3fe3('0x1c')](respondWithResult(_0x118c4a,null))[_0x3fe3('0x25')](handleError(_0x118c4a,null));};exports[_0x3fe3('0x130')]=function(_0x2417ee,_0x5902ec,_0x51c2c6){return db[_0x3fe3('0x3c')][_0x3fe3('0x59')]({'where':{'id':_0x2417ee[_0x3fe3('0x56')]['id']}})[_0x3fe3('0x1c')](handleEntityNotFound(_0x5902ec,null))['then'](function(_0x55dbb7){if(_0x55dbb7){return _0x55dbb7['removeAgents'](_0x2417ee[_0x3fe3('0x43')][_0x3fe3('0x69')])[_0x3fe3('0x1c')](function(){if(_['isArray'](_0x2417ee[_0x3fe3('0x43')][_0x3fe3('0x69')])){for(var _0x46801b=0x0;_0x46801b<_0x2417ee[_0x3fe3('0x43')][_0x3fe3('0x69')][_0x3fe3('0x48')];_0x46801b+=0x1){socket[_0x3fe3('0x12f')]('userChatWebsite:remove',{'UserId':Number(_0x2417ee[_0x3fe3('0x43')][_0x3fe3('0x69')][_0x46801b]),'ChatWebsiteId':Number(_0x2417ee[_0x3fe3('0x56')]['id'])});}}else{socket[_0x3fe3('0x12f')](_0x3fe3('0x131'),{'UserId':Number(_0x2417ee[_0x3fe3('0x43')][_0x3fe3('0x69')]),'ChatWebsiteId':Number(_0x2417ee[_0x3fe3('0x56')]['id'])});}});}})[_0x3fe3('0x1c')](respondWithStatusCode(_0x5902ec,null))[_0x3fe3('0x25')](handleError(_0x5902ec,null));};exports[_0x3fe3('0x132')]=function(_0x44ffae,_0x1715bb,_0x2a9f08){var _0x210c63={};var _0x43740a={};var _0x287142;var _0x3275b2;return db['ChatWebsite'][_0x3fe3('0x66')]({'where':{'id':_0x44ffae[_0x3fe3('0x56')]['id']}})[_0x3fe3('0x1c')](handleEntityNotFound(_0x1715bb,null))['then'](function(_0x968c98){if(_0x968c98){_0x287142=_0x968c98;_0x43740a[_0x3fe3('0x41')]=_[_0x3fe3('0x57')](db[_0x3fe3('0xc2')]['rawAttributes']);_0x43740a['query']=_['keys'](_0x44ffae[_0x3fe3('0x43')]);_0x43740a[_0x3fe3('0x44')]=_[_0x3fe3('0x45')](_0x43740a['model'],_0x43740a[_0x3fe3('0x43')]);_0x210c63[_0x3fe3('0x47')]=_[_0x3fe3('0x45')](_0x43740a[_0x3fe3('0x41')],qs[_0x3fe3('0x46')](_0x44ffae[_0x3fe3('0x43')][_0x3fe3('0x46')]));_0x210c63[_0x3fe3('0x47')]=_0x210c63[_0x3fe3('0x47')][_0x3fe3('0x48')]?_0x210c63[_0x3fe3('0x47')]:_0x43740a[_0x3fe3('0x41')];_0x210c63[_0x3fe3('0x4b')]=qs[_0x3fe3('0x4c')](_0x44ffae[_0x3fe3('0x43')]['sort']);_0x210c63[_0x3fe3('0x4d')]=qs[_0x3fe3('0x44')](_['pick'](_0x44ffae[_0x3fe3('0x43')],_0x43740a['filters']));if(_0x44ffae[_0x3fe3('0x43')][_0x3fe3('0x4f')]){_0x210c63[_0x3fe3('0x4d')]=_[_0x3fe3('0x58')](_0x210c63[_0x3fe3('0x4d')],{'$or':_['map'](_0x210c63['attributes'],function(_0x1ef9c5){var _0x3255db={};_0x3255db[_0x1ef9c5]={'$like':'%'+_0x44ffae['query'][_0x3fe3('0x4f')]+'%'};return _0x3255db;})});}_0x210c63=_[_0x3fe3('0x58')]({},_0x210c63,_0x44ffae[_0x3fe3('0x51')]);return _0x287142['getAgents'](_0x210c63);}})[_0x3fe3('0x1c')](function(_0x327e06){if(_0x327e06){_0x3275b2=_0x327e06['length'];if(!_0x44ffae[_0x3fe3('0x43')]['hasOwnProperty'](_0x3fe3('0x4a'))){_0x210c63[_0x3fe3('0x2c')]=qs['limit'](_0x44ffae[_0x3fe3('0x43')][_0x3fe3('0x2c')]);_0x210c63['offset']=qs[_0x3fe3('0x2a')](_0x44ffae[_0x3fe3('0x43')][_0x3fe3('0x2a')]);}return _0x287142[_0x3fe3('0x132')](_0x210c63);}})['then'](function(_0x14c517){if(_0x14c517){return _0x14c517?{'count':_0x3275b2,'rows':_0x14c517}:null;}})[_0x3fe3('0x1c')](respondWithResult(_0x1715bb,null))[_0x3fe3('0x25')](handleError(_0x1715bb,null));};
\ No newline at end of file
+var _0x6bd9=['%s\x20%s\x20%s','vendor','threadId','ChatInteraction','externalUrl','interaction','spread','firstName','lastName','messageId','autoclose','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','server','attachments','offline-chat','basename','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','SendMail','\x22%s\x22\x20<%s>','email','openNewInteraction','MailAccountId','mimetype','toPairsIn','subjectOffline','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','includeAll','Contact','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','interval','ONLINE','OFFLINE','No\x20timezone','Interval','Intervals','virtual','custom','chatLicenseExceeded','push','all','some','remote','x-real-ip','connection','remoteAddress','replace','verticalAlignment','color_button','backgroundColor','addApplications','findAndCountAll','priority','getApplications','chatProactiveAction','addProactiveActions','getProactiveActions','ChatProactiveAction','getFields','online','false','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','jayson/promise','http','client','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','UserProfileResource','sendStatus','stack','send','Pause','map','ChatWebsite','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','name','options','include','findAll','rows','show','params','mandatoryDispositionPause','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','ChatWebsiteId','merge','removeDispositions','findOne','CannedAnswer','removeAnswers','ids','addLogo','file','filename','agentAvatar','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','isNil','existsSync','server/files/images/logos/','sitepic','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','download','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','DESC','ChatApplication','account','applications','Applications','list','orderBy','asc','Contacts','mapKey','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device'];(function(_0x5840a5,_0x374e6c){var _0x2d3e92=function(_0x96cad4){while(--_0x96cad4){_0x5840a5['push'](_0x5840a5['shift']());}};_0x2d3e92(++_0x374e6c);}(_0x6bd9,0x1bf));var _0x96bd=function(_0x37c3da,_0x5df920){_0x37c3da=_0x37c3da-0x0;var _0x1426cb=_0x6bd9[_0x37c3da];return _0x1426cb;};'use strict';var emlformat=require(_0x96bd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x96bd('0x1'));var jsonpatch=require(_0x96bd('0x2'));var rp=require(_0x96bd('0x3'));var moment=require('moment');var BPromise=require(_0x96bd('0x4'));var Mustache=require(_0x96bd('0x5'));var util=require(_0x96bd('0x6'));var path=require(_0x96bd('0x7'));var sox=require(_0x96bd('0x8'));var csv=require('to-csv');var ejs=require(_0x96bd('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x96bd('0xa'));var crypto=require(_0x96bd('0xb'));var jsforce=require(_0x96bd('0xc'));var deskjs=require(_0x96bd('0xd'));var toCsv=require(_0x96bd('0xe'));var querystring=require('querystring');var Papa=require(_0x96bd('0xf'));var Redis=require(_0x96bd('0x10'));var authService=require(_0x96bd('0x11'));var qs=require(_0x96bd('0x12'));var as=require(_0x96bd('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x96bd('0x14'))(_0x96bd('0x15'));var utils=require(_0x96bd('0x16'));var config=require(_0x96bd('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x96bd('0x18'))['db'];config['redis']=_[_0x96bd('0x19')](config[_0x96bd('0x1a')],{'host':_0x96bd('0x1b'),'port':0x18eb});var socket=require(_0x96bd('0x1c'))(new Redis(config[_0x96bd('0x1a')]));require(_0x96bd('0x1d'))['register'](socket);var jayson=require(_0x96bd('0x1e'));var client=jayson['client'][_0x96bd('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0x96bd('0x1f')]({'port':0x232a});var client9003=jayson['client']['http']({'port':0x232b});var client9001=jayson[_0x96bd('0x20')][_0x96bd('0x1f')]({'port':0x2329});function respondWithRpcPromise(_0x318344,_0x5c48c5,_0x453c80,_0x2f72ea){return new BPromise(function(_0x2417b8,_0x4c781a){var _0x3a3b2e=_0x2f72ea||client;return _0x3a3b2e['request'](_0x318344,_0x453c80)['then'](function(_0x231a0d){logger[_0x96bd('0x21')](_0x96bd('0x22'),_0x5c48c5,'request\x20sent');logger[_0x96bd('0x23')](_0x96bd('0x24'),_0x5c48c5,_0x96bd('0x25'),JSON[_0x96bd('0x26')](_0x231a0d));if(_0x231a0d[_0x96bd('0x27')]){if(_0x231a0d[_0x96bd('0x27')]['code']===0x1f4){logger[_0x96bd('0x27')](_0x96bd('0x22'),_0x5c48c5,_0x231a0d[_0x96bd('0x27')][_0x96bd('0x28')]);return _0x4c781a(_0x231a0d['error'][_0x96bd('0x28')]);}logger[_0x96bd('0x27')](_0x96bd('0x22'),_0x5c48c5,_0x231a0d['error']['message']);return _0x2417b8(_0x231a0d['error'][_0x96bd('0x28')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x5c48c5,'request\x20sent');_0x2417b8(_0x231a0d[_0x96bd('0x29')][_0x96bd('0x28')]);}})[_0x96bd('0x2a')](function(_0x120100){logger['error'](_0x96bd('0x22'),_0x5c48c5,_0x120100);_0x4c781a(_0x120100);});});}function respondWithStatusCode(_0xeb2f1f,_0x13e476){_0x13e476=_0x13e476||0xcc;return function(_0x305dd5){if(_0x305dd5){return _0xeb2f1f['sendStatus'](_0x13e476);}return _0xeb2f1f[_0x96bd('0x2b')](_0x13e476)[_0x96bd('0x2c')]();};}function respondWithResult(_0x445234,_0x46eab9){_0x46eab9=_0x46eab9||0xc8;return function(_0x2c81f1){if(_0x2c81f1){return _0x445234[_0x96bd('0x2b')](_0x46eab9)[_0x96bd('0x2d')](_0x2c81f1);}};}function respondWithFilteredResult(_0x4bbe61,_0x538981){return function(_0x80eaaf){if(_0x80eaaf){var _0x274f1b=typeof _0x538981['offset']===_0x96bd('0x2e')&&typeof _0x538981[_0x96bd('0x2f')]==='undefined';var _0x13793a=_0x80eaaf[_0x96bd('0x30')];var _0xe67d6c=_0x274f1b?0x0:_0x538981['offset'];var _0x596107=_0x274f1b?_0x80eaaf['count']:_0x538981[_0x96bd('0x31')]+_0x538981[_0x96bd('0x2f')];var _0x466c5f;if(_0x596107>=_0x13793a){_0x596107=_0x13793a;_0x466c5f=0xc8;}else{_0x466c5f=0xce;}_0x4bbe61[_0x96bd('0x2b')](_0x466c5f);return _0x4bbe61[_0x96bd('0x32')](_0x96bd('0x33'),_0xe67d6c+'-'+_0x596107+'/'+_0x13793a)[_0x96bd('0x2d')](_0x80eaaf);}return null;};}function patchUpdates(_0x452f78){return function(_0x9a341c){try{jsonpatch[_0x96bd('0x34')](_0x9a341c,_0x452f78,!![]);}catch(_0x5b2b6a){return BPromise['reject'](_0x5b2b6a);}return _0x9a341c[_0x96bd('0x35')]();};}function saveUpdates(_0xd5aa27,_0x2a5038){return function(_0x5a2a86){if(_0x5a2a86){return _0x5a2a86[_0x96bd('0x36')](_0xd5aa27)[_0x96bd('0x37')](function(_0x2a62b9){return _0x2a62b9;});}return null;};}function removeEntity(_0x9dcaae,_0x394ff2){return function(_0x3bf9a2){if(_0x3bf9a2){return _0x3bf9a2[_0x96bd('0x38')]()[_0x96bd('0x37')](function(){var _0x39658e=_0x3bf9a2['get']({'plain':!![]});var _0x4b3424='ChatWebsites';return db[_0x96bd('0x39')][_0x96bd('0x38')]({'where':{'type':_0x4b3424,'resourceId':_0x39658e['id']}})['then'](function(){return _0x3bf9a2;});})[_0x96bd('0x37')](function(){_0x9dcaae[_0x96bd('0x2b')](0xcc)[_0x96bd('0x2c')]();});}};}function handleEntityNotFound(_0x1952af,_0x5d62c8){return function(_0x21758c){if(!_0x21758c){_0x1952af[_0x96bd('0x3a')](0x194);}return _0x21758c;};}function handleError(_0xde8fcd,_0x29d11e){_0x29d11e=_0x29d11e||0x1f4;return function(_0x111e9a){logger[_0x96bd('0x27')](_0x111e9a[_0x96bd('0x3b')]);if(_0x111e9a['name']){delete _0x111e9a['name'];}_0xde8fcd[_0x96bd('0x2b')](_0x29d11e)[_0x96bd('0x3c')](_0x111e9a);};}exports['index']=function(_0x5df5cc,_0x27b082){var _0x15d924={'include':[{'model':db[_0x96bd('0x3d')],'as':'mandatoryDispositionPause'}]},_0x1deb71={},_0x4194a0={'count':0x0,'rows':[]};var _0x5556c8=_[_0x96bd('0x3e')](db[_0x96bd('0x3f')][_0x96bd('0x40')],function(_0x4b73c5){return{'name':_0x4b73c5[_0x96bd('0x41')],'type':_0x4b73c5[_0x96bd('0x42')][_0x96bd('0x43')]};});_0x1deb71['model']=_[_0x96bd('0x3e')](_0x5556c8,'name');_0x1deb71[_0x96bd('0x44')]=_[_0x96bd('0x45')](_0x5df5cc[_0x96bd('0x44')]);_0x1deb71[_0x96bd('0x46')]=_[_0x96bd('0x47')](_0x1deb71[_0x96bd('0x48')],_0x1deb71[_0x96bd('0x44')]);_0x15d924[_0x96bd('0x49')]=_[_0x96bd('0x47')](_0x1deb71['model'],qs[_0x96bd('0x4a')](_0x5df5cc[_0x96bd('0x44')]['fields']));_0x15d924[_0x96bd('0x49')]=_0x15d924['attributes'][_0x96bd('0x4b')]?_0x15d924[_0x96bd('0x49')]:_0x1deb71[_0x96bd('0x48')];if(!_0x5df5cc[_0x96bd('0x44')][_0x96bd('0x4c')](_0x96bd('0x4d'))){_0x15d924[_0x96bd('0x2f')]=qs['limit'](_0x5df5cc[_0x96bd('0x44')]['limit']);_0x15d924['offset']=qs['offset'](_0x5df5cc[_0x96bd('0x44')][_0x96bd('0x31')]);}_0x15d924[_0x96bd('0x4e')]=qs[_0x96bd('0x4f')](_0x5df5cc[_0x96bd('0x44')]['sort']);_0x15d924[_0x96bd('0x50')]=qs[_0x96bd('0x46')](_[_0x96bd('0x51')](_0x5df5cc[_0x96bd('0x44')],_0x1deb71[_0x96bd('0x46')]),_0x5556c8);if(_0x5df5cc[_0x96bd('0x44')][_0x96bd('0x52')]){_0x15d924[_0x96bd('0x50')]=_['merge'](_0x15d924[_0x96bd('0x50')],{'$or':_[_0x96bd('0x3e')](_0x5556c8,function(_0xbd0e02){if(_0xbd0e02['type']!=='VIRTUAL'){var _0x402bbe={};_0x402bbe[_0xbd0e02[_0x96bd('0x53')]]={'$like':'%'+_0x5df5cc[_0x96bd('0x44')][_0x96bd('0x52')]+'%'};return _0x402bbe;}})});}_0x15d924=_['merge']({},_0x15d924,_0x5df5cc[_0x96bd('0x54')]);var _0xe9bf12={'where':_0x15d924[_0x96bd('0x50')]};return db[_0x96bd('0x3f')]['count'](_0xe9bf12)['then'](function(_0x5b7a55){_0x4194a0['count']=_0x5b7a55;if(_0x5df5cc[_0x96bd('0x44')]['includeAll']){_0x15d924[_0x96bd('0x55')]=[{'all':!![]}];}return db[_0x96bd('0x3f')][_0x96bd('0x56')](_0x15d924);})[_0x96bd('0x37')](function(_0x3a3bb7){_0x4194a0[_0x96bd('0x57')]=_0x3a3bb7;return _0x4194a0;})[_0x96bd('0x37')](respondWithFilteredResult(_0x27b082,_0x15d924))[_0x96bd('0x2a')](handleError(_0x27b082,null));};exports[_0x96bd('0x58')]=function(_0x542be7,_0xfca316){var _0x40cd56={'raw':![],'where':{'id':_0x542be7[_0x96bd('0x59')]['id']},'include':[{'model':db[_0x96bd('0x3d')],'as':_0x96bd('0x5a')}]},_0x483f4b={};_0x483f4b[_0x96bd('0x48')]=_[_0x96bd('0x45')](db[_0x96bd('0x3f')][_0x96bd('0x40')]);_0x483f4b[_0x96bd('0x44')]=_['keys'](_0x542be7[_0x96bd('0x44')]);_0x483f4b[_0x96bd('0x46')]=_[_0x96bd('0x47')](_0x483f4b[_0x96bd('0x48')],_0x483f4b[_0x96bd('0x44')]);_0x40cd56['attributes']=_[_0x96bd('0x47')](_0x483f4b[_0x96bd('0x48')],qs['fields'](_0x542be7[_0x96bd('0x44')][_0x96bd('0x4a')]));_0x40cd56[_0x96bd('0x49')]=_0x40cd56[_0x96bd('0x49')][_0x96bd('0x4b')]?_0x40cd56[_0x96bd('0x49')]:_0x483f4b[_0x96bd('0x48')];if(_0x542be7['query']['includeAll']){_0x40cd56[_0x96bd('0x55')]=[{'all':!![]}];}_0x40cd56=_['merge']({},_0x40cd56,_0x542be7['options']);return db['ChatWebsite'][_0x96bd('0x5b')](_0x40cd56)[_0x96bd('0x37')](handleEntityNotFound(_0xfca316,null))['then'](respondWithResult(_0xfca316,null))[_0x96bd('0x2a')](handleError(_0xfca316,null));};exports['create']=function(_0x45355c,_0x3556a1){return db['ChatWebsite'][_0x96bd('0x5c')](_0x45355c[_0x96bd('0x5d')],{})[_0x96bd('0x37')](function(_0x5c87fa){var _0x2038f5=_0x45355c['user'][_0x96bd('0x5e')]({'plain':!![]});if(!_0x2038f5)throw new Error(_0x96bd('0x5f'));if(_0x2038f5['role']===_0x96bd('0x60')){var _0x22aed0=_0x5c87fa[_0x96bd('0x5e')]({'plain':!![]});var _0x321eca='ChatWebsites';return db[_0x96bd('0x61')][_0x96bd('0x5b')]({'where':{'name':_0x321eca,'userProfileId':_0x2038f5[_0x96bd('0x62')]},'raw':!![]})[_0x96bd('0x37')](function(_0x377fbf){if(_0x377fbf&&_0x377fbf[_0x96bd('0x63')]===0x0){return db[_0x96bd('0x39')][_0x96bd('0x5c')]({'name':_0x22aed0[_0x96bd('0x53')],'resourceId':_0x22aed0['id'],'type':_0x377fbf['name'],'sectionId':_0x377fbf['id']},{})[_0x96bd('0x37')](function(){return _0x5c87fa;});}else{return _0x5c87fa;}})['catch'](function(_0x2f06e8){logger[_0x96bd('0x27')](_0x96bd('0x64'),_0x2f06e8);throw _0x2f06e8;});}return _0x5c87fa;})[_0x96bd('0x37')](respondWithResult(_0x3556a1,0xc9))[_0x96bd('0x2a')](handleError(_0x3556a1,null));};exports['update']=function(_0x4161c4,_0x12c0bd){if(_0x4161c4[_0x96bd('0x5d')]['id']){delete _0x4161c4[_0x96bd('0x5d')]['id'];}return db[_0x96bd('0x3f')]['find']({'where':{'id':_0x4161c4['params']['id']},'include':[{'model':db[_0x96bd('0x3d')],'as':_0x96bd('0x5a')}]})[_0x96bd('0x37')](handleEntityNotFound(_0x12c0bd,null))[_0x96bd('0x37')](saveUpdates(_0x4161c4[_0x96bd('0x5d')],null))[_0x96bd('0x37')](respondWithResult(_0x12c0bd,null))[_0x96bd('0x2a')](handleError(_0x12c0bd,null));};exports[_0x96bd('0x38')]=function(_0x4782ad,_0x16da71){return db[_0x96bd('0x3f')][_0x96bd('0x5b')]({'where':{'id':_0x4782ad[_0x96bd('0x59')]['id']}})[_0x96bd('0x37')](handleEntityNotFound(_0x16da71,null))[_0x96bd('0x37')](removeEntity(_0x16da71,null))[_0x96bd('0x2a')](handleError(_0x16da71,null));};exports['describe']=function(_0x172ae4,_0x2b623a){return db[_0x96bd('0x3f')][_0x96bd('0x65')]()[_0x96bd('0x37')](respondWithResult(_0x2b623a,null))[_0x96bd('0x2a')](handleError(_0x2b623a,null));};exports[_0x96bd('0x66')]=function(_0x47ec62,_0x34b0be,_0x5ac7f2){if(_0x47ec62[_0x96bd('0x5d')]['id']){delete _0x47ec62[_0x96bd('0x5d')]['id'];}return db[_0x96bd('0x3f')][_0x96bd('0x5b')]({'where':{'id':_0x47ec62['params']['id']}})[_0x96bd('0x37')](handleEntityNotFound(_0x34b0be,null))[_0x96bd('0x37')](function(_0x1b3c96){if(_0x1b3c96){_0x47ec62['body']['ChatWebsiteId']=_0x1b3c96['id'];return db[_0x96bd('0x67')][_0x96bd('0x5c')](_0x47ec62['body']);}})[_0x96bd('0x37')](respondWithResult(_0x34b0be,null))[_0x96bd('0x2a')](handleError(_0x34b0be,null));};exports[_0x96bd('0x68')]=function(_0x5996ef,_0x201703,_0x29adf8){var _0x1c710f={'raw':![],'where':{}};var _0x38bdfc={};var _0x5b2046={'count':0x0,'rows':[]};return db[_0x96bd('0x3f')]['findOne']({'where':{'id':_0x5996ef[_0x96bd('0x59')]['id']}})[_0x96bd('0x37')](handleEntityNotFound(_0x201703,null))[_0x96bd('0x37')](function(_0x4817bd){if(_0x4817bd){_0x38bdfc[_0x96bd('0x48')]=_[_0x96bd('0x45')](db['Disposition']['rawAttributes']);_0x38bdfc[_0x96bd('0x44')]=_['keys'](_0x5996ef[_0x96bd('0x44')]);_0x38bdfc['filters']=_[_0x96bd('0x47')](_0x38bdfc['model'],_0x38bdfc['query']);_0x1c710f['attributes']=_[_0x96bd('0x47')](_0x38bdfc[_0x96bd('0x48')],qs['fields'](_0x5996ef['query'][_0x96bd('0x4a')]));_0x1c710f[_0x96bd('0x49')]=_0x1c710f[_0x96bd('0x49')][_0x96bd('0x4b')]?_0x1c710f['attributes']:_0x38bdfc['model'];if(!_0x5996ef['query'][_0x96bd('0x4c')]('nolimit')){_0x1c710f[_0x96bd('0x2f')]=qs[_0x96bd('0x2f')](_0x5996ef[_0x96bd('0x44')][_0x96bd('0x2f')]);_0x1c710f['offset']=qs[_0x96bd('0x31')](_0x5996ef[_0x96bd('0x44')][_0x96bd('0x31')]);}_0x1c710f['order']=qs['sort'](_0x5996ef[_0x96bd('0x44')][_0x96bd('0x4f')]);_0x1c710f[_0x96bd('0x50')]=qs[_0x96bd('0x46')](_['pick'](_0x5996ef['query'],_0x38bdfc[_0x96bd('0x46')]));_0x1c710f[_0x96bd('0x50')][_0x96bd('0x69')]=_0x4817bd['id'];if(_0x5996ef[_0x96bd('0x44')][_0x96bd('0x52')]){_0x1c710f[_0x96bd('0x50')]=_[_0x96bd('0x6a')](_0x1c710f[_0x96bd('0x50')],{'$or':_[_0x96bd('0x3e')](_0x1c710f['attributes'],function(_0x27b674){var _0x139bba={};_0x139bba[_0x27b674]={'$like':'%'+_0x5996ef[_0x96bd('0x44')][_0x96bd('0x52')]+'%'};return _0x139bba;})});}_0x1c710f=_[_0x96bd('0x6a')]({},_0x1c710f,_0x5996ef[_0x96bd('0x54')]);return db['Disposition'][_0x96bd('0x30')]({'where':_0x1c710f[_0x96bd('0x50')]})[_0x96bd('0x37')](function(_0x17c0bf){_0x5b2046[_0x96bd('0x30')]=_0x17c0bf;if(_0x5996ef[_0x96bd('0x44')]['includeAll']){_0x1c710f[_0x96bd('0x55')]=[{'all':!![]}];}return db['Disposition'][_0x96bd('0x56')](_0x1c710f);})[_0x96bd('0x37')](function(_0x3ff703){_0x5b2046[_0x96bd('0x57')]=_0x3ff703;return _0x5b2046;});}})['then'](respondWithFilteredResult(_0x201703,_0x1c710f))[_0x96bd('0x2a')](handleError(_0x201703,null));};exports['removeDispositions']=function(_0x3c7647,_0x4a3883,_0x398e03){return db[_0x96bd('0x3f')][_0x96bd('0x5b')]({'where':{'id':_0x3c7647['params']['id']}})[_0x96bd('0x37')](handleEntityNotFound(_0x4a3883,null))[_0x96bd('0x37')](function(_0xcba8a4){if(_0xcba8a4){return _0xcba8a4[_0x96bd('0x6b')](_0x3c7647['query']['ids']);}})[_0x96bd('0x37')](respondWithStatusCode(_0x4a3883,null))['catch'](handleError(_0x4a3883,null));};exports['addAnswer']=function(_0x503764,_0x424597,_0x15cac4){if(_0x503764['body']['id']){delete _0x503764[_0x96bd('0x5d')]['id'];}return db['ChatWebsite'][_0x96bd('0x5b')]({'where':{'id':_0x503764[_0x96bd('0x59')]['id']}})[_0x96bd('0x37')](handleEntityNotFound(_0x424597,null))[_0x96bd('0x37')](function(_0x470e30){if(_0x470e30){_0x503764[_0x96bd('0x5d')][_0x96bd('0x69')]=_0x470e30['id'];return db['CannedAnswer']['create'](_0x503764[_0x96bd('0x5d')]);}})['then'](respondWithResult(_0x424597,null))[_0x96bd('0x2a')](handleError(_0x424597,null));};exports['getAnswers']=function(_0x3fa472,_0x9a4880,_0x4d18dc){var _0x164642={'raw':![],'where':{}};var _0xdc57e4={};var _0x1d8932={'count':0x0,'rows':[]};return db[_0x96bd('0x3f')][_0x96bd('0x6c')]({'where':{'id':_0x3fa472['params']['id']}})['then'](handleEntityNotFound(_0x9a4880,null))['then'](function(_0x304670){if(_0x304670){_0xdc57e4[_0x96bd('0x48')]=_['keys'](db[_0x96bd('0x6d')][_0x96bd('0x40')]);_0xdc57e4['query']=_[_0x96bd('0x45')](_0x3fa472[_0x96bd('0x44')]);_0xdc57e4[_0x96bd('0x46')]=_[_0x96bd('0x47')](_0xdc57e4[_0x96bd('0x48')],_0xdc57e4[_0x96bd('0x44')]);_0x164642[_0x96bd('0x49')]=_[_0x96bd('0x47')](_0xdc57e4[_0x96bd('0x48')],qs[_0x96bd('0x4a')](_0x3fa472[_0x96bd('0x44')][_0x96bd('0x4a')]));_0x164642[_0x96bd('0x49')]=_0x164642[_0x96bd('0x49')][_0x96bd('0x4b')]?_0x164642['attributes']:_0xdc57e4[_0x96bd('0x48')];if(!_0x3fa472['query'][_0x96bd('0x4c')]('nolimit')){_0x164642[_0x96bd('0x2f')]=qs[_0x96bd('0x2f')](_0x3fa472[_0x96bd('0x44')][_0x96bd('0x2f')]);_0x164642[_0x96bd('0x31')]=qs[_0x96bd('0x31')](_0x3fa472['query'][_0x96bd('0x31')]);}_0x164642[_0x96bd('0x4e')]=qs[_0x96bd('0x4f')](_0x3fa472['query']['sort']);_0x164642['where']=qs[_0x96bd('0x46')](_[_0x96bd('0x51')](_0x3fa472[_0x96bd('0x44')],_0xdc57e4[_0x96bd('0x46')]));_0x164642['where'][_0x96bd('0x69')]=_0x304670['id'];if(_0x3fa472[_0x96bd('0x44')][_0x96bd('0x52')]){_0x164642[_0x96bd('0x50')]=_[_0x96bd('0x6a')](_0x164642['where'],{'$or':_[_0x96bd('0x3e')](_0x164642[_0x96bd('0x49')],function(_0x5ab3cb){var _0x497cef={};_0x497cef[_0x5ab3cb]={'$like':'%'+_0x3fa472['query'][_0x96bd('0x52')]+'%'};return _0x497cef;})});}_0x164642=_['merge']({},_0x164642,_0x3fa472[_0x96bd('0x54')]);return db[_0x96bd('0x6d')][_0x96bd('0x30')]({'where':_0x164642[_0x96bd('0x50')]})[_0x96bd('0x37')](function(_0x8b580){_0x1d8932['count']=_0x8b580;if(_0x3fa472[_0x96bd('0x44')]['includeAll']){_0x164642[_0x96bd('0x55')]=[{'all':!![]}];}return db[_0x96bd('0x6d')]['findAll'](_0x164642);})[_0x96bd('0x37')](function(_0x368f04){_0x1d8932[_0x96bd('0x57')]=_0x368f04;return _0x1d8932;});}})[_0x96bd('0x37')](respondWithFilteredResult(_0x9a4880,_0x164642))['catch'](handleError(_0x9a4880,null));};exports['removeAnswers']=function(_0x3bc40a,_0x4b338e,_0x10fcbd){return db['ChatWebsite'][_0x96bd('0x5b')]({'where':{'id':_0x3bc40a['params']['id']}})[_0x96bd('0x37')](handleEntityNotFound(_0x4b338e,null))[_0x96bd('0x37')](function(_0xba0c98){if(_0xba0c98){return _0xba0c98[_0x96bd('0x6e')](_0x3bc40a['query'][_0x96bd('0x6f')]);}})[_0x96bd('0x37')](respondWithStatusCode(_0x4b338e,null))[_0x96bd('0x2a')](handleError(_0x4b338e,null));};exports[_0x96bd('0x70')]=function(_0x1d5d3b,_0x5cc66f,_0x5f3b16){_0x1d5d3b['body']['sitepic']=_0x1d5d3b[_0x96bd('0x71')][_0x96bd('0x72')];return db['ChatWebsite']['find']({'where':{'id':_0x1d5d3b[_0x96bd('0x59')]['id']}})[_0x96bd('0x37')](handleEntityNotFound(_0x5cc66f,null))[_0x96bd('0x37')](saveUpdates(_0x1d5d3b[_0x96bd('0x5d')],null))[_0x96bd('0x37')](respondWithResult(_0x5cc66f,null))[_0x96bd('0x2a')](handleError(_0x5cc66f,null));};exports['addAvatar']=function(_0x25a9d5,_0x4a8d5f,_0x60c722){_0x25a9d5[_0x96bd('0x5d')][_0x96bd('0x73')]=_0x25a9d5[_0x96bd('0x71')][_0x96bd('0x72')];return db[_0x96bd('0x3f')][_0x96bd('0x5b')]({'where':{'id':_0x25a9d5['params']['id']}})[_0x96bd('0x37')](handleEntityNotFound(_0x4a8d5f,null))[_0x96bd('0x37')](saveUpdates(_0x25a9d5[_0x96bd('0x5d')],null))[_0x96bd('0x37')](respondWithResult(_0x4a8d5f,null))[_0x96bd('0x2a')](handleError(_0x4a8d5f,null));};exports[_0x96bd('0x74')]=function(_0x55d08b,_0xa779be,_0xe47afe){_0x55d08b[_0x96bd('0x5d')]['customerAvatar']=_0x55d08b[_0x96bd('0x71')][_0x96bd('0x72')];return db[_0x96bd('0x3f')]['find']({'where':{'id':_0x55d08b[_0x96bd('0x59')]['id']}})[_0x96bd('0x37')](handleEntityNotFound(_0xa779be,null))['then'](saveUpdates(_0x55d08b[_0x96bd('0x5d')],null))['then'](respondWithResult(_0xa779be,null))[_0x96bd('0x2a')](handleError(_0xa779be,null));};exports[_0x96bd('0x75')]=function(_0x4c710f,_0x50d651,_0x529d74){_0x4c710f[_0x96bd('0x5d')][_0x96bd('0x76')]=_0x4c710f['file'][_0x96bd('0x72')];return db[_0x96bd('0x3f')][_0x96bd('0x5b')]({'where':{'id':_0x4c710f['params']['id']}})[_0x96bd('0x37')](handleEntityNotFound(_0x50d651,null))[_0x96bd('0x37')](saveUpdates(_0x4c710f[_0x96bd('0x5d')],null))['then'](respondWithResult(_0x50d651,null))[_0x96bd('0x2a')](handleError(_0x50d651,null));};exports[_0x96bd('0x77')]=function(_0x3ed979,_0x6d964a,_0x15d05f){var _0x1fc65f=path[_0x96bd('0x78')](config[_0x96bd('0x79')],_0x96bd('0x7a'));var _0x17af73={'where':{'id':_0x3ed979['params']['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x1b4a70=![];return require(_0x96bd('0x7b'))[_0x96bd('0x7c')]()[_0x96bd('0x37')](function(_0x56ffd7){if(_0x56ffd7){_0x1b4a70=_0x56ffd7['custom'];}})[_0x96bd('0x37')](function(){return db['ChatWebsite']['find'](_0x17af73);})[_0x96bd('0x37')](handleEntityNotFound(_0x6d964a,null))[_0x96bd('0x37')](function(_0x18750d){if(_0x18750d){if(!_[_0x96bd('0x7d')](_0x18750d['sitepic'])){if(fs[_0x96bd('0x7e')](path[_0x96bd('0x78')](config[_0x96bd('0x79')],_0x96bd('0x7f'),_0x18750d[_0x96bd('0x80')]))&&_0x1b4a70){_0x1fc65f=path[_0x96bd('0x78')](config[_0x96bd('0x79')],_0x96bd('0x7f'),_0x18750d[_0x96bd('0x80')]);}}return _0x6d964a['download'](_0x1fc65f);}})[_0x96bd('0x2a')](handleError(_0x6d964a,null));};exports[_0x96bd('0x81')]=function(_0x3da916,_0x44d5ed,_0x257c9c){var _0x33b1c2=path[_0x96bd('0x78')](config[_0x96bd('0x79')],_0x96bd('0x82'));var _0x44f818={'where':{'id':_0x3da916['params']['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x96bd('0x3f')]['find'](_0x44f818)['then'](handleEntityNotFound(_0x44d5ed,null))['then'](function(_0x306ccd){if(_0x306ccd){if(!_[_0x96bd('0x7d')](_0x306ccd[_0x96bd('0x73')])){if(fs[_0x96bd('0x7e')](path[_0x96bd('0x78')](config[_0x96bd('0x79')],_0x96bd('0x83'),_0x306ccd[_0x96bd('0x73')]))){_0x33b1c2=path[_0x96bd('0x78')](config['root'],_0x96bd('0x83'),_0x306ccd[_0x96bd('0x73')]);}}return _0x44d5ed[_0x96bd('0x84')](_0x33b1c2);}})[_0x96bd('0x2a')](handleError(_0x44d5ed,null));};exports['getCustomerAvatar']=function(_0x5998fb,_0x5bff00,_0x384854){var _0x1e89d0=path['join'](config[_0x96bd('0x79')],_0x96bd('0x85'));var _0x49a56c={'where':{'id':_0x5998fb['params']['id']},'attributes':['id',_0x96bd('0x86'),_0x96bd('0x87')],'raw':!![]};return db[_0x96bd('0x3f')][_0x96bd('0x5b')](_0x49a56c)[_0x96bd('0x37')](handleEntityNotFound(_0x5bff00,null))[_0x96bd('0x37')](function(_0x4014ce){if(_0x4014ce){if(!_[_0x96bd('0x7d')](_0x4014ce[_0x96bd('0x86')])){if(fs[_0x96bd('0x7e')](path[_0x96bd('0x78')](config['root'],'server/files/images/avatars/',_0x4014ce[_0x96bd('0x86')]))&&_0x4014ce[_0x96bd('0x87')]){_0x1e89d0=path['join'](config['root'],_0x96bd('0x83'),_0x4014ce['customerAvatar']);}}return _0x5bff00[_0x96bd('0x84')](_0x1e89d0);}})[_0x96bd('0x2a')](handleError(_0x5bff00,null));};exports[_0x96bd('0x88')]=function(_0x47d3f0,_0x29257a,_0x45fa72){var _0x2b94ea=path[_0x96bd('0x78')](config[_0x96bd('0x79')],_0x96bd('0x89'));var _0x540284={'where':{'id':_0x47d3f0['params']['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x96bd('0x3f')][_0x96bd('0x5b')](_0x540284)[_0x96bd('0x37')](handleEntityNotFound(_0x29257a,null))[_0x96bd('0x37')](function(_0x46a7af){if(_0x46a7af){if(!_[_0x96bd('0x7d')](_0x46a7af[_0x96bd('0x76')])){if(fs[_0x96bd('0x7e')](path[_0x96bd('0x78')](config[_0x96bd('0x79')],_0x96bd('0x83'),_0x46a7af['systemAvatar']))){_0x2b94ea=path[_0x96bd('0x78')](config[_0x96bd('0x79')],_0x96bd('0x83'),_0x46a7af[_0x96bd('0x76')]);}}return _0x29257a['download'](_0x2b94ea);}})['catch'](handleError(_0x29257a,null));};exports[_0x96bd('0x8a')]=function(_0x460c75,_0x20be5b,_0x47a0be){var _0x30d5f9=require(_0x96bd('0x8b'));var _0x2c9114=new _0x30d5f9();var _0x294c3a=_0x2c9114[_0x96bd('0x8c')](_0x460c75[_0x96bd('0x8d')][_0x96bd('0x8e')])[_0x96bd('0x8f')]();var _0x4ff2a7={'body':_0x460c75[_0x96bd('0x5d')],'channel':_0x96bd('0x90')};var _0x23d460=[];var _0x2c3e81=[];var _0x367f9c={};var _0x59eea1=![];return db[_0x96bd('0x91')]['describe']()[_0x96bd('0x37')](function(_0x279057){if(!_0x279057){throw new db[(_0x96bd('0x92'))][(_0x96bd('0x93'))](_0x96bd('0x94'));}_0x23d460=_[_0x96bd('0x95')](_[_0x96bd('0x45')](_0x279057),[_0x96bd('0x96'),_0x96bd('0x97')]);_0x2c3e81=_[_0x96bd('0x95')](_[_0x96bd('0x45')](_0x279057),[_0x96bd('0x96'),'updatedAt',_0x96bd('0x98'),_0x96bd('0x99')]);if(_0x460c75[_0x96bd('0x5d')]['id']){delete _0x460c75['body']['id'];}if(_[_0x96bd('0x7d')](_0x460c75[_0x96bd('0x5d')][_0x96bd('0x9a')])){throw new db[(_0x96bd('0x92'))][(_0x96bd('0x93'))](_0x96bd('0x9b'));}if(_[_0x96bd('0x7d')](_0x460c75[_0x96bd('0x5d')]['body'])||_0x460c75[_0x96bd('0x5d')][_0x96bd('0x5d')]===''){throw new db['Sequelize'][(_0x96bd('0x93'))](_0x96bd('0x9c'));}if(_[_0x96bd('0x7d')](_0x460c75[_0x96bd('0x5d')]['mapKey'])){throw new db[(_0x96bd('0x92'))]['ValidationError'](_0x96bd('0x9d')+_0x2c3e81);}if(!_[_0x96bd('0x9e')](_0x2c3e81,_0x460c75[_0x96bd('0x5d')]['mapKey'])){throw new db['Sequelize'][(_0x96bd('0x93'))](_0x96bd('0x9f')+_0x2c3e81);}_0x367f9c[_0x460c75[_0x96bd('0x5d')]['mapKey']]=_0x460c75[_0x96bd('0x5d')][_0x96bd('0x9a')];})[_0x96bd('0x37')](function(){return db[_0x96bd('0x3f')][_0x96bd('0x5b')]({'where':{'id':_0x460c75[_0x96bd('0x59')]['id']},'include':[{'model':db[_0x96bd('0xa0')],'as':_0x96bd('0xa1'),'include':[{'model':db[_0x96bd('0x91')],'as':'Contacts','where':_0x367f9c,'limit':0x1,'order':[[_0x96bd('0x97'),_0x96bd('0xa2')]]}]},{'model':db[_0x96bd('0xa3')],'as':'Applications'}]});})[_0x96bd('0x37')](handleEntityNotFound(_0x20be5b,null))[_0x96bd('0x37')](function(_0x625ec5){if(_0x625ec5&&_0x625ec5[_0x96bd('0xa1')]){_0x4ff2a7[_0x96bd('0xa4')]=_0x625ec5;_0x4ff2a7[_0x96bd('0xa5')]=_0x625ec5[_0x96bd('0xa6')];_0x4ff2a7[_0x96bd('0xa7')]=_0x625ec5[_0x96bd('0xa1')];_0x4ff2a7['applications']=_[_0x96bd('0xa8')](_0x4ff2a7['applications'],['priority'],[_0x96bd('0xa9')]);if(_0x4ff2a7[_0x96bd('0xa4')][_0x96bd('0xa6')]){delete _0x4ff2a7[_0x96bd('0xa4')][_0x96bd('0xa6')];}if(_0x4ff2a7[_0x96bd('0xa4')][_0x96bd('0xa1')]&&_0x4ff2a7[_0x96bd('0xa4')][_0x96bd('0xa1')][_0x96bd('0xaa')][_0x96bd('0x4b')]){return _0x4ff2a7[_0x96bd('0xa4')][_0x96bd('0xa1')][_0x96bd('0xaa')][0x0];}var _0x34bd46=_[_0x96bd('0x19')](_0x460c75[_0x96bd('0x5d')],{'firstName':_0x460c75[_0x96bd('0x5d')][_0x96bd('0x9a')],'ListId':_0x625ec5[_0x96bd('0x99')]});_0x34bd46[_0x460c75['body'][_0x96bd('0xab')]]=_0x460c75[_0x96bd('0x5d')]['from'];return db[_0x96bd('0x91')]['create'](_0x34bd46,{'fields':_0x23d460,'raw':!![]});}})[_0x96bd('0x37')](handleEntityNotFound(_0x20be5b,null))[_0x96bd('0x37')](function(_0xd3ba05){_0x4ff2a7[_0x96bd('0xac')]=_0xd3ba05;var _0x6a9b4c=_0x460c75[_0x96bd('0x5d')][_0x96bd('0xad')];if(_0x460c75['headers'][_0x96bd('0xae')]){_0x6a9b4c=_0x460c75[_0x96bd('0x8d')][_0x96bd('0xae')];}else if(_0x460c75[_0x96bd('0x8d')][_0x96bd('0xaf')]){_0x6a9b4c=_[_0x96bd('0xb0')](_0x460c75[_0x96bd('0x8d')][_0x96bd('0xaf')]['split'](','));}if(_0xd3ba05){var _0x2134e0={'ContactId':_0xd3ba05['id'],'ChatWebsiteId':_0x460c75[_0x96bd('0x59')]['id'],'from':(_0xd3ba05['firstName']||'')+'\x20'+(_0xd3ba05['lastName']||''),'customerIp':_0x6a9b4c,'customerPort':_0x460c75[_0x96bd('0x8d')][_0x96bd('0xb1')]?_0x460c75[_0x96bd('0x8d')][_0x96bd('0xb1')]:null,'referer':_0x460c75['body'][_0x96bd('0xb2')],'browserName':_0x294c3a['browser'][_0x96bd('0x53')]&&_0x294c3a[_0x96bd('0xb3')][_0x96bd('0xb4')]?util[_0x96bd('0xb5')](_0x96bd('0xb6'),_0x294c3a[_0x96bd('0xb3')][_0x96bd('0x53')],_0x294c3a['browser'][_0x96bd('0xb4')]):_0x96bd('0xb7'),'browserVersion':_0x294c3a[_0x96bd('0xb3')][_0x96bd('0xb4')]||_0x96bd('0xb7'),'osName':util['format'](_0x96bd('0xb6'),_0x294c3a['os'][_0x96bd('0x53')],_0x294c3a['os']['version']),'osVersion':_0x294c3a['os'][_0x96bd('0xb4')],'deviceModel':_0x294c3a[_0x96bd('0xb8')]['model']&&_0x294c3a[_0x96bd('0xb8')]['vendor']?util[_0x96bd('0xb5')](_0x96bd('0xb9'),_0x294c3a['device']['model'],_0x294c3a[_0x96bd('0xb8')][_0x96bd('0xba')],_0x294c3a[_0x96bd('0xb8')][_0x96bd('0x42')]):null,'deviceVendor':_0x294c3a[_0x96bd('0xb8')][_0x96bd('0xba')],'deviceType':_0x294c3a[_0x96bd('0xb8')]['type'],'formData':JSON[_0x96bd('0x26')](_0x460c75['body'])};var _0x12e710={'ChatWebsiteId':_0x460c75[_0x96bd('0x59')]['id'],'closed':![]};if(_0x460c75[_0x96bd('0x5d')]['threadId']){_0x12e710[_0x96bd('0xbb')]=_0x460c75[_0x96bd('0x5d')][_0x96bd('0xbb')];return db[_0x96bd('0xbc')][_0x96bd('0x5b')]({'where':_0x12e710})[_0x96bd('0x37')](function(_0x1e1553){if(_0x1e1553){return[_0x1e1553,![]];}_0x2134e0[_0x96bd('0xbb')]=_0x460c75[_0x96bd('0x5d')][_0x96bd('0xbb')];_0x2134e0[_0x96bd('0xbd')]=_0x460c75[_0x96bd('0x5d')]['externalUrl'];return db[_0x96bd('0xbc')]['create'](_0x2134e0)[_0x96bd('0x37')](function(_0x1fd062){return[_0x1fd062,!![]];});});}_0x12e710['ContactId']=_0xd3ba05['id'];if(_0x460c75[_0x96bd('0x5d')][_0x96bd('0xbe')]&&_0x460c75[_0x96bd('0x5d')][_0x96bd('0xbe')]['id']){_0x12e710['id']=_0x460c75['body']['interaction']['id'];return db[_0x96bd('0xbc')][_0x96bd('0x5b')]({'where':_0x12e710})[_0x96bd('0x37')](function(_0x22d979){if(_0x22d979){return[_0x22d979,![]];}return db[_0x96bd('0xbc')]['create'](_0x2134e0)[_0x96bd('0x37')](function(_0x1fec04){return[_0x1fec04,!![]];});});}return db[_0x96bd('0xbc')][_0x96bd('0x5c')](_0x2134e0)[_0x96bd('0x37')](function(_0x51121b){return[_0x51121b,!![]];});}})[_0x96bd('0xbf')](function(_0x3167a2,_0x37e1c3){if(_0x3167a2){_0x59eea1=_0x37e1c3;if(!_0x37e1c3){var _0x18212d={'from':(_0x4ff2a7['contact'][_0x96bd('0xc0')]||'')+'\x20'+(_0x4ff2a7[_0x96bd('0xac')][_0x96bd('0xc1')]||'')};if(_0x460c75[_0x96bd('0x5d')][_0x96bd('0xbb')]&&_0x460c75['body'][_0x96bd('0xc2')]&&_0x460c75[_0x96bd('0x5d')][_0x96bd('0xbb')]!=_0x460c75[_0x96bd('0x5d')]['messageId']){_0x18212d[_0x96bd('0xbb')]=_0x460c75[_0x96bd('0x5d')][_0x96bd('0xc2')];}return _0x3167a2[_0x96bd('0x36')](_0x18212d);}else{return _0x3167a2;}}})[_0x96bd('0x37')](function(_0x2edc4c){_0x4ff2a7[_0x96bd('0xbe')]=_0x2edc4c['get']({'plain':!![]});_0x4ff2a7[_0x96bd('0xbe')]['created']=_0x59eea1;if(_0x4ff2a7[_0x96bd('0xbe')]['created']){if(_0x4ff2a7[_0x96bd('0xa4')][_0x96bd('0xc3')]){_0x4ff2a7[_0x96bd('0xa5')]['push']({'id':0x0,'priority':_0x4ff2a7['applications'][_0x96bd('0x4b')]+0x1,'app':_0x96bd('0xc4'),'appdata':_0x96bd('0xc5'),'interval':_0x96bd('0xc6')});}}return db[_0x96bd('0xc7')][_0x96bd('0x5c')]({'body':_0x460c75['body'][_0x96bd('0x5d')],'ChatWebsiteId':_0x460c75[_0x96bd('0x59')]['id'],'ChatInteractionId':_0x2edc4c['id'],'direction':'in','ContactId':_0x4ff2a7[_0x96bd('0xac')]['id'],'AttachmentId':_0x460c75[_0x96bd('0x5d')][_0x96bd('0xc8')]});})[_0x96bd('0x37')](function(_0x43f423){_0x4ff2a7[_0x96bd('0x28')]=_0x43f423;if(_0x4ff2a7[_0x96bd('0xbe')][_0x96bd('0xc9')]){return db[_0x96bd('0xca')][_0x96bd('0x5b')]({'attributes':['id',_0x96bd('0x53')],'where':{'id':_0x4ff2a7[_0x96bd('0xbe')][_0x96bd('0xc9')]}})[_0x96bd('0x37')](function(_0x149f02){if(_0x149f02){_0x4ff2a7[_0x96bd('0xa5')][_0x96bd('0xcb')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x149f02['name']+','+(_0x4ff2a7[_0x96bd('0xa4')][_0x96bd('0xcc')]||0xa),'interval':_0x96bd('0xc6')});_0x4ff2a7[_0x96bd('0xcd')]=!![];}return respondWithRpcPromise(_0x96bd('0xce'),_0x96bd('0xcf'),_0x4ff2a7);});}return respondWithRpcPromise(_0x96bd('0xce'),'startRouting',_0x4ff2a7);})[_0x96bd('0x37')](function(_0x4119dd){respondWithRpcPromise(_0x96bd('0xd0'),_0x96bd('0xd0'),{'event':_0x96bd('0x8a'),'message':_0x4119dd},client9002);return _0x4119dd;})['then'](respondWithResult(_0x20be5b,null))['catch'](handleError(_0x20be5b,null));};exports['offline']=function(_0x54df7b,_0x2cd84d,_0x3225ad){var _0xdc4a,_0xa10c1a,_0x2f5554;var _0x484260=[];var _0x5aea5a=[];var _0x51e802={};var _0x5d95ea=_0x54df7b[_0x96bd('0xd1')]||[];var _0x443950=[];var _0x1f07f6;return db['CmContact']['describe']()[_0x96bd('0x37')](function(_0x200bf1){if(!_0x200bf1){throw new db['Sequelize'][(_0x96bd('0x93'))](_0x96bd('0x94'));}_0x5aea5a=_[_0x96bd('0x95')](_['keys'](_0x200bf1),[_0x96bd('0x96'),'updatedAt']);_0x484260=_[_0x96bd('0x95')](_[_0x96bd('0x45')](_0x200bf1),[_0x96bd('0x96'),_0x96bd('0x97'),_0x96bd('0x98'),'ListId']);if(_0x54df7b[_0x96bd('0x5d')]['id']){delete _0x54df7b['body']['id'];}if(_[_0x96bd('0x7d')](_0x54df7b[_0x96bd('0x5d')][_0x96bd('0x9a')])){throw _0x2cd84d[_0x96bd('0x2b')](0x1f4)[_0x96bd('0x3c')](new db[(_0x96bd('0x92'))]['ValidationError'](_0x96bd('0x9b')));}if(_[_0x96bd('0x7d')](_0x54df7b[_0x96bd('0x5d')]['body'])||_0x54df7b[_0x96bd('0x5d')]['body']===''){throw _0x2cd84d[_0x96bd('0x2b')](0x1f4)['send'](new db[(_0x96bd('0x92'))][(_0x96bd('0x93'))](_0x96bd('0x9c')));}if(_[_0x96bd('0x7d')](_0x54df7b['body'][_0x96bd('0xd2')])){throw _0x2cd84d['status'](0x1f4)[_0x96bd('0x3c')](new db[(_0x96bd('0x92'))][(_0x96bd('0x93'))](_0x96bd('0xd3')+_0x484260));}if(!_[_0x96bd('0x9e')](_0x484260,_0x54df7b[_0x96bd('0x5d')][_0x96bd('0xd2')])){throw _0x2cd84d[_0x96bd('0x2b')](0x1f4)['send'](new db[(_0x96bd('0x92'))][(_0x96bd('0x93'))](_0x96bd('0xd4')+_0x484260));}_0x51e802[_0x54df7b['body'][_0x96bd('0xd2')]]=_0x54df7b['body']['from'];})[_0x96bd('0x37')](function(){return db[_0x96bd('0x3f')][_0x96bd('0x5b')]({'where':{'id':_0x54df7b[_0x96bd('0x59')]['id']},'include':[{'model':db[_0x96bd('0xa0')],'as':_0x96bd('0xa1')},{'model':db[_0x96bd('0xd5')],'as':_0x96bd('0xd5')}]});})[_0x96bd('0x37')](handleEntityNotFound(_0x2cd84d,null))[_0x96bd('0x37')](function(_0x225cab){if(_0x225cab&&_0x225cab[_0x96bd('0xa1')]){_0xa10c1a=_0x225cab;var _0x37fbd7=_[_0x96bd('0x19')](_0x54df7b['body'],{'firstName':_0x54df7b[_0x96bd('0x5d')]['from'],'phone':_0x54df7b[_0x96bd('0x5d')][_0x96bd('0x9a')],'ListId':_0x225cab[_0x96bd('0x99')]});_0x37fbd7[_0x54df7b[_0x96bd('0x5d')]['mapKeyOffline']]=_0x54df7b[_0x96bd('0x5d')][_0x96bd('0x9a')];return db['CmContact'][_0x96bd('0xd6')]({'where':_0x51e802,'defaults':_0x37fbd7});}})[_0x96bd('0xbf')](function(_0xb7dc5f){if(_0xb7dc5f){_0x2f5554=_0xb7dc5f;var _0x286718=fs[_0x96bd('0xd7')](path[_0x96bd('0x78')](config['root'],_0x96bd('0xd8')),_0x96bd('0xd9'));var _0x16ebba=ejs['render'](_0x286718,{'body':_[_0x96bd('0xda')](_0x54df7b[_0x96bd('0x5d')]['body']),'bodyTitle':_0xa10c1a[_0x96bd('0xdb')]});return db[_0x96bd('0xdc')][_0x96bd('0x5c')]({'body':_0x16ebba,'ContactId':_0xb7dc5f['id'],'ChatWebsiteId':_0xa10c1a['id']});}})['then'](function(_0x23af6d){_0x1f07f6=_0x23af6d;if(_0x5d95ea['length']){var _0x1cc8e2=_0x5d95ea[_0x96bd('0x3e')](function(_0x56a458){return{'name':_0x56a458[_0x96bd('0xdd')],'basename':_0x56a458['filename'],'type':_0x56a458['mimetype'],'ChatOfflineMessageId':_0x23af6d['id']};});_0x443950=_0x1cc8e2[_0x96bd('0x3e')](_0x25500d=>{var _0x2971d0={'filename':_0x25500d[_0x96bd('0x53')],'path':path['join'](config[_0x96bd('0x79')],_0x96bd('0xde'),_0x96bd('0xd1'),_0x96bd('0xdf'),_0x96bd('0xe0'),_0x25500d[_0x96bd('0xe1')])};return _0x2971d0;});if(!_0xa10c1a['openNewInteraction']){return db[_0x96bd('0xe2')][_0x96bd('0xe3')](function(_0x46ca5e){return db[_0x96bd('0xe4')][_0x96bd('0xe5')](_0x1cc8e2,{'transaction':_0x46ca5e});});}}})[_0x96bd('0x37')](function(){if(_0x1f07f6){_0xdc4a=_0x1f07f6;return db[_0x96bd('0xd5')][_0x96bd('0x6c')]({'where':{'active':!![]},'include':[{'model':db[_0x96bd('0xe6')],'as':_0x96bd('0xe7'),'raw':!![]}]});}})[_0x96bd('0x37')](function(_0x1612f4){if(_0x1612f4&&_0x1612f4[_0x96bd('0xe7')]&&_0xa10c1a[_0x96bd('0xe8')]&&_0xa10c1a[_0x96bd('0xe9')]){var _0x21d0fb={'tls':{'rejectUnauthorized':![]}};if(_0x1612f4[_0x96bd('0xe7')][_0x96bd('0xea')]){_0x21d0fb[_0x96bd('0xea')]=_0x1612f4[_0x96bd('0xe7')][_0x96bd('0xea')];}else{_0x21d0fb[_0x96bd('0xeb')]=_0x1612f4[_0x96bd('0xe7')][_0x96bd('0xeb')];_0x21d0fb[_0x96bd('0xec')]=_0x1612f4['Smtp'][_0x96bd('0xec')];_0x21d0fb[_0x96bd('0xed')]=_0x1612f4[_0x96bd('0xe7')][_0x96bd('0xed')];}if(_0x1612f4[_0x96bd('0xe7')][_0x96bd('0xee')]){_0x21d0fb[_0x96bd('0xef')]={'user':_0x1612f4[_0x96bd('0xe7')]['user'],'pass':_0x1612f4['Smtp']['pass']};}return respondWithRpcPromise(_0x96bd('0xf0'),'sendMail',{'account':_0x21d0fb,'message':{'from':util[_0x96bd('0xb5')](_0x96bd('0xf1'),_0x1612f4['name'],_0x1612f4[_0x96bd('0xf2')]||_0x1612f4[_0x96bd('0xe7')][_0x96bd('0x60')]),'to':_0xa10c1a[_0x96bd('0xe9')],'subject':_0xa10c1a['offlineMessageSubject'],'html':_0xdc4a[_0x96bd('0x5d')],'attachments':_0x443950}},client9003)[_0x96bd('0x37')](function(){return _0xdc4a;})[_0x96bd('0x2a')](function(_0x830daf){console[_0x96bd('0x27')](_0x830daf);});}})[_0x96bd('0x37')](function(){if(_0xa10c1a&&_0xa10c1a[_0x96bd('0xf3')]&&_0xa10c1a[_0x96bd('0xf4')]){var _0x588647=[];if(_0x5d95ea[_0x96bd('0x4b')]){_0x588647=_0x5d95ea['map'](function(_0x2a7d69){return{'name':_0x2a7d69['originalname'],'basename':_0x2a7d69[_0x96bd('0x72')],'type':_0x2a7d69[_0x96bd('0xf5')],'ChatOfflineMessageId':_0x1f07f6['id']};});}var _0x5b811c;if(!_[_0x96bd('0x7d')](_0xa10c1a['subjectOffline'])){var _0x306afa=_[_0x96bd('0x3e')](_0x54df7b[_0x96bd('0x5d')],function(_0x3a24a2){return _0x3a24a2;});var _0x2ae12e=_[_0x96bd('0xf6')](_0x306afa)[0x0];var _0x24d4fb=_['mapValues'](_0x2ae12e,function(_0x50d8f8){return _0x50d8f8;});_0x5b811c=_0x24d4fb[0x1][_0xa10c1a[_0x96bd('0xf7')]];}var _0x22a244={'from':_0x2f5554[_0x96bd('0xf2')],'firstName':_0x2f5554[_0x96bd('0xc0')],'lastName':_0x2f5554[_0x96bd('0xc1')],'mapKey':'email','message':{'from':_0x2f5554['email'],'to':_0xa10c1a['MailAccount'][_0x96bd('0xf2')],'cc':'','subject':_[_0x96bd('0x7d')](_0x5b811c)?_0xa10c1a[_0x96bd('0xf8')]:_0x5b811c,'messageId':'','sentAt':new Date(),'attach':_0x588647[_0x96bd('0x4b')],'attachments':_0x588647,'originChannel':_0x96bd('0xf9'),'ChatWebsiteId':_0xa10c1a['id'],'ChatOfflineMessageId':_0xdc4a['id'],'originTo':_0xa10c1a[_0x96bd('0xd5')]['email']},'body':_0xdc4a[_0x96bd('0x5d')]};var _0x181c72={'account':{'id':_0xa10c1a[_0x96bd('0xf4')]},'body':_0x22a244,'log':_0x96bd('0xfa')};return respondWithRpcPromise(_0x96bd('0xfa'),_0x96bd('0xfb'),_0x181c72,client9001)['then'](function(){return _0xdc4a;})[_0x96bd('0x2a')](function(_0x22a052){console[_0x96bd('0x27')](_0x22a052);});}return;})[_0x96bd('0x37')](function(){if(_0xdc4a){return _0xdc4a;}})[_0x96bd('0x37')](respondWithResult(_0x2cd84d,null))[_0x96bd('0x2a')](function(_0x3a338c){console[_0x96bd('0x27')](_0x96bd('0x2a'),_0x3a338c);for(var _0x2fa09d of _0x5d95ea){var _0x4bea9f=path[_0x96bd('0x78')](config[_0x96bd('0x79')],_0x96bd('0xde'),_0x96bd('0xd1'),_0x96bd('0xdf'),_0x96bd('0xe0'),_0x2fa09d[_0x96bd('0x72')]);fs_extra[_0x96bd('0xfc')](_0x4bea9f)[_0x96bd('0x2a')](function(_0x58433f){console[_0x96bd('0x27')](_0x96bd('0xfd'),_0x4bea9f,_0x58433f);});}});};exports['addInteraction']=function(_0x19807a,_0x5376b2,_0x50798f){return db[_0x96bd('0xbc')][_0x96bd('0x5b')]({'where':{'id':_0x19807a[_0x96bd('0x59')]['id']}})[_0x96bd('0x37')](handleEntityNotFound(_0x5376b2,null))[_0x96bd('0x37')](function(_0x22cc0a){if(_0x22cc0a){return _0x22cc0a[_0x96bd('0xfe')](_0x19807a[_0x96bd('0x5d')][_0x96bd('0x6f')],_[_0x96bd('0xff')](_0x19807a['body'],['ids','id'])||{});}})[_0x96bd('0x37')](respondWithResult(_0x5376b2,null))[_0x96bd('0x2a')](handleError(_0x5376b2,null));};exports[_0x96bd('0x100')]=function(_0x4512a3,_0xedd1d9,_0x5083e5){var _0x39d748={'raw':![],'where':{}};var _0x382c09={};var _0x5e4c9c={'count':0x0,'rows':[]};return db[_0x96bd('0x3f')][_0x96bd('0x6c')]({'where':{'id':_0x4512a3[_0x96bd('0x59')]['id']}})[_0x96bd('0x37')](handleEntityNotFound(_0xedd1d9,null))[_0x96bd('0x37')](function(_0x36f80f){if(_0x36f80f){_0x382c09[_0x96bd('0x48')]=_['keys'](db['ChatInteraction'][_0x96bd('0x40')]);_0x382c09['query']=_[_0x96bd('0x45')](_0x4512a3[_0x96bd('0x44')]);_0x382c09[_0x96bd('0x46')]=_[_0x96bd('0x47')](_0x382c09[_0x96bd('0x48')],_0x382c09[_0x96bd('0x44')]);_0x39d748['attributes']=_[_0x96bd('0x47')](_0x382c09[_0x96bd('0x48')],qs[_0x96bd('0x4a')](_0x4512a3[_0x96bd('0x44')][_0x96bd('0x4a')]));_0x39d748['attributes']=_0x39d748[_0x96bd('0x49')][_0x96bd('0x4b')]?_0x39d748['attributes']:_0x382c09[_0x96bd('0x48')];if(!_0x4512a3['query'][_0x96bd('0x4c')](_0x96bd('0x4d'))){_0x39d748[_0x96bd('0x2f')]=qs['limit'](_0x4512a3[_0x96bd('0x44')]['limit']);_0x39d748['offset']=qs['offset'](_0x4512a3['query']['offset']);}_0x39d748['order']=qs[_0x96bd('0x4f')](_0x4512a3[_0x96bd('0x44')]['sort']);_0x39d748[_0x96bd('0x50')]=qs[_0x96bd('0x46')](_[_0x96bd('0x51')](_0x4512a3[_0x96bd('0x44')],_0x382c09[_0x96bd('0x46')]));_0x39d748[_0x96bd('0x50')][_0x96bd('0x69')]=_0x36f80f['id'];if(_0x4512a3[_0x96bd('0x44')]['filter']){_0x39d748['where']=_[_0x96bd('0x6a')](_0x39d748[_0x96bd('0x50')],{'$or':_[_0x96bd('0x3e')](_0x39d748[_0x96bd('0x49')],function(_0x30572d){var _0x5d6f67={};_0x5d6f67[_0x30572d]={'$like':'%'+_0x4512a3[_0x96bd('0x44')][_0x96bd('0x52')]+'%'};return _0x5d6f67;})});}_0x39d748=_['merge']({},_0x39d748,_0x4512a3['options']);return db[_0x96bd('0xbc')][_0x96bd('0x30')]({'where':_0x39d748[_0x96bd('0x50')]})[_0x96bd('0x37')](function(_0x585e7c){_0x5e4c9c['count']=_0x585e7c;if(_0x4512a3[_0x96bd('0x44')][_0x96bd('0x101')]){_0x39d748[_0x96bd('0x55')]=[{'model':db[_0x96bd('0x91')],'as':_0x96bd('0x102'),'required':![]},{'model':db['User'],'as':_0x96bd('0x103'),'attributes':['name',_0x96bd('0x104'),_0x96bd('0x105')],'required':![]},{'model':db[_0x96bd('0x106')],'as':_0x96bd('0x107'),'attributes':['id','name',_0x96bd('0x108')],'where':_0x4512a3[_0x96bd('0x44')][_0x96bd('0x109')]?{'id':_0x4512a3[_0x96bd('0x44')][_0x96bd('0x109')]}:undefined,'required':_0x4512a3[_0x96bd('0x44')][_0x96bd('0x109')]?!![]:![]}];}return db['ChatInteraction'][_0x96bd('0x56')](_0x39d748);})[_0x96bd('0x37')](function(_0x563046){_0x5e4c9c[_0x96bd('0x57')]=_0x563046;return _0x5e4c9c;});}})[_0x96bd('0x37')](respondWithFilteredResult(_0xedd1d9,_0x39d748))[_0x96bd('0x2a')](handleError(_0xedd1d9,null));};function iftimePromise(_0x189ac8,_0x1b272e){return respondWithRpcPromise(_0x96bd('0x10a'),_0x96bd('0x10b'),{'command':_0x1b272e[_0x96bd('0x10c')]?util[_0x96bd('0xb5')](_0x96bd('0x10d'),_0x189ac8['interval'],_0x1b272e['timezone']):util['format'](_0x96bd('0x10e'),_0x189ac8['interval'])},client9002)['then'](function(_0x4a5b24){var _0x2a3061=_0x4a5b24&&_0x4a5b24[_0x96bd('0x10f')](_0x96bd('0x110'))>=0x0?!![]:![];logger['info'](_0x96bd('0x111'),_0x1b272e['id'],_0x189ac8['id'],_0x189ac8[_0x96bd('0x112')],_0x2a3061?_0x96bd('0x113'):_0x96bd('0x114'),_0x1b272e[_0x96bd('0x10c')]?_0x1b272e[_0x96bd('0x10c')]:'No\x20timezone');return _0x2a3061;})[_0x96bd('0x2a')](function(_0x2e8104){logger[_0x96bd('0x27')](_0x96bd('0x111'),_0x1b272e['id'],_0x189ac8['id'],_0x189ac8[_0x96bd('0x112')],util['inspect'](_0x2e8104,{'showHidden':![],'depth':null}),_0x1b272e[_0x96bd('0x10c')]?_0x1b272e[_0x96bd('0x10c')]:_0x96bd('0x115'));return![];});}exports[_0x96bd('0x10b')]=function(_0x4ee803,_0x163206,_0x117f57){var _0xa55a53=0x0;var _0x47d5a2=0x0;var _0x2b5f92=![];var _0x42fd79;var _0xbc975e;return db[_0x96bd('0x3f')][_0x96bd('0x5b')]({'where':{'id':_0x4ee803[_0x96bd('0x59')]['id']},'include':[{'model':db[_0x96bd('0x116')],'as':_0x96bd('0x116'),'include':[{'model':db['Interval'],'as':_0x96bd('0x117'),'attributes':['id',_0x96bd('0x112')],'raw':!![]}]}]})[_0x96bd('0x37')](handleEntityNotFound(_0x163206,null))['then'](function(_0x562d1a){if(_0x562d1a){_0x42fd79=_0x562d1a;return _0x562d1a['getProactiveActions']({'raw':!![]});}})[_0x96bd('0x37')](function(_0x5958fb){if(_0x42fd79){if(_0x5958fb){_0xbc975e=_0x5958fb;}}return require('../../config/license/util')[_0x96bd('0x7c')]();})[_0x96bd('0x37')](function(_0x24297b){if(_0x24297b){_0x47d5a2=_0x24297b[_0x96bd('0x118')];_0x2b5f92=_0x24297b[_0x96bd('0x119')];}})['then'](function(){return db[_0x96bd('0xbc')]['count']({'where':{'closed':![]}});})[_0x96bd('0x37')](function(_0x2368a0){_0xa55a53=_0x2368a0;if(_0x47d5a2&&_0x2368a0>_0x47d5a2){return db['License'][_0x96bd('0x6c')]({'where':{'id':0x1}})[_0x96bd('0x37')](function(_0x577f2a){if(_0x577f2a){_0x577f2a['increment'](_0x96bd('0x11a'));}});}})[_0x96bd('0x37')](function(){if(_0x42fd79[_0x96bd('0x116')]&&_0x42fd79[_0x96bd('0x116')]['Intervals']){var _0x447f00=[];for(var _0x5535b6=0x0;_0x5535b6<_0x42fd79['Interval'][_0x96bd('0x117')][_0x96bd('0x4b')];_0x5535b6++){var _0x5ac383=_0x42fd79[_0x96bd('0x116')][_0x96bd('0x117')][_0x5535b6][_0x96bd('0x5e')]({'plain':!![]});_0x447f00[_0x96bd('0x11b')](iftimePromise(_0x5ac383,_0x42fd79));}return BPromise[_0x96bd('0x11c')](_0x447f00)['then'](function(_0x35d421){return _[_0x96bd('0x11d')](_0x35d421);});}else{return!![];}})[_0x96bd('0x37')](function(_0x3120ad){var _0x2b4c3b=fs[_0x96bd('0xd7')](path['join'](config['root'],'server/files/chat/iframe.ejs'),_0x96bd('0xd9'));var _0x458021={'remote':_0x42fd79[_0x96bd('0x11e')],'query':querystring[_0x96bd('0x26')](_[_0x96bd('0x6a')](_0x42fd79[_0x96bd('0x5e')]({'plain':!![]}),{'customerIp':_0x4ee803[_0x96bd('0x8d')][_0x96bd('0xaf')]||_0x4ee803[_0x96bd('0x8d')][_0x96bd('0x11f')]||_0x4ee803[_0x96bd('0x120')][_0x96bd('0x121')]||_0x4ee803['ip'],'referer':_0x4ee803[_0x96bd('0x8d')]['referer'],'openedInteractions':_0xa55a53,'maxInteractions':_0x47d5a2,'virtual':_0x2b5f92[_0x96bd('0x118')],'online':_0x3120ad,'custom':_0x2b5f92}))[_0x96bd('0x122')](/'/g,'\x5c\x27')};_0x163206[_0x96bd('0x3c')](ejs['render'](Mustache['render'](_0x2b4c3b,_0x458021),{'proactiveActions':_0xbc975e,'alignment':_0x42fd79['alignment'],'verticalAlignment':_0x42fd79[_0x96bd('0x123')],'div_color':_0x42fd79[_0x96bd('0x108')],'text_color':_0x42fd79['textColor'],'button_color':_0x42fd79[_0x96bd('0x124')],'background_color':_0x42fd79[_0x96bd('0x125')]}));})[_0x96bd('0x2a')](handleError(_0x163206,null));};exports[_0x96bd('0x126')]=function(_0x3f4e27,_0x1f4b27,_0x4acb17){return db['ChatWebsite'][_0x96bd('0x6c')]({'where':{'id':_0x3f4e27[_0x96bd('0x59')]['id']}})['then'](handleEntityNotFound(_0x1f4b27,null))[_0x96bd('0x37')](function(_0x20cd6d){if(_0x20cd6d){return db['sequelize']['transaction'](function(_0x2cc771){return db[_0x96bd('0xa3')][_0x96bd('0x38')]({'where':{'ChatWebsiteId':_0x3f4e27[_0x96bd('0x59')]['id']},'transaction':_0x2cc771})[_0x96bd('0x37')](function(_0x232428){var _0x122afc=_[_0x96bd('0x3e')](_0x3f4e27[_0x96bd('0x5d')],function(_0x7b05b9){_0x7b05b9[_0x96bd('0x69')]=_0x3f4e27[_0x96bd('0x59')]['id'];return _0x7b05b9;});return db[_0x96bd('0xa3')][_0x96bd('0xe5')](_0x122afc,{'transaction':_0x2cc771});});})[_0x96bd('0x37')](function(){return db[_0x96bd('0xa3')][_0x96bd('0x127')]({'where':{'ChatWebsiteId':_0x3f4e27[_0x96bd('0x59')]['id']},'order':_0x96bd('0x128')});});}})['then'](respondWithResult(_0x1f4b27,null))['catch'](handleError(_0x1f4b27,null));};exports['getApplications']=function(_0x5c6ae7,_0x1e2c9c,_0x507dc7){var _0x1e6884={};var _0x126387={};var _0x3008f7;var _0xe56539;return db['ChatWebsite'][_0x96bd('0x6c')]({'where':{'id':_0x5c6ae7[_0x96bd('0x59')]['id']}})[_0x96bd('0x37')](handleEntityNotFound(_0x1e2c9c,null))[_0x96bd('0x37')](function(_0x3abd66){if(_0x3abd66){_0x3008f7=_0x3abd66;_0x126387[_0x96bd('0x48')]=_[_0x96bd('0x45')](db[_0x96bd('0xa3')][_0x96bd('0x40')]);_0x126387[_0x96bd('0x44')]=_[_0x96bd('0x45')](_0x5c6ae7[_0x96bd('0x44')]);_0x126387[_0x96bd('0x46')]=_[_0x96bd('0x47')](_0x126387['model'],_0x126387[_0x96bd('0x44')]);_0x1e6884['attributes']=_[_0x96bd('0x47')](_0x126387[_0x96bd('0x48')],qs[_0x96bd('0x4a')](_0x5c6ae7[_0x96bd('0x44')][_0x96bd('0x4a')]));_0x1e6884['attributes']=_0x1e6884[_0x96bd('0x49')][_0x96bd('0x4b')]?_0x1e6884[_0x96bd('0x49')]:_0x126387[_0x96bd('0x48')];_0x1e6884[_0x96bd('0x4e')]=qs[_0x96bd('0x4f')](_0x5c6ae7[_0x96bd('0x44')][_0x96bd('0x4f')]);_0x1e6884[_0x96bd('0x50')]=qs['filters'](_['pick'](_0x5c6ae7['query'],_0x126387[_0x96bd('0x46')]));if(_0x5c6ae7['query'][_0x96bd('0x52')]){_0x1e6884[_0x96bd('0x50')]=_[_0x96bd('0x6a')](_0x1e6884['where'],{'$or':_[_0x96bd('0x3e')](_0x1e6884[_0x96bd('0x49')],function(_0x26afc5){var _0x56d5c5={};_0x56d5c5[_0x26afc5]={'$like':'%'+_0x5c6ae7['query'][_0x96bd('0x52')]+'%'};return _0x56d5c5;})});}_0x1e6884=_['merge']({},_0x1e6884,_0x5c6ae7[_0x96bd('0x54')]);return _0x3008f7[_0x96bd('0x129')](_0x1e6884);}})[_0x96bd('0x37')](function(_0x377b08){if(_0x377b08){_0xe56539=_0x377b08[_0x96bd('0x4b')];if(!_0x5c6ae7[_0x96bd('0x44')][_0x96bd('0x4c')](_0x96bd('0x4d'))){_0x1e6884[_0x96bd('0x2f')]=qs[_0x96bd('0x2f')](_0x5c6ae7[_0x96bd('0x44')][_0x96bd('0x2f')]);_0x1e6884[_0x96bd('0x31')]=qs[_0x96bd('0x31')](_0x5c6ae7[_0x96bd('0x44')]['offset']);}return _0x3008f7[_0x96bd('0x129')](_0x1e6884);}})[_0x96bd('0x37')](function(_0x55933e){if(_0x55933e){return _0x55933e?{'count':_0xe56539,'rows':_0x55933e}:null;}})[_0x96bd('0x37')](respondWithResult(_0x1e2c9c,null))[_0x96bd('0x2a')](handleError(_0x1e2c9c,null));};exports['addProactiveActions']=function(_0x171964,_0x329377,_0x4342e6){return db[_0x96bd('0x12a')]['find']({'where':{'id':_0x171964[_0x96bd('0x59')]['id']}})[_0x96bd('0x37')](handleEntityNotFound(_0x329377,null))[_0x96bd('0x37')](function(_0x19c3d7){if(_0x19c3d7){return _0x19c3d7[_0x96bd('0x12b')](_0x171964[_0x96bd('0x5d')][_0x96bd('0x6f')],_[_0x96bd('0xff')](_0x171964[_0x96bd('0x5d')],['ids','id'])||{});}})[_0x96bd('0x37')](respondWithResult(_0x329377,null))[_0x96bd('0x2a')](handleError(_0x329377,null));};exports[_0x96bd('0x12c')]=function(_0x59ac52,_0x794fbb,_0x4d73d5){var _0x1ca206={};var _0xee8efc={};var _0x13cbd0;var _0x1d49f9;return db['ChatWebsite']['findOne']({'where':{'id':_0x59ac52[_0x96bd('0x59')]['id']}})[_0x96bd('0x37')](handleEntityNotFound(_0x794fbb,null))[_0x96bd('0x37')](function(_0x11319a){if(_0x11319a){_0x13cbd0=_0x11319a;_0xee8efc[_0x96bd('0x48')]=_[_0x96bd('0x45')](db[_0x96bd('0x12d')][_0x96bd('0x40')]);_0xee8efc[_0x96bd('0x44')]=_[_0x96bd('0x45')](_0x59ac52[_0x96bd('0x44')]);_0xee8efc[_0x96bd('0x46')]=_[_0x96bd('0x47')](_0xee8efc[_0x96bd('0x48')],_0xee8efc[_0x96bd('0x44')]);_0x1ca206['attributes']=_[_0x96bd('0x47')](_0xee8efc[_0x96bd('0x48')],qs[_0x96bd('0x4a')](_0x59ac52[_0x96bd('0x44')]['fields']));_0x1ca206[_0x96bd('0x49')]=_0x1ca206[_0x96bd('0x49')][_0x96bd('0x4b')]?_0x1ca206['attributes']:_0xee8efc[_0x96bd('0x48')];_0x1ca206[_0x96bd('0x4e')]=qs[_0x96bd('0x4f')](_0x59ac52[_0x96bd('0x44')][_0x96bd('0x4f')]);_0x1ca206[_0x96bd('0x50')]=qs['filters'](_[_0x96bd('0x51')](_0x59ac52[_0x96bd('0x44')],_0xee8efc[_0x96bd('0x46')]));if(_0x59ac52[_0x96bd('0x44')][_0x96bd('0x52')]){_0x1ca206[_0x96bd('0x50')]=_[_0x96bd('0x6a')](_0x1ca206[_0x96bd('0x50')],{'$or':_[_0x96bd('0x3e')](_0x1ca206[_0x96bd('0x49')],function(_0x5f44ed){var _0xbdd9c7={};_0xbdd9c7[_0x5f44ed]={'$like':'%'+_0x59ac52[_0x96bd('0x44')][_0x96bd('0x52')]+'%'};return _0xbdd9c7;})});}_0x1ca206=_[_0x96bd('0x6a')]({},_0x1ca206,_0x59ac52['options']);return _0x13cbd0[_0x96bd('0x12c')](_0x1ca206);}})['then'](function(_0x33f863){if(_0x33f863){_0x1d49f9=_0x33f863['length'];if(!_0x59ac52['query'][_0x96bd('0x4c')](_0x96bd('0x4d'))){_0x1ca206[_0x96bd('0x2f')]=qs[_0x96bd('0x2f')](_0x59ac52[_0x96bd('0x44')][_0x96bd('0x2f')]);_0x1ca206[_0x96bd('0x31')]=qs[_0x96bd('0x31')](_0x59ac52[_0x96bd('0x44')][_0x96bd('0x31')]);}return _0x13cbd0[_0x96bd('0x12c')](_0x1ca206);}})[_0x96bd('0x37')](function(_0x3c17cd){if(_0x3c17cd){return _0x3c17cd?{'count':_0x1d49f9,'rows':_0x3c17cd}:null;}})[_0x96bd('0x37')](respondWithResult(_0x794fbb,null))[_0x96bd('0x2a')](handleError(_0x794fbb,null));};exports[_0x96bd('0x12e')]=function(_0x4bf154,_0x503fd3,_0x4170d6){var _0x1947e0=_0x4bf154[_0x96bd('0x44')][_0x96bd('0x12f')]===_0x96bd('0x130')?'offlineForm':_0x96bd('0x131');return db[_0x96bd('0x3f')]['find']({'attributes':['id',_0x1947e0],'where':{'id':_0x4bf154[_0x96bd('0x59')]['id']}})[_0x96bd('0x37')](handleEntityNotFound(_0x503fd3,null))[_0x96bd('0x37')](function(_0x19d6cd){if(_0x19d6cd){var _0x2dd58c=_0x19d6cd[_0x1947e0];var _0x223703=_0x2dd58c&&_0x2dd58c[_0x96bd('0x132')]?_0x2dd58c[_0x96bd('0x132')]:[];_0x503fd3[_0x96bd('0x3c')]({'fromKey':_['isNil'](_0x2dd58c[_0x96bd('0x133')])?undefined:_0x2dd58c[_0x96bd('0x133')],'count':_0x223703['length'],'rows':_0x223703});}})[_0x96bd('0x2a')](handleError(_0x503fd3,null));};exports[_0x96bd('0x134')]=function(_0x5df18e,_0x2b8cdf,_0x8e8371){var _0x571828={'raw':![],'where':{}};var _0x4cdeb7={};var _0x16bc74={'count':0x0,'rows':[]};return db[_0x96bd('0x3f')][_0x96bd('0x6c')]({'where':{'id':_0x5df18e[_0x96bd('0x59')]['id']}})[_0x96bd('0x37')](handleEntityNotFound(_0x2b8cdf,null))[_0x96bd('0x37')](function(_0xbe48f6){if(_0xbe48f6){_0x4cdeb7[_0x96bd('0x48')]=_[_0x96bd('0x45')](db[_0x96bd('0xdc')]['rawAttributes']);_0x4cdeb7[_0x96bd('0x44')]=_[_0x96bd('0x45')](_0x5df18e[_0x96bd('0x44')]);_0x4cdeb7[_0x96bd('0x46')]=_[_0x96bd('0x47')](_0x4cdeb7[_0x96bd('0x48')],_0x4cdeb7[_0x96bd('0x44')]);_0x571828['attributes']=_[_0x96bd('0x47')](_0x4cdeb7[_0x96bd('0x48')],qs[_0x96bd('0x4a')](_0x5df18e[_0x96bd('0x44')][_0x96bd('0x4a')]));_0x571828[_0x96bd('0x49')]=_0x571828['attributes'][_0x96bd('0x4b')]?_0x571828['attributes']:_0x4cdeb7[_0x96bd('0x48')];if(!_0x5df18e[_0x96bd('0x44')][_0x96bd('0x4c')](_0x96bd('0x4d'))){_0x571828['limit']=qs[_0x96bd('0x2f')](_0x5df18e[_0x96bd('0x44')][_0x96bd('0x2f')]);_0x571828[_0x96bd('0x31')]=qs[_0x96bd('0x31')](_0x5df18e[_0x96bd('0x44')]['offset']);}_0x571828[_0x96bd('0x4e')]=qs['sort'](_0x5df18e[_0x96bd('0x44')][_0x96bd('0x4f')]);_0x571828[_0x96bd('0x50')]=qs[_0x96bd('0x46')](_[_0x96bd('0x51')](_0x5df18e[_0x96bd('0x44')],_0x4cdeb7['filters']));_0x571828[_0x96bd('0x50')][_0x96bd('0x69')]=_0xbe48f6['id'];if(_0x5df18e[_0x96bd('0x44')][_0x96bd('0x52')]){_0x571828[_0x96bd('0x50')]=_[_0x96bd('0x6a')](_0x571828[_0x96bd('0x50')],{'$or':_[_0x96bd('0x3e')](_0x571828[_0x96bd('0x49')],function(_0x1ff9b3){var _0x204ae8={};_0x204ae8[_0x1ff9b3]={'$like':'%'+_0x5df18e['query'][_0x96bd('0x52')]+'%'};return _0x204ae8;})});}_0x571828=_[_0x96bd('0x6a')]({},_0x571828,_0x5df18e[_0x96bd('0x54')]);return db[_0x96bd('0xdc')][_0x96bd('0x30')]({'where':_0x571828[_0x96bd('0x50')]})['then'](function(_0x25a067){_0x16bc74['count']=_0x25a067;if(_0x5df18e[_0x96bd('0x44')]['includeAll']){_0x571828[_0x96bd('0x55')]=[{'all':!![]}];}else{_0x571828['include']=[{'model':db[_0x96bd('0x91')],'as':_0x96bd('0x102'),'required':![]},{'model':db[_0x96bd('0xe4')],'as':_0x96bd('0x135'),'required':![]}];}return db['ChatOfflineMessage']['findAll'](_0x571828);})['then'](function(_0x71d9c2){_0x16bc74[_0x96bd('0x57')]=_0x71d9c2;return _0x16bc74;});}})['then'](respondWithFilteredResult(_0x2b8cdf,_0x571828))[_0x96bd('0x2a')](handleError(_0x2b8cdf,null));};exports[_0x96bd('0x136')]=function(_0x53377c,_0x2086e6,_0x31cadc){return db[_0x96bd('0x3f')][_0x96bd('0x5b')]({'where':{'id':_0x53377c['params']['id']}})[_0x96bd('0x37')](handleEntityNotFound(_0x2086e6,null))[_0x96bd('0x37')](function(_0x3f031f){if(_0x3f031f){return _0x3f031f[_0x96bd('0x136')](_0x53377c[_0x96bd('0x5d')]['ids'],_[_0x96bd('0xff')](_0x53377c[_0x96bd('0x5d')],['ids','id'])||{})[_0x96bd('0xbf')](function(_0x52d7bc){for(var _0x5a6a6b=0x0;_0x5a6a6b<_0x53377c[_0x96bd('0x5d')][_0x96bd('0x6f')][_0x96bd('0x4b')];_0x5a6a6b+=0x1){socket[_0x96bd('0x137')]('userChatWebsite:save',{'UserId':Number(_0x53377c[_0x96bd('0x5d')][_0x96bd('0x6f')][_0x5a6a6b]),'ChatWebsiteId':Number(_0x53377c['params']['id'])});}return _0x52d7bc;});}})['then'](respondWithResult(_0x2086e6,null))[_0x96bd('0x2a')](handleError(_0x2086e6,null));};exports[_0x96bd('0x138')]=function(_0x11b6ed,_0x14bed0,_0x45f5c2){return db[_0x96bd('0x3f')]['find']({'where':{'id':_0x11b6ed['params']['id']}})[_0x96bd('0x37')](handleEntityNotFound(_0x14bed0,null))['then'](function(_0x2b6068){if(_0x2b6068){return _0x2b6068[_0x96bd('0x138')](_0x11b6ed[_0x96bd('0x44')][_0x96bd('0x6f')])['then'](function(){if(_[_0x96bd('0x139')](_0x11b6ed[_0x96bd('0x44')][_0x96bd('0x6f')])){for(var _0x26cc82=0x0;_0x26cc82<_0x11b6ed['query']['ids']['length'];_0x26cc82+=0x1){socket[_0x96bd('0x137')](_0x96bd('0x13a'),{'UserId':Number(_0x11b6ed[_0x96bd('0x44')][_0x96bd('0x6f')][_0x26cc82]),'ChatWebsiteId':Number(_0x11b6ed[_0x96bd('0x59')]['id'])});}}else{socket[_0x96bd('0x137')](_0x96bd('0x13a'),{'UserId':Number(_0x11b6ed[_0x96bd('0x44')][_0x96bd('0x6f')]),'ChatWebsiteId':Number(_0x11b6ed['params']['id'])});}});}})[_0x96bd('0x37')](respondWithStatusCode(_0x14bed0,null))['catch'](handleError(_0x14bed0,null));};exports[_0x96bd('0x13b')]=function(_0x15429b,_0xb8057e,_0x2bb623){var _0x13a200={};var _0x4245eb={};var _0x2316db;var _0x525570;return db[_0x96bd('0x3f')][_0x96bd('0x6c')]({'where':{'id':_0x15429b[_0x96bd('0x59')]['id']}})[_0x96bd('0x37')](handleEntityNotFound(_0xb8057e,null))[_0x96bd('0x37')](function(_0x6e760a){if(_0x6e760a){_0x2316db=_0x6e760a;_0x4245eb[_0x96bd('0x48')]=_[_0x96bd('0x45')](db[_0x96bd('0xca')][_0x96bd('0x40')]);_0x4245eb[_0x96bd('0x44')]=_['keys'](_0x15429b[_0x96bd('0x44')]);_0x4245eb[_0x96bd('0x46')]=_[_0x96bd('0x47')](_0x4245eb[_0x96bd('0x48')],_0x4245eb[_0x96bd('0x44')]);_0x13a200[_0x96bd('0x49')]=_['intersection'](_0x4245eb[_0x96bd('0x48')],qs[_0x96bd('0x4a')](_0x15429b['query'][_0x96bd('0x4a')]));_0x13a200[_0x96bd('0x49')]=_0x13a200['attributes'][_0x96bd('0x4b')]?_0x13a200[_0x96bd('0x49')]:_0x4245eb[_0x96bd('0x48')];_0x13a200[_0x96bd('0x4e')]=qs['sort'](_0x15429b[_0x96bd('0x44')][_0x96bd('0x4f')]);_0x13a200[_0x96bd('0x50')]=qs[_0x96bd('0x46')](_[_0x96bd('0x51')](_0x15429b[_0x96bd('0x44')],_0x4245eb[_0x96bd('0x46')]));if(_0x15429b[_0x96bd('0x44')][_0x96bd('0x52')]){_0x13a200['where']=_[_0x96bd('0x6a')](_0x13a200[_0x96bd('0x50')],{'$or':_[_0x96bd('0x3e')](_0x13a200['attributes'],function(_0x5ceb25){var _0x3a3ba0={};_0x3a3ba0[_0x5ceb25]={'$like':'%'+_0x15429b[_0x96bd('0x44')][_0x96bd('0x52')]+'%'};return _0x3a3ba0;})});}_0x13a200=_[_0x96bd('0x6a')]({},_0x13a200,_0x15429b[_0x96bd('0x54')]);return _0x2316db[_0x96bd('0x13b')](_0x13a200);}})[_0x96bd('0x37')](function(_0xeb999e){if(_0xeb999e){_0x525570=_0xeb999e[_0x96bd('0x4b')];if(!_0x15429b[_0x96bd('0x44')][_0x96bd('0x4c')](_0x96bd('0x4d'))){_0x13a200[_0x96bd('0x2f')]=qs[_0x96bd('0x2f')](_0x15429b[_0x96bd('0x44')][_0x96bd('0x2f')]);_0x13a200[_0x96bd('0x31')]=qs[_0x96bd('0x31')](_0x15429b[_0x96bd('0x44')][_0x96bd('0x31')]);}return _0x2316db[_0x96bd('0x13b')](_0x13a200);}})[_0x96bd('0x37')](function(_0x2749ca){if(_0x2749ca){return _0x2749ca?{'count':_0x525570,'rows':_0x2749ca}:null;}})[_0x96bd('0x37')](respondWithResult(_0xb8057e,null))[_0x96bd('0x2a')](handleError(_0xb8057e,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 16940c4..b05f085 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 _0x757f=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','ChatWebsite'];(function(_0x7ddf5a,_0x3e0253){var _0x2c8abd=function(_0x15cc34){while(--_0x15cc34){_0x7ddf5a['push'](_0x7ddf5a['shift']());}};_0x2c8abd(++_0x3e0253);}(_0x757f,0xee));var _0xf757=function(_0x2fbb8c,_0x15bc93){_0x2fbb8c=_0x2fbb8c-0x0;var _0x1005b4=_0x757f[_0x2fbb8c];return _0x1005b4;};'use strict';var EventEmitter=require(_0xf757('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0xf757('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xf757('0x2')](0x0);var events={'afterCreate':_0xf757('0x3'),'afterUpdate':_0xf757('0x4'),'afterDestroy':_0xf757('0x5')};function emitEvent(_0x44ebcf){return function(_0x26a38a,_0x302fba,_0x958ba7){ChatWebsiteEvents['emit'](_0x44ebcf+':'+_0x26a38a['id'],_0x26a38a);ChatWebsiteEvents[_0xf757('0x6')](_0x44ebcf,_0x26a38a);_0x958ba7(null);};}for(var e in events){if(events[_0xf757('0x7')](e)){var event=events[e];ChatWebsite[_0xf757('0x8')](e,emitEvent(event));}}module[_0xf757('0x9')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x946e=['hook','exports','events','ChatWebsite','save','emit','hasOwnProperty'];(function(_0x4d968a,_0x3cef1b){var _0xe0859d=function(_0x164a0b){while(--_0x164a0b){_0x4d968a['push'](_0x4d968a['shift']());}};_0xe0859d(++_0x3cef1b);}(_0x946e,0x1d0));var _0xe946=function(_0x5cc61d,_0x4fe17b){_0x5cc61d=_0x5cc61d-0x0;var _0x2e25d0=_0x946e[_0x5cc61d];return _0x2e25d0;};'use strict';var EventEmitter=require(_0xe946('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0xe946('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe946('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x31cade){return function(_0xb981db,_0x2b42cd,_0x145058){ChatWebsiteEvents[_0xe946('0x3')](_0x31cade+':'+_0xb981db['id'],_0xb981db);ChatWebsiteEvents['emit'](_0x31cade,_0xb981db);_0x145058(null);};}for(var e in events){if(events[_0xe946('0x4')](e)){var event=events[e];ChatWebsite[_0xe946('0x5')](e,emitEvent(event));}}module[_0xe946('0x6')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index ab4102a..bc6dfc3 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 _0x424f=['chat_websites','lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','ChatWebsite'];(function(_0x1b8e60,_0x21b885){var _0x363363=function(_0x5987c7){while(--_0x5987c7){_0x1b8e60['push'](_0x1b8e60['shift']());}};_0x363363(++_0x21b885);}(_0x424f,0x76));var _0xf424=function(_0x4fce1e,_0x5e9dfe){_0x4fce1e=_0x4fce1e-0x0;var _0x27ea1c=_0x424f[_0x4fce1e];return _0x27ea1c;};'use strict';var _=require(_0xf424('0x0'));var util=require('util');var logger=require(_0xf424('0x1'))(_0xf424('0x2'));var moment=require(_0xf424('0x3'));var BPromise=require(_0xf424('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf424('0x5'));var config=require(_0xf424('0x6'));var attributes=require('./chatWebsite.attributes');module['exports']=function(_0x1ef4d0,_0x11250c){return _0x1ef4d0['define'](_0xf424('0x7'),attributes,{'tableName':_0xf424('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6188=['../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','moment','request-promise','rimraf'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6188,0x88));var _0x8618=function(_0x1fc1f9,_0x454fb2){_0x1fc1f9=_0x1fc1f9-0x0;var _0x4987ca=_0x6188[_0x1fc1f9];return _0x4987ca;};'use strict';var _=require(_0x8618('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x8618('0x1'));var BPromise=require('bluebird');var rp=require(_0x8618('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8618('0x3'));var config=require(_0x8618('0x4'));var attributes=require(_0x8618('0x5'));module[_0x8618('0x6')]=function(_0x1ca967,_0x219c0b){return _0x1ca967[_0x8618('0x7')](_0x8618('0x8'),attributes,{'tableName':_0x8618('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 5ac06ce..2ff4144 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 _0x0ba3=['redis','defaults','socket.io-emitter','./chatWebsite.socket','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x45b976,_0x3ac0e3){var _0x42c656=function(_0x8025da){while(--_0x8025da){_0x45b976['push'](_0x45b976['shift']());}};_0x42c656(++_0x3ac0e3);}(_0x0ba3,0x70));var _0x30ba=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0x0ba3[_0x1b2ff7];return _0x31656a;};'use strict';var _=require(_0x30ba('0x0'));var util=require(_0x30ba('0x1'));var moment=require(_0x30ba('0x2'));var BPromise=require(_0x30ba('0x3'));var rs=require(_0x30ba('0x4'));var fs=require('fs');var Redis=require(_0x30ba('0x5'));var db=require(_0x30ba('0x6'))['db'];var utils=require(_0x30ba('0x7'));var logger=require(_0x30ba('0x8'))(_0x30ba('0x9'));var config=require('../../config/environment');var jayson=require(_0x30ba('0xa'));var client=jayson[_0x30ba('0xb')][_0x30ba('0xc')]({'port':0x232a});config[_0x30ba('0xd')]=_[_0x30ba('0xe')](config[_0x30ba('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x30ba('0xf'))(new Redis(config['redis']));require(_0x30ba('0x10'))['register'](socket);function respondWithRpcPromise(_0x13359a,_0x11e2a2,_0xd77125){return new BPromise(function(_0x3b04f1,_0x166e04){return client['request'](_0x13359a,_0xd77125)['then'](function(_0x4a6634){logger[_0x30ba('0x11')](_0x30ba('0x12'),_0x11e2a2,_0x30ba('0x13'));logger[_0x30ba('0x14')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x11e2a2,_0x30ba('0x13'),JSON['stringify'](_0x4a6634));if(_0x4a6634[_0x30ba('0x15')]){if(_0x4a6634[_0x30ba('0x15')][_0x30ba('0x16')]===0x1f4){logger[_0x30ba('0x15')](_0x30ba('0x12'),_0x11e2a2,_0x4a6634['error'][_0x30ba('0x17')]);return _0x166e04(_0x4a6634['error'][_0x30ba('0x17')]);}logger[_0x30ba('0x15')](_0x30ba('0x12'),_0x11e2a2,_0x4a6634['error'][_0x30ba('0x17')]);return _0x3b04f1(_0x4a6634[_0x30ba('0x15')][_0x30ba('0x17')]);}else{logger['info'](_0x30ba('0x12'),_0x11e2a2,'request\x20sent');_0x3b04f1(_0x4a6634[_0x30ba('0x18')][_0x30ba('0x17')]);}})['catch'](function(_0x1ae53d){logger[_0x30ba('0x15')](_0x30ba('0x12'),_0x11e2a2,_0x1ae53d);_0x166e04(_0x1ae53d);});});}
\ No newline at end of file
+var _0xa27a=['code','ChatWebsite,\x20%s,\x20%s','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x42ef9a,_0x11845e){var _0x56e5dd=function(_0x170b1c){while(--_0x170b1c){_0x42ef9a['push'](_0x42ef9a['shift']());}};_0x56e5dd(++_0x11845e);}(_0xa27a,0x6c));var _0xaa27=function(_0xaec7d,_0x44dce6){_0xaec7d=_0xaec7d-0x0;var _0x54a0ce=_0xa27a[_0xaec7d];return _0x54a0ce;};'use strict';var _=require('lodash');var util=require(_0xaa27('0x0'));var moment=require(_0xaa27('0x1'));var BPromise=require(_0xaa27('0x2'));var rs=require(_0xaa27('0x3'));var fs=require('fs');var Redis=require(_0xaa27('0x4'));var db=require(_0xaa27('0x5'))['db'];var utils=require(_0xaa27('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xaa27('0x7'));var jayson=require(_0xaa27('0x8'));var client=jayson[_0xaa27('0x9')]['http']({'port':0x232a});config[_0xaa27('0xa')]=_[_0xaa27('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xaa27('0xc'))(new Redis(config[_0xaa27('0xa')]));require(_0xaa27('0xd'))[_0xaa27('0xe')](socket);function respondWithRpcPromise(_0x1656cc,_0x5c6084,_0x2dde59){return new BPromise(function(_0x34f167,_0x6f3c7d){return client['request'](_0x1656cc,_0x2dde59)[_0xaa27('0xf')](function(_0x4bab4e){logger[_0xaa27('0x10')]('ChatWebsite,\x20%s,\x20%s',_0x5c6084,_0xaa27('0x11'));logger[_0xaa27('0x12')](_0xaa27('0x13'),_0x5c6084,_0xaa27('0x11'),JSON[_0xaa27('0x14')](_0x4bab4e));if(_0x4bab4e[_0xaa27('0x15')]){if(_0x4bab4e[_0xaa27('0x15')][_0xaa27('0x16')]===0x1f4){logger[_0xaa27('0x15')](_0xaa27('0x17'),_0x5c6084,_0x4bab4e[_0xaa27('0x15')]['message']);return _0x6f3c7d(_0x4bab4e[_0xaa27('0x15')]['message']);}logger['error'](_0xaa27('0x17'),_0x5c6084,_0x4bab4e['error'][_0xaa27('0x18')]);return _0x34f167(_0x4bab4e[_0xaa27('0x15')][_0xaa27('0x18')]);}else{logger[_0xaa27('0x10')](_0xaa27('0x17'),_0x5c6084,'request\x20sent');_0x34f167(_0x4bab4e[_0xaa27('0x19')]['message']);}})['catch'](function(_0x5b826e){logger[_0xaa27('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x5c6084,_0x5b826e);_0x6f3c7d(_0x5b826e);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 7022856..a3b1da9 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 _0xf65a=['./chatWebsite.events','remove','update','emit','removeListener','register','chatWebsite:'];(function(_0x505dcb,_0x3d3646){var _0x3f1944=function(_0x22dfa1){while(--_0x22dfa1){_0x505dcb['push'](_0x505dcb['shift']());}};_0x3f1944(++_0x3d3646);}(_0xf65a,0x10a));var _0xaf65=function(_0x2b2641,_0x28312b){_0x2b2641=_0x2b2641-0x0;var _0x36d9f4=_0xf65a[_0x2b2641];return _0x36d9f4;};'use strict';var ChatWebsiteEvents=require(_0xaf65('0x0'));var events=['save',_0xaf65('0x1'),_0xaf65('0x2')];function createListener(_0x52f995,_0x3b40ec){return function(_0x1e017e){_0x3b40ec[_0xaf65('0x3')](_0x52f995,_0x1e017e);};}function removeListener(_0x30026c,_0x2de4ae){return function(){ChatWebsiteEvents[_0xaf65('0x4')](_0x30026c,_0x2de4ae);};}exports[_0xaf65('0x5')]=function(_0x1ba358){for(var _0x63857f=0x0,_0x284cfa=events['length'];_0x63857f<_0x284cfa;_0x63857f++){var _0x2c2a48=events[_0x63857f];var _0x37bf1f=createListener(_0xaf65('0x6')+_0x2c2a48,_0x1ba358);ChatWebsiteEvents['on'](_0x2c2a48,_0x37bf1f);}};
\ No newline at end of file
+var _0x8443=['save','remove','update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x8443,0x1ca));var _0x3844=function(_0x15872f,_0x574f38){_0x15872f=_0x15872f-0x0;var _0x3dc290=_0x8443[_0x15872f];return _0x3dc290;};'use strict';var ChatWebsiteEvents=require(_0x3844('0x0'));var events=[_0x3844('0x1'),_0x3844('0x2'),_0x3844('0x3')];function createListener(_0x407804,_0x3b7843){return function(_0x3cbc63){_0x3b7843[_0x3844('0x4')](_0x407804,_0x3cbc63);};}function removeListener(_0x3b4699,_0x4a060c){return function(){ChatWebsiteEvents[_0x3844('0x5')](_0x3b4699,_0x4a060c);};}exports[_0x3844('0x6')]=function(_0xddea77){for(var _0x236729=0x0,_0x50b12f=events[_0x3844('0x7')];_0x236729<_0x50b12f;_0x236729++){var _0x40f802=events[_0x236729];var _0x412bab=createListener(_0x3844('0x8')+_0x40f802,_0xddea77);ChatWebsiteEvents['on'](_0x40f802,_0x412bab);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 7ed7c47..8437189 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 _0xcc60=['removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./chatWebsite.controller','isAuthenticated','/describe','get','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','getSnippet','/:id/applications','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','post','create','addDisposition','addAnswer','diskStorage','root','format','%s-%s','now','single','addLogo','join','server/files/images/avatars/','originalname','file','addAvatar','/:id/customer_avatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','ensureDir','extname','/:id/offline','any','addInteraction','addApplications','/:id/proactive_actions','addProactiveActions','put','/:id','update','delete','destroy','removeDispositions','removeAnswers'];(function(_0x2e2c52,_0x7e90fb){var _0x5918c5=function(_0x3f99a7){while(--_0x3f99a7){_0x2e2c52['push'](_0x2e2c52['shift']());}};_0x5918c5(++_0x7e90fb);}(_0xcc60,0x94));var _0x0cc6=function(_0xb38540,_0x1fc920){_0xb38540=_0xb38540-0x0;var _0x27fa72=_0xcc60[_0xb38540];return _0x27fa72;};'use strict';var multer=require(_0x0cc6('0x0'));var util=require(_0x0cc6('0x1'));var path=require(_0x0cc6('0x2'));var timeout=require(_0x0cc6('0x3'));var express=require(_0x0cc6('0x4'));var router=express[_0x0cc6('0x5')]();var fs_extra=require(_0x0cc6('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0cc6('0x7'));var controller=require(_0x0cc6('0x8'));router['get']('/',auth[_0x0cc6('0x9')](),controller['index']);router['get'](_0x0cc6('0xa'),auth[_0x0cc6('0x9')](),controller['describe']);router[_0x0cc6('0xb')]('/:id',auth[_0x0cc6('0x9')](),controller[_0x0cc6('0xc')]);router[_0x0cc6('0xb')](_0x0cc6('0xd'),auth[_0x0cc6('0x9')](),controller[_0x0cc6('0xe')]);router['get'](_0x0cc6('0xf'),auth[_0x0cc6('0x9')](),controller[_0x0cc6('0x10')]);router[_0x0cc6('0xb')](_0x0cc6('0x11'),controller[_0x0cc6('0x12')]);router[_0x0cc6('0xb')](_0x0cc6('0x13'),controller[_0x0cc6('0x14')]);router['get']('/:id/customer_avatar',controller[_0x0cc6('0x15')]);router[_0x0cc6('0xb')](_0x0cc6('0x16'),controller['getSystemAvatar']);router[_0x0cc6('0xb')](_0x0cc6('0x17'),auth[_0x0cc6('0x9')](),controller[_0x0cc6('0x18')]);router[_0x0cc6('0xb')]('/:id/snippet',controller[_0x0cc6('0x19')]);router[_0x0cc6('0xb')](_0x0cc6('0x1a'),auth[_0x0cc6('0x9')](),controller['getApplications']);router[_0x0cc6('0xb')]('/:id/proactive_actions',auth[_0x0cc6('0x9')](),controller[_0x0cc6('0x1b')]);router[_0x0cc6('0xb')](_0x0cc6('0x1c'),controller[_0x0cc6('0x1d')]);router[_0x0cc6('0xb')](_0x0cc6('0x1e'),auth[_0x0cc6('0x9')](),controller[_0x0cc6('0x1f')]);router[_0x0cc6('0xb')](_0x0cc6('0x20'),auth[_0x0cc6('0x9')](),controller['getAgents']);router[_0x0cc6('0x21')]('/',auth[_0x0cc6('0x9')](),controller[_0x0cc6('0x22')]);router[_0x0cc6('0x21')](_0x0cc6('0xd'),auth['isAuthenticated'](),controller[_0x0cc6('0x23')]);router['post'](_0x0cc6('0xf'),auth[_0x0cc6('0x9')](),controller[_0x0cc6('0x24')]);var upload=multer({'storage':multer[_0x0cc6('0x25')]({'destination':function(_0x42c430,_0x56dbf9,_0x4cac90){_0x4cac90(null,path['join'](config[_0x0cc6('0x26')],'server/files/images/logos/'));},'filename':function(_0x14b259,_0x5d6a39,_0x15afa8){_0x15afa8(null,util[_0x0cc6('0x27')](_0x0cc6('0x28'),Date[_0x0cc6('0x29')](),_0x5d6a39['originalname']));}})});router[_0x0cc6('0x21')](_0x0cc6('0x11'),upload[_0x0cc6('0x2a')]('file'),controller[_0x0cc6('0x2b')]);var upload=multer({'storage':multer[_0x0cc6('0x25')]({'destination':function(_0x5affc4,_0x2090c8,_0x20d982){_0x20d982(null,path[_0x0cc6('0x2c')](config[_0x0cc6('0x26')],_0x0cc6('0x2d')));},'filename':function(_0x882ef3,_0x3b603e,_0x24728e){_0x24728e(null,util[_0x0cc6('0x27')]('%s-%s',Date['now'](),_0x3b603e[_0x0cc6('0x2e')]));}})});router[_0x0cc6('0x21')](_0x0cc6('0x13'),upload[_0x0cc6('0x2a')](_0x0cc6('0x2f')),controller[_0x0cc6('0x30')]);var upload=multer({'storage':multer[_0x0cc6('0x25')]({'destination':function(_0x67d9f8,_0x344ec6,_0x1392fb){_0x1392fb(null,path[_0x0cc6('0x2c')](config[_0x0cc6('0x26')],'server/files/images/avatars/'));},'filename':function(_0x47cfd3,_0x1448a9,_0x30a663){_0x30a663(null,util['format'](_0x0cc6('0x28'),Date[_0x0cc6('0x29')](),_0x1448a9[_0x0cc6('0x2e')]));}})});router[_0x0cc6('0x21')](_0x0cc6('0x31'),upload[_0x0cc6('0x2a')](_0x0cc6('0x2f')),controller[_0x0cc6('0x32')]);var upload=multer({'storage':multer[_0x0cc6('0x25')]({'destination':function(_0x2b5517,_0x9fba4e,_0x342ee4){_0x342ee4(null,path['join'](config[_0x0cc6('0x26')],_0x0cc6('0x2d')));},'filename':function(_0x570efa,_0x42a49e,_0x3facf5){_0x3facf5(null,util[_0x0cc6('0x27')]('%s-%s',Date['now'](),_0x42a49e[_0x0cc6('0x2e')]));}})});router[_0x0cc6('0x21')](_0x0cc6('0x16'),upload[_0x0cc6('0x2a')](_0x0cc6('0x2f')),controller[_0x0cc6('0x33')]);router[_0x0cc6('0x21')](_0x0cc6('0x34'),controller[_0x0cc6('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0x0cc6('0x25')]({'destination':function(_0x9fabb1,_0x1b88b7,_0x226bb8){const _0x5920d1=path[_0x0cc6('0x2c')](config[_0x0cc6('0x26')],_0x0cc6('0x36'),_0x0cc6('0x37'),'offline-chat');fs_extra[_0x0cc6('0x38')](_0x5920d1,function(){_0x226bb8(null,_0x5920d1);});},'filename':function(_0x4d1257,_0x5add92,_0x12e22b){const _0xf281b=_0x5add92['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1c065d=path[_0x0cc6('0x39')](_0xf281b);const _0x5d3a7b=Date[_0x0cc6('0x29')]()+'-'+_0xf281b['replace'](_0x1c065d,'')+_0x1c065d;_0x12e22b(null,_0x5d3a7b);}})});router['post'](_0x0cc6('0x3a'),offlineUploadMulter[_0x0cc6('0x3b')](),controller['offline']);router[_0x0cc6('0x21')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x0cc6('0x3c')]);router['post'](_0x0cc6('0x1a'),auth['isAuthenticated'](),controller[_0x0cc6('0x3d')]);router[_0x0cc6('0x21')](_0x0cc6('0x3e'),auth[_0x0cc6('0x9')](),controller[_0x0cc6('0x3f')]);router[_0x0cc6('0x21')](_0x0cc6('0x20'),auth['isAuthenticated'](),controller['addAgents']);router[_0x0cc6('0x40')](_0x0cc6('0x41'),auth['isAuthenticated'](),controller[_0x0cc6('0x42')]);router[_0x0cc6('0x43')]('/:id',auth[_0x0cc6('0x9')](),controller[_0x0cc6('0x44')]);router[_0x0cc6('0x43')](_0x0cc6('0xd'),auth[_0x0cc6('0x9')](),controller[_0x0cc6('0x45')]);router[_0x0cc6('0x43')](_0x0cc6('0xf'),auth[_0x0cc6('0x9')](),controller[_0x0cc6('0x46')]);router[_0x0cc6('0x43')](_0x0cc6('0x20'),auth[_0x0cc6('0x9')](),controller[_0x0cc6('0x47')]);module[_0x0cc6('0x48')]=router;
\ No newline at end of file
+var _0xe381=['getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','root','server/files/images/logos/','format','%s-%s','now','file','addLogo','join','originalname','single','addAvatar','addCustomerAvatar','server/files/images/avatars/','addSystemAvatar','server/files','offline-chat','ensureDir','replace','extname','/:id/offline','offline','addInteraction','addApplications','addProactiveActions','addAgents','put','/:id','update','delete','removeAnswers','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','/: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'];(function(_0x5a5225,_0x30ded3){var _0x533f2f=function(_0xe3d024){while(--_0xe3d024){_0x5a5225['push'](_0x5a5225['shift']());}};_0x533f2f(++_0x30ded3);}(_0xe381,0x1f4));var _0x1e38=function(_0x470b0a,_0x2889d6){_0x470b0a=_0x470b0a-0x0;var _0x4463f6=_0xe381[_0x470b0a];return _0x4463f6;};'use strict';var multer=require('multer');var util=require(_0x1e38('0x0'));var path=require(_0x1e38('0x1'));var timeout=require(_0x1e38('0x2'));var express=require(_0x1e38('0x3'));var router=express[_0x1e38('0x4')]();var fs_extra=require(_0x1e38('0x5'));var auth=require(_0x1e38('0x6'));var interaction=require(_0x1e38('0x7'));var config=require('../../config/environment');var controller=require(_0x1e38('0x8'));router[_0x1e38('0x9')]('/',auth[_0x1e38('0xa')](),controller[_0x1e38('0xb')]);router[_0x1e38('0x9')](_0x1e38('0xc'),auth[_0x1e38('0xa')](),controller[_0x1e38('0xd')]);router[_0x1e38('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x1e38('0xe')]);router[_0x1e38('0x9')](_0x1e38('0xf'),auth[_0x1e38('0xa')](),controller[_0x1e38('0x10')]);router['get'](_0x1e38('0x11'),auth[_0x1e38('0xa')](),controller['getAnswers']);router['get'](_0x1e38('0x12'),controller[_0x1e38('0x13')]);router[_0x1e38('0x9')](_0x1e38('0x14'),controller['getAvatar']);router[_0x1e38('0x9')](_0x1e38('0x15'),controller[_0x1e38('0x16')]);router['get'](_0x1e38('0x17'),controller[_0x1e38('0x18')]);router['get'](_0x1e38('0x19'),auth[_0x1e38('0xa')](),controller[_0x1e38('0x1a')]);router[_0x1e38('0x9')](_0x1e38('0x1b'),controller[_0x1e38('0x1c')]);router['get'](_0x1e38('0x1d'),auth['isAuthenticated'](),controller[_0x1e38('0x1e')]);router['get'](_0x1e38('0x1f'),auth[_0x1e38('0xa')](),controller[_0x1e38('0x20')]);router[_0x1e38('0x9')](_0x1e38('0x21'),controller[_0x1e38('0x22')]);router[_0x1e38('0x9')](_0x1e38('0x23'),auth[_0x1e38('0xa')](),controller[_0x1e38('0x24')]);router['get'](_0x1e38('0x25'),auth['isAuthenticated'](),controller[_0x1e38('0x26')]);router[_0x1e38('0x27')]('/',auth[_0x1e38('0xa')](),controller[_0x1e38('0x28')]);router['post'](_0x1e38('0xf'),auth[_0x1e38('0xa')](),controller[_0x1e38('0x29')]);router['post']('/:id/canned_answers',auth[_0x1e38('0xa')](),controller[_0x1e38('0x2a')]);var upload=multer({'storage':multer[_0x1e38('0x2b')]({'destination':function(_0x3c9820,_0x3fb002,_0x46c3e4){_0x46c3e4(null,path['join'](config[_0x1e38('0x2c')],_0x1e38('0x2d')));},'filename':function(_0x2efdc6,_0x52c21c,_0x3008dd){_0x3008dd(null,util[_0x1e38('0x2e')](_0x1e38('0x2f'),Date[_0x1e38('0x30')](),_0x52c21c['originalname']));}})});router[_0x1e38('0x27')](_0x1e38('0x12'),upload['single'](_0x1e38('0x31')),controller[_0x1e38('0x32')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5dae8a,_0x58a70a,_0x43c545){_0x43c545(null,path[_0x1e38('0x33')](config[_0x1e38('0x2c')],'server/files/images/avatars/'));},'filename':function(_0x849b79,_0x55011a,_0x11afd4){_0x11afd4(null,util[_0x1e38('0x2e')](_0x1e38('0x2f'),Date[_0x1e38('0x30')](),_0x55011a[_0x1e38('0x34')]));}})});router[_0x1e38('0x27')](_0x1e38('0x14'),upload[_0x1e38('0x35')](_0x1e38('0x31')),controller[_0x1e38('0x36')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4380f2,_0x4beda0,_0x5fbccd){_0x5fbccd(null,path[_0x1e38('0x33')](config[_0x1e38('0x2c')],'server/files/images/avatars/'));},'filename':function(_0x23d04f,_0x1d90dc,_0x3daf9d){_0x3daf9d(null,util[_0x1e38('0x2e')]('%s-%s',Date[_0x1e38('0x30')](),_0x1d90dc['originalname']));}})});router['post'](_0x1e38('0x15'),upload[_0x1e38('0x35')](_0x1e38('0x31')),controller[_0x1e38('0x37')]);var upload=multer({'storage':multer[_0x1e38('0x2b')]({'destination':function(_0xe8b62d,_0x47d316,_0x268b75){_0x268b75(null,path[_0x1e38('0x33')](config['root'],_0x1e38('0x38')));},'filename':function(_0x21cb1f,_0x17f396,_0x4b1f74){_0x4b1f74(null,util[_0x1e38('0x2e')](_0x1e38('0x2f'),Date[_0x1e38('0x30')](),_0x17f396['originalname']));}})});router[_0x1e38('0x27')](_0x1e38('0x17'),upload[_0x1e38('0x35')](_0x1e38('0x31')),controller[_0x1e38('0x39')]);router[_0x1e38('0x27')]('/:id/notify',controller['notify']);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x194ad9,_0x5d47d7,_0x5da8f1){const _0x21dcd4=path[_0x1e38('0x33')](config['root'],_0x1e38('0x3a'),'attachments',_0x1e38('0x3b'));fs_extra[_0x1e38('0x3c')](_0x21dcd4,function(){_0x5da8f1(null,_0x21dcd4);});},'filename':function(_0x14214e,_0x24b615,_0x37f108){const _0x10ae58=_0x24b615[_0x1e38('0x34')][_0x1e38('0x3d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x3f9a03=path[_0x1e38('0x3e')](_0x10ae58);const _0x531016=Date[_0x1e38('0x30')]()+'-'+_0x10ae58[_0x1e38('0x3d')](_0x3f9a03,'')+_0x3f9a03;_0x37f108(null,_0x531016);}})});router['post'](_0x1e38('0x3f'),offlineUploadMulter['any'](),controller[_0x1e38('0x40')]);router[_0x1e38('0x27')](_0x1e38('0x19'),auth[_0x1e38('0xa')](),controller[_0x1e38('0x41')]);router['post'](_0x1e38('0x1d'),auth[_0x1e38('0xa')](),controller[_0x1e38('0x42')]);router['post'](_0x1e38('0x1f'),auth[_0x1e38('0xa')](),controller[_0x1e38('0x43')]);router[_0x1e38('0x27')](_0x1e38('0x25'),auth['isAuthenticated'](),controller[_0x1e38('0x44')]);router[_0x1e38('0x45')](_0x1e38('0x46'),auth[_0x1e38('0xa')](),controller[_0x1e38('0x47')]);router['delete']('/:id',auth[_0x1e38('0xa')](),controller['destroy']);router['delete'](_0x1e38('0xf'),auth[_0x1e38('0xa')](),controller['removeDispositions']);router[_0x1e38('0x48')](_0x1e38('0x11'),auth[_0x1e38('0xa')](),controller[_0x1e38('0x49')]);router[_0x1e38('0x48')]('/:id/users',auth[_0x1e38('0xa')](),controller[_0x1e38('0x4a')]);module[_0x1e38('0x4b')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index c387ff2..443fdf3 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 _0x0763=['STRING','ENUM','Google','sequelize'];(function(_0x52c51a,_0x31478a){var _0x20089c=function(_0x5b163c){while(--_0x5b163c){_0x52c51a['push'](_0x52c51a['shift']());}};_0x20089c(++_0x31478a);}(_0x0763,0x87));var _0x3076=function(_0xa45395,_0x5579e6){_0xa45395=_0xa45395-0x0;var _0x3c83d2=_0x0763[_0xa45395];return _0x3c83d2;};'use strict';var Sequelize=require(_0x3076('0x0'));module['exports']={'name':{'type':Sequelize[_0x3076('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x3076('0x2')]('AmazonAWS',_0x3076('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x3076('0x1')]},'data2':{'type':Sequelize[_0x3076('0x1')]}};
\ No newline at end of file
+var _0x6869=['STRING','AmazonAWS','sequelize','exports'];(function(_0x4c98b9,_0x1ad11b){var _0x3a257a=function(_0x147857){while(--_0x147857){_0x4c98b9['push'](_0x4c98b9['shift']());}};_0x3a257a(++_0x1ad11b);}(_0x6869,0xe2));var _0x9686=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x6869[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0x9686('0x0'));module[_0x9686('0x1')]={'name':{'type':Sequelize[_0x9686('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x9686('0x3'),'Google'),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x9686('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index af5fe45..055c93d 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 _0x2032=['body','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','CloudProvider','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','rows','show','params','keys','rawAttributes','includeAll','find','catch'];(function(_0x41dc41,_0x11b458){var _0x3a112f=function(_0x42e7c1){while(--_0x42e7c1){_0x41dc41['push'](_0x41dc41['shift']());}};_0x3a112f(++_0x11b458);}(_0x2032,0xd9));var _0x2203=function(_0x277f49,_0x4717d1){_0x277f49=_0x277f49-0x0;var _0x1bb801=_0x2032[_0x277f49];return _0x1bb801;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];function respondWithStatusCode(_0x4b9376,_0x583bc7){_0x583bc7=_0x583bc7||0xcc;return function(_0x585c76){if(_0x585c76){return _0x4b9376['sendStatus'](_0x583bc7);}return _0x4b9376['status'](_0x583bc7)[_0x2203('0x18')]();};}function respondWithResult(_0x538b30,_0x592e47){_0x592e47=_0x592e47||0xc8;return function(_0x21a3af){if(_0x21a3af){return _0x538b30[_0x2203('0x19')](_0x592e47)[_0x2203('0x1a')](_0x21a3af);}};}function respondWithFilteredResult(_0x41af85,_0x226209){return function(_0x3fe0a8){if(_0x3fe0a8){var _0x2c36e6=typeof _0x226209[_0x2203('0x1b')]===_0x2203('0x1c')&&typeof _0x226209[_0x2203('0x1d')]==='undefined';var _0x280eda=_0x3fe0a8[_0x2203('0x1e')];var _0x4893ff=_0x2c36e6?0x0:_0x226209[_0x2203('0x1b')];var _0x8906e1=_0x2c36e6?_0x3fe0a8['count']:_0x226209[_0x2203('0x1b')]+_0x226209['limit'];var _0x2904ba;if(_0x8906e1>=_0x280eda){_0x8906e1=_0x280eda;_0x2904ba=0xc8;}else{_0x2904ba=0xce;}_0x41af85[_0x2203('0x19')](_0x2904ba);return _0x41af85[_0x2203('0x1f')](_0x2203('0x20'),_0x4893ff+'-'+_0x8906e1+'/'+_0x280eda)[_0x2203('0x1a')](_0x3fe0a8);}return null;};}function patchUpdates(_0x449039){return function(_0x538c23){try{jsonpatch[_0x2203('0x21')](_0x538c23,_0x449039,!![]);}catch(_0x50822b){return BPromise['reject'](_0x50822b);}return _0x538c23[_0x2203('0x22')]();};}function saveUpdates(_0x496d82,_0x3b8ef9){return function(_0x5bfe61){if(_0x5bfe61){return _0x5bfe61['update'](_0x496d82)[_0x2203('0x23')](function(_0x5e29cd){return _0x5e29cd;});}return null;};}function removeEntity(_0x5c8da9,_0x226374){return function(_0x2718f5){if(_0x2718f5){return _0x2718f5[_0x2203('0x24')]()[_0x2203('0x23')](function(){_0x5c8da9[_0x2203('0x19')](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x49c12,_0x250349){return function(_0x576378){if(!_0x576378){_0x49c12[_0x2203('0x25')](0x194);}return _0x576378;};}function handleError(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0x1f4;return function(_0x5f11bf){logger[_0x2203('0x26')](_0x5f11bf[_0x2203('0x27')]);if(_0x5f11bf['name']){delete _0x5f11bf[_0x2203('0x28')];}_0x36b958[_0x2203('0x19')](_0x39a11a)[_0x2203('0x29')](_0x5f11bf);};}exports[_0x2203('0x2a')]=function(_0x28ae02,_0x1df508){var _0x9c53f={},_0x5a95c1={},_0x34b8ba={'count':0x0,'rows':[]};var _0x616ed8=_[_0x2203('0x2b')](db[_0x2203('0x2c')]['rawAttributes'],function(_0x3a8e23){return{'name':_0x3a8e23[_0x2203('0x2d')],'type':_0x3a8e23[_0x2203('0x2e')][_0x2203('0x2f')]};});_0x5a95c1['model']=_[_0x2203('0x2b')](_0x616ed8,_0x2203('0x28'));_0x5a95c1['query']=_['keys'](_0x28ae02[_0x2203('0x30')]);_0x5a95c1['filters']=_['intersection'](_0x5a95c1[_0x2203('0x31')],_0x5a95c1[_0x2203('0x30')]);_0x9c53f[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5a95c1[_0x2203('0x31')],qs['fields'](_0x28ae02[_0x2203('0x30')][_0x2203('0x34')]));_0x9c53f['attributes']=_0x9c53f[_0x2203('0x32')][_0x2203('0x35')]?_0x9c53f[_0x2203('0x32')]:_0x5a95c1[_0x2203('0x31')];if(!_0x28ae02[_0x2203('0x30')][_0x2203('0x36')](_0x2203('0x37'))){_0x9c53f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x28ae02['query'][_0x2203('0x1d')]);_0x9c53f[_0x2203('0x1b')]=qs['offset'](_0x28ae02['query'][_0x2203('0x1b')]);}_0x9c53f['order']=qs[_0x2203('0x38')](_0x28ae02[_0x2203('0x30')][_0x2203('0x38')]);_0x9c53f['where']=qs['filters'](_[_0x2203('0x39')](_0x28ae02['query'],_0x5a95c1[_0x2203('0x3a')]),_0x616ed8);if(_0x28ae02['query'][_0x2203('0x3b')]){_0x9c53f['where']=_[_0x2203('0x3c')](_0x9c53f[_0x2203('0x3d')],{'$or':_[_0x2203('0x2b')](_0x616ed8,function(_0x40a793){if(_0x40a793[_0x2203('0x2e')]!=='VIRTUAL'){var _0x5f1561={};_0x5f1561[_0x40a793['name']]={'$like':'%'+_0x28ae02[_0x2203('0x30')][_0x2203('0x3b')]+'%'};return _0x5f1561;}})});}_0x9c53f=_[_0x2203('0x3c')]({},_0x9c53f,_0x28ae02[_0x2203('0x3e')]);var _0x3283fb={'where':_0x9c53f[_0x2203('0x3d')]};return db[_0x2203('0x2c')]['count'](_0x3283fb)[_0x2203('0x23')](function(_0x1b12c3){_0x34b8ba[_0x2203('0x1e')]=_0x1b12c3;if(_0x28ae02[_0x2203('0x30')]['includeAll']){_0x9c53f['include']=[{'all':!![]}];}return db[_0x2203('0x2c')]['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x446209){_0x34b8ba[_0x2203('0x3f')]=_0x446209;return _0x34b8ba;})['then'](respondWithFilteredResult(_0x1df508,_0x9c53f))['catch'](handleError(_0x1df508,null));};exports[_0x2203('0x40')]=function(_0x3739f6,_0x368444){var _0x1e09f3={'raw':!![],'where':{'id':_0x3739f6[_0x2203('0x41')]['id']}},_0x372709={};_0x372709['model']=_[_0x2203('0x42')](db[_0x2203('0x2c')][_0x2203('0x43')]);_0x372709[_0x2203('0x30')]=_[_0x2203('0x42')](_0x3739f6[_0x2203('0x30')]);_0x372709[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x372709[_0x2203('0x31')],_0x372709[_0x2203('0x30')]);_0x1e09f3['attributes']=_[_0x2203('0x33')](_0x372709[_0x2203('0x31')],qs[_0x2203('0x34')](_0x3739f6[_0x2203('0x30')]['fields']));_0x1e09f3['attributes']=_0x1e09f3[_0x2203('0x32')]['length']?_0x1e09f3[_0x2203('0x32')]:_0x372709[_0x2203('0x31')];if(_0x3739f6[_0x2203('0x30')][_0x2203('0x44')]){_0x1e09f3['include']=[{'all':!![]}];}_0x1e09f3=_[_0x2203('0x3c')]({},_0x1e09f3,_0x3739f6[_0x2203('0x3e')]);return db['CloudProvider'][_0x2203('0x45')](_0x1e09f3)[_0x2203('0x23')](handleEntityNotFound(_0x368444,null))[_0x2203('0x23')](respondWithResult(_0x368444,null))[_0x2203('0x46')](handleError(_0x368444,null));};exports['create']=function(_0x4c1a29,_0x21b8ab){return db['CloudProvider']['create'](_0x4c1a29[_0x2203('0x47')],{})[_0x2203('0x23')](respondWithResult(_0x21b8ab,0xc9))[_0x2203('0x46')](handleError(_0x21b8ab,null));};exports['update']=function(_0x4c1496,_0x131aec){if(_0x4c1496[_0x2203('0x47')]['id']){delete _0x4c1496[_0x2203('0x47')]['id'];}return db[_0x2203('0x2c')][_0x2203('0x45')]({'where':{'id':_0x4c1496[_0x2203('0x41')]['id']}})['then'](handleEntityNotFound(_0x131aec,null))[_0x2203('0x23')](saveUpdates(_0x4c1496['body'],null))[_0x2203('0x23')](respondWithResult(_0x131aec,null))[_0x2203('0x46')](handleError(_0x131aec,null));};exports[_0x2203('0x24')]=function(_0x1e49dd,_0x58b9bb){return db['CloudProvider'][_0x2203('0x45')]({'where':{'id':_0x1e49dd[_0x2203('0x41')]['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x58b9bb,null))[_0x2203('0x23')](removeEntity(_0x58b9bb,null))['catch'](handleError(_0x58b9bb,null));};
\ No newline at end of file
+var _0x7a54=['offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','CloudProvider','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x158b71,_0x24f792){var _0x5056ab=function(_0x43b3e1){while(--_0x43b3e1){_0x158b71['push'](_0x158b71['shift']());}};_0x5056ab(++_0x24f792);}(_0x7a54,0x106));var _0x47a5=function(_0x327ff5,_0x3a1250){_0x327ff5=_0x327ff5-0x0;var _0x248bca=_0x7a54[_0x327ff5];return _0x248bca;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['CloudProvider'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['CloudProvider']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['CloudProvider']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 9c87f26..98dd126 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 _0x3f3d=['path','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x19aa84,_0x549537){var _0x536146=function(_0x5da480){while(--_0x5da480){_0x19aa84['push'](_0x19aa84['shift']());}};_0x536146(++_0x549537);}(_0x3f3d,0x1ac));var _0xd3f3=function(_0x4e9861,_0x25fe5f){_0x4e9861=_0x4e9861-0x0;var _0x49802f=_0x3f3d[_0x4e9861];return _0x49802f;};'use strict';var _=require(_0xd3f3('0x0'));var util=require('util');var logger=require(_0xd3f3('0x1'))(_0xd3f3('0x2'));var moment=require(_0xd3f3('0x3'));var BPromise=require(_0xd3f3('0x4'));var rp=require(_0xd3f3('0x5'));var fs=require('fs');var path=require(_0xd3f3('0x6'));var rimraf=require(_0xd3f3('0x7'));var config=require(_0xd3f3('0x8'));var attributes=require(_0xd3f3('0x9'));module[_0xd3f3('0xa')]=function(_0xe78eba,_0x13a2a1){return _0xe78eba[_0xd3f3('0xb')](_0xd3f3('0xc'),attributes,{'tableName':_0xd3f3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa466=['exports','CloudProvider','cloud_providers','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes'];(function(_0x5d7141,_0x13de2f){var _0x1c5d84=function(_0x29ae86){while(--_0x29ae86){_0x5d7141['push'](_0x5d7141['shift']());}};_0x1c5d84(++_0x13de2f);}(_0xa466,0x1d7));var _0x6a46=function(_0xa81117,_0x356201){_0xa81117=_0xa81117-0x0;var _0x4df5b5=_0xa466[_0xa81117];return _0x4df5b5;};'use strict';var _=require('lodash');var util=require(_0x6a46('0x0'));var logger=require(_0x6a46('0x1'))(_0x6a46('0x2'));var moment=require(_0x6a46('0x3'));var BPromise=require(_0x6a46('0x4'));var rp=require(_0x6a46('0x5'));var fs=require('fs');var path=require(_0x6a46('0x6'));var rimraf=require(_0x6a46('0x7'));var config=require(_0x6a46('0x8'));var attributes=require(_0x6a46('0x9'));module[_0x6a46('0xa')]=function(_0x5b049b,_0x12cf7c){return _0x5b049b['define'](_0x6a46('0xb'),attributes,{'tableName':_0x6a46('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index 104d31c..231d931 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 _0xd786=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x2cd969,_0x35dcd4){var _0x10d32f=function(_0xa86b97){while(--_0xa86b97){_0x2cd969['push'](_0x2cd969['shift']());}};_0x10d32f(++_0x35dcd4);}(_0xd786,0x1dc));var _0x6d78=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd786[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x6d78('0x0'));var util=require(_0x6d78('0x1'));var moment=require(_0x6d78('0x2'));var BPromise=require(_0x6d78('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6d78('0x4'));var db=require(_0x6d78('0x5'))['db'];var utils=require(_0x6d78('0x6'));var logger=require(_0x6d78('0x7'))(_0x6d78('0x8'));var config=require(_0x6d78('0x9'));var jayson=require(_0x6d78('0xa'));var client=jayson['client'][_0x6d78('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x30e9e5,_0x5c3f38,_0x44db98){return new BPromise(function(_0x33b85e,_0x10f58a){return client[_0x6d78('0xc')](_0x30e9e5,_0x44db98)['then'](function(_0x3198b6){logger[_0x6d78('0xd')](_0x6d78('0xe'),_0x5c3f38,'request\x20sent');logger[_0x6d78('0xf')](_0x6d78('0x10'),_0x5c3f38,_0x6d78('0x11'),JSON[_0x6d78('0x12')](_0x3198b6));if(_0x3198b6[_0x6d78('0x13')]){if(_0x3198b6[_0x6d78('0x13')][_0x6d78('0x14')]===0x1f4){logger[_0x6d78('0x13')](_0x6d78('0xe'),_0x5c3f38,_0x3198b6[_0x6d78('0x13')]['message']);return _0x10f58a(_0x3198b6[_0x6d78('0x13')][_0x6d78('0x15')]);}logger[_0x6d78('0x13')](_0x6d78('0xe'),_0x5c3f38,_0x3198b6[_0x6d78('0x13')]['message']);return _0x33b85e(_0x3198b6['error'][_0x6d78('0x15')]);}else{logger['info'](_0x6d78('0xe'),_0x5c3f38,'request\x20sent');_0x33b85e(_0x3198b6[_0x6d78('0x16')]['message']);}})[_0x6d78('0x17')](function(_0x378c59){logger[_0x6d78('0x13')](_0x6d78('0xe'),_0x5c3f38,_0x378c59);_0x10f58a(_0x378c59);});});}
\ No newline at end of file
+var _0xbc36=['info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','CloudProvider,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0x1b9ee6,_0x83b1e1){var _0x3a8ca3=function(_0x32985d){while(--_0x32985d){_0x1b9ee6['push'](_0x1b9ee6['shift']());}};_0x3a8ca3(++_0x83b1e1);}(_0xbc36,0x169));var _0x6bc3=function(_0x2d14e7,_0x32cff9){_0x2d14e7=_0x2d14e7-0x0;var _0x30f1e8=_0xbc36[_0x2d14e7];return _0x30f1e8;};'use strict';var _=require(_0x6bc3('0x0'));var util=require('util');var moment=require(_0x6bc3('0x1'));var BPromise=require(_0x6bc3('0x2'));var rs=require(_0x6bc3('0x3'));var fs=require('fs');var Redis=require(_0x6bc3('0x4'));var db=require(_0x6bc3('0x5'))['db'];var utils=require(_0x6bc3('0x6'));var logger=require(_0x6bc3('0x7'))(_0x6bc3('0x8'));var config=require(_0x6bc3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6bc3('0xa')][_0x6bc3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5584a5,_0x33e11c,_0x1f894a){return new BPromise(function(_0xf07594,_0x4de32d){return client[_0x6bc3('0xc')](_0x5584a5,_0x1f894a)[_0x6bc3('0xd')](function(_0x33e8e0){logger[_0x6bc3('0xe')]('CloudProvider,\x20%s,\x20%s',_0x33e11c,_0x6bc3('0xf'));logger[_0x6bc3('0x10')](_0x6bc3('0x11'),_0x33e11c,_0x6bc3('0xf'),JSON[_0x6bc3('0x12')](_0x33e8e0));if(_0x33e8e0[_0x6bc3('0x13')]){if(_0x33e8e0[_0x6bc3('0x13')][_0x6bc3('0x14')]===0x1f4){logger[_0x6bc3('0x13')]('CloudProvider,\x20%s,\x20%s',_0x33e11c,_0x33e8e0[_0x6bc3('0x13')]['message']);return _0x4de32d(_0x33e8e0[_0x6bc3('0x13')]['message']);}logger[_0x6bc3('0x13')](_0x6bc3('0x15'),_0x33e11c,_0x33e8e0['error'][_0x6bc3('0x16')]);return _0xf07594(_0x33e8e0['error']['message']);}else{logger[_0x6bc3('0xe')](_0x6bc3('0x15'),_0x33e11c,_0x6bc3('0xf'));_0xf07594(_0x33e8e0[_0x6bc3('0x17')][_0x6bc3('0x16')]);}})[_0x6bc3('0x18')](function(_0xa1782){logger['error'](_0x6bc3('0x15'),_0x33e11c,_0xa1782);_0x4de32d(_0xa1782);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index a20c43c..7de3726 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 _0xa03d=['show','post','/:id','update','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./cloudProvider.controller','isAuthenticated','index','get'];(function(_0x334292,_0xa12527){var _0x3af4a9=function(_0x26e948){while(--_0x26e948){_0x334292['push'](_0x334292['shift']());}};_0x3af4a9(++_0xa12527);}(_0xa03d,0x15b));var _0xda03=function(_0xa45300,_0x12b025){_0xa45300=_0xa45300-0x0;var _0x4b9521=_0xa03d[_0xa45300];return _0x4b9521;};'use strict';var multer=require(_0xda03('0x0'));var util=require(_0xda03('0x1'));var path=require('path');var timeout=require(_0xda03('0x2'));var express=require('express');var router=express[_0xda03('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xda03('0x4'));var interaction=require(_0xda03('0x5'));var config=require('../../config/environment');var controller=require(_0xda03('0x6'));router['get']('/',auth[_0xda03('0x7')](),controller[_0xda03('0x8')]);router[_0xda03('0x9')]('/:id',auth[_0xda03('0x7')](),controller[_0xda03('0xa')]);router[_0xda03('0xb')]('/',auth[_0xda03('0x7')](),controller['create']);router['put'](_0xda03('0xc'),auth[_0xda03('0x7')](),controller[_0xda03('0xd')]);router[_0xda03('0xe')](_0xda03('0xc'),auth['isAuthenticated'](),controller[_0xda03('0xf')]);module[_0xda03('0x10')]=router;
\ No newline at end of file
+var _0xd946=['isAuthenticated','show','post','put','/:id','update','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x1ccf7f,_0x1ed2b7){var _0x289389=function(_0x15cfce){while(--_0x15cfce){_0x1ccf7f['push'](_0x1ccf7f['shift']());}};_0x289389(++_0x1ed2b7);}(_0xd946,0x98));var _0x6d94=function(_0x43c1c6,_0x5863a3){_0x43c1c6=_0x43c1c6-0x0;var _0x51c1c0=_0xd946[_0x43c1c6];return _0x51c1c0;};'use strict';var multer=require(_0x6d94('0x0'));var util=require('util');var path=require(_0x6d94('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6d94('0x2')]();var fs_extra=require(_0x6d94('0x3'));var auth=require(_0x6d94('0x4'));var interaction=require(_0x6d94('0x5'));var config=require(_0x6d94('0x6'));var controller=require('./cloudProvider.controller');router[_0x6d94('0x7')]('/',auth[_0x6d94('0x8')](),controller['index']);router['get']('/:id',auth[_0x6d94('0x8')](),controller[_0x6d94('0x9')]);router[_0x6d94('0xa')]('/',auth[_0x6d94('0x8')](),controller['create']);router[_0x6d94('0xb')](_0x6d94('0xc'),auth[_0x6d94('0x8')](),controller[_0x6d94('0xd')]);router['delete'](_0x6d94('0xc'),auth[_0x6d94('0x8')](),controller[_0x6d94('0xe')]);module[_0x6d94('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index c43b7d2..ccbdb96 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 _0x357f=['name','sequelize','exports','STRING'];(function(_0xa20571,_0x49a4b9){var _0x16beae=function(_0x402d7d){while(--_0x402d7d){_0xa20571['push'](_0xa20571['shift']());}};_0x16beae(++_0x49a4b9);}(_0x357f,0x99));var _0xf357=function(_0x386297,_0x5bfc15){_0x386297=_0x386297-0x0;var _0x4c051e=_0x357f[_0x386297];return _0x4c051e;};'use strict';var Sequelize=require(_0xf357('0x0'));module[_0xf357('0x1')]={'name':{'type':Sequelize[_0xf357('0x2')],'unique':_0xf357('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xf357('0x2')]},'companyId':{'type':Sequelize[_0xf357('0x2')]},'website':{'type':Sequelize[_0xf357('0x2')]},'phone':{'type':Sequelize[_0xf357('0x2')]},'fax':{'type':Sequelize[_0xf357('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xf357('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xf357('0x2')]},'country':{'type':Sequelize[_0xf357('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xf357('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xf357('0x2')]},'sCountry':{'type':Sequelize[_0xf357('0x2')]},'description':{'type':Sequelize[_0xf357('0x2')]}};
\ No newline at end of file
+var _0xef8b=['exports','STRING','name'];(function(_0x261697,_0x150fe0){var _0x553db6=function(_0x417253){while(--_0x417253){_0x261697['push'](_0x261697['shift']());}};_0x553db6(++_0x150fe0);}(_0xef8b,0x192));var _0xbef8=function(_0x24d24e,_0x4e17a4){_0x24d24e=_0x24d24e-0x0;var _0x20e068=_0xef8b[_0x24d24e];return _0x20e068;};'use strict';var Sequelize=require('sequelize');module[_0xbef8('0x0')]={'name':{'type':Sequelize[_0xbef8('0x1')],'unique':_0xbef8('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xbef8('0x1')]},'companyId':{'type':Sequelize[_0xbef8('0x1')]},'website':{'type':Sequelize[_0xbef8('0x1')]},'phone':{'type':Sequelize[_0xbef8('0x1')]},'fax':{'type':Sequelize[_0xbef8('0x1')]},'type':{'type':Sequelize[_0xbef8('0x1')]},'street':{'type':Sequelize[_0xbef8('0x1')]},'postalCode':{'type':Sequelize[_0xbef8('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xbef8('0x1')]},'email':{'type':Sequelize[_0xbef8('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xbef8('0x1')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xbef8('0x1')]},'sCity':{'type':Sequelize[_0xbef8('0x1')]},'sCountry':{'type':Sequelize['STRING']},'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 e34bd98..6bd8e7b 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 _0xfa3a=['end','json','limit','offset','set','Content-Range','reject','save','update','destroy','then','get','Companies','UserProfileResource','error','stack','name','send','index','CmCompany','describe','keys','query','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','count','includeAll','include','findAll','rows','catch','params','rawAttributes','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','omit','ids','findOne','CmContact','length','getContacts','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x3bf194,_0x342216){var _0x105954=function(_0x40732d){while(--_0x40732d){_0x3bf194['push'](_0x3bf194['shift']());}};_0x105954(++_0x342216);}(_0xfa3a,0x145));var _0xafa3=function(_0x32e59e,_0x252469){_0x32e59e=_0x32e59e-0x0;var _0x4a621d=_0xfa3a[_0x32e59e];return _0x4a621d;};'use strict';var emlformat=require(_0xafa3('0x0'));var rimraf=require(_0xafa3('0x1'));var zipdir=require(_0xafa3('0x2'));var jsonpatch=require(_0xafa3('0x3'));var rp=require(_0xafa3('0x4'));var moment=require(_0xafa3('0x5'));var BPromise=require(_0xafa3('0x6'));var Mustache=require(_0xafa3('0x7'));var util=require('util');var path=require(_0xafa3('0x8'));var sox=require(_0xafa3('0x9'));var csv=require('to-csv');var ejs=require(_0xafa3('0xa'));var fs=require('fs');var fs_extra=require(_0xafa3('0xb'));var _=require(_0xafa3('0xc'));var squel=require(_0xafa3('0xd'));var crypto=require('crypto');var jsforce=require(_0xafa3('0xe'));var deskjs=require(_0xafa3('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xafa3('0x10'));var Redis=require(_0xafa3('0x11'));var authService=require(_0xafa3('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xafa3('0x13'));var hardwareService=require(_0xafa3('0x14'));var logger=require(_0xafa3('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xafa3('0x16'));var licenseUtil=require(_0xafa3('0x17'));var db=require(_0xafa3('0x18'))['db'];function respondWithStatusCode(_0x33fc81,_0x3c9324){_0x3c9324=_0x3c9324||0xcc;return function(_0x2b4ec4){if(_0x2b4ec4){return _0x33fc81[_0xafa3('0x19')](_0x3c9324);}return _0x33fc81[_0xafa3('0x1a')](_0x3c9324)[_0xafa3('0x1b')]();};}function respondWithResult(_0x5ed5bd,_0x168d69){_0x168d69=_0x168d69||0xc8;return function(_0xae981f){if(_0xae981f){return _0x5ed5bd[_0xafa3('0x1a')](_0x168d69)[_0xafa3('0x1c')](_0xae981f);}};}function respondWithFilteredResult(_0x40feef,_0x1d0377){return function(_0x2c8f4f){if(_0x2c8f4f){var _0x4b823f=typeof _0x1d0377['offset']==='undefined'&&typeof _0x1d0377[_0xafa3('0x1d')]==='undefined';var _0x4628b7=_0x2c8f4f['count'];var _0x413e6b=_0x4b823f?0x0:_0x1d0377[_0xafa3('0x1e')];var _0x58a450=_0x4b823f?_0x2c8f4f['count']:_0x1d0377[_0xafa3('0x1e')]+_0x1d0377['limit'];var _0x337dcf;if(_0x58a450>=_0x4628b7){_0x58a450=_0x4628b7;_0x337dcf=0xc8;}else{_0x337dcf=0xce;}_0x40feef[_0xafa3('0x1a')](_0x337dcf);return _0x40feef[_0xafa3('0x1f')](_0xafa3('0x20'),_0x413e6b+'-'+_0x58a450+'/'+_0x4628b7)[_0xafa3('0x1c')](_0x2c8f4f);}return null;};}function patchUpdates(_0x1b0c2c){return function(_0x5bdc4d){try{jsonpatch['apply'](_0x5bdc4d,_0x1b0c2c,!![]);}catch(_0x301d1a){return BPromise[_0xafa3('0x21')](_0x301d1a);}return _0x5bdc4d[_0xafa3('0x22')]();};}function saveUpdates(_0x1f25cf,_0x4ef5e1){return function(_0x3fde81){if(_0x3fde81){return _0x3fde81[_0xafa3('0x23')](_0x1f25cf)['then'](function(_0x21ad2a){return _0x21ad2a;});}return null;};}function removeEntity(_0x5de009,_0x3b80a1){return function(_0x3ed3f1){if(_0x3ed3f1){return _0x3ed3f1[_0xafa3('0x24')]()[_0xafa3('0x25')](function(){var _0x356413=_0x3ed3f1[_0xafa3('0x26')]({'plain':!![]});var _0x4fb2b0=_0xafa3('0x27');return db[_0xafa3('0x28')][_0xafa3('0x24')]({'where':{'type':_0x4fb2b0,'resourceId':_0x356413['id']}})[_0xafa3('0x25')](function(){return _0x3ed3f1;});})['then'](function(){_0x5de009[_0xafa3('0x1a')](0xcc)[_0xafa3('0x1b')]();});}};}function handleEntityNotFound(_0x4b008a,_0x5f41c2){return function(_0x48f2da){if(!_0x48f2da){_0x4b008a[_0xafa3('0x19')](0x194);}return _0x48f2da;};}function handleError(_0x41f9f7,_0xdd4506){_0xdd4506=_0xdd4506||0x1f4;return function(_0x5f2ce2){logger[_0xafa3('0x29')](_0x5f2ce2[_0xafa3('0x2a')]);if(_0x5f2ce2[_0xafa3('0x2b')]){delete _0x5f2ce2['name'];}_0x41f9f7[_0xafa3('0x1a')](_0xdd4506)[_0xafa3('0x2c')](_0x5f2ce2);};}exports[_0xafa3('0x2d')]=function(_0x56d23b,_0x320e6d){var _0x2abd46={},_0x257fa5={},_0x1e9023={'count':0x0,'rows':[]};return db[_0xafa3('0x2e')][_0xafa3('0x2f')]()['then'](function(_0x1b0bb5){_0x257fa5['model']=_[_0xafa3('0x30')](_0x1b0bb5);_0x257fa5[_0xafa3('0x31')]=_[_0xafa3('0x30')](_0x56d23b[_0xafa3('0x31')]);_0x257fa5['filters']=_[_0xafa3('0x32')](_0x257fa5[_0xafa3('0x33')],_0x257fa5[_0xafa3('0x31')]);_0x2abd46['attributes']=_[_0xafa3('0x32')](_0x257fa5['model'],qs[_0xafa3('0x34')](_0x56d23b[_0xafa3('0x31')]['fields']));_0x2abd46[_0xafa3('0x35')]=_0x2abd46[_0xafa3('0x35')]['length']?_0x2abd46[_0xafa3('0x35')]:_0x257fa5['model'];if(!_0x56d23b['query'][_0xafa3('0x36')](_0xafa3('0x37'))){_0x2abd46['limit']=qs[_0xafa3('0x1d')](_0x56d23b[_0xafa3('0x31')][_0xafa3('0x1d')]);_0x2abd46[_0xafa3('0x1e')]=qs['offset'](_0x56d23b[_0xafa3('0x31')][_0xafa3('0x1e')]);}_0x2abd46[_0xafa3('0x38')]=qs[_0xafa3('0x39')](_0x56d23b[_0xafa3('0x31')]['sort']);_0x2abd46[_0xafa3('0x3a')]=qs[_0xafa3('0x3b')](_[_0xafa3('0x3c')](_0x56d23b[_0xafa3('0x31')],_0x257fa5[_0xafa3('0x3b')]),_0x1b0bb5);if(_0x56d23b[_0xafa3('0x31')][_0xafa3('0x3d')]){_0x2abd46['where']=_[_0xafa3('0x3e')](_0x2abd46[_0xafa3('0x3a')],{'$or':_[_0xafa3('0x3f')](_0x2abd46[_0xafa3('0x35')],function(_0x5dbce1){var _0x13da20={};_0x13da20[_0x5dbce1]={'$like':'%'+_0x56d23b[_0xafa3('0x31')]['filter']+'%'};return _0x13da20;})});}_0x2abd46=_['merge']({},_0x2abd46,_0x56d23b['options']);var _0x11d101={'where':_0x2abd46[_0xafa3('0x3a')]};return db[_0xafa3('0x2e')]['count'](_0x11d101)[_0xafa3('0x25')](function(_0x47a2bb){_0x1e9023[_0xafa3('0x40')]=_0x47a2bb;if(_0x56d23b['query'][_0xafa3('0x41')]){_0x2abd46[_0xafa3('0x42')]=[{'all':!![]}];}return db[_0xafa3('0x2e')][_0xafa3('0x43')](_0x2abd46);})['then'](function(_0x1f131e){_0x1e9023[_0xafa3('0x44')]=_0x1f131e;return _0x1e9023;})[_0xafa3('0x25')](respondWithFilteredResult(_0x320e6d,_0x2abd46))[_0xafa3('0x45')](handleError(_0x320e6d,null));})[_0xafa3('0x45')](handleError(_0x320e6d,null));};exports['show']=function(_0x4b5959,_0x5315c1){var _0x1a0163={'raw':![],'where':{'id':_0x4b5959[_0xafa3('0x46')]['id']}},_0x2db8a4={};_0x2db8a4[_0xafa3('0x33')]=_[_0xafa3('0x30')](db[_0xafa3('0x2e')][_0xafa3('0x47')]);_0x2db8a4[_0xafa3('0x31')]=_[_0xafa3('0x30')](_0x4b5959[_0xafa3('0x31')]);_0x2db8a4[_0xafa3('0x3b')]=_[_0xafa3('0x32')](_0x2db8a4['model'],_0x2db8a4[_0xafa3('0x31')]);_0x1a0163['attributes']=_[_0xafa3('0x32')](_0x2db8a4[_0xafa3('0x33')],qs[_0xafa3('0x34')](_0x4b5959['query'][_0xafa3('0x34')]));_0x1a0163[_0xafa3('0x35')]=_0x1a0163[_0xafa3('0x35')]['length']?_0x1a0163[_0xafa3('0x35')]:_0x2db8a4[_0xafa3('0x33')];if(_0x4b5959[_0xafa3('0x31')][_0xafa3('0x41')]){_0x1a0163[_0xafa3('0x42')]=[{'all':!![]}];}_0x1a0163=_[_0xafa3('0x3e')]({},_0x1a0163,_0x4b5959[_0xafa3('0x48')]);return db[_0xafa3('0x2e')][_0xafa3('0x49')](_0x1a0163)[_0xafa3('0x25')](handleEntityNotFound(_0x5315c1,null))[_0xafa3('0x25')](respondWithResult(_0x5315c1,null))[_0xafa3('0x45')](handleError(_0x5315c1,null));};exports[_0xafa3('0x4a')]=function(_0x4efa80,_0x34fc93){return db[_0xafa3('0x2e')]['create'](_0x4efa80[_0xafa3('0x4b')],{})[_0xafa3('0x25')](function(_0x5a48d4){var _0x49acd8=_0x4efa80['user'][_0xafa3('0x26')]({'plain':!![]});if(!_0x49acd8)throw new Error(_0xafa3('0x4c'));if(_0x49acd8[_0xafa3('0x4d')]===_0xafa3('0x4e')){var _0x3a78a8=_0x5a48d4[_0xafa3('0x26')]({'plain':!![]});var _0x2a94d0=_0xafa3('0x27');return db[_0xafa3('0x4f')]['find']({'where':{'name':_0x2a94d0,'userProfileId':_0x49acd8['userProfileId']},'raw':!![]})['then'](function(_0x2ab1e3){if(_0x2ab1e3&&_0x2ab1e3['autoAssociation']===0x0){return db[_0xafa3('0x28')][_0xafa3('0x4a')]({'name':_0x3a78a8[_0xafa3('0x2b')],'resourceId':_0x3a78a8['id'],'type':_0x2ab1e3[_0xafa3('0x2b')],'sectionId':_0x2ab1e3['id']},{})[_0xafa3('0x25')](function(){return _0x5a48d4;});}else{return _0x5a48d4;}})[_0xafa3('0x45')](function(_0x50c799){logger[_0xafa3('0x29')](_0xafa3('0x50'),_0x50c799);throw _0x50c799;});}return _0x5a48d4;})['then'](respondWithResult(_0x34fc93,0xc9))[_0xafa3('0x45')](handleError(_0x34fc93,null));};exports[_0xafa3('0x23')]=function(_0x73676f,_0x27b457){if(_0x73676f[_0xafa3('0x4b')]['id']){delete _0x73676f[_0xafa3('0x4b')]['id'];}return db['CmCompany'][_0xafa3('0x49')]({'where':{'id':_0x73676f['params']['id']}})[_0xafa3('0x25')](handleEntityNotFound(_0x27b457,null))[_0xafa3('0x25')](saveUpdates(_0x73676f['body'],null))[_0xafa3('0x25')](respondWithResult(_0x27b457,null))[_0xafa3('0x45')](handleError(_0x27b457,null));};exports[_0xafa3('0x24')]=function(_0x15cb85,_0x5ef9f6){return db[_0xafa3('0x2e')][_0xafa3('0x49')]({'where':{'id':_0x15cb85[_0xafa3('0x46')]['id']}})[_0xafa3('0x25')](handleEntityNotFound(_0x5ef9f6,null))[_0xafa3('0x25')](removeEntity(_0x5ef9f6,null))['catch'](handleError(_0x5ef9f6,null));};exports[_0xafa3('0x2f')]=function(_0xe813c5,_0x201e59){return db[_0xafa3('0x2e')]['describe']()[_0xafa3('0x25')](respondWithResult(_0x201e59,null))[_0xafa3('0x45')](handleError(_0x201e59,null));};exports[_0xafa3('0x51')]=function(_0x5c09ad,_0x1af878,_0x23ce5d){return db['CmContact'][_0xafa3('0x49')]({'where':{'id':_0x5c09ad['params']['id']}})[_0xafa3('0x25')](handleEntityNotFound(_0x1af878,null))[_0xafa3('0x25')](function(_0x13e4e9){if(_0x13e4e9){return _0x13e4e9[_0xafa3('0x51')](_0x5c09ad[_0xafa3('0x4b')]['ids'],_[_0xafa3('0x52')](_0x5c09ad[_0xafa3('0x4b')],[_0xafa3('0x53'),'id'])||{});}})[_0xafa3('0x25')](respondWithResult(_0x1af878,null))[_0xafa3('0x45')](handleError(_0x1af878,null));};exports['getContacts']=function(_0x25e51c,_0x1b8801,_0x3d7144){var _0x247de5={};var _0x483038={};var _0x388328;var _0x4e1ad6;return db[_0xafa3('0x2e')][_0xafa3('0x54')]({'where':{'id':_0x25e51c[_0xafa3('0x46')]['id']}})[_0xafa3('0x25')](handleEntityNotFound(_0x1b8801,null))[_0xafa3('0x25')](function(_0x4fcbee){if(_0x4fcbee){_0x388328=_0x4fcbee;_0x483038[_0xafa3('0x33')]=_['keys'](db[_0xafa3('0x55')][_0xafa3('0x47')]);_0x483038[_0xafa3('0x31')]=_[_0xafa3('0x30')](_0x25e51c['query']);_0x483038[_0xafa3('0x3b')]=_[_0xafa3('0x32')](_0x483038[_0xafa3('0x33')],_0x483038[_0xafa3('0x31')]);_0x247de5[_0xafa3('0x35')]=_['intersection'](_0x483038[_0xafa3('0x33')],qs[_0xafa3('0x34')](_0x25e51c[_0xafa3('0x31')][_0xafa3('0x34')]));_0x247de5[_0xafa3('0x35')]=_0x247de5[_0xafa3('0x35')][_0xafa3('0x56')]?_0x247de5[_0xafa3('0x35')]:_0x483038['model'];_0x247de5[_0xafa3('0x38')]=qs[_0xafa3('0x39')](_0x25e51c['query'][_0xafa3('0x39')]);_0x247de5['where']=qs['filters'](_['pick'](_0x25e51c[_0xafa3('0x31')],_0x483038[_0xafa3('0x3b')]));if(_0x25e51c[_0xafa3('0x31')][_0xafa3('0x3d')]){_0x247de5[_0xafa3('0x3a')]=_[_0xafa3('0x3e')](_0x247de5[_0xafa3('0x3a')],{'$or':_[_0xafa3('0x3f')](_0x247de5[_0xafa3('0x35')],function(_0x2e9d4e){var _0x18bc4f={};_0x18bc4f[_0x2e9d4e]={'$like':'%'+_0x25e51c[_0xafa3('0x31')][_0xafa3('0x3d')]+'%'};return _0x18bc4f;})});}_0x247de5=_['merge']({},_0x247de5,_0x25e51c[_0xafa3('0x48')]);return _0x388328['getContacts'](_0x247de5);}})[_0xafa3('0x25')](function(_0x2be164){if(_0x2be164){_0x4e1ad6=_0x2be164[_0xafa3('0x56')];if(!_0x25e51c[_0xafa3('0x31')]['hasOwnProperty'](_0xafa3('0x37'))){_0x247de5[_0xafa3('0x1d')]=qs[_0xafa3('0x1d')](_0x25e51c[_0xafa3('0x31')][_0xafa3('0x1d')]);_0x247de5[_0xafa3('0x1e')]=qs['offset'](_0x25e51c[_0xafa3('0x31')][_0xafa3('0x1e')]);}return _0x388328[_0xafa3('0x57')](_0x247de5);}})[_0xafa3('0x25')](function(_0xdeeda6){if(_0xdeeda6){return _0xdeeda6?{'count':_0x4e1ad6,'rows':_0xdeeda6}:null;}})[_0xafa3('0x25')](respondWithResult(_0x1b8801,null))[_0xafa3('0x45')](handleError(_0x1b8801,null));};
\ No newline at end of file
+var _0x4bf5=['UserProfileResource','end','error','name','send','index','CmCompany','describe','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','map','merge','options','includeAll','include','catch','show','params','rawAttributes','length','find','create','user','Companies','UserProfileSection','autoAssociation','body','CmContact','ids','getContacts','findOne','nolimit','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get'];(function(_0x2405bc,_0x2f28a1){var _0x5272d4=function(_0x225294){while(--_0x225294){_0x2405bc['push'](_0x2405bc['shift']());}};_0x5272d4(++_0x2f28a1);}(_0x4bf5,0xcd));var _0x54bf=function(_0x180c9b,_0x13d173){_0x180c9b=_0x180c9b-0x0;var _0x3ff116=_0x4bf5[_0x180c9b];return _0x3ff116;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x54bf('0x0'));var zipdir=require(_0x54bf('0x1'));var jsonpatch=require(_0x54bf('0x2'));var rp=require(_0x54bf('0x3'));var moment=require('moment');var BPromise=require(_0x54bf('0x4'));var Mustache=require(_0x54bf('0x5'));var util=require(_0x54bf('0x6'));var path=require(_0x54bf('0x7'));var sox=require(_0x54bf('0x8'));var csv=require(_0x54bf('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x54bf('0xa'));var _=require(_0x54bf('0xb'));var squel=require('squel');var crypto=require(_0x54bf('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x54bf('0xd'));var toCsv=require('to-csv');var querystring=require(_0x54bf('0xe'));var Papa=require(_0x54bf('0xf'));var Redis=require(_0x54bf('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x54bf('0x11'));var as=require(_0x54bf('0x12'));var hardwareService=require(_0x54bf('0x13'));var logger=require(_0x54bf('0x14'))(_0x54bf('0x15'));var utils=require('../../config/utils');var config=require(_0x54bf('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5a077d,_0x295856){_0x295856=_0x295856||0xcc;return function(_0x9d3828){if(_0x9d3828){return _0x5a077d[_0x54bf('0x17')](_0x295856);}return _0x5a077d['status'](_0x295856)['end']();};}function respondWithResult(_0x290dca,_0x1cdf71){_0x1cdf71=_0x1cdf71||0xc8;return function(_0x16585e){if(_0x16585e){return _0x290dca[_0x54bf('0x18')](_0x1cdf71)[_0x54bf('0x19')](_0x16585e);}};}function respondWithFilteredResult(_0x2159cc,_0x2731ea){return function(_0x4ac673){if(_0x4ac673){var _0xf37633=typeof _0x2731ea[_0x54bf('0x1a')]===_0x54bf('0x1b')&&typeof _0x2731ea[_0x54bf('0x1c')]===_0x54bf('0x1b');var _0x13f294=_0x4ac673[_0x54bf('0x1d')];var _0x1d1251=_0xf37633?0x0:_0x2731ea[_0x54bf('0x1a')];var _0x246cbc=_0xf37633?_0x4ac673[_0x54bf('0x1d')]:_0x2731ea[_0x54bf('0x1a')]+_0x2731ea['limit'];var _0x5e5033;if(_0x246cbc>=_0x13f294){_0x246cbc=_0x13f294;_0x5e5033=0xc8;}else{_0x5e5033=0xce;}_0x2159cc[_0x54bf('0x18')](_0x5e5033);return _0x2159cc[_0x54bf('0x1e')](_0x54bf('0x1f'),_0x1d1251+'-'+_0x246cbc+'/'+_0x13f294)['json'](_0x4ac673);}return null;};}function patchUpdates(_0x5bfd1c){return function(_0x5d8c5b){try{jsonpatch['apply'](_0x5d8c5b,_0x5bfd1c,!![]);}catch(_0x31e49d){return BPromise[_0x54bf('0x20')](_0x31e49d);}return _0x5d8c5b[_0x54bf('0x21')]();};}function saveUpdates(_0x4e127a,_0x724d43){return function(_0x5f3e5b){if(_0x5f3e5b){return _0x5f3e5b[_0x54bf('0x22')](_0x4e127a)[_0x54bf('0x23')](function(_0x394d18){return _0x394d18;});}return null;};}function removeEntity(_0x4a7020,_0x188362){return function(_0x5dbe92){if(_0x5dbe92){return _0x5dbe92[_0x54bf('0x24')]()[_0x54bf('0x23')](function(){var _0xcc5631=_0x5dbe92[_0x54bf('0x25')]({'plain':!![]});var _0x3cc16f='Companies';return db[_0x54bf('0x26')][_0x54bf('0x24')]({'where':{'type':_0x3cc16f,'resourceId':_0xcc5631['id']}})[_0x54bf('0x23')](function(){return _0x5dbe92;});})[_0x54bf('0x23')](function(){_0x4a7020[_0x54bf('0x18')](0xcc)[_0x54bf('0x27')]();});}};}function handleEntityNotFound(_0x323a96,_0x4c51b8){return function(_0x19a7a8){if(!_0x19a7a8){_0x323a96[_0x54bf('0x17')](0x194);}return _0x19a7a8;};}function handleError(_0x44113f,_0x2a7aa6){_0x2a7aa6=_0x2a7aa6||0x1f4;return function(_0x1aa607){logger[_0x54bf('0x28')](_0x1aa607['stack']);if(_0x1aa607[_0x54bf('0x29')]){delete _0x1aa607[_0x54bf('0x29')];}_0x44113f[_0x54bf('0x18')](_0x2a7aa6)[_0x54bf('0x2a')](_0x1aa607);};}exports[_0x54bf('0x2b')]=function(_0x5a3ee7,_0xda5840){var _0x3da3b1={},_0x4b60d1={},_0x1f49e5={'count':0x0,'rows':[]};return db[_0x54bf('0x2c')][_0x54bf('0x2d')]()[_0x54bf('0x23')](function(_0x37613f){_0x4b60d1['model']=_[_0x54bf('0x2e')](_0x37613f);_0x4b60d1[_0x54bf('0x2f')]=_[_0x54bf('0x2e')](_0x5a3ee7[_0x54bf('0x2f')]);_0x4b60d1[_0x54bf('0x30')]=_[_0x54bf('0x31')](_0x4b60d1[_0x54bf('0x32')],_0x4b60d1['query']);_0x3da3b1[_0x54bf('0x33')]=_['intersection'](_0x4b60d1[_0x54bf('0x32')],qs[_0x54bf('0x34')](_0x5a3ee7[_0x54bf('0x2f')][_0x54bf('0x34')]));_0x3da3b1[_0x54bf('0x33')]=_0x3da3b1['attributes']['length']?_0x3da3b1[_0x54bf('0x33')]:_0x4b60d1[_0x54bf('0x32')];if(!_0x5a3ee7[_0x54bf('0x2f')][_0x54bf('0x35')]('nolimit')){_0x3da3b1[_0x54bf('0x1c')]=qs[_0x54bf('0x1c')](_0x5a3ee7['query'][_0x54bf('0x1c')]);_0x3da3b1['offset']=qs[_0x54bf('0x1a')](_0x5a3ee7['query']['offset']);}_0x3da3b1[_0x54bf('0x36')]=qs['sort'](_0x5a3ee7[_0x54bf('0x2f')][_0x54bf('0x37')]);_0x3da3b1[_0x54bf('0x38')]=qs[_0x54bf('0x30')](_[_0x54bf('0x39')](_0x5a3ee7['query'],_0x4b60d1[_0x54bf('0x30')]),_0x37613f);if(_0x5a3ee7[_0x54bf('0x2f')][_0x54bf('0x3a')]){_0x3da3b1[_0x54bf('0x38')]=_['merge'](_0x3da3b1[_0x54bf('0x38')],{'$or':_[_0x54bf('0x3b')](_0x3da3b1[_0x54bf('0x33')],function(_0x5d9cdf){var _0x3e8650={};_0x3e8650[_0x5d9cdf]={'$like':'%'+_0x5a3ee7['query']['filter']+'%'};return _0x3e8650;})});}_0x3da3b1=_[_0x54bf('0x3c')]({},_0x3da3b1,_0x5a3ee7[_0x54bf('0x3d')]);var _0x1c8d8d={'where':_0x3da3b1['where']};return db[_0x54bf('0x2c')]['count'](_0x1c8d8d)[_0x54bf('0x23')](function(_0xa3f48e){_0x1f49e5['count']=_0xa3f48e;if(_0x5a3ee7[_0x54bf('0x2f')][_0x54bf('0x3e')]){_0x3da3b1[_0x54bf('0x3f')]=[{'all':!![]}];}return db['CmCompany']['findAll'](_0x3da3b1);})[_0x54bf('0x23')](function(_0x3c069d){_0x1f49e5['rows']=_0x3c069d;return _0x1f49e5;})[_0x54bf('0x23')](respondWithFilteredResult(_0xda5840,_0x3da3b1))[_0x54bf('0x40')](handleError(_0xda5840,null));})['catch'](handleError(_0xda5840,null));};exports[_0x54bf('0x41')]=function(_0x4b3d2c,_0x2375ee){var _0x14e7cc={'raw':![],'where':{'id':_0x4b3d2c[_0x54bf('0x42')]['id']}},_0x5e629f={};_0x5e629f[_0x54bf('0x32')]=_[_0x54bf('0x2e')](db[_0x54bf('0x2c')][_0x54bf('0x43')]);_0x5e629f['query']=_[_0x54bf('0x2e')](_0x4b3d2c[_0x54bf('0x2f')]);_0x5e629f['filters']=_[_0x54bf('0x31')](_0x5e629f[_0x54bf('0x32')],_0x5e629f[_0x54bf('0x2f')]);_0x14e7cc[_0x54bf('0x33')]=_[_0x54bf('0x31')](_0x5e629f[_0x54bf('0x32')],qs[_0x54bf('0x34')](_0x4b3d2c['query'][_0x54bf('0x34')]));_0x14e7cc[_0x54bf('0x33')]=_0x14e7cc[_0x54bf('0x33')][_0x54bf('0x44')]?_0x14e7cc[_0x54bf('0x33')]:_0x5e629f['model'];if(_0x4b3d2c[_0x54bf('0x2f')][_0x54bf('0x3e')]){_0x14e7cc[_0x54bf('0x3f')]=[{'all':!![]}];}_0x14e7cc=_[_0x54bf('0x3c')]({},_0x14e7cc,_0x4b3d2c[_0x54bf('0x3d')]);return db[_0x54bf('0x2c')][_0x54bf('0x45')](_0x14e7cc)[_0x54bf('0x23')](handleEntityNotFound(_0x2375ee,null))[_0x54bf('0x23')](respondWithResult(_0x2375ee,null))[_0x54bf('0x40')](handleError(_0x2375ee,null));};exports[_0x54bf('0x46')]=function(_0x1f4116,_0x5d5f4d){return db['CmCompany'][_0x54bf('0x46')](_0x1f4116['body'],{})[_0x54bf('0x23')](function(_0x4d59c6){var _0x576277=_0x1f4116[_0x54bf('0x47')][_0x54bf('0x25')]({'plain':!![]});if(!_0x576277)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x576277['role']==='user'){var _0x4c25e7=_0x4d59c6[_0x54bf('0x25')]({'plain':!![]});var _0x42bbfc=_0x54bf('0x48');return db[_0x54bf('0x49')][_0x54bf('0x45')]({'where':{'name':_0x42bbfc,'userProfileId':_0x576277['userProfileId']},'raw':!![]})[_0x54bf('0x23')](function(_0x352f31){if(_0x352f31&&_0x352f31[_0x54bf('0x4a')]===0x0){return db[_0x54bf('0x26')][_0x54bf('0x46')]({'name':_0x4c25e7[_0x54bf('0x29')],'resourceId':_0x4c25e7['id'],'type':_0x352f31[_0x54bf('0x29')],'sectionId':_0x352f31['id']},{})['then'](function(){return _0x4d59c6;});}else{return _0x4d59c6;}})['catch'](function(_0x551f63){logger[_0x54bf('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x551f63);throw _0x551f63;});}return _0x4d59c6;})[_0x54bf('0x23')](respondWithResult(_0x5d5f4d,0xc9))['catch'](handleError(_0x5d5f4d,null));};exports[_0x54bf('0x22')]=function(_0x2302fd,_0x26a6d6){if(_0x2302fd[_0x54bf('0x4b')]['id']){delete _0x2302fd[_0x54bf('0x4b')]['id'];}return db['CmCompany']['find']({'where':{'id':_0x2302fd[_0x54bf('0x42')]['id']}})['then'](handleEntityNotFound(_0x26a6d6,null))[_0x54bf('0x23')](saveUpdates(_0x2302fd['body'],null))['then'](respondWithResult(_0x26a6d6,null))[_0x54bf('0x40')](handleError(_0x26a6d6,null));};exports[_0x54bf('0x24')]=function(_0x30f68f,_0x1f5f79){return db[_0x54bf('0x2c')][_0x54bf('0x45')]({'where':{'id':_0x30f68f[_0x54bf('0x42')]['id']}})[_0x54bf('0x23')](handleEntityNotFound(_0x1f5f79,null))[_0x54bf('0x23')](removeEntity(_0x1f5f79,null))[_0x54bf('0x40')](handleError(_0x1f5f79,null));};exports[_0x54bf('0x2d')]=function(_0x32a64c,_0x42a276){return db[_0x54bf('0x2c')][_0x54bf('0x2d')]()['then'](respondWithResult(_0x42a276,null))['catch'](handleError(_0x42a276,null));};exports['addContacts']=function(_0x4c6587,_0x14d17f,_0x542b31){return db[_0x54bf('0x4c')][_0x54bf('0x45')]({'where':{'id':_0x4c6587[_0x54bf('0x42')]['id']}})['then'](handleEntityNotFound(_0x14d17f,null))[_0x54bf('0x23')](function(_0x37411d){if(_0x37411d){return _0x37411d['addContacts'](_0x4c6587[_0x54bf('0x4b')]['ids'],_['omit'](_0x4c6587[_0x54bf('0x4b')],[_0x54bf('0x4d'),'id'])||{});}})['then'](respondWithResult(_0x14d17f,null))['catch'](handleError(_0x14d17f,null));};exports[_0x54bf('0x4e')]=function(_0x1887f0,_0x4b516b,_0x367e7c){var _0x18058a={};var _0x3fcf0e={};var _0x462f64;var _0x133fb7;return db[_0x54bf('0x2c')][_0x54bf('0x4f')]({'where':{'id':_0x1887f0[_0x54bf('0x42')]['id']}})['then'](handleEntityNotFound(_0x4b516b,null))['then'](function(_0x2aac5c){if(_0x2aac5c){_0x462f64=_0x2aac5c;_0x3fcf0e[_0x54bf('0x32')]=_[_0x54bf('0x2e')](db['CmContact']['rawAttributes']);_0x3fcf0e['query']=_[_0x54bf('0x2e')](_0x1887f0[_0x54bf('0x2f')]);_0x3fcf0e[_0x54bf('0x30')]=_[_0x54bf('0x31')](_0x3fcf0e['model'],_0x3fcf0e['query']);_0x18058a[_0x54bf('0x33')]=_[_0x54bf('0x31')](_0x3fcf0e[_0x54bf('0x32')],qs['fields'](_0x1887f0['query']['fields']));_0x18058a['attributes']=_0x18058a[_0x54bf('0x33')]['length']?_0x18058a[_0x54bf('0x33')]:_0x3fcf0e[_0x54bf('0x32')];_0x18058a[_0x54bf('0x36')]=qs['sort'](_0x1887f0[_0x54bf('0x2f')]['sort']);_0x18058a['where']=qs['filters'](_['pick'](_0x1887f0[_0x54bf('0x2f')],_0x3fcf0e[_0x54bf('0x30')]));if(_0x1887f0['query']['filter']){_0x18058a[_0x54bf('0x38')]=_['merge'](_0x18058a[_0x54bf('0x38')],{'$or':_[_0x54bf('0x3b')](_0x18058a[_0x54bf('0x33')],function(_0x3e1af9){var _0x4934fb={};_0x4934fb[_0x3e1af9]={'$like':'%'+_0x1887f0[_0x54bf('0x2f')]['filter']+'%'};return _0x4934fb;})});}_0x18058a=_['merge']({},_0x18058a,_0x1887f0['options']);return _0x462f64['getContacts'](_0x18058a);}})[_0x54bf('0x23')](function(_0x1c4603){if(_0x1c4603){_0x133fb7=_0x1c4603[_0x54bf('0x44')];if(!_0x1887f0[_0x54bf('0x2f')]['hasOwnProperty'](_0x54bf('0x50'))){_0x18058a['limit']=qs['limit'](_0x1887f0[_0x54bf('0x2f')][_0x54bf('0x1c')]);_0x18058a[_0x54bf('0x1a')]=qs['offset'](_0x1887f0[_0x54bf('0x2f')][_0x54bf('0x1a')]);}return _0x462f64[_0x54bf('0x4e')](_0x18058a);}})[_0x54bf('0x23')](function(_0xcf1df){if(_0xcf1df){return _0xcf1df?{'count':_0x133fb7,'rows':_0xcf1df}:null;}})[_0x54bf('0x23')](respondWithResult(_0x4b516b,null))['catch'](handleError(_0x4b516b,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 81dc3b5..151ec99 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 _0xbc6d=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','define','lodash','util','../../config/logger'];(function(_0x4b125d,_0x3dc671){var _0x535ead=function(_0x1e9b7e){while(--_0x1e9b7e){_0x4b125d['push'](_0x4b125d['shift']());}};_0x535ead(++_0x3dc671);}(_0xbc6d,0x189));var _0xdbc6=function(_0x5d82d9,_0x3d7694){_0x5d82d9=_0x5d82d9-0x0;var _0x3dfd86=_0xbc6d[_0x5d82d9];return _0x3dfd86;};'use strict';var _=require(_0xdbc6('0x0'));var util=require(_0xdbc6('0x1'));var logger=require(_0xdbc6('0x2'))(_0xdbc6('0x3'));var moment=require(_0xdbc6('0x4'));var BPromise=require(_0xdbc6('0x5'));var rp=require(_0xdbc6('0x6'));var fs=require('fs');var path=require(_0xdbc6('0x7'));var rimraf=require(_0xdbc6('0x8'));var config=require(_0xdbc6('0x9'));var attributes=require(_0xdbc6('0xa'));module['exports']=function(_0x190fdd,_0x3a9ebb){return _0x190fdd[_0xdbc6('0xb')]('CmCompany',attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x63c6=['lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','cm_companies'];(function(_0x5e7979,_0x4175c0){var _0x50f569=function(_0x184fa4){while(--_0x184fa4){_0x5e7979['push'](_0x5e7979['shift']());}};_0x50f569(++_0x4175c0);}(_0x63c6,0xf0));var _0x663c=function(_0x4503a1,_0xb44ea){_0x4503a1=_0x4503a1-0x0;var _0x4e0b58=_0x63c6[_0x4503a1];return _0x4e0b58;};'use strict';var _=require(_0x663c('0x0'));var util=require(_0x663c('0x1'));var logger=require('../../config/logger')(_0x663c('0x2'));var moment=require(_0x663c('0x3'));var BPromise=require(_0x663c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x663c('0x5'));var rimraf=require(_0x663c('0x6'));var config=require(_0x663c('0x7'));var attributes=require(_0x663c('0x8'));module[_0x663c('0x9')]=function(_0x2c2c4e,_0x461111){return _0x2c2c4e[_0x663c('0xa')]('CmCompany',attributes,{'tableName':_0x663c('0xb'),'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 ef7e702..5643399 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 _0x8af7=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message','info','lodash','util'];(function(_0x136290,_0x3e6b8f){var _0x290e92=function(_0x4095d6){while(--_0x4095d6){_0x136290['push'](_0x136290['shift']());}};_0x290e92(++_0x3e6b8f);}(_0x8af7,0x141));var _0x78af=function(_0x2e9921,_0x35501a){_0x2e9921=_0x2e9921-0x0;var _0x44575a=_0x8af7[_0x2e9921];return _0x44575a;};'use strict';var _=require(_0x78af('0x0'));var util=require(_0x78af('0x1'));var moment=require(_0x78af('0x2'));var BPromise=require(_0x78af('0x3'));var rs=require(_0x78af('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x78af('0x5'))['db'];var utils=require(_0x78af('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x78af('0x7'));var jayson=require(_0x78af('0x8'));var client=jayson[_0x78af('0x9')][_0x78af('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x222a7a,_0x25f854,_0x4b813e){return new BPromise(function(_0x43b884,_0x28f212){return client['request'](_0x222a7a,_0x4b813e)[_0x78af('0xb')](function(_0x28e2f6){logger['info'](_0x78af('0xc'),_0x25f854,'request\x20sent');logger[_0x78af('0xd')](_0x78af('0xe'),_0x25f854,'request\x20sent',JSON[_0x78af('0xf')](_0x28e2f6));if(_0x28e2f6[_0x78af('0x10')]){if(_0x28e2f6[_0x78af('0x10')]['code']===0x1f4){logger[_0x78af('0x10')](_0x78af('0xc'),_0x25f854,_0x28e2f6[_0x78af('0x10')][_0x78af('0x11')]);return _0x28f212(_0x28e2f6[_0x78af('0x10')][_0x78af('0x11')]);}logger[_0x78af('0x10')](_0x78af('0xc'),_0x25f854,_0x28e2f6[_0x78af('0x10')][_0x78af('0x11')]);return _0x43b884(_0x28e2f6[_0x78af('0x10')]['message']);}else{logger[_0x78af('0x12')](_0x78af('0xc'),_0x25f854,'request\x20sent');_0x43b884(_0x28e2f6['result']['message']);}})['catch'](function(_0x1c48c1){logger['error'](_0x78af('0xc'),_0x25f854,_0x1c48c1);_0x28f212(_0x1c48c1);});});}
\ No newline at end of file
+var _0x9a6b=['CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','CmCompany,\x20%s,\x20%s','debug'];(function(_0x3c00fa,_0x5b8d3b){var _0x5bdf86=function(_0x5518af){while(--_0x5518af){_0x3c00fa['push'](_0x3c00fa['shift']());}};_0x5bdf86(++_0x5b8d3b);}(_0x9a6b,0x92));var _0xb9a6=function(_0x24c0a3,_0x443029){_0x24c0a3=_0x24c0a3-0x0;var _0xd4cfbb=_0x9a6b[_0x24c0a3];return _0xd4cfbb;};'use strict';var _=require('lodash');var util=require(_0xb9a6('0x0'));var moment=require(_0xb9a6('0x1'));var BPromise=require(_0xb9a6('0x2'));var rs=require(_0xb9a6('0x3'));var fs=require('fs');var Redis=require(_0xb9a6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb9a6('0x5'));var logger=require(_0xb9a6('0x6'))('rpc');var config=require(_0xb9a6('0x7'));var jayson=require(_0xb9a6('0x8'));var client=jayson[_0xb9a6('0x9')][_0xb9a6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x58a3c5,_0x5eefc3,_0x5a7cd1){return new BPromise(function(_0xa7669c,_0xbb6163){return client[_0xb9a6('0xb')](_0x58a3c5,_0x5a7cd1)[_0xb9a6('0xc')](function(_0x49776f){logger['info'](_0xb9a6('0xd'),_0x5eefc3,'request\x20sent');logger[_0xb9a6('0xe')](_0xb9a6('0xf'),_0x5eefc3,_0xb9a6('0x10'),JSON[_0xb9a6('0x11')](_0x49776f));if(_0x49776f[_0xb9a6('0x12')]){if(_0x49776f[_0xb9a6('0x12')][_0xb9a6('0x13')]===0x1f4){logger['error']('CmCompany,\x20%s,\x20%s',_0x5eefc3,_0x49776f[_0xb9a6('0x12')][_0xb9a6('0x14')]);return _0xbb6163(_0x49776f[_0xb9a6('0x12')][_0xb9a6('0x14')]);}logger[_0xb9a6('0x12')]('CmCompany,\x20%s,\x20%s',_0x5eefc3,_0x49776f[_0xb9a6('0x12')]['message']);return _0xa7669c(_0x49776f[_0xb9a6('0x12')][_0xb9a6('0x14')]);}else{logger[_0xb9a6('0x15')]('CmCompany,\x20%s,\x20%s',_0x5eefc3,'request\x20sent');_0xa7669c(_0x49776f[_0xb9a6('0x16')][_0xb9a6('0x14')]);}})['catch'](function(_0x3f824a){logger[_0xb9a6('0x12')](_0xb9a6('0xd'),_0x5eefc3,_0x3f824a);_0xbb6163(_0x3f824a);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index d1d6e70..4903a3e 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 _0xe455=['./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/contacts','getContacts','post','addContacts','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5e0531,_0x4537b9){var _0xce690a=function(_0x2f015f){while(--_0x2f015f){_0x5e0531['push'](_0x5e0531['shift']());}};_0xce690a(++_0x4537b9);}(_0xe455,0xad));var _0x5e45=function(_0x30be10,_0x374300){_0x30be10=_0x30be10-0x0;var _0x3b379f=_0xe455[_0x30be10];return _0x3b379f;};'use strict';var multer=require(_0x5e45('0x0'));var util=require(_0x5e45('0x1'));var path=require('path');var timeout=require(_0x5e45('0x2'));var express=require(_0x5e45('0x3'));var router=express[_0x5e45('0x4')]();var fs_extra=require(_0x5e45('0x5'));var auth=require(_0x5e45('0x6'));var interaction=require(_0x5e45('0x7'));var config=require(_0x5e45('0x8'));var controller=require(_0x5e45('0x9'));router[_0x5e45('0xa')]('/',auth[_0x5e45('0xb')](),controller[_0x5e45('0xc')]);router[_0x5e45('0xa')](_0x5e45('0xd'),auth[_0x5e45('0xb')](),controller[_0x5e45('0xe')]);router[_0x5e45('0xa')](_0x5e45('0xf'),auth[_0x5e45('0xb')](),controller[_0x5e45('0x10')]);router['get'](_0x5e45('0x11'),auth['isAuthenticated'](),controller[_0x5e45('0x12')]);router[_0x5e45('0x13')]('/',auth[_0x5e45('0xb')](),controller['create']);router[_0x5e45('0x13')](_0x5e45('0x11'),auth[_0x5e45('0xb')](),controller[_0x5e45('0x14')]);router[_0x5e45('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x5e45('0x16')]);router[_0x5e45('0x17')](_0x5e45('0xf'),auth[_0x5e45('0xb')](),controller[_0x5e45('0x18')]);module[_0x5e45('0x19')]=router;
\ No newline at end of file
+var _0xf3bb=['exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/contacts','getContacts','post','addContacts','put','delete','destroy'];(function(_0x271507,_0x2b5210){var _0xd2da30=function(_0x499da1){while(--_0x499da1){_0x271507['push'](_0x271507['shift']());}};_0xd2da30(++_0x2b5210);}(_0xf3bb,0x15a));var _0xbf3b=function(_0xecddb9,_0x15e35e){_0xecddb9=_0xecddb9-0x0;var _0x34b872=_0xf3bb[_0xecddb9];return _0x34b872;};'use strict';var multer=require(_0xbf3b('0x0'));var util=require(_0xbf3b('0x1'));var path=require(_0xbf3b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xbf3b('0x3'));var auth=require(_0xbf3b('0x4'));var interaction=require(_0xbf3b('0x5'));var config=require(_0xbf3b('0x6'));var controller=require(_0xbf3b('0x7'));router[_0xbf3b('0x8')]('/',auth['isAuthenticated'](),controller[_0xbf3b('0x9')]);router[_0xbf3b('0x8')](_0xbf3b('0xa'),auth[_0xbf3b('0xb')](),controller[_0xbf3b('0xc')]);router[_0xbf3b('0x8')](_0xbf3b('0xd'),auth[_0xbf3b('0xb')](),controller[_0xbf3b('0xe')]);router['get'](_0xbf3b('0xf'),auth[_0xbf3b('0xb')](),controller[_0xbf3b('0x10')]);router[_0xbf3b('0x11')]('/',auth[_0xbf3b('0xb')](),controller['create']);router[_0xbf3b('0x11')](_0xbf3b('0xf'),auth[_0xbf3b('0xb')](),controller[_0xbf3b('0x12')]);router[_0xbf3b('0x13')](_0xbf3b('0xd'),auth[_0xbf3b('0xb')](),controller['update']);router[_0xbf3b('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xbf3b('0x15')]);module[_0xbf3b('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 3afea2f..524b980 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 _0xca9e=['exports','STRING','TEXT','INTEGER','UNSIGNED','NOW','lodash','sequelize'];(function(_0x2d73da,_0x4e9643){var _0x2d06af=function(_0x2f5810){while(--_0x2f5810){_0x2d73da['push'](_0x2d73da['shift']());}};_0x2d06af(++_0x4e9643);}(_0xca9e,0x136));var _0xeca9=function(_0x1fc62f,_0x547477){_0x1fc62f=_0x1fc62f-0x0;var _0x2cb919=_0xca9e[_0x1fc62f];return _0x2cb919;};'use strict';var _=require(_0xeca9('0x0'));var Sequelize=require(_0xeca9('0x1'));module[_0xeca9('0x2')]={'firstName':{'type':Sequelize[_0xeca9('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xeca9('0x3')]},'street':{'type':Sequelize[_0xeca9('0x3')]},'postalCode':{'type':Sequelize[_0xeca9('0x3')]},'city':{'type':Sequelize[_0xeca9('0x3')]},'country':{'type':Sequelize[_0xeca9('0x3')]},'dateOfBirth':{'type':Sequelize[_0xeca9('0x3')]},'description':{'type':Sequelize[_0xeca9('0x4')]},'phone':{'type':Sequelize[_0xeca9('0x3')]},'mobile':{'type':Sequelize[_0xeca9('0x3')]},'fax':{'type':Sequelize[_0xeca9('0x3')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0xeca9('0x3')]},'facebook':{'type':Sequelize[_0xeca9('0x3')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0xeca9('0x3')]},'teams':{'type':Sequelize[_0xeca9('0x3')]},'viber':{'type':Sequelize[_0xeca9('0x3')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0xeca9('0x3')]},'telegram':{'type':Sequelize[_0xeca9('0x3')]},'UserId':{'type':Sequelize[_0xeca9('0x5')]},'AdditionalPhones':{'type':Sequelize[_0xeca9('0x3')]},'priority':{'type':Sequelize[_0xeca9('0x5')](0x2)[_0xeca9('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0xeca9('0x7')]}};
\ No newline at end of file
+var _0xc0a4=['STRING','INTEGER','UNSIGNED','DATE','NOW','sequelize','exports'];(function(_0x302f9b,_0x57fd3e){var _0x4b7c81=function(_0x239046){while(--_0x239046){_0x302f9b['push'](_0x302f9b['shift']());}};_0x4b7c81(++_0x57fd3e);}(_0xc0a4,0x147));var _0x4c0a=function(_0x1ab88a,_0x4a27dc){_0x1ab88a=_0x1ab88a-0x0;var _0x56b695=_0xc0a4[_0x1ab88a];return _0x56b695;};'use strict';var _=require('lodash');var Sequelize=require(_0x4c0a('0x0'));module[_0x4c0a('0x1')]={'firstName':{'type':Sequelize[_0x4c0a('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x4c0a('0x2')]},'postalCode':{'type':Sequelize[_0x4c0a('0x2')]},'city':{'type':Sequelize[_0x4c0a('0x2')]},'country':{'type':Sequelize[_0x4c0a('0x2')]},'dateOfBirth':{'type':Sequelize[_0x4c0a('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x4c0a('0x2')]},'mobile':{'type':Sequelize[_0x4c0a('0x2')]},'fax':{'type':Sequelize[_0x4c0a('0x2')]},'email':{'type':Sequelize[_0x4c0a('0x2')]},'url':{'type':Sequelize[_0x4c0a('0x2')]},'facebook':{'type':Sequelize[_0x4c0a('0x2')]},'fb_data':{'type':Sequelize[_0x4c0a('0x2')]},'twitter':{'type':Sequelize[_0x4c0a('0x2')]},'skype':{'type':Sequelize[_0x4c0a('0x2')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x4c0a('0x2')]},'line':{'type':Sequelize[_0x4c0a('0x2')]},'wechat':{'type':Sequelize[_0x4c0a('0x2')]},'telegram':{'type':Sequelize[_0x4c0a('0x2')]},'UserId':{'type':Sequelize[_0x4c0a('0x3')]},'AdditionalPhones':{'type':Sequelize[_0x4c0a('0x2')]},'priority':{'type':Sequelize[_0x4c0a('0x3')](0x2)[_0x4c0a('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x4c0a('0x5')],'defaultValue':Sequelize[_0x4c0a('0x6')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 6834242..46b46fd 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 _0xe3d4=['agent','getLists','c.ListId\x20IS\x20NULL','ListId','sequelize','toString','keyBy','merge','CmContact','c.firstName','c.lastName','c.phone','c.mobile','c.email','c.ListId','c.deletedAt','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','destroy','describe','tags','columnName','displayName','CmCustomField','findAll','alias','values','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','body','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','create','ChatMessage','ChatOfflineMessage','MailInteraction','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperHistory','VoiceCallReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','additionalPhones','each','duplicates','$or','findOrCreate','spread','contact','show','params','CmContactHasItem','Phones','ContactItemType','ItemType','literal','`Phones.ItemType`.OrderBy','log','$and','format','cf_%d','pickBy','setFields','id\x20=\x20?','toParam','phone','getTags','rawAttributes','options','setTags','ids','setAdditionalPhones','item_types','items','ItemTypeId','description','PHONE','OrderBy','CmHopperId','ItemType.OrderBy','CmHopperAdditionalPhone','bulkCreate','getAdditionalPhones','`ItemType`.OrderBy','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','hopperId','getHoppers','ContactId','includeAll','include','getHopperHistories','getHopperFinals','CmHopperFinal','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','zipObject','No\x20firstName\x20column\x20specified','join','file','filename','chmodSync','child_process','fork','CompanyId','File\x20uploaded\x20correctly!','pid','send','upload','createReadStream','parse','meta','import','binding','No\x20phone\x20column\x20specified','firstName','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','../../components/import/cm/csvUpdates','getJourney','mail','chat','sms','whatsapp','voice','resolve','channel','includes','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','destination','endtime','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','findAndCountAll','get','startCase','closed','closedAt','disposition','secondDisposition','thirdDisposition','Account','key','Owner','browserName','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingType','ratingValue','referer','subject','substatus','openchannel','threadId','Interaction','flatten','reverse','slice','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','reject','save','update','then','error','name','index','length','startsWith','cf_','push','findOne','trimStart','all','fieldType','type','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','select','field','color','tools_tags','from','cm_contacts','cm_user_has_contacts','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','find','Tag','split','map','union','User','and','uc.UserId\x20=\x20?','value','datetime','castTo','DATE','buildExpression','text','filter','isNil','Contact','forEach','c.ListId\x20IN\x20?','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','QueryTypes','SELECT','DESC','isEmpty','t.id\x20IN\x20?','user','role'];(function(_0x44f39d,_0x1d05df){var _0x295cdf=function(_0x563147){while(--_0x563147){_0x44f39d['push'](_0x44f39d['shift']());}};_0x295cdf(++_0x1d05df);}(_0xe3d4,0xc6));var _0x4e3d=function(_0x231a47,_0x46a963){_0x231a47=_0x231a47-0x0;var _0x48d7c9=_0xe3d4[_0x231a47];return _0x48d7c9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4e3d('0x0'));var zipdir=require(_0x4e3d('0x1'));var jsonpatch=require(_0x4e3d('0x2'));var rp=require('request-promise');var moment=require(_0x4e3d('0x3'));var BPromise=require(_0x4e3d('0x4'));var Mustache=require('mustache');var util=require(_0x4e3d('0x5'));var path=require('path');var sox=require(_0x4e3d('0x6'));var csv=require(_0x4e3d('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4e3d('0x8'));var _=require(_0x4e3d('0x9'));var squel=require('squel');var crypto=require(_0x4e3d('0xa'));var jsforce=require(_0x4e3d('0xb'));var deskjs=require(_0x4e3d('0xc'));var toCsv=require(_0x4e3d('0x7'));var querystring=require(_0x4e3d('0xd'));var Papa=require(_0x4e3d('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4e3d('0xf'));var as=require(_0x4e3d('0x10'));var hardwareService=require(_0x4e3d('0x11'));var logger=require(_0x4e3d('0x12'))(_0x4e3d('0x13'));var utils=require(_0x4e3d('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x4e3d('0x15'));var db=require(_0x4e3d('0x16'))['db'];config[_0x4e3d('0x17')]=_[_0x4e3d('0x18')](config[_0x4e3d('0x17')],{'host':_0x4e3d('0x19'),'port':0x18eb});var socket=require(_0x4e3d('0x1a'))(new Redis(config[_0x4e3d('0x17')]));require('./cmContact.socket')[_0x4e3d('0x1b')](socket);function respondWithStatusCode(_0x4325b4,_0x3b7b45){_0x3b7b45=_0x3b7b45||0xcc;return function(_0x5e0d2c){if(_0x5e0d2c){return _0x4325b4[_0x4e3d('0x1c')](_0x3b7b45);}return _0x4325b4[_0x4e3d('0x1d')](_0x3b7b45)[_0x4e3d('0x1e')]();};}function respondWithResult(_0xc20768,_0x1b829e){_0x1b829e=_0x1b829e||0xc8;return function(_0x364798){if(_0x364798){return _0xc20768[_0x4e3d('0x1d')](_0x1b829e)[_0x4e3d('0x1f')](_0x364798);}};}function respondWithFilteredResult(_0x554ba6,_0x2aab75){return function(_0x5129d5){if(_0x5129d5){var _0x4b74cb=typeof _0x2aab75[_0x4e3d('0x20')]==='undefined'&&typeof _0x2aab75['limit']===_0x4e3d('0x21');var _0x2e37ad=_0x5129d5[_0x4e3d('0x22')];var _0x318bd4=_0x4b74cb?0x0:_0x2aab75['offset'];var _0x35d75c=_0x4b74cb?_0x5129d5['count']:_0x2aab75[_0x4e3d('0x20')]+_0x2aab75['limit'];var _0x170f88;if(_0x35d75c>=_0x2e37ad){_0x35d75c=_0x2e37ad;_0x170f88=0xc8;}else{_0x170f88=0xce;}_0x554ba6[_0x4e3d('0x1d')](_0x170f88);return _0x554ba6[_0x4e3d('0x23')](_0x4e3d('0x24'),_0x318bd4+'-'+_0x35d75c+'/'+_0x2e37ad)[_0x4e3d('0x1f')](_0x5129d5);}return null;};}function patchUpdates(_0x2c8186){return function(_0x575c72){try{jsonpatch['apply'](_0x575c72,_0x2c8186,!![]);}catch(_0x18271a){return BPromise[_0x4e3d('0x25')](_0x18271a);}return _0x575c72[_0x4e3d('0x26')]();};}function saveUpdates(_0x49301f,_0x3e6b53){return function(_0x58a9cb){if(_0x58a9cb){return _0x58a9cb[_0x4e3d('0x27')](_0x49301f)[_0x4e3d('0x28')](function(_0x43bc1b){return _0x43bc1b;});}return null;};}function removeEntity(_0x50d9db,_0x2434ea){return function(_0xa6569b){if(_0xa6569b){return _0xa6569b['destroy']()[_0x4e3d('0x28')](function(){_0x50d9db[_0x4e3d('0x1d')](0xcc)[_0x4e3d('0x1e')]();});}};}function handleEntityNotFound(_0x4a7820,_0x727783){return function(_0x56395b){if(!_0x56395b){_0x4a7820[_0x4e3d('0x1c')](0x194);}return _0x56395b;};}function handleError(_0x5271a1,_0x2edb44){_0x2edb44=_0x2edb44||0x1f4;return function(_0x2d1991){logger[_0x4e3d('0x29')](_0x2d1991['stack']);if(_0x2d1991[_0x4e3d('0x2a')]){delete _0x2d1991[_0x4e3d('0x2a')];}_0x5271a1['status'](_0x2edb44)['send'](_0x2d1991);};}exports[_0x4e3d('0x2b')]=function(_0x333fff,_0x36621d){var _0x49ba5b={},_0x4157e5={},_0x1be6aa={'count':0x0,'rows':[]};return db['CmContact']['describe']()[_0x4e3d('0x28')](function(_0x21c9d1){var _0x575957=[];for(var _0xefeafa=0x0;_0xefeafa
','getHost','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','split','length','slice','Anonymous','pop','isEmpty','html','replace','includes','0x1?_0x4db167[_0x85eb('0x12')]():'';}return'';}function getMails(_0x23a82a,_0x600a7f){var _0x1604ba='';for(var _0x183b0c=0x0;_0x183b0c<_0x600a7f['value'][_0x85eb('0xf')];_0x183b0c+=0x1){if(_0x600a7f['value'][_0x183b0c][_0x85eb('0x9')]!==_0x23a82a){if(!_[_0x85eb('0x13')](_0x1604ba)){_0x1604ba+=',';}_0x1604ba+=_0x600a7f[_0x85eb('0x8')][_0x183b0c][_0x85eb('0xd')]||_0x600a7f['value'][_0x183b0c]['address']||'';_0x1604ba+='\x20<';_0x1604ba+=_0x600a7f['value'][_0x183b0c][_0x85eb('0x9')]?_0x600a7f[_0x85eb('0x8')][_0x183b0c][_0x85eb('0x9')]:_0x85eb('0xa')+random[_0x85eb('0xb')](0x6)+_0x85eb('0xc');_0x1604ba+='>';}}return _0x1604ba;}function parseEmail(_0x5acd3d,_0x24cf28,_0x7244fc){if(_0x24cf28[_0x85eb('0x14')]){var _0x4e8041=/