From: support
Date: Fri, 15 Jul 2022 06:54:27 +0000 (+0000)
Subject: Built motion from commit 79c7c506.|2.6.12
X-Git-Url: http://repos.xcallymotion.com/?a=commitdiff_plain;h=2324d3b98fc87aee5f10dc5e9d72c83d4e970e19;p=motion2.git
Built motion from commit 79c7c506.|2.6.12
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 9e42dea..d08024c 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-07-13T15:30:06.967Z",
+ "time": "2022-07-15T06:45:48.176Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index bca3c88..7665dea 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-07-13T15:30:06.967Z",
+ "time": "2022-07-15T06:45:48.176Z",
"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 8febba5..1957b29 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 _0x4318=['urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action','contactManager','integration','motionbar','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'];(function(_0x167244,_0x5c43a9){var _0x263f0c=function(_0x171626){while(--_0x171626){_0x167244['push'](_0x167244['shift']());}};_0x263f0c(++_0x5c43a9);}(_0x4318,0x1a7));var _0x8431=function(_0x4d66df,_0x166a33){_0x4d66df=_0x4d66df-0x0;var _0x5781d0=_0x4318[_0x4d66df];return _0x5781d0;};'use strict';var Sequelize=require(_0x8431('0x0'));module[_0x8431('0x1')]={'name':{'type':Sequelize[_0x8431('0x2')],'get':function(_0x303346){return this[_0x8431('0x3')](_0x8431('0x4'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x8431('0x5'),_0x8431('0x6'),_0x8431('0x7'),'jscripty',_0x8431('0x8'),_0x8431('0x9'),_0x8431('0xa'),_0x8431('0xb')]],'msg':_0x8431('0xc')}},'comment':_0x8431('0xc')},'data1':{'type':Sequelize[_0x8431('0xd')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize[_0x8431('0xd')](0x1000),'comment':_0x8431('0xe')},'data3':{'type':Sequelize[_0x8431('0xd')](0x1000),'comment':_0x8431('0xf')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x8431('0x10')},'data5':{'type':Sequelize[_0x8431('0xd')](0x1000),'comments':_0x8431('0x11')},'data6':{'type':Sequelize[_0x8431('0xd')],'comments':_0x8431('0x12')},'data7':{'type':Sequelize[_0x8431('0x13')],'comments':_0x8431('0x14')}};
\ No newline at end of file
+var _0x7ab6=['exports','VIRTUAL','getDataValue','action','contactManager','integration','motionbar','urlForward','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','STRING','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize'];(function(_0x15b612,_0x3570c8){var _0x5bea74=function(_0x29c3db){while(--_0x29c3db){_0x15b612['push'](_0x15b612['shift']());}};_0x5bea74(++_0x3570c8);}(_0x7ab6,0x1bf));var _0x67ab=function(_0x19ad32,_0xcda39d){_0x19ad32=_0x19ad32-0x0;var _0x2d96c8=_0x7ab6[_0x19ad32];return _0x2d96c8;};'use strict';var Sequelize=require(_0x67ab('0x0'));module[_0x67ab('0x1')]={'name':{'type':Sequelize[_0x67ab('0x2')],'get':function(_0x46bb94){return this[_0x67ab('0x3')](_0x67ab('0x4'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x67ab('0x5'),_0x67ab('0x6'),_0x67ab('0x7'),'jscripty',_0x67ab('0x8'),'browser',_0x67ab('0x9'),'script']],'msg':_0x67ab('0xa')}},'comment':_0x67ab('0xa')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x67ab('0xb')},'data2':{'type':Sequelize[_0x67ab('0xc')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x67ab('0xc')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0x67ab('0xc')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize['STRING'](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize['STRING'],'comments':_0x67ab('0xd')},'data7':{'type':Sequelize[_0x67ab('0xe')],'comments':_0x67ab('0xf')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 1651060..d1bb29b 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 _0xd289=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','end','error','name','send','body','Action','params','catch','find','eml-format','zip-dir','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js'];(function(_0x31a938,_0x4daec6){var _0x1bf341=function(_0x514261){while(--_0x514261){_0x31a938['push'](_0x31a938['shift']());}};_0x1bf341(++_0x4daec6);}(_0xd289,0x80));var _0x9d28=function(_0x2bdc9d,_0x5ef92b){_0x2bdc9d=_0x2bdc9d-0x0;var _0x1ac0ba=_0xd289[_0x2bdc9d];return _0x1ac0ba;};'use strict';var emlformat=require(_0x9d28('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9d28('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9d28('0x2'));var BPromise=require(_0x9d28('0x3'));var Mustache=require('mustache');var util=require(_0x9d28('0x4'));var path=require(_0x9d28('0x5'));var sox=require('sox');var csv=require(_0x9d28('0x6'));var ejs=require(_0x9d28('0x7'));var fs=require('fs');var fs_extra=require(_0x9d28('0x8'));var _=require(_0x9d28('0x9'));var squel=require(_0x9d28('0xa'));var crypto=require('crypto');var jsforce=require(_0x9d28('0xb'));var deskjs=require(_0x9d28('0xc'));var toCsv=require(_0x9d28('0x6'));var querystring=require(_0x9d28('0xd'));var Papa=require(_0x9d28('0xe'));var Redis=require(_0x9d28('0xf'));var authService=require(_0x9d28('0x10'));var qs=require(_0x9d28('0x11'));var as=require(_0x9d28('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9d28('0x13'))('api');var utils=require(_0x9d28('0x14'));var config=require(_0x9d28('0x15'));var licenseUtil=require(_0x9d28('0x16'));var db=require(_0x9d28('0x17'))['db'];function respondWithStatusCode(_0x4e9bd8,_0x4e126c){_0x4e126c=_0x4e126c||0xcc;return function(_0x1c21c1){if(_0x1c21c1){return _0x4e9bd8[_0x9d28('0x18')](_0x4e126c);}return _0x4e9bd8[_0x9d28('0x19')](_0x4e126c)['end']();};}function respondWithResult(_0x4a2cc1,_0x153a0c){_0x153a0c=_0x153a0c||0xc8;return function(_0xebc3a7){if(_0xebc3a7){return _0x4a2cc1[_0x9d28('0x19')](_0x153a0c)[_0x9d28('0x1a')](_0xebc3a7);}};}function respondWithFilteredResult(_0x51eb9d,_0x49a1c0){return function(_0x46c889){if(_0x46c889){var _0x4aeba9=typeof _0x49a1c0[_0x9d28('0x1b')]===_0x9d28('0x1c')&&typeof _0x49a1c0[_0x9d28('0x1d')]===_0x9d28('0x1c');var _0x41b0c3=_0x46c889['count'];var _0x225976=_0x4aeba9?0x0:_0x49a1c0[_0x9d28('0x1b')];var _0x3148a9=_0x4aeba9?_0x46c889[_0x9d28('0x1e')]:_0x49a1c0[_0x9d28('0x1b')]+_0x49a1c0[_0x9d28('0x1d')];var _0x301b2d;if(_0x3148a9>=_0x41b0c3){_0x3148a9=_0x41b0c3;_0x301b2d=0xc8;}else{_0x301b2d=0xce;}_0x51eb9d['status'](_0x301b2d);return _0x51eb9d[_0x9d28('0x1f')](_0x9d28('0x20'),_0x225976+'-'+_0x3148a9+'/'+_0x41b0c3)[_0x9d28('0x1a')](_0x46c889);}return null;};}function patchUpdates(_0x22e119){return function(_0x285629){try{jsonpatch[_0x9d28('0x21')](_0x285629,_0x22e119,!![]);}catch(_0x205f7c){return BPromise['reject'](_0x205f7c);}return _0x285629[_0x9d28('0x22')]();};}function saveUpdates(_0x268e95,_0x2cfc55){return function(_0x23097a){if(_0x23097a){return _0x23097a[_0x9d28('0x23')](_0x268e95)[_0x9d28('0x24')](function(_0xc1b2d3){return _0xc1b2d3;});}return null;};}function removeEntity(_0x55b073,_0x1a607e){return function(_0x11700c){if(_0x11700c){return _0x11700c[_0x9d28('0x25')]()['then'](function(){_0x55b073[_0x9d28('0x19')](0xcc)[_0x9d28('0x26')]();});}};}function handleEntityNotFound(_0x33814e,_0x3bdd70){return function(_0x51970d){if(!_0x51970d){_0x33814e[_0x9d28('0x18')](0x194);}return _0x51970d;};}function handleError(_0x22529e,_0x162d21){_0x162d21=_0x162d21||0x1f4;return function(_0x3732a9){logger[_0x9d28('0x27')](_0x3732a9['stack']);if(_0x3732a9[_0x9d28('0x28')]){delete _0x3732a9[_0x9d28('0x28')];}_0x22529e['status'](_0x162d21)[_0x9d28('0x29')](_0x3732a9);};}exports[_0x9d28('0x23')]=function(_0x46c045,_0x2bed66){if(_0x46c045[_0x9d28('0x2a')]['id']){delete _0x46c045[_0x9d28('0x2a')]['id'];}return db[_0x9d28('0x2b')]['find']({'where':{'id':_0x46c045[_0x9d28('0x2c')]['id']}})[_0x9d28('0x24')](handleEntityNotFound(_0x2bed66,null))['then'](saveUpdates(_0x46c045[_0x9d28('0x2a')],null))[_0x9d28('0x24')](respondWithResult(_0x2bed66,null))[_0x9d28('0x2d')](handleError(_0x2bed66,null));};exports[_0x9d28('0x25')]=function(_0x20d48f,_0x32ff4a){return db[_0x9d28('0x2b')][_0x9d28('0x2e')]({'where':{'id':_0x20d48f[_0x9d28('0x2c')]['id']}})[_0x9d28('0x24')](handleEntityNotFound(_0x32ff4a,null))[_0x9d28('0x24')](removeEntity(_0x32ff4a,null))[_0x9d28('0x2d')](handleError(_0x32ff4a,null));};
\ No newline at end of file
+var _0x169f=['lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','status','error','stack','name','body','Action','params','catch','find','rimraf','fast-json-patch','moment','bluebird','mustache','path','ejs'];(function(_0x18983d,_0x3472b3){var _0x340651=function(_0x3d8cb7){while(--_0x3d8cb7){_0x18983d['push'](_0x18983d['shift']());}};_0x340651(++_0x3472b3);}(_0x169f,0x13b));var _0xf169=function(_0x59c23e,_0x555150){_0x59c23e=_0x59c23e-0x0;var _0x1db2b4=_0x169f[_0x59c23e];return _0x1db2b4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf169('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf169('0x1'));var rp=require('request-promise');var moment=require(_0xf169('0x2'));var BPromise=require(_0xf169('0x3'));var Mustache=require(_0xf169('0x4'));var util=require('util');var path=require(_0xf169('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf169('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf169('0x7'));var squel=require(_0xf169('0x8'));var crypto=require(_0xf169('0x9'));var jsforce=require(_0xf169('0xa'));var deskjs=require(_0xf169('0xb'));var toCsv=require(_0xf169('0xc'));var querystring=require(_0xf169('0xd'));var Papa=require(_0xf169('0xe'));var Redis=require(_0xf169('0xf'));var authService=require(_0xf169('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xf169('0x11'));var hardwareService=require(_0xf169('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xf169('0x13'));var config=require(_0xf169('0x14'));var licenseUtil=require(_0xf169('0x15'));var db=require(_0xf169('0x16'))['db'];function respondWithStatusCode(_0x5752d4,_0x1bf8b4){_0x1bf8b4=_0x1bf8b4||0xcc;return function(_0x50245a){if(_0x50245a){return _0x5752d4[_0xf169('0x17')](_0x1bf8b4);}return _0x5752d4['status'](_0x1bf8b4)[_0xf169('0x18')]();};}function respondWithResult(_0x4f1879,_0x35ca7a){_0x35ca7a=_0x35ca7a||0xc8;return function(_0x970789){if(_0x970789){return _0x4f1879['status'](_0x35ca7a)[_0xf169('0x19')](_0x970789);}};}function respondWithFilteredResult(_0x3c221c,_0x2d4eb5){return function(_0x4d3807){if(_0x4d3807){var _0x573224=typeof _0x2d4eb5[_0xf169('0x1a')]==='undefined'&&typeof _0x2d4eb5['limit']===_0xf169('0x1b');var _0x31237e=_0x4d3807[_0xf169('0x1c')];var _0x47ef98=_0x573224?0x0:_0x2d4eb5[_0xf169('0x1a')];var _0x5d6a6d=_0x573224?_0x4d3807['count']:_0x2d4eb5[_0xf169('0x1a')]+_0x2d4eb5[_0xf169('0x1d')];var _0xde4dfe;if(_0x5d6a6d>=_0x31237e){_0x5d6a6d=_0x31237e;_0xde4dfe=0xc8;}else{_0xde4dfe=0xce;}_0x3c221c['status'](_0xde4dfe);return _0x3c221c[_0xf169('0x1e')](_0xf169('0x1f'),_0x47ef98+'-'+_0x5d6a6d+'/'+_0x31237e)[_0xf169('0x19')](_0x4d3807);}return null;};}function patchUpdates(_0x5f2cf9){return function(_0x37fa8e){try{jsonpatch['apply'](_0x37fa8e,_0x5f2cf9,!![]);}catch(_0xab7a8d){return BPromise[_0xf169('0x20')](_0xab7a8d);}return _0x37fa8e[_0xf169('0x21')]();};}function saveUpdates(_0x526fa9,_0x23442c){return function(_0x56f724){if(_0x56f724){return _0x56f724[_0xf169('0x22')](_0x526fa9)[_0xf169('0x23')](function(_0x41eb0f){return _0x41eb0f;});}return null;};}function removeEntity(_0x6d6ed5,_0x580923){return function(_0x5498ed){if(_0x5498ed){return _0x5498ed[_0xf169('0x24')]()[_0xf169('0x23')](function(){_0x6d6ed5[_0xf169('0x25')](0xcc)[_0xf169('0x18')]();});}};}function handleEntityNotFound(_0x299d49,_0x14de7d){return function(_0x52ba5c){if(!_0x52ba5c){_0x299d49['sendStatus'](0x194);}return _0x52ba5c;};}function handleError(_0x40dfab,_0x463b5b){_0x463b5b=_0x463b5b||0x1f4;return function(_0x2c129f){logger[_0xf169('0x26')](_0x2c129f[_0xf169('0x27')]);if(_0x2c129f['name']){delete _0x2c129f[_0xf169('0x28')];}_0x40dfab[_0xf169('0x25')](_0x463b5b)['send'](_0x2c129f);};}exports[_0xf169('0x22')]=function(_0x2dbe30,_0x288a74){if(_0x2dbe30[_0xf169('0x29')]['id']){delete _0x2dbe30['body']['id'];}return db[_0xf169('0x2a')]['find']({'where':{'id':_0x2dbe30[_0xf169('0x2b')]['id']}})[_0xf169('0x23')](handleEntityNotFound(_0x288a74,null))[_0xf169('0x23')](saveUpdates(_0x2dbe30[_0xf169('0x29')],null))[_0xf169('0x23')](respondWithResult(_0x288a74,null))[_0xf169('0x2c')](handleError(_0x288a74,null));};exports['destroy']=function(_0x1bf8e4,_0x13cdd0){return db[_0xf169('0x2a')][_0xf169('0x2d')]({'where':{'id':_0x1bf8e4['params']['id']}})[_0xf169('0x23')](handleEntityNotFound(_0x13cdd0,null))[_0xf169('0x23')](removeEntity(_0x13cdd0,null))[_0xf169('0x2c')](handleError(_0x13cdd0,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 91b2161..96a8f6d 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 _0x8140=['define','tools_actions','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./action.attributes','exports'];(function(_0x26387d,_0x35c654){var _0x36c01a=function(_0x5c006d){while(--_0x5c006d){_0x26387d['push'](_0x26387d['shift']());}};_0x36c01a(++_0x35c654);}(_0x8140,0x9c));var _0x0814=function(_0x232848,_0x18384d){_0x232848=_0x232848-0x0;var _0x4540e2=_0x8140[_0x232848];return _0x4540e2;};'use strict';var _=require('lodash');var util=require(_0x0814('0x0'));var logger=require(_0x0814('0x1'))(_0x0814('0x2'));var moment=require(_0x0814('0x3'));var BPromise=require(_0x0814('0x4'));var rp=require(_0x0814('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0814('0x6'));var config=require('../../config/environment');var attributes=require(_0x0814('0x7'));module[_0x0814('0x8')]=function(_0x2e3af4,_0x1f4ef5){return _0x2e3af4[_0x0814('0x9')]('Action',attributes,{'tableName':_0x0814('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0a78=['api','bluebird','request-promise','path','../../config/environment','exports','define','Action','tools_actions','lodash','util'];(function(_0x3d220e,_0x3a67a5){var _0x421b95=function(_0x4c6a9a){while(--_0x4c6a9a){_0x3d220e['push'](_0x3d220e['shift']());}};_0x421b95(++_0x3a67a5);}(_0x0a78,0x1ab));var _0x80a7=function(_0x33a877,_0x413a2d){_0x33a877=_0x33a877-0x0;var _0x459879=_0x0a78[_0x33a877];return _0x459879;};'use strict';var _=require(_0x80a7('0x0'));var util=require(_0x80a7('0x1'));var logger=require('../../config/logger')(_0x80a7('0x2'));var moment=require('moment');var BPromise=require(_0x80a7('0x3'));var rp=require(_0x80a7('0x4'));var fs=require('fs');var path=require(_0x80a7('0x5'));var rimraf=require('rimraf');var config=require(_0x80a7('0x6'));var attributes=require('./action.attributes');module[_0x80a7('0x7')]=function(_0x38425e,_0x546c40){return _0x38425e[_0x80a7('0x8')](_0x80a7('0x9'),attributes,{'tableName':_0x80a7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index 2fbb33f..0627500 100644
--- a/server/api/action/action.rpc.js
+++ b/server/api/action/action.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','Action,\x20%s,\x20%s','Action,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x1ca48f,_0x58cb05){var _0xffa5a9=function(_0x1ba383){while(--_0x1ba383){_0x1ca48f['push'](_0x1ca48f['shift']());}};_0xffa5a9(++_0x58cb05);}(_0xe14b,0x93));var _0xbe14=function(_0xbbc401,_0x34de69){_0xbbc401=_0xbbc401-0x0;var _0x33b743=_0xe14b[_0xbbc401];return _0x33b743;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});}
\ No newline at end of file
+var _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(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0x53ec,0x192));var _0xc53e=function(_0x2bf6be,_0x5b23f1){_0x2bf6be=_0x2bf6be-0x0;var _0x532ef4=_0x53ec[_0x2bf6be];return _0x532ef4;};'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 6bb8e2f..3d836f9 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 _0x0380=['update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./action.controller','put','/:id','isAuthenticated'];(function(_0x305f2a,_0x489912){var _0x266f79=function(_0x12b945){while(--_0x12b945){_0x305f2a['push'](_0x305f2a['shift']());}};_0x266f79(++_0x489912);}(_0x0380,0xc4));var _0x0038=function(_0x48c8d5,_0x2eebf0){_0x48c8d5=_0x48c8d5-0x0;var _0x4dd4b1=_0x0380[_0x48c8d5];return _0x4dd4b1;};'use strict';var multer=require(_0x0038('0x0'));var util=require(_0x0038('0x1'));var path=require(_0x0038('0x2'));var timeout=require(_0x0038('0x3'));var express=require('express');var router=express[_0x0038('0x4')]();var fs_extra=require(_0x0038('0x5'));var auth=require(_0x0038('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0038('0x7'));var controller=require(_0x0038('0x8'));router[_0x0038('0x9')](_0x0038('0xa'),auth[_0x0038('0xb')](),controller[_0x0038('0xc')]);router[_0x0038('0xd')](_0x0038('0xa'),auth[_0x0038('0xb')](),controller[_0x0038('0xe')]);module[_0x0038('0xf')]=router;
\ No newline at end of file
+var _0xcfdf=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./action.controller','put','isAuthenticated','update','delete','/:id','exports'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0xcfdf,0x195));var _0xfcfd=function(_0x25147b,_0x534c37){_0x25147b=_0x25147b-0x0;var _0x12bc18=_0xcfdf[_0x25147b];return _0x12bc18;};'use strict';var multer=require('multer');var util=require(_0xfcfd('0x0'));var path=require(_0xfcfd('0x1'));var timeout=require(_0xfcfd('0x2'));var express=require(_0xfcfd('0x3'));var router=express[_0xfcfd('0x4')]();var fs_extra=require(_0xfcfd('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xfcfd('0x6'));var config=require(_0xfcfd('0x7'));var controller=require(_0xfcfd('0x8'));router[_0xfcfd('0x9')]('/:id',auth[_0xfcfd('0xa')](),controller[_0xfcfd('0xb')]);router[_0xfcfd('0xc')](_0xfcfd('0xd'),auth[_0xfcfd('0xa')](),controller['destroy']);module[_0xfcfd('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 57d7cf2..28b25e6 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 _0x2675=['sequelize','STRING','TEXT'];(function(_0x3e25c1,_0x1d15f9){var _0x52e7f2=function(_0x597a5a){while(--_0x597a5a){_0x3e25c1['push'](_0x3e25c1['shift']());}};_0x52e7f2(++_0x1d15f9);}(_0x2675,0x75));var _0x5267=function(_0x4859af,_0x22a5cc){_0x4859af=_0x4859af-0x0;var _0x5202fb=_0x2675[_0x4859af];return _0x5202fb;};'use strict';var Sequelize=require(_0x5267('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x5267('0x1')]},'table':{'type':Sequelize[_0x5267('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x5267('0x2')]}};
\ No newline at end of file
+var _0xbd51=['sequelize','STRING'];(function(_0x39ff5c,_0x3de001){var _0x1eba54=function(_0x1fcfaa){while(--_0x1fcfaa){_0x39ff5c['push'](_0x39ff5c['shift']());}};_0x1eba54(++_0x3de001);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x5f9a43,_0x33b992){_0x5f9a43=_0x5f9a43-0x0;var _0x1bbb9e=_0xbd51[_0x5f9a43];return _0x1bbb9e;};'use strict';var Sequelize=require(_0x1bd5('0x0'));module['exports']={'name':{'type':Sequelize[_0x1bd5('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x1bd5('0x1')]},'parent':{'type':Sequelize[_0x1bd5('0x1')]},'table':{'type':Sequelize[_0x1bd5('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 685a9ff..6fead9b 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 _0xdbed=['format','groupBy','orderBy','order','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','DATE(%s)','IS\x20NOT\x20NULL','MetricId','function','output','%s-%s.%s','randomstring','csv','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','run','runReport','cross_join','HOUR(%s)','eml-format','rimraf','zip-dir','fast-json-patch','moment','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','then','destroy','get','CustomReports','error','name','send','index','map','AnalyticCustomReport','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','limit','sort','where','filter','merge','type','VIRTUAL','options','include','findAll','catch','params','rawAttributes','includeAll','find','create','body','user','Reports','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','right_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)','SEC_TO_TIME(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','metric','replace'];(function(_0x12ab49,_0x56a63c){var _0x8256d9=function(_0x111b31){while(--_0x111b31){_0x12ab49['push'](_0x12ab49['shift']());}};_0x8256d9(++_0x56a63c);}(_0xdbed,0xca));var _0xddbe=function(_0x7060aa,_0x31ed19){_0x7060aa=_0x7060aa-0x0;var _0x48518e=_0xdbed[_0x7060aa];return _0x48518e;};'use strict';var emlformat=require(_0xddbe('0x0'));var rimraf=require(_0xddbe('0x1'));var zipdir=require(_0xddbe('0x2'));var jsonpatch=require(_0xddbe('0x3'));var rp=require('request-promise');var moment=require(_0xddbe('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xddbe('0x5'));var ejs=require(_0xddbe('0x6'));var fs=require('fs');var fs_extra=require(_0xddbe('0x7'));var _=require(_0xddbe('0x8'));var squel=require(_0xddbe('0x9'));var crypto=require(_0xddbe('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xddbe('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xddbe('0xc'));var Redis=require(_0xddbe('0xd'));var authService=require(_0xddbe('0xe'));var qs=require(_0xddbe('0xf'));var as=require(_0xddbe('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xddbe('0x11'));var config=require(_0xddbe('0x12'));var licenseUtil=require(_0xddbe('0x13'));var db=require('../../mysqldb')['db'];var dbH=require(_0xddbe('0x14'))[_0xddbe('0x15')];function respondWithStatusCode(_0x8ab39b,_0x246689){_0x246689=_0x246689||0xcc;return function(_0x31b039){if(_0x31b039){return _0x8ab39b[_0xddbe('0x16')](_0x246689);}return _0x8ab39b[_0xddbe('0x17')](_0x246689)[_0xddbe('0x18')]();};}function respondWithResult(_0x2eaa66,_0x2d5495){_0x2d5495=_0x2d5495||0xc8;return function(_0x226522){if(_0x226522){return _0x2eaa66['status'](_0x2d5495)[_0xddbe('0x19')](_0x226522);}};}function respondWithFilteredResult(_0x1abeea,_0xb2d0ee){return function(_0x8e82fd){if(_0x8e82fd){var _0x1e05cf=typeof _0xb2d0ee[_0xddbe('0x1a')]==='undefined'&&typeof _0xb2d0ee['limit']===_0xddbe('0x1b');var _0x449bc1=_0x8e82fd[_0xddbe('0x1c')];var _0x4a2f37=_0x1e05cf?0x0:_0xb2d0ee[_0xddbe('0x1a')];var _0x4b4be9=_0x1e05cf?_0x8e82fd[_0xddbe('0x1c')]:_0xb2d0ee[_0xddbe('0x1a')]+_0xb2d0ee['limit'];var _0x9dc713;if(_0x4b4be9>=_0x449bc1){_0x4b4be9=_0x449bc1;_0x9dc713=0xc8;}else{_0x9dc713=0xce;}_0x1abeea['status'](_0x9dc713);return _0x1abeea['set'](_0xddbe('0x1d'),_0x4a2f37+'-'+_0x4b4be9+'/'+_0x449bc1)[_0xddbe('0x19')](_0x8e82fd);}return null;};}function patchUpdates(_0x1c13de){return function(_0x5bb269){try{jsonpatch[_0xddbe('0x1e')](_0x5bb269,_0x1c13de,!![]);}catch(_0x5104bb){return BPromise[_0xddbe('0x1f')](_0x5104bb);}return _0x5bb269[_0xddbe('0x20')]();};}function saveUpdates(_0x21b2d5,_0x44da8b){return function(_0x4621aa){if(_0x4621aa){return _0x4621aa['update'](_0x21b2d5)[_0xddbe('0x21')](function(_0x2db05a){return _0x2db05a;});}return null;};}function removeEntity(_0x324d5b,_0x4ddf0b){return function(_0x47dc94){if(_0x47dc94){return _0x47dc94[_0xddbe('0x22')]()[_0xddbe('0x21')](function(){var _0x3759b6=_0x47dc94[_0xddbe('0x23')]({'plain':!![]});var _0x46f2aa=_0xddbe('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x46f2aa,'resourceId':_0x3759b6['id']}})['then'](function(){return _0x47dc94;});})[_0xddbe('0x21')](function(){_0x324d5b[_0xddbe('0x17')](0xcc)[_0xddbe('0x18')]();});}};}function handleEntityNotFound(_0x1086e4,_0x2245dc){return function(_0x577415){if(!_0x577415){_0x1086e4[_0xddbe('0x16')](0x194);}return _0x577415;};}function handleError(_0x4e5d8a,_0x5f17fd){_0x5f17fd=_0x5f17fd||0x1f4;return function(_0x2114aa){logger[_0xddbe('0x25')](_0x2114aa['stack']);if(_0x2114aa[_0xddbe('0x26')]){delete _0x2114aa[_0xddbe('0x26')];}_0x4e5d8a['status'](_0x5f17fd)[_0xddbe('0x27')](_0x2114aa);};}exports[_0xddbe('0x28')]=function(_0x1c0028,_0x2d4555){var _0x821b7f={},_0x50ce50={},_0x4336d2={'count':0x0,'rows':[]};var _0x37d21f=_[_0xddbe('0x29')](db[_0xddbe('0x2a')]['rawAttributes'],function(_0x28b31f){return{'name':_0x28b31f[_0xddbe('0x2b')],'type':_0x28b31f['type'][_0xddbe('0x2c')]};});_0x50ce50['model']=_[_0xddbe('0x29')](_0x37d21f,_0xddbe('0x26'));_0x50ce50[_0xddbe('0x2d')]=_[_0xddbe('0x2e')](_0x1c0028['query']);_0x50ce50[_0xddbe('0x2f')]=_[_0xddbe('0x30')](_0x50ce50[_0xddbe('0x31')],_0x50ce50['query']);_0x821b7f[_0xddbe('0x32')]=_[_0xddbe('0x30')](_0x50ce50[_0xddbe('0x31')],qs[_0xddbe('0x33')](_0x1c0028[_0xddbe('0x2d')]['fields']));_0x821b7f[_0xddbe('0x32')]=_0x821b7f[_0xddbe('0x32')][_0xddbe('0x34')]?_0x821b7f[_0xddbe('0x32')]:_0x50ce50['model'];if(!_0x1c0028[_0xddbe('0x2d')]['hasOwnProperty'](_0xddbe('0x35'))){_0x821b7f['limit']=qs[_0xddbe('0x36')](_0x1c0028[_0xddbe('0x2d')]['limit']);_0x821b7f['offset']=qs['offset'](_0x1c0028[_0xddbe('0x2d')][_0xddbe('0x1a')]);}_0x821b7f['order']=qs['sort'](_0x1c0028[_0xddbe('0x2d')][_0xddbe('0x37')]);_0x821b7f[_0xddbe('0x38')]=qs[_0xddbe('0x2f')](_['pick'](_0x1c0028[_0xddbe('0x2d')],_0x50ce50[_0xddbe('0x2f')]),_0x37d21f);if(_0x1c0028[_0xddbe('0x2d')][_0xddbe('0x39')]){_0x821b7f[_0xddbe('0x38')]=_[_0xddbe('0x3a')](_0x821b7f[_0xddbe('0x38')],{'$or':_[_0xddbe('0x29')](_0x37d21f,function(_0x5ad3ab){if(_0x5ad3ab[_0xddbe('0x3b')]!==_0xddbe('0x3c')){var _0x1b95b6={};_0x1b95b6[_0x5ad3ab[_0xddbe('0x26')]]={'$like':'%'+_0x1c0028[_0xddbe('0x2d')]['filter']+'%'};return _0x1b95b6;}})});}_0x821b7f=_[_0xddbe('0x3a')]({},_0x821b7f,_0x1c0028[_0xddbe('0x3d')]);var _0x7f75a3={'where':_0x821b7f[_0xddbe('0x38')]};return db[_0xddbe('0x2a')]['count'](_0x7f75a3)[_0xddbe('0x21')](function(_0x25a409){_0x4336d2[_0xddbe('0x1c')]=_0x25a409;if(_0x1c0028['query']['includeAll']){_0x821b7f[_0xddbe('0x3e')]=[{'all':!![]}];}return db[_0xddbe('0x2a')][_0xddbe('0x3f')](_0x821b7f);})[_0xddbe('0x21')](function(_0x1a9fb1){_0x4336d2['rows']=_0x1a9fb1;return _0x4336d2;})[_0xddbe('0x21')](respondWithFilteredResult(_0x2d4555,_0x821b7f))[_0xddbe('0x40')](handleError(_0x2d4555,null));};exports['show']=function(_0x178706,_0x3da74e){var _0x5b546e={'raw':![],'where':{'id':_0x178706[_0xddbe('0x41')]['id']}},_0x59c4d8={};_0x59c4d8['model']=_[_0xddbe('0x2e')](db[_0xddbe('0x2a')][_0xddbe('0x42')]);_0x59c4d8[_0xddbe('0x2d')]=_[_0xddbe('0x2e')](_0x178706[_0xddbe('0x2d')]);_0x59c4d8[_0xddbe('0x2f')]=_[_0xddbe('0x30')](_0x59c4d8[_0xddbe('0x31')],_0x59c4d8[_0xddbe('0x2d')]);_0x5b546e[_0xddbe('0x32')]=_[_0xddbe('0x30')](_0x59c4d8[_0xddbe('0x31')],qs['fields'](_0x178706[_0xddbe('0x2d')][_0xddbe('0x33')]));_0x5b546e[_0xddbe('0x32')]=_0x5b546e[_0xddbe('0x32')][_0xddbe('0x34')]?_0x5b546e['attributes']:_0x59c4d8[_0xddbe('0x31')];if(_0x178706[_0xddbe('0x2d')][_0xddbe('0x43')]){_0x5b546e[_0xddbe('0x3e')]=[{'all':!![]}];}_0x5b546e=_[_0xddbe('0x3a')]({},_0x5b546e,_0x178706[_0xddbe('0x3d')]);return db[_0xddbe('0x2a')][_0xddbe('0x44')](_0x5b546e)[_0xddbe('0x21')](handleEntityNotFound(_0x3da74e,null))['then'](respondWithResult(_0x3da74e,null))[_0xddbe('0x40')](handleError(_0x3da74e,null));};exports[_0xddbe('0x45')]=function(_0x177cd7,_0xc073a4){return db[_0xddbe('0x2a')][_0xddbe('0x45')](_0x177cd7[_0xddbe('0x46')],{})[_0xddbe('0x21')](function(_0x1bd32c){var _0x2e372e=_0x177cd7[_0xddbe('0x47')]['get']({'plain':!![]});if(!_0x2e372e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2e372e['role']==='user'){var _0x28ad23=_0x1bd32c['get']({'plain':!![]});var _0x4a1251=_0xddbe('0x48');return db['UserProfileSection'][_0xddbe('0x44')]({'where':{'name':_0x4a1251,'userProfileId':_0x2e372e[_0xddbe('0x49')]},'raw':!![]})['then'](function(_0x115c87){if(_0x115c87&&_0x115c87[_0xddbe('0x4a')]===0x0){return db[_0xddbe('0x4b')][_0xddbe('0x45')]({'name':_0x28ad23['name'],'resourceId':_0x28ad23['id'],'type':_0xddbe('0x24'),'sectionId':_0x115c87['id']},{})['then'](function(){return _0x1bd32c;});}else{return _0x1bd32c;}})['catch'](function(_0x3a2a33){logger[_0xddbe('0x25')](_0xddbe('0x4c'),_0x3a2a33);throw _0x3a2a33;});}return _0x1bd32c;})['then'](respondWithResult(_0xc073a4,0xc9))[_0xddbe('0x40')](handleError(_0xc073a4,null));};exports[_0xddbe('0x4d')]=function(_0x3971d9,_0x55ce8a){if(_0x3971d9['body']['id']){delete _0x3971d9[_0xddbe('0x46')]['id'];}return db[_0xddbe('0x2a')][_0xddbe('0x44')]({'where':{'id':_0x3971d9[_0xddbe('0x41')]['id']}})['then'](handleEntityNotFound(_0x55ce8a,null))[_0xddbe('0x21')](saveUpdates(_0x3971d9[_0xddbe('0x46')],null))['then'](respondWithResult(_0x55ce8a,null))[_0xddbe('0x40')](handleError(_0x55ce8a,null));};exports[_0xddbe('0x22')]=function(_0x484b9f,_0x334217){return db[_0xddbe('0x2a')]['find']({'where':{'id':_0x484b9f['params']['id']}})['then'](handleEntityNotFound(_0x334217,null))[_0xddbe('0x21')](removeEntity(_0x334217,null))[_0xddbe('0x40')](handleError(_0x334217,null));};exports[_0xddbe('0x4e')]=function(_0x12cc0c,_0x2812cf){var _0x2bdced=0xa;var _0x11bad6=[_0xddbe('0x4f'),_0xddbe('0x50'),_0xddbe('0x51'),'cross_join'];var _0x435f44={'SUM':_0xddbe('0x52'),'COUNT':_0xddbe('0x53'),'COUNT DISTINCT':_0xddbe('0x54'),'MAX':_0xddbe('0x55'),'MIN':_0xddbe('0x56'),'AVG':_0xddbe('0x57'),'GROUP_CONCAT':_0xddbe('0x58'),'GROUP_CONCAT ASC':_0xddbe('0x59'),'GROUP_CONCAT DESC':_0xddbe('0x5a')};var _0x1f7412={'SEC_TO_TIME':_0xddbe('0x5b'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xddbe('0x5c'),'UNIX_TIMESTAMP':_0xddbe('0x5d')};var _0x544a4b=function(_0x371211){return!_[_0xddbe('0x5e')]([_0xddbe('0x5f'),'IS\x20NOT\x20NULL',_0xddbe('0x60'),_0xddbe('0x61')],_0x371211);};var _0x39e09c=function(_0x3f2d27){if(!_0x3f2d27||!_0x3f2d27['rules']['length']){return'';}for(var _0x302608='(',_0x5458fc=0x0;_0x5458fc<_0x3f2d27[_0xddbe('0x62')][_0xddbe('0x34')];_0x5458fc+=0x1){_0x5458fc>0x0&&(_0x302608+='\x20'+_0x3f2d27['operator']+'\x20');_0x302608+=_0x3f2d27[_0xddbe('0x62')][_0x5458fc][_0xddbe('0x63')]?_0x39e09c(_0x3f2d27[_0xddbe('0x62')][_0x5458fc][_0xddbe('0x63')]):_0x3f2d27[_0xddbe('0x62')][_0x5458fc][_0xddbe('0x64')]+'\x20'+_0x3f2d27[_0xddbe('0x62')][_0x5458fc][_0xddbe('0x65')]+(_0x544a4b(_0x3f2d27[_0xddbe('0x62')][_0x5458fc][_0xddbe('0x65')])?'\x20'+_0x3f2d27[_0xddbe('0x62')][_0x5458fc][_0xddbe('0x66')]:'');}return _0x302608+')';};var _0x2b72f5={'where':{'id':_0x12cc0c[_0xddbe('0x41')]['id']}},_0x38e98e,_0x1dd777,_0x16f572,_0x4df3ee,_0x5753be;_0x2b72f5=_['merge']({},_0x2b72f5,_0x12cc0c[_0xddbe('0x3d')]);return db[_0xddbe('0x2a')][_0xddbe('0x44')](_0x2b72f5)[_0xddbe('0x21')](function(_0x1c667c){if(_0x1c667c){_0x38e98e=_0x1c667c;return _0x1c667c[_0xddbe('0x67')]();}return null;})[_0xddbe('0x21')](function(_0x53c804){if(_0x53c804){if(!_0x53c804[_0xddbe('0x34')]){throw new db[(_0xddbe('0x68'))][(_0xddbe('0x69'))](_0xddbe('0x6a'),0x193);}_0x1dd777=_0x53c804;return db[_0xddbe('0x6b')][_0xddbe('0x3f')]({'raw':!![]});}return null;})[_0xddbe('0x21')](function(_0x1deb68){if(_0x1deb68){_0x16f572=_[_0xddbe('0x6c')](_0x1deb68,'id');var _0xccc82c;var _0x1922e6=squel[_0xddbe('0x6d')]();_0x1922e6[_0xddbe('0x6e')](_0x38e98e[_0xddbe('0x6f')]);for(var _0x490a44=0x0;_0x490a44<_0x1dd777[_0xddbe('0x34')];_0x490a44+=0x1){_0xccc82c=_0x1dd777[_0x490a44]['MetricId']?_0x16f572[_0x1dd777[_0x490a44]['MetricId']][_0xddbe('0x70')]:_0x1dd777[_0x490a44]['field'];_0xccc82c=_0x1dd777[_0x490a44]['function']?_[_0xddbe('0x71')](_0x435f44[_0x1dd777[_0x490a44]['function']],'%s',_0xccc82c):_0xccc82c;_0xccc82c=_0x1dd777[_0x490a44][_0xddbe('0x72')]?_['replace'](_0x1f7412[_0x1dd777[_0x490a44][_0xddbe('0x72')]],'%s',_0xccc82c):_0xccc82c;if(_0x1dd777[_0x490a44][_0xddbe('0x73')]){_0x1922e6[_0xddbe('0x63')](_0xccc82c);}_0x1dd777[_0x490a44][_0xddbe('0x74')]&&_0x1922e6[_0xddbe('0x75')](_0xccc82c,_0x1dd777[_0x490a44]['orderBy']===_0xddbe('0x76')?![]:!![]);_0x1922e6['field'](_0xccc82c,_0x1dd777[_0x490a44][_0xddbe('0x77')]||_0xccc82c);}if(_0x38e98e[_0xddbe('0x78')]){_0x38e98e[_0xddbe('0x78')]=JSON[_0xddbe('0x79')](_0x38e98e[_0xddbe('0x78')]);for(var _0x21d582=0x0;_0x21d582<_0x38e98e[_0xddbe('0x78')]['length'];_0x21d582+=0x1){if(_0x38e98e[_0xddbe('0x78')][_0x21d582][_0xddbe('0x3b')]&&_[_0xddbe('0x5e')](_0x11bad6,_0x38e98e[_0xddbe('0x78')][_0x21d582]['type'])&&_0x38e98e['joins'][_0x21d582][_0xddbe('0x7a')]&&_0x38e98e['joins'][_0x21d582][_0xddbe('0x7b')]&&_0x38e98e[_0xddbe('0x78')][_0x21d582][_0xddbe('0x7c')]){_0x1922e6[_0x38e98e[_0xddbe('0x78')][_0x21d582][_0xddbe('0x3b')]](_0x38e98e[_0xddbe('0x78')][_0x21d582]['foreignTable'],null,util[_0xddbe('0x72')](_0xddbe('0x7d'),_0x38e98e[_0xddbe('0x6f')],_0x38e98e[_0xddbe('0x78')][_0x21d582][_0xddbe('0x7a')],_0x38e98e[_0xddbe('0x78')][_0x21d582]['foreignTable'],_0x38e98e[_0xddbe('0x78')][_0x21d582][_0xddbe('0x7c')]));}}}if(_0x38e98e['conditions']){_0x38e98e[_0xddbe('0x7e')]=JSON['parse'](_0x38e98e[_0xddbe('0x7e')]);_0x1922e6[_0xddbe('0x38')](_0x39e09c(_0x38e98e[_0xddbe('0x7e')]['group']));}_0x5753be=_0x1922e6[_0xddbe('0x7f')]();_0x1922e6[_0xddbe('0x36')](_0x2bdced);_0x1922e6[_0xddbe('0x1a')](0x0);logger[_0xddbe('0x80')](_0xddbe('0x81'),_0x1922e6[_0xddbe('0x82')]());return dbH[_0xddbe('0x83')][_0xddbe('0x2d')](_0x1922e6[_0xddbe('0x82')](),{'type':dbH['sequelize'][_0xddbe('0x84')][_0xddbe('0x85')]});}})[_0xddbe('0x21')](respondWithResult(_0x2812cf,null))[_0xddbe('0x40')](handleError(_0x2812cf,null));};function runReport(_0x5ac0ca,_0x5d42d2,_0x5e8a07){var _0x248a54=_0x5d42d2[_0xddbe('0x26')];var _0x3fe32c=0xa;var _0x201675=[_0xddbe('0x4f'),'left_join',_0xddbe('0x51'),'cross_join'];var _0x15690={'SUM':_0xddbe('0x52'),'COUNT':_0xddbe('0x53'),'COUNT DISTINCT':_0xddbe('0x54'),'MAX':_0xddbe('0x55'),'MIN':_0xddbe('0x56'),'AVG':_0xddbe('0x57'),'GROUP_CONCAT':_0xddbe('0x58'),'GROUP_CONCAT ASC':_0xddbe('0x59'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2225b2={'SEC_TO_TIME':_0xddbe('0x5b'),'DATE':_0xddbe('0x86'),'HOUR':'HOUR(%s)','ROUND':_0xddbe('0x5c'),'UNIX_TIMESTAMP':_0xddbe('0x5d')};var _0x5b555b=function(_0x5b9051){return!_[_0xddbe('0x5e')]([_0xddbe('0x5f'),_0xddbe('0x87'),_0xddbe('0x60'),_0xddbe('0x61')],_0x5b9051);};var _0x467dad=function(_0x570f74){if(!_0x570f74||!_0x570f74[_0xddbe('0x62')][_0xddbe('0x34')]){return'';}for(var _0x4d74ca='(',_0x4c3321=0x0;_0x4c3321<_0x570f74[_0xddbe('0x62')]['length'];_0x4c3321+=0x1){_0x4c3321>0x0&&(_0x4d74ca+='\x20'+_0x570f74['operator']+'\x20');_0x4d74ca+=_0x570f74[_0xddbe('0x62')][_0x4c3321]['group']?_0x467dad(_0x570f74[_0xddbe('0x62')][_0x4c3321]['group']):_0x570f74[_0xddbe('0x62')][_0x4c3321][_0xddbe('0x64')]+'\x20'+_0x570f74[_0xddbe('0x62')][_0x4c3321][_0xddbe('0x65')]+(_0x5b555b(_0x570f74[_0xddbe('0x62')][_0x4c3321]['condition'])?'\x20'+_0x570f74[_0xddbe('0x62')][_0x4c3321][_0xddbe('0x66')]:'');}return _0x4d74ca+')';};var _0x2f8eb4={'where':{'id':_0x5ac0ca['id']}},_0x1940fd,_0x2435f0,_0x543ada,_0x34b12f,_0x5633ba;_0x2f8eb4=_['merge']({},_0x2f8eb4,_0x5e8a07);return db[_0xddbe('0x2a')][_0xddbe('0x44')](_0x2f8eb4)[_0xddbe('0x21')](function(_0xedda6f){if(_0xedda6f){_0x1940fd=_0xedda6f;return _0xedda6f[_0xddbe('0x67')]();}return null;})['then'](function(_0x577b45){if(_0x577b45){if(!_0x577b45[_0xddbe('0x34')]){throw new db[(_0xddbe('0x68'))][(_0xddbe('0x69'))](_0xddbe('0x6a'),0x193);}_0x2435f0=_0x577b45;return db[_0xddbe('0x6b')][_0xddbe('0x3f')]({'raw':!![]});}return null;})[_0xddbe('0x21')](function(_0x2fe6ac){if(_0x2fe6ac){_0x543ada=_[_0xddbe('0x6c')](_0x2fe6ac,'id');var _0x5b3383;var _0x513632=squel['select']();_0x513632[_0xddbe('0x6e')](_0x1940fd[_0xddbe('0x6f')]);for(var _0x6f45c3=0x0;_0x6f45c3<_0x2435f0['length'];_0x6f45c3+=0x1){_0x5b3383=_0x2435f0[_0x6f45c3][_0xddbe('0x88')]?_0x543ada[_0x2435f0[_0x6f45c3][_0xddbe('0x88')]]['metric']:_0x2435f0[_0x6f45c3][_0xddbe('0x64')];_0x5b3383=_0x2435f0[_0x6f45c3]['function']?_[_0xddbe('0x71')](_0x15690[_0x2435f0[_0x6f45c3][_0xddbe('0x89')]],'%s',_0x5b3383):_0x5b3383;_0x5b3383=_0x2435f0[_0x6f45c3][_0xddbe('0x72')]?_[_0xddbe('0x71')](_0x2225b2[_0x2435f0[_0x6f45c3]['format']],'%s',_0x5b3383):_0x5b3383;if(_0x2435f0[_0x6f45c3][_0xddbe('0x73')]){_0x513632[_0xddbe('0x63')](_0x5b3383);}_0x2435f0[_0x6f45c3][_0xddbe('0x74')]&&_0x513632['order'](_0x5b3383,_0x2435f0[_0x6f45c3]['orderBy']===_0xddbe('0x76')?![]:!![]);_0x513632[_0xddbe('0x64')](_0x5b3383,_0x2435f0[_0x6f45c3]['alias']||_0x5b3383);}if(_0x1940fd[_0xddbe('0x78')]){_0x1940fd[_0xddbe('0x78')]=JSON[_0xddbe('0x79')](_0x1940fd['joins']);for(var _0x69bd29=0x0;_0x69bd29<_0x1940fd[_0xddbe('0x78')]['length'];_0x69bd29+=0x1){if(_0x1940fd[_0xddbe('0x78')][_0x69bd29][_0xddbe('0x3b')]&&_['includes'](_0x201675,_0x1940fd[_0xddbe('0x78')][_0x69bd29][_0xddbe('0x3b')])&&_0x1940fd[_0xddbe('0x78')][_0x69bd29][_0xddbe('0x7a')]&&_0x1940fd[_0xddbe('0x78')][_0x69bd29][_0xddbe('0x7b')]&&_0x1940fd[_0xddbe('0x78')][_0x69bd29]['foreignKey']){_0x513632[_0x1940fd[_0xddbe('0x78')][_0x69bd29][_0xddbe('0x3b')]](_0x1940fd[_0xddbe('0x78')][_0x69bd29][_0xddbe('0x7b')],null,util[_0xddbe('0x72')]('%s.%s\x20=\x20%s.%s',_0x1940fd['table'],_0x1940fd[_0xddbe('0x78')][_0x69bd29][_0xddbe('0x7a')],_0x1940fd[_0xddbe('0x78')][_0x69bd29]['foreignTable'],_0x1940fd[_0xddbe('0x78')][_0x69bd29][_0xddbe('0x7c')]));}}}if(_0x1940fd[_0xddbe('0x7e')]){_0x1940fd[_0xddbe('0x7e')]=JSON['parse'](_0x1940fd[_0xddbe('0x7e')]);_0x513632['where'](_0x467dad(_0x1940fd['conditions']['group']));}_0x5633ba=_0x513632[_0xddbe('0x7f')]();_0x513632[_0xddbe('0x36')](_0x3fe32c);_0x513632['offset'](0x0);return;}})['then'](function(){if(_0x5d42d2[_0xddbe('0x8a')]==='web'){return null;}var _0x142488=_[_0xddbe('0x3a')](_0x5d42d2,{'name':_0x5d42d2['fullPath']||_0x5d42d2['name']||_0x1940fd[_0xddbe('0x26')],'basename':_0x248a54,'savename':util[_0xddbe('0x72')](_0xddbe('0x8b'),_0x5d42d2[_0xddbe('0x26')]||_0x1940fd[_0xddbe('0x26')],require(_0xddbe('0x8c'))['generate'](0x4),_0x5d42d2[_0xddbe('0x8a')]||_0xddbe('0x8d')),'reportId':_0x1940fd['id'],'reportType':'custom'});return db[_0xddbe('0x8e')][_0xddbe('0x45')](_0x142488,{'raw':!![]});})['then'](function(_0x2f0906){if(_0x1940fd['table']==='cdr'){_0x5633ba[_0xddbe('0x38')](_0x1940fd[_0xddbe('0x6f')]+_0xddbe('0x8f'),_0x5d42d2[_0xddbe('0x90')],_0x5d42d2[_0xddbe('0x91')]);}else{_0x5633ba['where'](_0x1940fd[_0xddbe('0x6f')]+_0xddbe('0x92'),_0x5d42d2['startDate'],_0x5d42d2[_0xddbe('0x91')]);}if(_0x2f0906){logger[_0xddbe('0x93')](_0xddbe('0x94'),_0x5633ba[_0xddbe('0x82')]());require(_0xddbe('0x95'))[_0xddbe('0x96')](path['join'](__dirname,_0xddbe('0x97'),_0x2f0906[_0xddbe('0x8a')]),[_0x2f0906['id'],_0x5633ba['toString'](),path[_0xddbe('0x4f')](__dirname,_0xddbe('0x98'),_0x2f0906[_0xddbe('0x99')]),_0x248a54]);return _0x2f0906;}else{var _0x5d3269=squel[_0xddbe('0x6d')]();_0x5d3269[_0xddbe('0x6e')]('('+_0x5633ba[_0xddbe('0x82')]()+')','countTable');_0x5d3269['field']('COUNT(*)','count');_0x5633ba['limit'](_0x5d42d2['limit']||_0x3fe32c);_0x5633ba['offset'](_0x5d42d2[_0xddbe('0x1a')]||0x0);return dbH['sequelize'][_0xddbe('0x2d')](_0x5d3269[_0xddbe('0x82')](),{'type':dbH[_0xddbe('0x83')][_0xddbe('0x84')]['SELECT']})['then'](function(_0x2d8ae2){if(!_0x2d8ae2[_0xddbe('0x34')]){_0x34b12f=0x0;}else{_0x34b12f=_0x2d8ae2[0x0][_0xddbe('0x1c')]||0x0;}return dbH[_0xddbe('0x83')][_0xddbe('0x2d')](_0x5633ba['toString'](),{'type':dbH[_0xddbe('0x83')][_0xddbe('0x84')]['SELECT']});})[_0xddbe('0x21')](function(_0x1df444){return{'rows':_0x1df444||[],'count':_0x34b12f};});}});}exports[_0xddbe('0x9a')]=function(_0x1d02de,_0x255df6){return runReport(_0x1d02de[_0xddbe('0x41')],_0x1d02de['query'],_0x1d02de[_0xddbe('0x3d')])['then'](respondWithResult(_0x255df6,null))[_0xddbe('0x40')](handleError(_0x255df6,null));};exports[_0xddbe('0x9b')]=runReport;exports[_0xddbe('0x2d')]=function(_0x22a8bb,_0x40d4fa){var _0x4a9ab5=0xa;var _0x20ea2a=[_0xddbe('0x4f'),_0xddbe('0x50'),_0xddbe('0x51'),_0xddbe('0x9c')];var _0x2ebb11={'SUM':_0xddbe('0x52'),'COUNT':_0xddbe('0x53'),'COUNT DISTINCT':_0xddbe('0x54'),'MAX':'MAX(%s)','MIN':_0xddbe('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xddbe('0x59'),'GROUP_CONCAT DESC':_0xddbe('0x5a')};var _0x3aa9d3={'SEC_TO_TIME':_0xddbe('0x5b'),'DATE':_0xddbe('0x86'),'HOUR':_0xddbe('0x9d'),'ROUND':_0xddbe('0x5c'),'UNIX_TIMESTAMP':_0xddbe('0x5d')};var _0x418c81=function(_0x1eff51){return!_[_0xddbe('0x5e')]([_0xddbe('0x5f'),_0xddbe('0x87'),_0xddbe('0x60'),'IS\x20NOT\x20EMPTY'],_0x1eff51);};var _0x101388=function(_0x1e9d60){if(!_0x1e9d60||!_0x1e9d60[_0xddbe('0x62')][_0xddbe('0x34')]){return'';}for(var _0x428607='(',_0x2e0211=0x0;_0x2e0211<_0x1e9d60['rules'][_0xddbe('0x34')];_0x2e0211+=0x1){_0x2e0211>0x0&&(_0x428607+='\x20'+_0x1e9d60['operator']+'\x20');_0x428607+=_0x1e9d60[_0xddbe('0x62')][_0x2e0211][_0xddbe('0x63')]?_0x101388(_0x1e9d60[_0xddbe('0x62')][_0x2e0211]['group']):_0x1e9d60[_0xddbe('0x62')][_0x2e0211][_0xddbe('0x64')]+'\x20'+_0x1e9d60[_0xddbe('0x62')][_0x2e0211][_0xddbe('0x65')]+(_0x418c81(_0x1e9d60['rules'][_0x2e0211]['condition'])?'\x20'+_0x1e9d60[_0xddbe('0x62')][_0x2e0211][_0xddbe('0x66')]:'');}return _0x428607+')';};var _0x53fe2d={'where':{'id':_0x22a8bb[_0xddbe('0x41')]['id']}},_0x3dfbc1,_0x5dd3ae,_0x1ebef7,_0x4f5371,_0x10a8ac;_0x53fe2d=_[_0xddbe('0x3a')]({},_0x53fe2d,_0x22a8bb['options']);return db[_0xddbe('0x2a')][_0xddbe('0x44')](_0x53fe2d)[_0xddbe('0x21')](function(_0x363a3d){if(_0x363a3d){_0x3dfbc1=_0x363a3d;return _0x363a3d[_0xddbe('0x67')]();}return null;})[_0xddbe('0x21')](function(_0x2ef285){if(_0x2ef285){if(!_0x2ef285['length']){throw new db['Sequelize'][(_0xddbe('0x69'))](_0xddbe('0x6a'),0x193);}_0x5dd3ae=_0x2ef285;return db[_0xddbe('0x6b')][_0xddbe('0x3f')]({'raw':!![]});}return null;})[_0xddbe('0x21')](function(_0x192cf4){if(_0x192cf4){_0x1ebef7=_[_0xddbe('0x6c')](_0x192cf4,'id');var _0x273d16;var _0x2297ff=squel[_0xddbe('0x6d')]();_0x2297ff['from'](_0x3dfbc1[_0xddbe('0x6f')]);for(var _0x48207e=0x0;_0x48207e<_0x5dd3ae[_0xddbe('0x34')];_0x48207e+=0x1){_0x273d16=_0x5dd3ae[_0x48207e][_0xddbe('0x88')]?_0x1ebef7[_0x5dd3ae[_0x48207e][_0xddbe('0x88')]][_0xddbe('0x70')]:_0x5dd3ae[_0x48207e][_0xddbe('0x64')];_0x273d16=_0x5dd3ae[_0x48207e][_0xddbe('0x89')]?_[_0xddbe('0x71')](_0x2ebb11[_0x5dd3ae[_0x48207e][_0xddbe('0x89')]],'%s',_0x273d16):_0x273d16;_0x273d16=_0x5dd3ae[_0x48207e]['format']?_[_0xddbe('0x71')](_0x3aa9d3[_0x5dd3ae[_0x48207e][_0xddbe('0x72')]],'%s',_0x273d16):_0x273d16;if(_0x5dd3ae[_0x48207e][_0xddbe('0x73')]){_0x2297ff[_0xddbe('0x63')](_0x273d16);}_0x5dd3ae[_0x48207e]['orderBy']&&_0x2297ff[_0xddbe('0x75')](_0x273d16,_0x5dd3ae[_0x48207e][_0xddbe('0x74')]===_0xddbe('0x76')?![]:!![]);_0x2297ff[_0xddbe('0x64')](_0x273d16,_0x5dd3ae[_0x48207e][_0xddbe('0x77')]||_0x273d16);}if(_0x3dfbc1[_0xddbe('0x78')]){_0x3dfbc1[_0xddbe('0x78')]=JSON[_0xddbe('0x79')](_0x3dfbc1[_0xddbe('0x78')]);for(var _0x1f240f=0x0;_0x1f240f<_0x3dfbc1[_0xddbe('0x78')]['length'];_0x1f240f+=0x1){if(_0x3dfbc1[_0xddbe('0x78')][_0x1f240f][_0xddbe('0x3b')]&&_[_0xddbe('0x5e')](_0x20ea2a,_0x3dfbc1['joins'][_0x1f240f]['type'])&&_0x3dfbc1[_0xddbe('0x78')][_0x1f240f][_0xddbe('0x7a')]&&_0x3dfbc1[_0xddbe('0x78')][_0x1f240f][_0xddbe('0x7b')]&&_0x3dfbc1[_0xddbe('0x78')][_0x1f240f][_0xddbe('0x7c')]){_0x2297ff[_0x3dfbc1[_0xddbe('0x78')][_0x1f240f][_0xddbe('0x3b')]](_0x3dfbc1[_0xddbe('0x78')][_0x1f240f][_0xddbe('0x7b')],null,util[_0xddbe('0x72')](_0xddbe('0x7d'),_0x3dfbc1['table'],_0x3dfbc1[_0xddbe('0x78')][_0x1f240f]['parentKey'],_0x3dfbc1[_0xddbe('0x78')][_0x1f240f]['foreignTable'],_0x3dfbc1[_0xddbe('0x78')][_0x1f240f][_0xddbe('0x7c')]));}}}if(_0x3dfbc1[_0xddbe('0x7e')]){_0x3dfbc1[_0xddbe('0x7e')]=JSON[_0xddbe('0x79')](_0x3dfbc1[_0xddbe('0x7e')]);_0x2297ff[_0xddbe('0x38')](_0x101388(_0x3dfbc1[_0xddbe('0x7e')][_0xddbe('0x63')]));}_0x10a8ac=_0x2297ff['clone']();_0x2297ff[_0xddbe('0x36')](_0x4a9ab5);_0x2297ff[_0xddbe('0x1a')](0x0);logger[_0xddbe('0x80')]('Limited\x20Query:',_0x2297ff[_0xddbe('0x82')]());return dbH['sequelize'][_0xddbe('0x2d')](_0x2297ff[_0xddbe('0x82')](),{'type':dbH[_0xddbe('0x83')][_0xddbe('0x84')]['SELECT']});}})['then'](function(){return{'sql':_0x10a8ac[_0xddbe('0x82')]()};})[_0xddbe('0x21')](respondWithResult(_0x40d4fa,null))[_0xddbe('0x40')](handleError(_0x40d4fa,null));};
\ No newline at end of file
+var _0x95c3=['nolimit','order','sort','where','pick','merge','type','VIRTUAL','options','includeAll','include','AnalyticCustomReport','findAll','rows','catch','show','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','Reports','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','from','MetricId','metric','function','replace','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20NOT\x20NULL','Please\x20insert\x20at\x20least\x20one\x20field','select','output','web','fullPath','randomstring','csv','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','run','SUM(%s)','SEC_TO_TIME(%s)','IS\x20NULL','IS\x20EMPTY','groupBy','Limited\x20Query:','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','CustomReports','UserProfileResource','error','stack','name','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty'];(function(_0x29ce11,_0x3887ab){var _0x255fa8=function(_0x4b5475){while(--_0x4b5475){_0x29ce11['push'](_0x29ce11['shift']());}};_0x255fa8(++_0x3887ab);}(_0x95c3,0x6d));var _0x395c=function(_0x52f1e6,_0xf70489){_0x52f1e6=_0x52f1e6-0x0;var _0x21f104=_0x95c3[_0x52f1e6];return _0x21f104;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x395c('0x0'));var jsonpatch=require(_0x395c('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x395c('0x2'));var Mustache=require(_0x395c('0x3'));var util=require(_0x395c('0x4'));var path=require(_0x395c('0x5'));var sox=require(_0x395c('0x6'));var csv=require('to-csv');var ejs=require(_0x395c('0x7'));var fs=require('fs');var fs_extra=require(_0x395c('0x8'));var _=require(_0x395c('0x9'));var squel=require(_0x395c('0xa'));var crypto=require(_0x395c('0xb'));var jsforce=require(_0x395c('0xc'));var deskjs=require(_0x395c('0xd'));var toCsv=require(_0x395c('0xe'));var querystring=require(_0x395c('0xf'));var Papa=require(_0x395c('0x10'));var Redis=require(_0x395c('0x11'));var authService=require(_0x395c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x395c('0x13'));var hardwareService=require(_0x395c('0x14'));var logger=require(_0x395c('0x15'))(_0x395c('0x16'));var utils=require('../../config/utils');var config=require(_0x395c('0x17'));var licenseUtil=require(_0x395c('0x18'));var db=require('../../mysqldb')['db'];var dbH=require(_0x395c('0x19'))[_0x395c('0x1a')];function respondWithStatusCode(_0x2d5125,_0x3cba31){_0x3cba31=_0x3cba31||0xcc;return function(_0x4ffd1f){if(_0x4ffd1f){return _0x2d5125[_0x395c('0x1b')](_0x3cba31);}return _0x2d5125['status'](_0x3cba31)['end']();};}function respondWithResult(_0x493e3b,_0x3173d9){_0x3173d9=_0x3173d9||0xc8;return function(_0x134bf5){if(_0x134bf5){return _0x493e3b[_0x395c('0x1c')](_0x3173d9)[_0x395c('0x1d')](_0x134bf5);}};}function respondWithFilteredResult(_0x2a60d6,_0x5e498e){return function(_0x24b7ba){if(_0x24b7ba){var _0x265c93=typeof _0x5e498e[_0x395c('0x1e')]===_0x395c('0x1f')&&typeof _0x5e498e[_0x395c('0x20')]===_0x395c('0x1f');var _0x55516b=_0x24b7ba['count'];var _0x202efc=_0x265c93?0x0:_0x5e498e[_0x395c('0x1e')];var _0xefe87b=_0x265c93?_0x24b7ba[_0x395c('0x21')]:_0x5e498e[_0x395c('0x1e')]+_0x5e498e['limit'];var _0x5b117e;if(_0xefe87b>=_0x55516b){_0xefe87b=_0x55516b;_0x5b117e=0xc8;}else{_0x5b117e=0xce;}_0x2a60d6[_0x395c('0x1c')](_0x5b117e);return _0x2a60d6[_0x395c('0x22')](_0x395c('0x23'),_0x202efc+'-'+_0xefe87b+'/'+_0x55516b)[_0x395c('0x1d')](_0x24b7ba);}return null;};}function patchUpdates(_0x164628){return function(_0x1c2e7a){try{jsonpatch[_0x395c('0x24')](_0x1c2e7a,_0x164628,!![]);}catch(_0x2c3882){return BPromise[_0x395c('0x25')](_0x2c3882);}return _0x1c2e7a[_0x395c('0x26')]();};}function saveUpdates(_0x160e3b,_0x30eeec){return function(_0x41d2ae){if(_0x41d2ae){return _0x41d2ae[_0x395c('0x27')](_0x160e3b)[_0x395c('0x28')](function(_0x520ee6){return _0x520ee6;});}return null;};}function removeEntity(_0x404384,_0x221350){return function(_0x56faad){if(_0x56faad){return _0x56faad[_0x395c('0x29')]()[_0x395c('0x28')](function(){var _0x6e557f=_0x56faad['get']({'plain':!![]});var _0x977443=_0x395c('0x2a');return db[_0x395c('0x2b')][_0x395c('0x29')]({'where':{'type':_0x977443,'resourceId':_0x6e557f['id']}})[_0x395c('0x28')](function(){return _0x56faad;});})['then'](function(){_0x404384[_0x395c('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d4b54,_0x328a2c){return function(_0xc609e5){if(!_0xc609e5){_0x2d4b54[_0x395c('0x1b')](0x194);}return _0xc609e5;};}function handleError(_0x1c33f4,_0x26343c){_0x26343c=_0x26343c||0x1f4;return function(_0x393c50){logger[_0x395c('0x2c')](_0x393c50[_0x395c('0x2d')]);if(_0x393c50['name']){delete _0x393c50[_0x395c('0x2e')];}_0x1c33f4[_0x395c('0x1c')](_0x26343c)['send'](_0x393c50);};}exports[_0x395c('0x2f')]=function(_0x2625b7,_0xdb4d05){var _0x453680={},_0x3f6a1d={},_0x3130ad={'count':0x0,'rows':[]};var _0x5159ab=_[_0x395c('0x30')](db['AnalyticCustomReport'][_0x395c('0x31')],function(_0x4189b4){return{'name':_0x4189b4[_0x395c('0x32')],'type':_0x4189b4['type']['key']};});_0x3f6a1d[_0x395c('0x33')]=_[_0x395c('0x30')](_0x5159ab,'name');_0x3f6a1d[_0x395c('0x34')]=_[_0x395c('0x35')](_0x2625b7[_0x395c('0x34')]);_0x3f6a1d[_0x395c('0x36')]=_[_0x395c('0x37')](_0x3f6a1d[_0x395c('0x33')],_0x3f6a1d[_0x395c('0x34')]);_0x453680[_0x395c('0x38')]=_[_0x395c('0x37')](_0x3f6a1d[_0x395c('0x33')],qs[_0x395c('0x39')](_0x2625b7[_0x395c('0x34')][_0x395c('0x39')]));_0x453680[_0x395c('0x38')]=_0x453680['attributes']['length']?_0x453680[_0x395c('0x38')]:_0x3f6a1d[_0x395c('0x33')];if(!_0x2625b7[_0x395c('0x34')][_0x395c('0x3a')](_0x395c('0x3b'))){_0x453680[_0x395c('0x20')]=qs[_0x395c('0x20')](_0x2625b7['query'][_0x395c('0x20')]);_0x453680[_0x395c('0x1e')]=qs[_0x395c('0x1e')](_0x2625b7['query'][_0x395c('0x1e')]);}_0x453680[_0x395c('0x3c')]=qs[_0x395c('0x3d')](_0x2625b7['query']['sort']);_0x453680[_0x395c('0x3e')]=qs['filters'](_[_0x395c('0x3f')](_0x2625b7[_0x395c('0x34')],_0x3f6a1d[_0x395c('0x36')]),_0x5159ab);if(_0x2625b7['query']['filter']){_0x453680[_0x395c('0x3e')]=_[_0x395c('0x40')](_0x453680['where'],{'$or':_['map'](_0x5159ab,function(_0x1028d5){if(_0x1028d5[_0x395c('0x41')]!==_0x395c('0x42')){var _0x181e33={};_0x181e33[_0x1028d5[_0x395c('0x2e')]]={'$like':'%'+_0x2625b7[_0x395c('0x34')]['filter']+'%'};return _0x181e33;}})});}_0x453680=_['merge']({},_0x453680,_0x2625b7[_0x395c('0x43')]);var _0x22d7aa={'where':_0x453680[_0x395c('0x3e')]};return db['AnalyticCustomReport'][_0x395c('0x21')](_0x22d7aa)['then'](function(_0x3421f8){_0x3130ad[_0x395c('0x21')]=_0x3421f8;if(_0x2625b7['query'][_0x395c('0x44')]){_0x453680[_0x395c('0x45')]=[{'all':!![]}];}return db[_0x395c('0x46')][_0x395c('0x47')](_0x453680);})[_0x395c('0x28')](function(_0x8474af){_0x3130ad[_0x395c('0x48')]=_0x8474af;return _0x3130ad;})[_0x395c('0x28')](respondWithFilteredResult(_0xdb4d05,_0x453680))[_0x395c('0x49')](handleError(_0xdb4d05,null));};exports[_0x395c('0x4a')]=function(_0x3c59a2,_0x5dfba4){var _0x4b47d9={'raw':![],'where':{'id':_0x3c59a2['params']['id']}},_0x596819={};_0x596819[_0x395c('0x33')]=_[_0x395c('0x35')](db[_0x395c('0x46')][_0x395c('0x31')]);_0x596819[_0x395c('0x34')]=_['keys'](_0x3c59a2['query']);_0x596819[_0x395c('0x36')]=_['intersection'](_0x596819[_0x395c('0x33')],_0x596819[_0x395c('0x34')]);_0x4b47d9[_0x395c('0x38')]=_[_0x395c('0x37')](_0x596819[_0x395c('0x33')],qs[_0x395c('0x39')](_0x3c59a2[_0x395c('0x34')][_0x395c('0x39')]));_0x4b47d9[_0x395c('0x38')]=_0x4b47d9['attributes'][_0x395c('0x4b')]?_0x4b47d9[_0x395c('0x38')]:_0x596819[_0x395c('0x33')];if(_0x3c59a2[_0x395c('0x34')][_0x395c('0x44')]){_0x4b47d9[_0x395c('0x45')]=[{'all':!![]}];}_0x4b47d9=_['merge']({},_0x4b47d9,_0x3c59a2[_0x395c('0x43')]);return db['AnalyticCustomReport'][_0x395c('0x4c')](_0x4b47d9)['then'](handleEntityNotFound(_0x5dfba4,null))['then'](respondWithResult(_0x5dfba4,null))[_0x395c('0x49')](handleError(_0x5dfba4,null));};exports[_0x395c('0x4d')]=function(_0x432cb4,_0x2a4979){return db[_0x395c('0x46')][_0x395c('0x4d')](_0x432cb4[_0x395c('0x4e')],{})[_0x395c('0x28')](function(_0x1c6520){var _0x4a053f=_0x432cb4['user']['get']({'plain':!![]});if(!_0x4a053f)throw new Error(_0x395c('0x4f'));if(_0x4a053f[_0x395c('0x50')]===_0x395c('0x51')){var _0x52f975=_0x1c6520[_0x395c('0x52')]({'plain':!![]});var _0x3710ed=_0x395c('0x53');return db['UserProfileSection'][_0x395c('0x4c')]({'where':{'name':_0x3710ed,'userProfileId':_0x4a053f['userProfileId']},'raw':!![]})[_0x395c('0x28')](function(_0x47735e){if(_0x47735e&&_0x47735e[_0x395c('0x54')]===0x0){return db[_0x395c('0x2b')]['create']({'name':_0x52f975[_0x395c('0x2e')],'resourceId':_0x52f975['id'],'type':_0x395c('0x2a'),'sectionId':_0x47735e['id']},{})['then'](function(){return _0x1c6520;});}else{return _0x1c6520;}})['catch'](function(_0x535cc1){logger['error'](_0x395c('0x55'),_0x535cc1);throw _0x535cc1;});}return _0x1c6520;})[_0x395c('0x28')](respondWithResult(_0x2a4979,0xc9))['catch'](handleError(_0x2a4979,null));};exports['update']=function(_0x5a8889,_0x31f41b){if(_0x5a8889['body']['id']){delete _0x5a8889[_0x395c('0x4e')]['id'];}return db[_0x395c('0x46')][_0x395c('0x4c')]({'where':{'id':_0x5a8889['params']['id']}})[_0x395c('0x28')](handleEntityNotFound(_0x31f41b,null))[_0x395c('0x28')](saveUpdates(_0x5a8889[_0x395c('0x4e')],null))['then'](respondWithResult(_0x31f41b,null))['catch'](handleError(_0x31f41b,null));};exports[_0x395c('0x29')]=function(_0x4e7928,_0x5dde80){return db['AnalyticCustomReport'][_0x395c('0x4c')]({'where':{'id':_0x4e7928[_0x395c('0x56')]['id']}})[_0x395c('0x28')](handleEntityNotFound(_0x5dde80,null))[_0x395c('0x28')](removeEntity(_0x5dde80,null))[_0x395c('0x49')](handleError(_0x5dde80,null));};exports[_0x395c('0x57')]=function(_0x4a319e,_0x351f54){var _0x455648=0xa;var _0x59d63f=[_0x395c('0x58'),_0x395c('0x59'),_0x395c('0x5a'),_0x395c('0x5b')];var _0x240f99={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x395c('0x5c'),'MAX':_0x395c('0x5d'),'MIN':_0x395c('0x5e'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x395c('0x5f'),'GROUP_CONCAT ASC':_0x395c('0x60'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1cee20={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x395c('0x61'),'HOUR':_0x395c('0x62'),'ROUND':_0x395c('0x63'),'UNIX_TIMESTAMP':_0x395c('0x64')};var _0x32c356=function(_0x156ace){return!_[_0x395c('0x65')](['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY',_0x395c('0x66')],_0x156ace);};var _0x208d6d=function(_0xbb1a7){if(!_0xbb1a7||!_0xbb1a7['rules'][_0x395c('0x4b')]){return'';}for(var _0x272e13='(',_0x136fca=0x0;_0x136fca<_0xbb1a7[_0x395c('0x67')]['length'];_0x136fca+=0x1){_0x136fca>0x0&&(_0x272e13+='\x20'+_0xbb1a7[_0x395c('0x68')]+'\x20');_0x272e13+=_0xbb1a7[_0x395c('0x67')][_0x136fca]['group']?_0x208d6d(_0xbb1a7[_0x395c('0x67')][_0x136fca][_0x395c('0x69')]):_0xbb1a7[_0x395c('0x67')][_0x136fca][_0x395c('0x6a')]+'\x20'+_0xbb1a7[_0x395c('0x67')][_0x136fca][_0x395c('0x6b')]+(_0x32c356(_0xbb1a7[_0x395c('0x67')][_0x136fca][_0x395c('0x6b')])?'\x20'+_0xbb1a7[_0x395c('0x67')][_0x136fca][_0x395c('0x6c')]:'');}return _0x272e13+')';};var _0x3bda2a={'where':{'id':_0x4a319e[_0x395c('0x56')]['id']}},_0x227331,_0x3daee5,_0x353b19,_0x3cdb8f,_0x34f5b3;_0x3bda2a=_['merge']({},_0x3bda2a,_0x4a319e[_0x395c('0x43')]);return db[_0x395c('0x46')]['find'](_0x3bda2a)[_0x395c('0x28')](function(_0x2c02ef){if(_0x2c02ef){_0x227331=_0x2c02ef;return _0x2c02ef[_0x395c('0x6d')]();}return null;})[_0x395c('0x28')](function(_0x566612){if(_0x566612){if(!_0x566612['length']){throw new db[(_0x395c('0x6e'))][(_0x395c('0x6f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3daee5=_0x566612;return db[_0x395c('0x70')][_0x395c('0x47')]({'raw':!![]});}return null;})[_0x395c('0x28')](function(_0xd72304){if(_0xd72304){_0x353b19=_[_0x395c('0x71')](_0xd72304,'id');var _0xa8d112;var _0x21a9a=squel['select']();_0x21a9a[_0x395c('0x72')](_0x227331['table']);for(var _0xd2bef9=0x0;_0xd2bef9<_0x3daee5[_0x395c('0x4b')];_0xd2bef9+=0x1){_0xa8d112=_0x3daee5[_0xd2bef9]['MetricId']?_0x353b19[_0x3daee5[_0xd2bef9][_0x395c('0x73')]][_0x395c('0x74')]:_0x3daee5[_0xd2bef9][_0x395c('0x6a')];_0xa8d112=_0x3daee5[_0xd2bef9][_0x395c('0x75')]?_[_0x395c('0x76')](_0x240f99[_0x3daee5[_0xd2bef9][_0x395c('0x75')]],'%s',_0xa8d112):_0xa8d112;_0xa8d112=_0x3daee5[_0xd2bef9][_0x395c('0x77')]?_[_0x395c('0x76')](_0x1cee20[_0x3daee5[_0xd2bef9][_0x395c('0x77')]],'%s',_0xa8d112):_0xa8d112;if(_0x3daee5[_0xd2bef9]['groupBy']){_0x21a9a[_0x395c('0x69')](_0xa8d112);}_0x3daee5[_0xd2bef9]['orderBy']&&_0x21a9a[_0x395c('0x3c')](_0xa8d112,_0x3daee5[_0xd2bef9][_0x395c('0x78')]===_0x395c('0x79')?![]:!![]);_0x21a9a[_0x395c('0x6a')](_0xa8d112,_0x3daee5[_0xd2bef9][_0x395c('0x7a')]||_0xa8d112);}if(_0x227331[_0x395c('0x7b')]){_0x227331[_0x395c('0x7b')]=JSON[_0x395c('0x7c')](_0x227331[_0x395c('0x7b')]);for(var _0xe4c769=0x0;_0xe4c769<_0x227331['joins'][_0x395c('0x4b')];_0xe4c769+=0x1){if(_0x227331[_0x395c('0x7b')][_0xe4c769][_0x395c('0x41')]&&_[_0x395c('0x65')](_0x59d63f,_0x227331[_0x395c('0x7b')][_0xe4c769][_0x395c('0x41')])&&_0x227331[_0x395c('0x7b')][_0xe4c769][_0x395c('0x7d')]&&_0x227331[_0x395c('0x7b')][_0xe4c769][_0x395c('0x7e')]&&_0x227331[_0x395c('0x7b')][_0xe4c769][_0x395c('0x7f')]){_0x21a9a[_0x227331[_0x395c('0x7b')][_0xe4c769][_0x395c('0x41')]](_0x227331[_0x395c('0x7b')][_0xe4c769][_0x395c('0x7e')],null,util[_0x395c('0x77')](_0x395c('0x80'),_0x227331[_0x395c('0x81')],_0x227331['joins'][_0xe4c769][_0x395c('0x7d')],_0x227331['joins'][_0xe4c769]['foreignTable'],_0x227331[_0x395c('0x7b')][_0xe4c769][_0x395c('0x7f')]));}}}if(_0x227331[_0x395c('0x82')]){_0x227331[_0x395c('0x82')]=JSON[_0x395c('0x7c')](_0x227331[_0x395c('0x82')]);_0x21a9a[_0x395c('0x3e')](_0x208d6d(_0x227331[_0x395c('0x82')][_0x395c('0x69')]));}_0x34f5b3=_0x21a9a[_0x395c('0x83')]();_0x21a9a[_0x395c('0x20')](_0x455648);_0x21a9a[_0x395c('0x1e')](0x0);logger[_0x395c('0x84')]('Limited\x20Query:',_0x21a9a[_0x395c('0x85')]());return dbH[_0x395c('0x86')][_0x395c('0x34')](_0x21a9a[_0x395c('0x85')](),{'type':dbH[_0x395c('0x86')][_0x395c('0x87')][_0x395c('0x88')]});}})[_0x395c('0x28')](respondWithResult(_0x351f54,null))[_0x395c('0x49')](handleError(_0x351f54,null));};function runReport(_0x52faf5,_0x429758,_0x30c58d){var _0x3430f0=_0x429758[_0x395c('0x2e')];var _0x355de9=0xa;var _0x2132af=[_0x395c('0x58'),_0x395c('0x59'),'right_join',_0x395c('0x5b')];var _0x5c3d60={'SUM':'SUM(%s)','COUNT':_0x395c('0x89'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x395c('0x8a'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x395c('0x60'),'GROUP_CONCAT DESC':_0x395c('0x8b')};var _0x261770={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x395c('0x61'),'HOUR':_0x395c('0x62'),'ROUND':_0x395c('0x63'),'UNIX_TIMESTAMP':_0x395c('0x64')};var _0x504672=function(_0x1c8ecb){return!_['includes'](['IS\x20NULL',_0x395c('0x8c'),'IS\x20EMPTY',_0x395c('0x66')],_0x1c8ecb);};var _0x117d2c=function(_0x2e9031){if(!_0x2e9031||!_0x2e9031[_0x395c('0x67')][_0x395c('0x4b')]){return'';}for(var _0x5ed96f='(',_0xf2e9dd=0x0;_0xf2e9dd<_0x2e9031[_0x395c('0x67')][_0x395c('0x4b')];_0xf2e9dd+=0x1){_0xf2e9dd>0x0&&(_0x5ed96f+='\x20'+_0x2e9031['operator']+'\x20');_0x5ed96f+=_0x2e9031[_0x395c('0x67')][_0xf2e9dd][_0x395c('0x69')]?_0x117d2c(_0x2e9031['rules'][_0xf2e9dd][_0x395c('0x69')]):_0x2e9031['rules'][_0xf2e9dd][_0x395c('0x6a')]+'\x20'+_0x2e9031[_0x395c('0x67')][_0xf2e9dd][_0x395c('0x6b')]+(_0x504672(_0x2e9031[_0x395c('0x67')][_0xf2e9dd]['condition'])?'\x20'+_0x2e9031['rules'][_0xf2e9dd][_0x395c('0x6c')]:'');}return _0x5ed96f+')';};var _0x706699={'where':{'id':_0x52faf5['id']}},_0x465df4,_0x2de332,_0x391be6,_0x3fa8cf,_0x20c968;_0x706699=_[_0x395c('0x40')]({},_0x706699,_0x30c58d);return db[_0x395c('0x46')][_0x395c('0x4c')](_0x706699)[_0x395c('0x28')](function(_0x10d1f8){if(_0x10d1f8){_0x465df4=_0x10d1f8;return _0x10d1f8[_0x395c('0x6d')]();}return null;})[_0x395c('0x28')](function(_0x126f6c){if(_0x126f6c){if(!_0x126f6c['length']){throw new db[(_0x395c('0x6e'))][(_0x395c('0x6f'))](_0x395c('0x8d'),0x193);}_0x2de332=_0x126f6c;return db[_0x395c('0x70')]['findAll']({'raw':!![]});}return null;})[_0x395c('0x28')](function(_0xe8d66c){if(_0xe8d66c){_0x391be6=_[_0x395c('0x71')](_0xe8d66c,'id');var _0x516bad;var _0x52ecbf=squel[_0x395c('0x8e')]();_0x52ecbf[_0x395c('0x72')](_0x465df4['table']);for(var _0x46a431=0x0;_0x46a431<_0x2de332['length'];_0x46a431+=0x1){_0x516bad=_0x2de332[_0x46a431][_0x395c('0x73')]?_0x391be6[_0x2de332[_0x46a431][_0x395c('0x73')]]['metric']:_0x2de332[_0x46a431][_0x395c('0x6a')];_0x516bad=_0x2de332[_0x46a431]['function']?_[_0x395c('0x76')](_0x5c3d60[_0x2de332[_0x46a431]['function']],'%s',_0x516bad):_0x516bad;_0x516bad=_0x2de332[_0x46a431][_0x395c('0x77')]?_[_0x395c('0x76')](_0x261770[_0x2de332[_0x46a431][_0x395c('0x77')]],'%s',_0x516bad):_0x516bad;if(_0x2de332[_0x46a431]['groupBy']){_0x52ecbf['group'](_0x516bad);}_0x2de332[_0x46a431][_0x395c('0x78')]&&_0x52ecbf[_0x395c('0x3c')](_0x516bad,_0x2de332[_0x46a431]['orderBy']===_0x395c('0x79')?![]:!![]);_0x52ecbf[_0x395c('0x6a')](_0x516bad,_0x2de332[_0x46a431]['alias']||_0x516bad);}if(_0x465df4['joins']){_0x465df4[_0x395c('0x7b')]=JSON[_0x395c('0x7c')](_0x465df4[_0x395c('0x7b')]);for(var _0x38dc7b=0x0;_0x38dc7b<_0x465df4[_0x395c('0x7b')][_0x395c('0x4b')];_0x38dc7b+=0x1){if(_0x465df4[_0x395c('0x7b')][_0x38dc7b][_0x395c('0x41')]&&_[_0x395c('0x65')](_0x2132af,_0x465df4['joins'][_0x38dc7b][_0x395c('0x41')])&&_0x465df4[_0x395c('0x7b')][_0x38dc7b]['parentKey']&&_0x465df4[_0x395c('0x7b')][_0x38dc7b][_0x395c('0x7e')]&&_0x465df4[_0x395c('0x7b')][_0x38dc7b][_0x395c('0x7f')]){_0x52ecbf[_0x465df4[_0x395c('0x7b')][_0x38dc7b][_0x395c('0x41')]](_0x465df4[_0x395c('0x7b')][_0x38dc7b]['foreignTable'],null,util[_0x395c('0x77')]('%s.%s\x20=\x20%s.%s',_0x465df4['table'],_0x465df4[_0x395c('0x7b')][_0x38dc7b][_0x395c('0x7d')],_0x465df4[_0x395c('0x7b')][_0x38dc7b][_0x395c('0x7e')],_0x465df4[_0x395c('0x7b')][_0x38dc7b]['foreignKey']));}}}if(_0x465df4[_0x395c('0x82')]){_0x465df4[_0x395c('0x82')]=JSON[_0x395c('0x7c')](_0x465df4[_0x395c('0x82')]);_0x52ecbf['where'](_0x117d2c(_0x465df4['conditions']['group']));}_0x20c968=_0x52ecbf['clone']();_0x52ecbf[_0x395c('0x20')](_0x355de9);_0x52ecbf[_0x395c('0x1e')](0x0);return;}})['then'](function(){if(_0x429758[_0x395c('0x8f')]===_0x395c('0x90')){return null;}var _0x67fcf4=_[_0x395c('0x40')](_0x429758,{'name':_0x429758[_0x395c('0x91')]||_0x429758[_0x395c('0x2e')]||_0x465df4['name'],'basename':_0x3430f0,'savename':util[_0x395c('0x77')]('%s-%s.%s',_0x429758['name']||_0x465df4[_0x395c('0x2e')],require(_0x395c('0x92'))['generate'](0x4),_0x429758['output']||_0x395c('0x93')),'reportId':_0x465df4['id'],'reportType':_0x395c('0x94')});return db['AnalyticExtractedReport'][_0x395c('0x4d')](_0x67fcf4,{'raw':!![]});})[_0x395c('0x28')](function(_0x28098f){if(_0x465df4['table']===_0x395c('0x95')){_0x20c968[_0x395c('0x3e')](_0x465df4[_0x395c('0x81')]+_0x395c('0x96'),_0x429758[_0x395c('0x97')],_0x429758[_0x395c('0x98')]);}else{_0x20c968['where'](_0x465df4[_0x395c('0x81')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x429758[_0x395c('0x97')],_0x429758['endDate']);}if(_0x28098f){logger[_0x395c('0x99')](_0x395c('0x9a'),_0x20c968[_0x395c('0x85')]());require(_0x395c('0x9b'))[_0x395c('0x9c')](path['join'](__dirname,_0x395c('0x9d'),_0x28098f['output']),[_0x28098f['id'],_0x20c968['toString'](),path[_0x395c('0x58')](__dirname,'../../files/reports',_0x28098f[_0x395c('0x9e')]),_0x3430f0]);return _0x28098f;}else{var _0x260ea1=squel[_0x395c('0x8e')]();_0x260ea1[_0x395c('0x72')]('('+_0x20c968[_0x395c('0x85')]()+')',_0x395c('0x9f'));_0x260ea1['field'](_0x395c('0xa0'),_0x395c('0x21'));_0x20c968['limit'](_0x429758[_0x395c('0x20')]||_0x355de9);_0x20c968['offset'](_0x429758['offset']||0x0);return dbH[_0x395c('0x86')][_0x395c('0x34')](_0x260ea1[_0x395c('0x85')](),{'type':dbH['sequelize']['QueryTypes'][_0x395c('0x88')]})[_0x395c('0x28')](function(_0x541db6){if(!_0x541db6[_0x395c('0x4b')]){_0x3fa8cf=0x0;}else{_0x3fa8cf=_0x541db6[0x0][_0x395c('0x21')]||0x0;}return dbH['sequelize'][_0x395c('0x34')](_0x20c968[_0x395c('0x85')](),{'type':dbH[_0x395c('0x86')][_0x395c('0x87')]['SELECT']});})['then'](function(_0x5f4be7){return{'rows':_0x5f4be7||[],'count':_0x3fa8cf};});}});}exports[_0x395c('0xa1')]=function(_0x4a7bf5,_0x27d594){return runReport(_0x4a7bf5[_0x395c('0x56')],_0x4a7bf5[_0x395c('0x34')],_0x4a7bf5[_0x395c('0x43')])[_0x395c('0x28')](respondWithResult(_0x27d594,null))[_0x395c('0x49')](handleError(_0x27d594,null));};exports['runReport']=runReport;exports['query']=function(_0x4bc3ab,_0x39ef20){var _0x20b9d1=0xa;var _0x23635d=['join',_0x395c('0x59'),_0x395c('0x5a'),_0x395c('0x5b')];var _0xb51bff={'SUM':_0x395c('0xa2'),'COUNT':_0x395c('0x89'),'COUNT DISTINCT':_0x395c('0x5c'),'MAX':'MAX(%s)','MIN':_0x395c('0x5e'),'AVG':_0x395c('0x8a'),'GROUP_CONCAT':_0x395c('0x5f'),'GROUP_CONCAT ASC':_0x395c('0x60'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x441b08={'SEC_TO_TIME':_0x395c('0xa3'),'DATE':_0x395c('0x61'),'HOUR':_0x395c('0x62'),'ROUND':_0x395c('0x63'),'UNIX_TIMESTAMP':_0x395c('0x64')};var _0x19fe31=function(_0x1e199c){return!_[_0x395c('0x65')]([_0x395c('0xa4'),_0x395c('0x8c'),_0x395c('0xa5'),'IS\x20NOT\x20EMPTY'],_0x1e199c);};var _0x4bd290=function(_0x1e9560){if(!_0x1e9560||!_0x1e9560[_0x395c('0x67')][_0x395c('0x4b')]){return'';}for(var _0x57c75e='(',_0x18bae9=0x0;_0x18bae9<_0x1e9560[_0x395c('0x67')][_0x395c('0x4b')];_0x18bae9+=0x1){_0x18bae9>0x0&&(_0x57c75e+='\x20'+_0x1e9560['operator']+'\x20');_0x57c75e+=_0x1e9560[_0x395c('0x67')][_0x18bae9][_0x395c('0x69')]?_0x4bd290(_0x1e9560[_0x395c('0x67')][_0x18bae9][_0x395c('0x69')]):_0x1e9560[_0x395c('0x67')][_0x18bae9]['field']+'\x20'+_0x1e9560[_0x395c('0x67')][_0x18bae9][_0x395c('0x6b')]+(_0x19fe31(_0x1e9560['rules'][_0x18bae9][_0x395c('0x6b')])?'\x20'+_0x1e9560[_0x395c('0x67')][_0x18bae9][_0x395c('0x6c')]:'');}return _0x57c75e+')';};var _0x58b238={'where':{'id':_0x4bc3ab[_0x395c('0x56')]['id']}},_0x2c235b,_0x2264d9,_0x203dbd,_0x5043f9,_0x320baf;_0x58b238=_[_0x395c('0x40')]({},_0x58b238,_0x4bc3ab[_0x395c('0x43')]);return db['AnalyticCustomReport']['find'](_0x58b238)['then'](function(_0x3e90e3){if(_0x3e90e3){_0x2c235b=_0x3e90e3;return _0x3e90e3['getFields']();}return null;})[_0x395c('0x28')](function(_0xefad23){if(_0xefad23){if(!_0xefad23['length']){throw new db[(_0x395c('0x6e'))][(_0x395c('0x6f'))](_0x395c('0x8d'),0x193);}_0x2264d9=_0xefad23;return db[_0x395c('0x70')][_0x395c('0x47')]({'raw':!![]});}return null;})[_0x395c('0x28')](function(_0x468ffa){if(_0x468ffa){_0x203dbd=_[_0x395c('0x71')](_0x468ffa,'id');var _0x53f6e7;var _0x2b4696=squel[_0x395c('0x8e')]();_0x2b4696[_0x395c('0x72')](_0x2c235b[_0x395c('0x81')]);for(var _0x2ac5d5=0x0;_0x2ac5d5<_0x2264d9[_0x395c('0x4b')];_0x2ac5d5+=0x1){_0x53f6e7=_0x2264d9[_0x2ac5d5][_0x395c('0x73')]?_0x203dbd[_0x2264d9[_0x2ac5d5][_0x395c('0x73')]][_0x395c('0x74')]:_0x2264d9[_0x2ac5d5][_0x395c('0x6a')];_0x53f6e7=_0x2264d9[_0x2ac5d5][_0x395c('0x75')]?_[_0x395c('0x76')](_0xb51bff[_0x2264d9[_0x2ac5d5][_0x395c('0x75')]],'%s',_0x53f6e7):_0x53f6e7;_0x53f6e7=_0x2264d9[_0x2ac5d5][_0x395c('0x77')]?_[_0x395c('0x76')](_0x441b08[_0x2264d9[_0x2ac5d5][_0x395c('0x77')]],'%s',_0x53f6e7):_0x53f6e7;if(_0x2264d9[_0x2ac5d5][_0x395c('0xa6')]){_0x2b4696[_0x395c('0x69')](_0x53f6e7);}_0x2264d9[_0x2ac5d5][_0x395c('0x78')]&&_0x2b4696['order'](_0x53f6e7,_0x2264d9[_0x2ac5d5]['orderBy']===_0x395c('0x79')?![]:!![]);_0x2b4696[_0x395c('0x6a')](_0x53f6e7,_0x2264d9[_0x2ac5d5][_0x395c('0x7a')]||_0x53f6e7);}if(_0x2c235b[_0x395c('0x7b')]){_0x2c235b['joins']=JSON[_0x395c('0x7c')](_0x2c235b['joins']);for(var _0x84ea7f=0x0;_0x84ea7f<_0x2c235b['joins'][_0x395c('0x4b')];_0x84ea7f+=0x1){if(_0x2c235b[_0x395c('0x7b')][_0x84ea7f][_0x395c('0x41')]&&_['includes'](_0x23635d,_0x2c235b[_0x395c('0x7b')][_0x84ea7f][_0x395c('0x41')])&&_0x2c235b[_0x395c('0x7b')][_0x84ea7f]['parentKey']&&_0x2c235b[_0x395c('0x7b')][_0x84ea7f]['foreignTable']&&_0x2c235b['joins'][_0x84ea7f]['foreignKey']){_0x2b4696[_0x2c235b[_0x395c('0x7b')][_0x84ea7f]['type']](_0x2c235b['joins'][_0x84ea7f][_0x395c('0x7e')],null,util[_0x395c('0x77')](_0x395c('0x80'),_0x2c235b['table'],_0x2c235b[_0x395c('0x7b')][_0x84ea7f]['parentKey'],_0x2c235b['joins'][_0x84ea7f][_0x395c('0x7e')],_0x2c235b[_0x395c('0x7b')][_0x84ea7f]['foreignKey']));}}}if(_0x2c235b[_0x395c('0x82')]){_0x2c235b[_0x395c('0x82')]=JSON['parse'](_0x2c235b[_0x395c('0x82')]);_0x2b4696['where'](_0x4bd290(_0x2c235b[_0x395c('0x82')][_0x395c('0x69')]));}_0x320baf=_0x2b4696[_0x395c('0x83')]();_0x2b4696['limit'](_0x20b9d1);_0x2b4696[_0x395c('0x1e')](0x0);logger[_0x395c('0x84')](_0x395c('0xa7'),_0x2b4696[_0x395c('0x85')]());return dbH['sequelize']['query'](_0x2b4696['toString'](),{'type':dbH[_0x395c('0x86')][_0x395c('0x87')][_0x395c('0x88')]});}})[_0x395c('0x28')](function(){return{'sql':_0x320baf[_0x395c('0x85')]()};})[_0x395c('0x28')](respondWithResult(_0x39ef20,null))[_0x395c('0x49')](handleError(_0x39ef20,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index afef812..1e46f20 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 _0xc158=['exports','define','analytics_custom_reports','lodash','util','moment','request-promise','path','../../config/environment','./analyticCustomReport.attributes'];(function(_0x37422a,_0x44eef3){var _0x505f44=function(_0x4194f5){while(--_0x4194f5){_0x37422a['push'](_0x37422a['shift']());}};_0x505f44(++_0x44eef3);}(_0xc158,0xcb));var _0x8c15=function(_0x2c85e0,_0xe21145){_0x2c85e0=_0x2c85e0-0x0;var _0x5ec778=_0xc158[_0x2c85e0];return _0x5ec778;};'use strict';var _=require(_0x8c15('0x0'));var util=require(_0x8c15('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8c15('0x2'));var BPromise=require('bluebird');var rp=require(_0x8c15('0x3'));var fs=require('fs');var path=require(_0x8c15('0x4'));var rimraf=require('rimraf');var config=require(_0x8c15('0x5'));var attributes=require(_0x8c15('0x6'));module[_0x8c15('0x7')]=function(_0xe23b3c,_0x1e66db){return _0xe23b3c[_0x8c15('0x8')]('AnalyticCustomReport',attributes,{'tableName':_0x8c15('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x98e8=['api','bluebird','request-promise','path','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger'];(function(_0x584d2a,_0x80af2e){var _0x2929cc=function(_0xbca9e3){while(--_0xbca9e3){_0x584d2a['push'](_0x584d2a['shift']());}};_0x2929cc(++_0x80af2e);}(_0x98e8,0x10e));var _0x898e=function(_0x52c3e2,_0x332d61){_0x52c3e2=_0x52c3e2-0x0;var _0x325392=_0x98e8[_0x52c3e2];return _0x325392;};'use strict';var _=require(_0x898e('0x0'));var util=require(_0x898e('0x1'));var logger=require(_0x898e('0x2'))(_0x898e('0x3'));var moment=require('moment');var BPromise=require(_0x898e('0x4'));var rp=require(_0x898e('0x5'));var fs=require('fs');var path=require(_0x898e('0x6'));var rimraf=require('rimraf');var config=require(_0x898e('0x7'));var attributes=require(_0x898e('0x8'));module[_0x898e('0x9')]=function(_0xa016de,_0x37bb10){return _0xa016de[_0x898e('0xa')](_0x898e('0xb'),attributes,{'tableName':_0x898e('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index adb9432..4ed2332 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 _0xfc64=['util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','AnalyticCustomReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash'];(function(_0x3d15ec,_0x14827c){var _0x33e151=function(_0x14ff01){while(--_0x14ff01){_0x3d15ec['push'](_0x3d15ec['shift']());}};_0x33e151(++_0x14827c);}(_0xfc64,0x179));var _0x4fc6=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xfc64[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0x4fc6('0x0'));var util=require(_0x4fc6('0x1'));var moment=require(_0x4fc6('0x2'));var BPromise=require(_0x4fc6('0x3'));var rs=require(_0x4fc6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4fc6('0x5'));var logger=require('../../config/logger')(_0x4fc6('0x6'));var config=require(_0x4fc6('0x7'));var jayson=require(_0x4fc6('0x8'));var client=jayson['client'][_0x4fc6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x155723,_0xdfd82c,_0x56f72c){return new BPromise(function(_0x52984a,_0x26bb30){return client['request'](_0x155723,_0x56f72c)[_0x4fc6('0xa')](function(_0x322cdd){logger[_0x4fc6('0xb')](_0x4fc6('0xc'),_0xdfd82c,'request\x20sent');logger[_0x4fc6('0xd')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0xdfd82c,_0x4fc6('0xe'),JSON[_0x4fc6('0xf')](_0x322cdd));if(_0x322cdd[_0x4fc6('0x10')]){if(_0x322cdd[_0x4fc6('0x10')][_0x4fc6('0x11')]===0x1f4){logger[_0x4fc6('0x10')](_0x4fc6('0xc'),_0xdfd82c,_0x322cdd[_0x4fc6('0x10')]['message']);return _0x26bb30(_0x322cdd['error'][_0x4fc6('0x12')]);}logger[_0x4fc6('0x10')](_0x4fc6('0xc'),_0xdfd82c,_0x322cdd[_0x4fc6('0x10')]['message']);return _0x52984a(_0x322cdd[_0x4fc6('0x10')]['message']);}else{logger[_0x4fc6('0xb')](_0x4fc6('0xc'),_0xdfd82c,'request\x20sent');_0x52984a(_0x322cdd[_0x4fc6('0x13')][_0x4fc6('0x12')]);}})[_0x4fc6('0x14')](function(_0x730550){logger['error'](_0x4fc6('0xc'),_0xdfd82c,_0x730550);_0x26bb30(_0x730550);});});}
\ No newline at end of file
+var _0xebb5=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','request','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x34d2a0,_0x6cde4f){var _0x505c5b=function(_0x2130a3){while(--_0x2130a3){_0x34d2a0['push'](_0x34d2a0['shift']());}};_0x505c5b(++_0x6cde4f);}(_0xebb5,0xb5));var _0x5ebb=function(_0x22d9ee,_0x2f495b){_0x22d9ee=_0x22d9ee-0x0;var _0x3f66f1=_0xebb5[_0x22d9ee];return _0x3f66f1;};'use strict';var _=require(_0x5ebb('0x0'));var util=require(_0x5ebb('0x1'));var moment=require(_0x5ebb('0x2'));var BPromise=require(_0x5ebb('0x3'));var rs=require(_0x5ebb('0x4'));var fs=require('fs');var Redis=require(_0x5ebb('0x5'));var db=require(_0x5ebb('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5ebb('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5ebb('0x8'));var client=jayson[_0x5ebb('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b31a8,_0x2a417f,_0x1954a7){return new BPromise(function(_0x259c3d,_0x767513){return client[_0x5ebb('0xa')](_0x3b31a8,_0x1954a7)[_0x5ebb('0xb')](function(_0x34136c){logger['info'](_0x5ebb('0xc'),_0x2a417f,_0x5ebb('0xd'));logger[_0x5ebb('0xe')](_0x5ebb('0xf'),_0x2a417f,_0x5ebb('0xd'),JSON[_0x5ebb('0x10')](_0x34136c));if(_0x34136c[_0x5ebb('0x11')]){if(_0x34136c['error']['code']===0x1f4){logger[_0x5ebb('0x11')](_0x5ebb('0xc'),_0x2a417f,_0x34136c[_0x5ebb('0x11')]['message']);return _0x767513(_0x34136c[_0x5ebb('0x11')][_0x5ebb('0x12')]);}logger['error'](_0x5ebb('0xc'),_0x2a417f,_0x34136c[_0x5ebb('0x11')][_0x5ebb('0x12')]);return _0x259c3d(_0x34136c['error'][_0x5ebb('0x12')]);}else{logger['info'](_0x5ebb('0xc'),_0x2a417f,_0x5ebb('0xd'));_0x259c3d(_0x34136c[_0x5ebb('0x13')][_0x5ebb('0x12')]);}})['catch'](function(_0xbac4ed){logger[_0x5ebb('0x11')](_0x5ebb('0xc'),_0x2a417f,_0xbac4ed);_0x767513(_0xbac4ed);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 8106b6f..f7be351 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 _0x3660=['query','create','put','update','/:id','destroy','path','connect-timeout','express','Router','fs-extra','../../config/environment','./analyticCustomReport.controller','isAuthenticated','get','/:id/preview','preview','/:id/run','run'];(function(_0x1bff2b,_0x174d92){var _0x4f010e=function(_0x530492){while(--_0x530492){_0x1bff2b['push'](_0x1bff2b['shift']());}};_0x4f010e(++_0x174d92);}(_0x3660,0x1a8));var _0x0366=function(_0x17451f,_0x3c86cf){_0x17451f=_0x17451f-0x0;var _0x2ad480=_0x3660[_0x17451f];return _0x2ad480;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0366('0x0'));var timeout=require(_0x0366('0x1'));var express=require(_0x0366('0x2'));var router=express[_0x0366('0x3')]();var fs_extra=require(_0x0366('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0366('0x5'));var controller=require(_0x0366('0x6'));router['get']('/',auth[_0x0366('0x7')](),controller['index']);router[_0x0366('0x8')]('/:id',auth[_0x0366('0x7')](),controller['show']);router[_0x0366('0x8')](_0x0366('0x9'),auth[_0x0366('0x7')](),controller[_0x0366('0xa')]);router[_0x0366('0x8')](_0x0366('0xb'),auth[_0x0366('0x7')](),controller[_0x0366('0xc')]);router[_0x0366('0x8')]('/:id/query',auth[_0x0366('0x7')](),controller[_0x0366('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0366('0xe')]);router[_0x0366('0xf')]('/:id',auth[_0x0366('0x7')](),controller[_0x0366('0x10')]);router['delete'](_0x0366('0x11'),auth[_0x0366('0x7')](),controller[_0x0366('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x7490=['/:id/run','run','/:id/query','query','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','/:id/preview','preview'];(function(_0x5d0969,_0x15e07f){var _0x2f67aa=function(_0x59e132){while(--_0x59e132){_0x5d0969['push'](_0x5d0969['shift']());}};_0x2f67aa(++_0x15e07f);}(_0x7490,0xf4));var _0x0749=function(_0x2d9951,_0x121f23){_0x2d9951=_0x2d9951-0x0;var _0x310df9=_0x7490[_0x2d9951];return _0x310df9;};'use strict';var multer=require(_0x0749('0x0'));var util=require('util');var path=require(_0x0749('0x1'));var timeout=require(_0x0749('0x2'));var express=require(_0x0749('0x3'));var router=express[_0x0749('0x4')]();var fs_extra=require(_0x0749('0x5'));var auth=require(_0x0749('0x6'));var interaction=require(_0x0749('0x7'));var config=require(_0x0749('0x8'));var controller=require(_0x0749('0x9'));router[_0x0749('0xa')]('/',auth[_0x0749('0xb')](),controller[_0x0749('0xc')]);router['get'](_0x0749('0xd'),auth[_0x0749('0xb')](),controller['show']);router[_0x0749('0xa')](_0x0749('0xe'),auth[_0x0749('0xb')](),controller[_0x0749('0xf')]);router[_0x0749('0xa')](_0x0749('0x10'),auth[_0x0749('0xb')](),controller[_0x0749('0x11')]);router[_0x0749('0xa')](_0x0749('0x12'),auth['isAuthenticated'](),controller[_0x0749('0x13')]);router['post']('/',auth[_0x0749('0xb')](),controller[_0x0749('0x14')]);router[_0x0749('0x15')]('/:id',auth[_0x0749('0xb')](),controller[_0x0749('0x16')]);router[_0x0749('0x17')](_0x0749('0xd'),auth[_0x0749('0xb')](),controller[_0x0749('0x18')]);module[_0x0749('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 2795b13..24a0e75 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3eea=['STRING','TEXT','sequelize'];(function(_0x5cb7d6,_0x5485ae){var _0x28171c=function(_0x56718b){while(--_0x56718b){_0x5cb7d6['push'](_0x5cb7d6['shift']());}};_0x28171c(++_0x5485ae);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x188b1e,_0x39cf2e){_0x188b1e=_0x188b1e-0x0;var _0x18bb05=_0x3eea[_0x188b1e];return _0x18bb05;};'use strict';var Sequelize=require(_0xa3ee('0x0'));module['exports']={'name':{'type':Sequelize[_0xa3ee('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa3ee('0x1')]},'parent':{'type':Sequelize[_0xa3ee('0x1')]},'table':{'type':Sequelize[_0xa3ee('0x1')]},'conditions':{'type':Sequelize[_0xa3ee('0x2')]},'joins':{'type':Sequelize[_0xa3ee('0x2')]}};
\ No newline at end of file
+var _0x53ec=['STRING','TEXT','sequelize','exports'];(function(_0x26eeaf,_0x18f26d){var _0x20a33c=function(_0xe8790e){while(--_0xe8790e){_0x26eeaf['push'](_0x26eeaf['shift']());}};_0x20a33c(++_0x18f26d);}(_0x53ec,0x192));var _0xc53e=function(_0x2aecb2,_0x343312){_0x2aecb2=_0x2aecb2-0x0;var _0x3ebb80=_0x53ec[_0x2aecb2];return _0x3ebb80;};'use strict';var Sequelize=require(_0xc53e('0x0'));module[_0xc53e('0x1')]={'name':{'type':Sequelize[_0xc53e('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xc53e('0x2')]},'parent':{'type':Sequelize[_0xc53e('0x2')]},'table':{'type':Sequelize[_0xc53e('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xc53e('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index b51bb47..5c5d1f2 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 _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(_0x32a6a7,_0x1aeb67){var _0x50bd2d=function(_0x19ab20){while(--_0x19ab20){_0x32a6a7['push'](_0x32a6a7['shift']());}};_0x50bd2d(++_0x1aeb67);}(_0x5fab,0x177));var _0xb5fa=function(_0x2391cf,_0x2593e9){_0x2391cf=_0x2391cf-0x0;var _0x11f9e5=_0x5fab[_0x2391cf];return _0x11f9e5;};'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
+var _0xda19=['ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','field','function','replace','groupBy','orderBy','order','alias','joins','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20EMPTY','operator','Sequelize','metric','format','DESC','parse','parentKey','web','output','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','run','runReport','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','dbH','status','json','offset','undefined','limit','count','set','apply','update','then','DefaultReports','destroy','end','error','stack','name','send','map','AnalyticDefaultReport','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','merge','includeAll','include','findAll','show','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','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\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','condition','value','options','find','getFields'];(function(_0x1868f4,_0x150266){var _0x273bf8=function(_0x596165){while(--_0x596165){_0x1868f4['push'](_0x1868f4['shift']());}};_0x273bf8(++_0x150266);}(_0xda19,0xd5));var _0x9da1=function(_0x2b6fb8,_0x13466c){_0x2b6fb8=_0x2b6fb8-0x0;var _0x3b161a=_0xda19[_0x2b6fb8];return _0x3b161a;};'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'];var dbH=require('../../mysqldb')[_0x9da1('0x17')];function respondWithStatusCode(_0x1d93f8,_0xd2d225){_0xd2d225=_0xd2d225||0xcc;return function(_0x1ffa2a){if(_0x1ffa2a){return _0x1d93f8['sendStatus'](_0xd2d225);}return _0x1d93f8[_0x9da1('0x18')](_0xd2d225)['end']();};}function respondWithResult(_0x4d17e1,_0x40ba9d){_0x40ba9d=_0x40ba9d||0xc8;return function(_0x479ccd){if(_0x479ccd){return _0x4d17e1[_0x9da1('0x18')](_0x40ba9d)[_0x9da1('0x19')](_0x479ccd);}};}function respondWithFilteredResult(_0x37653d,_0x1a1a6b){return function(_0x7f1a64){if(_0x7f1a64){var _0x514d8e=typeof _0x1a1a6b[_0x9da1('0x1a')]===_0x9da1('0x1b')&&typeof _0x1a1a6b[_0x9da1('0x1c')]===_0x9da1('0x1b');var _0xfb278d=_0x7f1a64[_0x9da1('0x1d')];var _0x497676=_0x514d8e?0x0:_0x1a1a6b['offset'];var _0x17205d=_0x514d8e?_0x7f1a64[_0x9da1('0x1d')]:_0x1a1a6b[_0x9da1('0x1a')]+_0x1a1a6b[_0x9da1('0x1c')];var _0x40a967;if(_0x17205d>=_0xfb278d){_0x17205d=_0xfb278d;_0x40a967=0xc8;}else{_0x40a967=0xce;}_0x37653d[_0x9da1('0x18')](_0x40a967);return _0x37653d[_0x9da1('0x1e')]('Content-Range',_0x497676+'-'+_0x17205d+'/'+_0xfb278d)[_0x9da1('0x19')](_0x7f1a64);}return null;};}function patchUpdates(_0x554845){return function(_0x9c3b37){try{jsonpatch[_0x9da1('0x1f')](_0x9c3b37,_0x554845,!![]);}catch(_0x1fc065){return BPromise['reject'](_0x1fc065);}return _0x9c3b37['save']();};}function saveUpdates(_0x14793b,_0x3e6f85){return function(_0x16ee0c){if(_0x16ee0c){return _0x16ee0c[_0x9da1('0x20')](_0x14793b)[_0x9da1('0x21')](function(_0x165b73){return _0x165b73;});}return null;};}function removeEntity(_0x4c60aa,_0x2413fe){return function(_0x3bfa40){if(_0x3bfa40){return _0x3bfa40['destroy']()[_0x9da1('0x21')](function(){var _0x3f5680=_0x3bfa40['get']({'plain':!![]});var _0x2fd49c=_0x9da1('0x22');return db['UserProfileResource'][_0x9da1('0x23')]({'where':{'type':_0x2fd49c,'resourceId':_0x3f5680['id']}})[_0x9da1('0x21')](function(){return _0x3bfa40;});})['then'](function(){_0x4c60aa['status'](0xcc)[_0x9da1('0x24')]();});}};}function handleEntityNotFound(_0x47055e,_0x5eca5b){return function(_0x27c6e2){if(!_0x27c6e2){_0x47055e['sendStatus'](0x194);}return _0x27c6e2;};}function handleError(_0x5a6f2d,_0x5a59c2){_0x5a59c2=_0x5a59c2||0x1f4;return function(_0x31b826){logger[_0x9da1('0x25')](_0x31b826[_0x9da1('0x26')]);if(_0x31b826[_0x9da1('0x27')]){delete _0x31b826[_0x9da1('0x27')];}_0x5a6f2d['status'](_0x5a59c2)[_0x9da1('0x28')](_0x31b826);};}exports['index']=function(_0x1feae0,_0x235ced){var _0x5b38b3={},_0xc29ba8={},_0x2eb48f={'count':0x0,'rows':[]};var _0x4f318b=_[_0x9da1('0x29')](db[_0x9da1('0x2a')][_0x9da1('0x2b')],function(_0x2b2b48){return{'name':_0x2b2b48['fieldName'],'type':_0x2b2b48['type'][_0x9da1('0x2c')]};});_0xc29ba8[_0x9da1('0x2d')]=_[_0x9da1('0x29')](_0x4f318b,_0x9da1('0x27'));_0xc29ba8[_0x9da1('0x2e')]=_['keys'](_0x1feae0[_0x9da1('0x2e')]);_0xc29ba8[_0x9da1('0x2f')]=_[_0x9da1('0x30')](_0xc29ba8[_0x9da1('0x2d')],_0xc29ba8[_0x9da1('0x2e')]);_0x5b38b3[_0x9da1('0x31')]=_['intersection'](_0xc29ba8[_0x9da1('0x2d')],qs['fields'](_0x1feae0['query'][_0x9da1('0x32')]));_0x5b38b3['attributes']=_0x5b38b3[_0x9da1('0x31')][_0x9da1('0x33')]?_0x5b38b3[_0x9da1('0x31')]:_0xc29ba8[_0x9da1('0x2d')];if(!_0x1feae0[_0x9da1('0x2e')][_0x9da1('0x34')](_0x9da1('0x35'))){_0x5b38b3[_0x9da1('0x1c')]=qs['limit'](_0x1feae0[_0x9da1('0x2e')]['limit']);_0x5b38b3[_0x9da1('0x1a')]=qs['offset'](_0x1feae0['query'][_0x9da1('0x1a')]);}_0x5b38b3['order']=qs[_0x9da1('0x36')](_0x1feae0[_0x9da1('0x2e')]['sort']);_0x5b38b3[_0x9da1('0x37')]=qs[_0x9da1('0x2f')](_[_0x9da1('0x38')](_0x1feae0[_0x9da1('0x2e')],_0xc29ba8['filters']),_0x4f318b);if(_0x1feae0[_0x9da1('0x2e')]['filter']){_0x5b38b3[_0x9da1('0x37')]=_['merge'](_0x5b38b3[_0x9da1('0x37')],{'$or':_[_0x9da1('0x29')](_0x4f318b,function(_0x58e165){if(_0x58e165[_0x9da1('0x39')]!==_0x9da1('0x3a')){var _0x394acf={};_0x394acf[_0x58e165['name']]={'$like':'%'+_0x1feae0['query']['filter']+'%'};return _0x394acf;}})});}_0x5b38b3=_[_0x9da1('0x3b')]({},_0x5b38b3,_0x1feae0['options']);var _0x5b215c={'where':_0x5b38b3[_0x9da1('0x37')]};return db[_0x9da1('0x2a')][_0x9da1('0x1d')](_0x5b215c)['then'](function(_0x42dbd8){_0x2eb48f[_0x9da1('0x1d')]=_0x42dbd8;if(_0x1feae0[_0x9da1('0x2e')][_0x9da1('0x3c')]){_0x5b38b3[_0x9da1('0x3d')]=[{'all':!![]}];}return db[_0x9da1('0x2a')][_0x9da1('0x3e')](_0x5b38b3);})['then'](function(_0x467350){_0x2eb48f['rows']=_0x467350;return _0x2eb48f;})[_0x9da1('0x21')](respondWithFilteredResult(_0x235ced,_0x5b38b3))['catch'](handleError(_0x235ced,null));};exports[_0x9da1('0x3f')]=function(_0x40d848,_0x599211){var _0x265366={'raw':!![],'where':{'id':_0x40d848['params']['id']}},_0xfeec5f={};_0xfeec5f[_0x9da1('0x2d')]=_['keys'](db[_0x9da1('0x2a')][_0x9da1('0x2b')]);_0xfeec5f['query']=_['keys'](_0x40d848[_0x9da1('0x2e')]);_0xfeec5f[_0x9da1('0x2f')]=_[_0x9da1('0x30')](_0xfeec5f[_0x9da1('0x2d')],_0xfeec5f[_0x9da1('0x2e')]);_0x265366[_0x9da1('0x31')]=_[_0x9da1('0x30')](_0xfeec5f[_0x9da1('0x2d')],qs['fields'](_0x40d848[_0x9da1('0x2e')][_0x9da1('0x32')]));_0x265366[_0x9da1('0x31')]=_0x265366['attributes'][_0x9da1('0x33')]?_0x265366[_0x9da1('0x31')]:_0xfeec5f[_0x9da1('0x2d')];if(_0x40d848['query'][_0x9da1('0x3c')]){_0x265366[_0x9da1('0x3d')]=[{'all':!![]}];}_0x265366=_[_0x9da1('0x3b')]({},_0x265366,_0x40d848['options']);return db[_0x9da1('0x2a')]['find'](_0x265366)['then'](handleEntityNotFound(_0x599211,null))[_0x9da1('0x21')](respondWithResult(_0x599211,null))[_0x9da1('0x40')](handleError(_0x599211,null));};exports['create']=function(_0x712d10,_0x2066d2){return db['AnalyticDefaultReport'][_0x9da1('0x41')](_0x712d10[_0x9da1('0x42')],{})[_0x9da1('0x21')](function(_0x3a529d){var _0x4780ca=_0x712d10[_0x9da1('0x43')][_0x9da1('0x44')]({'plain':!![]});if(!_0x4780ca)throw new Error(_0x9da1('0x45'));if(_0x4780ca[_0x9da1('0x46')]==='user'){var _0x147c65=_0x3a529d[_0x9da1('0x44')]({'plain':!![]});var _0x34a203=_0x9da1('0x47');return db['UserProfileSection']['find']({'where':{'name':_0x34a203,'userProfileId':_0x4780ca[_0x9da1('0x48')]},'raw':!![]})[_0x9da1('0x21')](function(_0x3870dd){if(_0x3870dd&&_0x3870dd[_0x9da1('0x49')]===0x0){return db[_0x9da1('0x4a')][_0x9da1('0x41')]({'name':_0x147c65[_0x9da1('0x27')],'resourceId':_0x147c65['id'],'type':_0x9da1('0x22'),'sectionId':_0x3870dd['id']},{})[_0x9da1('0x21')](function(){return _0x3a529d;});}else{return _0x3a529d;}})[_0x9da1('0x40')](function(_0x868167){logger[_0x9da1('0x25')](_0x9da1('0x4b'),_0x868167);throw _0x868167;});}return _0x3a529d;})[_0x9da1('0x21')](respondWithResult(_0x2066d2,0xc9))['catch'](handleError(_0x2066d2,null));};exports[_0x9da1('0x20')]=function(_0x1fbb5d,_0x4d241a){if(_0x1fbb5d[_0x9da1('0x42')]['id']){delete _0x1fbb5d['body']['id'];}return db[_0x9da1('0x2a')]['find']({'where':{'id':_0x1fbb5d[_0x9da1('0x4c')]['id']}})[_0x9da1('0x21')](handleEntityNotFound(_0x4d241a,null))[_0x9da1('0x21')](saveUpdates(_0x1fbb5d[_0x9da1('0x42')],null))[_0x9da1('0x21')](respondWithResult(_0x4d241a,null))[_0x9da1('0x40')](handleError(_0x4d241a,null));};exports[_0x9da1('0x23')]=function(_0x343b05,_0x170351){return db[_0x9da1('0x2a')]['find']({'where':{'id':_0x343b05[_0x9da1('0x4c')]['id']}})[_0x9da1('0x21')](handleEntityNotFound(_0x170351,null))[_0x9da1('0x21')](removeEntity(_0x170351,null))[_0x9da1('0x40')](handleError(_0x170351,null));};exports[_0x9da1('0x4d')]=function(_0x4607a9,_0x2020d0){var _0x3c01c3=0xa;var _0xfa8d3f=[_0x9da1('0x4e'),'left_join',_0x9da1('0x4f'),_0x9da1('0x50')];var _0x5bda2a={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0xc27b00={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':_0x9da1('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x9da1('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x27ac84=function(_0x10ebc9){return!_[_0x9da1('0x5c')]([_0x9da1('0x5d'),_0x9da1('0x5e'),_0x9da1('0x5f'),'IS\x20NOT\x20EMPTY'],_0x10ebc9);};var _0x5f5dc2=function(_0x454a68){if(!_0x454a68||!_0x454a68['rules']['length']){return'';}for(var _0x5b4a05='(',_0x6f86c3=0x0;_0x6f86c3<_0x454a68['rules'][_0x9da1('0x33')];_0x6f86c3+=0x1){_0x6f86c3>0x0&&(_0x5b4a05+='\x20'+_0x454a68['operator']+'\x20');_0x5b4a05+=_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x61')]?_0x5f5dc2(_0x454a68['rules'][_0x6f86c3][_0x9da1('0x61')]):_0x454a68[_0x9da1('0x60')][_0x6f86c3]['field']+'\x20'+_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x62')]+(_0x27ac84(_0x454a68['rules'][_0x6f86c3]['condition'])?'\x20'+_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x63')]:'');}return _0x5b4a05+')';};var _0x21d00c={'where':{'id':_0x4607a9['params']['id']}},_0x3ca531,_0x236b01,_0x44d7fe,_0x5cb102,_0x3d2c25;_0x21d00c=_['merge']({},_0x21d00c,_0x4607a9[_0x9da1('0x64')]);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0x21d00c)[_0x9da1('0x21')](function(_0x3382b1){if(_0x3382b1){_0x3ca531=_0x3382b1;return _0x3382b1[_0x9da1('0x66')]();}return null;})[_0x9da1('0x21')](function(_0x1f2a4b){if(_0x1f2a4b){if(!_0x1f2a4b[_0x9da1('0x33')]){throw new db['Sequelize'][(_0x9da1('0x67'))](_0x9da1('0x68'),0x193);}_0x236b01=_0x1f2a4b;return db[_0x9da1('0x69')][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x491fcb){if(_0x491fcb){_0x44d7fe=_[_0x9da1('0x6a')](_0x491fcb,'id');var _0x13fadd;var _0x419f78=squel[_0x9da1('0x6b')]();_0x419f78[_0x9da1('0x6c')](_0x3ca531[_0x9da1('0x6d')]);for(var _0x55a6d2=0x0;_0x55a6d2<_0x236b01[_0x9da1('0x33')];_0x55a6d2+=0x1){_0x13fadd=_0x236b01[_0x55a6d2]['MetricId']?_0x44d7fe[_0x236b01[_0x55a6d2][_0x9da1('0x6e')]]['metric']:_0x236b01[_0x55a6d2][_0x9da1('0x6f')];_0x13fadd=_0x236b01[_0x55a6d2][_0x9da1('0x70')]?_[_0x9da1('0x71')](_0x5bda2a[_0x236b01[_0x55a6d2][_0x9da1('0x70')]],'%s',_0x13fadd):_0x13fadd;_0x13fadd=_0x236b01[_0x55a6d2]['format']?_['replace'](_0xc27b00[_0x236b01[_0x55a6d2]['format']],'%s',_0x13fadd):_0x13fadd;if(_0x236b01[_0x55a6d2][_0x9da1('0x72')]){_0x419f78[_0x9da1('0x61')](_0x13fadd);}_0x236b01[_0x55a6d2][_0x9da1('0x73')]&&_0x419f78[_0x9da1('0x74')](_0x13fadd,_0x236b01[_0x55a6d2]['orderBy']==='DESC'?![]:!![]);_0x419f78[_0x9da1('0x6f')](_0x13fadd,_0x236b01[_0x55a6d2][_0x9da1('0x75')]||_0x13fadd);}if(_0x3ca531[_0x9da1('0x76')]){_0x3ca531['joins']=JSON['parse'](_0x3ca531[_0x9da1('0x76')]);for(var _0x1deb93=0x0;_0x1deb93<_0x3ca531[_0x9da1('0x76')]['length'];_0x1deb93+=0x1){if(_0x3ca531['joins'][_0x1deb93][_0x9da1('0x39')]&&_[_0x9da1('0x5c')](_0xfa8d3f,_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x39')])&&_0x3ca531[_0x9da1('0x76')][_0x1deb93]['parentKey']&&_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')]&&_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x78')]){_0x419f78[_0x3ca531['joins'][_0x1deb93][_0x9da1('0x39')]](_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')],null,util['format'](_0x9da1('0x79'),_0x3ca531[_0x9da1('0x6d')],_0x3ca531[_0x9da1('0x76')][_0x1deb93]['parentKey'],_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')],_0x3ca531['joins'][_0x1deb93][_0x9da1('0x78')]));}}}if(_0x3ca531['conditions']){_0x3ca531[_0x9da1('0x7a')]=JSON['parse'](_0x3ca531[_0x9da1('0x7a')]);_0x419f78[_0x9da1('0x37')](_0x5f5dc2(_0x3ca531[_0x9da1('0x7a')][_0x9da1('0x61')]));}_0x3d2c25=_0x419f78[_0x9da1('0x7b')]();_0x419f78[_0x9da1('0x1c')](_0x3c01c3);_0x419f78[_0x9da1('0x1a')](0x0);logger[_0x9da1('0x7c')](_0x9da1('0x7d'),_0x419f78[_0x9da1('0x7e')]());return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x419f78[_0x9da1('0x7e')](),{'type':dbH['sequelize'][_0x9da1('0x80')][_0x9da1('0x81')]});}})[_0x9da1('0x21')](respondWithResult(_0x2020d0,null))[_0x9da1('0x40')](handleError(_0x2020d0,null));};function runReport(_0x162597,_0x4f39bc,_0x1ca102){var _0x2eb5e6=_0x4f39bc['name'];var _0x4a4cda=0xa;var _0x84f8d8=[_0x9da1('0x4e'),_0x9da1('0x82'),_0x9da1('0x4f'),_0x9da1('0x50')];var _0x4701b3={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0x3a0a84={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':_0x9da1('0x5a'),'HOUR':_0x9da1('0x83'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9da1('0x84')};var _0x354c5a=function(_0x53ab6a){return!_[_0x9da1('0x5c')](['IS\x20NULL',_0x9da1('0x5e'),'IS\x20EMPTY',_0x9da1('0x85')],_0x53ab6a);};var _0x106bd9=function(_0x347cb8){if(!_0x347cb8||!_0x347cb8[_0x9da1('0x60')][_0x9da1('0x33')]){return'';}for(var _0x3e331a='(',_0x1f785c=0x0;_0x1f785c<_0x347cb8[_0x9da1('0x60')][_0x9da1('0x33')];_0x1f785c+=0x1){_0x1f785c>0x0&&(_0x3e331a+='\x20'+_0x347cb8[_0x9da1('0x86')]+'\x20');_0x3e331a+=_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x61')]?_0x106bd9(_0x347cb8['rules'][_0x1f785c][_0x9da1('0x61')]):_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x6f')]+'\x20'+_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x62')]+(_0x354c5a(_0x347cb8[_0x9da1('0x60')][_0x1f785c]['condition'])?'\x20'+_0x347cb8['rules'][_0x1f785c][_0x9da1('0x63')]:'');}return _0x3e331a+')';};var _0xdecc82={'where':{'id':_0x162597['id']}},_0xe12dd7,_0x4cd85f,_0x4bf74c,_0x28335d,_0x175b4b;_0xdecc82=_[_0x9da1('0x3b')]({},_0xdecc82,_0x1ca102);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0xdecc82)[_0x9da1('0x21')](function(_0x5561f0){if(_0x5561f0){_0xe12dd7=_0x5561f0;return _0x5561f0[_0x9da1('0x66')]();}return null;})[_0x9da1('0x21')](function(_0x5a64fd){if(_0x5a64fd){if(!_0x5a64fd['length']){throw new db[(_0x9da1('0x87'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4cd85f=_0x5a64fd;return db[_0x9da1('0x69')][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x18ae08){if(_0x18ae08){_0x4bf74c=_[_0x9da1('0x6a')](_0x18ae08,'id');var _0x30065d;var _0x40a2ef=squel[_0x9da1('0x6b')]();_0x40a2ef['from'](_0xe12dd7['table']);for(var _0xd10ba4=0x0;_0xd10ba4<_0x4cd85f[_0x9da1('0x33')];_0xd10ba4+=0x1){_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x6e')]?_0x4bf74c[_0x4cd85f[_0xd10ba4][_0x9da1('0x6e')]][_0x9da1('0x88')]:_0x4cd85f[_0xd10ba4][_0x9da1('0x6f')];_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x70')]?_[_0x9da1('0x71')](_0x4701b3[_0x4cd85f[_0xd10ba4]['function']],'%s',_0x30065d):_0x30065d;_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x89')]?_['replace'](_0x3a0a84[_0x4cd85f[_0xd10ba4][_0x9da1('0x89')]],'%s',_0x30065d):_0x30065d;if(_0x4cd85f[_0xd10ba4][_0x9da1('0x72')]){_0x40a2ef[_0x9da1('0x61')](_0x30065d);}_0x4cd85f[_0xd10ba4][_0x9da1('0x73')]&&_0x40a2ef[_0x9da1('0x74')](_0x30065d,_0x4cd85f[_0xd10ba4][_0x9da1('0x73')]===_0x9da1('0x8a')?![]:!![]);_0x40a2ef['field'](_0x30065d,_0x4cd85f[_0xd10ba4][_0x9da1('0x75')]||_0x30065d);}if(_0xe12dd7['joins']){_0xe12dd7[_0x9da1('0x76')]=JSON[_0x9da1('0x8b')](_0xe12dd7[_0x9da1('0x76')]);for(var _0x22b679=0x0;_0x22b679<_0xe12dd7['joins'][_0x9da1('0x33')];_0x22b679+=0x1){if(_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')]&&_[_0x9da1('0x5c')](_0x84f8d8,_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')])&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x8c')]&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x77')]&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x78')]){_0x40a2ef[_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')]](_0xe12dd7['joins'][_0x22b679][_0x9da1('0x77')],null,util['format'](_0x9da1('0x79'),_0xe12dd7['table'],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x8c')],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x77')],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x78')]));}}}if(_0xe12dd7[_0x9da1('0x7a')]){_0xe12dd7[_0x9da1('0x7a')]=JSON['parse'](_0xe12dd7[_0x9da1('0x7a')]);_0x40a2ef[_0x9da1('0x37')](_0x106bd9(_0xe12dd7['conditions'][_0x9da1('0x61')]));}_0x175b4b=_0x40a2ef[_0x9da1('0x7b')]();_0x40a2ef[_0x9da1('0x1c')](_0x4a4cda);_0x40a2ef['offset'](0x0);return;}})['then'](function(){if(_0x4f39bc['output']===_0x9da1('0x8d')){return null;}var _0x3b17aa=_[_0x9da1('0x3b')](_0x4f39bc,{'name':_0x4f39bc['fullPath']||_0x4f39bc['name']||_0xe12dd7[_0x9da1('0x27')],'basename':_0x2eb5e6,'savename':util[_0x9da1('0x89')]('%s-%s.%s',_0x4f39bc[_0x9da1('0x27')]||_0xe12dd7['name'],require('randomstring')['generate'](0x4),_0x4f39bc[_0x9da1('0x8e')]||_0x9da1('0x8f')),'reportId':_0xe12dd7['id'],'reportType':_0x9da1('0x90')});return db[_0x9da1('0x91')][_0x9da1('0x41')](_0x3b17aa,{'raw':!![]});})[_0x9da1('0x21')](function(_0x2aac99){if(_0xe12dd7[_0x9da1('0x6d')]===_0x9da1('0x92')){_0x175b4b[_0x9da1('0x37')](_0xe12dd7[_0x9da1('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x4f39bc['startDate'],_0x4f39bc['endDate']);}else{_0x175b4b[_0x9da1('0x37')](_0xe12dd7[_0x9da1('0x6d')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4f39bc[_0x9da1('0x93')],_0x4f39bc[_0x9da1('0x94')]);}if(_0x2aac99){logger[_0x9da1('0x95')](_0x9da1('0x96'),_0x175b4b[_0x9da1('0x7e')]());require(_0x9da1('0x97'))[_0x9da1('0x98')](path[_0x9da1('0x4e')](__dirname,'../../components/export/',_0x2aac99[_0x9da1('0x8e')]),[_0x2aac99['id'],_0x175b4b[_0x9da1('0x7e')](),path[_0x9da1('0x4e')](__dirname,_0x9da1('0x99'),_0x2aac99[_0x9da1('0x9a')]),_0x2eb5e6]);return _0x2aac99;}else{var _0x5ad3f8=squel[_0x9da1('0x6b')]();_0x5ad3f8['from']('('+_0x175b4b[_0x9da1('0x7e')]()+')',_0x9da1('0x9b'));_0x5ad3f8[_0x9da1('0x6f')]('COUNT(*)','count');_0x175b4b[_0x9da1('0x1c')](_0x4f39bc[_0x9da1('0x1c')]||_0x4a4cda);_0x175b4b[_0x9da1('0x1a')](_0x4f39bc['offset']||0x0);return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x5ad3f8['toString'](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')]['SELECT']})['then'](function(_0x489b3f){if(!_0x489b3f[_0x9da1('0x33')]){_0x28335d=0x0;}else{_0x28335d=_0x489b3f[0x0]['count']||0x0;}return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x175b4b[_0x9da1('0x7e')](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')][_0x9da1('0x81')]});})['then'](function(_0x355a71){return{'rows':_0x355a71||[],'count':_0x28335d};});}});}exports[_0x9da1('0x9c')]=function(_0x492e1a,_0x449a17){return runReport(_0x492e1a[_0x9da1('0x4c')],_0x492e1a[_0x9da1('0x2e')],_0x492e1a[_0x9da1('0x64')])['then'](respondWithResult(_0x449a17,null))[_0x9da1('0x40')](handleError(_0x449a17,null));};exports[_0x9da1('0x9d')]=runReport;exports[_0x9da1('0x2e')]=function(_0x8280a9,_0x374754){var _0x1e466a=0xa;var _0x3f9133=[_0x9da1('0x4e'),'left_join',_0x9da1('0x4f'),'cross_join'];var _0x3dd3e0={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0x52e4a6={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x9da1('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4aa903=function(_0x55d7f2){return!_['includes'](['IS\x20NULL',_0x9da1('0x5e'),_0x9da1('0x5f'),_0x9da1('0x85')],_0x55d7f2);};var _0x3212ad=function(_0x5ac65b){if(!_0x5ac65b||!_0x5ac65b[_0x9da1('0x60')][_0x9da1('0x33')]){return'';}for(var _0x21a99d='(',_0xd19a7c=0x0;_0xd19a7c<_0x5ac65b[_0x9da1('0x60')][_0x9da1('0x33')];_0xd19a7c+=0x1){_0xd19a7c>0x0&&(_0x21a99d+='\x20'+_0x5ac65b[_0x9da1('0x86')]+'\x20');_0x21a99d+=_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x61')]?_0x3212ad(_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x61')]):_0x5ac65b['rules'][_0xd19a7c][_0x9da1('0x6f')]+'\x20'+_0x5ac65b[_0x9da1('0x60')][_0xd19a7c]['condition']+(_0x4aa903(_0x5ac65b['rules'][_0xd19a7c][_0x9da1('0x62')])?'\x20'+_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x63')]:'');}return _0x21a99d+')';};var _0xb14af1={'where':{'id':_0x8280a9[_0x9da1('0x4c')]['id']}},_0x245566,_0x5b2591,_0x3c51e3,_0x54b83d,_0x23bf86;_0xb14af1=_['merge']({},_0xb14af1,_0x8280a9[_0x9da1('0x64')]);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0xb14af1)[_0x9da1('0x21')](function(_0x4bb140){if(_0x4bb140){_0x245566=_0x4bb140;return _0x4bb140[_0x9da1('0x66')]();}return null;})['then'](function(_0x47cbdd){if(_0x47cbdd){if(!_0x47cbdd['length']){throw new db[(_0x9da1('0x87'))][(_0x9da1('0x67'))](_0x9da1('0x68'),0x193);}_0x5b2591=_0x47cbdd;return db['AnalyticMetric'][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x5e1e24){if(_0x5e1e24){_0x3c51e3=_[_0x9da1('0x6a')](_0x5e1e24,'id');var _0x49ddec;var _0x407218=squel['select']();_0x407218['from'](_0x245566['table']);for(var _0x316fee=0x0;_0x316fee<_0x5b2591['length'];_0x316fee+=0x1){_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x6e')]?_0x3c51e3[_0x5b2591[_0x316fee][_0x9da1('0x6e')]]['metric']:_0x5b2591[_0x316fee]['field'];_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x70')]?_['replace'](_0x3dd3e0[_0x5b2591[_0x316fee][_0x9da1('0x70')]],'%s',_0x49ddec):_0x49ddec;_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x89')]?_['replace'](_0x52e4a6[_0x5b2591[_0x316fee]['format']],'%s',_0x49ddec):_0x49ddec;if(_0x5b2591[_0x316fee][_0x9da1('0x72')]){_0x407218[_0x9da1('0x61')](_0x49ddec);}_0x5b2591[_0x316fee][_0x9da1('0x73')]&&_0x407218[_0x9da1('0x74')](_0x49ddec,_0x5b2591[_0x316fee]['orderBy']==='DESC'?![]:!![]);_0x407218[_0x9da1('0x6f')](_0x49ddec,_0x5b2591[_0x316fee][_0x9da1('0x75')]||_0x49ddec);}if(_0x245566[_0x9da1('0x76')]){_0x245566[_0x9da1('0x76')]=JSON[_0x9da1('0x8b')](_0x245566['joins']);for(var _0x56ec7d=0x0;_0x56ec7d<_0x245566[_0x9da1('0x76')][_0x9da1('0x33')];_0x56ec7d+=0x1){if(_0x245566['joins'][_0x56ec7d][_0x9da1('0x39')]&&_['includes'](_0x3f9133,_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x39')])&&_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x8c')]&&_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x77')]&&_0x245566['joins'][_0x56ec7d][_0x9da1('0x78')]){_0x407218[_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x39')]](_0x245566[_0x9da1('0x76')][_0x56ec7d]['foreignTable'],null,util[_0x9da1('0x89')](_0x9da1('0x79'),_0x245566[_0x9da1('0x6d')],_0x245566['joins'][_0x56ec7d]['parentKey'],_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x77')],_0x245566['joins'][_0x56ec7d]['foreignKey']));}}}if(_0x245566[_0x9da1('0x7a')]){_0x245566[_0x9da1('0x7a')]=JSON[_0x9da1('0x8b')](_0x245566[_0x9da1('0x7a')]);_0x407218[_0x9da1('0x37')](_0x3212ad(_0x245566['conditions'][_0x9da1('0x61')]));}_0x23bf86=_0x407218['clone']();_0x407218[_0x9da1('0x1c')](_0x1e466a);_0x407218[_0x9da1('0x1a')](0x0);logger[_0x9da1('0x7c')](_0x9da1('0x7d'),_0x407218['toString']());return dbH['sequelize'][_0x9da1('0x2e')](_0x407218[_0x9da1('0x7e')](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')][_0x9da1('0x81')]});}})[_0x9da1('0x21')](function(){return{'sql':_0x23bf86['toString']()};})[_0x9da1('0x21')](respondWithResult(_0x374754,null))[_0x9da1('0x40')](handleError(_0x374754,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 0daab32..c9ec0de 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 _0x6443=['request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','lodash','../../config/logger','api','moment'];(function(_0x585c4e,_0x25453f){var _0x458af1=function(_0x1893e3){while(--_0x1893e3){_0x585c4e['push'](_0x585c4e['shift']());}};_0x458af1(++_0x25453f);}(_0x6443,0x1a0));var _0x3644=function(_0x386c3e,_0x44a375){_0x386c3e=_0x386c3e-0x0;var _0x4b8e13=_0x6443[_0x386c3e];return _0x4b8e13;};'use strict';var _=require(_0x3644('0x0'));var util=require('util');var logger=require(_0x3644('0x1'))(_0x3644('0x2'));var moment=require(_0x3644('0x3'));var BPromise=require('bluebird');var rp=require(_0x3644('0x4'));var fs=require('fs');var path=require(_0x3644('0x5'));var rimraf=require(_0x3644('0x6'));var config=require(_0x3644('0x7'));var attributes=require(_0x3644('0x8'));module[_0x3644('0x9')]=function(_0x1f0ab9,_0x2f1cf2){return _0x1f0ab9[_0x3644('0xa')](_0x3644('0xb'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7010=['rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','AnalyticDefaultReport','lodash','api','moment','request-promise','path'];(function(_0x4d529a,_0x317bce){var _0x5754d9=function(_0x353b20){while(--_0x353b20){_0x4d529a['push'](_0x4d529a['shift']());}};_0x5754d9(++_0x317bce);}(_0x7010,0x9b));var _0x0701=function(_0x1c6efd,_0xb2f3cd){_0x1c6efd=_0x1c6efd-0x0;var _0x53a918=_0x7010[_0x1c6efd];return _0x53a918;};'use strict';var _=require(_0x0701('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0701('0x1'));var moment=require(_0x0701('0x2'));var BPromise=require('bluebird');var rp=require(_0x0701('0x3'));var fs=require('fs');var path=require(_0x0701('0x4'));var rimraf=require(_0x0701('0x5'));var config=require(_0x0701('0x6'));var attributes=require(_0x0701('0x7'));module[_0x0701('0x8')]=function(_0x2b1ec9,_0x4d2e89){return _0x2b1ec9['define'](_0x0701('0x9'),attributes,{'tableName':'analytics_default_reports','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 5f0daf5..d91296d 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 _0x71a4=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x71a4,0x1db));var _0x471a=function(_0x2ce982,_0x146000){_0x2ce982=_0x2ce982-0x0;var _0x4ec5f0=_0x71a4[_0x2ce982];return _0x4ec5f0;};'use strict';var _=require(_0x471a('0x0'));var util=require(_0x471a('0x1'));var moment=require(_0x471a('0x2'));var BPromise=require(_0x471a('0x3'));var rs=require(_0x471a('0x4'));var fs=require('fs');var Redis=require(_0x471a('0x5'));var db=require(_0x471a('0x6'))['db'];var utils=require(_0x471a('0x7'));var logger=require(_0x471a('0x8'))(_0x471a('0x9'));var config=require(_0x471a('0xa'));var jayson=require(_0x471a('0xb'));var client=jayson['client'][_0x471a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x96fec4,_0xae7f15,_0x20761b){return new BPromise(function(_0x2ee266,_0x3e2841){return client[_0x471a('0xd')](_0x96fec4,_0x20761b)[_0x471a('0xe')](function(_0x17e1a7){logger[_0x471a('0xf')](_0x471a('0x10'),_0xae7f15,'request\x20sent');logger['debug'](_0x471a('0x11'),_0xae7f15,_0x471a('0x12'),JSON[_0x471a('0x13')](_0x17e1a7));if(_0x17e1a7['error']){if(_0x17e1a7[_0x471a('0x14')][_0x471a('0x15')]===0x1f4){logger[_0x471a('0x14')](_0x471a('0x10'),_0xae7f15,_0x17e1a7[_0x471a('0x14')][_0x471a('0x16')]);return _0x3e2841(_0x17e1a7[_0x471a('0x14')][_0x471a('0x16')]);}logger[_0x471a('0x14')](_0x471a('0x10'),_0xae7f15,_0x17e1a7[_0x471a('0x14')]['message']);return _0x2ee266(_0x17e1a7[_0x471a('0x14')][_0x471a('0x16')]);}else{logger[_0x471a('0xf')](_0x471a('0x10'),_0xae7f15,_0x471a('0x12'));_0x2ee266(_0x17e1a7[_0x471a('0x17')][_0x471a('0x16')]);}})['catch'](function(_0xdbcd61){logger['error'](_0x471a('0x10'),_0xae7f15,_0xdbcd61);_0x3e2841(_0xdbcd61);});});}
\ No newline at end of file
+var _0x1002=['client','http','request','then','info','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticDefaultReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x36ff0d,_0x4dad91){var _0x49ba07=function(_0x34352d){while(--_0x34352d){_0x36ff0d['push'](_0x36ff0d['shift']());}};_0x49ba07(++_0x4dad91);}(_0x1002,0x9e));var _0x2100=function(_0x6598bd,_0x2240d4){_0x6598bd=_0x6598bd-0x0;var _0x46b063=_0x1002[_0x6598bd];return _0x46b063;};'use strict';var _=require(_0x2100('0x0'));var util=require('util');var moment=require(_0x2100('0x1'));var BPromise=require(_0x2100('0x2'));var rs=require(_0x2100('0x3'));var fs=require('fs');var Redis=require(_0x2100('0x4'));var db=require(_0x2100('0x5'))['db'];var utils=require(_0x2100('0x6'));var logger=require(_0x2100('0x7'))(_0x2100('0x8'));var config=require('../../config/environment');var jayson=require(_0x2100('0x9'));var client=jayson[_0x2100('0xa')][_0x2100('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x187b83,_0x3f011,_0x3ab061){return new BPromise(function(_0x1718dd,_0x47bab1){return client[_0x2100('0xc')](_0x187b83,_0x3ab061)[_0x2100('0xd')](function(_0x5c5c84){logger[_0x2100('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3f011,_0x2100('0xf'));logger[_0x2100('0x10')](_0x2100('0x11'),_0x3f011,_0x2100('0xf'),JSON[_0x2100('0x12')](_0x5c5c84));if(_0x5c5c84[_0x2100('0x13')]){if(_0x5c5c84['error']['code']===0x1f4){logger[_0x2100('0x13')](_0x2100('0x14'),_0x3f011,_0x5c5c84[_0x2100('0x13')][_0x2100('0x15')]);return _0x47bab1(_0x5c5c84['error'][_0x2100('0x15')]);}logger['error'](_0x2100('0x14'),_0x3f011,_0x5c5c84[_0x2100('0x13')][_0x2100('0x15')]);return _0x1718dd(_0x5c5c84[_0x2100('0x13')]['message']);}else{logger[_0x2100('0xe')](_0x2100('0x14'),_0x3f011,'request\x20sent');_0x1718dd(_0x5c5c84[_0x2100('0x16')]['message']);}})[_0x2100('0x17')](function(_0x895649){logger[_0x2100('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3f011,_0x895649);_0x47bab1(_0x895649);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index fe21421..2cd638e 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 _0x0045=['/:id/preview','preview','run','/:id/query','query','post','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show'];(function(_0x241c21,_0x11b64b){var _0x1ffb9e=function(_0x5e3509){while(--_0x5e3509){_0x241c21['push'](_0x241c21['shift']());}};_0x1ffb9e(++_0x11b64b);}(_0x0045,0xd8));var _0x5004=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0045[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x5004('0x0'));var util=require(_0x5004('0x1'));var path=require(_0x5004('0x2'));var timeout=require(_0x5004('0x3'));var express=require(_0x5004('0x4'));var router=express['Router']();var fs_extra=require(_0x5004('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5004('0x6'));var config=require(_0x5004('0x7'));var controller=require(_0x5004('0x8'));router[_0x5004('0x9')]('/',auth[_0x5004('0xa')](),controller[_0x5004('0xb')]);router['get'](_0x5004('0xc'),auth[_0x5004('0xa')](),controller[_0x5004('0xd')]);router[_0x5004('0x9')](_0x5004('0xe'),auth[_0x5004('0xa')](),controller[_0x5004('0xf')]);router[_0x5004('0x9')]('/:id/run',auth['isAuthenticated'](),controller[_0x5004('0x10')]);router[_0x5004('0x9')](_0x5004('0x11'),auth[_0x5004('0xa')](),controller[_0x5004('0x12')]);router[_0x5004('0x13')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x5004('0xc'),auth[_0x5004('0xa')](),controller[_0x5004('0x14')]);router[_0x5004('0x15')](_0x5004('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x5004('0x16')]=router;
\ No newline at end of file
+var _0x93a6=['/:id/preview','/:id/run','run','/:id/query','query','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','/:id','show'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x93a6,0x1ac));var _0x693a=function(_0x187dbd,_0x2ecf58){_0x187dbd=_0x187dbd-0x0;var _0x45d1e9=_0x93a6[_0x187dbd];return _0x45d1e9;};'use strict';var multer=require(_0x693a('0x0'));var util=require(_0x693a('0x1'));var path=require(_0x693a('0x2'));var timeout=require(_0x693a('0x3'));var express=require('express');var router=express[_0x693a('0x4')]();var fs_extra=require(_0x693a('0x5'));var auth=require(_0x693a('0x6'));var interaction=require(_0x693a('0x7'));var config=require(_0x693a('0x8'));var controller=require(_0x693a('0x9'));router[_0x693a('0xa')]('/',auth[_0x693a('0xb')](),controller['index']);router[_0x693a('0xa')](_0x693a('0xc'),auth[_0x693a('0xb')](),controller[_0x693a('0xd')]);router[_0x693a('0xa')](_0x693a('0xe'),auth['isAuthenticated'](),controller['preview']);router[_0x693a('0xa')](_0x693a('0xf'),auth['isAuthenticated'](),controller[_0x693a('0x10')]);router[_0x693a('0xa')](_0x693a('0x11'),auth[_0x693a('0xb')](),controller[_0x693a('0x12')]);router[_0x693a('0x13')]('/',auth[_0x693a('0xb')](),controller[_0x693a('0x14')]);router[_0x693a('0x15')](_0x693a('0xc'),auth[_0x693a('0xb')](),controller[_0x693a('0x16')]);router[_0x693a('0x17')](_0x693a('0xc'),auth[_0x693a('0xb')](),controller[_0x693a('0x18')]);module[_0x693a('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index e4d4740..556dbef 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 _0xb038=['pdf','xlsx','Loading','ENUM','manual','INTEGER','sequelize','moment','exports','STRING','csv'];(function(_0x4f3219,_0x210f7d){var _0x1a394b=function(_0x23d682){while(--_0x23d682){_0x4f3219['push'](_0x4f3219['shift']());}};_0x1a394b(++_0x210f7d);}(_0xb038,0x1d4));var _0x8b03=function(_0x56469a,_0x4c448c){_0x56469a=_0x56469a-0x0;var _0x458cdb=_0xb038[_0x56469a];return _0x458cdb;};'use strict';var Sequelize=require(_0x8b03('0x0'));var moment=require(_0x8b03('0x1'));module[_0x8b03('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x8b03('0x3')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x8b03('0x4'),_0x8b03('0x5'),_0x8b03('0x6')),'allowNull':![],'defaultValue':_0x8b03('0x4')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x8b03('0x3')],'defaultValue':_0x8b03('0x7')},'type':{'type':Sequelize[_0x8b03('0x8')](_0x8b03('0x9'),'scheduled'),'allowNull':![],'defaultValue':_0x8b03('0x9')},'reportId':{'type':Sequelize[_0x8b03('0xa')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x8b03('0x3')]}};
\ No newline at end of file
+var _0xc293=['ENUM','csv','DATE','manual','INTEGER','UNSIGNED','sequelize','moment','STRING'];(function(_0x39db98,_0x28c7d9){var _0x5939cf=function(_0x5ed6c6){while(--_0x5ed6c6){_0x39db98['push'](_0x39db98['shift']());}};_0x5939cf(++_0x28c7d9);}(_0xc293,0xe7));var _0x3c29=function(_0x196126,_0x35ce6c){_0x196126=_0x196126-0x0;var _0xe144e9=_0xc293[_0x196126];return _0xe144e9;};'use strict';var Sequelize=require(_0x3c29('0x0'));var moment=require(_0x3c29('0x1'));module['exports']={'name':{'type':Sequelize[_0x3c29('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x3c29('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x3c29('0x3')](_0x3c29('0x4'),'pdf','xlsx'),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x3c29('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x3c29('0x5')]},'endDate':{'type':Sequelize[_0x3c29('0x5')]},'status':{'type':Sequelize[_0x3c29('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x3c29('0x3')]('manual','scheduled'),'allowNull':![],'defaultValue':_0x3c29('0x6')},'reportId':{'type':Sequelize[_0x3c29('0x7')](0xb)[_0x3c29('0x8')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 25ea08e..a0fbbe8 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 _0x1ef8=['json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','ExtractedReports','UserProfileResource','sendStatus','error','stack','send','index','map','AnalyticExtractedReport','rawAttributes','type','key','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','create','body','user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','download','basename','savename','output','existsSync','join','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','root','format','%s.%s','toLowerCase','eml-format','rimraf','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end'];(function(_0x3e25c1,_0x1d15f9){var _0x52e7f2=function(_0x597a5a){while(--_0x597a5a){_0x3e25c1['push'](_0x3e25c1['shift']());}};_0x52e7f2(++_0x1d15f9);}(_0x1ef8,0x163));var _0x81ef=function(_0x1ac4ed,_0x45a0ac){_0x1ac4ed=_0x1ac4ed-0x0;var _0x56b836=_0x1ef8[_0x1ac4ed];return _0x56b836;};'use strict';var emlformat=require(_0x81ef('0x0'));var rimraf=require(_0x81ef('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x81ef('0x2'));var moment=require(_0x81ef('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x81ef('0x4'));var util=require(_0x81ef('0x5'));var path=require('path');var sox=require(_0x81ef('0x6'));var csv=require(_0x81ef('0x7'));var ejs=require(_0x81ef('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x81ef('0x9'));var squel=require('squel');var crypto=require(_0x81ef('0xa'));var jsforce=require(_0x81ef('0xb'));var deskjs=require(_0x81ef('0xc'));var toCsv=require('to-csv');var querystring=require(_0x81ef('0xd'));var Papa=require('papaparse');var Redis=require(_0x81ef('0xe'));var authService=require(_0x81ef('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x81ef('0x10'));var hardwareService=require(_0x81ef('0x11'));var logger=require(_0x81ef('0x12'))(_0x81ef('0x13'));var utils=require(_0x81ef('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x81ef('0x15'));var db=require(_0x81ef('0x16'))['db'];function respondWithStatusCode(_0x247485,_0x995c18){_0x995c18=_0x995c18||0xcc;return function(_0x1a4d3b){if(_0x1a4d3b){return _0x247485['sendStatus'](_0x995c18);}return _0x247485[_0x81ef('0x17')](_0x995c18)[_0x81ef('0x18')]();};}function respondWithResult(_0x492547,_0x41f18c){_0x41f18c=_0x41f18c||0xc8;return function(_0x332521){if(_0x332521){return _0x492547[_0x81ef('0x17')](_0x41f18c)[_0x81ef('0x19')](_0x332521);}};}function respondWithFilteredResult(_0xfcf347,_0x36b1d0){return function(_0x3725cb){if(_0x3725cb){var _0x27e9ed=typeof _0x36b1d0[_0x81ef('0x1a')]===_0x81ef('0x1b')&&typeof _0x36b1d0[_0x81ef('0x1c')]===_0x81ef('0x1b');var _0x302410=_0x3725cb[_0x81ef('0x1d')];var _0x36328d=_0x27e9ed?0x0:_0x36b1d0[_0x81ef('0x1a')];var _0x44df6a=_0x27e9ed?_0x3725cb[_0x81ef('0x1d')]:_0x36b1d0['offset']+_0x36b1d0[_0x81ef('0x1c')];var _0xcc7c6d;if(_0x44df6a>=_0x302410){_0x44df6a=_0x302410;_0xcc7c6d=0xc8;}else{_0xcc7c6d=0xce;}_0xfcf347[_0x81ef('0x17')](_0xcc7c6d);return _0xfcf347['set'](_0x81ef('0x1e'),_0x36328d+'-'+_0x44df6a+'/'+_0x302410)[_0x81ef('0x19')](_0x3725cb);}return null;};}function patchUpdates(_0x14707d){return function(_0x5e0fec){try{jsonpatch[_0x81ef('0x1f')](_0x5e0fec,_0x14707d,!![]);}catch(_0x328b09){return BPromise[_0x81ef('0x20')](_0x328b09);}return _0x5e0fec[_0x81ef('0x21')]();};}function saveUpdates(_0x64ab22,_0x3d2b12){return function(_0x596326){if(_0x596326){return _0x596326[_0x81ef('0x22')](_0x64ab22)[_0x81ef('0x23')](function(_0xbf21c9){return _0xbf21c9;});}return null;};}function removeEntity(_0x23cc0b,_0x4ec9ce){return function(_0x2a1a6c){if(_0x2a1a6c){return _0x2a1a6c['destroy']()[_0x81ef('0x23')](function(){var _0x105dfc=_0x2a1a6c[_0x81ef('0x24')]({'plain':!![]});var _0x551e47=_0x81ef('0x25');return db[_0x81ef('0x26')]['destroy']({'where':{'type':_0x551e47,'resourceId':_0x105dfc['id']}})['then'](function(){return _0x2a1a6c;});})['then'](function(){_0x23cc0b[_0x81ef('0x17')](0xcc)[_0x81ef('0x18')]();});}};}function handleEntityNotFound(_0x519828,_0x20d676){return function(_0x93bb5){if(!_0x93bb5){_0x519828[_0x81ef('0x27')](0x194);}return _0x93bb5;};}function handleError(_0x293eb9,_0x3d1c7b){_0x3d1c7b=_0x3d1c7b||0x1f4;return function(_0x57534e){logger[_0x81ef('0x28')](_0x57534e[_0x81ef('0x29')]);if(_0x57534e['name']){delete _0x57534e['name'];}_0x293eb9[_0x81ef('0x17')](_0x3d1c7b)[_0x81ef('0x2a')](_0x57534e);};}exports[_0x81ef('0x2b')]=function(_0x5be092,_0x19216b){var _0x5deb36={},_0x1d694d={},_0xdee746={'count':0x0,'rows':[]};var _0xe7a281=_[_0x81ef('0x2c')](db[_0x81ef('0x2d')][_0x81ef('0x2e')],function(_0xf8e0f2){return{'name':_0xf8e0f2['fieldName'],'type':_0xf8e0f2[_0x81ef('0x2f')][_0x81ef('0x30')]};});_0x1d694d[_0x81ef('0x31')]=_[_0x81ef('0x2c')](_0xe7a281,_0x81ef('0x32'));_0x1d694d[_0x81ef('0x33')]=_[_0x81ef('0x34')](_0x5be092[_0x81ef('0x33')]);_0x1d694d['filters']=_[_0x81ef('0x35')](_0x1d694d['model'],_0x1d694d[_0x81ef('0x33')]);_0x5deb36[_0x81ef('0x36')]=_[_0x81ef('0x35')](_0x1d694d['model'],qs[_0x81ef('0x37')](_0x5be092['query'][_0x81ef('0x37')]));_0x5deb36[_0x81ef('0x36')]=_0x5deb36[_0x81ef('0x36')][_0x81ef('0x38')]?_0x5deb36['attributes']:_0x1d694d[_0x81ef('0x31')];if(!_0x5be092[_0x81ef('0x33')][_0x81ef('0x39')]('nolimit')){_0x5deb36[_0x81ef('0x1c')]=qs[_0x81ef('0x1c')](_0x5be092[_0x81ef('0x33')]['limit']);_0x5deb36[_0x81ef('0x1a')]=qs['offset'](_0x5be092[_0x81ef('0x33')][_0x81ef('0x1a')]);}_0x5deb36[_0x81ef('0x3a')]=qs[_0x81ef('0x3b')](_0x5be092[_0x81ef('0x33')][_0x81ef('0x3b')]);_0x5deb36[_0x81ef('0x3c')]=qs[_0x81ef('0x3d')](_[_0x81ef('0x3e')](_0x5be092['query'],_0x1d694d[_0x81ef('0x3d')]),_0xe7a281);if(_0x5be092[_0x81ef('0x33')][_0x81ef('0x3f')]){_0x5deb36[_0x81ef('0x3c')]=_[_0x81ef('0x40')](_0x5deb36['where'],{'$or':_[_0x81ef('0x2c')](_0xe7a281,function(_0x3bd5ca){if(_0x3bd5ca[_0x81ef('0x2f')]!==_0x81ef('0x41')){var _0x4d1b3d={};_0x4d1b3d[_0x3bd5ca[_0x81ef('0x32')]]={'$like':'%'+_0x5be092[_0x81ef('0x33')][_0x81ef('0x3f')]+'%'};return _0x4d1b3d;}})});}_0x5deb36=_['merge']({},_0x5deb36,_0x5be092[_0x81ef('0x42')]);var _0x14ed26={'where':_0x5deb36[_0x81ef('0x3c')]};return db['AnalyticExtractedReport'][_0x81ef('0x1d')](_0x14ed26)[_0x81ef('0x23')](function(_0x1d35d6){_0xdee746[_0x81ef('0x1d')]=_0x1d35d6;if(_0x5be092[_0x81ef('0x33')]['includeAll']){_0x5deb36[_0x81ef('0x43')]=[{'all':!![]}];}return db[_0x81ef('0x2d')][_0x81ef('0x44')](_0x5deb36);})[_0x81ef('0x23')](function(_0x3d430c){_0xdee746['rows']=_0x3d430c;return _0xdee746;})[_0x81ef('0x23')](respondWithFilteredResult(_0x19216b,_0x5deb36))[_0x81ef('0x45')](handleError(_0x19216b,null));};exports[_0x81ef('0x46')]=function(_0x25c01f,_0xaa93f9){var _0x271a39={'raw':!![],'where':{'id':_0x25c01f['params']['id']}},_0x48a3f8={};_0x48a3f8[_0x81ef('0x31')]=_[_0x81ef('0x34')](db['AnalyticExtractedReport'][_0x81ef('0x2e')]);_0x48a3f8['query']=_[_0x81ef('0x34')](_0x25c01f[_0x81ef('0x33')]);_0x48a3f8[_0x81ef('0x3d')]=_[_0x81ef('0x35')](_0x48a3f8['model'],_0x48a3f8[_0x81ef('0x33')]);_0x271a39['attributes']=_[_0x81ef('0x35')](_0x48a3f8[_0x81ef('0x31')],qs[_0x81ef('0x37')](_0x25c01f[_0x81ef('0x33')][_0x81ef('0x37')]));_0x271a39[_0x81ef('0x36')]=_0x271a39[_0x81ef('0x36')][_0x81ef('0x38')]?_0x271a39[_0x81ef('0x36')]:_0x48a3f8['model'];if(_0x25c01f[_0x81ef('0x33')]['includeAll']){_0x271a39[_0x81ef('0x43')]=[{'all':!![]}];}_0x271a39=_['merge']({},_0x271a39,_0x25c01f[_0x81ef('0x42')]);return db['AnalyticExtractedReport']['find'](_0x271a39)['then'](handleEntityNotFound(_0xaa93f9,null))[_0x81ef('0x23')](respondWithResult(_0xaa93f9,null))[_0x81ef('0x45')](handleError(_0xaa93f9,null));};exports[_0x81ef('0x47')]=function(_0x234a59,_0x566abd){return db[_0x81ef('0x2d')][_0x81ef('0x47')](_0x234a59[_0x81ef('0x48')],{})['then'](function(_0x492f45){var _0x37f951=_0x234a59[_0x81ef('0x49')][_0x81ef('0x24')]({'plain':!![]});if(!_0x37f951)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x37f951[_0x81ef('0x4a')]===_0x81ef('0x49')){var _0x241f8b=_0x492f45[_0x81ef('0x24')]({'plain':!![]});var _0x26bad2=_0x81ef('0x25');return db['UserProfileSection'][_0x81ef('0x4b')]({'where':{'name':_0x26bad2,'userProfileId':_0x37f951[_0x81ef('0x4c')]},'raw':!![]})[_0x81ef('0x23')](function(_0x13d8db){if(_0x13d8db&&_0x13d8db[_0x81ef('0x4d')]===0x0){return db['UserProfileResource'][_0x81ef('0x47')]({'name':_0x241f8b[_0x81ef('0x32')],'resourceId':_0x241f8b['id'],'type':_0x13d8db[_0x81ef('0x32')],'sectionId':_0x13d8db['id']},{})[_0x81ef('0x23')](function(){return _0x492f45;});}else{return _0x492f45;}})['catch'](function(_0x55eebc){logger['error'](_0x81ef('0x4e'),_0x55eebc);throw _0x55eebc;});}return _0x492f45;})[_0x81ef('0x23')](respondWithResult(_0x566abd,0xc9))[_0x81ef('0x45')](handleError(_0x566abd,null));};exports[_0x81ef('0x22')]=function(_0x6652e2,_0x5e0335){if(_0x6652e2[_0x81ef('0x48')]['id']){delete _0x6652e2[_0x81ef('0x48')]['id'];}return db[_0x81ef('0x2d')][_0x81ef('0x4b')]({'where':{'id':_0x6652e2[_0x81ef('0x4f')]['id']}})[_0x81ef('0x23')](handleEntityNotFound(_0x5e0335,null))[_0x81ef('0x23')](saveUpdates(_0x6652e2[_0x81ef('0x48')],null))[_0x81ef('0x23')](respondWithResult(_0x5e0335,null))[_0x81ef('0x45')](handleError(_0x5e0335,null));};exports[_0x81ef('0x50')]=function(_0x2339b4,_0x2e1226){return db['AnalyticExtractedReport'][_0x81ef('0x4b')]({'where':{'id':_0x2339b4[_0x81ef('0x4f')]['id']}})[_0x81ef('0x23')](handleEntityNotFound(_0x2e1226,null))[_0x81ef('0x23')](removeEntity(_0x2e1226,null))[_0x81ef('0x45')](handleError(_0x2e1226,null));};exports[_0x81ef('0x51')]=function(_0x525a98,_0x26da84,_0x3fc37c){return db['AnalyticExtractedReport'][_0x81ef('0x4b')]({'where':{'id':_0x525a98[_0x81ef('0x4f')]['id']},'attributes':[_0x81ef('0x32'),_0x81ef('0x52'),_0x81ef('0x53'),_0x81ef('0x54')],'raw':!![]})[_0x81ef('0x23')](handleEntityNotFound(_0x26da84,null))['then'](function(_0xb43fb1){if(_0xb43fb1){if(!fs[_0x81ef('0x55')](path[_0x81ef('0x56')](config['root'],_0x81ef('0x57'),_0xb43fb1[_0x81ef('0x53')]))){throw new db[(_0x81ef('0x58'))]['ValidationError'](_0x81ef('0x59'));}if(_0x525a98[_0x81ef('0x33')][_0x81ef('0x5a')]){return _0x26da84['sendStatus'](0xc8);}return _0x26da84['download'](path[_0x81ef('0x56')](config[_0x81ef('0x5b')],_0x81ef('0x57'),_0xb43fb1[_0x81ef('0x53')]),util[_0x81ef('0x5c')](_0x81ef('0x5d'),_0xb43fb1[_0x81ef('0x52')]||_0xb43fb1[_0x81ef('0x32')],_0xb43fb1[_0x81ef('0x54')][_0x81ef('0x5e')]()));}})['catch'](handleError(_0x26da84,null));};
\ No newline at end of file
+var _0x2367=['sox','to-csv','ejs','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','destroy','get','ExtractedReports','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','AnalyticExtractedReport','includeAll','include','findAll','catch','show','params','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','body','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','format','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path'];(function(_0x19b2fb,_0x57af95){var _0x4ecad7=function(_0x3e6806){while(--_0x3e6806){_0x19b2fb['push'](_0x19b2fb['shift']());}};_0x4ecad7(++_0x57af95);}(_0x2367,0xb5));var _0x7236=function(_0x403145,_0x3aec5e){_0x403145=_0x403145-0x0;var _0x5e1d6f=_0x2367[_0x403145];return _0x5e1d6f;};'use strict';var emlformat=require(_0x7236('0x0'));var rimraf=require(_0x7236('0x1'));var zipdir=require(_0x7236('0x2'));var jsonpatch=require(_0x7236('0x3'));var rp=require(_0x7236('0x4'));var moment=require('moment');var BPromise=require(_0x7236('0x5'));var Mustache=require(_0x7236('0x6'));var util=require(_0x7236('0x7'));var path=require(_0x7236('0x8'));var sox=require(_0x7236('0x9'));var csv=require(_0x7236('0xa'));var ejs=require(_0x7236('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7236('0xc'));var squel=require(_0x7236('0xd'));var crypto=require(_0x7236('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7236('0xa'));var querystring=require('querystring');var Papa=require(_0x7236('0xf'));var Redis=require('ioredis');var authService=require(_0x7236('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7236('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7236('0x12'))(_0x7236('0x13'));var utils=require(_0x7236('0x14'));var config=require(_0x7236('0x15'));var licenseUtil=require(_0x7236('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x19066d,_0x305e05){_0x305e05=_0x305e05||0xcc;return function(_0x1489c2){if(_0x1489c2){return _0x19066d['sendStatus'](_0x305e05);}return _0x19066d[_0x7236('0x17')](_0x305e05)[_0x7236('0x18')]();};}function respondWithResult(_0x42bc5c,_0xcff778){_0xcff778=_0xcff778||0xc8;return function(_0x172fd3){if(_0x172fd3){return _0x42bc5c[_0x7236('0x17')](_0xcff778)[_0x7236('0x19')](_0x172fd3);}};}function respondWithFilteredResult(_0x4140b5,_0xb3f7e7){return function(_0x425602){if(_0x425602){var _0x435213=typeof _0xb3f7e7[_0x7236('0x1a')]===_0x7236('0x1b')&&typeof _0xb3f7e7['limit']==='undefined';var _0x2872b8=_0x425602[_0x7236('0x1c')];var _0x2d78e2=_0x435213?0x0:_0xb3f7e7[_0x7236('0x1a')];var _0x4db8f3=_0x435213?_0x425602[_0x7236('0x1c')]:_0xb3f7e7[_0x7236('0x1a')]+_0xb3f7e7[_0x7236('0x1d')];var _0x152ec4;if(_0x4db8f3>=_0x2872b8){_0x4db8f3=_0x2872b8;_0x152ec4=0xc8;}else{_0x152ec4=0xce;}_0x4140b5['status'](_0x152ec4);return _0x4140b5['set'](_0x7236('0x1e'),_0x2d78e2+'-'+_0x4db8f3+'/'+_0x2872b8)[_0x7236('0x19')](_0x425602);}return null;};}function patchUpdates(_0x1405b0){return function(_0x10af4c){try{jsonpatch[_0x7236('0x1f')](_0x10af4c,_0x1405b0,!![]);}catch(_0x479bc1){return BPromise[_0x7236('0x20')](_0x479bc1);}return _0x10af4c['save']();};}function saveUpdates(_0x309c07,_0x1f2907){return function(_0x4d47a5){if(_0x4d47a5){return _0x4d47a5[_0x7236('0x21')](_0x309c07)[_0x7236('0x22')](function(_0x17d613){return _0x17d613;});}return null;};}function removeEntity(_0xb735e1,_0x217a8e){return function(_0x5ecf0f){if(_0x5ecf0f){return _0x5ecf0f[_0x7236('0x23')]()['then'](function(){var _0x40889f=_0x5ecf0f[_0x7236('0x24')]({'plain':!![]});var _0x469f2d=_0x7236('0x25');return db['UserProfileResource'][_0x7236('0x23')]({'where':{'type':_0x469f2d,'resourceId':_0x40889f['id']}})[_0x7236('0x22')](function(){return _0x5ecf0f;});})[_0x7236('0x22')](function(){_0xb735e1[_0x7236('0x17')](0xcc)[_0x7236('0x18')]();});}};}function handleEntityNotFound(_0x57c943,_0x135dc6){return function(_0x38e710){if(!_0x38e710){_0x57c943[_0x7236('0x26')](0x194);}return _0x38e710;};}function handleError(_0x278559,_0x15e5bb){_0x15e5bb=_0x15e5bb||0x1f4;return function(_0xd999f4){logger[_0x7236('0x27')](_0xd999f4[_0x7236('0x28')]);if(_0xd999f4[_0x7236('0x29')]){delete _0xd999f4[_0x7236('0x29')];}_0x278559[_0x7236('0x17')](_0x15e5bb)[_0x7236('0x2a')](_0xd999f4);};}exports[_0x7236('0x2b')]=function(_0x4e4d69,_0x1b43de){var _0x539b84={},_0x3a193a={},_0x4b700d={'count':0x0,'rows':[]};var _0x319abf=_[_0x7236('0x2c')](db['AnalyticExtractedReport'][_0x7236('0x2d')],function(_0x284876){return{'name':_0x284876[_0x7236('0x2e')],'type':_0x284876[_0x7236('0x2f')][_0x7236('0x30')]};});_0x3a193a[_0x7236('0x31')]=_[_0x7236('0x2c')](_0x319abf,_0x7236('0x29'));_0x3a193a['query']=_[_0x7236('0x32')](_0x4e4d69[_0x7236('0x33')]);_0x3a193a[_0x7236('0x34')]=_[_0x7236('0x35')](_0x3a193a[_0x7236('0x31')],_0x3a193a[_0x7236('0x33')]);_0x539b84[_0x7236('0x36')]=_[_0x7236('0x35')](_0x3a193a[_0x7236('0x31')],qs[_0x7236('0x37')](_0x4e4d69['query'][_0x7236('0x37')]));_0x539b84['attributes']=_0x539b84[_0x7236('0x36')][_0x7236('0x38')]?_0x539b84[_0x7236('0x36')]:_0x3a193a[_0x7236('0x31')];if(!_0x4e4d69[_0x7236('0x33')][_0x7236('0x39')]('nolimit')){_0x539b84[_0x7236('0x1d')]=qs['limit'](_0x4e4d69['query'][_0x7236('0x1d')]);_0x539b84[_0x7236('0x1a')]=qs[_0x7236('0x1a')](_0x4e4d69[_0x7236('0x33')]['offset']);}_0x539b84[_0x7236('0x3a')]=qs[_0x7236('0x3b')](_0x4e4d69[_0x7236('0x33')]['sort']);_0x539b84['where']=qs[_0x7236('0x34')](_[_0x7236('0x3c')](_0x4e4d69[_0x7236('0x33')],_0x3a193a[_0x7236('0x34')]),_0x319abf);if(_0x4e4d69['query'][_0x7236('0x3d')]){_0x539b84['where']=_[_0x7236('0x3e')](_0x539b84['where'],{'$or':_[_0x7236('0x2c')](_0x319abf,function(_0x3d8d36){if(_0x3d8d36[_0x7236('0x2f')]!=='VIRTUAL'){var _0x262b97={};_0x262b97[_0x3d8d36[_0x7236('0x29')]]={'$like':'%'+_0x4e4d69[_0x7236('0x33')][_0x7236('0x3d')]+'%'};return _0x262b97;}})});}_0x539b84=_[_0x7236('0x3e')]({},_0x539b84,_0x4e4d69['options']);var _0x1a9d98={'where':_0x539b84[_0x7236('0x3f')]};return db[_0x7236('0x40')]['count'](_0x1a9d98)[_0x7236('0x22')](function(_0x4a0cb3){_0x4b700d[_0x7236('0x1c')]=_0x4a0cb3;if(_0x4e4d69[_0x7236('0x33')][_0x7236('0x41')]){_0x539b84[_0x7236('0x42')]=[{'all':!![]}];}return db[_0x7236('0x40')][_0x7236('0x43')](_0x539b84);})[_0x7236('0x22')](function(_0x19489c){_0x4b700d['rows']=_0x19489c;return _0x4b700d;})[_0x7236('0x22')](respondWithFilteredResult(_0x1b43de,_0x539b84))[_0x7236('0x44')](handleError(_0x1b43de,null));};exports[_0x7236('0x45')]=function(_0x1f25cb,_0x54aa22){var _0x2e16de={'raw':!![],'where':{'id':_0x1f25cb[_0x7236('0x46')]['id']}},_0x4d8abf={};_0x4d8abf[_0x7236('0x31')]=_['keys'](db[_0x7236('0x40')]['rawAttributes']);_0x4d8abf[_0x7236('0x33')]=_[_0x7236('0x32')](_0x1f25cb['query']);_0x4d8abf['filters']=_[_0x7236('0x35')](_0x4d8abf[_0x7236('0x31')],_0x4d8abf[_0x7236('0x33')]);_0x2e16de['attributes']=_['intersection'](_0x4d8abf[_0x7236('0x31')],qs[_0x7236('0x37')](_0x1f25cb['query'][_0x7236('0x37')]));_0x2e16de['attributes']=_0x2e16de[_0x7236('0x36')]['length']?_0x2e16de[_0x7236('0x36')]:_0x4d8abf[_0x7236('0x31')];if(_0x1f25cb['query']['includeAll']){_0x2e16de[_0x7236('0x42')]=[{'all':!![]}];}_0x2e16de=_[_0x7236('0x3e')]({},_0x2e16de,_0x1f25cb[_0x7236('0x47')]);return db['AnalyticExtractedReport'][_0x7236('0x48')](_0x2e16de)['then'](handleEntityNotFound(_0x54aa22,null))[_0x7236('0x22')](respondWithResult(_0x54aa22,null))['catch'](handleError(_0x54aa22,null));};exports[_0x7236('0x49')]=function(_0x102ebe,_0x4ebb31){return db[_0x7236('0x40')][_0x7236('0x49')](_0x102ebe['body'],{})[_0x7236('0x22')](function(_0x2f0817){var _0x372d16=_0x102ebe[_0x7236('0x4a')][_0x7236('0x24')]({'plain':!![]});if(!_0x372d16)throw new Error(_0x7236('0x4b'));if(_0x372d16[_0x7236('0x4c')]===_0x7236('0x4a')){var _0x34fc99=_0x2f0817[_0x7236('0x24')]({'plain':!![]});var _0x470f81=_0x7236('0x25');return db[_0x7236('0x4d')]['find']({'where':{'name':_0x470f81,'userProfileId':_0x372d16[_0x7236('0x4e')]},'raw':!![]})[_0x7236('0x22')](function(_0x3940aa){if(_0x3940aa&&_0x3940aa[_0x7236('0x4f')]===0x0){return db['UserProfileResource'][_0x7236('0x49')]({'name':_0x34fc99[_0x7236('0x29')],'resourceId':_0x34fc99['id'],'type':_0x3940aa[_0x7236('0x29')],'sectionId':_0x3940aa['id']},{})[_0x7236('0x22')](function(){return _0x2f0817;});}else{return _0x2f0817;}})[_0x7236('0x44')](function(_0x4ceae2){logger[_0x7236('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4ceae2);throw _0x4ceae2;});}return _0x2f0817;})[_0x7236('0x22')](respondWithResult(_0x4ebb31,0xc9))[_0x7236('0x44')](handleError(_0x4ebb31,null));};exports[_0x7236('0x21')]=function(_0x5a875a,_0x3f547e){if(_0x5a875a['body']['id']){delete _0x5a875a['body']['id'];}return db[_0x7236('0x40')]['find']({'where':{'id':_0x5a875a[_0x7236('0x46')]['id']}})[_0x7236('0x22')](handleEntityNotFound(_0x3f547e,null))[_0x7236('0x22')](saveUpdates(_0x5a875a[_0x7236('0x50')],null))['then'](respondWithResult(_0x3f547e,null))[_0x7236('0x44')](handleError(_0x3f547e,null));};exports[_0x7236('0x23')]=function(_0x1be458,_0x4031d5){return db[_0x7236('0x40')][_0x7236('0x48')]({'where':{'id':_0x1be458['params']['id']}})[_0x7236('0x22')](handleEntityNotFound(_0x4031d5,null))[_0x7236('0x22')](removeEntity(_0x4031d5,null))[_0x7236('0x44')](handleError(_0x4031d5,null));};exports['download']=function(_0x389089,_0x2ca120,_0x24ccf6){return db[_0x7236('0x40')][_0x7236('0x48')]({'where':{'id':_0x389089[_0x7236('0x46')]['id']},'attributes':['name',_0x7236('0x51'),_0x7236('0x52'),_0x7236('0x53')],'raw':!![]})[_0x7236('0x22')](handleEntityNotFound(_0x2ca120,null))[_0x7236('0x22')](function(_0x32684c){if(_0x32684c){if(!fs[_0x7236('0x54')](path[_0x7236('0x55')](config[_0x7236('0x56')],_0x7236('0x57'),_0x32684c[_0x7236('0x52')]))){throw new db[(_0x7236('0x58'))][(_0x7236('0x59'))](_0x7236('0x5a'));}if(_0x389089[_0x7236('0x33')][_0x7236('0x5b')]){return _0x2ca120[_0x7236('0x26')](0xc8);}return _0x2ca120[_0x7236('0x5c')](path['join'](config[_0x7236('0x56')],_0x7236('0x57'),_0x32684c[_0x7236('0x52')]),util[_0x7236('0x5d')]('%s.%s',_0x32684c['basename']||_0x32684c[_0x7236('0x29')],_0x32684c[_0x7236('0x53')][_0x7236('0x5e')]()));}})[_0x7236('0x44')](handleError(_0x2ca120,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 2506fb3..f41ea23 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 _0xeb8d=['moment','bluebird','request-promise','path','rimraf','exports','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger'];(function(_0x52a45c,_0x331b52){var _0x4ac4be=function(_0x3167dc){while(--_0x3167dc){_0x52a45c['push'](_0x52a45c['shift']());}};_0x4ac4be(++_0x331b52);}(_0xeb8d,0xce));var _0xdeb8=function(_0x1eb470,_0x52fc1a){_0x1eb470=_0x1eb470-0x0;var _0x48e20f=_0xeb8d[_0x1eb470];return _0x48e20f;};'use strict';var _=require(_0xdeb8('0x0'));var util=require(_0xdeb8('0x1'));var logger=require(_0xdeb8('0x2'))('api');var moment=require(_0xdeb8('0x3'));var BPromise=require(_0xdeb8('0x4'));var rp=require(_0xdeb8('0x5'));var fs=require('fs');var path=require(_0xdeb8('0x6'));var rimraf=require(_0xdeb8('0x7'));var config=require('../../config/environment');var attributes=require('./analyticExtractedReport.attributes');module[_0xdeb8('0x8')]=function(_0x20b8fa,_0x35a019){return _0x20b8fa['define'](_0xdeb8('0x9'),attributes,{'tableName':_0xdeb8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x05b5=['path','rimraf','../../config/environment','exports','AnalyticExtractedReport','analytics_extracted_reports','util','moment','bluebird','request-promise'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x05b5,0x114));var _0x505b=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x05b5[_0x138adb];return _0x1b27f2;};'use strict';var _=require('lodash');var util=require(_0x505b('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x505b('0x1'));var BPromise=require(_0x505b('0x2'));var rp=require(_0x505b('0x3'));var fs=require('fs');var path=require(_0x505b('0x4'));var rimraf=require(_0x505b('0x5'));var config=require(_0x505b('0x6'));var attributes=require('./analyticExtractedReport.attributes');module[_0x505b('0x7')]=function(_0xcd07df,_0x2a0a73){return _0xcd07df['define'](_0x505b('0x8'),attributes,{'tableName':_0x505b('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 9351a19..0891a13 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 _0xd087=['request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x400767,_0x4f362e){var _0x30a53f=function(_0x16c75c){while(--_0x16c75c){_0x400767['push'](_0x400767['shift']());}};_0x30a53f(++_0x4f362e);}(_0xd087,0x1bd));var _0x7d08=function(_0x1b58b8,_0x3e1c2a){_0x1b58b8=_0x1b58b8-0x0;var _0x479502=_0xd087[_0x1b58b8];return _0x479502;};'use strict';var _=require(_0x7d08('0x0'));var util=require(_0x7d08('0x1'));var moment=require(_0x7d08('0x2'));var BPromise=require(_0x7d08('0x3'));var rs=require(_0x7d08('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7d08('0x5'));var logger=require(_0x7d08('0x6'))('rpc');var config=require(_0x7d08('0x7'));var jayson=require(_0x7d08('0x8'));var client=jayson[_0x7d08('0x9')][_0x7d08('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb977ef,_0x5bbf46,_0x57803a){return new BPromise(function(_0x2578b7,_0x2375a6){return client[_0x7d08('0xb')](_0xb977ef,_0x57803a)[_0x7d08('0xc')](function(_0x2404ce){logger[_0x7d08('0xd')](_0x7d08('0xe'),_0x5bbf46,_0x7d08('0xf'));logger[_0x7d08('0x10')](_0x7d08('0x11'),_0x5bbf46,_0x7d08('0xf'),JSON[_0x7d08('0x12')](_0x2404ce));if(_0x2404ce[_0x7d08('0x13')]){if(_0x2404ce[_0x7d08('0x13')][_0x7d08('0x14')]===0x1f4){logger[_0x7d08('0x13')](_0x7d08('0xe'),_0x5bbf46,_0x2404ce[_0x7d08('0x13')][_0x7d08('0x15')]);return _0x2375a6(_0x2404ce[_0x7d08('0x13')][_0x7d08('0x15')]);}logger[_0x7d08('0x13')](_0x7d08('0xe'),_0x5bbf46,_0x2404ce[_0x7d08('0x13')][_0x7d08('0x15')]);return _0x2578b7(_0x2404ce['error']['message']);}else{logger[_0x7d08('0xd')](_0x7d08('0xe'),_0x5bbf46,_0x7d08('0xf'));_0x2578b7(_0x2404ce[_0x7d08('0x16')][_0x7d08('0x15')]);}})[_0x7d08('0x17')](function(_0x226c4c){logger[_0x7d08('0x13')](_0x7d08('0xe'),_0x5bbf46,_0x226c4c);_0x2375a6(_0x226c4c);});});}
\ No newline at end of file
+var _0x5b12=['AnalyticExtractedReport,\x20%s,\x20%s','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','client','request','then','info','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4b73a2,_0x40b5fe){var _0x383c66=function(_0x3917ae){while(--_0x3917ae){_0x4b73a2['push'](_0x4b73a2['shift']());}};_0x383c66(++_0x40b5fe);}(_0x5b12,0xa3));var _0x25b1=function(_0x1c8d0e,_0x38e48b){_0x1c8d0e=_0x1c8d0e-0x0;var _0x30f9b4=_0x5b12[_0x1c8d0e];return _0x30f9b4;};'use strict';var _=require(_0x25b1('0x0'));var util=require(_0x25b1('0x1'));var moment=require(_0x25b1('0x2'));var BPromise=require('bluebird');var rs=require(_0x25b1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x25b1('0x4'))['db'];var utils=require(_0x25b1('0x5'));var logger=require('../../config/logger')(_0x25b1('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x25b1('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5bb95b,_0x1f715d,_0x28c980){return new BPromise(function(_0x451c66,_0x2a46e0){return client[_0x25b1('0x8')](_0x5bb95b,_0x28c980)[_0x25b1('0x9')](function(_0x3346ed){logger[_0x25b1('0xa')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1f715d,_0x25b1('0xb'));logger[_0x25b1('0xc')](_0x25b1('0xd'),_0x1f715d,_0x25b1('0xb'),JSON[_0x25b1('0xe')](_0x3346ed));if(_0x3346ed[_0x25b1('0xf')]){if(_0x3346ed[_0x25b1('0xf')][_0x25b1('0x10')]===0x1f4){logger[_0x25b1('0xf')](_0x25b1('0x11'),_0x1f715d,_0x3346ed[_0x25b1('0xf')][_0x25b1('0x12')]);return _0x2a46e0(_0x3346ed[_0x25b1('0xf')][_0x25b1('0x12')]);}logger[_0x25b1('0xf')](_0x25b1('0x11'),_0x1f715d,_0x3346ed['error'][_0x25b1('0x12')]);return _0x451c66(_0x3346ed[_0x25b1('0xf')]['message']);}else{logger[_0x25b1('0xa')](_0x25b1('0x11'),_0x1f715d,_0x25b1('0xb'));_0x451c66(_0x3346ed['result']['message']);}})[_0x25b1('0x13')](function(_0x573ec2){logger[_0x25b1('0xf')](_0x25b1('0x11'),_0x1f715d,_0x573ec2);_0x2a46e0(_0x573ec2);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 01e62ed..7d2088c 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 _0xfd38=['create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/download','download','post'];(function(_0xb45119,_0x90c648){var _0x469da0=function(_0x5ac700){while(--_0x5ac700){_0xb45119['push'](_0xb45119['shift']());}};_0x469da0(++_0x90c648);}(_0xfd38,0xd8));var _0x8fd3=function(_0x406f5c,_0xd2bc06){_0x406f5c=_0x406f5c-0x0;var _0x3120d9=_0xfd38[_0x406f5c];return _0x3120d9;};'use strict';var multer=require(_0x8fd3('0x0'));var util=require(_0x8fd3('0x1'));var path=require('path');var timeout=require(_0x8fd3('0x2'));var express=require(_0x8fd3('0x3'));var router=express[_0x8fd3('0x4')]();var fs_extra=require(_0x8fd3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8fd3('0x6'));var config=require(_0x8fd3('0x7'));var controller=require('./analyticExtractedReport.controller');router[_0x8fd3('0x8')]('/',auth[_0x8fd3('0x9')](),controller[_0x8fd3('0xa')]);router[_0x8fd3('0x8')](_0x8fd3('0xb'),auth['isAuthenticated'](),controller['show']);router['get'](_0x8fd3('0xc'),auth[_0x8fd3('0x9')](),controller[_0x8fd3('0xd')]);router[_0x8fd3('0xe')]('/',auth[_0x8fd3('0x9')](),controller[_0x8fd3('0xf')]);router[_0x8fd3('0x10')]('/:id',auth[_0x8fd3('0x9')](),controller[_0x8fd3('0x11')]);router[_0x8fd3('0x12')](_0x8fd3('0xb'),auth[_0x8fd3('0x9')](),controller[_0x8fd3('0x13')]);module[_0x8fd3('0x14')]=router;
\ No newline at end of file
+var _0xb61b=['Router','fs-extra','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','create','update','exports','multer','util','express'];(function(_0x3a3f0c,_0x174f79){var _0x184722=function(_0x4fb5c3){while(--_0x4fb5c3){_0x3a3f0c['push'](_0x3a3f0c['shift']());}};_0x184722(++_0x174f79);}(_0xb61b,0xbd));var _0xbb61=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xb61b[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0xbb61('0x0'));var util=require(_0xbb61('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbb61('0x2'));var router=express[_0xbb61('0x3')]();var fs_extra=require(_0xbb61('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbb61('0x5'));router[_0xbb61('0x6')]('/',auth[_0xbb61('0x7')](),controller[_0xbb61('0x8')]);router[_0xbb61('0x6')](_0xbb61('0x9'),auth[_0xbb61('0x7')](),controller[_0xbb61('0xa')]);router[_0xbb61('0x6')](_0xbb61('0xb'),auth['isAuthenticated'](),controller[_0xbb61('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbb61('0xd')]);router['put'](_0xbb61('0x9'),auth[_0xbb61('0x7')](),controller[_0xbb61('0xe')]);router['delete']('/:id',auth[_0xbb61('0x7')](),controller['destroy']);module[_0xbb61('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index b88561e..117a9d8 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 _0x7821=['STRING','BOOLEAN','sequelize','exports'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x7821,0xea));var _0x1782=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0x7821[_0xa6cc5c];return _0x44803d;};'use strict';var Sequelize=require(_0x1782('0x0'));module[_0x1782('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x1782('0x2')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x1782('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x1782('0x2')]},'custom':{'type':Sequelize[_0x1782('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x932a=['sequelize','exports','STRING','BOOLEAN'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x932a,0x64));var _0xa932=function(_0x247d01,_0x1851fb){_0x247d01=_0x247d01-0x0;var _0xf18e8=_0x932a[_0x247d01];return _0xf18e8;};'use strict';var Sequelize=require(_0xa932('0x0'));module[_0xa932('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xa932('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0xa932('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xa932('0x2')]},'custom':{'type':Sequelize[_0xa932('0x3')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 4596fb6..27db7ff 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 _0xd33c=['map','AnalyticFieldReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','bulkCreate','update','bulkDestroy','addFields','sequelize','CustomReportId','fast-json-patch','request-promise','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index'];(function(_0x332c43,_0x545e88){var _0x20468e=function(_0x3ec7f9){while(--_0x3ec7f9){_0x332c43['push'](_0x332c43['shift']());}};_0x20468e(++_0x545e88);}(_0xd33c,0x7b));var _0xcd33=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xd33c[_0x4709c0];return _0x13348b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xcd33('0x0'));var rp=require(_0xcd33('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xcd33('0x2'));var util=require(_0xcd33('0x3'));var path=require('path');var sox=require(_0xcd33('0x4'));var csv=require('to-csv');var ejs=require(_0xcd33('0x5'));var fs=require('fs');var fs_extra=require(_0xcd33('0x6'));var _=require('lodash');var squel=require(_0xcd33('0x7'));var crypto=require(_0xcd33('0x8'));var jsforce=require(_0xcd33('0x9'));var deskjs=require(_0xcd33('0xa'));var toCsv=require(_0xcd33('0xb'));var querystring=require(_0xcd33('0xc'));var Papa=require(_0xcd33('0xd'));var Redis=require(_0xcd33('0xe'));var authService=require(_0xcd33('0xf'));var qs=require(_0xcd33('0x10'));var as=require(_0xcd33('0x11'));var hardwareService=require(_0xcd33('0x12'));var logger=require(_0xcd33('0x13'))(_0xcd33('0x14'));var utils=require(_0xcd33('0x15'));var config=require(_0xcd33('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xcd33('0x17'))['db'];function respondWithStatusCode(_0x364a70,_0x38bb4c){_0x38bb4c=_0x38bb4c||0xcc;return function(_0xaa9338){if(_0xaa9338){return _0x364a70['sendStatus'](_0x38bb4c);}return _0x364a70[_0xcd33('0x18')](_0x38bb4c)[_0xcd33('0x19')]();};}function respondWithResult(_0x5f9a3,_0xe0269e){_0xe0269e=_0xe0269e||0xc8;return function(_0x4c58b6){if(_0x4c58b6){return _0x5f9a3['status'](_0xe0269e)[_0xcd33('0x1a')](_0x4c58b6);}};}function respondWithFilteredResult(_0x423d93,_0x3bcab3){return function(_0x12fed8){if(_0x12fed8){var _0x294a70=typeof _0x3bcab3[_0xcd33('0x1b')]===_0xcd33('0x1c')&&typeof _0x3bcab3[_0xcd33('0x1d')]===_0xcd33('0x1c');var _0x53eb23=_0x12fed8['count'];var _0x520899=_0x294a70?0x0:_0x3bcab3[_0xcd33('0x1b')];var _0x4dcb7e=_0x294a70?_0x12fed8[_0xcd33('0x1e')]:_0x3bcab3[_0xcd33('0x1b')]+_0x3bcab3[_0xcd33('0x1d')];var _0x17c415;if(_0x4dcb7e>=_0x53eb23){_0x4dcb7e=_0x53eb23;_0x17c415=0xc8;}else{_0x17c415=0xce;}_0x423d93['status'](_0x17c415);return _0x423d93[_0xcd33('0x1f')](_0xcd33('0x20'),_0x520899+'-'+_0x4dcb7e+'/'+_0x53eb23)['json'](_0x12fed8);}return null;};}function patchUpdates(_0x37a5f6){return function(_0x2dcb66){try{jsonpatch[_0xcd33('0x21')](_0x2dcb66,_0x37a5f6,!![]);}catch(_0x1383ee){return BPromise['reject'](_0x1383ee);}return _0x2dcb66[_0xcd33('0x22')]();};}function saveUpdates(_0x191695,_0x53724d){return function(_0x4d6b3f){if(_0x4d6b3f){return _0x4d6b3f['update'](_0x191695)[_0xcd33('0x23')](function(_0xb3ace2){return _0xb3ace2;});}return null;};}function removeEntity(_0x19bd13,_0x461610){return function(_0x38065a){if(_0x38065a){return _0x38065a[_0xcd33('0x24')]()['then'](function(){_0x19bd13[_0xcd33('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1585e3,_0x16d36c){return function(_0x244b91){if(!_0x244b91){_0x1585e3[_0xcd33('0x25')](0x194);}return _0x244b91;};}function handleError(_0xbf38bc,_0x315456){_0x315456=_0x315456||0x1f4;return function(_0x5c6466){logger[_0xcd33('0x26')](_0x5c6466[_0xcd33('0x27')]);if(_0x5c6466[_0xcd33('0x28')]){delete _0x5c6466['name'];}_0xbf38bc[_0xcd33('0x18')](_0x315456)[_0xcd33('0x29')](_0x5c6466);};}exports[_0xcd33('0x2a')]=function(_0x45a381,_0x5b6bc0){var _0x3ccc6d={},_0x45e44a={},_0x29269e={'count':0x0,'rows':[]};var _0x30ee1a=_[_0xcd33('0x2b')](db[_0xcd33('0x2c')][_0xcd33('0x2d')],function(_0x40601e){return{'name':_0x40601e[_0xcd33('0x2e')],'type':_0x40601e['type'][_0xcd33('0x2f')]};});_0x45e44a[_0xcd33('0x30')]=_['map'](_0x30ee1a,'name');_0x45e44a[_0xcd33('0x31')]=_[_0xcd33('0x32')](_0x45a381[_0xcd33('0x31')]);_0x45e44a[_0xcd33('0x33')]=_[_0xcd33('0x34')](_0x45e44a[_0xcd33('0x30')],_0x45e44a['query']);_0x3ccc6d[_0xcd33('0x35')]=_['intersection'](_0x45e44a[_0xcd33('0x30')],qs[_0xcd33('0x36')](_0x45a381[_0xcd33('0x31')]['fields']));_0x3ccc6d[_0xcd33('0x35')]=_0x3ccc6d[_0xcd33('0x35')][_0xcd33('0x37')]?_0x3ccc6d[_0xcd33('0x35')]:_0x45e44a[_0xcd33('0x30')];if(!_0x45a381['query'][_0xcd33('0x38')](_0xcd33('0x39'))){_0x3ccc6d[_0xcd33('0x1d')]=qs[_0xcd33('0x1d')](_0x45a381[_0xcd33('0x31')][_0xcd33('0x1d')]);_0x3ccc6d[_0xcd33('0x1b')]=qs[_0xcd33('0x1b')](_0x45a381['query'][_0xcd33('0x1b')]);}_0x3ccc6d[_0xcd33('0x3a')]=qs['sort'](_0x45a381[_0xcd33('0x31')][_0xcd33('0x3b')]);_0x3ccc6d[_0xcd33('0x3c')]=qs[_0xcd33('0x33')](_[_0xcd33('0x3d')](_0x45a381[_0xcd33('0x31')],_0x45e44a[_0xcd33('0x33')]),_0x30ee1a);if(_0x45a381[_0xcd33('0x31')]['filter']){_0x3ccc6d[_0xcd33('0x3c')]=_[_0xcd33('0x3e')](_0x3ccc6d[_0xcd33('0x3c')],{'$or':_['map'](_0x30ee1a,function(_0x5e77a2){if(_0x5e77a2[_0xcd33('0x3f')]!==_0xcd33('0x40')){var _0x57c52d={};_0x57c52d[_0x5e77a2[_0xcd33('0x28')]]={'$like':'%'+_0x45a381[_0xcd33('0x31')][_0xcd33('0x41')]+'%'};return _0x57c52d;}})});}_0x3ccc6d=_[_0xcd33('0x3e')]({},_0x3ccc6d,_0x45a381[_0xcd33('0x42')]);var _0x503105={'where':_0x3ccc6d[_0xcd33('0x3c')]};return db[_0xcd33('0x2c')][_0xcd33('0x1e')](_0x503105)[_0xcd33('0x23')](function(_0x574011){_0x29269e[_0xcd33('0x1e')]=_0x574011;if(_0x45a381[_0xcd33('0x31')][_0xcd33('0x43')]){_0x3ccc6d[_0xcd33('0x44')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0xcd33('0x45')](_0x3ccc6d);})['then'](function(_0x43451a){_0x29269e[_0xcd33('0x46')]=_0x43451a;return _0x29269e;})[_0xcd33('0x23')](respondWithFilteredResult(_0x5b6bc0,_0x3ccc6d))['catch'](handleError(_0x5b6bc0,null));};exports[_0xcd33('0x47')]=function(_0x3da115,_0x417967){var _0x551fc7={'raw':![],'where':{'id':_0x3da115[_0xcd33('0x48')]['id']}},_0x41bb8c={};_0x41bb8c[_0xcd33('0x30')]=_[_0xcd33('0x32')](db[_0xcd33('0x2c')][_0xcd33('0x2d')]);_0x41bb8c[_0xcd33('0x31')]=_['keys'](_0x3da115['query']);_0x41bb8c[_0xcd33('0x33')]=_[_0xcd33('0x34')](_0x41bb8c[_0xcd33('0x30')],_0x41bb8c[_0xcd33('0x31')]);_0x551fc7[_0xcd33('0x35')]=_['intersection'](_0x41bb8c['model'],qs[_0xcd33('0x36')](_0x3da115[_0xcd33('0x31')][_0xcd33('0x36')]));_0x551fc7[_0xcd33('0x35')]=_0x551fc7[_0xcd33('0x35')][_0xcd33('0x37')]?_0x551fc7['attributes']:_0x41bb8c[_0xcd33('0x30')];if(_0x3da115[_0xcd33('0x31')][_0xcd33('0x43')]){_0x551fc7[_0xcd33('0x44')]=[{'all':!![]}];}_0x551fc7=_['merge']({},_0x551fc7,_0x3da115[_0xcd33('0x42')]);return db['AnalyticFieldReport'][_0xcd33('0x49')](_0x551fc7)['then'](handleEntityNotFound(_0x417967,null))[_0xcd33('0x23')](respondWithResult(_0x417967,null))[_0xcd33('0x4a')](handleError(_0x417967,null));};exports[_0xcd33('0x4b')]=function(_0x65d30d,_0x55f470){return db[_0xcd33('0x2c')]['create'](_0x65d30d[_0xcd33('0x4c')],{})['then'](respondWithResult(_0x55f470,0xc9))['catch'](handleError(_0x55f470,null));};exports[_0xcd33('0x4d')]=function(_0x3b2920,_0x27d299){return db['AnalyticFieldReport']['bulkCreate'](_0x3b2920['body'],{'raw':![],'individualHooks':!![]})[_0xcd33('0x23')](respondWithResult(_0x27d299,0xc9))[_0xcd33('0x4a')](handleError(_0x27d299,null));};exports[_0xcd33('0x4e')]=function(_0x252e53,_0x376d40){if(_0x252e53['body']['id']){delete _0x252e53[_0xcd33('0x4c')]['id'];}return db[_0xcd33('0x2c')][_0xcd33('0x49')]({'where':{'id':_0x252e53[_0xcd33('0x48')]['id']}})[_0xcd33('0x23')](handleEntityNotFound(_0x376d40,null))[_0xcd33('0x23')](saveUpdates(_0x252e53['body'],null))[_0xcd33('0x23')](respondWithResult(_0x376d40,null))[_0xcd33('0x4a')](handleError(_0x376d40,null));};exports['destroy']=function(_0x289e9e,_0x309372){return db['AnalyticFieldReport'][_0xcd33('0x49')]({'where':{'id':_0x289e9e[_0xcd33('0x48')]['id']}})[_0xcd33('0x23')](handleEntityNotFound(_0x309372,null))[_0xcd33('0x23')](removeEntity(_0x309372,null))[_0xcd33('0x4a')](handleError(_0x309372,null));};exports[_0xcd33('0x4f')]=function(_0x35262f,_0x3cc813){return db[_0xcd33('0x2c')][_0xcd33('0x24')]({'where':{'id':_0x35262f[_0xcd33('0x31')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0xcd33('0x23')](respondWithResult(_0x3cc813,0xcc))['catch'](handleError(_0x3cc813,null));};exports[_0xcd33('0x50')]=function(_0x2b214c,_0x5615ec,_0xbe8b97){return db['AnalyticCustomReport']['findOne']({'where':{'id':_0x2b214c[_0xcd33('0x48')]['id']}})[_0xcd33('0x23')](handleEntityNotFound(_0x5615ec,null))[_0xcd33('0x23')](function(_0x43cdb7){if(_0x43cdb7){return db[_0xcd33('0x51')]['transaction'](function(_0x3bfff7){return db['AnalyticFieldReport'][_0xcd33('0x24')]({'where':{'CustomReportId':_0x2b214c['params']['id']},'transaction':_0x3bfff7})[_0xcd33('0x23')](function(_0x28fb95){var _0x432055=_['map'](_0x2b214c[_0xcd33('0x4c')],function(_0x58a9e8){delete _0x58a9e8['id'];_0x58a9e8[_0xcd33('0x52')]=_0x2b214c[_0xcd33('0x48')]['id'];return _0x58a9e8;});return db[_0xcd33('0x2c')][_0xcd33('0x4d')](_0x432055,{'transaction':_0x3bfff7});});})[_0xcd33('0x23')](function(){return db['AnalyticFieldReport'][_0xcd33('0x45')]({'where':{'CustomReportId':_0x2b214c[_0xcd33('0x48')]['id']}});});}})['then'](respondWithResult(_0x5615ec,null))['catch'](handleError(_0x5615ec,null));};
\ No newline at end of file
+var _0xb642=['fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','AnalyticFieldReport','rows','catch','params','keys','options','find','create','body','bulkCreate','bulkDestroy','ids','addFields','findOne','sequelize','transaction','findAll','rimraf','zip-dir','request-promise','moment','bluebird','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0xb642,0x15d));var _0x2b64=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xb642[_0x4154a6];return _0x3b2786;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2b64('0x0'));var zipdir=require(_0x2b64('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2b64('0x2'));var moment=require(_0x2b64('0x3'));var BPromise=require(_0x2b64('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2b64('0x5'));var sox=require('sox');var csv=require(_0x2b64('0x6'));var ejs=require(_0x2b64('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2b64('0x8'));var squel=require(_0x2b64('0x9'));var crypto=require(_0x2b64('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x2b64('0xb'));var toCsv=require(_0x2b64('0x6'));var querystring=require(_0x2b64('0xc'));var Papa=require('papaparse');var Redis=require(_0x2b64('0xd'));var authService=require(_0x2b64('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2b64('0xf'));var logger=require(_0x2b64('0x10'))(_0x2b64('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2b64('0x12'));var db=require(_0x2b64('0x13'))['db'];function respondWithStatusCode(_0x1c8a6d,_0x1f1bfd){_0x1f1bfd=_0x1f1bfd||0xcc;return function(_0x135a8b){if(_0x135a8b){return _0x1c8a6d[_0x2b64('0x14')](_0x1f1bfd);}return _0x1c8a6d[_0x2b64('0x15')](_0x1f1bfd)[_0x2b64('0x16')]();};}function respondWithResult(_0x4a6d40,_0x3cd9c3){_0x3cd9c3=_0x3cd9c3||0xc8;return function(_0x49e0cc){if(_0x49e0cc){return _0x4a6d40[_0x2b64('0x15')](_0x3cd9c3)['json'](_0x49e0cc);}};}function respondWithFilteredResult(_0x6897a9,_0x762c03){return function(_0x272ad6){if(_0x272ad6){var _0x3e1675=typeof _0x762c03[_0x2b64('0x17')]===_0x2b64('0x18')&&typeof _0x762c03[_0x2b64('0x19')]==='undefined';var _0x49f71e=_0x272ad6['count'];var _0x356a18=_0x3e1675?0x0:_0x762c03[_0x2b64('0x17')];var _0x26a6ef=_0x3e1675?_0x272ad6[_0x2b64('0x1a')]:_0x762c03[_0x2b64('0x17')]+_0x762c03['limit'];var _0x3c6c62;if(_0x26a6ef>=_0x49f71e){_0x26a6ef=_0x49f71e;_0x3c6c62=0xc8;}else{_0x3c6c62=0xce;}_0x6897a9['status'](_0x3c6c62);return _0x6897a9[_0x2b64('0x1b')](_0x2b64('0x1c'),_0x356a18+'-'+_0x26a6ef+'/'+_0x49f71e)[_0x2b64('0x1d')](_0x272ad6);}return null;};}function patchUpdates(_0x35e8d2){return function(_0xa3c626){try{jsonpatch['apply'](_0xa3c626,_0x35e8d2,!![]);}catch(_0x322c96){return BPromise[_0x2b64('0x1e')](_0x322c96);}return _0xa3c626['save']();};}function saveUpdates(_0x37ccfa,_0x5871bc){return function(_0x14416f){if(_0x14416f){return _0x14416f[_0x2b64('0x1f')](_0x37ccfa)[_0x2b64('0x20')](function(_0xb664ce){return _0xb664ce;});}return null;};}function removeEntity(_0x4210e2,_0x39c08b){return function(_0x4be1f1){if(_0x4be1f1){return _0x4be1f1[_0x2b64('0x21')]()[_0x2b64('0x20')](function(){_0x4210e2[_0x2b64('0x15')](0xcc)[_0x2b64('0x16')]();});}};}function handleEntityNotFound(_0x30a93e,_0x4f4ec9){return function(_0xd94601){if(!_0xd94601){_0x30a93e[_0x2b64('0x14')](0x194);}return _0xd94601;};}function handleError(_0x149e97,_0xc2f3ed){_0xc2f3ed=_0xc2f3ed||0x1f4;return function(_0x2b5c19){logger[_0x2b64('0x22')](_0x2b5c19[_0x2b64('0x23')]);if(_0x2b5c19[_0x2b64('0x24')]){delete _0x2b5c19[_0x2b64('0x24')];}_0x149e97[_0x2b64('0x15')](_0xc2f3ed)[_0x2b64('0x25')](_0x2b5c19);};}exports[_0x2b64('0x26')]=function(_0x4a5188,_0x224763){var _0x3cf5fc={},_0x1ab1d2={},_0x463a0d={'count':0x0,'rows':[]};var _0x55fd7a=_[_0x2b64('0x27')](db['AnalyticFieldReport'][_0x2b64('0x28')],function(_0x234312){return{'name':_0x234312[_0x2b64('0x29')],'type':_0x234312[_0x2b64('0x2a')][_0x2b64('0x2b')]};});_0x1ab1d2['model']=_[_0x2b64('0x27')](_0x55fd7a,_0x2b64('0x24'));_0x1ab1d2[_0x2b64('0x2c')]=_['keys'](_0x4a5188['query']);_0x1ab1d2[_0x2b64('0x2d')]=_[_0x2b64('0x2e')](_0x1ab1d2[_0x2b64('0x2f')],_0x1ab1d2[_0x2b64('0x2c')]);_0x3cf5fc[_0x2b64('0x30')]=_['intersection'](_0x1ab1d2['model'],qs[_0x2b64('0x31')](_0x4a5188[_0x2b64('0x2c')][_0x2b64('0x31')]));_0x3cf5fc[_0x2b64('0x30')]=_0x3cf5fc[_0x2b64('0x30')][_0x2b64('0x32')]?_0x3cf5fc[_0x2b64('0x30')]:_0x1ab1d2[_0x2b64('0x2f')];if(!_0x4a5188[_0x2b64('0x2c')][_0x2b64('0x33')](_0x2b64('0x34'))){_0x3cf5fc['limit']=qs[_0x2b64('0x19')](_0x4a5188[_0x2b64('0x2c')][_0x2b64('0x19')]);_0x3cf5fc['offset']=qs['offset'](_0x4a5188[_0x2b64('0x2c')][_0x2b64('0x17')]);}_0x3cf5fc['order']=qs[_0x2b64('0x35')](_0x4a5188[_0x2b64('0x2c')][_0x2b64('0x35')]);_0x3cf5fc[_0x2b64('0x36')]=qs[_0x2b64('0x2d')](_[_0x2b64('0x37')](_0x4a5188['query'],_0x1ab1d2[_0x2b64('0x2d')]),_0x55fd7a);if(_0x4a5188[_0x2b64('0x2c')][_0x2b64('0x38')]){_0x3cf5fc['where']=_[_0x2b64('0x39')](_0x3cf5fc['where'],{'$or':_[_0x2b64('0x27')](_0x55fd7a,function(_0x15e999){if(_0x15e999[_0x2b64('0x2a')]!==_0x2b64('0x3a')){var _0x4f21d0={};_0x4f21d0[_0x15e999[_0x2b64('0x24')]]={'$like':'%'+_0x4a5188[_0x2b64('0x2c')][_0x2b64('0x38')]+'%'};return _0x4f21d0;}})});}_0x3cf5fc=_[_0x2b64('0x39')]({},_0x3cf5fc,_0x4a5188['options']);var _0x17603e={'where':_0x3cf5fc[_0x2b64('0x36')]};return db['AnalyticFieldReport']['count'](_0x17603e)['then'](function(_0x5aa7fb){_0x463a0d[_0x2b64('0x1a')]=_0x5aa7fb;if(_0x4a5188[_0x2b64('0x2c')][_0x2b64('0x3b')]){_0x3cf5fc[_0x2b64('0x3c')]=[{'all':!![]}];}return db[_0x2b64('0x3d')]['findAll'](_0x3cf5fc);})['then'](function(_0x340e1a){_0x463a0d[_0x2b64('0x3e')]=_0x340e1a;return _0x463a0d;})[_0x2b64('0x20')](respondWithFilteredResult(_0x224763,_0x3cf5fc))[_0x2b64('0x3f')](handleError(_0x224763,null));};exports['show']=function(_0x1da8bc,_0x5db4af){var _0x42bd9d={'raw':![],'where':{'id':_0x1da8bc[_0x2b64('0x40')]['id']}},_0x3dd6d0={};_0x3dd6d0['model']=_[_0x2b64('0x41')](db[_0x2b64('0x3d')][_0x2b64('0x28')]);_0x3dd6d0[_0x2b64('0x2c')]=_[_0x2b64('0x41')](_0x1da8bc['query']);_0x3dd6d0[_0x2b64('0x2d')]=_[_0x2b64('0x2e')](_0x3dd6d0[_0x2b64('0x2f')],_0x3dd6d0[_0x2b64('0x2c')]);_0x42bd9d[_0x2b64('0x30')]=_[_0x2b64('0x2e')](_0x3dd6d0['model'],qs[_0x2b64('0x31')](_0x1da8bc[_0x2b64('0x2c')][_0x2b64('0x31')]));_0x42bd9d[_0x2b64('0x30')]=_0x42bd9d[_0x2b64('0x30')][_0x2b64('0x32')]?_0x42bd9d[_0x2b64('0x30')]:_0x3dd6d0[_0x2b64('0x2f')];if(_0x1da8bc[_0x2b64('0x2c')][_0x2b64('0x3b')]){_0x42bd9d[_0x2b64('0x3c')]=[{'all':!![]}];}_0x42bd9d=_[_0x2b64('0x39')]({},_0x42bd9d,_0x1da8bc[_0x2b64('0x42')]);return db['AnalyticFieldReport'][_0x2b64('0x43')](_0x42bd9d)['then'](handleEntityNotFound(_0x5db4af,null))[_0x2b64('0x20')](respondWithResult(_0x5db4af,null))[_0x2b64('0x3f')](handleError(_0x5db4af,null));};exports['create']=function(_0xf652e5,_0x192fe4){return db[_0x2b64('0x3d')][_0x2b64('0x44')](_0xf652e5[_0x2b64('0x45')],{})['then'](respondWithResult(_0x192fe4,0xc9))[_0x2b64('0x3f')](handleError(_0x192fe4,null));};exports[_0x2b64('0x46')]=function(_0x49fda3,_0x45960b){return db['AnalyticFieldReport']['bulkCreate'](_0x49fda3[_0x2b64('0x45')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x45960b,0xc9))[_0x2b64('0x3f')](handleError(_0x45960b,null));};exports[_0x2b64('0x1f')]=function(_0x537c60,_0x5a35f5){if(_0x537c60['body']['id']){delete _0x537c60[_0x2b64('0x45')]['id'];}return db[_0x2b64('0x3d')][_0x2b64('0x43')]({'where':{'id':_0x537c60['params']['id']}})[_0x2b64('0x20')](handleEntityNotFound(_0x5a35f5,null))[_0x2b64('0x20')](saveUpdates(_0x537c60[_0x2b64('0x45')],null))['then'](respondWithResult(_0x5a35f5,null))[_0x2b64('0x3f')](handleError(_0x5a35f5,null));};exports['destroy']=function(_0xcdfcd2,_0x58a529){return db[_0x2b64('0x3d')]['find']({'where':{'id':_0xcdfcd2[_0x2b64('0x40')]['id']}})['then'](handleEntityNotFound(_0x58a529,null))[_0x2b64('0x20')](removeEntity(_0x58a529,null))[_0x2b64('0x3f')](handleError(_0x58a529,null));};exports[_0x2b64('0x47')]=function(_0x285694,_0x10d0c7){return db[_0x2b64('0x3d')][_0x2b64('0x21')]({'where':{'id':_0x285694[_0x2b64('0x2c')][_0x2b64('0x48')]||[]},'raw':![],'individualHooks':!![]})[_0x2b64('0x20')](respondWithResult(_0x10d0c7,0xcc))['catch'](handleError(_0x10d0c7,null));};exports[_0x2b64('0x49')]=function(_0x224eea,_0x48c224,_0x40cb1e){return db['AnalyticCustomReport'][_0x2b64('0x4a')]({'where':{'id':_0x224eea[_0x2b64('0x40')]['id']}})[_0x2b64('0x20')](handleEntityNotFound(_0x48c224,null))[_0x2b64('0x20')](function(_0x75f2dd){if(_0x75f2dd){return db[_0x2b64('0x4b')][_0x2b64('0x4c')](function(_0x50300b){return db['AnalyticFieldReport'][_0x2b64('0x21')]({'where':{'CustomReportId':_0x224eea[_0x2b64('0x40')]['id']},'transaction':_0x50300b})['then'](function(_0x2b7ced){var _0x1348d7=_[_0x2b64('0x27')](_0x224eea[_0x2b64('0x45')],function(_0x3a0656){delete _0x3a0656['id'];_0x3a0656['CustomReportId']=_0x224eea['params']['id'];return _0x3a0656;});return db[_0x2b64('0x3d')]['bulkCreate'](_0x1348d7,{'transaction':_0x50300b});});})['then'](function(){return db[_0x2b64('0x3d')][_0x2b64('0x4d')]({'where':{'CustomReportId':_0x224eea['params']['id']}});});}})['then'](respondWithResult(_0x48c224,null))[_0x2b64('0x3f')](handleError(_0x48c224,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 9a7a267..9f7494b 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 _0x6222=['bluebird','request-promise','path','rimraf','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','moment'];(function(_0x2638ea,_0x371b8b){var _0x340f66=function(_0x5f0e31){while(--_0x5f0e31){_0x2638ea['push'](_0x2638ea['shift']());}};_0x340f66(++_0x371b8b);}(_0x6222,0x1bb));var _0x2622=function(_0x124a46,_0x3fde31){_0x124a46=_0x124a46-0x0;var _0x194ec7=_0x6222[_0x124a46];return _0x194ec7;};'use strict';var _=require(_0x2622('0x0'));var util=require(_0x2622('0x1'));var logger=require(_0x2622('0x2'))(_0x2622('0x3'));var moment=require(_0x2622('0x4'));var BPromise=require(_0x2622('0x5'));var rp=require(_0x2622('0x6'));var fs=require('fs');var path=require(_0x2622('0x7'));var rimraf=require(_0x2622('0x8'));var config=require('../../config/environment');var attributes=require(_0x2622('0x9'));module[_0x2622('0xa')]=function(_0x162b52,_0x5ab5b6){return _0x162b52[_0x2622('0xb')](_0x2622('0xc'),attributes,{'tableName':_0x2622('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xea85=['./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','util','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x58b095,_0x13df00){var _0x3cb122=function(_0x20124e){while(--_0x20124e){_0x58b095['push'](_0x58b095['shift']());}};_0x3cb122(++_0x13df00);}(_0xea85,0xec));var _0x5ea8=function(_0xeae901,_0x33afa0){_0xeae901=_0xeae901-0x0;var _0x491531=_0xea85[_0xeae901];return _0x491531;};'use strict';var _=require('lodash');var util=require(_0x5ea8('0x0'));var logger=require('../../config/logger')(_0x5ea8('0x1'));var moment=require('moment');var BPromise=require(_0x5ea8('0x2'));var rp=require(_0x5ea8('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5ea8('0x4'));var config=require(_0x5ea8('0x5'));var attributes=require(_0x5ea8('0x6'));module[_0x5ea8('0x7')]=function(_0x171603,_0x5aa784){return _0x171603[_0x5ea8('0x8')](_0x5ea8('0x9'),attributes,{'tableName':_0x5ea8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index 4216271..7d79d3d 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 _0x6761=['result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x15b399,_0x59db1a){var _0x199f2d=function(_0x3bd31c){while(--_0x3bd31c){_0x15b399['push'](_0x15b399['shift']());}};_0x199f2d(++_0x59db1a);}(_0x6761,0xde));var _0x1676=function(_0x320a35,_0x8205bf){_0x320a35=_0x320a35-0x0;var _0x65836=_0x6761[_0x320a35];return _0x65836;};'use strict';var _=require(_0x1676('0x0'));var util=require(_0x1676('0x1'));var moment=require(_0x1676('0x2'));var BPromise=require('bluebird');var rs=require(_0x1676('0x3'));var fs=require('fs');var Redis=require(_0x1676('0x4'));var db=require(_0x1676('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1676('0x6'));var config=require('../../config/environment');var jayson=require(_0x1676('0x7'));var client=jayson[_0x1676('0x8')][_0x1676('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x24b351,_0x279ecc,_0x46c386){return new BPromise(function(_0x5a4c9d,_0x25de52){return client[_0x1676('0xa')](_0x24b351,_0x46c386)[_0x1676('0xb')](function(_0xba3319){logger[_0x1676('0xc')](_0x1676('0xd'),_0x279ecc,'request\x20sent');logger['debug'](_0x1676('0xe'),_0x279ecc,_0x1676('0xf'),JSON[_0x1676('0x10')](_0xba3319));if(_0xba3319[_0x1676('0x11')]){if(_0xba3319[_0x1676('0x11')][_0x1676('0x12')]===0x1f4){logger[_0x1676('0x11')](_0x1676('0xd'),_0x279ecc,_0xba3319[_0x1676('0x11')][_0x1676('0x13')]);return _0x25de52(_0xba3319['error'][_0x1676('0x13')]);}logger['error'](_0x1676('0xd'),_0x279ecc,_0xba3319['error'][_0x1676('0x13')]);return _0x5a4c9d(_0xba3319[_0x1676('0x11')]['message']);}else{logger[_0x1676('0xc')](_0x1676('0xd'),_0x279ecc,_0x1676('0xf'));_0x5a4c9d(_0xba3319[_0x1676('0x14')][_0x1676('0x13')]);}})[_0x1676('0x15')](function(_0x328ebc){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x279ecc,_0x328ebc);_0x25de52(_0x328ebc);});});}
\ No newline at end of file
+var _0xffa8=['AnalyticFieldReport,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','catch','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x7729b1,_0x468322){var _0x349504=function(_0x401cee){while(--_0x401cee){_0x7729b1['push'](_0x7729b1['shift']());}};_0x349504(++_0x468322);}(_0xffa8,0x170));var _0x8ffa=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xffa8[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require(_0x8ffa('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8ffa('0x1'));var fs=require('fs');var Redis=require(_0x8ffa('0x2'));var db=require(_0x8ffa('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x8ffa('0x4'))(_0x8ffa('0x5'));var config=require(_0x8ffa('0x6'));var jayson=require(_0x8ffa('0x7'));var client=jayson[_0x8ffa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e5e72,_0x362fe0,_0x131e40){return new BPromise(function(_0x3fd5d2,_0x536a63){return client[_0x8ffa('0x9')](_0x1e5e72,_0x131e40)[_0x8ffa('0xa')](function(_0x364ac6){logger[_0x8ffa('0xb')](_0x8ffa('0xc'),_0x362fe0,'request\x20sent');logger[_0x8ffa('0xd')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x362fe0,_0x8ffa('0xe'),JSON[_0x8ffa('0xf')](_0x364ac6));if(_0x364ac6['error']){if(_0x364ac6['error'][_0x8ffa('0x10')]===0x1f4){logger[_0x8ffa('0x11')](_0x8ffa('0xc'),_0x362fe0,_0x364ac6[_0x8ffa('0x11')][_0x8ffa('0x12')]);return _0x536a63(_0x364ac6[_0x8ffa('0x11')][_0x8ffa('0x12')]);}logger[_0x8ffa('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x362fe0,_0x364ac6['error'][_0x8ffa('0x12')]);return _0x3fd5d2(_0x364ac6[_0x8ffa('0x11')][_0x8ffa('0x12')]);}else{logger[_0x8ffa('0xb')](_0x8ffa('0xc'),_0x362fe0,_0x8ffa('0xe'));_0x3fd5d2(_0x364ac6['result'][_0x8ffa('0x12')]);}})[_0x8ffa('0x13')](function(_0x39f164){logger[_0x8ffa('0x11')](_0x8ffa('0xc'),_0x362fe0,_0x39f164);_0x536a63(_0x39f164);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 804b7c6..32066f7 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(_0x5b4f63,_0x5b09ef){var _0x42f7cb=function(_0x4b52e6){while(--_0x4b52e6){_0x5b4f63['push'](_0x5b4f63['shift']());}};_0x42f7cb(++_0x5b09ef);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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(_0xc153db,_0x516c10){var _0x4dc97d=function(_0x10fc05){while(--_0x10fc05){_0xc153db['push'](_0xc153db['shift']());}};_0x4dc97d(++_0x516c10);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'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 0ccc942..9725838 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 _0xc9c3=['name','exports','STRING'];(function(_0x39aeca,_0x214a96){var _0x13856e=function(_0x1e243a){while(--_0x1e243a){_0x39aeca['push'](_0x39aeca['shift']());}};_0x13856e(++_0x214a96);}(_0xc9c3,0xd0));var _0x3c9c=function(_0x4490b8,_0xf6dbd3){_0x4490b8=_0x4490b8-0x0;var _0x326831=_0xc9c3[_0x4490b8];return _0x326831;};'use strict';var Sequelize=require('sequelize');module[_0x3c9c('0x0')]={'name':{'type':Sequelize[_0x3c9c('0x1')],'allowNull':![],'unique':_0x3c9c('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x3c9c('0x1')]}};
\ No newline at end of file
+var _0x7c59=['exports','STRING','name'];(function(_0x54214c,_0x278464){var _0x4b9671=function(_0x17b6d8){while(--_0x17b6d8){_0x54214c['push'](_0x54214c['shift']());}};_0x4b9671(++_0x278464);}(_0x7c59,0x147));var _0x97c5=function(_0x21b613,_0x18972f){_0x21b613=_0x21b613-0x0;var _0x266727=_0x7c59[_0x21b613];return _0x266727;};'use strict';var Sequelize=require('sequelize');module[_0x97c5('0x0')]={'name':{'type':Sequelize[_0x97c5('0x1')],'allowNull':![],'unique':_0x97c5('0x2')},'table':{'type':Sequelize[_0x97c5('0x1')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x97c5('0x1')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 9f98c3a..6f2650e 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 _0xdc97=['mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','get','destroy','sendStatus','error','stack','name','send','AnalyticMetric','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','findAll','rows','catch','params','keys','fields','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Metrics','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','rimraf','zip-dir','request-promise','bluebird'];(function(_0x556bf7,_0xa7429b){var _0x97b6c5=function(_0x794986){while(--_0x794986){_0x556bf7['push'](_0x556bf7['shift']());}};_0x97b6c5(++_0xa7429b);}(_0xdc97,0x13b));var _0x7dc9=function(_0x5bf8d1,_0x5ad31e){_0x5bf8d1=_0x5bf8d1-0x0;var _0x8d51b3=_0xdc97[_0x5bf8d1];return _0x8d51b3;};'use strict';var emlformat=require(_0x7dc9('0x0'));var rimraf=require(_0x7dc9('0x1'));var zipdir=require(_0x7dc9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7dc9('0x3'));var moment=require('moment');var BPromise=require(_0x7dc9('0x4'));var Mustache=require(_0x7dc9('0x5'));var util=require('util');var path=require(_0x7dc9('0x6'));var sox=require(_0x7dc9('0x7'));var csv=require(_0x7dc9('0x8'));var ejs=require(_0x7dc9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7dc9('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7dc9('0xb'));var deskjs=require(_0x7dc9('0xc'));var toCsv=require(_0x7dc9('0x8'));var querystring=require(_0x7dc9('0xd'));var Papa=require(_0x7dc9('0xe'));var Redis=require('ioredis');var authService=require(_0x7dc9('0xf'));var qs=require(_0x7dc9('0x10'));var as=require(_0x7dc9('0x11'));var hardwareService=require(_0x7dc9('0x12'));var logger=require(_0x7dc9('0x13'))(_0x7dc9('0x14'));var utils=require(_0x7dc9('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x599ef1,_0x94c75a){_0x94c75a=_0x94c75a||0xcc;return function(_0x14e5db){if(_0x14e5db){return _0x599ef1['sendStatus'](_0x94c75a);}return _0x599ef1[_0x7dc9('0x16')](_0x94c75a)[_0x7dc9('0x17')]();};}function respondWithResult(_0xaadf2,_0xf37bc7){_0xf37bc7=_0xf37bc7||0xc8;return function(_0x31d43d){if(_0x31d43d){return _0xaadf2[_0x7dc9('0x16')](_0xf37bc7)['json'](_0x31d43d);}};}function respondWithFilteredResult(_0x3a54f2,_0x278191){return function(_0x1b0aa1){if(_0x1b0aa1){var _0x442819=typeof _0x278191[_0x7dc9('0x18')]===_0x7dc9('0x19')&&typeof _0x278191[_0x7dc9('0x1a')]===_0x7dc9('0x19');var _0x4778d5=_0x1b0aa1['count'];var _0x22577e=_0x442819?0x0:_0x278191['offset'];var _0x1f5906=_0x442819?_0x1b0aa1[_0x7dc9('0x1b')]:_0x278191['offset']+_0x278191[_0x7dc9('0x1a')];var _0x3b738a;if(_0x1f5906>=_0x4778d5){_0x1f5906=_0x4778d5;_0x3b738a=0xc8;}else{_0x3b738a=0xce;}_0x3a54f2[_0x7dc9('0x16')](_0x3b738a);return _0x3a54f2[_0x7dc9('0x1c')](_0x7dc9('0x1d'),_0x22577e+'-'+_0x1f5906+'/'+_0x4778d5)[_0x7dc9('0x1e')](_0x1b0aa1);}return null;};}function patchUpdates(_0x2dad65){return function(_0x2895f5){try{jsonpatch[_0x7dc9('0x1f')](_0x2895f5,_0x2dad65,!![]);}catch(_0x2b38d6){return BPromise['reject'](_0x2b38d6);}return _0x2895f5['save']();};}function saveUpdates(_0x12954f,_0x5981e2){return function(_0x596e0f){if(_0x596e0f){return _0x596e0f[_0x7dc9('0x20')](_0x12954f)[_0x7dc9('0x21')](function(_0x5e9525){return _0x5e9525;});}return null;};}function removeEntity(_0xffc080,_0x43d31f){return function(_0x41110a){if(_0x41110a){return _0x41110a['destroy']()[_0x7dc9('0x21')](function(){var _0x1e3a8d=_0x41110a[_0x7dc9('0x22')]({'plain':!![]});var _0x55a482='Metrics';return db['UserProfileResource'][_0x7dc9('0x23')]({'where':{'type':_0x55a482,'resourceId':_0x1e3a8d['id']}})[_0x7dc9('0x21')](function(){return _0x41110a;});})['then'](function(){_0xffc080['status'](0xcc)[_0x7dc9('0x17')]();});}};}function handleEntityNotFound(_0x5afb7d,_0x2d22eb){return function(_0x1c690b){if(!_0x1c690b){_0x5afb7d[_0x7dc9('0x24')](0x194);}return _0x1c690b;};}function handleError(_0x3e4102,_0xa2aaa9){_0xa2aaa9=_0xa2aaa9||0x1f4;return function(_0x450124){logger[_0x7dc9('0x25')](_0x450124[_0x7dc9('0x26')]);if(_0x450124[_0x7dc9('0x27')]){delete _0x450124[_0x7dc9('0x27')];}_0x3e4102[_0x7dc9('0x16')](_0xa2aaa9)[_0x7dc9('0x28')](_0x450124);};}exports['index']=function(_0x4e929c,_0x513dd6){var _0x49a4a5={},_0x4a68f0={},_0x553a03={'count':0x0,'rows':[]};var _0x58c4e8=_['map'](db[_0x7dc9('0x29')][_0x7dc9('0x2a')],function(_0x29dcef){return{'name':_0x29dcef[_0x7dc9('0x2b')],'type':_0x29dcef[_0x7dc9('0x2c')][_0x7dc9('0x2d')]};});_0x4a68f0['model']=_['map'](_0x58c4e8,'name');_0x4a68f0[_0x7dc9('0x2e')]=_['keys'](_0x4e929c[_0x7dc9('0x2e')]);_0x4a68f0[_0x7dc9('0x2f')]=_[_0x7dc9('0x30')](_0x4a68f0[_0x7dc9('0x31')],_0x4a68f0[_0x7dc9('0x2e')]);_0x49a4a5[_0x7dc9('0x32')]=_[_0x7dc9('0x30')](_0x4a68f0[_0x7dc9('0x31')],qs['fields'](_0x4e929c[_0x7dc9('0x2e')]['fields']));_0x49a4a5[_0x7dc9('0x32')]=_0x49a4a5[_0x7dc9('0x32')][_0x7dc9('0x33')]?_0x49a4a5[_0x7dc9('0x32')]:_0x4a68f0['model'];if(!_0x4e929c[_0x7dc9('0x2e')]['hasOwnProperty'](_0x7dc9('0x34'))){_0x49a4a5['limit']=qs['limit'](_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x1a')]);_0x49a4a5[_0x7dc9('0x18')]=qs[_0x7dc9('0x18')](_0x4e929c['query'][_0x7dc9('0x18')]);}_0x49a4a5[_0x7dc9('0x35')]=qs[_0x7dc9('0x36')](_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x36')]);_0x49a4a5[_0x7dc9('0x37')]=qs[_0x7dc9('0x2f')](_[_0x7dc9('0x38')](_0x4e929c[_0x7dc9('0x2e')],_0x4a68f0[_0x7dc9('0x2f')]),_0x58c4e8);if(_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x39')]){_0x49a4a5['where']=_[_0x7dc9('0x3a')](_0x49a4a5[_0x7dc9('0x37')],{'$or':_[_0x7dc9('0x3b')](_0x58c4e8,function(_0xfd2612){if(_0xfd2612['type']!==_0x7dc9('0x3c')){var _0x89db0e={};_0x89db0e[_0xfd2612[_0x7dc9('0x27')]]={'$like':'%'+_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x39')]+'%'};return _0x89db0e;}})});}_0x49a4a5=_[_0x7dc9('0x3a')]({},_0x49a4a5,_0x4e929c['options']);var _0x553230={'where':_0x49a4a5[_0x7dc9('0x37')]};return db[_0x7dc9('0x29')]['count'](_0x553230)[_0x7dc9('0x21')](function(_0x4a37ec){_0x553a03[_0x7dc9('0x1b')]=_0x4a37ec;if(_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x3d')]){_0x49a4a5['include']=[{'all':!![]}];}return db[_0x7dc9('0x29')][_0x7dc9('0x3e')](_0x49a4a5);})[_0x7dc9('0x21')](function(_0x95513c){_0x553a03[_0x7dc9('0x3f')]=_0x95513c;return _0x553a03;})[_0x7dc9('0x21')](respondWithFilteredResult(_0x513dd6,_0x49a4a5))[_0x7dc9('0x40')](handleError(_0x513dd6,null));};exports['show']=function(_0x187aa6,_0x4f29b2){var _0x52d883={'raw':!![],'where':{'id':_0x187aa6[_0x7dc9('0x41')]['id']}},_0xcced6c={};_0xcced6c[_0x7dc9('0x31')]=_[_0x7dc9('0x42')](db[_0x7dc9('0x29')][_0x7dc9('0x2a')]);_0xcced6c[_0x7dc9('0x2e')]=_[_0x7dc9('0x42')](_0x187aa6[_0x7dc9('0x2e')]);_0xcced6c['filters']=_[_0x7dc9('0x30')](_0xcced6c[_0x7dc9('0x31')],_0xcced6c[_0x7dc9('0x2e')]);_0x52d883[_0x7dc9('0x32')]=_[_0x7dc9('0x30')](_0xcced6c[_0x7dc9('0x31')],qs['fields'](_0x187aa6[_0x7dc9('0x2e')][_0x7dc9('0x43')]));_0x52d883['attributes']=_0x52d883[_0x7dc9('0x32')][_0x7dc9('0x33')]?_0x52d883[_0x7dc9('0x32')]:_0xcced6c['model'];if(_0x187aa6[_0x7dc9('0x2e')]['includeAll']){_0x52d883['include']=[{'all':!![]}];}_0x52d883=_[_0x7dc9('0x3a')]({},_0x52d883,_0x187aa6[_0x7dc9('0x44')]);return db[_0x7dc9('0x29')]['find'](_0x52d883)['then'](handleEntityNotFound(_0x4f29b2,null))[_0x7dc9('0x21')](respondWithResult(_0x4f29b2,null))['catch'](handleError(_0x4f29b2,null));};exports[_0x7dc9('0x45')]=function(_0x4ab558,_0x5e2d59){return db[_0x7dc9('0x29')][_0x7dc9('0x45')](_0x4ab558[_0x7dc9('0x46')],{})[_0x7dc9('0x21')](function(_0x414bf4){var _0x113087=_0x4ab558[_0x7dc9('0x47')][_0x7dc9('0x22')]({'plain':!![]});if(!_0x113087)throw new Error(_0x7dc9('0x48'));if(_0x113087[_0x7dc9('0x49')]===_0x7dc9('0x47')){var _0x13580b=_0x414bf4[_0x7dc9('0x22')]({'plain':!![]});var _0x59be9b=_0x7dc9('0x4a');return db['UserProfileSection']['find']({'where':{'name':_0x59be9b,'userProfileId':_0x113087[_0x7dc9('0x4b')]},'raw':!![]})[_0x7dc9('0x21')](function(_0x40e382){if(_0x40e382&&_0x40e382[_0x7dc9('0x4c')]===0x0){return db[_0x7dc9('0x4d')]['create']({'name':_0x13580b[_0x7dc9('0x27')],'resourceId':_0x13580b['id'],'type':_0x40e382[_0x7dc9('0x27')],'sectionId':_0x40e382['id']},{})[_0x7dc9('0x21')](function(){return _0x414bf4;});}else{return _0x414bf4;}})['catch'](function(_0x341909){logger[_0x7dc9('0x25')](_0x7dc9('0x4e'),_0x341909);throw _0x341909;});}return _0x414bf4;})[_0x7dc9('0x21')](respondWithResult(_0x5e2d59,0xc9))[_0x7dc9('0x40')](handleError(_0x5e2d59,null));};exports[_0x7dc9('0x20')]=function(_0x593132,_0x366b8b){if(_0x593132[_0x7dc9('0x46')]['id']){delete _0x593132[_0x7dc9('0x46')]['id'];}return db[_0x7dc9('0x29')][_0x7dc9('0x4f')]({'where':{'id':_0x593132[_0x7dc9('0x41')]['id']}})[_0x7dc9('0x21')](handleEntityNotFound(_0x366b8b,null))[_0x7dc9('0x21')](saveUpdates(_0x593132[_0x7dc9('0x46')],null))[_0x7dc9('0x21')](respondWithResult(_0x366b8b,null))[_0x7dc9('0x40')](handleError(_0x366b8b,null));};exports[_0x7dc9('0x23')]=function(_0x4fec6e,_0x1767b6){return db[_0x7dc9('0x29')][_0x7dc9('0x4f')]({'where':{'id':_0x4fec6e[_0x7dc9('0x41')]['id']}})[_0x7dc9('0x21')](handleEntityNotFound(_0x1767b6,null))['then'](removeEntity(_0x1767b6,null))[_0x7dc9('0x40')](handleError(_0x1767b6,null));};
\ No newline at end of file
+var _0x008c=['path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then','destroy','get','stack','name','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x6dd3c1,_0x53cf52){var _0xdef05a=function(_0x26a262){while(--_0x26a262){_0x6dd3c1['push'](_0x6dd3c1['shift']());}};_0xdef05a(++_0x53cf52);}(_0x008c,0x188));var _0xc008=function(_0xf5b712,_0x5487bf){_0xf5b712=_0xf5b712-0x0;var _0x410413=_0x008c[_0xf5b712];return _0x410413;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){var _0x2e3cfb=_0x58a6ea[_0xc008('0x23')]({'plain':!![]});var _0x5410f5='Metrics';return db['UserProfileResource'][_0xc008('0x22')]({'where':{'type':_0x5410f5,'resourceId':_0x2e3cfb['id']}})[_0xc008('0x21')](function(){return _0x58a6ea;});})[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e2aca,_0x4fce9c){return function(_0x4adbab){if(!_0x4adbab){_0x5e2aca['sendStatus'](0x194);}return _0x4adbab;};}function handleError(_0x3865c0,_0x29ba43){_0x29ba43=_0x29ba43||0x1f4;return function(_0x25eae4){logger['error'](_0x25eae4[_0xc008('0x24')]);if(_0x25eae4[_0xc008('0x25')]){delete _0x25eae4[_0xc008('0x25')];}_0x3865c0[_0xc008('0x19')](_0x29ba43)['send'](_0x25eae4);};}exports[_0xc008('0x26')]=function(_0x2e0b4e,_0x53ed35){var _0x58db82={},_0x539766={},_0x1032b2={'count':0x0,'rows':[]};var _0x267abd=_[_0xc008('0x27')](db[_0xc008('0x28')][_0xc008('0x29')],function(_0xceebc3){return{'name':_0xceebc3[_0xc008('0x2a')],'type':_0xceebc3[_0xc008('0x2b')][_0xc008('0x2c')]};});_0x539766[_0xc008('0x2d')]=_[_0xc008('0x27')](_0x267abd,_0xc008('0x25'));_0x539766['query']=_[_0xc008('0x2e')](_0x2e0b4e[_0xc008('0x2f')]);_0x539766['filters']=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],_0x539766[_0xc008('0x2f')]);_0x58db82[_0xc008('0x31')]=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x32')]));_0x58db82['attributes']=_0x58db82[_0xc008('0x31')][_0xc008('0x33')]?_0x58db82[_0xc008('0x31')]:_0x539766[_0xc008('0x2d')];if(!_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x34')](_0xc008('0x35'))){_0x58db82['limit']=qs[_0xc008('0x1d')](_0x2e0b4e[_0xc008('0x2f')]['limit']);_0x58db82[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x2e0b4e['query'][_0xc008('0x1b')]);}_0x58db82[_0xc008('0x36')]=qs[_0xc008('0x37')](_0x2e0b4e['query']['sort']);_0x58db82['where']=qs[_0xc008('0x38')](_['pick'](_0x2e0b4e[_0xc008('0x2f')],_0x539766[_0xc008('0x38')]),_0x267abd);if(_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x39')]){_0x58db82[_0xc008('0x3a')]=_[_0xc008('0x3b')](_0x58db82[_0xc008('0x3a')],{'$or':_[_0xc008('0x27')](_0x267abd,function(_0xffd2b3){if(_0xffd2b3[_0xc008('0x2b')]!==_0xc008('0x3c')){var _0xdfca2e={};_0xdfca2e[_0xffd2b3[_0xc008('0x25')]]={'$like':'%'+_0x2e0b4e[_0xc008('0x2f')]['filter']+'%'};return _0xdfca2e;}})});}_0x58db82=_[_0xc008('0x3b')]({},_0x58db82,_0x2e0b4e[_0xc008('0x3d')]);var _0x30b7df={'where':_0x58db82[_0xc008('0x3a')]};return db['AnalyticMetric'][_0xc008('0x1e')](_0x30b7df)[_0xc008('0x21')](function(_0xc8cb91){_0x1032b2[_0xc008('0x1e')]=_0xc8cb91;if(_0x2e0b4e[_0xc008('0x2f')]['includeAll']){_0x58db82[_0xc008('0x3e')]=[{'all':!![]}];}return db[_0xc008('0x28')][_0xc008('0x3f')](_0x58db82);})[_0xc008('0x21')](function(_0x7279e8){_0x1032b2['rows']=_0x7279e8;return _0x1032b2;})[_0xc008('0x21')](respondWithFilteredResult(_0x53ed35,_0x58db82))[_0xc008('0x40')](handleError(_0x53ed35,null));};exports[_0xc008('0x41')]=function(_0x408192,_0x4b80f3){var _0x26cd05={'raw':!![],'where':{'id':_0x408192[_0xc008('0x42')]['id']}},_0xe37446={};_0xe37446['model']=_[_0xc008('0x2e')](db['AnalyticMetric'][_0xc008('0x29')]);_0xe37446['query']=_[_0xc008('0x2e')](_0x408192[_0xc008('0x2f')]);_0xe37446['filters']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],_0xe37446[_0xc008('0x2f')]);_0x26cd05['attributes']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x408192[_0xc008('0x2f')][_0xc008('0x32')]));_0x26cd05[_0xc008('0x31')]=_0x26cd05['attributes']['length']?_0x26cd05['attributes']:_0xe37446[_0xc008('0x2d')];if(_0x408192[_0xc008('0x2f')][_0xc008('0x43')]){_0x26cd05[_0xc008('0x3e')]=[{'all':!![]}];}_0x26cd05=_[_0xc008('0x3b')]({},_0x26cd05,_0x408192[_0xc008('0x3d')]);return db[_0xc008('0x28')][_0xc008('0x44')](_0x26cd05)['then'](handleEntityNotFound(_0x4b80f3,null))['then'](respondWithResult(_0x4b80f3,null))['catch'](handleError(_0x4b80f3,null));};exports[_0xc008('0x45')]=function(_0x2651cf,_0x158eae){return db['AnalyticMetric'][_0xc008('0x45')](_0x2651cf[_0xc008('0x46')],{})[_0xc008('0x21')](function(_0x1c2c50){var _0x4981b4=_0x2651cf[_0xc008('0x47')][_0xc008('0x23')]({'plain':!![]});if(!_0x4981b4)throw new Error(_0xc008('0x48'));if(_0x4981b4[_0xc008('0x49')]===_0xc008('0x47')){var _0x52c444=_0x1c2c50['get']({'plain':!![]});var _0x223056='Metrics';return db[_0xc008('0x4a')][_0xc008('0x44')]({'where':{'name':_0x223056,'userProfileId':_0x4981b4[_0xc008('0x4b')]},'raw':!![]})['then'](function(_0x144ab2){if(_0x144ab2&&_0x144ab2[_0xc008('0x4c')]===0x0){return db[_0xc008('0x4d')][_0xc008('0x45')]({'name':_0x52c444[_0xc008('0x25')],'resourceId':_0x52c444['id'],'type':_0x144ab2['name'],'sectionId':_0x144ab2['id']},{})[_0xc008('0x21')](function(){return _0x1c2c50;});}else{return _0x1c2c50;}})[_0xc008('0x40')](function(_0x4b4c6d){logger[_0xc008('0x4e')](_0xc008('0x4f'),_0x4b4c6d);throw _0x4b4c6d;});}return _0x1c2c50;})['then'](respondWithResult(_0x158eae,0xc9))['catch'](handleError(_0x158eae,null));};exports[_0xc008('0x20')]=function(_0xd47b74,_0x20947b){if(_0xd47b74[_0xc008('0x46')]['id']){delete _0xd47b74[_0xc008('0x46')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0xd47b74[_0xc008('0x42')]['id']}})['then'](handleEntityNotFound(_0x20947b,null))[_0xc008('0x21')](saveUpdates(_0xd47b74[_0xc008('0x46')],null))[_0xc008('0x21')](respondWithResult(_0x20947b,null))[_0xc008('0x40')](handleError(_0x20947b,null));};exports[_0xc008('0x22')]=function(_0x27a167,_0x49d8b0){return db[_0xc008('0x28')][_0xc008('0x44')]({'where':{'id':_0x27a167[_0xc008('0x42')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x49d8b0,null))[_0xc008('0x21')](removeEntity(_0x49d8b0,null))['catch'](handleError(_0x49d8b0,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 26b8329..dd0154e 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 _0x5581=['AnalyticMetric','analytics_metrics','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./analyticMetric.attributes'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x5581,0x115));var _0x1558=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x5581[_0x1e4360];return _0x31e6b4;};'use strict';var _=require(_0x1558('0x0'));var util=require('util');var logger=require(_0x1558('0x1'))(_0x1558('0x2'));var moment=require(_0x1558('0x3'));var BPromise=require(_0x1558('0x4'));var rp=require(_0x1558('0x5'));var fs=require('fs');var path=require(_0x1558('0x6'));var rimraf=require('rimraf');var config=require(_0x1558('0x7'));var attributes=require(_0x1558('0x8'));module['exports']=function(_0x24c333,_0xcaef09){return _0x24c333['define'](_0x1558('0x9'),attributes,{'tableName':_0x1558('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbd3c=['bluebird','request-promise','../../config/environment','exports','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','moment'];(function(_0x37e343,_0x5dbfea){var _0xf688dc=function(_0x3b4766){while(--_0x3b4766){_0x37e343['push'](_0x37e343['shift']());}};_0xf688dc(++_0x5dbfea);}(_0xbd3c,0xc2));var _0xcbd3=function(_0x230be7,_0x26d232){_0x230be7=_0x230be7-0x0;var _0x10983b=_0xbd3c[_0x230be7];return _0x10983b;};'use strict';var _=require(_0xcbd3('0x0'));var util=require(_0xcbd3('0x1'));var logger=require(_0xcbd3('0x2'))('api');var moment=require(_0xcbd3('0x3'));var BPromise=require(_0xcbd3('0x4'));var rp=require(_0xcbd3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xcbd3('0x6'));var attributes=require('./analyticMetric.attributes');module[_0xcbd3('0x7')]=function(_0x3e5103,_0x5b27a3){return _0x3e5103[_0xcbd3('0x8')](_0xcbd3('0x9'),attributes,{'tableName':_0xcbd3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index 3fe0c9a..35f8a78 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 _0xc482=['bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment'];(function(_0x114d1f,_0x55548e){var _0x5b91d4=function(_0x358415){while(--_0x358415){_0x114d1f['push'](_0x114d1f['shift']());}};_0x5b91d4(++_0x55548e);}(_0xc482,0x165));var _0x2c48=function(_0x407c65,_0x60fc4a){_0x407c65=_0x407c65-0x0;var _0x21890c=_0xc482[_0x407c65];return _0x21890c;};'use strict';var _=require(_0x2c48('0x0'));var util=require(_0x2c48('0x1'));var moment=require(_0x2c48('0x2'));var BPromise=require(_0x2c48('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2c48('0x4'));var logger=require('../../config/logger')(_0x2c48('0x5'));var config=require(_0x2c48('0x6'));var jayson=require(_0x2c48('0x7'));var client=jayson['client'][_0x2c48('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x57644f,_0x4feaf7,_0x530cb7){return new BPromise(function(_0x4d6e99,_0x8a8dc8){return client[_0x2c48('0x9')](_0x57644f,_0x530cb7)[_0x2c48('0xa')](function(_0x5b7ae4){logger[_0x2c48('0xb')](_0x2c48('0xc'),_0x4feaf7,_0x2c48('0xd'));logger['debug'](_0x2c48('0xe'),_0x4feaf7,_0x2c48('0xd'),JSON['stringify'](_0x5b7ae4));if(_0x5b7ae4[_0x2c48('0xf')]){if(_0x5b7ae4['error']['code']===0x1f4){logger[_0x2c48('0xf')](_0x2c48('0xc'),_0x4feaf7,_0x5b7ae4[_0x2c48('0xf')][_0x2c48('0x10')]);return _0x8a8dc8(_0x5b7ae4[_0x2c48('0xf')][_0x2c48('0x10')]);}logger[_0x2c48('0xf')](_0x2c48('0xc'),_0x4feaf7,_0x5b7ae4['error'][_0x2c48('0x10')]);return _0x4d6e99(_0x5b7ae4['error'][_0x2c48('0x10')]);}else{logger[_0x2c48('0xb')](_0x2c48('0xc'),_0x4feaf7,_0x2c48('0xd'));_0x4d6e99(_0x5b7ae4['result'][_0x2c48('0x10')]);}})[_0x2c48('0x11')](function(_0x5cccd6){logger['error'](_0x2c48('0xc'),_0x4feaf7,_0x5cccd6);_0x8a8dc8(_0x5cccd6);});});}
\ No newline at end of file
+var _0x184f=['http','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x17770a,_0xe0364f){var _0x525494=function(_0x51f212){while(--_0x51f212){_0x17770a['push'](_0x17770a['shift']());}};_0x525494(++_0xe0364f);}(_0x184f,0x17c));var _0xf184=function(_0x35b18a,_0x6b2fbe){_0x35b18a=_0x35b18a-0x0;var _0x4db1bd=_0x184f[_0x35b18a];return _0x4db1bd;};'use strict';var _=require(_0xf184('0x0'));var util=require(_0xf184('0x1'));var moment=require(_0xf184('0x2'));var BPromise=require(_0xf184('0x3'));var rs=require(_0xf184('0x4'));var fs=require('fs');var Redis=require(_0xf184('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf184('0x6'));var logger=require(_0xf184('0x7'))(_0xf184('0x8'));var config=require(_0xf184('0x9'));var jayson=require(_0xf184('0xa'));var client=jayson['client'][_0xf184('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x260323,_0x3e2615,_0x2f7242){return new BPromise(function(_0x3e8071,_0x3f34a7){return client['request'](_0x260323,_0x2f7242)[_0xf184('0xc')](function(_0x3ea5c4){logger[_0xf184('0xd')](_0xf184('0xe'),_0x3e2615,_0xf184('0xf'));logger[_0xf184('0x10')](_0xf184('0x11'),_0x3e2615,_0xf184('0xf'),JSON[_0xf184('0x12')](_0x3ea5c4));if(_0x3ea5c4[_0xf184('0x13')]){if(_0x3ea5c4[_0xf184('0x13')][_0xf184('0x14')]===0x1f4){logger['error'](_0xf184('0xe'),_0x3e2615,_0x3ea5c4[_0xf184('0x13')]['message']);return _0x3f34a7(_0x3ea5c4[_0xf184('0x13')][_0xf184('0x15')]);}logger[_0xf184('0x13')](_0xf184('0xe'),_0x3e2615,_0x3ea5c4[_0xf184('0x13')][_0xf184('0x15')]);return _0x3e8071(_0x3ea5c4['error'][_0xf184('0x15')]);}else{logger[_0xf184('0xd')](_0xf184('0xe'),_0x3e2615,_0xf184('0xf'));_0x3e8071(_0x3ea5c4['result'][_0xf184('0x15')]);}})[_0xf184('0x16')](function(_0x4a018b){logger[_0xf184('0x13')](_0xf184('0xe'),_0x3e2615,_0x4a018b);_0x3f34a7(_0x4a018b);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index bd8ef43..a8472af 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 _0xd8af=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./analyticMetric.controller','isAuthenticated','get','/:id','show','create','put','update','destroy'];(function(_0x29d693,_0x2daadb){var _0x1210c6=function(_0x3ba2e1){while(--_0x3ba2e1){_0x29d693['push'](_0x29d693['shift']());}};_0x1210c6(++_0x2daadb);}(_0xd8af,0x18d));var _0xfd8a=function(_0x59e5e5,_0x186659){_0x59e5e5=_0x59e5e5-0x0;var _0x2bd949=_0xd8af[_0x59e5e5];return _0x2bd949;};'use strict';var multer=require(_0xfd8a('0x0'));var util=require(_0xfd8a('0x1'));var path=require(_0xfd8a('0x2'));var timeout=require(_0xfd8a('0x3'));var express=require(_0xfd8a('0x4'));var router=express['Router']();var fs_extra=require(_0xfd8a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xfd8a('0x6'));var config=require(_0xfd8a('0x7'));var controller=require(_0xfd8a('0x8'));router['get']('/',auth[_0xfd8a('0x9')](),controller['index']);router[_0xfd8a('0xa')](_0xfd8a('0xb'),auth[_0xfd8a('0x9')](),controller[_0xfd8a('0xc')]);router['post']('/',auth[_0xfd8a('0x9')](),controller[_0xfd8a('0xd')]);router[_0xfd8a('0xe')](_0xfd8a('0xb'),auth[_0xfd8a('0x9')](),controller[_0xfd8a('0xf')]);router['delete']('/:id',auth[_0xfd8a('0x9')](),controller[_0xfd8a('0x10')]);module[_0xfd8a('0x11')]=router;
\ No newline at end of file
+var _0x24ce=['delete','destroy','util','path','connect-timeout','express','../../components/auth/service','./analyticMetric.controller','get','isAuthenticated','index','show','post','create','put','/:id','update'];(function(_0x1ebe90,_0x5d29fc){var _0x447c82=function(_0x1c2646){while(--_0x1c2646){_0x1ebe90['push'](_0x1ebe90['shift']());}};_0x447c82(++_0x5d29fc);}(_0x24ce,0x1de));var _0xe24c=function(_0xd8d721,_0x85473b){_0xd8d721=_0xd8d721-0x0;var _0x2ed4dd=_0x24ce[_0xd8d721];return _0x2ed4dd;};'use strict';var multer=require('multer');var util=require(_0xe24c('0x0'));var path=require(_0xe24c('0x1'));var timeout=require(_0xe24c('0x2'));var express=require(_0xe24c('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe24c('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe24c('0x5'));router[_0xe24c('0x6')]('/',auth[_0xe24c('0x7')](),controller[_0xe24c('0x8')]);router[_0xe24c('0x6')]('/:id',auth[_0xe24c('0x7')](),controller[_0xe24c('0x9')]);router[_0xe24c('0xa')]('/',auth[_0xe24c('0x7')](),controller[_0xe24c('0xb')]);router[_0xe24c('0xc')](_0xe24c('0xd'),auth[_0xe24c('0x7')](),controller[_0xe24c('0xe')]);router[_0xe24c('0xf')](_0xe24c('0xd'),auth[_0xe24c('0x7')](),controller[_0xe24c('0x10')]);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 1733a02..928a2fe 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 _0x9836=['TEXT','sequelize','exports'];(function(_0xda19ac,_0x2facb7){var _0x46f5ad=function(_0x2793d3){while(--_0x2793d3){_0xda19ac['push'](_0xda19ac['shift']());}};_0x46f5ad(++_0x2facb7);}(_0x9836,0x1f0));var _0x6983=function(_0xdd2bfa,_0x5bd304){_0xdd2bfa=_0xdd2bfa-0x0;var _0x55397e=_0x9836[_0xdd2bfa];return _0x55397e;};'use strict';var Sequelize=require(_0x6983('0x0'));module[_0x6983('0x1')]={'tree':{'type':Sequelize[_0x6983('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0xf906=['exports','TEXT','sequelize'];(function(_0x42e8a3,_0x341058){var _0x59524d=function(_0x132ea5){while(--_0x132ea5){_0x42e8a3['push'](_0x42e8a3['shift']());}};_0x59524d(++_0x341058);}(_0xf906,0x176));var _0x6f90=function(_0x2a7d28,_0x5cc069){_0x2a7d28=_0x2a7d28-0x0;var _0xbdd0db=_0xf906[_0x2a7d28];return _0xbdd0db;};'use strict';var Sequelize=require(_0x6f90('0x0'));module[_0x6f90('0x1')]={'tree':{'type':Sequelize[_0x6f90('0x2')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 4253678..16f1766 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 _0xaf46=['fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','destroy','then','end','error','name','send','index','map','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','include','AnalyticTreeReport','findAll','rows','catch','show','params','rawAttributes','find','create','body','update','rimraf','zip-dir'];(function(_0x4a408d,_0x224606){var _0x51e853=function(_0x5a4894){while(--_0x5a4894){_0x4a408d['push'](_0x4a408d['shift']());}};_0x51e853(++_0x224606);}(_0xaf46,0x170));var _0x6af4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xaf46[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6af4('0x0'));var zipdir=require(_0x6af4('0x1'));var jsonpatch=require(_0x6af4('0x2'));var rp=require(_0x6af4('0x3'));var moment=require(_0x6af4('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6af4('0x5'));var path=require(_0x6af4('0x6'));var sox=require(_0x6af4('0x7'));var csv=require('to-csv');var ejs=require(_0x6af4('0x8'));var fs=require('fs');var fs_extra=require(_0x6af4('0x9'));var _=require(_0x6af4('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6af4('0xb'));var deskjs=require(_0x6af4('0xc'));var toCsv=require(_0x6af4('0xd'));var querystring=require(_0x6af4('0xe'));var Papa=require(_0x6af4('0xf'));var Redis=require(_0x6af4('0x10'));var authService=require(_0x6af4('0x11'));var qs=require(_0x6af4('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6af4('0x13'))(_0x6af4('0x14'));var utils=require(_0x6af4('0x15'));var config=require(_0x6af4('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x6af4('0x17'))['db'];function respondWithStatusCode(_0xd5c3e6,_0x3cb30d){_0x3cb30d=_0x3cb30d||0xcc;return function(_0x57e1fd){if(_0x57e1fd){return _0xd5c3e6[_0x6af4('0x18')](_0x3cb30d);}return _0xd5c3e6[_0x6af4('0x19')](_0x3cb30d)['end']();};}function respondWithResult(_0x1a9f53,_0x488886){_0x488886=_0x488886||0xc8;return function(_0x19280d){if(_0x19280d){return _0x1a9f53[_0x6af4('0x19')](_0x488886)[_0x6af4('0x1a')](_0x19280d);}};}function respondWithFilteredResult(_0x2a62c6,_0x44124d){return function(_0x24f3cd){if(_0x24f3cd){var _0x349ec5=typeof _0x44124d[_0x6af4('0x1b')]===_0x6af4('0x1c')&&typeof _0x44124d[_0x6af4('0x1d')]===_0x6af4('0x1c');var _0x3bfec1=_0x24f3cd['count'];var _0x5e3c17=_0x349ec5?0x0:_0x44124d[_0x6af4('0x1b')];var _0x471cc8=_0x349ec5?_0x24f3cd[_0x6af4('0x1e')]:_0x44124d[_0x6af4('0x1b')]+_0x44124d[_0x6af4('0x1d')];var _0x5e0b3b;if(_0x471cc8>=_0x3bfec1){_0x471cc8=_0x3bfec1;_0x5e0b3b=0xc8;}else{_0x5e0b3b=0xce;}_0x2a62c6[_0x6af4('0x19')](_0x5e0b3b);return _0x2a62c6[_0x6af4('0x1f')]('Content-Range',_0x5e3c17+'-'+_0x471cc8+'/'+_0x3bfec1)['json'](_0x24f3cd);}return null;};}function patchUpdates(_0x214013){return function(_0x1c5917){try{jsonpatch[_0x6af4('0x20')](_0x1c5917,_0x214013,!![]);}catch(_0x4319f7){return BPromise['reject'](_0x4319f7);}return _0x1c5917[_0x6af4('0x21')]();};}function saveUpdates(_0x125396,_0xca2d97){return function(_0x278bab){if(_0x278bab){return _0x278bab['update'](_0x125396)['then'](function(_0xb957aa){return _0xb957aa;});}return null;};}function removeEntity(_0x239a57,_0x4f1c3b){return function(_0x548db3){if(_0x548db3){return _0x548db3[_0x6af4('0x22')]()[_0x6af4('0x23')](function(){_0x239a57[_0x6af4('0x19')](0xcc)[_0x6af4('0x24')]();});}};}function handleEntityNotFound(_0x3a3ffc,_0x5a0b24){return function(_0x1443f4){if(!_0x1443f4){_0x3a3ffc[_0x6af4('0x18')](0x194);}return _0x1443f4;};}function handleError(_0x65da5a,_0x1cfe68){_0x1cfe68=_0x1cfe68||0x1f4;return function(_0x2a03da){logger[_0x6af4('0x25')](_0x2a03da['stack']);if(_0x2a03da['name']){delete _0x2a03da[_0x6af4('0x26')];}_0x65da5a[_0x6af4('0x19')](_0x1cfe68)[_0x6af4('0x27')](_0x2a03da);};}exports[_0x6af4('0x28')]=function(_0x33c0c6,_0x5c7a74){var _0x527ae1={},_0x24b7cb={},_0x534b98={'count':0x0,'rows':[]};var _0xd5261c=_[_0x6af4('0x29')](db['AnalyticTreeReport']['rawAttributes'],function(_0x47875e){return{'name':_0x47875e[_0x6af4('0x2a')],'type':_0x47875e[_0x6af4('0x2b')][_0x6af4('0x2c')]};});_0x24b7cb['model']=_[_0x6af4('0x29')](_0xd5261c,_0x6af4('0x26'));_0x24b7cb[_0x6af4('0x2d')]=_[_0x6af4('0x2e')](_0x33c0c6['query']);_0x24b7cb['filters']=_[_0x6af4('0x2f')](_0x24b7cb['model'],_0x24b7cb[_0x6af4('0x2d')]);_0x527ae1['attributes']=_[_0x6af4('0x2f')](_0x24b7cb[_0x6af4('0x30')],qs[_0x6af4('0x31')](_0x33c0c6[_0x6af4('0x2d')]['fields']));_0x527ae1['attributes']=_0x527ae1[_0x6af4('0x32')][_0x6af4('0x33')]?_0x527ae1[_0x6af4('0x32')]:_0x24b7cb['model'];if(!_0x33c0c6[_0x6af4('0x2d')][_0x6af4('0x34')](_0x6af4('0x35'))){_0x527ae1[_0x6af4('0x1d')]=qs[_0x6af4('0x1d')](_0x33c0c6[_0x6af4('0x2d')][_0x6af4('0x1d')]);_0x527ae1['offset']=qs[_0x6af4('0x1b')](_0x33c0c6[_0x6af4('0x2d')][_0x6af4('0x1b')]);}_0x527ae1[_0x6af4('0x36')]=qs['sort'](_0x33c0c6[_0x6af4('0x2d')][_0x6af4('0x37')]);_0x527ae1[_0x6af4('0x38')]=qs[_0x6af4('0x39')](_['pick'](_0x33c0c6[_0x6af4('0x2d')],_0x24b7cb['filters']),_0xd5261c);if(_0x33c0c6['query'][_0x6af4('0x3a')]){_0x527ae1[_0x6af4('0x38')]=_[_0x6af4('0x3b')](_0x527ae1[_0x6af4('0x38')],{'$or':_[_0x6af4('0x29')](_0xd5261c,function(_0x8d56d1){if(_0x8d56d1['type']!==_0x6af4('0x3c')){var _0x352ed0={};_0x352ed0[_0x8d56d1[_0x6af4('0x26')]]={'$like':'%'+_0x33c0c6[_0x6af4('0x2d')][_0x6af4('0x3a')]+'%'};return _0x352ed0;}})});}_0x527ae1=_[_0x6af4('0x3b')]({},_0x527ae1,_0x33c0c6[_0x6af4('0x3d')]);var _0x546478={'where':_0x527ae1['where']};return db['AnalyticTreeReport']['count'](_0x546478)['then'](function(_0x2e7b35){_0x534b98[_0x6af4('0x1e')]=_0x2e7b35;if(_0x33c0c6[_0x6af4('0x2d')]['includeAll']){_0x527ae1[_0x6af4('0x3e')]=[{'all':!![]}];}return db[_0x6af4('0x3f')][_0x6af4('0x40')](_0x527ae1);})[_0x6af4('0x23')](function(_0x148e81){_0x534b98[_0x6af4('0x41')]=_0x148e81;return _0x534b98;})['then'](respondWithFilteredResult(_0x5c7a74,_0x527ae1))[_0x6af4('0x42')](handleError(_0x5c7a74,null));};exports[_0x6af4('0x43')]=function(_0x5eda9a,_0x26fae7){var _0x54496e={'raw':!![],'where':{'id':_0x5eda9a[_0x6af4('0x44')]['id']}},_0x470955={};_0x470955[_0x6af4('0x30')]=_['keys'](db['AnalyticTreeReport'][_0x6af4('0x45')]);_0x470955['query']=_['keys'](_0x5eda9a[_0x6af4('0x2d')]);_0x470955['filters']=_[_0x6af4('0x2f')](_0x470955[_0x6af4('0x30')],_0x470955[_0x6af4('0x2d')]);_0x54496e[_0x6af4('0x32')]=_['intersection'](_0x470955['model'],qs[_0x6af4('0x31')](_0x5eda9a[_0x6af4('0x2d')][_0x6af4('0x31')]));_0x54496e[_0x6af4('0x32')]=_0x54496e[_0x6af4('0x32')][_0x6af4('0x33')]?_0x54496e[_0x6af4('0x32')]:_0x470955[_0x6af4('0x30')];if(_0x5eda9a[_0x6af4('0x2d')]['includeAll']){_0x54496e[_0x6af4('0x3e')]=[{'all':!![]}];}_0x54496e=_[_0x6af4('0x3b')]({},_0x54496e,_0x5eda9a[_0x6af4('0x3d')]);return db[_0x6af4('0x3f')][_0x6af4('0x46')](_0x54496e)['then'](handleEntityNotFound(_0x26fae7,null))['then'](respondWithResult(_0x26fae7,null))[_0x6af4('0x42')](handleError(_0x26fae7,null));};exports['create']=function(_0x7d1ac9,_0x3417e2){return db[_0x6af4('0x3f')][_0x6af4('0x47')](_0x7d1ac9[_0x6af4('0x48')],{})[_0x6af4('0x23')](respondWithResult(_0x3417e2,0xc9))['catch'](handleError(_0x3417e2,null));};exports[_0x6af4('0x49')]=function(_0x27ba6e,_0x8349c2){if(_0x27ba6e['body']['id']){delete _0x27ba6e['body']['id'];}return db['AnalyticTreeReport'][_0x6af4('0x46')]({'where':{'id':_0x27ba6e[_0x6af4('0x44')]['id']}})[_0x6af4('0x23')](handleEntityNotFound(_0x8349c2,null))[_0x6af4('0x23')](saveUpdates(_0x27ba6e[_0x6af4('0x48')],null))[_0x6af4('0x23')](respondWithResult(_0x8349c2,null))[_0x6af4('0x42')](handleError(_0x8349c2,null));};exports[_0x6af4('0x22')]=function(_0x56ce38,_0x1bdb46){return db[_0x6af4('0x3f')][_0x6af4('0x46')]({'where':{'id':_0x56ce38[_0x6af4('0x44')]['id']}})[_0x6af4('0x23')](handleEntityNotFound(_0x1bdb46,null))[_0x6af4('0x23')](removeEntity(_0x1bdb46,null))[_0x6af4('0x42')](handleError(_0x1bdb46,null));};
\ No newline at end of file
+var _0xf4bf=['destroy','name','index','map','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','AnalyticTreeReport','includeAll','findAll','rows','catch','show','params','include','create','body','find','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then'];(function(_0x309a3b,_0x4cb4dd){var _0x3152ac=function(_0x2c69bc){while(--_0x2c69bc){_0x309a3b['push'](_0x309a3b['shift']());}};_0x3152ac(++_0x4cb4dd);}(_0xf4bf,0xb0));var _0xff4b=function(_0x1e081a,_0x482d6b){_0x1e081a=_0x1e081a-0x0;var _0x428209=_0xf4bf[_0x1e081a];return _0x428209;};'use strict';var emlformat=require(_0xff4b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xff4b('0x1'));var jsonpatch=require(_0xff4b('0x2'));var rp=require('request-promise');var moment=require(_0xff4b('0x3'));var BPromise=require(_0xff4b('0x4'));var Mustache=require(_0xff4b('0x5'));var util=require(_0xff4b('0x6'));var path=require(_0xff4b('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xff4b('0x8'));var fs=require('fs');var fs_extra=require(_0xff4b('0x9'));var _=require(_0xff4b('0xa'));var squel=require(_0xff4b('0xb'));var crypto=require(_0xff4b('0xc'));var jsforce=require(_0xff4b('0xd'));var deskjs=require(_0xff4b('0xe'));var toCsv=require(_0xff4b('0xf'));var querystring=require(_0xff4b('0x10'));var Papa=require(_0xff4b('0x11'));var Redis=require(_0xff4b('0x12'));var authService=require(_0xff4b('0x13'));var qs=require(_0xff4b('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xff4b('0x15'));var logger=require(_0xff4b('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xff4b('0x17'))['db'];function respondWithStatusCode(_0x507d3c,_0x146270){_0x146270=_0x146270||0xcc;return function(_0x1b50bb){if(_0x1b50bb){return _0x507d3c[_0xff4b('0x18')](_0x146270);}return _0x507d3c[_0xff4b('0x19')](_0x146270)['end']();};}function respondWithResult(_0x2f2b22,_0x405869){_0x405869=_0x405869||0xc8;return function(_0x4f2104){if(_0x4f2104){return _0x2f2b22[_0xff4b('0x19')](_0x405869)[_0xff4b('0x1a')](_0x4f2104);}};}function respondWithFilteredResult(_0xa19e02,_0x5e0e86){return function(_0x20fd03){if(_0x20fd03){var _0x595bf4=typeof _0x5e0e86[_0xff4b('0x1b')]===_0xff4b('0x1c')&&typeof _0x5e0e86[_0xff4b('0x1d')]==='undefined';var _0x4ccba3=_0x20fd03[_0xff4b('0x1e')];var _0x5d363b=_0x595bf4?0x0:_0x5e0e86[_0xff4b('0x1b')];var _0x16f61c=_0x595bf4?_0x20fd03[_0xff4b('0x1e')]:_0x5e0e86[_0xff4b('0x1b')]+_0x5e0e86[_0xff4b('0x1d')];var _0x5e6f44;if(_0x16f61c>=_0x4ccba3){_0x16f61c=_0x4ccba3;_0x5e6f44=0xc8;}else{_0x5e6f44=0xce;}_0xa19e02['status'](_0x5e6f44);return _0xa19e02[_0xff4b('0x1f')](_0xff4b('0x20'),_0x5d363b+'-'+_0x16f61c+'/'+_0x4ccba3)[_0xff4b('0x1a')](_0x20fd03);}return null;};}function patchUpdates(_0x5ea71d){return function(_0x70849b){try{jsonpatch['apply'](_0x70849b,_0x5ea71d,!![]);}catch(_0x308bf6){return BPromise[_0xff4b('0x21')](_0x308bf6);}return _0x70849b[_0xff4b('0x22')]();};}function saveUpdates(_0x1383a1,_0x3e64ab){return function(_0x4d4172){if(_0x4d4172){return _0x4d4172[_0xff4b('0x23')](_0x1383a1)[_0xff4b('0x24')](function(_0x5709d7){return _0x5709d7;});}return null;};}function removeEntity(_0x1c1ba3,_0xe910b0){return function(_0xe790ca){if(_0xe790ca){return _0xe790ca[_0xff4b('0x25')]()['then'](function(){_0x1c1ba3[_0xff4b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x167461,_0x5872d6){return function(_0x28d88a){if(!_0x28d88a){_0x167461['sendStatus'](0x194);}return _0x28d88a;};}function handleError(_0x5715ee,_0x4cf60b){_0x4cf60b=_0x4cf60b||0x1f4;return function(_0x4e6759){logger['error'](_0x4e6759['stack']);if(_0x4e6759[_0xff4b('0x26')]){delete _0x4e6759[_0xff4b('0x26')];}_0x5715ee['status'](_0x4cf60b)['send'](_0x4e6759);};}exports[_0xff4b('0x27')]=function(_0x11324a,_0x1ab691){var _0x215259={},_0x46f331={},_0xf76797={'count':0x0,'rows':[]};var _0x3ea00f=_[_0xff4b('0x28')](db['AnalyticTreeReport'][_0xff4b('0x29')],function(_0x4633d0){return{'name':_0x4633d0['fieldName'],'type':_0x4633d0[_0xff4b('0x2a')][_0xff4b('0x2b')]};});_0x46f331[_0xff4b('0x2c')]=_[_0xff4b('0x28')](_0x3ea00f,_0xff4b('0x26'));_0x46f331['query']=_[_0xff4b('0x2d')](_0x11324a[_0xff4b('0x2e')]);_0x46f331[_0xff4b('0x2f')]=_[_0xff4b('0x30')](_0x46f331[_0xff4b('0x2c')],_0x46f331['query']);_0x215259[_0xff4b('0x31')]=_['intersection'](_0x46f331[_0xff4b('0x2c')],qs[_0xff4b('0x32')](_0x11324a[_0xff4b('0x2e')]['fields']));_0x215259['attributes']=_0x215259[_0xff4b('0x31')][_0xff4b('0x33')]?_0x215259[_0xff4b('0x31')]:_0x46f331['model'];if(!_0x11324a[_0xff4b('0x2e')][_0xff4b('0x34')]('nolimit')){_0x215259[_0xff4b('0x1d')]=qs[_0xff4b('0x1d')](_0x11324a['query'][_0xff4b('0x1d')]);_0x215259[_0xff4b('0x1b')]=qs['offset'](_0x11324a[_0xff4b('0x2e')][_0xff4b('0x1b')]);}_0x215259[_0xff4b('0x35')]=qs[_0xff4b('0x36')](_0x11324a['query']['sort']);_0x215259['where']=qs[_0xff4b('0x2f')](_[_0xff4b('0x37')](_0x11324a['query'],_0x46f331[_0xff4b('0x2f')]),_0x3ea00f);if(_0x11324a[_0xff4b('0x2e')][_0xff4b('0x38')]){_0x215259[_0xff4b('0x39')]=_['merge'](_0x215259[_0xff4b('0x39')],{'$or':_[_0xff4b('0x28')](_0x3ea00f,function(_0x48bf4c){if(_0x48bf4c['type']!=='VIRTUAL'){var _0x4edb1c={};_0x4edb1c[_0x48bf4c[_0xff4b('0x26')]]={'$like':'%'+_0x11324a['query'][_0xff4b('0x38')]+'%'};return _0x4edb1c;}})});}_0x215259=_[_0xff4b('0x3a')]({},_0x215259,_0x11324a[_0xff4b('0x3b')]);var _0x2815b7={'where':_0x215259['where']};return db[_0xff4b('0x3c')][_0xff4b('0x1e')](_0x2815b7)[_0xff4b('0x24')](function(_0x31a962){_0xf76797['count']=_0x31a962;if(_0x11324a[_0xff4b('0x2e')][_0xff4b('0x3d')]){_0x215259['include']=[{'all':!![]}];}return db['AnalyticTreeReport'][_0xff4b('0x3e')](_0x215259);})[_0xff4b('0x24')](function(_0x477432){_0xf76797[_0xff4b('0x3f')]=_0x477432;return _0xf76797;})[_0xff4b('0x24')](respondWithFilteredResult(_0x1ab691,_0x215259))[_0xff4b('0x40')](handleError(_0x1ab691,null));};exports[_0xff4b('0x41')]=function(_0x18829e,_0x2d46b7){var _0x21a216={'raw':!![],'where':{'id':_0x18829e[_0xff4b('0x42')]['id']}},_0x5c0794={};_0x5c0794[_0xff4b('0x2c')]=_[_0xff4b('0x2d')](db[_0xff4b('0x3c')][_0xff4b('0x29')]);_0x5c0794['query']=_[_0xff4b('0x2d')](_0x18829e[_0xff4b('0x2e')]);_0x5c0794[_0xff4b('0x2f')]=_[_0xff4b('0x30')](_0x5c0794[_0xff4b('0x2c')],_0x5c0794[_0xff4b('0x2e')]);_0x21a216['attributes']=_['intersection'](_0x5c0794[_0xff4b('0x2c')],qs[_0xff4b('0x32')](_0x18829e['query'][_0xff4b('0x32')]));_0x21a216[_0xff4b('0x31')]=_0x21a216[_0xff4b('0x31')][_0xff4b('0x33')]?_0x21a216[_0xff4b('0x31')]:_0x5c0794[_0xff4b('0x2c')];if(_0x18829e[_0xff4b('0x2e')][_0xff4b('0x3d')]){_0x21a216[_0xff4b('0x43')]=[{'all':!![]}];}_0x21a216=_['merge']({},_0x21a216,_0x18829e['options']);return db[_0xff4b('0x3c')]['find'](_0x21a216)[_0xff4b('0x24')](handleEntityNotFound(_0x2d46b7,null))[_0xff4b('0x24')](respondWithResult(_0x2d46b7,null))[_0xff4b('0x40')](handleError(_0x2d46b7,null));};exports[_0xff4b('0x44')]=function(_0x4bab3f,_0x1e7866){return db[_0xff4b('0x3c')][_0xff4b('0x44')](_0x4bab3f[_0xff4b('0x45')],{})[_0xff4b('0x24')](respondWithResult(_0x1e7866,0xc9))[_0xff4b('0x40')](handleError(_0x1e7866,null));};exports[_0xff4b('0x23')]=function(_0x2974f5,_0x569412){if(_0x2974f5[_0xff4b('0x45')]['id']){delete _0x2974f5[_0xff4b('0x45')]['id'];}return db[_0xff4b('0x3c')][_0xff4b('0x46')]({'where':{'id':_0x2974f5[_0xff4b('0x42')]['id']}})[_0xff4b('0x24')](handleEntityNotFound(_0x569412,null))[_0xff4b('0x24')](saveUpdates(_0x2974f5[_0xff4b('0x45')],null))[_0xff4b('0x24')](respondWithResult(_0x569412,null))['catch'](handleError(_0x569412,null));};exports[_0xff4b('0x25')]=function(_0x33110,_0x4fd8c7){return db['AnalyticTreeReport']['find']({'where':{'id':_0x33110['params']['id']}})[_0xff4b('0x24')](handleEntityNotFound(_0x4fd8c7,null))['then'](removeEntity(_0x4fd8c7,null))[_0xff4b('0x40')](handleError(_0x4fd8c7,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 9ea6fd9..22de259 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 _0x9ad4=['AnalyticTreeReport','lodash','util','../../config/logger','bluebird','rimraf','../../config/environment'];(function(_0x2436f4,_0x5077e5){var _0x540d0d=function(_0x41830c){while(--_0x41830c){_0x2436f4['push'](_0x2436f4['shift']());}};_0x540d0d(++_0x5077e5);}(_0x9ad4,0x151));var _0x49ad=function(_0x1e8dd5,_0x571f6d){_0x1e8dd5=_0x1e8dd5-0x0;var _0x9aa844=_0x9ad4[_0x1e8dd5];return _0x9aa844;};'use strict';var _=require(_0x49ad('0x0'));var util=require(_0x49ad('0x1'));var logger=require(_0x49ad('0x2'))('api');var moment=require('moment');var BPromise=require(_0x49ad('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x49ad('0x4'));var config=require(_0x49ad('0x5'));var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0x5433fc,_0x4c5920){return _0x5433fc['define'](_0x49ad('0x6'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x33fe=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','AnalyticTreeReport','lodash'];(function(_0x220256,_0x1fee31){var _0x3e8b32=function(_0x4d765f){while(--_0x4d765f){_0x220256['push'](_0x220256['shift']());}};_0x3e8b32(++_0x1fee31);}(_0x33fe,0x1cd));var _0xe33f=function(_0x1bf69b,_0x3e889c){_0x1bf69b=_0x1bf69b-0x0;var _0x252aa8=_0x33fe[_0x1bf69b];return _0x252aa8;};'use strict';var _=require(_0xe33f('0x0'));var util=require(_0xe33f('0x1'));var logger=require(_0xe33f('0x2'))('api');var moment=require(_0xe33f('0x3'));var BPromise=require(_0xe33f('0x4'));var rp=require(_0xe33f('0x5'));var fs=require('fs');var path=require(_0xe33f('0x6'));var rimraf=require(_0xe33f('0x7'));var config=require(_0xe33f('0x8'));var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0x466059,_0x164ae0){return _0x466059[_0xe33f('0x9')](_0xe33f('0xa'),attributes,{'tableName':'analytics_report_trees','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 a42084a..8a99995 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x55d143,_0x4836e2){var _0x29c2f7=function(_0xa65606){while(--_0xa65606){_0x55d143['push'](_0x55d143['shift']());}};_0x29c2f7(++_0x4836e2);}(_0x2ef3,0xba));var _0x32ef=function(_0x4883d5,_0x1ce202){_0x4883d5=_0x4883d5-0x0;var _0x1b188e=_0x2ef3[_0x4883d5];return _0x1b188e;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}
\ No newline at end of file
+var _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(_0xbc0cdb,_0x277170){var _0x25e621=function(_0x5d66a6){while(--_0x5d66a6){_0xbc0cdb['push'](_0xbc0cdb['shift']());}};_0x25e621(++_0x277170);}(_0xdb28,0x106));var _0x8db2=function(_0x4fed3d,_0x1a5c6e){_0x4fed3d=_0x4fed3d-0x0;var _0x5bb04e=_0xdb28[_0x4fed3d];return _0x5bb04e;};'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
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 931d6f5..c55a1b6 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 _0x7ca0=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','index','/:id','isAuthenticated','show','post','put','destroy','exports','util'];(function(_0x31a119,_0x17e6ca){var _0x2d6e6a=function(_0x3faa80){while(--_0x3faa80){_0x31a119['push'](_0x31a119['shift']());}};_0x2d6e6a(++_0x17e6ca);}(_0x7ca0,0x175));var _0x07ca=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7ca0[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x07ca('0x0'));var path=require(_0x07ca('0x1'));var timeout=require(_0x07ca('0x2'));var express=require('express');var router=express[_0x07ca('0x3')]();var fs_extra=require(_0x07ca('0x4'));var auth=require(_0x07ca('0x5'));var interaction=require(_0x07ca('0x6'));var config=require(_0x07ca('0x7'));var controller=require(_0x07ca('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x07ca('0x9')]);router['get'](_0x07ca('0xa'),auth[_0x07ca('0xb')](),controller[_0x07ca('0xc')]);router[_0x07ca('0xd')]('/',auth[_0x07ca('0xb')](),controller['create']);router[_0x07ca('0xe')](_0x07ca('0xa'),auth[_0x07ca('0xb')](),controller['update']);router['delete']('/:id',auth[_0x07ca('0xb')](),controller[_0x07ca('0xf')]);module[_0x07ca('0x10')]=router;
\ No newline at end of file
+var _0x4534=['get','index','isAuthenticated','show','post','create','put','/:id','update','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./analyticTreeReport.controller'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x4534,0xc6));var _0x4453=function(_0x2cc0a0,_0x4e9c49){_0x2cc0a0=_0x2cc0a0-0x0;var _0x24e0fe=_0x4534[_0x2cc0a0];return _0x24e0fe;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4453('0x0'));var timeout=require(_0x4453('0x1'));var express=require('express');var router=express[_0x4453('0x2')]();var fs_extra=require(_0x4453('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x4453('0x4'));var config=require('../../config/environment');var controller=require(_0x4453('0x5'));router[_0x4453('0x6')]('/',auth['isAuthenticated'](),controller[_0x4453('0x7')]);router[_0x4453('0x6')]('/:id',auth[_0x4453('0x8')](),controller[_0x4453('0x9')]);router[_0x4453('0xa')]('/',auth['isAuthenticated'](),controller[_0x4453('0xb')]);router[_0x4453('0xc')](_0x4453('0xd'),auth[_0x4453('0x8')](),controller[_0x4453('0xe')]);router['delete'](_0x4453('0xd'),auth[_0x4453('0x8')](),controller[_0x4453('0xf')]);module[_0x4453('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 4d2387f..9451f7d 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 _0x7f90=['STRING','sequelize','exports'];(function(_0x252632,_0x2b0ece){var _0x4b6e59=function(_0x2766f4){while(--_0x2766f4){_0x252632['push'](_0x252632['shift']());}};_0x4b6e59(++_0x2b0ece);}(_0x7f90,0xf4));var _0x07f9=function(_0x1a42da,_0x511121){_0x1a42da=_0x1a42da-0x0;var _0x57301e=_0x7f90[_0x1a42da];return _0x57301e;};'use strict';var Sequelize=require(_0x07f9('0x0'));module[_0x07f9('0x1')]={'name':{'type':Sequelize[_0x07f9('0x2')]},'basename':{'type':Sequelize[_0x07f9('0x2')]},'type':{'type':Sequelize[_0x07f9('0x2')]}};
\ No newline at end of file
+var _0x9649=['STRING','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9649,0x19f));var _0x9964=function(_0x2a8acc,_0x150fe2){_0x2a8acc=_0x2a8acc-0x0;var _0x4c507b=_0x9649[_0x2a8acc];return _0x4c507b;};'use strict';var Sequelize=require(_0x9964('0x0'));module[_0x9964('0x1')]={'name':{'type':Sequelize[_0x9964('0x2')]},'basename':{'type':Sequelize[_0x9964('0x2')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index a345597..6f800f5 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 _0xb14d=['VIRTUAL','options','includeAll','include','findAll','rows','params','find','catch','clone','get','omit','createdAt','updatedAt','body','create','originalname','basename','file','filename','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','name','send','index','Attachment','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','map'];(function(_0x20070d,_0x5a903e){var _0x6f9dfb=function(_0x52945b){while(--_0x52945b){_0x20070d['push'](_0x20070d['shift']());}};_0x6f9dfb(++_0x5a903e);}(_0xb14d,0x1e2));var _0xdb14=function(_0x7747e6,_0x5d1fcb){_0x7747e6=_0x7747e6-0x0;var _0x1c4204=_0xb14d[_0x7747e6];return _0x1c4204;};'use strict';var emlformat=require(_0xdb14('0x0'));var rimraf=require(_0xdb14('0x1'));var zipdir=require(_0xdb14('0x2'));var jsonpatch=require(_0xdb14('0x3'));var rp=require('request-promise');var moment=require(_0xdb14('0x4'));var BPromise=require(_0xdb14('0x5'));var Mustache=require('mustache');var util=require(_0xdb14('0x6'));var path=require(_0xdb14('0x7'));var sox=require(_0xdb14('0x8'));var csv=require(_0xdb14('0x9'));var ejs=require(_0xdb14('0xa'));var fs=require('fs');var fs_extra=require(_0xdb14('0xb'));var _=require(_0xdb14('0xc'));var squel=require(_0xdb14('0xd'));var crypto=require(_0xdb14('0xe'));var jsforce=require(_0xdb14('0xf'));var deskjs=require(_0xdb14('0x10'));var toCsv=require(_0xdb14('0x9'));var querystring=require(_0xdb14('0x11'));var Papa=require('papaparse');var Redis=require(_0xdb14('0x12'));var authService=require(_0xdb14('0x13'));var qs=require(_0xdb14('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdb14('0x15'));var logger=require(_0xdb14('0x16'))(_0xdb14('0x17'));var utils=require('../../config/utils');var config=require(_0xdb14('0x18'));var licenseUtil=require(_0xdb14('0x19'));var db=require(_0xdb14('0x1a'))['db'];function respondWithStatusCode(_0x25f9ad,_0x326cce){_0x326cce=_0x326cce||0xcc;return function(_0x4d4bdd){if(_0x4d4bdd){return _0x25f9ad[_0xdb14('0x1b')](_0x326cce);}return _0x25f9ad[_0xdb14('0x1c')](_0x326cce)[_0xdb14('0x1d')]();};}function respondWithResult(_0x33536d,_0x196744){_0x196744=_0x196744||0xc8;return function(_0x1313c4){if(_0x1313c4){return _0x33536d[_0xdb14('0x1c')](_0x196744)[_0xdb14('0x1e')](_0x1313c4);}};}function respondWithFilteredResult(_0x43a43e,_0x412a14){return function(_0x2190f0){if(_0x2190f0){var _0x12e1aa=typeof _0x412a14[_0xdb14('0x1f')]===_0xdb14('0x20')&&typeof _0x412a14[_0xdb14('0x21')]===_0xdb14('0x20');var _0x475503=_0x2190f0[_0xdb14('0x22')];var _0x570dbc=_0x12e1aa?0x0:_0x412a14[_0xdb14('0x1f')];var _0x2763a7=_0x12e1aa?_0x2190f0['count']:_0x412a14[_0xdb14('0x1f')]+_0x412a14[_0xdb14('0x21')];var _0x13872c;if(_0x2763a7>=_0x475503){_0x2763a7=_0x475503;_0x13872c=0xc8;}else{_0x13872c=0xce;}_0x43a43e['status'](_0x13872c);return _0x43a43e['set']('Content-Range',_0x570dbc+'-'+_0x2763a7+'/'+_0x475503)[_0xdb14('0x1e')](_0x2190f0);}return null;};}function patchUpdates(_0xc7cb8d){return function(_0x1c31b8){try{jsonpatch[_0xdb14('0x23')](_0x1c31b8,_0xc7cb8d,!![]);}catch(_0x4b15b1){return BPromise[_0xdb14('0x24')](_0x4b15b1);}return _0x1c31b8[_0xdb14('0x25')]();};}function saveUpdates(_0x4d0f7e,_0x367802){return function(_0x5503b2){if(_0x5503b2){return _0x5503b2[_0xdb14('0x26')](_0x4d0f7e)[_0xdb14('0x27')](function(_0x2c928b){return _0x2c928b;});}return null;};}function removeEntity(_0x374d46,_0x5215c9){return function(_0x42aa0d){if(_0x42aa0d){return _0x42aa0d[_0xdb14('0x28')]()[_0xdb14('0x27')](function(){_0x374d46[_0xdb14('0x1c')](0xcc)[_0xdb14('0x1d')]();});}};}function handleEntityNotFound(_0x4fb5d3,_0x25cada){return function(_0xc1947b){if(!_0xc1947b){_0x4fb5d3[_0xdb14('0x1b')](0x194);}return _0xc1947b;};}function handleError(_0x4e2ad1,_0x217134){_0x217134=_0x217134||0x1f4;return function(_0x415d3e){logger['error'](_0x415d3e['stack']);if(_0x415d3e[_0xdb14('0x29')]){delete _0x415d3e[_0xdb14('0x29')];}_0x4e2ad1['status'](_0x217134)[_0xdb14('0x2a')](_0x415d3e);};}exports[_0xdb14('0x2b')]=function(_0xe8fe2e,_0x59d99b){var _0x4252d3={},_0x534100={},_0x1e88c0={'count':0x0,'rows':[]};var _0x515c69=_['map'](db[_0xdb14('0x2c')][_0xdb14('0x2d')],function(_0x16eea3){return{'name':_0x16eea3[_0xdb14('0x2e')],'type':_0x16eea3[_0xdb14('0x2f')][_0xdb14('0x30')]};});_0x534100[_0xdb14('0x31')]=_['map'](_0x515c69,_0xdb14('0x29'));_0x534100['query']=_[_0xdb14('0x32')](_0xe8fe2e[_0xdb14('0x33')]);_0x534100[_0xdb14('0x34')]=_['intersection'](_0x534100[_0xdb14('0x31')],_0x534100[_0xdb14('0x33')]);_0x4252d3[_0xdb14('0x35')]=_[_0xdb14('0x36')](_0x534100[_0xdb14('0x31')],qs[_0xdb14('0x37')](_0xe8fe2e[_0xdb14('0x33')]['fields']));_0x4252d3[_0xdb14('0x35')]=_0x4252d3[_0xdb14('0x35')][_0xdb14('0x38')]?_0x4252d3['attributes']:_0x534100[_0xdb14('0x31')];if(!_0xe8fe2e[_0xdb14('0x33')][_0xdb14('0x39')](_0xdb14('0x3a'))){_0x4252d3[_0xdb14('0x21')]=qs[_0xdb14('0x21')](_0xe8fe2e[_0xdb14('0x33')][_0xdb14('0x21')]);_0x4252d3[_0xdb14('0x1f')]=qs['offset'](_0xe8fe2e[_0xdb14('0x33')][_0xdb14('0x1f')]);}_0x4252d3['order']=qs['sort'](_0xe8fe2e[_0xdb14('0x33')][_0xdb14('0x3b')]);_0x4252d3[_0xdb14('0x3c')]=qs['filters'](_['pick'](_0xe8fe2e[_0xdb14('0x33')],_0x534100['filters']),_0x515c69);if(_0xe8fe2e[_0xdb14('0x33')][_0xdb14('0x3d')]){_0x4252d3[_0xdb14('0x3c')]=_[_0xdb14('0x3e')](_0x4252d3['where'],{'$or':_[_0xdb14('0x3f')](_0x515c69,function(_0x58df9b){if(_0x58df9b[_0xdb14('0x2f')]!==_0xdb14('0x40')){var _0x42596f={};_0x42596f[_0x58df9b['name']]={'$like':'%'+_0xe8fe2e['query'][_0xdb14('0x3d')]+'%'};return _0x42596f;}})});}_0x4252d3=_[_0xdb14('0x3e')]({},_0x4252d3,_0xe8fe2e[_0xdb14('0x41')]);var _0x1e3cee={'where':_0x4252d3[_0xdb14('0x3c')]};return db[_0xdb14('0x2c')][_0xdb14('0x22')](_0x1e3cee)[_0xdb14('0x27')](function(_0x92dc8d){_0x1e88c0[_0xdb14('0x22')]=_0x92dc8d;if(_0xe8fe2e['query'][_0xdb14('0x42')]){_0x4252d3[_0xdb14('0x43')]=[{'all':!![]}];}return db[_0xdb14('0x2c')][_0xdb14('0x44')](_0x4252d3);})[_0xdb14('0x27')](function(_0x202b85){_0x1e88c0[_0xdb14('0x45')]=_0x202b85;return _0x1e88c0;})[_0xdb14('0x27')](respondWithFilteredResult(_0x59d99b,_0x4252d3))['catch'](handleError(_0x59d99b,null));};exports['show']=function(_0x28400d,_0x106c2e){var _0x3a846e={'raw':!![],'where':{'id':_0x28400d[_0xdb14('0x46')]['id']}},_0x1a1412={};_0x1a1412[_0xdb14('0x31')]=_[_0xdb14('0x32')](db[_0xdb14('0x2c')][_0xdb14('0x2d')]);_0x1a1412[_0xdb14('0x33')]=_[_0xdb14('0x32')](_0x28400d[_0xdb14('0x33')]);_0x1a1412[_0xdb14('0x34')]=_[_0xdb14('0x36')](_0x1a1412['model'],_0x1a1412[_0xdb14('0x33')]);_0x3a846e[_0xdb14('0x35')]=_['intersection'](_0x1a1412[_0xdb14('0x31')],qs[_0xdb14('0x37')](_0x28400d[_0xdb14('0x33')]['fields']));_0x3a846e[_0xdb14('0x35')]=_0x3a846e['attributes'][_0xdb14('0x38')]?_0x3a846e[_0xdb14('0x35')]:_0x1a1412[_0xdb14('0x31')];if(_0x28400d[_0xdb14('0x33')][_0xdb14('0x42')]){_0x3a846e['include']=[{'all':!![]}];}_0x3a846e=_['merge']({},_0x3a846e,_0x28400d[_0xdb14('0x41')]);return db[_0xdb14('0x2c')][_0xdb14('0x47')](_0x3a846e)['then'](handleEntityNotFound(_0x106c2e,null))[_0xdb14('0x27')](respondWithResult(_0x106c2e,null))[_0xdb14('0x48')](handleError(_0x106c2e,null));};exports[_0xdb14('0x49')]=function(_0x3fd1c2,_0x3114db){var _0x48be3e={'where':{'id':_0x3fd1c2[_0xdb14('0x46')]['id']}},_0x3822b5={};_0x3822b5[_0xdb14('0x31')]=_['keys'](db[_0xdb14('0x2c')][_0xdb14('0x2d')]);_0x48be3e[_0xdb14('0x35')]=_['intersection'](_0x3822b5[_0xdb14('0x31')],qs['fields'](_0x3fd1c2[_0xdb14('0x33')]['fields']));_0x48be3e['attributes']=_0x48be3e[_0xdb14('0x35')]['length']?_0x48be3e['attributes']:_0x3822b5[_0xdb14('0x31')];if(_0x3fd1c2['query']['includeAll']){_0x48be3e[_0xdb14('0x43')]=[{'all':!![]}];}_0x48be3e=_[_0xdb14('0x3e')]({},_0x48be3e,_0x3fd1c2[_0xdb14('0x41')]);return db[_0xdb14('0x2c')]['find'](_0x48be3e)['then'](handleEntityNotFound(_0x3114db,null))[_0xdb14('0x27')](function(_0x137ee5){if(_0x137ee5){var _0xe85e33=_0x137ee5[_0xdb14('0x4a')]({'plain':!![]});_0xe85e33=qs[_0xdb14('0x4b')](_0xe85e33,['id',_0xdb14('0x4c'),_0xdb14('0x4d')]);_0x3fd1c2[_0xdb14('0x4e')]=_[_0xdb14('0x4b')](_0x3fd1c2[_0xdb14('0x4e')],['id','createdAt','updatedAt']);return db[_0xdb14('0x2c')][_0xdb14('0x4f')](_[_0xdb14('0x3e')](_0xe85e33,_0x3fd1c2[_0xdb14('0x4e')]),{'include':_0x3fd1c2[_0xdb14('0x33')][_0xdb14('0x42')]?[{'all':!![]}]:undefined});}})[_0xdb14('0x27')](respondWithResult(_0x3114db,0xc9))[_0xdb14('0x48')](handleError(_0x3114db,null));};exports[_0xdb14('0x26')]=function(_0x18dad6,_0x6f6885){if(_0x18dad6[_0xdb14('0x4e')]['id']){delete _0x18dad6['body']['id'];}return db[_0xdb14('0x2c')][_0xdb14('0x47')]({'where':{'id':_0x18dad6[_0xdb14('0x46')]['id']}})[_0xdb14('0x27')](handleEntityNotFound(_0x6f6885,null))[_0xdb14('0x27')](saveUpdates(_0x18dad6[_0xdb14('0x4e')],null))[_0xdb14('0x27')](respondWithResult(_0x6f6885,null))[_0xdb14('0x48')](handleError(_0x6f6885,null));};exports[_0xdb14('0x28')]=function(_0x45fbe6,_0x3ccd06){return db[_0xdb14('0x2c')][_0xdb14('0x47')]({'where':{'id':_0x45fbe6[_0xdb14('0x46')]['id']}})[_0xdb14('0x27')](handleEntityNotFound(_0x3ccd06,null))[_0xdb14('0x27')](removeEntity(_0x3ccd06,null))[_0xdb14('0x48')](handleError(_0x3ccd06,null));};exports['create']=function(_0xa8a55c,_0x57c64b,_0x329a3e){_0xa8a55c[_0xdb14('0x4e')][_0xdb14('0x29')]=_0xa8a55c['file'][_0xdb14('0x50')];_0xa8a55c[_0xdb14('0x4e')][_0xdb14('0x51')]=_0xa8a55c[_0xdb14('0x52')][_0xdb14('0x53')];_0xa8a55c[_0xdb14('0x4e')][_0xdb14('0x2f')]=_0xa8a55c[_0xdb14('0x52')]['mimetype'];return db[_0xdb14('0x2c')][_0xdb14('0x4f')](_0xa8a55c[_0xdb14('0x4e')])['then'](respondWithResult(_0x57c64b,0xc9))[_0xdb14('0x48')](handleError(_0x57c64b,null));};exports[_0xdb14('0x54')]=function(_0x137abc,_0x58a651,_0x29eaa2){return db['Attachment'][_0xdb14('0x55')]({'where':{'id':_0x137abc[_0xdb14('0x46')]['id']},'raw':!![]})[_0xdb14('0x27')](handleEntityNotFound(_0x58a651,null))[_0xdb14('0x27')](function(_0x143c86){if(_0x143c86){var _0x50d39b=_0x143c86[_0xdb14('0x56')]!==null;var _0x1be194=path[_0xdb14('0x57')](config[_0xdb14('0x58')],_0xdb14('0x59'));if(_0x50d39b){_0x1be194=path[_0xdb14('0x57')](_0x1be194,_0xdb14('0x5a'));}var _0x530769=path[_0xdb14('0x57')](_0x1be194,_0x143c86['basename']);return _0x58a651[_0xdb14('0x54')](_0x530769);}})[_0xdb14('0x48')](handleError(_0x58a651,null));};
\ No newline at end of file
+var _0x9fb0=['fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','get','omit','createdAt','body','create','destroy','basename','file','filename','mimetype','download','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','save','update','then','error','stack','name','send','map','Attachment','rawAttributes'];(function(_0x18f8ff,_0x257e95){var _0x18de97=function(_0xc8eb68){while(--_0xc8eb68){_0x18f8ff['push'](_0x18f8ff['shift']());}};_0x18de97(++_0x257e95);}(_0x9fb0,0x1dd));var _0x09fb=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x9fb0[_0x5f0089];return _0x193892;};'use strict';var emlformat=require(_0x09fb('0x0'));var rimraf=require(_0x09fb('0x1'));var zipdir=require(_0x09fb('0x2'));var jsonpatch=require(_0x09fb('0x3'));var rp=require('request-promise');var moment=require(_0x09fb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x09fb('0x5'));var util=require('util');var path=require(_0x09fb('0x6'));var sox=require(_0x09fb('0x7'));var csv=require('to-csv');var ejs=require(_0x09fb('0x8'));var fs=require('fs');var fs_extra=require(_0x09fb('0x9'));var _=require(_0x09fb('0xa'));var squel=require(_0x09fb('0xb'));var crypto=require(_0x09fb('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x09fb('0xd'));var toCsv=require(_0x09fb('0xe'));var querystring=require(_0x09fb('0xf'));var Papa=require(_0x09fb('0x10'));var Redis=require(_0x09fb('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x09fb('0x12'));var as=require(_0x09fb('0x13'));var hardwareService=require(_0x09fb('0x14'));var logger=require('../../config/logger')(_0x09fb('0x15'));var utils=require('../../config/utils');var config=require(_0x09fb('0x16'));var licenseUtil=require(_0x09fb('0x17'));var db=require(_0x09fb('0x18'))['db'];function respondWithStatusCode(_0x419176,_0x22569f){_0x22569f=_0x22569f||0xcc;return function(_0x530a48){if(_0x530a48){return _0x419176[_0x09fb('0x19')](_0x22569f);}return _0x419176[_0x09fb('0x1a')](_0x22569f)[_0x09fb('0x1b')]();};}function respondWithResult(_0x377287,_0x1adc74){_0x1adc74=_0x1adc74||0xc8;return function(_0x8a8bcf){if(_0x8a8bcf){return _0x377287[_0x09fb('0x1a')](_0x1adc74)[_0x09fb('0x1c')](_0x8a8bcf);}};}function respondWithFilteredResult(_0x583e69,_0x470182){return function(_0x1cebc4){if(_0x1cebc4){var _0x57d362=typeof _0x470182['offset']==='undefined'&&typeof _0x470182[_0x09fb('0x1d')]===_0x09fb('0x1e');var _0x4752f6=_0x1cebc4[_0x09fb('0x1f')];var _0x26cf1f=_0x57d362?0x0:_0x470182[_0x09fb('0x20')];var _0x1c7657=_0x57d362?_0x1cebc4[_0x09fb('0x1f')]:_0x470182[_0x09fb('0x20')]+_0x470182['limit'];var _0x2e4675;if(_0x1c7657>=_0x4752f6){_0x1c7657=_0x4752f6;_0x2e4675=0xc8;}else{_0x2e4675=0xce;}_0x583e69[_0x09fb('0x1a')](_0x2e4675);return _0x583e69[_0x09fb('0x21')](_0x09fb('0x22'),_0x26cf1f+'-'+_0x1c7657+'/'+_0x4752f6)[_0x09fb('0x1c')](_0x1cebc4);}return null;};}function patchUpdates(_0x439536){return function(_0x41920f){try{jsonpatch['apply'](_0x41920f,_0x439536,!![]);}catch(_0x4a1f7d){return BPromise['reject'](_0x4a1f7d);}return _0x41920f[_0x09fb('0x23')]();};}function saveUpdates(_0x25f8a4,_0x3f3757){return function(_0x16e812){if(_0x16e812){return _0x16e812[_0x09fb('0x24')](_0x25f8a4)[_0x09fb('0x25')](function(_0x721ecb){return _0x721ecb;});}return null;};}function removeEntity(_0x488eb0,_0x57ce77){return function(_0x2671b1){if(_0x2671b1){return _0x2671b1['destroy']()[_0x09fb('0x25')](function(){_0x488eb0['status'](0xcc)[_0x09fb('0x1b')]();});}};}function handleEntityNotFound(_0x42e590,_0x3b1e72){return function(_0x1dfa7d){if(!_0x1dfa7d){_0x42e590[_0x09fb('0x19')](0x194);}return _0x1dfa7d;};}function handleError(_0x41cfc8,_0x57861a){_0x57861a=_0x57861a||0x1f4;return function(_0xe8928a){logger[_0x09fb('0x26')](_0xe8928a[_0x09fb('0x27')]);if(_0xe8928a[_0x09fb('0x28')]){delete _0xe8928a[_0x09fb('0x28')];}_0x41cfc8[_0x09fb('0x1a')](_0x57861a)[_0x09fb('0x29')](_0xe8928a);};}exports['index']=function(_0x23119b,_0x50cbea){var _0x5f5ec={},_0x1e797c={},_0x4445cb={'count':0x0,'rows':[]};var _0x375c0d=_[_0x09fb('0x2a')](db[_0x09fb('0x2b')][_0x09fb('0x2c')],function(_0x16cc38){return{'name':_0x16cc38[_0x09fb('0x2d')],'type':_0x16cc38[_0x09fb('0x2e')][_0x09fb('0x2f')]};});_0x1e797c[_0x09fb('0x30')]=_[_0x09fb('0x2a')](_0x375c0d,_0x09fb('0x28'));_0x1e797c[_0x09fb('0x31')]=_['keys'](_0x23119b[_0x09fb('0x31')]);_0x1e797c[_0x09fb('0x32')]=_[_0x09fb('0x33')](_0x1e797c[_0x09fb('0x30')],_0x1e797c[_0x09fb('0x31')]);_0x5f5ec[_0x09fb('0x34')]=_[_0x09fb('0x33')](_0x1e797c[_0x09fb('0x30')],qs[_0x09fb('0x35')](_0x23119b['query'][_0x09fb('0x35')]));_0x5f5ec[_0x09fb('0x34')]=_0x5f5ec[_0x09fb('0x34')][_0x09fb('0x36')]?_0x5f5ec[_0x09fb('0x34')]:_0x1e797c[_0x09fb('0x30')];if(!_0x23119b[_0x09fb('0x31')][_0x09fb('0x37')](_0x09fb('0x38'))){_0x5f5ec[_0x09fb('0x1d')]=qs[_0x09fb('0x1d')](_0x23119b['query'][_0x09fb('0x1d')]);_0x5f5ec[_0x09fb('0x20')]=qs[_0x09fb('0x20')](_0x23119b[_0x09fb('0x31')][_0x09fb('0x20')]);}_0x5f5ec['order']=qs[_0x09fb('0x39')](_0x23119b[_0x09fb('0x31')][_0x09fb('0x39')]);_0x5f5ec[_0x09fb('0x3a')]=qs[_0x09fb('0x32')](_['pick'](_0x23119b[_0x09fb('0x31')],_0x1e797c[_0x09fb('0x32')]),_0x375c0d);if(_0x23119b[_0x09fb('0x31')][_0x09fb('0x3b')]){_0x5f5ec[_0x09fb('0x3a')]=_[_0x09fb('0x3c')](_0x5f5ec[_0x09fb('0x3a')],{'$or':_[_0x09fb('0x2a')](_0x375c0d,function(_0x14628f){if(_0x14628f[_0x09fb('0x2e')]!=='VIRTUAL'){var _0x59bb4f={};_0x59bb4f[_0x14628f[_0x09fb('0x28')]]={'$like':'%'+_0x23119b[_0x09fb('0x31')]['filter']+'%'};return _0x59bb4f;}})});}_0x5f5ec=_[_0x09fb('0x3c')]({},_0x5f5ec,_0x23119b[_0x09fb('0x3d')]);var _0x5d9659={'where':_0x5f5ec[_0x09fb('0x3a')]};return db[_0x09fb('0x2b')][_0x09fb('0x1f')](_0x5d9659)['then'](function(_0x28a108){_0x4445cb[_0x09fb('0x1f')]=_0x28a108;if(_0x23119b[_0x09fb('0x31')][_0x09fb('0x3e')]){_0x5f5ec[_0x09fb('0x3f')]=[{'all':!![]}];}return db[_0x09fb('0x2b')][_0x09fb('0x40')](_0x5f5ec);})['then'](function(_0x37b1a2){_0x4445cb[_0x09fb('0x41')]=_0x37b1a2;return _0x4445cb;})['then'](respondWithFilteredResult(_0x50cbea,_0x5f5ec))[_0x09fb('0x42')](handleError(_0x50cbea,null));};exports[_0x09fb('0x43')]=function(_0x222cb9,_0x3ea311){var _0x4eca5c={'raw':!![],'where':{'id':_0x222cb9[_0x09fb('0x44')]['id']}},_0x1e90a2={};_0x1e90a2[_0x09fb('0x30')]=_['keys'](db['Attachment'][_0x09fb('0x2c')]);_0x1e90a2[_0x09fb('0x31')]=_[_0x09fb('0x45')](_0x222cb9['query']);_0x1e90a2[_0x09fb('0x32')]=_[_0x09fb('0x33')](_0x1e90a2[_0x09fb('0x30')],_0x1e90a2['query']);_0x4eca5c[_0x09fb('0x34')]=_['intersection'](_0x1e90a2['model'],qs[_0x09fb('0x35')](_0x222cb9[_0x09fb('0x31')][_0x09fb('0x35')]));_0x4eca5c[_0x09fb('0x34')]=_0x4eca5c[_0x09fb('0x34')][_0x09fb('0x36')]?_0x4eca5c['attributes']:_0x1e90a2['model'];if(_0x222cb9[_0x09fb('0x31')][_0x09fb('0x3e')]){_0x4eca5c[_0x09fb('0x3f')]=[{'all':!![]}];}_0x4eca5c=_[_0x09fb('0x3c')]({},_0x4eca5c,_0x222cb9[_0x09fb('0x3d')]);return db[_0x09fb('0x2b')]['find'](_0x4eca5c)[_0x09fb('0x25')](handleEntityNotFound(_0x3ea311,null))[_0x09fb('0x25')](respondWithResult(_0x3ea311,null))[_0x09fb('0x42')](handleError(_0x3ea311,null));};exports['clone']=function(_0x552969,_0x1ab5cb){var _0xc83c9b={'where':{'id':_0x552969[_0x09fb('0x44')]['id']}},_0x2d72e5={};_0x2d72e5[_0x09fb('0x30')]=_[_0x09fb('0x45')](db[_0x09fb('0x2b')][_0x09fb('0x2c')]);_0xc83c9b[_0x09fb('0x34')]=_[_0x09fb('0x33')](_0x2d72e5[_0x09fb('0x30')],qs[_0x09fb('0x35')](_0x552969[_0x09fb('0x31')][_0x09fb('0x35')]));_0xc83c9b[_0x09fb('0x34')]=_0xc83c9b['attributes'][_0x09fb('0x36')]?_0xc83c9b[_0x09fb('0x34')]:_0x2d72e5[_0x09fb('0x30')];if(_0x552969[_0x09fb('0x31')][_0x09fb('0x3e')]){_0xc83c9b[_0x09fb('0x3f')]=[{'all':!![]}];}_0xc83c9b=_[_0x09fb('0x3c')]({},_0xc83c9b,_0x552969['options']);return db['Attachment'][_0x09fb('0x46')](_0xc83c9b)[_0x09fb('0x25')](handleEntityNotFound(_0x1ab5cb,null))[_0x09fb('0x25')](function(_0x3e3e9a){if(_0x3e3e9a){var _0x3f5370=_0x3e3e9a[_0x09fb('0x47')]({'plain':!![]});_0x3f5370=qs[_0x09fb('0x48')](_0x3f5370,['id',_0x09fb('0x49'),'updatedAt']);_0x552969[_0x09fb('0x4a')]=_[_0x09fb('0x48')](_0x552969[_0x09fb('0x4a')],['id',_0x09fb('0x49'),'updatedAt']);return db[_0x09fb('0x2b')][_0x09fb('0x4b')](_[_0x09fb('0x3c')](_0x3f5370,_0x552969[_0x09fb('0x4a')]),{'include':_0x552969[_0x09fb('0x31')][_0x09fb('0x3e')]?[{'all':!![]}]:undefined});}})[_0x09fb('0x25')](respondWithResult(_0x1ab5cb,0xc9))[_0x09fb('0x42')](handleError(_0x1ab5cb,null));};exports[_0x09fb('0x24')]=function(_0x337602,_0x41ed5a){if(_0x337602[_0x09fb('0x4a')]['id']){delete _0x337602[_0x09fb('0x4a')]['id'];}return db[_0x09fb('0x2b')][_0x09fb('0x46')]({'where':{'id':_0x337602[_0x09fb('0x44')]['id']}})['then'](handleEntityNotFound(_0x41ed5a,null))[_0x09fb('0x25')](saveUpdates(_0x337602[_0x09fb('0x4a')],null))[_0x09fb('0x25')](respondWithResult(_0x41ed5a,null))[_0x09fb('0x42')](handleError(_0x41ed5a,null));};exports[_0x09fb('0x4c')]=function(_0x9f686f,_0x476b2f){return db[_0x09fb('0x2b')][_0x09fb('0x46')]({'where':{'id':_0x9f686f[_0x09fb('0x44')]['id']}})['then'](handleEntityNotFound(_0x476b2f,null))[_0x09fb('0x25')](removeEntity(_0x476b2f,null))[_0x09fb('0x42')](handleError(_0x476b2f,null));};exports[_0x09fb('0x4b')]=function(_0x475e88,_0x2d138c,_0x1d0b6c){_0x475e88[_0x09fb('0x4a')][_0x09fb('0x28')]=_0x475e88['file']['originalname'];_0x475e88[_0x09fb('0x4a')][_0x09fb('0x4d')]=_0x475e88[_0x09fb('0x4e')][_0x09fb('0x4f')];_0x475e88[_0x09fb('0x4a')][_0x09fb('0x2e')]=_0x475e88[_0x09fb('0x4e')][_0x09fb('0x50')];return db[_0x09fb('0x2b')][_0x09fb('0x4b')](_0x475e88['body'])[_0x09fb('0x25')](respondWithResult(_0x2d138c,0xc9))[_0x09fb('0x42')](handleError(_0x2d138c,null));};exports[_0x09fb('0x51')]=function(_0x4ee1f8,_0x572949,_0x5a2477){return db[_0x09fb('0x2b')]['findOne']({'where':{'id':_0x4ee1f8[_0x09fb('0x44')]['id']},'raw':!![]})[_0x09fb('0x25')](handleEntityNotFound(_0x572949,null))['then'](function(_0x10e382){if(_0x10e382){var _0x4e1259=_0x10e382[_0x09fb('0x52')]!==null;var _0x3a5010=path[_0x09fb('0x53')](config[_0x09fb('0x54')],_0x09fb('0x55'));if(_0x4e1259){_0x3a5010=path[_0x09fb('0x53')](_0x3a5010,_0x09fb('0x56'));}var _0x5ce674=path['join'](_0x3a5010,_0x10e382[_0x09fb('0x4d')]);return _0x572949['download'](_0x5ce674);}})[_0x09fb('0x42')](handleError(_0x572949,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 3b3262d..daaada8 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 _0xa583=['attachments','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./attachment.attributes','exports','define'];(function(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0xa583,0x1b9));var _0x3a58=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xa583[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x3a58('0x0'));var util=require(_0x3a58('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3a58('0x2'));var BPromise=require(_0x3a58('0x3'));var rp=require(_0x3a58('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3a58('0x5'));var config=require(_0x3a58('0x6'));var attributes=require(_0x3a58('0x7'));module[_0x3a58('0x8')]=function(_0x3ee687,_0x4ae87d){return _0x3ee687[_0x3a58('0x9')]('Attachment',attributes,{'tableName':_0x3a58('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xebd3=['attachments','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment'];(function(_0x451df9,_0x5e6047){var _0x59da59=function(_0x42bcd8){while(--_0x42bcd8){_0x451df9['push'](_0x451df9['shift']());}};_0x59da59(++_0x5e6047);}(_0xebd3,0x10f));var _0x3ebd=function(_0x53f964,_0x3b52b8){_0x53f964=_0x53f964-0x0;var _0x17be6c=_0xebd3[_0x53f964];return _0x17be6c;};'use strict';var _=require(_0x3ebd('0x0'));var util=require(_0x3ebd('0x1'));var logger=require(_0x3ebd('0x2'))(_0x3ebd('0x3'));var moment=require(_0x3ebd('0x4'));var BPromise=require(_0x3ebd('0x5'));var rp=require(_0x3ebd('0x6'));var fs=require('fs');var path=require(_0x3ebd('0x7'));var rimraf=require(_0x3ebd('0x8'));var config=require(_0x3ebd('0x9'));var attributes=require(_0x3ebd('0xa'));module[_0x3ebd('0xb')]=function(_0xa768c7,_0x22a69f){return _0xa768c7[_0x3ebd('0xc')](_0x3ebd('0xd'),attributes,{'tableName':_0x3ebd('0xe'),'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 65e59d0..eb2aa0b 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 _0x1339=['request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Attachment','create','options','raw','debug','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x3a802d,_0x119cfc){var _0x2fd218=function(_0x46bb78){while(--_0x46bb78){_0x3a802d['push'](_0x3a802d['shift']());}};_0x2fd218(++_0x119cfc);}(_0x1339,0x1ed));var _0x9133=function(_0x4e3d96,_0x496a94){_0x4e3d96=_0x4e3d96-0x0;var _0x45a34e=_0x1339[_0x4e3d96];return _0x45a34e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9133('0x0'));var BPromise=require(_0x9133('0x1'));var rs=require(_0x9133('0x2'));var fs=require('fs');var Redis=require(_0x9133('0x3'));var db=require(_0x9133('0x4'))['db'];var utils=require(_0x9133('0x5'));var logger=require(_0x9133('0x6'))(_0x9133('0x7'));var config=require('../../config/environment');var jayson=require(_0x9133('0x8'));var client=jayson[_0x9133('0x9')][_0x9133('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x539af6,_0x2758e2,_0x334dcd){return new BPromise(function(_0x3059c4,_0x431a55){return client[_0x9133('0xb')](_0x539af6,_0x334dcd)[_0x9133('0xc')](function(_0x4294b7){logger[_0x9133('0xd')](_0x9133('0xe'),_0x2758e2,_0x9133('0xf'));logger['debug'](_0x9133('0x10'),_0x2758e2,_0x9133('0xf'),JSON[_0x9133('0x11')](_0x4294b7));if(_0x4294b7[_0x9133('0x12')]){if(_0x4294b7[_0x9133('0x12')][_0x9133('0x13')]===0x1f4){logger['error'](_0x9133('0xe'),_0x2758e2,_0x4294b7[_0x9133('0x12')]['message']);return _0x431a55(_0x4294b7['error'][_0x9133('0x14')]);}logger['error'](_0x9133('0xe'),_0x2758e2,_0x4294b7[_0x9133('0x12')][_0x9133('0x14')]);return _0x3059c4(_0x4294b7[_0x9133('0x12')][_0x9133('0x14')]);}else{logger[_0x9133('0xd')]('Attachment,\x20%s,\x20%s',_0x2758e2,_0x9133('0xf'));_0x3059c4(_0x4294b7[_0x9133('0x15')]['message']);}})[_0x9133('0x16')](function(_0xa46eb1){logger[_0x9133('0x12')](_0x9133('0xe'),_0x2758e2,_0xa46eb1);_0x431a55(_0xa46eb1);});});}exports['CreateAttachment']=function(_0x1f3484){var _0x573998=this;return new Promise(function(_0x3c48ef,_0x5d4a77){return db[_0x9133('0x17')][_0x9133('0x18')](_0x1f3484['body'],{'raw':_0x1f3484[_0x9133('0x19')]?_0x1f3484['options'][_0x9133('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x5e4f0c){logger[_0x9133('0xd')]('CreateAttachment',_0x1f3484);logger[_0x9133('0x1b')]('CreateAttachment',_0x1f3484,JSON['stringify'](_0x5e4f0c));_0x3c48ef(_0x5e4f0c);})['catch'](function(_0x2e99a1){logger[_0x9133('0x12')]('CreateAttachment',_0x2e99a1[_0x9133('0x14')],_0x1f3484);_0x5d4a77(_0x573998[_0x9133('0x12')](0x1f4,_0x2e99a1[_0x9133('0x14')]));});});};
\ No newline at end of file
+var _0xd87e=['request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateAttachment','Attachment','create','body','options','raw','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','then','info','Attachment,\x20%s,\x20%s'];(function(_0x42cde2,_0x13f233){var _0x15c4b6=function(_0x1a3628){while(--_0x1a3628){_0x42cde2['push'](_0x42cde2['shift']());}};_0x15c4b6(++_0x13f233);}(_0xd87e,0x1bf));var _0xed87=function(_0x3b45e8,_0x628af6){_0x3b45e8=_0x3b45e8-0x0;var _0x370099=_0xd87e[_0x3b45e8];return _0x370099;};'use strict';var _=require(_0xed87('0x0'));var util=require(_0xed87('0x1'));var moment=require('moment');var BPromise=require(_0xed87('0x2'));var rs=require(_0xed87('0x3'));var fs=require('fs');var Redis=require(_0xed87('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xed87('0x5'));var logger=require('../../config/logger')(_0xed87('0x6'));var config=require(_0xed87('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xed87('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5da793,_0xa33c67,_0x42fef6){return new BPromise(function(_0x33e1c1,_0x2f348a){return client['request'](_0x5da793,_0x42fef6)[_0xed87('0x9')](function(_0x3dce4b){logger[_0xed87('0xa')](_0xed87('0xb'),_0xa33c67,_0xed87('0xc'));logger[_0xed87('0xd')](_0xed87('0xe'),_0xa33c67,'request\x20sent',JSON[_0xed87('0xf')](_0x3dce4b));if(_0x3dce4b[_0xed87('0x10')]){if(_0x3dce4b['error'][_0xed87('0x11')]===0x1f4){logger[_0xed87('0x10')]('Attachment,\x20%s,\x20%s',_0xa33c67,_0x3dce4b['error'][_0xed87('0x12')]);return _0x2f348a(_0x3dce4b[_0xed87('0x10')][_0xed87('0x12')]);}logger[_0xed87('0x10')](_0xed87('0xb'),_0xa33c67,_0x3dce4b[_0xed87('0x10')]['message']);return _0x33e1c1(_0x3dce4b[_0xed87('0x10')][_0xed87('0x12')]);}else{logger[_0xed87('0xa')](_0xed87('0xb'),_0xa33c67,_0xed87('0xc'));_0x33e1c1(_0x3dce4b[_0xed87('0x13')][_0xed87('0x12')]);}})[_0xed87('0x14')](function(_0x385859){logger['error'](_0xed87('0xb'),_0xa33c67,_0x385859);_0x2f348a(_0x385859);});});}exports[_0xed87('0x15')]=function(_0x2c386a){var _0xfb8a44=this;return new Promise(function(_0x5f4076,_0x211085){return db[_0xed87('0x16')][_0xed87('0x17')](_0x2c386a[_0xed87('0x18')],{'raw':_0x2c386a[_0xed87('0x19')]?_0x2c386a[_0xed87('0x19')][_0xed87('0x1a')]===undefined?!![]:![]:!![]})[_0xed87('0x9')](function(_0x3b7981){logger['info']('CreateAttachment',_0x2c386a);logger['debug']('CreateAttachment',_0x2c386a,JSON[_0xed87('0xf')](_0x3b7981));_0x5f4076(_0x3b7981);})['catch'](function(_0x4191a7){logger[_0xed87('0x10')]('CreateAttachment',_0x4191a7[_0xed87('0x12')],_0x2c386a);_0x211085(_0xfb8a44['error'](0x1f4,_0x4191a7[_0xed87('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 1b5bb60..7017d93 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(_0x35dee6,_0xe07081){var _0x38532a=function(_0x3784a6){while(--_0x3784a6){_0x35dee6['push'](_0x35dee6['shift']());}};_0x38532a(++_0xe07081);}(_0x5f2f,0x73));var _0xf5f2=function(_0x37e97a,_0x2be2c3){_0x37e97a=_0x37e97a-0x0;var _0x436f7e=_0x5f2f[_0x37e97a];return _0x436f7e;};'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 _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(_0x1621f8,_0x5d4d97){var _0xda6552=function(_0x550d95){while(--_0x550d95){_0x1621f8['push'](_0x1621f8['shift']());}};_0xda6552(++_0x5d4d97);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4dae3e,_0x343290){_0x4dae3e=_0x4dae3e-0x0;var _0x464847=_0x5f2f[_0x4dae3e];return _0x464847;};'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
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index ed22bf9..1a365b1 100644
--- a/server/api/authActiveDirectory/authActiveDirectory.controller.js
+++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x392a=['then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','password','salt','blocked','online','user','name','blockedAt','add','clearBlockUser','catch','status','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','User','passport','Strategy','moment','activedirectory2','bluebird','util','../../components/auth/service','../../config/environment','../../config/logger','activedirectory','undefined','baseDN','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','adSsoEnabled','blockDuration'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x392a,0x11d));var _0xa392=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x392a[_0x57b54c];return _0x59cc19;};'use strict';var passport=require(_0xa392('0x0'));var LocalStrategy=require('passport-local')[_0xa392('0x1')];var moment=require(_0xa392('0x2'));var ActiveDirectory=require(_0xa392('0x3'));var BPromise=require(_0xa392('0x4'));var util=require(_0xa392('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0xa392('0x6'));var utils=require('../../config/utils');var config=require(_0xa392('0x7'));var logger=require(_0xa392('0x8'))('api');function isActiveDirectoryConfigured(_0x271ac9){var _0x4c6668=![];if(typeof _0x271ac9[_0xa392('0x9')]!==_0xa392('0xa')){_0x4c6668=_0x271ac9[_0xa392('0x9')][_0xa392('0xb')]&&_0x271ac9[_0xa392('0x9')][_0xa392('0xc')]&&_0x271ac9[_0xa392('0x9')][_0xa392('0xd')];}return _0x4c6668;}function adAuthenticate(_0x3b753d,_0x1aa5e0,_0x47ec89){return new BPromise(function(_0x4bb261,_0x45051d){try{var _0x4c3c87=new ActiveDirectory(_0x3b753d);_0x4c3c87[_0xa392('0xe')](_0x1aa5e0,_0x47ec89,function(_0x1ba9c3,_0x3929d9){if(_0x1ba9c3){logger[_0xa392('0xf')](_0xa392('0x10'),_0x1aa5e0,util[_0xa392('0x11')](_0x1ba9c3,{'showHidden':![],'depth':null}));_0x45051d(_0xa392('0x12'));}else if(!_0x3929d9){logger['error']('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x1aa5e0);_0x45051d(_0xa392('0x12'));}else{_0x4bb261(_0x3929d9);}});}catch(_0x59052b){_0x45051d(_0x59052b);}});}function ActiveDirectoryAuthenticate(_0x211bf3,_0x554d07,_0xf8b296,_0x2b1c2c){var _0x1bf672,_0x1c5c20;if(!isActiveDirectoryConfigured(config)){logger[_0xa392('0xf')](_0xa392('0x13'),_0x554d07);return _0x2b1c2c(null,![],{'message':_0xa392('0x12')});}return db[_0xa392('0x14')]['findOne']({'where':{'id':0x1},'attributes':[_0xa392('0x15'),_0xa392('0x16')],'raw':!![]})[_0xa392('0x17')](function(_0x1a4495){_0x1bf672=_0x1a4495;if(!_0x1bf672[_0xa392('0x15')]){logger[_0xa392('0xf')](_0xa392('0x18'),_0x554d07);throw new Error(_0xa392('0x12'));}return _0x211bf3['findOne']({'attributes':['id','name',_0xa392('0x19'),_0xa392('0x1a'),'role','disabled',_0xa392('0x1b'),'blockedAt',_0xa392('0x1c')],'where':{'name':_0x554d07,'role':{'$or':['admin',_0xa392('0x1d'),'agent']},'adSsoEnabled':!![]}});})[_0xa392('0x17')](function(_0x40d2d6){if(!_0x40d2d6||_0x40d2d6&&_0x40d2d6[_0xa392('0x1e')]!==_0x554d07){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x1c5c20=_0x40d2d6;var _0x5e225a=_0x1c5c20[_0xa392('0x1e')]+'@'+config[_0xa392('0x9')][_0xa392('0xd')];return adAuthenticate(config[_0xa392('0x9')],_0x5e225a,_0xf8b296);})[_0xa392('0x17')](function(_0x4a64d8){if(_0x1c5c20['disabled']){throw new Error(_0xa392('0x12'));}if(_0x1bf672[_0xa392('0x16')]>0x0){if(_0x1c5c20[_0xa392('0x1b')]){if(moment(_0x1c5c20[_0xa392('0x1f')])[_0xa392('0x20')](_0x1bf672[_0xa392('0x16')],'minutes')>moment()){throw new Error(_0xa392('0x12'));}return utils[_0xa392('0x21')](_0x1c5c20,0x0,![],null)[_0xa392('0x17')](function(){return utils['getLicense'](_0x1c5c20);})['then'](function(){return _0x2b1c2c(null,_0x1c5c20);});}else{return utils['getLicense'](_0x1c5c20)[_0xa392('0x17')](function(){return _0x2b1c2c(null,_0x1c5c20);});}}else{return utils['getLicense'](_0x1c5c20)[_0xa392('0x17')](function(){return _0x2b1c2c(null,_0x1c5c20);});}})[_0xa392('0x22')](function(_0x5d94ec){return _0x2b1c2c(null,![],_0x5d94ec);});}function handleError(_0x5ee5a4,_0x371c97,_0x4b7d76){return _0x5ee5a4[_0xa392('0x23')](_0x371c97||0x1f4)[_0xa392('0x24')]({'message':_0x4b7d76?_0x4b7d76[_0xa392('0x25')]||_0x4b7d76:''});}exports[_0xa392('0x26')]=function(_0x45a139,_0x1d8c61,_0x1293d4){passport[_0xa392('0xe')](_0xa392('0x27'),function(_0x59f398,_0x169e14,_0x2d1d8d){var _0x23a0ad=_0x59f398||_0x2d1d8d;if(_0x23a0ad){return handleError(_0x1d8c61,0x191,_0x23a0ad);}if(!_0x169e14){return handleError(_0x1d8c61,0x194,{'message':_0xa392('0x28')});}else{var _0x5127ba={'payload':{'id':_0x169e14['id'],'role':_0x169e14['role']},'options':{'expiresIn':0x15180}};return authService[_0xa392('0x29')](_0x5127ba)[_0xa392('0x17')](function(_0x4958fb){_0x1d8c61[_0xa392('0x2a')]({'id':_0x169e14['id'],'token':_0x4958fb,'statusCall':'','isAlreadyLogged':_0x169e14[_0xa392('0x1c')]});});}})(_0x45a139,_0x1d8c61,_0x1293d4);};passport['use'](_0xa392('0x27'),new LocalStrategy({'usernameField':_0xa392('0x1e'),'passwordField':'password'},function(_0x2f8fc7,_0xee7a4e,_0x2e9284){return ActiveDirectoryAuthenticate(db[_0xa392('0x2b')],_0x2f8fc7,_0xee7a4e,_0x2e9284);}));
\ No newline at end of file
+var _0x8f18=['Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','disabled','blockedAt','online','admin','user','add','minutes','getLicense','catch','status','send','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','use','User','passport','passport-local','activedirectory2','bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','api','activedirectory','undefined','baseDN','domain','authenticate','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','error'];(function(_0x30fb4f,_0x2e4430){var _0x4ff8c8=function(_0x4a2b9a){while(--_0x4a2b9a){_0x30fb4f['push'](_0x30fb4f['shift']());}};_0x4ff8c8(++_0x2e4430);}(_0x8f18,0x108));var _0x88f1=function(_0x28fd98,_0xc2597b){_0x28fd98=_0x28fd98-0x0;var _0x2dcb8e=_0x8f18[_0x28fd98];return _0x2dcb8e;};'use strict';var passport=require(_0x88f1('0x0'));var LocalStrategy=require(_0x88f1('0x1'))['Strategy'];var moment=require('moment');var ActiveDirectory=require(_0x88f1('0x2'));var BPromise=require(_0x88f1('0x3'));var util=require('util');var db=require(_0x88f1('0x4'))['db'];var authService=require(_0x88f1('0x5'));var utils=require(_0x88f1('0x6'));var config=require(_0x88f1('0x7'));var logger=require('../../config/logger')(_0x88f1('0x8'));function isActiveDirectoryConfigured(_0x4fc7df){var _0x10e421=![];if(typeof _0x4fc7df[_0x88f1('0x9')]!==_0x88f1('0xa')){_0x10e421=_0x4fc7df[_0x88f1('0x9')][_0x88f1('0xb')]&&_0x4fc7df[_0x88f1('0x9')]['url']&&_0x4fc7df[_0x88f1('0x9')][_0x88f1('0xc')];}return _0x10e421;}function adAuthenticate(_0x428129,_0x8295b0,_0x1ec829){return new BPromise(function(_0x16e857,_0x401f31){try{var _0x3aa48e=new ActiveDirectory(_0x428129);_0x3aa48e[_0x88f1('0xd')](_0x8295b0,_0x1ec829,function(_0x1b4c87,_0x35dc22){if(_0x1b4c87){logger['error'](_0x88f1('0xe'),_0x8295b0,util[_0x88f1('0xf')](_0x1b4c87,{'showHidden':![],'depth':null}));_0x401f31(_0x88f1('0x10'));}else if(!_0x35dc22){logger[_0x88f1('0x11')](_0x88f1('0x12'),_0x8295b0);_0x401f31(_0x88f1('0x10'));}else{_0x16e857(_0x35dc22);}});}catch(_0x466a70){_0x401f31(_0x466a70);}});}function ActiveDirectoryAuthenticate(_0x181acd,_0x440408,_0x34d1cc,_0x59ebb1){var _0x155369,_0x525615;if(!isActiveDirectoryConfigured(config)){logger[_0x88f1('0x11')](_0x88f1('0x13'),_0x440408);return _0x59ebb1(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x88f1('0x14')][_0x88f1('0x15')]({'where':{'id':0x1},'attributes':[_0x88f1('0x16'),_0x88f1('0x17')],'raw':!![]})[_0x88f1('0x18')](function(_0x492dda){_0x155369=_0x492dda;if(!_0x155369[_0x88f1('0x16')]){logger[_0x88f1('0x11')](_0x88f1('0x19'),_0x440408);throw new Error(_0x88f1('0x10'));}return _0x181acd[_0x88f1('0x15')]({'attributes':['id',_0x88f1('0x1a'),_0x88f1('0x1b'),_0x88f1('0x1c'),_0x88f1('0x1d'),_0x88f1('0x1e'),'blocked',_0x88f1('0x1f'),_0x88f1('0x20')],'where':{'name':_0x440408,'role':{'$or':[_0x88f1('0x21'),_0x88f1('0x22'),'agent']},'adSsoEnabled':!![]}});})[_0x88f1('0x18')](function(_0x358183){if(!_0x358183||_0x358183&&_0x358183[_0x88f1('0x1a')]!==_0x440408){throw new Error(_0x88f1('0x10'));}_0x525615=_0x358183;var _0x4a6bf8=_0x525615[_0x88f1('0x1a')]+'@'+config['activedirectory'][_0x88f1('0xc')];return adAuthenticate(config['activedirectory'],_0x4a6bf8,_0x34d1cc);})['then'](function(_0x39ec2d){if(_0x525615[_0x88f1('0x1e')]){throw new Error(_0x88f1('0x10'));}if(_0x155369[_0x88f1('0x17')]>0x0){if(_0x525615['blocked']){if(moment(_0x525615[_0x88f1('0x1f')])[_0x88f1('0x23')](_0x155369[_0x88f1('0x17')],_0x88f1('0x24'))>moment()){throw new Error(_0x88f1('0x10'));}return utils['clearBlockUser'](_0x525615,0x0,![],null)['then'](function(){return utils[_0x88f1('0x25')](_0x525615);})[_0x88f1('0x18')](function(){return _0x59ebb1(null,_0x525615);});}else{return utils[_0x88f1('0x25')](_0x525615)[_0x88f1('0x18')](function(){return _0x59ebb1(null,_0x525615);});}}else{return utils['getLicense'](_0x525615)[_0x88f1('0x18')](function(){return _0x59ebb1(null,_0x525615);});}})[_0x88f1('0x26')](function(_0x218a97){return _0x59ebb1(null,![],_0x218a97);});}function handleError(_0x3ff0fd,_0x484fc6,_0x2f5dc2){return _0x3ff0fd[_0x88f1('0x27')](_0x484fc6||0x1f4)[_0x88f1('0x28')]({'message':_0x2f5dc2?_0x2f5dc2['message']||_0x2f5dc2:''});}exports[_0x88f1('0x29')]=function(_0x57c98a,_0x4ad56c,_0x29a7d5){passport['authenticate'](_0x88f1('0x2a'),function(_0x5c21ab,_0x34490c,_0x11241c){var _0x502b07=_0x5c21ab||_0x11241c;if(_0x502b07){return handleError(_0x4ad56c,0x191,_0x502b07);}if(!_0x34490c){return handleError(_0x4ad56c,0x194,{'message':_0x88f1('0x2b')});}else{var _0xeb6c40={'payload':{'id':_0x34490c['id'],'role':_0x34490c[_0x88f1('0x1d')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0xeb6c40)['then'](function(_0x5c7fe8){_0x4ad56c[_0x88f1('0x2c')]({'id':_0x34490c['id'],'token':_0x5c7fe8,'statusCall':'','isAlreadyLogged':_0x34490c[_0x88f1('0x20')]});});}})(_0x57c98a,_0x4ad56c,_0x29a7d5);};passport[_0x88f1('0x2d')](_0x88f1('0x2a'),new LocalStrategy({'usernameField':_0x88f1('0x1a'),'passwordField':_0x88f1('0x1b')},function(_0x146e92,_0xf45a9b,_0xaf3a5c){return ActiveDirectoryAuthenticate(db[_0x88f1('0x2e')],_0x146e92,_0xf45a9b,_0xaf3a5c);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index f3b6866..b654bff 100644
--- a/server/api/authActiveDirectory/index.js
+++ b/server/api/authActiveDirectory/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8f41=['exports','./authActiveDirectory.controller','post'];(function(_0x1dc634,_0x7f73e3){var _0x40b4dc=function(_0x533fc3){while(--_0x533fc3){_0x1dc634['push'](_0x1dc634['shift']());}};_0x40b4dc(++_0x7f73e3);}(_0x8f41,0xb8));var _0x18f4=function(_0x9b74c5,_0x468f39){_0x9b74c5=_0x9b74c5-0x0;var _0x4a734c=_0x8f41[_0x9b74c5];return _0x4a734c;};'use strict';var express=require('express');var router=express['Router']();var controller=require(_0x18f4('0x0'));router[_0x18f4('0x1')]('/',controller['login']);module[_0x18f4('0x2')]=router;
\ No newline at end of file
+var _0x5f7d=['post','login','express','Router','./authActiveDirectory.controller'];(function(_0x18c944,_0x4fbff2){var _0x472f3f=function(_0x38b93e){while(--_0x38b93e){_0x18c944['push'](_0x18c944['shift']());}};_0x472f3f(++_0x4fbff2);}(_0x5f7d,0xbb));var _0xd5f7=function(_0x2b6948,_0x548400){_0x2b6948=_0x2b6948-0x0;var _0x1fe750=_0x5f7d[_0x2b6948];return _0x1fe750;};'use strict';var express=require(_0xd5f7('0x0'));var router=express[_0xd5f7('0x1')]();var controller=require(_0xd5f7('0x2'));router[_0xd5f7('0x3')]('/',controller[_0xd5f7('0x4')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 684d4ff..d9085f4 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x7a54,0x106));var _0x47a5=function(_0x3c3c81,_0xaf548){_0x3c3c81=_0x3c3c81-0x0;var _0x46edeb=_0x7a54[_0x3c3c81];return _0x46edeb;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
+var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x24f004,_0x40f832){var _0x3f4286=function(_0x478a1a){while(--_0x478a1a){_0x24f004['push'](_0x24f004['shift']());}};_0x3f4286(++_0x40f832);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 0c1503c..b238447 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 _0x0035=['isMiddleware','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','get','/callback','callback'];(function(_0x427217,_0x4039b1){var _0x5b28fb=function(_0x3eaa08){while(--_0x3eaa08){_0x427217['push'](_0x427217['shift']());}};_0x5b28fb(++_0x4039b1);}(_0x0035,0x14d));var _0x5003=function(_0x35e124,_0x1d85e2){_0x35e124=_0x35e124-0x0;var _0x53c482=_0x0035[_0x35e124];return _0x53c482;};'use strict';var express=require(_0x5003('0x0'));var passport=require(_0x5003('0x1'));var router=express[_0x5003('0x2')]();var controller=require(_0x5003('0x3'));var userController=require(_0x5003('0x4'));var authService=require('../../components/auth/service');router['get']('/',controller['login']);router[_0x5003('0x5')](_0x5003('0x6'),controller[_0x5003('0x7')],authService[_0x5003('0x8')],userController['login'],authService[_0x5003('0x9')]);module[_0x5003('0xa')]=router;
\ No newline at end of file
+var _0x170d=['login','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','callback','isMiddleware'];(function(_0x3fa45b,_0x4b0ef3){var _0x251136=function(_0x5bc70a){while(--_0x5bc70a){_0x3fa45b['push'](_0x3fa45b['shift']());}};_0x251136(++_0x4b0ef3);}(_0x170d,0x13b));var _0xd170=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x170d[_0x59ee6f];return _0x4c0979;};'use strict';var express=require(_0xd170('0x0'));var passport=require(_0xd170('0x1'));var router=express[_0xd170('0x2')]();var controller=require(_0xd170('0x3'));var userController=require(_0xd170('0x4'));var authService=require(_0xd170('0x5'));router['get']('/',controller['login']);router[_0xd170('0x6')]('/callback',controller[_0xd170('0x7')],authService[_0xd170('0x8')],userController[_0xd170('0x9')],authService[_0xd170('0xa')]);module[_0xd170('0xb')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 32c0362..464e87e 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 _0x211e=['resetPasswordToken','now','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','resetPasswordExpires','send','use','User','util','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../config/utils','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','password','salt','disabled','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blocked','blockedAt','add','minutes','clearBlockUser','getLicense','catch','find','name','email','MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','format','user','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','login','local-login','role','json','forgot','generate','body','trim','toLowerCase','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.'];(function(_0x241cbc,_0x45da7b){var _0x164300=function(_0x3cba35){while(--_0x3cba35){_0x241cbc['push'](_0x241cbc['shift']());}};_0x164300(++_0x45da7b);}(_0x211e,0x1e6));var _0xe211=function(_0x204562,_0x2efa12){_0x204562=_0x204562-0x0;var _0x17558f=_0x211e[_0x204562];return _0x17558f;};'use strict';var util=require(_0xe211('0x0'));var passport=require('passport');var LocalStrategy=require('passport-local')[_0xe211('0x1')];var jayson=require(_0xe211('0x2'));var _=require(_0xe211('0x3'));var rs=require(_0xe211('0x4'));var moment=require(_0xe211('0x5'));var db=require(_0xe211('0x6'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xe211('0x7'));var client=jayson['client'][_0xe211('0x8')]({'port':0x232b});function localAuthenticate(_0x217bf6,_0x58348d,_0x5e794d,_0x1f7dd9){var _0x3d5c2,_0x315db5;return db[_0xe211('0x9')][_0xe211('0xa')]({'where':{'id':0x1},'attributes':[_0xe211('0xb'),_0xe211('0xc')],'raw':!![]})[_0xe211('0xd')](function(_0x39c4e9){_0x3d5c2=_0x39c4e9;return _0x217bf6[_0xe211('0xa')]({'attributes':['id','name',_0xe211('0xe'),_0xe211('0xf'),'role',_0xe211('0x10'),'blocked','blockedAt','loginAttempts'],'where':{'name':_0x58348d,'role':{'$or':['admin','user',_0xe211('0x11')]}}});})[_0xe211('0xd')](function(_0x1d628f){if(!_0x1d628f||_0x1d628f&&_0x1d628f['name']!==_0x58348d){throw new Error(_0xe211('0x12'));}else{_0x315db5=_0x1d628f;return _0x315db5;}})[_0xe211('0xd')](function(){_0x315db5[_0xe211('0x13')](_0x5e794d,function(_0x5ca944,_0x36f352){var _0x4b7333=_0x315db5['loginAttempts']+0x1;if(_0x5ca944){return _0x1f7dd9(_0x5ca944);}else if(!_0x36f352){if(_0x315db5[_0xe211('0x10')]){return _0x1f7dd9(null,![],{'message':_0xe211('0x12')});}else if(_0x3d5c2[_0xe211('0xb')]>0x0){if(_0x315db5[_0xe211('0x14')]){if(_0x3d5c2[_0xe211('0xc')]>0x0){if(moment(_0x315db5[_0xe211('0x15')])[_0xe211('0x16')](_0x3d5c2[_0xe211('0xc')],_0xe211('0x17'))>moment()){return _0x1f7dd9(null,![],{'message':_0xe211('0x12')});}else{return utils[_0xe211('0x18')](_0x315db5,_0x4b7333,![],null)[_0xe211('0xd')](function(){return _0x1f7dd9(null,![],{'message':_0xe211('0x12')});});}}else{return _0x1f7dd9(null,![],{'message':_0xe211('0x12')});}}else{if(_0x4b7333>=_0x3d5c2[_0xe211('0xb')]){return utils['clearBlockUser'](_0x315db5,0x0,!![],moment())[_0xe211('0xd')](function(){return _0x1f7dd9(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0xe211('0x18')](_0x315db5,_0x4b7333,![],null)[_0xe211('0xd')](function(){return _0x1f7dd9(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x1f7dd9(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x315db5[_0xe211('0x10')]){return _0x1f7dd9(null,![],{'message':_0xe211('0x12')});}else if(_0x3d5c2[_0xe211('0xb')]>0x0){if(_0x315db5[_0xe211('0x14')]){if(_0x3d5c2[_0xe211('0xc')]>0x0){if(moment(_0x315db5['blockedAt'])[_0xe211('0x16')](_0x3d5c2[_0xe211('0xc')],_0xe211('0x17'))>moment()){return _0x1f7dd9(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x315db5,0x0,![],null)[_0xe211('0xd')](function(){return utils[_0xe211('0x19')](_0x315db5);})['then'](function(){return _0x1f7dd9(null,_0x315db5);});}}else{return _0x1f7dd9(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils['clearBlockUser'](_0x315db5,0x0,![],null)[_0xe211('0xd')](function(){return utils[_0xe211('0x19')](_0x315db5);})[_0xe211('0xd')](function(){return _0x1f7dd9(null,_0x315db5);})[_0xe211('0x1a')](function(_0x2abab6){return _0x1f7dd9(null,![],_0x2abab6);});}}else{if(_0x315db5[_0xe211('0x14')]){return _0x1f7dd9(null,![],{'message':_0xe211('0x12')});}else{return utils[_0xe211('0x19')](_0x315db5)[_0xe211('0xd')](function(){return _0x1f7dd9(null,_0x315db5);});}}}});})[_0xe211('0x1a')](function(_0x55b854){return _0x1f7dd9(null,![],_0x55b854);});}function sendServiceMail(_0x56b65f){return db['MailAccount'][_0xe211('0x1b')]({'where':{'service':!![]},'attributes':['id',_0xe211('0x1c'),_0xe211('0x1d')],'include':[{'model':db[_0xe211('0x1e')],'as':'Smtp','include':[{'model':db[_0xe211('0x1f')],'as':'CloudProvider'}]}]})['then'](function(_0x4aec33){if(!_0x4aec33){throw new Error(_0xe211('0x20'));}var _0x3b9f30=_0x4aec33['getSmtpOptions']();var _0x574d41={'account':_0x3b9f30,'message':_[_0xe211('0x21')]({'from':util[_0xe211('0x22')]('\x22%s\x22\x20<%s>',_0x4aec33[_0xe211('0x1c')],_0x4aec33[_0xe211('0x1d')]||_0x4aec33['Smtp'][_0xe211('0x23')])},_0x56b65f)};return client[_0xe211('0x24')](_0xe211('0x25'),_0x574d41);})['then'](function(_0x268adb){if(_0x268adb[_0xe211('0x26')]){throw new Error(util[_0xe211('0x22')](_0xe211('0x27'),_0x268adb['error'][_0xe211('0x28')]||JSON[_0xe211('0x29')](_0x268adb[_0xe211('0x26')])));}return!![];});}function handleError(_0x1cd2dd,_0x2e5f3f,_0x1a1043){return _0x1cd2dd['status'](_0x2e5f3f||0x1f4)['send']({'message':_0x1a1043?_0x1a1043['message']||_0x1a1043:''});}exports[_0xe211('0x2a')]=function(_0x5e852f,_0x6e0d79,_0x22b894){passport[_0xe211('0x13')](_0xe211('0x2b'),function(_0xf3ce21,_0x11960b,_0x2c1c4f){var _0x1d517e=_0xf3ce21||_0x2c1c4f;if(_0x1d517e){return handleError(_0x6e0d79,0x191,_0x1d517e);}if(!_0x11960b){return handleError(_0x6e0d79,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0xdc83d4={'payload':{'id':_0x11960b['id'],'role':_0x11960b[_0xe211('0x2c')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0xdc83d4)[_0xe211('0xd')](function(_0x27b6ea){_0x6e0d79[_0xe211('0x2d')]({'id':_0x11960b['id'],'token':_0x27b6ea,'statusCall':'','isAlreadyLogged':_0x11960b['online']});});}})(_0x5e852f,_0x6e0d79,_0x22b894);};exports[_0xe211('0x2e')]=function(_0x77ad0a,_0x40e26a){if(!_0x77ad0a['body'][_0xe211('0x1d')]){return handleError(_0x40e26a,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x2cdcf0=rs[_0xe211('0x2f')]();_0x77ad0a[_0xe211('0x30')][_0xe211('0x1d')]=_0x77ad0a[_0xe211('0x30')][_0xe211('0x1d')][_0xe211('0x31')]()[_0xe211('0x32')]();var _0x1cdd98;return db[_0xe211('0x9')][_0xe211('0xa')]({'where':{'id':0x1},'attributes':[_0xe211('0xb'),_0xe211('0xc')],'raw':!![]})['then'](function(_0x2bab08){_0x1cdd98=_0x2bab08;return db['User'][_0xe211('0x1b')]({'where':{'email':_0x77ad0a['body'][_0xe211('0x1d')]}});})[_0xe211('0xd')](function(_0x479ec4){if(!_0x479ec4){throw new Error(_0xe211('0x33'));}if(_0x479ec4[_0xe211('0x10')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x479ec4[_0xe211('0x14')]){if(moment(_0x479ec4[_0xe211('0x15')])[_0xe211('0x16')](_0x1cdd98['blockDuration'],_0xe211('0x17'))>moment()){throw new Error(_0xe211('0x34'));}else{_0x479ec4[_0xe211('0x14')]=![];_0x479ec4[_0xe211('0x15')]=null;}}_0x479ec4[_0xe211('0x35')]=_0x2cdcf0;_0x479ec4['resetPasswordExpires']=Date[_0xe211('0x36')]()+0x36ee80;return _0x479ec4[_0xe211('0x37')]();})[_0xe211('0xd')](function(){return sendServiceMail({'to':_0x77ad0a[_0xe211('0x30')][_0xe211('0x1d')],'subject':_0xe211('0x38'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0xe211('0x39')+_0xe211('0x3a')+_0x77ad0a['headers'][_0xe211('0x3b')]+_0xe211('0x3c')+_0x2cdcf0+'\x0a\x0a'+_0xe211('0x3d')});})[_0xe211('0xd')](function(){_0x40e26a[_0xe211('0x3e')](0xc8)['send']({'message':_0xe211('0x3f')});})[_0xe211('0x1a')](function(_0x508fa8){return handleError(_0x40e26a,0x1f4,_0x508fa8);});};exports[_0xe211('0x40')]=function(_0x580875,_0x31b1f0){return db['User'][_0xe211('0x1b')]({'where':{'resetPasswordToken':_0x580875[_0xe211('0x41')][_0xe211('0x42')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0xe211('0xd')](function(_0x63d174){if(!_0x63d174){throw new Error(_0xe211('0x43'));}return db[_0xe211('0x9')][_0xe211('0xa')]({'attributes':['id',_0xe211('0x44'),_0xe211('0x45'),_0xe211('0x46')]})[_0xe211('0xd')](function(_0x2f2e7e){if(_0x2f2e7e[_0xe211('0x44')])authService[_0xe211('0x47')](_0x580875[_0xe211('0x30')][_0xe211('0xe')]);if(!_0x2f2e7e['enforcePasswordHistory']||!_0x63d174[_0xe211('0x48')])return _0x63d174;authService['validatePasswordHistory'](_0x580875[_0xe211('0x30')][_0xe211('0xe')],_0x63d174['previousPasswords'],_0x2f2e7e['passwordHistoryLimit']);return _0x63d174;})['then'](function(){_0x63d174[_0xe211('0xe')]=_0x580875[_0xe211('0x30')][_0xe211('0xe')];_0x63d174['resetPasswordToken']=null;_0x63d174[_0xe211('0x49')]=null;return _0x63d174[_0xe211('0x37')]();});})[_0xe211('0xd')](function(){_0x31b1f0[_0xe211('0x3e')](0xc8)[_0xe211('0x4a')]({'message':'Password\x20reset!'});})[_0xe211('0x1a')](function(_0x277067){return handleError(_0x31b1f0,0x1f4,_0x277067);});};passport[_0xe211('0x4b')](_0xe211('0x2b'),new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x573bfe,_0x4e0a65,_0xa82f52){return localAuthenticate(db[_0xe211('0x4c')],_0x573bfe,_0x4e0a65,_0xa82f52);}));
\ No newline at end of file
+var _0xb56f=['forgot','body','generate','trim','User','This\x20email\x20is\x20not\x20registered.','now','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','resetPasswordToken','resetPasswordExpires','save','Password\x20reset!','use','util','passport','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','disabled','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockedAt','add','minutes','clearBlockUser','blocked','getLicense','catch','MailAccount','find','email','Smtp','CloudProvider','getSmtpOptions','merge','format','request','SendMail','error','message','stringify','status','send','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','online'];(function(_0xb050c6,_0x3ee607){var _0x7d06ee=function(_0x37d479){while(--_0x37d479){_0xb050c6['push'](_0xb050c6['shift']());}};_0x7d06ee(++_0x3ee607);}(_0xb56f,0x70));var _0xfb56=function(_0x44c35f,_0x153e3f){_0x44c35f=_0x44c35f-0x0;var _0x415a67=_0xb56f[_0x44c35f];return _0x415a67;};'use strict';var util=require(_0xfb56('0x0'));var passport=require(_0xfb56('0x1'));var LocalStrategy=require('passport-local')['Strategy'];var jayson=require(_0xfb56('0x2'));var _=require(_0xfb56('0x3'));var rs=require(_0xfb56('0x4'));var moment=require(_0xfb56('0x5'));var db=require(_0xfb56('0x6'))['db'];var authService=require(_0xfb56('0x7'));var utils=require(_0xfb56('0x8'));var client=jayson[_0xfb56('0x9')][_0xfb56('0xa')]({'port':0x232b});function localAuthenticate(_0x690c3a,_0x26c86b,_0xa800c0,_0x328c59){var _0x58274b,_0x1dfea8;return db[_0xfb56('0xb')][_0xfb56('0xc')]({'where':{'id':0x1},'attributes':[_0xfb56('0xd'),_0xfb56('0xe')],'raw':!![]})[_0xfb56('0xf')](function(_0x41acc9){_0x58274b=_0x41acc9;return _0x690c3a[_0xfb56('0xc')]({'attributes':['id',_0xfb56('0x10'),_0xfb56('0x11'),'salt','role',_0xfb56('0x12'),'blocked','blockedAt',_0xfb56('0x13')],'where':{'name':_0x26c86b,'role':{'$or':[_0xfb56('0x14'),_0xfb56('0x15'),_0xfb56('0x16')]}}});})[_0xfb56('0xf')](function(_0x4f4a27){if(!_0x4f4a27||_0x4f4a27&&_0x4f4a27[_0xfb56('0x10')]!==_0x26c86b){throw new Error(_0xfb56('0x17'));}else{_0x1dfea8=_0x4f4a27;return _0x1dfea8;}})[_0xfb56('0xf')](function(){_0x1dfea8[_0xfb56('0x18')](_0xa800c0,function(_0x200d89,_0x1407b6){var _0x345da0=_0x1dfea8[_0xfb56('0x13')]+0x1;if(_0x200d89){return _0x328c59(_0x200d89);}else if(!_0x1407b6){if(_0x1dfea8['disabled']){return _0x328c59(null,![],{'message':_0xfb56('0x17')});}else if(_0x58274b[_0xfb56('0xd')]>0x0){if(_0x1dfea8['blocked']){if(_0x58274b[_0xfb56('0xe')]>0x0){if(moment(_0x1dfea8[_0xfb56('0x19')])[_0xfb56('0x1a')](_0x58274b['blockDuration'],_0xfb56('0x1b'))>moment()){return _0x328c59(null,![],{'message':_0xfb56('0x17')});}else{return utils[_0xfb56('0x1c')](_0x1dfea8,_0x345da0,![],null)[_0xfb56('0xf')](function(){return _0x328c59(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x328c59(null,![],{'message':_0xfb56('0x17')});}}else{if(_0x345da0>=_0x58274b[_0xfb56('0xd')]){return utils[_0xfb56('0x1c')](_0x1dfea8,0x0,!![],moment())[_0xfb56('0xf')](function(){return _0x328c59(null,![],{'message':_0xfb56('0x17')});});}else{return utils[_0xfb56('0x1c')](_0x1dfea8,_0x345da0,![],null)['then'](function(){return _0x328c59(null,![],{'message':_0xfb56('0x17')});});}}}else{return _0x328c59(null,![],{'message':_0xfb56('0x17')});}}else{if(_0x1dfea8['disabled']){return _0x328c59(null,![],{'message':_0xfb56('0x17')});}else if(_0x58274b[_0xfb56('0xd')]>0x0){if(_0x1dfea8[_0xfb56('0x1d')]){if(_0x58274b[_0xfb56('0xe')]>0x0){if(moment(_0x1dfea8[_0xfb56('0x19')])[_0xfb56('0x1a')](_0x58274b[_0xfb56('0xe')],_0xfb56('0x1b'))>moment()){return _0x328c59(null,![],{'message':_0xfb56('0x17')});}else{return utils[_0xfb56('0x1c')](_0x1dfea8,0x0,![],null)[_0xfb56('0xf')](function(){return utils[_0xfb56('0x1e')](_0x1dfea8);})[_0xfb56('0xf')](function(){return _0x328c59(null,_0x1dfea8);});}}else{return _0x328c59(null,![],{'message':_0xfb56('0x17')});}}else{return utils[_0xfb56('0x1c')](_0x1dfea8,0x0,![],null)[_0xfb56('0xf')](function(){return utils[_0xfb56('0x1e')](_0x1dfea8);})[_0xfb56('0xf')](function(){return _0x328c59(null,_0x1dfea8);})[_0xfb56('0x1f')](function(_0x16ebfb){return _0x328c59(null,![],_0x16ebfb);});}}else{if(_0x1dfea8[_0xfb56('0x1d')]){return _0x328c59(null,![],{'message':_0xfb56('0x17')});}else{return utils[_0xfb56('0x1e')](_0x1dfea8)[_0xfb56('0xf')](function(){return _0x328c59(null,_0x1dfea8);});}}}});})[_0xfb56('0x1f')](function(_0x3a0cc5){return _0x328c59(null,![],_0x3a0cc5);});}function sendServiceMail(_0xc6f4dc){return db[_0xfb56('0x20')][_0xfb56('0x21')]({'where':{'service':!![]},'attributes':['id','name',_0xfb56('0x22')],'include':[{'model':db['MailServerOut'],'as':_0xfb56('0x23'),'include':[{'model':db[_0xfb56('0x24')],'as':_0xfb56('0x24')}]}]})[_0xfb56('0xf')](function(_0x305503){if(!_0x305503){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x3c2fc0=_0x305503[_0xfb56('0x25')]();var _0x1117d5={'account':_0x3c2fc0,'message':_[_0xfb56('0x26')]({'from':util[_0xfb56('0x27')]('\x22%s\x22\x20<%s>',_0x305503[_0xfb56('0x10')],_0x305503[_0xfb56('0x22')]||_0x305503[_0xfb56('0x23')][_0xfb56('0x15')])},_0xc6f4dc)};return client[_0xfb56('0x28')](_0xfb56('0x29'),_0x1117d5);})[_0xfb56('0xf')](function(_0x598b0d){if(_0x598b0d[_0xfb56('0x2a')]){throw new Error(util['format']('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x598b0d[_0xfb56('0x2a')][_0xfb56('0x2b')]||JSON[_0xfb56('0x2c')](_0x598b0d[_0xfb56('0x2a')])));}return!![];});}function handleError(_0xefea57,_0x1e7655,_0x39323c){return _0xefea57[_0xfb56('0x2d')](_0x1e7655||0x1f4)[_0xfb56('0x2e')]({'message':_0x39323c?_0x39323c['message']||_0x39323c:''});}exports['login']=function(_0x36b3f9,_0xcdf580,_0x531c86){passport['authenticate']('local-login',function(_0x230db5,_0x597c12,_0x5381e3){var _0xad2345=_0x230db5||_0x5381e3;if(_0xad2345){return handleError(_0xcdf580,0x191,_0xad2345);}if(!_0x597c12){return handleError(_0xcdf580,0x194,{'message':_0xfb56('0x2f')});}else{var _0x559e50={'payload':{'id':_0x597c12['id'],'role':_0x597c12[_0xfb56('0x30')]},'options':{'expiresIn':0x15180}};return authService[_0xfb56('0x31')](_0x559e50)[_0xfb56('0xf')](function(_0x4a9ded){_0xcdf580[_0xfb56('0x32')]({'id':_0x597c12['id'],'token':_0x4a9ded,'statusCall':'','isAlreadyLogged':_0x597c12[_0xfb56('0x33')]});});}})(_0x36b3f9,_0xcdf580,_0x531c86);};exports[_0xfb56('0x34')]=function(_0xfe7b16,_0xc4a936){if(!_0xfe7b16[_0xfb56('0x35')][_0xfb56('0x22')]){return handleError(_0xc4a936,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x40541e=rs[_0xfb56('0x36')]();_0xfe7b16[_0xfb56('0x35')]['email']=_0xfe7b16[_0xfb56('0x35')][_0xfb56('0x22')][_0xfb56('0x37')]()['toLowerCase']();var _0x3e7750;return db[_0xfb56('0xb')]['findOne']({'where':{'id':0x1},'attributes':[_0xfb56('0xd'),_0xfb56('0xe')],'raw':!![]})[_0xfb56('0xf')](function(_0xb9975f){_0x3e7750=_0xb9975f;return db[_0xfb56('0x38')]['find']({'where':{'email':_0xfe7b16[_0xfb56('0x35')]['email']}});})[_0xfb56('0xf')](function(_0x42be24){if(!_0x42be24){throw new Error(_0xfb56('0x39'));}if(_0x42be24[_0xfb56('0x12')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x42be24[_0xfb56('0x1d')]){if(moment(_0x42be24[_0xfb56('0x19')])[_0xfb56('0x1a')](_0x3e7750[_0xfb56('0xe')],_0xfb56('0x1b'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x42be24['blocked']=![];_0x42be24[_0xfb56('0x19')]=null;}}_0x42be24['resetPasswordToken']=_0x40541e;_0x42be24['resetPasswordExpires']=Date[_0xfb56('0x3a')]()+0x36ee80;return _0x42be24['save']();})[_0xfb56('0xf')](function(){return sendServiceMail({'to':_0xfe7b16[_0xfb56('0x35')][_0xfb56('0x22')],'subject':_0xfb56('0x3b'),'text':_0xfb56('0x3c')+_0xfb56('0x3d')+_0xfb56('0x3e')+_0xfe7b16[_0xfb56('0x3f')][_0xfb56('0x40')]+'/reset/'+_0x40541e+'\x0a\x0a'+_0xfb56('0x41')});})['then'](function(){_0xc4a936[_0xfb56('0x2d')](0xc8)[_0xfb56('0x2e')]({'message':_0xfb56('0x42')});})[_0xfb56('0x1f')](function(_0x388e31){return handleError(_0xc4a936,0x1f4,_0x388e31);});};exports[_0xfb56('0x43')]=function(_0xb452bd,_0xc094fd){return db[_0xfb56('0x38')][_0xfb56('0x21')]({'where':{'resetPasswordToken':_0xb452bd[_0xfb56('0x44')][_0xfb56('0x45')],'resetPasswordExpires':{'$gt':Date[_0xfb56('0x3a')]()}}})[_0xfb56('0xf')](function(_0x28dfc0){if(!_0x28dfc0){throw new Error(_0xfb56('0x46'));}return db[_0xfb56('0xb')]['findOne']({'attributes':['id',_0xfb56('0x47'),_0xfb56('0x48'),_0xfb56('0x49')]})[_0xfb56('0xf')](function(_0x3060a7){if(_0x3060a7[_0xfb56('0x47')])authService[_0xfb56('0x4a')](_0xb452bd[_0xfb56('0x35')][_0xfb56('0x11')]);if(!_0x3060a7[_0xfb56('0x48')]||!_0x28dfc0[_0xfb56('0x4b')])return _0x28dfc0;authService[_0xfb56('0x4c')](_0xb452bd['body'][_0xfb56('0x11')],_0x28dfc0['previousPasswords'],_0x3060a7[_0xfb56('0x49')]);return _0x28dfc0;})[_0xfb56('0xf')](function(){_0x28dfc0[_0xfb56('0x11')]=_0xb452bd[_0xfb56('0x35')]['password'];_0x28dfc0[_0xfb56('0x4d')]=null;_0x28dfc0[_0xfb56('0x4e')]=null;return _0x28dfc0[_0xfb56('0x4f')]();});})[_0xfb56('0xf')](function(){_0xc094fd[_0xfb56('0x2d')](0xc8)[_0xfb56('0x2e')]({'message':_0xfb56('0x50')});})['catch'](function(_0x432f34){return handleError(_0xc094fd,0x1f4,_0x432f34);});};passport[_0xfb56('0x51')]('local-login',new LocalStrategy({'usernameField':_0xfb56('0x10'),'passwordField':_0xfb56('0x11')},function(_0x6b1ab6,_0x4f258b,_0x54ff23){return localAuthenticate(db[_0xfb56('0x38')],_0x6b1ab6,_0x4f258b,_0x54ff23);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index e6cbe90..514064e 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 _0x2268=['./authLocal.controller','login','/forgot','forgot','/reset/:token','reset','exports','express','Router'];(function(_0x11490a,_0x325f82){var _0x37ea5e=function(_0xe68b42){while(--_0xe68b42){_0x11490a['push'](_0x11490a['shift']());}};_0x37ea5e(++_0x325f82);}(_0x2268,0x103));var _0x8226=function(_0x26758e,_0x407c00){_0x26758e=_0x26758e-0x0;var _0x3c3ac3=_0x2268[_0x26758e];return _0x3c3ac3;};'use strict';var express=require(_0x8226('0x0'));var router=express[_0x8226('0x1')]();var controller=require(_0x8226('0x2'));router['post']('/',controller[_0x8226('0x3')]);router['post'](_0x8226('0x4'),controller[_0x8226('0x5')]);router['post'](_0x8226('0x6'),controller[_0x8226('0x7')]);module[_0x8226('0x8')]=router;
\ No newline at end of file
+var _0x1cb4=['post','login','/forgot','forgot','/reset/:token','express','Router'];(function(_0x347ae8,_0x55e717){var _0x109fb6=function(_0x4657fc){while(--_0x4657fc){_0x347ae8['push'](_0x347ae8['shift']());}};_0x109fb6(++_0x55e717);}(_0x1cb4,0x18d));var _0x41cb=function(_0x774780,_0x3012aa){_0x774780=_0x774780-0x0;var _0x596b9a=_0x1cb4[_0x774780];return _0x596b9a;};'use strict';var express=require(_0x41cb('0x0'));var router=express[_0x41cb('0x1')]();var controller=require('./authLocal.controller');router[_0x41cb('0x2')]('/',controller[_0x41cb('0x3')]);router[_0x41cb('0x2')](_0x41cb('0x4'),controller[_0x41cb('0x5')]);router['post'](_0x41cb('0x6'),controller['reset']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 8492e8d..c261b45 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 _0x3623=['INTEGER','exports','STRING','BOOLEAN'];(function(_0xefbe93,_0x486b59){var _0x348a0f=function(_0x377055){while(--_0x377055){_0xefbe93['push'](_0xefbe93['shift']());}};_0x348a0f(++_0x486b59);}(_0x3623,0x9d));var _0x3362=function(_0x5a19fc,_0x58f9f4){_0x5a19fc=_0x5a19fc-0x0;var _0x34b413=_0x3623[_0x5a19fc];return _0x34b413;};'use strict';var Sequelize=require('sequelize');module[_0x3362('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x3362('0x1')]},'description':{'type':Sequelize[_0x3362('0x1')]},'status':{'type':Sequelize[_0x3362('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x3362('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x8fe8=['sequelize','exports','STRING','INTEGER'];(function(_0x21b49a,_0x4a930c){var _0x2e0492=function(_0x4fb37e){while(--_0x4fb37e){_0x21b49a['push'](_0x21b49a['shift']());}};_0x2e0492(++_0x4a930c);}(_0x8fe8,0x100));var _0x88fe=function(_0x67d9d7,_0x49b147){_0x67d9d7=_0x67d9d7-0x0;var _0x2a7c7f=_0x8fe8[_0x67d9d7];return _0x2a7c7f;};'use strict';var Sequelize=require(_0x88fe('0x0'));module[_0x88fe('0x1')]={'name':{'type':Sequelize[_0x88fe('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x88fe('0x2')]},'description':{'type':Sequelize[_0x88fe('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x88fe('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 0d39f62..44b1326 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 _0xcb46=['rawAttributes','length','find','catch','create','body','params','destroy','addConditions','Condition','ids','omit','getConditions','findOne','hasOwnProperty','addActions','Action','getActions','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','reject','save','update','then','error','stack','name','send','index','map','fieldName','type','model','keys','intersection','query','attributes','fields','nolimit','sort','where','filters','pick','filter','merge','options','include','Automation','findAll','rows','show'];(function(_0x112fe3,_0x16b642){var _0x1ec903=function(_0x1539eb){while(--_0x1539eb){_0x112fe3['push'](_0x112fe3['shift']());}};_0x1ec903(++_0x16b642);}(_0xcb46,0x108));var _0x6cb4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcb46[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x6cb4('0x0'));var rimraf=require(_0x6cb4('0x1'));var zipdir=require(_0x6cb4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6cb4('0x3'));var BPromise=require(_0x6cb4('0x4'));var Mustache=require('mustache');var util=require(_0x6cb4('0x5'));var path=require(_0x6cb4('0x6'));var sox=require(_0x6cb4('0x7'));var csv=require(_0x6cb4('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6cb4('0x9'));var _=require(_0x6cb4('0xa'));var squel=require(_0x6cb4('0xb'));var crypto=require(_0x6cb4('0xc'));var jsforce=require(_0x6cb4('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x6cb4('0x8'));var querystring=require(_0x6cb4('0xe'));var Papa=require(_0x6cb4('0xf'));var Redis=require(_0x6cb4('0x10'));var authService=require(_0x6cb4('0x11'));var qs=require(_0x6cb4('0x12'));var as=require(_0x6cb4('0x13'));var hardwareService=require(_0x6cb4('0x14'));var logger=require(_0x6cb4('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x6cb4('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x6cb4('0x17'))['db'];function respondWithStatusCode(_0x35bb39,_0x1de3d6){_0x1de3d6=_0x1de3d6||0xcc;return function(_0x28ae09){if(_0x28ae09){return _0x35bb39[_0x6cb4('0x18')](_0x1de3d6);}return _0x35bb39[_0x6cb4('0x19')](_0x1de3d6)[_0x6cb4('0x1a')]();};}function respondWithResult(_0x4b1543,_0x57823e){_0x57823e=_0x57823e||0xc8;return function(_0xe3a663){if(_0xe3a663){return _0x4b1543[_0x6cb4('0x19')](_0x57823e)[_0x6cb4('0x1b')](_0xe3a663);}};}function respondWithFilteredResult(_0xd15616,_0x4aece7){return function(_0xc5be13){if(_0xc5be13){var _0x4c8c0b=typeof _0x4aece7[_0x6cb4('0x1c')]==='undefined'&&typeof _0x4aece7['limit']===_0x6cb4('0x1d');var _0x452aaf=_0xc5be13['count'];var _0x5b9fea=_0x4c8c0b?0x0:_0x4aece7['offset'];var _0xbe8e5b=_0x4c8c0b?_0xc5be13[_0x6cb4('0x1e')]:_0x4aece7[_0x6cb4('0x1c')]+_0x4aece7[_0x6cb4('0x1f')];var _0x33b266;if(_0xbe8e5b>=_0x452aaf){_0xbe8e5b=_0x452aaf;_0x33b266=0xc8;}else{_0x33b266=0xce;}_0xd15616[_0x6cb4('0x19')](_0x33b266);return _0xd15616['set'](_0x6cb4('0x20'),_0x5b9fea+'-'+_0xbe8e5b+'/'+_0x452aaf)[_0x6cb4('0x1b')](_0xc5be13);}return null;};}function patchUpdates(_0x7a15d5){return function(_0x470679){try{jsonpatch['apply'](_0x470679,_0x7a15d5,!![]);}catch(_0x39c588){return BPromise[_0x6cb4('0x21')](_0x39c588);}return _0x470679[_0x6cb4('0x22')]();};}function saveUpdates(_0x2bdbcd,_0x3aca3c){return function(_0x3cfafe){if(_0x3cfafe){return _0x3cfafe[_0x6cb4('0x23')](_0x2bdbcd)[_0x6cb4('0x24')](function(_0x5f20f1){return _0x5f20f1;});}return null;};}function removeEntity(_0x12313b,_0x134d7c){return function(_0x14ac9c){if(_0x14ac9c){return _0x14ac9c['destroy']()[_0x6cb4('0x24')](function(){_0x12313b[_0x6cb4('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32b4a8,_0x147529){return function(_0x156914){if(!_0x156914){_0x32b4a8[_0x6cb4('0x18')](0x194);}return _0x156914;};}function handleError(_0x11a94a,_0x5d39bf){_0x5d39bf=_0x5d39bf||0x1f4;return function(_0xc83d65){logger[_0x6cb4('0x25')](_0xc83d65[_0x6cb4('0x26')]);if(_0xc83d65[_0x6cb4('0x27')]){delete _0xc83d65[_0x6cb4('0x27')];}_0x11a94a[_0x6cb4('0x19')](_0x5d39bf)[_0x6cb4('0x28')](_0xc83d65);};}exports[_0x6cb4('0x29')]=function(_0x10af7a,_0x42d0c3){var _0x8159cc={},_0x46b057={},_0x46b0d1={'count':0x0,'rows':[]};var _0x2d92fa=_[_0x6cb4('0x2a')](db['Automation']['rawAttributes'],function(_0x19f18b){return{'name':_0x19f18b[_0x6cb4('0x2b')],'type':_0x19f18b[_0x6cb4('0x2c')]['key']};});_0x46b057[_0x6cb4('0x2d')]=_[_0x6cb4('0x2a')](_0x2d92fa,_0x6cb4('0x27'));_0x46b057['query']=_[_0x6cb4('0x2e')](_0x10af7a['query']);_0x46b057['filters']=_[_0x6cb4('0x2f')](_0x46b057[_0x6cb4('0x2d')],_0x46b057[_0x6cb4('0x30')]);_0x8159cc[_0x6cb4('0x31')]=_['intersection'](_0x46b057[_0x6cb4('0x2d')],qs[_0x6cb4('0x32')](_0x10af7a['query'][_0x6cb4('0x32')]));_0x8159cc[_0x6cb4('0x31')]=_0x8159cc[_0x6cb4('0x31')]['length']?_0x8159cc[_0x6cb4('0x31')]:_0x46b057['model'];if(!_0x10af7a[_0x6cb4('0x30')]['hasOwnProperty'](_0x6cb4('0x33'))){_0x8159cc['limit']=qs[_0x6cb4('0x1f')](_0x10af7a[_0x6cb4('0x30')][_0x6cb4('0x1f')]);_0x8159cc[_0x6cb4('0x1c')]=qs[_0x6cb4('0x1c')](_0x10af7a[_0x6cb4('0x30')][_0x6cb4('0x1c')]);}_0x8159cc['order']=qs['sort'](_0x10af7a[_0x6cb4('0x30')][_0x6cb4('0x34')]);_0x8159cc[_0x6cb4('0x35')]=qs[_0x6cb4('0x36')](_[_0x6cb4('0x37')](_0x10af7a[_0x6cb4('0x30')],_0x46b057[_0x6cb4('0x36')]),_0x2d92fa);if(_0x10af7a['query'][_0x6cb4('0x38')]){_0x8159cc[_0x6cb4('0x35')]=_[_0x6cb4('0x39')](_0x8159cc[_0x6cb4('0x35')],{'$or':_['map'](_0x2d92fa,function(_0xd622cb){if(_0xd622cb[_0x6cb4('0x2c')]!=='VIRTUAL'){var _0x4b3a36={};_0x4b3a36[_0xd622cb[_0x6cb4('0x27')]]={'$like':'%'+_0x10af7a[_0x6cb4('0x30')][_0x6cb4('0x38')]+'%'};return _0x4b3a36;}})});}_0x8159cc=_[_0x6cb4('0x39')]({},_0x8159cc,_0x10af7a[_0x6cb4('0x3a')]);var _0x243727={'where':_0x8159cc[_0x6cb4('0x35')]};return db['Automation'][_0x6cb4('0x1e')](_0x243727)[_0x6cb4('0x24')](function(_0x7d25ed){_0x46b0d1[_0x6cb4('0x1e')]=_0x7d25ed;if(_0x10af7a[_0x6cb4('0x30')]['includeAll']){_0x8159cc[_0x6cb4('0x3b')]=[{'all':!![]}];}return db[_0x6cb4('0x3c')][_0x6cb4('0x3d')](_0x8159cc);})[_0x6cb4('0x24')](function(_0x50a80b){_0x46b0d1[_0x6cb4('0x3e')]=_0x50a80b;return _0x46b0d1;})['then'](respondWithFilteredResult(_0x42d0c3,_0x8159cc))['catch'](handleError(_0x42d0c3,null));};exports[_0x6cb4('0x3f')]=function(_0x4096dd,_0x111a7a){var _0x3a16ca={'raw':![],'where':{'id':_0x4096dd['params']['id']}},_0xd942fa={};_0xd942fa['model']=_[_0x6cb4('0x2e')](db[_0x6cb4('0x3c')][_0x6cb4('0x40')]);_0xd942fa[_0x6cb4('0x30')]=_[_0x6cb4('0x2e')](_0x4096dd[_0x6cb4('0x30')]);_0xd942fa[_0x6cb4('0x36')]=_['intersection'](_0xd942fa[_0x6cb4('0x2d')],_0xd942fa[_0x6cb4('0x30')]);_0x3a16ca[_0x6cb4('0x31')]=_[_0x6cb4('0x2f')](_0xd942fa[_0x6cb4('0x2d')],qs[_0x6cb4('0x32')](_0x4096dd[_0x6cb4('0x30')][_0x6cb4('0x32')]));_0x3a16ca[_0x6cb4('0x31')]=_0x3a16ca[_0x6cb4('0x31')][_0x6cb4('0x41')]?_0x3a16ca['attributes']:_0xd942fa[_0x6cb4('0x2d')];if(_0x4096dd['query']['includeAll']){_0x3a16ca[_0x6cb4('0x3b')]=[{'all':!![]}];}_0x3a16ca=_[_0x6cb4('0x39')]({},_0x3a16ca,_0x4096dd[_0x6cb4('0x3a')]);return db[_0x6cb4('0x3c')][_0x6cb4('0x42')](_0x3a16ca)[_0x6cb4('0x24')](handleEntityNotFound(_0x111a7a,null))[_0x6cb4('0x24')](respondWithResult(_0x111a7a,null))[_0x6cb4('0x43')](handleError(_0x111a7a,null));};exports['create']=function(_0x47e2cb,_0x701a3a){return db[_0x6cb4('0x3c')][_0x6cb4('0x44')](_0x47e2cb['body'],{})[_0x6cb4('0x24')](respondWithResult(_0x701a3a,0xc9))[_0x6cb4('0x43')](handleError(_0x701a3a,null));};exports[_0x6cb4('0x23')]=function(_0x5e0d5b,_0x5dcd98){if(_0x5e0d5b[_0x6cb4('0x45')]['id']){delete _0x5e0d5b[_0x6cb4('0x45')]['id'];}return db[_0x6cb4('0x3c')][_0x6cb4('0x42')]({'where':{'id':_0x5e0d5b[_0x6cb4('0x46')]['id']}})['then'](handleEntityNotFound(_0x5dcd98,null))[_0x6cb4('0x24')](saveUpdates(_0x5e0d5b[_0x6cb4('0x45')],null))[_0x6cb4('0x24')](respondWithResult(_0x5dcd98,null))[_0x6cb4('0x43')](handleError(_0x5dcd98,null));};exports[_0x6cb4('0x47')]=function(_0x34834a,_0x3a06ee){return db['Automation'][_0x6cb4('0x42')]({'where':{'id':_0x34834a[_0x6cb4('0x46')]['id']}})[_0x6cb4('0x24')](handleEntityNotFound(_0x3a06ee,null))[_0x6cb4('0x24')](removeEntity(_0x3a06ee,null))[_0x6cb4('0x43')](handleError(_0x3a06ee,null));};exports[_0x6cb4('0x48')]=function(_0x287371,_0x32b025,_0x215b31){return db[_0x6cb4('0x49')][_0x6cb4('0x42')]({'where':{'id':_0x287371[_0x6cb4('0x46')]['id']}})[_0x6cb4('0x24')](handleEntityNotFound(_0x32b025,null))[_0x6cb4('0x24')](function(_0x5a06b6){if(_0x5a06b6){return _0x5a06b6[_0x6cb4('0x48')](_0x287371['body'][_0x6cb4('0x4a')],_[_0x6cb4('0x4b')](_0x287371['body'],[_0x6cb4('0x4a'),'id'])||{});}})[_0x6cb4('0x24')](respondWithResult(_0x32b025,null))[_0x6cb4('0x43')](handleError(_0x32b025,null));};exports[_0x6cb4('0x4c')]=function(_0x39d4c1,_0x5bee07,_0x22dbf9){var _0x2d4414={};var _0x3900f0={};var _0x38d8f8;var _0x471885;return db[_0x6cb4('0x3c')][_0x6cb4('0x4d')]({'where':{'id':_0x39d4c1['params']['id']}})[_0x6cb4('0x24')](handleEntityNotFound(_0x5bee07,null))[_0x6cb4('0x24')](function(_0x45c79a){if(_0x45c79a){_0x38d8f8=_0x45c79a;_0x3900f0['model']=_[_0x6cb4('0x2e')](db[_0x6cb4('0x49')][_0x6cb4('0x40')]);_0x3900f0[_0x6cb4('0x30')]=_[_0x6cb4('0x2e')](_0x39d4c1[_0x6cb4('0x30')]);_0x3900f0[_0x6cb4('0x36')]=_[_0x6cb4('0x2f')](_0x3900f0[_0x6cb4('0x2d')],_0x3900f0[_0x6cb4('0x30')]);_0x2d4414[_0x6cb4('0x31')]=_[_0x6cb4('0x2f')](_0x3900f0['model'],qs['fields'](_0x39d4c1[_0x6cb4('0x30')][_0x6cb4('0x32')]));_0x2d4414[_0x6cb4('0x31')]=_0x2d4414[_0x6cb4('0x31')]['length']?_0x2d4414[_0x6cb4('0x31')]:_0x3900f0[_0x6cb4('0x2d')];_0x2d4414['order']=qs[_0x6cb4('0x34')](_0x39d4c1[_0x6cb4('0x30')]['sort']);_0x2d4414['where']=qs[_0x6cb4('0x36')](_[_0x6cb4('0x37')](_0x39d4c1[_0x6cb4('0x30')],_0x3900f0['filters']));if(_0x39d4c1[_0x6cb4('0x30')][_0x6cb4('0x38')]){_0x2d4414[_0x6cb4('0x35')]=_[_0x6cb4('0x39')](_0x2d4414[_0x6cb4('0x35')],{'$or':_[_0x6cb4('0x2a')](_0x2d4414[_0x6cb4('0x31')],function(_0x4139f4){var _0x477640={};_0x477640[_0x4139f4]={'$like':'%'+_0x39d4c1['query'][_0x6cb4('0x38')]+'%'};return _0x477640;})});}_0x2d4414=_[_0x6cb4('0x39')]({},_0x2d4414,_0x39d4c1[_0x6cb4('0x3a')]);return _0x38d8f8[_0x6cb4('0x4c')](_0x2d4414);}})[_0x6cb4('0x24')](function(_0x420816){if(_0x420816){_0x471885=_0x420816[_0x6cb4('0x41')];if(!_0x39d4c1[_0x6cb4('0x30')][_0x6cb4('0x4e')](_0x6cb4('0x33'))){_0x2d4414['limit']=qs['limit'](_0x39d4c1['query'][_0x6cb4('0x1f')]);_0x2d4414[_0x6cb4('0x1c')]=qs[_0x6cb4('0x1c')](_0x39d4c1[_0x6cb4('0x30')][_0x6cb4('0x1c')]);}return _0x38d8f8[_0x6cb4('0x4c')](_0x2d4414);}})[_0x6cb4('0x24')](function(_0x28d325){if(_0x28d325){return _0x28d325?{'count':_0x471885,'rows':_0x28d325}:null;}})[_0x6cb4('0x24')](respondWithResult(_0x5bee07,null))['catch'](handleError(_0x5bee07,null));};exports[_0x6cb4('0x4f')]=function(_0x13be27,_0x193e4e,_0x3ad5af){return db[_0x6cb4('0x50')][_0x6cb4('0x42')]({'where':{'id':_0x13be27[_0x6cb4('0x46')]['id']}})[_0x6cb4('0x24')](handleEntityNotFound(_0x193e4e,null))['then'](function(_0x24a311){if(_0x24a311){return _0x24a311['addActions'](_0x13be27['body']['ids'],_['omit'](_0x13be27[_0x6cb4('0x45')],[_0x6cb4('0x4a'),'id'])||{});}})[_0x6cb4('0x24')](respondWithResult(_0x193e4e,null))[_0x6cb4('0x43')](handleError(_0x193e4e,null));};exports[_0x6cb4('0x51')]=function(_0xe0b3bd,_0x278c0c,_0x13068e){var _0x242859={};var _0x1d71bd={};var _0x17de7e;var _0x3ae5b3;return db[_0x6cb4('0x3c')]['findOne']({'where':{'id':_0xe0b3bd['params']['id']}})[_0x6cb4('0x24')](handleEntityNotFound(_0x278c0c,null))['then'](function(_0xaccf29){if(_0xaccf29){_0x17de7e=_0xaccf29;_0x1d71bd[_0x6cb4('0x2d')]=_[_0x6cb4('0x2e')](db[_0x6cb4('0x50')]['rawAttributes']);_0x1d71bd[_0x6cb4('0x30')]=_[_0x6cb4('0x2e')](_0xe0b3bd[_0x6cb4('0x30')]);_0x1d71bd[_0x6cb4('0x36')]=_[_0x6cb4('0x2f')](_0x1d71bd[_0x6cb4('0x2d')],_0x1d71bd[_0x6cb4('0x30')]);_0x242859['attributes']=_[_0x6cb4('0x2f')](_0x1d71bd[_0x6cb4('0x2d')],qs[_0x6cb4('0x32')](_0xe0b3bd[_0x6cb4('0x30')][_0x6cb4('0x32')]));_0x242859['attributes']=_0x242859[_0x6cb4('0x31')]['length']?_0x242859[_0x6cb4('0x31')]:_0x1d71bd[_0x6cb4('0x2d')];_0x242859['order']=qs[_0x6cb4('0x34')](_0xe0b3bd['query'][_0x6cb4('0x34')]);_0x242859['where']=qs['filters'](_['pick'](_0xe0b3bd['query'],_0x1d71bd[_0x6cb4('0x36')]));if(_0xe0b3bd[_0x6cb4('0x30')][_0x6cb4('0x38')]){_0x242859[_0x6cb4('0x35')]=_[_0x6cb4('0x39')](_0x242859[_0x6cb4('0x35')],{'$or':_[_0x6cb4('0x2a')](_0x242859[_0x6cb4('0x31')],function(_0x4ca06a){var _0x32d103={};_0x32d103[_0x4ca06a]={'$like':'%'+_0xe0b3bd[_0x6cb4('0x30')]['filter']+'%'};return _0x32d103;})});}_0x242859=_[_0x6cb4('0x39')]({},_0x242859,_0xe0b3bd['options']);return _0x17de7e[_0x6cb4('0x51')](_0x242859);}})[_0x6cb4('0x24')](function(_0xeff276){if(_0xeff276){_0x3ae5b3=_0xeff276[_0x6cb4('0x41')];if(!_0xe0b3bd['query'][_0x6cb4('0x4e')](_0x6cb4('0x33'))){_0x242859[_0x6cb4('0x1f')]=qs[_0x6cb4('0x1f')](_0xe0b3bd[_0x6cb4('0x30')][_0x6cb4('0x1f')]);_0x242859[_0x6cb4('0x1c')]=qs[_0x6cb4('0x1c')](_0xe0b3bd['query'][_0x6cb4('0x1c')]);}return _0x17de7e[_0x6cb4('0x51')](_0x242859);}})['then'](function(_0x4f4ec6){if(_0x4f4ec6){return _0x4f4ec6?{'count':_0x3ae5b3,'rows':_0x4f4ec6}:null;}})[_0x6cb4('0x24')](respondWithResult(_0x278c0c,null))[_0x6cb4('0x43')](handleError(_0x278c0c,null));};
\ No newline at end of file
+var _0x7943=['Automation','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','include','findAll','rows','show','params','includeAll','catch','create','body','Condition','addConditions','ids','omit','getConditions','findOne','merge','addActions','Action','find','getActions','eml-format','zip-dir','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','limit','undefined','count','Content-Range','json','save','update','then','destroy','sendStatus','error','stack','name','send','index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7943,0x7e));var _0x3794=function(_0x831dc4,_0x1877c9){_0x831dc4=_0x831dc4-0x0;var _0x4087eb=_0x7943[_0x831dc4];return _0x4087eb;};'use strict';var emlformat=require(_0x3794('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3794('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3794('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3794('0x3'));var util=require('util');var path=require(_0x3794('0x4'));var sox=require(_0x3794('0x5'));var csv=require(_0x3794('0x6'));var ejs=require(_0x3794('0x7'));var fs=require('fs');var fs_extra=require(_0x3794('0x8'));var _=require(_0x3794('0x9'));var squel=require(_0x3794('0xa'));var crypto=require(_0x3794('0xb'));var jsforce=require(_0x3794('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3794('0x6'));var querystring=require(_0x3794('0xd'));var Papa=require(_0x3794('0xe'));var Redis=require(_0x3794('0xf'));var authService=require(_0x3794('0x10'));var qs=require(_0x3794('0x11'));var as=require(_0x3794('0x12'));var hardwareService=require(_0x3794('0x13'));var logger=require('../../config/logger')(_0x3794('0x14'));var utils=require(_0x3794('0x15'));var config=require(_0x3794('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x3794('0x17'))['db'];function respondWithStatusCode(_0x22b5e5,_0x5e0a2d){_0x5e0a2d=_0x5e0a2d||0xcc;return function(_0x15dbbd){if(_0x15dbbd){return _0x22b5e5['sendStatus'](_0x5e0a2d);}return _0x22b5e5[_0x3794('0x18')](_0x5e0a2d)[_0x3794('0x19')]();};}function respondWithResult(_0x115f2c,_0xa08c4d){_0xa08c4d=_0xa08c4d||0xc8;return function(_0x1e1b64){if(_0x1e1b64){return _0x115f2c[_0x3794('0x18')](_0xa08c4d)['json'](_0x1e1b64);}};}function respondWithFilteredResult(_0x3e6f44,_0x27dcdf){return function(_0xa81d2a){if(_0xa81d2a){var _0x15a95d=typeof _0x27dcdf[_0x3794('0x1a')]==='undefined'&&typeof _0x27dcdf[_0x3794('0x1b')]===_0x3794('0x1c');var _0x315758=_0xa81d2a[_0x3794('0x1d')];var _0x1ecb34=_0x15a95d?0x0:_0x27dcdf[_0x3794('0x1a')];var _0x577fbe=_0x15a95d?_0xa81d2a[_0x3794('0x1d')]:_0x27dcdf[_0x3794('0x1a')]+_0x27dcdf[_0x3794('0x1b')];var _0x5499c2;if(_0x577fbe>=_0x315758){_0x577fbe=_0x315758;_0x5499c2=0xc8;}else{_0x5499c2=0xce;}_0x3e6f44[_0x3794('0x18')](_0x5499c2);return _0x3e6f44['set'](_0x3794('0x1e'),_0x1ecb34+'-'+_0x577fbe+'/'+_0x315758)[_0x3794('0x1f')](_0xa81d2a);}return null;};}function patchUpdates(_0x4453c1){return function(_0x130f4f){try{jsonpatch['apply'](_0x130f4f,_0x4453c1,!![]);}catch(_0x234a03){return BPromise['reject'](_0x234a03);}return _0x130f4f[_0x3794('0x20')]();};}function saveUpdates(_0x2e6b67,_0x16b26e){return function(_0x58a970){if(_0x58a970){return _0x58a970[_0x3794('0x21')](_0x2e6b67)[_0x3794('0x22')](function(_0x3f60c9){return _0x3f60c9;});}return null;};}function removeEntity(_0x49dc47,_0x2497eb){return function(_0x42f162){if(_0x42f162){return _0x42f162[_0x3794('0x23')]()['then'](function(){_0x49dc47[_0x3794('0x18')](0xcc)[_0x3794('0x19')]();});}};}function handleEntityNotFound(_0x5ee5f0,_0x2bdc0a){return function(_0x56b3dc){if(!_0x56b3dc){_0x5ee5f0[_0x3794('0x24')](0x194);}return _0x56b3dc;};}function handleError(_0x5eddd5,_0xdbe130){_0xdbe130=_0xdbe130||0x1f4;return function(_0x285eb9){logger[_0x3794('0x25')](_0x285eb9[_0x3794('0x26')]);if(_0x285eb9[_0x3794('0x27')]){delete _0x285eb9[_0x3794('0x27')];}_0x5eddd5[_0x3794('0x18')](_0xdbe130)[_0x3794('0x28')](_0x285eb9);};}exports[_0x3794('0x29')]=function(_0x44fe69,_0x2045f5){var _0x3a3c8a={},_0x5a3e70={},_0x434dc3={'count':0x0,'rows':[]};var _0x1025a0=_['map'](db[_0x3794('0x2a')][_0x3794('0x2b')],function(_0x180f9f){return{'name':_0x180f9f[_0x3794('0x2c')],'type':_0x180f9f[_0x3794('0x2d')][_0x3794('0x2e')]};});_0x5a3e70['model']=_[_0x3794('0x2f')](_0x1025a0,_0x3794('0x27'));_0x5a3e70[_0x3794('0x30')]=_[_0x3794('0x31')](_0x44fe69[_0x3794('0x30')]);_0x5a3e70[_0x3794('0x32')]=_[_0x3794('0x33')](_0x5a3e70['model'],_0x5a3e70[_0x3794('0x30')]);_0x3a3c8a['attributes']=_[_0x3794('0x33')](_0x5a3e70[_0x3794('0x34')],qs[_0x3794('0x35')](_0x44fe69[_0x3794('0x30')]['fields']));_0x3a3c8a[_0x3794('0x36')]=_0x3a3c8a[_0x3794('0x36')][_0x3794('0x37')]?_0x3a3c8a['attributes']:_0x5a3e70[_0x3794('0x34')];if(!_0x44fe69[_0x3794('0x30')][_0x3794('0x38')](_0x3794('0x39'))){_0x3a3c8a[_0x3794('0x1b')]=qs[_0x3794('0x1b')](_0x44fe69[_0x3794('0x30')][_0x3794('0x1b')]);_0x3a3c8a[_0x3794('0x1a')]=qs['offset'](_0x44fe69[_0x3794('0x30')][_0x3794('0x1a')]);}_0x3a3c8a[_0x3794('0x3a')]=qs[_0x3794('0x3b')](_0x44fe69[_0x3794('0x30')][_0x3794('0x3b')]);_0x3a3c8a[_0x3794('0x3c')]=qs[_0x3794('0x32')](_[_0x3794('0x3d')](_0x44fe69[_0x3794('0x30')],_0x5a3e70['filters']),_0x1025a0);if(_0x44fe69[_0x3794('0x30')][_0x3794('0x3e')]){_0x3a3c8a['where']=_['merge'](_0x3a3c8a[_0x3794('0x3c')],{'$or':_[_0x3794('0x2f')](_0x1025a0,function(_0x5209c1){if(_0x5209c1[_0x3794('0x2d')]!=='VIRTUAL'){var _0x44414f={};_0x44414f[_0x5209c1[_0x3794('0x27')]]={'$like':'%'+_0x44fe69['query'][_0x3794('0x3e')]+'%'};return _0x44414f;}})});}_0x3a3c8a=_['merge']({},_0x3a3c8a,_0x44fe69[_0x3794('0x3f')]);var _0x301e21={'where':_0x3a3c8a[_0x3794('0x3c')]};return db[_0x3794('0x2a')][_0x3794('0x1d')](_0x301e21)[_0x3794('0x22')](function(_0x4f3808){_0x434dc3[_0x3794('0x1d')]=_0x4f3808;if(_0x44fe69[_0x3794('0x30')]['includeAll']){_0x3a3c8a[_0x3794('0x40')]=[{'all':!![]}];}return db[_0x3794('0x2a')][_0x3794('0x41')](_0x3a3c8a);})[_0x3794('0x22')](function(_0x188785){_0x434dc3[_0x3794('0x42')]=_0x188785;return _0x434dc3;})[_0x3794('0x22')](respondWithFilteredResult(_0x2045f5,_0x3a3c8a))['catch'](handleError(_0x2045f5,null));};exports[_0x3794('0x43')]=function(_0x3b2237,_0x357d97){var _0x36f023={'raw':![],'where':{'id':_0x3b2237[_0x3794('0x44')]['id']}},_0x30cdda={};_0x30cdda[_0x3794('0x34')]=_[_0x3794('0x31')](db['Automation'][_0x3794('0x2b')]);_0x30cdda[_0x3794('0x30')]=_['keys'](_0x3b2237[_0x3794('0x30')]);_0x30cdda['filters']=_[_0x3794('0x33')](_0x30cdda[_0x3794('0x34')],_0x30cdda['query']);_0x36f023['attributes']=_['intersection'](_0x30cdda[_0x3794('0x34')],qs[_0x3794('0x35')](_0x3b2237[_0x3794('0x30')]['fields']));_0x36f023[_0x3794('0x36')]=_0x36f023[_0x3794('0x36')]['length']?_0x36f023[_0x3794('0x36')]:_0x30cdda[_0x3794('0x34')];if(_0x3b2237['query'][_0x3794('0x45')]){_0x36f023[_0x3794('0x40')]=[{'all':!![]}];}_0x36f023=_['merge']({},_0x36f023,_0x3b2237[_0x3794('0x3f')]);return db[_0x3794('0x2a')]['find'](_0x36f023)[_0x3794('0x22')](handleEntityNotFound(_0x357d97,null))[_0x3794('0x22')](respondWithResult(_0x357d97,null))[_0x3794('0x46')](handleError(_0x357d97,null));};exports[_0x3794('0x47')]=function(_0x454149,_0x479fb1){return db['Automation'][_0x3794('0x47')](_0x454149[_0x3794('0x48')],{})[_0x3794('0x22')](respondWithResult(_0x479fb1,0xc9))[_0x3794('0x46')](handleError(_0x479fb1,null));};exports[_0x3794('0x21')]=function(_0x4f1dd5,_0x2a3a70){if(_0x4f1dd5['body']['id']){delete _0x4f1dd5[_0x3794('0x48')]['id'];}return db[_0x3794('0x2a')]['find']({'where':{'id':_0x4f1dd5[_0x3794('0x44')]['id']}})[_0x3794('0x22')](handleEntityNotFound(_0x2a3a70,null))[_0x3794('0x22')](saveUpdates(_0x4f1dd5['body'],null))['then'](respondWithResult(_0x2a3a70,null))[_0x3794('0x46')](handleError(_0x2a3a70,null));};exports[_0x3794('0x23')]=function(_0x453b42,_0x22f277){return db['Automation']['find']({'where':{'id':_0x453b42[_0x3794('0x44')]['id']}})['then'](handleEntityNotFound(_0x22f277,null))[_0x3794('0x22')](removeEntity(_0x22f277,null))[_0x3794('0x46')](handleError(_0x22f277,null));};exports['addConditions']=function(_0x57d1dd,_0x10a779,_0x1fcf7e){return db[_0x3794('0x49')]['find']({'where':{'id':_0x57d1dd['params']['id']}})[_0x3794('0x22')](handleEntityNotFound(_0x10a779,null))[_0x3794('0x22')](function(_0x1f2d79){if(_0x1f2d79){return _0x1f2d79[_0x3794('0x4a')](_0x57d1dd[_0x3794('0x48')][_0x3794('0x4b')],_[_0x3794('0x4c')](_0x57d1dd[_0x3794('0x48')],[_0x3794('0x4b'),'id'])||{});}})['then'](respondWithResult(_0x10a779,null))['catch'](handleError(_0x10a779,null));};exports[_0x3794('0x4d')]=function(_0x541ceb,_0x4f0b1b,_0x499208){var _0x1567b8={};var _0x30ea87={};var _0x1aed29;var _0x3ac82d;return db[_0x3794('0x2a')][_0x3794('0x4e')]({'where':{'id':_0x541ceb['params']['id']}})[_0x3794('0x22')](handleEntityNotFound(_0x4f0b1b,null))[_0x3794('0x22')](function(_0x6ca493){if(_0x6ca493){_0x1aed29=_0x6ca493;_0x30ea87[_0x3794('0x34')]=_[_0x3794('0x31')](db['Condition'][_0x3794('0x2b')]);_0x30ea87['query']=_[_0x3794('0x31')](_0x541ceb[_0x3794('0x30')]);_0x30ea87['filters']=_['intersection'](_0x30ea87[_0x3794('0x34')],_0x30ea87[_0x3794('0x30')]);_0x1567b8[_0x3794('0x36')]=_[_0x3794('0x33')](_0x30ea87[_0x3794('0x34')],qs[_0x3794('0x35')](_0x541ceb['query'][_0x3794('0x35')]));_0x1567b8['attributes']=_0x1567b8[_0x3794('0x36')][_0x3794('0x37')]?_0x1567b8[_0x3794('0x36')]:_0x30ea87[_0x3794('0x34')];_0x1567b8[_0x3794('0x3a')]=qs[_0x3794('0x3b')](_0x541ceb[_0x3794('0x30')][_0x3794('0x3b')]);_0x1567b8[_0x3794('0x3c')]=qs[_0x3794('0x32')](_['pick'](_0x541ceb['query'],_0x30ea87[_0x3794('0x32')]));if(_0x541ceb[_0x3794('0x30')][_0x3794('0x3e')]){_0x1567b8['where']=_[_0x3794('0x4f')](_0x1567b8[_0x3794('0x3c')],{'$or':_[_0x3794('0x2f')](_0x1567b8[_0x3794('0x36')],function(_0x5d9fac){var _0x1a129e={};_0x1a129e[_0x5d9fac]={'$like':'%'+_0x541ceb['query'][_0x3794('0x3e')]+'%'};return _0x1a129e;})});}_0x1567b8=_[_0x3794('0x4f')]({},_0x1567b8,_0x541ceb[_0x3794('0x3f')]);return _0x1aed29[_0x3794('0x4d')](_0x1567b8);}})[_0x3794('0x22')](function(_0x43a89e){if(_0x43a89e){_0x3ac82d=_0x43a89e['length'];if(!_0x541ceb[_0x3794('0x30')][_0x3794('0x38')](_0x3794('0x39'))){_0x1567b8[_0x3794('0x1b')]=qs[_0x3794('0x1b')](_0x541ceb[_0x3794('0x30')][_0x3794('0x1b')]);_0x1567b8['offset']=qs[_0x3794('0x1a')](_0x541ceb[_0x3794('0x30')][_0x3794('0x1a')]);}return _0x1aed29['getConditions'](_0x1567b8);}})[_0x3794('0x22')](function(_0xb0bb53){if(_0xb0bb53){return _0xb0bb53?{'count':_0x3ac82d,'rows':_0xb0bb53}:null;}})['then'](respondWithResult(_0x4f0b1b,null))[_0x3794('0x46')](handleError(_0x4f0b1b,null));};exports[_0x3794('0x50')]=function(_0x6b7f9c,_0x3c6579,_0x54f51e){return db[_0x3794('0x51')][_0x3794('0x52')]({'where':{'id':_0x6b7f9c[_0x3794('0x44')]['id']}})[_0x3794('0x22')](handleEntityNotFound(_0x3c6579,null))[_0x3794('0x22')](function(_0x2a9144){if(_0x2a9144){return _0x2a9144[_0x3794('0x50')](_0x6b7f9c['body'][_0x3794('0x4b')],_[_0x3794('0x4c')](_0x6b7f9c[_0x3794('0x48')],['ids','id'])||{});}})[_0x3794('0x22')](respondWithResult(_0x3c6579,null))[_0x3794('0x46')](handleError(_0x3c6579,null));};exports[_0x3794('0x53')]=function(_0x3a1fac,_0x3f0393,_0x272886){var _0x544618={};var _0xa68b2={};var _0x2ee4de;var _0x48a57a;return db[_0x3794('0x2a')][_0x3794('0x4e')]({'where':{'id':_0x3a1fac[_0x3794('0x44')]['id']}})[_0x3794('0x22')](handleEntityNotFound(_0x3f0393,null))[_0x3794('0x22')](function(_0x123dde){if(_0x123dde){_0x2ee4de=_0x123dde;_0xa68b2[_0x3794('0x34')]=_[_0x3794('0x31')](db[_0x3794('0x51')][_0x3794('0x2b')]);_0xa68b2[_0x3794('0x30')]=_[_0x3794('0x31')](_0x3a1fac[_0x3794('0x30')]);_0xa68b2[_0x3794('0x32')]=_['intersection'](_0xa68b2['model'],_0xa68b2['query']);_0x544618[_0x3794('0x36')]=_['intersection'](_0xa68b2[_0x3794('0x34')],qs[_0x3794('0x35')](_0x3a1fac['query'][_0x3794('0x35')]));_0x544618[_0x3794('0x36')]=_0x544618[_0x3794('0x36')][_0x3794('0x37')]?_0x544618[_0x3794('0x36')]:_0xa68b2[_0x3794('0x34')];_0x544618[_0x3794('0x3a')]=qs[_0x3794('0x3b')](_0x3a1fac[_0x3794('0x30')][_0x3794('0x3b')]);_0x544618[_0x3794('0x3c')]=qs[_0x3794('0x32')](_[_0x3794('0x3d')](_0x3a1fac[_0x3794('0x30')],_0xa68b2[_0x3794('0x32')]));if(_0x3a1fac[_0x3794('0x30')]['filter']){_0x544618[_0x3794('0x3c')]=_[_0x3794('0x4f')](_0x544618[_0x3794('0x3c')],{'$or':_['map'](_0x544618[_0x3794('0x36')],function(_0x4c5042){var _0x3d902d={};_0x3d902d[_0x4c5042]={'$like':'%'+_0x3a1fac[_0x3794('0x30')][_0x3794('0x3e')]+'%'};return _0x3d902d;})});}_0x544618=_[_0x3794('0x4f')]({},_0x544618,_0x3a1fac[_0x3794('0x3f')]);return _0x2ee4de[_0x3794('0x53')](_0x544618);}})[_0x3794('0x22')](function(_0x5b1a54){if(_0x5b1a54){_0x48a57a=_0x5b1a54[_0x3794('0x37')];if(!_0x3a1fac[_0x3794('0x30')]['hasOwnProperty']('nolimit')){_0x544618[_0x3794('0x1b')]=qs[_0x3794('0x1b')](_0x3a1fac[_0x3794('0x30')][_0x3794('0x1b')]);_0x544618[_0x3794('0x1a')]=qs['offset'](_0x3a1fac[_0x3794('0x30')][_0x3794('0x1a')]);}return _0x2ee4de['getActions'](_0x544618);}})[_0x3794('0x22')](function(_0x5035cf){if(_0x5035cf){return _0x5035cf?{'count':_0x48a57a,'rows':_0x5035cf}:null;}})['then'](respondWithResult(_0x3f0393,null))[_0x3794('0x46')](handleError(_0x3f0393,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 97a871e..6f41c2b 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 _0xfb84=['Automation','lodash','util','../../config/logger','api','moment','request-promise','rimraf','exports','define'];(function(_0x5d3e47,_0x27c60e){var _0x588ff6=function(_0x3678bf){while(--_0x3678bf){_0x5d3e47['push'](_0x5d3e47['shift']());}};_0x588ff6(++_0x27c60e);}(_0xfb84,0xfb));var _0x4fb8=function(_0x2a55f8,_0x540ac4){_0x2a55f8=_0x2a55f8-0x0;var _0x245efd=_0xfb84[_0x2a55f8];return _0x245efd;};'use strict';var _=require(_0x4fb8('0x0'));var util=require(_0x4fb8('0x1'));var logger=require(_0x4fb8('0x2'))(_0x4fb8('0x3'));var moment=require(_0x4fb8('0x4'));var BPromise=require('bluebird');var rp=require(_0x4fb8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4fb8('0x6'));var config=require('../../config/environment');var attributes=require('./automation.attributes');module[_0x4fb8('0x7')]=function(_0x521089,_0x4695ab){return _0x521089[_0x4fb8('0x8')](_0x4fb8('0x9'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x938a=['request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','lodash','api','bluebird'];(function(_0x4dab14,_0x164ea0){var _0xf41aa=function(_0x305d50){while(--_0x305d50){_0x4dab14['push'](_0x4dab14['shift']());}};_0xf41aa(++_0x164ea0);}(_0x938a,0x14d));var _0xa938=function(_0x14a880,_0x53a466){_0x14a880=_0x14a880-0x0;var _0x259843=_0x938a[_0x14a880];return _0x259843;};'use strict';var _=require(_0xa938('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa938('0x1'));var moment=require('moment');var BPromise=require(_0xa938('0x2'));var rp=require(_0xa938('0x3'));var fs=require('fs');var path=require(_0xa938('0x4'));var rimraf=require(_0xa938('0x5'));var config=require(_0xa938('0x6'));var attributes=require(_0xa938('0x7'));module[_0xa938('0x8')]=function(_0x133c56,_0x47c77f){return _0x133c56[_0xa938('0x9')](_0xa938('0xa'),attributes,{'tableName':_0xa938('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index 2fdaf61..4704225 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 _0x4ccb=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util'];(function(_0x4a85a6,_0x2bda1c){var _0x5b7080=function(_0xc4b84e){while(--_0xc4b84e){_0x4a85a6['push'](_0x4a85a6['shift']());}};_0x5b7080(++_0x2bda1c);}(_0x4ccb,0x196));var _0xb4cc=function(_0x26488f,_0x4ae4e9){_0x26488f=_0x26488f-0x0;var _0x29802a=_0x4ccb[_0x26488f];return _0x29802a;};'use strict';var _=require(_0xb4cc('0x0'));var util=require(_0xb4cc('0x1'));var moment=require(_0xb4cc('0x2'));var BPromise=require('bluebird');var rs=require(_0xb4cc('0x3'));var fs=require('fs');var Redis=require(_0xb4cc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb4cc('0x5'));var logger=require(_0xb4cc('0x6'))(_0xb4cc('0x7'));var config=require('../../config/environment');var jayson=require(_0xb4cc('0x8'));var client=jayson[_0xb4cc('0x9')][_0xb4cc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5c0bdd,_0x370b12,_0x6ba3bf){return new BPromise(function(_0x2129ef,_0x5327a4){return client[_0xb4cc('0xb')](_0x5c0bdd,_0x6ba3bf)[_0xb4cc('0xc')](function(_0xbf893){logger[_0xb4cc('0xd')](_0xb4cc('0xe'),_0x370b12,'request\x20sent');logger[_0xb4cc('0xf')](_0xb4cc('0x10'),_0x370b12,'request\x20sent',JSON[_0xb4cc('0x11')](_0xbf893));if(_0xbf893['error']){if(_0xbf893[_0xb4cc('0x12')][_0xb4cc('0x13')]===0x1f4){logger[_0xb4cc('0x12')]('Automation,\x20%s,\x20%s',_0x370b12,_0xbf893['error'][_0xb4cc('0x14')]);return _0x5327a4(_0xbf893['error']['message']);}logger[_0xb4cc('0x12')]('Automation,\x20%s,\x20%s',_0x370b12,_0xbf893['error'][_0xb4cc('0x14')]);return _0x2129ef(_0xbf893[_0xb4cc('0x12')][_0xb4cc('0x14')]);}else{logger['info'](_0xb4cc('0xe'),_0x370b12,_0xb4cc('0x15'));_0x2129ef(_0xbf893[_0xb4cc('0x16')][_0xb4cc('0x14')]);}})[_0xb4cc('0x17')](function(_0x506ef9){logger[_0xb4cc('0x12')](_0xb4cc('0xe'),_0x370b12,_0x506ef9);_0x5327a4(_0x506ef9);});});}
\ No newline at end of file
+var _0xb8cb=['info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0xb8cb,0xd9));var _0xbb8c=function(_0x3d18cf,_0x285c01){_0x3d18cf=_0x3d18cf-0x0;var _0x47943a=_0xb8cb[_0x3d18cf];return _0x47943a;};'use strict';var _=require(_0xbb8c('0x0'));var util=require(_0xbb8c('0x1'));var moment=require(_0xbb8c('0x2'));var BPromise=require(_0xbb8c('0x3'));var rs=require(_0xbb8c('0x4'));var fs=require('fs');var Redis=require(_0xbb8c('0x5'));var db=require(_0xbb8c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xbb8c('0x7'))(_0xbb8c('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbb8c('0x9')][_0xbb8c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3eb759,_0x497956,_0x31224b){return new BPromise(function(_0x3eda24,_0x11d365){return client[_0xbb8c('0xb')](_0x3eb759,_0x31224b)[_0xbb8c('0xc')](function(_0x2a9791){logger[_0xbb8c('0xd')](_0xbb8c('0xe'),_0x497956,_0xbb8c('0xf'));logger[_0xbb8c('0x10')](_0xbb8c('0x11'),_0x497956,_0xbb8c('0xf'),JSON['stringify'](_0x2a9791));if(_0x2a9791[_0xbb8c('0x12')]){if(_0x2a9791[_0xbb8c('0x12')][_0xbb8c('0x13')]===0x1f4){logger[_0xbb8c('0x12')](_0xbb8c('0xe'),_0x497956,_0x2a9791['error'][_0xbb8c('0x14')]);return _0x11d365(_0x2a9791[_0xbb8c('0x12')][_0xbb8c('0x14')]);}logger[_0xbb8c('0x12')](_0xbb8c('0xe'),_0x497956,_0x2a9791[_0xbb8c('0x12')][_0xbb8c('0x14')]);return _0x3eda24(_0x2a9791['error'][_0xbb8c('0x14')]);}else{logger[_0xbb8c('0xd')](_0xbb8c('0xe'),_0x497956,_0xbb8c('0xf'));_0x3eda24(_0x2a9791[_0xbb8c('0x15')][_0xbb8c('0x14')]);}})[_0xbb8c('0x16')](function(_0x3988cf){logger[_0xbb8c('0x12')](_0xbb8c('0xe'),_0x497956,_0x3988cf);_0x11d365(_0x3988cf);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 88baf36..ff87047 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 _0x2121=['getConditions','/:id/actions','create','post','addConditions','addActions','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','isAuthenticated','index','get','/:id','show','/:id/conditions'];(function(_0xf48cce,_0x3531e4){var _0x2a5c38=function(_0x22a454){while(--_0x22a454){_0xf48cce['push'](_0xf48cce['shift']());}};_0x2a5c38(++_0x3531e4);}(_0x2121,0x1b4));var _0x1212=function(_0x3760a4,_0x3329f5){_0x3760a4=_0x3760a4-0x0;var _0x1f8c66=_0x2121[_0x3760a4];return _0x1f8c66;};'use strict';var multer=require(_0x1212('0x0'));var util=require(_0x1212('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1212('0x2'));var router=express[_0x1212('0x3')]();var fs_extra=require(_0x1212('0x4'));var auth=require(_0x1212('0x5'));var interaction=require(_0x1212('0x6'));var config=require('../../config/environment');var controller=require(_0x1212('0x7'));router['get']('/',auth[_0x1212('0x8')](),controller[_0x1212('0x9')]);router[_0x1212('0xa')](_0x1212('0xb'),auth[_0x1212('0x8')](),controller[_0x1212('0xc')]);router['get'](_0x1212('0xd'),auth[_0x1212('0x8')](),controller[_0x1212('0xe')]);router[_0x1212('0xa')](_0x1212('0xf'),auth[_0x1212('0x8')](),controller['getActions']);router['post']('/',auth[_0x1212('0x8')](),controller[_0x1212('0x10')]);router[_0x1212('0x11')](_0x1212('0xd'),auth['isAuthenticated'](),controller[_0x1212('0x12')]);router[_0x1212('0x11')](_0x1212('0xf'),auth[_0x1212('0x8')](),controller[_0x1212('0x13')]);router[_0x1212('0x14')](_0x1212('0xb'),auth[_0x1212('0x8')](),controller[_0x1212('0x15')]);router[_0x1212('0x16')](_0x1212('0xb'),auth[_0x1212('0x8')](),controller[_0x1212('0x17')]);module[_0x1212('0x18')]=router;
\ No newline at end of file
+var _0x5859=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','/:id','/:id/conditions','/:id/actions','getActions','post','addConditions','addActions','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x51b8eb,_0x45e664){var _0x219949=function(_0x21d965){while(--_0x21d965){_0x51b8eb['push'](_0x51b8eb['shift']());}};_0x219949(++_0x45e664);}(_0x5859,0xc4));var _0x9585=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0x5859[_0x2aa0e7];return _0x1472c0;};'use strict';var multer=require(_0x9585('0x0'));var util=require(_0x9585('0x1'));var path=require(_0x9585('0x2'));var timeout=require(_0x9585('0x3'));var express=require(_0x9585('0x4'));var router=express[_0x9585('0x5')]();var fs_extra=require(_0x9585('0x6'));var auth=require(_0x9585('0x7'));var interaction=require(_0x9585('0x8'));var config=require(_0x9585('0x9'));var controller=require(_0x9585('0xa'));router[_0x9585('0xb')]('/',auth[_0x9585('0xc')](),controller['index']);router[_0x9585('0xb')](_0x9585('0xd'),auth[_0x9585('0xc')](),controller['show']);router[_0x9585('0xb')](_0x9585('0xe'),auth['isAuthenticated'](),controller['getConditions']);router[_0x9585('0xb')](_0x9585('0xf'),auth[_0x9585('0xc')](),controller[_0x9585('0x10')]);router['post']('/',auth[_0x9585('0xc')](),controller['create']);router[_0x9585('0x11')](_0x9585('0xe'),auth[_0x9585('0xc')](),controller[_0x9585('0x12')]);router[_0x9585('0x11')](_0x9585('0xf'),auth['isAuthenticated'](),controller[_0x9585('0x13')]);router[_0x9585('0x14')](_0x9585('0xd'),auth['isAuthenticated'](),controller[_0x9585('0x15')]);router[_0x9585('0x16')](_0x9585('0xd'),auth['isAuthenticated'](),controller[_0x9585('0x17')]);module[_0x9585('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index de3e586..2b62823 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 _0xba8e=['#AMD\x20Maximum\x20Word\x20Length','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','always','onlyIfOpen','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words'];(function(_0x4da93f,_0x924ad7){var _0x7e1408=function(_0x51cabc){while(--_0x51cabc){_0x4da93f['push'](_0x4da93f['shift']());}};_0x7e1408(++_0x924ad7);}(_0xba8e,0xa1));var _0xeba8=function(_0x554047,_0x46ec41){_0x554047=_0x554047-0x0;var _0x5d11e4=_0xba8e[_0x554047];return _0x5d11e4;};'use strict';var Sequelize=require(_0xeba8('0x0'));module[_0xeba8('0x1')]={'name':{'type':Sequelize[_0xeba8('0x2')],'unique':_0xeba8('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xeba8('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xeba8('0x2')]},'active':{'type':Sequelize[_0xeba8('0x5')],'defaultValue':0x0,'comment':_0xeba8('0x6')},'limitCalls':{'type':Sequelize[_0xeba8('0x7')](0x4)[_0xeba8('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xeba8('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0xeba8('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xeba8('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xeba8('0x7')](0x3)[_0xeba8('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xeba8('0x7')](0x3)[_0xeba8('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xeba8('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xeba8('0x7')](0x5)[_0xeba8('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xeba8('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xeba8('0x7')](0x3)[_0xeba8('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xeba8('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xeba8('0x7')](0x5)[_0xeba8('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xeba8('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xeba8('0x7')](0x5)[_0xeba8('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xeba8('0x7')](0x3)[_0xeba8('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xeba8('0xe')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xeba8('0x2')],'defaultValue':_0xeba8('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0xeba8('0x10')](_0xeba8('0x11'),'never',_0xeba8('0x12')),'defaultValue':_0xeba8('0x11')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xeba8('0x7')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xeba8('0x7')](0x9)[_0xeba8('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xeba8('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xeba8('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xeba8('0x7')](0x9)[_0xeba8('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xeba8('0x14')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xeba8('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xeba8('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xeba8('0x7')](0x9)[_0xeba8('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xeba8('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xeba8('0x7')](0x9)[_0xeba8('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xeba8('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xeba8('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xeba8('0x7')](0x9)[_0xeba8('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xeba8('0x18')},'dialOrderByScheduledAt':{'type':Sequelize[_0xeba8('0x10')]('DESC',_0xeba8('0x19')),'defaultValue':_0xeba8('0x1a')},'dialPrefix':{'type':Sequelize[_0xeba8('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xeba8('0x1b')},'dialCutDigit':{'type':Sequelize[_0xeba8('0x7')](0x3)[_0xeba8('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xeba8('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xeba8('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xeba8('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xeba8('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xeba8('0x1e')},'dialDropMaxRetry':{'type':Sequelize[_0xeba8('0x7')](0x3)[_0xeba8('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xeba8('0x1f')},'dialDropRetryFrequency':{'type':Sequelize[_0xeba8('0x7')](0x5)[_0xeba8('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xeba8('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xeba8('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xeba8('0x7')](0x5)[_0xeba8('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xeba8('0x7')](0x3)[_0xeba8('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xeba8('0x21')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xeba8('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xeba8('0x7')](0x3)[_0xeba8('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xeba8('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xeba8('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xeba8('0x24')}};
\ No newline at end of file
+var _0x39bb=['#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','exports','STRING','name','ENUM','ivr','BOOLEAN','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x3754fb,_0x12ff0e){var _0x292964=function(_0x26c8f1){while(--_0x26c8f1){_0x3754fb['push'](_0x3754fb['shift']());}};_0x292964(++_0x12ff0e);}(_0x39bb,0xe7));var _0xb39b=function(_0x4f6f84,_0x31e197){_0x4f6f84=_0x4f6f84-0x0;var _0x20d989=_0x39bb[_0x4f6f84];return _0x20d989;};'use strict';var Sequelize=require('sequelize');module[_0xb39b('0x0')]={'name':{'type':Sequelize[_0xb39b('0x1')],'unique':_0xb39b('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xb39b('0x3')](_0xb39b('0x4')),'allowNull':![],'defaultValue':_0xb39b('0x4')},'description':{'type':Sequelize[_0xb39b('0x1')]},'active':{'type':Sequelize[_0xb39b('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0xb39b('0x6')](0x4)[_0xb39b('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xb39b('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xb39b('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xb39b('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xb39b('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb39b('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xb39b('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb39b('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xb39b('0x6')](0x5)[_0xb39b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb39b('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xb39b('0x6')](0x3)[_0xb39b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb39b('0xc')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb39b('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xb39b('0x6')](0x3)[_0xb39b('0x7')],'defaultValue':0x3,'comment':_0xb39b('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xb39b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb39b('0xf')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb39b('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xb39b('0x10')},'dialTimezone':{'type':Sequelize[_0xb39b('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xb39b('0x1')],'defaultValue':_0xb39b('0x11')},'dialCheckDuplicateType':{'type':Sequelize[_0xb39b('0x3')](_0xb39b('0x12'),_0xb39b('0x13'),_0xb39b('0x14')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xb39b('0x5')],'defaultValue':0x0,'comment':_0xb39b('0x15')},'dialAMDInitialSilence':{'type':Sequelize[_0xb39b('0x6')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xb39b('0x6')](0x9)[_0xb39b('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xb39b('0x6')](0x9)[_0xb39b('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xb39b('0x6')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xb39b('0x6')](0x9)[_0xb39b('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xb39b('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xb39b('0x6')](0x9)[_0xb39b('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xb39b('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xb39b('0x6')](0x5)[_0xb39b('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xb39b('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xb39b('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xb39b('0x3')](_0xb39b('0x19'),_0xb39b('0x1a')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xb39b('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xb39b('0x6')](0x3)[_0xb39b('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb39b('0x1b')},'dialCutDigit':{'type':Sequelize[_0xb39b('0x6')](0x3)[_0xb39b('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb39b('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xb39b('0x6')](0x3)[_0xb39b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb39b('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xb39b('0x6')](0x5)[_0xb39b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb39b('0x1e')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb39b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xb39b('0x6')](0x3)[_0xb39b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb39b('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xb39b('0x6')](0x5)[_0xb39b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xb39b('0x6')](0x3)[_0xb39b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb39b('0x20')},'dialMachineRetryFrequency':{'type':Sequelize[_0xb39b('0x6')](0x5)[_0xb39b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb39b('0x21')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb39b('0x22')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xb39b('0x6')](0x5)[_0xb39b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index c928074..f217099 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 _0xd4dc=['get','IvrCampaigns','end','error','stack','name','send','index','Campaign','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','findAll','rows','catch','show','rawAttributes','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','include','updatedAt','omit','createdAt','findOne','nolimit','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','format','ids','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','onlyIfOpen','into','COALESCE(phone,\x27\x27)','cm_hopper_additional_phones','cmHopperId','h.id','ci.item','ci.OrderBY','OrderBy','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','push','sequelize','all','removeLists','destroy','getBlackLists','CmList','YYYY-MM-DD\x20HH:mm:ss','addBlackLists','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','set','apply','reject','save','update','then'];(function(_0x21e574,_0x4730c3){var _0x676b77=function(_0x2c4c46){while(--_0x2c4c46){_0x21e574['push'](_0x21e574['shift']());}};_0x676b77(++_0x4730c3);}(_0xd4dc,0xff));var _0xcd4d=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0xd4dc[_0x4dc7b9];return _0x3ab114;};'use strict';var emlformat=require(_0xcd4d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcd4d('0x1'));var jsonpatch=require(_0xcd4d('0x2'));var rp=require(_0xcd4d('0x3'));var moment=require(_0xcd4d('0x4'));var BPromise=require(_0xcd4d('0x5'));var Mustache=require(_0xcd4d('0x6'));var util=require(_0xcd4d('0x7'));var path=require('path');var sox=require(_0xcd4d('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcd4d('0x9'));var _=require('lodash');var squel=require(_0xcd4d('0xa'));var crypto=require(_0xcd4d('0xb'));var jsforce=require(_0xcd4d('0xc'));var deskjs=require(_0xcd4d('0xd'));var toCsv=require(_0xcd4d('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcd4d('0xf'));var authService=require(_0xcd4d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xcd4d('0x11'));var hardwareService=require(_0xcd4d('0x12'));var logger=require(_0xcd4d('0x13'))('api');var utils=require(_0xcd4d('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xcd4d('0x15'));var db=require(_0xcd4d('0x16'))['db'];function respondWithStatusCode(_0x3d3019,_0x1604e3){_0x1604e3=_0x1604e3||0xcc;return function(_0x10fb9e){if(_0x10fb9e){return _0x3d3019['sendStatus'](_0x1604e3);}return _0x3d3019['status'](_0x1604e3)['end']();};}function respondWithResult(_0x316215,_0x44d095){_0x44d095=_0x44d095||0xc8;return function(_0x36afd0){if(_0x36afd0){return _0x316215[_0xcd4d('0x17')](_0x44d095)[_0xcd4d('0x18')](_0x36afd0);}};}function respondWithFilteredResult(_0x464e7,_0xc4cf9b){return function(_0x3cf713){if(_0x3cf713){var _0x27bf0c=typeof _0xc4cf9b[_0xcd4d('0x19')]==='undefined'&&typeof _0xc4cf9b[_0xcd4d('0x1a')]===_0xcd4d('0x1b');var _0x1e7b6c=_0x3cf713[_0xcd4d('0x1c')];var _0x470e42=_0x27bf0c?0x0:_0xc4cf9b[_0xcd4d('0x19')];var _0x32ac99=_0x27bf0c?_0x3cf713[_0xcd4d('0x1c')]:_0xc4cf9b[_0xcd4d('0x19')]+_0xc4cf9b[_0xcd4d('0x1a')];var _0x263172;if(_0x32ac99>=_0x1e7b6c){_0x32ac99=_0x1e7b6c;_0x263172=0xc8;}else{_0x263172=0xce;}_0x464e7[_0xcd4d('0x17')](_0x263172);return _0x464e7[_0xcd4d('0x1d')]('Content-Range',_0x470e42+'-'+_0x32ac99+'/'+_0x1e7b6c)[_0xcd4d('0x18')](_0x3cf713);}return null;};}function patchUpdates(_0x1d7cdf){return function(_0x15935b){try{jsonpatch[_0xcd4d('0x1e')](_0x15935b,_0x1d7cdf,!![]);}catch(_0x2a4ee3){return BPromise[_0xcd4d('0x1f')](_0x2a4ee3);}return _0x15935b[_0xcd4d('0x20')]();};}function saveUpdates(_0x108919,_0x42f0f9){return function(_0x1f3e88){if(_0x1f3e88){return _0x1f3e88[_0xcd4d('0x21')](_0x108919)['then'](function(_0x22b562){return _0x22b562;});}return null;};}function removeEntity(_0x4fa4ad,_0x1f7026){return function(_0x770ec6){if(_0x770ec6){return _0x770ec6['destroy']()[_0xcd4d('0x22')](function(){var _0x5e911a=_0x770ec6[_0xcd4d('0x23')]({'plain':!![]});var _0xdc7660=_0xcd4d('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0xdc7660,'resourceId':_0x5e911a['id']}})['then'](function(){return _0x770ec6;});})[_0xcd4d('0x22')](function(){_0x4fa4ad[_0xcd4d('0x17')](0xcc)[_0xcd4d('0x25')]();});}};}function handleEntityNotFound(_0xf9e37e,_0x35d7e5){return function(_0x4d5c84){if(!_0x4d5c84){_0xf9e37e['sendStatus'](0x194);}return _0x4d5c84;};}function handleError(_0x28da5c,_0x6a999c){_0x6a999c=_0x6a999c||0x1f4;return function(_0x4adcb5){logger[_0xcd4d('0x26')](_0x4adcb5[_0xcd4d('0x27')]);if(_0x4adcb5[_0xcd4d('0x28')]){delete _0x4adcb5[_0xcd4d('0x28')];}_0x28da5c[_0xcd4d('0x17')](_0x6a999c)[_0xcd4d('0x29')](_0x4adcb5);};}exports[_0xcd4d('0x2a')]=function(_0x529d48,_0x319689){var _0x10bdfa={},_0x4a2cf4={},_0xe150ec={'count':0x0,'rows':[]};var _0x490012=_['map'](db[_0xcd4d('0x2b')]['rawAttributes'],function(_0x2f1f64){return{'name':_0x2f1f64[_0xcd4d('0x2c')],'type':_0x2f1f64[_0xcd4d('0x2d')][_0xcd4d('0x2e')]};});_0x4a2cf4[_0xcd4d('0x2f')]=_[_0xcd4d('0x30')](_0x490012,_0xcd4d('0x28'));_0x4a2cf4[_0xcd4d('0x31')]=_[_0xcd4d('0x32')](_0x529d48[_0xcd4d('0x31')]);_0x4a2cf4[_0xcd4d('0x33')]=_[_0xcd4d('0x34')](_0x4a2cf4[_0xcd4d('0x2f')],_0x4a2cf4[_0xcd4d('0x31')]);_0x10bdfa[_0xcd4d('0x35')]=_[_0xcd4d('0x34')](_0x4a2cf4[_0xcd4d('0x2f')],qs[_0xcd4d('0x36')](_0x529d48['query'][_0xcd4d('0x36')]));_0x10bdfa['attributes']=_0x10bdfa[_0xcd4d('0x35')][_0xcd4d('0x37')]?_0x10bdfa[_0xcd4d('0x35')]:_0x4a2cf4['model'];if(!_0x529d48['query'][_0xcd4d('0x38')]('nolimit')){_0x10bdfa[_0xcd4d('0x1a')]=qs[_0xcd4d('0x1a')](_0x529d48[_0xcd4d('0x31')][_0xcd4d('0x1a')]);_0x10bdfa[_0xcd4d('0x19')]=qs[_0xcd4d('0x19')](_0x529d48['query'][_0xcd4d('0x19')]);}_0x10bdfa[_0xcd4d('0x39')]=qs[_0xcd4d('0x3a')](_0x529d48['query'][_0xcd4d('0x3a')]);_0x10bdfa[_0xcd4d('0x3b')]=qs[_0xcd4d('0x33')](_[_0xcd4d('0x3c')](_0x529d48['query'],_0x4a2cf4[_0xcd4d('0x33')]),_0x490012);if(_0x529d48[_0xcd4d('0x31')]['filter']){_0x10bdfa[_0xcd4d('0x3b')]=_[_0xcd4d('0x3d')](_0x10bdfa['where'],{'$or':_['map'](_0x490012,function(_0x4353dd){if(_0x4353dd[_0xcd4d('0x2d')]!==_0xcd4d('0x3e')){var _0x3349d6={};_0x3349d6[_0x4353dd[_0xcd4d('0x28')]]={'$like':'%'+_0x529d48[_0xcd4d('0x31')][_0xcd4d('0x3f')]+'%'};return _0x3349d6;}})});}_0x10bdfa=_[_0xcd4d('0x3d')]({},_0x10bdfa,_0x529d48['options']);var _0x4cf9d2={'where':_0x10bdfa[_0xcd4d('0x3b')]};return db['Campaign'][_0xcd4d('0x1c')](_0x4cf9d2)[_0xcd4d('0x22')](function(_0x234a59){_0xe150ec[_0xcd4d('0x1c')]=_0x234a59;if(_0x529d48[_0xcd4d('0x31')][_0xcd4d('0x40')]){_0x10bdfa['include']=[{'all':!![]}];}return db[_0xcd4d('0x2b')][_0xcd4d('0x41')](_0x10bdfa);})[_0xcd4d('0x22')](function(_0x43faea){_0xe150ec[_0xcd4d('0x42')]=_0x43faea;return _0xe150ec;})[_0xcd4d('0x22')](respondWithFilteredResult(_0x319689,_0x10bdfa))[_0xcd4d('0x43')](handleError(_0x319689,null));};exports[_0xcd4d('0x44')]=function(_0x568bf3,_0x51cf1d){var _0x2e1f9a={'raw':![],'where':{'id':_0x568bf3['params']['id']}},_0x25ee24={};_0x25ee24[_0xcd4d('0x2f')]=_[_0xcd4d('0x32')](db[_0xcd4d('0x2b')][_0xcd4d('0x45')]);_0x25ee24['query']=_[_0xcd4d('0x32')](_0x568bf3[_0xcd4d('0x31')]);_0x25ee24[_0xcd4d('0x33')]=_['intersection'](_0x25ee24[_0xcd4d('0x2f')],_0x25ee24['query']);_0x2e1f9a['attributes']=_[_0xcd4d('0x34')](_0x25ee24[_0xcd4d('0x2f')],qs[_0xcd4d('0x36')](_0x568bf3[_0xcd4d('0x31')][_0xcd4d('0x36')]));_0x2e1f9a['attributes']=_0x2e1f9a[_0xcd4d('0x35')][_0xcd4d('0x37')]?_0x2e1f9a[_0xcd4d('0x35')]:_0x25ee24['model'];if(_0x568bf3['query']['includeAll']){_0x2e1f9a['include']=[{'all':!![]}];}_0x2e1f9a=_[_0xcd4d('0x3d')]({},_0x2e1f9a,_0x568bf3[_0xcd4d('0x46')]);return db[_0xcd4d('0x2b')][_0xcd4d('0x47')](_0x2e1f9a)[_0xcd4d('0x22')](handleEntityNotFound(_0x51cf1d,null))[_0xcd4d('0x22')](respondWithResult(_0x51cf1d,null))[_0xcd4d('0x43')](handleError(_0x51cf1d,null));};exports[_0xcd4d('0x48')]=function(_0x4a2575,_0x54f14f){return db[_0xcd4d('0x2b')][_0xcd4d('0x48')](_0x4a2575[_0xcd4d('0x49')],{})[_0xcd4d('0x22')](function(_0x2fcf40){var _0x51c6d4=_0x4a2575[_0xcd4d('0x4a')][_0xcd4d('0x23')]({'plain':!![]});if(!_0x51c6d4)throw new Error(_0xcd4d('0x4b'));if(_0x51c6d4['role']===_0xcd4d('0x4a')){var _0x2bcaef=_0x2fcf40[_0xcd4d('0x23')]({'plain':!![]});var _0x10c9a4=_0xcd4d('0x24');return db[_0xcd4d('0x4c')][_0xcd4d('0x47')]({'where':{'name':_0x10c9a4,'userProfileId':_0x51c6d4[_0xcd4d('0x4d')]},'raw':!![]})[_0xcd4d('0x22')](function(_0x1844cb){if(_0x1844cb&&_0x1844cb[_0xcd4d('0x4e')]===0x0){return db[_0xcd4d('0x4f')][_0xcd4d('0x48')]({'name':_0x2bcaef['name'],'resourceId':_0x2bcaef['id'],'type':_0x1844cb[_0xcd4d('0x28')],'sectionId':_0x1844cb['id']},{})['then'](function(){return _0x2fcf40;});}else{return _0x2fcf40;}})['catch'](function(_0x43a24f){logger[_0xcd4d('0x26')](_0xcd4d('0x50'),_0x43a24f);throw _0x43a24f;});}return _0x2fcf40;})[_0xcd4d('0x22')](respondWithResult(_0x54f14f,0xc9))[_0xcd4d('0x43')](handleError(_0x54f14f,null));};exports[_0xcd4d('0x51')]=function(_0x50bcfe,_0x333e8c){var _0x48a17a={'where':{'id':_0x50bcfe[_0xcd4d('0x52')]['id']}},_0x1546e0={};_0x1546e0[_0xcd4d('0x2f')]=_['keys'](db[_0xcd4d('0x2b')][_0xcd4d('0x45')]);_0x48a17a[_0xcd4d('0x35')]=_['intersection'](_0x1546e0['model'],qs[_0xcd4d('0x36')](_0x50bcfe[_0xcd4d('0x31')]['fields']));_0x48a17a[_0xcd4d('0x35')]=_0x48a17a[_0xcd4d('0x35')][_0xcd4d('0x37')]?_0x48a17a[_0xcd4d('0x35')]:_0x1546e0[_0xcd4d('0x2f')];if(_0x50bcfe[_0xcd4d('0x31')][_0xcd4d('0x40')]){_0x48a17a[_0xcd4d('0x53')]=[{'all':!![]}];}_0x48a17a=_[_0xcd4d('0x3d')]({},_0x48a17a,_0x50bcfe['options']);return db[_0xcd4d('0x2b')][_0xcd4d('0x47')](_0x48a17a)[_0xcd4d('0x22')](handleEntityNotFound(_0x333e8c,null))[_0xcd4d('0x22')](function(_0x1857f2){if(_0x1857f2){var _0x425d66=_0x1857f2['get']({'plain':!![]});_0x425d66=qs['omit'](_0x425d66,['id','createdAt',_0xcd4d('0x54')]);_0x50bcfe[_0xcd4d('0x49')]=_[_0xcd4d('0x55')](_0x50bcfe[_0xcd4d('0x49')],['id',_0xcd4d('0x56'),_0xcd4d('0x54')]);return db[_0xcd4d('0x2b')][_0xcd4d('0x48')](_[_0xcd4d('0x3d')](_0x425d66,_0x50bcfe[_0xcd4d('0x49')]),{'include':_0x50bcfe['query'][_0xcd4d('0x40')]?[{'all':!![]}]:undefined})[_0xcd4d('0x22')](function(_0x145af1){var _0x8b8ab8=_0x50bcfe['user']['get']({'plain':!![]});if(!_0x8b8ab8)throw new Error(_0xcd4d('0x4b'));if(_0x8b8ab8['role']==='user'){var _0x14ccb7=_0x145af1[_0xcd4d('0x23')]({'plain':!![]});var _0x3074d7='IvrCampaigns';return db[_0xcd4d('0x4c')][_0xcd4d('0x47')]({'where':{'name':_0x3074d7,'userProfileId':_0x8b8ab8[_0xcd4d('0x4d')]},'raw':!![]})[_0xcd4d('0x22')](function(_0x3ae722){if(_0x3ae722&&_0x3ae722['autoAssociation']===0x0){return db['UserProfileResource'][_0xcd4d('0x48')]({'name':_0x14ccb7[_0xcd4d('0x28')],'resourceId':_0x14ccb7['id'],'type':_0x3ae722['name'],'sectionId':_0x3ae722['id']},{})[_0xcd4d('0x22')](function(){return _0x145af1;});}else{return _0x145af1;}})['catch'](function(_0x1c4e46){logger['error'](_0xcd4d('0x50'),_0x1c4e46);throw _0x1c4e46;});}return _0x145af1;});}})[_0xcd4d('0x22')](respondWithResult(_0x333e8c,0xc9))[_0xcd4d('0x43')](handleError(_0x333e8c,null));};exports['update']=function(_0xfff2fb,_0x2adf9c){if(_0xfff2fb['body']['id']){delete _0xfff2fb[_0xcd4d('0x49')]['id'];}return db[_0xcd4d('0x2b')][_0xcd4d('0x47')]({'where':{'id':_0xfff2fb['params']['id']}})[_0xcd4d('0x22')](handleEntityNotFound(_0x2adf9c,null))[_0xcd4d('0x22')](saveUpdates(_0xfff2fb[_0xcd4d('0x49')],null))[_0xcd4d('0x22')](respondWithResult(_0x2adf9c,null))['catch'](handleError(_0x2adf9c,null));};exports['destroy']=function(_0x452e82,_0x289838){return db['Campaign']['find']({'where':{'id':_0x452e82[_0xcd4d('0x52')]['id']}})['then'](handleEntityNotFound(_0x289838,null))[_0xcd4d('0x22')](removeEntity(_0x289838,null))[_0xcd4d('0x43')](handleError(_0x289838,null));};exports['getHoppers']=function(_0x409a3a,_0x1cb0a9,_0x56a0f1){var _0x25cd0c={'raw':!![],'where':{}};var _0x1a2169={};var _0x4aab35={'count':0x0,'rows':[]};return db['Campaign'][_0xcd4d('0x57')]({'where':{'id':_0x409a3a[_0xcd4d('0x52')]['id']}})['then'](handleEntityNotFound(_0x1cb0a9,null))['then'](function(_0x502783){if(_0x502783){_0x1a2169['model']=_['keys'](db['CmHopper']['rawAttributes']);_0x1a2169[_0xcd4d('0x31')]=_[_0xcd4d('0x32')](_0x409a3a['query']);_0x1a2169['filters']=_[_0xcd4d('0x34')](_0x1a2169[_0xcd4d('0x2f')],_0x1a2169[_0xcd4d('0x31')]);_0x25cd0c['attributes']=_[_0xcd4d('0x34')](_0x1a2169['model'],qs[_0xcd4d('0x36')](_0x409a3a['query'][_0xcd4d('0x36')]));_0x25cd0c[_0xcd4d('0x35')]=_0x25cd0c[_0xcd4d('0x35')][_0xcd4d('0x37')]?_0x25cd0c[_0xcd4d('0x35')]:_0x1a2169[_0xcd4d('0x2f')];if(!_0x409a3a[_0xcd4d('0x31')]['hasOwnProperty'](_0xcd4d('0x58'))){_0x25cd0c[_0xcd4d('0x1a')]=qs[_0xcd4d('0x1a')](_0x409a3a['query'][_0xcd4d('0x1a')]);_0x25cd0c[_0xcd4d('0x19')]=qs[_0xcd4d('0x19')](_0x409a3a[_0xcd4d('0x31')]['offset']);}_0x25cd0c[_0xcd4d('0x39')]=qs[_0xcd4d('0x3a')](_0x409a3a[_0xcd4d('0x31')]['sort']);_0x25cd0c[_0xcd4d('0x3b')]=qs[_0xcd4d('0x33')](_[_0xcd4d('0x3c')](_0x409a3a['query'],_0x1a2169[_0xcd4d('0x33')]));_0x25cd0c['where'][_0xcd4d('0x59')]=_0x502783['id'];if(_0x409a3a[_0xcd4d('0x31')]['filter']){_0x25cd0c[_0xcd4d('0x3b')]=_['merge'](_0x25cd0c[_0xcd4d('0x3b')],{'$or':_['map'](_0x25cd0c[_0xcd4d('0x35')],function(_0x2ae842){var _0x13e81e={};_0x13e81e[_0x2ae842]={'$like':'%'+_0x409a3a[_0xcd4d('0x31')]['filter']+'%'};return _0x13e81e;})});}_0x25cd0c=_[_0xcd4d('0x3d')]({},_0x25cd0c,_0x409a3a[_0xcd4d('0x46')]);return db[_0xcd4d('0x5a')][_0xcd4d('0x1c')]({'where':_0x25cd0c[_0xcd4d('0x3b')]})[_0xcd4d('0x22')](function(_0x10e73a){_0x4aab35[_0xcd4d('0x1c')]=_0x10e73a;if(_0x409a3a[_0xcd4d('0x31')]['includeAll']){_0x25cd0c[_0xcd4d('0x53')]=[{'all':!![]}];}return db[_0xcd4d('0x5a')][_0xcd4d('0x41')](_0x25cd0c);})[_0xcd4d('0x22')](function(_0x1d9e82){_0x4aab35[_0xcd4d('0x42')]=_0x1d9e82;return _0x4aab35;});}})['then'](respondWithFilteredResult(_0x1cb0a9,_0x25cd0c))[_0xcd4d('0x43')](handleError(_0x1cb0a9,null));};exports[_0xcd4d('0x5b')]=function(_0x4574b5,_0x5b18a2,_0x106eb5){var _0x57f68f={'raw':!![],'where':{}};var _0x4005a9={};var _0x4df240={'count':0x0,'rows':[]};return db[_0xcd4d('0x2b')][_0xcd4d('0x57')]({'where':{'id':_0x4574b5[_0xcd4d('0x52')]['id']}})[_0xcd4d('0x22')](handleEntityNotFound(_0x5b18a2,null))[_0xcd4d('0x22')](function(_0x1d43dd){if(_0x1d43dd){_0x4005a9[_0xcd4d('0x2f')]=_[_0xcd4d('0x32')](db[_0xcd4d('0x5c')][_0xcd4d('0x45')]);_0x4005a9[_0xcd4d('0x31')]=_[_0xcd4d('0x32')](_0x4574b5[_0xcd4d('0x31')]);_0x4005a9[_0xcd4d('0x33')]=_[_0xcd4d('0x34')](_0x4005a9[_0xcd4d('0x2f')],_0x4005a9[_0xcd4d('0x31')]);_0x57f68f[_0xcd4d('0x35')]=_['intersection'](_0x4005a9[_0xcd4d('0x2f')],qs[_0xcd4d('0x36')](_0x4574b5[_0xcd4d('0x31')][_0xcd4d('0x36')]));_0x57f68f[_0xcd4d('0x35')]=_0x57f68f[_0xcd4d('0x35')]['length']?_0x57f68f[_0xcd4d('0x35')]:_0x4005a9[_0xcd4d('0x2f')];if(!_0x4574b5[_0xcd4d('0x31')]['hasOwnProperty'](_0xcd4d('0x58'))){_0x57f68f[_0xcd4d('0x1a')]=qs[_0xcd4d('0x1a')](_0x4574b5['query'][_0xcd4d('0x1a')]);_0x57f68f[_0xcd4d('0x19')]=qs[_0xcd4d('0x19')](_0x4574b5[_0xcd4d('0x31')][_0xcd4d('0x19')]);}_0x57f68f[_0xcd4d('0x39')]=qs[_0xcd4d('0x3a')](_0x4574b5[_0xcd4d('0x31')][_0xcd4d('0x3a')]);_0x57f68f[_0xcd4d('0x3b')]=qs['filters'](_[_0xcd4d('0x3c')](_0x4574b5[_0xcd4d('0x31')],_0x4005a9['filters']));_0x57f68f[_0xcd4d('0x3b')][_0xcd4d('0x59')]=_0x1d43dd['id'];if(_0x4574b5['query'][_0xcd4d('0x3f')]){_0x57f68f['where']=_['merge'](_0x57f68f['where'],{'$or':_['map'](_0x57f68f[_0xcd4d('0x35')],function(_0x422f89){var _0x27ee54={};_0x27ee54[_0x422f89]={'$like':'%'+_0x4574b5[_0xcd4d('0x31')][_0xcd4d('0x3f')]+'%'};return _0x27ee54;})});}_0x57f68f=_['merge']({},_0x57f68f,_0x4574b5[_0xcd4d('0x46')]);return db['CmHopperHistory'][_0xcd4d('0x1c')]({'where':_0x57f68f[_0xcd4d('0x3b')]})['then'](function(_0x2bc608){_0x4df240[_0xcd4d('0x1c')]=_0x2bc608;if(_0x4574b5['query']['includeAll']){_0x57f68f['include']=[{'all':!![]}];}return db[_0xcd4d('0x5c')][_0xcd4d('0x41')](_0x57f68f);})['then'](function(_0x37fc26){_0x4df240[_0xcd4d('0x42')]=_0x37fc26;return _0x4df240;});}})[_0xcd4d('0x22')](respondWithFilteredResult(_0x5b18a2,_0x57f68f))[_0xcd4d('0x43')](handleError(_0x5b18a2,null));};exports['getHopperFinals']=function(_0x425d9a,_0x2fbb3a,_0x3e3f16){var _0x2206ad={'raw':!![],'where':{}};var _0x239d27={};var _0x250de2={'count':0x0,'rows':[]};return db['Campaign'][_0xcd4d('0x57')]({'where':{'id':_0x425d9a[_0xcd4d('0x52')]['id']}})['then'](handleEntityNotFound(_0x2fbb3a,null))[_0xcd4d('0x22')](function(_0x41356a){if(_0x41356a){_0x239d27[_0xcd4d('0x2f')]=_['keys'](db[_0xcd4d('0x5d')]['rawAttributes']);_0x239d27[_0xcd4d('0x31')]=_[_0xcd4d('0x32')](_0x425d9a[_0xcd4d('0x31')]);_0x239d27[_0xcd4d('0x33')]=_['intersection'](_0x239d27[_0xcd4d('0x2f')],_0x239d27[_0xcd4d('0x31')]);_0x2206ad[_0xcd4d('0x35')]=_['intersection'](_0x239d27[_0xcd4d('0x2f')],qs[_0xcd4d('0x36')](_0x425d9a[_0xcd4d('0x31')][_0xcd4d('0x36')]));_0x2206ad[_0xcd4d('0x35')]=_0x2206ad[_0xcd4d('0x35')][_0xcd4d('0x37')]?_0x2206ad['attributes']:_0x239d27[_0xcd4d('0x2f')];if(!_0x425d9a[_0xcd4d('0x31')]['hasOwnProperty'](_0xcd4d('0x58'))){_0x2206ad[_0xcd4d('0x1a')]=qs['limit'](_0x425d9a[_0xcd4d('0x31')][_0xcd4d('0x1a')]);_0x2206ad['offset']=qs[_0xcd4d('0x19')](_0x425d9a[_0xcd4d('0x31')][_0xcd4d('0x19')]);}_0x2206ad['order']=qs[_0xcd4d('0x3a')](_0x425d9a[_0xcd4d('0x31')][_0xcd4d('0x3a')]);_0x2206ad[_0xcd4d('0x3b')]=qs[_0xcd4d('0x33')](_['pick'](_0x425d9a[_0xcd4d('0x31')],_0x239d27['filters']));_0x2206ad[_0xcd4d('0x3b')][_0xcd4d('0x59')]=_0x41356a['id'];if(_0x425d9a[_0xcd4d('0x31')][_0xcd4d('0x3f')]){_0x2206ad[_0xcd4d('0x3b')]=_['merge'](_0x2206ad['where'],{'$or':_['map'](_0x2206ad[_0xcd4d('0x35')],function(_0x5d9298){var _0x5d00ef={};_0x5d00ef[_0x5d9298]={'$like':'%'+_0x425d9a[_0xcd4d('0x31')]['filter']+'%'};return _0x5d00ef;})});}_0x2206ad=_[_0xcd4d('0x3d')]({},_0x2206ad,_0x425d9a[_0xcd4d('0x46')]);return db[_0xcd4d('0x5d')][_0xcd4d('0x1c')]({'where':_0x2206ad[_0xcd4d('0x3b')]})[_0xcd4d('0x22')](function(_0x181940){_0x250de2[_0xcd4d('0x1c')]=_0x181940;if(_0x425d9a[_0xcd4d('0x31')][_0xcd4d('0x40')]){_0x2206ad[_0xcd4d('0x53')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xcd4d('0x41')](_0x2206ad);})['then'](function(_0x276fd8){_0x250de2[_0xcd4d('0x42')]=_0x276fd8;return _0x250de2;});}})[_0xcd4d('0x22')](respondWithFilteredResult(_0x2fbb3a,_0x2206ad))[_0xcd4d('0x43')](handleError(_0x2fbb3a,null));};exports[_0xcd4d('0x5e')]=function(_0x49ca0b,_0x2e2818,_0x56fbc7){var _0x36e9a9={'raw':!![],'where':{}};var _0x1c41f6={};var _0x4f1a33={'count':0x0,'rows':[]};return db[_0xcd4d('0x2b')][_0xcd4d('0x57')]({'where':{'id':_0x49ca0b[_0xcd4d('0x52')]['id']}})[_0xcd4d('0x22')](handleEntityNotFound(_0x2e2818,null))[_0xcd4d('0x22')](function(_0x11591b){if(_0x11591b){_0x1c41f6[_0xcd4d('0x2f')]=_[_0xcd4d('0x32')](db[_0xcd4d('0x5f')][_0xcd4d('0x45')]);_0x1c41f6[_0xcd4d('0x31')]=_[_0xcd4d('0x32')](_0x49ca0b[_0xcd4d('0x31')]);_0x1c41f6['filters']=_[_0xcd4d('0x34')](_0x1c41f6[_0xcd4d('0x2f')],_0x1c41f6[_0xcd4d('0x31')]);_0x36e9a9['attributes']=_[_0xcd4d('0x34')](_0x1c41f6[_0xcd4d('0x2f')],qs['fields'](_0x49ca0b[_0xcd4d('0x31')][_0xcd4d('0x36')]));_0x36e9a9[_0xcd4d('0x35')]=_0x36e9a9[_0xcd4d('0x35')]['length']?_0x36e9a9[_0xcd4d('0x35')]:_0x1c41f6[_0xcd4d('0x2f')];if(!_0x49ca0b['query'][_0xcd4d('0x38')](_0xcd4d('0x58'))){_0x36e9a9[_0xcd4d('0x1a')]=qs[_0xcd4d('0x1a')](_0x49ca0b[_0xcd4d('0x31')][_0xcd4d('0x1a')]);_0x36e9a9['offset']=qs[_0xcd4d('0x19')](_0x49ca0b[_0xcd4d('0x31')][_0xcd4d('0x19')]);}_0x36e9a9[_0xcd4d('0x39')]=qs['sort'](_0x49ca0b[_0xcd4d('0x31')][_0xcd4d('0x3a')]);_0x36e9a9[_0xcd4d('0x3b')]=qs[_0xcd4d('0x33')](_[_0xcd4d('0x3c')](_0x49ca0b[_0xcd4d('0x31')],_0x1c41f6[_0xcd4d('0x33')]));_0x36e9a9['where'][_0xcd4d('0x59')]=_0x11591b['id'];if(_0x49ca0b[_0xcd4d('0x31')][_0xcd4d('0x3f')]){_0x36e9a9[_0xcd4d('0x3b')]=_[_0xcd4d('0x3d')](_0x36e9a9[_0xcd4d('0x3b')],{'$or':_['map'](_0x36e9a9[_0xcd4d('0x35')],function(_0x5b4d69){var _0x123d6f={};_0x123d6f[_0x5b4d69]={'$like':'%'+_0x49ca0b['query']['filter']+'%'};return _0x123d6f;})});}_0x36e9a9=_[_0xcd4d('0x3d')]({},_0x36e9a9,_0x49ca0b[_0xcd4d('0x46')]);return db[_0xcd4d('0x5f')]['count']({'where':_0x36e9a9[_0xcd4d('0x3b')]})[_0xcd4d('0x22')](function(_0x355e7f){_0x4f1a33['count']=_0x355e7f;if(_0x49ca0b['query']['includeAll']){_0x36e9a9['include']=[{'all':!![]}];}return db[_0xcd4d('0x5f')][_0xcd4d('0x41')](_0x36e9a9);})[_0xcd4d('0x22')](function(_0x1017b3){_0x4f1a33[_0xcd4d('0x42')]=_0x1017b3;return _0x4f1a33;});}})[_0xcd4d('0x22')](respondWithFilteredResult(_0x2e2818,_0x36e9a9))[_0xcd4d('0x43')](handleError(_0x2e2818,null));};exports[_0xcd4d('0x60')]=function(_0x5144c3,_0x40ea5b,_0x1a10ee){var _0x1a4b89={};var _0x99db39={};var _0x37d13f;var _0x540fbe;return db[_0xcd4d('0x2b')][_0xcd4d('0x57')]({'where':{'id':_0x5144c3[_0xcd4d('0x52')]['id']}})['then'](handleEntityNotFound(_0x40ea5b,null))['then'](function(_0x1d76f7){if(_0x1d76f7){_0x37d13f=_0x1d76f7;_0x99db39[_0xcd4d('0x2f')]=_[_0xcd4d('0x32')](db['CmList'][_0xcd4d('0x45')]);_0x99db39[_0xcd4d('0x31')]=_[_0xcd4d('0x32')](_0x5144c3[_0xcd4d('0x31')]);_0x99db39['filters']=_[_0xcd4d('0x34')](_0x99db39['model'],_0x99db39['query']);_0x1a4b89[_0xcd4d('0x35')]=_[_0xcd4d('0x34')](_0x99db39[_0xcd4d('0x2f')],qs[_0xcd4d('0x36')](_0x5144c3[_0xcd4d('0x31')][_0xcd4d('0x36')]));_0x1a4b89[_0xcd4d('0x35')]=_0x1a4b89['attributes'][_0xcd4d('0x37')]?_0x1a4b89[_0xcd4d('0x35')]:_0x99db39['model'];_0x1a4b89[_0xcd4d('0x39')]=qs[_0xcd4d('0x3a')](_0x5144c3[_0xcd4d('0x31')][_0xcd4d('0x3a')]);_0x1a4b89[_0xcd4d('0x3b')]=qs[_0xcd4d('0x33')](_[_0xcd4d('0x3c')](_0x5144c3[_0xcd4d('0x31')],_0x99db39[_0xcd4d('0x33')]));if(_0x5144c3[_0xcd4d('0x31')]['filter']){_0x1a4b89[_0xcd4d('0x3b')]=_[_0xcd4d('0x3d')](_0x1a4b89[_0xcd4d('0x3b')],{'$or':_[_0xcd4d('0x30')](_0x1a4b89['attributes'],function(_0xcbb8fd){var _0xfa75b9={};_0xfa75b9[_0xcbb8fd]={'$like':'%'+_0x5144c3['query'][_0xcd4d('0x3f')]+'%'};return _0xfa75b9;})});}_0x1a4b89=_[_0xcd4d('0x3d')]({},_0x1a4b89,_0x5144c3[_0xcd4d('0x46')]);return _0x37d13f[_0xcd4d('0x60')](_0x1a4b89);}})[_0xcd4d('0x22')](function(_0x26f90c){if(_0x26f90c){_0x540fbe=_0x26f90c[_0xcd4d('0x37')];if(!_0x5144c3[_0xcd4d('0x31')][_0xcd4d('0x38')](_0xcd4d('0x58'))){_0x1a4b89[_0xcd4d('0x1a')]=qs[_0xcd4d('0x1a')](_0x5144c3[_0xcd4d('0x31')][_0xcd4d('0x1a')]);_0x1a4b89['offset']=qs[_0xcd4d('0x19')](_0x5144c3[_0xcd4d('0x31')][_0xcd4d('0x19')]);}return _0x37d13f['getLists'](_0x1a4b89);}})[_0xcd4d('0x22')](function(_0x3e956f){if(_0x3e956f){return _0x3e956f?{'count':_0x540fbe,'rows':_0x3e956f}:null;}})['then'](respondWithResult(_0x40ea5b,null))[_0xcd4d('0x43')](handleError(_0x40ea5b,null));};exports[_0xcd4d('0x61')]=function(_0x516ea3,_0x4a61ef,_0x43fa37){var _0x2a30a4,_0x5d1c7d;var _0x54c8f5=[];var _0x1b0f97=moment()[_0xcd4d('0x62')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0xcd4d('0x2b')][_0xcd4d('0x47')]({'where':{'id':_0x516ea3[_0xcd4d('0x52')]['id']}})[_0xcd4d('0x22')](handleEntityNotFound(_0x4a61ef,null))[_0xcd4d('0x22')](function(_0x15d3bb){if(_0x15d3bb){_0x5d1c7d=_0x15d3bb;return _0x15d3bb[_0xcd4d('0x61')](_0x516ea3[_0xcd4d('0x49')][_0xcd4d('0x63')],_['omit'](_0x516ea3[_0xcd4d('0x49')],['ids','id'])||{});}return null;})[_0xcd4d('0x64')](function(_0xc017a0){var _0x43a546;var _0x271f93;_0x2a30a4=_0xc017a0||[];var _0x5c304b=[];if(_0xc017a0){for(var _0x343a13=0x0;_0x343a13<_0xc017a0[_0xcd4d('0x37')];_0x343a13+=0x1){var _0x2efca6=_0xc017a0[_0x343a13]['get']({'plain':!![]});_0x5d1c7d[_0xcd4d('0x65')]=_0x516ea3[_0xcd4d('0x49')][_0xcd4d('0x65')]?_0x516ea3['body'][_0xcd4d('0x65')]:_0x5d1c7d['dialCheckDuplicateType'];switch(_0x5d1c7d['dialCheckDuplicateType']){case _0xcd4d('0x66'):_0x43a546=squel[_0xcd4d('0x67')]()['into'](_0xcd4d('0x68'))[_0xcd4d('0x69')]([_0xcd4d('0x6a'),_0xcd4d('0x6b'),_0xcd4d('0x6c'),_0xcd4d('0x6d'),_0xcd4d('0x59'),'createdAt',_0xcd4d('0x54')],squel['select']()[_0xcd4d('0x6e')](_0xcd4d('0x6a'),_0xcd4d('0x6a'))[_0xcd4d('0x6e')](_0xcd4d('0x6f'),_0xcd4d('0x6b'))[_0xcd4d('0x6e')]('id',_0xcd4d('0x6c'))[_0xcd4d('0x6e')](_0x2efca6[_0xcd4d('0x70')][_0xcd4d('0x71')](),_0xcd4d('0x6d'))[_0xcd4d('0x6e')](_0x516ea3[_0xcd4d('0x52')]['id'][_0xcd4d('0x71')](),_0xcd4d('0x59'))['field']('\x27'+_0x1b0f97+'\x27','createdAt')[_0xcd4d('0x6e')]('\x27'+_0x1b0f97+'\x27',_0xcd4d('0x54'))[_0xcd4d('0x72')](_0xcd4d('0x73'))[_0xcd4d('0x3b')](_0xcd4d('0x74'))[_0xcd4d('0x3b')](_0xcd4d('0x75'),_0x2efca6[_0xcd4d('0x70')][_0xcd4d('0x71')]())[_0xcd4d('0x3b')](_0xcd4d('0x76'))[_0xcd4d('0x3b')]('phone\x20NOT\x20IN\x20(?)',squel[_0xcd4d('0x77')]()[_0xcd4d('0x6e')](_0xcd4d('0x78'))[_0xcd4d('0x72')](_0xcd4d('0x79'))[_0xcd4d('0x3b')](_0xcd4d('0x7a'),_0x516ea3['params']['id'][_0xcd4d('0x71')]()))[_0xcd4d('0x3b')](_0xcd4d('0x7b'),squel[_0xcd4d('0x77')]()[_0xcd4d('0x6e')]('COALESCE(phone,\x27\x27)')[_0xcd4d('0x72')](_0xcd4d('0x68'))[_0xcd4d('0x3b')](_0xcd4d('0x7a'),_0x516ea3[_0xcd4d('0x52')]['id']['toString']())))[_0xcd4d('0x71')]();break;case _0xcd4d('0x7c'):_0x43a546=squel[_0xcd4d('0x67')]()[_0xcd4d('0x7d')](_0xcd4d('0x68'))['fromQuery']([_0xcd4d('0x6a'),_0xcd4d('0x6b'),_0xcd4d('0x6c'),'ListId','CampaignId','createdAt','updatedAt'],squel[_0xcd4d('0x77')]()[_0xcd4d('0x6e')](_0xcd4d('0x6a'),_0xcd4d('0x6a'))[_0xcd4d('0x6e')](_0xcd4d('0x6f'),'scheduledAt')[_0xcd4d('0x6e')]('id',_0xcd4d('0x6c'))[_0xcd4d('0x6e')](_0x2efca6[_0xcd4d('0x70')][_0xcd4d('0x71')](),_0xcd4d('0x6d'))[_0xcd4d('0x6e')](_0x516ea3[_0xcd4d('0x52')]['id'][_0xcd4d('0x71')](),'CampaignId')[_0xcd4d('0x6e')]('\x27'+_0x1b0f97+'\x27','createdAt')[_0xcd4d('0x6e')]('\x27'+_0x1b0f97+'\x27',_0xcd4d('0x54'))[_0xcd4d('0x72')](_0xcd4d('0x73'))[_0xcd4d('0x3b')](_0xcd4d('0x74'))[_0xcd4d('0x3b')](_0xcd4d('0x75'),_0x2efca6[_0xcd4d('0x70')][_0xcd4d('0x71')]())[_0xcd4d('0x3b')](_0xcd4d('0x76'))[_0xcd4d('0x3b')](_0xcd4d('0x7b'),squel[_0xcd4d('0x77')]()[_0xcd4d('0x6e')](_0xcd4d('0x7e'))[_0xcd4d('0x72')](_0xcd4d('0x68'))[_0xcd4d('0x3b')]('CampaignId\x20=\x20?',_0x516ea3[_0xcd4d('0x52')]['id'][_0xcd4d('0x71')]())))[_0xcd4d('0x71')]();break;default:_0x43a546=squel[_0xcd4d('0x67')]()[_0xcd4d('0x7d')](_0xcd4d('0x68'))[_0xcd4d('0x69')]([_0xcd4d('0x6a'),_0xcd4d('0x6b'),_0xcd4d('0x6c'),_0xcd4d('0x6d'),_0xcd4d('0x59'),'createdAt',_0xcd4d('0x54')],squel[_0xcd4d('0x77')]()['field'](_0xcd4d('0x6a'),_0xcd4d('0x6a'))[_0xcd4d('0x6e')](_0xcd4d('0x6f'),_0xcd4d('0x6b'))['field']('id',_0xcd4d('0x6c'))[_0xcd4d('0x6e')](_0x2efca6[_0xcd4d('0x70')][_0xcd4d('0x71')](),_0xcd4d('0x6d'))[_0xcd4d('0x6e')](_0x516ea3[_0xcd4d('0x52')]['id'][_0xcd4d('0x71')](),_0xcd4d('0x59'))[_0xcd4d('0x6e')]('\x27'+_0x1b0f97+'\x27',_0xcd4d('0x56'))[_0xcd4d('0x6e')]('\x27'+_0x1b0f97+'\x27','updatedAt')['from'](_0xcd4d('0x73'))['where']('deletedAt\x20IS\x20NULL')[_0xcd4d('0x3b')](_0xcd4d('0x75'),_0x2efca6[_0xcd4d('0x70')][_0xcd4d('0x71')]())[_0xcd4d('0x3b')](_0xcd4d('0x76')))[_0xcd4d('0x71')]();}_0x271f93=squel['insert']()[_0xcd4d('0x7d')](_0xcd4d('0x7f'))[_0xcd4d('0x69')]([_0xcd4d('0x80'),_0xcd4d('0x6b'),'phone','OrderBy',_0xcd4d('0x56'),_0xcd4d('0x54')],squel[_0xcd4d('0x77')]()[_0xcd4d('0x6e')](_0xcd4d('0x81'),'id')[_0xcd4d('0x6e')](_0xcd4d('0x6f'),'scheduledAt')[_0xcd4d('0x6e')](_0xcd4d('0x82'),_0xcd4d('0x6a'))['field'](_0xcd4d('0x83'),_0xcd4d('0x84'))['field']('\x27'+_0x1b0f97+'\x27',_0xcd4d('0x56'))[_0xcd4d('0x6e')]('\x27'+_0x1b0f97+'\x27',_0xcd4d('0x54'))[_0xcd4d('0x72')](_0xcd4d('0x85'),'ci')['join'](_0xcd4d('0x68'),'h',_0xcd4d('0x86'))[_0xcd4d('0x3b')]('h.ListId\x20=\x20?',_0x2efca6['CmListId'][_0xcd4d('0x71')]())[_0xcd4d('0x3b')]('h.CampaignId=?',_0x516ea3[_0xcd4d('0x52')]['id'][_0xcd4d('0x71')]())[_0xcd4d('0x3b')]('h.createdAt\x20=\x20?',_0x1b0f97))[_0xcd4d('0x71')]();_0x5c304b[_0xcd4d('0x87')](db['sequelize']['query'](_0x43a546));_0x54c8f5[_0xcd4d('0x87')](db[_0xcd4d('0x88')][_0xcd4d('0x31')](_0x271f93));}return BPromise[_0xcd4d('0x89')](_0x5c304b);}})[_0xcd4d('0x22')](function(){return BPromise['all'](_0x54c8f5);})[_0xcd4d('0x22')](function(){return _0x2a30a4;})['then'](respondWithResult(_0x4a61ef,null))[_0xcd4d('0x43')](handleError(_0x4a61ef,null));};exports[_0xcd4d('0x8a')]=function(_0xf49bba,_0x5834e7,_0x5c2fff){return db[_0xcd4d('0x2b')][_0xcd4d('0x47')]({'where':{'id':_0xf49bba[_0xcd4d('0x52')]['id']}})[_0xcd4d('0x22')](handleEntityNotFound(_0x5834e7,null))['then'](function(_0x1a3b72){if(_0x1a3b72){return _0x1a3b72[_0xcd4d('0x8a')](_0xf49bba['query']['ids']);}})[_0xcd4d('0x22')](function(_0x3b706b){if(_0x3b706b){return db['CmHopper'][_0xcd4d('0x8b')]({'where':{'ListId':_0xf49bba[_0xcd4d('0x31')]['ids'],'CampaignId':_0xf49bba[_0xcd4d('0x52')]['id']}})[_0xcd4d('0x22')](function(){return _0x3b706b;});}})['then'](respondWithStatusCode(_0x5834e7,null))[_0xcd4d('0x43')](handleError(_0x5834e7,null));};exports[_0xcd4d('0x8c')]=function(_0x11b223,_0x5ca9dc,_0x47f5b2){var _0x1a4233={};var _0x1b033a={};var _0x2aad65;var _0x3b1ae8;return db['Campaign'][_0xcd4d('0x57')]({'where':{'id':_0x11b223[_0xcd4d('0x52')]['id']}})['then'](handleEntityNotFound(_0x5ca9dc,null))['then'](function(_0x1fd4c2){if(_0x1fd4c2){_0x2aad65=_0x1fd4c2;_0x1b033a['model']=_[_0xcd4d('0x32')](db[_0xcd4d('0x8d')]['rawAttributes']);_0x1b033a[_0xcd4d('0x31')]=_['keys'](_0x11b223[_0xcd4d('0x31')]);_0x1b033a[_0xcd4d('0x33')]=_['intersection'](_0x1b033a[_0xcd4d('0x2f')],_0x1b033a[_0xcd4d('0x31')]);_0x1a4233['attributes']=_[_0xcd4d('0x34')](_0x1b033a['model'],qs['fields'](_0x11b223[_0xcd4d('0x31')]['fields']));_0x1a4233[_0xcd4d('0x35')]=_0x1a4233[_0xcd4d('0x35')][_0xcd4d('0x37')]?_0x1a4233[_0xcd4d('0x35')]:_0x1b033a[_0xcd4d('0x2f')];_0x1a4233[_0xcd4d('0x39')]=qs[_0xcd4d('0x3a')](_0x11b223[_0xcd4d('0x31')][_0xcd4d('0x3a')]);_0x1a4233[_0xcd4d('0x3b')]=qs[_0xcd4d('0x33')](_[_0xcd4d('0x3c')](_0x11b223['query'],_0x1b033a[_0xcd4d('0x33')]));if(_0x11b223[_0xcd4d('0x31')][_0xcd4d('0x3f')]){_0x1a4233[_0xcd4d('0x3b')]=_['merge'](_0x1a4233[_0xcd4d('0x3b')],{'$or':_[_0xcd4d('0x30')](_0x1a4233['attributes'],function(_0x22c687){var _0x7b5972={};_0x7b5972[_0x22c687]={'$like':'%'+_0x11b223[_0xcd4d('0x31')]['filter']+'%'};return _0x7b5972;})});}_0x1a4233=_[_0xcd4d('0x3d')]({},_0x1a4233,_0x11b223['options']);return _0x2aad65[_0xcd4d('0x8c')](_0x1a4233);}})[_0xcd4d('0x22')](function(_0x2789ff){if(_0x2789ff){_0x3b1ae8=_0x2789ff[_0xcd4d('0x37')];if(!_0x11b223[_0xcd4d('0x31')]['hasOwnProperty'](_0xcd4d('0x58'))){_0x1a4233['limit']=qs['limit'](_0x11b223['query']['limit']);_0x1a4233['offset']=qs[_0xcd4d('0x19')](_0x11b223[_0xcd4d('0x31')][_0xcd4d('0x19')]);}return _0x2aad65[_0xcd4d('0x8c')](_0x1a4233);}})[_0xcd4d('0x22')](function(_0x2b5e3a){if(_0x2b5e3a){return _0x2b5e3a?{'count':_0x3b1ae8,'rows':_0x2b5e3a}:null;}})[_0xcd4d('0x22')](respondWithResult(_0x5ca9dc,null))[_0xcd4d('0x43')](handleError(_0x5ca9dc,null));};exports['addBlackLists']=function(_0x285e92,_0x280154,_0x1a025b){var _0x47903f,_0x242c7f;var _0x437b16=[];var _0x4181ff=moment()[_0xcd4d('0x62')](_0xcd4d('0x8e'));return db['Campaign'][_0xcd4d('0x47')]({'where':{'id':_0x285e92[_0xcd4d('0x52')]['id']}})[_0xcd4d('0x22')](handleEntityNotFound(_0x280154,null))[_0xcd4d('0x22')](function(_0x5e2166){if(_0x5e2166){_0x242c7f=_0x5e2166;return _0x5e2166[_0xcd4d('0x8f')](_0x285e92[_0xcd4d('0x49')]['ids'],_[_0xcd4d('0x55')](_0x285e92['body'],[_0xcd4d('0x63'),'id'])||{});}return null;})[_0xcd4d('0x64')](function(_0x176ae6){var _0x5e3714;var _0x125daa;_0x47903f=_0x176ae6||[];var _0xdadc4c=[];if(_0x176ae6){for(var _0x384d6e=0x0;_0x384d6e<_0x176ae6[_0xcd4d('0x37')];_0x384d6e+=0x1){var _0xb33b86=_0x176ae6[_0x384d6e][_0xcd4d('0x23')]({'plain':!![]});_0x5e3714=squel['insert']()[_0xcd4d('0x7d')]('cm_hopper_black')[_0xcd4d('0x69')]([_0xcd4d('0x6a'),_0xcd4d('0x6c'),_0xcd4d('0x6d'),_0xcd4d('0x59'),'createdAt',_0xcd4d('0x54')],squel[_0xcd4d('0x77')]()['field'](_0xcd4d('0x6a'),_0xcd4d('0x6a'))[_0xcd4d('0x6e')]('id',_0xcd4d('0x6c'))['field'](_0xb33b86[_0xcd4d('0x70')][_0xcd4d('0x71')](),'ListId')['field'](_0x285e92[_0xcd4d('0x52')]['id'][_0xcd4d('0x71')](),_0xcd4d('0x59'))[_0xcd4d('0x6e')](_0xcd4d('0x6f'),_0xcd4d('0x56'))[_0xcd4d('0x6e')](_0xcd4d('0x6f'),_0xcd4d('0x54'))[_0xcd4d('0x72')](_0xcd4d('0x73'))['where'](_0xcd4d('0x74'))[_0xcd4d('0x3b')]('ListId\x20=\x20?',_0xb33b86[_0xcd4d('0x70')]['toString']())[_0xcd4d('0x3b')](_0xcd4d('0x76')))[_0xcd4d('0x71')]();_0xdadc4c[_0xcd4d('0x87')](db['sequelize'][_0xcd4d('0x31')](_0x5e3714));}return BPromise['all'](_0xdadc4c);}})[_0xcd4d('0x22')](function(){return _0x47903f;})['then'](respondWithResult(_0x280154,null))['catch'](handleError(_0x280154,null));};exports[_0xcd4d('0x90')]=function(_0x57cc75,_0x4adf8a,_0x319795){return db[_0xcd4d('0x2b')]['find']({'where':{'id':_0x57cc75[_0xcd4d('0x52')]['id']}})[_0xcd4d('0x22')](handleEntityNotFound(_0x4adf8a,null))[_0xcd4d('0x22')](function(_0x3a6788){if(_0x3a6788){return _0x3a6788[_0xcd4d('0x90')](_0x57cc75['query'][_0xcd4d('0x63')]);}})[_0xcd4d('0x22')](function(_0x3bd65b){if(_0x3bd65b){return db[_0xcd4d('0x5f')]['destroy']({'where':{'ListId':_0x57cc75['query']['ids'],'CampaignId':_0x57cc75[_0xcd4d('0x52')]['id']}})[_0xcd4d('0x22')](function(){return _0x3bd65b;});}})[_0xcd4d('0x22')](respondWithStatusCode(_0x4adf8a,null))[_0xcd4d('0x43')](handleError(_0x4adf8a,null));};
\ No newline at end of file
+var _0xe860=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','Campaign','includeAll','include','rows','catch','show','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','error','getHoppers','findOne','pick','CmHopper','getHopperHistories','CampaignId','CmHopperHistory','findAll','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','ContactId','ListId','field','NOW()','scheduledAt','CmListId','toString','from','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_contacts','ListId\x20=\x20?','cm_hopper_additional_phones','cmHopperId','OrderBy','ci.item','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','format','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','end','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','intersection'];(function(_0x3306a2,_0x274117){var _0x54f452=function(_0x266cb5){while(--_0x266cb5){_0x3306a2['push'](_0x3306a2['shift']());}};_0x54f452(++_0x274117);}(_0xe860,0x188));var _0x0e86=function(_0x206510,_0x170973){_0x206510=_0x206510-0x0;var _0x87aba=_0xe860[_0x206510];return _0x87aba;};'use strict';var emlformat=require(_0x0e86('0x0'));var rimraf=require(_0x0e86('0x1'));var zipdir=require(_0x0e86('0x2'));var jsonpatch=require(_0x0e86('0x3'));var rp=require('request-promise');var moment=require(_0x0e86('0x4'));var BPromise=require(_0x0e86('0x5'));var Mustache=require('mustache');var util=require(_0x0e86('0x6'));var path=require(_0x0e86('0x7'));var sox=require(_0x0e86('0x8'));var csv=require(_0x0e86('0x9'));var ejs=require(_0x0e86('0xa'));var fs=require('fs');var fs_extra=require(_0x0e86('0xb'));var _=require(_0x0e86('0xc'));var squel=require(_0x0e86('0xd'));var crypto=require(_0x0e86('0xe'));var jsforce=require(_0x0e86('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0e86('0x9'));var querystring=require('querystring');var Papa=require(_0x0e86('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0e86('0x11'));var logger=require('../../config/logger')(_0x0e86('0x12'));var utils=require(_0x0e86('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x0e86('0x14'));var db=require(_0x0e86('0x15'))['db'];function respondWithStatusCode(_0x336308,_0x731e0b){_0x731e0b=_0x731e0b||0xcc;return function(_0x2ef563){if(_0x2ef563){return _0x336308[_0x0e86('0x16')](_0x731e0b);}return _0x336308[_0x0e86('0x17')](_0x731e0b)['end']();};}function respondWithResult(_0xee30a9,_0x27e093){_0x27e093=_0x27e093||0xc8;return function(_0xbd69f4){if(_0xbd69f4){return _0xee30a9[_0x0e86('0x17')](_0x27e093)[_0x0e86('0x18')](_0xbd69f4);}};}function respondWithFilteredResult(_0x39449f,_0x9964f7){return function(_0x3e4189){if(_0x3e4189){var _0x32cd00=typeof _0x9964f7[_0x0e86('0x19')]===_0x0e86('0x1a')&&typeof _0x9964f7[_0x0e86('0x1b')]===_0x0e86('0x1a');var _0x3b7933=_0x3e4189[_0x0e86('0x1c')];var _0xee60ba=_0x32cd00?0x0:_0x9964f7[_0x0e86('0x19')];var _0x1fbcd3=_0x32cd00?_0x3e4189[_0x0e86('0x1c')]:_0x9964f7['offset']+_0x9964f7['limit'];var _0x54579d;if(_0x1fbcd3>=_0x3b7933){_0x1fbcd3=_0x3b7933;_0x54579d=0xc8;}else{_0x54579d=0xce;}_0x39449f[_0x0e86('0x17')](_0x54579d);return _0x39449f[_0x0e86('0x1d')](_0x0e86('0x1e'),_0xee60ba+'-'+_0x1fbcd3+'/'+_0x3b7933)['json'](_0x3e4189);}return null;};}function patchUpdates(_0xe30ad9){return function(_0x53ceb1){try{jsonpatch[_0x0e86('0x1f')](_0x53ceb1,_0xe30ad9,!![]);}catch(_0x13008a){return BPromise[_0x0e86('0x20')](_0x13008a);}return _0x53ceb1[_0x0e86('0x21')]();};}function saveUpdates(_0x17edb4,_0x385530){return function(_0x538ef3){if(_0x538ef3){return _0x538ef3[_0x0e86('0x22')](_0x17edb4)[_0x0e86('0x23')](function(_0x340a93){return _0x340a93;});}return null;};}function removeEntity(_0x432253,_0xa24e68){return function(_0x185354){if(_0x185354){return _0x185354[_0x0e86('0x24')]()['then'](function(){var _0x7ad308=_0x185354[_0x0e86('0x25')]({'plain':!![]});var _0x1ae6fe=_0x0e86('0x26');return db[_0x0e86('0x27')][_0x0e86('0x24')]({'where':{'type':_0x1ae6fe,'resourceId':_0x7ad308['id']}})['then'](function(){return _0x185354;});})[_0x0e86('0x23')](function(){_0x432253['status'](0xcc)[_0x0e86('0x28')]();});}};}function handleEntityNotFound(_0x13a187,_0x5b483f){return function(_0x49aea3){if(!_0x49aea3){_0x13a187[_0x0e86('0x16')](0x194);}return _0x49aea3;};}function handleError(_0x580416,_0x405643){_0x405643=_0x405643||0x1f4;return function(_0x1a7f77){logger['error'](_0x1a7f77['stack']);if(_0x1a7f77[_0x0e86('0x29')]){delete _0x1a7f77[_0x0e86('0x29')];}_0x580416[_0x0e86('0x17')](_0x405643)[_0x0e86('0x2a')](_0x1a7f77);};}exports[_0x0e86('0x2b')]=function(_0x53139c,_0x2194fd){var _0x432696={},_0x2351ca={},_0x33ea18={'count':0x0,'rows':[]};var _0x5a81dd=_[_0x0e86('0x2c')](db['Campaign'][_0x0e86('0x2d')],function(_0x244808){return{'name':_0x244808[_0x0e86('0x2e')],'type':_0x244808['type'][_0x0e86('0x2f')]};});_0x2351ca[_0x0e86('0x30')]=_[_0x0e86('0x2c')](_0x5a81dd,_0x0e86('0x29'));_0x2351ca[_0x0e86('0x31')]=_['keys'](_0x53139c[_0x0e86('0x31')]);_0x2351ca[_0x0e86('0x32')]=_[_0x0e86('0x33')](_0x2351ca[_0x0e86('0x30')],_0x2351ca['query']);_0x432696[_0x0e86('0x34')]=_['intersection'](_0x2351ca[_0x0e86('0x30')],qs[_0x0e86('0x35')](_0x53139c[_0x0e86('0x31')][_0x0e86('0x35')]));_0x432696[_0x0e86('0x34')]=_0x432696[_0x0e86('0x34')][_0x0e86('0x36')]?_0x432696[_0x0e86('0x34')]:_0x2351ca['model'];if(!_0x53139c[_0x0e86('0x31')][_0x0e86('0x37')](_0x0e86('0x38'))){_0x432696['limit']=qs['limit'](_0x53139c[_0x0e86('0x31')][_0x0e86('0x1b')]);_0x432696[_0x0e86('0x19')]=qs[_0x0e86('0x19')](_0x53139c[_0x0e86('0x31')]['offset']);}_0x432696[_0x0e86('0x39')]=qs['sort'](_0x53139c[_0x0e86('0x31')][_0x0e86('0x3a')]);_0x432696['where']=qs[_0x0e86('0x32')](_['pick'](_0x53139c[_0x0e86('0x31')],_0x2351ca[_0x0e86('0x32')]),_0x5a81dd);if(_0x53139c[_0x0e86('0x31')]['filter']){_0x432696[_0x0e86('0x3b')]=_[_0x0e86('0x3c')](_0x432696[_0x0e86('0x3b')],{'$or':_[_0x0e86('0x2c')](_0x5a81dd,function(_0xdd6fdb){if(_0xdd6fdb[_0x0e86('0x3d')]!==_0x0e86('0x3e')){var _0x1d8d42={};_0x1d8d42[_0xdd6fdb[_0x0e86('0x29')]]={'$like':'%'+_0x53139c[_0x0e86('0x31')][_0x0e86('0x3f')]+'%'};return _0x1d8d42;}})});}_0x432696=_['merge']({},_0x432696,_0x53139c[_0x0e86('0x40')]);var _0x382d94={'where':_0x432696[_0x0e86('0x3b')]};return db[_0x0e86('0x41')][_0x0e86('0x1c')](_0x382d94)[_0x0e86('0x23')](function(_0x5fa25f){_0x33ea18['count']=_0x5fa25f;if(_0x53139c[_0x0e86('0x31')][_0x0e86('0x42')]){_0x432696[_0x0e86('0x43')]=[{'all':!![]}];}return db[_0x0e86('0x41')]['findAll'](_0x432696);})[_0x0e86('0x23')](function(_0x4b4a2c){_0x33ea18[_0x0e86('0x44')]=_0x4b4a2c;return _0x33ea18;})[_0x0e86('0x23')](respondWithFilteredResult(_0x2194fd,_0x432696))[_0x0e86('0x45')](handleError(_0x2194fd,null));};exports[_0x0e86('0x46')]=function(_0x1bc5cc,_0x46de02){var _0x3e9ec3={'raw':![],'where':{'id':_0x1bc5cc['params']['id']}},_0x261899={};_0x261899[_0x0e86('0x30')]=_[_0x0e86('0x47')](db['Campaign'][_0x0e86('0x2d')]);_0x261899[_0x0e86('0x31')]=_[_0x0e86('0x47')](_0x1bc5cc[_0x0e86('0x31')]);_0x261899[_0x0e86('0x32')]=_[_0x0e86('0x33')](_0x261899[_0x0e86('0x30')],_0x261899[_0x0e86('0x31')]);_0x3e9ec3[_0x0e86('0x34')]=_[_0x0e86('0x33')](_0x261899[_0x0e86('0x30')],qs[_0x0e86('0x35')](_0x1bc5cc[_0x0e86('0x31')][_0x0e86('0x35')]));_0x3e9ec3[_0x0e86('0x34')]=_0x3e9ec3[_0x0e86('0x34')][_0x0e86('0x36')]?_0x3e9ec3[_0x0e86('0x34')]:_0x261899[_0x0e86('0x30')];if(_0x1bc5cc[_0x0e86('0x31')][_0x0e86('0x42')]){_0x3e9ec3[_0x0e86('0x43')]=[{'all':!![]}];}_0x3e9ec3=_[_0x0e86('0x3c')]({},_0x3e9ec3,_0x1bc5cc[_0x0e86('0x40')]);return db['Campaign'][_0x0e86('0x48')](_0x3e9ec3)['then'](handleEntityNotFound(_0x46de02,null))['then'](respondWithResult(_0x46de02,null))[_0x0e86('0x45')](handleError(_0x46de02,null));};exports[_0x0e86('0x49')]=function(_0x33de57,_0x334cc2){return db['Campaign']['create'](_0x33de57[_0x0e86('0x4a')],{})[_0x0e86('0x23')](function(_0x581add){var _0x3fcf2a=_0x33de57['user'][_0x0e86('0x25')]({'plain':!![]});if(!_0x3fcf2a)throw new Error(_0x0e86('0x4b'));if(_0x3fcf2a[_0x0e86('0x4c')]===_0x0e86('0x4d')){var _0x53e1b5=_0x581add['get']({'plain':!![]});var _0x119cf1='IvrCampaigns';return db[_0x0e86('0x4e')][_0x0e86('0x48')]({'where':{'name':_0x119cf1,'userProfileId':_0x3fcf2a[_0x0e86('0x4f')]},'raw':!![]})['then'](function(_0x3d792a){if(_0x3d792a&&_0x3d792a[_0x0e86('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x53e1b5[_0x0e86('0x29')],'resourceId':_0x53e1b5['id'],'type':_0x3d792a[_0x0e86('0x29')],'sectionId':_0x3d792a['id']},{})[_0x0e86('0x23')](function(){return _0x581add;});}else{return _0x581add;}})[_0x0e86('0x45')](function(_0x1a33b3){logger['error'](_0x0e86('0x51'),_0x1a33b3);throw _0x1a33b3;});}return _0x581add;})[_0x0e86('0x23')](respondWithResult(_0x334cc2,0xc9))[_0x0e86('0x45')](handleError(_0x334cc2,null));};exports[_0x0e86('0x52')]=function(_0xb80509,_0x42fb33){var _0x9049a3={'where':{'id':_0xb80509[_0x0e86('0x53')]['id']}},_0x5a813b={};_0x5a813b['model']=_[_0x0e86('0x47')](db['Campaign'][_0x0e86('0x2d')]);_0x9049a3[_0x0e86('0x34')]=_[_0x0e86('0x33')](_0x5a813b[_0x0e86('0x30')],qs['fields'](_0xb80509[_0x0e86('0x31')]['fields']));_0x9049a3[_0x0e86('0x34')]=_0x9049a3['attributes']['length']?_0x9049a3['attributes']:_0x5a813b[_0x0e86('0x30')];if(_0xb80509[_0x0e86('0x31')][_0x0e86('0x42')]){_0x9049a3[_0x0e86('0x43')]=[{'all':!![]}];}_0x9049a3=_[_0x0e86('0x3c')]({},_0x9049a3,_0xb80509[_0x0e86('0x40')]);return db['Campaign']['find'](_0x9049a3)['then'](handleEntityNotFound(_0x42fb33,null))[_0x0e86('0x23')](function(_0x1e220c){if(_0x1e220c){var _0x373ffc=_0x1e220c[_0x0e86('0x25')]({'plain':!![]});_0x373ffc=qs[_0x0e86('0x54')](_0x373ffc,['id',_0x0e86('0x55'),_0x0e86('0x56')]);_0xb80509[_0x0e86('0x4a')]=_[_0x0e86('0x54')](_0xb80509['body'],['id',_0x0e86('0x55'),_0x0e86('0x56')]);return db[_0x0e86('0x41')]['create'](_[_0x0e86('0x3c')](_0x373ffc,_0xb80509['body']),{'include':_0xb80509[_0x0e86('0x31')][_0x0e86('0x42')]?[{'all':!![]}]:undefined})[_0x0e86('0x23')](function(_0x3b3ba2){var _0x370ca6=_0xb80509[_0x0e86('0x4d')][_0x0e86('0x25')]({'plain':!![]});if(!_0x370ca6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x370ca6[_0x0e86('0x4c')]===_0x0e86('0x4d')){var _0x3424fa=_0x3b3ba2[_0x0e86('0x25')]({'plain':!![]});var _0x86558c=_0x0e86('0x26');return db[_0x0e86('0x4e')][_0x0e86('0x48')]({'where':{'name':_0x86558c,'userProfileId':_0x370ca6[_0x0e86('0x4f')]},'raw':!![]})[_0x0e86('0x23')](function(_0x3d6b76){if(_0x3d6b76&&_0x3d6b76[_0x0e86('0x50')]===0x0){return db['UserProfileResource'][_0x0e86('0x49')]({'name':_0x3424fa['name'],'resourceId':_0x3424fa['id'],'type':_0x3d6b76[_0x0e86('0x29')],'sectionId':_0x3d6b76['id']},{})[_0x0e86('0x23')](function(){return _0x3b3ba2;});}else{return _0x3b3ba2;}})[_0x0e86('0x45')](function(_0x57ee43){logger[_0x0e86('0x57')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x57ee43);throw _0x57ee43;});}return _0x3b3ba2;});}})[_0x0e86('0x23')](respondWithResult(_0x42fb33,0xc9))[_0x0e86('0x45')](handleError(_0x42fb33,null));};exports[_0x0e86('0x22')]=function(_0x379a7a,_0x259cc3){if(_0x379a7a[_0x0e86('0x4a')]['id']){delete _0x379a7a[_0x0e86('0x4a')]['id'];}return db['Campaign'][_0x0e86('0x48')]({'where':{'id':_0x379a7a[_0x0e86('0x53')]['id']}})[_0x0e86('0x23')](handleEntityNotFound(_0x259cc3,null))['then'](saveUpdates(_0x379a7a[_0x0e86('0x4a')],null))[_0x0e86('0x23')](respondWithResult(_0x259cc3,null))[_0x0e86('0x45')](handleError(_0x259cc3,null));};exports[_0x0e86('0x24')]=function(_0x5e3626,_0x269bab){return db[_0x0e86('0x41')][_0x0e86('0x48')]({'where':{'id':_0x5e3626[_0x0e86('0x53')]['id']}})['then'](handleEntityNotFound(_0x269bab,null))['then'](removeEntity(_0x269bab,null))[_0x0e86('0x45')](handleError(_0x269bab,null));};exports[_0x0e86('0x58')]=function(_0x14a450,_0x2e437e,_0x4b9264){var _0x492c74={'raw':!![],'where':{}};var _0x204ed0={};var _0x2ac63f={'count':0x0,'rows':[]};return db[_0x0e86('0x41')][_0x0e86('0x59')]({'where':{'id':_0x14a450[_0x0e86('0x53')]['id']}})[_0x0e86('0x23')](handleEntityNotFound(_0x2e437e,null))[_0x0e86('0x23')](function(_0x2d8d2e){if(_0x2d8d2e){_0x204ed0[_0x0e86('0x30')]=_[_0x0e86('0x47')](db['CmHopper'][_0x0e86('0x2d')]);_0x204ed0[_0x0e86('0x31')]=_[_0x0e86('0x47')](_0x14a450[_0x0e86('0x31')]);_0x204ed0[_0x0e86('0x32')]=_[_0x0e86('0x33')](_0x204ed0[_0x0e86('0x30')],_0x204ed0['query']);_0x492c74[_0x0e86('0x34')]=_[_0x0e86('0x33')](_0x204ed0[_0x0e86('0x30')],qs['fields'](_0x14a450[_0x0e86('0x31')]['fields']));_0x492c74[_0x0e86('0x34')]=_0x492c74[_0x0e86('0x34')][_0x0e86('0x36')]?_0x492c74[_0x0e86('0x34')]:_0x204ed0['model'];if(!_0x14a450['query'][_0x0e86('0x37')](_0x0e86('0x38'))){_0x492c74[_0x0e86('0x1b')]=qs[_0x0e86('0x1b')](_0x14a450['query'][_0x0e86('0x1b')]);_0x492c74[_0x0e86('0x19')]=qs[_0x0e86('0x19')](_0x14a450['query'][_0x0e86('0x19')]);}_0x492c74[_0x0e86('0x39')]=qs[_0x0e86('0x3a')](_0x14a450[_0x0e86('0x31')][_0x0e86('0x3a')]);_0x492c74[_0x0e86('0x3b')]=qs['filters'](_[_0x0e86('0x5a')](_0x14a450['query'],_0x204ed0[_0x0e86('0x32')]));_0x492c74[_0x0e86('0x3b')]['CampaignId']=_0x2d8d2e['id'];if(_0x14a450[_0x0e86('0x31')]['filter']){_0x492c74[_0x0e86('0x3b')]=_[_0x0e86('0x3c')](_0x492c74['where'],{'$or':_[_0x0e86('0x2c')](_0x492c74['attributes'],function(_0x5ede91){var _0x4028a6={};_0x4028a6[_0x5ede91]={'$like':'%'+_0x14a450[_0x0e86('0x31')][_0x0e86('0x3f')]+'%'};return _0x4028a6;})});}_0x492c74=_['merge']({},_0x492c74,_0x14a450['options']);return db[_0x0e86('0x5b')][_0x0e86('0x1c')]({'where':_0x492c74['where']})[_0x0e86('0x23')](function(_0x474b6b){_0x2ac63f['count']=_0x474b6b;if(_0x14a450[_0x0e86('0x31')]['includeAll']){_0x492c74[_0x0e86('0x43')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x492c74);})[_0x0e86('0x23')](function(_0xec1890){_0x2ac63f[_0x0e86('0x44')]=_0xec1890;return _0x2ac63f;});}})['then'](respondWithFilteredResult(_0x2e437e,_0x492c74))['catch'](handleError(_0x2e437e,null));};exports[_0x0e86('0x5c')]=function(_0x2b8ecc,_0x1de61f,_0x2a51ee){var _0x595dab={'raw':!![],'where':{}};var _0x575a0c={};var _0x5211d6={'count':0x0,'rows':[]};return db[_0x0e86('0x41')][_0x0e86('0x59')]({'where':{'id':_0x2b8ecc['params']['id']}})['then'](handleEntityNotFound(_0x1de61f,null))[_0x0e86('0x23')](function(_0x3d52e5){if(_0x3d52e5){_0x575a0c[_0x0e86('0x30')]=_[_0x0e86('0x47')](db['CmHopperHistory'][_0x0e86('0x2d')]);_0x575a0c[_0x0e86('0x31')]=_[_0x0e86('0x47')](_0x2b8ecc[_0x0e86('0x31')]);_0x575a0c['filters']=_[_0x0e86('0x33')](_0x575a0c['model'],_0x575a0c['query']);_0x595dab[_0x0e86('0x34')]=_[_0x0e86('0x33')](_0x575a0c[_0x0e86('0x30')],qs[_0x0e86('0x35')](_0x2b8ecc[_0x0e86('0x31')]['fields']));_0x595dab[_0x0e86('0x34')]=_0x595dab[_0x0e86('0x34')][_0x0e86('0x36')]?_0x595dab[_0x0e86('0x34')]:_0x575a0c[_0x0e86('0x30')];if(!_0x2b8ecc['query'][_0x0e86('0x37')](_0x0e86('0x38'))){_0x595dab[_0x0e86('0x1b')]=qs[_0x0e86('0x1b')](_0x2b8ecc[_0x0e86('0x31')][_0x0e86('0x1b')]);_0x595dab[_0x0e86('0x19')]=qs[_0x0e86('0x19')](_0x2b8ecc[_0x0e86('0x31')][_0x0e86('0x19')]);}_0x595dab[_0x0e86('0x39')]=qs[_0x0e86('0x3a')](_0x2b8ecc[_0x0e86('0x31')][_0x0e86('0x3a')]);_0x595dab['where']=qs['filters'](_[_0x0e86('0x5a')](_0x2b8ecc[_0x0e86('0x31')],_0x575a0c[_0x0e86('0x32')]));_0x595dab[_0x0e86('0x3b')][_0x0e86('0x5d')]=_0x3d52e5['id'];if(_0x2b8ecc[_0x0e86('0x31')][_0x0e86('0x3f')]){_0x595dab[_0x0e86('0x3b')]=_[_0x0e86('0x3c')](_0x595dab[_0x0e86('0x3b')],{'$or':_[_0x0e86('0x2c')](_0x595dab['attributes'],function(_0x4ad45d){var _0x5ad0b3={};_0x5ad0b3[_0x4ad45d]={'$like':'%'+_0x2b8ecc[_0x0e86('0x31')]['filter']+'%'};return _0x5ad0b3;})});}_0x595dab=_[_0x0e86('0x3c')]({},_0x595dab,_0x2b8ecc['options']);return db[_0x0e86('0x5e')][_0x0e86('0x1c')]({'where':_0x595dab[_0x0e86('0x3b')]})['then'](function(_0x3254fb){_0x5211d6['count']=_0x3254fb;if(_0x2b8ecc['query']['includeAll']){_0x595dab['include']=[{'all':!![]}];}return db[_0x0e86('0x5e')][_0x0e86('0x5f')](_0x595dab);})[_0x0e86('0x23')](function(_0x14a189){_0x5211d6[_0x0e86('0x44')]=_0x14a189;return _0x5211d6;});}})['then'](respondWithFilteredResult(_0x1de61f,_0x595dab))['catch'](handleError(_0x1de61f,null));};exports[_0x0e86('0x60')]=function(_0x4bda62,_0x16ac42,_0x4d97f8){var _0x50818b={'raw':!![],'where':{}};var _0x573c6e={};var _0x172100={'count':0x0,'rows':[]};return db['Campaign'][_0x0e86('0x59')]({'where':{'id':_0x4bda62[_0x0e86('0x53')]['id']}})['then'](handleEntityNotFound(_0x16ac42,null))[_0x0e86('0x23')](function(_0x644f28){if(_0x644f28){_0x573c6e['model']=_[_0x0e86('0x47')](db['CmHopperFinal'][_0x0e86('0x2d')]);_0x573c6e[_0x0e86('0x31')]=_[_0x0e86('0x47')](_0x4bda62[_0x0e86('0x31')]);_0x573c6e[_0x0e86('0x32')]=_[_0x0e86('0x33')](_0x573c6e[_0x0e86('0x30')],_0x573c6e['query']);_0x50818b[_0x0e86('0x34')]=_[_0x0e86('0x33')](_0x573c6e['model'],qs[_0x0e86('0x35')](_0x4bda62[_0x0e86('0x31')][_0x0e86('0x35')]));_0x50818b[_0x0e86('0x34')]=_0x50818b[_0x0e86('0x34')][_0x0e86('0x36')]?_0x50818b['attributes']:_0x573c6e[_0x0e86('0x30')];if(!_0x4bda62['query']['hasOwnProperty'](_0x0e86('0x38'))){_0x50818b[_0x0e86('0x1b')]=qs[_0x0e86('0x1b')](_0x4bda62[_0x0e86('0x31')][_0x0e86('0x1b')]);_0x50818b['offset']=qs['offset'](_0x4bda62[_0x0e86('0x31')][_0x0e86('0x19')]);}_0x50818b[_0x0e86('0x39')]=qs['sort'](_0x4bda62[_0x0e86('0x31')][_0x0e86('0x3a')]);_0x50818b[_0x0e86('0x3b')]=qs[_0x0e86('0x32')](_['pick'](_0x4bda62[_0x0e86('0x31')],_0x573c6e[_0x0e86('0x32')]));_0x50818b[_0x0e86('0x3b')][_0x0e86('0x5d')]=_0x644f28['id'];if(_0x4bda62[_0x0e86('0x31')][_0x0e86('0x3f')]){_0x50818b['where']=_[_0x0e86('0x3c')](_0x50818b['where'],{'$or':_[_0x0e86('0x2c')](_0x50818b[_0x0e86('0x34')],function(_0x1c99f4){var _0x1be099={};_0x1be099[_0x1c99f4]={'$like':'%'+_0x4bda62[_0x0e86('0x31')][_0x0e86('0x3f')]+'%'};return _0x1be099;})});}_0x50818b=_[_0x0e86('0x3c')]({},_0x50818b,_0x4bda62[_0x0e86('0x40')]);return db[_0x0e86('0x61')]['count']({'where':_0x50818b['where']})[_0x0e86('0x23')](function(_0x1a3ef2){_0x172100[_0x0e86('0x1c')]=_0x1a3ef2;if(_0x4bda62[_0x0e86('0x31')][_0x0e86('0x42')]){_0x50818b['include']=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x50818b);})[_0x0e86('0x23')](function(_0x2532f6){_0x172100[_0x0e86('0x44')]=_0x2532f6;return _0x172100;});}})[_0x0e86('0x23')](respondWithFilteredResult(_0x16ac42,_0x50818b))['catch'](handleError(_0x16ac42,null));};exports['getHopperBlacks']=function(_0x3e64a8,_0x2cd55f,_0x152961){var _0x2ae260={'raw':!![],'where':{}};var _0x108a0c={};var _0x506230={'count':0x0,'rows':[]};return db[_0x0e86('0x41')]['findOne']({'where':{'id':_0x3e64a8['params']['id']}})['then'](handleEntityNotFound(_0x2cd55f,null))[_0x0e86('0x23')](function(_0x68fb2a){if(_0x68fb2a){_0x108a0c[_0x0e86('0x30')]=_[_0x0e86('0x47')](db['CmHopperBlack'][_0x0e86('0x2d')]);_0x108a0c[_0x0e86('0x31')]=_[_0x0e86('0x47')](_0x3e64a8['query']);_0x108a0c['filters']=_[_0x0e86('0x33')](_0x108a0c[_0x0e86('0x30')],_0x108a0c[_0x0e86('0x31')]);_0x2ae260[_0x0e86('0x34')]=_[_0x0e86('0x33')](_0x108a0c[_0x0e86('0x30')],qs[_0x0e86('0x35')](_0x3e64a8[_0x0e86('0x31')][_0x0e86('0x35')]));_0x2ae260[_0x0e86('0x34')]=_0x2ae260[_0x0e86('0x34')][_0x0e86('0x36')]?_0x2ae260[_0x0e86('0x34')]:_0x108a0c[_0x0e86('0x30')];if(!_0x3e64a8[_0x0e86('0x31')][_0x0e86('0x37')](_0x0e86('0x38'))){_0x2ae260[_0x0e86('0x1b')]=qs[_0x0e86('0x1b')](_0x3e64a8[_0x0e86('0x31')][_0x0e86('0x1b')]);_0x2ae260[_0x0e86('0x19')]=qs[_0x0e86('0x19')](_0x3e64a8['query'][_0x0e86('0x19')]);}_0x2ae260['order']=qs[_0x0e86('0x3a')](_0x3e64a8[_0x0e86('0x31')][_0x0e86('0x3a')]);_0x2ae260['where']=qs[_0x0e86('0x32')](_[_0x0e86('0x5a')](_0x3e64a8[_0x0e86('0x31')],_0x108a0c['filters']));_0x2ae260['where'][_0x0e86('0x5d')]=_0x68fb2a['id'];if(_0x3e64a8[_0x0e86('0x31')][_0x0e86('0x3f')]){_0x2ae260[_0x0e86('0x3b')]=_[_0x0e86('0x3c')](_0x2ae260['where'],{'$or':_[_0x0e86('0x2c')](_0x2ae260[_0x0e86('0x34')],function(_0x1662ad){var _0x6318ad={};_0x6318ad[_0x1662ad]={'$like':'%'+_0x3e64a8[_0x0e86('0x31')][_0x0e86('0x3f')]+'%'};return _0x6318ad;})});}_0x2ae260=_[_0x0e86('0x3c')]({},_0x2ae260,_0x3e64a8['options']);return db[_0x0e86('0x62')][_0x0e86('0x1c')]({'where':_0x2ae260['where']})[_0x0e86('0x23')](function(_0x2cd3d4){_0x506230[_0x0e86('0x1c')]=_0x2cd3d4;if(_0x3e64a8[_0x0e86('0x31')]['includeAll']){_0x2ae260[_0x0e86('0x43')]=[{'all':!![]}];}return db[_0x0e86('0x62')][_0x0e86('0x5f')](_0x2ae260);})[_0x0e86('0x23')](function(_0x806099){_0x506230[_0x0e86('0x44')]=_0x806099;return _0x506230;});}})[_0x0e86('0x23')](respondWithFilteredResult(_0x2cd55f,_0x2ae260))[_0x0e86('0x45')](handleError(_0x2cd55f,null));};exports[_0x0e86('0x63')]=function(_0x5dc45d,_0x5a52f6,_0x40741c){var _0x49064c={};var _0x3270e5={};var _0x1f3d5b;var _0x2a74e4;return db[_0x0e86('0x41')]['findOne']({'where':{'id':_0x5dc45d[_0x0e86('0x53')]['id']}})[_0x0e86('0x23')](handleEntityNotFound(_0x5a52f6,null))[_0x0e86('0x23')](function(_0x2c7653){if(_0x2c7653){_0x1f3d5b=_0x2c7653;_0x3270e5[_0x0e86('0x30')]=_[_0x0e86('0x47')](db[_0x0e86('0x64')]['rawAttributes']);_0x3270e5[_0x0e86('0x31')]=_['keys'](_0x5dc45d['query']);_0x3270e5[_0x0e86('0x32')]=_['intersection'](_0x3270e5['model'],_0x3270e5[_0x0e86('0x31')]);_0x49064c[_0x0e86('0x34')]=_[_0x0e86('0x33')](_0x3270e5[_0x0e86('0x30')],qs[_0x0e86('0x35')](_0x5dc45d[_0x0e86('0x31')][_0x0e86('0x35')]));_0x49064c[_0x0e86('0x34')]=_0x49064c[_0x0e86('0x34')]['length']?_0x49064c[_0x0e86('0x34')]:_0x3270e5[_0x0e86('0x30')];_0x49064c['order']=qs[_0x0e86('0x3a')](_0x5dc45d[_0x0e86('0x31')][_0x0e86('0x3a')]);_0x49064c[_0x0e86('0x3b')]=qs[_0x0e86('0x32')](_[_0x0e86('0x5a')](_0x5dc45d[_0x0e86('0x31')],_0x3270e5[_0x0e86('0x32')]));if(_0x5dc45d['query'][_0x0e86('0x3f')]){_0x49064c['where']=_[_0x0e86('0x3c')](_0x49064c[_0x0e86('0x3b')],{'$or':_[_0x0e86('0x2c')](_0x49064c[_0x0e86('0x34')],function(_0x419088){var _0x2adef6={};_0x2adef6[_0x419088]={'$like':'%'+_0x5dc45d['query'][_0x0e86('0x3f')]+'%'};return _0x2adef6;})});}_0x49064c=_['merge']({},_0x49064c,_0x5dc45d['options']);return _0x1f3d5b[_0x0e86('0x63')](_0x49064c);}})[_0x0e86('0x23')](function(_0x5754f2){if(_0x5754f2){_0x2a74e4=_0x5754f2['length'];if(!_0x5dc45d[_0x0e86('0x31')][_0x0e86('0x37')](_0x0e86('0x38'))){_0x49064c[_0x0e86('0x1b')]=qs['limit'](_0x5dc45d[_0x0e86('0x31')][_0x0e86('0x1b')]);_0x49064c['offset']=qs[_0x0e86('0x19')](_0x5dc45d[_0x0e86('0x31')][_0x0e86('0x19')]);}return _0x1f3d5b[_0x0e86('0x63')](_0x49064c);}})[_0x0e86('0x23')](function(_0x4fc66f){if(_0x4fc66f){return _0x4fc66f?{'count':_0x2a74e4,'rows':_0x4fc66f}:null;}})[_0x0e86('0x23')](respondWithResult(_0x5a52f6,null))[_0x0e86('0x45')](handleError(_0x5a52f6,null));};exports[_0x0e86('0x65')]=function(_0x18fc81,_0xd776db,_0x361a09){var _0x634087,_0x29051c;var _0xd3638f=[];var _0x19fe5d=moment()['format'](_0x0e86('0x66'));return db[_0x0e86('0x41')][_0x0e86('0x48')]({'where':{'id':_0x18fc81['params']['id']}})[_0x0e86('0x23')](handleEntityNotFound(_0xd776db,null))['then'](function(_0x89b797){if(_0x89b797){_0x29051c=_0x89b797;return _0x89b797[_0x0e86('0x65')](_0x18fc81['body'][_0x0e86('0x67')],_['omit'](_0x18fc81[_0x0e86('0x4a')],[_0x0e86('0x67'),'id'])||{});}return null;})[_0x0e86('0x68')](function(_0x2b21c5){var _0x4ca95c;var _0x4d46d7;_0x634087=_0x2b21c5||[];var _0x1379a3=[];if(_0x2b21c5){for(var _0x4866cc=0x0;_0x4866cc<_0x2b21c5[_0x0e86('0x36')];_0x4866cc+=0x1){var _0xdc8a00=_0x2b21c5[_0x4866cc][_0x0e86('0x25')]({'plain':!![]});_0x29051c[_0x0e86('0x69')]=_0x18fc81[_0x0e86('0x4a')][_0x0e86('0x69')]?_0x18fc81[_0x0e86('0x4a')][_0x0e86('0x69')]:_0x29051c[_0x0e86('0x69')];switch(_0x29051c[_0x0e86('0x69')]){case _0x0e86('0x6a'):_0x4ca95c=squel[_0x0e86('0x6b')]()[_0x0e86('0x6c')](_0x0e86('0x6d'))[_0x0e86('0x6e')]([_0x0e86('0x6f'),'scheduledAt',_0x0e86('0x70'),_0x0e86('0x71'),'CampaignId',_0x0e86('0x55'),_0x0e86('0x56')],squel['select']()[_0x0e86('0x72')](_0x0e86('0x6f'),'phone')['field'](_0x0e86('0x73'),_0x0e86('0x74'))['field']('id',_0x0e86('0x70'))[_0x0e86('0x72')](_0xdc8a00[_0x0e86('0x75')][_0x0e86('0x76')](),_0x0e86('0x71'))[_0x0e86('0x72')](_0x18fc81[_0x0e86('0x53')]['id'][_0x0e86('0x76')](),_0x0e86('0x5d'))[_0x0e86('0x72')]('\x27'+_0x19fe5d+'\x27',_0x0e86('0x55'))[_0x0e86('0x72')]('\x27'+_0x19fe5d+'\x27',_0x0e86('0x56'))[_0x0e86('0x77')]('cm_contacts')[_0x0e86('0x3b')](_0x0e86('0x78'))[_0x0e86('0x3b')]('ListId\x20=\x20?',_0xdc8a00[_0x0e86('0x75')][_0x0e86('0x76')]())[_0x0e86('0x3b')](_0x0e86('0x79'))[_0x0e86('0x3b')]('phone\x20NOT\x20IN\x20(?)',squel[_0x0e86('0x7a')]()[_0x0e86('0x72')](_0x0e86('0x7b'))[_0x0e86('0x77')](_0x0e86('0x7c'))['where'](_0x0e86('0x7d'),_0x18fc81[_0x0e86('0x53')]['id'][_0x0e86('0x76')]()))[_0x0e86('0x3b')](_0x0e86('0x7e'),squel[_0x0e86('0x7a')]()[_0x0e86('0x72')](_0x0e86('0x7f'))[_0x0e86('0x77')](_0x0e86('0x6d'))[_0x0e86('0x3b')](_0x0e86('0x7d'),_0x18fc81[_0x0e86('0x53')]['id'][_0x0e86('0x76')]())))[_0x0e86('0x76')]();break;case _0x0e86('0x80'):_0x4ca95c=squel['insert']()[_0x0e86('0x6c')](_0x0e86('0x6d'))[_0x0e86('0x6e')]([_0x0e86('0x6f'),_0x0e86('0x74'),_0x0e86('0x70'),_0x0e86('0x71'),_0x0e86('0x5d'),_0x0e86('0x55'),_0x0e86('0x56')],squel[_0x0e86('0x7a')]()[_0x0e86('0x72')](_0x0e86('0x6f'),_0x0e86('0x6f'))[_0x0e86('0x72')](_0x0e86('0x73'),_0x0e86('0x74'))[_0x0e86('0x72')]('id',_0x0e86('0x70'))[_0x0e86('0x72')](_0xdc8a00[_0x0e86('0x75')][_0x0e86('0x76')](),_0x0e86('0x71'))['field'](_0x18fc81[_0x0e86('0x53')]['id']['toString'](),_0x0e86('0x5d'))[_0x0e86('0x72')]('\x27'+_0x19fe5d+'\x27','createdAt')[_0x0e86('0x72')]('\x27'+_0x19fe5d+'\x27','updatedAt')[_0x0e86('0x77')](_0x0e86('0x81'))['where']('deletedAt\x20IS\x20NULL')[_0x0e86('0x3b')](_0x0e86('0x82'),_0xdc8a00[_0x0e86('0x75')]['toString']())[_0x0e86('0x3b')]('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x0e86('0x7a')]()[_0x0e86('0x72')](_0x0e86('0x7f'))['from'](_0x0e86('0x6d'))[_0x0e86('0x3b')](_0x0e86('0x7d'),_0x18fc81[_0x0e86('0x53')]['id']['toString']())))[_0x0e86('0x76')]();break;default:_0x4ca95c=squel[_0x0e86('0x6b')]()[_0x0e86('0x6c')](_0x0e86('0x6d'))[_0x0e86('0x6e')]([_0x0e86('0x6f'),'scheduledAt','ContactId',_0x0e86('0x71'),'CampaignId',_0x0e86('0x55'),_0x0e86('0x56')],squel['select']()[_0x0e86('0x72')](_0x0e86('0x6f'),_0x0e86('0x6f'))[_0x0e86('0x72')](_0x0e86('0x73'),_0x0e86('0x74'))[_0x0e86('0x72')]('id',_0x0e86('0x70'))[_0x0e86('0x72')](_0xdc8a00['CmListId']['toString'](),_0x0e86('0x71'))['field'](_0x18fc81['params']['id']['toString'](),_0x0e86('0x5d'))['field']('\x27'+_0x19fe5d+'\x27',_0x0e86('0x55'))['field']('\x27'+_0x19fe5d+'\x27',_0x0e86('0x56'))[_0x0e86('0x77')](_0x0e86('0x81'))[_0x0e86('0x3b')]('deletedAt\x20IS\x20NULL')[_0x0e86('0x3b')](_0x0e86('0x82'),_0xdc8a00[_0x0e86('0x75')][_0x0e86('0x76')]())['where'](_0x0e86('0x79')))[_0x0e86('0x76')]();}_0x4d46d7=squel['insert']()[_0x0e86('0x6c')](_0x0e86('0x83'))[_0x0e86('0x6e')]([_0x0e86('0x84'),_0x0e86('0x74'),'phone',_0x0e86('0x85'),'createdAt',_0x0e86('0x56')],squel[_0x0e86('0x7a')]()['field']('h.id','id')[_0x0e86('0x72')]('NOW()',_0x0e86('0x74'))[_0x0e86('0x72')](_0x0e86('0x86'),_0x0e86('0x6f'))[_0x0e86('0x72')]('ci.OrderBY',_0x0e86('0x85'))[_0x0e86('0x72')]('\x27'+_0x19fe5d+'\x27',_0x0e86('0x55'))[_0x0e86('0x72')]('\x27'+_0x19fe5d+'\x27',_0x0e86('0x56'))[_0x0e86('0x77')](_0x0e86('0x87'),'ci')['join']('cm_hopper','h',_0x0e86('0x88'))[_0x0e86('0x3b')](_0x0e86('0x89'),_0xdc8a00[_0x0e86('0x75')][_0x0e86('0x76')]())[_0x0e86('0x3b')](_0x0e86('0x8a'),_0x18fc81['params']['id'][_0x0e86('0x76')]())[_0x0e86('0x3b')](_0x0e86('0x8b'),_0x19fe5d))[_0x0e86('0x76')]();_0x1379a3[_0x0e86('0x8c')](db[_0x0e86('0x8d')]['query'](_0x4ca95c));_0xd3638f[_0x0e86('0x8c')](db['sequelize']['query'](_0x4d46d7));}return BPromise[_0x0e86('0x8e')](_0x1379a3);}})['then'](function(){return BPromise[_0x0e86('0x8e')](_0xd3638f);})[_0x0e86('0x23')](function(){return _0x634087;})['then'](respondWithResult(_0xd776db,null))[_0x0e86('0x45')](handleError(_0xd776db,null));};exports[_0x0e86('0x8f')]=function(_0x33134e,_0x36011d,_0x2fc9f2){return db[_0x0e86('0x41')][_0x0e86('0x48')]({'where':{'id':_0x33134e[_0x0e86('0x53')]['id']}})['then'](handleEntityNotFound(_0x36011d,null))['then'](function(_0x1d03d7){if(_0x1d03d7){return _0x1d03d7[_0x0e86('0x8f')](_0x33134e[_0x0e86('0x31')][_0x0e86('0x67')]);}})[_0x0e86('0x23')](function(_0x5e07a3){if(_0x5e07a3){return db['CmHopper'][_0x0e86('0x24')]({'where':{'ListId':_0x33134e['query'][_0x0e86('0x67')],'CampaignId':_0x33134e[_0x0e86('0x53')]['id']}})[_0x0e86('0x23')](function(){return _0x5e07a3;});}})[_0x0e86('0x23')](respondWithStatusCode(_0x36011d,null))[_0x0e86('0x45')](handleError(_0x36011d,null));};exports[_0x0e86('0x90')]=function(_0x580138,_0xb36335,_0x8aa5d){var _0x2d52af={};var _0xe18336={};var _0x43123f;var _0x52442d;return db['Campaign'][_0x0e86('0x59')]({'where':{'id':_0x580138[_0x0e86('0x53')]['id']}})[_0x0e86('0x23')](handleEntityNotFound(_0xb36335,null))[_0x0e86('0x23')](function(_0x536ed9){if(_0x536ed9){_0x43123f=_0x536ed9;_0xe18336['model']=_[_0x0e86('0x47')](db[_0x0e86('0x64')]['rawAttributes']);_0xe18336[_0x0e86('0x31')]=_[_0x0e86('0x47')](_0x580138[_0x0e86('0x31')]);_0xe18336[_0x0e86('0x32')]=_[_0x0e86('0x33')](_0xe18336[_0x0e86('0x30')],_0xe18336[_0x0e86('0x31')]);_0x2d52af['attributes']=_[_0x0e86('0x33')](_0xe18336['model'],qs[_0x0e86('0x35')](_0x580138['query'][_0x0e86('0x35')]));_0x2d52af['attributes']=_0x2d52af[_0x0e86('0x34')][_0x0e86('0x36')]?_0x2d52af[_0x0e86('0x34')]:_0xe18336[_0x0e86('0x30')];_0x2d52af[_0x0e86('0x39')]=qs[_0x0e86('0x3a')](_0x580138[_0x0e86('0x31')][_0x0e86('0x3a')]);_0x2d52af[_0x0e86('0x3b')]=qs[_0x0e86('0x32')](_[_0x0e86('0x5a')](_0x580138['query'],_0xe18336[_0x0e86('0x32')]));if(_0x580138[_0x0e86('0x31')]['filter']){_0x2d52af[_0x0e86('0x3b')]=_[_0x0e86('0x3c')](_0x2d52af[_0x0e86('0x3b')],{'$or':_[_0x0e86('0x2c')](_0x2d52af[_0x0e86('0x34')],function(_0x1df37c){var _0x1f1486={};_0x1f1486[_0x1df37c]={'$like':'%'+_0x580138['query'][_0x0e86('0x3f')]+'%'};return _0x1f1486;})});}_0x2d52af=_[_0x0e86('0x3c')]({},_0x2d52af,_0x580138[_0x0e86('0x40')]);return _0x43123f[_0x0e86('0x90')](_0x2d52af);}})[_0x0e86('0x23')](function(_0x427d8c){if(_0x427d8c){_0x52442d=_0x427d8c[_0x0e86('0x36')];if(!_0x580138[_0x0e86('0x31')][_0x0e86('0x37')]('nolimit')){_0x2d52af['limit']=qs[_0x0e86('0x1b')](_0x580138[_0x0e86('0x31')][_0x0e86('0x1b')]);_0x2d52af['offset']=qs[_0x0e86('0x19')](_0x580138[_0x0e86('0x31')]['offset']);}return _0x43123f[_0x0e86('0x90')](_0x2d52af);}})[_0x0e86('0x23')](function(_0x5544cd){if(_0x5544cd){return _0x5544cd?{'count':_0x52442d,'rows':_0x5544cd}:null;}})['then'](respondWithResult(_0xb36335,null))[_0x0e86('0x45')](handleError(_0xb36335,null));};exports['addBlackLists']=function(_0x342522,_0x369a02,_0x1564e3){var _0x4e3bc0,_0x5ddc03;var _0x470a96=[];var _0x1dfe5f=moment()[_0x0e86('0x91')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x0e86('0x41')]['find']({'where':{'id':_0x342522[_0x0e86('0x53')]['id']}})[_0x0e86('0x23')](handleEntityNotFound(_0x369a02,null))[_0x0e86('0x23')](function(_0x3b8ad0){if(_0x3b8ad0){_0x5ddc03=_0x3b8ad0;return _0x3b8ad0['addBlackLists'](_0x342522['body'][_0x0e86('0x67')],_['omit'](_0x342522[_0x0e86('0x4a')],[_0x0e86('0x67'),'id'])||{});}return null;})[_0x0e86('0x68')](function(_0x5a557a){var _0x4d9f1e;var _0x175419;_0x4e3bc0=_0x5a557a||[];var _0x1e9950=[];if(_0x5a557a){for(var _0x4e3bcb=0x0;_0x4e3bcb<_0x5a557a['length'];_0x4e3bcb+=0x1){var _0x496260=_0x5a557a[_0x4e3bcb][_0x0e86('0x25')]({'plain':!![]});_0x4d9f1e=squel['insert']()[_0x0e86('0x6c')](_0x0e86('0x92'))[_0x0e86('0x6e')]([_0x0e86('0x6f'),'ContactId',_0x0e86('0x71'),_0x0e86('0x5d'),'createdAt',_0x0e86('0x56')],squel['select']()[_0x0e86('0x72')](_0x0e86('0x6f'),_0x0e86('0x6f'))[_0x0e86('0x72')]('id',_0x0e86('0x70'))[_0x0e86('0x72')](_0x496260['CmListId']['toString'](),_0x0e86('0x71'))[_0x0e86('0x72')](_0x342522['params']['id']['toString'](),_0x0e86('0x5d'))['field']('NOW()',_0x0e86('0x55'))[_0x0e86('0x72')]('NOW()',_0x0e86('0x56'))['from'](_0x0e86('0x81'))['where']('deletedAt\x20IS\x20NULL')[_0x0e86('0x3b')](_0x0e86('0x82'),_0x496260[_0x0e86('0x75')][_0x0e86('0x76')]())[_0x0e86('0x3b')](_0x0e86('0x79')))['toString']();_0x1e9950['push'](db['sequelize'][_0x0e86('0x31')](_0x4d9f1e));}return BPromise['all'](_0x1e9950);}})[_0x0e86('0x23')](function(){return _0x4e3bc0;})[_0x0e86('0x23')](respondWithResult(_0x369a02,null))[_0x0e86('0x45')](handleError(_0x369a02,null));};exports['removeBlackLists']=function(_0x33c463,_0x56cd27,_0x51dc39){return db[_0x0e86('0x41')][_0x0e86('0x48')]({'where':{'id':_0x33c463['params']['id']}})[_0x0e86('0x23')](handleEntityNotFound(_0x56cd27,null))[_0x0e86('0x23')](function(_0x2d4e0c){if(_0x2d4e0c){return _0x2d4e0c[_0x0e86('0x93')](_0x33c463['query'][_0x0e86('0x67')]);}})[_0x0e86('0x23')](function(_0x468f4e){if(_0x468f4e){return db['CmHopperBlack'][_0x0e86('0x24')]({'where':{'ListId':_0x33c463['query'][_0x0e86('0x67')],'CampaignId':_0x33c463['params']['id']}})['then'](function(){return _0x468f4e;});}})[_0x0e86('0x23')](respondWithStatusCode(_0x56cd27,null))['catch'](handleError(_0x56cd27,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 43e09cb..864e1ba 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(_0x10d8ad,_0x4c10fa){var _0x212cfc=function(_0x40a5d7){while(--_0x40a5d7){_0x10d8ad['push'](_0x10d8ad['shift']());}};_0x212cfc(++_0x4c10fa);}(_0x7a54,0x106));var _0x47a5=function(_0x45512c,_0xfbed96){_0x45512c=_0x45512c-0x0;var _0xb6445f=_0x7a54[_0x45512c];return _0xb6445f;};'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(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'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 894b0b7..6908ffa 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 _0x37f8=['util','moment','bluebird','randomstring','../../mysqldb','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','map','model'];(function(_0x39ac56,_0x2d111e){var _0x445a26=function(_0x25a8ec){while(--_0x25a8ec){_0x39ac56['push'](_0x39ac56['shift']());}};_0x445a26(++_0x2d111e);}(_0x37f8,0xd2));var _0x837f=function(_0x3c556d,_0x518379){_0x3c556d=_0x3c556d-0x0;var _0x2e4de5=_0x37f8[_0x3c556d];return _0x2e4de5;};'use strict';var _=require('lodash');var util=require(_0x837f('0x0'));var moment=require(_0x837f('0x1'));var BPromise=require(_0x837f('0x2'));var rs=require(_0x837f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x837f('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x837f('0x5')][_0x837f('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x224ad2,_0x40270f,_0x4111cb){return new BPromise(function(_0x25bbcb,_0x12c732){return client[_0x837f('0x7')](_0x224ad2,_0x4111cb)[_0x837f('0x8')](function(_0x2f1dc7){logger[_0x837f('0x9')](_0x837f('0xa'),_0x40270f,_0x837f('0xb'));logger[_0x837f('0xc')](_0x837f('0xd'),_0x40270f,'request\x20sent',JSON[_0x837f('0xe')](_0x2f1dc7));if(_0x2f1dc7[_0x837f('0xf')]){if(_0x2f1dc7[_0x837f('0xf')][_0x837f('0x10')]===0x1f4){logger[_0x837f('0xf')]('Campaign,\x20%s,\x20%s',_0x40270f,_0x2f1dc7['error'][_0x837f('0x11')]);return _0x12c732(_0x2f1dc7[_0x837f('0xf')][_0x837f('0x11')]);}logger[_0x837f('0xf')](_0x837f('0xa'),_0x40270f,_0x2f1dc7['error'][_0x837f('0x11')]);return _0x25bbcb(_0x2f1dc7[_0x837f('0xf')][_0x837f('0x11')]);}else{logger[_0x837f('0x9')](_0x837f('0xa'),_0x40270f,_0x837f('0xb'));_0x25bbcb(_0x2f1dc7['result'][_0x837f('0x11')]);}})[_0x837f('0x12')](function(_0x47bbe7){logger[_0x837f('0xf')](_0x837f('0xa'),_0x40270f,_0x47bbe7);_0x12c732(_0x47bbe7);});});}exports[_0x837f('0x13')]=function(_0x1d17b3){var _0x53279d=this;return new Promise(function(_0x1d974f,_0x2d5d54){return db[_0x837f('0x14')][_0x837f('0x15')]({'raw':_0x1d17b3[_0x837f('0x16')]?_0x1d17b3['options'][_0x837f('0x17')]===undefined?!![]:![]:!![],'where':_0x1d17b3[_0x837f('0x16')]?_0x1d17b3[_0x837f('0x16')][_0x837f('0x18')]||null:null,'attributes':_0x1d17b3[_0x837f('0x16')]?_0x1d17b3['options'][_0x837f('0x19')]||null:null,'limit':_0x1d17b3[_0x837f('0x16')]?_0x1d17b3[_0x837f('0x16')][_0x837f('0x1a')]||null:null,'include':_0x1d17b3[_0x837f('0x16')]?_0x1d17b3[_0x837f('0x16')][_0x837f('0x1b')]?_[_0x837f('0x1c')](_0x1d17b3[_0x837f('0x16')][_0x837f('0x1b')],function(_0x3fa18e){return{'model':db[_0x3fa18e[_0x837f('0x1d')]],'as':_0x3fa18e['as'],'attributes':_0x3fa18e[_0x837f('0x19')],'include':_0x3fa18e[_0x837f('0x1b')]?_[_0x837f('0x1c')](_0x3fa18e[_0x837f('0x1b')],function(_0x43ca7d){return{'model':db[_0x43ca7d[_0x837f('0x1d')]],'as':_0x43ca7d['as'],'attributes':_0x43ca7d[_0x837f('0x19')],'include':_0x43ca7d[_0x837f('0x1b')]?_[_0x837f('0x1c')](_0x43ca7d[_0x837f('0x1b')],function(_0x21f826){return{'model':db[_0x21f826['model']],'as':_0x21f826['as'],'attributes':_0x21f826[_0x837f('0x19')]};}):[]};}):[]};}):[]:[]})[_0x837f('0x8')](function(_0x4290e6){logger['info']('GetCampaign',_0x1d17b3);logger[_0x837f('0xc')](_0x837f('0x13'),_0x1d17b3,JSON[_0x837f('0xe')](_0x4290e6));_0x1d974f(_0x4290e6);})[_0x837f('0x12')](function(_0x30a3d9){logger[_0x837f('0xf')](_0x837f('0x13'),_0x30a3d9['message'],_0x1d17b3);_0x2d5d54(_0x53279d[_0x837f('0xf')](0x1f4,_0x30a3d9[_0x837f('0x11')]));});});};
\ No newline at end of file
+var _0x757f=['info','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','Campaign,\x20%s,\x20%s','message','result','GetCampaign','Campaign','findAll','raw','where','options','attributes','limit','include','map','model','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0x4e55a9,_0x241b22){var _0x4a9b67=function(_0x2a3bd1){while(--_0x2a3bd1){_0x4e55a9['push'](_0x4e55a9['shift']());}};_0x4a9b67(++_0x241b22);}(_0x757f,0xee));var _0xf757=function(_0x3beea0,_0x416691){_0x3beea0=_0x3beea0-0x0;var _0x314eb1=_0x757f[_0x3beea0];return _0x314eb1;};'use strict';var _=require(_0xf757('0x0'));var util=require('util');var moment=require(_0xf757('0x1'));var BPromise=require(_0xf757('0x2'));var rs=require(_0xf757('0x3'));var fs=require('fs');var Redis=require(_0xf757('0x4'));var db=require(_0xf757('0x5'))['db'];var utils=require(_0xf757('0x6'));var logger=require(_0xf757('0x7'))(_0xf757('0x8'));var config=require(_0xf757('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf757('0xa')][_0xf757('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e1e06,_0x2c0fcf,_0x44b312){return new BPromise(function(_0x565224,_0x5bf802){return client[_0xf757('0xc')](_0x4e1e06,_0x44b312)[_0xf757('0xd')](function(_0x1360ac){logger[_0xf757('0xe')]('Campaign,\x20%s,\x20%s',_0x2c0fcf,_0xf757('0xf'));logger[_0xf757('0x10')](_0xf757('0x11'),_0x2c0fcf,_0xf757('0xf'),JSON[_0xf757('0x12')](_0x1360ac));if(_0x1360ac[_0xf757('0x13')]){if(_0x1360ac[_0xf757('0x13')][_0xf757('0x14')]===0x1f4){logger[_0xf757('0x13')](_0xf757('0x15'),_0x2c0fcf,_0x1360ac[_0xf757('0x13')][_0xf757('0x16')]);return _0x5bf802(_0x1360ac[_0xf757('0x13')][_0xf757('0x16')]);}logger[_0xf757('0x13')](_0xf757('0x15'),_0x2c0fcf,_0x1360ac[_0xf757('0x13')][_0xf757('0x16')]);return _0x565224(_0x1360ac['error'][_0xf757('0x16')]);}else{logger[_0xf757('0xe')]('Campaign,\x20%s,\x20%s',_0x2c0fcf,_0xf757('0xf'));_0x565224(_0x1360ac[_0xf757('0x17')][_0xf757('0x16')]);}})['catch'](function(_0x1c5934){logger[_0xf757('0x13')](_0xf757('0x15'),_0x2c0fcf,_0x1c5934);_0x5bf802(_0x1c5934);});});}exports[_0xf757('0x18')]=function(_0x54af52){var _0x2ef7fe=this;return new Promise(function(_0x4124a0,_0x23277e){return db[_0xf757('0x19')][_0xf757('0x1a')]({'raw':_0x54af52['options']?_0x54af52['options'][_0xf757('0x1b')]===undefined?!![]:![]:!![],'where':_0x54af52['options']?_0x54af52['options'][_0xf757('0x1c')]||null:null,'attributes':_0x54af52[_0xf757('0x1d')]?_0x54af52['options'][_0xf757('0x1e')]||null:null,'limit':_0x54af52[_0xf757('0x1d')]?_0x54af52[_0xf757('0x1d')][_0xf757('0x1f')]||null:null,'include':_0x54af52['options']?_0x54af52['options'][_0xf757('0x20')]?_[_0xf757('0x21')](_0x54af52[_0xf757('0x1d')][_0xf757('0x20')],function(_0x3d38dd){return{'model':db[_0x3d38dd[_0xf757('0x22')]],'as':_0x3d38dd['as'],'attributes':_0x3d38dd[_0xf757('0x1e')],'include':_0x3d38dd[_0xf757('0x20')]?_[_0xf757('0x21')](_0x3d38dd[_0xf757('0x20')],function(_0x4d9012){return{'model':db[_0x4d9012['model']],'as':_0x4d9012['as'],'attributes':_0x4d9012[_0xf757('0x1e')],'include':_0x4d9012[_0xf757('0x20')]?_[_0xf757('0x21')](_0x4d9012[_0xf757('0x20')],function(_0x207bae){return{'model':db[_0x207bae[_0xf757('0x22')]],'as':_0x207bae['as'],'attributes':_0x207bae[_0xf757('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xf757('0xd')](function(_0x58ac7a){logger['info'](_0xf757('0x18'),_0x54af52);logger['debug'](_0xf757('0x18'),_0x54af52,JSON['stringify'](_0x58ac7a));_0x4124a0(_0x58ac7a);})[_0xf757('0x23')](function(_0x1345d6){logger['error'](_0xf757('0x18'),_0x1345d6[_0xf757('0x16')],_0x54af52);_0x23277e(_0x2ef7fe[_0xf757('0x13')](0x1f4,_0x1345d6[_0xf757('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index bdd3601..736a7eb 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 _0xb6b1=['/:id','update','delete','destroy','removeLists','removeBlackLists','exports','multer','path','express','Router','../../components/auth/service','../../config/environment','./campaign.controller','get','isAuthenticated','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/blacklists','getBlackLists','post','create','clone','/:id/lists','addLists','addBlackLists','put'];(function(_0x468602,_0x388c46){var _0x2c9203=function(_0x54ba9f){while(--_0x54ba9f){_0x468602['push'](_0x468602['shift']());}};_0x2c9203(++_0x388c46);}(_0xb6b1,0x17b));var _0x1b6b=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0xb6b1[_0x565c49];return _0x20ca34;};'use strict';var multer=require(_0x1b6b('0x0'));var util=require('util');var path=require(_0x1b6b('0x1'));var timeout=require('connect-timeout');var express=require(_0x1b6b('0x2'));var router=express[_0x1b6b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1b6b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1b6b('0x5'));var controller=require(_0x1b6b('0x6'));router[_0x1b6b('0x7')]('/',auth[_0x1b6b('0x8')](),controller['index']);router[_0x1b6b('0x7')]('/:id',auth[_0x1b6b('0x8')](),controller['show']);router[_0x1b6b('0x7')](_0x1b6b('0x9'),auth[_0x1b6b('0x8')](),controller[_0x1b6b('0xa')]);router['get']('/:id/hopper_histories',auth[_0x1b6b('0x8')](),controller[_0x1b6b('0xb')]);router[_0x1b6b('0x7')](_0x1b6b('0xc'),auth[_0x1b6b('0x8')](),controller[_0x1b6b('0xd')]);router[_0x1b6b('0x7')]('/:id/hopper_black',auth[_0x1b6b('0x8')](),controller[_0x1b6b('0xe')]);router[_0x1b6b('0x7')]('/:id/lists',auth[_0x1b6b('0x8')](),controller['getLists']);router['get'](_0x1b6b('0xf'),auth[_0x1b6b('0x8')](),controller[_0x1b6b('0x10')]);router[_0x1b6b('0x11')]('/',auth[_0x1b6b('0x8')](),controller[_0x1b6b('0x12')]);router[_0x1b6b('0x11')]('/:id/clone',auth[_0x1b6b('0x8')](),controller[_0x1b6b('0x13')]);router[_0x1b6b('0x11')](_0x1b6b('0x14'),auth['isAuthenticated'](),controller[_0x1b6b('0x15')]);router[_0x1b6b('0x11')](_0x1b6b('0xf'),auth['isAuthenticated'](),controller[_0x1b6b('0x16')]);router[_0x1b6b('0x17')](_0x1b6b('0x18'),auth[_0x1b6b('0x8')](),controller[_0x1b6b('0x19')]);router[_0x1b6b('0x1a')](_0x1b6b('0x18'),auth[_0x1b6b('0x8')](),controller[_0x1b6b('0x1b')]);router[_0x1b6b('0x1a')]('/:id/lists',auth[_0x1b6b('0x8')](),controller[_0x1b6b('0x1c')]);router[_0x1b6b('0x1a')](_0x1b6b('0xf'),auth[_0x1b6b('0x8')](),controller[_0x1b6b('0x1d')]);module[_0x1b6b('0x1e')]=router;
\ No newline at end of file
+var _0x6208=['multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','./campaign.controller','isAuthenticated','get','/:id','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','put','delete','destroy','removeLists','removeBlackLists','exports'];(function(_0x47370b,_0x1c12e8){var _0x43e3e2=function(_0x52fffe){while(--_0x52fffe){_0x47370b['push'](_0x47370b['shift']());}};_0x43e3e2(++_0x1c12e8);}(_0x6208,0x15c));var _0x8620=function(_0x2fbd0e,_0x3460a9){_0x2fbd0e=_0x2fbd0e-0x0;var _0x481c9f=_0x6208[_0x2fbd0e];return _0x481c9f;};'use strict';var multer=require(_0x8620('0x0'));var util=require(_0x8620('0x1'));var path=require('path');var timeout=require(_0x8620('0x2'));var express=require('express');var router=express[_0x8620('0x3')]();var fs_extra=require(_0x8620('0x4'));var auth=require(_0x8620('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8620('0x6'));router['get']('/',auth[_0x8620('0x7')](),controller['index']);router[_0x8620('0x8')](_0x8620('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x8620('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller['getHoppers']);router[_0x8620('0x8')](_0x8620('0xa'),auth[_0x8620('0x7')](),controller[_0x8620('0xb')]);router[_0x8620('0x8')](_0x8620('0xc'),auth[_0x8620('0x7')](),controller[_0x8620('0xd')]);router[_0x8620('0x8')](_0x8620('0xe'),auth[_0x8620('0x7')](),controller['getHopperBlacks']);router[_0x8620('0x8')](_0x8620('0xf'),auth[_0x8620('0x7')](),controller['getLists']);router[_0x8620('0x8')](_0x8620('0x10'),auth[_0x8620('0x7')](),controller[_0x8620('0x11')]);router[_0x8620('0x12')]('/',auth[_0x8620('0x7')](),controller[_0x8620('0x13')]);router[_0x8620('0x12')](_0x8620('0x14'),auth[_0x8620('0x7')](),controller[_0x8620('0x15')]);router[_0x8620('0x12')](_0x8620('0xf'),auth[_0x8620('0x7')](),controller[_0x8620('0x16')]);router[_0x8620('0x12')](_0x8620('0x10'),auth[_0x8620('0x7')](),controller['addBlackLists']);router[_0x8620('0x17')](_0x8620('0x9'),auth[_0x8620('0x7')](),controller['update']);router[_0x8620('0x18')](_0x8620('0x9'),auth[_0x8620('0x7')](),controller[_0x8620('0x19')]);router['delete'](_0x8620('0xf'),auth[_0x8620('0x7')](),controller[_0x8620('0x1a')]);router[_0x8620('0x18')]('/:id/blacklists',auth[_0x8620('0x7')](),controller[_0x8620('0x1b')]);module[_0x8620('0x1c')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 22f1f5e..e61b06c 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 _0xdfa1=['VIRTUAL','getDataValue','sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdfa1,0x1b5));var _0x1dfa=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0xdfa1[_0x1573ea];return _0x51c0e2;};'use strict';var Sequelize=require(_0x1dfa('0x0'));module[_0x1dfa('0x1')]={'key':{'type':Sequelize[_0x1dfa('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x1dfa('0x2')]},'name':{'type':Sequelize[_0x1dfa('0x3')],'get':function(){return this[_0x1dfa('0x4')]('key');}}};
\ No newline at end of file
+var _0xbc74=['exports','TEXT','STRING','VIRTUAL','getDataValue','key'];(function(_0x10d8ad,_0x4c10fa){var _0x212cfc=function(_0x40a5d7){while(--_0x40a5d7){_0x10d8ad['push'](_0x10d8ad['shift']());}};_0x212cfc(++_0x4c10fa);}(_0xbc74,0x162));var _0x4bc7=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xbc74[_0x13e741];return _0x3f8bb3;};'use strict';var Sequelize=require('sequelize');module[_0x4bc7('0x0')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x4bc7('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x4bc7('0x2')]},'name':{'type':Sequelize[_0x4bc7('0x3')],'get':function(){return this[_0x4bc7('0x4')](_0x4bc7('0x5'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 5d3b106..b42015a 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 _0x5cd5=['nolimit','order','sort','pick','filter','where','merge','options','include','findAll','rows','catch','show','keys','length','includeAll','find','body','params','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','role','UserProfileSection','CannedAnswers','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','mustache','util','path','sox','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','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','destroy','then','get','error','stack','name','index','map','CannedAnswer','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty'];(function(_0x4764cb,_0x15a140){var _0x3fc947=function(_0x2e1033){while(--_0x2e1033){_0x4764cb['push'](_0x4764cb['shift']());}};_0x3fc947(++_0x15a140);}(_0x5cd5,0x7f));var _0x55cd=function(_0xca550e,_0x54da07){_0xca550e=_0xca550e-0x0;var _0x48a51e=_0x5cd5[_0xca550e];return _0x48a51e;};'use strict';var emlformat=require(_0x55cd('0x0'));var rimraf=require(_0x55cd('0x1'));var zipdir=require(_0x55cd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x55cd('0x3'));var util=require(_0x55cd('0x4'));var path=require(_0x55cd('0x5'));var sox=require(_0x55cd('0x6'));var csv=require(_0x55cd('0x7'));var ejs=require(_0x55cd('0x8'));var fs=require('fs');var fs_extra=require(_0x55cd('0x9'));var _=require(_0x55cd('0xa'));var squel=require('squel');var crypto=require(_0x55cd('0xb'));var jsforce=require(_0x55cd('0xc'));var deskjs=require(_0x55cd('0xd'));var toCsv=require(_0x55cd('0x7'));var querystring=require('querystring');var Papa=require(_0x55cd('0xe'));var Redis=require('ioredis');var authService=require(_0x55cd('0xf'));var qs=require(_0x55cd('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x55cd('0x11'));var logger=require(_0x55cd('0x12'))(_0x55cd('0x13'));var utils=require(_0x55cd('0x14'));var config=require(_0x55cd('0x15'));var licenseUtil=require(_0x55cd('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3dfa31,_0x3e28a9){_0x3e28a9=_0x3e28a9||0xcc;return function(_0x24316d){if(_0x24316d){return _0x3dfa31[_0x55cd('0x17')](_0x3e28a9);}return _0x3dfa31[_0x55cd('0x18')](_0x3e28a9)[_0x55cd('0x19')]();};}function respondWithResult(_0x5439e9,_0x4ed9af){_0x4ed9af=_0x4ed9af||0xc8;return function(_0x3b78e0){if(_0x3b78e0){return _0x5439e9[_0x55cd('0x18')](_0x4ed9af)[_0x55cd('0x1a')](_0x3b78e0);}};}function respondWithFilteredResult(_0x445a14,_0x3d5dea){return function(_0x3793aa){if(_0x3793aa){var _0x38e104=typeof _0x3d5dea[_0x55cd('0x1b')]==='undefined'&&typeof _0x3d5dea[_0x55cd('0x1c')]===_0x55cd('0x1d');var _0xb1a48e=_0x3793aa[_0x55cd('0x1e')];var _0x27963f=_0x38e104?0x0:_0x3d5dea['offset'];var _0x3960b9=_0x38e104?_0x3793aa['count']:_0x3d5dea[_0x55cd('0x1b')]+_0x3d5dea[_0x55cd('0x1c')];var _0x1c0cb0;if(_0x3960b9>=_0xb1a48e){_0x3960b9=_0xb1a48e;_0x1c0cb0=0xc8;}else{_0x1c0cb0=0xce;}_0x445a14['status'](_0x1c0cb0);return _0x445a14[_0x55cd('0x1f')]('Content-Range',_0x27963f+'-'+_0x3960b9+'/'+_0xb1a48e)[_0x55cd('0x1a')](_0x3793aa);}return null;};}function patchUpdates(_0x2cd970){return function(_0x4e2ffa){try{jsonpatch[_0x55cd('0x20')](_0x4e2ffa,_0x2cd970,!![]);}catch(_0x29f649){return BPromise[_0x55cd('0x21')](_0x29f649);}return _0x4e2ffa[_0x55cd('0x22')]();};}function saveUpdates(_0x19a8b5,_0x228065){return function(_0x4d0a3d){if(_0x4d0a3d){return _0x4d0a3d[_0x55cd('0x23')](_0x19a8b5)['then'](function(_0x46e16e){return _0x46e16e;});}return null;};}function removeEntity(_0x4c2f11,_0x10ad4c){return function(_0x1d63e3){if(_0x1d63e3){return _0x1d63e3[_0x55cd('0x24')]()[_0x55cd('0x25')](function(){var _0x4e5603=_0x1d63e3[_0x55cd('0x26')]({'plain':!![]});var _0x180d30='CannedAnswers';return db['UserProfileResource'][_0x55cd('0x24')]({'where':{'type':_0x180d30,'resourceId':_0x4e5603['id']}})[_0x55cd('0x25')](function(){return _0x1d63e3;});})[_0x55cd('0x25')](function(){_0x4c2f11[_0x55cd('0x18')](0xcc)[_0x55cd('0x19')]();});}};}function handleEntityNotFound(_0x35caf6,_0x5a7076){return function(_0x39ec6e){if(!_0x39ec6e){_0x35caf6[_0x55cd('0x17')](0x194);}return _0x39ec6e;};}function handleError(_0x3f9a87,_0x5cee47){_0x5cee47=_0x5cee47||0x1f4;return function(_0x194cd3){logger[_0x55cd('0x27')](_0x194cd3[_0x55cd('0x28')]);if(_0x194cd3[_0x55cd('0x29')]){delete _0x194cd3[_0x55cd('0x29')];}_0x3f9a87['status'](_0x5cee47)['send'](_0x194cd3);};}exports[_0x55cd('0x2a')]=function(_0x152f7d,_0x5d4577){var _0x3ea82d={},_0x356f4c={},_0x55478a={'count':0x0,'rows':[]};var _0x16dd0b=_[_0x55cd('0x2b')](db[_0x55cd('0x2c')][_0x55cd('0x2d')],function(_0x48bb98){return{'name':_0x48bb98[_0x55cd('0x2e')],'type':_0x48bb98[_0x55cd('0x2f')]['key']};});_0x356f4c[_0x55cd('0x30')]=_[_0x55cd('0x2b')](_0x16dd0b,_0x55cd('0x29'));_0x356f4c[_0x55cd('0x31')]=_['keys'](_0x152f7d[_0x55cd('0x31')]);_0x356f4c[_0x55cd('0x32')]=_[_0x55cd('0x33')](_0x356f4c[_0x55cd('0x30')],_0x356f4c[_0x55cd('0x31')]);_0x3ea82d[_0x55cd('0x34')]=_['intersection'](_0x356f4c[_0x55cd('0x30')],qs[_0x55cd('0x35')](_0x152f7d['query']['fields']));_0x3ea82d['attributes']=_0x3ea82d['attributes']['length']?_0x3ea82d['attributes']:_0x356f4c[_0x55cd('0x30')];if(!_0x152f7d[_0x55cd('0x31')][_0x55cd('0x36')](_0x55cd('0x37'))){_0x3ea82d[_0x55cd('0x1c')]=qs[_0x55cd('0x1c')](_0x152f7d['query'][_0x55cd('0x1c')]);_0x3ea82d[_0x55cd('0x1b')]=qs[_0x55cd('0x1b')](_0x152f7d['query'][_0x55cd('0x1b')]);}_0x3ea82d[_0x55cd('0x38')]=qs['sort'](_0x152f7d[_0x55cd('0x31')][_0x55cd('0x39')]);_0x3ea82d['where']=qs[_0x55cd('0x32')](_[_0x55cd('0x3a')](_0x152f7d[_0x55cd('0x31')],_0x356f4c[_0x55cd('0x32')]),_0x16dd0b);if(_0x152f7d[_0x55cd('0x31')][_0x55cd('0x3b')]){_0x3ea82d[_0x55cd('0x3c')]=_[_0x55cd('0x3d')](_0x3ea82d[_0x55cd('0x3c')],{'$or':[{'key':{'$like':'%'+_0x152f7d[_0x55cd('0x31')]['filter']+'%'}},{'value':{'$like':'%'+_0x152f7d[_0x55cd('0x31')][_0x55cd('0x3b')]+'%'}}]});}_0x3ea82d=_['merge']({},_0x3ea82d,_0x152f7d[_0x55cd('0x3e')]);var _0x367e2b={'where':_0x3ea82d['where']};return db['CannedAnswer']['count'](_0x367e2b)['then'](function(_0x2db851){_0x55478a[_0x55cd('0x1e')]=_0x2db851;if(_0x152f7d[_0x55cd('0x31')]['includeAll']){_0x3ea82d[_0x55cd('0x3f')]=[{'all':!![]}];}return db['CannedAnswer'][_0x55cd('0x40')](_0x3ea82d);})[_0x55cd('0x25')](function(_0x2ae856){_0x55478a[_0x55cd('0x41')]=_0x2ae856;return _0x55478a;})['then'](respondWithFilteredResult(_0x5d4577,_0x3ea82d))[_0x55cd('0x42')](handleError(_0x5d4577,null));};exports[_0x55cd('0x43')]=function(_0x12d8c9,_0x5a5f49){var _0x594adb={'raw':!![],'where':{'id':_0x12d8c9['params']['id']}},_0xe868f0={};_0xe868f0[_0x55cd('0x30')]=_['keys'](db[_0x55cd('0x2c')]['rawAttributes']);_0xe868f0['query']=_[_0x55cd('0x44')](_0x12d8c9[_0x55cd('0x31')]);_0xe868f0['filters']=_[_0x55cd('0x33')](_0xe868f0[_0x55cd('0x30')],_0xe868f0[_0x55cd('0x31')]);_0x594adb[_0x55cd('0x34')]=_['intersection'](_0xe868f0[_0x55cd('0x30')],qs[_0x55cd('0x35')](_0x12d8c9[_0x55cd('0x31')]['fields']));_0x594adb[_0x55cd('0x34')]=_0x594adb[_0x55cd('0x34')][_0x55cd('0x45')]?_0x594adb[_0x55cd('0x34')]:_0xe868f0['model'];if(_0x12d8c9[_0x55cd('0x31')][_0x55cd('0x46')]){_0x594adb['include']=[{'all':!![]}];}_0x594adb=_[_0x55cd('0x3d')]({},_0x594adb,_0x12d8c9[_0x55cd('0x3e')]);return db['CannedAnswer'][_0x55cd('0x47')](_0x594adb)[_0x55cd('0x25')](handleEntityNotFound(_0x5a5f49,null))[_0x55cd('0x25')](respondWithResult(_0x5a5f49,null))['catch'](handleError(_0x5a5f49,null));};exports[_0x55cd('0x23')]=function(_0x4cba67,_0x3477d8){if(_0x4cba67[_0x55cd('0x48')]['id']){delete _0x4cba67[_0x55cd('0x48')]['id'];}return db['CannedAnswer'][_0x55cd('0x47')]({'where':{'id':_0x4cba67[_0x55cd('0x49')]['id']}})['then'](handleEntityNotFound(_0x3477d8,null))[_0x55cd('0x25')](saveUpdates(_0x4cba67[_0x55cd('0x48')],null))[_0x55cd('0x25')](respondWithResult(_0x3477d8,null))[_0x55cd('0x42')](handleError(_0x3477d8,null));};exports[_0x55cd('0x24')]=function(_0x860ca5,_0x8ceabf){return db[_0x55cd('0x2c')][_0x55cd('0x47')]({'where':{'id':_0x860ca5[_0x55cd('0x49')]['id']}})['then'](handleEntityNotFound(_0x8ceabf,null))[_0x55cd('0x25')](removeEntity(_0x8ceabf,null))[_0x55cd('0x42')](handleError(_0x8ceabf,null));};exports['create']=function(_0x541a9f,_0xe9add3){var _0x505bbc={'key':_0x541a9f[_0x55cd('0x48')][_0x55cd('0x4a')]};if(_0x541a9f[_0x55cd('0x48')][_0x55cd('0x4b')]){_0x505bbc[_0x55cd('0x4b')]=_0x541a9f['body'][_0x55cd('0x4b')];}else if(_0x541a9f[_0x55cd('0x48')][_0x55cd('0x4c')]){_0x505bbc[_0x55cd('0x4c')]=_0x541a9f[_0x55cd('0x48')][_0x55cd('0x4c')];}else if(_0x541a9f[_0x55cd('0x48')][_0x55cd('0x4d')]){_0x505bbc['OpenchannelAccountId']=_0x541a9f[_0x55cd('0x48')]['OpenchannelAccountId'];}else if(_0x541a9f[_0x55cd('0x48')][_0x55cd('0x4e')]){_0x505bbc[_0x55cd('0x4e')]=_0x541a9f['body']['ChatWebsiteId'];}return db[_0x55cd('0x2c')][_0x55cd('0x47')]({'where':_0x505bbc})[_0x55cd('0x25')](function(_0x4fd457){if(_0x4fd457){throw new db[(_0x55cd('0x4f'))][(_0x55cd('0x50'))](_0x55cd('0x51'));}return db[_0x55cd('0x2c')][_0x55cd('0x52')](_0x541a9f[_0x55cd('0x48')]);})[_0x55cd('0x25')](function(_0x6a47e3){var _0x59635a=_0x541a9f[_0x55cd('0x53')]['get']({'plain':!![]});if(!_0x59635a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x59635a[_0x55cd('0x54')]===_0x55cd('0x53')){var _0x1816cf=_0x6a47e3[_0x55cd('0x26')]({'plain':!![]});return db[_0x55cd('0x55')][_0x55cd('0x47')]({'where':{'name':_0x55cd('0x56'),'userProfileId':_0x59635a[_0x55cd('0x57')]},'raw':!![]})[_0x55cd('0x25')](function(_0x118309){if(_0x118309&&_0x118309[_0x55cd('0x58')]===0x0){return db[_0x55cd('0x59')][_0x55cd('0x52')]({'name':_0x1816cf[_0x55cd('0x29')],'resourceId':_0x1816cf['id'],'type':_0x118309[_0x55cd('0x29')],'sectionId':_0x118309['id']},{})['then'](function(){return _0x6a47e3;});}else{return _0x6a47e3;}})['catch'](function(_0x226dad){logger[_0x55cd('0x27')](_0x55cd('0x5a'),_0x226dad);throw _0x226dad;});}return _0x6a47e3;})[_0x55cd('0x25')](respondWithResult(_0xe9add3,0xc9))['catch'](handleError(_0xe9add3,null));};
\ No newline at end of file
+var _0x22f3=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','end','error','name','CannedAnswer','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','intersection','fields','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','length','find','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','eml-format','rimraf'];(function(_0x9df3d8,_0x4074e3){var _0x366da1=function(_0x5af940){while(--_0x5af940){_0x9df3d8['push'](_0x9df3d8['shift']());}};_0x366da1(++_0x4074e3);}(_0x22f3,0xae));var _0x322f=function(_0x438c82,_0xd70276){_0x438c82=_0x438c82-0x0;var _0x17073a=_0x22f3[_0x438c82];return _0x17073a;};'use strict';var emlformat=require(_0x322f('0x0'));var rimraf=require(_0x322f('0x1'));var zipdir=require(_0x322f('0x2'));var jsonpatch=require(_0x322f('0x3'));var rp=require(_0x322f('0x4'));var moment=require(_0x322f('0x5'));var BPromise=require(_0x322f('0x6'));var Mustache=require(_0x322f('0x7'));var util=require('util');var path=require(_0x322f('0x8'));var sox=require(_0x322f('0x9'));var csv=require(_0x322f('0xa'));var ejs=require(_0x322f('0xb'));var fs=require('fs');var fs_extra=require(_0x322f('0xc'));var _=require('lodash');var squel=require(_0x322f('0xd'));var crypto=require(_0x322f('0xe'));var jsforce=require(_0x322f('0xf'));var deskjs=require(_0x322f('0x10'));var toCsv=require(_0x322f('0xa'));var querystring=require(_0x322f('0x11'));var Papa=require(_0x322f('0x12'));var Redis=require(_0x322f('0x13'));var authService=require(_0x322f('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x322f('0x15'));var hardwareService=require(_0x322f('0x16'));var logger=require(_0x322f('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x322f('0x18'));var licenseUtil=require(_0x322f('0x19'));var db=require(_0x322f('0x1a'))['db'];function respondWithStatusCode(_0x152be9,_0x39ad87){_0x39ad87=_0x39ad87||0xcc;return function(_0x58bfdf){if(_0x58bfdf){return _0x152be9[_0x322f('0x1b')](_0x39ad87);}return _0x152be9['status'](_0x39ad87)['end']();};}function respondWithResult(_0x497629,_0x2f7320){_0x2f7320=_0x2f7320||0xc8;return function(_0x15685f){if(_0x15685f){return _0x497629[_0x322f('0x1c')](_0x2f7320)[_0x322f('0x1d')](_0x15685f);}};}function respondWithFilteredResult(_0x2683c5,_0x4cda22){return function(_0x1fc16a){if(_0x1fc16a){var _0x452ae6=typeof _0x4cda22['offset']===_0x322f('0x1e')&&typeof _0x4cda22[_0x322f('0x1f')]===_0x322f('0x1e');var _0x1e3852=_0x1fc16a[_0x322f('0x20')];var _0x542583=_0x452ae6?0x0:_0x4cda22['offset'];var _0x171586=_0x452ae6?_0x1fc16a[_0x322f('0x20')]:_0x4cda22[_0x322f('0x21')]+_0x4cda22[_0x322f('0x1f')];var _0x3bcc9c;if(_0x171586>=_0x1e3852){_0x171586=_0x1e3852;_0x3bcc9c=0xc8;}else{_0x3bcc9c=0xce;}_0x2683c5[_0x322f('0x1c')](_0x3bcc9c);return _0x2683c5[_0x322f('0x22')](_0x322f('0x23'),_0x542583+'-'+_0x171586+'/'+_0x1e3852)[_0x322f('0x1d')](_0x1fc16a);}return null;};}function patchUpdates(_0xc9ff8){return function(_0x160c4c){try{jsonpatch[_0x322f('0x24')](_0x160c4c,_0xc9ff8,!![]);}catch(_0x298554){return BPromise[_0x322f('0x25')](_0x298554);}return _0x160c4c[_0x322f('0x26')]();};}function saveUpdates(_0x1c105d,_0x183894){return function(_0x25d529){if(_0x25d529){return _0x25d529[_0x322f('0x27')](_0x1c105d)[_0x322f('0x28')](function(_0x471712){return _0x471712;});}return null;};}function removeEntity(_0xa4cd26,_0x1967d7){return function(_0x3985fd){if(_0x3985fd){return _0x3985fd[_0x322f('0x29')]()[_0x322f('0x28')](function(){var _0x48c0e1=_0x3985fd[_0x322f('0x2a')]({'plain':!![]});var _0x5c7d99=_0x322f('0x2b');return db[_0x322f('0x2c')][_0x322f('0x29')]({'where':{'type':_0x5c7d99,'resourceId':_0x48c0e1['id']}})[_0x322f('0x28')](function(){return _0x3985fd;});})[_0x322f('0x28')](function(){_0xa4cd26[_0x322f('0x1c')](0xcc)[_0x322f('0x2d')]();});}};}function handleEntityNotFound(_0x873312,_0x64f44f){return function(_0x2e9ed3){if(!_0x2e9ed3){_0x873312[_0x322f('0x1b')](0x194);}return _0x2e9ed3;};}function handleError(_0x4ab290,_0x1f777c){_0x1f777c=_0x1f777c||0x1f4;return function(_0x4c5090){logger[_0x322f('0x2e')](_0x4c5090['stack']);if(_0x4c5090[_0x322f('0x2f')]){delete _0x4c5090[_0x322f('0x2f')];}_0x4ab290[_0x322f('0x1c')](_0x1f777c)['send'](_0x4c5090);};}exports['index']=function(_0x292ba0,_0x37b307){var _0x5d4207={},_0x200679={},_0x340fe3={'count':0x0,'rows':[]};var _0x407a4a=_['map'](db[_0x322f('0x30')][_0x322f('0x31')],function(_0xd65f1a){return{'name':_0xd65f1a[_0x322f('0x32')],'type':_0xd65f1a['type'][_0x322f('0x33')]};});_0x200679[_0x322f('0x34')]=_[_0x322f('0x35')](_0x407a4a,_0x322f('0x2f'));_0x200679[_0x322f('0x36')]=_[_0x322f('0x37')](_0x292ba0[_0x322f('0x36')]);_0x200679[_0x322f('0x38')]=_['intersection'](_0x200679[_0x322f('0x34')],_0x200679[_0x322f('0x36')]);_0x5d4207[_0x322f('0x39')]=_[_0x322f('0x3a')](_0x200679[_0x322f('0x34')],qs[_0x322f('0x3b')](_0x292ba0[_0x322f('0x36')][_0x322f('0x3b')]));_0x5d4207['attributes']=_0x5d4207[_0x322f('0x39')]['length']?_0x5d4207[_0x322f('0x39')]:_0x200679['model'];if(!_0x292ba0[_0x322f('0x36')]['hasOwnProperty']('nolimit')){_0x5d4207['limit']=qs['limit'](_0x292ba0[_0x322f('0x36')][_0x322f('0x1f')]);_0x5d4207[_0x322f('0x21')]=qs[_0x322f('0x21')](_0x292ba0[_0x322f('0x36')][_0x322f('0x21')]);}_0x5d4207[_0x322f('0x3c')]=qs[_0x322f('0x3d')](_0x292ba0[_0x322f('0x36')][_0x322f('0x3d')]);_0x5d4207[_0x322f('0x3e')]=qs['filters'](_[_0x322f('0x3f')](_0x292ba0[_0x322f('0x36')],_0x200679['filters']),_0x407a4a);if(_0x292ba0[_0x322f('0x36')][_0x322f('0x40')]){_0x5d4207[_0x322f('0x3e')]=_['merge'](_0x5d4207[_0x322f('0x3e')],{'$or':[{'key':{'$like':'%'+_0x292ba0[_0x322f('0x36')]['filter']+'%'}},{'value':{'$like':'%'+_0x292ba0[_0x322f('0x36')][_0x322f('0x40')]+'%'}}]});}_0x5d4207=_[_0x322f('0x41')]({},_0x5d4207,_0x292ba0[_0x322f('0x42')]);var _0x57a041={'where':_0x5d4207[_0x322f('0x3e')]};return db[_0x322f('0x30')][_0x322f('0x20')](_0x57a041)['then'](function(_0x9ee9b8){_0x340fe3[_0x322f('0x20')]=_0x9ee9b8;if(_0x292ba0[_0x322f('0x36')][_0x322f('0x43')]){_0x5d4207[_0x322f('0x44')]=[{'all':!![]}];}return db[_0x322f('0x30')][_0x322f('0x45')](_0x5d4207);})[_0x322f('0x28')](function(_0x4228bf){_0x340fe3['rows']=_0x4228bf;return _0x340fe3;})[_0x322f('0x28')](respondWithFilteredResult(_0x37b307,_0x5d4207))[_0x322f('0x46')](handleError(_0x37b307,null));};exports[_0x322f('0x47')]=function(_0x2b3556,_0x126d2d){var _0x503f04={'raw':!![],'where':{'id':_0x2b3556[_0x322f('0x48')]['id']}},_0x358bab={};_0x358bab[_0x322f('0x34')]=_[_0x322f('0x37')](db['CannedAnswer'][_0x322f('0x31')]);_0x358bab[_0x322f('0x36')]=_[_0x322f('0x37')](_0x2b3556[_0x322f('0x36')]);_0x358bab['filters']=_[_0x322f('0x3a')](_0x358bab[_0x322f('0x34')],_0x358bab['query']);_0x503f04[_0x322f('0x39')]=_[_0x322f('0x3a')](_0x358bab['model'],qs[_0x322f('0x3b')](_0x2b3556[_0x322f('0x36')]['fields']));_0x503f04[_0x322f('0x39')]=_0x503f04['attributes'][_0x322f('0x49')]?_0x503f04[_0x322f('0x39')]:_0x358bab['model'];if(_0x2b3556[_0x322f('0x36')][_0x322f('0x43')]){_0x503f04[_0x322f('0x44')]=[{'all':!![]}];}_0x503f04=_[_0x322f('0x41')]({},_0x503f04,_0x2b3556[_0x322f('0x42')]);return db[_0x322f('0x30')][_0x322f('0x4a')](_0x503f04)['then'](handleEntityNotFound(_0x126d2d,null))[_0x322f('0x28')](respondWithResult(_0x126d2d,null))['catch'](handleError(_0x126d2d,null));};exports[_0x322f('0x27')]=function(_0x1e4bdc,_0x220b99){if(_0x1e4bdc['body']['id']){delete _0x1e4bdc['body']['id'];}return db[_0x322f('0x30')][_0x322f('0x4a')]({'where':{'id':_0x1e4bdc[_0x322f('0x48')]['id']}})[_0x322f('0x28')](handleEntityNotFound(_0x220b99,null))[_0x322f('0x28')](saveUpdates(_0x1e4bdc[_0x322f('0x4b')],null))['then'](respondWithResult(_0x220b99,null))[_0x322f('0x46')](handleError(_0x220b99,null));};exports[_0x322f('0x29')]=function(_0x29b876,_0x10ae12){return db[_0x322f('0x30')][_0x322f('0x4a')]({'where':{'id':_0x29b876['params']['id']}})['then'](handleEntityNotFound(_0x10ae12,null))[_0x322f('0x28')](removeEntity(_0x10ae12,null))['catch'](handleError(_0x10ae12,null));};exports['create']=function(_0x5bc13e,_0x198fa3){var _0x11b77b={'key':_0x5bc13e[_0x322f('0x4b')][_0x322f('0x33')]};if(_0x5bc13e[_0x322f('0x4b')][_0x322f('0x4c')]){_0x11b77b[_0x322f('0x4c')]=_0x5bc13e[_0x322f('0x4b')]['MailAccountId'];}else if(_0x5bc13e[_0x322f('0x4b')][_0x322f('0x4d')]){_0x11b77b[_0x322f('0x4d')]=_0x5bc13e[_0x322f('0x4b')][_0x322f('0x4d')];}else if(_0x5bc13e[_0x322f('0x4b')][_0x322f('0x4e')]){_0x11b77b[_0x322f('0x4e')]=_0x5bc13e['body']['OpenchannelAccountId'];}else if(_0x5bc13e[_0x322f('0x4b')][_0x322f('0x4f')]){_0x11b77b['ChatWebsiteId']=_0x5bc13e[_0x322f('0x4b')][_0x322f('0x4f')];}return db['CannedAnswer'][_0x322f('0x4a')]({'where':_0x11b77b})['then'](function(_0x3b9e5c){if(_0x3b9e5c){throw new db[(_0x322f('0x50'))][(_0x322f('0x51'))](_0x322f('0x52'));}return db[_0x322f('0x30')][_0x322f('0x53')](_0x5bc13e['body']);})[_0x322f('0x28')](function(_0x34c816){var _0x4798e0=_0x5bc13e[_0x322f('0x54')]['get']({'plain':!![]});if(!_0x4798e0)throw new Error(_0x322f('0x55'));if(_0x4798e0[_0x322f('0x56')]===_0x322f('0x54')){var _0x28695a=_0x34c816['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':'CannedAnswers','userProfileId':_0x4798e0['userProfileId']},'raw':!![]})[_0x322f('0x28')](function(_0x20dd74){if(_0x20dd74&&_0x20dd74[_0x322f('0x57')]===0x0){return db[_0x322f('0x2c')][_0x322f('0x53')]({'name':_0x28695a['name'],'resourceId':_0x28695a['id'],'type':_0x20dd74[_0x322f('0x2f')],'sectionId':_0x20dd74['id']},{})['then'](function(){return _0x34c816;});}else{return _0x34c816;}})['catch'](function(_0x5e2269){logger[_0x322f('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5e2269);throw _0x5e2269;});}return _0x34c816;})[_0x322f('0x28')](respondWithResult(_0x198fa3,0xc9))['catch'](handleError(_0x198fa3,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index ff94f11..a5020c0 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 _0x1391=['bluebird','request-promise','path','./cannedAnswer.attributes','exports','define','CannedAnswer','util','moment'];(function(_0x2e62be,_0x27e972){var _0x4b113c=function(_0x14c1a1){while(--_0x14c1a1){_0x2e62be['push'](_0x2e62be['shift']());}};_0x4b113c(++_0x27e972);}(_0x1391,0xcd));var _0x1139=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x1391[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require('lodash');var util=require(_0x1139('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x1139('0x1'));var BPromise=require(_0x1139('0x2'));var rp=require(_0x1139('0x3'));var fs=require('fs');var path=require(_0x1139('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1139('0x5'));module[_0x1139('0x6')]=function(_0x43ecaf,_0x42ea70){return _0x43ecaf[_0x1139('0x7')](_0x1139('0x8'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xd0a9=['CannedAnswer','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./cannedAnswer.attributes','exports'];(function(_0x5e42a7,_0x3eba35){var _0x36d21b=function(_0x567f0a){while(--_0x567f0a){_0x5e42a7['push'](_0x5e42a7['shift']());}};_0x36d21b(++_0x3eba35);}(_0xd0a9,0x10b));var _0x9d0a=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xd0a9[_0x565ed7];return _0x183ad7;};'use strict';var _=require('lodash');var util=require(_0x9d0a('0x0'));var logger=require(_0x9d0a('0x1'))(_0x9d0a('0x2'));var moment=require(_0x9d0a('0x3'));var BPromise=require(_0x9d0a('0x4'));var rp=require(_0x9d0a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9d0a('0x6'));var attributes=require(_0x9d0a('0x7'));module[_0x9d0a('0x8')]=function(_0x13e08f,_0x5c9aa3){return _0x13e08f['define'](_0x9d0a('0x9'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9d0a('0xa'),'collate':_0x9d0a('0xb')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index de48281..286fc0b 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(_0x567841,_0x43981d){var _0x60a14e=function(_0x14c12b){while(--_0x14c12b){_0x567841['push'](_0x567841['shift']());}};_0x60a14e(++_0x43981d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'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(_0xae0e9b,_0x209495){var _0x5dec3a=function(_0x5df799){while(--_0x5df799){_0xae0e9b['push'](_0xae0e9b['shift']());}};_0x5dec3a(++_0x209495);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'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 da0cfb3..32ab53c 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 _0xbb64=['express','Router','fs-extra','../../components/auth/service','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer','connect-timeout'];(function(_0x191c34,_0x1fa270){var _0x43433b=function(_0x3dd0ab){while(--_0x3dd0ab){_0x191c34['push'](_0x191c34['shift']());}};_0x43433b(++_0x1fa270);}(_0xbb64,0xd6));var _0x4bb6=function(_0x3fe4bb,_0xf98f59){_0x3fe4bb=_0x3fe4bb-0x0;var _0x2e2a65=_0xbb64[_0x3fe4bb];return _0x2e2a65;};'use strict';var multer=require(_0x4bb6('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4bb6('0x1'));var express=require(_0x4bb6('0x2'));var router=express[_0x4bb6('0x3')]();var fs_extra=require(_0x4bb6('0x4'));var auth=require(_0x4bb6('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4bb6('0x6'));router[_0x4bb6('0x7')]('/',auth[_0x4bb6('0x8')](),controller[_0x4bb6('0x9')]);router[_0x4bb6('0x7')](_0x4bb6('0xa'),auth['isAuthenticated'](),controller[_0x4bb6('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4bb6('0xc')]);router[_0x4bb6('0xd')]('/:id',auth[_0x4bb6('0x8')](),controller[_0x4bb6('0xe')]);router[_0x4bb6('0xf')](_0x4bb6('0xa'),auth[_0x4bb6('0x8')](),controller[_0x4bb6('0x10')]);module[_0x4bb6('0x11')]=router;
\ No newline at end of file
+var _0x3e28=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','show','post','create','put','update','delete'];(function(_0x4104f0,_0x489f33){var _0xe518fd=function(_0x6c75dd){while(--_0x6c75dd){_0x4104f0['push'](_0x4104f0['shift']());}};_0xe518fd(++_0x489f33);}(_0x3e28,0x142));var _0x83e2=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0x3e28[_0x1b6186];return _0x186121;};'use strict';var multer=require(_0x83e2('0x0'));var util=require(_0x83e2('0x1'));var path=require(_0x83e2('0x2'));var timeout=require(_0x83e2('0x3'));var express=require('express');var router=express[_0x83e2('0x4')]();var fs_extra=require(_0x83e2('0x5'));var auth=require(_0x83e2('0x6'));var interaction=require(_0x83e2('0x7'));var config=require(_0x83e2('0x8'));var controller=require('./cannedAnswer.controller');router['get']('/',auth[_0x83e2('0x9')](),controller[_0x83e2('0xa')]);router['get'](_0x83e2('0xb'),auth['isAuthenticated'](),controller[_0x83e2('0xc')]);router[_0x83e2('0xd')]('/',auth[_0x83e2('0x9')](),controller[_0x83e2('0xe')]);router[_0x83e2('0xf')](_0x83e2('0xb'),auth['isAuthenticated'](),controller[_0x83e2('0x10')]);router[_0x83e2('0x11')](_0x83e2('0xb'),auth['isAuthenticated'](),controller[_0x83e2('0x12')]);module[_0x83e2('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index a7f267a..5862f37 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 _0xc772=['sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xc772,0x108));var _0x2c77=function(_0x4305f6,_0x433c71){_0x4305f6=_0x4305f6-0x0;var _0x2d4415=_0xc772[_0x4305f6];return _0x2d4415;};'use strict';var Sequelize=require(_0x2c77('0x0'));module[_0x2c77('0x1')]={'calldate':{'type':Sequelize[_0x2c77('0x2')],'allowNull':![],'defaultValue':_0x2c77('0x3')},'clid':{'type':Sequelize[_0x2c77('0x4')]},'src':{'type':Sequelize[_0x2c77('0x4')]},'dst':{'type':Sequelize[_0x2c77('0x4')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x2c77('0x4')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x2c77('0x4')]},'duration':{'type':Sequelize[_0x2c77('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x2c77('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x2c77('0x4')]},'amaflags':{'type':Sequelize[_0x2c77('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x2c77('0x4')]},'userfield':{'type':Sequelize[_0x2c77('0x4')]},'uniqueid':{'type':Sequelize[_0x2c77('0x4')]},'linkedid':{'type':Sequelize[_0x2c77('0x4')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x2c77('0x4')]},'type':{'type':Sequelize[_0x2c77('0x4')]},'tag':{'type':Sequelize[_0x2c77('0x4')]}};
\ No newline at end of file
+var _0xaf09=['exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x2639fe,_0x508cb9){var _0x5148bd=function(_0x430192){while(--_0x430192){_0x2639fe['push'](_0x2639fe['shift']());}};_0x5148bd(++_0x508cb9);}(_0xaf09,0x10d));var _0x9af0=function(_0x4b26b5,_0x4f71fd){_0x4b26b5=_0x4b26b5-0x0;var _0x4dec71=_0xaf09[_0x4b26b5];return _0x4dec71;};'use strict';var Sequelize=require(_0x9af0('0x0'));module[_0x9af0('0x1')]={'calldate':{'type':Sequelize[_0x9af0('0x2')],'allowNull':![],'defaultValue':_0x9af0('0x3')},'clid':{'type':Sequelize[_0x9af0('0x4')]},'src':{'type':Sequelize[_0x9af0('0x4')]},'dst':{'type':Sequelize[_0x9af0('0x4')]},'dcontext':{'type':Sequelize[_0x9af0('0x4')]},'channel':{'type':Sequelize[_0x9af0('0x4')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x9af0('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x9af0('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x9af0('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x9af0('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x9af0('0x4')]},'linkedid':{'type':Sequelize[_0x9af0('0x4')]},'sequence':{'type':Sequelize[_0x9af0('0x4')]},'peeraccount':{'type':Sequelize[_0x9af0('0x4')]},'type':{'type':Sequelize[_0x9af0('0x4')]},'tag':{'type':Sequelize[_0x9af0('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index ff45058..35681ce 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 _0x7579=['VIRTUAL','merge','options','includeAll','include','findAll','catch','show','create','body','find','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','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','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','error','name','index','map','Cdr','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0x5a5a49,_0x21c835){var _0x35cba1=function(_0x4c3c82){while(--_0x4c3c82){_0x5a5a49['push'](_0x5a5a49['shift']());}};_0x35cba1(++_0x21c835);}(_0x7579,0x1e2));var _0x9757=function(_0x3bb314,_0x3a8b46){_0x3bb314=_0x3bb314-0x0;var _0x441f1f=_0x7579[_0x3bb314];return _0x441f1f;};'use strict';var emlformat=require(_0x9757('0x0'));var rimraf=require(_0x9757('0x1'));var zipdir=require(_0x9757('0x2'));var jsonpatch=require(_0x9757('0x3'));var rp=require(_0x9757('0x4'));var moment=require(_0x9757('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9757('0x6'));var util=require(_0x9757('0x7'));var path=require(_0x9757('0x8'));var sox=require(_0x9757('0x9'));var csv=require('to-csv');var ejs=require(_0x9757('0xa'));var fs=require('fs');var fs_extra=require(_0x9757('0xb'));var _=require(_0x9757('0xc'));var squel=require('squel');var crypto=require(_0x9757('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9757('0xe'));var toCsv=require(_0x9757('0xf'));var querystring=require(_0x9757('0x10'));var Papa=require('papaparse');var Redis=require(_0x9757('0x11'));var authService=require(_0x9757('0x12'));var qs=require(_0x9757('0x13'));var as=require(_0x9757('0x14'));var hardwareService=require(_0x9757('0x15'));var logger=require(_0x9757('0x16'))(_0x9757('0x17'));var utils=require(_0x9757('0x18'));var config=require(_0x9757('0x19'));var licenseUtil=require(_0x9757('0x1a'));var db=require(_0x9757('0x1b'))['db'];function respondWithStatusCode(_0x5c19c9,_0x2f2200){_0x2f2200=_0x2f2200||0xcc;return function(_0x1d32ee){if(_0x1d32ee){return _0x5c19c9[_0x9757('0x1c')](_0x2f2200);}return _0x5c19c9['status'](_0x2f2200)[_0x9757('0x1d')]();};}function respondWithResult(_0x39fa5c,_0x413d55){_0x413d55=_0x413d55||0xc8;return function(_0x14f67c){if(_0x14f67c){return _0x39fa5c[_0x9757('0x1e')](_0x413d55)[_0x9757('0x1f')](_0x14f67c);}};}function respondWithFilteredResult(_0x105e56,_0x4b994d){return function(_0x1fd6f6){if(_0x1fd6f6){var _0x55ded7=typeof _0x4b994d[_0x9757('0x20')]===_0x9757('0x21')&&typeof _0x4b994d[_0x9757('0x22')]===_0x9757('0x21');var _0x3f6be9=_0x1fd6f6[_0x9757('0x23')];var _0x57e309=_0x55ded7?0x0:_0x4b994d[_0x9757('0x20')];var _0x2aa360=_0x55ded7?_0x1fd6f6[_0x9757('0x23')]:_0x4b994d[_0x9757('0x20')]+_0x4b994d[_0x9757('0x22')];var _0xd2306b;if(_0x2aa360>=_0x3f6be9){_0x2aa360=_0x3f6be9;_0xd2306b=0xc8;}else{_0xd2306b=0xce;}_0x105e56[_0x9757('0x1e')](_0xd2306b);return _0x105e56['set'](_0x9757('0x24'),_0x57e309+'-'+_0x2aa360+'/'+_0x3f6be9)['json'](_0x1fd6f6);}return null;};}function patchUpdates(_0x517504){return function(_0x37c889){try{jsonpatch[_0x9757('0x25')](_0x37c889,_0x517504,!![]);}catch(_0x1443a9){return BPromise[_0x9757('0x26')](_0x1443a9);}return _0x37c889['save']();};}function saveUpdates(_0x4ef000,_0x53d21c){return function(_0x73dac4){if(_0x73dac4){return _0x73dac4[_0x9757('0x27')](_0x4ef000)[_0x9757('0x28')](function(_0x21435e){return _0x21435e;});}return null;};}function removeEntity(_0x5dc2fa,_0x11f5ac){return function(_0x160108){if(_0x160108){return _0x160108['destroy']()[_0x9757('0x28')](function(){_0x5dc2fa[_0x9757('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b6915,_0x1a7036){return function(_0x172e8c){if(!_0x172e8c){_0x2b6915[_0x9757('0x1c')](0x194);}return _0x172e8c;};}function handleError(_0x115e33,_0x19588f){_0x19588f=_0x19588f||0x1f4;return function(_0x4e6b86){logger[_0x9757('0x29')](_0x4e6b86['stack']);if(_0x4e6b86[_0x9757('0x2a')]){delete _0x4e6b86[_0x9757('0x2a')];}_0x115e33['status'](_0x19588f)['send'](_0x4e6b86);};}exports[_0x9757('0x2b')]=function(_0x21a4bd,_0xc81976){var _0x3aae8b={},_0x4ebdb6={},_0x3dea3c={'count':0x0,'rows':[]};var _0xecf119=_[_0x9757('0x2c')](db[_0x9757('0x2d')][_0x9757('0x2e')],function(_0xa471a9){return{'name':_0xa471a9['fieldName'],'type':_0xa471a9[_0x9757('0x2f')][_0x9757('0x30')]};});_0x4ebdb6[_0x9757('0x31')]=_[_0x9757('0x2c')](_0xecf119,_0x9757('0x2a'));_0x4ebdb6[_0x9757('0x32')]=_[_0x9757('0x33')](_0x21a4bd['query']);_0x4ebdb6[_0x9757('0x34')]=_[_0x9757('0x35')](_0x4ebdb6[_0x9757('0x31')],_0x4ebdb6[_0x9757('0x32')]);_0x3aae8b[_0x9757('0x36')]=_[_0x9757('0x35')](_0x4ebdb6[_0x9757('0x31')],qs[_0x9757('0x37')](_0x21a4bd['query'][_0x9757('0x37')]));_0x3aae8b['attributes']=_0x3aae8b[_0x9757('0x36')][_0x9757('0x38')]?_0x3aae8b['attributes']:_0x4ebdb6[_0x9757('0x31')];if(!_0x21a4bd[_0x9757('0x32')][_0x9757('0x39')](_0x9757('0x3a'))){_0x3aae8b[_0x9757('0x22')]=qs[_0x9757('0x22')](_0x21a4bd[_0x9757('0x32')][_0x9757('0x22')]);_0x3aae8b[_0x9757('0x20')]=qs[_0x9757('0x20')](_0x21a4bd['query'][_0x9757('0x20')]);}_0x3aae8b[_0x9757('0x3b')]=qs[_0x9757('0x3c')](_0x21a4bd['query'][_0x9757('0x3c')]);_0x3aae8b[_0x9757('0x3d')]=qs[_0x9757('0x34')](_[_0x9757('0x3e')](_0x21a4bd[_0x9757('0x32')],_0x4ebdb6[_0x9757('0x34')]),_0xecf119);if(_0x21a4bd[_0x9757('0x32')][_0x9757('0x3f')]){_0x3aae8b[_0x9757('0x3d')]=_['merge'](_0x3aae8b['where'],{'$or':_[_0x9757('0x2c')](_0xecf119,function(_0x2d0a6e){if(_0x2d0a6e[_0x9757('0x2f')]!==_0x9757('0x40')){var _0x4f779b={};_0x4f779b[_0x2d0a6e[_0x9757('0x2a')]]={'$like':'%'+_0x21a4bd['query'][_0x9757('0x3f')]+'%'};return _0x4f779b;}})});}_0x3aae8b=_[_0x9757('0x41')]({},_0x3aae8b,_0x21a4bd[_0x9757('0x42')]);var _0x59f7ca={'where':_0x3aae8b[_0x9757('0x3d')]};return db[_0x9757('0x2d')][_0x9757('0x23')](_0x59f7ca)['then'](function(_0x37b223){_0x3dea3c['count']=_0x37b223;if(_0x21a4bd['query'][_0x9757('0x43')]){_0x3aae8b[_0x9757('0x44')]=[{'all':!![]}];}return db[_0x9757('0x2d')][_0x9757('0x45')](_0x3aae8b);})[_0x9757('0x28')](function(_0x4f30db){_0x3dea3c['rows']=_0x4f30db;return _0x3dea3c;})['then'](respondWithFilteredResult(_0xc81976,_0x3aae8b))[_0x9757('0x46')](handleError(_0xc81976,null));};exports[_0x9757('0x47')]=function(_0x23fd63,_0x596d57){var _0x2e0985={'raw':!![],'where':{'id':_0x23fd63['params']['id']}},_0x1763cd={};_0x1763cd[_0x9757('0x31')]=_[_0x9757('0x33')](db[_0x9757('0x2d')][_0x9757('0x2e')]);_0x1763cd['query']=_[_0x9757('0x33')](_0x23fd63[_0x9757('0x32')]);_0x1763cd[_0x9757('0x34')]=_[_0x9757('0x35')](_0x1763cd[_0x9757('0x31')],_0x1763cd[_0x9757('0x32')]);_0x2e0985[_0x9757('0x36')]=_[_0x9757('0x35')](_0x1763cd[_0x9757('0x31')],qs['fields'](_0x23fd63['query'][_0x9757('0x37')]));_0x2e0985[_0x9757('0x36')]=_0x2e0985[_0x9757('0x36')]['length']?_0x2e0985[_0x9757('0x36')]:_0x1763cd[_0x9757('0x31')];if(_0x23fd63[_0x9757('0x32')]['includeAll']){_0x2e0985[_0x9757('0x44')]=[{'all':!![]}];}_0x2e0985=_[_0x9757('0x41')]({},_0x2e0985,_0x23fd63['options']);return db['Cdr']['find'](_0x2e0985)[_0x9757('0x28')](handleEntityNotFound(_0x596d57,null))[_0x9757('0x28')](respondWithResult(_0x596d57,null))[_0x9757('0x46')](handleError(_0x596d57,null));};exports['create']=function(_0x279295,_0x5aaadf){return db[_0x9757('0x2d')][_0x9757('0x48')](_0x279295['body'],{})[_0x9757('0x28')](respondWithResult(_0x5aaadf,0xc9))[_0x9757('0x46')](handleError(_0x5aaadf,null));};exports[_0x9757('0x27')]=function(_0x4487a4,_0x118d02){if(_0x4487a4['body']['id']){delete _0x4487a4[_0x9757('0x49')]['id'];}return db[_0x9757('0x2d')][_0x9757('0x4a')]({'where':{'id':_0x4487a4[_0x9757('0x4b')]['id']}})[_0x9757('0x28')](handleEntityNotFound(_0x118d02,null))[_0x9757('0x28')](saveUpdates(_0x4487a4[_0x9757('0x49')],null))['then'](respondWithResult(_0x118d02,null))['catch'](handleError(_0x118d02,null));};exports[_0x9757('0x4c')]=function(_0x496a8a,_0x53c910){return db[_0x9757('0x2d')]['find']({'where':{'id':_0x496a8a[_0x9757('0x4b')]['id']}})[_0x9757('0x28')](handleEntityNotFound(_0x53c910,null))['then'](removeEntity(_0x53c910,null))['catch'](handleError(_0x53c910,null));};exports[_0x9757('0x4d')]=function(_0x502321,_0x428b77){return db['Cdr'][_0x9757('0x4d')]()['then'](respondWithResult(_0x428b77,null))[_0x9757('0x46')](handleError(_0x428b77,null));};
\ No newline at end of file
+var _0x79a8=['reject','update','then','destroy','error','name','send','index','map','Cdr','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','hasOwnProperty','sort','where','filters','pick','filter','VIRTUAL','options','includeAll','include','findAll','catch','params','merge','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x79a8,0x1d0));var _0x879a=function(_0x2ebd68,_0x10e9cc){_0x2ebd68=_0x2ebd68-0x0;var _0x2e68d5=_0x79a8[_0x2ebd68];return _0x2e68d5;};'use strict';var emlformat=require(_0x879a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x879a('0x1'));var jsonpatch=require(_0x879a('0x2'));var rp=require(_0x879a('0x3'));var moment=require('moment');var BPromise=require(_0x879a('0x4'));var Mustache=require('mustache');var util=require(_0x879a('0x5'));var path=require(_0x879a('0x6'));var sox=require(_0x879a('0x7'));var csv=require(_0x879a('0x8'));var ejs=require(_0x879a('0x9'));var fs=require('fs');var fs_extra=require(_0x879a('0xa'));var _=require(_0x879a('0xb'));var squel=require(_0x879a('0xc'));var crypto=require('crypto');var jsforce=require(_0x879a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x879a('0x8'));var querystring=require(_0x879a('0xe'));var Papa=require('papaparse');var Redis=require(_0x879a('0xf'));var authService=require(_0x879a('0x10'));var qs=require(_0x879a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x879a('0x12'));var logger=require(_0x879a('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x879a('0x14'));var licenseUtil=require(_0x879a('0x15'));var db=require(_0x879a('0x16'))['db'];function respondWithStatusCode(_0x320115,_0x54a9b6){_0x54a9b6=_0x54a9b6||0xcc;return function(_0x4738b4){if(_0x4738b4){return _0x320115[_0x879a('0x17')](_0x54a9b6);}return _0x320115[_0x879a('0x18')](_0x54a9b6)[_0x879a('0x19')]();};}function respondWithResult(_0x1a20c5,_0x1c2853){_0x1c2853=_0x1c2853||0xc8;return function(_0x461f1e){if(_0x461f1e){return _0x1a20c5[_0x879a('0x18')](_0x1c2853)[_0x879a('0x1a')](_0x461f1e);}};}function respondWithFilteredResult(_0x16b649,_0x5b4dbe){return function(_0x4a1e0e){if(_0x4a1e0e){var _0x3b8680=typeof _0x5b4dbe[_0x879a('0x1b')]==='undefined'&&typeof _0x5b4dbe[_0x879a('0x1c')]===_0x879a('0x1d');var _0x149105=_0x4a1e0e[_0x879a('0x1e')];var _0x32d9f5=_0x3b8680?0x0:_0x5b4dbe[_0x879a('0x1b')];var _0x4160bd=_0x3b8680?_0x4a1e0e[_0x879a('0x1e')]:_0x5b4dbe[_0x879a('0x1b')]+_0x5b4dbe[_0x879a('0x1c')];var _0x14241a;if(_0x4160bd>=_0x149105){_0x4160bd=_0x149105;_0x14241a=0xc8;}else{_0x14241a=0xce;}_0x16b649[_0x879a('0x18')](_0x14241a);return _0x16b649[_0x879a('0x1f')](_0x879a('0x20'),_0x32d9f5+'-'+_0x4160bd+'/'+_0x149105)['json'](_0x4a1e0e);}return null;};}function patchUpdates(_0x830b36){return function(_0x326e6a){try{jsonpatch['apply'](_0x326e6a,_0x830b36,!![]);}catch(_0x25a57d){return BPromise[_0x879a('0x21')](_0x25a57d);}return _0x326e6a['save']();};}function saveUpdates(_0x56e394,_0x4ed0d6){return function(_0x28c401){if(_0x28c401){return _0x28c401[_0x879a('0x22')](_0x56e394)[_0x879a('0x23')](function(_0x38d42c){return _0x38d42c;});}return null;};}function removeEntity(_0x4c3808,_0x5c21e2){return function(_0x3674f9){if(_0x3674f9){return _0x3674f9[_0x879a('0x24')]()[_0x879a('0x23')](function(){_0x4c3808[_0x879a('0x18')](0xcc)[_0x879a('0x19')]();});}};}function handleEntityNotFound(_0x1dd818,_0x7d67ed){return function(_0x14213c){if(!_0x14213c){_0x1dd818[_0x879a('0x17')](0x194);}return _0x14213c;};}function handleError(_0x2ee375,_0x272bf9){_0x272bf9=_0x272bf9||0x1f4;return function(_0x3510cc){logger[_0x879a('0x25')](_0x3510cc['stack']);if(_0x3510cc[_0x879a('0x26')]){delete _0x3510cc[_0x879a('0x26')];}_0x2ee375[_0x879a('0x18')](_0x272bf9)[_0x879a('0x27')](_0x3510cc);};}exports[_0x879a('0x28')]=function(_0x3030e0,_0x3ef6c1){var _0x2d9ed3={},_0x3ca5cd={},_0x1b6c15={'count':0x0,'rows':[]};var _0x2605e9=_[_0x879a('0x29')](db[_0x879a('0x2a')][_0x879a('0x2b')],function(_0x99559){return{'name':_0x99559[_0x879a('0x2c')],'type':_0x99559[_0x879a('0x2d')][_0x879a('0x2e')]};});_0x3ca5cd['model']=_[_0x879a('0x29')](_0x2605e9,'name');_0x3ca5cd[_0x879a('0x2f')]=_[_0x879a('0x30')](_0x3030e0[_0x879a('0x2f')]);_0x3ca5cd['filters']=_[_0x879a('0x31')](_0x3ca5cd['model'],_0x3ca5cd['query']);_0x2d9ed3['attributes']=_['intersection'](_0x3ca5cd[_0x879a('0x32')],qs[_0x879a('0x33')](_0x3030e0['query'][_0x879a('0x33')]));_0x2d9ed3[_0x879a('0x34')]=_0x2d9ed3[_0x879a('0x34')]['length']?_0x2d9ed3[_0x879a('0x34')]:_0x3ca5cd[_0x879a('0x32')];if(!_0x3030e0[_0x879a('0x2f')][_0x879a('0x35')]('nolimit')){_0x2d9ed3[_0x879a('0x1c')]=qs[_0x879a('0x1c')](_0x3030e0[_0x879a('0x2f')][_0x879a('0x1c')]);_0x2d9ed3['offset']=qs[_0x879a('0x1b')](_0x3030e0['query'][_0x879a('0x1b')]);}_0x2d9ed3['order']=qs[_0x879a('0x36')](_0x3030e0[_0x879a('0x2f')]['sort']);_0x2d9ed3[_0x879a('0x37')]=qs[_0x879a('0x38')](_[_0x879a('0x39')](_0x3030e0[_0x879a('0x2f')],_0x3ca5cd['filters']),_0x2605e9);if(_0x3030e0[_0x879a('0x2f')][_0x879a('0x3a')]){_0x2d9ed3[_0x879a('0x37')]=_['merge'](_0x2d9ed3['where'],{'$or':_['map'](_0x2605e9,function(_0x5de17f){if(_0x5de17f['type']!==_0x879a('0x3b')){var _0x142bdc={};_0x142bdc[_0x5de17f[_0x879a('0x26')]]={'$like':'%'+_0x3030e0['query']['filter']+'%'};return _0x142bdc;}})});}_0x2d9ed3=_['merge']({},_0x2d9ed3,_0x3030e0[_0x879a('0x3c')]);var _0x5597f9={'where':_0x2d9ed3[_0x879a('0x37')]};return db[_0x879a('0x2a')][_0x879a('0x1e')](_0x5597f9)['then'](function(_0x4f9681){_0x1b6c15[_0x879a('0x1e')]=_0x4f9681;if(_0x3030e0['query'][_0x879a('0x3d')]){_0x2d9ed3[_0x879a('0x3e')]=[{'all':!![]}];}return db['Cdr'][_0x879a('0x3f')](_0x2d9ed3);})[_0x879a('0x23')](function(_0x2cc43c){_0x1b6c15['rows']=_0x2cc43c;return _0x1b6c15;})[_0x879a('0x23')](respondWithFilteredResult(_0x3ef6c1,_0x2d9ed3))[_0x879a('0x40')](handleError(_0x3ef6c1,null));};exports['show']=function(_0x7d99a0,_0x2456a4){var _0x4dedfe={'raw':!![],'where':{'id':_0x7d99a0[_0x879a('0x41')]['id']}},_0x14f8e7={};_0x14f8e7[_0x879a('0x32')]=_[_0x879a('0x30')](db['Cdr'][_0x879a('0x2b')]);_0x14f8e7['query']=_[_0x879a('0x30')](_0x7d99a0['query']);_0x14f8e7[_0x879a('0x38')]=_['intersection'](_0x14f8e7[_0x879a('0x32')],_0x14f8e7[_0x879a('0x2f')]);_0x4dedfe[_0x879a('0x34')]=_[_0x879a('0x31')](_0x14f8e7[_0x879a('0x32')],qs[_0x879a('0x33')](_0x7d99a0['query'][_0x879a('0x33')]));_0x4dedfe[_0x879a('0x34')]=_0x4dedfe[_0x879a('0x34')]['length']?_0x4dedfe[_0x879a('0x34')]:_0x14f8e7[_0x879a('0x32')];if(_0x7d99a0[_0x879a('0x2f')]['includeAll']){_0x4dedfe[_0x879a('0x3e')]=[{'all':!![]}];}_0x4dedfe=_[_0x879a('0x42')]({},_0x4dedfe,_0x7d99a0[_0x879a('0x3c')]);return db[_0x879a('0x2a')]['find'](_0x4dedfe)['then'](handleEntityNotFound(_0x2456a4,null))[_0x879a('0x23')](respondWithResult(_0x2456a4,null))[_0x879a('0x40')](handleError(_0x2456a4,null));};exports['create']=function(_0x2ff7cd,_0x4420ac){return db['Cdr'][_0x879a('0x43')](_0x2ff7cd[_0x879a('0x44')],{})[_0x879a('0x23')](respondWithResult(_0x4420ac,0xc9))[_0x879a('0x40')](handleError(_0x4420ac,null));};exports['update']=function(_0x3ffbe6,_0x32933f){if(_0x3ffbe6[_0x879a('0x44')]['id']){delete _0x3ffbe6['body']['id'];}return db['Cdr'][_0x879a('0x45')]({'where':{'id':_0x3ffbe6[_0x879a('0x41')]['id']}})['then'](handleEntityNotFound(_0x32933f,null))[_0x879a('0x23')](saveUpdates(_0x3ffbe6[_0x879a('0x44')],null))[_0x879a('0x23')](respondWithResult(_0x32933f,null))['catch'](handleError(_0x32933f,null));};exports[_0x879a('0x24')]=function(_0x677418,_0xc1c234){return db[_0x879a('0x2a')]['find']({'where':{'id':_0x677418[_0x879a('0x41')]['id']}})[_0x879a('0x23')](handleEntityNotFound(_0xc1c234,null))['then'](removeEntity(_0xc1c234,null))[_0x879a('0x40')](handleError(_0xc1c234,null));};exports[_0x879a('0x46')]=function(_0x59ff36,_0x51644c){return db[_0x879a('0x2a')]['describe']()['then'](respondWithResult(_0x51644c,null))[_0x879a('0x40')](handleError(_0x51644c,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 81ef768..9c2d328 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(_0xd6dcf3,_0x26ffa4){var _0x4bfb7d=function(_0x3ad013){while(--_0x3ad013){_0xd6dcf3['push'](_0xd6dcf3['shift']());}};_0x4bfb7d(++_0x26ffa4);}(_0x7a54,0x106));var _0x47a5=function(_0xee2a7,_0x38b248){_0xee2a7=_0xee2a7-0x0;var _0x93c838=_0x7a54[_0xee2a7];return _0x93c838;};'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(_0x801484,_0x184262){var _0x2ecd18=function(_0x4ee805){while(--_0x4ee805){_0x801484['push'](_0x801484['shift']());}};_0x2ecd18(++_0x184262);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 9b4bb2f..ca2345c 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 _0x019f=['util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','request','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','error','message'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x019f,0xfc));var _0xf019=function(_0x1f3aec,_0x24c18e){_0x1f3aec=_0x1f3aec-0x0;var _0x409f0d=_0x019f[_0x1f3aec];return _0x409f0d;};'use strict';var _=require('lodash');var util=require(_0xf019('0x0'));var moment=require('moment');var BPromise=require(_0xf019('0x1'));var rs=require(_0xf019('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf019('0x3'));var logger=require(_0xf019('0x4'))(_0xf019('0x5'));var config=require('../../config/environment');var jayson=require(_0xf019('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xdaeeb4,_0xafdd66,_0x14b502){return new BPromise(function(_0x5a360d,_0x1ac0bb){return client[_0xf019('0x7')](_0xdaeeb4,_0x14b502)['then'](function(_0x3514ba){logger[_0xf019('0x8')](_0xf019('0x9'),_0xafdd66,_0xf019('0xa'));logger[_0xf019('0xb')]('Cdr,\x20%s,\x20%s,\x20%s',_0xafdd66,_0xf019('0xa'),JSON['stringify'](_0x3514ba));if(_0x3514ba[_0xf019('0xc')]){if(_0x3514ba[_0xf019('0xc')]['code']===0x1f4){logger[_0xf019('0xc')](_0xf019('0x9'),_0xafdd66,_0x3514ba[_0xf019('0xc')][_0xf019('0xd')]);return _0x1ac0bb(_0x3514ba[_0xf019('0xc')][_0xf019('0xd')]);}logger[_0xf019('0xc')](_0xf019('0x9'),_0xafdd66,_0x3514ba['error'][_0xf019('0xd')]);return _0x5a360d(_0x3514ba[_0xf019('0xc')][_0xf019('0xd')]);}else{logger['info']('Cdr,\x20%s,\x20%s',_0xafdd66,_0xf019('0xa'));_0x5a360d(_0x3514ba['result'][_0xf019('0xd')]);}})['catch'](function(_0x2aacc9){logger['error']('Cdr,\x20%s,\x20%s',_0xafdd66,_0x2aacc9);_0x1ac0bb(_0x2aacc9);});});}
\ No newline at end of file
+var _0x459f=['error','code','message','Cdr,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x459f,0x1e8));var _0xf459=function(_0x5f0746,_0x88ab3d){_0x5f0746=_0x5f0746-0x0;var _0x573949=_0x459f[_0x5f0746];return _0x573949;};'use strict';var _=require(_0xf459('0x0'));var util=require(_0xf459('0x1'));var moment=require(_0xf459('0x2'));var BPromise=require(_0xf459('0x3'));var rs=require(_0xf459('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf459('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xf459('0x6'));var jayson=require(_0xf459('0x7'));var client=jayson[_0xf459('0x8')][_0xf459('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x363157,_0x3cd829,_0x3a989e){return new BPromise(function(_0x5ba229,_0x28a153){return client[_0xf459('0xa')](_0x363157,_0x3a989e)[_0xf459('0xb')](function(_0x599c50){logger[_0xf459('0xc')]('Cdr,\x20%s,\x20%s',_0x3cd829,_0xf459('0xd'));logger[_0xf459('0xe')](_0xf459('0xf'),_0x3cd829,'request\x20sent',JSON['stringify'](_0x599c50));if(_0x599c50[_0xf459('0x10')]){if(_0x599c50[_0xf459('0x10')][_0xf459('0x11')]===0x1f4){logger[_0xf459('0x10')]('Cdr,\x20%s,\x20%s',_0x3cd829,_0x599c50[_0xf459('0x10')]['message']);return _0x28a153(_0x599c50[_0xf459('0x10')][_0xf459('0x12')]);}logger[_0xf459('0x10')](_0xf459('0x13'),_0x3cd829,_0x599c50[_0xf459('0x10')]['message']);return _0x5ba229(_0x599c50['error'][_0xf459('0x12')]);}else{logger['info'](_0xf459('0x13'),_0x3cd829,_0xf459('0xd'));_0x5ba229(_0x599c50[_0xf459('0x14')][_0xf459('0x12')]);}})['catch'](function(_0x2288ec){logger[_0xf459('0x10')](_0xf459('0x13'),_0x3cd829,_0x2288ec);_0x28a153(_0x2288ec);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 9812bbc..8fefaea 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(_0x3bd93d,_0x49393d){var _0x4c8680=function(_0x2f4fa6){while(--_0x2f4fa6){_0x3bd93d['push'](_0x3bd93d['shift']());}};_0x4c8680(++_0x49393d);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x19f727,_0x28224e){var _0x412836=function(_0x40634f){while(--_0x40634f){_0x19f727['push'](_0x19f727['shift']());}};_0x412836(++_0x28224e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 47d6b37..68ff948 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 _0x0be2=['exports','STRING','noop','*,*,*,*'];(function(_0x35d4fa,_0x5ece58){var _0xece0ba=function(_0x59278c){while(--_0x59278c){_0x35d4fa['push'](_0x35d4fa['shift']());}};_0xece0ba(++_0x5ece58);}(_0x0be2,0x198));var _0x20be=function(_0x3c4dad,_0x25ffd5){_0x3c4dad=_0x3c4dad-0x0;var _0x1a4f49=_0x0be2[_0x3c4dad];return _0x1a4f49;};'use strict';var Sequelize=require('sequelize');module[_0x20be('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x20be('0x1')],'allowNull':![],'defaultValue':_0x20be('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x20be('0x1')]},'interval':{'type':Sequelize[_0x20be('0x1')],'defaultValue':_0x20be('0x3')}};
\ No newline at end of file
+var _0x278a=['INTEGER','STRING','noop','*,*,*,*','exports'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0x278a,0x90));var _0xa278=function(_0x37c900,_0x363707){_0x37c900=_0x37c900-0x0;var _0x85741f=_0x278a[_0x37c900];return _0x85741f;};'use strict';var Sequelize=require('sequelize');module[_0xa278('0x0')]={'priority':{'type':Sequelize[_0xa278('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xa278('0x2')],'allowNull':![],'defaultValue':_0xa278('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xa278('0x4')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 3133e8c..9c6e455 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 _0x3c2c=['params','model','ChatApplication','rawAttributes','query','keys','filters','intersection','fields','length','includeAll','options','find','then','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','end','sendStatus','stack','name','send','show'];(function(_0x3f3026,_0x35d62a){var _0x4e87bf=function(_0x174109){while(--_0x174109){_0x3f3026['push'](_0x3f3026['shift']());}};_0x4e87bf(++_0x35d62a);}(_0x3c2c,0x160));var _0xc3c2=function(_0x554590,_0x4cede1){_0x554590=_0x554590-0x0;var _0x461631=_0x3c2c[_0x554590];return _0x461631;};'use strict';var emlformat=require(_0xc3c2('0x0'));var rimraf=require(_0xc3c2('0x1'));var zipdir=require(_0xc3c2('0x2'));var jsonpatch=require(_0xc3c2('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc3c2('0x4'));var Mustache=require(_0xc3c2('0x5'));var util=require(_0xc3c2('0x6'));var path=require(_0xc3c2('0x7'));var sox=require('sox');var csv=require(_0xc3c2('0x8'));var ejs=require(_0xc3c2('0x9'));var fs=require('fs');var fs_extra=require(_0xc3c2('0xa'));var _=require(_0xc3c2('0xb'));var squel=require(_0xc3c2('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc3c2('0x8'));var querystring=require(_0xc3c2('0xd'));var Papa=require('papaparse');var Redis=require(_0xc3c2('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc3c2('0xf'));var hardwareService=require(_0xc3c2('0x10'));var logger=require(_0xc3c2('0x11'))('api');var utils=require(_0xc3c2('0x12'));var config=require(_0xc3c2('0x13'));var licenseUtil=require(_0xc3c2('0x14'));var db=require(_0xc3c2('0x15'))['db'];function respondWithStatusCode(_0x578ac4,_0x3920e7){_0x3920e7=_0x3920e7||0xcc;return function(_0x1befad){if(_0x1befad){return _0x578ac4['sendStatus'](_0x3920e7);}return _0x578ac4[_0xc3c2('0x16')](_0x3920e7)['end']();};}function respondWithResult(_0x25b091,_0x4d7d11){_0x4d7d11=_0x4d7d11||0xc8;return function(_0x154071){if(_0x154071){return _0x25b091['status'](_0x4d7d11)[_0xc3c2('0x17')](_0x154071);}};}function respondWithFilteredResult(_0xf5d9a,_0x56bc61){return function(_0x1c2987){if(_0x1c2987){var _0x36f10f=typeof _0x56bc61[_0xc3c2('0x18')]===_0xc3c2('0x19')&&typeof _0x56bc61[_0xc3c2('0x1a')]===_0xc3c2('0x19');var _0x57b7b3=_0x1c2987['count'];var _0x4c0f2d=_0x36f10f?0x0:_0x56bc61[_0xc3c2('0x18')];var _0x3e26e1=_0x36f10f?_0x1c2987[_0xc3c2('0x1b')]:_0x56bc61[_0xc3c2('0x18')]+_0x56bc61[_0xc3c2('0x1a')];var _0x5c9d2c;if(_0x3e26e1>=_0x57b7b3){_0x3e26e1=_0x57b7b3;_0x5c9d2c=0xc8;}else{_0x5c9d2c=0xce;}_0xf5d9a['status'](_0x5c9d2c);return _0xf5d9a[_0xc3c2('0x1c')](_0xc3c2('0x1d'),_0x4c0f2d+'-'+_0x3e26e1+'/'+_0x57b7b3)[_0xc3c2('0x17')](_0x1c2987);}return null;};}function patchUpdates(_0x5e925e){return function(_0x42feba){try{jsonpatch['apply'](_0x42feba,_0x5e925e,!![]);}catch(_0x2e9c78){return BPromise[_0xc3c2('0x1e')](_0x2e9c78);}return _0x42feba[_0xc3c2('0x1f')]();};}function saveUpdates(_0x57458a,_0x2ca609){return function(_0x340c75){if(_0x340c75){return _0x340c75[_0xc3c2('0x20')](_0x57458a)['then'](function(_0x3db978){return _0x3db978;});}return null;};}function removeEntity(_0x3287a3,_0x6ad7af){return function(_0x5d7789){if(_0x5d7789){return _0x5d7789[_0xc3c2('0x21')]()['then'](function(){_0x3287a3[_0xc3c2('0x16')](0xcc)[_0xc3c2('0x22')]();});}};}function handleEntityNotFound(_0x26aacc,_0x38d0b9){return function(_0x15f5f9){if(!_0x15f5f9){_0x26aacc[_0xc3c2('0x23')](0x194);}return _0x15f5f9;};}function handleError(_0x978056,_0x4b6504){_0x4b6504=_0x4b6504||0x1f4;return function(_0x48fa15){logger['error'](_0x48fa15[_0xc3c2('0x24')]);if(_0x48fa15[_0xc3c2('0x25')]){delete _0x48fa15[_0xc3c2('0x25')];}_0x978056['status'](_0x4b6504)[_0xc3c2('0x26')](_0x48fa15);};}exports[_0xc3c2('0x27')]=function(_0x2dc9ec,_0x2bc3b7){var _0x7686ac={'raw':!![],'where':{'id':_0x2dc9ec[_0xc3c2('0x28')]['id']}},_0x166f8e={};_0x166f8e[_0xc3c2('0x29')]=_['keys'](db[_0xc3c2('0x2a')][_0xc3c2('0x2b')]);_0x166f8e[_0xc3c2('0x2c')]=_[_0xc3c2('0x2d')](_0x2dc9ec[_0xc3c2('0x2c')]);_0x166f8e[_0xc3c2('0x2e')]=_['intersection'](_0x166f8e['model'],_0x166f8e[_0xc3c2('0x2c')]);_0x7686ac['attributes']=_[_0xc3c2('0x2f')](_0x166f8e[_0xc3c2('0x29')],qs[_0xc3c2('0x30')](_0x2dc9ec['query']['fields']));_0x7686ac['attributes']=_0x7686ac['attributes'][_0xc3c2('0x31')]?_0x7686ac['attributes']:_0x166f8e[_0xc3c2('0x29')];if(_0x2dc9ec['query'][_0xc3c2('0x32')]){_0x7686ac['include']=[{'all':!![]}];}_0x7686ac=_['merge']({},_0x7686ac,_0x2dc9ec[_0xc3c2('0x33')]);return db[_0xc3c2('0x2a')][_0xc3c2('0x34')](_0x7686ac)[_0xc3c2('0x35')](handleEntityNotFound(_0x2bc3b7,null))[_0xc3c2('0x35')](respondWithResult(_0x2bc3b7,null))[_0xc3c2('0x36')](handleError(_0x2bc3b7,null));};exports[_0xc3c2('0x20')]=function(_0x434430,_0x3ee2ee){if(_0x434430['body']['id']){delete _0x434430['body']['id'];}return db[_0xc3c2('0x2a')][_0xc3c2('0x34')]({'where':{'id':_0x434430[_0xc3c2('0x28')]['id']}})[_0xc3c2('0x35')](handleEntityNotFound(_0x3ee2ee,null))[_0xc3c2('0x35')](saveUpdates(_0x434430[_0xc3c2('0x37')],null))['then'](respondWithResult(_0x3ee2ee,null))[_0xc3c2('0x36')](handleError(_0x3ee2ee,null));};exports['destroy']=function(_0x2278fa,_0x227dfb){return db['ChatApplication'][_0xc3c2('0x34')]({'where':{'id':_0x2278fa[_0xc3c2('0x28')]['id']}})['then'](handleEntityNotFound(_0x227dfb,null))[_0xc3c2('0x35')](removeEntity(_0x227dfb,null))[_0xc3c2('0x36')](handleError(_0x227dfb,null));};
\ No newline at end of file
+var _0x3ae9=['util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','stack','name','send','show','params','model','query','filters','attributes','intersection','fields','length','includeAll','include','merge','ChatApplication','catch','body','find','destroy','zip-dir','fast-json-patch','request-promise','bluebird','mustache'];(function(_0x16eadc,_0x3fc953){var _0x5b05c8=function(_0xd8b9cf){while(--_0xd8b9cf){_0x16eadc['push'](_0x16eadc['shift']());}};_0x5b05c8(++_0x3fc953);}(_0x3ae9,0xdb));var _0x93ae=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x3ae9[_0x4d8ed9];return _0x1e2140;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x93ae('0x0'));var jsonpatch=require(_0x93ae('0x1'));var rp=require(_0x93ae('0x2'));var moment=require('moment');var BPromise=require(_0x93ae('0x3'));var Mustache=require(_0x93ae('0x4'));var util=require(_0x93ae('0x5'));var path=require(_0x93ae('0x6'));var sox=require('sox');var csv=require(_0x93ae('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x93ae('0x8'));var _=require(_0x93ae('0x9'));var squel=require(_0x93ae('0xa'));var crypto=require(_0x93ae('0xb'));var jsforce=require(_0x93ae('0xc'));var deskjs=require(_0x93ae('0xd'));var toCsv=require('to-csv');var querystring=require(_0x93ae('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x93ae('0xf'));var as=require(_0x93ae('0x10'));var hardwareService=require(_0x93ae('0x11'));var logger=require(_0x93ae('0x12'))(_0x93ae('0x13'));var utils=require(_0x93ae('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x93ae('0x15'))['db'];function respondWithStatusCode(_0x1a23a3,_0x4a9f52){_0x4a9f52=_0x4a9f52||0xcc;return function(_0x571e5f){if(_0x571e5f){return _0x1a23a3[_0x93ae('0x16')](_0x4a9f52);}return _0x1a23a3['status'](_0x4a9f52)[_0x93ae('0x17')]();};}function respondWithResult(_0xbaf0e,_0x5b4ea1){_0x5b4ea1=_0x5b4ea1||0xc8;return function(_0x392a55){if(_0x392a55){return _0xbaf0e[_0x93ae('0x18')](_0x5b4ea1)[_0x93ae('0x19')](_0x392a55);}};}function respondWithFilteredResult(_0x1f8aa2,_0x121937){return function(_0x2d1df5){if(_0x2d1df5){var _0x5ed82a=typeof _0x121937[_0x93ae('0x1a')]===_0x93ae('0x1b')&&typeof _0x121937[_0x93ae('0x1c')]==='undefined';var _0x1a1718=_0x2d1df5['count'];var _0x54cfd0=_0x5ed82a?0x0:_0x121937[_0x93ae('0x1a')];var _0x51c77d=_0x5ed82a?_0x2d1df5[_0x93ae('0x1d')]:_0x121937[_0x93ae('0x1a')]+_0x121937['limit'];var _0x2dd19a;if(_0x51c77d>=_0x1a1718){_0x51c77d=_0x1a1718;_0x2dd19a=0xc8;}else{_0x2dd19a=0xce;}_0x1f8aa2[_0x93ae('0x18')](_0x2dd19a);return _0x1f8aa2[_0x93ae('0x1e')](_0x93ae('0x1f'),_0x54cfd0+'-'+_0x51c77d+'/'+_0x1a1718)['json'](_0x2d1df5);}return null;};}function patchUpdates(_0x128913){return function(_0x2f4187){try{jsonpatch['apply'](_0x2f4187,_0x128913,!![]);}catch(_0x3e0407){return BPromise[_0x93ae('0x20')](_0x3e0407);}return _0x2f4187[_0x93ae('0x21')]();};}function saveUpdates(_0x29922f,_0x26d5ac){return function(_0x468fdf){if(_0x468fdf){return _0x468fdf[_0x93ae('0x22')](_0x29922f)['then'](function(_0x5e7c32){return _0x5e7c32;});}return null;};}function removeEntity(_0xd33af5,_0x283e50){return function(_0x4f9f43){if(_0x4f9f43){return _0x4f9f43['destroy']()[_0x93ae('0x23')](function(){_0xd33af5[_0x93ae('0x18')](0xcc)[_0x93ae('0x17')]();});}};}function handleEntityNotFound(_0x10f6a3,_0x1abea7){return function(_0xe17086){if(!_0xe17086){_0x10f6a3[_0x93ae('0x16')](0x194);}return _0xe17086;};}function handleError(_0x32ddca,_0x542656){_0x542656=_0x542656||0x1f4;return function(_0x564c15){logger['error'](_0x564c15[_0x93ae('0x24')]);if(_0x564c15[_0x93ae('0x25')]){delete _0x564c15[_0x93ae('0x25')];}_0x32ddca[_0x93ae('0x18')](_0x542656)[_0x93ae('0x26')](_0x564c15);};}exports[_0x93ae('0x27')]=function(_0x520d6d,_0x54a37b){var _0x223f42={'raw':!![],'where':{'id':_0x520d6d[_0x93ae('0x28')]['id']}},_0x115ac5={};_0x115ac5[_0x93ae('0x29')]=_['keys'](db['ChatApplication']['rawAttributes']);_0x115ac5[_0x93ae('0x2a')]=_['keys'](_0x520d6d[_0x93ae('0x2a')]);_0x115ac5[_0x93ae('0x2b')]=_['intersection'](_0x115ac5[_0x93ae('0x29')],_0x115ac5[_0x93ae('0x2a')]);_0x223f42[_0x93ae('0x2c')]=_[_0x93ae('0x2d')](_0x115ac5[_0x93ae('0x29')],qs[_0x93ae('0x2e')](_0x520d6d[_0x93ae('0x2a')][_0x93ae('0x2e')]));_0x223f42['attributes']=_0x223f42[_0x93ae('0x2c')][_0x93ae('0x2f')]?_0x223f42[_0x93ae('0x2c')]:_0x115ac5[_0x93ae('0x29')];if(_0x520d6d[_0x93ae('0x2a')][_0x93ae('0x30')]){_0x223f42[_0x93ae('0x31')]=[{'all':!![]}];}_0x223f42=_[_0x93ae('0x32')]({},_0x223f42,_0x520d6d['options']);return db[_0x93ae('0x33')]['find'](_0x223f42)[_0x93ae('0x23')](handleEntityNotFound(_0x54a37b,null))[_0x93ae('0x23')](respondWithResult(_0x54a37b,null))[_0x93ae('0x34')](handleError(_0x54a37b,null));};exports[_0x93ae('0x22')]=function(_0x1778f7,_0x46ade5){if(_0x1778f7['body']['id']){delete _0x1778f7[_0x93ae('0x35')]['id'];}return db[_0x93ae('0x33')][_0x93ae('0x36')]({'where':{'id':_0x1778f7['params']['id']}})[_0x93ae('0x23')](handleEntityNotFound(_0x46ade5,null))[_0x93ae('0x23')](saveUpdates(_0x1778f7[_0x93ae('0x35')],null))['then'](respondWithResult(_0x46ade5,null))['catch'](handleError(_0x46ade5,null));};exports[_0x93ae('0x37')]=function(_0x266126,_0x31e9b0){return db[_0x93ae('0x33')][_0x93ae('0x36')]({'where':{'id':_0x266126[_0x93ae('0x28')]['id']}})[_0x93ae('0x23')](handleEntityNotFound(_0x31e9b0,null))[_0x93ae('0x23')](removeEntity(_0x31e9b0,null))[_0x93ae('0x34')](handleError(_0x31e9b0,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 9051f53..d5a7d1a 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 _0x9bee=['exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes'];(function(_0x539932,_0x56f147){var _0x20c961=function(_0x36adb8){while(--_0x36adb8){_0x539932['push'](_0x539932['shift']());}};_0x20c961(++_0x56f147);}(_0x9bee,0xf4));var _0xe9be=function(_0x4988d1,_0x11ce15){_0x4988d1=_0x4988d1-0x0;var _0x6640a7=_0x9bee[_0x4988d1];return _0x6640a7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe9be('0x0'))(_0xe9be('0x1'));var moment=require('moment');var BPromise=require(_0xe9be('0x2'));var rp=require(_0xe9be('0x3'));var fs=require('fs');var path=require(_0xe9be('0x4'));var rimraf=require(_0xe9be('0x5'));var config=require(_0xe9be('0x6'));var attributes=require(_0xe9be('0x7'));module[_0xe9be('0x8')]=function(_0x1d5c7a,_0x5bbaad){return _0x1d5c7a[_0xe9be('0x9')](_0xe9be('0xa'),attributes,{'tableName':_0xe9be('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe9be('0xc'),'collate':_0xe9be('0xd')});};
\ No newline at end of file
+var _0x8743=['bluebird','request-promise','path','rimraf','./chatApplication.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8743,0xa3));var _0x3874=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x8743[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require(_0x3874('0x0'));var util=require(_0x3874('0x1'));var logger=require(_0x3874('0x2'))(_0x3874('0x3'));var moment=require(_0x3874('0x4'));var BPromise=require(_0x3874('0x5'));var rp=require(_0x3874('0x6'));var fs=require('fs');var path=require(_0x3874('0x7'));var rimraf=require(_0x3874('0x8'));var config=require('../../config/environment');var attributes=require(_0x3874('0x9'));module[_0x3874('0xa')]=function(_0x1de2f9,_0x4fd2de){return _0x1de2f9[_0x3874('0xb')]('ChatApplication',attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3874('0xc'),'collate':_0x3874('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index d24e8c1..5640d0b 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 _0xe2b1=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x2fb6fa,_0x447166){var _0x558b8a=function(_0x365641){while(--_0x365641){_0x2fb6fa['push'](_0x2fb6fa['shift']());}};_0x558b8a(++_0x447166);}(_0xe2b1,0x13d));var _0x1e2b=function(_0x587dee,_0x10f017){_0x587dee=_0x587dee-0x0;var _0x17d827=_0xe2b1[_0x587dee];return _0x17d827;};'use strict';var _=require(_0x1e2b('0x0'));var util=require(_0x1e2b('0x1'));var moment=require(_0x1e2b('0x2'));var BPromise=require(_0x1e2b('0x3'));var rs=require(_0x1e2b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1e2b('0x5'))['db'];var utils=require(_0x1e2b('0x6'));var logger=require('../../config/logger')(_0x1e2b('0x7'));var config=require(_0x1e2b('0x8'));var jayson=require(_0x1e2b('0x9'));var client=jayson[_0x1e2b('0xa')][_0x1e2b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3e81e7,_0x353334,_0x24a5d5){return new BPromise(function(_0x3c0832,_0x21bb06){return client[_0x1e2b('0xc')](_0x3e81e7,_0x24a5d5)['then'](function(_0x4e86c5){logger[_0x1e2b('0xd')](_0x1e2b('0xe'),_0x353334,_0x1e2b('0xf'));logger[_0x1e2b('0x10')](_0x1e2b('0x11'),_0x353334,_0x1e2b('0xf'),JSON[_0x1e2b('0x12')](_0x4e86c5));if(_0x4e86c5['error']){if(_0x4e86c5[_0x1e2b('0x13')][_0x1e2b('0x14')]===0x1f4){logger[_0x1e2b('0x13')]('ChatApplication,\x20%s,\x20%s',_0x353334,_0x4e86c5[_0x1e2b('0x13')][_0x1e2b('0x15')]);return _0x21bb06(_0x4e86c5[_0x1e2b('0x13')][_0x1e2b('0x15')]);}logger[_0x1e2b('0x13')](_0x1e2b('0xe'),_0x353334,_0x4e86c5['error'][_0x1e2b('0x15')]);return _0x3c0832(_0x4e86c5[_0x1e2b('0x13')][_0x1e2b('0x15')]);}else{logger[_0x1e2b('0xd')]('ChatApplication,\x20%s,\x20%s',_0x353334,_0x1e2b('0xf'));_0x3c0832(_0x4e86c5['result']['message']);}})[_0x1e2b('0x16')](function(_0x5b1a7a){logger[_0x1e2b('0x13')](_0x1e2b('0xe'),_0x353334,_0x5b1a7a);_0x21bb06(_0x5b1a7a);});});}
\ No newline at end of file
+var _0xa0b1=['stringify','error','message','info','catch','lodash','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s'];(function(_0x1f7f32,_0x1e0a55){var _0x47ab3a=function(_0x3d6afc){while(--_0x3d6afc){_0x1f7f32['push'](_0x1f7f32['shift']());}};_0x47ab3a(++_0x1e0a55);}(_0xa0b1,0xa5));var _0x1a0b=function(_0x49923f,_0x671404){_0x49923f=_0x49923f-0x0;var _0x560684=_0xa0b1[_0x49923f];return _0x560684;};'use strict';var _=require(_0x1a0b('0x0'));var util=require('util');var moment=require(_0x1a0b('0x1'));var BPromise=require(_0x1a0b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1a0b('0x3'));var logger=require(_0x1a0b('0x4'))(_0x1a0b('0x5'));var config=require(_0x1a0b('0x6'));var jayson=require(_0x1a0b('0x7'));var client=jayson[_0x1a0b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x311a81,_0x52fe19,_0x34d49e){return new BPromise(function(_0x444f46,_0x40e322){return client[_0x1a0b('0x9')](_0x311a81,_0x34d49e)[_0x1a0b('0xa')](function(_0x33e882){logger['info'](_0x1a0b('0xb'),_0x52fe19,_0x1a0b('0xc'));logger[_0x1a0b('0xd')](_0x1a0b('0xe'),_0x52fe19,'request\x20sent',JSON[_0x1a0b('0xf')](_0x33e882));if(_0x33e882[_0x1a0b('0x10')]){if(_0x33e882[_0x1a0b('0x10')]['code']===0x1f4){logger['error'](_0x1a0b('0xb'),_0x52fe19,_0x33e882[_0x1a0b('0x10')]['message']);return _0x40e322(_0x33e882[_0x1a0b('0x10')][_0x1a0b('0x11')]);}logger[_0x1a0b('0x10')](_0x1a0b('0xb'),_0x52fe19,_0x33e882['error'][_0x1a0b('0x11')]);return _0x444f46(_0x33e882[_0x1a0b('0x10')][_0x1a0b('0x11')]);}else{logger[_0x1a0b('0x12')]('ChatApplication,\x20%s,\x20%s',_0x52fe19,_0x1a0b('0xc'));_0x444f46(_0x33e882['result'][_0x1a0b('0x11')]);}})[_0x1a0b('0x13')](function(_0x24d28a){logger['error'](_0x1a0b('0xb'),_0x52fe19,_0x24d28a);_0x40e322(_0x24d28a);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 1dbe37d..48d9f5e 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 _0x667e=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x56761e,_0x1a5388){var _0x5ca7e8=function(_0x2e0b87){while(--_0x2e0b87){_0x56761e['push'](_0x56761e['shift']());}};_0x5ca7e8(++_0x1a5388);}(_0x667e,0x80));var _0xe667=function(_0x2ea8ed,_0x38bbf3){_0x2ea8ed=_0x2ea8ed-0x0;var _0x1283f8=_0x667e[_0x2ea8ed];return _0x1283f8;};'use strict';var multer=require(_0xe667('0x0'));var util=require(_0xe667('0x1'));var path=require(_0xe667('0x2'));var timeout=require(_0xe667('0x3'));var express=require(_0xe667('0x4'));var router=express[_0xe667('0x5')]();var fs_extra=require(_0xe667('0x6'));var auth=require(_0xe667('0x7'));var interaction=require(_0xe667('0x8'));var config=require(_0xe667('0x9'));var controller=require('./chatApplication.controller');router[_0xe667('0xa')]('/:id',auth[_0xe667('0xb')](),controller[_0xe667('0xc')]);router[_0xe667('0xd')](_0xe667('0xe'),auth[_0xe667('0xb')](),controller[_0xe667('0xf')]);router[_0xe667('0x10')](_0xe667('0xe'),auth['isAuthenticated'](),controller[_0xe667('0x11')]);module[_0xe667('0x12')]=router;
\ No newline at end of file
+var _0x7b1e=['fs-extra','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x579d67,_0x56a6aa){var _0x826234=function(_0x270f06){while(--_0x270f06){_0x579d67['push'](_0x579d67['shift']());}};_0x826234(++_0x56a6aa);}(_0x7b1e,0xe8));var _0xe7b1=function(_0x31a371,_0x50828e){_0x31a371=_0x31a371-0x0;var _0x2a5bd6=_0x7b1e[_0x31a371];return _0x2a5bd6;};'use strict';var multer=require(_0xe7b1('0x0'));var util=require(_0xe7b1('0x1'));var path=require(_0xe7b1('0x2'));var timeout=require(_0xe7b1('0x3'));var express=require(_0xe7b1('0x4'));var router=express[_0xe7b1('0x5')]();var fs_extra=require(_0xe7b1('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xe7b1('0x7'));var config=require(_0xe7b1('0x8'));var controller=require(_0xe7b1('0x9'));router[_0xe7b1('0xa')](_0xe7b1('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xe7b1('0xc')](_0xe7b1('0xb'),auth['isAuthenticated'](),controller[_0xe7b1('0xd')]);router[_0xe7b1('0xe')](_0xe7b1('0xb'),auth['isAuthenticated'](),controller[_0xe7b1('0xf')]);module[_0xe7b1('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index ec8f40f..dc31b56 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 _0x242e=['STRING','sequelize'];(function(_0x26edc2,_0x12a906){var _0x34489e=function(_0x227193){while(--_0x227193){_0x26edc2['push'](_0x26edc2['shift']());}};_0x34489e(++_0x12a906);}(_0x242e,0x12f));var _0xe242=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x242e[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xe242('0x0'));module['exports']={'name':{'type':Sequelize[_0xe242('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xe242('0x1')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0x3adf=['STRING','BOOLEAN','sequelize','exports'];(function(_0xa91eed,_0x4b7c93){var _0x1c77fc=function(_0x67d2f){while(--_0x67d2f){_0xa91eed['push'](_0xa91eed['shift']());}};_0x1c77fc(++_0x4b7c93);}(_0x3adf,0x1a6));var _0xf3ad=function(_0x1193d0,_0x299caa){_0x1193d0=_0x1193d0-0x0;var _0x16d3a3=_0x3adf[_0x1193d0];return _0x16d3a3;};'use strict';var Sequelize=require(_0xf3ad('0x0'));module[_0xf3ad('0x1')]={'name':{'type':Sequelize[_0xf3ad('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xf3ad('0x2')]},'write':{'type':Sequelize[_0xf3ad('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 ee0687d..df4b2c8 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 _0x93bc=['catch','params','rawAttributes','includeAll','include','find','create','body','describe','getUnread','ChatInternalMessage','user','addMembers','ids','getMembers','findOne','User','nolimit','removeMembers','addMessage','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','zip-dir','fast-json-patch','request-promise','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','ChatGroup','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','merge','where','VIRTUAL','filter','options','findAll','rows'];(function(_0x14e35c,_0x42d167){var _0x2f1025=function(_0x86565a){while(--_0x86565a){_0x14e35c['push'](_0x14e35c['shift']());}};_0x2f1025(++_0x42d167);}(_0x93bc,0x195));var _0xc93b=function(_0x26f65f,_0x2d62d9){_0x26f65f=_0x26f65f-0x0;var _0x3ead39=_0x93bc[_0x26f65f];return _0x3ead39;};'use strict';var emlformat=require(_0xc93b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc93b('0x1'));var jsonpatch=require(_0xc93b('0x2'));var rp=require(_0xc93b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc93b('0x4'));var path=require('path');var sox=require(_0xc93b('0x5'));var csv=require(_0xc93b('0x6'));var ejs=require(_0xc93b('0x7'));var fs=require('fs');var fs_extra=require(_0xc93b('0x8'));var _=require(_0xc93b('0x9'));var squel=require('squel');var crypto=require(_0xc93b('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xc93b('0xb'));var toCsv=require(_0xc93b('0x6'));var querystring=require(_0xc93b('0xc'));var Papa=require('papaparse');var Redis=require(_0xc93b('0xd'));var authService=require(_0xc93b('0xe'));var qs=require(_0xc93b('0xf'));var as=require(_0xc93b('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc93b('0x11'))(_0xc93b('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc93b('0x13'));var db=require(_0xc93b('0x14'))['db'];config[_0xc93b('0x15')]=_[_0xc93b('0x16')](config[_0xc93b('0x15')],{'host':_0xc93b('0x17'),'port':0x18eb});var socket=require(_0xc93b('0x18'))(new Redis(config[_0xc93b('0x15')]));require('./chatGroup.socket')[_0xc93b('0x19')](socket);function respondWithStatusCode(_0x5dad0e,_0x592f30){_0x592f30=_0x592f30||0xcc;return function(_0x3103ca){if(_0x3103ca){return _0x5dad0e[_0xc93b('0x1a')](_0x592f30);}return _0x5dad0e[_0xc93b('0x1b')](_0x592f30)[_0xc93b('0x1c')]();};}function respondWithResult(_0x33a86f,_0x3bc932){_0x3bc932=_0x3bc932||0xc8;return function(_0x16d1e1){if(_0x16d1e1){return _0x33a86f[_0xc93b('0x1b')](_0x3bc932)[_0xc93b('0x1d')](_0x16d1e1);}};}function respondWithFilteredResult(_0x9f910a,_0x3acefa){return function(_0x224bb7){if(_0x224bb7){var _0xbbe90b=typeof _0x3acefa['offset']===_0xc93b('0x1e')&&typeof _0x3acefa[_0xc93b('0x1f')]===_0xc93b('0x1e');var _0x4ce58a=_0x224bb7[_0xc93b('0x20')];var _0x5d0eab=_0xbbe90b?0x0:_0x3acefa[_0xc93b('0x21')];var _0x2c2e8d=_0xbbe90b?_0x224bb7[_0xc93b('0x20')]:_0x3acefa['offset']+_0x3acefa['limit'];var _0x523f22;if(_0x2c2e8d>=_0x4ce58a){_0x2c2e8d=_0x4ce58a;_0x523f22=0xc8;}else{_0x523f22=0xce;}_0x9f910a[_0xc93b('0x1b')](_0x523f22);return _0x9f910a[_0xc93b('0x22')](_0xc93b('0x23'),_0x5d0eab+'-'+_0x2c2e8d+'/'+_0x4ce58a)['json'](_0x224bb7);}return null;};}function patchUpdates(_0x49304f){return function(_0x590da6){try{jsonpatch[_0xc93b('0x24')](_0x590da6,_0x49304f,!![]);}catch(_0x377aa8){return BPromise[_0xc93b('0x25')](_0x377aa8);}return _0x590da6[_0xc93b('0x26')]();};}function saveUpdates(_0xc2a89b,_0xaf12a){return function(_0x3a63e8){if(_0x3a63e8){return _0x3a63e8[_0xc93b('0x27')](_0xc2a89b)[_0xc93b('0x28')](function(_0x2ffaa1){return _0x2ffaa1;});}return null;};}function removeEntity(_0x1a8535,_0x32a612){return function(_0x5b247d){if(_0x5b247d){return _0x5b247d[_0xc93b('0x29')]()[_0xc93b('0x28')](function(){_0x1a8535[_0xc93b('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x340945,_0x304b98){return function(_0x40a087){if(!_0x40a087){_0x340945[_0xc93b('0x1a')](0x194);}return _0x40a087;};}function handleError(_0x6a520,_0x55a65b){_0x55a65b=_0x55a65b||0x1f4;return function(_0x46860b){logger[_0xc93b('0x2a')](_0x46860b[_0xc93b('0x2b')]);if(_0x46860b[_0xc93b('0x2c')]){delete _0x46860b[_0xc93b('0x2c')];}_0x6a520[_0xc93b('0x1b')](_0x55a65b)[_0xc93b('0x2d')](_0x46860b);};}exports['index']=function(_0x312a43,_0x2fdce4){var _0x8b7287={},_0x57ee7d={},_0x24c6d0={'count':0x0,'rows':[]};var _0x2958b5=_['map'](db[_0xc93b('0x2e')]['rawAttributes'],function(_0x307479){return{'name':_0x307479[_0xc93b('0x2f')],'type':_0x307479[_0xc93b('0x30')][_0xc93b('0x31')]};});_0x57ee7d[_0xc93b('0x32')]=_[_0xc93b('0x33')](_0x2958b5,_0xc93b('0x2c'));_0x57ee7d[_0xc93b('0x34')]=_[_0xc93b('0x35')](_0x312a43['query']);_0x57ee7d[_0xc93b('0x36')]=_[_0xc93b('0x37')](_0x57ee7d[_0xc93b('0x32')],_0x57ee7d['query']);_0x8b7287['attributes']=_[_0xc93b('0x37')](_0x57ee7d['model'],qs[_0xc93b('0x38')](_0x312a43[_0xc93b('0x34')][_0xc93b('0x38')]));_0x8b7287[_0xc93b('0x39')]=_0x8b7287[_0xc93b('0x39')][_0xc93b('0x3a')]?_0x8b7287[_0xc93b('0x39')]:_0x57ee7d[_0xc93b('0x32')];if(!_0x312a43['query'][_0xc93b('0x3b')]('nolimit')){_0x8b7287[_0xc93b('0x1f')]=qs[_0xc93b('0x1f')](_0x312a43['query'][_0xc93b('0x1f')]);_0x8b7287[_0xc93b('0x21')]=qs['offset'](_0x312a43[_0xc93b('0x34')][_0xc93b('0x21')]);}_0x8b7287[_0xc93b('0x3c')]=qs[_0xc93b('0x3d')](_0x312a43[_0xc93b('0x34')]['sort']);_0x8b7287['where']=qs[_0xc93b('0x36')](_[_0xc93b('0x3e')](_0x312a43[_0xc93b('0x34')],_0x57ee7d[_0xc93b('0x36')]),_0x2958b5);if(_0x312a43[_0xc93b('0x34')]['filter']){_0x8b7287['where']=_[_0xc93b('0x3f')](_0x8b7287[_0xc93b('0x40')],{'$or':_[_0xc93b('0x33')](_0x2958b5,function(_0x1a60ff){if(_0x1a60ff[_0xc93b('0x30')]!==_0xc93b('0x41')){var _0x15d011={};_0x15d011[_0x1a60ff[_0xc93b('0x2c')]]={'$like':'%'+_0x312a43[_0xc93b('0x34')][_0xc93b('0x42')]+'%'};return _0x15d011;}})});}_0x8b7287=_[_0xc93b('0x3f')]({},_0x8b7287,_0x312a43[_0xc93b('0x43')]);var _0x224d6f={'where':_0x8b7287[_0xc93b('0x40')]};return db[_0xc93b('0x2e')]['count'](_0x224d6f)[_0xc93b('0x28')](function(_0x260f6e){_0x24c6d0['count']=_0x260f6e;if(_0x312a43[_0xc93b('0x34')]['includeAll']){_0x8b7287['include']=[{'all':!![]}];}return db['ChatGroup'][_0xc93b('0x44')](_0x8b7287);})[_0xc93b('0x28')](function(_0x526479){_0x24c6d0[_0xc93b('0x45')]=_0x526479;return _0x24c6d0;})[_0xc93b('0x28')](respondWithFilteredResult(_0x2fdce4,_0x8b7287))[_0xc93b('0x46')](handleError(_0x2fdce4,null));};exports['show']=function(_0x3c9166,_0x5db3d0){var _0x532407={'raw':!![],'where':{'id':_0x3c9166[_0xc93b('0x47')]['id']}},_0x479ef5={};_0x479ef5[_0xc93b('0x32')]=_[_0xc93b('0x35')](db[_0xc93b('0x2e')][_0xc93b('0x48')]);_0x479ef5[_0xc93b('0x34')]=_[_0xc93b('0x35')](_0x3c9166['query']);_0x479ef5[_0xc93b('0x36')]=_[_0xc93b('0x37')](_0x479ef5[_0xc93b('0x32')],_0x479ef5['query']);_0x532407['attributes']=_[_0xc93b('0x37')](_0x479ef5[_0xc93b('0x32')],qs[_0xc93b('0x38')](_0x3c9166[_0xc93b('0x34')]['fields']));_0x532407[_0xc93b('0x39')]=_0x532407[_0xc93b('0x39')][_0xc93b('0x3a')]?_0x532407[_0xc93b('0x39')]:_0x479ef5[_0xc93b('0x32')];if(_0x3c9166[_0xc93b('0x34')][_0xc93b('0x49')]){_0x532407[_0xc93b('0x4a')]=[{'all':!![]}];}_0x532407=_[_0xc93b('0x3f')]({},_0x532407,_0x3c9166['options']);return db[_0xc93b('0x2e')][_0xc93b('0x4b')](_0x532407)['then'](handleEntityNotFound(_0x5db3d0,null))[_0xc93b('0x28')](respondWithResult(_0x5db3d0,null))['catch'](handleError(_0x5db3d0,null));};exports[_0xc93b('0x4c')]=function(_0xba167d,_0x559cbc){return db[_0xc93b('0x2e')]['create'](_0xba167d[_0xc93b('0x4d')],{})[_0xc93b('0x28')](respondWithResult(_0x559cbc,0xc9))['catch'](handleError(_0x559cbc,null));};exports[_0xc93b('0x27')]=function(_0x58c1e9,_0x5ed489){if(_0x58c1e9[_0xc93b('0x4d')]['id']){delete _0x58c1e9[_0xc93b('0x4d')]['id'];}return db[_0xc93b('0x2e')]['find']({'where':{'id':_0x58c1e9[_0xc93b('0x47')]['id']}})[_0xc93b('0x28')](handleEntityNotFound(_0x5ed489,null))[_0xc93b('0x28')](saveUpdates(_0x58c1e9[_0xc93b('0x4d')],null))[_0xc93b('0x28')](respondWithResult(_0x5ed489,null))[_0xc93b('0x46')](handleError(_0x5ed489,null));};exports[_0xc93b('0x29')]=function(_0x589336,_0x454a92){return db[_0xc93b('0x2e')][_0xc93b('0x4b')]({'where':{'id':_0x589336[_0xc93b('0x47')]['id']}})[_0xc93b('0x28')](handleEntityNotFound(_0x454a92,null))[_0xc93b('0x28')](removeEntity(_0x454a92,null))['catch'](handleError(_0x454a92,null));};exports['describe']=function(_0x5d2a5b,_0x1c5843){return db[_0xc93b('0x2e')][_0xc93b('0x4e')]()[_0xc93b('0x28')](respondWithResult(_0x1c5843,null))[_0xc93b('0x46')](handleError(_0x1c5843,null));};exports[_0xc93b('0x4f')]=function(_0x4b526a,_0x31bb47,_0x22e3a6){return db[_0xc93b('0x50')][_0xc93b('0x20')]({'where':{'ChatGroupId':_0x4b526a[_0xc93b('0x47')]['id'],'ToId':_0x4b526a[_0xc93b('0x51')]['id'],'read':![]}})[_0xc93b('0x28')](function(_0x1a2025){return{'id':_['toInteger'](_0x4b526a[_0xc93b('0x47')]['id']),'count':_0x1a2025};})[_0xc93b('0x28')](respondWithResult(_0x31bb47,null))['catch'](handleError(_0x31bb47,null));};exports['addMembers']=function(_0x1ee89d,_0xd7b057,_0x1b122c){return db[_0xc93b('0x2e')][_0xc93b('0x4b')]({'where':{'id':_0x1ee89d['params']['id']}})[_0xc93b('0x28')](handleEntityNotFound(_0xd7b057,null))[_0xc93b('0x28')](function(_0xdb5fa1){if(_0xdb5fa1){return _0xdb5fa1[_0xc93b('0x52')](_0x1ee89d['body'][_0xc93b('0x53')],_['omit'](_0x1ee89d[_0xc93b('0x4d')],[_0xc93b('0x53'),'id'])||{});}})[_0xc93b('0x28')](respondWithResult(_0xd7b057,null))[_0xc93b('0x46')](handleError(_0xd7b057,null));};exports[_0xc93b('0x54')]=function(_0x37e176,_0x2b73f4,_0x4f4bc2){var _0x41dcb3={};var _0x26bbfd={};var _0x32d34f;var _0x177805;return db[_0xc93b('0x2e')][_0xc93b('0x55')]({'where':{'id':_0x37e176[_0xc93b('0x47')]['id']}})['then'](handleEntityNotFound(_0x2b73f4,null))[_0xc93b('0x28')](function(_0x1a8a74){if(_0x1a8a74){_0x32d34f=_0x1a8a74;_0x26bbfd['model']=_[_0xc93b('0x35')](db[_0xc93b('0x56')]['rawAttributes']);_0x26bbfd[_0xc93b('0x34')]=_[_0xc93b('0x35')](_0x37e176['query']);_0x26bbfd[_0xc93b('0x36')]=_['intersection'](_0x26bbfd[_0xc93b('0x32')],_0x26bbfd['query']);_0x41dcb3['attributes']=_[_0xc93b('0x37')](_0x26bbfd[_0xc93b('0x32')],qs[_0xc93b('0x38')](_0x37e176[_0xc93b('0x34')]['fields']));_0x41dcb3['attributes']=_0x41dcb3[_0xc93b('0x39')][_0xc93b('0x3a')]?_0x41dcb3['attributes']:_0x26bbfd[_0xc93b('0x32')];_0x41dcb3[_0xc93b('0x3c')]=qs['sort'](_0x37e176['query']['sort']);_0x41dcb3['where']=qs['filters'](_[_0xc93b('0x3e')](_0x37e176[_0xc93b('0x34')],_0x26bbfd[_0xc93b('0x36')]));if(_0x37e176['query'][_0xc93b('0x42')]){_0x41dcb3[_0xc93b('0x40')]=_[_0xc93b('0x3f')](_0x41dcb3[_0xc93b('0x40')],{'$or':_[_0xc93b('0x33')](_0x41dcb3[_0xc93b('0x39')],function(_0x4f1f41){var _0x1ccfa4={};_0x1ccfa4[_0x4f1f41]={'$like':'%'+_0x37e176['query']['filter']+'%'};return _0x1ccfa4;})});}_0x41dcb3=_[_0xc93b('0x3f')]({},_0x41dcb3,_0x37e176[_0xc93b('0x43')]);return _0x32d34f['getMembers'](_0x41dcb3);}})['then'](function(_0x22e851){if(_0x22e851){_0x177805=_0x22e851['length'];if(!_0x37e176[_0xc93b('0x34')]['hasOwnProperty'](_0xc93b('0x57'))){_0x41dcb3['limit']=qs[_0xc93b('0x1f')](_0x37e176['query'][_0xc93b('0x1f')]);_0x41dcb3[_0xc93b('0x21')]=qs[_0xc93b('0x21')](_0x37e176[_0xc93b('0x34')][_0xc93b('0x21')]);}return _0x32d34f[_0xc93b('0x54')](_0x41dcb3);}})[_0xc93b('0x28')](function(_0x4cbc34){if(_0x4cbc34){return _0x4cbc34?{'count':_0x177805,'rows':_0x4cbc34}:null;}})[_0xc93b('0x28')](respondWithResult(_0x2b73f4,null))['catch'](handleError(_0x2b73f4,null));};exports[_0xc93b('0x58')]=function(_0x4b0eb5,_0x430c09,_0x57b0ca){return db[_0xc93b('0x2e')][_0xc93b('0x4b')]({'where':{'id':_0x4b0eb5[_0xc93b('0x47')]['id']}})[_0xc93b('0x28')](handleEntityNotFound(_0x430c09,null))[_0xc93b('0x28')](function(_0x3ea0ac){if(_0x3ea0ac){return _0x3ea0ac[_0xc93b('0x58')](_0x4b0eb5[_0xc93b('0x34')][_0xc93b('0x53')]);}})[_0xc93b('0x28')](respondWithStatusCode(_0x430c09,null))[_0xc93b('0x46')](handleError(_0x430c09,null));};exports[_0xc93b('0x59')]=function(_0x231338,_0x346a36,_0x58deb3){if(_0x231338[_0xc93b('0x4d')]['id']){delete _0x231338[_0xc93b('0x4d')]['id'];}return db[_0xc93b('0x2e')][_0xc93b('0x4b')]({'where':{'id':_0x231338[_0xc93b('0x47')]['id']}})[_0xc93b('0x28')](handleEntityNotFound(_0x346a36,null))[_0xc93b('0x28')](function(_0x3bd8a2){if(_0x3bd8a2){_0x231338[_0xc93b('0x4d')]['ChatGroupId']=_0x3bd8a2['id'];return db[_0xc93b('0x50')][_0xc93b('0x4c')](_0x231338[_0xc93b('0x4d')]);}})['then'](respondWithResult(_0x346a36,null))[_0xc93b('0x46')](handleError(_0x346a36,null));};exports[_0xc93b('0x5a')]=function(_0x3418a9,_0x51a2f5,_0x23d38b){var _0x4752de={};var _0x3148c2={};var _0x495cb1;var _0x63caeb;return db[_0xc93b('0x2e')][_0xc93b('0x55')]({'where':{'id':_0x3418a9[_0xc93b('0x47')]['id']}})['then'](handleEntityNotFound(_0x51a2f5,null))[_0xc93b('0x28')](function(_0x14aa01){if(_0x14aa01){_0x495cb1=_0x14aa01;_0x3148c2[_0xc93b('0x32')]=_[_0xc93b('0x35')](db['ChatInternalMessage']['rawAttributes']);_0x3148c2[_0xc93b('0x34')]=_[_0xc93b('0x35')](_0x3418a9['query']);_0x3148c2[_0xc93b('0x36')]=_[_0xc93b('0x37')](_0x3148c2[_0xc93b('0x32')],_0x3148c2['query']);_0x4752de[_0xc93b('0x39')]=_[_0xc93b('0x37')](_0x3148c2[_0xc93b('0x32')],qs[_0xc93b('0x38')](_0x3418a9[_0xc93b('0x34')][_0xc93b('0x38')]));_0x4752de[_0xc93b('0x39')]=_0x4752de[_0xc93b('0x39')][_0xc93b('0x3a')]?_0x4752de[_0xc93b('0x39')]:_0x3148c2['model'];_0x4752de[_0xc93b('0x3c')]=qs[_0xc93b('0x3d')](_0x3418a9['query'][_0xc93b('0x3d')]);_0x4752de['where']=qs['filters'](_[_0xc93b('0x3e')](_0x3418a9['query'],_0x3148c2['filters']));if(_0x3418a9[_0xc93b('0x34')][_0xc93b('0x42')]){_0x4752de[_0xc93b('0x40')]=_[_0xc93b('0x3f')](_0x4752de[_0xc93b('0x40')],{'$or':_[_0xc93b('0x33')](_0x4752de[_0xc93b('0x39')],function(_0x37f0a6){var _0x136374={};_0x136374[_0x37f0a6]={'$like':'%'+_0x3418a9['query']['filter']+'%'};return _0x136374;})});}if(_0x3418a9[_0xc93b('0x34')][_0xc93b('0x5b')]){var _0x371092=_0x3418a9['query'][_0xc93b('0x5b')][_0xc93b('0x5c')](',');var _0x30d752={};_0x30d752[_0x371092[0x0]]={'$gte':moment(_0x371092[0x1])[_0xc93b('0x5d')](_0xc93b('0x5e'))};_0x4752de[_0xc93b('0x40')]=_[_0xc93b('0x3f')](_0x4752de[_0xc93b('0x40')],_0x30d752);}_0x4752de=_['merge']({},_0x4752de,_0x3418a9[_0xc93b('0x43')]);return _0x495cb1[_0xc93b('0x5a')](_0x4752de);}})['then'](function(_0x152b58){if(_0x152b58){_0x63caeb=_0x152b58['length'];if(!_0x3418a9[_0xc93b('0x34')][_0xc93b('0x3b')]('nolimit')){_0x4752de[_0xc93b('0x1f')]=qs[_0xc93b('0x1f')](_0x3418a9['query']['limit']);_0x4752de[_0xc93b('0x21')]=qs['offset'](_0x3418a9[_0xc93b('0x34')][_0xc93b('0x21')]);}return _0x495cb1[_0xc93b('0x5a')](_0x4752de);}})[_0xc93b('0x28')](function(_0x19becd){if(_0x19becd){return _0x19becd?{'count':_0x63caeb,'rows':_0x19becd}:null;}})[_0xc93b('0x28')](respondWithResult(_0x51a2f5,null))[_0xc93b('0x46')](handleError(_0x51a2f5,null));};
\ No newline at end of file
+var _0x5b75=['show','params','fields','includeAll','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','User','nolimit','findOne','$gte','split','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','stack','name','index','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','map','options','ChatGroup','include','findAll','rows','catch'];(function(_0x405ac9,_0x2c795c){var _0x2d200f=function(_0x27ae59){while(--_0x27ae59){_0x405ac9['push'](_0x405ac9['shift']());}};_0x2d200f(++_0x2c795c);}(_0x5b75,0x137));var _0x55b7=function(_0x5211bc,_0x410051){_0x5211bc=_0x5211bc-0x0;var _0x2e5a9f=_0x5b75[_0x5211bc];return _0x2e5a9f;};'use strict';var emlformat=require(_0x55b7('0x0'));var rimraf=require(_0x55b7('0x1'));var zipdir=require(_0x55b7('0x2'));var jsonpatch=require(_0x55b7('0x3'));var rp=require('request-promise');var moment=require(_0x55b7('0x4'));var BPromise=require(_0x55b7('0x5'));var Mustache=require(_0x55b7('0x6'));var util=require('util');var path=require(_0x55b7('0x7'));var sox=require(_0x55b7('0x8'));var csv=require(_0x55b7('0x9'));var ejs=require(_0x55b7('0xa'));var fs=require('fs');var fs_extra=require(_0x55b7('0xb'));var _=require(_0x55b7('0xc'));var squel=require(_0x55b7('0xd'));var crypto=require(_0x55b7('0xe'));var jsforce=require(_0x55b7('0xf'));var deskjs=require(_0x55b7('0x10'));var toCsv=require(_0x55b7('0x9'));var querystring=require('querystring');var Papa=require(_0x55b7('0x11'));var Redis=require(_0x55b7('0x12'));var authService=require(_0x55b7('0x13'));var qs=require(_0x55b7('0x14'));var as=require(_0x55b7('0x15'));var hardwareService=require(_0x55b7('0x16'));var logger=require(_0x55b7('0x17'))(_0x55b7('0x18'));var utils=require(_0x55b7('0x19'));var config=require(_0x55b7('0x1a'));var licenseUtil=require(_0x55b7('0x1b'));var db=require(_0x55b7('0x1c'))['db'];config[_0x55b7('0x1d')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x55b7('0x1e'))(new Redis(config['redis']));require('./chatGroup.socket')['register'](socket);function respondWithStatusCode(_0x3feb9b,_0xa5ab){_0xa5ab=_0xa5ab||0xcc;return function(_0xd47649){if(_0xd47649){return _0x3feb9b[_0x55b7('0x1f')](_0xa5ab);}return _0x3feb9b[_0x55b7('0x20')](_0xa5ab)['end']();};}function respondWithResult(_0x44ca4c,_0x29dad5){_0x29dad5=_0x29dad5||0xc8;return function(_0x5801b1){if(_0x5801b1){return _0x44ca4c[_0x55b7('0x20')](_0x29dad5)[_0x55b7('0x21')](_0x5801b1);}};}function respondWithFilteredResult(_0x5a85d9,_0xdc2a74){return function(_0x9b18ba){if(_0x9b18ba){var _0x2efc38=typeof _0xdc2a74[_0x55b7('0x22')]===_0x55b7('0x23')&&typeof _0xdc2a74[_0x55b7('0x24')]==='undefined';var _0x4d62af=_0x9b18ba[_0x55b7('0x25')];var _0x2ce3dc=_0x2efc38?0x0:_0xdc2a74[_0x55b7('0x22')];var _0x1e3645=_0x2efc38?_0x9b18ba['count']:_0xdc2a74['offset']+_0xdc2a74[_0x55b7('0x24')];var _0x6e295c;if(_0x1e3645>=_0x4d62af){_0x1e3645=_0x4d62af;_0x6e295c=0xc8;}else{_0x6e295c=0xce;}_0x5a85d9[_0x55b7('0x20')](_0x6e295c);return _0x5a85d9[_0x55b7('0x26')](_0x55b7('0x27'),_0x2ce3dc+'-'+_0x1e3645+'/'+_0x4d62af)['json'](_0x9b18ba);}return null;};}function patchUpdates(_0x28dbfb){return function(_0xf497fc){try{jsonpatch[_0x55b7('0x28')](_0xf497fc,_0x28dbfb,!![]);}catch(_0x2332a2){return BPromise[_0x55b7('0x29')](_0x2332a2);}return _0xf497fc['save']();};}function saveUpdates(_0x5b0343,_0x472d3f){return function(_0x5e6c86){if(_0x5e6c86){return _0x5e6c86[_0x55b7('0x2a')](_0x5b0343)[_0x55b7('0x2b')](function(_0x5f0781){return _0x5f0781;});}return null;};}function removeEntity(_0x12a218,_0x1008cf){return function(_0x1b19be){if(_0x1b19be){return _0x1b19be[_0x55b7('0x2c')]()[_0x55b7('0x2b')](function(){_0x12a218[_0x55b7('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46e434,_0x34aee7){return function(_0x22a246){if(!_0x22a246){_0x46e434[_0x55b7('0x1f')](0x194);}return _0x22a246;};}function handleError(_0x3af05e,_0x4b541c){_0x4b541c=_0x4b541c||0x1f4;return function(_0x16f9bb){logger['error'](_0x16f9bb[_0x55b7('0x2d')]);if(_0x16f9bb[_0x55b7('0x2e')]){delete _0x16f9bb['name'];}_0x3af05e['status'](_0x4b541c)['send'](_0x16f9bb);};}exports[_0x55b7('0x2f')]=function(_0x5f326f,_0x31d6dc){var _0x3b1935={},_0x2878a9={},_0x199fcd={'count':0x0,'rows':[]};var _0x35e1fb=_['map'](db['ChatGroup'][_0x55b7('0x30')],function(_0x3645ac){return{'name':_0x3645ac[_0x55b7('0x31')],'type':_0x3645ac[_0x55b7('0x32')][_0x55b7('0x33')]};});_0x2878a9[_0x55b7('0x34')]=_['map'](_0x35e1fb,_0x55b7('0x2e'));_0x2878a9[_0x55b7('0x35')]=_[_0x55b7('0x36')](_0x5f326f[_0x55b7('0x35')]);_0x2878a9[_0x55b7('0x37')]=_[_0x55b7('0x38')](_0x2878a9[_0x55b7('0x34')],_0x2878a9['query']);_0x3b1935[_0x55b7('0x39')]=_[_0x55b7('0x38')](_0x2878a9[_0x55b7('0x34')],qs['fields'](_0x5f326f['query']['fields']));_0x3b1935[_0x55b7('0x39')]=_0x3b1935[_0x55b7('0x39')][_0x55b7('0x3a')]?_0x3b1935[_0x55b7('0x39')]:_0x2878a9[_0x55b7('0x34')];if(!_0x5f326f[_0x55b7('0x35')][_0x55b7('0x3b')]('nolimit')){_0x3b1935[_0x55b7('0x24')]=qs[_0x55b7('0x24')](_0x5f326f['query']['limit']);_0x3b1935['offset']=qs['offset'](_0x5f326f['query'][_0x55b7('0x22')]);}_0x3b1935[_0x55b7('0x3c')]=qs[_0x55b7('0x3d')](_0x5f326f[_0x55b7('0x35')][_0x55b7('0x3d')]);_0x3b1935['where']=qs[_0x55b7('0x37')](_[_0x55b7('0x3e')](_0x5f326f[_0x55b7('0x35')],_0x2878a9[_0x55b7('0x37')]),_0x35e1fb);if(_0x5f326f[_0x55b7('0x35')][_0x55b7('0x3f')]){_0x3b1935[_0x55b7('0x40')]=_[_0x55b7('0x41')](_0x3b1935[_0x55b7('0x40')],{'$or':_[_0x55b7('0x42')](_0x35e1fb,function(_0x613a81){if(_0x613a81['type']!=='VIRTUAL'){var _0x12976b={};_0x12976b[_0x613a81['name']]={'$like':'%'+_0x5f326f[_0x55b7('0x35')][_0x55b7('0x3f')]+'%'};return _0x12976b;}})});}_0x3b1935=_[_0x55b7('0x41')]({},_0x3b1935,_0x5f326f[_0x55b7('0x43')]);var _0x25c857={'where':_0x3b1935[_0x55b7('0x40')]};return db[_0x55b7('0x44')][_0x55b7('0x25')](_0x25c857)[_0x55b7('0x2b')](function(_0x34bf78){_0x199fcd[_0x55b7('0x25')]=_0x34bf78;if(_0x5f326f[_0x55b7('0x35')]['includeAll']){_0x3b1935[_0x55b7('0x45')]=[{'all':!![]}];}return db[_0x55b7('0x44')][_0x55b7('0x46')](_0x3b1935);})[_0x55b7('0x2b')](function(_0x2c4d49){_0x199fcd[_0x55b7('0x47')]=_0x2c4d49;return _0x199fcd;})[_0x55b7('0x2b')](respondWithFilteredResult(_0x31d6dc,_0x3b1935))[_0x55b7('0x48')](handleError(_0x31d6dc,null));};exports[_0x55b7('0x49')]=function(_0x477897,_0x477982){var _0x16f80f={'raw':!![],'where':{'id':_0x477897[_0x55b7('0x4a')]['id']}},_0x52146f={};_0x52146f[_0x55b7('0x34')]=_[_0x55b7('0x36')](db[_0x55b7('0x44')][_0x55b7('0x30')]);_0x52146f[_0x55b7('0x35')]=_[_0x55b7('0x36')](_0x477897[_0x55b7('0x35')]);_0x52146f['filters']=_[_0x55b7('0x38')](_0x52146f[_0x55b7('0x34')],_0x52146f['query']);_0x16f80f[_0x55b7('0x39')]=_[_0x55b7('0x38')](_0x52146f[_0x55b7('0x34')],qs[_0x55b7('0x4b')](_0x477897[_0x55b7('0x35')]['fields']));_0x16f80f[_0x55b7('0x39')]=_0x16f80f[_0x55b7('0x39')][_0x55b7('0x3a')]?_0x16f80f[_0x55b7('0x39')]:_0x52146f[_0x55b7('0x34')];if(_0x477897[_0x55b7('0x35')][_0x55b7('0x4c')]){_0x16f80f['include']=[{'all':!![]}];}_0x16f80f=_[_0x55b7('0x41')]({},_0x16f80f,_0x477897['options']);return db[_0x55b7('0x44')][_0x55b7('0x4d')](_0x16f80f)[_0x55b7('0x2b')](handleEntityNotFound(_0x477982,null))[_0x55b7('0x2b')](respondWithResult(_0x477982,null))[_0x55b7('0x48')](handleError(_0x477982,null));};exports[_0x55b7('0x4e')]=function(_0x9055df,_0x42bfad){return db[_0x55b7('0x44')]['create'](_0x9055df[_0x55b7('0x4f')],{})[_0x55b7('0x2b')](respondWithResult(_0x42bfad,0xc9))['catch'](handleError(_0x42bfad,null));};exports[_0x55b7('0x2a')]=function(_0x5b7d1e,_0x49f01c){if(_0x5b7d1e[_0x55b7('0x4f')]['id']){delete _0x5b7d1e[_0x55b7('0x4f')]['id'];}return db[_0x55b7('0x44')][_0x55b7('0x4d')]({'where':{'id':_0x5b7d1e[_0x55b7('0x4a')]['id']}})[_0x55b7('0x2b')](handleEntityNotFound(_0x49f01c,null))[_0x55b7('0x2b')](saveUpdates(_0x5b7d1e[_0x55b7('0x4f')],null))['then'](respondWithResult(_0x49f01c,null))['catch'](handleError(_0x49f01c,null));};exports[_0x55b7('0x2c')]=function(_0x3923ad,_0x483713){return db[_0x55b7('0x44')][_0x55b7('0x4d')]({'where':{'id':_0x3923ad[_0x55b7('0x4a')]['id']}})[_0x55b7('0x2b')](handleEntityNotFound(_0x483713,null))[_0x55b7('0x2b')](removeEntity(_0x483713,null))[_0x55b7('0x48')](handleError(_0x483713,null));};exports['describe']=function(_0x143d56,_0x156b7f){return db[_0x55b7('0x44')][_0x55b7('0x50')]()['then'](respondWithResult(_0x156b7f,null))[_0x55b7('0x48')](handleError(_0x156b7f,null));};exports[_0x55b7('0x51')]=function(_0x285a01,_0x44ede3,_0x5ea535){return db[_0x55b7('0x52')][_0x55b7('0x25')]({'where':{'ChatGroupId':_0x285a01['params']['id'],'ToId':_0x285a01[_0x55b7('0x53')]['id'],'read':![]}})[_0x55b7('0x2b')](function(_0x4017ff){return{'id':_[_0x55b7('0x54')](_0x285a01[_0x55b7('0x4a')]['id']),'count':_0x4017ff};})['then'](respondWithResult(_0x44ede3,null))[_0x55b7('0x48')](handleError(_0x44ede3,null));};exports[_0x55b7('0x55')]=function(_0x59290b,_0x996d84,_0x1cf788){return db['ChatGroup']['find']({'where':{'id':_0x59290b[_0x55b7('0x4a')]['id']}})[_0x55b7('0x2b')](handleEntityNotFound(_0x996d84,null))[_0x55b7('0x2b')](function(_0x245df7){if(_0x245df7){return _0x245df7[_0x55b7('0x55')](_0x59290b[_0x55b7('0x4f')][_0x55b7('0x56')],_[_0x55b7('0x57')](_0x59290b['body'],[_0x55b7('0x56'),'id'])||{});}})[_0x55b7('0x2b')](respondWithResult(_0x996d84,null))[_0x55b7('0x48')](handleError(_0x996d84,null));};exports[_0x55b7('0x58')]=function(_0x1a3ead,_0x4d864e,_0x467f7e){var _0x4ff6f8={};var _0x51c814={};var _0x572af2;var _0x4b3b46;return db[_0x55b7('0x44')]['findOne']({'where':{'id':_0x1a3ead['params']['id']}})['then'](handleEntityNotFound(_0x4d864e,null))[_0x55b7('0x2b')](function(_0x4689e2){if(_0x4689e2){_0x572af2=_0x4689e2;_0x51c814['model']=_[_0x55b7('0x36')](db[_0x55b7('0x59')]['rawAttributes']);_0x51c814['query']=_[_0x55b7('0x36')](_0x1a3ead['query']);_0x51c814[_0x55b7('0x37')]=_[_0x55b7('0x38')](_0x51c814[_0x55b7('0x34')],_0x51c814['query']);_0x4ff6f8[_0x55b7('0x39')]=_['intersection'](_0x51c814['model'],qs[_0x55b7('0x4b')](_0x1a3ead[_0x55b7('0x35')][_0x55b7('0x4b')]));_0x4ff6f8[_0x55b7('0x39')]=_0x4ff6f8[_0x55b7('0x39')][_0x55b7('0x3a')]?_0x4ff6f8[_0x55b7('0x39')]:_0x51c814[_0x55b7('0x34')];_0x4ff6f8[_0x55b7('0x3c')]=qs[_0x55b7('0x3d')](_0x1a3ead[_0x55b7('0x35')][_0x55b7('0x3d')]);_0x4ff6f8['where']=qs['filters'](_[_0x55b7('0x3e')](_0x1a3ead[_0x55b7('0x35')],_0x51c814[_0x55b7('0x37')]));if(_0x1a3ead[_0x55b7('0x35')][_0x55b7('0x3f')]){_0x4ff6f8['where']=_[_0x55b7('0x41')](_0x4ff6f8[_0x55b7('0x40')],{'$or':_[_0x55b7('0x42')](_0x4ff6f8[_0x55b7('0x39')],function(_0x183530){var _0x3def34={};_0x3def34[_0x183530]={'$like':'%'+_0x1a3ead[_0x55b7('0x35')][_0x55b7('0x3f')]+'%'};return _0x3def34;})});}_0x4ff6f8=_['merge']({},_0x4ff6f8,_0x1a3ead[_0x55b7('0x43')]);return _0x572af2[_0x55b7('0x58')](_0x4ff6f8);}})['then'](function(_0x1e9faa){if(_0x1e9faa){_0x4b3b46=_0x1e9faa[_0x55b7('0x3a')];if(!_0x1a3ead['query'][_0x55b7('0x3b')](_0x55b7('0x5a'))){_0x4ff6f8[_0x55b7('0x24')]=qs['limit'](_0x1a3ead[_0x55b7('0x35')][_0x55b7('0x24')]);_0x4ff6f8[_0x55b7('0x22')]=qs['offset'](_0x1a3ead['query'][_0x55b7('0x22')]);}return _0x572af2[_0x55b7('0x58')](_0x4ff6f8);}})[_0x55b7('0x2b')](function(_0x590669){if(_0x590669){return _0x590669?{'count':_0x4b3b46,'rows':_0x590669}:null;}})[_0x55b7('0x2b')](respondWithResult(_0x4d864e,null))[_0x55b7('0x48')](handleError(_0x4d864e,null));};exports['removeMembers']=function(_0x150393,_0x2a5c5d,_0x50a3ea){return db[_0x55b7('0x44')]['find']({'where':{'id':_0x150393['params']['id']}})[_0x55b7('0x2b')](handleEntityNotFound(_0x2a5c5d,null))[_0x55b7('0x2b')](function(_0x5aee6c){if(_0x5aee6c){return _0x5aee6c['removeMembers'](_0x150393[_0x55b7('0x35')][_0x55b7('0x56')]);}})[_0x55b7('0x2b')](respondWithStatusCode(_0x2a5c5d,null))[_0x55b7('0x48')](handleError(_0x2a5c5d,null));};exports['addMessage']=function(_0x5520b6,_0x17c6fa,_0x55ffdd){if(_0x5520b6[_0x55b7('0x4f')]['id']){delete _0x5520b6[_0x55b7('0x4f')]['id'];}return db[_0x55b7('0x44')][_0x55b7('0x4d')]({'where':{'id':_0x5520b6[_0x55b7('0x4a')]['id']}})[_0x55b7('0x2b')](handleEntityNotFound(_0x17c6fa,null))[_0x55b7('0x2b')](function(_0x3d079f){if(_0x3d079f){_0x5520b6[_0x55b7('0x4f')]['ChatGroupId']=_0x3d079f['id'];return db[_0x55b7('0x52')][_0x55b7('0x4e')](_0x5520b6['body']);}})['then'](respondWithResult(_0x17c6fa,null))[_0x55b7('0x48')](handleError(_0x17c6fa,null));};exports['getMessages']=function(_0xcde715,_0x5267b4,_0x15d434){var _0x48cdb9={};var _0x1544cc={};var _0x49ad61;var _0x1adbd9;return db['ChatGroup'][_0x55b7('0x5b')]({'where':{'id':_0xcde715['params']['id']}})[_0x55b7('0x2b')](handleEntityNotFound(_0x5267b4,null))[_0x55b7('0x2b')](function(_0x1cdaf3){if(_0x1cdaf3){_0x49ad61=_0x1cdaf3;_0x1544cc[_0x55b7('0x34')]=_[_0x55b7('0x36')](db['ChatInternalMessage'][_0x55b7('0x30')]);_0x1544cc[_0x55b7('0x35')]=_[_0x55b7('0x36')](_0xcde715['query']);_0x1544cc[_0x55b7('0x37')]=_['intersection'](_0x1544cc[_0x55b7('0x34')],_0x1544cc['query']);_0x48cdb9['attributes']=_[_0x55b7('0x38')](_0x1544cc[_0x55b7('0x34')],qs[_0x55b7('0x4b')](_0xcde715['query'][_0x55b7('0x4b')]));_0x48cdb9[_0x55b7('0x39')]=_0x48cdb9[_0x55b7('0x39')][_0x55b7('0x3a')]?_0x48cdb9[_0x55b7('0x39')]:_0x1544cc[_0x55b7('0x34')];_0x48cdb9[_0x55b7('0x3c')]=qs[_0x55b7('0x3d')](_0xcde715[_0x55b7('0x35')]['sort']);_0x48cdb9[_0x55b7('0x40')]=qs[_0x55b7('0x37')](_[_0x55b7('0x3e')](_0xcde715[_0x55b7('0x35')],_0x1544cc[_0x55b7('0x37')]));if(_0xcde715[_0x55b7('0x35')][_0x55b7('0x3f')]){_0x48cdb9[_0x55b7('0x40')]=_[_0x55b7('0x41')](_0x48cdb9['where'],{'$or':_['map'](_0x48cdb9[_0x55b7('0x39')],function(_0x469c0b){var _0x4b7b97={};_0x4b7b97[_0x469c0b]={'$like':'%'+_0xcde715[_0x55b7('0x35')][_0x55b7('0x3f')]+'%'};return _0x4b7b97;})});}if(_0xcde715[_0x55b7('0x35')][_0x55b7('0x5c')]){var _0x56e082=_0xcde715[_0x55b7('0x35')]['$gte'][_0x55b7('0x5d')](',');var _0x37f399={};_0x37f399[_0x56e082[0x0]]={'$gte':moment(_0x56e082[0x1])['format'](_0x55b7('0x5e'))};_0x48cdb9[_0x55b7('0x40')]=_[_0x55b7('0x41')](_0x48cdb9['where'],_0x37f399);}_0x48cdb9=_['merge']({},_0x48cdb9,_0xcde715['options']);return _0x49ad61[_0x55b7('0x5f')](_0x48cdb9);}})[_0x55b7('0x2b')](function(_0xc73b75){if(_0xc73b75){_0x1adbd9=_0xc73b75[_0x55b7('0x3a')];if(!_0xcde715[_0x55b7('0x35')][_0x55b7('0x3b')](_0x55b7('0x5a'))){_0x48cdb9[_0x55b7('0x24')]=qs[_0x55b7('0x24')](_0xcde715['query'][_0x55b7('0x24')]);_0x48cdb9[_0x55b7('0x22')]=qs[_0x55b7('0x22')](_0xcde715['query'][_0x55b7('0x22')]);}return _0x49ad61[_0x55b7('0x5f')](_0x48cdb9);}})[_0x55b7('0x2b')](function(_0x21f179){if(_0x21f179){return _0x21f179?{'count':_0x1adbd9,'rows':_0x21f179}:null;}})[_0x55b7('0x2b')](respondWithResult(_0x5267b4,null))[_0x55b7('0x48')](handleError(_0x5267b4,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 9bb5b04..add507f 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 _0x6dad=['save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x4f0159,_0xaf2d85){var _0x2b53a8=function(_0x34e528){while(--_0x34e528){_0x4f0159['push'](_0x4f0159['shift']());}};_0x2b53a8(++_0xaf2d85);}(_0x6dad,0x77));var _0xd6da=function(_0x4a393b,_0x483444){_0x4a393b=_0x4a393b-0x0;var _0x21e53b=_0x6dad[_0x4a393b];return _0x21e53b;};'use strict';var EventEmitter=require(_0xd6da('0x0'));var ChatGroup=require('../../mysqldb')['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd6da('0x1'),'afterUpdate':_0xd6da('0x2'),'afterDestroy':_0xd6da('0x3')};function emitEvent(_0x68d591){return function(_0x4f1f58,_0x21b59c,_0x30dc10){ChatGroupEvents[_0xd6da('0x4')](_0x68d591+':'+_0x4f1f58['id'],_0x4f1f58);ChatGroupEvents[_0xd6da('0x4')](_0x68d591,_0x4f1f58);_0x30dc10(null);};}for(var e in events){if(events[_0xd6da('0x5')](e)){var event=events[e];ChatGroup[_0xd6da('0x6')](e,emitEvent(event));}}module[_0xd6da('0x7')]=ChatGroupEvents;
\ No newline at end of file
+var _0x9b7c=['ChatGroup','setMaxListeners','update','remove','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9b7c,0x176));var _0xc9b7=function(_0x1ea053,_0x22aecc){_0x1ea053=_0x1ea053-0x0;var _0x444b08=_0x9b7c[_0x1ea053];return _0x444b08;};'use strict';var EventEmitter=require(_0xc9b7('0x0'));var ChatGroup=require(_0xc9b7('0x1'))['db'][_0xc9b7('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xc9b7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc9b7('0x4'),'afterDestroy':_0xc9b7('0x5')};function emitEvent(_0x29399d){return function(_0xee2a38,_0x251da6,_0x4a6516){ChatGroupEvents[_0xc9b7('0x6')](_0x29399d+':'+_0xee2a38['id'],_0xee2a38);ChatGroupEvents[_0xc9b7('0x6')](_0x29399d,_0xee2a38);_0x4a6516(null);};}for(var e in events){if(events[_0xc9b7('0x7')](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 304de4a..c5f6986 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 _0x13fd=['../../config/logger','moment','request-promise','./chatGroup.attributes','exports','define','ChatGroup'];(function(_0x4d1b78,_0x29e2cb){var _0x271274=function(_0x35f48c){while(--_0x35f48c){_0x4d1b78['push'](_0x4d1b78['shift']());}};_0x271274(++_0x29e2cb);}(_0x13fd,0x93));var _0xd13f=function(_0x59b252,_0x49683c){_0x59b252=_0x59b252-0x0;var _0xfc55e6=_0x13fd[_0x59b252];return _0xfc55e6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd13f('0x0'))('api');var moment=require(_0xd13f('0x1'));var BPromise=require('bluebird');var rp=require(_0xd13f('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd13f('0x3'));module[_0xd13f('0x4')]=function(_0x34bb9e,_0xa61f97){return _0x34bb9e[_0xd13f('0x5')](_0xd13f('0x6'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8786=['lodash','util','../../config/logger','bluebird','request-promise','../../config/environment','./chatGroup.attributes','exports','chat_groups'];(function(_0xdfc19,_0x48a555){var _0x1c3a65=function(_0x5dfc48){while(--_0x5dfc48){_0xdfc19['push'](_0xdfc19['shift']());}};_0x1c3a65(++_0x48a555);}(_0x8786,0x6c));var _0x6878=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x8786[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0x6878('0x0'));var util=require(_0x6878('0x1'));var logger=require(_0x6878('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6878('0x3'));var rp=require(_0x6878('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6878('0x5'));var attributes=require(_0x6878('0x6'));module[_0x6878('0x7')]=function(_0x5851a6,_0x2c5f10){return _0x5851a6['define']('ChatGroup',attributes,{'tableName':_0x6878('0x8'),'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 613bbd9..c10d2fa 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 _0xe8a4=['debug','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent'];(function(_0xb45a4a,_0x366c34){var _0x3d6405=function(_0x55c3b5){while(--_0x55c3b5){_0xb45a4a['push'](_0xb45a4a['shift']());}};_0x3d6405(++_0x366c34);}(_0xe8a4,0x158));var _0x4e8a=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0xe8a4[_0x1e7b16];return _0x37fadc;};'use strict';var _=require(_0x4e8a('0x0'));var util=require('util');var moment=require(_0x4e8a('0x1'));var BPromise=require('bluebird');var rs=require(_0x4e8a('0x2'));var fs=require('fs');var Redis=require(_0x4e8a('0x3'));var db=require(_0x4e8a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4e8a('0x5'))(_0x4e8a('0x6'));var config=require('../../config/environment');var jayson=require(_0x4e8a('0x7'));var client=jayson[_0x4e8a('0x8')][_0x4e8a('0x9')]({'port':0x232a});config[_0x4e8a('0xa')]=_[_0x4e8a('0xb')](config[_0x4e8a('0xa')],{'host':_0x4e8a('0xc'),'port':0x18eb});var socket=require(_0x4e8a('0xd'))(new Redis(config[_0x4e8a('0xa')]));require(_0x4e8a('0xe'))['register'](socket);function respondWithRpcPromise(_0x1cbdf3,_0x3904bd,_0x395889){return new BPromise(function(_0x3ebde6,_0x5beaee){return client[_0x4e8a('0xf')](_0x1cbdf3,_0x395889)[_0x4e8a('0x10')](function(_0x50469a){logger[_0x4e8a('0x11')](_0x4e8a('0x12'),_0x3904bd,_0x4e8a('0x13'));logger[_0x4e8a('0x14')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x3904bd,_0x4e8a('0x13'),JSON['stringify'](_0x50469a));if(_0x50469a[_0x4e8a('0x15')]){if(_0x50469a[_0x4e8a('0x15')][_0x4e8a('0x16')]===0x1f4){logger['error'](_0x4e8a('0x12'),_0x3904bd,_0x50469a['error'][_0x4e8a('0x17')]);return _0x5beaee(_0x50469a[_0x4e8a('0x15')][_0x4e8a('0x17')]);}logger['error'](_0x4e8a('0x12'),_0x3904bd,_0x50469a[_0x4e8a('0x15')][_0x4e8a('0x17')]);return _0x3ebde6(_0x50469a[_0x4e8a('0x15')]['message']);}else{logger[_0x4e8a('0x11')]('ChatGroup,\x20%s,\x20%s',_0x3904bd,_0x4e8a('0x13'));_0x3ebde6(_0x50469a[_0x4e8a('0x18')][_0x4e8a('0x17')]);}})[_0x4e8a('0x19')](function(_0x2b51d5){logger[_0x4e8a('0x15')](_0x4e8a('0x12'),_0x3904bd,_0x2b51d5);_0x5beaee(_0x2b51d5);});});}
\ No newline at end of file
+var _0x61a5=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','register','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird'];(function(_0x308119,_0x2335dd){var _0x30a8d7=function(_0x2d52ce){while(--_0x2d52ce){_0x308119['push'](_0x308119['shift']());}};_0x30a8d7(++_0x2335dd);}(_0x61a5,0xf0));var _0x561a=function(_0x131205,_0x57575c){_0x131205=_0x131205-0x0;var _0x305300=_0x61a5[_0x131205];return _0x305300;};'use strict';var _=require(_0x561a('0x0'));var util=require('util');var moment=require(_0x561a('0x1'));var BPromise=require(_0x561a('0x2'));var rs=require(_0x561a('0x3'));var fs=require('fs');var Redis=require(_0x561a('0x4'));var db=require(_0x561a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x561a('0x6'))(_0x561a('0x7'));var config=require('../../config/environment');var jayson=require(_0x561a('0x8'));var client=jayson[_0x561a('0x9')][_0x561a('0xa')]({'port':0x232a});config[_0x561a('0xb')]=_[_0x561a('0xc')](config[_0x561a('0xb')],{'host':_0x561a('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x561a('0xb')]));require('./chatGroup.socket')[_0x561a('0xe')](socket);function respondWithRpcPromise(_0x5288b4,_0x5b3510,_0x34e464){return new BPromise(function(_0x4071ba,_0x522f52){return client[_0x561a('0xf')](_0x5288b4,_0x34e464)['then'](function(_0x205e99){logger[_0x561a('0x10')](_0x561a('0x11'),_0x5b3510,_0x561a('0x12'));logger[_0x561a('0x13')](_0x561a('0x14'),_0x5b3510,_0x561a('0x12'),JSON[_0x561a('0x15')](_0x205e99));if(_0x205e99[_0x561a('0x16')]){if(_0x205e99[_0x561a('0x16')][_0x561a('0x17')]===0x1f4){logger[_0x561a('0x16')]('ChatGroup,\x20%s,\x20%s',_0x5b3510,_0x205e99[_0x561a('0x16')][_0x561a('0x18')]);return _0x522f52(_0x205e99[_0x561a('0x16')][_0x561a('0x18')]);}logger[_0x561a('0x16')](_0x561a('0x11'),_0x5b3510,_0x205e99[_0x561a('0x16')][_0x561a('0x18')]);return _0x4071ba(_0x205e99[_0x561a('0x16')][_0x561a('0x18')]);}else{logger[_0x561a('0x10')]('ChatGroup,\x20%s,\x20%s',_0x5b3510,_0x561a('0x12'));_0x4071ba(_0x205e99[_0x561a('0x19')]['message']);}})[_0x561a('0x1a')](function(_0x785831){logger['error'](_0x561a('0x11'),_0x5b3510,_0x785831);_0x522f52(_0x785831);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 6b86977..4667f66 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 _0x3137=['update','removeListener','chatGroup:','./chatGroup.events','save','remove'];(function(_0x4c7765,_0x40e8c2){var _0x18776f=function(_0x583711){while(--_0x583711){_0x4c7765['push'](_0x4c7765['shift']());}};_0x18776f(++_0x40e8c2);}(_0x3137,0x135));var _0x7313=function(_0x28cbb5,_0x127005){_0x28cbb5=_0x28cbb5-0x0;var _0x27c4be=_0x3137[_0x28cbb5];return _0x27c4be;};'use strict';var ChatGroupEvents=require(_0x7313('0x0'));var events=[_0x7313('0x1'),_0x7313('0x2'),_0x7313('0x3')];function createListener(_0x545dbe,_0xfa9a93){return function(_0x46245f){_0xfa9a93['emit'](_0x545dbe,_0x46245f);};}function removeListener(_0x472f4c,_0x3963cf){return function(){ChatGroupEvents[_0x7313('0x4')](_0x472f4c,_0x3963cf);};}exports['register']=function(_0x6ecfc9){for(var _0x542349=0x0,_0x226fe9=events['length'];_0x542349<_0x226fe9;_0x542349++){var _0x48e75c=events[_0x542349];var _0x578eb2=createListener(_0x7313('0x5')+_0x48e75c,_0x6ecfc9);ChatGroupEvents['on'](_0x48e75c,_0x578eb2);}};
\ No newline at end of file
+var _0x0eba=['removeListener','length','chatGroup:','./chatGroup.events','save','emit'];(function(_0x3aaf0a,_0x450970){var _0x33e6bc=function(_0x1db54d){while(--_0x1db54d){_0x3aaf0a['push'](_0x3aaf0a['shift']());}};_0x33e6bc(++_0x450970);}(_0x0eba,0x1d1));var _0xa0eb=function(_0x5715a2,_0x17e9c0){_0x5715a2=_0x5715a2-0x0;var _0x2ebf35=_0x0eba[_0x5715a2];return _0x2ebf35;};'use strict';var ChatGroupEvents=require(_0xa0eb('0x0'));var events=[_0xa0eb('0x1'),'remove','update'];function createListener(_0x38a06c,_0x475489){return function(_0x2c2d08){_0x475489[_0xa0eb('0x2')](_0x38a06c,_0x2c2d08);};}function removeListener(_0x984986,_0x397bd6){return function(){ChatGroupEvents[_0xa0eb('0x3')](_0x984986,_0x397bd6);};}exports['register']=function(_0x255b93){for(var _0x15ed4e=0x0,_0x545d73=events[_0xa0eb('0x4')];_0x15ed4e<_0x545d73;_0x15ed4e++){var _0x3f4cfd=events[_0x15ed4e];var _0x569016=createListener(_0xa0eb('0x5')+_0x3f4cfd,_0x255b93);ChatGroupEvents['on'](_0x3f4cfd,_0x569016);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 30233be..1a4af5c 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 _0x1ca4=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/describe','isAuthenticated','describe','get','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','put','update','delete','/:id','destroy'];(function(_0x4a3991,_0x412a7b){var _0x1b9f70=function(_0x4e6df3){while(--_0x4e6df3){_0x4a3991['push'](_0x4a3991['shift']());}};_0x1b9f70(++_0x412a7b);}(_0x1ca4,0x194));var _0x41ca=function(_0x59534f,_0x1c834d){_0x59534f=_0x59534f-0x0;var _0x5d252a=_0x1ca4[_0x59534f];return _0x5d252a;};'use strict';var multer=require(_0x41ca('0x0'));var util=require(_0x41ca('0x1'));var path=require(_0x41ca('0x2'));var timeout=require(_0x41ca('0x3'));var express=require(_0x41ca('0x4'));var router=express['Router']();var fs_extra=require(_0x41ca('0x5'));var auth=require(_0x41ca('0x6'));var interaction=require(_0x41ca('0x7'));var config=require(_0x41ca('0x8'));var controller=require('./chatGroup.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x41ca('0x9')]);router['get'](_0x41ca('0xa'),auth[_0x41ca('0xb')](),controller[_0x41ca('0xc')]);router[_0x41ca('0xd')]('/:id',auth[_0x41ca('0xb')](),controller[_0x41ca('0xe')]);router[_0x41ca('0xd')](_0x41ca('0xf'),auth[_0x41ca('0xb')](),controller[_0x41ca('0x10')]);router[_0x41ca('0xd')](_0x41ca('0x11'),auth[_0x41ca('0xb')](),controller[_0x41ca('0x12')]);router['get'](_0x41ca('0x13'),auth[_0x41ca('0xb')](),controller[_0x41ca('0x14')]);router[_0x41ca('0x15')]('/',auth[_0x41ca('0xb')](),controller[_0x41ca('0x16')]);router[_0x41ca('0x15')]('/:id/members',auth[_0x41ca('0xb')](),controller[_0x41ca('0x17')]);router['post']('/:id/messages',auth['isAuthenticated'](),controller[_0x41ca('0x18')]);router[_0x41ca('0x19')]('/:id',auth[_0x41ca('0xb')](),controller[_0x41ca('0x1a')]);router[_0x41ca('0x1b')](_0x41ca('0x1c'),auth[_0x41ca('0xb')](),controller[_0x41ca('0x1d')]);router[_0x41ca('0x1b')]('/:id/members',auth[_0x41ca('0xb')](),controller['removeMembers']);module[_0x41ca('0x1e')]=router;
\ No newline at end of file
+var _0x1be7=['../../config/environment','./chatGroup.controller','get','index','/describe','isAuthenticated','describe','/:id','show','getUnread','/:id/messages','post','create','/:id/members','addMembers','addMessage','put','update','delete','destroy','removeMembers','exports','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x353f81,_0x2e9105){var _0x261d52=function(_0x358e45){while(--_0x358e45){_0x353f81['push'](_0x353f81['shift']());}};_0x261d52(++_0x2e9105);}(_0x1be7,0x1d8));var _0x71be=function(_0x26f081,_0x4277f3){_0x26f081=_0x26f081-0x0;var _0x4bf032=_0x1be7[_0x26f081];return _0x4bf032;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x71be('0x0'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x71be('0x1'));var auth=require(_0x71be('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x71be('0x3'));var controller=require(_0x71be('0x4'));router[_0x71be('0x5')]('/',auth['isAuthenticated'](),controller[_0x71be('0x6')]);router[_0x71be('0x5')](_0x71be('0x7'),auth[_0x71be('0x8')](),controller[_0x71be('0x9')]);router[_0x71be('0x5')](_0x71be('0xa'),auth[_0x71be('0x8')](),controller[_0x71be('0xb')]);router[_0x71be('0x5')]('/:id/unread',auth[_0x71be('0x8')](),controller[_0x71be('0xc')]);router['get']('/:id/members',auth[_0x71be('0x8')](),controller['getMembers']);router[_0x71be('0x5')](_0x71be('0xd'),auth['isAuthenticated'](),controller['getMessages']);router[_0x71be('0xe')]('/',auth['isAuthenticated'](),controller[_0x71be('0xf')]);router[_0x71be('0xe')](_0x71be('0x10'),auth['isAuthenticated'](),controller[_0x71be('0x11')]);router[_0x71be('0xe')](_0x71be('0xd'),auth[_0x71be('0x8')](),controller[_0x71be('0x12')]);router[_0x71be('0x13')](_0x71be('0xa'),auth[_0x71be('0x8')](),controller[_0x71be('0x14')]);router[_0x71be('0x15')](_0x71be('0xa'),auth[_0x71be('0x8')](),controller[_0x71be('0x16')]);router[_0x71be('0x15')](_0x71be('0x10'),auth['isAuthenticated'](),controller[_0x71be('0x17')]);module[_0x71be('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 4a11e8b..fbef10e 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 _0xa699=['INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','long','sequelize','exports','BOOLEAN'];(function(_0x592e40,_0x2ed011){var _0x5d4288=function(_0x366e87){while(--_0x366e87){_0x592e40['push'](_0x592e40['shift']());}};_0x5d4288(++_0x2ed011);}(_0xa699,0x6b));var _0x9a69=function(_0x21b36c,_0x543483){_0x21b36c=_0x21b36c-0x0;var _0x236627=_0xa699[_0x21b36c];return _0x236627;};'use strict';var Sequelize=require(_0x9a69('0x0'));module[_0x9a69('0x1')]={'closed':{'type':Sequelize[_0x9a69('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x9a69('0x3')]},'ratingType':{'type':Sequelize[_0x9a69('0x4')](_0x9a69('0x5'),_0x9a69('0x6')),'defaultValue':_0x9a69('0x5')},'ratingMessage':{'type':Sequelize[_0x9a69('0x7')]},'pathTranscript':{'type':Sequelize[_0x9a69('0x7')]},'mailTranscript':{'type':Sequelize[_0x9a69('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x9a69('0x9')]},'disposition':{'type':Sequelize[_0x9a69('0x8')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x9a69('0x8')]},'note':{'type':Sequelize[_0x9a69('0x8')]},'browserName':{'type':Sequelize[_0x9a69('0x8')]},'browserVersion':{'type':Sequelize[_0x9a69('0x8')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x9a69('0x8')]},'deviceModel':{'type':Sequelize[_0x9a69('0x8')]},'deviceVendor':{'type':Sequelize[_0x9a69('0x8')]},'deviceType':{'type':Sequelize[_0x9a69('0x8')]},'referer':{'type':Sequelize[_0x9a69('0x7')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT'](_0x9a69('0xa'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x9a69('0x9')]},'lastMsgDirection':{'type':Sequelize[_0x9a69('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x9a69('0x8')]},'customerPort':{'type':Sequelize[_0x9a69('0x8')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x9a69('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x3c0d=['DATE','long','out','INTEGER','ENUM','star','thumb','TEXT','STRING'];(function(_0x578e15,_0x8e0df0){var _0x4c547d=function(_0x3c6888){while(--_0x3c6888){_0x578e15['push'](_0x578e15['shift']());}};_0x4c547d(++_0x8e0df0);}(_0x3c0d,0xf6));var _0xd3c0=function(_0x4e823f,_0x1eb3f9){_0x4e823f=_0x4e823f-0x0;var _0x294b36=_0x3c0d[_0x4e823f];return _0x294b36;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xd3c0('0x0')]},'ratingType':{'type':Sequelize[_0xd3c0('0x1')](_0xd3c0('0x2'),_0xd3c0('0x3')),'defaultValue':_0xd3c0('0x2')},'ratingMessage':{'type':Sequelize[_0xd3c0('0x4')]},'pathTranscript':{'type':Sequelize[_0xd3c0('0x4')]},'mailTranscript':{'type':Sequelize[_0xd3c0('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xd3c0('0x6')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xd3c0('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xd3c0('0x5')]},'browserName':{'type':Sequelize[_0xd3c0('0x5')]},'browserVersion':{'type':Sequelize[_0xd3c0('0x5')]},'osName':{'type':Sequelize[_0xd3c0('0x5')]},'osVersion':{'type':Sequelize[_0xd3c0('0x5')]},'deviceModel':{'type':Sequelize[_0xd3c0('0x5')]},'deviceVendor':{'type':Sequelize[_0xd3c0('0x5')]},'deviceType':{'type':Sequelize[_0xd3c0('0x5')]},'referer':{'type':Sequelize[_0xd3c0('0x4')]},'customerIp':{'type':Sequelize[_0xd3c0('0x5')]},'formData':{'type':Sequelize['TEXT'](_0xd3c0('0x7'))},'read1stAt':{'type':Sequelize[_0xd3c0('0x6')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xd3c0('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xd3c0('0x5')]},'customerPort':{'type':Sequelize[_0xd3c0('0x5')]},'vidaooSessionId':{'type':Sequelize[_0xd3c0('0x4')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 65116b4..cdb8371 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 _0x56ee=['type','key','getOptions','findAll','chat','query','user','model','filters','intersection','attributes','fields','length','include','options','find','create','update','params','describe','createVidaooSession','ChatWebsite','findOne','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooNote','vidaooMetadata','email','POST','vidaooTopic','follow','isNull','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','CmContact','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','Interaction\x20already\x20assigned','disposition','AbandonInteraction','abandon','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','download','close','server/files/chat/upload/','format','now','pathTranscript','Messages','User','ContactId','UserId','%s%d','agentAlias','System','customer','Visitor','alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','MailServerOut','CloudProvider','Smtp','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','addMessage','omit','ids','getMessages','keys','rawAttributes','hasOwnProperty','nolimit','order','sort','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','secret','includeAgent','push','addTags','setTags','spread','Tag','unix','files','tmp','server','attachments','transcript-%d-%s.zip','firstName','lastName','read','Account','Owner','get','mkdirSync','Chat','N.A.','closed','closedAt','toString','browserName','referer','customerIp','customerPort','tail','createReadStream','pipe','createWriteStream','out','value','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','moment','bluebird','mustache','util','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','register','jayson/promise','http','client','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','ChatInteraction,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','then','destroy','stack','name','send','merge','body','contact','interaction','account','map','ChatInteraction'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x56ee,0x168));var _0xe56e=function(_0x45fc6a,_0x166adb){_0x45fc6a=_0x45fc6a-0x0;var _0x14bcfd=_0x56ee[_0x45fc6a];return _0x14bcfd;};'use strict';var rimraf=require(_0xe56e('0x0'));var zipdir=require('zip-dir');var rp=require('request-promise');var moment=require(_0xe56e('0x1'));var BPromise=require(_0xe56e('0x2'));var Mustache=require(_0xe56e('0x3'));var util=require(_0xe56e('0x4'));var path=require('path');var ejs=require(_0xe56e('0x5'));var fs=require('fs');var _=require(_0xe56e('0x6'));var Redis=require(_0xe56e('0x7'));var interaction=require(_0xe56e('0x8'));var qs=require(_0xe56e('0x9'));var pdf=require('../../components/export/pdf');var logger=require('../../config/logger')(_0xe56e('0xa'));var config=require(_0xe56e('0xb'));var db=require(_0xe56e('0xc'))['db'];config[_0xe56e('0xd')]=_[_0xe56e('0xe')](config[_0xe56e('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatInteraction.socket')[_0xe56e('0xf')](socket);var jayson=require(_0xe56e('0x10'));var client=jayson['client'][_0xe56e('0x11')]({'port':0x232b});var client9004=jayson[_0xe56e('0x12')][_0xe56e('0x11')]({'port':0x232c});function respondWithRpcPromise(_0x1fabdd,_0x61e6f3,_0x510931,_0x269fb2){return new BPromise(function(_0x1776aa,_0x54beeb){var _0x58a83e=_0x269fb2||client;return _0x58a83e['request'](_0x1fabdd,_0x510931)['then'](function(_0x18518c){logger[_0xe56e('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x61e6f3,_0xe56e('0x14'));logger[_0xe56e('0x15')](_0xe56e('0x16'),_0x61e6f3,_0xe56e('0x14'),JSON[_0xe56e('0x17')](_0x18518c));if(_0x18518c[_0xe56e('0x18')]){if(_0x18518c['error']['code']===0x1f4){logger[_0xe56e('0x18')](_0xe56e('0x19'),_0x61e6f3,_0x18518c[_0xe56e('0x18')][_0xe56e('0x1a')]);return _0x54beeb(_0x18518c[_0xe56e('0x18')]['message']);}logger[_0xe56e('0x18')](_0xe56e('0x19'),_0x61e6f3,_0x18518c[_0xe56e('0x18')][_0xe56e('0x1a')]);return _0x1776aa(_0x18518c[_0xe56e('0x18')]['message']);}else{logger[_0xe56e('0x13')](_0xe56e('0x19'),_0x61e6f3,_0xe56e('0x14'));_0x1776aa(_0x18518c[_0xe56e('0x1b')][_0xe56e('0x1a')]);}})[_0xe56e('0x1c')](function(_0x4a3622){logger[_0xe56e('0x18')](_0xe56e('0x19'),_0x61e6f3,_0x4a3622);_0x54beeb(_0x4a3622);});});}function respondWithStatusCode(_0x1549cf,_0x5b6cb5){_0x5b6cb5=_0x5b6cb5||0xcc;return function(_0x52a02a){if(_0x52a02a){return _0x1549cf[_0xe56e('0x1d')](_0x5b6cb5);}return _0x1549cf[_0xe56e('0x1e')](_0x5b6cb5)['end']();};}function respondWithResult(_0x544c73,_0x2a31ae){_0x2a31ae=_0x2a31ae||0xc8;return function(_0x26f0c5){if(_0x26f0c5){return _0x544c73[_0xe56e('0x1e')](_0x2a31ae)[_0xe56e('0x1f')](_0x26f0c5);}};}function respondWithFilteredResult(_0x37cbc7,_0x1ed369){return function(_0xe721f0){if(_0xe721f0){var _0x43d38f=typeof _0x1ed369['offset']===_0xe56e('0x20')&&typeof _0x1ed369[_0xe56e('0x21')]===_0xe56e('0x20');var _0xd27c6=_0xe721f0[_0xe56e('0x22')];var _0x56b7cb=_0x43d38f?0x0:_0x1ed369[_0xe56e('0x23')];var _0x1bd92b=_0x43d38f?_0xe721f0[_0xe56e('0x22')]:_0x1ed369[_0xe56e('0x23')]+_0x1ed369[_0xe56e('0x21')];var _0x391142;if(_0x1bd92b>=_0xd27c6){_0x1bd92b=_0xd27c6;_0x391142=0xc8;}else{_0x391142=0xce;}_0x37cbc7[_0xe56e('0x1e')](_0x391142);return _0x37cbc7[_0xe56e('0x24')](_0xe56e('0x25'),_0x56b7cb+'-'+_0x1bd92b+'/'+_0xd27c6)[_0xe56e('0x1f')](_0xe721f0);}return null;};}function saveUpdates(_0x3e1afa){return function(_0x15d850){if(_0x15d850){return _0x15d850['update'](_0x3e1afa)[_0xe56e('0x26')](function(_0x4c3acf){return _0x4c3acf;});}return null;};}function removeEntity(_0x3ef156){return function(_0x9942a){if(_0x9942a){return _0x9942a[_0xe56e('0x27')]()['then'](function(){_0x3ef156[_0xe56e('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49674b){return function(_0x2f9992){if(!_0x2f9992){_0x49674b['sendStatus'](0x194);}return _0x2f9992;};}function handleError(_0x25f5db,_0x1852db){_0x1852db=_0x1852db||0x1f4;return function(_0x1c1526){logger[_0xe56e('0x18')](_0x1c1526[_0xe56e('0x28')]);if(_0x1c1526[_0xe56e('0x29')]){delete _0x1c1526[_0xe56e('0x29')];}_0x25f5db['status'](_0x1852db)[_0xe56e('0x2a')](_0x1c1526);};}function getMustacheRender(_0x1ca259,_0x2acef5){return Mustache['render'](_0x1ca259,_[_0xe56e('0x2b')](_0x2acef5[_0xe56e('0x2c')],{'contact':_0x2acef5[_0xe56e('0x2d')],'message':_0x2acef5['message'],'agent':_0x2acef5['agent'],'interaction':_0x2acef5[_0xe56e('0x2e')],'account':_0x2acef5[_0xe56e('0x2f')]}))||'';}exports['index']=function(_0xbec72b,_0x3ec2ac){var _0x341d70={};var _0x47d2e0=_[_0xe56e('0x30')](db[_0xe56e('0x31')]['rawAttributes'],function(_0xea8398){return{'name':_0xea8398['fieldName'],'type':_0xea8398[_0xe56e('0x32')][_0xe56e('0x33')]};});_0x341d70=qs[_0xe56e('0x34')](_0x47d2e0,_0xbec72b);return interaction[_0xe56e('0x35')](_0xe56e('0x36'),_0xbec72b[_0xe56e('0x37')],_0xbec72b[_0xe56e('0x38')],_0x341d70,_0x47d2e0)[_0xe56e('0x26')](respondWithFilteredResult(_0x3ec2ac,_0x341d70))['catch'](handleError(_0x3ec2ac,null));};exports['show']=function(_0x47726e,_0xf49a05){var _0x5e9fe2={'raw':![],'where':{'id':_0x47726e['params']['id']}},_0x26d3c5={};_0x26d3c5[_0xe56e('0x39')]=_['keys'](db['ChatInteraction']['rawAttributes']);_0x26d3c5[_0xe56e('0x37')]=_['keys'](_0x47726e[_0xe56e('0x37')]);_0x26d3c5[_0xe56e('0x3a')]=_[_0xe56e('0x3b')](_0x26d3c5[_0xe56e('0x39')],_0x26d3c5['query']);_0x5e9fe2[_0xe56e('0x3c')]=_['intersection'](_0x26d3c5[_0xe56e('0x39')],qs['fields'](_0x47726e[_0xe56e('0x37')][_0xe56e('0x3d')]));_0x5e9fe2[_0xe56e('0x3c')]=_0x5e9fe2[_0xe56e('0x3c')][_0xe56e('0x3e')]?_0x5e9fe2[_0xe56e('0x3c')]:_0x26d3c5[_0xe56e('0x39')];if(_0x47726e[_0xe56e('0x37')]['includeAll']){_0x5e9fe2[_0xe56e('0x3f')]=[{'all':!![]}];}_0x5e9fe2=_[_0xe56e('0x2b')]({},_0x5e9fe2,_0x47726e[_0xe56e('0x40')]);return db['ChatInteraction'][_0xe56e('0x41')](_0x5e9fe2)[_0xe56e('0x26')](handleEntityNotFound(_0xf49a05,null))[_0xe56e('0x26')](respondWithResult(_0xf49a05,null))['catch'](handleError(_0xf49a05,null));};exports[_0xe56e('0x42')]=function(_0x5bca6c,_0x162ee5){return db[_0xe56e('0x31')][_0xe56e('0x42')](_0x5bca6c[_0xe56e('0x2c')],{})[_0xe56e('0x26')](respondWithResult(_0x162ee5,0xc9))[_0xe56e('0x1c')](handleError(_0x162ee5,null));};exports[_0xe56e('0x43')]=function(_0x53703a,_0x5593a9){if(_0x53703a[_0xe56e('0x2c')]['id']){delete _0x53703a[_0xe56e('0x2c')]['id'];}return db[_0xe56e('0x31')]['find']({'where':{'id':_0x53703a['params']['id']}})[_0xe56e('0x26')](handleEntityNotFound(_0x5593a9,null))[_0xe56e('0x26')](saveUpdates(_0x53703a[_0xe56e('0x2c')],null))['then'](respondWithResult(_0x5593a9,null))[_0xe56e('0x1c')](handleError(_0x5593a9,null));};exports[_0xe56e('0x27')]=function(_0x508b73,_0x1ed5f4){return db[_0xe56e('0x31')][_0xe56e('0x41')]({'where':{'id':_0x508b73[_0xe56e('0x44')]['id']}})['then'](handleEntityNotFound(_0x1ed5f4,null))['then'](removeEntity(_0x1ed5f4,null))[_0xe56e('0x1c')](handleError(_0x1ed5f4,null));};exports[_0xe56e('0x45')]=function(_0x3f3203,_0x48ed32){return db[_0xe56e('0x31')][_0xe56e('0x45')]()[_0xe56e('0x26')](respondWithResult(_0x48ed32,null))['catch'](handleError(_0x48ed32,null));};exports[_0xe56e('0x46')]=function(_0x2c0b42,_0x3698b8){var _0x38ee5f=_0x2c0b42[_0xe56e('0x44')]['id'];var _0x70e576;var _0x43a38e;var _0x173315;return db[_0xe56e('0x31')]['findOne']({'where':{'id':_0x38ee5f}})[_0xe56e('0x26')](function(_0x2c11b8){_0x70e576=_0x2c11b8;return db[_0xe56e('0x47')][_0xe56e('0x48')]({'where':{'id':_0x2c11b8[_0xe56e('0x49')]},'attributes':['id',_0xe56e('0x4a'),_0xe56e('0x4b'),'vidaooTopic',_0xe56e('0x4c'),_0xe56e('0x4d')],'raw':!![]});})['then'](function(_0x47b464){if(_0x47b464&&_0x47b464['vidaooApiKey']&&_0x47b464[_0xe56e('0x4b')]){_0x43a38e=_0x47b464;var _0x329f3f={'interaction':{'id':_0x38ee5f},'agent':{'id':_0x2c0b42[_0xe56e('0x38')]['id'],'name':_0x2c0b42['user']['name'],'fullname':_0x2c0b42[_0xe56e('0x38')]['fullname'],'email':_0x2c0b42[_0xe56e('0x38')][_0xe56e('0x4e')]},'contact':_0x2c0b42[_0xe56e('0x2c')][_0xe56e('0x2d')],'account':_0x2c0b42[_0xe56e('0x2c')]['account']};var _0x1bd835={'rejectUnauthorized':![],'method':_0xe56e('0x4f'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x47b464[_0xe56e('0x4a')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x2c0b42['user'][_0xe56e('0x4e')]],'buttons':null,'topic':_0x43a38e[_0xe56e('0x50')],'note':_['isNull'](_0x43a38e[_0xe56e('0x4c')])?null:getMustacheRender(_0x43a38e['vidaooNote'],_0x329f3f),'metadata':null},'redirect':_0xe56e('0x51'),'json':!![]};try{if(!_[_0xe56e('0x52')](_0x43a38e[_0xe56e('0x4d')])){var _0x3a64fb=getMustacheRender(_0x43a38e['vidaooMetadata'],_0x329f3f);var _0x227c57=JSON['parse'](_0x3a64fb);_0x1bd835[_0xe56e('0x2c')][_0xe56e('0x53')]=_0x227c57;}}catch(_0x32359a){throw new db[(_0xe56e('0x54'))][(_0xe56e('0x55'))](_0xe56e('0x56'));}return rp(_0x1bd835);}else{throw new db[(_0xe56e('0x54'))][(_0xe56e('0x55'))](_0xe56e('0x57'));}})[_0xe56e('0x26')](function(_0x42fd38){_0x173315=_0x42fd38;if(_0x173315['id']){var _0x295752={'body':_0x173315['join_url'],'ChatWebsiteId':_0x43a38e['id'],'ChatInteractionId':_0x70e576['id'],'direction':'out','UserId':_0x2c0b42[_0xe56e('0x38')]['id']};return db[_0xe56e('0x58')]['create'](_0x295752,{});}else{throw new db['Sequelize'][(_0xe56e('0x55'))](_0xe56e('0x59'));}})[_0xe56e('0x26')](function(){return _0x70e576['updateAttributes']({'vidaooSessionId':_0x173315['id']});})[_0xe56e('0x26')](respondWithResult(_0x3698b8,null))[_0xe56e('0x1c')](handleError(_0x3698b8,null));};exports[_0xe56e('0x5a')]=function(_0x2e0055,_0x26df35){if(_0x2e0055[_0xe56e('0x2c')]['id']){delete _0x2e0055[_0xe56e('0x2c')]['id'];}return db['ChatInteraction'][_0xe56e('0x41')]({'where':{'id':_0x2e0055['params']['id']},'include':[{'model':db[_0xe56e('0x5b')],'as':_0xe56e('0x5c')}]})[_0xe56e('0x26')](handleEntityNotFound(_0x26df35,null))['then'](saveUpdates(_0x2e0055[_0xe56e('0x2c')],null))[_0xe56e('0x26')](respondWithResult(_0x26df35,null))[_0xe56e('0x1c')](handleError(_0x26df35,null));};exports['abandon']=function(_0x5ede1e,_0x2309ec){if(_0x5ede1e[_0xe56e('0x2c')]['id']){delete _0x5ede1e['body']['id'];}return db[_0xe56e('0x31')][_0xe56e('0x41')]({'where':{'id':_0x5ede1e[_0xe56e('0x44')]['id']}})[_0xe56e('0x26')](function(_0x5bb8a9){if(!_0x5bb8a9){logger['error'](_0xe56e('0x5d'),'abandon',0x194,'entity\x20not\x20found');_0x2309ec['sendStatus'](0x194);}else{if(_0x5bb8a9['UserId']){throw new db['Sequelize'][(_0xe56e('0x55'))](_0xe56e('0x5e'));}}return _0x5bb8a9;})[_0xe56e('0x26')](function(_0x244946){if(_0x244946){return _0x244946['update']({'closed':_0x5ede1e[_0xe56e('0x2c')]['closed'],'disposition':_0x5ede1e[_0xe56e('0x2c')][_0xe56e('0x5f')]})[_0xe56e('0x26')](function(_0x14c5fd){return _0x14c5fd;});}})[_0xe56e('0x26')](function(){return respondWithRpcPromise(_0xe56e('0x60'),_0xe56e('0x61'),_0x5ede1e[_0xe56e('0x2c')],client9004);})['then'](respondWithResult(_0x2309ec,null))[_0xe56e('0x1c')](handleError(_0x2309ec,null));};exports[_0xe56e('0x62')]=function(_0x9e487a,_0x2e1634){_0x9e487a['body']['name']=_0x9e487a[_0xe56e('0x63')][_0xe56e('0x64')];_0x9e487a[_0xe56e('0x2c')][_0xe56e('0x65')]=_0x9e487a[_0xe56e('0x63')][_0xe56e('0x66')];_0x9e487a['body']['type']=_0x9e487a['file'][_0xe56e('0x67')];return db[_0xe56e('0x68')][_0xe56e('0x42')](_0x9e487a[_0xe56e('0x2c')])['then'](respondWithResult(_0x2e1634,0xc9))[_0xe56e('0x1c')](handleError(_0x2e1634,null));};exports[_0xe56e('0x69')]=function(_0x153657,_0x419fe5){return db['ChatInteraction'][_0xe56e('0x48')]({'where':{'id':_0x153657[_0xe56e('0x44')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x419fe5,null))['then'](function(_0x30160d){if(_0x30160d){if(_0x30160d['closed']){return _0x419fe5[_0xe56e('0x1e')](0x193)['json']({'status':0x193,'message':_0xe56e('0x6a')});}return db[_0xe56e('0x68')][_0xe56e('0x48')]({'where':{'id':_0x153657[_0xe56e('0x37')][_0xe56e('0x6b')]},'raw':!![]})[_0xe56e('0x26')](handleEntityNotFound(_0x419fe5,null));}})['then'](function(_0x2a10fd){if(_0x2a10fd){var _0x22ec21=_0x2a10fd[_0xe56e('0x6c')]!==null;var _0x724547=path['join'](config[_0xe56e('0x6d')],_0xe56e('0x6e'));if(_0x22ec21){_0x724547=path[_0xe56e('0x6f')](_0x724547,_0xe56e('0x70'));}var _0x53a182=path[_0xe56e('0x6f')](_0x724547,_0x2a10fd[_0xe56e('0x65')]);return _0x419fe5[_0xe56e('0x71')](_0x53a182);}})[_0xe56e('0x1c')](handleError(_0x419fe5,null));};exports[_0xe56e('0x72')]=function(_0x289b69,_0x453a9c){var _0x2b8aaa=null;var _0x1f16c4=null;var _0x44ed4d=null;if(_0x289b69[_0xe56e('0x2c')]['id']){delete _0x289b69['body']['id'];}if(_0x289b69[_0xe56e('0x2c')]['mailTranscript']){_0x44ed4d=path[_0xe56e('0x6f')](config[_0xe56e('0x6d')],_0xe56e('0x73'),util[_0xe56e('0x74')]('transcript-%s.txt',Date[_0xe56e('0x75')]()));_0x289b69[_0xe56e('0x2c')][_0xe56e('0x76')]=_0x44ed4d;}return db[_0xe56e('0x31')][_0xe56e('0x41')]({'where':{'id':_0x289b69[_0xe56e('0x44')]['id']},'include':[{'model':db[_0xe56e('0x58')],'as':_0xe56e('0x77'),'include':[{'model':db[_0xe56e('0x78')],'as':_0xe56e('0x78')}]}]})[_0xe56e('0x26')](handleEntityNotFound(_0x453a9c,null))[_0xe56e('0x26')](saveUpdates(_0x289b69[_0xe56e('0x2c')],null))[_0xe56e('0x26')](function(_0x2ffa3b){if(_0x2ffa3b){_0x2b8aaa=_0x2ffa3b;return db[_0xe56e('0x47')][_0xe56e('0x41')]({'where':{'id':_0x2b8aaa[_0xe56e('0x49')]}});}})[_0xe56e('0x26')](function(_0x26a2e3){if(_0x26a2e3){_0x1f16c4=_0x26a2e3;return db[_0xe56e('0x5b')][_0xe56e('0x41')]({'where':{'id':_0x2b8aaa[_0xe56e('0x79')]}});}})['then'](function(_0x2cb575){if(_0x2cb575){if(_0x44ed4d){var _0x3634b6=null;for(var _0x41d24b=0x1;_0x41d24b<_0x2b8aaa[_0xe56e('0x77')][_0xe56e('0x3e')];++_0x41d24b){_0x3634b6=_0x2b8aaa['Messages'][_0x41d24b];var _0x4c51ad=_0x3634b6[_0xe56e('0x7a')]?util['format'](_0xe56e('0x7b'),_0x1f16c4[_0xe56e('0x7c')],_0x3634b6[_0xe56e('0x7a')]):_0xe56e('0x7d');var _0x1168b7=_0x289b69['body'][_0xe56e('0x7e')]||util[_0xe56e('0x74')](_0xe56e('0x7b'),_0xe56e('0x7f'),_0x3634b6[_0xe56e('0x79')]);switch(_0x1f16c4['agentIdentifier']){case'website_alias':_0x4c51ad=_0x3634b6[_0xe56e('0x7a')]?util[_0xe56e('0x74')](_0xe56e('0x7b'),_0x1f16c4[_0xe56e('0x7c')],_0x3634b6[_0xe56e('0x7a')]):_0xe56e('0x7d');break;case'agent_alias':_0x4c51ad=_0x3634b6[_0xe56e('0x7a')]?_0x3634b6[_0xe56e('0x78')][_0xe56e('0x80')]||_0x3634b6[_0xe56e('0x78')][_0xe56e('0x81')]:_0xe56e('0x7d');break;case _0xe56e('0x82'):_0x4c51ad=_0x3634b6[_0xe56e('0x7a')]?_0x3634b6[_0xe56e('0x78')]['fullname']:_0xe56e('0x7d');break;default:_0x4c51ad=_0x3634b6[_0xe56e('0x7a')]?util[_0xe56e('0x74')](_0xe56e('0x7b'),_0x1f16c4[_0xe56e('0x7c')],_0x3634b6[_0xe56e('0x7a')]):_0xe56e('0x7d');}var _0x1f915b=util[_0xe56e('0x74')](_0xe56e('0x83'),moment(_0x3634b6[_0xe56e('0x84')])[_0xe56e('0x74')](_0xe56e('0x85')),_0x3634b6[_0xe56e('0x86')]==='in'?_0x1168b7:_0x4c51ad,_0x3634b6[_0xe56e('0x2c')]);if(!_0x3634b6['secret']){fs[_0xe56e('0x87')](_0x44ed4d,_0x1f915b);}}return db[_0xe56e('0x88')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xe56e('0x89')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xe56e('0x8a')],'as':_0xe56e('0x8a'),'raw':!![]}]}]});}}})[_0xe56e('0x26')](function(_0x37d0f0){if(!_0x37d0f0||!_0x37d0f0[_0xe56e('0x8b')]||!_0x289b69[_0xe56e('0x2c')])return _0x2b8aaa;var _0x307aee=_0x37d0f0[_0xe56e('0x8c')]();return respondWithRpcPromise(_0xe56e('0x8d'),'sendMail',{'account':_0x307aee,'message':{'from':util['format'](_0xe56e('0x8e'),_0x37d0f0[_0xe56e('0x29')],_0x37d0f0[_0xe56e('0x4e')]||_0x37d0f0[_0xe56e('0x8b')][_0xe56e('0x38')]),'to':_0x289b69['body'][_0xe56e('0x8f')],'subject':_0xe56e('0x90'),'text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x289b69['body'][_0xe56e('0x8f')]),'attachments':[{'path':_0x44ed4d}]}})[_0xe56e('0x26')](function(){return _0x2b8aaa;})[_0xe56e('0x1c')](function(_0x46f1b4){logger[_0xe56e('0x18')](_0x46f1b4);});})[_0xe56e('0x26')](respondWithStatusCode(_0x453a9c,0xc8))['catch'](handleError(_0x453a9c,null));};exports['addMessage']=function(_0x593db3,_0x3117ce){return db[_0xe56e('0x58')][_0xe56e('0x41')]({'where':{'id':_0x593db3[_0xe56e('0x44')]['id']}})[_0xe56e('0x26')](handleEntityNotFound(_0x3117ce,null))['then'](function(_0x1d5d81){if(_0x1d5d81){return _0x1d5d81[_0xe56e('0x91')](_0x593db3[_0xe56e('0x2c')]['ids'],_[_0xe56e('0x92')](_0x593db3[_0xe56e('0x2c')],[_0xe56e('0x93'),'id'])||{});}})[_0xe56e('0x26')](respondWithResult(_0x3117ce,null))['catch'](handleError(_0x3117ce,null));};exports[_0xe56e('0x94')]=function(_0x2d0e3d,_0x2f70cf){var _0x58fe52={'raw':![],'where':{}};var _0x5003f4={};var _0x5648d7={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xe56e('0x48')]({'where':{'id':_0x2d0e3d['params']['id']}})[_0xe56e('0x26')](handleEntityNotFound(_0x2f70cf,null))[_0xe56e('0x26')](function(_0x316dde){if(_0x316dde){_0x5003f4['model']=_[_0xe56e('0x95')](db['ChatMessage'][_0xe56e('0x96')]);_0x5003f4['query']=_[_0xe56e('0x95')](_0x2d0e3d[_0xe56e('0x37')]);_0x5003f4[_0xe56e('0x3a')]=_[_0xe56e('0x3b')](_0x5003f4[_0xe56e('0x39')],_0x5003f4[_0xe56e('0x37')]);_0x58fe52[_0xe56e('0x3c')]=_[_0xe56e('0x3b')](_0x5003f4[_0xe56e('0x39')],qs[_0xe56e('0x3d')](_0x2d0e3d[_0xe56e('0x37')][_0xe56e('0x3d')]));_0x58fe52[_0xe56e('0x3c')]=_0x58fe52[_0xe56e('0x3c')][_0xe56e('0x3e')]?_0x58fe52[_0xe56e('0x3c')]:_0x5003f4['model'];if(!_0x2d0e3d[_0xe56e('0x37')][_0xe56e('0x97')](_0xe56e('0x98'))){_0x58fe52[_0xe56e('0x21')]=qs[_0xe56e('0x21')](_0x2d0e3d[_0xe56e('0x37')][_0xe56e('0x21')]);_0x58fe52[_0xe56e('0x23')]=qs['offset'](_0x2d0e3d[_0xe56e('0x37')][_0xe56e('0x23')]);}_0x58fe52[_0xe56e('0x99')]=qs[_0xe56e('0x9a')](_0x2d0e3d[_0xe56e('0x37')][_0xe56e('0x9a')]);_0x58fe52[_0xe56e('0x9b')]=qs[_0xe56e('0x3a')](_[_0xe56e('0x9c')](_0x2d0e3d[_0xe56e('0x37')],_0x5003f4[_0xe56e('0x3a')]));_0x58fe52['where'][_0xe56e('0x9d')]=_0x316dde['id'];if(_0x2d0e3d[_0xe56e('0x37')][_0xe56e('0x9e')]){_0x58fe52[_0xe56e('0x9b')]=_[_0xe56e('0x2b')](_0x58fe52['where'],{'$or':_['map'](_0x58fe52[_0xe56e('0x3c')],function(_0x26cff0){var _0x3587db={};_0x3587db[_0x26cff0]={'$like':'%'+_0x2d0e3d[_0xe56e('0x37')]['filter']+'%'};return _0x3587db;})});}if(_0x2d0e3d['query'][_0xe56e('0x9f')]){var _0x4115ae=_0x2d0e3d[_0xe56e('0x37')][_0xe56e('0x9f')][_0xe56e('0xa0')](',');var _0x27b422={};_0x27b422[_0x4115ae[0x0]]={'$gte':moment(_0x4115ae[0x1])[_0xe56e('0x74')](_0xe56e('0xa1'))};_0x58fe52[_0xe56e('0x9b')]=_[_0xe56e('0x2b')](_0x58fe52[_0xe56e('0x9b')],_0x27b422);}_0x58fe52=_[_0xe56e('0x2b')]({},_0x58fe52,_0x2d0e3d[_0xe56e('0x40')]);return db['ChatMessage'][_0xe56e('0x22')]({'where':_0x58fe52['where']})[_0xe56e('0x26')](function(_0x48cca0){_0x5648d7[_0xe56e('0x22')]=_0x48cca0;if(_0x2d0e3d['query']['includeAll']){_0x58fe52[_0xe56e('0x3f')]=[{'all':!![]}];}return db[_0xe56e('0x58')]['findAll'](_0x58fe52);})[_0xe56e('0x26')](function(_0x11ff43){_0x5648d7[_0xe56e('0xa2')]=_0x11ff43;return _0x5648d7;});}})['then'](respondWithFilteredResult(_0x2f70cf,_0x58fe52))[_0xe56e('0x1c')](handleError(_0x2f70cf,null));};exports[_0xe56e('0xa3')]=function(_0x39165a,_0x534e53){var _0x47de3={'where':{}},_0x3db5dd={},_0x7a1683={'count':0x0,'rows':[]};return db[_0xe56e('0x31')]['findOne']({'where':{'id':_0x39165a[_0xe56e('0x44')]['id']}})[_0xe56e('0x26')](handleEntityNotFound(_0x534e53,null))[_0xe56e('0x26')](function(_0x548ffa){if(_0x548ffa){_0x3db5dd[_0xe56e('0x39')]=_[_0xe56e('0x95')](db[_0xe56e('0x58')]['rawAttributes']);_0x3db5dd[_0xe56e('0x37')]=_['keys'](_0x39165a['query']);_0x3db5dd['filters']=_[_0xe56e('0x3b')](_0x3db5dd['model'],_0x3db5dd['query']);_0x47de3[_0xe56e('0x3c')]=_['intersection'](_0x3db5dd[_0xe56e('0x39')],qs['fields'](_0x39165a[_0xe56e('0x37')][_0xe56e('0x3d')]));_0x47de3[_0xe56e('0x3c')]=_0x47de3[_0xe56e('0x3c')][_0xe56e('0x3e')]?_0x47de3[_0xe56e('0x3c')]:_0x3db5dd['model'];if(!_0x39165a[_0xe56e('0x37')]['hasOwnProperty'](_0xe56e('0x98'))){_0x47de3[_0xe56e('0x21')]=qs['limit'](_0x39165a['query'][_0xe56e('0x21')]);_0x47de3[_0xe56e('0x23')]=qs['offset'](_0x39165a['query'][_0xe56e('0x23')]);}_0x47de3[_0xe56e('0x99')]=qs[_0xe56e('0x9a')](_0x39165a['query']['sort']);_0x47de3[_0xe56e('0x9b')]=qs[_0xe56e('0x3a')](_[_0xe56e('0x9c')](_0x39165a[_0xe56e('0x37')],_0x3db5dd['filters']));_0x47de3[_0xe56e('0x9b')][_0xe56e('0x9d')]=_0x548ffa['id'];if(_0x39165a['query'][_0xe56e('0x9e')]){_0x47de3[_0xe56e('0x9b')]=_[_0xe56e('0x2b')](_0x47de3['where'],{'$or':_[_0xe56e('0x30')](_0x47de3[_0xe56e('0x3c')],function(_0x226b22){var _0x371917={};_0x371917[_0x226b22]={'$like':'%'+_0x39165a['query'][_0xe56e('0x9e')]+'%'};return _0x371917;})});}_0x47de3[_0xe56e('0x9b')][_0xe56e('0xa4')]=![];if(_0x39165a['query']['id']){_0x47de3['where']['id']={'$gt':_0x39165a[_0xe56e('0x37')]['id']};}_0x47de3=_['merge']({},_0x47de3,_0x39165a[_0xe56e('0x40')]);return db[_0xe56e('0x58')]['count']({'where':_0x47de3[_0xe56e('0x9b')]})['then'](function(_0x3fd122){_0x7a1683[_0xe56e('0x22')]=_0x3fd122;_0x47de3['include']=[];if(_0x39165a[_0xe56e('0x37')][_0xe56e('0xa5')]){_0x47de3['include'][_0xe56e('0xa6')]({'model':db[_0xe56e('0x78')],'as':_0xe56e('0x78'),'attributes':['id',_0xe56e('0x81'),_0xe56e('0x80')]});}if(_0x39165a[_0xe56e('0x37')]['includeAll']){_0x47de3['include']=[{'all':!![]}];}return db[_0xe56e('0x58')]['findAll'](_0x47de3);})[_0xe56e('0x26')](function(_0x5aa35c){_0x7a1683[_0xe56e('0xa2')]=_0x5aa35c;return _0x7a1683;});}})[_0xe56e('0x26')](respondWithFilteredResult(_0x534e53,_0x47de3))[_0xe56e('0x1c')](handleError(_0x534e53,null));};exports[_0xe56e('0xa7')]=function(_0x4ca58c,_0xfe644d){return db[_0xe56e('0x31')]['find']({'where':{'id':_0x4ca58c[_0xe56e('0x44')]['id']}})[_0xe56e('0x26')](handleEntityNotFound(_0xfe644d,null))['then'](function(_0x534198){if(_0x534198){return _0x534198[_0xe56e('0xa8')](_0x4ca58c[_0xe56e('0x2c')][_0xe56e('0x93')],_['omit'](_0x4ca58c[_0xe56e('0x2c')],[_0xe56e('0x93'),'id'])||{})[_0xe56e('0xa9')](function(){return db[_0xe56e('0xaa')][_0xe56e('0x35')]({'attributes':['id',_0xe56e('0x29'),'color'],'where':{'id':_0x4ca58c[_0xe56e('0x2c')][_0xe56e('0x93')]}});})[_0xe56e('0x26')](function(_0x4eefae){socket['emit']('chatInteractionTags:save',{'id':Number(_0x4ca58c['params']['id']),'tags':_0x4eefae||[]});return{'id':Number(_0x4ca58c['params']['id']),'tags':_0x4eefae||[]};});}})['then'](respondWithResult(_0xfe644d,null))[_0xe56e('0x1c')](handleError(_0xfe644d,null));};exports['removeTags']=function(_0x8aedea,_0x312e05){return db[_0xe56e('0x31')]['find']({'where':{'id':_0x8aedea[_0xe56e('0x44')]['id']}})['then'](handleEntityNotFound(_0x312e05,null))[_0xe56e('0x26')](function(_0x4d97a3){if(_0x4d97a3){return _0x4d97a3['removeTags'](_0x8aedea[_0xe56e('0x37')][_0xe56e('0x93')]);}})[_0xe56e('0x26')](respondWithStatusCode(_0x312e05,null))[_0xe56e('0x1c')](handleError(_0x312e05,null));};exports[_0xe56e('0x71')]=function(_0x4a04a9,_0x473d38){var _0x576f6d=moment()[_0xe56e('0xab')]()['toString']();var _0x236c04=path[_0xe56e('0x6f')](config[_0xe56e('0x6d')],'server',_0xe56e('0xac'),_0xe56e('0xad'));var _0x2a7a40=path[_0xe56e('0x6f')](config[_0xe56e('0x6d')],_0xe56e('0xae'),'files',_0xe56e('0xaf'));var _0x156990=path[_0xe56e('0x6f')](_0x236c04,_0x576f6d);var _0x8f3301=util[_0xe56e('0x74')](_0xe56e('0xb0'),_0x4a04a9['params']['id'],_0x576f6d);var _0x3958af=path[_0xe56e('0x6f')](_0x236c04,_0x8f3301);var _0x3cb92b=[];_0x3cb92b[_0xe56e('0xa6')]({'model':db[_0xe56e('0x78')],'as':_0xe56e('0x78'),'attributes':['id',_0xe56e('0x81')],'raw':!![]});_0x3cb92b['push']({'model':db[_0xe56e('0x5b')],'as':_0xe56e('0x5c'),'attributes':['id',_0xe56e('0xb1'),_0xe56e('0xb2')],'raw':!![]});if(_0x4a04a9['query'][_0xe56e('0xaf')]){_0x3cb92b[_0xe56e('0xa6')]({'model':db[_0xe56e('0x68')],'as':_0xe56e('0x68'),'raw':!![]});}var _0x3140b9=[{'model':db['ChatMessage'],'as':_0xe56e('0x77'),'attributes':['id',_0xe56e('0x2c'),_0xe56e('0x84'),_0xe56e('0x86'),_0xe56e('0xa4'),_0xe56e('0xb3')],'include':_0x3cb92b}];_0x3140b9[_0xe56e('0xa6')]({'model':db['ChatWebsite'],'as':_0xe56e('0xb4'),'attributes':['id',_0xe56e('0x29')]});_0x3140b9[_0xe56e('0xa6')]({'model':db[_0xe56e('0x78')],'as':_0xe56e('0xb5'),'attributes':['id',_0xe56e('0x81')]});return db[_0xe56e('0x31')][_0xe56e('0x41')]({'where':{'id':_0x4a04a9['params']['id']},'include':_0x3140b9})[_0xe56e('0x26')](handleEntityNotFound(_0x473d38,null))[_0xe56e('0x26')](function(_0x412fc8){if(_0x412fc8){var _0x497979=_0x412fc8[_0xe56e('0xb6')]({'plain':!![]});fs[_0xe56e('0xb7')](_0x156990);var _0x249158={'channel':_0xe56e('0xb8'),'account':_0x497979[_0xe56e('0xb4')][_0xe56e('0x29')],'agent':_0x497979[_0xe56e('0xb5')]?_0x497979[_0xe56e('0xb5')][_0xe56e('0x81')]:_0xe56e('0xb9'),'createdAt':moment(_0x497979[_0xe56e('0x84')])[_0xe56e('0x74')](_0xe56e('0xa1'))['toString'](),'closedAt':_0x497979[_0xe56e('0xba')]?moment(_0x497979[_0xe56e('0xbb')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xe56e('0xbc')]():'','disposition':_0x497979[_0xe56e('0x5f')],'chatInfo':{'browser':_0x497979[_0xe56e('0xbd')],'os':_0x497979['osName'],'referer':_0x497979[_0xe56e('0xbe')],'customerIp':_0x497979[_0xe56e('0xbf')],'customerPort':_0x497979[_0xe56e('0xc0')]?_0x497979[_0xe56e('0xc0')]:_0xe56e('0xb9')},'messages':_(_0x497979[_0xe56e('0x77')])[_0xe56e('0xc1')]()[_0xe56e('0x9e')]({'secret':![]})[_0xe56e('0x30')](function(_0xc46686){if(_0xc46686[_0xe56e('0x68')]){var _0x42d3b2=path[_0xe56e('0x6f')](_0x2a7a40,_0xc46686['Attachment'][_0xe56e('0x65')]);if(fs['existsSync'](_0x42d3b2)){fs[_0xe56e('0xc2')](_0x42d3b2)[_0xe56e('0xc3')](fs[_0xe56e('0xc4')](path[_0xe56e('0x6f')](_0x156990,_0xc46686[_0xe56e('0x68')]['basename'])));}}return{'date':moment(_0xc46686['createdAt'])[_0xe56e('0x74')](_0xe56e('0xa1'))[_0xe56e('0xbc')](),'sender':_0xc46686[_0xe56e('0x86')]===_0xe56e('0xc5')?_0xc46686[_0xe56e('0x78')]?_0xc46686['User'][_0xe56e('0x81')]:_0xe56e('0x7d'):_0xc46686['Contact'][_0xe56e('0xb1')]+(_0xc46686[_0xe56e('0x5c')][_0xe56e('0xb2')]?'\x20'+_0xc46686[_0xe56e('0x5c')][_0xe56e('0xb2')]:''),'body':_0xc46686[_0xe56e('0x68')]?_0xc46686[_0xe56e('0x68')]['basename']:_0xc46686[_0xe56e('0x2c')],'direction':_0xc46686[_0xe56e('0x86')]===_0xe56e('0xc5')?'A':'C','secret':_0xc46686['secret'],'read':_0xc46686[_0xe56e('0xb3')],'attachment':_0xc46686[_0xe56e('0x68')]};})[_0xe56e('0xc6')]()};return ejs['renderFile'](path['join'](config[_0xe56e('0x6d')],_0xe56e('0xae'),'views',_0xe56e('0xc7')),{'interaction':_0x249158})[_0xe56e('0x26')](function(_0x376b50){var _0x24eb5e=path[_0xe56e('0x6f')](_0x156990,_0xe56e('0xc8')+_0x497979['id']+'-'+_0x576f6d+_0xe56e('0xc9'));var _0x23e239={'path':_0x24eb5e,'channel':'Chat','interactionId':_0x497979['id']};return pdf[_0xe56e('0xca')](_0x376b50,_0x23e239);})[_0xe56e('0x26')](function(){return new Promise(function(_0x588eed,_0x4ac2e6){zipdir(_0x156990,{'saveTo':_0x3958af},function(_0x517873,_0x50b1bc){if(_0x517873)return _0x4ac2e6(_0x517873);return _0x588eed(_0x50b1bc);});})['then'](function(){return new BPromise(function(_0x5e9fb7,_0xd34613){rimraf(_0x156990,function(_0x2116c1){if(_0x2116c1)_0xd34613(_0x2116c1);return _0x5e9fb7();});});})[_0xe56e('0x26')](function(){return _0x473d38[_0xe56e('0x71')](_0x3958af,_0x8f3301,function(_0x3604ab){if(_0x3604ab){logger[_0xe56e('0x18')](_0xe56e('0xcb'),_0x3604ab);}else{fs[_0xe56e('0xcc')](_0x3958af);}});});});}else{return _0x473d38[_0xe56e('0x1d')](0xc8);}})[_0xe56e('0x1c')](handleError(_0x473d38,null));};
\ No newline at end of file
+var _0xdfd5=['order','ChatInteractionId','includeAgent','push','rows','setTags','spread','Tag','color','emit','chatInteractionTags:save','removeTags','download','toString','files','tmp','transcript-%d-%s.zip','lastName','attachments','read','Account','mkdirSync','Chat','browserName','osName','referer','customerPort','N.A.','tail','existsSync','createWriteStream','firstName','value','server','views','transcript-','.pdf','createPdfFromHTML','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','stack','name','render','merge','body','contact','agent','interaction','map','rawAttributes','fieldName','type','key','findAll','chat','query','user','show','params','model','keys','ChatInteraction','filters','intersection','fields','attributes','includeAll','include','options','create','update','find','describe','findOne','ChatWebsite','ChatWebsiteId','vidaooEscalation','vidaooMetadata','vidaooApiKey','fullname','email','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','isNull','vidaooNote','metadata','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','Contact','abandon','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','Unauthorized','attachId','join','root','server/files/attachments/','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','ContactId','Messages','length','agentAlias','System','customer','Visitor','website_alias','%s%d','agent_alias','alias','User','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailServerOut','Smtp','CloudProvider','SendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','hasOwnProperty','nolimit','sort','where','pick','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','getMyMessages'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdfd5,0x1c3));var _0x5dfd=function(_0xc0a3d3,_0x2c8d00){_0xc0a3d3=_0xc0a3d3-0x0;var _0x3386e8=_0xdfd5[_0xc0a3d3];return _0x3386e8;};'use strict';var rimraf=require(_0x5dfd('0x0'));var zipdir=require(_0x5dfd('0x1'));var rp=require(_0x5dfd('0x2'));var moment=require(_0x5dfd('0x3'));var BPromise=require(_0x5dfd('0x4'));var Mustache=require(_0x5dfd('0x5'));var util=require(_0x5dfd('0x6'));var path=require(_0x5dfd('0x7'));var ejs=require(_0x5dfd('0x8'));var fs=require('fs');var _=require(_0x5dfd('0x9'));var Redis=require(_0x5dfd('0xa'));var interaction=require(_0x5dfd('0xb'));var qs=require('../../components/parsers/qs');var pdf=require(_0x5dfd('0xc'));var logger=require(_0x5dfd('0xd'))('api');var config=require(_0x5dfd('0xe'));var db=require('../../mysqldb')['db'];config[_0x5dfd('0xf')]=_[_0x5dfd('0x10')](config[_0x5dfd('0xf')],{'host':_0x5dfd('0x11'),'port':0x18eb});var socket=require(_0x5dfd('0x12'))(new Redis(config[_0x5dfd('0xf')]));require('./chatInteraction.socket')[_0x5dfd('0x13')](socket);var jayson=require(_0x5dfd('0x14'));var client=jayson[_0x5dfd('0x15')][_0x5dfd('0x16')]({'port':0x232b});var client9004=jayson['client'][_0x5dfd('0x16')]({'port':0x232c});function respondWithRpcPromise(_0x567186,_0x5e63cd,_0xa31e,_0x22c24c){return new BPromise(function(_0xbc4f07,_0x5f5342){var _0x4dfecd=_0x22c24c||client;return _0x4dfecd[_0x5dfd('0x17')](_0x567186,_0xa31e)[_0x5dfd('0x18')](function(_0x1b265e){logger[_0x5dfd('0x19')](_0x5dfd('0x1a'),_0x5e63cd,_0x5dfd('0x1b'));logger[_0x5dfd('0x1c')](_0x5dfd('0x1d'),_0x5e63cd,_0x5dfd('0x1b'),JSON[_0x5dfd('0x1e')](_0x1b265e));if(_0x1b265e[_0x5dfd('0x1f')]){if(_0x1b265e[_0x5dfd('0x1f')][_0x5dfd('0x20')]===0x1f4){logger[_0x5dfd('0x1f')](_0x5dfd('0x1a'),_0x5e63cd,_0x1b265e[_0x5dfd('0x1f')][_0x5dfd('0x21')]);return _0x5f5342(_0x1b265e['error']['message']);}logger[_0x5dfd('0x1f')](_0x5dfd('0x1a'),_0x5e63cd,_0x1b265e[_0x5dfd('0x1f')][_0x5dfd('0x21')]);return _0xbc4f07(_0x1b265e['error']['message']);}else{logger[_0x5dfd('0x19')](_0x5dfd('0x1a'),_0x5e63cd,_0x5dfd('0x1b'));_0xbc4f07(_0x1b265e['result'][_0x5dfd('0x21')]);}})[_0x5dfd('0x22')](function(_0xa72fe0){logger[_0x5dfd('0x1f')](_0x5dfd('0x1a'),_0x5e63cd,_0xa72fe0);_0x5f5342(_0xa72fe0);});});}function respondWithStatusCode(_0x25f52d,_0x11de10){_0x11de10=_0x11de10||0xcc;return function(_0x1fe62a){if(_0x1fe62a){return _0x25f52d[_0x5dfd('0x23')](_0x11de10);}return _0x25f52d[_0x5dfd('0x24')](_0x11de10)[_0x5dfd('0x25')]();};}function respondWithResult(_0x3b2bc5,_0x1ee99f){_0x1ee99f=_0x1ee99f||0xc8;return function(_0x149c22){if(_0x149c22){return _0x3b2bc5[_0x5dfd('0x24')](_0x1ee99f)[_0x5dfd('0x26')](_0x149c22);}};}function respondWithFilteredResult(_0x5165f4,_0x5ee86b){return function(_0x1a2f90){if(_0x1a2f90){var _0x96e0aa=typeof _0x5ee86b[_0x5dfd('0x27')]===_0x5dfd('0x28')&&typeof _0x5ee86b[_0x5dfd('0x29')]===_0x5dfd('0x28');var _0x24f158=_0x1a2f90[_0x5dfd('0x2a')];var _0x350ee2=_0x96e0aa?0x0:_0x5ee86b[_0x5dfd('0x27')];var _0x3230ab=_0x96e0aa?_0x1a2f90[_0x5dfd('0x2a')]:_0x5ee86b[_0x5dfd('0x27')]+_0x5ee86b[_0x5dfd('0x29')];var _0x41a7c5;if(_0x3230ab>=_0x24f158){_0x3230ab=_0x24f158;_0x41a7c5=0xc8;}else{_0x41a7c5=0xce;}_0x5165f4[_0x5dfd('0x24')](_0x41a7c5);return _0x5165f4[_0x5dfd('0x2b')](_0x5dfd('0x2c'),_0x350ee2+'-'+_0x3230ab+'/'+_0x24f158)['json'](_0x1a2f90);}return null;};}function saveUpdates(_0x13bc15){return function(_0x3c3b30){if(_0x3c3b30){return _0x3c3b30['update'](_0x13bc15)['then'](function(_0x15b12f){return _0x15b12f;});}return null;};}function removeEntity(_0x57d752){return function(_0x286a37){if(_0x286a37){return _0x286a37[_0x5dfd('0x2d')]()[_0x5dfd('0x18')](function(){_0x57d752[_0x5dfd('0x24')](0xcc)[_0x5dfd('0x25')]();});}};}function handleEntityNotFound(_0x296624){return function(_0x40dff6){if(!_0x40dff6){_0x296624['sendStatus'](0x194);}return _0x40dff6;};}function handleError(_0x26416b,_0x11b367){_0x11b367=_0x11b367||0x1f4;return function(_0x5cd921){logger['error'](_0x5cd921[_0x5dfd('0x2e')]);if(_0x5cd921[_0x5dfd('0x2f')]){delete _0x5cd921[_0x5dfd('0x2f')];}_0x26416b[_0x5dfd('0x24')](_0x11b367)['send'](_0x5cd921);};}function getMustacheRender(_0x434eb1,_0x5b8a61){return Mustache[_0x5dfd('0x30')](_0x434eb1,_[_0x5dfd('0x31')](_0x5b8a61[_0x5dfd('0x32')],{'contact':_0x5b8a61[_0x5dfd('0x33')],'message':_0x5b8a61[_0x5dfd('0x21')],'agent':_0x5b8a61[_0x5dfd('0x34')],'interaction':_0x5b8a61[_0x5dfd('0x35')],'account':_0x5b8a61['account']}))||'';}exports['index']=function(_0x263f18,_0x13d7d3){var _0x5dc4be={};var _0x218b46=_[_0x5dfd('0x36')](db['ChatInteraction'][_0x5dfd('0x37')],function(_0x4ebc78){return{'name':_0x4ebc78[_0x5dfd('0x38')],'type':_0x4ebc78[_0x5dfd('0x39')][_0x5dfd('0x3a')]};});_0x5dc4be=qs['getOptions'](_0x218b46,_0x263f18);return interaction[_0x5dfd('0x3b')](_0x5dfd('0x3c'),_0x263f18[_0x5dfd('0x3d')],_0x263f18[_0x5dfd('0x3e')],_0x5dc4be,_0x218b46)[_0x5dfd('0x18')](respondWithFilteredResult(_0x13d7d3,_0x5dc4be))['catch'](handleError(_0x13d7d3,null));};exports[_0x5dfd('0x3f')]=function(_0x18ac03,_0x4680a4){var _0x5f153={'raw':![],'where':{'id':_0x18ac03[_0x5dfd('0x40')]['id']}},_0x5928d3={};_0x5928d3[_0x5dfd('0x41')]=_[_0x5dfd('0x42')](db[_0x5dfd('0x43')]['rawAttributes']);_0x5928d3[_0x5dfd('0x3d')]=_['keys'](_0x18ac03[_0x5dfd('0x3d')]);_0x5928d3[_0x5dfd('0x44')]=_[_0x5dfd('0x45')](_0x5928d3[_0x5dfd('0x41')],_0x5928d3[_0x5dfd('0x3d')]);_0x5f153['attributes']=_[_0x5dfd('0x45')](_0x5928d3[_0x5dfd('0x41')],qs[_0x5dfd('0x46')](_0x18ac03[_0x5dfd('0x3d')][_0x5dfd('0x46')]));_0x5f153[_0x5dfd('0x47')]=_0x5f153[_0x5dfd('0x47')]['length']?_0x5f153[_0x5dfd('0x47')]:_0x5928d3[_0x5dfd('0x41')];if(_0x18ac03[_0x5dfd('0x3d')][_0x5dfd('0x48')]){_0x5f153[_0x5dfd('0x49')]=[{'all':!![]}];}_0x5f153=_[_0x5dfd('0x31')]({},_0x5f153,_0x18ac03[_0x5dfd('0x4a')]);return db[_0x5dfd('0x43')]['find'](_0x5f153)[_0x5dfd('0x18')](handleEntityNotFound(_0x4680a4,null))[_0x5dfd('0x18')](respondWithResult(_0x4680a4,null))[_0x5dfd('0x22')](handleError(_0x4680a4,null));};exports[_0x5dfd('0x4b')]=function(_0x2d3aa5,_0x136f15){return db[_0x5dfd('0x43')][_0x5dfd('0x4b')](_0x2d3aa5[_0x5dfd('0x32')],{})[_0x5dfd('0x18')](respondWithResult(_0x136f15,0xc9))[_0x5dfd('0x22')](handleError(_0x136f15,null));};exports[_0x5dfd('0x4c')]=function(_0x3ce5fd,_0x24361d){if(_0x3ce5fd['body']['id']){delete _0x3ce5fd[_0x5dfd('0x32')]['id'];}return db['ChatInteraction'][_0x5dfd('0x4d')]({'where':{'id':_0x3ce5fd['params']['id']}})[_0x5dfd('0x18')](handleEntityNotFound(_0x24361d,null))[_0x5dfd('0x18')](saveUpdates(_0x3ce5fd[_0x5dfd('0x32')],null))[_0x5dfd('0x18')](respondWithResult(_0x24361d,null))[_0x5dfd('0x22')](handleError(_0x24361d,null));};exports[_0x5dfd('0x2d')]=function(_0x4f57ae,_0x422706){return db[_0x5dfd('0x43')][_0x5dfd('0x4d')]({'where':{'id':_0x4f57ae[_0x5dfd('0x40')]['id']}})[_0x5dfd('0x18')](handleEntityNotFound(_0x422706,null))[_0x5dfd('0x18')](removeEntity(_0x422706,null))[_0x5dfd('0x22')](handleError(_0x422706,null));};exports[_0x5dfd('0x4e')]=function(_0x2e19bb,_0x166ced){return db['ChatInteraction'][_0x5dfd('0x4e')]()[_0x5dfd('0x18')](respondWithResult(_0x166ced,null))[_0x5dfd('0x22')](handleError(_0x166ced,null));};exports['createVidaooSession']=function(_0x71ba3e,_0x32532d){var _0x3865e5=_0x71ba3e[_0x5dfd('0x40')]['id'];var _0x333035;var _0xd98c0f;var _0x40e9d7;return db[_0x5dfd('0x43')][_0x5dfd('0x4f')]({'where':{'id':_0x3865e5}})['then'](function(_0x28c84a){_0x333035=_0x28c84a;return db[_0x5dfd('0x50')]['findOne']({'where':{'id':_0x28c84a[_0x5dfd('0x51')]},'attributes':['id','vidaooApiKey',_0x5dfd('0x52'),'vidaooTopic','vidaooNote',_0x5dfd('0x53')],'raw':!![]});})[_0x5dfd('0x18')](function(_0x4f3af6){if(_0x4f3af6&&_0x4f3af6[_0x5dfd('0x54')]&&_0x4f3af6[_0x5dfd('0x52')]){_0xd98c0f=_0x4f3af6;var _0x2f38c5={'interaction':{'id':_0x3865e5},'agent':{'id':_0x71ba3e[_0x5dfd('0x3e')]['id'],'name':_0x71ba3e[_0x5dfd('0x3e')][_0x5dfd('0x2f')],'fullname':_0x71ba3e[_0x5dfd('0x3e')][_0x5dfd('0x55')],'email':_0x71ba3e[_0x5dfd('0x3e')][_0x5dfd('0x56')]},'contact':_0x71ba3e['body'][_0x5dfd('0x33')],'account':_0x71ba3e[_0x5dfd('0x32')][_0x5dfd('0x57')]};var _0x2d8585={'rejectUnauthorized':![],'method':_0x5dfd('0x58'),'url':_0x5dfd('0x59'),'headers':{'X-APIKEY':_0x4f3af6[_0x5dfd('0x54')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x71ba3e[_0x5dfd('0x3e')][_0x5dfd('0x56')]],'buttons':null,'topic':_0xd98c0f[_0x5dfd('0x5a')],'note':_[_0x5dfd('0x5b')](_0xd98c0f[_0x5dfd('0x5c')])?null:getMustacheRender(_0xd98c0f[_0x5dfd('0x5c')],_0x2f38c5),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x5dfd('0x5b')](_0xd98c0f[_0x5dfd('0x53')])){var _0xe2649d=getMustacheRender(_0xd98c0f[_0x5dfd('0x53')],_0x2f38c5);var _0x5726df=JSON['parse'](_0xe2649d);_0x2d8585[_0x5dfd('0x32')][_0x5dfd('0x5d')]=_0x5726df;}}catch(_0x642260){throw new db[(_0x5dfd('0x5e'))][(_0x5dfd('0x5f'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x2d8585);}else{throw new db[(_0x5dfd('0x5e'))][(_0x5dfd('0x5f'))](_0x5dfd('0x60'));}})['then'](function(_0x11334e){_0x40e9d7=_0x11334e;if(_0x40e9d7['id']){var _0x4b8f19={'body':_0x40e9d7['join_url'],'ChatWebsiteId':_0xd98c0f['id'],'ChatInteractionId':_0x333035['id'],'direction':_0x5dfd('0x61'),'UserId':_0x71ba3e['user']['id']};return db[_0x5dfd('0x62')]['create'](_0x4b8f19,{});}else{throw new db['Sequelize'][(_0x5dfd('0x5f'))](_0x5dfd('0x63'));}})[_0x5dfd('0x18')](function(){return _0x333035[_0x5dfd('0x64')]({'vidaooSessionId':_0x40e9d7['id']});})[_0x5dfd('0x18')](respondWithResult(_0x32532d,null))['catch'](handleError(_0x32532d,null));};exports['customUpdate']=function(_0x177168,_0x476020){if(_0x177168[_0x5dfd('0x32')]['id']){delete _0x177168['body']['id'];}return db[_0x5dfd('0x43')]['find']({'where':{'id':_0x177168[_0x5dfd('0x40')]['id']},'include':[{'model':db[_0x5dfd('0x65')],'as':_0x5dfd('0x66')}]})[_0x5dfd('0x18')](handleEntityNotFound(_0x476020,null))['then'](saveUpdates(_0x177168[_0x5dfd('0x32')],null))[_0x5dfd('0x18')](respondWithResult(_0x476020,null))['catch'](handleError(_0x476020,null));};exports['abandon']=function(_0x4766c5,_0x34357c){if(_0x4766c5[_0x5dfd('0x32')]['id']){delete _0x4766c5[_0x5dfd('0x32')]['id'];}return db[_0x5dfd('0x43')]['find']({'where':{'id':_0x4766c5['params']['id']}})[_0x5dfd('0x18')](function(_0x355b5e){if(!_0x355b5e){logger[_0x5dfd('0x1f')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x5dfd('0x67'),0x194,_0x5dfd('0x68'));_0x34357c[_0x5dfd('0x23')](0x194);}else{if(_0x355b5e[_0x5dfd('0x69')]){throw new db[(_0x5dfd('0x5e'))][(_0x5dfd('0x5f'))](_0x5dfd('0x6a'));}}return _0x355b5e;})[_0x5dfd('0x18')](function(_0x5c5583){if(_0x5c5583){return _0x5c5583[_0x5dfd('0x4c')]({'closed':_0x4766c5[_0x5dfd('0x32')][_0x5dfd('0x6b')],'disposition':_0x4766c5[_0x5dfd('0x32')][_0x5dfd('0x6c')]})[_0x5dfd('0x18')](function(_0x3de061){return _0x3de061;});}})[_0x5dfd('0x18')](function(){return respondWithRpcPromise(_0x5dfd('0x6d'),_0x5dfd('0x67'),_0x4766c5[_0x5dfd('0x32')],client9004);})['then'](respondWithResult(_0x34357c,null))['catch'](handleError(_0x34357c,null));};exports[_0x5dfd('0x6e')]=function(_0x3dd887,_0x2ae1fe){_0x3dd887[_0x5dfd('0x32')][_0x5dfd('0x2f')]=_0x3dd887[_0x5dfd('0x6f')][_0x5dfd('0x70')];_0x3dd887[_0x5dfd('0x32')][_0x5dfd('0x71')]=_0x3dd887[_0x5dfd('0x6f')][_0x5dfd('0x72')];_0x3dd887[_0x5dfd('0x32')][_0x5dfd('0x39')]=_0x3dd887[_0x5dfd('0x6f')][_0x5dfd('0x73')];return db[_0x5dfd('0x74')]['create'](_0x3dd887['body'])[_0x5dfd('0x18')](respondWithResult(_0x2ae1fe,0xc9))[_0x5dfd('0x22')](handleError(_0x2ae1fe,null));};exports['attachmentDownload']=function(_0x1d8f5f,_0x5b75e4){return db[_0x5dfd('0x43')][_0x5dfd('0x4f')]({'where':{'id':_0x1d8f5f[_0x5dfd('0x40')]['id']},'raw':!![]})[_0x5dfd('0x18')](handleEntityNotFound(_0x5b75e4,null))[_0x5dfd('0x18')](function(_0x158a97){if(_0x158a97){if(_0x158a97[_0x5dfd('0x6b')]){return _0x5b75e4[_0x5dfd('0x24')](0x193)[_0x5dfd('0x26')]({'status':0x193,'message':_0x5dfd('0x75')});}return db['Attachment'][_0x5dfd('0x4f')]({'where':{'id':_0x1d8f5f['query'][_0x5dfd('0x76')]},'raw':!![]})[_0x5dfd('0x18')](handleEntityNotFound(_0x5b75e4,null));}})['then'](function(_0xc20fa7){if(_0xc20fa7){var _0x2df00c=_0xc20fa7['ChatOfflineMessageId']!==null;var _0x522d2e=path[_0x5dfd('0x77')](config[_0x5dfd('0x78')],_0x5dfd('0x79'));if(_0x2df00c){_0x522d2e=path[_0x5dfd('0x77')](_0x522d2e,'offline-chat/');}var _0x35d594=path['join'](_0x522d2e,_0xc20fa7[_0x5dfd('0x71')]);return _0x5b75e4['download'](_0x35d594);}})['catch'](handleError(_0x5b75e4,null));};exports['close']=function(_0x36c9fa,_0x2bb094){var _0x4118de=null;var _0x1f57a0=null;var _0x4be4c1=null;if(_0x36c9fa[_0x5dfd('0x32')]['id']){delete _0x36c9fa['body']['id'];}if(_0x36c9fa['body'][_0x5dfd('0x7a')]){_0x4be4c1=path[_0x5dfd('0x77')](config[_0x5dfd('0x78')],_0x5dfd('0x7b'),util[_0x5dfd('0x7c')](_0x5dfd('0x7d'),Date[_0x5dfd('0x7e')]()));_0x36c9fa[_0x5dfd('0x32')][_0x5dfd('0x7f')]=_0x4be4c1;}return db['ChatInteraction'][_0x5dfd('0x4d')]({'where':{'id':_0x36c9fa[_0x5dfd('0x40')]['id']},'include':[{'model':db[_0x5dfd('0x62')],'as':'Messages','include':[{'model':db['User'],'as':'User'}]}]})[_0x5dfd('0x18')](handleEntityNotFound(_0x2bb094,null))[_0x5dfd('0x18')](saveUpdates(_0x36c9fa['body'],null))[_0x5dfd('0x18')](function(_0x20d94f){if(_0x20d94f){_0x4118de=_0x20d94f;return db[_0x5dfd('0x50')][_0x5dfd('0x4d')]({'where':{'id':_0x4118de['ChatWebsiteId']}});}})[_0x5dfd('0x18')](function(_0x1abfac){if(_0x1abfac){_0x1f57a0=_0x1abfac;return db[_0x5dfd('0x65')]['find']({'where':{'id':_0x4118de[_0x5dfd('0x80')]}});}})[_0x5dfd('0x18')](function(_0x2bd84b){if(_0x2bd84b){if(_0x4be4c1){var _0x14eec1=null;for(var _0x45a598=0x1;_0x45a598<_0x4118de[_0x5dfd('0x81')][_0x5dfd('0x82')];++_0x45a598){_0x14eec1=_0x4118de['Messages'][_0x45a598];var _0xabe737=_0x14eec1[_0x5dfd('0x69')]?util[_0x5dfd('0x7c')]('%s%d',_0x1f57a0[_0x5dfd('0x83')],_0x14eec1[_0x5dfd('0x69')]):_0x5dfd('0x84');var _0x57c664=_0x36c9fa[_0x5dfd('0x32')][_0x5dfd('0x85')]||util[_0x5dfd('0x7c')]('%s%d',_0x5dfd('0x86'),_0x14eec1[_0x5dfd('0x80')]);switch(_0x1f57a0['agentIdentifier']){case _0x5dfd('0x87'):_0xabe737=_0x14eec1[_0x5dfd('0x69')]?util['format'](_0x5dfd('0x88'),_0x1f57a0[_0x5dfd('0x83')],_0x14eec1[_0x5dfd('0x69')]):_0x5dfd('0x84');break;case _0x5dfd('0x89'):_0xabe737=_0x14eec1[_0x5dfd('0x69')]?_0x14eec1['User'][_0x5dfd('0x8a')]||_0x14eec1[_0x5dfd('0x8b')][_0x5dfd('0x55')]:_0x5dfd('0x84');break;case _0x5dfd('0x8c'):_0xabe737=_0x14eec1[_0x5dfd('0x69')]?_0x14eec1[_0x5dfd('0x8b')][_0x5dfd('0x55')]:_0x5dfd('0x84');break;default:_0xabe737=_0x14eec1[_0x5dfd('0x69')]?util['format']('%s%d',_0x1f57a0[_0x5dfd('0x83')],_0x14eec1[_0x5dfd('0x69')]):_0x5dfd('0x84');}var _0x27e002=util[_0x5dfd('0x7c')](_0x5dfd('0x8d'),moment(_0x14eec1[_0x5dfd('0x8e')])[_0x5dfd('0x7c')](_0x5dfd('0x8f')),_0x14eec1[_0x5dfd('0x90')]==='in'?_0x57c664:_0xabe737,_0x14eec1[_0x5dfd('0x32')]);if(!_0x14eec1[_0x5dfd('0x91')]){fs[_0x5dfd('0x92')](_0x4be4c1,_0x27e002);}}return db['MailAccount'][_0x5dfd('0x4f')]({'where':{'service':!![]},'include':[{'model':db[_0x5dfd('0x93')],'as':_0x5dfd('0x94'),'raw':!![],'include':[{'model':db[_0x5dfd('0x95')],'as':_0x5dfd('0x95'),'raw':!![]}]}]});}}})[_0x5dfd('0x18')](function(_0xea5e0){if(!_0xea5e0||!_0xea5e0[_0x5dfd('0x94')]||!_0x36c9fa[_0x5dfd('0x32')])return _0x4118de;var _0xb8a62b=_0xea5e0['getSmtpOptions']();return respondWithRpcPromise(_0x5dfd('0x96'),'sendMail',{'account':_0xb8a62b,'message':{'from':util[_0x5dfd('0x7c')](_0x5dfd('0x97'),_0xea5e0[_0x5dfd('0x2f')],_0xea5e0[_0x5dfd('0x56')]||_0xea5e0[_0x5dfd('0x94')][_0x5dfd('0x3e')]),'to':_0x36c9fa[_0x5dfd('0x32')][_0x5dfd('0x7a')],'subject':_0x5dfd('0x98'),'text':util[_0x5dfd('0x7c')](_0x5dfd('0x99'),_0x36c9fa['body'][_0x5dfd('0x7a')]),'attachments':[{'path':_0x4be4c1}]}})[_0x5dfd('0x18')](function(){return _0x4118de;})[_0x5dfd('0x22')](function(_0x421991){logger[_0x5dfd('0x1f')](_0x421991);});})[_0x5dfd('0x18')](respondWithStatusCode(_0x2bb094,0xc8))[_0x5dfd('0x22')](handleError(_0x2bb094,null));};exports[_0x5dfd('0x9a')]=function(_0x1d8b85,_0x2e4360){return db[_0x5dfd('0x62')][_0x5dfd('0x4d')]({'where':{'id':_0x1d8b85[_0x5dfd('0x40')]['id']}})['then'](handleEntityNotFound(_0x2e4360,null))[_0x5dfd('0x18')](function(_0x2fc5f6){if(_0x2fc5f6){return _0x2fc5f6[_0x5dfd('0x9a')](_0x1d8b85[_0x5dfd('0x32')][_0x5dfd('0x9b')],_[_0x5dfd('0x9c')](_0x1d8b85[_0x5dfd('0x32')],[_0x5dfd('0x9b'),'id'])||{});}})[_0x5dfd('0x18')](respondWithResult(_0x2e4360,null))[_0x5dfd('0x22')](handleError(_0x2e4360,null));};exports['getMessages']=function(_0x16d6e8,_0x29b226){var _0x253810={'raw':![],'where':{}};var _0x9bc8a2={};var _0x4fe0a7={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x5dfd('0x4f')]({'where':{'id':_0x16d6e8[_0x5dfd('0x40')]['id']}})[_0x5dfd('0x18')](handleEntityNotFound(_0x29b226,null))[_0x5dfd('0x18')](function(_0x340282){if(_0x340282){_0x9bc8a2[_0x5dfd('0x41')]=_[_0x5dfd('0x42')](db[_0x5dfd('0x62')][_0x5dfd('0x37')]);_0x9bc8a2['query']=_[_0x5dfd('0x42')](_0x16d6e8[_0x5dfd('0x3d')]);_0x9bc8a2['filters']=_[_0x5dfd('0x45')](_0x9bc8a2[_0x5dfd('0x41')],_0x9bc8a2[_0x5dfd('0x3d')]);_0x253810['attributes']=_['intersection'](_0x9bc8a2[_0x5dfd('0x41')],qs[_0x5dfd('0x46')](_0x16d6e8[_0x5dfd('0x3d')]['fields']));_0x253810['attributes']=_0x253810['attributes'][_0x5dfd('0x82')]?_0x253810['attributes']:_0x9bc8a2[_0x5dfd('0x41')];if(!_0x16d6e8['query'][_0x5dfd('0x9d')](_0x5dfd('0x9e'))){_0x253810[_0x5dfd('0x29')]=qs[_0x5dfd('0x29')](_0x16d6e8[_0x5dfd('0x3d')][_0x5dfd('0x29')]);_0x253810[_0x5dfd('0x27')]=qs[_0x5dfd('0x27')](_0x16d6e8[_0x5dfd('0x3d')][_0x5dfd('0x27')]);}_0x253810['order']=qs[_0x5dfd('0x9f')](_0x16d6e8[_0x5dfd('0x3d')]['sort']);_0x253810[_0x5dfd('0xa0')]=qs['filters'](_[_0x5dfd('0xa1')](_0x16d6e8[_0x5dfd('0x3d')],_0x9bc8a2[_0x5dfd('0x44')]));_0x253810[_0x5dfd('0xa0')]['ChatInteractionId']=_0x340282['id'];if(_0x16d6e8[_0x5dfd('0x3d')][_0x5dfd('0xa2')]){_0x253810['where']=_[_0x5dfd('0x31')](_0x253810[_0x5dfd('0xa0')],{'$or':_[_0x5dfd('0x36')](_0x253810[_0x5dfd('0x47')],function(_0x45e502){var _0xddded4={};_0xddded4[_0x45e502]={'$like':'%'+_0x16d6e8[_0x5dfd('0x3d')][_0x5dfd('0xa2')]+'%'};return _0xddded4;})});}if(_0x16d6e8[_0x5dfd('0x3d')][_0x5dfd('0xa3')]){var _0x5be9a2=_0x16d6e8[_0x5dfd('0x3d')][_0x5dfd('0xa3')][_0x5dfd('0xa4')](',');var _0x4777f8={};_0x4777f8[_0x5be9a2[0x0]]={'$gte':moment(_0x5be9a2[0x1])[_0x5dfd('0x7c')](_0x5dfd('0xa5'))};_0x253810[_0x5dfd('0xa0')]=_[_0x5dfd('0x31')](_0x253810[_0x5dfd('0xa0')],_0x4777f8);}_0x253810=_[_0x5dfd('0x31')]({},_0x253810,_0x16d6e8[_0x5dfd('0x4a')]);return db['ChatMessage']['count']({'where':_0x253810['where']})[_0x5dfd('0x18')](function(_0x55051b){_0x4fe0a7[_0x5dfd('0x2a')]=_0x55051b;if(_0x16d6e8[_0x5dfd('0x3d')][_0x5dfd('0x48')]){_0x253810['include']=[{'all':!![]}];}return db[_0x5dfd('0x62')][_0x5dfd('0x3b')](_0x253810);})[_0x5dfd('0x18')](function(_0x4c2e7b){_0x4fe0a7['rows']=_0x4c2e7b;return _0x4fe0a7;});}})[_0x5dfd('0x18')](respondWithFilteredResult(_0x29b226,_0x253810))['catch'](handleError(_0x29b226,null));};exports[_0x5dfd('0xa6')]=function(_0x460008,_0x28bd3b){var _0x204d36={'where':{}},_0x551579={},_0x13b2a1={'count':0x0,'rows':[]};return db[_0x5dfd('0x43')][_0x5dfd('0x4f')]({'where':{'id':_0x460008[_0x5dfd('0x40')]['id']}})[_0x5dfd('0x18')](handleEntityNotFound(_0x28bd3b,null))[_0x5dfd('0x18')](function(_0x21c7f1){if(_0x21c7f1){_0x551579[_0x5dfd('0x41')]=_[_0x5dfd('0x42')](db[_0x5dfd('0x62')][_0x5dfd('0x37')]);_0x551579[_0x5dfd('0x3d')]=_[_0x5dfd('0x42')](_0x460008[_0x5dfd('0x3d')]);_0x551579[_0x5dfd('0x44')]=_[_0x5dfd('0x45')](_0x551579[_0x5dfd('0x41')],_0x551579[_0x5dfd('0x3d')]);_0x204d36[_0x5dfd('0x47')]=_[_0x5dfd('0x45')](_0x551579[_0x5dfd('0x41')],qs['fields'](_0x460008[_0x5dfd('0x3d')][_0x5dfd('0x46')]));_0x204d36[_0x5dfd('0x47')]=_0x204d36[_0x5dfd('0x47')][_0x5dfd('0x82')]?_0x204d36[_0x5dfd('0x47')]:_0x551579['model'];if(!_0x460008[_0x5dfd('0x3d')]['hasOwnProperty']('nolimit')){_0x204d36[_0x5dfd('0x29')]=qs[_0x5dfd('0x29')](_0x460008[_0x5dfd('0x3d')][_0x5dfd('0x29')]);_0x204d36[_0x5dfd('0x27')]=qs['offset'](_0x460008[_0x5dfd('0x3d')][_0x5dfd('0x27')]);}_0x204d36[_0x5dfd('0xa7')]=qs[_0x5dfd('0x9f')](_0x460008[_0x5dfd('0x3d')][_0x5dfd('0x9f')]);_0x204d36[_0x5dfd('0xa0')]=qs['filters'](_[_0x5dfd('0xa1')](_0x460008[_0x5dfd('0x3d')],_0x551579[_0x5dfd('0x44')]));_0x204d36['where'][_0x5dfd('0xa8')]=_0x21c7f1['id'];if(_0x460008[_0x5dfd('0x3d')][_0x5dfd('0xa2')]){_0x204d36['where']=_[_0x5dfd('0x31')](_0x204d36[_0x5dfd('0xa0')],{'$or':_['map'](_0x204d36[_0x5dfd('0x47')],function(_0x14b098){var _0xe07a6f={};_0xe07a6f[_0x14b098]={'$like':'%'+_0x460008[_0x5dfd('0x3d')]['filter']+'%'};return _0xe07a6f;})});}_0x204d36['where'][_0x5dfd('0x91')]=![];if(_0x460008[_0x5dfd('0x3d')]['id']){_0x204d36[_0x5dfd('0xa0')]['id']={'$gt':_0x460008[_0x5dfd('0x3d')]['id']};}_0x204d36=_['merge']({},_0x204d36,_0x460008[_0x5dfd('0x4a')]);return db[_0x5dfd('0x62')][_0x5dfd('0x2a')]({'where':_0x204d36[_0x5dfd('0xa0')]})[_0x5dfd('0x18')](function(_0x1b6518){_0x13b2a1['count']=_0x1b6518;_0x204d36[_0x5dfd('0x49')]=[];if(_0x460008['query'][_0x5dfd('0xa9')]){_0x204d36['include'][_0x5dfd('0xaa')]({'model':db[_0x5dfd('0x8b')],'as':_0x5dfd('0x8b'),'attributes':['id',_0x5dfd('0x55'),_0x5dfd('0x8a')]});}if(_0x460008[_0x5dfd('0x3d')][_0x5dfd('0x48')]){_0x204d36[_0x5dfd('0x49')]=[{'all':!![]}];}return db[_0x5dfd('0x62')]['findAll'](_0x204d36);})[_0x5dfd('0x18')](function(_0x507f08){_0x13b2a1[_0x5dfd('0xab')]=_0x507f08;return _0x13b2a1;});}})[_0x5dfd('0x18')](respondWithFilteredResult(_0x28bd3b,_0x204d36))['catch'](handleError(_0x28bd3b,null));};exports['addTags']=function(_0x4a180b,_0x4ceb2e){return db[_0x5dfd('0x43')]['find']({'where':{'id':_0x4a180b[_0x5dfd('0x40')]['id']}})[_0x5dfd('0x18')](handleEntityNotFound(_0x4ceb2e,null))[_0x5dfd('0x18')](function(_0x3f23fd){if(_0x3f23fd){return _0x3f23fd[_0x5dfd('0xac')](_0x4a180b[_0x5dfd('0x32')][_0x5dfd('0x9b')],_[_0x5dfd('0x9c')](_0x4a180b['body'],[_0x5dfd('0x9b'),'id'])||{})[_0x5dfd('0xad')](function(){return db[_0x5dfd('0xae')]['findAll']({'attributes':['id',_0x5dfd('0x2f'),_0x5dfd('0xaf')],'where':{'id':_0x4a180b['body'][_0x5dfd('0x9b')]}});})[_0x5dfd('0x18')](function(_0x5c600c){socket[_0x5dfd('0xb0')](_0x5dfd('0xb1'),{'id':Number(_0x4a180b[_0x5dfd('0x40')]['id']),'tags':_0x5c600c||[]});return{'id':Number(_0x4a180b[_0x5dfd('0x40')]['id']),'tags':_0x5c600c||[]};});}})[_0x5dfd('0x18')](respondWithResult(_0x4ceb2e,null))[_0x5dfd('0x22')](handleError(_0x4ceb2e,null));};exports[_0x5dfd('0xb2')]=function(_0xc7a87d,_0x2398e4){return db['ChatInteraction'][_0x5dfd('0x4d')]({'where':{'id':_0xc7a87d[_0x5dfd('0x40')]['id']}})[_0x5dfd('0x18')](handleEntityNotFound(_0x2398e4,null))['then'](function(_0x11a262){if(_0x11a262){return _0x11a262['removeTags'](_0xc7a87d[_0x5dfd('0x3d')][_0x5dfd('0x9b')]);}})[_0x5dfd('0x18')](respondWithStatusCode(_0x2398e4,null))['catch'](handleError(_0x2398e4,null));};exports[_0x5dfd('0xb3')]=function(_0x26ea70,_0x5984c5){var _0x4481f5=moment()['unix']()[_0x5dfd('0xb4')]();var _0x179265=path[_0x5dfd('0x77')](config['root'],'server',_0x5dfd('0xb5'),_0x5dfd('0xb6'));var _0x493023=path['join'](config['root'],'server','files','attachments');var _0x32ea28=path[_0x5dfd('0x77')](_0x179265,_0x4481f5);var _0x303f79=util[_0x5dfd('0x7c')](_0x5dfd('0xb7'),_0x26ea70[_0x5dfd('0x40')]['id'],_0x4481f5);var _0xaec36b=path['join'](_0x179265,_0x303f79);var _0x447e42=[];_0x447e42[_0x5dfd('0xaa')]({'model':db[_0x5dfd('0x8b')],'as':_0x5dfd('0x8b'),'attributes':['id','fullname'],'raw':!![]});_0x447e42['push']({'model':db['CmContact'],'as':_0x5dfd('0x66'),'attributes':['id','firstName',_0x5dfd('0xb8')],'raw':!![]});if(_0x26ea70[_0x5dfd('0x3d')][_0x5dfd('0xb9')]){_0x447e42['push']({'model':db['Attachment'],'as':_0x5dfd('0x74'),'raw':!![]});}var _0xf8fa16=[{'model':db[_0x5dfd('0x62')],'as':'Messages','attributes':['id',_0x5dfd('0x32'),_0x5dfd('0x8e'),'direction',_0x5dfd('0x91'),_0x5dfd('0xba')],'include':_0x447e42}];_0xf8fa16[_0x5dfd('0xaa')]({'model':db[_0x5dfd('0x50')],'as':_0x5dfd('0xbb'),'attributes':['id',_0x5dfd('0x2f')]});_0xf8fa16['push']({'model':db[_0x5dfd('0x8b')],'as':'Owner','attributes':['id',_0x5dfd('0x55')]});return db[_0x5dfd('0x43')][_0x5dfd('0x4d')]({'where':{'id':_0x26ea70[_0x5dfd('0x40')]['id']},'include':_0xf8fa16})[_0x5dfd('0x18')](handleEntityNotFound(_0x5984c5,null))['then'](function(_0x2f3704){if(_0x2f3704){var _0x2af6d0=_0x2f3704['get']({'plain':!![]});fs[_0x5dfd('0xbc')](_0x32ea28);var _0x31b0d7={'channel':_0x5dfd('0xbd'),'account':_0x2af6d0[_0x5dfd('0xbb')]['name'],'agent':_0x2af6d0['Owner']?_0x2af6d0['Owner']['fullname']:'N.A.','createdAt':moment(_0x2af6d0['createdAt'])[_0x5dfd('0x7c')](_0x5dfd('0xa5'))[_0x5dfd('0xb4')](),'closedAt':_0x2af6d0[_0x5dfd('0x6b')]?moment(_0x2af6d0['closedAt'])[_0x5dfd('0x7c')](_0x5dfd('0xa5'))[_0x5dfd('0xb4')]():'','disposition':_0x2af6d0['disposition'],'chatInfo':{'browser':_0x2af6d0[_0x5dfd('0xbe')],'os':_0x2af6d0[_0x5dfd('0xbf')],'referer':_0x2af6d0[_0x5dfd('0xc0')],'customerIp':_0x2af6d0['customerIp'],'customerPort':_0x2af6d0[_0x5dfd('0xc1')]?_0x2af6d0[_0x5dfd('0xc1')]:_0x5dfd('0xc2')},'messages':_(_0x2af6d0[_0x5dfd('0x81')])[_0x5dfd('0xc3')]()[_0x5dfd('0xa2')]({'secret':![]})['map'](function(_0xacb12a){if(_0xacb12a['Attachment']){var _0x7df070=path[_0x5dfd('0x77')](_0x493023,_0xacb12a[_0x5dfd('0x74')][_0x5dfd('0x71')]);if(fs[_0x5dfd('0xc4')](_0x7df070)){fs['createReadStream'](_0x7df070)['pipe'](fs[_0x5dfd('0xc5')](path[_0x5dfd('0x77')](_0x32ea28,_0xacb12a[_0x5dfd('0x74')][_0x5dfd('0x71')])));}}return{'date':moment(_0xacb12a[_0x5dfd('0x8e')])[_0x5dfd('0x7c')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0xacb12a[_0x5dfd('0x90')]===_0x5dfd('0x61')?_0xacb12a[_0x5dfd('0x8b')]?_0xacb12a[_0x5dfd('0x8b')]['fullname']:'System':_0xacb12a[_0x5dfd('0x66')][_0x5dfd('0xc6')]+(_0xacb12a[_0x5dfd('0x66')][_0x5dfd('0xb8')]?'\x20'+_0xacb12a[_0x5dfd('0x66')]['lastName']:''),'body':_0xacb12a['Attachment']?_0xacb12a[_0x5dfd('0x74')][_0x5dfd('0x71')]:_0xacb12a[_0x5dfd('0x32')],'direction':_0xacb12a['direction']===_0x5dfd('0x61')?'A':'C','secret':_0xacb12a[_0x5dfd('0x91')],'read':_0xacb12a[_0x5dfd('0xba')],'attachment':_0xacb12a[_0x5dfd('0x74')]};})[_0x5dfd('0xc7')]()};return ejs['renderFile'](path[_0x5dfd('0x77')](config['root'],_0x5dfd('0xc8'),_0x5dfd('0xc9'),'downloadInteraction.ejs'),{'interaction':_0x31b0d7})[_0x5dfd('0x18')](function(_0x134519){var _0x44e4b0=path[_0x5dfd('0x77')](_0x32ea28,_0x5dfd('0xca')+_0x2af6d0['id']+'-'+_0x4481f5+_0x5dfd('0xcb'));var _0x539313={'path':_0x44e4b0,'channel':_0x5dfd('0xbd'),'interactionId':_0x2af6d0['id']};return pdf[_0x5dfd('0xcc')](_0x134519,_0x539313);})[_0x5dfd('0x18')](function(){return new Promise(function(_0x2a8266,_0x5a7422){zipdir(_0x32ea28,{'saveTo':_0xaec36b},function(_0x507fa2,_0x4ce325){if(_0x507fa2)return _0x5a7422(_0x507fa2);return _0x2a8266(_0x4ce325);});})[_0x5dfd('0x18')](function(){return new BPromise(function(_0xda5f61,_0xb60d91){rimraf(_0x32ea28,function(_0x2960bc){if(_0x2960bc)_0xb60d91(_0x2960bc);return _0xda5f61();});});})[_0x5dfd('0x18')](function(){return _0x5984c5[_0x5dfd('0xb3')](_0xaec36b,_0x303f79,function(_0x381941){if(_0x381941){logger[_0x5dfd('0x1f')]('err',_0x381941);}else{fs[_0x5dfd('0xcd')](_0xaec36b);}});});});}else{return _0x5984c5[_0x5dfd('0x23')](0xc8);}})['catch'](handleError(_0x5984c5,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 4fd4117..c730afb 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 _0xc53e=['ChatMessage','setMaxListeners','update','remove','getUsers','setDataValue','Users','map','findAll','unreadMessages','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x490f5e,_0x3325c3){var _0x175c8b=function(_0x4f8374){while(--_0x4f8374){_0x490f5e['push'](_0x490f5e['shift']());}};_0x175c8b(++_0x3325c3);}(_0xc53e,0x86));var _0xec53=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xc53e[_0x481bf7];return _0x461787;};'use strict';var EventEmitter=require(_0xec53('0x0'));var ChatInteraction=require(_0xec53('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0xec53('0x1'))['db'][_0xec53('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xec53('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xec53('0x4'),'afterDestroy':_0xec53('0x5')};function emitEvent(_0x4c177c){return function(_0x5d41d6,_0x46ebfb,_0x1cfe17){_0x5d41d6[_0xec53('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x116904){_0x5d41d6[_0xec53('0x7')](_0xec53('0x8'),_0x116904[_0xec53('0x9')](function(_0x26f136){return{'id':_0x26f136['id']};}));return ChatMessage[_0xec53('0xa')]({'where':{'ChatInteractionId':_0x5d41d6['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x552f2c){_0x5d41d6['setDataValue'](_0xec53('0xb'),_0x552f2c[_0xec53('0xc')]);ChatInteractionEvents[_0xec53('0xd')](_0x4c177c+':'+_0x5d41d6['id'],_0x5d41d6);ChatInteractionEvents['emit'](_0x4c177c,_0x5d41d6);_0x1cfe17(null);})['catch'](_0x1cfe17(null));};}for(var e in events){if(events[_0xec53('0xe')](e)){var event=events[e];ChatInteraction[_0xec53('0xf')](e,emitEvent(event));}}module[_0xec53('0x10')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xec1a=['findAll','then','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','Users','map'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0xec1a,0xdb));var _0xaec1=function(_0x59e9d8,_0x5e9850){_0x59e9d8=_0x59e9d8-0x0;var _0x33ebc9=_0xec1a[_0x59e9d8];return _0x33ebc9;};'use strict';var EventEmitter=require(_0xaec1('0x0'));var ChatInteraction=require(_0xaec1('0x1'))['db'][_0xaec1('0x2')];var ChatMessage=require(_0xaec1('0x1'))['db'][_0xaec1('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xaec1('0x4')](0x0);var events={'afterCreate':_0xaec1('0x5'),'afterUpdate':_0xaec1('0x6'),'afterDestroy':'remove'};function emitEvent(_0x1e785d){return function(_0x4d2b66,_0x3a3648,_0x2948fd){_0x4d2b66['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x1ea22b){_0x4d2b66['setDataValue'](_0xaec1('0x7'),_0x1ea22b[_0xaec1('0x8')](function(_0x282834){return{'id':_0x282834['id']};}));return ChatMessage[_0xaec1('0x9')]({'where':{'ChatInteractionId':_0x4d2b66['id'],'direction':'in','read':![]},'raw':!![]});})[_0xaec1('0xa')](function(_0x3af653){_0x4d2b66[_0xaec1('0xb')](_0xaec1('0xc'),_0x3af653[_0xaec1('0xd')]);ChatInteractionEvents[_0xaec1('0xe')](_0x1e785d+':'+_0x4d2b66['id'],_0x4d2b66);ChatInteractionEvents[_0xaec1('0xe')](_0x1e785d,_0x4d2b66);_0x2948fd(null);})[_0xaec1('0xf')](_0x2948fd(null));};}for(var e in events){if(events[_0xaec1('0x10')](e)){var event=events[e];ChatInteraction[_0xaec1('0x11')](e,emitEvent(event));}}module[_0xaec1('0x12')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index af53f9f..548e867 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 _0xa0b2=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','ChatInteraction','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xa0b2,0x18e));var _0x2a0b=function(_0x156a0d,_0x3946ce){_0x156a0d=_0x156a0d-0x0;var _0x98a9ba=_0xa0b2[_0x156a0d];return _0x98a9ba;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2a0b('0x0'))(_0x2a0b('0x1'));var moment=require(_0x2a0b('0x2'));var BPromise=require(_0x2a0b('0x3'));var rp=require(_0x2a0b('0x4'));var fs=require('fs');var path=require(_0x2a0b('0x5'));var rimraf=require(_0x2a0b('0x6'));var config=require(_0x2a0b('0x7'));var attributes=require(_0x2a0b('0x8'));module['exports']=function(_0x33cffd,_0x3f0fd4){return _0x33cffd['define'](_0x2a0b('0x9'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x80a02d,_0x48a5ff,_0x32bb39){if(_0x80a02d['changed'](_0x2a0b('0xa'))){_0x80a02d[_0x2a0b('0xb')]=moment()[_0x2a0b('0xc')](_0x2a0b('0xd'));}_0x32bb39(null,_0x80a02d);}},'charset':_0x2a0b('0xe'),'collate':_0x2a0b('0xf')});};
\ No newline at end of file
+var _0xa11b=['request-promise','path','./chatInteraction.attributes','exports','define','ChatInteraction','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','util','../../config/logger','api','moment'];(function(_0x2612dd,_0x1b3ed){var _0x15af02=function(_0x41b8cc){while(--_0x41b8cc){_0x2612dd['push'](_0x2612dd['shift']());}};_0x15af02(++_0x1b3ed);}(_0xa11b,0xbf));var _0xba11=function(_0x391ff0,_0x46db5d){_0x391ff0=_0x391ff0-0x0;var _0x33fd7b=_0xa11b[_0x391ff0];return _0x33fd7b;};'use strict';var _=require('lodash');var util=require(_0xba11('0x0'));var logger=require(_0xba11('0x1'))(_0xba11('0x2'));var moment=require(_0xba11('0x3'));var BPromise=require('bluebird');var rp=require(_0xba11('0x4'));var fs=require('fs');var path=require(_0xba11('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xba11('0x6'));module[_0xba11('0x7')]=function(_0x2619e7,_0x616bcb){return _0x2619e7[_0xba11('0x8')](_0xba11('0x9'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2db92e,_0x106568,_0x14db16){if(_0x2db92e[_0xba11('0xa')](_0xba11('0xb'))){_0x2db92e['closedAt']=moment()[_0xba11('0xc')](_0xba11('0xd'));}_0x14db16(null,_0x2db92e);}},'charset':'utf8mb4','collate':_0xba11('0xe')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 79de01e..fc052f3 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 _0xb44c=['stringify','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','where','attributes','limit','find','addTags','ids','spread','AddTags','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s'];(function(_0x4988ce,_0x27a3a7){var _0x786381=function(_0xd80ab7){while(--_0xd80ab7){_0x4988ce['push'](_0x4988ce['shift']());}};_0x786381(++_0x27a3a7);}(_0xb44c,0x1b7));var _0xcb44=function(_0x1d1963,_0x32cc0e){_0x1d1963=_0x1d1963-0x0;var _0x3f58bb=_0xb44c[_0x1d1963];return _0x3f58bb;};'use strict';var _=require(_0xcb44('0x0'));var util=require(_0xcb44('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcb44('0x2'));var fs=require('fs');var Redis=require(_0xcb44('0x3'));var db=require(_0xcb44('0x4'))['db'];var utils=require(_0xcb44('0x5'));var logger=require('../../config/logger')(_0xcb44('0x6'));var config=require(_0xcb44('0x7'));var jayson=require(_0xcb44('0x8'));var client=jayson[_0xcb44('0x9')]['http']({'port':0x232a});config[_0xcb44('0xa')]=_[_0xcb44('0xb')](config['redis'],{'host':_0xcb44('0xc'),'port':0x18eb});var socket=require(_0xcb44('0xd'))(new Redis(config[_0xcb44('0xa')]));require(_0xcb44('0xe'))[_0xcb44('0xf')](socket);function respondWithRpcPromise(_0x17ef57,_0x56ee9e,_0x4fe99d){return new BPromise(function(_0xc84ab,_0x51fe3a){return client[_0xcb44('0x10')](_0x17ef57,_0x4fe99d)[_0xcb44('0x11')](function(_0x5668a6){logger[_0xcb44('0x12')](_0xcb44('0x13'),_0x56ee9e,_0xcb44('0x14'));logger[_0xcb44('0x15')](_0xcb44('0x16'),_0x56ee9e,_0xcb44('0x14'),JSON[_0xcb44('0x17')](_0x5668a6));if(_0x5668a6['error']){if(_0x5668a6[_0xcb44('0x18')][_0xcb44('0x19')]===0x1f4){logger[_0xcb44('0x18')](_0xcb44('0x13'),_0x56ee9e,_0x5668a6[_0xcb44('0x18')]['message']);return _0x51fe3a(_0x5668a6[_0xcb44('0x18')]['message']);}logger[_0xcb44('0x18')](_0xcb44('0x13'),_0x56ee9e,_0x5668a6[_0xcb44('0x18')][_0xcb44('0x1a')]);return _0xc84ab(_0x5668a6['error'][_0xcb44('0x1a')]);}else{logger[_0xcb44('0x12')](_0xcb44('0x13'),_0x56ee9e,_0xcb44('0x14'));_0xc84ab(_0x5668a6[_0xcb44('0x1b')][_0xcb44('0x1a')]);}})[_0xcb44('0x1c')](function(_0xcdb260){logger[_0xcb44('0x18')](_0xcb44('0x13'),_0x56ee9e,_0xcdb260);_0x51fe3a(_0xcdb260);});});}exports[_0xcb44('0x1d')]=function(_0x21016f){var _0x191d31=this;return new Promise(function(_0x26791b,_0x3fb7a4){return db[_0xcb44('0x1e')][_0xcb44('0x1f')](_0x21016f[_0xcb44('0x20')],{'raw':_0x21016f[_0xcb44('0x21')]?_0x21016f[_0xcb44('0x21')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21016f[_0xcb44('0x21')]?_0x21016f[_0xcb44('0x21')][_0xcb44('0x22')]||null:null,'attributes':_0x21016f[_0xcb44('0x21')]?_0x21016f['options'][_0xcb44('0x23')]||null:null,'limit':_0x21016f[_0xcb44('0x21')]?_0x21016f['options'][_0xcb44('0x24')]||null:null})['then'](function(_0x1cbc5a){logger[_0xcb44('0x12')](_0xcb44('0x1d'),_0x21016f);logger[_0xcb44('0x15')](_0xcb44('0x1d'),_0x21016f,JSON[_0xcb44('0x17')](_0x1cbc5a));_0x26791b(_0x1cbc5a);})[_0xcb44('0x1c')](function(_0x31c7b1){logger[_0xcb44('0x18')]('UpdateChatInteraction',_0x31c7b1[_0xcb44('0x1a')],_0x21016f);_0x3fb7a4(_0x191d31[_0xcb44('0x18')](0x1f4,_0x31c7b1['message']));});});};exports['AddTagsToChatInteraction']=function(_0x43ede3){return new Promise(function(_0x58565c,_0x5b71c3){return db['ChatInteraction'][_0xcb44('0x25')]({'where':_0x43ede3['options']?_0x43ede3[_0xcb44('0x21')][_0xcb44('0x22')]||null:null})[_0xcb44('0x11')](function(_0x10da34){if(_0x10da34){return _0x10da34[_0xcb44('0x26')](_0x43ede3[_0xcb44('0x20')][_0xcb44('0x27')],_['omit'](_0x43ede3[_0xcb44('0x20')],[_0xcb44('0x27'),'id'])||{});}})[_0xcb44('0x28')](function(_0x1cb55a){logger[_0xcb44('0x12')](_0xcb44('0x29'),_0x43ede3);logger['debug'](_0xcb44('0x29'),_0x43ede3,JSON[_0xcb44('0x17')](_0x1cb55a));_0x58565c(_0x1cb55a);})[_0xcb44('0x1c')](function(_0x1980b7){logger[_0xcb44('0x18')]('AddTags',_0x1980b7[_0xcb44('0x1a')],_0x43ede3);_0x5b71c3(_this[_0xcb44('0x18')](0x1f4,_0x1980b7['message']));});});};
\ No newline at end of file
+var _0x0814=['where','attributes','AddTagsToChatInteraction','find','addTags','ids','AddTags','lodash','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw'];(function(_0x17a23d,_0x4b6c0c){var _0x531cec=function(_0x2c10f4){while(--_0x2c10f4){_0x17a23d['push'](_0x17a23d['shift']());}};_0x531cec(++_0x4b6c0c);}(_0x0814,0x15d));var _0x4081=function(_0x41289e,_0x13bef1){_0x41289e=_0x41289e-0x0;var _0x89a172=_0x0814[_0x41289e];return _0x89a172;};'use strict';var _=require(_0x4081('0x0'));var util=require('util');var moment=require(_0x4081('0x1'));var BPromise=require('bluebird');var rs=require(_0x4081('0x2'));var fs=require('fs');var Redis=require(_0x4081('0x3'));var db=require(_0x4081('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4081('0x5'));var config=require(_0x4081('0x6'));var jayson=require(_0x4081('0x7'));var client=jayson[_0x4081('0x8')][_0x4081('0x9')]({'port':0x232a});config[_0x4081('0xa')]=_['defaults'](config[_0x4081('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x4081('0xb'))(new Redis(config[_0x4081('0xa')]));require(_0x4081('0xc'))[_0x4081('0xd')](socket);function respondWithRpcPromise(_0x8584e8,_0x286a05,_0x1340c2){return new BPromise(function(_0x27023d,_0x2ea04a){return client['request'](_0x8584e8,_0x1340c2)[_0x4081('0xe')](function(_0x121ff6){logger[_0x4081('0xf')](_0x4081('0x10'),_0x286a05,'request\x20sent');logger[_0x4081('0x11')](_0x4081('0x12'),_0x286a05,_0x4081('0x13'),JSON[_0x4081('0x14')](_0x121ff6));if(_0x121ff6['error']){if(_0x121ff6['error']['code']===0x1f4){logger[_0x4081('0x15')](_0x4081('0x10'),_0x286a05,_0x121ff6['error'][_0x4081('0x16')]);return _0x2ea04a(_0x121ff6[_0x4081('0x15')]['message']);}logger[_0x4081('0x15')](_0x4081('0x10'),_0x286a05,_0x121ff6[_0x4081('0x15')][_0x4081('0x16')]);return _0x27023d(_0x121ff6[_0x4081('0x15')]['message']);}else{logger[_0x4081('0xf')](_0x4081('0x10'),_0x286a05,'request\x20sent');_0x27023d(_0x121ff6[_0x4081('0x17')]['message']);}})[_0x4081('0x18')](function(_0x17541f){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x286a05,_0x17541f);_0x2ea04a(_0x17541f);});});}exports[_0x4081('0x19')]=function(_0x34cfcc){var _0x2f64e7=this;return new Promise(function(_0x3f145e,_0x5f18c4){return db[_0x4081('0x1a')][_0x4081('0x1b')](_0x34cfcc[_0x4081('0x1c')],{'raw':_0x34cfcc[_0x4081('0x1d')]?_0x34cfcc['options'][_0x4081('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34cfcc[_0x4081('0x1d')]?_0x34cfcc[_0x4081('0x1d')][_0x4081('0x1f')]||null:null,'attributes':_0x34cfcc['options']?_0x34cfcc[_0x4081('0x1d')][_0x4081('0x20')]||null:null,'limit':_0x34cfcc['options']?_0x34cfcc[_0x4081('0x1d')]['limit']||null:null})[_0x4081('0xe')](function(_0x45e92d){logger[_0x4081('0xf')](_0x4081('0x19'),_0x34cfcc);logger[_0x4081('0x11')](_0x4081('0x19'),_0x34cfcc,JSON[_0x4081('0x14')](_0x45e92d));_0x3f145e(_0x45e92d);})[_0x4081('0x18')](function(_0x44d6de){logger['error'](_0x4081('0x19'),_0x44d6de[_0x4081('0x16')],_0x34cfcc);_0x5f18c4(_0x2f64e7[_0x4081('0x15')](0x1f4,_0x44d6de['message']));});});};exports[_0x4081('0x21')]=function(_0x194105){return new Promise(function(_0x15ee6c,_0xa90a85){return db[_0x4081('0x1a')][_0x4081('0x22')]({'where':_0x194105[_0x4081('0x1d')]?_0x194105[_0x4081('0x1d')]['where']||null:null})['then'](function(_0x3b8ca4){if(_0x3b8ca4){return _0x3b8ca4[_0x4081('0x23')](_0x194105[_0x4081('0x1c')][_0x4081('0x24')],_['omit'](_0x194105['body'],[_0x4081('0x24'),'id'])||{});}})['spread'](function(_0xec2384){logger[_0x4081('0xf')](_0x4081('0x25'),_0x194105);logger['debug']('AddTags',_0x194105,JSON[_0x4081('0x14')](_0xec2384));_0x15ee6c(_0xec2384);})[_0x4081('0x18')](function(_0x38e89c){logger[_0x4081('0x15')](_0x4081('0x25'),_0x38e89c[_0x4081('0x16')],_0x194105);_0xa90a85(_this[_0x4081('0x15')](0x1f4,_0x38e89c[_0x4081('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index f4c741a..9468218 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 _0x4276=['removeListener','register','./chatInteraction.events','save','remove','emit'];(function(_0x1f4f67,_0x4565b3){var _0x2d2f1e=function(_0x2a9dfd){while(--_0x2a9dfd){_0x1f4f67['push'](_0x1f4f67['shift']());}};_0x2d2f1e(++_0x4565b3);}(_0x4276,0x98));var _0x6427=function(_0x333106,_0x1da13a){_0x333106=_0x333106-0x0;var _0x3bc0d5=_0x4276[_0x333106];return _0x3bc0d5;};'use strict';var ChatInteractionEvents=require(_0x6427('0x0'));var events=[_0x6427('0x1'),_0x6427('0x2'),'update'];function createListener(_0x1f2eeb,_0x317abe){return function(_0x1267bf){_0x317abe[_0x6427('0x3')](_0x1f2eeb,_0x1267bf);};}function removeListener(_0x872732,_0x11dfb6){return function(){ChatInteractionEvents[_0x6427('0x4')](_0x872732,_0x11dfb6);};}exports[_0x6427('0x5')]=function(_0x42c357){for(var _0x4246a3=0x0,_0x45721d=events['length'];_0x4246a3<_0x45721d;_0x4246a3++){var _0x2a8a30=events[_0x4246a3];var _0x4982bf=createListener('chatInteraction:'+_0x2a8a30,_0x42c357);ChatInteractionEvents['on'](_0x2a8a30,_0x4982bf);}};
\ No newline at end of file
+var _0xab4b=['length','chatInteraction:','save','emit','removeListener'];(function(_0x39c931,_0xce322a){var _0x4d1dbb=function(_0x31db4e){while(--_0x31db4e){_0x39c931['push'](_0x39c931['shift']());}};_0x4d1dbb(++_0xce322a);}(_0xab4b,0x156));var _0xbab4=function(_0x257841,_0x389b4d){_0x257841=_0x257841-0x0;var _0x1b87ed=_0xab4b[_0x257841];return _0x1b87ed;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0xbab4('0x0'),'remove','update'];function createListener(_0x28fe4e,_0x479e3b){return function(_0x4eac02){_0x479e3b[_0xbab4('0x1')](_0x28fe4e,_0x4eac02);};}function removeListener(_0x174b76,_0x25f747){return function(){ChatInteractionEvents[_0xbab4('0x2')](_0x174b76,_0x25f747);};}exports['register']=function(_0x365090){for(var _0x6f1a52=0x0,_0x4f1afa=events[_0xbab4('0x3')];_0x6f1a52<_0x4f1afa;_0x6f1a52++){var _0x9851c8=events[_0x6f1a52];var _0x55cdd2=createListener(_0xbab4('0x4')+_0x9851c8,_0x365090);ChatInteractionEvents['on'](_0x9851c8,_0x55cdd2);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 10e3385..c5a390e 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 _0xf205=['/:id/abandon','abandon','close','delete','tracked','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','/:id/messages','isAuthenticated','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','server/files/attachments/','format','%s-%s','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','chat','chatinteraction:addtags','addTags','chatinteraction:update','update','put','/:id/custom_update','customUpdate'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0xf205,0x106));var _0x5f20=function(_0x274a50,_0x5ef89a){_0x274a50=_0x274a50-0x0;var _0x10092c=_0xf205[_0x274a50];return _0x10092c;};'use strict';var multer=require(_0x5f20('0x0'));var util=require(_0x5f20('0x1'));var path=require(_0x5f20('0x2'));var timeout=require('connect-timeout');var express=require(_0x5f20('0x3'));var router=express[_0x5f20('0x4')]();var fs_extra=require(_0x5f20('0x5'));var auth=require(_0x5f20('0x6'));var interaction=require(_0x5f20('0x7'));var config=require('../../config/environment');var controller=require('./chatInteraction.controller');router[_0x5f20('0x8')]('/',auth['isAuthenticated'](),controller[_0x5f20('0x9')]);router[_0x5f20('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x5f20('0xa')]);router[_0x5f20('0x8')](_0x5f20('0xb'),auth[_0x5f20('0xc')](),controller['show']);router[_0x5f20('0x8')](_0x5f20('0xd'),auth['isChatInteractionAuthorized'](),controller[_0x5f20('0xe')]);router['get'](_0x5f20('0xf'),auth[_0x5f20('0x10')](),controller[_0x5f20('0x11')]);router[_0x5f20('0x8')](_0x5f20('0x12'),auth[_0x5f20('0xc')](),controller[_0x5f20('0x13')]);router[_0x5f20('0x8')](_0x5f20('0x14'),auth[_0x5f20('0x10')](),controller[_0x5f20('0x15')]);router[_0x5f20('0x16')]('/',auth[_0x5f20('0x10')](),controller[_0x5f20('0x17')]);router['post'](_0x5f20('0x18'),auth[_0x5f20('0x10')](),controller[_0x5f20('0x19')]);var upload=multer({'storage':multer[_0x5f20('0x1a')]({'destination':function(_0x4081fe,_0x19b8c9,_0x5d583b){_0x5d583b(null,path['join'](config['root'],_0x5f20('0x1b')));},'filename':function(_0x29c949,_0x30822b,_0x666d43){_0x666d43(null,util[_0x5f20('0x1c')](_0x5f20('0x1d'),Date['now'](),_0x30822b['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5f20('0x16')](_0x5f20('0x1e'),upload[_0x5f20('0x1f')](_0x5f20('0x20')),controller[_0x5f20('0x21')]);router[_0x5f20('0x16')](_0x5f20('0xf'),auth[_0x5f20('0xc')](),controller[_0x5f20('0x22')]);router[_0x5f20('0x16')](_0x5f20('0x23'),auth[_0x5f20('0x10')](),interaction['tracked'](_0x5f20('0x24'),_0x5f20('0x25')),controller[_0x5f20('0x26')]);router['put'](_0x5f20('0xb'),auth[_0x5f20('0x10')](),interaction['tracked'](_0x5f20('0x24'),_0x5f20('0x27')),controller[_0x5f20('0x28')]);router[_0x5f20('0x29')](_0x5f20('0x2a'),controller[_0x5f20('0x2b')]);router[_0x5f20('0x29')](_0x5f20('0x2c'),auth['isChatInteractionAuthorized'](),controller[_0x5f20('0x2d')]);router[_0x5f20('0x29')]('/:id/close',controller[_0x5f20('0x2e')]);router[_0x5f20('0x2f')](_0x5f20('0xb'),auth[_0x5f20('0x10')](),interaction[_0x5f20('0x30')]('chat','chatinteraction:destroy'),controller[_0x5f20('0x31')]);router[_0x5f20('0x2f')](_0x5f20('0x23'),auth[_0x5f20('0x10')](),controller['removeTags']);module[_0x5f20('0x32')]=router;
\ No newline at end of file
+var _0x7aae=['create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','single','file','attachmentUpload','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','/:id/custom_update','customUpdate','/:id/abandon','abandon','close','delete','chatinteraction:destroy','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','describe','get','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','/:id/download','post'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x7aae,0x1b6));var _0xe7aa=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7aae[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xe7aa('0x0'));var path=require(_0xe7aa('0x1'));var timeout=require(_0xe7aa('0x2'));var express=require('express');var router=express[_0xe7aa('0x3')]();var fs_extra=require(_0xe7aa('0x4'));var auth=require(_0xe7aa('0x5'));var interaction=require(_0xe7aa('0x6'));var config=require(_0xe7aa('0x7'));var controller=require('./chatInteraction.controller');router['get']('/',auth[_0xe7aa('0x8')](),controller['index']);router['get']('/describe',auth[_0xe7aa('0x8')](),controller[_0xe7aa('0x9')]);router[_0xe7aa('0xa')](_0xe7aa('0xb'),auth[_0xe7aa('0xc')](),controller[_0xe7aa('0xd')]);router['get'](_0xe7aa('0xe'),auth[_0xe7aa('0xc')](),controller[_0xe7aa('0xf')]);router[_0xe7aa('0xa')](_0xe7aa('0x10'),auth['isAuthenticated'](),controller[_0xe7aa('0x11')]);router['get'](_0xe7aa('0x12'),auth[_0xe7aa('0xc')](),controller['getMyMessages']);router[_0xe7aa('0xa')](_0xe7aa('0x13'),auth['isAuthenticated'](),controller['download']);router[_0xe7aa('0x14')]('/',auth['isAuthenticated'](),controller[_0xe7aa('0x15')]);router[_0xe7aa('0x14')](_0xe7aa('0x16'),auth['isAuthenticated'](),controller[_0xe7aa('0x17')]);var upload=multer({'storage':multer[_0xe7aa('0x18')]({'destination':function(_0x570e00,_0x2da2e4,_0x581d9e){_0x581d9e(null,path[_0xe7aa('0x19')](config[_0xe7aa('0x1a')],_0xe7aa('0x1b')));},'filename':function(_0x48a31b,_0x1a1579,_0x195e17){_0x195e17(null,util[_0xe7aa('0x1c')](_0xe7aa('0x1d'),Date[_0xe7aa('0x1e')](),_0x1a1579[_0xe7aa('0x1f')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe7aa('0x14')]('/:id/attachment_upload',upload[_0xe7aa('0x20')](_0xe7aa('0x21')),controller[_0xe7aa('0x22')]);router['post'](_0xe7aa('0x10'),auth[_0xe7aa('0xc')](),controller['addMessage']);router[_0xe7aa('0x14')](_0xe7aa('0x23'),auth[_0xe7aa('0x8')](),interaction[_0xe7aa('0x24')](_0xe7aa('0x25'),_0xe7aa('0x26')),controller[_0xe7aa('0x27')]);router[_0xe7aa('0x28')](_0xe7aa('0xb'),auth[_0xe7aa('0x8')](),interaction['tracked'](_0xe7aa('0x25'),_0xe7aa('0x29')),controller['update']);router[_0xe7aa('0x28')](_0xe7aa('0x2a'),controller[_0xe7aa('0x2b')]);router[_0xe7aa('0x28')](_0xe7aa('0x2c'),auth[_0xe7aa('0xc')](),controller[_0xe7aa('0x2d')]);router[_0xe7aa('0x28')]('/:id/close',controller[_0xe7aa('0x2e')]);router[_0xe7aa('0x2f')](_0xe7aa('0xb'),auth[_0xe7aa('0x8')](),interaction['tracked'](_0xe7aa('0x25'),_0xe7aa('0x30')),controller[_0xe7aa('0x31')]);router['delete'](_0xe7aa('0x23'),auth[_0xe7aa('0x8')](),controller['removeTags']);module[_0xe7aa('0x32')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index d11d646..cc7cfec 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 _0x9d7a=['sequelize','exports','TEXT','medium','BOOLEAN','INTEGER'];(function(_0x156282,_0x15aa54){var _0x401672=function(_0xa571fb){while(--_0xa571fb){_0x156282['push'](_0x156282['shift']());}};_0x401672(++_0x15aa54);}(_0x9d7a,0x114));var _0xa9d7=function(_0x5d2021,_0xe50457){_0x5d2021=_0x5d2021-0x0;var _0x373566=_0x9d7a[_0x5d2021];return _0x373566;};'use strict';var Sequelize=require(_0xa9d7('0x0'));module[_0xa9d7('0x1')]={'body':{'type':Sequelize[_0xa9d7('0x2')](_0xa9d7('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xa9d7('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xa9d7('0x5')]}};
\ No newline at end of file
+var _0x4058=['BOOLEAN','INTEGER','sequelize','exports','TEXT','medium'];(function(_0x4283e9,_0x55c057){var _0x4e4c67=function(_0x3c700c){while(--_0x3c700c){_0x4283e9['push'](_0x4283e9['shift']());}};_0x4e4c67(++_0x55c057);}(_0x4058,0x1be));var _0x8405=function(_0x25c72c,_0x14f0ab){_0x25c72c=_0x25c72c-0x0;var _0x57e28b=_0x4058[_0x25c72c];return _0x57e28b;};'use strict';var Sequelize=require(_0x8405('0x0'));module[_0x8405('0x1')]={'body':{'type':Sequelize[_0x8405('0x2')](_0x8405('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x8405('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x8405('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index c41fc01..c4db13c 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 _0x4dde=['admin','user','fullname','role','userpic','lastLoginAt','showWebBar','-online','VoiceQueue','VoiceQueues','type','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','messages','ToId','read','-createdAt','all','rimraf','fast-json-patch','request-promise','util','path','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','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','save','update','destroy','then','error','stack','name','index','map','ChatInternalMessage','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','get','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','User','agent'];(function(_0x5ba74f,_0x200bf4){var _0x534d79=function(_0x50521a){while(--_0x50521a){_0x5ba74f['push'](_0x5ba74f['shift']());}};_0x534d79(++_0x200bf4);}(_0x4dde,0x15e));var _0xe4dd=function(_0x3f182f,_0x459e7){_0x3f182f=_0x3f182f-0x0;var _0x39bc35=_0x4dde[_0x3f182f];return _0x39bc35;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe4dd('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe4dd('0x1'));var rp=require(_0xe4dd('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe4dd('0x3'));var path=require(_0xe4dd('0x4'));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(_0xe4dd('0x5'));var squel=require(_0xe4dd('0x6'));var crypto=require(_0xe4dd('0x7'));var jsforce=require(_0xe4dd('0x8'));var deskjs=require(_0xe4dd('0x9'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe4dd('0xa'));var Redis=require(_0xe4dd('0xb'));var authService=require(_0xe4dd('0xc'));var qs=require(_0xe4dd('0xd'));var as=require(_0xe4dd('0xe'));var hardwareService=require(_0xe4dd('0xf'));var logger=require(_0xe4dd('0x10'))(_0xe4dd('0x11'));var utils=require(_0xe4dd('0x12'));var config=require(_0xe4dd('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xe4dd('0x14'))['db'];config[_0xe4dd('0x15')]=_[_0xe4dd('0x16')](config[_0xe4dd('0x15')],{'host':_0xe4dd('0x17'),'port':0x18eb});var socket=require(_0xe4dd('0x18'))(new Redis(config[_0xe4dd('0x15')]));require(_0xe4dd('0x19'))['register'](socket);function respondWithStatusCode(_0x38653c,_0x5c4e38){_0x5c4e38=_0x5c4e38||0xcc;return function(_0x4063ee){if(_0x4063ee){return _0x38653c[_0xe4dd('0x1a')](_0x5c4e38);}return _0x38653c['status'](_0x5c4e38)[_0xe4dd('0x1b')]();};}function respondWithResult(_0x1b59cc,_0x20d1ab){_0x20d1ab=_0x20d1ab||0xc8;return function(_0x22653f){if(_0x22653f){return _0x1b59cc[_0xe4dd('0x1c')](_0x20d1ab)[_0xe4dd('0x1d')](_0x22653f);}};}function respondWithFilteredResult(_0x233f3e,_0x1e92d9){return function(_0x4d9e56){if(_0x4d9e56){var _0x30a3c3=typeof _0x1e92d9[_0xe4dd('0x1e')]===_0xe4dd('0x1f')&&typeof _0x1e92d9[_0xe4dd('0x20')]==='undefined';var _0x329124=_0x4d9e56[_0xe4dd('0x21')];var _0x2454e9=_0x30a3c3?0x0:_0x1e92d9[_0xe4dd('0x1e')];var _0x440d3c=_0x30a3c3?_0x4d9e56[_0xe4dd('0x21')]:_0x1e92d9[_0xe4dd('0x1e')]+_0x1e92d9[_0xe4dd('0x20')];var _0x85960a;if(_0x440d3c>=_0x329124){_0x440d3c=_0x329124;_0x85960a=0xc8;}else{_0x85960a=0xce;}_0x233f3e[_0xe4dd('0x1c')](_0x85960a);return _0x233f3e[_0xe4dd('0x22')]('Content-Range',_0x2454e9+'-'+_0x440d3c+'/'+_0x329124)[_0xe4dd('0x1d')](_0x4d9e56);}return null;};}function patchUpdates(_0x1c8ba7){return function(_0x581249){try{jsonpatch[_0xe4dd('0x23')](_0x581249,_0x1c8ba7,!![]);}catch(_0x42e9fb){return BPromise['reject'](_0x42e9fb);}return _0x581249[_0xe4dd('0x24')]();};}function saveUpdates(_0x17c5e0,_0x37f298){return function(_0x3534ed){if(_0x3534ed){return _0x3534ed[_0xe4dd('0x25')](_0x17c5e0)['then'](function(_0x2c21b8){return _0x2c21b8;});}return null;};}function removeEntity(_0x4be101,_0x7d3ec7){return function(_0x43f795){if(_0x43f795){return _0x43f795[_0xe4dd('0x26')]()[_0xe4dd('0x27')](function(){_0x4be101[_0xe4dd('0x1c')](0xcc)[_0xe4dd('0x1b')]();});}};}function handleEntityNotFound(_0x13b033,_0x9acb7d){return function(_0x3c0ddd){if(!_0x3c0ddd){_0x13b033[_0xe4dd('0x1a')](0x194);}return _0x3c0ddd;};}function handleError(_0x32d8dc,_0x11a481){_0x11a481=_0x11a481||0x1f4;return function(_0x346997){logger[_0xe4dd('0x28')](_0x346997[_0xe4dd('0x29')]);if(_0x346997['name']){delete _0x346997[_0xe4dd('0x2a')];}_0x32d8dc[_0xe4dd('0x1c')](_0x11a481)['send'](_0x346997);};}exports[_0xe4dd('0x2b')]=function(_0x5a65b2,_0x475050){var _0x3a5426={},_0x23db8f={},_0x3b9785={'count':0x0,'rows':[]};var _0x4575c2=_[_0xe4dd('0x2c')](db[_0xe4dd('0x2d')][_0xe4dd('0x2e')],function(_0x3fdac7){return{'name':_0x3fdac7[_0xe4dd('0x2f')],'type':_0x3fdac7['type'][_0xe4dd('0x30')]};});_0x23db8f[_0xe4dd('0x31')]=_['map'](_0x4575c2,'name');_0x23db8f[_0xe4dd('0x32')]=_[_0xe4dd('0x33')](_0x5a65b2['query']);_0x23db8f[_0xe4dd('0x34')]=_[_0xe4dd('0x35')](_0x23db8f[_0xe4dd('0x31')],_0x23db8f[_0xe4dd('0x32')]);_0x3a5426[_0xe4dd('0x36')]=_[_0xe4dd('0x35')](_0x23db8f[_0xe4dd('0x31')],qs['fields'](_0x5a65b2['query'][_0xe4dd('0x37')]));_0x3a5426[_0xe4dd('0x36')]=_0x3a5426['attributes']['length']?_0x3a5426[_0xe4dd('0x36')]:_0x23db8f['model'];if(!_0x5a65b2[_0xe4dd('0x32')][_0xe4dd('0x38')](_0xe4dd('0x39'))){_0x3a5426['limit']=qs[_0xe4dd('0x20')](_0x5a65b2[_0xe4dd('0x32')][_0xe4dd('0x20')]);_0x3a5426[_0xe4dd('0x1e')]=qs[_0xe4dd('0x1e')](_0x5a65b2[_0xe4dd('0x32')][_0xe4dd('0x1e')]);}_0x3a5426[_0xe4dd('0x3a')]=qs[_0xe4dd('0x3b')](_0x5a65b2[_0xe4dd('0x32')][_0xe4dd('0x3b')]);_0x3a5426[_0xe4dd('0x3c')]=qs[_0xe4dd('0x34')](_[_0xe4dd('0x3d')](_0x5a65b2[_0xe4dd('0x32')],_0x23db8f[_0xe4dd('0x34')]),_0x4575c2);if(_0x5a65b2[_0xe4dd('0x32')][_0xe4dd('0x3e')]){_0x3a5426[_0xe4dd('0x3c')]=_[_0xe4dd('0x3f')](_0x3a5426[_0xe4dd('0x3c')],{'$or':_['map'](_0x4575c2,function(_0xc9b8c4){if(_0xc9b8c4['type']!==_0xe4dd('0x40')){var _0x52182e={};_0x52182e[_0xc9b8c4['name']]={'$like':'%'+_0x5a65b2[_0xe4dd('0x32')][_0xe4dd('0x3e')]+'%'};return _0x52182e;}})});}_0x3a5426=_['merge']({},_0x3a5426,_0x5a65b2[_0xe4dd('0x41')]);var _0x37fbe8={'where':_0x3a5426[_0xe4dd('0x3c')]};return db['ChatInternalMessage'][_0xe4dd('0x21')](_0x37fbe8)['then'](function(_0x486a9f){_0x3b9785[_0xe4dd('0x21')]=_0x486a9f;if(_0x5a65b2['query'][_0xe4dd('0x42')]){_0x3a5426[_0xe4dd('0x43')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0xe4dd('0x44')](_0x3a5426);})[_0xe4dd('0x27')](function(_0x2cd858){_0x3b9785[_0xe4dd('0x45')]=_0x2cd858;return _0x3b9785;})['then'](respondWithFilteredResult(_0x475050,_0x3a5426))[_0xe4dd('0x46')](handleError(_0x475050,null));};exports[_0xe4dd('0x47')]=function(_0x42023d,_0x13bf6f){var _0x393bc1={'raw':!![],'where':{'id':_0x42023d[_0xe4dd('0x48')]['id']}},_0x4f39f8={};_0x4f39f8[_0xe4dd('0x31')]=_['keys'](db[_0xe4dd('0x2d')][_0xe4dd('0x2e')]);_0x4f39f8[_0xe4dd('0x32')]=_['keys'](_0x42023d[_0xe4dd('0x32')]);_0x4f39f8[_0xe4dd('0x34')]=_[_0xe4dd('0x35')](_0x4f39f8[_0xe4dd('0x31')],_0x4f39f8['query']);_0x393bc1[_0xe4dd('0x36')]=_[_0xe4dd('0x35')](_0x4f39f8['model'],qs[_0xe4dd('0x37')](_0x42023d[_0xe4dd('0x32')][_0xe4dd('0x37')]));_0x393bc1[_0xe4dd('0x36')]=_0x393bc1[_0xe4dd('0x36')][_0xe4dd('0x49')]?_0x393bc1[_0xe4dd('0x36')]:_0x4f39f8[_0xe4dd('0x31')];if(_0x42023d[_0xe4dd('0x32')][_0xe4dd('0x42')]){_0x393bc1[_0xe4dd('0x43')]=[{'all':!![]}];}_0x393bc1=_['merge']({},_0x393bc1,_0x42023d[_0xe4dd('0x41')]);return db[_0xe4dd('0x2d')][_0xe4dd('0x4a')](_0x393bc1)[_0xe4dd('0x27')](handleEntityNotFound(_0x13bf6f,null))[_0xe4dd('0x27')](respondWithResult(_0x13bf6f,null))[_0xe4dd('0x46')](handleError(_0x13bf6f,null));};exports[_0xe4dd('0x4b')]=function(_0x3372db,_0x64f831){return db[_0xe4dd('0x2d')][_0xe4dd('0x4b')](_0x3372db['body'],{})[_0xe4dd('0x27')](respondWithResult(_0x64f831,0xc9))[_0xe4dd('0x46')](handleError(_0x64f831,null));};exports[_0xe4dd('0x25')]=function(_0x4ae1f5,_0x52bbf3){if(_0x4ae1f5[_0xe4dd('0x4c')]['id']){delete _0x4ae1f5[_0xe4dd('0x4c')]['id'];}return db[_0xe4dd('0x2d')][_0xe4dd('0x4a')]({'where':{'id':_0x4ae1f5[_0xe4dd('0x48')]['id']}})[_0xe4dd('0x27')](handleEntityNotFound(_0x52bbf3,null))['then'](saveUpdates(_0x4ae1f5[_0xe4dd('0x4c')],null))['then'](respondWithResult(_0x52bbf3,null))[_0xe4dd('0x46')](handleError(_0x52bbf3,null));};exports[_0xe4dd('0x26')]=function(_0x3faa17,_0x56dc63){return db[_0xe4dd('0x2d')]['find']({'where':{'id':_0x3faa17[_0xe4dd('0x48')]['id']}})[_0xe4dd('0x27')](handleEntityNotFound(_0x56dc63,null))[_0xe4dd('0x27')](removeEntity(_0x56dc63,null))['catch'](handleError(_0x56dc63,null));};exports['describe']=function(_0xa5815,_0x2df29f){return db[_0xe4dd('0x2d')][_0xe4dd('0x4d')]()['then'](respondWithResult(_0x2df29f,null))[_0xe4dd('0x46')](handleError(_0x2df29f,null));};function wrapUser(_0x108eee){return function(_0x4c87c7){var _0x2f5cf3=_0x108eee[_0xe4dd('0x4e')]({'plain':!![]});_0x2f5cf3['messages']=[];if(_0x4c87c7){_0x2f5cf3[_0xe4dd('0x4f')]=_0x4c87c7[_0xe4dd('0x50')];_0x2f5cf3[_0xe4dd('0x51')]=_0x4c87c7;}else{_0x2f5cf3[_0xe4dd('0x4f')]=moment(0x0)[_0xe4dd('0x52')](_0xe4dd('0x53'));_0x2f5cf3[_0xe4dd('0x51')]={};}return _0x2f5cf3;};}exports['getUsers']=function(_0x574b1d,_0x352e24,_0x4aabef){var _0x24be20=[];return db[_0xe4dd('0x54')][_0xe4dd('0x44')]({'where':{'role':[_0xe4dd('0x55'),_0xe4dd('0x56'),_0xe4dd('0x57')]},'attributes':['id',_0xe4dd('0x58'),'name',_0xe4dd('0x59'),_0xe4dd('0x5a'),'internal','online',_0xe4dd('0x5b'),'allowmessenger',_0xe4dd('0x5c')],'order':qs['sort'](_0xe4dd('0x5d')),'include':[{'model':db[_0xe4dd('0x5e')],'as':_0xe4dd('0x5f'),'attributes':['id',_0xe4dd('0x2a'),_0xe4dd('0x60')],'through':{'attributes':[]}}]})[_0xe4dd('0x27')](function(_0x46a442){if(_0x46a442){var _0x26148f=_0x574b1d['user'][_0xe4dd('0x4e')]({'plain':!![]});if(!_0x26148f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26148f[_0xe4dd('0x59')]==='user'){return db['UserProfileSection'][_0xe4dd('0x4a')]({'where':{'name':_0xe4dd('0x61'),'userProfileId':_0x26148f[_0xe4dd('0x62')]},'raw':!![]})[_0xe4dd('0x27')](function(_0x527ef0){if(_0x527ef0){if(_0x527ef0[_0xe4dd('0x63')]===0x0){return db[_0xe4dd('0x64')][_0xe4dd('0x44')]({'where':{'sectionId':_0x527ef0['id']},'raw':!![]})[_0xe4dd('0x27')](function(_0x49cdc1){var _0x5ed17f=[];if(_[_0xe4dd('0x65')](_0x49cdc1)){_0x5ed17f=_[_0xe4dd('0x3e')](_0x46a442,function(_0x5bff77){if(_0x5bff77[_0xe4dd('0x59')]!=='agent'){return _0x5bff77;}});return _0x5ed17f;}else{for(var _0x1ef16f=0x0;_0x1ef16f<_0x46a442[_0xe4dd('0x49')];_0x1ef16f++){var _0x298431=_0x46a442[_0x1ef16f];if(_0x298431[_0xe4dd('0x59')]===_0xe4dd('0x55')){var _0x37dbfa=_[_0xe4dd('0x4a')](_0x49cdc1,function(_0x117731){return _0x117731[_0xe4dd('0x66')]===_0x298431['id'];});if(_0x37dbfa)_0x5ed17f[_0xe4dd('0x67')](_0x298431);}else{_0x5ed17f[_0xe4dd('0x67')](_0x298431);}}return _0x5ed17f;}});}else{return _0x46a442;}}else{var _0x2fa63f=_[_0xe4dd('0x3e')](_0x46a442,function(_0x1fa7b4){if(_0x1fa7b4[_0xe4dd('0x59')]!==_0xe4dd('0x55')){return _0x1fa7b4;}});return _0x2fa63f;}});}else{return _0x46a442;}}})[_0xe4dd('0x27')](function(_0x53608e){var _0x4f3a56=[];if(_0x53608e){_0x24be20=_0x53608e;for(var _0x2910a7=0x0;_0x2910a7<_0x53608e[_0xe4dd('0x49')];_0x2910a7+=0x1){_0x24be20[_0x2910a7][_0xe4dd('0x68')]=[];_0x4f3a56[_0xe4dd('0x67')](db[_0xe4dd('0x2d')][_0xe4dd('0x4a')]({'where':{'FromId':[_0x574b1d[_0xe4dd('0x57')]['id'],_0x53608e[_0x2910a7]['id']],'ToId':[_0x574b1d['user']['id'],_0x53608e[_0x2910a7]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId',_0xe4dd('0x69'),_0xe4dd('0x6a'),_0xe4dd('0x4c')],'order':qs[_0xe4dd('0x3b')](_0xe4dd('0x6b')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xe4dd('0x27')](wrapUser(_0x53608e[_0x2910a7])));}return BPromise[_0xe4dd('0x6c')](_0x4f3a56);}return[];})[_0xe4dd('0x27')](function(_0x3fa616){return{'rows':_0x3fa616,'count':_0x3fa616[_0xe4dd('0x49')]};})[_0xe4dd('0x27')](respondWithResult(_0x352e24,null))[_0xe4dd('0x46')](handleError(_0x352e24,null));};
\ No newline at end of file
+var _0x88b6=['undefined','limit','count','set','Content-Range','apply','update','then','destroy','stack','name','index','map','rawAttributes','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','ChatInternalMessage','includeAll','find','create','body','describe','messages','lastMessageAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','fullname','role','userpic','internal','online','lastLoginAt','showWebBar','VoiceQueues','user','Agents','userProfileId','autoAssociation','UserProfileResource','length','resourceId','push','createdAt','ToId','read','all','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset'];(function(_0x25ab29,_0x364fec){var _0x146cdf=function(_0x5a809d){while(--_0x5a809d){_0x25ab29['push'](_0x25ab29['shift']());}};_0x146cdf(++_0x364fec);}(_0x88b6,0x112));var _0x688b=function(_0x393bf6,_0x45b827){_0x393bf6=_0x393bf6-0x0;var _0x437338=_0x88b6[_0x393bf6];return _0x437338;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x688b('0x0'));var zipdir=require(_0x688b('0x1'));var jsonpatch=require(_0x688b('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x688b('0x3'));var util=require(_0x688b('0x4'));var path=require(_0x688b('0x5'));var sox=require(_0x688b('0x6'));var csv=require(_0x688b('0x7'));var ejs=require(_0x688b('0x8'));var fs=require('fs');var fs_extra=require(_0x688b('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x688b('0xa'));var jsforce=require(_0x688b('0xb'));var deskjs=require(_0x688b('0xc'));var toCsv=require('to-csv');var querystring=require(_0x688b('0xd'));var Papa=require(_0x688b('0xe'));var Redis=require('ioredis');var authService=require(_0x688b('0xf'));var qs=require(_0x688b('0x10'));var as=require(_0x688b('0x11'));var hardwareService=require(_0x688b('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x688b('0x13'));var licenseUtil=require(_0x688b('0x14'));var db=require(_0x688b('0x15'))['db'];config[_0x688b('0x16')]=_[_0x688b('0x17')](config[_0x688b('0x16')],{'host':_0x688b('0x18'),'port':0x18eb});var socket=require(_0x688b('0x19'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0x688b('0x1a')](socket);function respondWithStatusCode(_0x5bbc69,_0x2209c9){_0x2209c9=_0x2209c9||0xcc;return function(_0x212a13){if(_0x212a13){return _0x5bbc69[_0x688b('0x1b')](_0x2209c9);}return _0x5bbc69[_0x688b('0x1c')](_0x2209c9)[_0x688b('0x1d')]();};}function respondWithResult(_0x261823,_0x6b16c0){_0x6b16c0=_0x6b16c0||0xc8;return function(_0x1230af){if(_0x1230af){return _0x261823['status'](_0x6b16c0)[_0x688b('0x1e')](_0x1230af);}};}function respondWithFilteredResult(_0x602f7c,_0x2ca610){return function(_0x9157a){if(_0x9157a){var _0x44ca75=typeof _0x2ca610[_0x688b('0x1f')]===_0x688b('0x20')&&typeof _0x2ca610[_0x688b('0x21')]===_0x688b('0x20');var _0x26d69b=_0x9157a[_0x688b('0x22')];var _0x41fe4c=_0x44ca75?0x0:_0x2ca610[_0x688b('0x1f')];var _0x2bad4d=_0x44ca75?_0x9157a[_0x688b('0x22')]:_0x2ca610['offset']+_0x2ca610['limit'];var _0x54558e;if(_0x2bad4d>=_0x26d69b){_0x2bad4d=_0x26d69b;_0x54558e=0xc8;}else{_0x54558e=0xce;}_0x602f7c[_0x688b('0x1c')](_0x54558e);return _0x602f7c[_0x688b('0x23')](_0x688b('0x24'),_0x41fe4c+'-'+_0x2bad4d+'/'+_0x26d69b)[_0x688b('0x1e')](_0x9157a);}return null;};}function patchUpdates(_0x4ef372){return function(_0xe9f43d){try{jsonpatch[_0x688b('0x25')](_0xe9f43d,_0x4ef372,!![]);}catch(_0x270b0e){return BPromise['reject'](_0x270b0e);}return _0xe9f43d['save']();};}function saveUpdates(_0x434106,_0xa934ed){return function(_0x1827ab){if(_0x1827ab){return _0x1827ab[_0x688b('0x26')](_0x434106)[_0x688b('0x27')](function(_0x1310d6){return _0x1310d6;});}return null;};}function removeEntity(_0xa39004,_0x4b7464){return function(_0x3009b8){if(_0x3009b8){return _0x3009b8[_0x688b('0x28')]()[_0x688b('0x27')](function(){_0xa39004[_0x688b('0x1c')](0xcc)[_0x688b('0x1d')]();});}};}function handleEntityNotFound(_0x318c99,_0x4e90b8){return function(_0x327f57){if(!_0x327f57){_0x318c99[_0x688b('0x1b')](0x194);}return _0x327f57;};}function handleError(_0x594ab5,_0x306e19){_0x306e19=_0x306e19||0x1f4;return function(_0x506fe7){logger['error'](_0x506fe7[_0x688b('0x29')]);if(_0x506fe7[_0x688b('0x2a')]){delete _0x506fe7['name'];}_0x594ab5[_0x688b('0x1c')](_0x306e19)['send'](_0x506fe7);};}exports[_0x688b('0x2b')]=function(_0x1cd0a6,_0x5c4211){var _0x4d35c7={},_0x2687ab={},_0x4e3b44={'count':0x0,'rows':[]};var _0x3c1228=_[_0x688b('0x2c')](db['ChatInternalMessage'][_0x688b('0x2d')],function(_0x15e82a){return{'name':_0x15e82a['fieldName'],'type':_0x15e82a[_0x688b('0x2e')]['key']};});_0x2687ab[_0x688b('0x2f')]=_['map'](_0x3c1228,_0x688b('0x2a'));_0x2687ab[_0x688b('0x30')]=_['keys'](_0x1cd0a6[_0x688b('0x30')]);_0x2687ab[_0x688b('0x31')]=_[_0x688b('0x32')](_0x2687ab[_0x688b('0x2f')],_0x2687ab[_0x688b('0x30')]);_0x4d35c7[_0x688b('0x33')]=_[_0x688b('0x32')](_0x2687ab['model'],qs[_0x688b('0x34')](_0x1cd0a6[_0x688b('0x30')]['fields']));_0x4d35c7[_0x688b('0x33')]=_0x4d35c7['attributes']['length']?_0x4d35c7[_0x688b('0x33')]:_0x2687ab[_0x688b('0x2f')];if(!_0x1cd0a6[_0x688b('0x30')][_0x688b('0x35')]('nolimit')){_0x4d35c7[_0x688b('0x21')]=qs[_0x688b('0x21')](_0x1cd0a6[_0x688b('0x30')][_0x688b('0x21')]);_0x4d35c7[_0x688b('0x1f')]=qs[_0x688b('0x1f')](_0x1cd0a6[_0x688b('0x30')]['offset']);}_0x4d35c7['order']=qs['sort'](_0x1cd0a6['query'][_0x688b('0x36')]);_0x4d35c7[_0x688b('0x37')]=qs['filters'](_[_0x688b('0x38')](_0x1cd0a6[_0x688b('0x30')],_0x2687ab[_0x688b('0x31')]),_0x3c1228);if(_0x1cd0a6['query'][_0x688b('0x39')]){_0x4d35c7[_0x688b('0x37')]=_[_0x688b('0x3a')](_0x4d35c7['where'],{'$or':_[_0x688b('0x2c')](_0x3c1228,function(_0x47e653){if(_0x47e653[_0x688b('0x2e')]!==_0x688b('0x3b')){var _0x2c1ee4={};_0x2c1ee4[_0x47e653[_0x688b('0x2a')]]={'$like':'%'+_0x1cd0a6['query'][_0x688b('0x39')]+'%'};return _0x2c1ee4;}})});}_0x4d35c7=_['merge']({},_0x4d35c7,_0x1cd0a6[_0x688b('0x3c')]);var _0x28aa1e={'where':_0x4d35c7[_0x688b('0x37')]};return db['ChatInternalMessage']['count'](_0x28aa1e)[_0x688b('0x27')](function(_0x1fd051){_0x4e3b44[_0x688b('0x22')]=_0x1fd051;if(_0x1cd0a6['query']['includeAll']){_0x4d35c7[_0x688b('0x3d')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x688b('0x3e')](_0x4d35c7);})[_0x688b('0x27')](function(_0x105635){_0x4e3b44[_0x688b('0x3f')]=_0x105635;return _0x4e3b44;})[_0x688b('0x27')](respondWithFilteredResult(_0x5c4211,_0x4d35c7))[_0x688b('0x40')](handleError(_0x5c4211,null));};exports[_0x688b('0x41')]=function(_0x23cc30,_0x54ff7e){var _0x4bd99f={'raw':!![],'where':{'id':_0x23cc30[_0x688b('0x42')]['id']}},_0x3350be={};_0x3350be[_0x688b('0x2f')]=_[_0x688b('0x43')](db[_0x688b('0x44')]['rawAttributes']);_0x3350be[_0x688b('0x30')]=_['keys'](_0x23cc30[_0x688b('0x30')]);_0x3350be[_0x688b('0x31')]=_['intersection'](_0x3350be[_0x688b('0x2f')],_0x3350be[_0x688b('0x30')]);_0x4bd99f[_0x688b('0x33')]=_[_0x688b('0x32')](_0x3350be[_0x688b('0x2f')],qs[_0x688b('0x34')](_0x23cc30[_0x688b('0x30')][_0x688b('0x34')]));_0x4bd99f[_0x688b('0x33')]=_0x4bd99f[_0x688b('0x33')]['length']?_0x4bd99f[_0x688b('0x33')]:_0x3350be[_0x688b('0x2f')];if(_0x23cc30['query'][_0x688b('0x45')]){_0x4bd99f[_0x688b('0x3d')]=[{'all':!![]}];}_0x4bd99f=_[_0x688b('0x3a')]({},_0x4bd99f,_0x23cc30[_0x688b('0x3c')]);return db[_0x688b('0x44')][_0x688b('0x46')](_0x4bd99f)[_0x688b('0x27')](handleEntityNotFound(_0x54ff7e,null))[_0x688b('0x27')](respondWithResult(_0x54ff7e,null))[_0x688b('0x40')](handleError(_0x54ff7e,null));};exports[_0x688b('0x47')]=function(_0x14f953,_0x217a55){return db['ChatInternalMessage']['create'](_0x14f953[_0x688b('0x48')],{})[_0x688b('0x27')](respondWithResult(_0x217a55,0xc9))[_0x688b('0x40')](handleError(_0x217a55,null));};exports['update']=function(_0x3c717a,_0x1d9c55){if(_0x3c717a[_0x688b('0x48')]['id']){delete _0x3c717a['body']['id'];}return db['ChatInternalMessage'][_0x688b('0x46')]({'where':{'id':_0x3c717a[_0x688b('0x42')]['id']}})['then'](handleEntityNotFound(_0x1d9c55,null))['then'](saveUpdates(_0x3c717a[_0x688b('0x48')],null))[_0x688b('0x27')](respondWithResult(_0x1d9c55,null))['catch'](handleError(_0x1d9c55,null));};exports[_0x688b('0x28')]=function(_0x4b6b68,_0x3d9c3e){return db['ChatInternalMessage'][_0x688b('0x46')]({'where':{'id':_0x4b6b68[_0x688b('0x42')]['id']}})[_0x688b('0x27')](handleEntityNotFound(_0x3d9c3e,null))[_0x688b('0x27')](removeEntity(_0x3d9c3e,null))[_0x688b('0x40')](handleError(_0x3d9c3e,null));};exports[_0x688b('0x49')]=function(_0x1a6902,_0x213200){return db[_0x688b('0x44')][_0x688b('0x49')]()[_0x688b('0x27')](respondWithResult(_0x213200,null))['catch'](handleError(_0x213200,null));};function wrapUser(_0x25b482){return function(_0x1d7371){var _0xcde578=_0x25b482['get']({'plain':!![]});_0xcde578[_0x688b('0x4a')]=[];if(_0x1d7371){_0xcde578[_0x688b('0x4b')]=_0x1d7371['createdAt'];_0xcde578[_0x688b('0x4c')]=_0x1d7371;}else{_0xcde578[_0x688b('0x4b')]=moment(0x0)[_0x688b('0x4d')](_0x688b('0x4e'));_0xcde578[_0x688b('0x4c')]={};}return _0xcde578;};}exports[_0x688b('0x4f')]=function(_0x5bfa33,_0x5f20e5,_0x32414a){var _0x16e7b1=[];return db[_0x688b('0x50')][_0x688b('0x3e')]({'where':{'role':[_0x688b('0x51'),'admin','user']},'attributes':['id',_0x688b('0x52'),'name',_0x688b('0x53'),_0x688b('0x54'),_0x688b('0x55'),_0x688b('0x56'),_0x688b('0x57'),'allowmessenger',_0x688b('0x58')],'order':qs['sort']('-online'),'include':[{'model':db['VoiceQueue'],'as':_0x688b('0x59'),'attributes':['id','name','type'],'through':{'attributes':[]}}]})[_0x688b('0x27')](function(_0x3f79da){if(_0x3f79da){var _0x47a589=_0x5bfa33[_0x688b('0x5a')]['get']({'plain':!![]});if(!_0x47a589)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x47a589[_0x688b('0x53')]===_0x688b('0x5a')){return db['UserProfileSection']['find']({'where':{'name':_0x688b('0x5b'),'userProfileId':_0x47a589[_0x688b('0x5c')]},'raw':!![]})[_0x688b('0x27')](function(_0xe4b232){if(_0xe4b232){if(_0xe4b232[_0x688b('0x5d')]===0x0){return db[_0x688b('0x5e')]['findAll']({'where':{'sectionId':_0xe4b232['id']},'raw':!![]})[_0x688b('0x27')](function(_0x39bded){var _0x203d5a=[];if(_['isEmpty'](_0x39bded)){_0x203d5a=_[_0x688b('0x39')](_0x3f79da,function(_0x3d6058){if(_0x3d6058['role']!==_0x688b('0x51')){return _0x3d6058;}});return _0x203d5a;}else{for(var _0x3446d1=0x0;_0x3446d1<_0x3f79da[_0x688b('0x5f')];_0x3446d1++){var _0x3a0b80=_0x3f79da[_0x3446d1];if(_0x3a0b80[_0x688b('0x53')]==='agent'){var _0x4e4841=_[_0x688b('0x46')](_0x39bded,function(_0x553816){return _0x553816[_0x688b('0x60')]===_0x3a0b80['id'];});if(_0x4e4841)_0x203d5a[_0x688b('0x61')](_0x3a0b80);}else{_0x203d5a['push'](_0x3a0b80);}}return _0x203d5a;}});}else{return _0x3f79da;}}else{var _0x4e4ca2=_[_0x688b('0x39')](_0x3f79da,function(_0x247fd2){if(_0x247fd2['role']!=='agent'){return _0x247fd2;}});return _0x4e4ca2;}});}else{return _0x3f79da;}}})[_0x688b('0x27')](function(_0x4ba986){var _0x2ae8a2=[];if(_0x4ba986){_0x16e7b1=_0x4ba986;for(var _0x47be44=0x0;_0x47be44<_0x4ba986['length'];_0x47be44+=0x1){_0x16e7b1[_0x47be44][_0x688b('0x4a')]=[];_0x2ae8a2['push'](db[_0x688b('0x44')][_0x688b('0x46')]({'where':{'FromId':[_0x5bfa33[_0x688b('0x5a')]['id'],_0x4ba986[_0x47be44]['id']],'ToId':[_0x5bfa33[_0x688b('0x5a')]['id'],_0x4ba986[_0x47be44]['id']],'ChatGroupId':null},'attributes':['id',_0x688b('0x62'),'FromId',_0x688b('0x63'),_0x688b('0x64'),_0x688b('0x48')],'order':qs[_0x688b('0x36')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x688b('0x27')](wrapUser(_0x4ba986[_0x47be44])));}return BPromise[_0x688b('0x65')](_0x2ae8a2);}return[];})[_0x688b('0x27')](function(_0x4be39f){return{'rows':_0x4be39f,'count':_0x4be39f['length']};})[_0x688b('0x27')](respondWithResult(_0x5f20e5,null))['catch'](handleError(_0x5f20e5,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 5772649..28676cf 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 _0x2140=['update','hasOwnProperty','hook','../../mysqldb','ChatInternalMessage','setMaxListeners','save'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x2140,0x11b));var _0x0214=function(_0x5a3cd,_0xe14e8c){_0x5a3cd=_0x5a3cd-0x0;var _0x1f8b11=_0x2140[_0x5a3cd];return _0x1f8b11;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x0214('0x0'))['db'][_0x0214('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x0214('0x2')](0x0);var events={'afterCreate':_0x0214('0x3'),'afterUpdate':_0x0214('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3a0344){return function(_0x40015a,_0x436133,_0x1e17a5){ChatInternalMessageEvents['emit'](_0x3a0344+':'+_0x40015a['id'],_0x40015a);ChatInternalMessageEvents['emit'](_0x3a0344,_0x40015a);_0x1e17a5(null);};}for(var e in events){if(events[_0x0214('0x5')](e)){var event=events[e];ChatInternalMessage[_0x0214('0x6')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x6d6d=['../../mysqldb','ChatInternalMessage','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x63de62,_0xe5cc89){var _0x3daddf=function(_0x2a5d79){while(--_0x2a5d79){_0x63de62['push'](_0x63de62['shift']());}};_0x3daddf(++_0xe5cc89);}(_0x6d6d,0xd2));var _0xd6d6=function(_0x3cf0c9,_0x4e4ec8){_0x3cf0c9=_0x3cf0c9-0x0;var _0xe29f0e=_0x6d6d[_0x3cf0c9];return _0xe29f0e;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0xd6d6('0x0'))['db'][_0xd6d6('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xd6d6('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd6d6('0x3'),'afterDestroy':_0xd6d6('0x4')};function emitEvent(_0x69ff42){return function(_0xccafee,_0xfb579c,_0x15102b){ChatInternalMessageEvents[_0xd6d6('0x5')](_0x69ff42+':'+_0xccafee['id'],_0xccafee);ChatInternalMessageEvents[_0xd6d6('0x5')](_0x69ff42,_0xccafee);_0x15102b(null);};}for(var e in events){if(events[_0xd6d6('0x6')](e)){var event=events[e];ChatInternalMessage['hook'](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 91b01d3..dbf6908 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 _0x1c93=['rimraf','./chatInternalMessage.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x59b71f,_0x1dcbf4){var _0x99dbb0=function(_0x232bba){while(--_0x232bba){_0x59b71f['push'](_0x59b71f['shift']());}};_0x99dbb0(++_0x1dcbf4);}(_0x1c93,0x1c0));var _0x31c9=function(_0x2f5c61,_0x38800c){_0x2f5c61=_0x2f5c61-0x0;var _0x466046=_0x1c93[_0x2f5c61];return _0x466046;};'use strict';var _=require(_0x31c9('0x0'));var util=require(_0x31c9('0x1'));var logger=require('../../config/logger')(_0x31c9('0x2'));var moment=require(_0x31c9('0x3'));var BPromise=require(_0x31c9('0x4'));var rp=require(_0x31c9('0x5'));var fs=require('fs');var path=require(_0x31c9('0x6'));var rimraf=require(_0x31c9('0x7'));var config=require('../../config/environment');var attributes=require(_0x31c9('0x8'));module[_0x31c9('0x9')]=function(_0x3f7c2e,_0x2e8dcf){return _0x3f7c2e[_0x31c9('0xa')]('ChatInternalMessage',attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x31c9('0xb'),'collate':_0x31c9('0xc')});};
\ No newline at end of file
+var _0xc8ed=['bluebird','request-promise','path','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment'];(function(_0x1d5ba8,_0x412a52){var _0x1022a2=function(_0x187f11){while(--_0x187f11){_0x1d5ba8['push'](_0x1d5ba8['shift']());}};_0x1022a2(++_0x412a52);}(_0xc8ed,0x1bd));var _0xdc8e=function(_0x251ae3,_0x340452){_0x251ae3=_0x251ae3-0x0;var _0x4b6995=_0xc8ed[_0x251ae3];return _0x4b6995;};'use strict';var _=require('lodash');var util=require(_0xdc8e('0x0'));var logger=require(_0xdc8e('0x1'))('api');var moment=require(_0xdc8e('0x2'));var BPromise=require(_0xdc8e('0x3'));var rp=require(_0xdc8e('0x4'));var fs=require('fs');var path=require(_0xdc8e('0x5'));var rimraf=require('rimraf');var config=require(_0xdc8e('0x6'));var attributes=require(_0xdc8e('0x7'));module[_0xdc8e('0x8')]=function(_0x4ce6a8,_0x5494b3){return _0x4ce6a8[_0xdc8e('0x9')](_0xdc8e('0xa'),attributes,{'tableName':_0xdc8e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdc8e('0xc'),'collate':_0xdc8e('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 87bf07b..6408a4d 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 _0x04cc=['ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','info'];(function(_0x3d3709,_0x39d31a){var _0x2f6417=function(_0x440a76){while(--_0x440a76){_0x3d3709['push'](_0x3d3709['shift']());}};_0x2f6417(++_0x39d31a);}(_0x04cc,0x10d));var _0xc04c=function(_0x5cd51d,_0x20d4fa){_0x5cd51d=_0x5cd51d-0x0;var _0x444608=_0x04cc[_0x5cd51d];return _0x444608;};'use strict';var _=require(_0xc04c('0x0'));var util=require(_0xc04c('0x1'));var moment=require(_0xc04c('0x2'));var BPromise=require('bluebird');var rs=require(_0xc04c('0x3'));var fs=require('fs');var Redis=require(_0xc04c('0x4'));var db=require(_0xc04c('0x5'))['db'];var utils=require(_0xc04c('0x6'));var logger=require(_0xc04c('0x7'))('rpc');var config=require(_0xc04c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc04c('0x9')]['http']({'port':0x232a});config[_0xc04c('0xa')]=_['defaults'](config['redis'],{'host':_0xc04c('0xb'),'port':0x18eb});var socket=require(_0xc04c('0xc'))(new Redis(config[_0xc04c('0xa')]));require(_0xc04c('0xd'))[_0xc04c('0xe')](socket);function respondWithRpcPromise(_0x10a9e8,_0x564f9c,_0x2ac84c){return new BPromise(function(_0xa7b23a,_0x4a2e43){return client[_0xc04c('0xf')](_0x10a9e8,_0x2ac84c)['then'](function(_0xe13626){logger[_0xc04c('0x10')](_0xc04c('0x11'),_0x564f9c,_0xc04c('0x12'));logger[_0xc04c('0x13')](_0xc04c('0x14'),_0x564f9c,_0xc04c('0x12'),JSON[_0xc04c('0x15')](_0xe13626));if(_0xe13626['error']){if(_0xe13626[_0xc04c('0x16')][_0xc04c('0x17')]===0x1f4){logger[_0xc04c('0x16')](_0xc04c('0x11'),_0x564f9c,_0xe13626['error'][_0xc04c('0x18')]);return _0x4a2e43(_0xe13626[_0xc04c('0x16')][_0xc04c('0x18')]);}logger[_0xc04c('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x564f9c,_0xe13626[_0xc04c('0x16')]['message']);return _0xa7b23a(_0xe13626[_0xc04c('0x16')][_0xc04c('0x18')]);}else{logger[_0xc04c('0x10')](_0xc04c('0x11'),_0x564f9c,_0xc04c('0x12'));_0xa7b23a(_0xe13626['result'][_0xc04c('0x18')]);}})[_0xc04c('0x19')](function(_0x190918){logger[_0xc04c('0x16')](_0xc04c('0x11'),_0x564f9c,_0x190918);_0x4a2e43(_0x190918);});});}
\ No newline at end of file
+var _0x2982=['error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','./chatInternalMessage.socket','request','then','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2db83f,_0x5754fb){var _0x1fbe86=function(_0x16272f){while(--_0x16272f){_0x2db83f['push'](_0x2db83f['shift']());}};_0x1fbe86(++_0x5754fb);}(_0x2982,0x8d));var _0x2298=function(_0x28801e,_0x3c0c42){_0x28801e=_0x28801e-0x0;var _0x56e311=_0x2982[_0x28801e];return _0x56e311;};'use strict';var _=require(_0x2298('0x0'));var util=require('util');var moment=require(_0x2298('0x1'));var BPromise=require(_0x2298('0x2'));var rs=require(_0x2298('0x3'));var fs=require('fs');var Redis=require(_0x2298('0x4'));var db=require(_0x2298('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2298('0x6'))(_0x2298('0x7'));var config=require('../../config/environment');var jayson=require(_0x2298('0x8'));var client=jayson[_0x2298('0x9')][_0x2298('0xa')]({'port':0x232a});config['redis']=_[_0x2298('0xb')](config[_0x2298('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2298('0xd'))['register'](socket);function respondWithRpcPromise(_0x1b34b2,_0xf6e6d9,_0x123b9e){return new BPromise(function(_0x493b7b,_0x11a3f9){return client[_0x2298('0xe')](_0x1b34b2,_0x123b9e)[_0x2298('0xf')](function(_0x1636ab){logger[_0x2298('0x10')]('ChatInternalMessage,\x20%s,\x20%s',_0xf6e6d9,_0x2298('0x11'));logger[_0x2298('0x12')](_0x2298('0x13'),_0xf6e6d9,_0x2298('0x11'),JSON[_0x2298('0x14')](_0x1636ab));if(_0x1636ab[_0x2298('0x15')]){if(_0x1636ab['error'][_0x2298('0x16')]===0x1f4){logger['error'](_0x2298('0x17'),_0xf6e6d9,_0x1636ab[_0x2298('0x15')][_0x2298('0x18')]);return _0x11a3f9(_0x1636ab['error'][_0x2298('0x18')]);}logger[_0x2298('0x15')](_0x2298('0x17'),_0xf6e6d9,_0x1636ab[_0x2298('0x15')][_0x2298('0x18')]);return _0x493b7b(_0x1636ab[_0x2298('0x15')][_0x2298('0x18')]);}else{logger[_0x2298('0x10')](_0x2298('0x17'),_0xf6e6d9,_0x2298('0x11'));_0x493b7b(_0x1636ab[_0x2298('0x19')][_0x2298('0x18')]);}})[_0x2298('0x1a')](function(_0x453862){logger[_0x2298('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0xf6e6d9,_0x453862);_0x11a3f9(_0x453862);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index f8864ad..5283d63 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 _0x310f=['save','emit','./chatInternalMessage.events'];(function(_0x10ed87,_0x4c5f77){var _0x5763ea=function(_0x323ae5){while(--_0x323ae5){_0x10ed87['push'](_0x10ed87['shift']());}};_0x5763ea(++_0x4c5f77);}(_0x310f,0x12e));var _0xf310=function(_0x36935d,_0x6ab9d8){_0x36935d=_0x36935d-0x0;var _0x287f38=_0x310f[_0x36935d];return _0x287f38;};'use strict';var ChatInternalMessageEvents=require(_0xf310('0x0'));var events=[_0xf310('0x1'),'remove','update'];function createListener(_0x4075f0,_0x55c66e){return function(_0x1303d1){_0x55c66e[_0xf310('0x2')](_0x4075f0,_0x1303d1);};}function removeListener(_0x41fe6d,_0x238f82){return function(){ChatInternalMessageEvents['removeListener'](_0x41fe6d,_0x238f82);};}exports['register']=function(_0x1c6ce8){for(var _0x448d21=0x0,_0x38f6ad=events['length'];_0x448d21<_0x38f6ad;_0x448d21++){var _0xcc8028=events[_0x448d21];var _0x4ce604=createListener('chatInternalMessage:'+_0xcc8028,_0x1c6ce8);ChatInternalMessageEvents['on'](_0xcc8028,_0x4ce604);}};
\ No newline at end of file
+var _0xbde6=['removeListener','register','length','./chatInternalMessage.events','save','update','emit'];(function(_0x3b150c,_0x2f93f8){var _0x5cd414=function(_0x26305e){while(--_0x26305e){_0x3b150c['push'](_0x3b150c['shift']());}};_0x5cd414(++_0x2f93f8);}(_0xbde6,0xc7));var _0x6bde=function(_0x480c85,_0x291d15){_0x480c85=_0x480c85-0x0;var _0x51531c=_0xbde6[_0x480c85];return _0x51531c;};'use strict';var ChatInternalMessageEvents=require(_0x6bde('0x0'));var events=[_0x6bde('0x1'),'remove',_0x6bde('0x2')];function createListener(_0x65e0d7,_0x4c9e67){return function(_0x552583){_0x4c9e67[_0x6bde('0x3')](_0x65e0d7,_0x552583);};}function removeListener(_0x5dc36d,_0x1b6604){return function(){ChatInternalMessageEvents[_0x6bde('0x4')](_0x5dc36d,_0x1b6604);};}exports[_0x6bde('0x5')]=function(_0x22d440){for(var _0x252625=0x0,_0x244daa=events[_0x6bde('0x6')];_0x252625<_0x244daa;_0x252625++){var _0x6b2c8f=events[_0x252625];var _0x24d6a5=createListener('chatInternalMessage:'+_0x6b2c8f,_0x22d440);ChatInternalMessageEvents['on'](_0x6b2c8f,_0x24d6a5);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 99a7c3b..af64287 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 _0x1b3d=['/describe','describe','/users','getUsers','/:id','create','put','update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index'];(function(_0x61318d,_0x4d8395){var _0x26995e=function(_0x306ede){while(--_0x306ede){_0x61318d['push'](_0x61318d['shift']());}};_0x26995e(++_0x4d8395);}(_0x1b3d,0xd1));var _0xd1b3=function(_0x1d2e76,_0x4fddeb){_0x1d2e76=_0x1d2e76-0x0;var _0x2cb384=_0x1b3d[_0x1d2e76];return _0x2cb384;};'use strict';var multer=require(_0xd1b3('0x0'));var util=require('util');var path=require(_0xd1b3('0x1'));var timeout=require('connect-timeout');var express=require(_0xd1b3('0x2'));var router=express[_0xd1b3('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd1b3('0x4'));var interaction=require(_0xd1b3('0x5'));var config=require(_0xd1b3('0x6'));var controller=require(_0xd1b3('0x7'));router[_0xd1b3('0x8')]('/',auth[_0xd1b3('0x9')](),controller[_0xd1b3('0xa')]);router[_0xd1b3('0x8')](_0xd1b3('0xb'),auth[_0xd1b3('0x9')](),controller[_0xd1b3('0xc')]);router[_0xd1b3('0x8')](_0xd1b3('0xd'),auth['isAuthenticated'](),controller[_0xd1b3('0xe')]);router['get'](_0xd1b3('0xf'),auth[_0xd1b3('0x9')](),controller['show']);router['post']('/',auth[_0xd1b3('0x9')](),controller[_0xd1b3('0x10')]);router[_0xd1b3('0x11')]('/:id',controller[_0xd1b3('0x12')]);router[_0xd1b3('0x13')](_0xd1b3('0xf'),auth[_0xd1b3('0x9')](),controller[_0xd1b3('0x14')]);module[_0xd1b3('0x15')]=router;
\ No newline at end of file
+var _0x024c=['getUsers','/:id','show','post','create','put','delete','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','/describe','isAuthenticated','describe','/users'];(function(_0x30cb3a,_0x4adc6f){var _0x32e69f=function(_0x14845e){while(--_0x14845e){_0x30cb3a['push'](_0x30cb3a['shift']());}};_0x32e69f(++_0x4adc6f);}(_0x024c,0x1c0));var _0xc024=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x024c[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xc024('0x0'));var util=require(_0xc024('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc024('0x2'));var router=express[_0xc024('0x3')]();var fs_extra=require(_0xc024('0x4'));var auth=require(_0xc024('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc024('0x6'));var controller=require('./chatInternalMessage.controller');router[_0xc024('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc024('0x7')](_0xc024('0x8'),auth[_0xc024('0x9')](),controller[_0xc024('0xa')]);router['get'](_0xc024('0xb'),auth[_0xc024('0x9')](),controller[_0xc024('0xc')]);router[_0xc024('0x7')](_0xc024('0xd'),auth['isAuthenticated'](),controller[_0xc024('0xe')]);router[_0xc024('0xf')]('/',auth[_0xc024('0x9')](),controller[_0xc024('0x10')]);router[_0xc024('0x11')]('/:id',controller['update']);router[_0xc024('0x12')](_0xc024('0xd'),auth[_0xc024('0x9')](),controller['destroy']);module[_0xc024('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 2acb4b6..40e874d 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 _0xea28=['exports','TEXT','medium','BOOLEAN','ENUM','out','DATE','STRING','sequelize'];(function(_0x1faa61,_0x1bd7e2){var _0x3f0e58=function(_0x386cf3){while(--_0x386cf3){_0x1faa61['push'](_0x1faa61['shift']());}};_0x3f0e58(++_0x1bd7e2);}(_0xea28,0x13a));var _0x8ea2=function(_0x466d24,_0x297406){_0x466d24=_0x466d24-0x0;var _0x3ef0a0=_0xea28[_0x466d24];return _0x3ef0a0;};'use strict';var Sequelize=require(_0x8ea2('0x0'));module[_0x8ea2('0x1')]={'body':{'type':Sequelize[_0x8ea2('0x2')](_0x8ea2('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x8ea2('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x8ea2('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8ea2('0x5')]('in',_0x8ea2('0x6')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x8ea2('0x7')]},'providerName':{'type':Sequelize[_0x8ea2('0x8')]},'providerResponse':{'type':Sequelize[_0x8ea2('0x2')]}};
\ No newline at end of file
+var _0x578c=['sequelize','exports','TEXT','BOOLEAN','ENUM','out','DATE','STRING'];(function(_0x21929f,_0xb96182){var _0x1a6077=function(_0x209786){while(--_0x209786){_0x21929f['push'](_0x21929f['shift']());}};_0x1a6077(++_0xb96182);}(_0x578c,0x158));var _0xc578=function(_0x3e68f3,_0x1ec053){_0x3e68f3=_0x3e68f3-0x0;var _0x27ee2e=_0x578c[_0x3e68f3];return _0x27ee2e;};'use strict';var Sequelize=require(_0xc578('0x0'));module[_0xc578('0x1')]={'body':{'type':Sequelize[_0xc578('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xc578('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xc578('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc578('0x4')]('in','out'),'defaultValue':_0xc578('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xc578('0x6')]},'providerName':{'type':Sequelize[_0xc578('0x7')]},'providerResponse':{'type':Sequelize[_0xc578('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 1682720..4faa73f 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 _0xeaf5=['User','fullname','email','interface','SIP/%s','motionChannel','channel','event','EventManager','acceptmessage','parse','formData','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','QueryTypes','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatMessage.socket','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','undefined','limit','offset','count','set','Content-Range','json','apply','reject','save','update','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','ChatMessage','includeAll','findAll','show','include','find','create','body','destroy','describe','chat-interactions','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','params','get','ChatInteraction','isNil','read1stAt','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','SELECT','contact'];(function(_0x4ede8b,_0x4879fa){var _0x4d45d0=function(_0x402634){while(--_0x402634){_0x4ede8b['push'](_0x4ede8b['shift']());}};_0x4d45d0(++_0x4879fa);}(_0xeaf5,0x19e));var _0x5eaf=function(_0x503790,_0x525c78){_0x503790=_0x503790-0x0;var _0x388092=_0xeaf5[_0x503790];return _0x388092;};'use strict';var emlformat=require(_0x5eaf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5eaf('0x1'));var jsonpatch=require(_0x5eaf('0x2'));var rp=require('request-promise');var moment=require(_0x5eaf('0x3'));var BPromise=require(_0x5eaf('0x4'));var Mustache=require(_0x5eaf('0x5'));var util=require('util');var path=require('path');var sox=require(_0x5eaf('0x6'));var csv=require(_0x5eaf('0x7'));var ejs=require(_0x5eaf('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5eaf('0x9'));var squel=require(_0x5eaf('0xa'));var crypto=require('crypto');var jsforce=require(_0x5eaf('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x5eaf('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5eaf('0xc'));var authService=require(_0x5eaf('0xd'));var qs=require(_0x5eaf('0xe'));var as=require(_0x5eaf('0xf'));var hardwareService=require(_0x5eaf('0x10'));var logger=require(_0x5eaf('0x11'))('api');var utils=require(_0x5eaf('0x12'));var config=require(_0x5eaf('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5eaf('0x14'))['db'];config[_0x5eaf('0x15')]=_['defaults'](config[_0x5eaf('0x15')],{'host':_0x5eaf('0x16'),'port':0x18eb});var socket=require(_0x5eaf('0x17'))(new Redis(config['redis']));require(_0x5eaf('0x18'))['register'](socket);var jayson=require(_0x5eaf('0x19'));var client=jayson[_0x5eaf('0x1a')][_0x5eaf('0x1b')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4f00b3,_0x1a9d1c,_0x319cb2,_0x5219d6){return new BPromise(function(_0x342a4d,_0x29fcc1){var _0x49dc6d=_0x5219d6||client;return _0x49dc6d[_0x5eaf('0x1c')](_0x4f00b3,_0x319cb2)[_0x5eaf('0x1d')](function(_0x1a7eae){logger[_0x5eaf('0x1e')]('ChatMessage,\x20%s,\x20%s',_0x1a9d1c,_0x5eaf('0x1f'));logger[_0x5eaf('0x20')](_0x5eaf('0x21'),_0x1a9d1c,_0x5eaf('0x1f'),JSON[_0x5eaf('0x22')](_0x1a7eae));if(_0x1a7eae[_0x5eaf('0x23')]){if(_0x1a7eae[_0x5eaf('0x23')][_0x5eaf('0x24')]===0x1f4){logger[_0x5eaf('0x23')](_0x5eaf('0x25'),_0x1a9d1c,_0x1a7eae[_0x5eaf('0x23')][_0x5eaf('0x26')]);return _0x29fcc1(_0x1a7eae[_0x5eaf('0x23')][_0x5eaf('0x26')]);}logger['error'](_0x5eaf('0x25'),_0x1a9d1c,_0x1a7eae['error'][_0x5eaf('0x26')]);return _0x342a4d(_0x1a7eae[_0x5eaf('0x23')][_0x5eaf('0x26')]);}else{logger[_0x5eaf('0x1e')](_0x5eaf('0x25'),_0x1a9d1c,_0x5eaf('0x1f'));_0x342a4d(_0x1a7eae[_0x5eaf('0x27')][_0x5eaf('0x26')]);}})[_0x5eaf('0x28')](function(_0x3577f0){logger['error'](_0x5eaf('0x25'),_0x1a9d1c,_0x3577f0);_0x29fcc1(_0x3577f0);});});}function respondWithStatusCode(_0x4517bd,_0x1a58ab){_0x1a58ab=_0x1a58ab||0xcc;return function(_0x4a62ed){if(_0x4a62ed){return _0x4517bd[_0x5eaf('0x29')](_0x1a58ab);}return _0x4517bd[_0x5eaf('0x2a')](_0x1a58ab)['end']();};}function respondWithResult(_0x42469a,_0x5746f0){_0x5746f0=_0x5746f0||0xc8;return function(_0x51c02d){if(_0x51c02d){return _0x42469a[_0x5eaf('0x2a')](_0x5746f0)['json'](_0x51c02d);}};}function respondWithFilteredResult(_0x42da59,_0x41959f){return function(_0xdc1137){if(_0xdc1137){var _0x5191a6=typeof _0x41959f['offset']===_0x5eaf('0x2b')&&typeof _0x41959f[_0x5eaf('0x2c')]==='undefined';var _0x38a4de=_0xdc1137['count'];var _0x392501=_0x5191a6?0x0:_0x41959f[_0x5eaf('0x2d')];var _0x2a4e55=_0x5191a6?_0xdc1137[_0x5eaf('0x2e')]:_0x41959f['offset']+_0x41959f['limit'];var _0x201dd4;if(_0x2a4e55>=_0x38a4de){_0x2a4e55=_0x38a4de;_0x201dd4=0xc8;}else{_0x201dd4=0xce;}_0x42da59[_0x5eaf('0x2a')](_0x201dd4);return _0x42da59[_0x5eaf('0x2f')](_0x5eaf('0x30'),_0x392501+'-'+_0x2a4e55+'/'+_0x38a4de)[_0x5eaf('0x31')](_0xdc1137);}return null;};}function patchUpdates(_0x52bde3){return function(_0x352954){try{jsonpatch[_0x5eaf('0x32')](_0x352954,_0x52bde3,!![]);}catch(_0x193ae5){return BPromise[_0x5eaf('0x33')](_0x193ae5);}return _0x352954[_0x5eaf('0x34')]();};}function saveUpdates(_0x318bf0,_0x4a32a6){return function(_0x67403a){if(_0x67403a){return _0x67403a[_0x5eaf('0x35')](_0x318bf0)[_0x5eaf('0x1d')](function(_0x753158){return _0x753158;});}return null;};}function removeEntity(_0x310b10,_0x485f53){return function(_0x3d3367){if(_0x3d3367){return _0x3d3367['destroy']()[_0x5eaf('0x1d')](function(){_0x310b10[_0x5eaf('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x124d89,_0x1a52bb){return function(_0x531a1a){if(!_0x531a1a){_0x124d89[_0x5eaf('0x29')](0x194);}return _0x531a1a;};}function handleError(_0x58ce00,_0xf6e9a){_0xf6e9a=_0xf6e9a||0x1f4;return function(_0x291674){logger[_0x5eaf('0x23')](_0x291674[_0x5eaf('0x36')]);if(_0x291674['name']){delete _0x291674[_0x5eaf('0x37')];}_0x58ce00[_0x5eaf('0x2a')](_0xf6e9a)[_0x5eaf('0x38')](_0x291674);};}exports[_0x5eaf('0x39')]=function(_0x110f30,_0xe5f382){var _0x28db9e={},_0x247029={},_0x91b0a5={'count':0x0,'rows':[]};var _0x214e4d=_[_0x5eaf('0x3a')](db['ChatMessage'][_0x5eaf('0x3b')],function(_0xa7b8e4){return{'name':_0xa7b8e4[_0x5eaf('0x3c')],'type':_0xa7b8e4[_0x5eaf('0x3d')][_0x5eaf('0x3e')]};});_0x247029[_0x5eaf('0x3f')]=_['map'](_0x214e4d,_0x5eaf('0x37'));_0x247029[_0x5eaf('0x40')]=_[_0x5eaf('0x41')](_0x110f30[_0x5eaf('0x40')]);_0x247029[_0x5eaf('0x42')]=_[_0x5eaf('0x43')](_0x247029[_0x5eaf('0x3f')],_0x247029[_0x5eaf('0x40')]);_0x28db9e['attributes']=_[_0x5eaf('0x43')](_0x247029[_0x5eaf('0x3f')],qs[_0x5eaf('0x44')](_0x110f30[_0x5eaf('0x40')][_0x5eaf('0x44')]));_0x28db9e['attributes']=_0x28db9e['attributes'][_0x5eaf('0x45')]?_0x28db9e[_0x5eaf('0x46')]:_0x247029[_0x5eaf('0x3f')];if(!_0x110f30[_0x5eaf('0x40')]['hasOwnProperty'](_0x5eaf('0x47'))){_0x28db9e[_0x5eaf('0x2c')]=qs['limit'](_0x110f30[_0x5eaf('0x40')][_0x5eaf('0x2c')]);_0x28db9e[_0x5eaf('0x2d')]=qs[_0x5eaf('0x2d')](_0x110f30[_0x5eaf('0x40')][_0x5eaf('0x2d')]);}_0x28db9e[_0x5eaf('0x48')]=qs[_0x5eaf('0x49')](_0x110f30[_0x5eaf('0x40')][_0x5eaf('0x49')]);_0x28db9e['where']=qs['filters'](_[_0x5eaf('0x4a')](_0x110f30[_0x5eaf('0x40')],_0x247029['filters']),_0x214e4d);if(_0x110f30['query'][_0x5eaf('0x4b')]){_0x28db9e[_0x5eaf('0x4c')]=_[_0x5eaf('0x4d')](_0x28db9e[_0x5eaf('0x4c')],{'$or':_[_0x5eaf('0x3a')](_0x214e4d,function(_0x2ca589){if(_0x2ca589[_0x5eaf('0x3d')]!==_0x5eaf('0x4e')){var _0x37f4e7={};_0x37f4e7[_0x2ca589['name']]={'$like':'%'+_0x110f30[_0x5eaf('0x40')][_0x5eaf('0x4b')]+'%'};return _0x37f4e7;}})});}_0x28db9e=_[_0x5eaf('0x4d')]({},_0x28db9e,_0x110f30['options']);var _0x5f52fb={'where':_0x28db9e[_0x5eaf('0x4c')]};return db[_0x5eaf('0x4f')]['count'](_0x5f52fb)[_0x5eaf('0x1d')](function(_0x44f981){_0x91b0a5[_0x5eaf('0x2e')]=_0x44f981;if(_0x110f30[_0x5eaf('0x40')][_0x5eaf('0x50')]){_0x28db9e['include']=[{'all':!![]}];}return db[_0x5eaf('0x4f')][_0x5eaf('0x51')](_0x28db9e);})[_0x5eaf('0x1d')](function(_0x92e5b7){_0x91b0a5['rows']=_0x92e5b7;return _0x91b0a5;})[_0x5eaf('0x1d')](respondWithFilteredResult(_0xe5f382,_0x28db9e))['catch'](handleError(_0xe5f382,null));};exports[_0x5eaf('0x52')]=function(_0x49526c,_0x309b4d){var _0x553674={'raw':!![],'where':{'id':_0x49526c['params']['id']}},_0x1aa064={};_0x1aa064[_0x5eaf('0x3f')]=_[_0x5eaf('0x41')](db[_0x5eaf('0x4f')][_0x5eaf('0x3b')]);_0x1aa064[_0x5eaf('0x40')]=_['keys'](_0x49526c[_0x5eaf('0x40')]);_0x1aa064['filters']=_[_0x5eaf('0x43')](_0x1aa064[_0x5eaf('0x3f')],_0x1aa064[_0x5eaf('0x40')]);_0x553674[_0x5eaf('0x46')]=_[_0x5eaf('0x43')](_0x1aa064[_0x5eaf('0x3f')],qs[_0x5eaf('0x44')](_0x49526c[_0x5eaf('0x40')][_0x5eaf('0x44')]));_0x553674[_0x5eaf('0x46')]=_0x553674[_0x5eaf('0x46')][_0x5eaf('0x45')]?_0x553674[_0x5eaf('0x46')]:_0x1aa064[_0x5eaf('0x3f')];if(_0x49526c[_0x5eaf('0x40')][_0x5eaf('0x50')]){_0x553674[_0x5eaf('0x53')]=[{'all':!![]}];}_0x553674=_[_0x5eaf('0x4d')]({},_0x553674,_0x49526c['options']);return db['ChatMessage'][_0x5eaf('0x54')](_0x553674)[_0x5eaf('0x1d')](handleEntityNotFound(_0x309b4d,null))[_0x5eaf('0x1d')](respondWithResult(_0x309b4d,null))[_0x5eaf('0x28')](handleError(_0x309b4d,null));};exports[_0x5eaf('0x55')]=function(_0x1599e3,_0x140f0c){return db[_0x5eaf('0x4f')][_0x5eaf('0x55')](_0x1599e3[_0x5eaf('0x56')],{})['then'](respondWithResult(_0x140f0c,0xc9))[_0x5eaf('0x28')](handleError(_0x140f0c,null));};exports[_0x5eaf('0x35')]=function(_0x5a3809,_0x799a24){if(_0x5a3809[_0x5eaf('0x56')]['id']){delete _0x5a3809[_0x5eaf('0x56')]['id'];}return db[_0x5eaf('0x4f')][_0x5eaf('0x54')]({'where':{'id':_0x5a3809['params']['id']}})[_0x5eaf('0x1d')](handleEntityNotFound(_0x799a24,null))[_0x5eaf('0x1d')](saveUpdates(_0x5a3809[_0x5eaf('0x56')],null))[_0x5eaf('0x1d')](respondWithResult(_0x799a24,null))[_0x5eaf('0x28')](handleError(_0x799a24,null));};exports[_0x5eaf('0x57')]=function(_0x3cb3dc,_0x141d9f){return db['ChatMessage']['find']({'where':{'id':_0x3cb3dc['params']['id']}})[_0x5eaf('0x1d')](handleEntityNotFound(_0x141d9f,null))[_0x5eaf('0x1d')](removeEntity(_0x141d9f,null))[_0x5eaf('0x28')](handleError(_0x141d9f,null));};exports[_0x5eaf('0x58')]=function(_0x5eec03,_0x167ed3){return db['ChatMessage'][_0x5eaf('0x58')]()[_0x5eaf('0x1d')](respondWithResult(_0x167ed3,null))[_0x5eaf('0x28')](handleError(_0x167ed3,null));};var interaction_log=require('../../config/logger')(_0x5eaf('0x59'));exports['accept']=function(_0x16f0e7,_0x4d413b,_0x45663c){var _0x14ad0b={'agent':{},'channel':_0x5eaf('0x5a')};if(_0x16f0e7['body']['id']){delete _0x16f0e7['body']['id'];}_0x16f0e7[_0x5eaf('0x56')][_0x5eaf('0x5b')]=!![];_0x16f0e7[_0x5eaf('0x56')][_0x5eaf('0x5c')]=moment()[_0x5eaf('0x5d')](_0x5eaf('0x5e'));_0x16f0e7[_0x5eaf('0x56')][_0x5eaf('0x5f')]=_0x16f0e7[_0x5eaf('0x56')][_0x5eaf('0x5f')]||_0x16f0e7['user']['id'];_0x14ad0b[_0x5eaf('0x60')]['id']=_0x16f0e7[_0x5eaf('0x56')]['UserId'];return db[_0x5eaf('0x4f')][_0x5eaf('0x54')]({'where':{'id':_0x16f0e7[_0x5eaf('0x61')]['id'],'UserId':null}})[_0x5eaf('0x1d')](handleEntityNotFound(_0x4d413b,null))[_0x5eaf('0x1d')](saveUpdates(_0x16f0e7[_0x5eaf('0x56')],null))['then'](function(_0x175588){if(_0x175588){_0x14ad0b[_0x5eaf('0x26')]=_0x175588[_0x5eaf('0x62')]({'plain':!![]});return db[_0x5eaf('0x63')][_0x5eaf('0x54')]({'where':{'id':_0x175588['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x4d413b,null))[_0x5eaf('0x1d')](function(_0x148fc3){if(_0x148fc3){return _0x148fc3[_0x5eaf('0x35')]({'UserId':_0x16f0e7[_0x5eaf('0x56')][_0x5eaf('0x5f')],'read1stAt':_[_0x5eaf('0x64')](_0x148fc3[_0x5eaf('0x65')])?moment()[_0x5eaf('0x5d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x5eaf('0x1d')](function(_0x17c96e){if(_0x17c96e){_0x14ad0b['interaction']=_0x17c96e[_0x5eaf('0x62')]({'plain':!![]});interaction_log['info'](_0x5eaf('0x66'),_0x16f0e7[_0x5eaf('0x67')]['id'],_0x16f0e7[_0x5eaf('0x67')]['name'],_0x16f0e7[_0x5eaf('0x67')][_0x5eaf('0x68')],_0x14ad0b[_0x5eaf('0x69')]['id'],_0x16f0e7[_0x5eaf('0x56')]?JSON[_0x5eaf('0x22')](_0x16f0e7[_0x5eaf('0x56')]):_0x5eaf('0x6a'));return respondWithRpcPromise(_0x5eaf('0x6b'),_0x5eaf('0x6c'),_0x14ad0b);}return null;})['then'](function(_0x2d9a40){var _0x1c9cfa=_0x5eaf('0x6d')+_0x2d9a40[_0x5eaf('0x26')][_0x5eaf('0x6e')];return db[_0x5eaf('0x6f')][_0x5eaf('0x40')](_0x1c9cfa,{'type':db['Sequelize']['QueryTypes'][_0x5eaf('0x70')],'raw':!![]})[_0x5eaf('0x1d')](function(_0x140750){return _0x140750;});})[_0x5eaf('0x1d')](function(_0x17862b){if(_0x17862b){_0x14ad0b[_0x5eaf('0x26')][_0x5eaf('0x71')]=_0x17862b[0x0];if(!_0x16f0e7[_0x5eaf('0x56')][_0x5eaf('0x5f')])return;return db[_0x5eaf('0x72')][_0x5eaf('0x54')]({'where':{'id':_0x16f0e7[_0x5eaf('0x56')][_0x5eaf('0x5f')],'role':_0x5eaf('0x60')},'attributes':['id','name',_0x5eaf('0x73'),_0x5eaf('0x74'),'internal'],'raw':!![]});}return null;})[_0x5eaf('0x1d')](function(_0x72c9ff){if(!_0x72c9ff)return null;_0x14ad0b[_0x5eaf('0x26')]['agent']=_0x72c9ff;return _0x14ad0b;})[_0x5eaf('0x1d')](function(_0x3244f9){if(_0x3244f9){if(_0x16f0e7[_0x5eaf('0x56')]['manual']){_0x14ad0b[_0x5eaf('0x26')][_0x5eaf('0x75')]=util[_0x5eaf('0x5d')](_0x5eaf('0x76'),_0x16f0e7[_0x5eaf('0x67')][_0x5eaf('0x37')]);_0x14ad0b[_0x5eaf('0x26')]['channel']=_0x14ad0b['channel'];_0x14ad0b['message'][_0x5eaf('0x77')]=_0x14ad0b[_0x5eaf('0x78')];_0x14ad0b[_0x5eaf('0x26')][_0x5eaf('0x79')]='accept';return respondWithRpcPromise('EventManager',_0x5eaf('0x7a'),{'event':_0x5eaf('0x7b'),'message':_[_0x5eaf('0x4d')](_0x14ad0b['message'],JSON[_0x5eaf('0x7c')](_0x14ad0b[_0x5eaf('0x69')][_0x5eaf('0x7d')]))},client9002)['then'](function(){return _0x14ad0b;});}return _0x14ad0b;}return null;})[_0x5eaf('0x1d')](respondWithResult(_0x4d413b,null))[_0x5eaf('0x28')](handleError(_0x4d413b,null));};var interaction_log=require(_0x5eaf('0x11'))('chat-interactions');exports[_0x5eaf('0x33')]=function(_0x55b073,_0x4b330c,_0x2987e6){var _0x38c9bc={'agent':{},'channel':_0x5eaf('0x5a')};if(_0x55b073[_0x5eaf('0x56')]['id']){delete _0x55b073['body']['id'];}_0x55b073[_0x5eaf('0x56')][_0x5eaf('0x5f')]=_0x55b073[_0x5eaf('0x56')][_0x5eaf('0x5f')]||_0x55b073[_0x5eaf('0x67')]['id'];_0x38c9bc[_0x5eaf('0x60')]['id']=_0x55b073[_0x5eaf('0x56')][_0x5eaf('0x5f')];return db[_0x5eaf('0x4f')][_0x5eaf('0x54')]({'where':{'id':_0x55b073[_0x5eaf('0x61')]['id'],'UserId':null}})[_0x5eaf('0x1d')](handleEntityNotFound(_0x4b330c,null))[_0x5eaf('0x1d')](function(_0x1c08eb){if(_0x1c08eb){_0x38c9bc['message']=_0x1c08eb[_0x5eaf('0x62')]({'plain':!![]});return db[_0x5eaf('0x63')][_0x5eaf('0x54')]({'where':{'id':_0x1c08eb[_0x5eaf('0x7e')]}});}return null;})['then'](handleEntityNotFound(_0x4b330c,null))[_0x5eaf('0x1d')](function(_0x2e5df8){if(_0x2e5df8){_0x38c9bc[_0x5eaf('0x69')]=_0x2e5df8['get']({'plain':!![]});interaction_log[_0x5eaf('0x1e')](_0x5eaf('0x7f'),_0x55b073[_0x5eaf('0x67')]['id'],_0x55b073[_0x5eaf('0x67')][_0x5eaf('0x37')],_0x55b073['user'][_0x5eaf('0x68')],_0x38c9bc['interaction']['id'],_0x55b073[_0x5eaf('0x56')]?JSON[_0x5eaf('0x22')](_0x55b073['body']):'null');return respondWithRpcPromise(_0x5eaf('0x80'),_0x5eaf('0x81'),_0x38c9bc);}return null;})[_0x5eaf('0x1d')](function(_0x50cdd8){var _0x2b8fb9=_0x5eaf('0x6d')+_0x50cdd8[_0x5eaf('0x26')][_0x5eaf('0x6e')];return db[_0x5eaf('0x6f')][_0x5eaf('0x40')](_0x2b8fb9,{'type':db[_0x5eaf('0x82')][_0x5eaf('0x83')][_0x5eaf('0x70')],'raw':!![]})['then'](function(_0x263c16){return _0x263c16;});})[_0x5eaf('0x1d')](function(_0x5c2a9a){if(_0x5c2a9a){_0x38c9bc['message'][_0x5eaf('0x71')]=_0x5c2a9a[0x0];if(!_0x55b073['body'][_0x5eaf('0x5f')])return;return db[_0x5eaf('0x72')][_0x5eaf('0x54')]({'where':{'id':_0x55b073[_0x5eaf('0x56')][_0x5eaf('0x5f')],'role':_0x5eaf('0x60')},'attributes':['id',_0x5eaf('0x37'),_0x5eaf('0x73'),_0x5eaf('0x74'),'internal'],'raw':!![]});}return null;})['then'](function(_0x6f83e){if(!_0x6f83e)return null;_0x38c9bc['message'][_0x5eaf('0x60')]=_0x6f83e;return _0x38c9bc;})[_0x5eaf('0x1d')](function(_0x112009){if(_0x112009){_0x112009[_0x5eaf('0x26')][_0x5eaf('0x75')]=util['format'](_0x5eaf('0x76'),_0x55b073[_0x5eaf('0x67')][_0x5eaf('0x37')]);_0x112009[_0x5eaf('0x26')][_0x5eaf('0x78')]=_0x38c9bc[_0x5eaf('0x78')];_0x112009[_0x5eaf('0x26')][_0x5eaf('0x77')]=_0x38c9bc[_0x5eaf('0x78')];_0x112009[_0x5eaf('0x26')][_0x5eaf('0x79')]='reject';respondWithRpcPromise(_0x5eaf('0x7a'),_0x5eaf('0x7a'),{'event':'rejectmessage','message':_[_0x5eaf('0x4d')](_0x38c9bc['message'],JSON[_0x5eaf('0x7c')](_0x38c9bc[_0x5eaf('0x69')][_0x5eaf('0x7d')]))},client9002);return _0x38c9bc;}return null;})[_0x5eaf('0x1d')](respondWithResult(_0x4b330c,null))[_0x5eaf('0x28')](handleError(_0x4b330c,null));};
\ No newline at end of file
+var _0xd6e0=['../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./chatMessage.socket','register','jayson/promise','client','http','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','stack','name','send','ChatMessage','rawAttributes','fieldName','type','key','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','includeAll','include','findAll','catch','show','params','find','create','body','update','describe','chat-interactions','accept','UserId','user','get','ChatInteraction','ChatInteractionId','read1stAt','YYYY-MM-DD\x20HH:mm:ss','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','AcceptMessage','acceptMessage','sequelize','Sequelize','SELECT','contact','User','agent','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','event','rejectmessage','parse','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x6c70aa,_0x14bea7){var _0x31dbf0=function(_0x1488a0){while(--_0x1488a0){_0x6c70aa['push'](_0x6c70aa['shift']());}};_0x31dbf0(++_0x14bea7);}(_0xd6e0,0x6d));var _0x0d6e=function(_0x1505e5,_0x5cc291){_0x1505e5=_0x1505e5-0x0;var _0x5b1dcd=_0xd6e0[_0x1505e5];return _0x5b1dcd;};'use strict';var emlformat=require(_0x0d6e('0x0'));var rimraf=require(_0x0d6e('0x1'));var zipdir=require(_0x0d6e('0x2'));var jsonpatch=require(_0x0d6e('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0d6e('0x4'));var Mustache=require(_0x0d6e('0x5'));var util=require(_0x0d6e('0x6'));var path=require(_0x0d6e('0x7'));var sox=require(_0x0d6e('0x8'));var csv=require('to-csv');var ejs=require(_0x0d6e('0x9'));var fs=require('fs');var fs_extra=require(_0x0d6e('0xa'));var _=require(_0x0d6e('0xb'));var squel=require(_0x0d6e('0xc'));var crypto=require(_0x0d6e('0xd'));var jsforce=require(_0x0d6e('0xe'));var deskjs=require(_0x0d6e('0xf'));var toCsv=require(_0x0d6e('0x10'));var querystring=require(_0x0d6e('0x11'));var Papa=require('papaparse');var Redis=require(_0x0d6e('0x12'));var authService=require(_0x0d6e('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0d6e('0x14'));var hardwareService=require(_0x0d6e('0x15'));var logger=require(_0x0d6e('0x16'))(_0x0d6e('0x17'));var utils=require(_0x0d6e('0x18'));var config=require(_0x0d6e('0x19'));var licenseUtil=require(_0x0d6e('0x1a'));var db=require(_0x0d6e('0x1b'))['db'];config['redis']=_[_0x0d6e('0x1c')](config['redis'],{'host':_0x0d6e('0x1d'),'port':0x18eb});var socket=require(_0x0d6e('0x1e'))(new Redis(config[_0x0d6e('0x1f')]));require(_0x0d6e('0x20'))[_0x0d6e('0x21')](socket);var jayson=require(_0x0d6e('0x22'));var client=jayson[_0x0d6e('0x23')][_0x0d6e('0x24')]({'port':0x232c});var client9002=jayson[_0x0d6e('0x23')][_0x0d6e('0x24')]({'port':0x232a});function respondWithRpcPromise(_0x3f4a63,_0x117e93,_0x3352ac,_0x448e0b){return new BPromise(function(_0x2cff53,_0xdd2c5f){var _0x3d601a=_0x448e0b||client;return _0x3d601a['request'](_0x3f4a63,_0x3352ac)['then'](function(_0x3477c8){logger['info'](_0x0d6e('0x25'),_0x117e93,'request\x20sent');logger[_0x0d6e('0x26')](_0x0d6e('0x27'),_0x117e93,'request\x20sent',JSON[_0x0d6e('0x28')](_0x3477c8));if(_0x3477c8[_0x0d6e('0x29')]){if(_0x3477c8[_0x0d6e('0x29')]['code']===0x1f4){logger[_0x0d6e('0x29')](_0x0d6e('0x25'),_0x117e93,_0x3477c8[_0x0d6e('0x29')][_0x0d6e('0x2a')]);return _0xdd2c5f(_0x3477c8[_0x0d6e('0x29')][_0x0d6e('0x2a')]);}logger[_0x0d6e('0x29')](_0x0d6e('0x25'),_0x117e93,_0x3477c8['error'][_0x0d6e('0x2a')]);return _0x2cff53(_0x3477c8['error'][_0x0d6e('0x2a')]);}else{logger[_0x0d6e('0x2b')](_0x0d6e('0x25'),_0x117e93,_0x0d6e('0x2c'));_0x2cff53(_0x3477c8['result'][_0x0d6e('0x2a')]);}})['catch'](function(_0x9cf683){logger[_0x0d6e('0x29')](_0x0d6e('0x25'),_0x117e93,_0x9cf683);_0xdd2c5f(_0x9cf683);});});}function respondWithStatusCode(_0x166ec9,_0x2a7490){_0x2a7490=_0x2a7490||0xcc;return function(_0x3ae998){if(_0x3ae998){return _0x166ec9[_0x0d6e('0x2d')](_0x2a7490);}return _0x166ec9[_0x0d6e('0x2e')](_0x2a7490)[_0x0d6e('0x2f')]();};}function respondWithResult(_0x30d853,_0xe8fa){_0xe8fa=_0xe8fa||0xc8;return function(_0x5a357e){if(_0x5a357e){return _0x30d853['status'](_0xe8fa)[_0x0d6e('0x30')](_0x5a357e);}};}function respondWithFilteredResult(_0x29a0f8,_0x43cb7a){return function(_0x3bbdc4){if(_0x3bbdc4){var _0x1c38ab=typeof _0x43cb7a[_0x0d6e('0x31')]===_0x0d6e('0x32')&&typeof _0x43cb7a[_0x0d6e('0x33')]===_0x0d6e('0x32');var _0x133355=_0x3bbdc4[_0x0d6e('0x34')];var _0x5413c6=_0x1c38ab?0x0:_0x43cb7a[_0x0d6e('0x31')];var _0x384c81=_0x1c38ab?_0x3bbdc4[_0x0d6e('0x34')]:_0x43cb7a[_0x0d6e('0x31')]+_0x43cb7a[_0x0d6e('0x33')];var _0x1ce21e;if(_0x384c81>=_0x133355){_0x384c81=_0x133355;_0x1ce21e=0xc8;}else{_0x1ce21e=0xce;}_0x29a0f8[_0x0d6e('0x2e')](_0x1ce21e);return _0x29a0f8[_0x0d6e('0x35')]('Content-Range',_0x5413c6+'-'+_0x384c81+'/'+_0x133355)[_0x0d6e('0x30')](_0x3bbdc4);}return null;};}function patchUpdates(_0x255e8f){return function(_0xc4092){try{jsonpatch[_0x0d6e('0x36')](_0xc4092,_0x255e8f,!![]);}catch(_0x578061){return BPromise[_0x0d6e('0x37')](_0x578061);}return _0xc4092[_0x0d6e('0x38')]();};}function saveUpdates(_0x21576d,_0x244e22){return function(_0x42f7){if(_0x42f7){return _0x42f7['update'](_0x21576d)[_0x0d6e('0x39')](function(_0x4e0375){return _0x4e0375;});}return null;};}function removeEntity(_0x1444a9,_0x50de86){return function(_0x1b9139){if(_0x1b9139){return _0x1b9139[_0x0d6e('0x3a')]()['then'](function(){_0x1444a9[_0x0d6e('0x2e')](0xcc)[_0x0d6e('0x2f')]();});}};}function handleEntityNotFound(_0x46ba49,_0x18009e){return function(_0x5c88be){if(!_0x5c88be){_0x46ba49[_0x0d6e('0x2d')](0x194);}return _0x5c88be;};}function handleError(_0x2224c6,_0x51643f){_0x51643f=_0x51643f||0x1f4;return function(_0xbfa059){logger[_0x0d6e('0x29')](_0xbfa059[_0x0d6e('0x3b')]);if(_0xbfa059[_0x0d6e('0x3c')]){delete _0xbfa059[_0x0d6e('0x3c')];}_0x2224c6['status'](_0x51643f)[_0x0d6e('0x3d')](_0xbfa059);};}exports['index']=function(_0x6a0e02,_0x5299b9){var _0x3144e0={},_0x411942={},_0x3aee44={'count':0x0,'rows':[]};var _0xedb01e=_['map'](db[_0x0d6e('0x3e')][_0x0d6e('0x3f')],function(_0x4bede1){return{'name':_0x4bede1[_0x0d6e('0x40')],'type':_0x4bede1[_0x0d6e('0x41')][_0x0d6e('0x42')]};});_0x411942[_0x0d6e('0x43')]=_[_0x0d6e('0x44')](_0xedb01e,_0x0d6e('0x3c'));_0x411942['query']=_[_0x0d6e('0x45')](_0x6a0e02[_0x0d6e('0x46')]);_0x411942[_0x0d6e('0x47')]=_['intersection'](_0x411942[_0x0d6e('0x43')],_0x411942[_0x0d6e('0x46')]);_0x3144e0[_0x0d6e('0x48')]=_[_0x0d6e('0x49')](_0x411942[_0x0d6e('0x43')],qs[_0x0d6e('0x4a')](_0x6a0e02[_0x0d6e('0x46')][_0x0d6e('0x4a')]));_0x3144e0[_0x0d6e('0x48')]=_0x3144e0[_0x0d6e('0x48')][_0x0d6e('0x4b')]?_0x3144e0[_0x0d6e('0x48')]:_0x411942['model'];if(!_0x6a0e02['query'][_0x0d6e('0x4c')](_0x0d6e('0x4d'))){_0x3144e0[_0x0d6e('0x33')]=qs[_0x0d6e('0x33')](_0x6a0e02[_0x0d6e('0x46')][_0x0d6e('0x33')]);_0x3144e0[_0x0d6e('0x31')]=qs[_0x0d6e('0x31')](_0x6a0e02[_0x0d6e('0x46')][_0x0d6e('0x31')]);}_0x3144e0[_0x0d6e('0x4e')]=qs[_0x0d6e('0x4f')](_0x6a0e02[_0x0d6e('0x46')]['sort']);_0x3144e0[_0x0d6e('0x50')]=qs['filters'](_['pick'](_0x6a0e02[_0x0d6e('0x46')],_0x411942[_0x0d6e('0x47')]),_0xedb01e);if(_0x6a0e02['query']['filter']){_0x3144e0['where']=_[_0x0d6e('0x51')](_0x3144e0[_0x0d6e('0x50')],{'$or':_[_0x0d6e('0x44')](_0xedb01e,function(_0x412f54){if(_0x412f54['type']!=='VIRTUAL'){var _0x5b114d={};_0x5b114d[_0x412f54[_0x0d6e('0x3c')]]={'$like':'%'+_0x6a0e02['query'][_0x0d6e('0x52')]+'%'};return _0x5b114d;}})});}_0x3144e0=_[_0x0d6e('0x51')]({},_0x3144e0,_0x6a0e02[_0x0d6e('0x53')]);var _0x4e5068={'where':_0x3144e0['where']};return db[_0x0d6e('0x3e')]['count'](_0x4e5068)['then'](function(_0x468e7f){_0x3aee44[_0x0d6e('0x34')]=_0x468e7f;if(_0x6a0e02['query'][_0x0d6e('0x54')]){_0x3144e0[_0x0d6e('0x55')]=[{'all':!![]}];}return db[_0x0d6e('0x3e')][_0x0d6e('0x56')](_0x3144e0);})[_0x0d6e('0x39')](function(_0x4ca73e){_0x3aee44['rows']=_0x4ca73e;return _0x3aee44;})[_0x0d6e('0x39')](respondWithFilteredResult(_0x5299b9,_0x3144e0))[_0x0d6e('0x57')](handleError(_0x5299b9,null));};exports[_0x0d6e('0x58')]=function(_0x23c04a,_0x3a46fd){var _0x396b58={'raw':!![],'where':{'id':_0x23c04a[_0x0d6e('0x59')]['id']}},_0x2a9341={};_0x2a9341['model']=_[_0x0d6e('0x45')](db[_0x0d6e('0x3e')][_0x0d6e('0x3f')]);_0x2a9341[_0x0d6e('0x46')]=_[_0x0d6e('0x45')](_0x23c04a[_0x0d6e('0x46')]);_0x2a9341[_0x0d6e('0x47')]=_[_0x0d6e('0x49')](_0x2a9341[_0x0d6e('0x43')],_0x2a9341[_0x0d6e('0x46')]);_0x396b58['attributes']=_['intersection'](_0x2a9341['model'],qs[_0x0d6e('0x4a')](_0x23c04a[_0x0d6e('0x46')][_0x0d6e('0x4a')]));_0x396b58[_0x0d6e('0x48')]=_0x396b58['attributes'][_0x0d6e('0x4b')]?_0x396b58[_0x0d6e('0x48')]:_0x2a9341[_0x0d6e('0x43')];if(_0x23c04a[_0x0d6e('0x46')][_0x0d6e('0x54')]){_0x396b58[_0x0d6e('0x55')]=[{'all':!![]}];}_0x396b58=_[_0x0d6e('0x51')]({},_0x396b58,_0x23c04a['options']);return db[_0x0d6e('0x3e')][_0x0d6e('0x5a')](_0x396b58)[_0x0d6e('0x39')](handleEntityNotFound(_0x3a46fd,null))[_0x0d6e('0x39')](respondWithResult(_0x3a46fd,null))[_0x0d6e('0x57')](handleError(_0x3a46fd,null));};exports[_0x0d6e('0x5b')]=function(_0x956447,_0x241cea){return db[_0x0d6e('0x3e')]['create'](_0x956447[_0x0d6e('0x5c')],{})[_0x0d6e('0x39')](respondWithResult(_0x241cea,0xc9))[_0x0d6e('0x57')](handleError(_0x241cea,null));};exports[_0x0d6e('0x5d')]=function(_0x35d0f3,_0x5b0b8c){if(_0x35d0f3[_0x0d6e('0x5c')]['id']){delete _0x35d0f3[_0x0d6e('0x5c')]['id'];}return db[_0x0d6e('0x3e')]['find']({'where':{'id':_0x35d0f3['params']['id']}})[_0x0d6e('0x39')](handleEntityNotFound(_0x5b0b8c,null))[_0x0d6e('0x39')](saveUpdates(_0x35d0f3[_0x0d6e('0x5c')],null))[_0x0d6e('0x39')](respondWithResult(_0x5b0b8c,null))[_0x0d6e('0x57')](handleError(_0x5b0b8c,null));};exports[_0x0d6e('0x3a')]=function(_0x6f2fe9,_0x20819e){return db[_0x0d6e('0x3e')]['find']({'where':{'id':_0x6f2fe9[_0x0d6e('0x59')]['id']}})[_0x0d6e('0x39')](handleEntityNotFound(_0x20819e,null))[_0x0d6e('0x39')](removeEntity(_0x20819e,null))[_0x0d6e('0x57')](handleError(_0x20819e,null));};exports[_0x0d6e('0x5e')]=function(_0x314ca2,_0x50e9d5){return db[_0x0d6e('0x3e')][_0x0d6e('0x5e')]()[_0x0d6e('0x39')](respondWithResult(_0x50e9d5,null))[_0x0d6e('0x57')](handleError(_0x50e9d5,null));};var interaction_log=require(_0x0d6e('0x16'))(_0x0d6e('0x5f'));exports[_0x0d6e('0x60')]=function(_0x560857,_0x5704c9,_0xfc96d1){var _0x55099b={'agent':{},'channel':'chat'};if(_0x560857[_0x0d6e('0x5c')]['id']){delete _0x560857['body']['id'];}_0x560857['body']['read']=!![];_0x560857[_0x0d6e('0x5c')]['readAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x560857['body'][_0x0d6e('0x61')]=_0x560857['body']['UserId']||_0x560857[_0x0d6e('0x62')]['id'];_0x55099b['agent']['id']=_0x560857[_0x0d6e('0x5c')][_0x0d6e('0x61')];return db['ChatMessage'][_0x0d6e('0x5a')]({'where':{'id':_0x560857['params']['id'],'UserId':null}})[_0x0d6e('0x39')](handleEntityNotFound(_0x5704c9,null))[_0x0d6e('0x39')](saveUpdates(_0x560857[_0x0d6e('0x5c')],null))[_0x0d6e('0x39')](function(_0x29988e){if(_0x29988e){_0x55099b[_0x0d6e('0x2a')]=_0x29988e[_0x0d6e('0x63')]({'plain':!![]});return db[_0x0d6e('0x64')][_0x0d6e('0x5a')]({'where':{'id':_0x29988e[_0x0d6e('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x5704c9,null))['then'](function(_0x363a9c){if(_0x363a9c){return _0x363a9c[_0x0d6e('0x5d')]({'UserId':_0x560857[_0x0d6e('0x5c')][_0x0d6e('0x61')],'read1stAt':_['isNil'](_0x363a9c[_0x0d6e('0x66')])?moment()['format'](_0x0d6e('0x67')):undefined});}return null;})['then'](function(_0x48c392){if(_0x48c392){_0x55099b['interaction']=_0x48c392['get']({'plain':!![]});interaction_log[_0x0d6e('0x2b')](_0x0d6e('0x68'),_0x560857['user']['id'],_0x560857[_0x0d6e('0x62')][_0x0d6e('0x3c')],_0x560857['user'][_0x0d6e('0x69')],_0x55099b[_0x0d6e('0x6a')]['id'],_0x560857[_0x0d6e('0x5c')]?JSON[_0x0d6e('0x28')](_0x560857[_0x0d6e('0x5c')]):'null');return respondWithRpcPromise(_0x0d6e('0x6b'),_0x0d6e('0x6c'),_0x55099b);}return null;})[_0x0d6e('0x39')](function(_0x43fc24){var _0x2c0d3b='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x43fc24[_0x0d6e('0x2a')]['ContactId'];return db[_0x0d6e('0x6d')][_0x0d6e('0x46')](_0x2c0d3b,{'type':db[_0x0d6e('0x6e')]['QueryTypes'][_0x0d6e('0x6f')],'raw':!![]})['then'](function(_0xe7ed40){return _0xe7ed40;});})[_0x0d6e('0x39')](function(_0x15e816){if(_0x15e816){_0x55099b['message'][_0x0d6e('0x70')]=_0x15e816[0x0];if(!_0x560857[_0x0d6e('0x5c')][_0x0d6e('0x61')])return;return db[_0x0d6e('0x71')][_0x0d6e('0x5a')]({'where':{'id':_0x560857[_0x0d6e('0x5c')][_0x0d6e('0x61')],'role':_0x0d6e('0x72')},'attributes':['id',_0x0d6e('0x3c'),_0x0d6e('0x73'),'email',_0x0d6e('0x74')],'raw':!![]});}return null;})[_0x0d6e('0x39')](function(_0x33b5ba){if(!_0x33b5ba)return null;_0x55099b[_0x0d6e('0x2a')][_0x0d6e('0x72')]=_0x33b5ba;return _0x55099b;})['then'](function(_0x2827ea){if(_0x2827ea){if(_0x560857[_0x0d6e('0x5c')][_0x0d6e('0x75')]){_0x55099b[_0x0d6e('0x2a')][_0x0d6e('0x76')]=util['format'](_0x0d6e('0x77'),_0x560857[_0x0d6e('0x62')][_0x0d6e('0x3c')]);_0x55099b[_0x0d6e('0x2a')][_0x0d6e('0x78')]=_0x55099b[_0x0d6e('0x78')];_0x55099b[_0x0d6e('0x2a')][_0x0d6e('0x79')]=_0x55099b[_0x0d6e('0x78')];_0x55099b['message']['event']=_0x0d6e('0x60');return respondWithRpcPromise(_0x0d6e('0x7a'),_0x0d6e('0x7a'),{'event':_0x0d6e('0x7b'),'message':_[_0x0d6e('0x51')](_0x55099b[_0x0d6e('0x2a')],JSON['parse'](_0x55099b[_0x0d6e('0x6a')][_0x0d6e('0x7c')]))},client9002)[_0x0d6e('0x39')](function(){return _0x55099b;});}return _0x55099b;}return null;})[_0x0d6e('0x39')](respondWithResult(_0x5704c9,null))[_0x0d6e('0x57')](handleError(_0x5704c9,null));};var interaction_log=require(_0x0d6e('0x16'))(_0x0d6e('0x5f'));exports[_0x0d6e('0x37')]=function(_0x537f6b,_0x49f82f,_0x34851f){var _0x583830={'agent':{},'channel':'chat'};if(_0x537f6b[_0x0d6e('0x5c')]['id']){delete _0x537f6b['body']['id'];}_0x537f6b['body'][_0x0d6e('0x61')]=_0x537f6b[_0x0d6e('0x5c')]['UserId']||_0x537f6b[_0x0d6e('0x62')]['id'];_0x583830[_0x0d6e('0x72')]['id']=_0x537f6b['body'][_0x0d6e('0x61')];return db[_0x0d6e('0x3e')][_0x0d6e('0x5a')]({'where':{'id':_0x537f6b['params']['id'],'UserId':null}})[_0x0d6e('0x39')](handleEntityNotFound(_0x49f82f,null))['then'](function(_0x5dc060){if(_0x5dc060){_0x583830['message']=_0x5dc060['get']({'plain':!![]});return db[_0x0d6e('0x64')][_0x0d6e('0x5a')]({'where':{'id':_0x5dc060[_0x0d6e('0x65')]}});}return null;})[_0x0d6e('0x39')](handleEntityNotFound(_0x49f82f,null))[_0x0d6e('0x39')](function(_0x3abfef){if(_0x3abfef){_0x583830[_0x0d6e('0x6a')]=_0x3abfef[_0x0d6e('0x63')]({'plain':!![]});interaction_log[_0x0d6e('0x2b')](_0x0d6e('0x7d'),_0x537f6b[_0x0d6e('0x62')]['id'],_0x537f6b['user']['name'],_0x537f6b['user'][_0x0d6e('0x69')],_0x583830[_0x0d6e('0x6a')]['id'],_0x537f6b[_0x0d6e('0x5c')]?JSON[_0x0d6e('0x28')](_0x537f6b['body']):'null');return respondWithRpcPromise(_0x0d6e('0x7e'),_0x0d6e('0x7f'),_0x583830);}return null;})[_0x0d6e('0x39')](function(_0x151510){var _0x5b6c54=_0x0d6e('0x80')+_0x151510[_0x0d6e('0x2a')][_0x0d6e('0x81')];return db[_0x0d6e('0x6d')][_0x0d6e('0x46')](_0x5b6c54,{'type':db[_0x0d6e('0x6e')][_0x0d6e('0x82')][_0x0d6e('0x6f')],'raw':!![]})['then'](function(_0x4c8f14){return _0x4c8f14;});})[_0x0d6e('0x39')](function(_0x4d0fa9){if(_0x4d0fa9){_0x583830[_0x0d6e('0x2a')]['contact']=_0x4d0fa9[0x0];if(!_0x537f6b[_0x0d6e('0x5c')][_0x0d6e('0x61')])return;return db['User'][_0x0d6e('0x5a')]({'where':{'id':_0x537f6b[_0x0d6e('0x5c')][_0x0d6e('0x61')],'role':'agent'},'attributes':['id','name',_0x0d6e('0x73'),'email',_0x0d6e('0x74')],'raw':!![]});}return null;})[_0x0d6e('0x39')](function(_0x2114db){if(!_0x2114db)return null;_0x583830[_0x0d6e('0x2a')][_0x0d6e('0x72')]=_0x2114db;return _0x583830;})['then'](function(_0x2dafb0){if(_0x2dafb0){_0x2dafb0['message'][_0x0d6e('0x76')]=util['format']('SIP/%s',_0x537f6b[_0x0d6e('0x62')][_0x0d6e('0x3c')]);_0x2dafb0[_0x0d6e('0x2a')][_0x0d6e('0x78')]=_0x583830[_0x0d6e('0x78')];_0x2dafb0[_0x0d6e('0x2a')][_0x0d6e('0x79')]=_0x583830[_0x0d6e('0x78')];_0x2dafb0[_0x0d6e('0x2a')][_0x0d6e('0x83')]=_0x0d6e('0x37');respondWithRpcPromise(_0x0d6e('0x7a'),_0x0d6e('0x7a'),{'event':_0x0d6e('0x84'),'message':_['merge'](_0x583830[_0x0d6e('0x2a')],JSON[_0x0d6e('0x85')](_0x583830[_0x0d6e('0x6a')][_0x0d6e('0x7c')]))},client9002);return _0x583830;}return null;})[_0x0d6e('0x39')](respondWithResult(_0x49f82f,null))['catch'](handleError(_0x49f82f,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index cc937d4..f32bea1 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 _0xece8=['emit','exports','../../mysqldb','ChatMessage','setMaxListeners','update'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xece8,0x104));var _0x8ece=function(_0x381403,_0x19fd9a){_0x381403=_0x381403-0x0;var _0x30b3b1=_0xece8[_0x381403];return _0x30b3b1;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x8ece('0x0'))['db'][_0x8ece('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x8ece('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8ece('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3cff3c){return function(_0xe3cd2b,_0x3ce82a,_0x1be42f){ChatMessageEvents['emit'](_0x3cff3c+':'+_0xe3cd2b['id'],_0xe3cd2b);ChatMessageEvents[_0x8ece('0x4')](_0x3cff3c,_0xe3cd2b);_0x1be42f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x8ece('0x5')]=ChatMessageEvents;
\ No newline at end of file
+var _0x6108=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners'];(function(_0x2ff762,_0x342c0b){var _0x158b02=function(_0x13c38e){while(--_0x13c38e){_0x2ff762['push'](_0x2ff762['shift']());}};_0x158b02(++_0x342c0b);}(_0x6108,0x126));var _0x8610=function(_0xb276c0,_0x116692){_0xb276c0=_0xb276c0-0x0;var _0x3b5a6f=_0x6108[_0xb276c0];return _0x3b5a6f;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x8610('0x0'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x8610('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8610('0x2'),'afterDestroy':_0x8610('0x3')};function emitEvent(_0x454a13){return function(_0x57a33f,_0x59dc79,_0x3f3357){ChatMessageEvents[_0x8610('0x4')](_0x454a13+':'+_0x57a33f['id'],_0x57a33f);ChatMessageEvents[_0x8610('0x4')](_0x454a13,_0x57a33f);_0x3f3357(null);};}for(var e in events){if(events[_0x8610('0x5')](e)){var event=events[e];ChatMessage[_0x8610('0x6')](e,emitEvent(event));}}module[_0x8610('0x7')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 7fa68d5..efa6672 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 _0x17d7=['update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatMessage.attributes','exports','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','ChatInteraction','ChatInteractionId','then'];(function(_0x453e2b,_0x4f1258){var _0x50f306=function(_0x397f14){while(--_0x397f14){_0x453e2b['push'](_0x453e2b['shift']());}};_0x50f306(++_0x4f1258);}(_0x17d7,0x15b));var _0x717d=function(_0x3c6141,_0x4a51f2){_0x3c6141=_0x3c6141-0x0;var _0x1a1e32=_0x17d7[_0x3c6141];return _0x1a1e32;};'use strict';var _=require(_0x717d('0x0'));var util=require(_0x717d('0x1'));var logger=require('../../config/logger')(_0x717d('0x2'));var moment=require(_0x717d('0x3'));var BPromise=require(_0x717d('0x4'));var rp=require(_0x717d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x717d('0x6'));var config=require(_0x717d('0x7'));var attributes=require(_0x717d('0x8'));module[_0x717d('0x9')]=function(_0x4bbb38,_0x16e3ac){return _0x4bbb38['define'](_0x717d('0xa'),attributes,{'tableName':_0x717d('0xb'),'paranoid':![],'indexes':[{'name':_0x717d('0xc'),'fields':[_0x717d('0xd')],'type':_0x717d('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x40843e,_0x1937f0,_0x5cfbad){var _0x69a26e=_0x4bbb38[_0x717d('0xf')];var _0x2fac9e=_0x40843e[_0x717d('0x10')]({'plain':!![]});if(_0x2fac9e[_0x717d('0x11')][_0x717d('0x12')]()==='in'||_0x2fac9e[_0x717d('0x11')][_0x717d('0x12')]()===_0x717d('0x13')&&!_0x2fac9e[_0x717d('0x14')]&&!_[_0x717d('0x15')](_0x2fac9e['UserId'])){_0x69a26e[_0x717d('0x16')]['findOne']({'where':{'id':_0x2fac9e[_0x717d('0x17')]}})[_0x717d('0x18')](function(_0x24977d){if(_0x24977d){_0x24977d[_0x717d('0x19')]({'lastMsgAt':_0x2fac9e[_0x717d('0x1a')],'lastMsgDirection':_0x2fac9e[_0x717d('0x11')][_0x717d('0x12')]()});}})[_0x717d('0x1b')](function(_0x3e327e){console[_0x717d('0x1c')](_0x3e327e);});}_0x5cfbad();}},'charset':_0x717d('0x1d'),'collate':_0x717d('0x1e')});};
\ No newline at end of file
+var _0xf05b=['fti_chat_messages','FULLTEXT','models','direction','toLowerCase','out','secret','ChatInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','path','rimraf','./chatMessage.attributes','exports','define','chat_messages'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xf05b,0xbd));var _0xbf05=function(_0x458ad3,_0x1cc9fe){_0x458ad3=_0x458ad3-0x0;var _0x4f9c4d=_0xf05b[_0x458ad3];return _0x4f9c4d;};'use strict';var _=require(_0xbf05('0x0'));var util=require(_0xbf05('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbf05('0x2'));var BPromise=require(_0xbf05('0x3'));var rp=require(_0xbf05('0x4'));var fs=require('fs');var path=require(_0xbf05('0x5'));var rimraf=require(_0xbf05('0x6'));var config=require('../../config/environment');var attributes=require(_0xbf05('0x7'));module[_0xbf05('0x8')]=function(_0x3f9c35,_0x3a6f09){return _0x3f9c35[_0xbf05('0x9')]('ChatMessage',attributes,{'tableName':_0xbf05('0xa'),'paranoid':![],'indexes':[{'name':_0xbf05('0xb'),'fields':['body'],'type':_0xbf05('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x403655,_0x3da244,_0x5b143c){var _0x1b108c=_0x3f9c35[_0xbf05('0xd')];var _0x381f8c=_0x403655['get']({'plain':!![]});if(_0x381f8c[_0xbf05('0xe')][_0xbf05('0xf')]()==='in'||_0x381f8c[_0xbf05('0xe')][_0xbf05('0xf')]()===_0xbf05('0x10')&&!_0x381f8c[_0xbf05('0x11')]&&!_['isNil'](_0x381f8c['UserId'])){_0x1b108c['ChatInteraction']['findOne']({'where':{'id':_0x381f8c[_0xbf05('0x12')]}})[_0xbf05('0x13')](function(_0x194a9c){if(_0x194a9c){_0x194a9c[_0xbf05('0x14')]({'lastMsgAt':_0x381f8c[_0xbf05('0x15')],'lastMsgDirection':_0x381f8c[_0xbf05('0xe')][_0xbf05('0xf')]()});}})[_0xbf05('0x16')](function(_0x15ed51){console['error'](_0x15ed51);});}_0x5b143c();}},'charset':_0xbf05('0x17'),'collate':_0xbf05('0x18')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index e15cb9e..869d1db 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 _0x46fe=['http','redis','localhost','socket.io-emitter','register','request','debug','request\x20sent','error','code','message','ChatMessage,\x20%s,\x20%s','result','catch','ChatMessage','create','body','options','raw','then','info','CreateChatMessage','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x46fe,0x1c3));var _0xe46f=function(_0x3fe6df,_0x5a04d4){_0x3fe6df=_0x3fe6df-0x0;var _0x372a0e=_0x46fe[_0x3fe6df];return _0x372a0e;};'use strict';var _=require(_0xe46f('0x0'));var util=require(_0xe46f('0x1'));var moment=require(_0xe46f('0x2'));var BPromise=require('bluebird');var rs=require(_0xe46f('0x3'));var fs=require('fs');var Redis=require(_0xe46f('0x4'));var db=require(_0xe46f('0x5'))['db'];var utils=require(_0xe46f('0x6'));var logger=require(_0xe46f('0x7'))('rpc');var config=require(_0xe46f('0x8'));var jayson=require(_0xe46f('0x9'));var client=jayson[_0xe46f('0xa')][_0xe46f('0xb')]({'port':0x232a});config[_0xe46f('0xc')]=_['defaults'](config[_0xe46f('0xc')],{'host':_0xe46f('0xd'),'port':0x18eb});var socket=require(_0xe46f('0xe'))(new Redis(config['redis']));require('./chatMessage.socket')[_0xe46f('0xf')](socket);function respondWithRpcPromise(_0x3603c4,_0x15b72d,_0x4157cc){return new BPromise(function(_0xa64a1c,_0x2d214d){return client[_0xe46f('0x10')](_0x3603c4,_0x4157cc)['then'](function(_0x3d70d6){logger['info']('ChatMessage,\x20%s,\x20%s',_0x15b72d,'request\x20sent');logger[_0xe46f('0x11')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x15b72d,_0xe46f('0x12'),JSON['stringify'](_0x3d70d6));if(_0x3d70d6[_0xe46f('0x13')]){if(_0x3d70d6[_0xe46f('0x13')][_0xe46f('0x14')]===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x15b72d,_0x3d70d6[_0xe46f('0x13')][_0xe46f('0x15')]);return _0x2d214d(_0x3d70d6[_0xe46f('0x13')]['message']);}logger[_0xe46f('0x13')]('ChatMessage,\x20%s,\x20%s',_0x15b72d,_0x3d70d6[_0xe46f('0x13')][_0xe46f('0x15')]);return _0xa64a1c(_0x3d70d6['error'][_0xe46f('0x15')]);}else{logger['info'](_0xe46f('0x16'),_0x15b72d,_0xe46f('0x12'));_0xa64a1c(_0x3d70d6[_0xe46f('0x17')][_0xe46f('0x15')]);}})[_0xe46f('0x18')](function(_0x2241fc){logger['error'](_0xe46f('0x16'),_0x15b72d,_0x2241fc);_0x2d214d(_0x2241fc);});});}exports['CreateChatMessage']=function(_0x5eb192){var _0x3bf428=this;return new Promise(function(_0x1f2134,_0x3a3426){return db[_0xe46f('0x19')][_0xe46f('0x1a')](_0x5eb192[_0xe46f('0x1b')],{'raw':_0x5eb192[_0xe46f('0x1c')]?_0x5eb192[_0xe46f('0x1c')][_0xe46f('0x1d')]===undefined?!![]:![]:!![]})[_0xe46f('0x1e')](function(_0x31690a){logger[_0xe46f('0x1f')](_0xe46f('0x20'),_0x5eb192);logger[_0xe46f('0x11')](_0xe46f('0x20'),_0x5eb192,JSON['stringify'](_0x31690a));_0x1f2134(_0x31690a);})[_0xe46f('0x18')](function(_0x4aaef7){logger[_0xe46f('0x13')]('CreateChatMessage',_0x4aaef7[_0xe46f('0x15')],_0x5eb192);_0x3a3426(_0x3bf428[_0xe46f('0x13')](0x1f4,_0x4aaef7[_0xe46f('0x15')]));});});};
\ No newline at end of file
+var _0x9f02=['register','info','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','CreateChatMessage','create','body','options','raw','then','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','socket.io-emitter','./chatMessage.socket'];(function(_0x4394b6,_0x12357f){var _0x360244=function(_0x5689a1){while(--_0x5689a1){_0x4394b6['push'](_0x4394b6['shift']());}};_0x360244(++_0x12357f);}(_0x9f02,0x68));var _0x29f0=function(_0x4f7efa,_0x299b08){_0x4f7efa=_0x4f7efa-0x0;var _0x33d69d=_0x9f02[_0x4f7efa];return _0x33d69d;};'use strict';var _=require(_0x29f0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x29f0('0x1'));var fs=require('fs');var Redis=require(_0x29f0('0x2'));var db=require(_0x29f0('0x3'))['db'];var utils=require(_0x29f0('0x4'));var logger=require(_0x29f0('0x5'))('rpc');var config=require(_0x29f0('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x29f0('0x7')][_0x29f0('0x8')]({'port':0x232a});config[_0x29f0('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x29f0('0xa'))(new Redis(config['redis']));require(_0x29f0('0xb'))[_0x29f0('0xc')](socket);function respondWithRpcPromise(_0x581e4,_0x529ded,_0x48adaf){return new BPromise(function(_0x3e1eeb,_0x5a8eb2){return client['request'](_0x581e4,_0x48adaf)['then'](function(_0x488b7f){logger[_0x29f0('0xd')]('ChatMessage,\x20%s,\x20%s',_0x529ded,_0x29f0('0xe'));logger['debug'](_0x29f0('0xf'),_0x529ded,_0x29f0('0xe'),JSON[_0x29f0('0x10')](_0x488b7f));if(_0x488b7f[_0x29f0('0x11')]){if(_0x488b7f['error'][_0x29f0('0x12')]===0x1f4){logger[_0x29f0('0x11')]('ChatMessage,\x20%s,\x20%s',_0x529ded,_0x488b7f[_0x29f0('0x11')]['message']);return _0x5a8eb2(_0x488b7f[_0x29f0('0x11')]['message']);}logger[_0x29f0('0x11')](_0x29f0('0x13'),_0x529ded,_0x488b7f['error']['message']);return _0x3e1eeb(_0x488b7f['error'][_0x29f0('0x14')]);}else{logger[_0x29f0('0xd')](_0x29f0('0x13'),_0x529ded,'request\x20sent');_0x3e1eeb(_0x488b7f[_0x29f0('0x15')][_0x29f0('0x14')]);}})[_0x29f0('0x16')](function(_0x12e197){logger[_0x29f0('0x11')]('ChatMessage,\x20%s,\x20%s',_0x529ded,_0x12e197);_0x5a8eb2(_0x12e197);});});}exports[_0x29f0('0x17')]=function(_0xf7da2e){var _0x340fc0=this;return new Promise(function(_0x5a4579,_0x2fd36b){return db['ChatMessage'][_0x29f0('0x18')](_0xf7da2e[_0x29f0('0x19')],{'raw':_0xf7da2e[_0x29f0('0x1a')]?_0xf7da2e['options'][_0x29f0('0x1b')]===undefined?!![]:![]:!![]})[_0x29f0('0x1c')](function(_0x23e691){logger[_0x29f0('0xd')](_0x29f0('0x17'),_0xf7da2e);logger['debug'](_0x29f0('0x17'),_0xf7da2e,JSON[_0x29f0('0x10')](_0x23e691));_0x5a4579(_0x23e691);})[_0x29f0('0x16')](function(_0x3d9a49){logger[_0x29f0('0x11')](_0x29f0('0x17'),_0x3d9a49[_0x29f0('0x14')],_0xf7da2e);_0x2fd36b(_0x340fc0[_0x29f0('0x11')](0x1f4,_0x3d9a49[_0x29f0('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 2133055..8f58316 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 _0x9009=['removeListener','register','length','chatMessage:','./chatMessage.events','remove','update','emit'];(function(_0x248f6b,_0x401324){var _0x54b829=function(_0x51ad90){while(--_0x51ad90){_0x248f6b['push'](_0x248f6b['shift']());}};_0x54b829(++_0x401324);}(_0x9009,0x1d4));var _0x9900=function(_0x1cfab8,_0x3381e7){_0x1cfab8=_0x1cfab8-0x0;var _0x24a72f=_0x9009[_0x1cfab8];return _0x24a72f;};'use strict';var ChatMessageEvents=require(_0x9900('0x0'));var events=['save',_0x9900('0x1'),_0x9900('0x2')];function createListener(_0x5d0a60,_0x12d637){return function(_0x177acf){_0x12d637[_0x9900('0x3')](_0x5d0a60,_0x177acf);};}function removeListener(_0x224abb,_0x5705f1){return function(){ChatMessageEvents[_0x9900('0x4')](_0x224abb,_0x5705f1);};}exports[_0x9900('0x5')]=function(_0x502dac){for(var _0x59dd25=0x0,_0x16de4e=events[_0x9900('0x6')];_0x59dd25<_0x16de4e;_0x59dd25++){var _0x4abe19=events[_0x59dd25];var _0x2f085b=createListener(_0x9900('0x7')+_0x4abe19,_0x502dac);ChatMessageEvents['on'](_0x4abe19,_0x2f085b);}};
\ No newline at end of file
+var _0x5183=['./chatMessage.events','save','remove','emit','register','chatMessage:'];(function(_0x4399a6,_0x4f3ef7){var _0x20ba25=function(_0x5c9e3c){while(--_0x5c9e3c){_0x4399a6['push'](_0x4399a6['shift']());}};_0x20ba25(++_0x4f3ef7);}(_0x5183,0x13e));var _0x3518=function(_0x237b0d,_0x2a940c){_0x237b0d=_0x237b0d-0x0;var _0x1b0713=_0x5183[_0x237b0d];return _0x1b0713;};'use strict';var ChatMessageEvents=require(_0x3518('0x0'));var events=[_0x3518('0x1'),_0x3518('0x2'),'update'];function createListener(_0x5b6958,_0x2323f3){return function(_0x3cc276){_0x2323f3[_0x3518('0x3')](_0x5b6958,_0x3cc276);};}function removeListener(_0x421ab5,_0x5a38df){return function(){ChatMessageEvents['removeListener'](_0x421ab5,_0x5a38df);};}exports[_0x3518('0x4')]=function(_0x1031a9){for(var _0x2c019c=0x0,_0x482b2d=events['length'];_0x2c019c<_0x482b2d;_0x2c019c++){var _0x488c52=events[_0x2c019c];var _0x147b59=createListener(_0x3518('0x5')+_0x488c52,_0x1031a9);ChatMessageEvents['on'](_0x488c52,_0x147b59);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 42a3bfc..4ec6272 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 _0xc8dd=['./chatMessage.controller','get','isAuthenticated','index','describe','/:id','show','post','tracked','chat','chatmessage:create','update','put','/:id/accept','accept','/:id/reject','delete','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3c7299,_0xff8a76){var _0x5cf417=function(_0x3d4e34){while(--_0x3d4e34){_0x3c7299['push'](_0x3c7299['shift']());}};_0x5cf417(++_0xff8a76);}(_0xc8dd,0x191));var _0xdc8d=function(_0xa30766,_0x6f613e){_0xa30766=_0xa30766-0x0;var _0x24e780=_0xc8dd[_0xa30766];return _0x24e780;};'use strict';var multer=require('multer');var util=require(_0xdc8d('0x0'));var path=require(_0xdc8d('0x1'));var timeout=require('connect-timeout');var express=require(_0xdc8d('0x2'));var router=express['Router']();var fs_extra=require(_0xdc8d('0x3'));var auth=require(_0xdc8d('0x4'));var interaction=require(_0xdc8d('0x5'));var config=require(_0xdc8d('0x6'));var controller=require(_0xdc8d('0x7'));router[_0xdc8d('0x8')]('/',auth[_0xdc8d('0x9')](),controller[_0xdc8d('0xa')]);router[_0xdc8d('0x8')]('/describe',auth[_0xdc8d('0x9')](),controller[_0xdc8d('0xb')]);router['get'](_0xdc8d('0xc'),auth[_0xdc8d('0x9')](),controller[_0xdc8d('0xd')]);router[_0xdc8d('0xe')]('/',auth['isAuthenticated'](),interaction[_0xdc8d('0xf')](_0xdc8d('0x10'),_0xdc8d('0x11')),controller['create']);router['put'](_0xdc8d('0xc'),controller[_0xdc8d('0x12')]);router[_0xdc8d('0x13')](_0xdc8d('0x14'),auth[_0xdc8d('0x9')](),controller[_0xdc8d('0x15')]);router[_0xdc8d('0x13')](_0xdc8d('0x16'),auth['isAuthenticated'](),controller['reject']);router[_0xdc8d('0x17')]('/:id',auth[_0xdc8d('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x79b3=['exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','describe','/:id','show','post','tracked','chat','chatmessage:create','create','update','/:id/accept','accept','put','/:id/reject','reject','delete'];(function(_0x3aa4a8,_0x53044f){var _0x3968d7=function(_0x38faaf){while(--_0x38faaf){_0x3aa4a8['push'](_0x3aa4a8['shift']());}};_0x3968d7(++_0x53044f);}(_0x79b3,0xb7));var _0x379b=function(_0x1b7623,_0x5460c4){_0x1b7623=_0x1b7623-0x0;var _0xe2d267=_0x79b3[_0x1b7623];return _0xe2d267;};'use strict';var multer=require(_0x379b('0x0'));var util=require(_0x379b('0x1'));var path=require(_0x379b('0x2'));var timeout=require(_0x379b('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x379b('0x4'));var auth=require(_0x379b('0x5'));var interaction=require(_0x379b('0x6'));var config=require('../../config/environment');var controller=require(_0x379b('0x7'));router[_0x379b('0x8')]('/',auth[_0x379b('0x9')](),controller['index']);router[_0x379b('0x8')]('/describe',auth[_0x379b('0x9')](),controller[_0x379b('0xa')]);router[_0x379b('0x8')](_0x379b('0xb'),auth[_0x379b('0x9')](),controller[_0x379b('0xc')]);router[_0x379b('0xd')]('/',auth[_0x379b('0x9')](),interaction[_0x379b('0xe')](_0x379b('0xf'),_0x379b('0x10')),controller[_0x379b('0x11')]);router['put']('/:id',controller[_0x379b('0x12')]);router['put'](_0x379b('0x13'),auth[_0x379b('0x9')](),controller[_0x379b('0x14')]);router[_0x379b('0x15')](_0x379b('0x16'),auth[_0x379b('0x9')](),controller[_0x379b('0x17')]);router[_0x379b('0x18')](_0x379b('0xb'),auth[_0x379b('0x9')](),controller['destroy']);module[_0x379b('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index d44e122..8951594 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 _0x0b0e=['medium','sequelize','TEXT'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x0b0e,0x187));var _0xe0b0=function(_0x57d671,_0x1a101c){_0x57d671=_0x57d671-0x0;var _0x450dfe=_0x0b0e[_0x57d671];return _0x450dfe;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('0x2')),'allowNull':![]}};
\ No newline at end of file
+var _0xb10b=['medium','sequelize','TEXT'];(function(_0x3f3e83,_0x425bc0){var _0x560422=function(_0x4f78ea){while(--_0x4f78ea){_0x3f3e83['push'](_0x3f3e83['shift']());}};_0x560422(++_0x425bc0);}(_0xb10b,0x12a));var _0xbb10=function(_0x4336a6,_0xc235ca){_0x4336a6=_0x4336a6-0x0;var _0x4012f3=_0xb10b[_0x4336a6];return _0x4012f3;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'body':{'type':Sequelize[_0xbb10('0x1')](_0xbb10('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xbb10('0x1')]('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 dbdf64b..c0ee6f8 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(_0x5b14db,_0x40e54b){var _0x449a93=function(_0x36f0e7){while(--_0x36f0e7){_0x5b14db['push'](_0x5b14db['shift']());}};_0x449a93(++_0x40e54b);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
+var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0x7a54,0x106));var _0x47a5=function(_0xc80b7f,_0x2a8c83){_0xc80b7f=_0xc80b7f-0x0;var _0x1ab2cb=_0x7a54[_0xc80b7f];return _0x1ab2cb;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index 6b1d813..df290a2 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1caa=['emit','hook','events','ChatOfflineMessage','save','update','remove'];(function(_0x2c8573,_0x345465){var _0x263d3e=function(_0x4d7394){while(--_0x4d7394){_0x2c8573['push'](_0x2c8573['shift']());}};_0x263d3e(++_0x345465);}(_0x1caa,0xbf));var _0xa1ca=function(_0x31da21,_0x47cb01){_0x31da21=_0x31da21-0x0;var _0x4a8084=_0x1caa[_0x31da21];return _0x4a8084;};'use strict';var EventEmitter=require(_0xa1ca('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0xa1ca('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa1ca('0x2'),'afterUpdate':_0xa1ca('0x3'),'afterDestroy':_0xa1ca('0x4')};function emitEvent(_0x18ad61){return function(_0xd599ba,_0x586653,_0x231a97){ChatOfflineMessageEvents[_0xa1ca('0x5')](_0x18ad61+':'+_0xd599ba['id'],_0xd599ba);ChatOfflineMessageEvents[_0xa1ca('0x5')](_0x18ad61,_0xd599ba);_0x231a97(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0xa1ca('0x6')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x293a=['ChatOfflineMessage','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x20711e,_0x5b61c9){var _0x173e7f=function(_0x4eabdc){while(--_0x4eabdc){_0x20711e['push'](_0x20711e['shift']());}};_0x173e7f(++_0x5b61c9);}(_0x293a,0xa6));var _0xa293=function(_0x51af8c,_0x7ae22f){_0x51af8c=_0x51af8c-0x0;var _0x170551=_0x293a[_0x51af8c];return _0x170551;};'use strict';var EventEmitter=require(_0xa293('0x0'));var ChatOfflineMessage=require(_0xa293('0x1'))['db'][_0xa293('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa293('0x3'),'afterDestroy':_0xa293('0x4')};function emitEvent(_0x1a971f){return function(_0x1bb168,_0x406ec1,_0x2626cf){ChatOfflineMessageEvents[_0xa293('0x5')](_0x1a971f+':'+_0x1bb168['id'],_0x1bb168);ChatOfflineMessageEvents['emit'](_0x1a971f,_0x1bb168);_0x2626cf(null);};}for(var e in events){if(events[_0xa293('0x6')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0xa293('0x7')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 1e0d68c..18ab773 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 _0x39db=['exports','ChatOfflineMessage','chat_offline_messages','utf8mb4'];(function(_0x3a4e1f,_0x26d373){var _0x2524d1=function(_0x238b5f){while(--_0x238b5f){_0x3a4e1f['push'](_0x3a4e1f['shift']());}};_0x2524d1(++_0x26d373);}(_0x39db,0x1c4));var _0xb39d=function(_0x1d558c,_0x1e497c){_0x1d558c=_0x1d558c-0x0;var _0x15767d=_0x39db[_0x1d558c];return _0x15767d;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0xb39d('0x0')]=function(_0x3f23d2){return _0x3f23d2['define'](_0xb39d('0x1'),attributes,{'tableName':_0xb39d('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb39d('0x3'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x3e82=['chat_offline_messages','utf8mb4','./chatOfflineMessage.attributes','define','ChatOfflineMessage'];(function(_0x6e8056,_0x786ea0){var _0x5c7a56=function(_0xa43aa5){while(--_0xa43aa5){_0x6e8056['push'](_0x6e8056['shift']());}};_0x5c7a56(++_0x786ea0);}(_0x3e82,0x147));var _0x23e8=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x3e82[_0x40a045];return _0x1a687c;};'use strict';var attributes=require(_0x23e8('0x0'));module['exports']=function(_0x48a682){return _0x48a682[_0x23e8('0x1')](_0x23e8('0x2'),attributes,{'tableName':_0x23e8('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x23e8('0x4'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index ce44687..2426662 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 _0x2ae0=['catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result'];(function(_0xbb6084,_0x1612c1){var _0x2db4f0=function(_0x59048){while(--_0x59048){_0xbb6084['push'](_0xbb6084['shift']());}};_0x2db4f0(++_0x1612c1);}(_0x2ae0,0x161));var _0x02ae=function(_0x356c85,_0x22b9c7){_0x356c85=_0x356c85-0x0;var _0x4d6fa1=_0x2ae0[_0x356c85];return _0x4d6fa1;};'use strict';var _=require(_0x02ae('0x0'));var util=require(_0x02ae('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x02ae('0x2'));var fs=require('fs');var Redis=require(_0x02ae('0x3'));var db=require(_0x02ae('0x4'))['db'];var utils=require(_0x02ae('0x5'));var logger=require('../../config/logger')(_0x02ae('0x6'));var config=require(_0x02ae('0x7'));var jayson=require(_0x02ae('0x8'));var client=jayson[_0x02ae('0x9')][_0x02ae('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25edc3,_0x1edc81,_0x174329){return new BPromise(function(_0x2f4312,_0x593b65){return client[_0x02ae('0xb')](_0x25edc3,_0x174329)['then'](function(_0xfc98cb){logger[_0x02ae('0xc')](_0x02ae('0xd'),_0x1edc81,'request\x20sent');logger[_0x02ae('0xe')](_0x02ae('0xf'),_0x1edc81,'request\x20sent',JSON[_0x02ae('0x10')](_0xfc98cb));if(_0xfc98cb[_0x02ae('0x11')]){if(_0xfc98cb[_0x02ae('0x11')]['code']===0x1f4){logger[_0x02ae('0x11')](_0x02ae('0xd'),_0x1edc81,_0xfc98cb[_0x02ae('0x11')]['message']);return _0x593b65(_0xfc98cb[_0x02ae('0x11')]['message']);}logger[_0x02ae('0x11')](_0x02ae('0xd'),_0x1edc81,_0xfc98cb['error'][_0x02ae('0x12')]);return _0x2f4312(_0xfc98cb[_0x02ae('0x11')][_0x02ae('0x12')]);}else{logger[_0x02ae('0xc')](_0x02ae('0xd'),_0x1edc81,_0x02ae('0x13'));_0x2f4312(_0xfc98cb[_0x02ae('0x14')]['message']);}})[_0x02ae('0x15')](function(_0x1135cb){logger[_0x02ae('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x1edc81,_0x1135cb);_0x593b65(_0x1135cb);});});}
\ No newline at end of file
+var _0xc507=['ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x5aedb2,_0x41d9d5){var _0x4010a1=function(_0x233e99){while(--_0x233e99){_0x5aedb2['push'](_0x5aedb2['shift']());}};_0x4010a1(++_0x41d9d5);}(_0xc507,0x73));var _0x7c50=function(_0x40ebff,_0x1dd15e){_0x40ebff=_0x40ebff-0x0;var _0x40122a=_0xc507[_0x40ebff];return _0x40122a;};'use strict';var _=require(_0x7c50('0x0'));var util=require(_0x7c50('0x1'));var moment=require(_0x7c50('0x2'));var BPromise=require(_0x7c50('0x3'));var rs=require(_0x7c50('0x4'));var fs=require('fs');var Redis=require(_0x7c50('0x5'));var db=require(_0x7c50('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x7c50('0x7'))(_0x7c50('0x8'));var config=require('../../config/environment');var jayson=require(_0x7c50('0x9'));var client=jayson[_0x7c50('0xa')][_0x7c50('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2eda30,_0x1ace0d,_0x815f20){return new BPromise(function(_0x5efd32,_0x909310){return client[_0x7c50('0xc')](_0x2eda30,_0x815f20)[_0x7c50('0xd')](function(_0x1df00b){logger[_0x7c50('0xe')](_0x7c50('0xf'),_0x1ace0d,_0x7c50('0x10'));logger[_0x7c50('0x11')](_0x7c50('0x12'),_0x1ace0d,'request\x20sent',JSON[_0x7c50('0x13')](_0x1df00b));if(_0x1df00b[_0x7c50('0x14')]){if(_0x1df00b[_0x7c50('0x14')]['code']===0x1f4){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x1ace0d,_0x1df00b[_0x7c50('0x14')][_0x7c50('0x15')]);return _0x909310(_0x1df00b[_0x7c50('0x14')][_0x7c50('0x15')]);}logger[_0x7c50('0x14')]('ChatOfflineMessage,\x20%s,\x20%s',_0x1ace0d,_0x1df00b['error'][_0x7c50('0x15')]);return _0x5efd32(_0x1df00b['error']['message']);}else{logger[_0x7c50('0xe')](_0x7c50('0xf'),_0x1ace0d,_0x7c50('0x10'));_0x5efd32(_0x1df00b[_0x7c50('0x16')][_0x7c50('0x15')]);}})[_0x7c50('0x17')](function(_0x2515d7){logger[_0x7c50('0x14')](_0x7c50('0xf'),_0x1ace0d,_0x2515d7);_0x909310(_0x2515d7);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 43a89cb..679917c 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 _0xd10c=['/:id','show','post','put','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe'];(function(_0x4e4068,_0x122c31){var _0x2846a4=function(_0x1b9ab4){while(--_0x1b9ab4){_0x4e4068['push'](_0x4e4068['shift']());}};_0x2846a4(++_0x122c31);}(_0xd10c,0x1db));var _0xcd10=function(_0x3c931c,_0x16bba9){_0x3c931c=_0x3c931c-0x0;var _0x5492c4=_0xd10c[_0x3c931c];return _0x5492c4;};'use strict';var multer=require(_0xcd10('0x0'));var util=require('util');var path=require(_0xcd10('0x1'));var timeout=require(_0xcd10('0x2'));var express=require(_0xcd10('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xcd10('0x4'));var interaction=require(_0xcd10('0x5'));var config=require(_0xcd10('0x6'));var controller=require('./chatOfflineMessage.controller');router[_0xcd10('0x7')]('/',auth['isAuthenticated'](),controller[_0xcd10('0x8')]);router[_0xcd10('0x7')]('/describe',auth[_0xcd10('0x9')](),controller[_0xcd10('0xa')]);router[_0xcd10('0x7')](_0xcd10('0xb'),auth[_0xcd10('0x9')](),controller[_0xcd10('0xc')]);router[_0xcd10('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xcd10('0xe')](_0xcd10('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xcd10('0xf')](_0xcd10('0xb'),auth[_0xcd10('0x9')](),controller[_0xcd10('0x10')]);module[_0xcd10('0x11')]=router;
\ No newline at end of file
+var _0x854f=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','describe','/:id','show','post','create','update','delete','exports'];(function(_0x3fd26c,_0x29e6d1){var _0x8b7bbe=function(_0x3217be){while(--_0x3217be){_0x3fd26c['push'](_0x3fd26c['shift']());}};_0x8b7bbe(++_0x29e6d1);}(_0x854f,0x108));var _0xf854=function(_0x52dfcf,_0x26e802){_0x52dfcf=_0x52dfcf-0x0;var _0x4d89cf=_0x854f[_0x52dfcf];return _0x4d89cf;};'use strict';var multer=require(_0xf854('0x0'));var util=require(_0xf854('0x1'));var path=require(_0xf854('0x2'));var timeout=require(_0xf854('0x3'));var express=require(_0xf854('0x4'));var router=express[_0xf854('0x5')]();var fs_extra=require(_0xf854('0x6'));var auth=require(_0xf854('0x7'));var interaction=require(_0xf854('0x8'));var config=require(_0xf854('0x9'));var controller=require(_0xf854('0xa'));router[_0xf854('0xb')]('/',auth[_0xf854('0xc')](),controller[_0xf854('0xd')]);router[_0xf854('0xb')]('/describe',auth['isAuthenticated'](),controller[_0xf854('0xe')]);router[_0xf854('0xb')](_0xf854('0xf'),auth['isAuthenticated'](),controller[_0xf854('0x10')]);router[_0xf854('0x11')]('/',auth['isAuthenticated'](),controller[_0xf854('0x12')]);router['put'](_0xf854('0xf'),auth[_0xf854('0xc')](),controller[_0xf854('0x13')]);router[_0xf854('0x14')](_0xf854('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0xf854('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 8c40783..9f2c95e 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 _0x9b3e=['mouseOver','timeout','INTEGER','sequelize','exports','STRING'];(function(_0x15c211,_0x13093b){var _0x2fc84c=function(_0x37852d){while(--_0x37852d){_0x15c211['push'](_0x15c211['shift']());}};_0x2fc84c(++_0x13093b);}(_0x9b3e,0x1a7));var _0xe9b3=function(_0x4c862c,_0x56c72a){_0x4c862c=_0x4c862c-0x0;var _0x546cf8=_0x9b3e[_0x4c862c];return _0x546cf8;};'use strict';var Sequelize=require(_0xe9b3('0x0'));module[_0xe9b3('0x1')]={'name':{'type':Sequelize[_0xe9b3('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9b3('0x3'),_0xe9b3('0x4')),'defaultValue':_0xe9b3('0x3')},'selector':{'type':Sequelize[_0xe9b3('0x2')]},'timeout':{'type':Sequelize[_0xe9b3('0x5')]}};
\ No newline at end of file
+var _0x7e34=['mouseOver','timeout','INTEGER','sequelize','STRING','ENUM'];(function(_0x160393,_0x4e2ea7){var _0x39865d=function(_0x14362b){while(--_0x14362b){_0x160393['push'](_0x160393['shift']());}};_0x39865d(++_0x4e2ea7);}(_0x7e34,0xb7));var _0x47e3=function(_0x5f1413,_0x4eace2){_0x5f1413=_0x5f1413-0x0;var _0x216666=_0x7e34[_0x5f1413];return _0x216666;};'use strict';var Sequelize=require(_0x47e3('0x0'));module['exports']={'name':{'type':Sequelize[_0x47e3('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x47e3('0x2')](_0x47e3('0x3'),_0x47e3('0x4')),'defaultValue':_0x47e3('0x3')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x47e3('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index f90df80..6569b43 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 _0x06f4=['sendStatus','status','end','offset','undefined','count','limit','Content-Range','apply','reject','update','then','destroy','stack','name','send','show','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','model','fields','length','includeAll','merge','options','find','catch','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x06f4,0x136));var _0x406f=function(_0x3ff609,_0xc1942e){_0x3ff609=_0x3ff609-0x0;var _0x120444=_0x06f4[_0x3ff609];return _0x120444;};'use strict';var emlformat=require(_0x406f('0x0'));var rimraf=require(_0x406f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x406f('0x2'));var rp=require(_0x406f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x406f('0x4'));var util=require('util');var path=require(_0x406f('0x5'));var sox=require(_0x406f('0x6'));var csv=require(_0x406f('0x7'));var ejs=require(_0x406f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x406f('0x9'));var squel=require('squel');var crypto=require(_0x406f('0xa'));var jsforce=require(_0x406f('0xb'));var deskjs=require(_0x406f('0xc'));var toCsv=require('to-csv');var querystring=require(_0x406f('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x406f('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x406f('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x406f('0x10'))('api');var utils=require(_0x406f('0x11'));var config=require(_0x406f('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x406f('0x13'))['db'];function respondWithStatusCode(_0x380382,_0x451592){_0x451592=_0x451592||0xcc;return function(_0x163de4){if(_0x163de4){return _0x380382[_0x406f('0x14')](_0x451592);}return _0x380382[_0x406f('0x15')](_0x451592)[_0x406f('0x16')]();};}function respondWithResult(_0xcc1d6,_0x4522b2){_0x4522b2=_0x4522b2||0xc8;return function(_0x5045e8){if(_0x5045e8){return _0xcc1d6[_0x406f('0x15')](_0x4522b2)['json'](_0x5045e8);}};}function respondWithFilteredResult(_0x1bf795,_0x28fda6){return function(_0x4498d9){if(_0x4498d9){var _0x5c80af=typeof _0x28fda6[_0x406f('0x17')]===_0x406f('0x18')&&typeof _0x28fda6['limit']==='undefined';var _0x11c759=_0x4498d9[_0x406f('0x19')];var _0x509bae=_0x5c80af?0x0:_0x28fda6[_0x406f('0x17')];var _0x57d93a=_0x5c80af?_0x4498d9[_0x406f('0x19')]:_0x28fda6[_0x406f('0x17')]+_0x28fda6[_0x406f('0x1a')];var _0x12bb0f;if(_0x57d93a>=_0x11c759){_0x57d93a=_0x11c759;_0x12bb0f=0xc8;}else{_0x12bb0f=0xce;}_0x1bf795['status'](_0x12bb0f);return _0x1bf795['set'](_0x406f('0x1b'),_0x509bae+'-'+_0x57d93a+'/'+_0x11c759)['json'](_0x4498d9);}return null;};}function patchUpdates(_0x33dd5f){return function(_0x5089b2){try{jsonpatch[_0x406f('0x1c')](_0x5089b2,_0x33dd5f,!![]);}catch(_0x3a1a36){return BPromise[_0x406f('0x1d')](_0x3a1a36);}return _0x5089b2['save']();};}function saveUpdates(_0x58c0d3,_0x518a88){return function(_0x11683){if(_0x11683){return _0x11683[_0x406f('0x1e')](_0x58c0d3)[_0x406f('0x1f')](function(_0x5ebb26){return _0x5ebb26;});}return null;};}function removeEntity(_0x102cfd,_0x5961cc){return function(_0x3dd3d1){if(_0x3dd3d1){return _0x3dd3d1[_0x406f('0x20')]()[_0x406f('0x1f')](function(){_0x102cfd[_0x406f('0x15')](0xcc)[_0x406f('0x16')]();});}};}function handleEntityNotFound(_0x51ac15,_0x55a4ee){return function(_0x81589c){if(!_0x81589c){_0x51ac15['sendStatus'](0x194);}return _0x81589c;};}function handleError(_0x467a3a,_0xa240d8){_0xa240d8=_0xa240d8||0x1f4;return function(_0x4ff1de){logger['error'](_0x4ff1de[_0x406f('0x21')]);if(_0x4ff1de['name']){delete _0x4ff1de[_0x406f('0x22')];}_0x467a3a[_0x406f('0x15')](_0xa240d8)[_0x406f('0x23')](_0x4ff1de);};}exports[_0x406f('0x24')]=function(_0x2c439b,_0x174e47){var _0x224bd0={'raw':!![],'where':{'id':_0x2c439b['params']['id']}},_0x2b41dd={};_0x2b41dd['model']=_[_0x406f('0x25')](db[_0x406f('0x26')][_0x406f('0x27')]);_0x2b41dd[_0x406f('0x28')]=_['keys'](_0x2c439b['query']);_0x2b41dd[_0x406f('0x29')]=_[_0x406f('0x2a')](_0x2b41dd['model'],_0x2b41dd['query']);_0x224bd0[_0x406f('0x2b')]=_[_0x406f('0x2a')](_0x2b41dd[_0x406f('0x2c')],qs[_0x406f('0x2d')](_0x2c439b[_0x406f('0x28')][_0x406f('0x2d')]));_0x224bd0[_0x406f('0x2b')]=_0x224bd0[_0x406f('0x2b')][_0x406f('0x2e')]?_0x224bd0[_0x406f('0x2b')]:_0x2b41dd[_0x406f('0x2c')];if(_0x2c439b[_0x406f('0x28')][_0x406f('0x2f')]){_0x224bd0['include']=[{'all':!![]}];}_0x224bd0=_[_0x406f('0x30')]({},_0x224bd0,_0x2c439b[_0x406f('0x31')]);return db[_0x406f('0x26')][_0x406f('0x32')](_0x224bd0)[_0x406f('0x1f')](handleEntityNotFound(_0x174e47,null))[_0x406f('0x1f')](respondWithResult(_0x174e47,null))[_0x406f('0x33')](handleError(_0x174e47,null));};exports[_0x406f('0x34')]=function(_0x3dc67b,_0x3fdc25){return db['ChatProactiveAction'][_0x406f('0x34')](_0x3dc67b[_0x406f('0x35')],{})[_0x406f('0x1f')](respondWithResult(_0x3fdc25,0xc9))[_0x406f('0x33')](handleError(_0x3fdc25,null));};exports[_0x406f('0x1e')]=function(_0x2a3cc1,_0x58108b){if(_0x2a3cc1['body']['id']){delete _0x2a3cc1[_0x406f('0x35')]['id'];}return db[_0x406f('0x26')]['find']({'where':{'id':_0x2a3cc1[_0x406f('0x36')]['id']}})['then'](handleEntityNotFound(_0x58108b,null))[_0x406f('0x1f')](saveUpdates(_0x2a3cc1[_0x406f('0x35')],null))[_0x406f('0x1f')](respondWithResult(_0x58108b,null))['catch'](handleError(_0x58108b,null));};exports[_0x406f('0x20')]=function(_0x147448,_0x3e3546){return db[_0x406f('0x26')][_0x406f('0x32')]({'where':{'id':_0x147448[_0x406f('0x36')]['id']}})[_0x406f('0x1f')](handleEntityNotFound(_0x3e3546,null))[_0x406f('0x1f')](removeEntity(_0x3e3546,null))[_0x406f('0x33')](handleError(_0x3e3546,null));};
\ No newline at end of file
+var _0x59c3=['crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','filters','intersection','query','attributes','fields','includeAll','merge','options','find','create','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash'];(function(_0x46a38b,_0x16ffb5){var _0x346e75=function(_0x34f8d0){while(--_0x34f8d0){_0x46a38b['push'](_0x46a38b['shift']());}};_0x346e75(++_0x16ffb5);}(_0x59c3,0x133));var _0x359c=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0x59c3[_0x1cfa0d];return _0xe33279;};'use strict';var emlformat=require(_0x359c('0x0'));var rimraf=require(_0x359c('0x1'));var zipdir=require(_0x359c('0x2'));var jsonpatch=require(_0x359c('0x3'));var rp=require(_0x359c('0x4'));var moment=require(_0x359c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x359c('0x6'));var util=require(_0x359c('0x7'));var path=require(_0x359c('0x8'));var sox=require(_0x359c('0x9'));var csv=require(_0x359c('0xa'));var ejs=require(_0x359c('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x359c('0xc'));var squel=require('squel');var crypto=require(_0x359c('0xd'));var jsforce=require(_0x359c('0xe'));var deskjs=require(_0x359c('0xf'));var toCsv=require(_0x359c('0xa'));var querystring=require('querystring');var Papa=require(_0x359c('0x10'));var Redis=require('ioredis');var authService=require(_0x359c('0x11'));var qs=require(_0x359c('0x12'));var as=require(_0x359c('0x13'));var hardwareService=require(_0x359c('0x14'));var logger=require(_0x359c('0x15'))(_0x359c('0x16'));var utils=require('../../config/utils');var config=require(_0x359c('0x17'));var licenseUtil=require(_0x359c('0x18'));var db=require(_0x359c('0x19'))['db'];function respondWithStatusCode(_0x18fab2,_0x1d4d8a){_0x1d4d8a=_0x1d4d8a||0xcc;return function(_0x29d295){if(_0x29d295){return _0x18fab2[_0x359c('0x1a')](_0x1d4d8a);}return _0x18fab2[_0x359c('0x1b')](_0x1d4d8a)[_0x359c('0x1c')]();};}function respondWithResult(_0x4413ce,_0x2cf668){_0x2cf668=_0x2cf668||0xc8;return function(_0xd07946){if(_0xd07946){return _0x4413ce['status'](_0x2cf668)[_0x359c('0x1d')](_0xd07946);}};}function respondWithFilteredResult(_0x1901cc,_0x4d4860){return function(_0x80b8d8){if(_0x80b8d8){var _0x186e45=typeof _0x4d4860[_0x359c('0x1e')]===_0x359c('0x1f')&&typeof _0x4d4860[_0x359c('0x20')]===_0x359c('0x1f');var _0x42d3b5=_0x80b8d8[_0x359c('0x21')];var _0x2931eb=_0x186e45?0x0:_0x4d4860[_0x359c('0x1e')];var _0x2bdd3c=_0x186e45?_0x80b8d8[_0x359c('0x21')]:_0x4d4860[_0x359c('0x1e')]+_0x4d4860[_0x359c('0x20')];var _0x19d0da;if(_0x2bdd3c>=_0x42d3b5){_0x2bdd3c=_0x42d3b5;_0x19d0da=0xc8;}else{_0x19d0da=0xce;}_0x1901cc[_0x359c('0x1b')](_0x19d0da);return _0x1901cc[_0x359c('0x22')](_0x359c('0x23'),_0x2931eb+'-'+_0x2bdd3c+'/'+_0x42d3b5)['json'](_0x80b8d8);}return null;};}function patchUpdates(_0x395ef8){return function(_0x5b305b){try{jsonpatch[_0x359c('0x24')](_0x5b305b,_0x395ef8,!![]);}catch(_0x5df429){return BPromise[_0x359c('0x25')](_0x5df429);}return _0x5b305b[_0x359c('0x26')]();};}function saveUpdates(_0x34f747,_0x402114){return function(_0x6e731c){if(_0x6e731c){return _0x6e731c[_0x359c('0x27')](_0x34f747)[_0x359c('0x28')](function(_0x1fe73f){return _0x1fe73f;});}return null;};}function removeEntity(_0x15b7c7,_0x1d29df){return function(_0x3e9cdf){if(_0x3e9cdf){return _0x3e9cdf[_0x359c('0x29')]()[_0x359c('0x28')](function(){_0x15b7c7[_0x359c('0x1b')](0xcc)[_0x359c('0x1c')]();});}};}function handleEntityNotFound(_0xf6f24,_0x4fbc28){return function(_0xf0770b){if(!_0xf0770b){_0xf6f24[_0x359c('0x1a')](0x194);}return _0xf0770b;};}function handleError(_0x35569d,_0x540fc9){_0x540fc9=_0x540fc9||0x1f4;return function(_0x1436a8){logger[_0x359c('0x2a')](_0x1436a8[_0x359c('0x2b')]);if(_0x1436a8['name']){delete _0x1436a8[_0x359c('0x2c')];}_0x35569d['status'](_0x540fc9)[_0x359c('0x2d')](_0x1436a8);};}exports[_0x359c('0x2e')]=function(_0x1d52ac,_0x31d65c){var _0x512fc0={'raw':!![],'where':{'id':_0x1d52ac[_0x359c('0x2f')]['id']}},_0x2e42f6={};_0x2e42f6[_0x359c('0x30')]=_[_0x359c('0x31')](db[_0x359c('0x32')][_0x359c('0x33')]);_0x2e42f6['query']=_['keys'](_0x1d52ac['query']);_0x2e42f6[_0x359c('0x34')]=_[_0x359c('0x35')](_0x2e42f6['model'],_0x2e42f6[_0x359c('0x36')]);_0x512fc0[_0x359c('0x37')]=_[_0x359c('0x35')](_0x2e42f6[_0x359c('0x30')],qs[_0x359c('0x38')](_0x1d52ac['query'][_0x359c('0x38')]));_0x512fc0[_0x359c('0x37')]=_0x512fc0[_0x359c('0x37')]['length']?_0x512fc0['attributes']:_0x2e42f6['model'];if(_0x1d52ac[_0x359c('0x36')][_0x359c('0x39')]){_0x512fc0['include']=[{'all':!![]}];}_0x512fc0=_[_0x359c('0x3a')]({},_0x512fc0,_0x1d52ac[_0x359c('0x3b')]);return db[_0x359c('0x32')][_0x359c('0x3c')](_0x512fc0)[_0x359c('0x28')](handleEntityNotFound(_0x31d65c,null))[_0x359c('0x28')](respondWithResult(_0x31d65c,null))['catch'](handleError(_0x31d65c,null));};exports[_0x359c('0x3d')]=function(_0x326baa,_0xc2f4b6){return db[_0x359c('0x32')][_0x359c('0x3d')](_0x326baa[_0x359c('0x3e')],{})['then'](respondWithResult(_0xc2f4b6,0xc9))[_0x359c('0x3f')](handleError(_0xc2f4b6,null));};exports['update']=function(_0x5366e0,_0x1cf3f8){if(_0x5366e0[_0x359c('0x3e')]['id']){delete _0x5366e0['body']['id'];}return db[_0x359c('0x32')][_0x359c('0x3c')]({'where':{'id':_0x5366e0[_0x359c('0x2f')]['id']}})[_0x359c('0x28')](handleEntityNotFound(_0x1cf3f8,null))['then'](saveUpdates(_0x5366e0[_0x359c('0x3e')],null))[_0x359c('0x28')](respondWithResult(_0x1cf3f8,null))[_0x359c('0x3f')](handleError(_0x1cf3f8,null));};exports['destroy']=function(_0x16ff10,_0x56d973){return db[_0x359c('0x32')]['find']({'where':{'id':_0x16ff10[_0x359c('0x2f')]['id']}})[_0x359c('0x28')](handleEntityNotFound(_0x56d973,null))['then'](removeEntity(_0x56d973,null))['catch'](handleError(_0x56d973,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 5c97736..49e2287 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 _0x5146=['define','ChatProactiveAction','lodash','util','../../config/logger','api','request-promise','path','../../config/environment'];(function(_0x1da7c5,_0xb292c5){var _0x575cd=function(_0x54229e){while(--_0x54229e){_0x1da7c5['push'](_0x1da7c5['shift']());}};_0x575cd(++_0xb292c5);}(_0x5146,0x1c4));var _0x6514=function(_0x560375,_0x34359d){_0x560375=_0x560375-0x0;var _0x298bbc=_0x5146[_0x560375];return _0x298bbc;};'use strict';var _=require(_0x6514('0x0'));var util=require(_0x6514('0x1'));var logger=require(_0x6514('0x2'))(_0x6514('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6514('0x4'));var fs=require('fs');var path=require(_0x6514('0x5'));var rimraf=require('rimraf');var config=require(_0x6514('0x6'));var attributes=require('./chatProactiveAction.attributes');module['exports']=function(_0x1deb07,_0x16cfd1){return _0x1deb07[_0x6514('0x7')](_0x6514('0x8'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf68f=['moment','bluebird','request-promise','path','rimraf','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','lodash','util','../../config/logger','api'];(function(_0x27a027,_0x7f9a8f){var _0x4fc60d=function(_0x568acc){while(--_0x568acc){_0x27a027['push'](_0x27a027['shift']());}};_0x4fc60d(++_0x7f9a8f);}(_0xf68f,0x168));var _0xff68=function(_0xa8ef70,_0x364d2f){_0xa8ef70=_0xa8ef70-0x0;var _0x447423=_0xf68f[_0xa8ef70];return _0x447423;};'use strict';var _=require(_0xff68('0x0'));var util=require(_0xff68('0x1'));var logger=require(_0xff68('0x2'))(_0xff68('0x3'));var moment=require(_0xff68('0x4'));var BPromise=require(_0xff68('0x5'));var rp=require(_0xff68('0x6'));var fs=require('fs');var path=require(_0xff68('0x7'));var rimraf=require(_0xff68('0x8'));var config=require('../../config/environment');var attributes=require(_0xff68('0x9'));module[_0xff68('0xa')]=function(_0x473cce,_0x28ea54){return _0x473cce[_0xff68('0xb')](_0xff68('0xc'),attributes,{'tableName':'chat_proactive_actions','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 7a5c378..bbd2714 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 _0x67c7=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatProactiveAction,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird'];(function(_0xdc37a1,_0x53ebb9){var _0x99b4fe=function(_0x2811e3){while(--_0x2811e3){_0xdc37a1['push'](_0xdc37a1['shift']());}};_0x99b4fe(++_0x53ebb9);}(_0x67c7,0xfa));var _0x767c=function(_0x311c35,_0x54a2b0){_0x311c35=_0x311c35-0x0;var _0x31ff65=_0x67c7[_0x311c35];return _0x31ff65;};'use strict';var _=require(_0x767c('0x0'));var util=require(_0x767c('0x1'));var moment=require('moment');var BPromise=require(_0x767c('0x2'));var rs=require(_0x767c('0x3'));var fs=require('fs');var Redis=require(_0x767c('0x4'));var db=require(_0x767c('0x5'))['db'];var utils=require(_0x767c('0x6'));var logger=require('../../config/logger')(_0x767c('0x7'));var config=require(_0x767c('0x8'));var jayson=require(_0x767c('0x9'));var client=jayson[_0x767c('0xa')][_0x767c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5ef4b6,_0x3680aa,_0x475145){return new BPromise(function(_0xdea499,_0x166880){return client[_0x767c('0xc')](_0x5ef4b6,_0x475145)['then'](function(_0x138c99){logger[_0x767c('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x3680aa,_0x767c('0xe'));logger['debug'](_0x767c('0xf'),_0x3680aa,_0x767c('0xe'),JSON[_0x767c('0x10')](_0x138c99));if(_0x138c99['error']){if(_0x138c99[_0x767c('0x11')][_0x767c('0x12')]===0x1f4){logger[_0x767c('0x11')](_0x767c('0x13'),_0x3680aa,_0x138c99[_0x767c('0x11')][_0x767c('0x14')]);return _0x166880(_0x138c99[_0x767c('0x11')][_0x767c('0x14')]);}logger['error'](_0x767c('0x13'),_0x3680aa,_0x138c99[_0x767c('0x11')]['message']);return _0xdea499(_0x138c99[_0x767c('0x11')][_0x767c('0x14')]);}else{logger[_0x767c('0xd')](_0x767c('0x13'),_0x3680aa,'request\x20sent');_0xdea499(_0x138c99[_0x767c('0x15')][_0x767c('0x14')]);}})[_0x767c('0x16')](function(_0x5762e8){logger[_0x767c('0x11')](_0x767c('0x13'),_0x3680aa,_0x5762e8);_0x166880(_0x5762e8);});});}
\ No newline at end of file
+var _0xbd40=['jayson/promise','client','http','request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0xbd40,0x98));var _0x0bd4=function(_0x975e75,_0x42b16c){_0x975e75=_0x975e75-0x0;var _0x3c6f06=_0xbd40[_0x975e75];return _0x3c6f06;};'use strict';var _=require(_0x0bd4('0x0'));var util=require(_0x0bd4('0x1'));var moment=require(_0x0bd4('0x2'));var BPromise=require(_0x0bd4('0x3'));var rs=require(_0x0bd4('0x4'));var fs=require('fs');var Redis=require(_0x0bd4('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0bd4('0x6'));var logger=require(_0x0bd4('0x7'))(_0x0bd4('0x8'));var config=require('../../config/environment');var jayson=require(_0x0bd4('0x9'));var client=jayson[_0x0bd4('0xa')][_0x0bd4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5fed53,_0x4f12ff,_0x536b98){return new BPromise(function(_0x4980d2,_0xa06455){return client[_0x0bd4('0xc')](_0x5fed53,_0x536b98)['then'](function(_0x324dbd){logger[_0x0bd4('0xd')](_0x0bd4('0xe'),_0x4f12ff,_0x0bd4('0xf'));logger[_0x0bd4('0x10')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x4f12ff,'request\x20sent',JSON[_0x0bd4('0x11')](_0x324dbd));if(_0x324dbd[_0x0bd4('0x12')]){if(_0x324dbd[_0x0bd4('0x12')][_0x0bd4('0x13')]===0x1f4){logger['error'](_0x0bd4('0xe'),_0x4f12ff,_0x324dbd['error'][_0x0bd4('0x14')]);return _0xa06455(_0x324dbd['error'][_0x0bd4('0x14')]);}logger[_0x0bd4('0x12')](_0x0bd4('0xe'),_0x4f12ff,_0x324dbd[_0x0bd4('0x12')][_0x0bd4('0x14')]);return _0x4980d2(_0x324dbd['error'][_0x0bd4('0x14')]);}else{logger[_0x0bd4('0xd')](_0x0bd4('0xe'),_0x4f12ff,_0x0bd4('0xf'));_0x4980d2(_0x324dbd[_0x0bd4('0x15')]['message']);}})[_0x0bd4('0x16')](function(_0x5e3018){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x4f12ff,_0x5e3018);_0xa06455(_0x5e3018);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 267f459..d839b29 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 _0xb138=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id','isAuthenticated','post','create','destroy','exports','multer','util','path'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0xb138,0x1dd));var _0x8b13=function(_0x44c98f,_0x17fbd0){_0x44c98f=_0x44c98f-0x0;var _0x5da512=_0xb138[_0x44c98f];return _0x5da512;};'use strict';var multer=require(_0x8b13('0x0'));var util=require(_0x8b13('0x1'));var path=require(_0x8b13('0x2'));var timeout=require(_0x8b13('0x3'));var express=require(_0x8b13('0x4'));var router=express[_0x8b13('0x5')]();var fs_extra=require(_0x8b13('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8b13('0x7'));var config=require(_0x8b13('0x8'));var controller=require(_0x8b13('0x9'));router['get'](_0x8b13('0xa'),auth[_0x8b13('0xb')](),controller['show']);router[_0x8b13('0xc')]('/',auth[_0x8b13('0xb')](),controller[_0x8b13('0xd')]);router['put'](_0x8b13('0xa'),auth[_0x8b13('0xb')](),controller['update']);router['delete'](_0x8b13('0xa'),auth[_0x8b13('0xb')](),controller[_0x8b13('0xe')]);module[_0x8b13('0xf')]=router;
\ No newline at end of file
+var _0x7da7=['util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','get','/:id','show','isAuthenticated','create','put','delete','exports','multer'];(function(_0x57bb3a,_0x237ede){var _0x5decaa=function(_0x262a8f){while(--_0x262a8f){_0x57bb3a['push'](_0x57bb3a['shift']());}};_0x5decaa(++_0x237ede);}(_0x7da7,0x10d));var _0x77da=function(_0x1b3a5c,_0x2f9d5f){_0x1b3a5c=_0x1b3a5c-0x0;var _0x2ae8cb=_0x7da7[_0x1b3a5c];return _0x2ae8cb;};'use strict';var multer=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var path=require(_0x77da('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x77da('0x3')]();var fs_extra=require(_0x77da('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x77da('0x5'));var config=require(_0x77da('0x6'));var controller=require('./chatProactiveAction.controller');router[_0x77da('0x7')](_0x77da('0x8'),auth['isAuthenticated'](),controller[_0x77da('0x9')]);router['post']('/',auth[_0x77da('0xa')](),controller[_0x77da('0xb')]);router[_0x77da('0xc')](_0x77da('0x8'),auth[_0x77da('0xa')](),controller['update']);router[_0x77da('0xd')](_0x77da('0x8'),auth[_0x77da('0xa')](),controller['destroy']);module[_0x77da('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 2e5e1ac..9a3923a 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 _0xdb51=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x493898,_0x31c6b4){var _0x74c353=function(_0x2391b3){while(--_0x2391b3){_0x493898['push'](_0x493898['shift']());}};_0x74c353(++_0x31c6b4);}(_0xdb51,0x12c));var _0x1db5=function(_0x21e920,_0x296dc3){_0x21e920=_0x21e920-0x0;var _0x47f9c5=_0xdb51[_0x21e920];return _0x47f9c5;};'use strict';var Sequelize=require(_0x1db5('0x0'));module[_0x1db5('0x1')]={'name':{'type':Sequelize[_0x1db5('0x2')],'unique':_0x1db5('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1db5('0x2')]},'timeout':{'type':Sequelize[_0x1db5('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1db5('0x5')](_0x1db5('0x6'),_0x1db5('0x7'),_0x1db5('0x8'))}};
\ No newline at end of file
+var _0x26e5=['STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x32854c,_0x1ceeea){var _0x1b3012=function(_0x15ca7d){while(--_0x15ca7d){_0x32854c['push'](_0x32854c['shift']());}};_0x1b3012(++_0x1ceeea);}(_0x26e5,0xfb));var _0x526e=function(_0xf4f343,_0x41fe4a){_0xf4f343=_0xf4f343-0x0;var _0x4cda68=_0x26e5[_0xf4f343];return _0x4cda68;};'use strict';var Sequelize=require(_0x526e('0x0'));module['exports']={'name':{'type':Sequelize[_0x526e('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x526e('0x1')]},'timeout':{'type':Sequelize[_0x526e('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x526e('0x3')](_0x526e('0x4'),_0x526e('0x5'),_0x526e('0x6'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 165f0a9..e8590f4 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 _0x9a77=['addAgents','omit','getAgents','findOne','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','ejs','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','jayson/promise','client','http','then','info','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset','undefined','count','Content-Range','reject','save','update','destroy','ChatQueues','stack','name','send','index','map','ChatQueue','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','params','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserChatQueue','ChatQueueId','findAll','findAndCountAll','UserId','agent','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','ids','Team','User','online','interface','flatMap','sequelize','transaction','addTeams','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','Agents','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','userChatQueue:remove'];(function(_0x2d8e0e,_0x40cd18){var _0x3ff08f=function(_0x5e41cb){while(--_0x5e41cb){_0x2d8e0e['push'](_0x2d8e0e['shift']());}};_0x3ff08f(++_0x40cd18);}(_0x9a77,0x9b));var _0x79a7=function(_0x475eca,_0x211133){_0x475eca=_0x475eca-0x0;var _0x4d007a=_0x9a77[_0x475eca];return _0x4d007a;};'use strict';var emlformat=require(_0x79a7('0x0'));var rimraf=require(_0x79a7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x79a7('0x2'));var rp=require(_0x79a7('0x3'));var moment=require(_0x79a7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x79a7('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x79a7('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x79a7('0x7'));var squel=require(_0x79a7('0x8'));var crypto=require(_0x79a7('0x9'));var jsforce=require(_0x79a7('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x79a7('0xb'));var querystring=require('querystring');var Papa=require(_0x79a7('0xc'));var Redis=require(_0x79a7('0xd'));var authService=require(_0x79a7('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x79a7('0xf'));var hardwareService=require(_0x79a7('0x10'));var logger=require(_0x79a7('0x11'))(_0x79a7('0x12'));var utils=require(_0x79a7('0x13'));var config=require(_0x79a7('0x14'));var licenseUtil=require(_0x79a7('0x15'));var db=require(_0x79a7('0x16'))['db'];config[_0x79a7('0x17')]=_[_0x79a7('0x18')](config['redis'],{'host':_0x79a7('0x19'),'port':0x18eb});var socket=require(_0x79a7('0x1a'))(new Redis(config[_0x79a7('0x17')]));require(_0x79a7('0x1b'))['register'](socket);var jayson=require(_0x79a7('0x1c'));var client=jayson[_0x79a7('0x1d')][_0x79a7('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x334b03,_0x1dc46b,_0x483608,_0x5b7d49){return new BPromise(function(_0x5bc0d8,_0x7b8a9b){var _0x234b74=_0x5b7d49||client;return _0x234b74['request'](_0x334b03,_0x483608)[_0x79a7('0x1f')](function(_0x3c3d83){logger[_0x79a7('0x20')]('ChatQueue,\x20%s,\x20%s',_0x1dc46b,'request\x20sent');logger[_0x79a7('0x21')](_0x79a7('0x22'),_0x1dc46b,'request\x20sent',JSON[_0x79a7('0x23')](_0x3c3d83));if(_0x3c3d83[_0x79a7('0x24')]){if(_0x3c3d83[_0x79a7('0x24')][_0x79a7('0x25')]===0x1f4){logger[_0x79a7('0x24')](_0x79a7('0x26'),_0x1dc46b,_0x3c3d83['error']['message']);return _0x7b8a9b(_0x3c3d83[_0x79a7('0x24')]['message']);}logger[_0x79a7('0x24')](_0x79a7('0x26'),_0x1dc46b,_0x3c3d83[_0x79a7('0x24')][_0x79a7('0x27')]);return _0x5bc0d8(_0x3c3d83[_0x79a7('0x24')][_0x79a7('0x27')]);}else{logger[_0x79a7('0x20')](_0x79a7('0x26'),_0x1dc46b,'request\x20sent');_0x5bc0d8(_0x3c3d83[_0x79a7('0x28')][_0x79a7('0x27')]);}})[_0x79a7('0x29')](function(_0x3dad54){logger['error']('ChatQueue,\x20%s,\x20%s',_0x1dc46b,_0x3dad54);_0x7b8a9b(_0x3dad54);});});}function respondWithStatusCode(_0x33e46c,_0x25f99a){_0x25f99a=_0x25f99a||0xcc;return function(_0x5d0b07){if(_0x5d0b07){return _0x33e46c[_0x79a7('0x2a')](_0x25f99a);}return _0x33e46c[_0x79a7('0x2b')](_0x25f99a)[_0x79a7('0x2c')]();};}function respondWithResult(_0x339ec7,_0x7a7e93){_0x7a7e93=_0x7a7e93||0xc8;return function(_0x499903){if(_0x499903){return _0x339ec7[_0x79a7('0x2b')](_0x7a7e93)['json'](_0x499903);}};}function respondWithFilteredResult(_0x1feda0,_0x137390){return function(_0x96bce3){if(_0x96bce3){var _0x3caffc=typeof _0x137390[_0x79a7('0x2d')]===_0x79a7('0x2e')&&typeof _0x137390['limit']===_0x79a7('0x2e');var _0x3bc6c3=_0x96bce3[_0x79a7('0x2f')];var _0x33c105=_0x3caffc?0x0:_0x137390[_0x79a7('0x2d')];var _0x24fcf4=_0x3caffc?_0x96bce3[_0x79a7('0x2f')]:_0x137390[_0x79a7('0x2d')]+_0x137390['limit'];var _0x1ba0b5;if(_0x24fcf4>=_0x3bc6c3){_0x24fcf4=_0x3bc6c3;_0x1ba0b5=0xc8;}else{_0x1ba0b5=0xce;}_0x1feda0[_0x79a7('0x2b')](_0x1ba0b5);return _0x1feda0['set'](_0x79a7('0x30'),_0x33c105+'-'+_0x24fcf4+'/'+_0x3bc6c3)['json'](_0x96bce3);}return null;};}function patchUpdates(_0x12d4f4){return function(_0x3b9c1d){try{jsonpatch['apply'](_0x3b9c1d,_0x12d4f4,!![]);}catch(_0x2d57f1){return BPromise[_0x79a7('0x31')](_0x2d57f1);}return _0x3b9c1d[_0x79a7('0x32')]();};}function saveUpdates(_0x3ede67,_0x403a51){return function(_0x29b9ae){if(_0x29b9ae){return _0x29b9ae[_0x79a7('0x33')](_0x3ede67)[_0x79a7('0x1f')](function(_0x42572e){return _0x42572e;});}return null;};}function removeEntity(_0x5cca31,_0x30dcb5){return function(_0x40f4e4){if(_0x40f4e4){return _0x40f4e4[_0x79a7('0x34')]()[_0x79a7('0x1f')](function(){var _0x5e5f1e=_0x40f4e4['get']({'plain':!![]});var _0x475a34=_0x79a7('0x35');return db['UserProfileResource'][_0x79a7('0x34')]({'where':{'type':_0x475a34,'resourceId':_0x5e5f1e['id']}})['then'](function(){return _0x40f4e4;});})[_0x79a7('0x1f')](function(){_0x5cca31[_0x79a7('0x2b')](0xcc)[_0x79a7('0x2c')]();});}};}function handleEntityNotFound(_0x213750,_0x4bfd44){return function(_0x56b4ed){if(!_0x56b4ed){_0x213750[_0x79a7('0x2a')](0x194);}return _0x56b4ed;};}function handleError(_0x1e70af,_0x5c9497){_0x5c9497=_0x5c9497||0x1f4;return function(_0xa8e97){logger[_0x79a7('0x24')](_0xa8e97[_0x79a7('0x36')]);if(_0xa8e97[_0x79a7('0x37')]){delete _0xa8e97[_0x79a7('0x37')];}_0x1e70af['status'](_0x5c9497)[_0x79a7('0x38')](_0xa8e97);};}exports[_0x79a7('0x39')]=function(_0x520a1d,_0x1e9191){var _0x25e9f6={},_0x28a0f5={},_0x2627e8={'count':0x0,'rows':[]};var _0x45aa62=_[_0x79a7('0x3a')](db[_0x79a7('0x3b')][_0x79a7('0x3c')],function(_0x5f0691){return{'name':_0x5f0691['fieldName'],'type':_0x5f0691[_0x79a7('0x3d')][_0x79a7('0x3e')]};});_0x28a0f5[_0x79a7('0x3f')]=_[_0x79a7('0x3a')](_0x45aa62,_0x79a7('0x37'));_0x28a0f5[_0x79a7('0x40')]=_['keys'](_0x520a1d[_0x79a7('0x40')]);_0x28a0f5[_0x79a7('0x41')]=_[_0x79a7('0x42')](_0x28a0f5[_0x79a7('0x3f')],_0x28a0f5['query']);_0x25e9f6[_0x79a7('0x43')]=_['intersection'](_0x28a0f5[_0x79a7('0x3f')],qs[_0x79a7('0x44')](_0x520a1d[_0x79a7('0x40')][_0x79a7('0x44')]));_0x25e9f6[_0x79a7('0x43')]=_0x25e9f6['attributes'][_0x79a7('0x45')]?_0x25e9f6['attributes']:_0x28a0f5[_0x79a7('0x3f')];if(!_0x520a1d[_0x79a7('0x40')][_0x79a7('0x46')](_0x79a7('0x47'))){_0x25e9f6[_0x79a7('0x48')]=qs[_0x79a7('0x48')](_0x520a1d['query'][_0x79a7('0x48')]);_0x25e9f6[_0x79a7('0x2d')]=qs['offset'](_0x520a1d[_0x79a7('0x40')][_0x79a7('0x2d')]);}_0x25e9f6[_0x79a7('0x49')]=qs[_0x79a7('0x4a')](_0x520a1d['query'][_0x79a7('0x4a')]);_0x25e9f6[_0x79a7('0x4b')]=qs[_0x79a7('0x41')](_[_0x79a7('0x4c')](_0x520a1d[_0x79a7('0x40')],_0x28a0f5[_0x79a7('0x41')]),_0x45aa62);if(_0x520a1d['query'][_0x79a7('0x4d')]){_0x25e9f6[_0x79a7('0x4b')]=_[_0x79a7('0x4e')](_0x25e9f6[_0x79a7('0x4b')],{'$or':_[_0x79a7('0x3a')](_0x45aa62,function(_0xead68d){if(_0xead68d['type']!==_0x79a7('0x4f')){var _0x2ccde2={};_0x2ccde2[_0xead68d[_0x79a7('0x37')]]={'$like':'%'+_0x520a1d[_0x79a7('0x40')][_0x79a7('0x4d')]+'%'};return _0x2ccde2;}})});}_0x25e9f6=_[_0x79a7('0x4e')]({},_0x25e9f6,_0x520a1d[_0x79a7('0x50')]);var _0x3bb8f0={'where':_0x25e9f6['where']};return db[_0x79a7('0x3b')][_0x79a7('0x2f')](_0x3bb8f0)[_0x79a7('0x1f')](function(_0x495f2c){_0x2627e8['count']=_0x495f2c;if(_0x520a1d[_0x79a7('0x40')][_0x79a7('0x51')]){_0x25e9f6[_0x79a7('0x52')]=[{'all':!![]}];}return db['ChatQueue']['findAll'](_0x25e9f6);})[_0x79a7('0x1f')](function(_0x19eff4){_0x2627e8['rows']=_0x19eff4;return _0x2627e8;})[_0x79a7('0x1f')](respondWithFilteredResult(_0x1e9191,_0x25e9f6))[_0x79a7('0x29')](handleError(_0x1e9191,null));};exports['show']=function(_0x386444,_0x5ab165){var _0x26073d={'raw':!![],'where':{'id':_0x386444[_0x79a7('0x53')]['id']}},_0x37427c={};_0x37427c[_0x79a7('0x3f')]=_[_0x79a7('0x54')](db[_0x79a7('0x3b')][_0x79a7('0x3c')]);_0x37427c['query']=_[_0x79a7('0x54')](_0x386444['query']);_0x37427c[_0x79a7('0x41')]=_[_0x79a7('0x42')](_0x37427c[_0x79a7('0x3f')],_0x37427c[_0x79a7('0x40')]);_0x26073d[_0x79a7('0x43')]=_['intersection'](_0x37427c[_0x79a7('0x3f')],qs[_0x79a7('0x44')](_0x386444[_0x79a7('0x40')][_0x79a7('0x44')]));_0x26073d[_0x79a7('0x43')]=_0x26073d['attributes'][_0x79a7('0x45')]?_0x26073d[_0x79a7('0x43')]:_0x37427c[_0x79a7('0x3f')];if(_0x386444[_0x79a7('0x40')][_0x79a7('0x51')]){_0x26073d['include']=[{'all':!![]}];}_0x26073d=_[_0x79a7('0x4e')]({},_0x26073d,_0x386444[_0x79a7('0x50')]);return db[_0x79a7('0x3b')]['find'](_0x26073d)[_0x79a7('0x1f')](handleEntityNotFound(_0x5ab165,null))[_0x79a7('0x1f')](respondWithResult(_0x5ab165,null))[_0x79a7('0x29')](handleError(_0x5ab165,null));};exports[_0x79a7('0x55')]=function(_0x48cf93,_0x3d5eca){return db[_0x79a7('0x3b')]['create'](_0x48cf93[_0x79a7('0x56')],{})[_0x79a7('0x1f')](function(_0x4c374d){var _0x4af522=_0x48cf93[_0x79a7('0x57')]['get']({'plain':!![]});if(!_0x4af522)throw new Error(_0x79a7('0x58'));if(_0x4af522[_0x79a7('0x59')]==='user'){var _0x27cb82=_0x4c374d[_0x79a7('0x5a')]({'plain':!![]});var _0x349e68=_0x79a7('0x35');return db[_0x79a7('0x5b')][_0x79a7('0x5c')]({'where':{'name':_0x349e68,'userProfileId':_0x4af522[_0x79a7('0x5d')]},'raw':!![]})[_0x79a7('0x1f')](function(_0x9127c2){if(_0x9127c2&&_0x9127c2[_0x79a7('0x5e')]===0x0){return db[_0x79a7('0x5f')]['create']({'name':_0x27cb82[_0x79a7('0x37')],'resourceId':_0x27cb82['id'],'type':_0x9127c2['name'],'sectionId':_0x9127c2['id']},{})[_0x79a7('0x1f')](function(){return _0x4c374d;});}else{return _0x4c374d;}})['catch'](function(_0x1677e2){logger['error'](_0x79a7('0x60'),_0x1677e2);throw _0x1677e2;});}return _0x4c374d;})[_0x79a7('0x1f')](respondWithResult(_0x3d5eca,0xc9))[_0x79a7('0x29')](handleError(_0x3d5eca,null));};exports['update']=function(_0xf6274d,_0x5e3fc3){if(_0xf6274d[_0x79a7('0x56')]['id']){delete _0xf6274d[_0x79a7('0x56')]['id'];}return db['ChatQueue'][_0x79a7('0x5c')]({'where':{'id':_0xf6274d[_0x79a7('0x53')]['id']}})[_0x79a7('0x1f')](handleEntityNotFound(_0x5e3fc3,null))[_0x79a7('0x1f')](saveUpdates(_0xf6274d[_0x79a7('0x56')],null))['then'](respondWithResult(_0x5e3fc3,null))['catch'](handleError(_0x5e3fc3,null));};exports['destroy']=function(_0x55de53,_0x178767){return db[_0x79a7('0x3b')]['find']({'where':{'id':_0x55de53[_0x79a7('0x53')]['id']}})['then'](handleEntityNotFound(_0x178767,null))[_0x79a7('0x1f')](removeEntity(_0x178767,null))['catch'](handleError(_0x178767,null));};exports[_0x79a7('0x61')]=function(_0x244bac,_0x43092f){return db[_0x79a7('0x3b')][_0x79a7('0x61')]()[_0x79a7('0x1f')](respondWithResult(_0x43092f,null))[_0x79a7('0x29')](handleError(_0x43092f,null));};exports[_0x79a7('0x62')]=function(_0x422cf1,_0x3a3539,_0x510d8f){var _0x57520b={'raw':!![],'where':{}},_0x1d434f={},_0x1efc9c;return db[_0x79a7('0x3b')]['findOne']({'where':{'id':_0x422cf1[_0x79a7('0x53')]['id']}})[_0x79a7('0x1f')](handleEntityNotFound(_0x3a3539,null))[_0x79a7('0x1f')](function(_0x2410f5){if(_0x2410f5){_0x1efc9c=_0x2410f5[_0x79a7('0x5a')]({'plain':!![]});_0x1d434f[_0x79a7('0x3f')]=_['keys'](db[_0x79a7('0x63')][_0x79a7('0x3c')]);_0x1d434f[_0x79a7('0x40')]=_['keys'](_0x422cf1[_0x79a7('0x40')]);_0x1d434f[_0x79a7('0x41')]=_[_0x79a7('0x42')](_0x1d434f[_0x79a7('0x3f')],_0x1d434f[_0x79a7('0x40')]);_0x57520b['attributes']=_[_0x79a7('0x42')](_0x1d434f[_0x79a7('0x3f')],qs[_0x79a7('0x44')](_0x422cf1[_0x79a7('0x40')][_0x79a7('0x44')]));_0x57520b[_0x79a7('0x43')]=_0x57520b[_0x79a7('0x43')][_0x79a7('0x45')]?_0x57520b['attributes']:_0x1d434f[_0x79a7('0x3f')];if(!_0x422cf1[_0x79a7('0x40')][_0x79a7('0x46')](_0x79a7('0x47'))){_0x57520b['limit']=qs['limit'](_0x422cf1[_0x79a7('0x40')][_0x79a7('0x48')]);_0x57520b[_0x79a7('0x2d')]=qs[_0x79a7('0x2d')](_0x422cf1[_0x79a7('0x40')][_0x79a7('0x2d')]);}_0x57520b[_0x79a7('0x49')]=qs[_0x79a7('0x4a')](_0x422cf1[_0x79a7('0x40')]['sort']);_0x57520b['where']=qs[_0x79a7('0x41')](_[_0x79a7('0x4c')](_0x422cf1[_0x79a7('0x40')],_0x1d434f['filters']));_0x57520b[_0x79a7('0x4b')][_0x79a7('0x64')]=_0x2410f5['id'];if(_0x422cf1['query'][_0x79a7('0x4d')]){_0x57520b[_0x79a7('0x4b')]=_[_0x79a7('0x4e')](_0x57520b[_0x79a7('0x4b')],{'$or':_['map'](_0x57520b[_0x79a7('0x43')],function(_0x38ec28){var _0xec452={};_0xec452[_0x38ec28]={'$like':'%'+_0x422cf1[_0x79a7('0x40')][_0x79a7('0x4d')]+'%'};return _0xec452;})});}_0x57520b=_[_0x79a7('0x4e')]({},_0x57520b,_0x422cf1[_0x79a7('0x50')]);return db[_0x79a7('0x63')][_0x79a7('0x65')](_0x57520b);}})[_0x79a7('0x1f')](function(_0x1308a6){if(_0x1308a6){return db['User'][_0x79a7('0x66')]({'where':{'id':_[_0x79a7('0x3a')](_0x1308a6,_0x79a7('0x67')),'role':_0x79a7('0x68')},'attributes':['id',_0x79a7('0x37'),'chatPause',_0x79a7('0x69'),_0x79a7('0x6a')]});}})['then'](function(_0xf3d34f){if(_0xf3d34f){return{'count':_0xf3d34f[_0x79a7('0x2f')],'rows':_[_0x79a7('0x3a')](_0xf3d34f[_0x79a7('0x6b')],function(_0x33e184){return{'membername':_0x33e184['name'],'UserId':_0x33e184['id'],'queue_name':_0x1efc9c[_0x79a7('0x37')],'ChatQueueId':_0x1efc9c['id'],'interface':util[_0x79a7('0x6c')](_0x79a7('0x6d'),_0x79a7('0x6e'),_0x33e184['name']),'penalty':0x0,'paused':_0x33e184['chatPause'],'createdAt':_0x33e184[_0x79a7('0x6a')],'updatedAt':_0x33e184['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x79a7('0x1f')](respondWithFilteredResult(_0x3a3539,_0x57520b))['catch'](handleError(_0x3a3539,null));};exports[_0x79a7('0x6f')]=function(_0x58c1f4,_0x3a3c7a,_0x637184){var _0xaa6c39={};var _0x217191={};var _0x51edfa;var _0x2bb810;return db[_0x79a7('0x3b')]['findOne']({'where':{'id':_0x58c1f4[_0x79a7('0x53')]['id']}})['then'](handleEntityNotFound(_0x3a3c7a,null))['then'](function(_0x18c797){if(_0x18c797){_0x51edfa=_0x18c797;_0x217191[_0x79a7('0x3f')]=_[_0x79a7('0x54')](db['Team'][_0x79a7('0x3c')]);_0x217191[_0x79a7('0x40')]=_[_0x79a7('0x54')](_0x58c1f4[_0x79a7('0x40')]);_0x217191[_0x79a7('0x41')]=_[_0x79a7('0x42')](_0x217191[_0x79a7('0x3f')],_0x217191[_0x79a7('0x40')]);_0xaa6c39['attributes']=_[_0x79a7('0x42')](_0x217191[_0x79a7('0x3f')],qs['fields'](_0x58c1f4[_0x79a7('0x40')]['fields']));_0xaa6c39[_0x79a7('0x43')]=_0xaa6c39[_0x79a7('0x43')]['length']?_0xaa6c39[_0x79a7('0x43')]:_0x217191[_0x79a7('0x3f')];_0xaa6c39[_0x79a7('0x49')]=qs[_0x79a7('0x4a')](_0x58c1f4[_0x79a7('0x40')][_0x79a7('0x4a')]);_0xaa6c39[_0x79a7('0x4b')]=qs[_0x79a7('0x41')](_[_0x79a7('0x4c')](_0x58c1f4[_0x79a7('0x40')],_0x217191['filters']));if(_0x58c1f4[_0x79a7('0x40')][_0x79a7('0x4d')]){_0xaa6c39['where']=_['merge'](_0xaa6c39[_0x79a7('0x4b')],{'$or':_['map'](_0xaa6c39[_0x79a7('0x43')],function(_0x4dfc3d){var _0x1b56de={};_0x1b56de[_0x4dfc3d]={'$like':'%'+_0x58c1f4[_0x79a7('0x40')][_0x79a7('0x4d')]+'%'};return _0x1b56de;})});}_0xaa6c39=_[_0x79a7('0x4e')]({},_0xaa6c39,_0x58c1f4[_0x79a7('0x50')]);return _0x51edfa['getTeams'](_0xaa6c39);}})[_0x79a7('0x1f')](function(_0x10ee98){if(_0x10ee98){_0x2bb810=_0x10ee98['length'];if(!_0x58c1f4[_0x79a7('0x40')][_0x79a7('0x46')](_0x79a7('0x47'))){_0xaa6c39[_0x79a7('0x48')]=qs[_0x79a7('0x48')](_0x58c1f4['query'][_0x79a7('0x48')]);_0xaa6c39['offset']=qs[_0x79a7('0x2d')](_0x58c1f4[_0x79a7('0x40')][_0x79a7('0x2d')]);}return _0x51edfa[_0x79a7('0x6f')](_0xaa6c39);}})[_0x79a7('0x1f')](function(_0x58b4e7){if(_0x58b4e7){return _0x58b4e7?{'count':_0x2bb810,'rows':_0x58b4e7}:null;}})[_0x79a7('0x1f')](respondWithResult(_0x3a3c7a,null))['catch'](handleError(_0x3a3c7a,null));};exports['addTeams']=function(_0x1a7a56,_0x259894,_0x295b0e){var _0x962064=_0x1a7a56['body'][_0x79a7('0x70')];return db[_0x79a7('0x71')][_0x79a7('0x65')]({'where':{'id':_0x962064},'attributes':['id'],'include':[{'model':db[_0x79a7('0x72')],'as':'Agents','attributes':['id','name',_0x79a7('0x73'),'voicePause',_0x79a7('0x74')],'raw':!![]}]})[_0x79a7('0x1f')](function(_0x413605){if(_0x413605){var _0x24f21c=_[_0x79a7('0x75')](_0x413605,function(_0x2f2bbd){var _0x5a3595=_0x2f2bbd[_0x79a7('0x5a')]({'plain':!![]});return _0x5a3595['Agents'];});return db[_0x79a7('0x3b')]['find']({'where':{'id':_0x1a7a56['params']['id']}})[_0x79a7('0x1f')](function(_0x43a458){return db[_0x79a7('0x76')][_0x79a7('0x77')](function(_0x5b6132){return _0x43a458[_0x79a7('0x78')](_0x962064,{'transaction':_0x5b6132})[_0x79a7('0x1f')](function(){return BPromise['each'](_0x24f21c,function(_0x19dc33){return db[_0x79a7('0x63')][_0x79a7('0x79')]({'where':{'UserId':_0x19dc33['id'],'ChatQueueId':_0x1a7a56[_0x79a7('0x53')]['id']},'transaction':_0x5b6132});});})[_0x79a7('0x1f')](function(){_0x24f21c[_0x79a7('0x7a')](function(_0x5bf1d1){socket[_0x79a7('0x7b')](_0x79a7('0x7c'),{'UserId':_0x5bf1d1['id'],'ChatQueueId':_0x43a458['id']});});});});});}})[_0x79a7('0x1f')](respondWithStatusCode(_0x259894,null))['catch'](handleError(_0x259894,null));};exports[_0x79a7('0x7d')]=function(_0x290fb5,_0x1f2dd1,_0x2fdb28){return db[_0x79a7('0x71')][_0x79a7('0x65')]({'where':{'id':_0x290fb5[_0x79a7('0x40')][_0x79a7('0x70')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1f2dd1,null))[_0x79a7('0x1f')](function(_0x1ff65a){var _0x4e7210=_['map'](_0x1ff65a,'id');var _0x9454be=[];var _0x1a6866=[];var _0x532c2d=squel[_0x79a7('0x7e')]();_0x532c2d[_0x79a7('0x7f')](_0x79a7('0x80'))['from'](_0x79a7('0x81'),'tq')[_0x79a7('0x82')](_0x79a7('0x83'),'ut',_0x79a7('0x84'))[_0x79a7('0x4b')](_0x79a7('0x85'),_0x290fb5[_0x79a7('0x53')]['id']);for(var _0x2457da=0x0;_0x2457da<_0x1ff65a[_0x79a7('0x45')];_0x2457da+=0x1){let _0x3d2b64=_0x1ff65a[_0x2457da];for(var _0x687281=0x0;_0x687281<_0x3d2b64['Agents'][_0x79a7('0x45')];_0x687281+=0x1){let _0x2c2a1a=_0x3d2b64[_0x79a7('0x86')][_0x687281];var _0x566507=_0x532c2d['clone']();_0x566507[_0x79a7('0x4b')]('ut.UserId\x20=\x20?',_0x2c2a1a['id']);_0x1a6866['push'](db[_0x79a7('0x76')]['query'](_0x566507[_0x79a7('0x87')](),{'type':db['sequelize'][_0x79a7('0x88')][_0x79a7('0x89')]})[_0x79a7('0x1f')](function(_0x3582d4){if(_0x3582d4[_0x79a7('0x45')]===0x1){return _0x2c2a1a['id'];}else{var _0x228b23=_[_0x79a7('0x8a')](_[_0x79a7('0x3a')](_0x3582d4,_0x79a7('0x8b')),function(_0x419b1a){return _[_0x79a7('0x8c')](_0x4e7210,_0x419b1a);});if(_0x228b23){return _0x2c2a1a['id'];}}}));}}return BPromise[_0x79a7('0x8d')](_0x1a6866)[_0x79a7('0x1f')](function(_0x5348ae){_0x9454be=_(_0x9454be)['union'](_0x5348ae)[_0x79a7('0x8e')]()[_0x79a7('0x8f')]();return db[_0x79a7('0x3b')]['find']({'where':{'id':_0x290fb5['params']['id']}})[_0x79a7('0x1f')](function(_0x2d7efd){return db[_0x79a7('0x76')][_0x79a7('0x77')](function(_0x208de6){return _0x2d7efd[_0x79a7('0x7d')](_0x290fb5[_0x79a7('0x40')]['ids'],{'transaction':_0x208de6})[_0x79a7('0x1f')](function(){if(!_[_0x79a7('0x90')](_0x9454be)){return _0x2d7efd[_0x79a7('0x91')](_0x9454be,{'transaction':_0x208de6});}})[_0x79a7('0x1f')](function(){_0x9454be['forEach'](function(_0x3f5630){socket['emit'](_0x79a7('0x92'),{'UserId':_0x3f5630,'ChatQueueId':_0x2d7efd['id']});});});});});});})[_0x79a7('0x1f')](respondWithStatusCode(_0x1f2dd1,null))[_0x79a7('0x29')](handleError(_0x1f2dd1,null));};exports['addAgents']=function(_0x541315,_0x4d9957,_0x29b1b7){return db[_0x79a7('0x3b')][_0x79a7('0x5c')]({'where':{'id':_0x541315[_0x79a7('0x53')]['id']}})[_0x79a7('0x1f')](handleEntityNotFound(_0x4d9957,null))[_0x79a7('0x1f')](function(_0x33218a){if(_0x33218a){return _0x33218a[_0x79a7('0x93')](_0x541315[_0x79a7('0x56')][_0x79a7('0x70')],_[_0x79a7('0x94')](_0x541315[_0x79a7('0x56')],[_0x79a7('0x70'),'id'])||{})['spread'](function(_0x506bc0){for(var _0x40ec57=0x0;_0x40ec57<_0x541315[_0x79a7('0x56')][_0x79a7('0x70')][_0x79a7('0x45')];_0x40ec57+=0x1){socket[_0x79a7('0x7b')](_0x79a7('0x7c'),{'UserId':Number(_0x541315[_0x79a7('0x56')][_0x79a7('0x70')][_0x40ec57]),'ChatQueueId':Number(_0x541315[_0x79a7('0x53')]['id'])});}return _0x506bc0;});}})[_0x79a7('0x1f')](respondWithResult(_0x4d9957,null))[_0x79a7('0x29')](handleError(_0x4d9957,null));};exports[_0x79a7('0x91')]=function(_0x1f23f6,_0x44e524,_0x55ba86){return db['ChatQueue'][_0x79a7('0x5c')]({'where':{'id':_0x1f23f6[_0x79a7('0x53')]['id']}})[_0x79a7('0x1f')](handleEntityNotFound(_0x44e524,null))['then'](function(_0xea0706){if(_0xea0706){return _0xea0706[_0x79a7('0x91')](_0x1f23f6[_0x79a7('0x40')]['ids'])[_0x79a7('0x1f')](function(){if(_['isArray'](_0x1f23f6[_0x79a7('0x40')][_0x79a7('0x70')])){for(var _0xaab382=0x0;_0xaab382<_0x1f23f6[_0x79a7('0x40')][_0x79a7('0x70')]['length'];_0xaab382+=0x1){socket[_0x79a7('0x7b')](_0x79a7('0x92'),{'UserId':Number(_0x1f23f6[_0x79a7('0x40')][_0x79a7('0x70')][_0xaab382]),'ChatQueueId':Number(_0x1f23f6[_0x79a7('0x53')]['id'])});}}else{socket[_0x79a7('0x7b')](_0x79a7('0x92'),{'UserId':Number(_0x1f23f6[_0x79a7('0x40')][_0x79a7('0x70')]),'ChatQueueId':Number(_0x1f23f6[_0x79a7('0x53')]['id'])});}});}})[_0x79a7('0x1f')](respondWithStatusCode(_0x44e524,null))[_0x79a7('0x29')](handleError(_0x44e524,null));};exports[_0x79a7('0x95')]=function(_0x21b1eb,_0x528064,_0x49dff7){var _0x5c2398={};var _0x74542c={};var _0xf007d7;var _0x3ceb02;return db[_0x79a7('0x3b')][_0x79a7('0x96')]({'where':{'id':_0x21b1eb[_0x79a7('0x53')]['id']}})['then'](handleEntityNotFound(_0x528064,null))[_0x79a7('0x1f')](function(_0x361b7a){if(_0x361b7a){_0xf007d7=_0x361b7a;_0x74542c[_0x79a7('0x3f')]=_['keys'](db[_0x79a7('0x72')][_0x79a7('0x3c')]);_0x74542c[_0x79a7('0x40')]=_[_0x79a7('0x54')](_0x21b1eb['query']);_0x74542c[_0x79a7('0x41')]=_[_0x79a7('0x42')](_0x74542c[_0x79a7('0x3f')],_0x74542c[_0x79a7('0x40')]);_0x5c2398['attributes']=_[_0x79a7('0x42')](_0x74542c[_0x79a7('0x3f')],qs[_0x79a7('0x44')](_0x21b1eb['query'][_0x79a7('0x44')]));_0x5c2398[_0x79a7('0x43')]=_0x5c2398['attributes'][_0x79a7('0x45')]?_0x5c2398[_0x79a7('0x43')]:_0x74542c[_0x79a7('0x3f')];_0x5c2398[_0x79a7('0x49')]=qs[_0x79a7('0x4a')](_0x21b1eb[_0x79a7('0x40')]['sort']);_0x5c2398[_0x79a7('0x4b')]=qs[_0x79a7('0x41')](_[_0x79a7('0x4c')](_0x21b1eb[_0x79a7('0x40')],_0x74542c['filters']));if(_0x21b1eb['query'][_0x79a7('0x4d')]){_0x5c2398['where']=_[_0x79a7('0x4e')](_0x5c2398[_0x79a7('0x4b')],{'$or':_['map'](_0x5c2398[_0x79a7('0x43')],function(_0x328ab8){var _0x1d3b0c={};_0x1d3b0c[_0x328ab8]={'$like':'%'+_0x21b1eb[_0x79a7('0x40')][_0x79a7('0x4d')]+'%'};return _0x1d3b0c;})});}_0x5c2398=_[_0x79a7('0x4e')]({},_0x5c2398,_0x21b1eb[_0x79a7('0x50')]);return _0xf007d7['getAgents'](_0x5c2398);}})[_0x79a7('0x1f')](function(_0x318c57){if(_0x318c57){_0x3ceb02=_0x318c57[_0x79a7('0x45')];if(!_0x21b1eb[_0x79a7('0x40')][_0x79a7('0x46')](_0x79a7('0x47'))){_0x5c2398[_0x79a7('0x48')]=qs[_0x79a7('0x48')](_0x21b1eb['query'][_0x79a7('0x48')]);_0x5c2398[_0x79a7('0x2d')]=qs[_0x79a7('0x2d')](_0x21b1eb[_0x79a7('0x40')][_0x79a7('0x2d')]);}return _0xf007d7[_0x79a7('0x95')](_0x5c2398);}})['then'](function(_0x3c2014){if(_0x3c2014){return _0x3c2014?{'count':_0x3ceb02,'rows':_0x3c2014}:null;}})[_0x79a7('0x1f')](respondWithResult(_0x528064,null))['catch'](handleError(_0x528064,null));};
\ No newline at end of file
+var _0xee40=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','./chatQueue.socket','register','jayson/promise','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatQueue,\x20%s,\x20%s','sendStatus','end','status','json','undefined','limit','offset','set','Content-Range','reject','update','destroy','get','ChatQueues','UserProfileResource','name','send','index','map','ChatQueue','rawAttributes','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','filter','merge','type','VIRTUAL','options','count','includeAll','include','rows','catch','show','params','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','nolimit','ChatQueueId','findAll','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','SIP','getTeams','pick','addTeams','ids','Agents','online','interface','transaction','each','UserChatQueue','findOrCreate','forEach','userChatQueue:save','removeTeams','Team','select','field','tq.TeamId','from','team_has_chat_queues','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','push','sequelize','toString','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','emit','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xee40,0x85));var _0x0ee4=function(_0x20fe76,_0x1caa47){_0x20fe76=_0x20fe76-0x0;var _0x446f73=_0xee40[_0x20fe76];return _0x446f73;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0ee4('0x0'));var jsonpatch=require(_0x0ee4('0x1'));var rp=require(_0x0ee4('0x2'));var moment=require('moment');var BPromise=require(_0x0ee4('0x3'));var Mustache=require(_0x0ee4('0x4'));var util=require(_0x0ee4('0x5'));var path=require(_0x0ee4('0x6'));var sox=require('sox');var csv=require(_0x0ee4('0x7'));var ejs=require(_0x0ee4('0x8'));var fs=require('fs');var fs_extra=require(_0x0ee4('0x9'));var _=require(_0x0ee4('0xa'));var squel=require(_0x0ee4('0xb'));var crypto=require(_0x0ee4('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0ee4('0x7'));var querystring=require(_0x0ee4('0xd'));var Papa=require(_0x0ee4('0xe'));var Redis=require(_0x0ee4('0xf'));var authService=require(_0x0ee4('0x10'));var qs=require(_0x0ee4('0x11'));var as=require(_0x0ee4('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0ee4('0x13'))(_0x0ee4('0x14'));var utils=require(_0x0ee4('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x0ee4('0x16'));var db=require(_0x0ee4('0x17'))['db'];config[_0x0ee4('0x18')]=_['defaults'](config['redis'],{'host':_0x0ee4('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0ee4('0x18')]));require(_0x0ee4('0x1a'))[_0x0ee4('0x1b')](socket);var jayson=require(_0x0ee4('0x1c'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x34f82e,_0x5754fb,_0x5db41f,_0x4bc02d){return new BPromise(function(_0x1c0ba5,_0x4de31e){var _0x41bfee=_0x4bc02d||client;return _0x41bfee[_0x0ee4('0x1d')](_0x34f82e,_0x5db41f)[_0x0ee4('0x1e')](function(_0x3e04ce){logger[_0x0ee4('0x1f')]('ChatQueue,\x20%s,\x20%s',_0x5754fb,_0x0ee4('0x20'));logger[_0x0ee4('0x21')](_0x0ee4('0x22'),_0x5754fb,_0x0ee4('0x20'),JSON[_0x0ee4('0x23')](_0x3e04ce));if(_0x3e04ce[_0x0ee4('0x24')]){if(_0x3e04ce[_0x0ee4('0x24')]['code']===0x1f4){logger[_0x0ee4('0x24')]('ChatQueue,\x20%s,\x20%s',_0x5754fb,_0x3e04ce[_0x0ee4('0x24')][_0x0ee4('0x25')]);return _0x4de31e(_0x3e04ce[_0x0ee4('0x24')][_0x0ee4('0x25')]);}logger[_0x0ee4('0x24')]('ChatQueue,\x20%s,\x20%s',_0x5754fb,_0x3e04ce[_0x0ee4('0x24')][_0x0ee4('0x25')]);return _0x1c0ba5(_0x3e04ce[_0x0ee4('0x24')]['message']);}else{logger[_0x0ee4('0x1f')](_0x0ee4('0x26'),_0x5754fb,'request\x20sent');_0x1c0ba5(_0x3e04ce['result'][_0x0ee4('0x25')]);}})['catch'](function(_0x176baf){logger[_0x0ee4('0x24')](_0x0ee4('0x26'),_0x5754fb,_0x176baf);_0x4de31e(_0x176baf);});});}function respondWithStatusCode(_0x3c00a7,_0x47383d){_0x47383d=_0x47383d||0xcc;return function(_0x318081){if(_0x318081){return _0x3c00a7[_0x0ee4('0x27')](_0x47383d);}return _0x3c00a7['status'](_0x47383d)[_0x0ee4('0x28')]();};}function respondWithResult(_0x2a8ff6,_0x146701){_0x146701=_0x146701||0xc8;return function(_0x35dbe8){if(_0x35dbe8){return _0x2a8ff6[_0x0ee4('0x29')](_0x146701)[_0x0ee4('0x2a')](_0x35dbe8);}};}function respondWithFilteredResult(_0x71541d,_0x1d4400){return function(_0x12409a){if(_0x12409a){var _0x16da09=typeof _0x1d4400['offset']===_0x0ee4('0x2b')&&typeof _0x1d4400[_0x0ee4('0x2c')]===_0x0ee4('0x2b');var _0x3c585c=_0x12409a['count'];var _0x3b515a=_0x16da09?0x0:_0x1d4400[_0x0ee4('0x2d')];var _0x2b205e=_0x16da09?_0x12409a['count']:_0x1d4400[_0x0ee4('0x2d')]+_0x1d4400[_0x0ee4('0x2c')];var _0x53efda;if(_0x2b205e>=_0x3c585c){_0x2b205e=_0x3c585c;_0x53efda=0xc8;}else{_0x53efda=0xce;}_0x71541d[_0x0ee4('0x29')](_0x53efda);return _0x71541d[_0x0ee4('0x2e')](_0x0ee4('0x2f'),_0x3b515a+'-'+_0x2b205e+'/'+_0x3c585c)[_0x0ee4('0x2a')](_0x12409a);}return null;};}function patchUpdates(_0x4798eb){return function(_0x1bf252){try{jsonpatch['apply'](_0x1bf252,_0x4798eb,!![]);}catch(_0x2cf156){return BPromise[_0x0ee4('0x30')](_0x2cf156);}return _0x1bf252['save']();};}function saveUpdates(_0x4bd549,_0x21ddc5){return function(_0x3d7759){if(_0x3d7759){return _0x3d7759[_0x0ee4('0x31')](_0x4bd549)['then'](function(_0x41bc7b){return _0x41bc7b;});}return null;};}function removeEntity(_0x57eac4,_0x2e33a7){return function(_0x4a047f){if(_0x4a047f){return _0x4a047f[_0x0ee4('0x32')]()[_0x0ee4('0x1e')](function(){var _0xb26e32=_0x4a047f[_0x0ee4('0x33')]({'plain':!![]});var _0x100784=_0x0ee4('0x34');return db[_0x0ee4('0x35')]['destroy']({'where':{'type':_0x100784,'resourceId':_0xb26e32['id']}})['then'](function(){return _0x4a047f;});})[_0x0ee4('0x1e')](function(){_0x57eac4[_0x0ee4('0x29')](0xcc)[_0x0ee4('0x28')]();});}};}function handleEntityNotFound(_0x44dd60,_0x1e27df){return function(_0x40d7c2){if(!_0x40d7c2){_0x44dd60['sendStatus'](0x194);}return _0x40d7c2;};}function handleError(_0x2998d7,_0x2e2a13){_0x2e2a13=_0x2e2a13||0x1f4;return function(_0x4f8f15){logger['error'](_0x4f8f15['stack']);if(_0x4f8f15[_0x0ee4('0x36')]){delete _0x4f8f15['name'];}_0x2998d7[_0x0ee4('0x29')](_0x2e2a13)[_0x0ee4('0x37')](_0x4f8f15);};}exports[_0x0ee4('0x38')]=function(_0xb48cf9,_0x38e8c2){var _0x355eec={},_0x454e11={},_0x4bf1ee={'count':0x0,'rows':[]};var _0x346c98=_[_0x0ee4('0x39')](db[_0x0ee4('0x3a')][_0x0ee4('0x3b')],function(_0x46c6e4){return{'name':_0x46c6e4['fieldName'],'type':_0x46c6e4['type'][_0x0ee4('0x3c')]};});_0x454e11[_0x0ee4('0x3d')]=_[_0x0ee4('0x39')](_0x346c98,_0x0ee4('0x36'));_0x454e11[_0x0ee4('0x3e')]=_[_0x0ee4('0x3f')](_0xb48cf9['query']);_0x454e11['filters']=_[_0x0ee4('0x40')](_0x454e11['model'],_0x454e11[_0x0ee4('0x3e')]);_0x355eec[_0x0ee4('0x41')]=_['intersection'](_0x454e11[_0x0ee4('0x3d')],qs[_0x0ee4('0x42')](_0xb48cf9['query'][_0x0ee4('0x42')]));_0x355eec['attributes']=_0x355eec['attributes']['length']?_0x355eec['attributes']:_0x454e11[_0x0ee4('0x3d')];if(!_0xb48cf9['query'][_0x0ee4('0x43')]('nolimit')){_0x355eec[_0x0ee4('0x2c')]=qs[_0x0ee4('0x2c')](_0xb48cf9[_0x0ee4('0x3e')]['limit']);_0x355eec[_0x0ee4('0x2d')]=qs[_0x0ee4('0x2d')](_0xb48cf9[_0x0ee4('0x3e')][_0x0ee4('0x2d')]);}_0x355eec[_0x0ee4('0x44')]=qs[_0x0ee4('0x45')](_0xb48cf9['query'][_0x0ee4('0x45')]);_0x355eec[_0x0ee4('0x46')]=qs[_0x0ee4('0x47')](_['pick'](_0xb48cf9[_0x0ee4('0x3e')],_0x454e11[_0x0ee4('0x47')]),_0x346c98);if(_0xb48cf9[_0x0ee4('0x3e')][_0x0ee4('0x48')]){_0x355eec[_0x0ee4('0x46')]=_[_0x0ee4('0x49')](_0x355eec[_0x0ee4('0x46')],{'$or':_['map'](_0x346c98,function(_0x5ea9cb){if(_0x5ea9cb[_0x0ee4('0x4a')]!==_0x0ee4('0x4b')){var _0x9f3566={};_0x9f3566[_0x5ea9cb[_0x0ee4('0x36')]]={'$like':'%'+_0xb48cf9[_0x0ee4('0x3e')][_0x0ee4('0x48')]+'%'};return _0x9f3566;}})});}_0x355eec=_[_0x0ee4('0x49')]({},_0x355eec,_0xb48cf9[_0x0ee4('0x4c')]);var _0x52dd8e={'where':_0x355eec[_0x0ee4('0x46')]};return db['ChatQueue'][_0x0ee4('0x4d')](_0x52dd8e)['then'](function(_0x52e070){_0x4bf1ee[_0x0ee4('0x4d')]=_0x52e070;if(_0xb48cf9[_0x0ee4('0x3e')][_0x0ee4('0x4e')]){_0x355eec[_0x0ee4('0x4f')]=[{'all':!![]}];}return db['ChatQueue']['findAll'](_0x355eec);})[_0x0ee4('0x1e')](function(_0x2bf9f0){_0x4bf1ee[_0x0ee4('0x50')]=_0x2bf9f0;return _0x4bf1ee;})['then'](respondWithFilteredResult(_0x38e8c2,_0x355eec))[_0x0ee4('0x51')](handleError(_0x38e8c2,null));};exports[_0x0ee4('0x52')]=function(_0x1f4b32,_0x3d81a5){var _0x5520d3={'raw':!![],'where':{'id':_0x1f4b32[_0x0ee4('0x53')]['id']}},_0x333bea={};_0x333bea[_0x0ee4('0x3d')]=_[_0x0ee4('0x3f')](db[_0x0ee4('0x3a')][_0x0ee4('0x3b')]);_0x333bea[_0x0ee4('0x3e')]=_[_0x0ee4('0x3f')](_0x1f4b32[_0x0ee4('0x3e')]);_0x333bea['filters']=_[_0x0ee4('0x40')](_0x333bea[_0x0ee4('0x3d')],_0x333bea[_0x0ee4('0x3e')]);_0x5520d3[_0x0ee4('0x41')]=_[_0x0ee4('0x40')](_0x333bea[_0x0ee4('0x3d')],qs['fields'](_0x1f4b32['query'][_0x0ee4('0x42')]));_0x5520d3[_0x0ee4('0x41')]=_0x5520d3['attributes'][_0x0ee4('0x54')]?_0x5520d3[_0x0ee4('0x41')]:_0x333bea[_0x0ee4('0x3d')];if(_0x1f4b32[_0x0ee4('0x3e')][_0x0ee4('0x4e')]){_0x5520d3[_0x0ee4('0x4f')]=[{'all':!![]}];}_0x5520d3=_[_0x0ee4('0x49')]({},_0x5520d3,_0x1f4b32[_0x0ee4('0x4c')]);return db[_0x0ee4('0x3a')][_0x0ee4('0x55')](_0x5520d3)['then'](handleEntityNotFound(_0x3d81a5,null))['then'](respondWithResult(_0x3d81a5,null))[_0x0ee4('0x51')](handleError(_0x3d81a5,null));};exports[_0x0ee4('0x56')]=function(_0x1a4d39,_0x459850){return db[_0x0ee4('0x3a')][_0x0ee4('0x56')](_0x1a4d39['body'],{})['then'](function(_0x3529ed){var _0x53968c=_0x1a4d39[_0x0ee4('0x57')][_0x0ee4('0x33')]({'plain':!![]});if(!_0x53968c)throw new Error(_0x0ee4('0x58'));if(_0x53968c[_0x0ee4('0x59')]===_0x0ee4('0x57')){var _0x1b53ba=_0x3529ed[_0x0ee4('0x33')]({'plain':!![]});var _0x338a17=_0x0ee4('0x34');return db[_0x0ee4('0x5a')]['find']({'where':{'name':_0x338a17,'userProfileId':_0x53968c[_0x0ee4('0x5b')]},'raw':!![]})[_0x0ee4('0x1e')](function(_0x4df7b1){if(_0x4df7b1&&_0x4df7b1['autoAssociation']===0x0){return db[_0x0ee4('0x35')][_0x0ee4('0x56')]({'name':_0x1b53ba[_0x0ee4('0x36')],'resourceId':_0x1b53ba['id'],'type':_0x4df7b1[_0x0ee4('0x36')],'sectionId':_0x4df7b1['id']},{})['then'](function(){return _0x3529ed;});}else{return _0x3529ed;}})[_0x0ee4('0x51')](function(_0x4c90c3){logger[_0x0ee4('0x24')](_0x0ee4('0x5c'),_0x4c90c3);throw _0x4c90c3;});}return _0x3529ed;})['then'](respondWithResult(_0x459850,0xc9))['catch'](handleError(_0x459850,null));};exports[_0x0ee4('0x31')]=function(_0x34c341,_0x53612f){if(_0x34c341[_0x0ee4('0x5d')]['id']){delete _0x34c341[_0x0ee4('0x5d')]['id'];}return db[_0x0ee4('0x3a')]['find']({'where':{'id':_0x34c341[_0x0ee4('0x53')]['id']}})['then'](handleEntityNotFound(_0x53612f,null))[_0x0ee4('0x1e')](saveUpdates(_0x34c341[_0x0ee4('0x5d')],null))[_0x0ee4('0x1e')](respondWithResult(_0x53612f,null))['catch'](handleError(_0x53612f,null));};exports['destroy']=function(_0x2a8503,_0x264da4){return db['ChatQueue'][_0x0ee4('0x55')]({'where':{'id':_0x2a8503[_0x0ee4('0x53')]['id']}})[_0x0ee4('0x1e')](handleEntityNotFound(_0x264da4,null))[_0x0ee4('0x1e')](removeEntity(_0x264da4,null))['catch'](handleError(_0x264da4,null));};exports[_0x0ee4('0x5e')]=function(_0x21b026,_0x151142){return db[_0x0ee4('0x3a')][_0x0ee4('0x5e')]()[_0x0ee4('0x1e')](respondWithResult(_0x151142,null))[_0x0ee4('0x51')](handleError(_0x151142,null));};exports['getMembers']=function(_0x59d16f,_0x1d39cd,_0xe9e1c5){var _0x2fd9e3={'raw':!![],'where':{}},_0x378740={},_0x272901;return db[_0x0ee4('0x3a')][_0x0ee4('0x5f')]({'where':{'id':_0x59d16f['params']['id']}})['then'](handleEntityNotFound(_0x1d39cd,null))[_0x0ee4('0x1e')](function(_0x4ab152){if(_0x4ab152){_0x272901=_0x4ab152[_0x0ee4('0x33')]({'plain':!![]});_0x378740[_0x0ee4('0x3d')]=_[_0x0ee4('0x3f')](db['UserChatQueue'][_0x0ee4('0x3b')]);_0x378740['query']=_[_0x0ee4('0x3f')](_0x59d16f[_0x0ee4('0x3e')]);_0x378740['filters']=_[_0x0ee4('0x40')](_0x378740[_0x0ee4('0x3d')],_0x378740[_0x0ee4('0x3e')]);_0x2fd9e3[_0x0ee4('0x41')]=_[_0x0ee4('0x40')](_0x378740['model'],qs[_0x0ee4('0x42')](_0x59d16f[_0x0ee4('0x3e')][_0x0ee4('0x42')]));_0x2fd9e3[_0x0ee4('0x41')]=_0x2fd9e3['attributes'][_0x0ee4('0x54')]?_0x2fd9e3[_0x0ee4('0x41')]:_0x378740[_0x0ee4('0x3d')];if(!_0x59d16f['query'][_0x0ee4('0x43')](_0x0ee4('0x60'))){_0x2fd9e3[_0x0ee4('0x2c')]=qs[_0x0ee4('0x2c')](_0x59d16f['query'][_0x0ee4('0x2c')]);_0x2fd9e3[_0x0ee4('0x2d')]=qs['offset'](_0x59d16f[_0x0ee4('0x3e')][_0x0ee4('0x2d')]);}_0x2fd9e3[_0x0ee4('0x44')]=qs[_0x0ee4('0x45')](_0x59d16f['query']['sort']);_0x2fd9e3[_0x0ee4('0x46')]=qs['filters'](_['pick'](_0x59d16f[_0x0ee4('0x3e')],_0x378740['filters']));_0x2fd9e3[_0x0ee4('0x46')][_0x0ee4('0x61')]=_0x4ab152['id'];if(_0x59d16f[_0x0ee4('0x3e')]['filter']){_0x2fd9e3[_0x0ee4('0x46')]=_[_0x0ee4('0x49')](_0x2fd9e3['where'],{'$or':_['map'](_0x2fd9e3[_0x0ee4('0x41')],function(_0x4fed59){var _0x1fa481={};_0x1fa481[_0x4fed59]={'$like':'%'+_0x59d16f[_0x0ee4('0x3e')][_0x0ee4('0x48')]+'%'};return _0x1fa481;})});}_0x2fd9e3=_[_0x0ee4('0x49')]({},_0x2fd9e3,_0x59d16f['options']);return db['UserChatQueue'][_0x0ee4('0x62')](_0x2fd9e3);}})['then'](function(_0x6e6259){if(_0x6e6259){return db[_0x0ee4('0x63')][_0x0ee4('0x64')]({'where':{'id':_['map'](_0x6e6259,_0x0ee4('0x65')),'role':_0x0ee4('0x66')},'attributes':['id',_0x0ee4('0x36'),_0x0ee4('0x67'),_0x0ee4('0x68'),_0x0ee4('0x69')]});}})[_0x0ee4('0x1e')](function(_0x205462){if(_0x205462){return{'count':_0x205462[_0x0ee4('0x4d')],'rows':_['map'](_0x205462['rows'],function(_0x3ed2fe){return{'membername':_0x3ed2fe[_0x0ee4('0x36')],'UserId':_0x3ed2fe['id'],'queue_name':_0x272901[_0x0ee4('0x36')],'ChatQueueId':_0x272901['id'],'interface':util['format']('%s/%s',_0x0ee4('0x6a'),_0x3ed2fe[_0x0ee4('0x36')]),'penalty':0x0,'paused':_0x3ed2fe[_0x0ee4('0x67')],'createdAt':_0x3ed2fe['createdAt'],'updatedAt':_0x3ed2fe[_0x0ee4('0x68')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0ee4('0x1e')](respondWithFilteredResult(_0x1d39cd,_0x2fd9e3))[_0x0ee4('0x51')](handleError(_0x1d39cd,null));};exports[_0x0ee4('0x6b')]=function(_0x237456,_0x28aefb,_0x1f60f7){var _0x791468={};var _0x454d28={};var _0x568b6a;var _0x3ae5be;return db['ChatQueue']['findOne']({'where':{'id':_0x237456[_0x0ee4('0x53')]['id']}})[_0x0ee4('0x1e')](handleEntityNotFound(_0x28aefb,null))[_0x0ee4('0x1e')](function(_0x1b748f){if(_0x1b748f){_0x568b6a=_0x1b748f;_0x454d28['model']=_[_0x0ee4('0x3f')](db['Team'][_0x0ee4('0x3b')]);_0x454d28[_0x0ee4('0x3e')]=_['keys'](_0x237456[_0x0ee4('0x3e')]);_0x454d28[_0x0ee4('0x47')]=_[_0x0ee4('0x40')](_0x454d28[_0x0ee4('0x3d')],_0x454d28[_0x0ee4('0x3e')]);_0x791468['attributes']=_['intersection'](_0x454d28[_0x0ee4('0x3d')],qs[_0x0ee4('0x42')](_0x237456[_0x0ee4('0x3e')][_0x0ee4('0x42')]));_0x791468['attributes']=_0x791468[_0x0ee4('0x41')][_0x0ee4('0x54')]?_0x791468[_0x0ee4('0x41')]:_0x454d28[_0x0ee4('0x3d')];_0x791468[_0x0ee4('0x44')]=qs['sort'](_0x237456['query'][_0x0ee4('0x45')]);_0x791468[_0x0ee4('0x46')]=qs[_0x0ee4('0x47')](_[_0x0ee4('0x6c')](_0x237456[_0x0ee4('0x3e')],_0x454d28['filters']));if(_0x237456[_0x0ee4('0x3e')][_0x0ee4('0x48')]){_0x791468['where']=_[_0x0ee4('0x49')](_0x791468[_0x0ee4('0x46')],{'$or':_[_0x0ee4('0x39')](_0x791468['attributes'],function(_0x441e20){var _0x166885={};_0x166885[_0x441e20]={'$like':'%'+_0x237456[_0x0ee4('0x3e')][_0x0ee4('0x48')]+'%'};return _0x166885;})});}_0x791468=_[_0x0ee4('0x49')]({},_0x791468,_0x237456[_0x0ee4('0x4c')]);return _0x568b6a[_0x0ee4('0x6b')](_0x791468);}})[_0x0ee4('0x1e')](function(_0x42a6bf){if(_0x42a6bf){_0x3ae5be=_0x42a6bf[_0x0ee4('0x54')];if(!_0x237456['query'][_0x0ee4('0x43')](_0x0ee4('0x60'))){_0x791468['limit']=qs[_0x0ee4('0x2c')](_0x237456[_0x0ee4('0x3e')][_0x0ee4('0x2c')]);_0x791468[_0x0ee4('0x2d')]=qs[_0x0ee4('0x2d')](_0x237456[_0x0ee4('0x3e')][_0x0ee4('0x2d')]);}return _0x568b6a[_0x0ee4('0x6b')](_0x791468);}})[_0x0ee4('0x1e')](function(_0x20ba78){if(_0x20ba78){return _0x20ba78?{'count':_0x3ae5be,'rows':_0x20ba78}:null;}})['then'](respondWithResult(_0x28aefb,null))['catch'](handleError(_0x28aefb,null));};exports[_0x0ee4('0x6d')]=function(_0x1bc030,_0x3f4371,_0x409a53){var _0x4d57af=_0x1bc030[_0x0ee4('0x5d')][_0x0ee4('0x6e')];return db['Team'][_0x0ee4('0x62')]({'where':{'id':_0x4d57af},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0ee4('0x6f'),'attributes':['id','name',_0x0ee4('0x70'),'voicePause',_0x0ee4('0x71')],'raw':!![]}]})[_0x0ee4('0x1e')](function(_0x555c47){if(_0x555c47){var _0x4b11e6=_['flatMap'](_0x555c47,function(_0x356888){var _0x283a3d=_0x356888[_0x0ee4('0x33')]({'plain':!![]});return _0x283a3d[_0x0ee4('0x6f')];});return db[_0x0ee4('0x3a')]['find']({'where':{'id':_0x1bc030[_0x0ee4('0x53')]['id']}})[_0x0ee4('0x1e')](function(_0x59dc8a){return db['sequelize'][_0x0ee4('0x72')](function(_0x3ce6a4){return _0x59dc8a[_0x0ee4('0x6d')](_0x4d57af,{'transaction':_0x3ce6a4})['then'](function(){return BPromise[_0x0ee4('0x73')](_0x4b11e6,function(_0x511cbe){return db[_0x0ee4('0x74')][_0x0ee4('0x75')]({'where':{'UserId':_0x511cbe['id'],'ChatQueueId':_0x1bc030[_0x0ee4('0x53')]['id']},'transaction':_0x3ce6a4});});})[_0x0ee4('0x1e')](function(){_0x4b11e6[_0x0ee4('0x76')](function(_0x5cdaf8){socket['emit'](_0x0ee4('0x77'),{'UserId':_0x5cdaf8['id'],'ChatQueueId':_0x59dc8a['id']});});});});});}})[_0x0ee4('0x1e')](respondWithStatusCode(_0x3f4371,null))[_0x0ee4('0x51')](handleError(_0x3f4371,null));};exports[_0x0ee4('0x78')]=function(_0x406935,_0x48a6ff,_0x900f02){return db[_0x0ee4('0x79')][_0x0ee4('0x62')]({'where':{'id':_0x406935[_0x0ee4('0x3e')][_0x0ee4('0x6e')]},'attributes':['id'],'include':[{'model':db[_0x0ee4('0x63')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x48a6ff,null))[_0x0ee4('0x1e')](function(_0x162bf4){var _0x4035b2=_[_0x0ee4('0x39')](_0x162bf4,'id');var _0x36bd3d=[];var _0x130b49=[];var _0xc2c7b6=squel[_0x0ee4('0x7a')]();_0xc2c7b6[_0x0ee4('0x7b')](_0x0ee4('0x7c'))[_0x0ee4('0x7d')](_0x0ee4('0x7e'),'tq')['join']('user_has_teams','ut',_0x0ee4('0x7f'))[_0x0ee4('0x46')](_0x0ee4('0x80'),_0x406935[_0x0ee4('0x53')]['id']);for(var _0x32956b=0x0;_0x32956b<_0x162bf4['length'];_0x32956b+=0x1){let _0x1e1fdb=_0x162bf4[_0x32956b];for(var _0x1f9b4d=0x0;_0x1f9b4d<_0x1e1fdb[_0x0ee4('0x6f')]['length'];_0x1f9b4d+=0x1){let _0x5663af=_0x1e1fdb[_0x0ee4('0x6f')][_0x1f9b4d];var _0x4d029a=_0xc2c7b6[_0x0ee4('0x81')]();_0x4d029a[_0x0ee4('0x46')]('ut.UserId\x20=\x20?',_0x5663af['id']);_0x130b49[_0x0ee4('0x82')](db[_0x0ee4('0x83')][_0x0ee4('0x3e')](_0x4d029a[_0x0ee4('0x84')](),{'type':db[_0x0ee4('0x83')]['QueryTypes'][_0x0ee4('0x85')]})[_0x0ee4('0x1e')](function(_0xc3e6a3){if(_0xc3e6a3[_0x0ee4('0x54')]===0x1){return _0x5663af['id'];}else{var _0x5dcddd=_[_0x0ee4('0x86')](_[_0x0ee4('0x39')](_0xc3e6a3,_0x0ee4('0x87')),function(_0x1ae871){return _[_0x0ee4('0x88')](_0x4035b2,_0x1ae871);});if(_0x5dcddd){return _0x5663af['id'];}}}));}}return BPromise[_0x0ee4('0x89')](_0x130b49)[_0x0ee4('0x1e')](function(_0x536496){_0x36bd3d=_(_0x36bd3d)[_0x0ee4('0x8a')](_0x536496)[_0x0ee4('0x8b')]()[_0x0ee4('0x8c')]();return db[_0x0ee4('0x3a')][_0x0ee4('0x55')]({'where':{'id':_0x406935[_0x0ee4('0x53')]['id']}})[_0x0ee4('0x1e')](function(_0x264fb0){return db[_0x0ee4('0x83')][_0x0ee4('0x72')](function(_0x1bddd1){return _0x264fb0[_0x0ee4('0x78')](_0x406935[_0x0ee4('0x3e')][_0x0ee4('0x6e')],{'transaction':_0x1bddd1})[_0x0ee4('0x1e')](function(){if(!_[_0x0ee4('0x8d')](_0x36bd3d)){return _0x264fb0[_0x0ee4('0x8e')](_0x36bd3d,{'transaction':_0x1bddd1});}})['then'](function(){_0x36bd3d[_0x0ee4('0x76')](function(_0x123cb3){socket[_0x0ee4('0x8f')](_0x0ee4('0x90'),{'UserId':_0x123cb3,'ChatQueueId':_0x264fb0['id']});});});});});});})['then'](respondWithStatusCode(_0x48a6ff,null))[_0x0ee4('0x51')](handleError(_0x48a6ff,null));};exports['addAgents']=function(_0x4430c0,_0x17f36c,_0xf0b41c){return db['ChatQueue']['find']({'where':{'id':_0x4430c0['params']['id']}})[_0x0ee4('0x1e')](handleEntityNotFound(_0x17f36c,null))[_0x0ee4('0x1e')](function(_0x3a2da2){if(_0x3a2da2){return _0x3a2da2[_0x0ee4('0x91')](_0x4430c0[_0x0ee4('0x5d')][_0x0ee4('0x6e')],_[_0x0ee4('0x92')](_0x4430c0[_0x0ee4('0x5d')],[_0x0ee4('0x6e'),'id'])||{})[_0x0ee4('0x93')](function(_0x38b2f5){for(var _0x23087a=0x0;_0x23087a<_0x4430c0[_0x0ee4('0x5d')][_0x0ee4('0x6e')][_0x0ee4('0x54')];_0x23087a+=0x1){socket['emit']('userChatQueue:save',{'UserId':Number(_0x4430c0[_0x0ee4('0x5d')][_0x0ee4('0x6e')][_0x23087a]),'ChatQueueId':Number(_0x4430c0[_0x0ee4('0x53')]['id'])});}return _0x38b2f5;});}})[_0x0ee4('0x1e')](respondWithResult(_0x17f36c,null))['catch'](handleError(_0x17f36c,null));};exports[_0x0ee4('0x8e')]=function(_0x588ac7,_0xe2d58e,_0x4de398){return db['ChatQueue'][_0x0ee4('0x55')]({'where':{'id':_0x588ac7[_0x0ee4('0x53')]['id']}})[_0x0ee4('0x1e')](handleEntityNotFound(_0xe2d58e,null))[_0x0ee4('0x1e')](function(_0x5d0071){if(_0x5d0071){return _0x5d0071[_0x0ee4('0x8e')](_0x588ac7[_0x0ee4('0x3e')][_0x0ee4('0x6e')])[_0x0ee4('0x1e')](function(){if(_[_0x0ee4('0x94')](_0x588ac7[_0x0ee4('0x3e')][_0x0ee4('0x6e')])){for(var _0x87c05d=0x0;_0x87c05d<_0x588ac7[_0x0ee4('0x3e')][_0x0ee4('0x6e')][_0x0ee4('0x54')];_0x87c05d+=0x1){socket[_0x0ee4('0x8f')](_0x0ee4('0x90'),{'UserId':Number(_0x588ac7[_0x0ee4('0x3e')][_0x0ee4('0x6e')][_0x87c05d]),'ChatQueueId':Number(_0x588ac7['params']['id'])});}}else{socket['emit'](_0x0ee4('0x90'),{'UserId':Number(_0x588ac7[_0x0ee4('0x3e')]['ids']),'ChatQueueId':Number(_0x588ac7[_0x0ee4('0x53')]['id'])});}});}})['then'](respondWithStatusCode(_0xe2d58e,null))[_0x0ee4('0x51')](handleError(_0xe2d58e,null));};exports[_0x0ee4('0x95')]=function(_0x217a7c,_0x2b5d15,_0x6657f6){var _0x4c7639={};var _0x4f65b9={};var _0x484df7;var _0x4ea576;return db[_0x0ee4('0x3a')][_0x0ee4('0x5f')]({'where':{'id':_0x217a7c[_0x0ee4('0x53')]['id']}})[_0x0ee4('0x1e')](handleEntityNotFound(_0x2b5d15,null))[_0x0ee4('0x1e')](function(_0x2a41e6){if(_0x2a41e6){_0x484df7=_0x2a41e6;_0x4f65b9['model']=_[_0x0ee4('0x3f')](db['User'][_0x0ee4('0x3b')]);_0x4f65b9['query']=_[_0x0ee4('0x3f')](_0x217a7c[_0x0ee4('0x3e')]);_0x4f65b9[_0x0ee4('0x47')]=_[_0x0ee4('0x40')](_0x4f65b9[_0x0ee4('0x3d')],_0x4f65b9['query']);_0x4c7639['attributes']=_[_0x0ee4('0x40')](_0x4f65b9['model'],qs[_0x0ee4('0x42')](_0x217a7c[_0x0ee4('0x3e')]['fields']));_0x4c7639['attributes']=_0x4c7639[_0x0ee4('0x41')][_0x0ee4('0x54')]?_0x4c7639[_0x0ee4('0x41')]:_0x4f65b9[_0x0ee4('0x3d')];_0x4c7639[_0x0ee4('0x44')]=qs[_0x0ee4('0x45')](_0x217a7c[_0x0ee4('0x3e')][_0x0ee4('0x45')]);_0x4c7639['where']=qs[_0x0ee4('0x47')](_[_0x0ee4('0x6c')](_0x217a7c['query'],_0x4f65b9[_0x0ee4('0x47')]));if(_0x217a7c['query']['filter']){_0x4c7639[_0x0ee4('0x46')]=_['merge'](_0x4c7639[_0x0ee4('0x46')],{'$or':_[_0x0ee4('0x39')](_0x4c7639[_0x0ee4('0x41')],function(_0x173e1d){var _0x587245={};_0x587245[_0x173e1d]={'$like':'%'+_0x217a7c[_0x0ee4('0x3e')][_0x0ee4('0x48')]+'%'};return _0x587245;})});}_0x4c7639=_['merge']({},_0x4c7639,_0x217a7c[_0x0ee4('0x4c')]);return _0x484df7[_0x0ee4('0x95')](_0x4c7639);}})[_0x0ee4('0x1e')](function(_0x735d87){if(_0x735d87){_0x4ea576=_0x735d87[_0x0ee4('0x54')];if(!_0x217a7c[_0x0ee4('0x3e')]['hasOwnProperty'](_0x0ee4('0x60'))){_0x4c7639[_0x0ee4('0x2c')]=qs[_0x0ee4('0x2c')](_0x217a7c[_0x0ee4('0x3e')][_0x0ee4('0x2c')]);_0x4c7639['offset']=qs[_0x0ee4('0x2d')](_0x217a7c[_0x0ee4('0x3e')]['offset']);}return _0x484df7['getAgents'](_0x4c7639);}})[_0x0ee4('0x1e')](function(_0x43084c){if(_0x43084c){return _0x43084c?{'count':_0x4ea576,'rows':_0x43084c}:null;}})['then'](respondWithResult(_0x2b5d15,null))[_0x0ee4('0x51')](handleError(_0x2b5d15,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 5520932..ae4a98c 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 _0x64c4=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update','remove'];(function(_0x372316,_0x36205b){var _0x22fc88=function(_0x1a17fe){while(--_0x1a17fe){_0x372316['push'](_0x372316['shift']());}};_0x22fc88(++_0x36205b);}(_0x64c4,0x11b));var _0x464c=function(_0x28c689,_0x4ae001){_0x28c689=_0x28c689-0x0;var _0x6a3248=_0x64c4[_0x28c689];return _0x6a3248;};'use strict';var EventEmitter=require(_0x464c('0x0'));var ChatQueue=require(_0x464c('0x1'))['db'][_0x464c('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x464c('0x3')](0x0);var events={'afterCreate':_0x464c('0x4'),'afterUpdate':_0x464c('0x5'),'afterDestroy':_0x464c('0x6')};function emitEvent(_0x5ea96e){return function(_0x473755,_0x3656d6,_0x2ae690){ChatQueueEvents['emit'](_0x5ea96e+':'+_0x473755['id'],_0x473755);ChatQueueEvents['emit'](_0x5ea96e,_0x473755);_0x2ae690(null);};}for(var e in events){if(events[_0x464c('0x7')](e)){var event=events[e];ChatQueue[_0x464c('0x8')](e,emitEvent(event));}}module[_0x464c('0x9')]=ChatQueueEvents;
\ No newline at end of file
+var _0xf6d1=['../../mysqldb','ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x1ab59f,_0x2d3051){var _0x234db7=function(_0x2db228){while(--_0x2db228){_0x1ab59f['push'](_0x1ab59f['shift']());}};_0x234db7(++_0x2d3051);}(_0xf6d1,0x99));var _0x1f6d=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xf6d1[_0x5b644e];return _0x49c6bf;};'use strict';var EventEmitter=require(_0x1f6d('0x0'));var ChatQueue=require(_0x1f6d('0x1'))['db'][_0x1f6d('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x1f6d('0x3')](0x0);var events={'afterCreate':_0x1f6d('0x4'),'afterUpdate':_0x1f6d('0x5'),'afterDestroy':_0x1f6d('0x6')};function emitEvent(_0x4fa5a2){return function(_0x1b8190,_0x59e1ab,_0x1532aa){ChatQueueEvents[_0x1f6d('0x7')](_0x4fa5a2+':'+_0x1b8190['id'],_0x1b8190);ChatQueueEvents[_0x1f6d('0x7')](_0x4fa5a2,_0x1b8190);_0x1532aa(null);};}for(var e in events){if(events[_0x1f6d('0x8')](e)){var event=events[e];ChatQueue[_0x1f6d('0x9')](e,emitEvent(event));}}module[_0x1f6d('0xa')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index c8156a3..6f01525 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 _0x43f5=['lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','./chatQueue.attributes','exports','define','ChatQueue','chat_queues'];(function(_0x3e1226,_0x4199d6){var _0x1ff634=function(_0x4dbed0){while(--_0x4dbed0){_0x3e1226['push'](_0x3e1226['shift']());}};_0x1ff634(++_0x4199d6);}(_0x43f5,0x1bc));var _0x543f=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x43f5[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0x543f('0x0'));var util=require('util');var logger=require(_0x543f('0x1'))('api');var moment=require(_0x543f('0x2'));var BPromise=require(_0x543f('0x3'));var rp=require(_0x543f('0x4'));var fs=require('fs');var path=require(_0x543f('0x5'));var rimraf=require(_0x543f('0x6'));var config=require('../../config/environment');var attributes=require(_0x543f('0x7'));module[_0x543f('0x8')]=function(_0x12d9f4,_0x308eb7){return _0x12d9f4[_0x543f('0x9')](_0x543f('0xa'),attributes,{'tableName':_0x543f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0244=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment'];(function(_0xf93365,_0x26c5eb){var _0x42fa5d=function(_0x5b9aee){while(--_0x5b9aee){_0xf93365['push'](_0xf93365['shift']());}};_0x42fa5d(++_0x26c5eb);}(_0x0244,0x14b));var _0x4024=function(_0x282ccc,_0x5d66a1){_0x282ccc=_0x282ccc-0x0;var _0x27c2dd=_0x0244[_0x282ccc];return _0x27c2dd;};'use strict';var _=require(_0x4024('0x0'));var util=require(_0x4024('0x1'));var logger=require(_0x4024('0x2'))(_0x4024('0x3'));var moment=require(_0x4024('0x4'));var BPromise=require(_0x4024('0x5'));var rp=require(_0x4024('0x6'));var fs=require('fs');var path=require(_0x4024('0x7'));var rimraf=require(_0x4024('0x8'));var config=require(_0x4024('0x9'));var attributes=require('./chatQueue.attributes');module[_0x4024('0xa')]=function(_0x4aca82,_0x41efe7){return _0x4aca82[_0x4024('0xb')](_0x4024('0xc'),attributes,{'tableName':_0x4024('0xd'),'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 2e923e9..36c48fd 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 _0x2fc0=['../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','request','info','ChatQueue,\x20%s,\x20%s','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetChatQueue','options','raw','attributes','include','map','model','then','debug','ShowChatQueue','util','moment','bluebird','randomstring','ioredis'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x2fc0,0x192));var _0x02fc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2fc0[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x02fc('0x0'));var moment=require(_0x02fc('0x1'));var BPromise=require(_0x02fc('0x2'));var rs=require(_0x02fc('0x3'));var fs=require('fs');var Redis=require(_0x02fc('0x4'));var db=require(_0x02fc('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x02fc('0x6'))(_0x02fc('0x7'));var config=require(_0x02fc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x02fc('0x9')][_0x02fc('0xa')]({'port':0x232a});config[_0x02fc('0xb')]=_[_0x02fc('0xc')](config['redis'],{'host':_0x02fc('0xd'),'port':0x18eb});var socket=require(_0x02fc('0xe'))(new Redis(config[_0x02fc('0xb')]));require(_0x02fc('0xf'))['register'](socket);function respondWithRpcPromise(_0x23d777,_0x3283a3,_0xb4dbc9){return new BPromise(function(_0x588bc3,_0x3fb788){return client[_0x02fc('0x10')](_0x23d777,_0xb4dbc9)['then'](function(_0x88540d){logger[_0x02fc('0x11')](_0x02fc('0x12'),_0x3283a3,'request\x20sent');logger['debug'](_0x02fc('0x13'),_0x3283a3,_0x02fc('0x14'),JSON[_0x02fc('0x15')](_0x88540d));if(_0x88540d[_0x02fc('0x16')]){if(_0x88540d['error'][_0x02fc('0x17')]===0x1f4){logger['error'](_0x02fc('0x12'),_0x3283a3,_0x88540d[_0x02fc('0x16')]['message']);return _0x3fb788(_0x88540d[_0x02fc('0x16')][_0x02fc('0x18')]);}logger[_0x02fc('0x16')](_0x02fc('0x12'),_0x3283a3,_0x88540d['error']['message']);return _0x588bc3(_0x88540d[_0x02fc('0x16')][_0x02fc('0x18')]);}else{logger[_0x02fc('0x11')](_0x02fc('0x12'),_0x3283a3,_0x02fc('0x14'));_0x588bc3(_0x88540d[_0x02fc('0x19')][_0x02fc('0x18')]);}})[_0x02fc('0x1a')](function(_0x57d824){logger[_0x02fc('0x16')](_0x02fc('0x12'),_0x3283a3,_0x57d824);_0x3fb788(_0x57d824);});});}exports[_0x02fc('0x1b')]=function(_0x767db8){var _0x204438=this;return new Promise(function(_0xc29da2,_0x1c892d){return db['ChatQueue']['findAll']({'raw':_0x767db8[_0x02fc('0x1c')]?_0x767db8[_0x02fc('0x1c')][_0x02fc('0x1d')]===undefined?!![]:![]:!![],'where':_0x767db8['options']?_0x767db8['options']['where']||null:null,'attributes':_0x767db8['options']?_0x767db8[_0x02fc('0x1c')][_0x02fc('0x1e')]||null:null,'limit':_0x767db8[_0x02fc('0x1c')]?_0x767db8[_0x02fc('0x1c')]['limit']||null:null,'include':_0x767db8[_0x02fc('0x1c')]?_0x767db8[_0x02fc('0x1c')][_0x02fc('0x1f')]?_[_0x02fc('0x20')](_0x767db8['options'][_0x02fc('0x1f')],function(_0x3acfb6){return{'model':db[_0x3acfb6[_0x02fc('0x21')]],'as':_0x3acfb6['as'],'attributes':_0x3acfb6[_0x02fc('0x1e')],'include':_0x3acfb6[_0x02fc('0x1f')]?_[_0x02fc('0x20')](_0x3acfb6['include'],function(_0x4c2d3e){return{'model':db[_0x4c2d3e[_0x02fc('0x21')]],'as':_0x4c2d3e['as'],'attributes':_0x4c2d3e[_0x02fc('0x1e')],'include':_0x4c2d3e['include']?_[_0x02fc('0x20')](_0x4c2d3e[_0x02fc('0x1f')],function(_0x8d821e){return{'model':db[_0x8d821e['model']],'as':_0x8d821e['as'],'attributes':_0x8d821e[_0x02fc('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x02fc('0x22')](function(_0xb21002){logger[_0x02fc('0x11')](_0x02fc('0x1b'),_0x767db8);logger[_0x02fc('0x23')](_0x02fc('0x1b'),_0x767db8,JSON['stringify'](_0xb21002));_0xc29da2(_0xb21002);})['catch'](function(_0x289f36){logger[_0x02fc('0x16')]('GetChatQueue',_0x289f36[_0x02fc('0x18')],_0x767db8);_0x1c892d(_0x204438[_0x02fc('0x16')](0x1f4,_0x289f36[_0x02fc('0x18')]));});});};exports['ShowChatQueue']=function(_0x2fe34e){var _0x5014f8=this;return new Promise(function(_0x61c5e5,_0x5e97ba){return db['ChatQueue']['find']({'raw':_0x2fe34e['options']?_0x2fe34e[_0x02fc('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x2fe34e[_0x02fc('0x1c')]?_0x2fe34e[_0x02fc('0x1c')]['where']||null:null,'attributes':_0x2fe34e['options']?_0x2fe34e[_0x02fc('0x1c')]['attributes']||null:null,'include':_0x2fe34e['options']?_0x2fe34e[_0x02fc('0x1c')]['include']?_[_0x02fc('0x20')](_0x2fe34e['options'][_0x02fc('0x1f')],function(_0x4ec08f){return{'model':db[_0x4ec08f[_0x02fc('0x21')]],'as':_0x4ec08f['as'],'attributes':_0x4ec08f[_0x02fc('0x1e')],'include':_0x4ec08f['include']?_[_0x02fc('0x20')](_0x4ec08f[_0x02fc('0x1f')],function(_0x2e622d){return{'model':db[_0x2e622d[_0x02fc('0x21')]],'as':_0x2e622d['as'],'attributes':_0x2e622d['attributes'],'include':_0x2e622d[_0x02fc('0x1f')]?_[_0x02fc('0x20')](_0x2e622d[_0x02fc('0x1f')],function(_0x57673c){return{'model':db[_0x57673c[_0x02fc('0x21')]],'as':_0x57673c['as'],'attributes':_0x57673c[_0x02fc('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x02fc('0x22')](function(_0x358b40){logger[_0x02fc('0x11')](_0x02fc('0x24'),_0x2fe34e);logger['debug']('ShowChatQueue',_0x2fe34e,JSON['stringify'](_0x358b40));_0x61c5e5(_0x358b40);})[_0x02fc('0x1a')](function(_0x2084a8){logger[_0x02fc('0x16')](_0x02fc('0x24'),_0x2084a8['message'],_0x2fe34e);_0x5e97ba(_0x5014f8['error'](0x1f4,_0x2084a8[_0x02fc('0x18')]));});});};
\ No newline at end of file
+var _0xc584=['request\x20sent','stringify','error','code','message','ChatQueue,\x20%s,\x20%s','result','catch','GetChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','ChatQueue','ShowChatQueue','util','moment','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','./chatQueue.socket','register','request','then','info','debug'];(function(_0x5e745e,_0xde2931){var _0x122dab=function(_0xe396a5){while(--_0xe396a5){_0x5e745e['push'](_0x5e745e['shift']());}};_0x122dab(++_0xde2931);}(_0xc584,0xa8));var _0x4c58=function(_0x312abc,_0x17f25c){_0x312abc=_0x312abc-0x0;var _0x314298=_0xc584[_0x312abc];return _0x314298;};'use strict';var _=require('lodash');var util=require(_0x4c58('0x0'));var moment=require(_0x4c58('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4c58('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x4c58('0x3'));var logger=require(_0x4c58('0x4'))(_0x4c58('0x5'));var config=require('../../config/environment');var jayson=require(_0x4c58('0x6'));var client=jayson[_0x4c58('0x7')][_0x4c58('0x8')]({'port':0x232a});config[_0x4c58('0x9')]=_[_0x4c58('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4c58('0x9')]));require(_0x4c58('0xb'))[_0x4c58('0xc')](socket);function respondWithRpcPromise(_0x39405a,_0xb89ef4,_0x23a115){return new BPromise(function(_0x85e280,_0xd08c65){return client[_0x4c58('0xd')](_0x39405a,_0x23a115)[_0x4c58('0xe')](function(_0x2b21da){logger[_0x4c58('0xf')]('ChatQueue,\x20%s,\x20%s',_0xb89ef4,'request\x20sent');logger[_0x4c58('0x10')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0xb89ef4,_0x4c58('0x11'),JSON[_0x4c58('0x12')](_0x2b21da));if(_0x2b21da[_0x4c58('0x13')]){if(_0x2b21da[_0x4c58('0x13')][_0x4c58('0x14')]===0x1f4){logger[_0x4c58('0x13')]('ChatQueue,\x20%s,\x20%s',_0xb89ef4,_0x2b21da[_0x4c58('0x13')]['message']);return _0xd08c65(_0x2b21da[_0x4c58('0x13')][_0x4c58('0x15')]);}logger[_0x4c58('0x13')](_0x4c58('0x16'),_0xb89ef4,_0x2b21da[_0x4c58('0x13')][_0x4c58('0x15')]);return _0x85e280(_0x2b21da['error'][_0x4c58('0x15')]);}else{logger[_0x4c58('0xf')](_0x4c58('0x16'),_0xb89ef4,_0x4c58('0x11'));_0x85e280(_0x2b21da[_0x4c58('0x17')]['message']);}})[_0x4c58('0x18')](function(_0x45b1ab){logger['error'](_0x4c58('0x16'),_0xb89ef4,_0x45b1ab);_0xd08c65(_0x45b1ab);});});}exports[_0x4c58('0x19')]=function(_0x1a0062){var _0x2413f4=this;return new Promise(function(_0x227931,_0x46876f){return db['ChatQueue'][_0x4c58('0x1a')]({'raw':_0x1a0062[_0x4c58('0x1b')]?_0x1a0062[_0x4c58('0x1b')][_0x4c58('0x1c')]===undefined?!![]:![]:!![],'where':_0x1a0062[_0x4c58('0x1b')]?_0x1a0062['options'][_0x4c58('0x1d')]||null:null,'attributes':_0x1a0062['options']?_0x1a0062[_0x4c58('0x1b')][_0x4c58('0x1e')]||null:null,'limit':_0x1a0062['options']?_0x1a0062[_0x4c58('0x1b')][_0x4c58('0x1f')]||null:null,'include':_0x1a0062[_0x4c58('0x1b')]?_0x1a0062['options'][_0x4c58('0x20')]?_[_0x4c58('0x21')](_0x1a0062[_0x4c58('0x1b')][_0x4c58('0x20')],function(_0x41bc70){return{'model':db[_0x41bc70['model']],'as':_0x41bc70['as'],'attributes':_0x41bc70[_0x4c58('0x1e')],'include':_0x41bc70[_0x4c58('0x20')]?_[_0x4c58('0x21')](_0x41bc70[_0x4c58('0x20')],function(_0x317409){return{'model':db[_0x317409[_0x4c58('0x22')]],'as':_0x317409['as'],'attributes':_0x317409[_0x4c58('0x1e')],'include':_0x317409[_0x4c58('0x20')]?_['map'](_0x317409[_0x4c58('0x20')],function(_0x10b72c){return{'model':db[_0x10b72c[_0x4c58('0x22')]],'as':_0x10b72c['as'],'attributes':_0x10b72c[_0x4c58('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4c58('0xe')](function(_0x19ed6e){logger[_0x4c58('0xf')](_0x4c58('0x19'),_0x1a0062);logger[_0x4c58('0x10')](_0x4c58('0x19'),_0x1a0062,JSON[_0x4c58('0x12')](_0x19ed6e));_0x227931(_0x19ed6e);})[_0x4c58('0x18')](function(_0x3ec02a){logger[_0x4c58('0x13')](_0x4c58('0x19'),_0x3ec02a[_0x4c58('0x15')],_0x1a0062);_0x46876f(_0x2413f4[_0x4c58('0x13')](0x1f4,_0x3ec02a[_0x4c58('0x15')]));});});};exports['ShowChatQueue']=function(_0x540fad){var _0x5238c9=this;return new Promise(function(_0x282071,_0x50fbeb){return db[_0x4c58('0x23')]['find']({'raw':_0x540fad[_0x4c58('0x1b')]?_0x540fad[_0x4c58('0x1b')][_0x4c58('0x1c')]===undefined?!![]:![]:!![],'where':_0x540fad['options']?_0x540fad[_0x4c58('0x1b')][_0x4c58('0x1d')]||null:null,'attributes':_0x540fad[_0x4c58('0x1b')]?_0x540fad[_0x4c58('0x1b')][_0x4c58('0x1e')]||null:null,'include':_0x540fad[_0x4c58('0x1b')]?_0x540fad[_0x4c58('0x1b')][_0x4c58('0x20')]?_['map'](_0x540fad['options']['include'],function(_0x284335){return{'model':db[_0x284335[_0x4c58('0x22')]],'as':_0x284335['as'],'attributes':_0x284335[_0x4c58('0x1e')],'include':_0x284335['include']?_[_0x4c58('0x21')](_0x284335[_0x4c58('0x20')],function(_0x10d420){return{'model':db[_0x10d420[_0x4c58('0x22')]],'as':_0x10d420['as'],'attributes':_0x10d420['attributes'],'include':_0x10d420[_0x4c58('0x20')]?_[_0x4c58('0x21')](_0x10d420[_0x4c58('0x20')],function(_0x4419a6){return{'model':db[_0x4419a6[_0x4c58('0x22')]],'as':_0x4419a6['as'],'attributes':_0x4419a6[_0x4c58('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xf032cc){logger['info']('ShowChatQueue',_0x540fad);logger[_0x4c58('0x10')]('ShowChatQueue',_0x540fad,JSON[_0x4c58('0x12')](_0xf032cc));_0x282071(_0xf032cc);})[_0x4c58('0x18')](function(_0x3b6aeb){logger[_0x4c58('0x13')](_0x4c58('0x24'),_0x3b6aeb['message'],_0x540fad);_0x50fbeb(_0x5238c9[_0x4c58('0x13')](0x1f4,_0x3b6aeb[_0x4c58('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 5e9e73f..0967b79 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 _0x34e5=['update','emit','removeListener','register','length','chatQueue:','save'];(function(_0xe46336,_0x3b1a0d){var _0x5a9f5b=function(_0x6c06c4){while(--_0x6c06c4){_0xe46336['push'](_0xe46336['shift']());}};_0x5a9f5b(++_0x3b1a0d);}(_0x34e5,0x172));var _0x534e=function(_0xc4d9f7,_0x4a28e4){_0xc4d9f7=_0xc4d9f7-0x0;var _0x1d8214=_0x34e5[_0xc4d9f7];return _0x1d8214;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x534e('0x0'),'remove',_0x534e('0x1')];function createListener(_0x467e3e,_0x425ae8){return function(_0x246650){_0x425ae8[_0x534e('0x2')](_0x467e3e,_0x246650);};}function removeListener(_0x50b790,_0x11a158){return function(){ChatQueueEvents[_0x534e('0x3')](_0x50b790,_0x11a158);};}exports[_0x534e('0x4')]=function(_0x117f0c){for(var _0x436a92=0x0,_0x2d0370=events[_0x534e('0x5')];_0x436a92<_0x2d0370;_0x436a92++){var _0x5620d4=events[_0x436a92];var _0x24d562=createListener(_0x534e('0x6')+_0x5620d4,_0x117f0c);ChatQueueEvents['on'](_0x5620d4,_0x24d562);}};
\ No newline at end of file
+var _0xec56=['removeListener','register','length','chatQueue:','./chatQueue.events','update','emit'];(function(_0xa9ac50,_0x14e3e4){var _0xfabbe7=function(_0x2b68b5){while(--_0x2b68b5){_0xa9ac50['push'](_0xa9ac50['shift']());}};_0xfabbe7(++_0x14e3e4);}(_0xec56,0x1bd));var _0x6ec5=function(_0x26e154,_0x5e8835){_0x26e154=_0x26e154-0x0;var _0x3e949d=_0xec56[_0x26e154];return _0x3e949d;};'use strict';var ChatQueueEvents=require(_0x6ec5('0x0'));var events=['save','remove',_0x6ec5('0x1')];function createListener(_0x3b8a3f,_0x26a5af){return function(_0x240ccf){_0x26a5af[_0x6ec5('0x2')](_0x3b8a3f,_0x240ccf);};}function removeListener(_0x399441,_0x469679){return function(){ChatQueueEvents[_0x6ec5('0x3')](_0x399441,_0x469679);};}exports[_0x6ec5('0x4')]=function(_0x28b12b){for(var _0x2d0a93=0x0,_0x3bb683=events[_0x6ec5('0x5')];_0x2d0a93<_0x3bb683;_0x2d0a93++){var _0x1f59cd=events[_0x2d0a93];var _0x3dd891=createListener(_0x6ec5('0x6')+_0x1f59cd,_0x28b12b);ChatQueueEvents['on'](_0x1f59cd,_0x3dd891);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 820491f..e4b7ba2 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 _0x7217=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x1beb3d,_0x410173){var _0x28894c=function(_0xa7b338){while(--_0xa7b338){_0x1beb3d['push'](_0x1beb3d['shift']());}};_0x28894c(++_0x410173);}(_0x7217,0x19e));var _0x7721=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x7217[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getAgents']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['post'](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);router[_0x7721('0x17')](_0x7721('0xd'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router['delete'](_0x7721('0x11'),auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x17')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1a')]);module[_0x7721('0x1b')]=router;
\ No newline at end of file
+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(_0x3bec85,_0x37d590){var _0x26e51a=function(_0xd347f5){while(--_0xd347f5){_0x3bec85['push'](_0x3bec85['shift']());}};_0x26e51a(++_0x37d590);}(_0xe14b,0x93));var _0xbe14=function(_0x36cfae,_0x35dae4){_0x36cfae=_0x36cfae-0x0;var _0x297137=_0xe14b[_0x36cfae];return _0x297137;};'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
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index f1b86b3..228d3e0 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 _0x3805=['exports','STRING','DATE','moment','sequelize'];(function(_0x2a2591,_0x958577){var _0x45bde5=function(_0x581142){while(--_0x581142){_0x2a2591['push'](_0x2a2591['shift']());}};_0x45bde5(++_0x958577);}(_0x3805,0x111));var _0x5380=function(_0x8c1005,_0x1f3f16){_0x8c1005=_0x8c1005-0x0;var _0x175354=_0x3805[_0x8c1005];return _0x175354;};'use strict';var moment=require(_0x5380('0x0'));var Sequelize=require(_0x5380('0x1'));module[_0x5380('0x2')]={'uniqueid':{'type':Sequelize[_0x5380('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x5380('0x3')]},'joinAt':{'type':Sequelize[_0x5380('0x4')]},'leaveAt':{'type':Sequelize[_0x5380('0x4')]},'acceptAt':{'type':Sequelize[_0x5380('0x4')]},'exitAt':{'type':Sequelize[_0x5380('0x4')]},'reason':{'type':Sequelize[_0x5380('0x3')]}};
\ No newline at end of file
+var _0xdeeb=['exports','STRING','DATE','moment'];(function(_0x37756b,_0x24db76){var _0x46efec=function(_0x319807){while(--_0x319807){_0x37756b['push'](_0x37756b['shift']());}};_0x46efec(++_0x24db76);}(_0xdeeb,0x1b3));var _0xbdee=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0xdeeb[_0x9fd887];return _0x1a54ab;};'use strict';var moment=require(_0xbdee('0x0'));var Sequelize=require('sequelize');module[_0xbdee('0x1')]={'uniqueid':{'type':Sequelize[_0xbdee('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xbdee('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xbdee('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xbdee('0x3')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 3be5cbf..15e9eed 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 _0x7dee=['fields','length','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','count','includeAll','findAll','rows','show','options','catch','create','body','find','params','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','set','Content-Range','json','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','ChatQueueReport','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','attributes'];(function(_0xd5baf1,_0x2dcaa6){var _0x47eb69=function(_0x243cd4){while(--_0x243cd4){_0xd5baf1['push'](_0xd5baf1['shift']());}};_0x47eb69(++_0x2dcaa6);}(_0x7dee,0xb0));var _0xe7de=function(_0x398500,_0x2d52b4){_0x398500=_0x398500-0x0;var _0x3a2817=_0x7dee[_0x398500];return _0x3a2817;};'use strict';var emlformat=require(_0xe7de('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe7de('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe7de('0x2'));var moment=require(_0xe7de('0x3'));var BPromise=require(_0xe7de('0x4'));var Mustache=require(_0xe7de('0x5'));var util=require('util');var path=require(_0xe7de('0x6'));var sox=require('sox');var csv=require(_0xe7de('0x7'));var ejs=require(_0xe7de('0x8'));var fs=require('fs');var fs_extra=require(_0xe7de('0x9'));var _=require(_0xe7de('0xa'));var squel=require(_0xe7de('0xb'));var crypto=require(_0xe7de('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe7de('0xd'));var toCsv=require(_0xe7de('0x7'));var querystring=require(_0xe7de('0xe'));var Papa=require(_0xe7de('0xf'));var Redis=require('ioredis');var authService=require(_0xe7de('0x10'));var qs=require(_0xe7de('0x11'));var as=require(_0xe7de('0x12'));var hardwareService=require(_0xe7de('0x13'));var logger=require(_0xe7de('0x14'))(_0xe7de('0x15'));var utils=require(_0xe7de('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xe7de('0x17'));var db=require(_0xe7de('0x18'))['db'];function respondWithStatusCode(_0x38c0a1,_0x2c535c){_0x2c535c=_0x2c535c||0xcc;return function(_0x2c49d6){if(_0x2c49d6){return _0x38c0a1['sendStatus'](_0x2c535c);}return _0x38c0a1[_0xe7de('0x19')](_0x2c535c)[_0xe7de('0x1a')]();};}function respondWithResult(_0x280473,_0x41f731){_0x41f731=_0x41f731||0xc8;return function(_0xe68b48){if(_0xe68b48){return _0x280473[_0xe7de('0x19')](_0x41f731)['json'](_0xe68b48);}};}function respondWithFilteredResult(_0x4b70ab,_0x28a0c4){return function(_0x3f62e1){if(_0x3f62e1){var _0x3e49d5=typeof _0x28a0c4[_0xe7de('0x1b')]===_0xe7de('0x1c')&&typeof _0x28a0c4['limit']===_0xe7de('0x1c');var _0x4b1648=_0x3f62e1['count'];var _0x5cb629=_0x3e49d5?0x0:_0x28a0c4[_0xe7de('0x1b')];var _0x1da189=_0x3e49d5?_0x3f62e1['count']:_0x28a0c4[_0xe7de('0x1b')]+_0x28a0c4[_0xe7de('0x1d')];var _0x2850c6;if(_0x1da189>=_0x4b1648){_0x1da189=_0x4b1648;_0x2850c6=0xc8;}else{_0x2850c6=0xce;}_0x4b70ab[_0xe7de('0x19')](_0x2850c6);return _0x4b70ab[_0xe7de('0x1e')](_0xe7de('0x1f'),_0x5cb629+'-'+_0x1da189+'/'+_0x4b1648)[_0xe7de('0x20')](_0x3f62e1);}return null;};}function patchUpdates(_0xfead44){return function(_0x1c6fa6){try{jsonpatch['apply'](_0x1c6fa6,_0xfead44,!![]);}catch(_0x1120c1){return BPromise[_0xe7de('0x21')](_0x1120c1);}return _0x1c6fa6[_0xe7de('0x22')]();};}function saveUpdates(_0x4eb228,_0xc9f494){return function(_0x597346){if(_0x597346){return _0x597346[_0xe7de('0x23')](_0x4eb228)[_0xe7de('0x24')](function(_0x3b0c24){return _0x3b0c24;});}return null;};}function removeEntity(_0x5e97ec,_0x45b4e1){return function(_0x454952){if(_0x454952){return _0x454952[_0xe7de('0x25')]()[_0xe7de('0x24')](function(){_0x5e97ec[_0xe7de('0x19')](0xcc)[_0xe7de('0x1a')]();});}};}function handleEntityNotFound(_0xd7f3ca,_0x1f837e){return function(_0x4c0aff){if(!_0x4c0aff){_0xd7f3ca[_0xe7de('0x26')](0x194);}return _0x4c0aff;};}function handleError(_0x33e7f1,_0x419a94){_0x419a94=_0x419a94||0x1f4;return function(_0x248b9a){logger[_0xe7de('0x27')](_0x248b9a[_0xe7de('0x28')]);if(_0x248b9a[_0xe7de('0x29')]){delete _0x248b9a['name'];}_0x33e7f1[_0xe7de('0x19')](_0x419a94)[_0xe7de('0x2a')](_0x248b9a);};}exports[_0xe7de('0x2b')]=function(_0x3d4d63,_0x25b7cd){var _0x4ff7df={},_0x41b591={},_0x241a37={'count':0x0,'rows':[]};var _0x596cb2=_['map'](db[_0xe7de('0x2c')][_0xe7de('0x2d')],function(_0x225e8e){return{'name':_0x225e8e[_0xe7de('0x2e')],'type':_0x225e8e['type'][_0xe7de('0x2f')]};});_0x41b591[_0xe7de('0x30')]=_[_0xe7de('0x31')](_0x596cb2,_0xe7de('0x29'));_0x41b591['query']=_[_0xe7de('0x32')](_0x3d4d63[_0xe7de('0x33')]);_0x41b591[_0xe7de('0x34')]=_[_0xe7de('0x35')](_0x41b591[_0xe7de('0x30')],_0x41b591[_0xe7de('0x33')]);_0x4ff7df[_0xe7de('0x36')]=_[_0xe7de('0x35')](_0x41b591['model'],qs[_0xe7de('0x37')](_0x3d4d63[_0xe7de('0x33')][_0xe7de('0x37')]));_0x4ff7df[_0xe7de('0x36')]=_0x4ff7df[_0xe7de('0x36')][_0xe7de('0x38')]?_0x4ff7df[_0xe7de('0x36')]:_0x41b591[_0xe7de('0x30')];if(!_0x3d4d63[_0xe7de('0x33')][_0xe7de('0x39')]('nolimit')){_0x4ff7df['limit']=qs[_0xe7de('0x1d')](_0x3d4d63[_0xe7de('0x33')][_0xe7de('0x1d')]);_0x4ff7df[_0xe7de('0x1b')]=qs[_0xe7de('0x1b')](_0x3d4d63[_0xe7de('0x33')][_0xe7de('0x1b')]);}_0x4ff7df[_0xe7de('0x3a')]=qs[_0xe7de('0x3b')](_0x3d4d63[_0xe7de('0x33')]['sort']);_0x4ff7df[_0xe7de('0x3c')]=qs[_0xe7de('0x34')](_[_0xe7de('0x3d')](_0x3d4d63[_0xe7de('0x33')],_0x41b591[_0xe7de('0x34')]),_0x596cb2);if(_0x3d4d63['query']['filter']){_0x4ff7df[_0xe7de('0x3c')]=_[_0xe7de('0x3e')](_0x4ff7df[_0xe7de('0x3c')],{'$or':_[_0xe7de('0x31')](_0x596cb2,function(_0x377b89){if(_0x377b89[_0xe7de('0x3f')]!==_0xe7de('0x40')){var _0x219231={};_0x219231[_0x377b89[_0xe7de('0x29')]]={'$like':'%'+_0x3d4d63['query']['filter']+'%'};return _0x219231;}})});}_0x4ff7df=_[_0xe7de('0x3e')]({},_0x4ff7df,_0x3d4d63['options']);var _0x51ff68={'where':_0x4ff7df['where']};return db[_0xe7de('0x2c')][_0xe7de('0x41')](_0x51ff68)[_0xe7de('0x24')](function(_0x94a7c2){_0x241a37[_0xe7de('0x41')]=_0x94a7c2;if(_0x3d4d63[_0xe7de('0x33')][_0xe7de('0x42')]){_0x4ff7df['include']=[{'all':!![]}];}return db['ChatQueueReport'][_0xe7de('0x43')](_0x4ff7df);})[_0xe7de('0x24')](function(_0xa71e89){_0x241a37[_0xe7de('0x44')]=_0xa71e89;return _0x241a37;})['then'](respondWithFilteredResult(_0x25b7cd,_0x4ff7df))['catch'](handleError(_0x25b7cd,null));};exports[_0xe7de('0x45')]=function(_0x495a82,_0x1ad1ac){var _0x5ac35f={'raw':!![],'where':{'id':_0x495a82['params']['id']}},_0x3e33dc={};_0x3e33dc[_0xe7de('0x30')]=_['keys'](db[_0xe7de('0x2c')][_0xe7de('0x2d')]);_0x3e33dc[_0xe7de('0x33')]=_['keys'](_0x495a82[_0xe7de('0x33')]);_0x3e33dc[_0xe7de('0x34')]=_[_0xe7de('0x35')](_0x3e33dc['model'],_0x3e33dc[_0xe7de('0x33')]);_0x5ac35f['attributes']=_[_0xe7de('0x35')](_0x3e33dc[_0xe7de('0x30')],qs[_0xe7de('0x37')](_0x495a82[_0xe7de('0x33')][_0xe7de('0x37')]));_0x5ac35f['attributes']=_0x5ac35f['attributes'][_0xe7de('0x38')]?_0x5ac35f['attributes']:_0x3e33dc['model'];if(_0x495a82[_0xe7de('0x33')][_0xe7de('0x42')]){_0x5ac35f['include']=[{'all':!![]}];}_0x5ac35f=_[_0xe7de('0x3e')]({},_0x5ac35f,_0x495a82[_0xe7de('0x46')]);return db['ChatQueueReport']['find'](_0x5ac35f)[_0xe7de('0x24')](handleEntityNotFound(_0x1ad1ac,null))[_0xe7de('0x24')](respondWithResult(_0x1ad1ac,null))[_0xe7de('0x47')](handleError(_0x1ad1ac,null));};exports['create']=function(_0x2eef24,_0x28eef7){return db[_0xe7de('0x2c')][_0xe7de('0x48')](_0x2eef24[_0xe7de('0x49')],{})[_0xe7de('0x24')](respondWithResult(_0x28eef7,0xc9))[_0xe7de('0x47')](handleError(_0x28eef7,null));};exports[_0xe7de('0x23')]=function(_0x407582,_0x2d8a9a){if(_0x407582[_0xe7de('0x49')]['id']){delete _0x407582['body']['id'];}return db[_0xe7de('0x2c')][_0xe7de('0x4a')]({'where':{'id':_0x407582[_0xe7de('0x4b')]['id']}})[_0xe7de('0x24')](handleEntityNotFound(_0x2d8a9a,null))['then'](saveUpdates(_0x407582[_0xe7de('0x49')],null))[_0xe7de('0x24')](respondWithResult(_0x2d8a9a,null))[_0xe7de('0x47')](handleError(_0x2d8a9a,null));};exports[_0xe7de('0x25')]=function(_0x374d37,_0x427ba6){return db[_0xe7de('0x2c')][_0xe7de('0x4a')]({'where':{'id':_0x374d37[_0xe7de('0x4b')]['id']}})[_0xe7de('0x24')](handleEntityNotFound(_0x427ba6,null))['then'](removeEntity(_0x427ba6,null))[_0xe7de('0x47')](handleError(_0x427ba6,null));};exports[_0xe7de('0x4c')]=function(_0x3aac91,_0x3415a6){return db[_0xe7de('0x2c')][_0xe7de('0x4c')]()['then'](respondWithResult(_0x3415a6,null))[_0xe7de('0x47')](handleError(_0x3415a6,null));};
\ No newline at end of file
+var _0x6ab9=['query','attributes','fields','nolimit','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','length','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','key','model','intersection'];(function(_0x2ad5cb,_0x34bf2a){var _0x3e3b42=function(_0x2a7be2){while(--_0x2a7be2){_0x2ad5cb['push'](_0x2ad5cb['shift']());}};_0x3e3b42(++_0x34bf2a);}(_0x6ab9,0x19a));var _0x96ab=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0x6ab9[_0x476bf4];return _0x788ffe;};'use strict';var emlformat=require(_0x96ab('0x0'));var rimraf=require(_0x96ab('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x96ab('0x2'));var rp=require(_0x96ab('0x3'));var moment=require(_0x96ab('0x4'));var BPromise=require(_0x96ab('0x5'));var Mustache=require(_0x96ab('0x6'));var util=require('util');var path=require('path');var sox=require(_0x96ab('0x7'));var csv=require(_0x96ab('0x8'));var ejs=require(_0x96ab('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x96ab('0xa'));var squel=require(_0x96ab('0xb'));var crypto=require('crypto');var jsforce=require(_0x96ab('0xc'));var deskjs=require(_0x96ab('0xd'));var toCsv=require(_0x96ab('0x8'));var querystring=require(_0x96ab('0xe'));var Papa=require(_0x96ab('0xf'));var Redis=require(_0x96ab('0x10'));var authService=require(_0x96ab('0x11'));var qs=require(_0x96ab('0x12'));var as=require(_0x96ab('0x13'));var hardwareService=require(_0x96ab('0x14'));var logger=require(_0x96ab('0x15'))(_0x96ab('0x16'));var utils=require(_0x96ab('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x96ab('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c9204,_0x1131b5){_0x1131b5=_0x1131b5||0xcc;return function(_0x2d3ec3){if(_0x2d3ec3){return _0x2c9204[_0x96ab('0x19')](_0x1131b5);}return _0x2c9204[_0x96ab('0x1a')](_0x1131b5)[_0x96ab('0x1b')]();};}function respondWithResult(_0x3ff9a9,_0x24e2c4){_0x24e2c4=_0x24e2c4||0xc8;return function(_0x126761){if(_0x126761){return _0x3ff9a9[_0x96ab('0x1a')](_0x24e2c4)[_0x96ab('0x1c')](_0x126761);}};}function respondWithFilteredResult(_0x4df67b,_0x4ec844){return function(_0x3b54cc){if(_0x3b54cc){var _0x8d5c87=typeof _0x4ec844[_0x96ab('0x1d')]==='undefined'&&typeof _0x4ec844[_0x96ab('0x1e')]===_0x96ab('0x1f');var _0x56f92b=_0x3b54cc[_0x96ab('0x20')];var _0x4eca78=_0x8d5c87?0x0:_0x4ec844[_0x96ab('0x1d')];var _0x1a502a=_0x8d5c87?_0x3b54cc[_0x96ab('0x20')]:_0x4ec844[_0x96ab('0x1d')]+_0x4ec844[_0x96ab('0x1e')];var _0x1577bb;if(_0x1a502a>=_0x56f92b){_0x1a502a=_0x56f92b;_0x1577bb=0xc8;}else{_0x1577bb=0xce;}_0x4df67b[_0x96ab('0x1a')](_0x1577bb);return _0x4df67b[_0x96ab('0x21')](_0x96ab('0x22'),_0x4eca78+'-'+_0x1a502a+'/'+_0x56f92b)[_0x96ab('0x1c')](_0x3b54cc);}return null;};}function patchUpdates(_0x2aa3c4){return function(_0x4f3bb4){try{jsonpatch['apply'](_0x4f3bb4,_0x2aa3c4,!![]);}catch(_0x347b91){return BPromise[_0x96ab('0x23')](_0x347b91);}return _0x4f3bb4[_0x96ab('0x24')]();};}function saveUpdates(_0x583be2,_0x41936c){return function(_0x5ccaaa){if(_0x5ccaaa){return _0x5ccaaa[_0x96ab('0x25')](_0x583be2)['then'](function(_0x33c140){return _0x33c140;});}return null;};}function removeEntity(_0x90fa22,_0x5a02d0){return function(_0x1deef7){if(_0x1deef7){return _0x1deef7[_0x96ab('0x26')]()[_0x96ab('0x27')](function(){_0x90fa22[_0x96ab('0x1a')](0xcc)[_0x96ab('0x1b')]();});}};}function handleEntityNotFound(_0x27d6d5,_0x9cb9b6){return function(_0x2837a7){if(!_0x2837a7){_0x27d6d5[_0x96ab('0x19')](0x194);}return _0x2837a7;};}function handleError(_0x53869e,_0x215f09){_0x215f09=_0x215f09||0x1f4;return function(_0x524e1c){logger[_0x96ab('0x28')](_0x524e1c[_0x96ab('0x29')]);if(_0x524e1c[_0x96ab('0x2a')]){delete _0x524e1c[_0x96ab('0x2a')];}_0x53869e[_0x96ab('0x1a')](_0x215f09)[_0x96ab('0x2b')](_0x524e1c);};}exports[_0x96ab('0x2c')]=function(_0x435613,_0x4f954c){var _0xefb070={},_0x269c51={},_0xa5c503={'count':0x0,'rows':[]};var _0x5a998e=_[_0x96ab('0x2d')](db[_0x96ab('0x2e')][_0x96ab('0x2f')],function(_0x575664){return{'name':_0x575664[_0x96ab('0x30')],'type':_0x575664['type'][_0x96ab('0x31')]};});_0x269c51[_0x96ab('0x32')]=_['map'](_0x5a998e,_0x96ab('0x2a'));_0x269c51['query']=_['keys'](_0x435613['query']);_0x269c51['filters']=_[_0x96ab('0x33')](_0x269c51['model'],_0x269c51[_0x96ab('0x34')]);_0xefb070[_0x96ab('0x35')]=_[_0x96ab('0x33')](_0x269c51[_0x96ab('0x32')],qs[_0x96ab('0x36')](_0x435613['query']['fields']));_0xefb070[_0x96ab('0x35')]=_0xefb070[_0x96ab('0x35')]['length']?_0xefb070[_0x96ab('0x35')]:_0x269c51[_0x96ab('0x32')];if(!_0x435613['query']['hasOwnProperty'](_0x96ab('0x37'))){_0xefb070[_0x96ab('0x1e')]=qs[_0x96ab('0x1e')](_0x435613[_0x96ab('0x34')]['limit']);_0xefb070[_0x96ab('0x1d')]=qs['offset'](_0x435613['query'][_0x96ab('0x1d')]);}_0xefb070['order']=qs[_0x96ab('0x38')](_0x435613[_0x96ab('0x34')][_0x96ab('0x38')]);_0xefb070[_0x96ab('0x39')]=qs['filters'](_[_0x96ab('0x3a')](_0x435613[_0x96ab('0x34')],_0x269c51[_0x96ab('0x3b')]),_0x5a998e);if(_0x435613[_0x96ab('0x34')][_0x96ab('0x3c')]){_0xefb070['where']=_[_0x96ab('0x3d')](_0xefb070['where'],{'$or':_[_0x96ab('0x2d')](_0x5a998e,function(_0x4dae51){if(_0x4dae51[_0x96ab('0x3e')]!==_0x96ab('0x3f')){var _0x3f2305={};_0x3f2305[_0x4dae51[_0x96ab('0x2a')]]={'$like':'%'+_0x435613['query'][_0x96ab('0x3c')]+'%'};return _0x3f2305;}})});}_0xefb070=_[_0x96ab('0x3d')]({},_0xefb070,_0x435613[_0x96ab('0x40')]);var _0x3c7e5d={'where':_0xefb070[_0x96ab('0x39')]};return db[_0x96ab('0x2e')][_0x96ab('0x20')](_0x3c7e5d)[_0x96ab('0x27')](function(_0x14bcbf){_0xa5c503[_0x96ab('0x20')]=_0x14bcbf;if(_0x435613[_0x96ab('0x34')][_0x96ab('0x41')]){_0xefb070['include']=[{'all':!![]}];}return db['ChatQueueReport'][_0x96ab('0x42')](_0xefb070);})[_0x96ab('0x27')](function(_0xb541d8){_0xa5c503[_0x96ab('0x43')]=_0xb541d8;return _0xa5c503;})[_0x96ab('0x27')](respondWithFilteredResult(_0x4f954c,_0xefb070))[_0x96ab('0x44')](handleError(_0x4f954c,null));};exports[_0x96ab('0x45')]=function(_0x4b73d7,_0x347957){var _0x53f848={'raw':!![],'where':{'id':_0x4b73d7[_0x96ab('0x46')]['id']}},_0x5e8109={};_0x5e8109[_0x96ab('0x32')]=_['keys'](db[_0x96ab('0x2e')][_0x96ab('0x2f')]);_0x5e8109[_0x96ab('0x34')]=_[_0x96ab('0x47')](_0x4b73d7[_0x96ab('0x34')]);_0x5e8109['filters']=_[_0x96ab('0x33')](_0x5e8109['model'],_0x5e8109['query']);_0x53f848[_0x96ab('0x35')]=_['intersection'](_0x5e8109[_0x96ab('0x32')],qs[_0x96ab('0x36')](_0x4b73d7[_0x96ab('0x34')]['fields']));_0x53f848[_0x96ab('0x35')]=_0x53f848[_0x96ab('0x35')][_0x96ab('0x48')]?_0x53f848[_0x96ab('0x35')]:_0x5e8109[_0x96ab('0x32')];if(_0x4b73d7['query'][_0x96ab('0x41')]){_0x53f848['include']=[{'all':!![]}];}_0x53f848=_[_0x96ab('0x3d')]({},_0x53f848,_0x4b73d7['options']);return db[_0x96ab('0x2e')]['find'](_0x53f848)[_0x96ab('0x27')](handleEntityNotFound(_0x347957,null))[_0x96ab('0x27')](respondWithResult(_0x347957,null))[_0x96ab('0x44')](handleError(_0x347957,null));};exports[_0x96ab('0x49')]=function(_0x25d387,_0x42dbd7){return db['ChatQueueReport'][_0x96ab('0x49')](_0x25d387[_0x96ab('0x4a')],{})['then'](respondWithResult(_0x42dbd7,0xc9))[_0x96ab('0x44')](handleError(_0x42dbd7,null));};exports['update']=function(_0x14b467,_0x170992){if(_0x14b467[_0x96ab('0x4a')]['id']){delete _0x14b467['body']['id'];}return db[_0x96ab('0x2e')][_0x96ab('0x4b')]({'where':{'id':_0x14b467['params']['id']}})[_0x96ab('0x27')](handleEntityNotFound(_0x170992,null))[_0x96ab('0x27')](saveUpdates(_0x14b467[_0x96ab('0x4a')],null))[_0x96ab('0x27')](respondWithResult(_0x170992,null))[_0x96ab('0x44')](handleError(_0x170992,null));};exports[_0x96ab('0x26')]=function(_0x13b865,_0x5f2521){return db[_0x96ab('0x2e')][_0x96ab('0x4b')]({'where':{'id':_0x13b865['params']['id']}})[_0x96ab('0x27')](handleEntityNotFound(_0x5f2521,null))[_0x96ab('0x27')](removeEntity(_0x5f2521,null))['catch'](handleError(_0x5f2521,null));};exports[_0x96ab('0x4c')]=function(_0x2454b4,_0x391169){return db[_0x96ab('0x2e')][_0x96ab('0x4c')]()[_0x96ab('0x27')](respondWithResult(_0x391169,null))[_0x96ab('0x44')](handleError(_0x391169,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index d17c355..915a2dd 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 _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x20b75e,_0x45b003){var _0x5cae91=function(_0xa9440e){while(--_0xa9440e){_0x20b75e['push'](_0x20b75e['shift']());}};_0x5cae91(++_0x45b003);}(_0x757a,0xde));var _0xa757=function(_0x36fdc3,_0x1e4aa8){_0x36fdc3=_0x36fdc3-0x0;var _0x1734fd=_0x757a[_0x36fdc3];return _0x1734fd;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x154940,_0x4a448a){var _0x401409=function(_0x45cdcf){while(--_0x45cdcf){_0x154940['push'](_0x154940['shift']());}};_0x401409(++_0x4a448a);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index f9c4c15..863fe7a 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 _0x27c2=['then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','ChatQueueReport','create','options','CreateChatQueueReport','UpdateChatQueueReport','update','body','where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x279dd6,_0x150b12){var _0x503290=function(_0x16e440){while(--_0x16e440){_0x279dd6['push'](_0x279dd6['shift']());}};_0x503290(++_0x150b12);}(_0x27c2,0x71));var _0x227c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x27c2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x227c('0x0'));var util=require(_0x227c('0x1'));var moment=require(_0x227c('0x2'));var BPromise=require(_0x227c('0x3'));var rs=require(_0x227c('0x4'));var fs=require('fs');var Redis=require(_0x227c('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x227c('0x6'))(_0x227c('0x7'));var config=require('../../config/environment');var jayson=require(_0x227c('0x8'));var client=jayson[_0x227c('0x9')][_0x227c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x45ba86,_0x232803,_0x260dd7){return new BPromise(function(_0x591a38,_0x4c6a8f){return client['request'](_0x45ba86,_0x260dd7)[_0x227c('0xb')](function(_0x25d081){logger[_0x227c('0xc')](_0x227c('0xd'),_0x232803,_0x227c('0xe'));logger[_0x227c('0xf')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x232803,_0x227c('0xe'),JSON[_0x227c('0x10')](_0x25d081));if(_0x25d081[_0x227c('0x11')]){if(_0x25d081[_0x227c('0x11')][_0x227c('0x12')]===0x1f4){logger[_0x227c('0x11')](_0x227c('0xd'),_0x232803,_0x25d081[_0x227c('0x11')][_0x227c('0x13')]);return _0x4c6a8f(_0x25d081[_0x227c('0x11')][_0x227c('0x13')]);}logger[_0x227c('0x11')](_0x227c('0xd'),_0x232803,_0x25d081['error']['message']);return _0x591a38(_0x25d081[_0x227c('0x11')][_0x227c('0x13')]);}else{logger[_0x227c('0xc')](_0x227c('0xd'),_0x232803,_0x227c('0xe'));_0x591a38(_0x25d081[_0x227c('0x14')][_0x227c('0x13')]);}})[_0x227c('0x15')](function(_0x52e8bc){logger[_0x227c('0x11')](_0x227c('0xd'),_0x232803,_0x52e8bc);_0x4c6a8f(_0x52e8bc);});});}exports['CreateChatQueueReport']=function(_0x4a9182){var _0x2dd773=this;return new Promise(function(_0x5be9fc,_0x85a96){return db[_0x227c('0x16')][_0x227c('0x17')](_0x4a9182['body'],{'raw':_0x4a9182[_0x227c('0x18')]?_0x4a9182[_0x227c('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x227c('0xb')](function(_0x5ea6f9){logger['info'](_0x227c('0x19'),_0x4a9182);logger[_0x227c('0xf')](_0x227c('0x19'),_0x4a9182,JSON[_0x227c('0x10')](_0x5ea6f9));_0x5be9fc(_0x5ea6f9);})[_0x227c('0x15')](function(_0x168954){logger['error'](_0x227c('0x19'),_0x168954[_0x227c('0x13')],_0x4a9182);_0x85a96(_0x2dd773['error'](0x1f4,_0x168954[_0x227c('0x13')]));});});};exports[_0x227c('0x1a')]=function(_0x53bcbb){var _0x867772=this;return new Promise(function(_0x3b5cf0,_0x43c879){return db[_0x227c('0x16')][_0x227c('0x1b')](_0x53bcbb[_0x227c('0x1c')],{'raw':_0x53bcbb[_0x227c('0x18')]?_0x53bcbb['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53bcbb['options']?_0x53bcbb['options'][_0x227c('0x1d')]||null:null,'attributes':_0x53bcbb['options']?_0x53bcbb[_0x227c('0x18')]['attributes']||null:null,'limit':_0x53bcbb[_0x227c('0x18')]?_0x53bcbb[_0x227c('0x18')][_0x227c('0x1e')]||null:null})[_0x227c('0xb')](function(_0x2f7b23){logger[_0x227c('0xc')](_0x227c('0x1a'),_0x53bcbb);logger[_0x227c('0xf')](_0x227c('0x1a'),_0x53bcbb,JSON['stringify'](_0x2f7b23));_0x3b5cf0(_0x2f7b23);})[_0x227c('0x15')](function(_0x458a6a){logger[_0x227c('0x11')](_0x227c('0x1a'),_0x458a6a[_0x227c('0x13')],_0x53bcbb);_0x43c879(_0x867772['error'](0x1f4,_0x458a6a[_0x227c('0x13')]));});});};
\ No newline at end of file
+var _0x8748=['../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateChatQueueReport','create','body','options','raw','catch','UpdateChatQueueReport','update','where','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x4c7bbd,_0x5617f9){var _0x38e260=function(_0x538771){while(--_0x538771){_0x4c7bbd['push'](_0x4c7bbd['shift']());}};_0x38e260(++_0x5617f9);}(_0x8748,0x9e));var _0x8874=function(_0x471cfd,_0xe74c8c){_0x471cfd=_0x471cfd-0x0;var _0x12cf40=_0x8748[_0x471cfd];return _0x12cf40;};'use strict';var _=require(_0x8874('0x0'));var util=require(_0x8874('0x1'));var moment=require(_0x8874('0x2'));var BPromise=require(_0x8874('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8874('0x4'));var db=require(_0x8874('0x5'))['db'];var utils=require(_0x8874('0x6'));var logger=require(_0x8874('0x7'))(_0x8874('0x8'));var config=require(_0x8874('0x9'));var jayson=require(_0x8874('0xa'));var client=jayson['client'][_0x8874('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b372a,_0x1f57b3,_0x482f29){return new BPromise(function(_0x548467,_0x424872){return client['request'](_0x5b372a,_0x482f29)[_0x8874('0xc')](function(_0x21b54d){logger[_0x8874('0xd')](_0x8874('0xe'),_0x1f57b3,_0x8874('0xf'));logger[_0x8874('0x10')](_0x8874('0x11'),_0x1f57b3,_0x8874('0xf'),JSON[_0x8874('0x12')](_0x21b54d));if(_0x21b54d[_0x8874('0x13')]){if(_0x21b54d[_0x8874('0x13')][_0x8874('0x14')]===0x1f4){logger[_0x8874('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0x1f57b3,_0x21b54d[_0x8874('0x13')][_0x8874('0x15')]);return _0x424872(_0x21b54d['error'][_0x8874('0x15')]);}logger['error'](_0x8874('0xe'),_0x1f57b3,_0x21b54d[_0x8874('0x13')][_0x8874('0x15')]);return _0x548467(_0x21b54d[_0x8874('0x13')]['message']);}else{logger[_0x8874('0xd')]('ChatQueueReport,\x20%s,\x20%s',_0x1f57b3,_0x8874('0xf'));_0x548467(_0x21b54d[_0x8874('0x16')][_0x8874('0x15')]);}})['catch'](function(_0x1b0501){logger['error'](_0x8874('0xe'),_0x1f57b3,_0x1b0501);_0x424872(_0x1b0501);});});}exports[_0x8874('0x17')]=function(_0x1a1725){var _0x1e7138=this;return new Promise(function(_0x2122db,_0x484390){return db['ChatQueueReport'][_0x8874('0x18')](_0x1a1725[_0x8874('0x19')],{'raw':_0x1a1725[_0x8874('0x1a')]?_0x1a1725[_0x8874('0x1a')][_0x8874('0x1b')]===undefined?!![]:![]:!![]})[_0x8874('0xc')](function(_0x5e4552){logger[_0x8874('0xd')](_0x8874('0x17'),_0x1a1725);logger[_0x8874('0x10')]('CreateChatQueueReport',_0x1a1725,JSON[_0x8874('0x12')](_0x5e4552));_0x2122db(_0x5e4552);})[_0x8874('0x1c')](function(_0x18c03b){logger['error'](_0x8874('0x17'),_0x18c03b[_0x8874('0x15')],_0x1a1725);_0x484390(_0x1e7138[_0x8874('0x13')](0x1f4,_0x18c03b[_0x8874('0x15')]));});});};exports[_0x8874('0x1d')]=function(_0x55f589){var _0x38e938=this;return new Promise(function(_0x971726,_0x17665a){return db['ChatQueueReport'][_0x8874('0x1e')](_0x55f589['body'],{'raw':_0x55f589[_0x8874('0x1a')]?_0x55f589[_0x8874('0x1a')][_0x8874('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55f589['options']?_0x55f589[_0x8874('0x1a')][_0x8874('0x1f')]||null:null,'attributes':_0x55f589['options']?_0x55f589[_0x8874('0x1a')]['attributes']||null:null,'limit':_0x55f589[_0x8874('0x1a')]?_0x55f589[_0x8874('0x1a')][_0x8874('0x20')]||null:null})['then'](function(_0x4a80a6){logger[_0x8874('0xd')]('UpdateChatQueueReport',_0x55f589);logger[_0x8874('0x10')](_0x8874('0x1d'),_0x55f589,JSON[_0x8874('0x12')](_0x4a80a6));_0x971726(_0x4a80a6);})[_0x8874('0x1c')](function(_0x289b2d){logger[_0x8874('0x13')](_0x8874('0x1d'),_0x289b2d[_0x8874('0x15')],_0x55f589);_0x17665a(_0x38e938[_0x8874('0x13')](0x1f4,_0x289b2d[_0x8874('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 76fd442..f435140 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 _0xe31c=['index','/describe','describe','show','post','create','put','/:id','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated'];(function(_0x3a5a98,_0x5fa71e){var _0x10f6a4=function(_0x3ca66d){while(--_0x3ca66d){_0x3a5a98['push'](_0x3a5a98['shift']());}};_0x10f6a4(++_0x5fa71e);}(_0xe31c,0x172));var _0xce31=function(_0x4ac651,_0x597909){_0x4ac651=_0x4ac651-0x0;var _0x385d2f=_0xe31c[_0x4ac651];return _0x385d2f;};'use strict';var multer=require(_0xce31('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xce31('0x1'));var express=require(_0xce31('0x2'));var router=express[_0xce31('0x3')]();var fs_extra=require(_0xce31('0x4'));var auth=require(_0xce31('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xce31('0x6'));var controller=require(_0xce31('0x7'));router[_0xce31('0x8')]('/',auth[_0xce31('0x9')](),controller[_0xce31('0xa')]);router[_0xce31('0x8')](_0xce31('0xb'),auth[_0xce31('0x9')](),controller[_0xce31('0xc')]);router['get']('/:id',auth[_0xce31('0x9')](),controller[_0xce31('0xd')]);router[_0xce31('0xe')]('/',auth['isAuthenticated'](),controller[_0xce31('0xf')]);router[_0xce31('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0xce31('0x11'),auth[_0xce31('0x9')](),controller[_0xce31('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x9d47=['put','update','destroy','exports','multer','util','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','index','/describe','isAuthenticated','show','post','create'];(function(_0x3423b0,_0x4eb7e8){var _0x4b13cf=function(_0x900ca7){while(--_0x900ca7){_0x3423b0['push'](_0x3423b0['shift']());}};_0x4b13cf(++_0x4eb7e8);}(_0x9d47,0xca));var _0x79d4=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x9d47[_0x5f09c5];return _0x426ad9;};'use strict';var multer=require(_0x79d4('0x0'));var util=require(_0x79d4('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x79d4('0x2'));var auth=require(_0x79d4('0x3'));var interaction=require(_0x79d4('0x4'));var config=require(_0x79d4('0x5'));var controller=require(_0x79d4('0x6'));router[_0x79d4('0x7')]('/',auth['isAuthenticated'](),controller[_0x79d4('0x8')]);router['get'](_0x79d4('0x9'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0x79d4('0xa')](),controller[_0x79d4('0xb')]);router[_0x79d4('0xc')]('/',auth[_0x79d4('0xa')](),controller[_0x79d4('0xd')]);router[_0x79d4('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x79d4('0xf')]);router['delete']('/:id',auth[_0x79d4('0xa')](),controller[_0x79d4('0x10')]);module[_0x79d4('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index dc20421..cc31e85 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(_0x2430de,_0x40394d){var _0x30d356=function(_0x2cd79d){while(--_0x2cd79d){_0x2430de['push'](_0x2430de['shift']());}};_0x30d356(++_0x40394d);}(_0x34e8,0x12c));var _0x834e=function(_0xcdf282,_0x47bdba){_0xcdf282=_0xcdf282-0x0;var _0x2b7648=_0x34e8[_0xcdf282];return _0x2b7648;};'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 _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x3a3c17,_0x5b7b7e){var _0xd07f21=function(_0xeaad44){while(--_0xeaad44){_0x3a3c17['push'](_0x3a3c17['shift']());}};_0xd07f21(++_0x5b7b7e);}(_0xb43b,0x1b2));var _0xbb43=function(_0x80d246,_0x167b6a){_0x80d246=_0x80d246-0x0;var _0x45ee56=_0xb43b[_0x80d246];return _0x45ee56;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index c1aad9d..67129a1 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 _0xc7f1=['then','destroy','end','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','save','update'];(function(_0x348749,_0x5c3920){var _0x5b3a56=function(_0x34f37d){while(--_0x34f37d){_0x348749['push'](_0x348749['shift']());}};_0x5b3a56(++_0x5c3920);}(_0xc7f1,0x166));var _0x1c7f=function(_0x5a5633,_0x5cd289){_0x5a5633=_0x5a5633-0x0;var _0x49138e=_0xc7f1[_0x5a5633];return _0x49138e;};'use strict';var emlformat=require(_0x1c7f('0x0'));var rimraf=require(_0x1c7f('0x1'));var zipdir=require(_0x1c7f('0x2'));var jsonpatch=require(_0x1c7f('0x3'));var rp=require(_0x1c7f('0x4'));var moment=require(_0x1c7f('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1c7f('0x6'));var path=require(_0x1c7f('0x7'));var sox=require(_0x1c7f('0x8'));var csv=require(_0x1c7f('0x9'));var ejs=require(_0x1c7f('0xa'));var fs=require('fs');var fs_extra=require(_0x1c7f('0xb'));var _=require(_0x1c7f('0xc'));var squel=require('squel');var crypto=require(_0x1c7f('0xd'));var jsforce=require(_0x1c7f('0xe'));var deskjs=require(_0x1c7f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1c7f('0x10'));var Papa=require(_0x1c7f('0x11'));var Redis=require(_0x1c7f('0x12'));var authService=require(_0x1c7f('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x1c7f('0x14'));var hardwareService=require(_0x1c7f('0x15'));var logger=require(_0x1c7f('0x16'))(_0x1c7f('0x17'));var utils=require('../../config/utils');var config=require(_0x1c7f('0x18'));var licenseUtil=require(_0x1c7f('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x376b06,_0x50fe13){_0x50fe13=_0x50fe13||0xcc;return function(_0x2e6c3a){if(_0x2e6c3a){return _0x376b06[_0x1c7f('0x1a')](_0x50fe13);}return _0x376b06[_0x1c7f('0x1b')](_0x50fe13)['end']();};}function respondWithResult(_0x6a3400,_0x5b6f46){_0x5b6f46=_0x5b6f46||0xc8;return function(_0x1ffb07){if(_0x1ffb07){return _0x6a3400[_0x1c7f('0x1b')](_0x5b6f46)[_0x1c7f('0x1c')](_0x1ffb07);}};}function respondWithFilteredResult(_0x380614,_0x3ed59a){return function(_0x2e836a){if(_0x2e836a){var _0x21aa19=typeof _0x3ed59a['offset']==='undefined'&&typeof _0x3ed59a[_0x1c7f('0x1d')]===_0x1c7f('0x1e');var _0x2e3fa0=_0x2e836a[_0x1c7f('0x1f')];var _0xc3de62=_0x21aa19?0x0:_0x3ed59a[_0x1c7f('0x20')];var _0x1733d6=_0x21aa19?_0x2e836a[_0x1c7f('0x1f')]:_0x3ed59a[_0x1c7f('0x20')]+_0x3ed59a[_0x1c7f('0x1d')];var _0x3c6e82;if(_0x1733d6>=_0x2e3fa0){_0x1733d6=_0x2e3fa0;_0x3c6e82=0xc8;}else{_0x3c6e82=0xce;}_0x380614['status'](_0x3c6e82);return _0x380614[_0x1c7f('0x21')](_0x1c7f('0x22'),_0xc3de62+'-'+_0x1733d6+'/'+_0x2e3fa0)[_0x1c7f('0x1c')](_0x2e836a);}return null;};}function patchUpdates(_0x3c2993){return function(_0xcb5170){try{jsonpatch['apply'](_0xcb5170,_0x3c2993,!![]);}catch(_0x11cc5f){return BPromise['reject'](_0x11cc5f);}return _0xcb5170[_0x1c7f('0x23')]();};}function saveUpdates(_0x27ff1c,_0x33a89c){return function(_0x535669){if(_0x535669){return _0x535669[_0x1c7f('0x24')](_0x27ff1c)[_0x1c7f('0x25')](function(_0x3f83e4){return _0x3f83e4;});}return null;};}function removeEntity(_0xb02b2e,_0x2730ac){return function(_0x1e7377){if(_0x1e7377){return _0x1e7377[_0x1c7f('0x26')]()['then'](function(){_0xb02b2e[_0x1c7f('0x1b')](0xcc)[_0x1c7f('0x27')]();});}};}function handleEntityNotFound(_0x461907,_0x348e4a){return function(_0x499290){if(!_0x499290){_0x461907[_0x1c7f('0x1a')](0x194);}return _0x499290;};}function handleError(_0x544bdb,_0x468e25){_0x468e25=_0x468e25||0x1f4;return function(_0x3dda6d){logger[_0x1c7f('0x28')](_0x3dda6d[_0x1c7f('0x29')]);if(_0x3dda6d[_0x1c7f('0x2a')]){delete _0x3dda6d[_0x1c7f('0x2a')];}_0x544bdb[_0x1c7f('0x1b')](_0x468e25)[_0x1c7f('0x2b')](_0x3dda6d);};}exports[_0x1c7f('0x2c')]=function(_0x1cbf77,_0x2bb7c5){var _0x5a13ec={},_0x3cfd21={},_0x2cbe42={'count':0x0,'rows':[]};var _0x362b84=_[_0x1c7f('0x2d')](db[_0x1c7f('0x2e')][_0x1c7f('0x2f')],function(_0x3419a2){return{'name':_0x3419a2[_0x1c7f('0x30')],'type':_0x3419a2[_0x1c7f('0x31')][_0x1c7f('0x32')]};});_0x3cfd21['model']=_[_0x1c7f('0x2d')](_0x362b84,_0x1c7f('0x2a'));_0x3cfd21[_0x1c7f('0x33')]=_[_0x1c7f('0x34')](_0x1cbf77['query']);_0x3cfd21[_0x1c7f('0x35')]=_[_0x1c7f('0x36')](_0x3cfd21[_0x1c7f('0x37')],_0x3cfd21['query']);_0x5a13ec[_0x1c7f('0x38')]=_[_0x1c7f('0x36')](_0x3cfd21[_0x1c7f('0x37')],qs[_0x1c7f('0x39')](_0x1cbf77[_0x1c7f('0x33')][_0x1c7f('0x39')]));_0x5a13ec[_0x1c7f('0x38')]=_0x5a13ec['attributes'][_0x1c7f('0x3a')]?_0x5a13ec[_0x1c7f('0x38')]:_0x3cfd21[_0x1c7f('0x37')];if(!_0x1cbf77['query'][_0x1c7f('0x3b')](_0x1c7f('0x3c'))){_0x5a13ec[_0x1c7f('0x1d')]=qs[_0x1c7f('0x1d')](_0x1cbf77['query'][_0x1c7f('0x1d')]);_0x5a13ec[_0x1c7f('0x20')]=qs['offset'](_0x1cbf77[_0x1c7f('0x33')]['offset']);}_0x5a13ec[_0x1c7f('0x3d')]=qs[_0x1c7f('0x3e')](_0x1cbf77[_0x1c7f('0x33')]['sort']);_0x5a13ec[_0x1c7f('0x3f')]=qs[_0x1c7f('0x35')](_[_0x1c7f('0x40')](_0x1cbf77[_0x1c7f('0x33')],_0x3cfd21[_0x1c7f('0x35')]),_0x362b84);if(_0x1cbf77[_0x1c7f('0x33')][_0x1c7f('0x41')]){_0x5a13ec[_0x1c7f('0x3f')]=_['merge'](_0x5a13ec[_0x1c7f('0x3f')],{'$or':_[_0x1c7f('0x2d')](_0x362b84,function(_0x336155){if(_0x336155[_0x1c7f('0x31')]!=='VIRTUAL'){var _0x4db0b5={};_0x4db0b5[_0x336155[_0x1c7f('0x2a')]]={'$like':'%'+_0x1cbf77['query']['filter']+'%'};return _0x4db0b5;}})});}_0x5a13ec=_[_0x1c7f('0x42')]({},_0x5a13ec,_0x1cbf77[_0x1c7f('0x43')]);var _0x3b4316={'where':_0x5a13ec[_0x1c7f('0x3f')]};return db[_0x1c7f('0x2e')][_0x1c7f('0x1f')](_0x3b4316)[_0x1c7f('0x25')](function(_0x535c58){_0x2cbe42[_0x1c7f('0x1f')]=_0x535c58;if(_0x1cbf77[_0x1c7f('0x33')][_0x1c7f('0x44')]){_0x5a13ec['include']=[{'all':!![]}];}return db[_0x1c7f('0x2e')][_0x1c7f('0x45')](_0x5a13ec);})[_0x1c7f('0x25')](function(_0x1e6e8c){_0x2cbe42[_0x1c7f('0x46')]=_0x1e6e8c;return _0x2cbe42;})[_0x1c7f('0x25')](respondWithFilteredResult(_0x2bb7c5,_0x5a13ec))[_0x1c7f('0x47')](handleError(_0x2bb7c5,null));};exports[_0x1c7f('0x48')]=function(_0x68c375,_0x3c6f50){var _0x19c312={'raw':!![],'where':{'id':_0x68c375[_0x1c7f('0x49')]['id']}},_0x535eeb={};_0x535eeb[_0x1c7f('0x37')]=_[_0x1c7f('0x34')](db[_0x1c7f('0x2e')][_0x1c7f('0x2f')]);_0x535eeb[_0x1c7f('0x33')]=_['keys'](_0x68c375[_0x1c7f('0x33')]);_0x535eeb[_0x1c7f('0x35')]=_[_0x1c7f('0x36')](_0x535eeb[_0x1c7f('0x37')],_0x535eeb[_0x1c7f('0x33')]);_0x19c312['attributes']=_[_0x1c7f('0x36')](_0x535eeb[_0x1c7f('0x37')],qs[_0x1c7f('0x39')](_0x68c375['query'][_0x1c7f('0x39')]));_0x19c312['attributes']=_0x19c312[_0x1c7f('0x38')][_0x1c7f('0x3a')]?_0x19c312[_0x1c7f('0x38')]:_0x535eeb[_0x1c7f('0x37')];if(_0x68c375[_0x1c7f('0x33')][_0x1c7f('0x44')]){_0x19c312[_0x1c7f('0x4a')]=[{'all':!![]}];}_0x19c312=_['merge']({},_0x19c312,_0x68c375[_0x1c7f('0x43')]);return db[_0x1c7f('0x2e')][_0x1c7f('0x4b')](_0x19c312)[_0x1c7f('0x25')](handleEntityNotFound(_0x3c6f50,null))[_0x1c7f('0x25')](respondWithResult(_0x3c6f50,null))[_0x1c7f('0x47')](handleError(_0x3c6f50,null));};exports[_0x1c7f('0x4c')]=function(_0x2fea85,_0x2434df){return db[_0x1c7f('0x2e')][_0x1c7f('0x4c')](_0x2fea85[_0x1c7f('0x4d')],{})[_0x1c7f('0x25')](respondWithResult(_0x2434df,0xc9))[_0x1c7f('0x47')](handleError(_0x2434df,null));};exports['update']=function(_0x4f473c,_0x3ea72b){if(_0x4f473c[_0x1c7f('0x4d')]['id']){delete _0x4f473c[_0x1c7f('0x4d')]['id'];}return db[_0x1c7f('0x2e')][_0x1c7f('0x4b')]({'where':{'id':_0x4f473c['params']['id']}})['then'](handleEntityNotFound(_0x3ea72b,null))[_0x1c7f('0x25')](saveUpdates(_0x4f473c['body'],null))[_0x1c7f('0x25')](respondWithResult(_0x3ea72b,null))[_0x1c7f('0x47')](handleError(_0x3ea72b,null));};exports[_0x1c7f('0x26')]=function(_0x1d0d8f,_0x1552f1){return db[_0x1c7f('0x2e')]['find']({'where':{'id':_0x1d0d8f[_0x1c7f('0x49')]['id']}})['then'](handleEntityNotFound(_0x1552f1,null))[_0x1c7f('0x25')](removeEntity(_0x1552f1,null))[_0x1c7f('0x47')](handleError(_0x1552f1,null));};exports[_0x1c7f('0x4e')]=function(_0x1643ed,_0x52700f){return db[_0x1c7f('0x2e')][_0x1c7f('0x4e')]()[_0x1c7f('0x25')](respondWithResult(_0x52700f,null))[_0x1c7f('0x47')](handleError(_0x52700f,null));};
\ No newline at end of file
+var _0xeb5d=['merge','find','create','body','catch','describe','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','destroy','then','stack','name','send','map','ChatTransferReport','fieldName','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','includeAll','findAll','rows','show','params','keys','rawAttributes','include'];(function(_0x44d8d1,_0x2a600e){var _0x5babcf=function(_0x5ae877){while(--_0x5ae877){_0x44d8d1['push'](_0x44d8d1['shift']());}};_0x5babcf(++_0x2a600e);}(_0xeb5d,0x126));var _0xdeb5=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xeb5d[_0x178e48];return _0x440d7e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdeb5('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdeb5('0x1'));var rp=require(_0xdeb5('0x2'));var moment=require(_0xdeb5('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xdeb5('0x4'));var util=require(_0xdeb5('0x5'));var path=require(_0xdeb5('0x6'));var sox=require(_0xdeb5('0x7'));var csv=require(_0xdeb5('0x8'));var ejs=require(_0xdeb5('0x9'));var fs=require('fs');var fs_extra=require(_0xdeb5('0xa'));var _=require(_0xdeb5('0xb'));var squel=require(_0xdeb5('0xc'));var crypto=require('crypto');var jsforce=require(_0xdeb5('0xd'));var deskjs=require(_0xdeb5('0xe'));var toCsv=require(_0xdeb5('0x8'));var querystring=require(_0xdeb5('0xf'));var Papa=require(_0xdeb5('0x10'));var Redis=require(_0xdeb5('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xdeb5('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdeb5('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xdeb5('0x14'));var db=require(_0xdeb5('0x15'))['db'];function respondWithStatusCode(_0x5d918f,_0x52af87){_0x52af87=_0x52af87||0xcc;return function(_0x5999b0){if(_0x5999b0){return _0x5d918f[_0xdeb5('0x16')](_0x52af87);}return _0x5d918f[_0xdeb5('0x17')](_0x52af87)[_0xdeb5('0x18')]();};}function respondWithResult(_0x1cd6d0,_0x177a38){_0x177a38=_0x177a38||0xc8;return function(_0x1a653d){if(_0x1a653d){return _0x1cd6d0[_0xdeb5('0x17')](_0x177a38)['json'](_0x1a653d);}};}function respondWithFilteredResult(_0x10a162,_0x5bc7b8){return function(_0x48f79c){if(_0x48f79c){var _0x27ceb4=typeof _0x5bc7b8[_0xdeb5('0x19')]===_0xdeb5('0x1a')&&typeof _0x5bc7b8[_0xdeb5('0x1b')]===_0xdeb5('0x1a');var _0x451bc0=_0x48f79c[_0xdeb5('0x1c')];var _0x4cb8d6=_0x27ceb4?0x0:_0x5bc7b8[_0xdeb5('0x19')];var _0x2256a8=_0x27ceb4?_0x48f79c[_0xdeb5('0x1c')]:_0x5bc7b8[_0xdeb5('0x19')]+_0x5bc7b8[_0xdeb5('0x1b')];var _0x2f3cba;if(_0x2256a8>=_0x451bc0){_0x2256a8=_0x451bc0;_0x2f3cba=0xc8;}else{_0x2f3cba=0xce;}_0x10a162[_0xdeb5('0x17')](_0x2f3cba);return _0x10a162[_0xdeb5('0x1d')](_0xdeb5('0x1e'),_0x4cb8d6+'-'+_0x2256a8+'/'+_0x451bc0)['json'](_0x48f79c);}return null;};}function patchUpdates(_0x396e62){return function(_0xc83d89){try{jsonpatch['apply'](_0xc83d89,_0x396e62,!![]);}catch(_0x3ae0d5){return BPromise[_0xdeb5('0x1f')](_0x3ae0d5);}return _0xc83d89[_0xdeb5('0x20')]();};}function saveUpdates(_0x367d18,_0x43f779){return function(_0x5ece08){if(_0x5ece08){return _0x5ece08['update'](_0x367d18)['then'](function(_0x2aeb30){return _0x2aeb30;});}return null;};}function removeEntity(_0x581e5b,_0x552295){return function(_0xd0405e){if(_0xd0405e){return _0xd0405e[_0xdeb5('0x21')]()[_0xdeb5('0x22')](function(){_0x581e5b['status'](0xcc)[_0xdeb5('0x18')]();});}};}function handleEntityNotFound(_0x38e285,_0x40aaf5){return function(_0x449638){if(!_0x449638){_0x38e285[_0xdeb5('0x16')](0x194);}return _0x449638;};}function handleError(_0xec0fc0,_0x4a0cda){_0x4a0cda=_0x4a0cda||0x1f4;return function(_0xe51ce4){logger['error'](_0xe51ce4[_0xdeb5('0x23')]);if(_0xe51ce4['name']){delete _0xe51ce4[_0xdeb5('0x24')];}_0xec0fc0[_0xdeb5('0x17')](_0x4a0cda)[_0xdeb5('0x25')](_0xe51ce4);};}exports['index']=function(_0x223d5d,_0x334711){var _0x3000f8={},_0x1ad5be={},_0xc09c1e={'count':0x0,'rows':[]};var _0x3474ba=_[_0xdeb5('0x26')](db[_0xdeb5('0x27')]['rawAttributes'],function(_0x307970){return{'name':_0x307970[_0xdeb5('0x28')],'type':_0x307970['type'][_0xdeb5('0x29')]};});_0x1ad5be['model']=_['map'](_0x3474ba,'name');_0x1ad5be[_0xdeb5('0x2a')]=_['keys'](_0x223d5d['query']);_0x1ad5be[_0xdeb5('0x2b')]=_[_0xdeb5('0x2c')](_0x1ad5be[_0xdeb5('0x2d')],_0x1ad5be['query']);_0x3000f8[_0xdeb5('0x2e')]=_[_0xdeb5('0x2c')](_0x1ad5be[_0xdeb5('0x2d')],qs[_0xdeb5('0x2f')](_0x223d5d[_0xdeb5('0x2a')][_0xdeb5('0x2f')]));_0x3000f8['attributes']=_0x3000f8[_0xdeb5('0x2e')][_0xdeb5('0x30')]?_0x3000f8[_0xdeb5('0x2e')]:_0x1ad5be[_0xdeb5('0x2d')];if(!_0x223d5d[_0xdeb5('0x2a')]['hasOwnProperty'](_0xdeb5('0x31'))){_0x3000f8[_0xdeb5('0x1b')]=qs[_0xdeb5('0x1b')](_0x223d5d[_0xdeb5('0x2a')][_0xdeb5('0x1b')]);_0x3000f8[_0xdeb5('0x19')]=qs[_0xdeb5('0x19')](_0x223d5d[_0xdeb5('0x2a')][_0xdeb5('0x19')]);}_0x3000f8[_0xdeb5('0x32')]=qs[_0xdeb5('0x33')](_0x223d5d[_0xdeb5('0x2a')]['sort']);_0x3000f8[_0xdeb5('0x34')]=qs[_0xdeb5('0x2b')](_[_0xdeb5('0x35')](_0x223d5d[_0xdeb5('0x2a')],_0x1ad5be[_0xdeb5('0x2b')]),_0x3474ba);if(_0x223d5d[_0xdeb5('0x2a')][_0xdeb5('0x36')]){_0x3000f8[_0xdeb5('0x34')]=_['merge'](_0x3000f8['where'],{'$or':_['map'](_0x3474ba,function(_0x2ce4ef){if(_0x2ce4ef[_0xdeb5('0x37')]!==_0xdeb5('0x38')){var _0x212d5d={};_0x212d5d[_0x2ce4ef['name']]={'$like':'%'+_0x223d5d['query'][_0xdeb5('0x36')]+'%'};return _0x212d5d;}})});}_0x3000f8=_['merge']({},_0x3000f8,_0x223d5d[_0xdeb5('0x39')]);var _0x16a4d2={'where':_0x3000f8[_0xdeb5('0x34')]};return db[_0xdeb5('0x27')][_0xdeb5('0x1c')](_0x16a4d2)[_0xdeb5('0x22')](function(_0xbb9e1a){_0xc09c1e[_0xdeb5('0x1c')]=_0xbb9e1a;if(_0x223d5d[_0xdeb5('0x2a')][_0xdeb5('0x3a')]){_0x3000f8['include']=[{'all':!![]}];}return db['ChatTransferReport'][_0xdeb5('0x3b')](_0x3000f8);})[_0xdeb5('0x22')](function(_0x19ac48){_0xc09c1e[_0xdeb5('0x3c')]=_0x19ac48;return _0xc09c1e;})['then'](respondWithFilteredResult(_0x334711,_0x3000f8))['catch'](handleError(_0x334711,null));};exports[_0xdeb5('0x3d')]=function(_0x11635d,_0x42aae6){var _0x3fc6e8={'raw':!![],'where':{'id':_0x11635d[_0xdeb5('0x3e')]['id']}},_0x73ab8a={};_0x73ab8a['model']=_[_0xdeb5('0x3f')](db[_0xdeb5('0x27')][_0xdeb5('0x40')]);_0x73ab8a['query']=_[_0xdeb5('0x3f')](_0x11635d[_0xdeb5('0x2a')]);_0x73ab8a['filters']=_['intersection'](_0x73ab8a[_0xdeb5('0x2d')],_0x73ab8a['query']);_0x3fc6e8[_0xdeb5('0x2e')]=_[_0xdeb5('0x2c')](_0x73ab8a[_0xdeb5('0x2d')],qs[_0xdeb5('0x2f')](_0x11635d['query'][_0xdeb5('0x2f')]));_0x3fc6e8[_0xdeb5('0x2e')]=_0x3fc6e8[_0xdeb5('0x2e')][_0xdeb5('0x30')]?_0x3fc6e8[_0xdeb5('0x2e')]:_0x73ab8a['model'];if(_0x11635d[_0xdeb5('0x2a')][_0xdeb5('0x3a')]){_0x3fc6e8[_0xdeb5('0x41')]=[{'all':!![]}];}_0x3fc6e8=_[_0xdeb5('0x42')]({},_0x3fc6e8,_0x11635d[_0xdeb5('0x39')]);return db[_0xdeb5('0x27')][_0xdeb5('0x43')](_0x3fc6e8)[_0xdeb5('0x22')](handleEntityNotFound(_0x42aae6,null))[_0xdeb5('0x22')](respondWithResult(_0x42aae6,null))['catch'](handleError(_0x42aae6,null));};exports['create']=function(_0x159b4f,_0x486ef1){return db['ChatTransferReport'][_0xdeb5('0x44')](_0x159b4f[_0xdeb5('0x45')],{})[_0xdeb5('0x22')](respondWithResult(_0x486ef1,0xc9))['catch'](handleError(_0x486ef1,null));};exports['update']=function(_0x792656,_0x33cb4f){if(_0x792656['body']['id']){delete _0x792656[_0xdeb5('0x45')]['id'];}return db['ChatTransferReport'][_0xdeb5('0x43')]({'where':{'id':_0x792656[_0xdeb5('0x3e')]['id']}})[_0xdeb5('0x22')](handleEntityNotFound(_0x33cb4f,null))['then'](saveUpdates(_0x792656[_0xdeb5('0x45')],null))[_0xdeb5('0x22')](respondWithResult(_0x33cb4f,null))[_0xdeb5('0x46')](handleError(_0x33cb4f,null));};exports[_0xdeb5('0x21')]=function(_0x5bbfcd,_0x5d0ea5){return db[_0xdeb5('0x27')][_0xdeb5('0x43')]({'where':{'id':_0x5bbfcd[_0xdeb5('0x3e')]['id']}})[_0xdeb5('0x22')](handleEntityNotFound(_0x5d0ea5,null))[_0xdeb5('0x22')](removeEntity(_0x5d0ea5,null))[_0xdeb5('0x46')](handleError(_0x5d0ea5,null));};exports[_0xdeb5('0x47')]=function(_0x20dc06,_0x369cd7){return db['ChatTransferReport'][_0xdeb5('0x47')]()[_0xdeb5('0x22')](respondWithResult(_0x369cd7,null))['catch'](handleError(_0x369cd7,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 731011b..10ae37a 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 _0xcd47=['report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define'];(function(_0xe1b5f6,_0x210c09){var _0x44636e=function(_0x3a3212){while(--_0x3a3212){_0xe1b5f6['push'](_0xe1b5f6['shift']());}};_0x44636e(++_0x210c09);}(_0xcd47,0x1de));var _0x7cd4=function(_0x333b9a,_0x14ce97){_0x333b9a=_0x333b9a-0x0;var _0x18670e=_0xcd47[_0x333b9a];return _0x18670e;};'use strict';var _=require(_0x7cd4('0x0'));var util=require(_0x7cd4('0x1'));var logger=require(_0x7cd4('0x2'))(_0x7cd4('0x3'));var moment=require(_0x7cd4('0x4'));var BPromise=require('bluebird');var rp=require(_0x7cd4('0x5'));var fs=require('fs');var path=require(_0x7cd4('0x6'));var rimraf=require(_0x7cd4('0x7'));var config=require(_0x7cd4('0x8'));var attributes=require(_0x7cd4('0x9'));module[_0x7cd4('0xa')]=function(_0x490c20,_0x2b9b83){return _0x490c20[_0x7cd4('0xb')]('ChatTransferReport',attributes,{'tableName':_0x7cd4('0xc'),'paranoid':![],'indexes':[{'name':_0x7cd4('0xd'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x82c3=['request-promise','path','rimraf','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x170685,_0x51edfa){var _0x5a41d8=function(_0xb1ab45){while(--_0xb1ab45){_0x170685['push'](_0x170685['shift']());}};_0x5a41d8(++_0x51edfa);}(_0x82c3,0x1ba));var _0x382c=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x82c3[_0x2763f2];return _0x3ef471;};'use strict';var _=require(_0x382c('0x0'));var util=require(_0x382c('0x1'));var logger=require(_0x382c('0x2'))(_0x382c('0x3'));var moment=require(_0x382c('0x4'));var BPromise=require(_0x382c('0x5'));var rp=require(_0x382c('0x6'));var fs=require('fs');var path=require(_0x382c('0x7'));var rimraf=require(_0x382c('0x8'));var config=require('../../config/environment');var attributes=require(_0x382c('0x9'));module[_0x382c('0xa')]=function(_0x3ac2ab,_0xc14b66){return _0x3ac2ab['define'](_0x382c('0xb'),attributes,{'tableName':_0x382c('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x382c('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index f5c5488..b285360 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 _0x4663=['stringify','error','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0x4663,0x159));var _0x3466=function(_0xf4acb,_0x38403b){_0xf4acb=_0xf4acb-0x0;var _0x1ae455=_0x4663[_0xf4acb];return _0x1ae455;};'use strict';var _=require(_0x3466('0x0'));var util=require(_0x3466('0x1'));var moment=require('moment');var BPromise=require(_0x3466('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3466('0x3'));var db=require(_0x3466('0x4'))['db'];var utils=require(_0x3466('0x5'));var logger=require(_0x3466('0x6'))(_0x3466('0x7'));var config=require(_0x3466('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3466('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x353c37,_0x4428d4,_0x248e33){return new BPromise(function(_0x4d7b22,_0x3143bc){return client['request'](_0x353c37,_0x248e33)[_0x3466('0xa')](function(_0x2ed402){logger[_0x3466('0xb')](_0x3466('0xc'),_0x4428d4,_0x3466('0xd'));logger['debug'](_0x3466('0xe'),_0x4428d4,'request\x20sent',JSON[_0x3466('0xf')](_0x2ed402));if(_0x2ed402[_0x3466('0x10')]){if(_0x2ed402[_0x3466('0x10')]['code']===0x1f4){logger[_0x3466('0x10')](_0x3466('0xc'),_0x4428d4,_0x2ed402[_0x3466('0x10')][_0x3466('0x11')]);return _0x3143bc(_0x2ed402['error'][_0x3466('0x11')]);}logger[_0x3466('0x10')](_0x3466('0xc'),_0x4428d4,_0x2ed402['error']['message']);return _0x4d7b22(_0x2ed402[_0x3466('0x10')][_0x3466('0x11')]);}else{logger[_0x3466('0xb')](_0x3466('0xc'),_0x4428d4,'request\x20sent');_0x4d7b22(_0x2ed402[_0x3466('0x12')][_0x3466('0x11')]);}})[_0x3466('0x13')](function(_0xb8ac77){logger['error'](_0x3466('0xc'),_0x4428d4,_0xb8ac77);_0x3143bc(_0xb8ac77);});});}
\ No newline at end of file
+var _0x382c=['message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x14545a,_0x1ed81d){var _0x17cd82=function(_0x318cf7){while(--_0x318cf7){_0x14545a['push'](_0x14545a['shift']());}};_0x17cd82(++_0x1ed81d);}(_0x382c,0x12a));var _0xc382=function(_0x320cf5,_0x4e437d){_0x320cf5=_0x320cf5-0x0;var _0xa77006=_0x382c[_0x320cf5];return _0xa77006;};'use strict';var _=require(_0xc382('0x0'));var util=require(_0xc382('0x1'));var moment=require(_0xc382('0x2'));var BPromise=require(_0xc382('0x3'));var rs=require(_0xc382('0x4'));var fs=require('fs');var Redis=require(_0xc382('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc382('0x6'));var logger=require(_0xc382('0x7'))(_0xc382('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc382('0x9')][_0xc382('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27ad7a,_0x5a40dd,_0x481d88){return new BPromise(function(_0x2d3a86,_0x3fc1bc){return client[_0xc382('0xb')](_0x27ad7a,_0x481d88)[_0xc382('0xc')](function(_0x4ec866){logger['info'](_0xc382('0xd'),_0x5a40dd,_0xc382('0xe'));logger['debug'](_0xc382('0xf'),_0x5a40dd,_0xc382('0xe'),JSON['stringify'](_0x4ec866));if(_0x4ec866[_0xc382('0x10')]){if(_0x4ec866['error']['code']===0x1f4){logger[_0xc382('0x10')](_0xc382('0xd'),_0x5a40dd,_0x4ec866[_0xc382('0x10')][_0xc382('0x11')]);return _0x3fc1bc(_0x4ec866[_0xc382('0x10')][_0xc382('0x11')]);}logger['error'](_0xc382('0xd'),_0x5a40dd,_0x4ec866[_0xc382('0x10')][_0xc382('0x11')]);return _0x2d3a86(_0x4ec866[_0xc382('0x10')]['message']);}else{logger[_0xc382('0x12')](_0xc382('0xd'),_0x5a40dd,'request\x20sent');_0x2d3a86(_0x4ec866[_0xc382('0x13')][_0xc382('0x11')]);}})[_0xc382('0x14')](function(_0x6a6e4b){logger[_0xc382('0x10')](_0xc382('0xd'),_0x5a40dd,_0x6a6e4b);_0x3fc1bc(_0x6a6e4b);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 95b9c8a..867898a 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 _0xf4e7=['get','isAuthenticated','index','/describe','show','post','put','/:id','update','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller'];(function(_0x16f124,_0x49a016){var _0x38cb04=function(_0x126397){while(--_0x126397){_0x16f124['push'](_0x16f124['shift']());}};_0x38cb04(++_0x49a016);}(_0xf4e7,0x149));var _0x7f4e=function(_0x2318da,_0x4b0f98){_0x2318da=_0x2318da-0x0;var _0x14c397=_0xf4e7[_0x2318da];return _0x14c397;};'use strict';var multer=require(_0x7f4e('0x0'));var util=require(_0x7f4e('0x1'));var path=require(_0x7f4e('0x2'));var timeout=require(_0x7f4e('0x3'));var express=require(_0x7f4e('0x4'));var router=express[_0x7f4e('0x5')]();var fs_extra=require(_0x7f4e('0x6'));var auth=require(_0x7f4e('0x7'));var interaction=require(_0x7f4e('0x8'));var config=require(_0x7f4e('0x9'));var controller=require(_0x7f4e('0xa'));router[_0x7f4e('0xb')]('/',auth[_0x7f4e('0xc')](),controller[_0x7f4e('0xd')]);router[_0x7f4e('0xb')](_0x7f4e('0xe'),auth[_0x7f4e('0xc')](),controller['describe']);router[_0x7f4e('0xb')]('/:id',auth[_0x7f4e('0xc')](),controller[_0x7f4e('0xf')]);router[_0x7f4e('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7f4e('0x11')](_0x7f4e('0x12'),auth['isAuthenticated'](),controller[_0x7f4e('0x13')]);router['delete'](_0x7f4e('0x12'),auth[_0x7f4e('0xc')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x2ce0=['describe','get','/:id','post','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','index','/describe','isAuthenticated'];(function(_0x5eb9d2,_0x2761a2){var _0xd3174b=function(_0x26fff7){while(--_0x26fff7){_0x5eb9d2['push'](_0x5eb9d2['shift']());}};_0xd3174b(++_0x2761a2);}(_0x2ce0,0x71));var _0x02ce=function(_0x5a9aed,_0x7ff498){_0x5a9aed=_0x5a9aed-0x0;var _0x58fc5d=_0x2ce0[_0x5a9aed];return _0x58fc5d;};'use strict';var multer=require(_0x02ce('0x0'));var util=require(_0x02ce('0x1'));var path=require(_0x02ce('0x2'));var timeout=require(_0x02ce('0x3'));var express=require(_0x02ce('0x4'));var router=express[_0x02ce('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x02ce('0x6'));var interaction=require(_0x02ce('0x7'));var config=require(_0x02ce('0x8'));var controller=require(_0x02ce('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x02ce('0xa')]);router['get'](_0x02ce('0xb'),auth[_0x02ce('0xc')](),controller[_0x02ce('0xd')]);router[_0x02ce('0xe')](_0x02ce('0xf'),auth[_0x02ce('0xc')](),controller['show']);router[_0x02ce('0x10')]('/',auth[_0x02ce('0xc')](),controller['create']);router[_0x02ce('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x02ce('0x12')](_0x02ce('0xf'),auth[_0x02ce('0xc')](),controller[_0x02ce('0x13')]);module[_0x02ce('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 77fe7ba..8dadf85 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 _0x6f7a=['Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','BOOLEAN','ENUM','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Feedback','star','thumb','stringify','input','onlineForm','setDataValue','Comments','Leave\x20your\x20comments','getDataValue','offlineForm','parse','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x28931a,_0x461726){_0x28931a=_0x28931a-0x0;var _0x234c8e=_0x6f7a[_0x28931a];return _0x234c8e;};'use strict';var Sequelize=require(_0xa6f7('0x0'));var rs=require(_0xa6f7('0x1'));module[_0xa6f7('0x2')]={'name':{'type':Sequelize[_0xa6f7('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xa6f7('0x4')},'description':{'type':Sequelize[_0xa6f7('0x3')]},'mapKey':{'type':Sequelize[_0xa6f7('0x3')],'defaultValue':_0xa6f7('0x5')},'mapKeyOffline':{'type':Sequelize[_0xa6f7('0x3')],'defaultValue':_0xa6f7('0x5')},'key':{'type':Sequelize[_0xa6f7('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xa6f7('0x3')],'defaultValue':_0xa6f7('0x6')},'customerAlias':{'type':Sequelize[_0xa6f7('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xa6f7('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa6f7('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xa6f7('0x3')],'allowNull':![],'defaultValue':_0xa6f7('0x8'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xa6f7('0x3')],'allowNull':![],'defaultValue':_0xa6f7('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xa6f7('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xa6f7('0xa')]('rounded',_0xa6f7('0xb')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0xa6f7('0x3')],'defaultValue':_0xa6f7('0xc')},'start_chat_button':{'type':Sequelize[_0xa6f7('0x3')],'defaultValue':_0xa6f7('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xa6f7('0xe')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xa6f7('0xf')},'download_transcript':{'type':Sequelize[_0xa6f7('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xa6f7('0x10')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0xa6f7('0x11')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xa6f7('0x12')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0xa6f7('0x13')},'formSubmitSuccessMessage':{'type':Sequelize[_0xa6f7('0x3')],'defaultValue':_0xa6f7('0x14')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0xa6f7('0x15')},'noteTitle':{'type':Sequelize[_0xa6f7('0x3')],'defaultValue':_0xa6f7('0x16')},'placeholderMessage':{'type':Sequelize[_0xa6f7('0x3')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xa6f7('0x17')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xa6f7('0xe')},'skipMessageButton':{'type':Sequelize[_0xa6f7('0x3')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0xa6f7('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xa6f7('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xa6f7('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xa6f7('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xa6f7('0x3')],'defaultValue':_0xa6f7('0x18')},'ratingType':{'type':Sequelize['ENUM'](_0xa6f7('0x19'),_0xa6f7('0x1a')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xa6f7('0x1b')]({'items':[{'type':_0xa6f7('0x1c'),'variable':null,'config':{'placeholder':'name','type':'text','required':!![]},'props':{'title':'name','helpText':''}},{'type':_0xa6f7('0x1c'),'props':{'title':_0xa6f7('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xa6f7('0x5'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0xa6f7('0x1d'))?JSON['parse'](this['getDataValue'](_0xa6f7('0x1d'))):{};},'set':function(_0x5efdce){return this[_0xa6f7('0x1e')](_0xa6f7('0x1d'),JSON[_0xa6f7('0x1b')](_0x5efdce));}},'offlineForm':{'type':Sequelize[_0xa6f7('0x12')],'defaultValue':function(){return JSON[_0xa6f7('0x1b')]({'items':[{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xa6f7('0x5'),'type':_0xa6f7('0x5')},'variable':null},{'type':'textarea','config':{'placeholder':_0xa6f7('0x1f')},'props':{'title':_0xa6f7('0x1f'),'helpText':_0xa6f7('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0xa6f7('0x21')](_0xa6f7('0x22'))?JSON[_0xa6f7('0x23')](this[_0xa6f7('0x21')](_0xa6f7('0x22'))):{};},'set':function(_0x57282e){return this[_0xa6f7('0x1e')](_0xa6f7('0x22'),JSON[_0xa6f7('0x1b')](_0x57282e));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xa6f7('0x24')]();}},'autoclose':{'type':Sequelize[_0xa6f7('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xa6f7('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xa6f7('0x3')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0xa6f7('0x3')],'defaultValue':_0xa6f7('0x25')},'waitingMessage':{'type':Sequelize[_0xa6f7('0x3')],'defaultValue':_0xa6f7('0x26')},'offlineMessageSubject':{'type':Sequelize[_0xa6f7('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xa6f7('0x27')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xa6f7('0x3')],'defaultValue':_0xa6f7('0x28')},'skipUnmanaged':{'type':Sequelize[_0xa6f7('0x3')],'defaultValue':_0xa6f7('0x29')},'sendUnmanaged':{'type':Sequelize[_0xa6f7('0x3')],'defaultValue':_0xa6f7('0xe')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xa6f7('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xa6f7('0x12')]},'showAgentAvatar':{'type':Sequelize[_0xa6f7('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xa6f7('0x12')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xa6f7('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa6f7('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xa6f7('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0xa6f7('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize[_0xa6f7('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xa6f7('0x3')],'defaultValue':_0xa6f7('0x2b')},'verticalAlignment':{'type':Sequelize[_0xa6f7('0x10')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xa6f7('0x3')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0xa6f7('0x3')],'defaultValue':_0xa6f7('0x2c')},'defaultTitle':{'type':Sequelize[_0xa6f7('0x3')]},'customerAvatar':{'type':Sequelize[_0xa6f7('0x12')]},'showCustomerAvatar':{'type':Sequelize[_0xa6f7('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xa6f7('0x10')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xa6f7('0x3')],'allowNull':![],'defaultValue':_0xa6f7('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa6f7('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa6f7('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa6f7('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xa6f7('0x2e')},'systemAvatar':{'type':Sequelize[_0xa6f7('0x12')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xa6f7('0x2f')},'mandatoryDisposition':{'type':Sequelize[_0xa6f7('0x9')],'defaultValue':![],'comment':_0xa6f7('0x30'),'set':function(_0x14d532){if(!_0x14d532)this[_0xa6f7('0x1e')]('mandatoryDispositionPauseId',null);this[_0xa6f7('0x1e')](_0xa6f7('0x31'),_0x14d532);}},'vidaooEscalation':{'type':Sequelize[_0xa6f7('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xa6f7('0x3')]},'vidaooTopic':{'type':Sequelize[_0xa6f7('0x3')],'allowNull':![],'defaultValue':_0xa6f7('0x32')},'vidaooNote':{'type':Sequelize[_0xa6f7('0x3')],'defaultValue':function(){return _0xa6f7('0x33');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xa6f7('0x12')]}};
\ No newline at end of file
+var _0x0bb5=['mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','address','email','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Feedback','star','input','text','name','onlineForm','parse','getDataValue','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','stringify','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','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x3efe87,_0x35ad48){var _0x56a4cc=function(_0x47869e){while(--_0x47869e){_0x3efe87['push'](_0x3efe87['shift']());}};_0x56a4cc(++_0x35ad48);}(_0x0bb5,0x148));var _0x50bb=function(_0x424e05,_0x6c6e6a){_0x424e05=_0x424e05-0x0;var _0x2a3c50=_0x0bb5[_0x424e05];return _0x2a3c50;};'use strict';var Sequelize=require(_0x50bb('0x0'));var rs=require(_0x50bb('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x50bb('0x2')],'allowNull':![],'unique':_0x50bb('0x3')},'description':{'type':Sequelize[_0x50bb('0x2')]},'mapKey':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x4')},'mapKeyOffline':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x4')},'key':{'type':Sequelize[_0x50bb('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x50bb('0x2')],'allowNull':![],'defaultValue':_0x50bb('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x50bb('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x50bb('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x50bb('0x2')],'allowNull':![],'defaultValue':_0x50bb('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x50bb('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x50bb('0x9')](_0x50bb('0xa'),_0x50bb('0xb')),'defaultValue':_0x50bb('0xa')},'header_online':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0xc')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x50bb('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x50bb('0xe')},'header_offline':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0xf')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x50bb('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x10')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x50bb('0x11')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x50bb('0x12')},'formSubmitSuccessMessage':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x13')},'formSubmitFailureMessage':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x14')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x50bb('0x15')},'placeholderMessage':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0xe')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x50bb('0x16')},'ratingType':{'type':Sequelize[_0x50bb('0x9')](_0x50bb('0x17'),'thumb'),'defaultValue':_0x50bb('0x17')},'ratingStarsNumber':{'type':Sequelize[_0x50bb('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x50bb('0x11')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x50bb('0x18'),'variable':null,'config':{'placeholder':'name','type':_0x50bb('0x19'),'required':!![]},'props':{'title':_0x50bb('0x1a'),'helpText':''}},{'type':_0x50bb('0x18'),'props':{'title':_0x50bb('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x50bb('0x4'),'type':_0x50bb('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x50bb('0x1b'))?JSON[_0x50bb('0x1c')](this[_0x50bb('0x1d')](_0x50bb('0x1b'))):{};},'set':function(_0x5234d7){return this[_0x50bb('0x1e')]('onlineForm',JSON['stringify'](_0x5234d7));}},'offlineForm':{'type':Sequelize[_0x50bb('0x11')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','props':{'title':_0x50bb('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x50bb('0x4'),'type':_0x50bb('0x4')},'variable':null},{'type':_0x50bb('0x1f'),'config':{'placeholder':_0x50bb('0x20')},'props':{'title':_0x50bb('0x20'),'helpText':_0x50bb('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x50bb('0x1d')]('offlineForm')?JSON[_0x50bb('0x1c')](this[_0x50bb('0x1d')](_0x50bb('0x22'))):{};},'set':function(_0x1b7c0f){return this['setDataValue'](_0x50bb('0x22'),JSON[_0x50bb('0x23')](_0x1b7c0f));}},'token':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':function(){return rs[_0x50bb('0x24')]();}},'autoclose':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x50bb('0x2')]},'forwardOffline':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x50bb('0x2')]},'waitingTitle':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x25')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x50bb('0x26')},'offlineMessageSubject':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x27')},'offlineMessageBody':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x28')},'enableUnmanagedNote':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x29')},'skipUnmanaged':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x2a')},'sendUnmanaged':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x50bb('0x11')]},'showAgentAvatar':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x50bb('0x2')]},'notificationTemplate':{'type':Sequelize[_0x50bb('0x11')],'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[_0x50bb('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0x50bb('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x2c')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x2d')},'defaultTitle':{'type':Sequelize[_0x50bb('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x50bb('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x50bb('0x2')],'allowNull':![],'defaultValue':_0x50bb('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x50bb('0x2f')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x50bb('0x7')],'comment':_0x50bb('0x30')},'mandatoryDisposition':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![],'comment':_0x50bb('0x31'),'set':function(_0x3a9fe4){if(!_0x3a9fe4)this[_0x50bb('0x1e')](_0x50bb('0x32'),null);this[_0x50bb('0x1e')](_0x50bb('0x33'),_0x3a9fe4);}},'vidaooEscalation':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x50bb('0x34')},'vidaooNote':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':function(){return _0x50bb('0x35');}},'vidaooMetadata':{'type':Sequelize[_0x50bb('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x50bb('0x11')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index c2b1f3d..6ccbde3 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 _0x0586=['ChatWebsiteId','findOne','Disposition','options','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','addLogo','filename','file','addSystemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','sitepic','../../config/license/util','custom','isNil','existsSync','join','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/','customerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','user-agent-parser','headers','user-agent','getResult','Sequelize','ValidationError','no\x20available\x20attributes','updatedAt','difference','createdAt','CompanyId','ListId','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','Contacts','Applications','applications','list','asc','account','contact','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','format','unknown','device','vendor','%s\x20%s\x20%s','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','unshift','agent','forcedOwnership','Start','startRouting','EventManager','notify','offline','files','from\x20is\x20mandatory','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','mimetype','server','attachments','offline-chat','basename','sequelize','transaction','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','SendMail','sendMail','\x22%s\x22\x20<%s>','email','MailAccountId','originalname','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','notifyMail','remove','addInteraction','omit','getInteractions','Contact','User','fullname','internal','Tag','Tags','color','tag','Command','iftime\x20%s,%s','interval','timezone','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','getSnippet','Interval','Intervals','getProactiveActions','getLicense','License','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','URL','address','origin','3.1.0','remote','x-real-ip','connection','remoteAddress','virtual','alignment','textColor','textButtonColor','color_button','hideWhenOffline','IntervalId','addApplications','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','findAndCountAll','priority','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','Attachment','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','path','ejs','fs-extra','lodash','querystring','../../components/parsers/qs','../../config/logger','api','../../config/environment','url','../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','request','then','info','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','ChatWebsite,\x20%s,\x20%s','message','result','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','end','stack','name','index','Pause','mandatoryDispositionPause','map','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','ChatWebsite','includeAll','include','findAll','rows','params','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition'];(function(_0xc5655,_0x23027d){var _0x6bf0a1=function(_0xe7426b){while(--_0xe7426b){_0xc5655['push'](_0xc5655['shift']());}};_0x6bf0a1(++_0x23027d);}(_0x0586,0xda));var _0x6058=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0586[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x6058('0x0'));var Mustache=require(_0x6058('0x1'));var util=require('util');var path=require(_0x6058('0x2'));var ejs=require(_0x6058('0x3'));var fs=require('fs');var fs_extra=require(_0x6058('0x4'));var _=require(_0x6058('0x5'));var querystring=require(_0x6058('0x6'));var Redis=require('ioredis');var qs=require(_0x6058('0x7'));var logger=require(_0x6058('0x8'))(_0x6058('0x9'));var config=require(_0x6058('0xa'));var url=require(_0x6058('0xb'));var db=require(_0x6058('0xc'))['db'];config[_0x6058('0xd')]=_[_0x6058('0xe')](config[_0x6058('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x6058('0xf'))(new Redis(config[_0x6058('0xd')]));require(_0x6058('0x10'))[_0x6058('0x11')](socket);var htmlToText=require(_0x6058('0x12'));var jayson=require(_0x6058('0x13'));var client=jayson[_0x6058('0x14')][_0x6058('0x15')]({'port':0x232c});var client9002=jayson[_0x6058('0x14')][_0x6058('0x15')]({'port':0x232a});var client9003=jayson[_0x6058('0x14')]['http']({'port':0x232b});var client9001=jayson[_0x6058('0x14')][_0x6058('0x15')]({'port':0x2329});function respondWithRpcPromise(_0x1d791d,_0x221fad,_0x283892,_0x4d07b8){return new BPromise(function(_0xdf2af6,_0x5750b8){var _0xf1cb8d=_0x4d07b8||client;return _0xf1cb8d[_0x6058('0x16')](_0x1d791d,_0x283892)[_0x6058('0x17')](function(_0xfe3834){logger[_0x6058('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x221fad,_0x6058('0x19'));logger['debug'](_0x6058('0x1a'),_0x221fad,_0x6058('0x19'),JSON['stringify'](_0xfe3834));if(_0xfe3834['error']){if(_0xfe3834[_0x6058('0x1b')][_0x6058('0x1c')]===0x1f4){logger[_0x6058('0x1b')](_0x6058('0x1d'),_0x221fad,_0xfe3834[_0x6058('0x1b')][_0x6058('0x1e')]);return _0x5750b8(_0xfe3834[_0x6058('0x1b')][_0x6058('0x1e')]);}logger[_0x6058('0x1b')](_0x6058('0x1d'),_0x221fad,_0xfe3834['error'][_0x6058('0x1e')]);return _0xdf2af6(_0xfe3834[_0x6058('0x1b')][_0x6058('0x1e')]);}else{logger['info'](_0x6058('0x1d'),_0x221fad,_0x6058('0x19'));_0xdf2af6(_0xfe3834[_0x6058('0x1f')][_0x6058('0x1e')]);}})['catch'](function(_0x2478b0){logger[_0x6058('0x1b')](_0x6058('0x1d'),_0x221fad,_0x2478b0);_0x5750b8(_0x2478b0);});});}function respondWithStatusCode(_0x305fd7,_0x7d845c){_0x7d845c=_0x7d845c||0xcc;return function(_0x4a6a87){if(_0x4a6a87){return _0x305fd7[_0x6058('0x20')](_0x7d845c);}return _0x305fd7[_0x6058('0x21')](_0x7d845c)['end']();};}function respondWithResult(_0x525b89,_0x20cb1a){_0x20cb1a=_0x20cb1a||0xc8;return function(_0x175627){if(_0x175627){return _0x525b89[_0x6058('0x21')](_0x20cb1a)[_0x6058('0x22')](_0x175627);}};}function respondWithFilteredResult(_0x2aa57b,_0x5c4cd1){return function(_0x115d0c){if(_0x115d0c){var _0x55207e=typeof _0x5c4cd1[_0x6058('0x23')]==='undefined'&&typeof _0x5c4cd1[_0x6058('0x24')]===_0x6058('0x25');var _0x4e5182=_0x115d0c['count'];var _0x1c7d5d=_0x55207e?0x0:_0x5c4cd1[_0x6058('0x23')];var _0x2e6c41=_0x55207e?_0x115d0c[_0x6058('0x26')]:_0x5c4cd1['offset']+_0x5c4cd1['limit'];var _0x4a28cf;if(_0x2e6c41>=_0x4e5182){_0x2e6c41=_0x4e5182;_0x4a28cf=0xc8;}else{_0x4a28cf=0xce;}_0x2aa57b[_0x6058('0x21')](_0x4a28cf);return _0x2aa57b[_0x6058('0x27')](_0x6058('0x28'),_0x1c7d5d+'-'+_0x2e6c41+'/'+_0x4e5182)[_0x6058('0x22')](_0x115d0c);}return null;};}function saveUpdates(_0x497717){return function(_0x2d6f84){if(_0x2d6f84){return _0x2d6f84[_0x6058('0x29')](_0x497717)[_0x6058('0x17')](function(_0x5a5e97){return _0x5a5e97;});}return null;};}function removeEntity(_0xca52de){return function(_0x3d9103){if(_0x3d9103){return _0x3d9103[_0x6058('0x2a')]()[_0x6058('0x17')](function(){var _0x34c72e=_0x3d9103[_0x6058('0x2b')]({'plain':!![]});var _0x4bfcd8=_0x6058('0x2c');return db[_0x6058('0x2d')]['destroy']({'where':{'type':_0x4bfcd8,'resourceId':_0x34c72e['id']}})[_0x6058('0x17')](function(){return _0x3d9103;});})[_0x6058('0x17')](function(){_0xca52de['status'](0xcc)[_0x6058('0x2e')]();});}};}function handleEntityNotFound(_0x4d089b){return function(_0xb0b232){if(!_0xb0b232){_0x4d089b[_0x6058('0x20')](0x194);}return _0xb0b232;};}function handleError(_0x31d89e,_0x3808ee){_0x3808ee=_0x3808ee||0x1f4;return function(_0x140bc2){logger[_0x6058('0x1b')](_0x140bc2[_0x6058('0x2f')]);if(_0x140bc2[_0x6058('0x30')]){delete _0x140bc2[_0x6058('0x30')];}_0x31d89e[_0x6058('0x21')](_0x3808ee)['send'](_0x140bc2);};}exports[_0x6058('0x31')]=function(_0x1c5ac3,_0x134382){var _0x3e9184={'include':[{'model':db[_0x6058('0x32')],'as':_0x6058('0x33')}]},_0x16ad2e={},_0x3d7ea1={'count':0x0,'rows':[]};var _0x4e8718=_[_0x6058('0x34')](db['ChatWebsite'][_0x6058('0x35')],function(_0x145b53){return{'name':_0x145b53['fieldName'],'type':_0x145b53[_0x6058('0x36')][_0x6058('0x37')]};});_0x16ad2e['model']=_['map'](_0x4e8718,_0x6058('0x30'));_0x16ad2e[_0x6058('0x38')]=_[_0x6058('0x39')](_0x1c5ac3[_0x6058('0x38')]);_0x16ad2e[_0x6058('0x3a')]=_[_0x6058('0x3b')](_0x16ad2e[_0x6058('0x3c')],_0x16ad2e[_0x6058('0x38')]);_0x3e9184[_0x6058('0x3d')]=_[_0x6058('0x3b')](_0x16ad2e[_0x6058('0x3c')],qs[_0x6058('0x3e')](_0x1c5ac3[_0x6058('0x38')][_0x6058('0x3e')]));_0x3e9184[_0x6058('0x3d')]=_0x3e9184[_0x6058('0x3d')][_0x6058('0x3f')]?_0x3e9184[_0x6058('0x3d')]:_0x16ad2e['model'];if(!_0x1c5ac3[_0x6058('0x38')][_0x6058('0x40')](_0x6058('0x41'))){_0x3e9184[_0x6058('0x24')]=qs[_0x6058('0x24')](_0x1c5ac3[_0x6058('0x38')][_0x6058('0x24')]);_0x3e9184['offset']=qs[_0x6058('0x23')](_0x1c5ac3[_0x6058('0x38')][_0x6058('0x23')]);}_0x3e9184[_0x6058('0x42')]=qs[_0x6058('0x43')](_0x1c5ac3[_0x6058('0x38')][_0x6058('0x43')]);_0x3e9184[_0x6058('0x44')]=qs[_0x6058('0x3a')](_[_0x6058('0x45')](_0x1c5ac3[_0x6058('0x38')],_0x16ad2e[_0x6058('0x3a')]),_0x4e8718);if(_0x1c5ac3[_0x6058('0x38')]['filter']){_0x3e9184[_0x6058('0x44')]=_[_0x6058('0x46')](_0x3e9184[_0x6058('0x44')],{'$or':_['map'](_0x4e8718,function(_0x145155){if(_0x145155[_0x6058('0x36')]!==_0x6058('0x47')){var _0x26a090={};_0x26a090[_0x145155[_0x6058('0x30')]]={'$like':'%'+_0x1c5ac3[_0x6058('0x38')][_0x6058('0x48')]+'%'};return _0x26a090;}})});}_0x3e9184=_[_0x6058('0x46')]({},_0x3e9184,_0x1c5ac3['options']);var _0x1f977d={'where':_0x3e9184[_0x6058('0x44')]};return db[_0x6058('0x49')]['count'](_0x1f977d)[_0x6058('0x17')](function(_0x410255){_0x3d7ea1[_0x6058('0x26')]=_0x410255;if(_0x1c5ac3[_0x6058('0x38')][_0x6058('0x4a')]){_0x3e9184[_0x6058('0x4b')]=[{'all':!![]}];}return db[_0x6058('0x49')][_0x6058('0x4c')](_0x3e9184);})['then'](function(_0x19a636){_0x3d7ea1[_0x6058('0x4d')]=_0x19a636;return _0x3d7ea1;})[_0x6058('0x17')](respondWithFilteredResult(_0x134382,_0x3e9184))['catch'](handleError(_0x134382,null));};exports['show']=function(_0x273eff,_0x119fac){var _0x3c3a65={'raw':![],'where':{'id':_0x273eff[_0x6058('0x4e')]['id']},'include':[{'model':db[_0x6058('0x32')],'as':_0x6058('0x33')}]},_0x4bb10f={};_0x4bb10f[_0x6058('0x3c')]=_[_0x6058('0x39')](db[_0x6058('0x49')][_0x6058('0x35')]);_0x4bb10f['query']=_[_0x6058('0x39')](_0x273eff[_0x6058('0x38')]);_0x4bb10f['filters']=_[_0x6058('0x3b')](_0x4bb10f['model'],_0x4bb10f[_0x6058('0x38')]);_0x3c3a65[_0x6058('0x3d')]=_[_0x6058('0x3b')](_0x4bb10f['model'],qs['fields'](_0x273eff[_0x6058('0x38')][_0x6058('0x3e')]));_0x3c3a65[_0x6058('0x3d')]=_0x3c3a65[_0x6058('0x3d')][_0x6058('0x3f')]?_0x3c3a65[_0x6058('0x3d')]:_0x4bb10f[_0x6058('0x3c')];if(_0x273eff['query'][_0x6058('0x4a')]){_0x3c3a65['include']=[{'all':!![]}];}_0x3c3a65=_['merge']({},_0x3c3a65,_0x273eff['options']);return db[_0x6058('0x49')][_0x6058('0x4f')](_0x3c3a65)[_0x6058('0x17')](handleEntityNotFound(_0x119fac,null))[_0x6058('0x17')](respondWithResult(_0x119fac,null))[_0x6058('0x50')](handleError(_0x119fac,null));};exports[_0x6058('0x51')]=function(_0x31bfcc,_0x2e79c3){return db['ChatWebsite']['create'](_0x31bfcc[_0x6058('0x52')],{})[_0x6058('0x17')](function(_0x38d32c){var _0x27e9d9=_0x31bfcc['user'][_0x6058('0x2b')]({'plain':!![]});if(!_0x27e9d9)throw new Error(_0x6058('0x53'));if(_0x27e9d9[_0x6058('0x54')]===_0x6058('0x55')){var _0xfc3bb=_0x38d32c[_0x6058('0x2b')]({'plain':!![]});var _0x15f078=_0x6058('0x2c');return db[_0x6058('0x56')]['find']({'where':{'name':_0x15f078,'userProfileId':_0x27e9d9[_0x6058('0x57')]},'raw':!![]})[_0x6058('0x17')](function(_0x2f0e03){if(_0x2f0e03&&_0x2f0e03[_0x6058('0x58')]===0x0){return db[_0x6058('0x2d')][_0x6058('0x51')]({'name':_0xfc3bb[_0x6058('0x30')],'resourceId':_0xfc3bb['id'],'type':_0x2f0e03[_0x6058('0x30')],'sectionId':_0x2f0e03['id']},{})[_0x6058('0x17')](function(){return _0x38d32c;});}else{return _0x38d32c;}})[_0x6058('0x50')](function(_0x5cb5da){logger[_0x6058('0x1b')](_0x6058('0x59'),_0x5cb5da);throw _0x5cb5da;});}return _0x38d32c;})[_0x6058('0x17')](respondWithResult(_0x2e79c3,0xc9))['catch'](handleError(_0x2e79c3,null));};exports[_0x6058('0x29')]=function(_0x2fb1fe,_0x2702c3){if(_0x2fb1fe[_0x6058('0x52')]['id']){delete _0x2fb1fe[_0x6058('0x52')]['id'];}return db[_0x6058('0x49')][_0x6058('0x4f')]({'where':{'id':_0x2fb1fe[_0x6058('0x4e')]['id']},'include':[{'model':db['Pause'],'as':_0x6058('0x33')}]})[_0x6058('0x17')](handleEntityNotFound(_0x2702c3,null))['then'](saveUpdates(_0x2fb1fe['body'],null))[_0x6058('0x17')](respondWithResult(_0x2702c3,null))['catch'](handleError(_0x2702c3,null));};exports[_0x6058('0x2a')]=function(_0x184a5a,_0x2ed82b){return db[_0x6058('0x49')]['find']({'where':{'id':_0x184a5a[_0x6058('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2ed82b,null))[_0x6058('0x17')](removeEntity(_0x2ed82b,null))[_0x6058('0x50')](handleError(_0x2ed82b,null));};exports[_0x6058('0x5a')]=function(_0x50d0cd,_0x50338a){return db[_0x6058('0x49')][_0x6058('0x5a')]()['then'](respondWithResult(_0x50338a,null))[_0x6058('0x50')](handleError(_0x50338a,null));};exports[_0x6058('0x5b')]=function(_0xf3616b,_0x1f23bb){if(_0xf3616b['body']['id']){delete _0xf3616b[_0x6058('0x52')]['id'];}return db[_0x6058('0x49')]['find']({'where':{'id':_0xf3616b['params']['id']}})[_0x6058('0x17')](handleEntityNotFound(_0x1f23bb,null))[_0x6058('0x17')](function(_0x29ed84){if(_0x29ed84){_0xf3616b[_0x6058('0x52')][_0x6058('0x5c')]=_0x29ed84['id'];return db['Disposition'][_0x6058('0x51')](_0xf3616b[_0x6058('0x52')]);}})[_0x6058('0x17')](respondWithResult(_0x1f23bb,null))[_0x6058('0x50')](handleError(_0x1f23bb,null));};exports['getDispositions']=function(_0x35f410,_0x520a3d){var _0x233833={'raw':![],'where':{}};var _0x27ccff={};var _0x288787={'count':0x0,'rows':[]};return db[_0x6058('0x49')][_0x6058('0x5d')]({'where':{'id':_0x35f410['params']['id']}})['then'](handleEntityNotFound(_0x520a3d,null))[_0x6058('0x17')](function(_0x13e74a){if(_0x13e74a){_0x27ccff[_0x6058('0x3c')]=_[_0x6058('0x39')](db[_0x6058('0x5e')][_0x6058('0x35')]);_0x27ccff['query']=_['keys'](_0x35f410[_0x6058('0x38')]);_0x27ccff[_0x6058('0x3a')]=_[_0x6058('0x3b')](_0x27ccff[_0x6058('0x3c')],_0x27ccff[_0x6058('0x38')]);_0x233833[_0x6058('0x3d')]=_[_0x6058('0x3b')](_0x27ccff[_0x6058('0x3c')],qs[_0x6058('0x3e')](_0x35f410[_0x6058('0x38')][_0x6058('0x3e')]));_0x233833[_0x6058('0x3d')]=_0x233833[_0x6058('0x3d')][_0x6058('0x3f')]?_0x233833[_0x6058('0x3d')]:_0x27ccff['model'];if(!_0x35f410[_0x6058('0x38')]['hasOwnProperty'](_0x6058('0x41'))){_0x233833[_0x6058('0x24')]=qs[_0x6058('0x24')](_0x35f410[_0x6058('0x38')][_0x6058('0x24')]);_0x233833[_0x6058('0x23')]=qs[_0x6058('0x23')](_0x35f410[_0x6058('0x38')][_0x6058('0x23')]);}_0x233833[_0x6058('0x42')]=qs[_0x6058('0x43')](_0x35f410[_0x6058('0x38')][_0x6058('0x43')]);_0x233833[_0x6058('0x44')]=qs[_0x6058('0x3a')](_[_0x6058('0x45')](_0x35f410[_0x6058('0x38')],_0x27ccff[_0x6058('0x3a')]));_0x233833[_0x6058('0x44')]['ChatWebsiteId']=_0x13e74a['id'];if(_0x35f410[_0x6058('0x38')][_0x6058('0x48')]){_0x233833[_0x6058('0x44')]=_[_0x6058('0x46')](_0x233833[_0x6058('0x44')],{'$or':_['map'](_0x233833[_0x6058('0x3d')],function(_0x31cd0d){var _0x2025c1={};_0x2025c1[_0x31cd0d]={'$like':'%'+_0x35f410['query'][_0x6058('0x48')]+'%'};return _0x2025c1;})});}_0x233833=_['merge']({},_0x233833,_0x35f410[_0x6058('0x5f')]);return db['Disposition']['count']({'where':_0x233833[_0x6058('0x44')]})[_0x6058('0x17')](function(_0x237402){_0x288787['count']=_0x237402;if(_0x35f410[_0x6058('0x38')][_0x6058('0x4a')]){_0x233833[_0x6058('0x4b')]=[{'all':!![]}];}return db[_0x6058('0x5e')]['findAll'](_0x233833);})['then'](function(_0x206168){_0x288787[_0x6058('0x4d')]=_0x206168;return _0x288787;});}})['then'](respondWithFilteredResult(_0x520a3d,_0x233833))['catch'](handleError(_0x520a3d,null));};exports[_0x6058('0x60')]=function(_0x53b326,_0x788c5a){return db[_0x6058('0x49')][_0x6058('0x4f')]({'where':{'id':_0x53b326['params']['id']}})[_0x6058('0x17')](handleEntityNotFound(_0x788c5a,null))[_0x6058('0x17')](function(_0x39d88d){if(_0x39d88d){return _0x39d88d[_0x6058('0x60')](_0x53b326[_0x6058('0x38')]['ids']);}})[_0x6058('0x17')](respondWithStatusCode(_0x788c5a,null))[_0x6058('0x50')](handleError(_0x788c5a,null));};exports[_0x6058('0x61')]=function(_0x563a76,_0x3c7ce0){if(_0x563a76[_0x6058('0x52')]['id']){delete _0x563a76[_0x6058('0x52')]['id'];}return db[_0x6058('0x49')][_0x6058('0x4f')]({'where':{'id':_0x563a76[_0x6058('0x4e')]['id']}})[_0x6058('0x17')](handleEntityNotFound(_0x3c7ce0,null))[_0x6058('0x17')](function(_0x5dcb8e){if(_0x5dcb8e){_0x563a76[_0x6058('0x52')][_0x6058('0x5c')]=_0x5dcb8e['id'];return db[_0x6058('0x62')]['create'](_0x563a76[_0x6058('0x52')]);}})[_0x6058('0x17')](respondWithResult(_0x3c7ce0,null))[_0x6058('0x50')](handleError(_0x3c7ce0,null));};exports[_0x6058('0x63')]=function(_0x1b4516,_0x4d60d3){var _0xf09771={'raw':![],'where':{}};var _0xbcd27f={};var _0x58d726={'count':0x0,'rows':[]};return db[_0x6058('0x49')]['findOne']({'where':{'id':_0x1b4516[_0x6058('0x4e')]['id']}})[_0x6058('0x17')](handleEntityNotFound(_0x4d60d3,null))['then'](function(_0x54074b){if(_0x54074b){_0xbcd27f[_0x6058('0x3c')]=_[_0x6058('0x39')](db['CannedAnswer']['rawAttributes']);_0xbcd27f[_0x6058('0x38')]=_[_0x6058('0x39')](_0x1b4516[_0x6058('0x38')]);_0xbcd27f[_0x6058('0x3a')]=_['intersection'](_0xbcd27f['model'],_0xbcd27f['query']);_0xf09771[_0x6058('0x3d')]=_[_0x6058('0x3b')](_0xbcd27f[_0x6058('0x3c')],qs[_0x6058('0x3e')](_0x1b4516['query'][_0x6058('0x3e')]));_0xf09771[_0x6058('0x3d')]=_0xf09771[_0x6058('0x3d')][_0x6058('0x3f')]?_0xf09771[_0x6058('0x3d')]:_0xbcd27f[_0x6058('0x3c')];if(!_0x1b4516['query'][_0x6058('0x40')](_0x6058('0x41'))){_0xf09771[_0x6058('0x24')]=qs[_0x6058('0x24')](_0x1b4516[_0x6058('0x38')][_0x6058('0x24')]);_0xf09771[_0x6058('0x23')]=qs['offset'](_0x1b4516[_0x6058('0x38')][_0x6058('0x23')]);}_0xf09771[_0x6058('0x42')]=qs[_0x6058('0x43')](_0x1b4516['query'][_0x6058('0x43')]);_0xf09771['where']=qs[_0x6058('0x3a')](_[_0x6058('0x45')](_0x1b4516['query'],_0xbcd27f[_0x6058('0x3a')]));_0xf09771['where']['ChatWebsiteId']=_0x54074b['id'];if(_0x1b4516[_0x6058('0x38')][_0x6058('0x48')]){_0xf09771[_0x6058('0x44')]=_[_0x6058('0x46')](_0xf09771[_0x6058('0x44')],{'$or':_[_0x6058('0x34')](_0xf09771[_0x6058('0x3d')],function(_0x1639f6){var _0x299ef6={};_0x299ef6[_0x1639f6]={'$like':'%'+_0x1b4516[_0x6058('0x38')][_0x6058('0x48')]+'%'};return _0x299ef6;})});}_0xf09771=_[_0x6058('0x46')]({},_0xf09771,_0x1b4516[_0x6058('0x5f')]);return db[_0x6058('0x62')][_0x6058('0x26')]({'where':_0xf09771[_0x6058('0x44')]})[_0x6058('0x17')](function(_0x5608a3){_0x58d726[_0x6058('0x26')]=_0x5608a3;if(_0x1b4516['query'][_0x6058('0x4a')]){_0xf09771[_0x6058('0x4b')]=[{'all':!![]}];}return db[_0x6058('0x62')][_0x6058('0x4c')](_0xf09771);})[_0x6058('0x17')](function(_0x111b1f){_0x58d726[_0x6058('0x4d')]=_0x111b1f;return _0x58d726;});}})[_0x6058('0x17')](respondWithFilteredResult(_0x4d60d3,_0xf09771))[_0x6058('0x50')](handleError(_0x4d60d3,null));};exports[_0x6058('0x64')]=function(_0x471d8c,_0x5191fd){return db[_0x6058('0x49')]['find']({'where':{'id':_0x471d8c['params']['id']}})[_0x6058('0x17')](handleEntityNotFound(_0x5191fd,null))[_0x6058('0x17')](function(_0x98e8ac){if(_0x98e8ac){return _0x98e8ac[_0x6058('0x64')](_0x471d8c['query'][_0x6058('0x65')]);}})[_0x6058('0x17')](respondWithStatusCode(_0x5191fd,null))[_0x6058('0x50')](handleError(_0x5191fd,null));};exports[_0x6058('0x66')]=function(_0x284903,_0x11c405){_0x284903[_0x6058('0x52')]['sitepic']=_0x284903['file'][_0x6058('0x67')];return db[_0x6058('0x49')]['find']({'where':{'id':_0x284903[_0x6058('0x4e')]['id']}})[_0x6058('0x17')](handleEntityNotFound(_0x11c405,null))[_0x6058('0x17')](saveUpdates(_0x284903[_0x6058('0x52')],null))[_0x6058('0x17')](respondWithResult(_0x11c405,null))[_0x6058('0x50')](handleError(_0x11c405,null));};exports['addAvatar']=function(_0x410e7f,_0x4a7197){_0x410e7f[_0x6058('0x52')]['agentAvatar']=_0x410e7f[_0x6058('0x68')][_0x6058('0x67')];return db[_0x6058('0x49')]['find']({'where':{'id':_0x410e7f[_0x6058('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4a7197,null))[_0x6058('0x17')](saveUpdates(_0x410e7f[_0x6058('0x52')],null))['then'](respondWithResult(_0x4a7197,null))['catch'](handleError(_0x4a7197,null));};exports['addCustomerAvatar']=function(_0x161e92,_0x20aacb){_0x161e92[_0x6058('0x52')]['customerAvatar']=_0x161e92[_0x6058('0x68')][_0x6058('0x67')];return db['ChatWebsite']['find']({'where':{'id':_0x161e92[_0x6058('0x4e')]['id']}})[_0x6058('0x17')](handleEntityNotFound(_0x20aacb,null))[_0x6058('0x17')](saveUpdates(_0x161e92['body'],null))[_0x6058('0x17')](respondWithResult(_0x20aacb,null))[_0x6058('0x50')](handleError(_0x20aacb,null));};exports[_0x6058('0x69')]=function(_0x2af4a0,_0x148d17){_0x2af4a0[_0x6058('0x52')]['systemAvatar']=_0x2af4a0[_0x6058('0x68')][_0x6058('0x67')];return db[_0x6058('0x49')][_0x6058('0x4f')]({'where':{'id':_0x2af4a0['params']['id']}})['then'](handleEntityNotFound(_0x148d17,null))[_0x6058('0x17')](saveUpdates(_0x2af4a0['body'],null))[_0x6058('0x17')](respondWithResult(_0x148d17,null))[_0x6058('0x50')](handleError(_0x148d17,null));};exports[_0x6058('0x6a')]=function(_0xa242d9,_0x40cb95){var _0x150abf=path['join'](config[_0x6058('0x6b')],_0x6058('0x6c'));var _0x45709e={'where':{'id':_0xa242d9[_0x6058('0x4e')]['id']},'attributes':['id',_0x6058('0x6d')],'raw':!![]};var _0x55eb34=![];return require(_0x6058('0x6e'))['getLicense']()[_0x6058('0x17')](function(_0x25d69b){if(_0x25d69b){_0x55eb34=_0x25d69b[_0x6058('0x6f')];}})[_0x6058('0x17')](function(){return db[_0x6058('0x49')][_0x6058('0x4f')](_0x45709e);})[_0x6058('0x17')](handleEntityNotFound(_0x40cb95,null))[_0x6058('0x17')](function(_0x363adc){if(_0x363adc){if(!_[_0x6058('0x70')](_0x363adc[_0x6058('0x6d')])){if(fs[_0x6058('0x71')](path[_0x6058('0x72')](config['root'],'server/files/images/logos/',_0x363adc[_0x6058('0x6d')]))&&_0x55eb34){_0x150abf=path['join'](config['root'],_0x6058('0x73'),_0x363adc[_0x6058('0x6d')]);}}return _0x40cb95[_0x6058('0x74')](_0x150abf);}})[_0x6058('0x50')](handleError(_0x40cb95,null));};exports['getAvatar']=function(_0x435f9d,_0x319d74){var _0x150ab0=path[_0x6058('0x72')](config[_0x6058('0x6b')],_0x6058('0x75'));var _0x31fea6={'where':{'id':_0x435f9d[_0x6058('0x4e')]['id']},'attributes':['id',_0x6058('0x76')],'raw':!![]};return db[_0x6058('0x49')][_0x6058('0x4f')](_0x31fea6)['then'](handleEntityNotFound(_0x319d74,null))[_0x6058('0x17')](function(_0x527ac9){if(_0x527ac9){if(!_[_0x6058('0x70')](_0x527ac9[_0x6058('0x76')])){if(fs[_0x6058('0x71')](path[_0x6058('0x72')](config[_0x6058('0x6b')],'server/files/images/avatars/',_0x527ac9[_0x6058('0x76')]))){_0x150ab0=path['join'](config['root'],'server/files/images/avatars/',_0x527ac9[_0x6058('0x76')]);}}return _0x319d74[_0x6058('0x74')](_0x150ab0);}})[_0x6058('0x50')](handleError(_0x319d74,null));};exports['getCustomerAvatar']=function(_0x24a871,_0x21ddad){var _0x4522c4=path[_0x6058('0x72')](config[_0x6058('0x6b')],_0x6058('0x77'));var _0x2685d1={'where':{'id':_0x24a871[_0x6058('0x4e')]['id']},'attributes':['id','customerAvatar',_0x6058('0x78')],'raw':!![]};return db[_0x6058('0x49')][_0x6058('0x4f')](_0x2685d1)['then'](handleEntityNotFound(_0x21ddad,null))['then'](function(_0x3c6b59){if(_0x3c6b59){if(!_['isNil'](_0x3c6b59['customerAvatar'])){if(fs['existsSync'](path[_0x6058('0x72')](config[_0x6058('0x6b')],_0x6058('0x79'),_0x3c6b59[_0x6058('0x7a')]))&&_0x3c6b59[_0x6058('0x78')]){_0x4522c4=path['join'](config[_0x6058('0x6b')],_0x6058('0x79'),_0x3c6b59[_0x6058('0x7a')]);}}return _0x21ddad['download'](_0x4522c4);}})[_0x6058('0x50')](handleError(_0x21ddad,null));};exports[_0x6058('0x7b')]=function(_0x3dae5c,_0x47b550){var _0x56defc=path[_0x6058('0x72')](config[_0x6058('0x6b')],_0x6058('0x7c'));var _0x19ad2c={'where':{'id':_0x3dae5c['params']['id']},'attributes':['id',_0x6058('0x7d')],'raw':!![]};return db[_0x6058('0x49')][_0x6058('0x4f')](_0x19ad2c)[_0x6058('0x17')](handleEntityNotFound(_0x47b550,null))[_0x6058('0x17')](function(_0x1ea53c){if(_0x1ea53c){if(!_[_0x6058('0x70')](_0x1ea53c[_0x6058('0x7d')])){if(fs[_0x6058('0x71')](path['join'](config['root'],_0x6058('0x79'),_0x1ea53c[_0x6058('0x7d')]))){_0x56defc=path[_0x6058('0x72')](config[_0x6058('0x6b')],'server/files/images/avatars/',_0x1ea53c['systemAvatar']);}}return _0x47b550['download'](_0x56defc);}})['catch'](handleError(_0x47b550,null));};exports['notify']=function(_0x2cf15d,_0x5227c3){var _0x46d1ff=require(_0x6058('0x7e'));var _0x1e909a=new _0x46d1ff();var _0x216ea7=_0x1e909a['setUA'](_0x2cf15d[_0x6058('0x7f')][_0x6058('0x80')])[_0x6058('0x81')]();var _0x5d6944={'body':_0x2cf15d[_0x6058('0x52')],'channel':'chat'};var _0x383702=[];var _0x1fde7e=[];var _0x39b62c={};var _0x597a8e=![];return db['CmContact'][_0x6058('0x5a')]()[_0x6058('0x17')](function(_0xd1d22d){if(!_0xd1d22d){throw new db[(_0x6058('0x82'))][(_0x6058('0x83'))](_0x6058('0x84'));}_0x383702=_['difference'](_[_0x6058('0x39')](_0xd1d22d),['createdAt',_0x6058('0x85')]);_0x1fde7e=_[_0x6058('0x86')](_['keys'](_0xd1d22d),[_0x6058('0x87'),'updatedAt',_0x6058('0x88'),_0x6058('0x89')]);if(_0x2cf15d['body']['id']){delete _0x2cf15d[_0x6058('0x52')]['id'];}if(_[_0x6058('0x70')](_0x2cf15d[_0x6058('0x52')][_0x6058('0x8a')])){throw new db[(_0x6058('0x82'))][(_0x6058('0x83'))]('from\x20is\x20mandatory');}if(_[_0x6058('0x70')](_0x2cf15d[_0x6058('0x52')][_0x6058('0x52')])||_0x2cf15d['body'][_0x6058('0x52')]===''){throw new db[(_0x6058('0x82'))][(_0x6058('0x83'))](_0x6058('0x8b'));}if(_[_0x6058('0x70')](_0x2cf15d[_0x6058('0x52')][_0x6058('0x8c')])){throw new db[(_0x6058('0x82'))][(_0x6058('0x83'))](_0x6058('0x8d')+_0x1fde7e);}if(!_[_0x6058('0x8e')](_0x1fde7e,_0x2cf15d[_0x6058('0x52')][_0x6058('0x8c')])){throw new db[(_0x6058('0x82'))][(_0x6058('0x83'))](_0x6058('0x8f')+_0x1fde7e);}_0x39b62c[_0x2cf15d[_0x6058('0x52')]['mapKey']]=_0x2cf15d[_0x6058('0x52')]['from'];})[_0x6058('0x17')](function(){return db[_0x6058('0x49')][_0x6058('0x4f')]({'where':{'id':_0x2cf15d[_0x6058('0x4e')]['id']},'include':[{'model':db[_0x6058('0x90')],'as':_0x6058('0x91'),'include':[{'model':db[_0x6058('0x92')],'as':_0x6058('0x93'),'where':_0x39b62c,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db['ChatApplication'],'as':_0x6058('0x94')}]});})[_0x6058('0x17')](handleEntityNotFound(_0x5227c3,null))['then'](function(_0x49da26){if(_0x49da26&&_0x49da26[_0x6058('0x91')]){_0x5d6944['account']=_0x49da26;_0x5d6944[_0x6058('0x95')]=_0x49da26[_0x6058('0x94')];_0x5d6944[_0x6058('0x96')]=_0x49da26[_0x6058('0x91')];_0x5d6944[_0x6058('0x95')]=_['orderBy'](_0x5d6944[_0x6058('0x95')],['priority'],[_0x6058('0x97')]);if(_0x5d6944[_0x6058('0x98')]['Applications']){delete _0x5d6944[_0x6058('0x98')][_0x6058('0x94')];}if(_0x5d6944[_0x6058('0x98')][_0x6058('0x91')]&&_0x5d6944[_0x6058('0x98')][_0x6058('0x91')]['Contacts'][_0x6058('0x3f')]){return _0x5d6944['account'][_0x6058('0x91')][_0x6058('0x93')][0x0];}var _0x5a9938=_[_0x6058('0xe')](_0x2cf15d['body'],{'firstName':_0x2cf15d['body']['from'],'ListId':_0x49da26[_0x6058('0x89')]});_0x5a9938[_0x2cf15d[_0x6058('0x52')]['mapKey']]=_0x2cf15d[_0x6058('0x52')][_0x6058('0x8a')];return db[_0x6058('0x92')][_0x6058('0x51')](_0x5a9938,{'fields':_0x383702,'raw':!![]});}})[_0x6058('0x17')](handleEntityNotFound(_0x5227c3,null))['then'](function(_0x3e88ab){_0x5d6944[_0x6058('0x99')]=_0x3e88ab;var _0xfb8431=_0x2cf15d[_0x6058('0x52')]['customerIp'];if(_0x2cf15d[_0x6058('0x7f')][_0x6058('0x9a')]){_0xfb8431=_0x2cf15d[_0x6058('0x7f')][_0x6058('0x9a')];}else if(_0x2cf15d[_0x6058('0x7f')][_0x6058('0x9b')]){_0xfb8431=_[_0x6058('0x9c')](_0x2cf15d['headers'][_0x6058('0x9b')][_0x6058('0x9d')](','));}if(_0x3e88ab){var _0x19c5ba={'ContactId':_0x3e88ab['id'],'ChatWebsiteId':_0x2cf15d[_0x6058('0x4e')]['id'],'from':(_0x3e88ab[_0x6058('0x9e')]||'')+'\x20'+(_0x3e88ab[_0x6058('0x9f')]||''),'customerIp':_0xfb8431,'customerPort':_0x2cf15d[_0x6058('0x7f')][_0x6058('0xa0')]?_0x2cf15d[_0x6058('0x7f')]['x-real-port']:null,'referer':_0x2cf15d['body'][_0x6058('0xa1')],'browserName':_0x216ea7[_0x6058('0xa2')][_0x6058('0x30')]&&_0x216ea7['browser'][_0x6058('0xa3')]?util[_0x6058('0xa4')]('%s\x20%s',_0x216ea7['browser'][_0x6058('0x30')],_0x216ea7[_0x6058('0xa2')][_0x6058('0xa3')]):_0x6058('0xa5'),'browserVersion':_0x216ea7[_0x6058('0xa2')][_0x6058('0xa3')]||_0x6058('0xa5'),'osName':util[_0x6058('0xa4')]('%s\x20%s',_0x216ea7['os'][_0x6058('0x30')],_0x216ea7['os']['version']),'osVersion':_0x216ea7['os']['version'],'deviceModel':_0x216ea7[_0x6058('0xa6')]['model']&&_0x216ea7[_0x6058('0xa6')][_0x6058('0xa7')]?util[_0x6058('0xa4')](_0x6058('0xa8'),_0x216ea7['device'][_0x6058('0x3c')],_0x216ea7['device']['vendor'],_0x216ea7['device'][_0x6058('0x36')]):null,'deviceVendor':_0x216ea7[_0x6058('0xa6')][_0x6058('0xa7')],'deviceType':_0x216ea7[_0x6058('0xa6')]['type'],'formData':JSON[_0x6058('0xa9')](_0x2cf15d[_0x6058('0x52')])};var _0x1342f0={'ChatWebsiteId':_0x2cf15d[_0x6058('0x4e')]['id'],'closed':![]};if(_0x2cf15d[_0x6058('0x52')][_0x6058('0xaa')]){_0x1342f0[_0x6058('0xaa')]=_0x2cf15d['body'][_0x6058('0xaa')];return db[_0x6058('0xab')][_0x6058('0x4f')]({'where':_0x1342f0})[_0x6058('0x17')](function(_0x2bf547){if(_0x2bf547){return[_0x2bf547,![]];}_0x19c5ba[_0x6058('0xaa')]=_0x2cf15d[_0x6058('0x52')][_0x6058('0xaa')];_0x19c5ba['externalUrl']=_0x2cf15d[_0x6058('0x52')][_0x6058('0xac')];return db[_0x6058('0xab')][_0x6058('0x51')](_0x19c5ba)[_0x6058('0x17')](function(_0x27c255){return[_0x27c255,!![]];});});}_0x1342f0[_0x6058('0xad')]=_0x3e88ab['id'];if(_0x2cf15d[_0x6058('0x52')][_0x6058('0xae')]&&_0x2cf15d['body'][_0x6058('0xae')]['id']){_0x1342f0['id']=_0x2cf15d[_0x6058('0x52')][_0x6058('0xae')]['id'];return db[_0x6058('0xab')][_0x6058('0x4f')]({'where':_0x1342f0})[_0x6058('0x17')](function(_0x50e5d6){if(_0x50e5d6){return[_0x50e5d6,![]];}return db[_0x6058('0xab')]['create'](_0x19c5ba)[_0x6058('0x17')](function(_0x451832){return[_0x451832,!![]];});});}return db[_0x6058('0xab')]['create'](_0x19c5ba)[_0x6058('0x17')](function(_0x32f33e){return[_0x32f33e,!![]];});}})[_0x6058('0xaf')](function(_0x3cc95f,_0x295b6){if(_0x3cc95f){_0x597a8e=_0x295b6;if(!_0x295b6){var _0x266e72={'from':(_0x5d6944['contact'][_0x6058('0x9e')]||'')+'\x20'+(_0x5d6944[_0x6058('0x99')]['lastName']||'')};if(_0x2cf15d['body']['threadId']&&_0x2cf15d['body']['messageId']&&_0x2cf15d[_0x6058('0x52')]['threadId']!=_0x2cf15d[_0x6058('0x52')][_0x6058('0xb0')]){_0x266e72[_0x6058('0xaa')]=_0x2cf15d[_0x6058('0x52')][_0x6058('0xb0')];}return _0x3cc95f[_0x6058('0x29')](_0x266e72);}else{return _0x3cc95f;}}})[_0x6058('0x17')](function(_0x153728){_0x5d6944['interaction']=_0x153728['get']({'plain':!![]});_0x5d6944[_0x6058('0xae')][_0x6058('0xb1')]=_0x597a8e;if(_0x5d6944[_0x6058('0xae')][_0x6058('0xb1')]){if(_0x5d6944['account'][_0x6058('0xb2')]){_0x5d6944[_0x6058('0x95')][_0x6058('0xb3')]({'id':0x0,'priority':_0x5d6944[_0x6058('0x95')][_0x6058('0x3f')]+0x1,'app':_0x6058('0xb4'),'appdata':_0x6058('0xb5'),'interval':_0x6058('0xb6')});}}return db[_0x6058('0xb7')][_0x6058('0x51')]({'body':_0x2cf15d[_0x6058('0x52')]['body'],'ChatWebsiteId':_0x2cf15d[_0x6058('0x4e')]['id'],'ChatInteractionId':_0x153728['id'],'direction':'in','ContactId':_0x5d6944[_0x6058('0x99')]['id'],'AttachmentId':_0x2cf15d[_0x6058('0x52')][_0x6058('0xb8')]});})[_0x6058('0x17')](function(_0x270f92){_0x5d6944[_0x6058('0x1e')]=_0x270f92;if(_0x5d6944['interaction'][_0x6058('0xb9')]){return db['User']['find']({'attributes':['id',_0x6058('0x30')],'where':{'id':_0x5d6944[_0x6058('0xae')]['UserId']}})[_0x6058('0x17')](function(_0x286f82){if(_0x286f82){_0x5d6944[_0x6058('0x95')][_0x6058('0xba')]({'id':0x0,'priority':0x0,'app':_0x6058('0xbb'),'appdata':_0x286f82['name']+','+(_0x5d6944[_0x6058('0x98')]['waitForTheAssignedAgent']||0xa),'interval':_0x6058('0xb6')});_0x5d6944[_0x6058('0xbc')]=!![];}return respondWithRpcPromise(_0x6058('0xbd'),_0x6058('0xbe'),_0x5d6944);});}return respondWithRpcPromise(_0x6058('0xbd'),'startRouting',_0x5d6944);})['then'](function(_0x2b19d6){respondWithRpcPromise(_0x6058('0xbf'),'EventManager',{'event':_0x6058('0xc0'),'message':_0x2b19d6},client9002);return _0x2b19d6;})[_0x6058('0x17')](respondWithResult(_0x5227c3,null))[_0x6058('0x50')](handleError(_0x5227c3,null));};exports[_0x6058('0xc1')]=function(_0x30f993,_0x1224a9){var _0x59542a,_0x582a57,_0x2b4a41;var _0x164cc4=[];var _0x1ac532={};var _0x539681=_0x30f993[_0x6058('0xc2')]||[];var _0x3f9199=[];var _0x426a96;return db[_0x6058('0x92')][_0x6058('0x5a')]()[_0x6058('0x17')](function(_0x2e8a14){if(!_0x2e8a14){throw new db[(_0x6058('0x82'))]['ValidationError'](_0x6058('0x84'));}_0x164cc4=_['difference'](_[_0x6058('0x39')](_0x2e8a14),[_0x6058('0x87'),_0x6058('0x85'),_0x6058('0x88'),_0x6058('0x89')]);if(_0x30f993[_0x6058('0x52')]['id']){delete _0x30f993[_0x6058('0x52')]['id'];}if(_[_0x6058('0x70')](_0x30f993[_0x6058('0x52')]['from'])){throw _0x1224a9[_0x6058('0x21')](0x1f4)['send'](new db[(_0x6058('0x82'))][(_0x6058('0x83'))](_0x6058('0xc3')));}if(_[_0x6058('0x70')](_0x30f993[_0x6058('0x52')][_0x6058('0x52')])||_0x30f993[_0x6058('0x52')]['body']===''){throw _0x1224a9[_0x6058('0x21')](0x1f4)[_0x6058('0xc4')](new db[(_0x6058('0x82'))][(_0x6058('0x83'))](_0x6058('0x8b')));}if(_[_0x6058('0x70')](_0x30f993['body'][_0x6058('0xc5')])){throw _0x1224a9[_0x6058('0x21')](0x1f4)[_0x6058('0xc4')](new db[(_0x6058('0x82'))][(_0x6058('0x83'))](_0x6058('0xc6')+_0x164cc4));}if(!_[_0x6058('0x8e')](_0x164cc4,_0x30f993[_0x6058('0x52')]['mapKeyOffline'])){throw _0x1224a9['status'](0x1f4)['send'](new db['Sequelize'][(_0x6058('0x83'))](_0x6058('0xc7')+_0x164cc4));}_0x1ac532[_0x30f993['body'][_0x6058('0xc5')]]=_0x30f993['body'][_0x6058('0x8a')];})[_0x6058('0x17')](function(){return db[_0x6058('0x49')]['find']({'where':{'id':_0x30f993[_0x6058('0x4e')]['id']},'include':[{'model':db[_0x6058('0x90')],'as':_0x6058('0x91')},{'model':db['MailAccount'],'as':_0x6058('0xc8')}]});})[_0x6058('0x17')](handleEntityNotFound(_0x1224a9,null))[_0x6058('0x17')](function(_0x1198aa){if(_0x1198aa&&_0x1198aa[_0x6058('0x91')]){_0x582a57=_0x1198aa;var _0x520d4e=_[_0x6058('0xe')](_0x30f993['body'],{'firstName':_0x30f993[_0x6058('0x52')]['from'],'phone':_0x30f993['body'][_0x6058('0x8a')],'ListId':_0x1198aa[_0x6058('0x89')]});_0x520d4e[_0x30f993[_0x6058('0x52')][_0x6058('0xc5')]]=_0x30f993[_0x6058('0x52')][_0x6058('0x8a')];return db[_0x6058('0x92')][_0x6058('0xc9')]({'where':_0x1ac532,'defaults':_0x520d4e});}})[_0x6058('0xaf')](function(_0x5384f0){if(_0x5384f0){_0x2b4a41=_0x5384f0;var _0x23b892=fs[_0x6058('0xca')](path[_0x6058('0x72')](config[_0x6058('0x6b')],'server/files/templates/chatOfflineMessage.ejs'),_0x6058('0xcb'));var _0xf1cdab=ejs[_0x6058('0xcc')](_0x23b892,{'body':_[_0x6058('0xcd')](_0x30f993[_0x6058('0x52')][_0x6058('0x52')]),'bodyTitle':_0x582a57[_0x6058('0xce')]});return db[_0x6058('0xcf')]['create']({'body':_0xf1cdab,'plainBody':htmlToText['fromString'](_0xf1cdab),'ContactId':_0x5384f0['id'],'ChatWebsiteId':_0x582a57['id']});}})['then'](function(_0xae4061){_0x426a96=_0xae4061;if(_0x539681[_0x6058('0x3f')]){var _0x3b36d7=_0x539681[_0x6058('0x34')](function(_0x5c4bf5){return{'name':_0x5c4bf5['originalname'],'basename':_0x5c4bf5[_0x6058('0x67')],'type':_0x5c4bf5[_0x6058('0xd0')],'ChatOfflineMessageId':_0xae4061['id']};});_0x3f9199=_0x3b36d7['map'](_0xb73ce0=>{var _0x38af2d={'filename':_0xb73ce0[_0x6058('0x30')],'path':path[_0x6058('0x72')](config[_0x6058('0x6b')],_0x6058('0xd1'),_0x6058('0xc2'),_0x6058('0xd2'),_0x6058('0xd3'),_0xb73ce0[_0x6058('0xd4')])};return _0x38af2d;});if(!_0x582a57['openNewInteraction']){return db[_0x6058('0xd5')][_0x6058('0xd6')](function(_0x30c6eb){return db['Attachment'][_0x6058('0xd7')](_0x3b36d7,{'transaction':_0x30c6eb});});}}})['then'](function(){if(_0x426a96){_0x59542a=_0x426a96;return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x6058('0xd8')],'as':_0x6058('0xd9'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x6058('0xda'),'raw':!![]}]}]});}})[_0x6058('0x17')](function(_0xaebce1){if(_0xaebce1&&_0xaebce1[_0x6058('0xd9')]&&_0x582a57[_0x6058('0xdb')]&&_0x582a57[_0x6058('0xdc')]){var _0x549ede=_0xaebce1['getSmtpOptions']();return respondWithRpcPromise(_0x6058('0xdd'),_0x6058('0xde'),{'account':_0x549ede,'message':{'from':util[_0x6058('0xa4')](_0x6058('0xdf'),_0xaebce1[_0x6058('0x30')],_0xaebce1[_0x6058('0xe0')]||_0xaebce1[_0x6058('0xd9')][_0x6058('0x55')]),'to':_0x582a57[_0x6058('0xdc')],'subject':_0x582a57['offlineMessageSubject'],'html':_0x59542a['body'],'attachments':_0x3f9199}},client9003)[_0x6058('0x17')](function(){return _0x59542a;})[_0x6058('0x50')](function(_0xd842a0){logger[_0x6058('0x1b')](_0xd842a0);});}})[_0x6058('0x17')](function(){if(_0x582a57&&_0x582a57['openNewInteraction']&&_0x582a57[_0x6058('0xe1')]){var _0x7979cf=[];if(_0x539681['length']){_0x7979cf=_0x539681['map'](function(_0x25e130){return{'name':_0x25e130[_0x6058('0xe2')],'basename':_0x25e130['filename'],'type':_0x25e130['mimetype'],'ChatOfflineMessageId':_0x426a96['id']};});}var _0x54cb60;if(!_[_0x6058('0x70')](_0x582a57[_0x6058('0xe3')])){var _0x1e1570=_[_0x6058('0x34')](_0x30f993['body'],function(_0x146b21){return _0x146b21;});var _0x3d8d93=_[_0x6058('0xe4')](_0x1e1570)[0x0];var _0x2272b0=_[_0x6058('0xe5')](_0x3d8d93,function(_0x233db6){return _0x233db6;});_0x54cb60=_0x2272b0[0x1][_0x582a57[_0x6058('0xe3')]];}var _0x4d8795={'from':_0x2b4a41[_0x6058('0xe0')],'firstName':_0x2b4a41[_0x6058('0x9e')],'lastName':_0x2b4a41[_0x6058('0x9f')],'mapKey':_0x6058('0xe0'),'message':{'from':_0x2b4a41['email'],'to':_0x582a57['MailAccount'][_0x6058('0xe0')],'cc':'','subject':_[_0x6058('0x70')](_0x54cb60)?_0x582a57['offlineMessageSubject']:_0x54cb60,'messageId':'','sentAt':new Date(),'attach':_0x7979cf[_0x6058('0x3f')],'attachments':_0x7979cf,'originChannel':_0x6058('0xe6'),'ChatWebsiteId':_0x582a57['id'],'ChatOfflineMessageId':_0x59542a['id'],'originTo':_0x582a57[_0x6058('0xc8')]['email']},'body':_0x59542a[_0x6058('0x52')]};var _0x45d9ef={'account':{'id':_0x582a57[_0x6058('0xe1')]},'body':_0x4d8795,'log':_0x6058('0xe7')};return respondWithRpcPromise(_0x6058('0xe7'),_0x6058('0xe8'),_0x45d9ef,client9001)[_0x6058('0x17')](function(){return _0x59542a;})['catch'](function(_0x2b0771){logger[_0x6058('0x1b')](_0x2b0771);});}return;})[_0x6058('0x17')](function(){if(_0x59542a){return _0x59542a;}})['then'](respondWithResult(_0x1224a9,null))[_0x6058('0x50')](function(_0x2e07f7){logger[_0x6058('0x1b')](_0x6058('0x50'),_0x2e07f7);for(var _0x5ed092 of _0x539681){var _0x4fefff=path[_0x6058('0x72')](config[_0x6058('0x6b')],'server',_0x6058('0xc2'),_0x6058('0xd2'),_0x6058('0xd3'),_0x5ed092[_0x6058('0x67')]);fs_extra[_0x6058('0xe9')](_0x4fefff)[_0x6058('0x50')](function(_0x273283){logger[_0x6058('0x1b')]('Could\x20not\x20remove\x20attachment\x20file',_0x4fefff,_0x273283);});}});};exports[_0x6058('0xea')]=function(_0x2ebd04,_0x4456d1){return db[_0x6058('0xab')][_0x6058('0x4f')]({'where':{'id':_0x2ebd04[_0x6058('0x4e')]['id']}})[_0x6058('0x17')](handleEntityNotFound(_0x4456d1,null))[_0x6058('0x17')](function(_0x2a7c90){if(_0x2a7c90){return _0x2a7c90[_0x6058('0xea')](_0x2ebd04['body']['ids'],_[_0x6058('0xeb')](_0x2ebd04['body'],[_0x6058('0x65'),'id'])||{});}})[_0x6058('0x17')](respondWithResult(_0x4456d1,null))['catch'](handleError(_0x4456d1,null));};exports[_0x6058('0xec')]=function(_0x59b4d0,_0x405965){var _0x1a01e6={'raw':![],'where':{}};var _0x42e304={};var _0x257c9c={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x6058('0x5d')]({'where':{'id':_0x59b4d0[_0x6058('0x4e')]['id']}})[_0x6058('0x17')](handleEntityNotFound(_0x405965,null))[_0x6058('0x17')](function(_0x218013){if(_0x218013){_0x42e304[_0x6058('0x3c')]=_[_0x6058('0x39')](db['ChatInteraction'][_0x6058('0x35')]);_0x42e304[_0x6058('0x38')]=_[_0x6058('0x39')](_0x59b4d0[_0x6058('0x38')]);_0x42e304[_0x6058('0x3a')]=_[_0x6058('0x3b')](_0x42e304[_0x6058('0x3c')],_0x42e304['query']);_0x1a01e6[_0x6058('0x3d')]=_[_0x6058('0x3b')](_0x42e304['model'],qs[_0x6058('0x3e')](_0x59b4d0[_0x6058('0x38')][_0x6058('0x3e')]));_0x1a01e6[_0x6058('0x3d')]=_0x1a01e6[_0x6058('0x3d')][_0x6058('0x3f')]?_0x1a01e6[_0x6058('0x3d')]:_0x42e304[_0x6058('0x3c')];if(!_0x59b4d0[_0x6058('0x38')][_0x6058('0x40')](_0x6058('0x41'))){_0x1a01e6['limit']=qs['limit'](_0x59b4d0[_0x6058('0x38')]['limit']);_0x1a01e6[_0x6058('0x23')]=qs['offset'](_0x59b4d0[_0x6058('0x38')][_0x6058('0x23')]);}_0x1a01e6[_0x6058('0x42')]=qs['sort'](_0x59b4d0[_0x6058('0x38')][_0x6058('0x43')]);_0x1a01e6['where']=qs[_0x6058('0x3a')](_[_0x6058('0x45')](_0x59b4d0['query'],_0x42e304[_0x6058('0x3a')]));_0x1a01e6[_0x6058('0x44')][_0x6058('0x5c')]=_0x218013['id'];if(_0x59b4d0[_0x6058('0x38')][_0x6058('0x48')]){_0x1a01e6['where']=_[_0x6058('0x46')](_0x1a01e6['where'],{'$or':_[_0x6058('0x34')](_0x1a01e6['attributes'],function(_0x2ed197){var _0x39f5d8={};_0x39f5d8[_0x2ed197]={'$like':'%'+_0x59b4d0['query'][_0x6058('0x48')]+'%'};return _0x39f5d8;})});}_0x1a01e6=_[_0x6058('0x46')]({},_0x1a01e6,_0x59b4d0[_0x6058('0x5f')]);return db[_0x6058('0xab')][_0x6058('0x26')]({'where':_0x1a01e6[_0x6058('0x44')]})[_0x6058('0x17')](function(_0x379379){_0x257c9c['count']=_0x379379;if(_0x59b4d0[_0x6058('0x38')][_0x6058('0x4a')]){_0x1a01e6[_0x6058('0x4b')]=[{'model':db['CmContact'],'as':_0x6058('0xed'),'required':![]},{'model':db[_0x6058('0xee')],'as':'Owner','attributes':[_0x6058('0x30'),_0x6058('0xef'),_0x6058('0xf0')],'required':![]},{'model':db[_0x6058('0xf1')],'as':_0x6058('0xf2'),'attributes':['id',_0x6058('0x30'),_0x6058('0xf3')],'where':_0x59b4d0[_0x6058('0x38')][_0x6058('0xf4')]?{'id':_0x59b4d0[_0x6058('0x38')][_0x6058('0xf4')]}:undefined,'required':_0x59b4d0[_0x6058('0x38')][_0x6058('0xf4')]?!![]:![]}];}return db[_0x6058('0xab')]['findAll'](_0x1a01e6);})[_0x6058('0x17')](function(_0x13ba89){_0x257c9c[_0x6058('0x4d')]=_0x13ba89;return _0x257c9c;});}})[_0x6058('0x17')](respondWithFilteredResult(_0x405965,_0x1a01e6))[_0x6058('0x50')](handleError(_0x405965,null));};function iftimePromise(_0x23e9af,_0x1aaa39){return respondWithRpcPromise(_0x6058('0xf5'),'getSnippet',{'command':_0x1aaa39['timezone']?util[_0x6058('0xa4')](_0x6058('0xf6'),_0x23e9af[_0x6058('0xf7')],_0x1aaa39[_0x6058('0xf8')]):util['format'](_0x6058('0xf9'),_0x23e9af[_0x6058('0xf7')])},client9002)[_0x6058('0x17')](function(_0xc31dee){var _0x1e2c6f=_0xc31dee&&_0xc31dee[_0x6058('0xfa')](_0x6058('0xfb'))>=0x0?!![]:![];logger['info'](_0x6058('0xfc'),_0x1aaa39['id'],_0x23e9af['id'],_0x23e9af['interval'],_0x1e2c6f?_0x6058('0xfd'):_0x6058('0xfe'),_0x1aaa39[_0x6058('0xf8')]?_0x1aaa39[_0x6058('0xf8')]:_0x6058('0xff'));return _0x1e2c6f;})['catch'](function(_0x4f9197){logger[_0x6058('0x1b')](_0x6058('0xfc'),_0x1aaa39['id'],_0x23e9af['id'],_0x23e9af[_0x6058('0xf7')],util[_0x6058('0x100')](_0x4f9197,{'showHidden':![],'depth':null}),_0x1aaa39[_0x6058('0xf8')]?_0x1aaa39['timezone']:_0x6058('0xff'));return![];});}exports[_0x6058('0x101')]=function(_0x261d24,_0x99f11b){var _0x51d715=0x0;var _0x488ffc=0x0;var _0x3c28cc=![];var _0x2e3c17;var _0x16a1ac;return db['ChatWebsite']['find']({'where':{'id':_0x261d24[_0x6058('0x4e')]['id']},'include':[{'model':db[_0x6058('0x102')],'as':'Interval','include':[{'model':db[_0x6058('0x102')],'as':_0x6058('0x103'),'attributes':['id',_0x6058('0xf7')],'raw':!![]}]}]})[_0x6058('0x17')](handleEntityNotFound(_0x99f11b,null))[_0x6058('0x17')](function(_0x4be8c3){if(_0x4be8c3){_0x2e3c17=_0x4be8c3;return _0x4be8c3[_0x6058('0x104')]({'raw':!![]});}})[_0x6058('0x17')](function(_0xed9dc6){if(_0x2e3c17){if(_0xed9dc6){_0x16a1ac=_0xed9dc6;}}return require(_0x6058('0x6e'))[_0x6058('0x105')]();})['then'](function(_0x34a566){if(_0x34a566){_0x488ffc=_0x34a566['virtual'];_0x3c28cc=_0x34a566[_0x6058('0x6f')];}})[_0x6058('0x17')](function(){return db[_0x6058('0xab')][_0x6058('0x26')]({'where':{'closed':![]}});})[_0x6058('0x17')](function(_0x15d2c2){_0x51d715=_0x15d2c2;if(_0x488ffc&&_0x15d2c2>_0x488ffc){return db[_0x6058('0x106')][_0x6058('0x5d')]({'where':{'id':0x1}})['then'](function(_0x3987c4){if(_0x3987c4){_0x3987c4[_0x6058('0x107')](_0x6058('0x108'));}});}})[_0x6058('0x17')](function(){if(_0x2e3c17[_0x6058('0x102')]&&_0x2e3c17[_0x6058('0x102')][_0x6058('0x103')]){var _0x573f6d=[];for(var _0x2cd727=0x0;_0x2cd727<_0x2e3c17['Interval'][_0x6058('0x103')][_0x6058('0x3f')];_0x2cd727++){var _0x53c1cc=_0x2e3c17[_0x6058('0x102')][_0x6058('0x103')][_0x2cd727]['get']({'plain':!![]});_0x573f6d[_0x6058('0xb3')](iftimePromise(_0x53c1cc,_0x2e3c17));}return BPromise[_0x6058('0x109')](_0x573f6d)['then'](function(_0x13c4fd){return _[_0x6058('0x10a')](_0x13c4fd);});}else{return!![];}})[_0x6058('0x17')](function(_0x18c7dc){var _0x337441=fs[_0x6058('0xca')](path[_0x6058('0x72')](config[_0x6058('0x6b')],_0x6058('0x10b')),_0x6058('0xcb'));var _0x58c69e=new url[(_0x6058('0x10c'))](_0x2e3c17[_0x6058('0x10d')])[_0x6058('0x10e')];var _0x53776d=_0x6058('0x10f');var _0x52c31b=![];var _0x274ea9={'chatVersion':_0x53776d,'chatWebsiteAddressOrigin':_0x58c69e,'remote':_0x2e3c17[_0x6058('0x110')],'query':querystring[_0x6058('0xa9')](_[_0x6058('0x46')](_0x2e3c17['get']({'plain':!![]}),{'customerIp':_0x261d24[_0x6058('0x7f')]['x-forwarded-for']||_0x261d24[_0x6058('0x7f')][_0x6058('0x111')]||_0x261d24[_0x6058('0x112')][_0x6058('0x113')]||_0x261d24['ip'],'referer':_0x261d24['headers'][_0x6058('0xa1')],'openedInteractions':_0x51d715,'maxInteractions':_0x488ffc,'virtual':_0x3c28cc[_0x6058('0x114')],'online':_0x18c7dc,'custom':_0x3c28cc}))['replace'](/'/g,'\x5c\x27')};_0x99f11b[_0x6058('0xc4')](ejs[_0x6058('0xcc')](Mustache[_0x6058('0xcc')](_0x337441,_0x274ea9),{'proactiveActions':_0x16a1ac,'alignment':_0x2e3c17[_0x6058('0x115')],'verticalAlignment':_0x2e3c17['verticalAlignment'],'div_color':_0x2e3c17[_0x6058('0xf3')],'labelText':_0x2e3c17['labelText'],'text_color':_0x2e3c17[_0x6058('0x116')],'text_button_color':_0x2e3c17[_0x6058('0x117')],'button_color':_0x2e3c17[_0x6058('0x118')],'background_color':_0x2e3c17['backgroundColor'],'hideWhenOffline':_0x2e3c17[_0x6058('0x119')],'intervalId':_0x2e3c17[_0x6058('0x11a')],'isDevelopment':_0x52c31b,'chatVersion':_0x53776d}));})[_0x6058('0x50')](handleError(_0x99f11b,null));};exports[_0x6058('0x11b')]=function(_0x6f6148,_0x44ce10){var _0xf634e4=_0x6f6148[_0x6058('0x4e')]['id'];var _0xf295c0=_0x6f6148[_0x6058('0x52')];var _0x13dc7e=0xc8;var _0x3aed23=null;return db['sequelize'][_0x6058('0xd6')]({'isolationLevel':db['sequelize']['Transaction'][_0x6058('0x11c')][_0x6058('0x11d')]},function(_0x473877){return db['ChatWebsite'][_0x6058('0x5d')]({'where':{'id':_0xf634e4},'transaction':_0x473877})['then'](function(_0xc54ae5){if(_0xc54ae5){return db[_0x6058('0x11e')][_0x6058('0x2a')]({'where':{'ChatWebsiteId':_0xf634e4},'transaction':_0x473877})[_0x6058('0x17')](function(){var _0x3a50cb=_[_0x6058('0x34')](_0xf295c0,function(_0x53c34e){_0x53c34e['ChatWebsiteId']=_0xf634e4;return _0x53c34e;});return db[_0x6058('0x11e')][_0x6058('0xd7')](_0x3a50cb,{'transaction':_0x473877});});}else{_0x13dc7e=0x194;_0x3aed23=[];}});})[_0x6058('0x17')](function(){if(_0x13dc7e!==0x194){return db[_0x6058('0x11e')][_0x6058('0x11f')]({'where':{'ChatWebsiteId':_0xf634e4},'order':_0x6058('0x120')})[_0x6058('0x17')](function(_0x1d7c4a){_0x3aed23=_0x1d7c4a;});}})[_0x6058('0x50')](function(_0x4a6fff){_0x13dc7e=0x1f4;logger[_0x6058('0x1b')](_0x4a6fff[_0x6058('0x2f')]);if(_0x4a6fff[_0x6058('0x30')]){delete _0x4a6fff[_0x6058('0x30')];}_0x3aed23=_0x4a6fff;})[_0x6058('0x121')](function(){if(_0x3aed23===null){_0x44ce10[_0x6058('0x20')](_0x13dc7e);}else{if(_0x13dc7e===0x1f4){_0x44ce10['status'](_0x13dc7e)['send'](_0x3aed23);}else{_0x44ce10[_0x6058('0x21')](_0x13dc7e)[_0x6058('0x22')](_0x3aed23);}}});};exports['getApplications']=function(_0x5133e9,_0x1b6182){var _0x52aec9={};var _0x551a80={};var _0x56c582;var _0x410648;return db[_0x6058('0x49')]['findOne']({'where':{'id':_0x5133e9[_0x6058('0x4e')]['id']}})[_0x6058('0x17')](handleEntityNotFound(_0x1b6182,null))['then'](function(_0x4c85f7){if(_0x4c85f7){_0x56c582=_0x4c85f7;_0x551a80['model']=_[_0x6058('0x39')](db['ChatApplication']['rawAttributes']);_0x551a80[_0x6058('0x38')]=_[_0x6058('0x39')](_0x5133e9[_0x6058('0x38')]);_0x551a80[_0x6058('0x3a')]=_[_0x6058('0x3b')](_0x551a80[_0x6058('0x3c')],_0x551a80[_0x6058('0x38')]);_0x52aec9[_0x6058('0x3d')]=_['intersection'](_0x551a80['model'],qs[_0x6058('0x3e')](_0x5133e9[_0x6058('0x38')][_0x6058('0x3e')]));_0x52aec9[_0x6058('0x3d')]=_0x52aec9['attributes'][_0x6058('0x3f')]?_0x52aec9[_0x6058('0x3d')]:_0x551a80[_0x6058('0x3c')];_0x52aec9[_0x6058('0x42')]=qs['sort'](_0x5133e9['query'][_0x6058('0x43')]);_0x52aec9[_0x6058('0x44')]=qs[_0x6058('0x3a')](_['pick'](_0x5133e9[_0x6058('0x38')],_0x551a80[_0x6058('0x3a')]));if(_0x5133e9[_0x6058('0x38')][_0x6058('0x48')]){_0x52aec9[_0x6058('0x44')]=_[_0x6058('0x46')](_0x52aec9['where'],{'$or':_[_0x6058('0x34')](_0x52aec9[_0x6058('0x3d')],function(_0xb8a2d6){var _0x22832f={};_0x22832f[_0xb8a2d6]={'$like':'%'+_0x5133e9[_0x6058('0x38')][_0x6058('0x48')]+'%'};return _0x22832f;})});}_0x52aec9=_[_0x6058('0x46')]({},_0x52aec9,_0x5133e9[_0x6058('0x5f')]);return _0x56c582[_0x6058('0x122')](_0x52aec9);}})[_0x6058('0x17')](function(_0xd9038){if(_0xd9038){_0x410648=_0xd9038[_0x6058('0x3f')];if(!_0x5133e9['query'][_0x6058('0x40')]('nolimit')){_0x52aec9[_0x6058('0x24')]=qs['limit'](_0x5133e9['query'][_0x6058('0x24')]);_0x52aec9[_0x6058('0x23')]=qs['offset'](_0x5133e9[_0x6058('0x38')][_0x6058('0x23')]);}return _0x56c582[_0x6058('0x122')](_0x52aec9);}})[_0x6058('0x17')](function(_0x2ef82c){if(_0x2ef82c){return _0x2ef82c?{'count':_0x410648,'rows':_0x2ef82c}:null;}})[_0x6058('0x17')](respondWithResult(_0x1b6182,null))[_0x6058('0x50')](handleError(_0x1b6182,null));};exports[_0x6058('0x123')]=function(_0x284ca5,_0x291ef2){return db[_0x6058('0x124')]['find']({'where':{'id':_0x284ca5[_0x6058('0x4e')]['id']}})['then'](handleEntityNotFound(_0x291ef2,null))[_0x6058('0x17')](function(_0x50a447){if(_0x50a447){return _0x50a447[_0x6058('0x123')](_0x284ca5[_0x6058('0x52')][_0x6058('0x65')],_[_0x6058('0xeb')](_0x284ca5[_0x6058('0x52')],['ids','id'])||{});}})[_0x6058('0x17')](respondWithResult(_0x291ef2,null))[_0x6058('0x50')](handleError(_0x291ef2,null));};exports[_0x6058('0x104')]=function(_0x4000c3,_0x10ac7d){var _0x4721b9={};var _0x4089ba={};var _0x13aefa;var _0x390425;return db[_0x6058('0x49')]['findOne']({'where':{'id':_0x4000c3[_0x6058('0x4e')]['id']}})['then'](handleEntityNotFound(_0x10ac7d,null))[_0x6058('0x17')](function(_0x2f736b){if(_0x2f736b){_0x13aefa=_0x2f736b;_0x4089ba[_0x6058('0x3c')]=_[_0x6058('0x39')](db[_0x6058('0x125')][_0x6058('0x35')]);_0x4089ba['query']=_[_0x6058('0x39')](_0x4000c3['query']);_0x4089ba[_0x6058('0x3a')]=_[_0x6058('0x3b')](_0x4089ba[_0x6058('0x3c')],_0x4089ba['query']);_0x4721b9[_0x6058('0x3d')]=_[_0x6058('0x3b')](_0x4089ba['model'],qs[_0x6058('0x3e')](_0x4000c3[_0x6058('0x38')][_0x6058('0x3e')]));_0x4721b9[_0x6058('0x3d')]=_0x4721b9[_0x6058('0x3d')][_0x6058('0x3f')]?_0x4721b9['attributes']:_0x4089ba['model'];_0x4721b9[_0x6058('0x42')]=qs[_0x6058('0x43')](_0x4000c3[_0x6058('0x38')][_0x6058('0x43')]);_0x4721b9[_0x6058('0x44')]=qs['filters'](_[_0x6058('0x45')](_0x4000c3['query'],_0x4089ba[_0x6058('0x3a')]));if(_0x4000c3[_0x6058('0x38')][_0x6058('0x48')]){_0x4721b9[_0x6058('0x44')]=_['merge'](_0x4721b9[_0x6058('0x44')],{'$or':_['map'](_0x4721b9[_0x6058('0x3d')],function(_0x41c014){var _0x2e3db2={};_0x2e3db2[_0x41c014]={'$like':'%'+_0x4000c3['query'][_0x6058('0x48')]+'%'};return _0x2e3db2;})});}_0x4721b9=_[_0x6058('0x46')]({},_0x4721b9,_0x4000c3[_0x6058('0x5f')]);return _0x13aefa[_0x6058('0x104')](_0x4721b9);}})['then'](function(_0x5a059b){if(_0x5a059b){_0x390425=_0x5a059b[_0x6058('0x3f')];if(!_0x4000c3[_0x6058('0x38')][_0x6058('0x40')]('nolimit')){_0x4721b9[_0x6058('0x24')]=qs[_0x6058('0x24')](_0x4000c3[_0x6058('0x38')][_0x6058('0x24')]);_0x4721b9[_0x6058('0x23')]=qs[_0x6058('0x23')](_0x4000c3[_0x6058('0x38')][_0x6058('0x23')]);}return _0x13aefa['getProactiveActions'](_0x4721b9);}})[_0x6058('0x17')](function(_0x58ff4c){if(_0x58ff4c){return _0x58ff4c?{'count':_0x390425,'rows':_0x58ff4c}:null;}})[_0x6058('0x17')](respondWithResult(_0x10ac7d,null))[_0x6058('0x50')](handleError(_0x10ac7d,null));};exports[_0x6058('0x126')]=function(_0x527039,_0x71d1ef){var _0x3a2b0b=_0x527039[_0x6058('0x38')][_0x6058('0x127')]===_0x6058('0x128')?_0x6058('0x129'):_0x6058('0x12a');return db['ChatWebsite'][_0x6058('0x4f')]({'attributes':['id',_0x3a2b0b],'where':{'id':_0x527039['params']['id']}})['then'](handleEntityNotFound(_0x71d1ef,null))[_0x6058('0x17')](function(_0x48be4d){if(_0x48be4d){var _0x2fc690=_0x48be4d[_0x3a2b0b];var _0x1bd00b=_0x2fc690&&_0x2fc690[_0x6058('0x12b')]?_0x2fc690[_0x6058('0x12b')]:[];_0x71d1ef[_0x6058('0xc4')]({'fromKey':_[_0x6058('0x70')](_0x2fc690[_0x6058('0x12c')])?undefined:_0x2fc690[_0x6058('0x12c')],'count':_0x1bd00b['length'],'rows':_0x1bd00b});}})['catch'](handleError(_0x71d1ef,null));};exports['getOfflineMessages']=function(_0x2f63a9,_0x5e0217){var _0x5e8ec8={'raw':![],'where':{}};var _0x674b69={};var _0x3beb67={'count':0x0,'rows':[]};return db[_0x6058('0x49')][_0x6058('0x5d')]({'where':{'id':_0x2f63a9[_0x6058('0x4e')]['id']}})[_0x6058('0x17')](handleEntityNotFound(_0x5e0217,null))[_0x6058('0x17')](function(_0x3e4169){if(_0x3e4169){_0x674b69[_0x6058('0x3c')]=_[_0x6058('0x39')](db[_0x6058('0xcf')][_0x6058('0x35')]);_0x674b69[_0x6058('0x38')]=_[_0x6058('0x39')](_0x2f63a9[_0x6058('0x38')]);_0x674b69[_0x6058('0x3a')]=_[_0x6058('0x3b')](_0x674b69[_0x6058('0x3c')],_0x674b69[_0x6058('0x38')]);_0x5e8ec8[_0x6058('0x3d')]=_[_0x6058('0x3b')](_0x674b69[_0x6058('0x3c')],qs['fields'](_0x2f63a9[_0x6058('0x38')][_0x6058('0x3e')]));_0x5e8ec8['attributes']=_0x5e8ec8[_0x6058('0x3d')][_0x6058('0x3f')]?_0x5e8ec8['attributes']:_0x674b69['model'];if(!_0x2f63a9[_0x6058('0x38')][_0x6058('0x40')](_0x6058('0x41'))){_0x5e8ec8[_0x6058('0x24')]=qs[_0x6058('0x24')](_0x2f63a9[_0x6058('0x38')][_0x6058('0x24')]);_0x5e8ec8[_0x6058('0x23')]=qs[_0x6058('0x23')](_0x2f63a9[_0x6058('0x38')][_0x6058('0x23')]);}_0x5e8ec8[_0x6058('0x42')]=qs['sort'](_0x2f63a9[_0x6058('0x38')][_0x6058('0x43')]);_0x5e8ec8[_0x6058('0x44')]=qs[_0x6058('0x3a')](_[_0x6058('0x45')](_0x2f63a9[_0x6058('0x38')],_0x674b69[_0x6058('0x3a')]));_0x5e8ec8[_0x6058('0x44')][_0x6058('0x5c')]=_0x3e4169['id'];if(_0x2f63a9[_0x6058('0x38')][_0x6058('0x48')]){_0x5e8ec8['where']=_['merge'](_0x5e8ec8['where'],{'$or':_[_0x6058('0x34')](_0x5e8ec8[_0x6058('0x3d')],function(_0x51d460){var _0x406c16={};_0x406c16[_0x51d460]={'$like':'%'+_0x2f63a9[_0x6058('0x38')][_0x6058('0x48')]+'%'};return _0x406c16;})});}_0x5e8ec8=_[_0x6058('0x46')]({},_0x5e8ec8,_0x2f63a9[_0x6058('0x5f')]);return db['ChatOfflineMessage'][_0x6058('0x26')]({'where':_0x5e8ec8['where']})['then'](function(_0x5779ed){_0x3beb67[_0x6058('0x26')]=_0x5779ed;if(_0x2f63a9[_0x6058('0x38')][_0x6058('0x4a')]){_0x5e8ec8[_0x6058('0x4b')]=[{'all':!![]}];}else{_0x5e8ec8['include']=[{'model':db[_0x6058('0x92')],'as':'Contact','required':![]},{'model':db[_0x6058('0x12d')],'as':_0x6058('0x12e'),'required':![]}];}return db[_0x6058('0xcf')][_0x6058('0x4c')](_0x5e8ec8);})[_0x6058('0x17')](function(_0x396428){_0x3beb67[_0x6058('0x4d')]=_0x396428;return _0x3beb67;});}})[_0x6058('0x17')](respondWithFilteredResult(_0x5e0217,_0x5e8ec8))[_0x6058('0x50')](handleError(_0x5e0217,null));};exports['addAgents']=function(_0x1a7e81,_0x518bae){return db[_0x6058('0x49')]['find']({'where':{'id':_0x1a7e81[_0x6058('0x4e')]['id']}})[_0x6058('0x17')](handleEntityNotFound(_0x518bae,null))['then'](function(_0x1fe1da){if(_0x1fe1da){return _0x1fe1da[_0x6058('0x12f')](_0x1a7e81[_0x6058('0x52')][_0x6058('0x65')],_['omit'](_0x1a7e81['body'],[_0x6058('0x65'),'id'])||{})[_0x6058('0xaf')](function(_0x5df250){for(var _0x36da13=0x0;_0x36da13<_0x1a7e81[_0x6058('0x52')][_0x6058('0x65')][_0x6058('0x3f')];_0x36da13+=0x1){socket[_0x6058('0x130')](_0x6058('0x131'),{'UserId':Number(_0x1a7e81[_0x6058('0x52')][_0x6058('0x65')][_0x36da13]),'ChatWebsiteId':Number(_0x1a7e81[_0x6058('0x4e')]['id'])});}return _0x5df250;});}})[_0x6058('0x17')](respondWithResult(_0x518bae,null))[_0x6058('0x50')](handleError(_0x518bae,null));};exports[_0x6058('0x132')]=function(_0x51e7a5,_0x593d89){return db['ChatWebsite'][_0x6058('0x4f')]({'where':{'id':_0x51e7a5[_0x6058('0x4e')]['id']}})[_0x6058('0x17')](handleEntityNotFound(_0x593d89,null))['then'](function(_0x44ede4){if(_0x44ede4){return _0x44ede4[_0x6058('0x132')](_0x51e7a5['query'][_0x6058('0x65')])[_0x6058('0x17')](function(){if(_[_0x6058('0x133')](_0x51e7a5[_0x6058('0x38')][_0x6058('0x65')])){for(var _0x1b6d02=0x0;_0x1b6d02<_0x51e7a5[_0x6058('0x38')][_0x6058('0x65')][_0x6058('0x3f')];_0x1b6d02+=0x1){socket['emit'](_0x6058('0x134'),{'UserId':Number(_0x51e7a5[_0x6058('0x38')][_0x6058('0x65')][_0x1b6d02]),'ChatWebsiteId':Number(_0x51e7a5[_0x6058('0x4e')]['id'])});}}else{socket[_0x6058('0x130')](_0x6058('0x134'),{'UserId':Number(_0x51e7a5[_0x6058('0x38')][_0x6058('0x65')]),'ChatWebsiteId':Number(_0x51e7a5[_0x6058('0x4e')]['id'])});}});}})[_0x6058('0x17')](respondWithStatusCode(_0x593d89,null))[_0x6058('0x50')](handleError(_0x593d89,null));};exports[_0x6058('0x135')]=function(_0x3e2e03,_0x405c21){var _0x19050c={};var _0x167eec={};var _0x52c618;var _0x5379b0;return db[_0x6058('0x49')][_0x6058('0x5d')]({'where':{'id':_0x3e2e03[_0x6058('0x4e')]['id']}})['then'](handleEntityNotFound(_0x405c21,null))[_0x6058('0x17')](function(_0x2c7be9){if(_0x2c7be9){_0x52c618=_0x2c7be9;_0x167eec['model']=_[_0x6058('0x39')](db[_0x6058('0xee')][_0x6058('0x35')]);_0x167eec['query']=_[_0x6058('0x39')](_0x3e2e03[_0x6058('0x38')]);_0x167eec[_0x6058('0x3a')]=_[_0x6058('0x3b')](_0x167eec[_0x6058('0x3c')],_0x167eec[_0x6058('0x38')]);_0x19050c[_0x6058('0x3d')]=_['intersection'](_0x167eec[_0x6058('0x3c')],qs['fields'](_0x3e2e03[_0x6058('0x38')][_0x6058('0x3e')]));_0x19050c[_0x6058('0x3d')]=_0x19050c[_0x6058('0x3d')]['length']?_0x19050c[_0x6058('0x3d')]:_0x167eec[_0x6058('0x3c')];_0x19050c[_0x6058('0x42')]=qs[_0x6058('0x43')](_0x3e2e03[_0x6058('0x38')]['sort']);_0x19050c[_0x6058('0x44')]=qs[_0x6058('0x3a')](_[_0x6058('0x45')](_0x3e2e03[_0x6058('0x38')],_0x167eec[_0x6058('0x3a')]));if(_0x3e2e03[_0x6058('0x38')][_0x6058('0x48')]){_0x19050c[_0x6058('0x44')]=_['merge'](_0x19050c[_0x6058('0x44')],{'$or':_['map'](_0x19050c[_0x6058('0x3d')],function(_0x9329b3){var _0x5f14ec={};_0x5f14ec[_0x9329b3]={'$like':'%'+_0x3e2e03[_0x6058('0x38')][_0x6058('0x48')]+'%'};return _0x5f14ec;})});}_0x19050c=_['merge']({},_0x19050c,_0x3e2e03[_0x6058('0x5f')]);return _0x52c618[_0x6058('0x135')](_0x19050c);}})[_0x6058('0x17')](function(_0xfd9991){if(_0xfd9991){_0x5379b0=_0xfd9991[_0x6058('0x3f')];if(!_0x3e2e03[_0x6058('0x38')]['hasOwnProperty'](_0x6058('0x41'))){_0x19050c[_0x6058('0x24')]=qs['limit'](_0x3e2e03[_0x6058('0x38')]['limit']);_0x19050c[_0x6058('0x23')]=qs['offset'](_0x3e2e03[_0x6058('0x38')][_0x6058('0x23')]);}return _0x52c618['getAgents'](_0x19050c);}})['then'](function(_0x2ecca9){if(_0x2ecca9){return _0x2ecca9?{'count':_0x5379b0,'rows':_0x2ecca9}:null;}})[_0x6058('0x17')](respondWithResult(_0x405c21,null))[_0x6058('0x50')](handleError(_0x405c21,null));};
\ No newline at end of file
+var _0xcedc=['UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','ChatWebsiteId','getDispositions','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','rows','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','custom','isNil','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','showCustomerAvatar','customerAvatar','notify','setUA','headers','user-agent','getResult','chat','Sequelize','difference','createdAt','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','ValidationError','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','List','CmContact','Contacts','updatedAt','DESC','Applications','account','applications','list','orderBy','priority','asc','ListId','contact','customerIp','cf-connecting-ip','x-forwarded-for','split','firstName','lastName','x-real-port','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','push','close','ChatMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','offline','files','no\x20available\x20attributes','CompanyId','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','fromString','originalname','mimetype','server','attachments','offline-chat','basename','sequelize','transaction','Attachment','bulkCreate','findOne','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','email','offlineMessageSubject','MailAccountId','mapValues','subjectOffline','Chat','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Owner','fullname','internal','Tags','color','tag','Command','timezone','iftime\x20%s,%s','interval','iftime\x20%s','true','info','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','getSnippet','Interval','Intervals','getProactiveActions','getLicense','virtual','License','all','some','server/files/chat/iframe.ejs','address','3.1.0','connection','remoteAddress','referer','replace','render','alignment','verticalAlignment','textColor','color_button','backgroundColor','hideWhenOffline','addApplications','Transaction','READ_COMMITTED','ChatApplication','findAndCountAll','finally','getApplications','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Contact','Attachments','addAgents','emit','userChatWebsite:save','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','url','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','client','http','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','limit','undefined','count','offset','update','destroy','get','ChatWebsites','stack','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','includeAll','include','findAll','show','params','options','find','create','user'];(function(_0x25ac0f,_0x3e73a3){var _0x2269ef=function(_0x500298){while(--_0x500298){_0x25ac0f['push'](_0x25ac0f['shift']());}};_0x2269ef(++_0x3e73a3);}(_0xcedc,0xd8));var _0xcced=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcedc[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0xcced('0x0'));var Mustache=require(_0xcced('0x1'));var util=require(_0xcced('0x2'));var path=require(_0xcced('0x3'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcced('0x4'));var _=require(_0xcced('0x5'));var querystring=require(_0xcced('0x6'));var Redis=require(_0xcced('0x7'));var qs=require(_0xcced('0x8'));var logger=require(_0xcced('0x9'))('api');var config=require(_0xcced('0xa'));var url=require(_0xcced('0xb'));var db=require('../../mysqldb')['db'];config[_0xcced('0xc')]=_[_0xcced('0xd')](config[_0xcced('0xc')],{'host':_0xcced('0xe'),'port':0x18eb});var socket=require(_0xcced('0xf'))(new Redis(config[_0xcced('0xc')]));require(_0xcced('0x10'))[_0xcced('0x11')](socket);var htmlToText=require(_0xcced('0x12'));var jayson=require('jayson/promise');var client=jayson[_0xcced('0x13')][_0xcced('0x14')]({'port':0x232c});var client9002=jayson[_0xcced('0x13')][_0xcced('0x14')]({'port':0x232a});var client9003=jayson[_0xcced('0x13')]['http']({'port':0x232b});var client9001=jayson['client'][_0xcced('0x14')]({'port':0x2329});function respondWithRpcPromise(_0x338705,_0x2d2f4b,_0x5b15d7,_0x315c65){return new BPromise(function(_0x3afab5,_0x4e5aa0){var _0x3e7ed0=_0x315c65||client;return _0x3e7ed0['request'](_0x338705,_0x5b15d7)[_0xcced('0x15')](function(_0x542965){logger['info'](_0xcced('0x16'),_0x2d2f4b,_0xcced('0x17'));logger['debug'](_0xcced('0x18'),_0x2d2f4b,_0xcced('0x17'),JSON[_0xcced('0x19')](_0x542965));if(_0x542965[_0xcced('0x1a')]){if(_0x542965[_0xcced('0x1a')][_0xcced('0x1b')]===0x1f4){logger[_0xcced('0x1a')](_0xcced('0x16'),_0x2d2f4b,_0x542965['error'][_0xcced('0x1c')]);return _0x4e5aa0(_0x542965[_0xcced('0x1a')]['message']);}logger[_0xcced('0x1a')](_0xcced('0x16'),_0x2d2f4b,_0x542965[_0xcced('0x1a')]['message']);return _0x3afab5(_0x542965[_0xcced('0x1a')][_0xcced('0x1c')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x2d2f4b,_0xcced('0x17'));_0x3afab5(_0x542965['result']['message']);}})[_0xcced('0x1d')](function(_0x3a88da){logger[_0xcced('0x1a')]('ChatWebsite,\x20%s,\x20%s',_0x2d2f4b,_0x3a88da);_0x4e5aa0(_0x3a88da);});});}function respondWithStatusCode(_0x36dbdf,_0xdb5c06){_0xdb5c06=_0xdb5c06||0xcc;return function(_0x58acbf){if(_0x58acbf){return _0x36dbdf[_0xcced('0x1e')](_0xdb5c06);}return _0x36dbdf[_0xcced('0x1f')](_0xdb5c06)[_0xcced('0x20')]();};}function respondWithResult(_0x4bf976,_0x4b65e0){_0x4b65e0=_0x4b65e0||0xc8;return function(_0x77182c){if(_0x77182c){return _0x4bf976[_0xcced('0x1f')](_0x4b65e0)[_0xcced('0x21')](_0x77182c);}};}function respondWithFilteredResult(_0x11add6,_0x235945){return function(_0x1198d0){if(_0x1198d0){var _0x59185c=typeof _0x235945['offset']==='undefined'&&typeof _0x235945[_0xcced('0x22')]===_0xcced('0x23');var _0x24315a=_0x1198d0[_0xcced('0x24')];var _0x832dc4=_0x59185c?0x0:_0x235945[_0xcced('0x25')];var _0x10e14e=_0x59185c?_0x1198d0[_0xcced('0x24')]:_0x235945['offset']+_0x235945[_0xcced('0x22')];var _0x101e85;if(_0x10e14e>=_0x24315a){_0x10e14e=_0x24315a;_0x101e85=0xc8;}else{_0x101e85=0xce;}_0x11add6[_0xcced('0x1f')](_0x101e85);return _0x11add6['set']('Content-Range',_0x832dc4+'-'+_0x10e14e+'/'+_0x24315a)[_0xcced('0x21')](_0x1198d0);}return null;};}function saveUpdates(_0x26b3f3){return function(_0x39032a){if(_0x39032a){return _0x39032a[_0xcced('0x26')](_0x26b3f3)['then'](function(_0x42d18a){return _0x42d18a;});}return null;};}function removeEntity(_0x526935){return function(_0x2c2df4){if(_0x2c2df4){return _0x2c2df4[_0xcced('0x27')]()[_0xcced('0x15')](function(){var _0xc010a1=_0x2c2df4[_0xcced('0x28')]({'plain':!![]});var _0x3b1a2b=_0xcced('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x3b1a2b,'resourceId':_0xc010a1['id']}})[_0xcced('0x15')](function(){return _0x2c2df4;});})['then'](function(){_0x526935['status'](0xcc)[_0xcced('0x20')]();});}};}function handleEntityNotFound(_0x372c9d){return function(_0x19bb1d){if(!_0x19bb1d){_0x372c9d['sendStatus'](0x194);}return _0x19bb1d;};}function handleError(_0x22af8e,_0xab6363){_0xab6363=_0xab6363||0x1f4;return function(_0x515989){logger[_0xcced('0x1a')](_0x515989[_0xcced('0x2a')]);if(_0x515989[_0xcced('0x2b')]){delete _0x515989[_0xcced('0x2b')];}_0x22af8e['status'](_0xab6363)[_0xcced('0x2c')](_0x515989);};}exports[_0xcced('0x2d')]=function(_0x17c101,_0x25ef31){var _0x489f31={'include':[{'model':db[_0xcced('0x2e')],'as':_0xcced('0x2f')}]},_0xcde5f1={},_0x4a9143={'count':0x0,'rows':[]};var _0x30900=_[_0xcced('0x30')](db[_0xcced('0x31')][_0xcced('0x32')],function(_0x52de0b){return{'name':_0x52de0b[_0xcced('0x33')],'type':_0x52de0b['type'][_0xcced('0x34')]};});_0xcde5f1[_0xcced('0x35')]=_['map'](_0x30900,'name');_0xcde5f1[_0xcced('0x36')]=_[_0xcced('0x37')](_0x17c101[_0xcced('0x36')]);_0xcde5f1[_0xcced('0x38')]=_[_0xcced('0x39')](_0xcde5f1[_0xcced('0x35')],_0xcde5f1[_0xcced('0x36')]);_0x489f31[_0xcced('0x3a')]=_[_0xcced('0x39')](_0xcde5f1[_0xcced('0x35')],qs[_0xcced('0x3b')](_0x17c101[_0xcced('0x36')][_0xcced('0x3b')]));_0x489f31[_0xcced('0x3a')]=_0x489f31[_0xcced('0x3a')][_0xcced('0x3c')]?_0x489f31[_0xcced('0x3a')]:_0xcde5f1[_0xcced('0x35')];if(!_0x17c101[_0xcced('0x36')][_0xcced('0x3d')](_0xcced('0x3e'))){_0x489f31['limit']=qs[_0xcced('0x22')](_0x17c101[_0xcced('0x36')][_0xcced('0x22')]);_0x489f31[_0xcced('0x25')]=qs[_0xcced('0x25')](_0x17c101[_0xcced('0x36')]['offset']);}_0x489f31[_0xcced('0x3f')]=qs[_0xcced('0x40')](_0x17c101['query'][_0xcced('0x40')]);_0x489f31[_0xcced('0x41')]=qs[_0xcced('0x38')](_[_0xcced('0x42')](_0x17c101[_0xcced('0x36')],_0xcde5f1['filters']),_0x30900);if(_0x17c101[_0xcced('0x36')][_0xcced('0x43')]){_0x489f31['where']=_['merge'](_0x489f31[_0xcced('0x41')],{'$or':_['map'](_0x30900,function(_0x84912d){if(_0x84912d[_0xcced('0x44')]!==_0xcced('0x45')){var _0x53ddad={};_0x53ddad[_0x84912d[_0xcced('0x2b')]]={'$like':'%'+_0x17c101[_0xcced('0x36')]['filter']+'%'};return _0x53ddad;}})});}_0x489f31=_[_0xcced('0x46')]({},_0x489f31,_0x17c101['options']);var _0x32d1a1={'where':_0x489f31[_0xcced('0x41')]};return db[_0xcced('0x31')]['count'](_0x32d1a1)[_0xcced('0x15')](function(_0x84dc5e){_0x4a9143['count']=_0x84dc5e;if(_0x17c101['query'][_0xcced('0x47')]){_0x489f31[_0xcced('0x48')]=[{'all':!![]}];}return db[_0xcced('0x31')][_0xcced('0x49')](_0x489f31);})['then'](function(_0x1cc32b){_0x4a9143['rows']=_0x1cc32b;return _0x4a9143;})[_0xcced('0x15')](respondWithFilteredResult(_0x25ef31,_0x489f31))['catch'](handleError(_0x25ef31,null));};exports[_0xcced('0x4a')]=function(_0x478657,_0x362227){var _0x22351d={'raw':![],'where':{'id':_0x478657[_0xcced('0x4b')]['id']},'include':[{'model':db['Pause'],'as':_0xcced('0x2f')}]},_0x302eed={};_0x302eed[_0xcced('0x35')]=_[_0xcced('0x37')](db[_0xcced('0x31')][_0xcced('0x32')]);_0x302eed[_0xcced('0x36')]=_[_0xcced('0x37')](_0x478657[_0xcced('0x36')]);_0x302eed[_0xcced('0x38')]=_[_0xcced('0x39')](_0x302eed[_0xcced('0x35')],_0x302eed['query']);_0x22351d[_0xcced('0x3a')]=_[_0xcced('0x39')](_0x302eed[_0xcced('0x35')],qs[_0xcced('0x3b')](_0x478657[_0xcced('0x36')]['fields']));_0x22351d[_0xcced('0x3a')]=_0x22351d['attributes'][_0xcced('0x3c')]?_0x22351d['attributes']:_0x302eed['model'];if(_0x478657[_0xcced('0x36')]['includeAll']){_0x22351d[_0xcced('0x48')]=[{'all':!![]}];}_0x22351d=_['merge']({},_0x22351d,_0x478657[_0xcced('0x4c')]);return db[_0xcced('0x31')][_0xcced('0x4d')](_0x22351d)['then'](handleEntityNotFound(_0x362227,null))['then'](respondWithResult(_0x362227,null))['catch'](handleError(_0x362227,null));};exports[_0xcced('0x4e')]=function(_0x1b8876,_0x4eff77){return db['ChatWebsite'][_0xcced('0x4e')](_0x1b8876['body'],{})[_0xcced('0x15')](function(_0xbaf3a7){var _0x5a44c7=_0x1b8876[_0xcced('0x4f')][_0xcced('0x28')]({'plain':!![]});if(!_0x5a44c7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a44c7['role']==='user'){var _0x2547cb=_0xbaf3a7[_0xcced('0x28')]({'plain':!![]});var _0x20f327=_0xcced('0x29');return db[_0xcced('0x50')]['find']({'where':{'name':_0x20f327,'userProfileId':_0x5a44c7['userProfileId']},'raw':!![]})[_0xcced('0x15')](function(_0x5b6915){if(_0x5b6915&&_0x5b6915['autoAssociation']===0x0){return db['UserProfileResource'][_0xcced('0x4e')]({'name':_0x2547cb[_0xcced('0x2b')],'resourceId':_0x2547cb['id'],'type':_0x5b6915[_0xcced('0x2b')],'sectionId':_0x5b6915['id']},{})['then'](function(){return _0xbaf3a7;});}else{return _0xbaf3a7;}})[_0xcced('0x1d')](function(_0x447918){logger['error'](_0xcced('0x51'),_0x447918);throw _0x447918;});}return _0xbaf3a7;})[_0xcced('0x15')](respondWithResult(_0x4eff77,0xc9))[_0xcced('0x1d')](handleError(_0x4eff77,null));};exports[_0xcced('0x26')]=function(_0x4fee8b,_0x5e596f){if(_0x4fee8b['body']['id']){delete _0x4fee8b[_0xcced('0x52')]['id'];}return db[_0xcced('0x31')][_0xcced('0x4d')]({'where':{'id':_0x4fee8b['params']['id']},'include':[{'model':db['Pause'],'as':_0xcced('0x2f')}]})[_0xcced('0x15')](handleEntityNotFound(_0x5e596f,null))[_0xcced('0x15')](saveUpdates(_0x4fee8b['body'],null))['then'](respondWithResult(_0x5e596f,null))[_0xcced('0x1d')](handleError(_0x5e596f,null));};exports[_0xcced('0x27')]=function(_0x4a6b0e,_0x84156a){return db[_0xcced('0x31')][_0xcced('0x4d')]({'where':{'id':_0x4a6b0e[_0xcced('0x4b')]['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x84156a,null))[_0xcced('0x15')](removeEntity(_0x84156a,null))[_0xcced('0x1d')](handleError(_0x84156a,null));};exports[_0xcced('0x53')]=function(_0x99d1a7,_0x484c22){return db[_0xcced('0x31')]['describe']()[_0xcced('0x15')](respondWithResult(_0x484c22,null))[_0xcced('0x1d')](handleError(_0x484c22,null));};exports['addDisposition']=function(_0x484b01,_0x16bd00){if(_0x484b01[_0xcced('0x52')]['id']){delete _0x484b01[_0xcced('0x52')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x484b01['params']['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x16bd00,null))[_0xcced('0x15')](function(_0x203810){if(_0x203810){_0x484b01[_0xcced('0x52')][_0xcced('0x54')]=_0x203810['id'];return db['Disposition']['create'](_0x484b01[_0xcced('0x52')]);}})[_0xcced('0x15')](respondWithResult(_0x16bd00,null))[_0xcced('0x1d')](handleError(_0x16bd00,null));};exports[_0xcced('0x55')]=function(_0x5baa67,_0x119b43){var _0x190901={'raw':![],'where':{}};var _0x13ff3b={};var _0x259849={'count':0x0,'rows':[]};return db[_0xcced('0x31')]['findOne']({'where':{'id':_0x5baa67[_0xcced('0x4b')]['id']}})['then'](handleEntityNotFound(_0x119b43,null))[_0xcced('0x15')](function(_0x40bb9b){if(_0x40bb9b){_0x13ff3b['model']=_['keys'](db[_0xcced('0x56')][_0xcced('0x32')]);_0x13ff3b[_0xcced('0x36')]=_[_0xcced('0x37')](_0x5baa67[_0xcced('0x36')]);_0x13ff3b['filters']=_[_0xcced('0x39')](_0x13ff3b['model'],_0x13ff3b[_0xcced('0x36')]);_0x190901[_0xcced('0x3a')]=_[_0xcced('0x39')](_0x13ff3b[_0xcced('0x35')],qs['fields'](_0x5baa67['query'][_0xcced('0x3b')]));_0x190901[_0xcced('0x3a')]=_0x190901[_0xcced('0x3a')][_0xcced('0x3c')]?_0x190901[_0xcced('0x3a')]:_0x13ff3b['model'];if(!_0x5baa67[_0xcced('0x36')]['hasOwnProperty']('nolimit')){_0x190901[_0xcced('0x22')]=qs[_0xcced('0x22')](_0x5baa67[_0xcced('0x36')][_0xcced('0x22')]);_0x190901[_0xcced('0x25')]=qs[_0xcced('0x25')](_0x5baa67[_0xcced('0x36')][_0xcced('0x25')]);}_0x190901[_0xcced('0x3f')]=qs[_0xcced('0x40')](_0x5baa67['query']['sort']);_0x190901[_0xcced('0x41')]=qs['filters'](_[_0xcced('0x42')](_0x5baa67[_0xcced('0x36')],_0x13ff3b[_0xcced('0x38')]));_0x190901[_0xcced('0x41')][_0xcced('0x54')]=_0x40bb9b['id'];if(_0x5baa67['query'][_0xcced('0x43')]){_0x190901[_0xcced('0x41')]=_[_0xcced('0x46')](_0x190901[_0xcced('0x41')],{'$or':_[_0xcced('0x30')](_0x190901['attributes'],function(_0x121add){var _0x45eb39={};_0x45eb39[_0x121add]={'$like':'%'+_0x5baa67['query'][_0xcced('0x43')]+'%'};return _0x45eb39;})});}_0x190901=_[_0xcced('0x46')]({},_0x190901,_0x5baa67[_0xcced('0x4c')]);return db[_0xcced('0x56')][_0xcced('0x24')]({'where':_0x190901[_0xcced('0x41')]})['then'](function(_0x4fed9a){_0x259849['count']=_0x4fed9a;if(_0x5baa67[_0xcced('0x36')][_0xcced('0x47')]){_0x190901[_0xcced('0x48')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x190901);})['then'](function(_0x4106a6){_0x259849['rows']=_0x4106a6;return _0x259849;});}})[_0xcced('0x15')](respondWithFilteredResult(_0x119b43,_0x190901))[_0xcced('0x1d')](handleError(_0x119b43,null));};exports[_0xcced('0x57')]=function(_0x905c67,_0x5d9b30){return db[_0xcced('0x31')]['find']({'where':{'id':_0x905c67[_0xcced('0x4b')]['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x5d9b30,null))[_0xcced('0x15')](function(_0x45c2e4){if(_0x45c2e4){return _0x45c2e4[_0xcced('0x57')](_0x905c67[_0xcced('0x36')][_0xcced('0x58')]);}})[_0xcced('0x15')](respondWithStatusCode(_0x5d9b30,null))['catch'](handleError(_0x5d9b30,null));};exports[_0xcced('0x59')]=function(_0x53628b,_0x1f838a){if(_0x53628b[_0xcced('0x52')]['id']){delete _0x53628b[_0xcced('0x52')]['id'];}return db[_0xcced('0x31')]['find']({'where':{'id':_0x53628b[_0xcced('0x4b')]['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x1f838a,null))['then'](function(_0x42bc2b){if(_0x42bc2b){_0x53628b[_0xcced('0x52')]['ChatWebsiteId']=_0x42bc2b['id'];return db[_0xcced('0x5a')][_0xcced('0x4e')](_0x53628b[_0xcced('0x52')]);}})[_0xcced('0x15')](respondWithResult(_0x1f838a,null))[_0xcced('0x1d')](handleError(_0x1f838a,null));};exports[_0xcced('0x5b')]=function(_0x525be4,_0x16a041){var _0x562383={'raw':![],'where':{}};var _0x32c9cf={};var _0x27da9d={'count':0x0,'rows':[]};return db[_0xcced('0x31')]['findOne']({'where':{'id':_0x525be4['params']['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x16a041,null))[_0xcced('0x15')](function(_0x4f4470){if(_0x4f4470){_0x32c9cf[_0xcced('0x35')]=_[_0xcced('0x37')](db['CannedAnswer'][_0xcced('0x32')]);_0x32c9cf[_0xcced('0x36')]=_[_0xcced('0x37')](_0x525be4[_0xcced('0x36')]);_0x32c9cf[_0xcced('0x38')]=_[_0xcced('0x39')](_0x32c9cf[_0xcced('0x35')],_0x32c9cf[_0xcced('0x36')]);_0x562383[_0xcced('0x3a')]=_[_0xcced('0x39')](_0x32c9cf[_0xcced('0x35')],qs[_0xcced('0x3b')](_0x525be4[_0xcced('0x36')][_0xcced('0x3b')]));_0x562383[_0xcced('0x3a')]=_0x562383[_0xcced('0x3a')]['length']?_0x562383[_0xcced('0x3a')]:_0x32c9cf['model'];if(!_0x525be4[_0xcced('0x36')][_0xcced('0x3d')]('nolimit')){_0x562383[_0xcced('0x22')]=qs['limit'](_0x525be4[_0xcced('0x36')][_0xcced('0x22')]);_0x562383[_0xcced('0x25')]=qs[_0xcced('0x25')](_0x525be4[_0xcced('0x36')]['offset']);}_0x562383[_0xcced('0x3f')]=qs[_0xcced('0x40')](_0x525be4[_0xcced('0x36')][_0xcced('0x40')]);_0x562383[_0xcced('0x41')]=qs[_0xcced('0x38')](_[_0xcced('0x42')](_0x525be4['query'],_0x32c9cf['filters']));_0x562383[_0xcced('0x41')][_0xcced('0x54')]=_0x4f4470['id'];if(_0x525be4[_0xcced('0x36')]['filter']){_0x562383[_0xcced('0x41')]=_[_0xcced('0x46')](_0x562383[_0xcced('0x41')],{'$or':_['map'](_0x562383[_0xcced('0x3a')],function(_0x3525a7){var _0xe5b610={};_0xe5b610[_0x3525a7]={'$like':'%'+_0x525be4[_0xcced('0x36')][_0xcced('0x43')]+'%'};return _0xe5b610;})});}_0x562383=_[_0xcced('0x46')]({},_0x562383,_0x525be4['options']);return db['CannedAnswer'][_0xcced('0x24')]({'where':_0x562383[_0xcced('0x41')]})[_0xcced('0x15')](function(_0x2bfda4){_0x27da9d[_0xcced('0x24')]=_0x2bfda4;if(_0x525be4[_0xcced('0x36')]['includeAll']){_0x562383['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xcced('0x49')](_0x562383);})[_0xcced('0x15')](function(_0x59c572){_0x27da9d[_0xcced('0x5c')]=_0x59c572;return _0x27da9d;});}})['then'](respondWithFilteredResult(_0x16a041,_0x562383))[_0xcced('0x1d')](handleError(_0x16a041,null));};exports[_0xcced('0x5d')]=function(_0x38cfe7,_0x128214){return db['ChatWebsite'][_0xcced('0x4d')]({'where':{'id':_0x38cfe7[_0xcced('0x4b')]['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x128214,null))['then'](function(_0x3c9f9e){if(_0x3c9f9e){return _0x3c9f9e['removeAnswers'](_0x38cfe7[_0xcced('0x36')][_0xcced('0x58')]);}})[_0xcced('0x15')](respondWithStatusCode(_0x128214,null))[_0xcced('0x1d')](handleError(_0x128214,null));};exports[_0xcced('0x5e')]=function(_0x5492d1,_0x272f80){_0x5492d1[_0xcced('0x52')][_0xcced('0x5f')]=_0x5492d1[_0xcced('0x60')][_0xcced('0x61')];return db['ChatWebsite']['find']({'where':{'id':_0x5492d1[_0xcced('0x4b')]['id']}})['then'](handleEntityNotFound(_0x272f80,null))[_0xcced('0x15')](saveUpdates(_0x5492d1[_0xcced('0x52')],null))['then'](respondWithResult(_0x272f80,null))[_0xcced('0x1d')](handleError(_0x272f80,null));};exports[_0xcced('0x62')]=function(_0x41ad57,_0x333040){_0x41ad57[_0xcced('0x52')][_0xcced('0x63')]=_0x41ad57[_0xcced('0x60')]['filename'];return db[_0xcced('0x31')][_0xcced('0x4d')]({'where':{'id':_0x41ad57['params']['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x333040,null))[_0xcced('0x15')](saveUpdates(_0x41ad57[_0xcced('0x52')],null))[_0xcced('0x15')](respondWithResult(_0x333040,null))[_0xcced('0x1d')](handleError(_0x333040,null));};exports[_0xcced('0x64')]=function(_0x17d186,_0x19b5c0){_0x17d186[_0xcced('0x52')]['customerAvatar']=_0x17d186[_0xcced('0x60')]['filename'];return db[_0xcced('0x31')][_0xcced('0x4d')]({'where':{'id':_0x17d186[_0xcced('0x4b')]['id']}})['then'](handleEntityNotFound(_0x19b5c0,null))[_0xcced('0x15')](saveUpdates(_0x17d186[_0xcced('0x52')],null))[_0xcced('0x15')](respondWithResult(_0x19b5c0,null))[_0xcced('0x1d')](handleError(_0x19b5c0,null));};exports[_0xcced('0x65')]=function(_0x2118b8,_0x5b2f65){_0x2118b8[_0xcced('0x52')][_0xcced('0x66')]=_0x2118b8[_0xcced('0x60')][_0xcced('0x61')];return db[_0xcced('0x31')]['find']({'where':{'id':_0x2118b8[_0xcced('0x4b')]['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x5b2f65,null))[_0xcced('0x15')](saveUpdates(_0x2118b8[_0xcced('0x52')],null))[_0xcced('0x15')](respondWithResult(_0x5b2f65,null))['catch'](handleError(_0x5b2f65,null));};exports[_0xcced('0x67')]=function(_0xb0afae,_0x2ca256){var _0x15a356=path[_0xcced('0x68')](config[_0xcced('0x69')],_0xcced('0x6a'));var _0x1ac382={'where':{'id':_0xb0afae[_0xcced('0x4b')]['id']},'attributes':['id',_0xcced('0x5f')],'raw':!![]};var _0x720878=![];return require(_0xcced('0x6b'))['getLicense']()[_0xcced('0x15')](function(_0x1bfe9c){if(_0x1bfe9c){_0x720878=_0x1bfe9c[_0xcced('0x6c')];}})[_0xcced('0x15')](function(){return db[_0xcced('0x31')][_0xcced('0x4d')](_0x1ac382);})[_0xcced('0x15')](handleEntityNotFound(_0x2ca256,null))[_0xcced('0x15')](function(_0x1b6826){if(_0x1b6826){if(!_[_0xcced('0x6d')](_0x1b6826[_0xcced('0x5f')])){if(fs['existsSync'](path[_0xcced('0x68')](config[_0xcced('0x69')],_0xcced('0x6e'),_0x1b6826[_0xcced('0x5f')]))&&_0x720878){_0x15a356=path[_0xcced('0x68')](config[_0xcced('0x69')],_0xcced('0x6e'),_0x1b6826[_0xcced('0x5f')]);}}return _0x2ca256[_0xcced('0x6f')](_0x15a356);}})[_0xcced('0x1d')](handleError(_0x2ca256,null));};exports[_0xcced('0x70')]=function(_0x14ffee,_0x4fdb0a){var _0x148f9b=path['join'](config[_0xcced('0x69')],_0xcced('0x71'));var _0x50550f={'where':{'id':_0x14ffee[_0xcced('0x4b')]['id']},'attributes':['id',_0xcced('0x63')],'raw':!![]};return db[_0xcced('0x31')][_0xcced('0x4d')](_0x50550f)[_0xcced('0x15')](handleEntityNotFound(_0x4fdb0a,null))['then'](function(_0x373667){if(_0x373667){if(!_[_0xcced('0x6d')](_0x373667[_0xcced('0x63')])){if(fs[_0xcced('0x72')](path['join'](config[_0xcced('0x69')],_0xcced('0x73'),_0x373667[_0xcced('0x63')]))){_0x148f9b=path['join'](config[_0xcced('0x69')],_0xcced('0x73'),_0x373667[_0xcced('0x63')]);}}return _0x4fdb0a[_0xcced('0x6f')](_0x148f9b);}})['catch'](handleError(_0x4fdb0a,null));};exports['getCustomerAvatar']=function(_0x25a117,_0x33ba63){var _0x13e220=path[_0xcced('0x68')](config['root'],'server/files/images/avatars/customer_avatar.png');var _0x2ba312={'where':{'id':_0x25a117[_0xcced('0x4b')]['id']},'attributes':['id','customerAvatar',_0xcced('0x74')],'raw':!![]};return db['ChatWebsite'][_0xcced('0x4d')](_0x2ba312)['then'](handleEntityNotFound(_0x33ba63,null))[_0xcced('0x15')](function(_0x2c62b1){if(_0x2c62b1){if(!_[_0xcced('0x6d')](_0x2c62b1[_0xcced('0x75')])){if(fs[_0xcced('0x72')](path[_0xcced('0x68')](config[_0xcced('0x69')],_0xcced('0x73'),_0x2c62b1[_0xcced('0x75')]))&&_0x2c62b1['showCustomerAvatar']){_0x13e220=path[_0xcced('0x68')](config['root'],_0xcced('0x73'),_0x2c62b1[_0xcced('0x75')]);}}return _0x33ba63[_0xcced('0x6f')](_0x13e220);}})[_0xcced('0x1d')](handleError(_0x33ba63,null));};exports['getSystemAvatar']=function(_0x555258,_0x499f0b){var _0x1e4568=path['join'](config[_0xcced('0x69')],'server/files/images/avatars/system_avatar.png');var _0x5e19d0={'where':{'id':_0x555258[_0xcced('0x4b')]['id']},'attributes':['id',_0xcced('0x66')],'raw':!![]};return db[_0xcced('0x31')][_0xcced('0x4d')](_0x5e19d0)[_0xcced('0x15')](handleEntityNotFound(_0x499f0b,null))[_0xcced('0x15')](function(_0x5d1c05){if(_0x5d1c05){if(!_['isNil'](_0x5d1c05[_0xcced('0x66')])){if(fs[_0xcced('0x72')](path[_0xcced('0x68')](config[_0xcced('0x69')],_0xcced('0x73'),_0x5d1c05['systemAvatar']))){_0x1e4568=path[_0xcced('0x68')](config[_0xcced('0x69')],_0xcced('0x73'),_0x5d1c05['systemAvatar']);}}return _0x499f0b['download'](_0x1e4568);}})['catch'](handleError(_0x499f0b,null));};exports[_0xcced('0x76')]=function(_0x5eeb8c,_0x522b3b){var _0x3feaf0=require('user-agent-parser');var _0x4ff851=new _0x3feaf0();var _0x383a05=_0x4ff851[_0xcced('0x77')](_0x5eeb8c[_0xcced('0x78')][_0xcced('0x79')])[_0xcced('0x7a')]();var _0x4459c1={'body':_0x5eeb8c[_0xcced('0x52')],'channel':_0xcced('0x7b')};var _0x5c607d=[];var _0x1d89cb=[];var _0x204b71={};var _0x3dd0a=![];return db['CmContact'][_0xcced('0x53')]()[_0xcced('0x15')](function(_0x9b5bd4){if(!_0x9b5bd4){throw new db[(_0xcced('0x7c'))]['ValidationError']('no\x20available\x20attributes');}_0x5c607d=_[_0xcced('0x7d')](_[_0xcced('0x37')](_0x9b5bd4),[_0xcced('0x7e'),'updatedAt']);_0x1d89cb=_[_0xcced('0x7d')](_[_0xcced('0x37')](_0x9b5bd4),['createdAt','updatedAt','CompanyId','ListId']);if(_0x5eeb8c['body']['id']){delete _0x5eeb8c[_0xcced('0x52')]['id'];}if(_[_0xcced('0x6d')](_0x5eeb8c[_0xcced('0x52')]['from'])){throw new db['Sequelize']['ValidationError'](_0xcced('0x7f'));}if(_['isNil'](_0x5eeb8c[_0xcced('0x52')][_0xcced('0x52')])||_0x5eeb8c[_0xcced('0x52')]['body']===''){throw new db[(_0xcced('0x7c'))]['ValidationError'](_0xcced('0x80'));}if(_['isNil'](_0x5eeb8c['body'][_0xcced('0x81')])){throw new db[(_0xcced('0x7c'))][(_0xcced('0x82'))](_0xcced('0x83')+_0x1d89cb);}if(!_['includes'](_0x1d89cb,_0x5eeb8c[_0xcced('0x52')]['mapKey'])){throw new db[(_0xcced('0x7c'))][(_0xcced('0x82'))](_0xcced('0x84')+_0x1d89cb);}_0x204b71[_0x5eeb8c['body'][_0xcced('0x81')]]=_0x5eeb8c[_0xcced('0x52')][_0xcced('0x85')];})[_0xcced('0x15')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x5eeb8c[_0xcced('0x4b')]['id']},'include':[{'model':db['CmList'],'as':_0xcced('0x86'),'include':[{'model':db[_0xcced('0x87')],'as':_0xcced('0x88'),'where':_0x204b71,'limit':0x1,'order':[[_0xcced('0x89'),_0xcced('0x8a')]]}]},{'model':db['ChatApplication'],'as':_0xcced('0x8b')}]});})[_0xcced('0x15')](handleEntityNotFound(_0x522b3b,null))[_0xcced('0x15')](function(_0xd33f51){if(_0xd33f51&&_0xd33f51[_0xcced('0x86')]){_0x4459c1[_0xcced('0x8c')]=_0xd33f51;_0x4459c1[_0xcced('0x8d')]=_0xd33f51['Applications'];_0x4459c1[_0xcced('0x8e')]=_0xd33f51['List'];_0x4459c1['applications']=_[_0xcced('0x8f')](_0x4459c1[_0xcced('0x8d')],[_0xcced('0x90')],[_0xcced('0x91')]);if(_0x4459c1[_0xcced('0x8c')]['Applications']){delete _0x4459c1['account']['Applications'];}if(_0x4459c1[_0xcced('0x8c')]['List']&&_0x4459c1[_0xcced('0x8c')][_0xcced('0x86')][_0xcced('0x88')][_0xcced('0x3c')]){return _0x4459c1[_0xcced('0x8c')][_0xcced('0x86')]['Contacts'][0x0];}var _0x4ae149=_[_0xcced('0xd')](_0x5eeb8c[_0xcced('0x52')],{'firstName':_0x5eeb8c[_0xcced('0x52')][_0xcced('0x85')],'ListId':_0xd33f51[_0xcced('0x92')]});_0x4ae149[_0x5eeb8c[_0xcced('0x52')][_0xcced('0x81')]]=_0x5eeb8c[_0xcced('0x52')][_0xcced('0x85')];return db[_0xcced('0x87')][_0xcced('0x4e')](_0x4ae149,{'fields':_0x5c607d,'raw':!![]});}})[_0xcced('0x15')](handleEntityNotFound(_0x522b3b,null))[_0xcced('0x15')](function(_0x4a67e9){_0x4459c1[_0xcced('0x93')]=_0x4a67e9;var _0x3b8a26=_0x5eeb8c['body'][_0xcced('0x94')];if(_0x5eeb8c[_0xcced('0x78')][_0xcced('0x95')]){_0x3b8a26=_0x5eeb8c[_0xcced('0x78')]['cf-connecting-ip'];}else if(_0x5eeb8c['headers'][_0xcced('0x96')]){_0x3b8a26=_['first'](_0x5eeb8c[_0xcced('0x78')]['x-forwarded-for'][_0xcced('0x97')](','));}if(_0x4a67e9){var _0x4d89fe={'ContactId':_0x4a67e9['id'],'ChatWebsiteId':_0x5eeb8c[_0xcced('0x4b')]['id'],'from':(_0x4a67e9[_0xcced('0x98')]||'')+'\x20'+(_0x4a67e9[_0xcced('0x99')]||''),'customerIp':_0x3b8a26,'customerPort':_0x5eeb8c['headers']['x-real-port']?_0x5eeb8c[_0xcced('0x78')][_0xcced('0x9a')]:null,'referer':_0x5eeb8c[_0xcced('0x52')]['referer'],'browserName':_0x383a05['browser'][_0xcced('0x2b')]&&_0x383a05[_0xcced('0x9b')][_0xcced('0x9c')]?util[_0xcced('0x9d')](_0xcced('0x9e'),_0x383a05['browser']['name'],_0x383a05[_0xcced('0x9b')][_0xcced('0x9c')]):_0xcced('0x9f'),'browserVersion':_0x383a05[_0xcced('0x9b')][_0xcced('0x9c')]||'unknown','osName':util[_0xcced('0x9d')]('%s\x20%s',_0x383a05['os'][_0xcced('0x2b')],_0x383a05['os']['version']),'osVersion':_0x383a05['os'][_0xcced('0x9c')],'deviceModel':_0x383a05[_0xcced('0xa0')]['model']&&_0x383a05[_0xcced('0xa0')][_0xcced('0xa1')]?util[_0xcced('0x9d')](_0xcced('0xa2'),_0x383a05['device'][_0xcced('0x35')],_0x383a05[_0xcced('0xa0')]['vendor'],_0x383a05[_0xcced('0xa0')][_0xcced('0x44')]):null,'deviceVendor':_0x383a05[_0xcced('0xa0')][_0xcced('0xa1')],'deviceType':_0x383a05['device'][_0xcced('0x44')],'formData':JSON['stringify'](_0x5eeb8c[_0xcced('0x52')])};var _0x2a9a47={'ChatWebsiteId':_0x5eeb8c[_0xcced('0x4b')]['id'],'closed':![]};if(_0x5eeb8c[_0xcced('0x52')]['threadId']){_0x2a9a47['threadId']=_0x5eeb8c[_0xcced('0x52')][_0xcced('0xa3')];return db[_0xcced('0xa4')][_0xcced('0x4d')]({'where':_0x2a9a47})[_0xcced('0x15')](function(_0x3210d6){if(_0x3210d6){return[_0x3210d6,![]];}_0x4d89fe[_0xcced('0xa3')]=_0x5eeb8c[_0xcced('0x52')][_0xcced('0xa3')];_0x4d89fe[_0xcced('0xa5')]=_0x5eeb8c[_0xcced('0x52')][_0xcced('0xa5')];return db[_0xcced('0xa4')][_0xcced('0x4e')](_0x4d89fe)[_0xcced('0x15')](function(_0x107f3a){return[_0x107f3a,!![]];});});}_0x2a9a47[_0xcced('0xa6')]=_0x4a67e9['id'];if(_0x5eeb8c[_0xcced('0x52')]['interaction']&&_0x5eeb8c[_0xcced('0x52')][_0xcced('0xa7')]['id']){_0x2a9a47['id']=_0x5eeb8c[_0xcced('0x52')]['interaction']['id'];return db[_0xcced('0xa4')]['find']({'where':_0x2a9a47})[_0xcced('0x15')](function(_0x5d2836){if(_0x5d2836){return[_0x5d2836,![]];}return db[_0xcced('0xa4')][_0xcced('0x4e')](_0x4d89fe)['then'](function(_0x295105){return[_0x295105,!![]];});});}return db['ChatInteraction'][_0xcced('0x4e')](_0x4d89fe)[_0xcced('0x15')](function(_0x3b04a8){return[_0x3b04a8,!![]];});}})[_0xcced('0xa8')](function(_0x36e66a,_0x4ee948){if(_0x36e66a){_0x3dd0a=_0x4ee948;if(!_0x4ee948){var _0x2481d3={'from':(_0x4459c1['contact'][_0xcced('0x98')]||'')+'\x20'+(_0x4459c1[_0xcced('0x93')][_0xcced('0x99')]||'')};if(_0x5eeb8c[_0xcced('0x52')][_0xcced('0xa3')]&&_0x5eeb8c[_0xcced('0x52')][_0xcced('0xa9')]&&_0x5eeb8c['body']['threadId']!=_0x5eeb8c[_0xcced('0x52')][_0xcced('0xa9')]){_0x2481d3[_0xcced('0xa3')]=_0x5eeb8c['body'][_0xcced('0xa9')];}return _0x36e66a[_0xcced('0x26')](_0x2481d3);}else{return _0x36e66a;}}})['then'](function(_0x4d7979){_0x4459c1[_0xcced('0xa7')]=_0x4d7979['get']({'plain':!![]});_0x4459c1['interaction'][_0xcced('0xaa')]=_0x3dd0a;if(_0x4459c1[_0xcced('0xa7')][_0xcced('0xaa')]){if(_0x4459c1['account'][_0xcced('0xab')]){_0x4459c1[_0xcced('0x8d')][_0xcced('0xac')]({'id':0x0,'priority':_0x4459c1[_0xcced('0x8d')][_0xcced('0x3c')]+0x1,'app':_0xcced('0xad'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0xcced('0xae')][_0xcced('0x4e')]({'body':_0x5eeb8c[_0xcced('0x52')][_0xcced('0x52')],'ChatWebsiteId':_0x5eeb8c[_0xcced('0x4b')]['id'],'ChatInteractionId':_0x4d7979['id'],'direction':'in','ContactId':_0x4459c1['contact']['id'],'AttachmentId':_0x5eeb8c['body'][_0xcced('0xaf')]});})[_0xcced('0x15')](function(_0x2d4011){_0x4459c1[_0xcced('0x1c')]=_0x2d4011;if(_0x4459c1[_0xcced('0xa7')][_0xcced('0xb0')]){return db[_0xcced('0xb1')]['find']({'attributes':['id',_0xcced('0x2b')],'where':{'id':_0x4459c1[_0xcced('0xa7')][_0xcced('0xb0')]}})['then'](function(_0x5a038d){if(_0x5a038d){_0x4459c1[_0xcced('0x8d')]['unshift']({'id':0x0,'priority':0x0,'app':_0xcced('0xb2'),'appdata':_0x5a038d[_0xcced('0x2b')]+','+(_0x4459c1[_0xcced('0x8c')][_0xcced('0xb3')]||0xa),'interval':_0xcced('0xb4')});_0x4459c1[_0xcced('0xb5')]=!![];}return respondWithRpcPromise(_0xcced('0xb6'),'startRouting',_0x4459c1);});}return respondWithRpcPromise(_0xcced('0xb6'),_0xcced('0xb7'),_0x4459c1);})[_0xcced('0x15')](function(_0x272749){respondWithRpcPromise(_0xcced('0xb8'),_0xcced('0xb8'),{'event':_0xcced('0x76'),'message':_0x272749},client9002);return _0x272749;})[_0xcced('0x15')](respondWithResult(_0x522b3b,null))[_0xcced('0x1d')](handleError(_0x522b3b,null));};exports[_0xcced('0xb9')]=function(_0x1e2f2a,_0x12b3e7){var _0x59d4cc,_0x4031c4,_0x4f095a;var _0x15de88=[];var _0x11b81a={};var _0x577af7=_0x1e2f2a[_0xcced('0xba')]||[];var _0x115654=[];var _0x1849be;return db['CmContact']['describe']()[_0xcced('0x15')](function(_0x5ee873){if(!_0x5ee873){throw new db[(_0xcced('0x7c'))]['ValidationError'](_0xcced('0xbb'));}_0x15de88=_[_0xcced('0x7d')](_[_0xcced('0x37')](_0x5ee873),[_0xcced('0x7e'),_0xcced('0x89'),_0xcced('0xbc'),_0xcced('0x92')]);if(_0x1e2f2a['body']['id']){delete _0x1e2f2a[_0xcced('0x52')]['id'];}if(_[_0xcced('0x6d')](_0x1e2f2a[_0xcced('0x52')]['from'])){throw _0x12b3e7[_0xcced('0x1f')](0x1f4)[_0xcced('0x2c')](new db[(_0xcced('0x7c'))][(_0xcced('0x82'))]('from\x20is\x20mandatory'));}if(_[_0xcced('0x6d')](_0x1e2f2a['body']['body'])||_0x1e2f2a[_0xcced('0x52')][_0xcced('0x52')]===''){throw _0x12b3e7['status'](0x1f4)['send'](new db[(_0xcced('0x7c'))]['ValidationError'](_0xcced('0x80')));}if(_[_0xcced('0x6d')](_0x1e2f2a['body']['mapKeyOffline'])){throw _0x12b3e7[_0xcced('0x1f')](0x1f4)[_0xcced('0x2c')](new db[(_0xcced('0x7c'))][(_0xcced('0x82'))](_0xcced('0xbd')+_0x15de88));}if(!_['includes'](_0x15de88,_0x1e2f2a[_0xcced('0x52')][_0xcced('0xbe')])){throw _0x12b3e7[_0xcced('0x1f')](0x1f4)[_0xcced('0x2c')](new db[(_0xcced('0x7c'))][(_0xcced('0x82'))](_0xcced('0xbf')+_0x15de88));}_0x11b81a[_0x1e2f2a[_0xcced('0x52')][_0xcced('0xbe')]]=_0x1e2f2a[_0xcced('0x52')][_0xcced('0x85')];})['then'](function(){return db[_0xcced('0x31')][_0xcced('0x4d')]({'where':{'id':_0x1e2f2a[_0xcced('0x4b')]['id']},'include':[{'model':db[_0xcced('0xc0')],'as':'List'},{'model':db[_0xcced('0xc1')],'as':'MailAccount'}]});})['then'](handleEntityNotFound(_0x12b3e7,null))['then'](function(_0x4052d4){if(_0x4052d4&&_0x4052d4[_0xcced('0x86')]){_0x4031c4=_0x4052d4;var _0x3b0a30=_['defaults'](_0x1e2f2a['body'],{'firstName':_0x1e2f2a[_0xcced('0x52')]['from'],'phone':_0x1e2f2a[_0xcced('0x52')][_0xcced('0x85')],'ListId':_0x4052d4['ListId']});_0x3b0a30[_0x1e2f2a[_0xcced('0x52')][_0xcced('0xbe')]]=_0x1e2f2a[_0xcced('0x52')][_0xcced('0x85')];return db[_0xcced('0x87')][_0xcced('0xc2')]({'where':_0x11b81a,'defaults':_0x3b0a30});}})['spread'](function(_0xeb64f){if(_0xeb64f){_0x4f095a=_0xeb64f;var _0x5781de=fs[_0xcced('0xc3')](path['join'](config[_0xcced('0x69')],_0xcced('0xc4')),_0xcced('0xc5'));var _0x4c2a79=ejs['render'](_0x5781de,{'body':_['toPairs'](_0x1e2f2a['body']['body']),'bodyTitle':_0x4031c4['offlineMessageBody']});return db['ChatOfflineMessage'][_0xcced('0x4e')]({'body':_0x4c2a79,'plainBody':htmlToText[_0xcced('0xc6')](_0x4c2a79),'ContactId':_0xeb64f['id'],'ChatWebsiteId':_0x4031c4['id']});}})[_0xcced('0x15')](function(_0x41900b){_0x1849be=_0x41900b;if(_0x577af7[_0xcced('0x3c')]){var _0xf45315=_0x577af7['map'](function(_0x5a7a57){return{'name':_0x5a7a57[_0xcced('0xc7')],'basename':_0x5a7a57[_0xcced('0x61')],'type':_0x5a7a57[_0xcced('0xc8')],'ChatOfflineMessageId':_0x41900b['id']};});_0x115654=_0xf45315[_0xcced('0x30')](_0x4712d5=>{var _0x167f79={'filename':_0x4712d5['name'],'path':path[_0xcced('0x68')](config['root'],_0xcced('0xc9'),_0xcced('0xba'),_0xcced('0xca'),_0xcced('0xcb'),_0x4712d5[_0xcced('0xcc')])};return _0x167f79;});if(!_0x4031c4['openNewInteraction']){return db[_0xcced('0xcd')][_0xcced('0xce')](function(_0x80f9f6){return db[_0xcced('0xcf')][_0xcced('0xd0')](_0xf45315,{'transaction':_0x80f9f6});});}}})[_0xcced('0x15')](function(){if(_0x1849be){_0x59d4cc=_0x1849be;return db[_0xcced('0xc1')][_0xcced('0xd1')]({'where':{'service':!![]},'include':[{'model':db[_0xcced('0xd2')],'as':_0xcced('0xd3'),'raw':!![],'include':[{'model':db[_0xcced('0xd4')],'as':_0xcced('0xd4'),'raw':!![]}]}]});}})[_0xcced('0x15')](function(_0x5db023){if(_0x5db023&&_0x5db023[_0xcced('0xd3')]&&_0x4031c4[_0xcced('0xd5')]&&_0x4031c4[_0xcced('0xd6')]){var _0x24ea2d=_0x5db023[_0xcced('0xd7')]();return respondWithRpcPromise(_0xcced('0xd8'),'sendMail',{'account':_0x24ea2d,'message':{'from':util[_0xcced('0x9d')]('\x22%s\x22\x20<%s>',_0x5db023[_0xcced('0x2b')],_0x5db023[_0xcced('0xd9')]||_0x5db023[_0xcced('0xd3')]['user']),'to':_0x4031c4['forwardOfflineAddress'],'subject':_0x4031c4[_0xcced('0xda')],'html':_0x59d4cc[_0xcced('0x52')],'attachments':_0x115654}},client9003)[_0xcced('0x15')](function(){return _0x59d4cc;})[_0xcced('0x1d')](function(_0x19a6a9){logger[_0xcced('0x1a')](_0x19a6a9);});}})[_0xcced('0x15')](function(){if(_0x4031c4&&_0x4031c4['openNewInteraction']&&_0x4031c4[_0xcced('0xdb')]){var _0x463694=[];if(_0x577af7[_0xcced('0x3c')]){_0x463694=_0x577af7[_0xcced('0x30')](function(_0x57659d){return{'name':_0x57659d[_0xcced('0xc7')],'basename':_0x57659d[_0xcced('0x61')],'type':_0x57659d['mimetype'],'ChatOfflineMessageId':_0x1849be['id']};});}var _0x30b372;if(!_[_0xcced('0x6d')](_0x4031c4['subjectOffline'])){var _0x3cb87b=_['map'](_0x1e2f2a[_0xcced('0x52')],function(_0x3eac32){return _0x3eac32;});var _0x5cf6e7=_['toPairsIn'](_0x3cb87b)[0x0];var _0x314276=_[_0xcced('0xdc')](_0x5cf6e7,function(_0x5038e4){return _0x5038e4;});_0x30b372=_0x314276[0x1][_0x4031c4[_0xcced('0xdd')]];}var _0x186eb6={'from':_0x4f095a[_0xcced('0xd9')],'firstName':_0x4f095a[_0xcced('0x98')],'lastName':_0x4f095a['lastName'],'mapKey':_0xcced('0xd9'),'message':{'from':_0x4f095a['email'],'to':_0x4031c4['MailAccount'][_0xcced('0xd9')],'cc':'','subject':_[_0xcced('0x6d')](_0x30b372)?_0x4031c4[_0xcced('0xda')]:_0x30b372,'messageId':'','sentAt':new Date(),'attach':_0x463694[_0xcced('0x3c')],'attachments':_0x463694,'originChannel':_0xcced('0xde'),'ChatWebsiteId':_0x4031c4['id'],'ChatOfflineMessageId':_0x59d4cc['id'],'originTo':_0x4031c4[_0xcced('0xc1')]['email']},'body':_0x59d4cc[_0xcced('0x52')]};var _0x487548={'account':{'id':_0x4031c4[_0xcced('0xdb')]},'body':_0x186eb6,'log':'NotifyMailAccount'};return respondWithRpcPromise('NotifyMailAccount',_0xcced('0xdf'),_0x487548,client9001)[_0xcced('0x15')](function(){return _0x59d4cc;})[_0xcced('0x1d')](function(_0x1b0f41){logger[_0xcced('0x1a')](_0x1b0f41);});}return;})[_0xcced('0x15')](function(){if(_0x59d4cc){return _0x59d4cc;}})[_0xcced('0x15')](respondWithResult(_0x12b3e7,null))[_0xcced('0x1d')](function(_0x412ceb){logger[_0xcced('0x1a')](_0xcced('0x1d'),_0x412ceb);for(var _0x25cc19 of _0x577af7){var _0x5c565f=path[_0xcced('0x68')](config[_0xcced('0x69')],_0xcced('0xc9'),_0xcced('0xba'),_0xcced('0xca'),_0xcced('0xcb'),_0x25cc19[_0xcced('0x61')]);fs_extra[_0xcced('0xe0')](_0x5c565f)[_0xcced('0x1d')](function(_0x5af517){logger[_0xcced('0x1a')](_0xcced('0xe1'),_0x5c565f,_0x5af517);});}});};exports[_0xcced('0xe2')]=function(_0x444000,_0x20b258){return db[_0xcced('0xa4')]['find']({'where':{'id':_0x444000[_0xcced('0x4b')]['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x20b258,null))[_0xcced('0x15')](function(_0x5c2028){if(_0x5c2028){return _0x5c2028[_0xcced('0xe2')](_0x444000['body'][_0xcced('0x58')],_[_0xcced('0xe3')](_0x444000[_0xcced('0x52')],['ids','id'])||{});}})[_0xcced('0x15')](respondWithResult(_0x20b258,null))[_0xcced('0x1d')](handleError(_0x20b258,null));};exports[_0xcced('0xe4')]=function(_0x4965ad,_0x523cec){var _0x1dabe1={'raw':![],'where':{}};var _0x6f026a={};var _0xcd7f43={'count':0x0,'rows':[]};return db[_0xcced('0x31')]['findOne']({'where':{'id':_0x4965ad[_0xcced('0x4b')]['id']}})['then'](handleEntityNotFound(_0x523cec,null))[_0xcced('0x15')](function(_0x16bcd9){if(_0x16bcd9){_0x6f026a[_0xcced('0x35')]=_[_0xcced('0x37')](db['ChatInteraction']['rawAttributes']);_0x6f026a[_0xcced('0x36')]=_[_0xcced('0x37')](_0x4965ad[_0xcced('0x36')]);_0x6f026a[_0xcced('0x38')]=_[_0xcced('0x39')](_0x6f026a[_0xcced('0x35')],_0x6f026a['query']);_0x1dabe1[_0xcced('0x3a')]=_[_0xcced('0x39')](_0x6f026a['model'],qs['fields'](_0x4965ad[_0xcced('0x36')][_0xcced('0x3b')]));_0x1dabe1[_0xcced('0x3a')]=_0x1dabe1[_0xcced('0x3a')][_0xcced('0x3c')]?_0x1dabe1[_0xcced('0x3a')]:_0x6f026a[_0xcced('0x35')];if(!_0x4965ad[_0xcced('0x36')][_0xcced('0x3d')](_0xcced('0x3e'))){_0x1dabe1[_0xcced('0x22')]=qs[_0xcced('0x22')](_0x4965ad[_0xcced('0x36')][_0xcced('0x22')]);_0x1dabe1[_0xcced('0x25')]=qs[_0xcced('0x25')](_0x4965ad[_0xcced('0x36')][_0xcced('0x25')]);}_0x1dabe1['order']=qs[_0xcced('0x40')](_0x4965ad['query'][_0xcced('0x40')]);_0x1dabe1[_0xcced('0x41')]=qs[_0xcced('0x38')](_[_0xcced('0x42')](_0x4965ad[_0xcced('0x36')],_0x6f026a[_0xcced('0x38')]));_0x1dabe1['where'][_0xcced('0x54')]=_0x16bcd9['id'];if(_0x4965ad['query'][_0xcced('0x43')]){_0x1dabe1[_0xcced('0x41')]=_[_0xcced('0x46')](_0x1dabe1[_0xcced('0x41')],{'$or':_[_0xcced('0x30')](_0x1dabe1[_0xcced('0x3a')],function(_0x20091f){var _0x5e623f={};_0x5e623f[_0x20091f]={'$like':'%'+_0x4965ad['query'][_0xcced('0x43')]+'%'};return _0x5e623f;})});}_0x1dabe1=_[_0xcced('0x46')]({},_0x1dabe1,_0x4965ad[_0xcced('0x4c')]);return db[_0xcced('0xa4')][_0xcced('0x24')]({'where':_0x1dabe1[_0xcced('0x41')]})[_0xcced('0x15')](function(_0x320def){_0xcd7f43[_0xcced('0x24')]=_0x320def;if(_0x4965ad[_0xcced('0x36')][_0xcced('0x47')]){_0x1dabe1[_0xcced('0x48')]=[{'model':db[_0xcced('0x87')],'as':'Contact','required':![]},{'model':db[_0xcced('0xb1')],'as':_0xcced('0xe5'),'attributes':[_0xcced('0x2b'),_0xcced('0xe6'),_0xcced('0xe7')],'required':![]},{'model':db['Tag'],'as':_0xcced('0xe8'),'attributes':['id','name',_0xcced('0xe9')],'where':_0x4965ad[_0xcced('0x36')]['tag']?{'id':_0x4965ad['query']['tag']}:undefined,'required':_0x4965ad[_0xcced('0x36')][_0xcced('0xea')]?!![]:![]}];}return db[_0xcced('0xa4')][_0xcced('0x49')](_0x1dabe1);})['then'](function(_0x397b0e){_0xcd7f43[_0xcced('0x5c')]=_0x397b0e;return _0xcd7f43;});}})[_0xcced('0x15')](respondWithFilteredResult(_0x523cec,_0x1dabe1))[_0xcced('0x1d')](handleError(_0x523cec,null));};function iftimePromise(_0xbbf619,_0x6cf794){return respondWithRpcPromise(_0xcced('0xeb'),'getSnippet',{'command':_0x6cf794[_0xcced('0xec')]?util[_0xcced('0x9d')](_0xcced('0xed'),_0xbbf619[_0xcced('0xee')],_0x6cf794[_0xcced('0xec')]):util[_0xcced('0x9d')](_0xcced('0xef'),_0xbbf619[_0xcced('0xee')])},client9002)['then'](function(_0x2c2fe3){var _0x203b49=_0x2c2fe3&&_0x2c2fe3['indexOf'](_0xcced('0xf0'))>=0x0?!![]:![];logger[_0xcced('0xf1')](_0xcced('0xf2'),_0x6cf794['id'],_0xbbf619['id'],_0xbbf619[_0xcced('0xee')],_0x203b49?_0xcced('0xf3'):_0xcced('0xf4'),_0x6cf794[_0xcced('0xec')]?_0x6cf794[_0xcced('0xec')]:_0xcced('0xf5'));return _0x203b49;})[_0xcced('0x1d')](function(_0x3787f4){logger['error'](_0xcced('0xf2'),_0x6cf794['id'],_0xbbf619['id'],_0xbbf619[_0xcced('0xee')],util[_0xcced('0xf6')](_0x3787f4,{'showHidden':![],'depth':null}),_0x6cf794[_0xcced('0xec')]?_0x6cf794[_0xcced('0xec')]:_0xcced('0xf5'));return![];});}exports[_0xcced('0xf7')]=function(_0x5a9723,_0x20ae4c){var _0x413b6e=0x0;var _0xdc49da=0x0;var _0x7fc2ba=![];var _0x31a461;var _0x118083;return db[_0xcced('0x31')]['find']({'where':{'id':_0x5a9723[_0xcced('0x4b')]['id']},'include':[{'model':db[_0xcced('0xf8')],'as':_0xcced('0xf8'),'include':[{'model':db[_0xcced('0xf8')],'as':_0xcced('0xf9'),'attributes':['id',_0xcced('0xee')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x20ae4c,null))[_0xcced('0x15')](function(_0x291489){if(_0x291489){_0x31a461=_0x291489;return _0x291489[_0xcced('0xfa')]({'raw':!![]});}})['then'](function(_0x1f9241){if(_0x31a461){if(_0x1f9241){_0x118083=_0x1f9241;}}return require(_0xcced('0x6b'))[_0xcced('0xfb')]();})[_0xcced('0x15')](function(_0x42f5a6){if(_0x42f5a6){_0xdc49da=_0x42f5a6[_0xcced('0xfc')];_0x7fc2ba=_0x42f5a6[_0xcced('0x6c')];}})[_0xcced('0x15')](function(){return db['ChatInteraction'][_0xcced('0x24')]({'where':{'closed':![]}});})[_0xcced('0x15')](function(_0x50a525){_0x413b6e=_0x50a525;if(_0xdc49da&&_0x50a525>_0xdc49da){return db[_0xcced('0xfd')][_0xcced('0xd1')]({'where':{'id':0x1}})[_0xcced('0x15')](function(_0x102e65){if(_0x102e65){_0x102e65['increment']('chatLicenseExceeded');}});}})[_0xcced('0x15')](function(){if(_0x31a461[_0xcced('0xf8')]&&_0x31a461[_0xcced('0xf8')]['Intervals']){var _0x3750a2=[];for(var _0x354e7c=0x0;_0x354e7c<_0x31a461[_0xcced('0xf8')]['Intervals'][_0xcced('0x3c')];_0x354e7c++){var _0x21be6c=_0x31a461[_0xcced('0xf8')]['Intervals'][_0x354e7c][_0xcced('0x28')]({'plain':!![]});_0x3750a2[_0xcced('0xac')](iftimePromise(_0x21be6c,_0x31a461));}return BPromise[_0xcced('0xfe')](_0x3750a2)['then'](function(_0x3c11e7){return _[_0xcced('0xff')](_0x3c11e7);});}else{return!![];}})[_0xcced('0x15')](function(_0x55e362){var _0x44abed=fs[_0xcced('0xc3')](path[_0xcced('0x68')](config['root'],_0xcced('0x100')),_0xcced('0xc5'));var _0x5887b3=new url['URL'](_0x31a461[_0xcced('0x101')])['origin'];var _0x4b88ad=_0xcced('0x102');var _0xaa4b44=![];var _0x1ea1ff={'chatVersion':_0x4b88ad,'chatWebsiteAddressOrigin':_0x5887b3,'remote':_0x31a461['remote'],'query':querystring[_0xcced('0x19')](_[_0xcced('0x46')](_0x31a461['get']({'plain':!![]}),{'customerIp':_0x5a9723['headers'][_0xcced('0x96')]||_0x5a9723[_0xcced('0x78')]['x-real-ip']||_0x5a9723[_0xcced('0x103')][_0xcced('0x104')]||_0x5a9723['ip'],'referer':_0x5a9723[_0xcced('0x78')][_0xcced('0x105')],'openedInteractions':_0x413b6e,'maxInteractions':_0xdc49da,'virtual':_0x7fc2ba[_0xcced('0xfc')],'online':_0x55e362,'custom':_0x7fc2ba}))[_0xcced('0x106')](/'/g,'\x5c\x27')};_0x20ae4c[_0xcced('0x2c')](ejs[_0xcced('0x107')](Mustache['render'](_0x44abed,_0x1ea1ff),{'proactiveActions':_0x118083,'alignment':_0x31a461[_0xcced('0x108')],'verticalAlignment':_0x31a461[_0xcced('0x109')],'div_color':_0x31a461[_0xcced('0xe9')],'labelText':_0x31a461['labelText'],'text_color':_0x31a461[_0xcced('0x10a')],'text_button_color':_0x31a461['textButtonColor'],'button_color':_0x31a461[_0xcced('0x10b')],'background_color':_0x31a461[_0xcced('0x10c')],'hideWhenOffline':_0x31a461[_0xcced('0x10d')],'intervalId':_0x31a461['IntervalId'],'isDevelopment':_0xaa4b44,'chatVersion':_0x4b88ad}));})[_0xcced('0x1d')](handleError(_0x20ae4c,null));};exports[_0xcced('0x10e')]=function(_0x537fb1,_0x19cabf){var _0x1df2c1=_0x537fb1[_0xcced('0x4b')]['id'];var _0x1fba43=_0x537fb1[_0xcced('0x52')];var _0x1625a2=0xc8;var _0xba9177=null;return db['sequelize']['transaction']({'isolationLevel':db['sequelize'][_0xcced('0x10f')]['ISOLATION_LEVELS'][_0xcced('0x110')]},function(_0x483116){return db[_0xcced('0x31')][_0xcced('0xd1')]({'where':{'id':_0x1df2c1},'transaction':_0x483116})[_0xcced('0x15')](function(_0xae1e6c){if(_0xae1e6c){return db['ChatApplication'][_0xcced('0x27')]({'where':{'ChatWebsiteId':_0x1df2c1},'transaction':_0x483116})[_0xcced('0x15')](function(){var _0xc4d6e1=_[_0xcced('0x30')](_0x1fba43,function(_0x424acb){_0x424acb[_0xcced('0x54')]=_0x1df2c1;return _0x424acb;});return db[_0xcced('0x111')][_0xcced('0xd0')](_0xc4d6e1,{'transaction':_0x483116});});}else{_0x1625a2=0x194;_0xba9177=[];}});})[_0xcced('0x15')](function(){if(_0x1625a2!==0x194){return db[_0xcced('0x111')][_0xcced('0x112')]({'where':{'ChatWebsiteId':_0x1df2c1},'order':_0xcced('0x90')})['then'](function(_0x6f4603){_0xba9177=_0x6f4603;});}})[_0xcced('0x1d')](function(_0x7e965b){_0x1625a2=0x1f4;logger[_0xcced('0x1a')](_0x7e965b[_0xcced('0x2a')]);if(_0x7e965b[_0xcced('0x2b')]){delete _0x7e965b[_0xcced('0x2b')];}_0xba9177=_0x7e965b;})[_0xcced('0x113')](function(){if(_0xba9177===null){_0x19cabf[_0xcced('0x1e')](_0x1625a2);}else{if(_0x1625a2===0x1f4){_0x19cabf[_0xcced('0x1f')](_0x1625a2)['send'](_0xba9177);}else{_0x19cabf[_0xcced('0x1f')](_0x1625a2)[_0xcced('0x21')](_0xba9177);}}});};exports['getApplications']=function(_0x1c0aef,_0x5752e7){var _0x508a2c={};var _0x5519d2={};var _0x5abb43;var _0x13a150;return db[_0xcced('0x31')][_0xcced('0xd1')]({'where':{'id':_0x1c0aef[_0xcced('0x4b')]['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x5752e7,null))[_0xcced('0x15')](function(_0x35b680){if(_0x35b680){_0x5abb43=_0x35b680;_0x5519d2[_0xcced('0x35')]=_[_0xcced('0x37')](db['ChatApplication']['rawAttributes']);_0x5519d2[_0xcced('0x36')]=_['keys'](_0x1c0aef[_0xcced('0x36')]);_0x5519d2['filters']=_['intersection'](_0x5519d2[_0xcced('0x35')],_0x5519d2['query']);_0x508a2c[_0xcced('0x3a')]=_[_0xcced('0x39')](_0x5519d2[_0xcced('0x35')],qs['fields'](_0x1c0aef[_0xcced('0x36')][_0xcced('0x3b')]));_0x508a2c['attributes']=_0x508a2c[_0xcced('0x3a')][_0xcced('0x3c')]?_0x508a2c[_0xcced('0x3a')]:_0x5519d2['model'];_0x508a2c[_0xcced('0x3f')]=qs['sort'](_0x1c0aef['query'][_0xcced('0x40')]);_0x508a2c[_0xcced('0x41')]=qs[_0xcced('0x38')](_[_0xcced('0x42')](_0x1c0aef[_0xcced('0x36')],_0x5519d2[_0xcced('0x38')]));if(_0x1c0aef[_0xcced('0x36')][_0xcced('0x43')]){_0x508a2c[_0xcced('0x41')]=_['merge'](_0x508a2c['where'],{'$or':_[_0xcced('0x30')](_0x508a2c[_0xcced('0x3a')],function(_0x5c0d5d){var _0x16ed51={};_0x16ed51[_0x5c0d5d]={'$like':'%'+_0x1c0aef['query']['filter']+'%'};return _0x16ed51;})});}_0x508a2c=_['merge']({},_0x508a2c,_0x1c0aef[_0xcced('0x4c')]);return _0x5abb43['getApplications'](_0x508a2c);}})[_0xcced('0x15')](function(_0x2360e3){if(_0x2360e3){_0x13a150=_0x2360e3[_0xcced('0x3c')];if(!_0x1c0aef[_0xcced('0x36')][_0xcced('0x3d')](_0xcced('0x3e'))){_0x508a2c['limit']=qs[_0xcced('0x22')](_0x1c0aef['query'][_0xcced('0x22')]);_0x508a2c[_0xcced('0x25')]=qs['offset'](_0x1c0aef[_0xcced('0x36')][_0xcced('0x25')]);}return _0x5abb43[_0xcced('0x114')](_0x508a2c);}})[_0xcced('0x15')](function(_0x21f992){if(_0x21f992){return _0x21f992?{'count':_0x13a150,'rows':_0x21f992}:null;}})[_0xcced('0x15')](respondWithResult(_0x5752e7,null))[_0xcced('0x1d')](handleError(_0x5752e7,null));};exports['addProactiveActions']=function(_0x475627,_0x110077){return db[_0xcced('0x115')][_0xcced('0x4d')]({'where':{'id':_0x475627['params']['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x110077,null))['then'](function(_0x38fc70){if(_0x38fc70){return _0x38fc70['addProactiveActions'](_0x475627[_0xcced('0x52')][_0xcced('0x58')],_['omit'](_0x475627[_0xcced('0x52')],[_0xcced('0x58'),'id'])||{});}})[_0xcced('0x15')](respondWithResult(_0x110077,null))[_0xcced('0x1d')](handleError(_0x110077,null));};exports[_0xcced('0xfa')]=function(_0x23c4a0,_0x2001f5){var _0x3fa897={};var _0x2ea578={};var _0x5bcf03;var _0x4522e1;return db[_0xcced('0x31')][_0xcced('0xd1')]({'where':{'id':_0x23c4a0[_0xcced('0x4b')]['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x2001f5,null))[_0xcced('0x15')](function(_0x250d2a){if(_0x250d2a){_0x5bcf03=_0x250d2a;_0x2ea578[_0xcced('0x35')]=_['keys'](db[_0xcced('0x116')]['rawAttributes']);_0x2ea578[_0xcced('0x36')]=_['keys'](_0x23c4a0[_0xcced('0x36')]);_0x2ea578['filters']=_['intersection'](_0x2ea578[_0xcced('0x35')],_0x2ea578[_0xcced('0x36')]);_0x3fa897[_0xcced('0x3a')]=_[_0xcced('0x39')](_0x2ea578['model'],qs[_0xcced('0x3b')](_0x23c4a0[_0xcced('0x36')][_0xcced('0x3b')]));_0x3fa897[_0xcced('0x3a')]=_0x3fa897[_0xcced('0x3a')][_0xcced('0x3c')]?_0x3fa897[_0xcced('0x3a')]:_0x2ea578[_0xcced('0x35')];_0x3fa897['order']=qs[_0xcced('0x40')](_0x23c4a0[_0xcced('0x36')][_0xcced('0x40')]);_0x3fa897['where']=qs[_0xcced('0x38')](_['pick'](_0x23c4a0[_0xcced('0x36')],_0x2ea578[_0xcced('0x38')]));if(_0x23c4a0['query'][_0xcced('0x43')]){_0x3fa897[_0xcced('0x41')]=_[_0xcced('0x46')](_0x3fa897[_0xcced('0x41')],{'$or':_[_0xcced('0x30')](_0x3fa897['attributes'],function(_0x20ee43){var _0x5201ca={};_0x5201ca[_0x20ee43]={'$like':'%'+_0x23c4a0[_0xcced('0x36')][_0xcced('0x43')]+'%'};return _0x5201ca;})});}_0x3fa897=_[_0xcced('0x46')]({},_0x3fa897,_0x23c4a0[_0xcced('0x4c')]);return _0x5bcf03[_0xcced('0xfa')](_0x3fa897);}})[_0xcced('0x15')](function(_0x4f74ab){if(_0x4f74ab){_0x4522e1=_0x4f74ab[_0xcced('0x3c')];if(!_0x23c4a0[_0xcced('0x36')][_0xcced('0x3d')](_0xcced('0x3e'))){_0x3fa897[_0xcced('0x22')]=qs[_0xcced('0x22')](_0x23c4a0[_0xcced('0x36')][_0xcced('0x22')]);_0x3fa897[_0xcced('0x25')]=qs[_0xcced('0x25')](_0x23c4a0[_0xcced('0x36')][_0xcced('0x25')]);}return _0x5bcf03[_0xcced('0xfa')](_0x3fa897);}})['then'](function(_0x126d2c){if(_0x126d2c){return _0x126d2c?{'count':_0x4522e1,'rows':_0x126d2c}:null;}})[_0xcced('0x15')](respondWithResult(_0x2001f5,null))[_0xcced('0x1d')](handleError(_0x2001f5,null));};exports[_0xcced('0x117')]=function(_0x541e29,_0x3d97b5){var _0x4df014=_0x541e29[_0xcced('0x36')][_0xcced('0x118')]===_0xcced('0x119')?_0xcced('0x11a'):_0xcced('0x11b');return db['ChatWebsite']['find']({'attributes':['id',_0x4df014],'where':{'id':_0x541e29['params']['id']}})['then'](handleEntityNotFound(_0x3d97b5,null))[_0xcced('0x15')](function(_0x21c43d){if(_0x21c43d){var _0x11050f=_0x21c43d[_0x4df014];var _0x1bd368=_0x11050f&&_0x11050f[_0xcced('0x11c')]?_0x11050f[_0xcced('0x11c')]:[];_0x3d97b5[_0xcced('0x2c')]({'fromKey':_[_0xcced('0x6d')](_0x11050f['fromKey'])?undefined:_0x11050f[_0xcced('0x11d')],'count':_0x1bd368[_0xcced('0x3c')],'rows':_0x1bd368});}})[_0xcced('0x1d')](handleError(_0x3d97b5,null));};exports[_0xcced('0x11e')]=function(_0x54e75f,_0x559c0f){var _0x32f99f={'raw':![],'where':{}};var _0xc4c0ed={};var _0x3410d0={'count':0x0,'rows':[]};return db[_0xcced('0x31')][_0xcced('0xd1')]({'where':{'id':_0x54e75f['params']['id']}})['then'](handleEntityNotFound(_0x559c0f,null))['then'](function(_0x18dca6){if(_0x18dca6){_0xc4c0ed['model']=_[_0xcced('0x37')](db[_0xcced('0x11f')]['rawAttributes']);_0xc4c0ed[_0xcced('0x36')]=_[_0xcced('0x37')](_0x54e75f[_0xcced('0x36')]);_0xc4c0ed[_0xcced('0x38')]=_[_0xcced('0x39')](_0xc4c0ed[_0xcced('0x35')],_0xc4c0ed[_0xcced('0x36')]);_0x32f99f[_0xcced('0x3a')]=_[_0xcced('0x39')](_0xc4c0ed[_0xcced('0x35')],qs[_0xcced('0x3b')](_0x54e75f[_0xcced('0x36')][_0xcced('0x3b')]));_0x32f99f[_0xcced('0x3a')]=_0x32f99f[_0xcced('0x3a')]['length']?_0x32f99f['attributes']:_0xc4c0ed[_0xcced('0x35')];if(!_0x54e75f[_0xcced('0x36')][_0xcced('0x3d')](_0xcced('0x3e'))){_0x32f99f[_0xcced('0x22')]=qs[_0xcced('0x22')](_0x54e75f[_0xcced('0x36')][_0xcced('0x22')]);_0x32f99f[_0xcced('0x25')]=qs[_0xcced('0x25')](_0x54e75f['query']['offset']);}_0x32f99f[_0xcced('0x3f')]=qs['sort'](_0x54e75f['query'][_0xcced('0x40')]);_0x32f99f[_0xcced('0x41')]=qs['filters'](_[_0xcced('0x42')](_0x54e75f[_0xcced('0x36')],_0xc4c0ed[_0xcced('0x38')]));_0x32f99f['where'][_0xcced('0x54')]=_0x18dca6['id'];if(_0x54e75f[_0xcced('0x36')]['filter']){_0x32f99f['where']=_[_0xcced('0x46')](_0x32f99f[_0xcced('0x41')],{'$or':_[_0xcced('0x30')](_0x32f99f[_0xcced('0x3a')],function(_0x4f63c9){var _0x53b4b8={};_0x53b4b8[_0x4f63c9]={'$like':'%'+_0x54e75f[_0xcced('0x36')][_0xcced('0x43')]+'%'};return _0x53b4b8;})});}_0x32f99f=_[_0xcced('0x46')]({},_0x32f99f,_0x54e75f[_0xcced('0x4c')]);return db[_0xcced('0x11f')]['count']({'where':_0x32f99f[_0xcced('0x41')]})[_0xcced('0x15')](function(_0xe329ab){_0x3410d0['count']=_0xe329ab;if(_0x54e75f[_0xcced('0x36')][_0xcced('0x47')]){_0x32f99f['include']=[{'all':!![]}];}else{_0x32f99f['include']=[{'model':db[_0xcced('0x87')],'as':_0xcced('0x120'),'required':![]},{'model':db[_0xcced('0xcf')],'as':_0xcced('0x121'),'required':![]}];}return db[_0xcced('0x11f')][_0xcced('0x49')](_0x32f99f);})[_0xcced('0x15')](function(_0x19f355){_0x3410d0[_0xcced('0x5c')]=_0x19f355;return _0x3410d0;});}})[_0xcced('0x15')](respondWithFilteredResult(_0x559c0f,_0x32f99f))[_0xcced('0x1d')](handleError(_0x559c0f,null));};exports[_0xcced('0x122')]=function(_0x3675f4,_0x562457){return db[_0xcced('0x31')][_0xcced('0x4d')]({'where':{'id':_0x3675f4[_0xcced('0x4b')]['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x562457,null))[_0xcced('0x15')](function(_0x3472ec){if(_0x3472ec){return _0x3472ec[_0xcced('0x122')](_0x3675f4['body'][_0xcced('0x58')],_[_0xcced('0xe3')](_0x3675f4[_0xcced('0x52')],['ids','id'])||{})[_0xcced('0xa8')](function(_0x27a447){for(var _0x14e490=0x0;_0x14e490<_0x3675f4[_0xcced('0x52')][_0xcced('0x58')][_0xcced('0x3c')];_0x14e490+=0x1){socket[_0xcced('0x123')](_0xcced('0x124'),{'UserId':Number(_0x3675f4[_0xcced('0x52')][_0xcced('0x58')][_0x14e490]),'ChatWebsiteId':Number(_0x3675f4[_0xcced('0x4b')]['id'])});}return _0x27a447;});}})[_0xcced('0x15')](respondWithResult(_0x562457,null))[_0xcced('0x1d')](handleError(_0x562457,null));};exports['removeAgents']=function(_0x160764,_0x4d0d2c){return db[_0xcced('0x31')][_0xcced('0x4d')]({'where':{'id':_0x160764['params']['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x4d0d2c,null))[_0xcced('0x15')](function(_0x4abe52){if(_0x4abe52){return _0x4abe52['removeAgents'](_0x160764[_0xcced('0x36')][_0xcced('0x58')])[_0xcced('0x15')](function(){if(_[_0xcced('0x125')](_0x160764['query'][_0xcced('0x58')])){for(var _0x523a90=0x0;_0x523a90<_0x160764['query'][_0xcced('0x58')][_0xcced('0x3c')];_0x523a90+=0x1){socket[_0xcced('0x123')](_0xcced('0x126'),{'UserId':Number(_0x160764[_0xcced('0x36')][_0xcced('0x58')][_0x523a90]),'ChatWebsiteId':Number(_0x160764[_0xcced('0x4b')]['id'])});}}else{socket[_0xcced('0x123')](_0xcced('0x126'),{'UserId':Number(_0x160764[_0xcced('0x36')][_0xcced('0x58')]),'ChatWebsiteId':Number(_0x160764['params']['id'])});}});}})[_0xcced('0x15')](respondWithStatusCode(_0x4d0d2c,null))[_0xcced('0x1d')](handleError(_0x4d0d2c,null));};exports[_0xcced('0x127')]=function(_0x55e328,_0x340e31){var _0x58e0ee={};var _0x223776={};var _0x1781f9;var _0x2c50ad;return db['ChatWebsite'][_0xcced('0xd1')]({'where':{'id':_0x55e328[_0xcced('0x4b')]['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x340e31,null))['then'](function(_0x15c9ea){if(_0x15c9ea){_0x1781f9=_0x15c9ea;_0x223776[_0xcced('0x35')]=_['keys'](db['User'][_0xcced('0x32')]);_0x223776[_0xcced('0x36')]=_[_0xcced('0x37')](_0x55e328[_0xcced('0x36')]);_0x223776['filters']=_[_0xcced('0x39')](_0x223776[_0xcced('0x35')],_0x223776[_0xcced('0x36')]);_0x58e0ee['attributes']=_[_0xcced('0x39')](_0x223776[_0xcced('0x35')],qs['fields'](_0x55e328['query'][_0xcced('0x3b')]));_0x58e0ee[_0xcced('0x3a')]=_0x58e0ee[_0xcced('0x3a')]['length']?_0x58e0ee[_0xcced('0x3a')]:_0x223776[_0xcced('0x35')];_0x58e0ee['order']=qs['sort'](_0x55e328[_0xcced('0x36')][_0xcced('0x40')]);_0x58e0ee[_0xcced('0x41')]=qs[_0xcced('0x38')](_[_0xcced('0x42')](_0x55e328[_0xcced('0x36')],_0x223776[_0xcced('0x38')]));if(_0x55e328[_0xcced('0x36')][_0xcced('0x43')]){_0x58e0ee[_0xcced('0x41')]=_[_0xcced('0x46')](_0x58e0ee[_0xcced('0x41')],{'$or':_[_0xcced('0x30')](_0x58e0ee[_0xcced('0x3a')],function(_0x41f2e6){var _0x33f0a5={};_0x33f0a5[_0x41f2e6]={'$like':'%'+_0x55e328[_0xcced('0x36')][_0xcced('0x43')]+'%'};return _0x33f0a5;})});}_0x58e0ee=_[_0xcced('0x46')]({},_0x58e0ee,_0x55e328[_0xcced('0x4c')]);return _0x1781f9['getAgents'](_0x58e0ee);}})[_0xcced('0x15')](function(_0x14b2d7){if(_0x14b2d7){_0x2c50ad=_0x14b2d7[_0xcced('0x3c')];if(!_0x55e328[_0xcced('0x36')][_0xcced('0x3d')]('nolimit')){_0x58e0ee['limit']=qs[_0xcced('0x22')](_0x55e328[_0xcced('0x36')][_0xcced('0x22')]);_0x58e0ee[_0xcced('0x25')]=qs[_0xcced('0x25')](_0x55e328[_0xcced('0x36')][_0xcced('0x25')]);}return _0x1781f9['getAgents'](_0x58e0ee);}})[_0xcced('0x15')](function(_0x473792){if(_0x473792){return _0x473792?{'count':_0x2c50ad,'rows':_0x473792}:null;}})[_0xcced('0x15')](respondWithResult(_0x340e31,null))['catch'](handleError(_0x340e31,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 08eda43..98795b6 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 _0xb66c=['update','remove','emit','hook','exports','events','ChatWebsite','save'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb66c,0x175));var _0xcb66=function(_0x4bb5e3,_0x938d49){_0x4bb5e3=_0x4bb5e3-0x0;var _0x2d49a5=_0xb66c[_0x4bb5e3];return _0x2d49a5;};'use strict';var EventEmitter=require(_0xcb66('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0xcb66('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcb66('0x2'),'afterUpdate':_0xcb66('0x3'),'afterDestroy':_0xcb66('0x4')};function emitEvent(_0x5f487c){return function(_0x35d439,_0x386241,_0x3f7cc7){ChatWebsiteEvents[_0xcb66('0x5')](_0x5f487c+':'+_0x35d439['id'],_0x35d439);ChatWebsiteEvents['emit'](_0x5f487c,_0x35d439);_0x3f7cc7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0xcb66('0x6')](e,emitEvent(event));}}module[_0xcb66('0x7')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0xa9b1=['exports','ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x2fc012,_0x503e5b){var _0x2891f9=function(_0x295f5e){while(--_0x295f5e){_0x2fc012['push'](_0x2fc012['shift']());}};_0x2891f9(++_0x503e5b);}(_0xa9b1,0x133));var _0x1a9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa9b1[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var ChatWebsite=require('../../mysqldb')['db'][_0x1a9b('0x0')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x1a9b('0x1')](0x0);var events={'afterCreate':_0x1a9b('0x2'),'afterUpdate':_0x1a9b('0x3'),'afterDestroy':_0x1a9b('0x4')};function emitEvent(_0x10c90c){return function(_0x52f55f,_0x57b453,_0x4914cd){ChatWebsiteEvents[_0x1a9b('0x5')](_0x10c90c+':'+_0x52f55f['id'],_0x52f55f);ChatWebsiteEvents[_0x1a9b('0x5')](_0x10c90c,_0x52f55f);_0x4914cd(null);};}for(var e in events){if(events[_0x1a9b('0x6')](e)){var event=events[e];ChatWebsite[_0x1a9b('0x7')](e,emitEvent(event));}}module[_0x1a9b('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 9f5d7d8..2377bc6 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 _0x0fa8=['ChatWebsite','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatWebsite.attributes','define'];(function(_0x492b20,_0x5af7db){var _0x2416fa=function(_0x428d34){while(--_0x428d34){_0x492b20['push'](_0x492b20['shift']());}};_0x2416fa(++_0x5af7db);}(_0x0fa8,0x91));var _0x80fa=function(_0x512891,_0x46005a){_0x512891=_0x512891-0x0;var _0x1c190c=_0x0fa8[_0x512891];return _0x1c190c;};'use strict';var _=require(_0x80fa('0x0'));var util=require(_0x80fa('0x1'));var logger=require(_0x80fa('0x2'))(_0x80fa('0x3'));var moment=require(_0x80fa('0x4'));var BPromise=require(_0x80fa('0x5'));var rp=require(_0x80fa('0x6'));var fs=require('fs');var path=require(_0x80fa('0x7'));var rimraf=require('rimraf');var config=require(_0x80fa('0x8'));var attributes=require(_0x80fa('0x9'));module['exports']=function(_0x4aa7fa,_0x2c84a4){return _0x4aa7fa[_0x80fa('0xa')](_0x80fa('0xb'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3075=['define','ChatWebsite','chat_websites','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x2ed7d1,_0x363741){var _0x38ae3c=function(_0x4a1b42){while(--_0x4a1b42){_0x2ed7d1['push'](_0x2ed7d1['shift']());}};_0x38ae3c(++_0x363741);}(_0x3075,0x1e3));var _0x5307=function(_0x32daf0,_0x4ea4c0){_0x32daf0=_0x32daf0-0x0;var _0x39361c=_0x3075[_0x32daf0];return _0x39361c;};'use strict';var _=require(_0x5307('0x0'));var util=require('util');var logger=require(_0x5307('0x1'))(_0x5307('0x2'));var moment=require(_0x5307('0x3'));var BPromise=require(_0x5307('0x4'));var rp=require(_0x5307('0x5'));var fs=require('fs');var path=require(_0x5307('0x6'));var rimraf=require('rimraf');var config=require(_0x5307('0x7'));var attributes=require('./chatWebsite.attributes');module[_0x5307('0x8')]=function(_0x41967b,_0xfda21){return _0x41967b[_0x5307('0x9')](_0x5307('0xa'),attributes,{'tableName':_0x5307('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index 31f4a2b..8a4a296 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 _0x90c4=['then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','./chatWebsite.socket','register'];(function(_0x18ae58,_0x242c57){var _0x37dd9e=function(_0x2b2d6f){while(--_0x2b2d6f){_0x18ae58['push'](_0x18ae58['shift']());}};_0x37dd9e(++_0x242c57);}(_0x90c4,0x186));var _0x490c=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x90c4[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x490c('0x0'));var util=require(_0x490c('0x1'));var moment=require(_0x490c('0x2'));var BPromise=require('bluebird');var rs=require(_0x490c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x490c('0x4'))['db'];var utils=require(_0x490c('0x5'));var logger=require(_0x490c('0x6'))(_0x490c('0x7'));var config=require('../../config/environment');var jayson=require(_0x490c('0x8'));var client=jayson[_0x490c('0x9')][_0x490c('0xa')]({'port':0x232a});config[_0x490c('0xb')]=_['defaults'](config[_0x490c('0xb')],{'host':_0x490c('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x490c('0xb')]));require(_0x490c('0xd'))[_0x490c('0xe')](socket);function respondWithRpcPromise(_0x5755f6,_0x39ab83,_0x52776f){return new BPromise(function(_0xc0e936,_0x2f3516){return client['request'](_0x5755f6,_0x52776f)[_0x490c('0xf')](function(_0x20abfd){logger[_0x490c('0x10')](_0x490c('0x11'),_0x39ab83,'request\x20sent');logger[_0x490c('0x12')](_0x490c('0x13'),_0x39ab83,_0x490c('0x14'),JSON[_0x490c('0x15')](_0x20abfd));if(_0x20abfd[_0x490c('0x16')]){if(_0x20abfd[_0x490c('0x16')][_0x490c('0x17')]===0x1f4){logger[_0x490c('0x16')](_0x490c('0x11'),_0x39ab83,_0x20abfd[_0x490c('0x16')][_0x490c('0x18')]);return _0x2f3516(_0x20abfd[_0x490c('0x16')][_0x490c('0x18')]);}logger[_0x490c('0x16')](_0x490c('0x11'),_0x39ab83,_0x20abfd[_0x490c('0x16')][_0x490c('0x18')]);return _0xc0e936(_0x20abfd[_0x490c('0x16')][_0x490c('0x18')]);}else{logger[_0x490c('0x10')](_0x490c('0x11'),_0x39ab83,'request\x20sent');_0xc0e936(_0x20abfd[_0x490c('0x19')]['message']);}})[_0x490c('0x1a')](function(_0x3b9f0b){logger['error'](_0x490c('0x11'),_0x39ab83,_0x3b9f0b);_0x2f3516(_0x3b9f0b);});});}
\ No newline at end of file
+var _0x421c=['info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','request'];(function(_0xe256e9,_0x5f605d){var _0xc17b10=function(_0x2f0cab){while(--_0x2f0cab){_0xe256e9['push'](_0xe256e9['shift']());}};_0xc17b10(++_0x5f605d);}(_0x421c,0x190));var _0xc421=function(_0x4e0101,_0x41208b){_0x4e0101=_0x4e0101-0x0;var _0x5ba014=_0x421c[_0x4e0101];return _0x5ba014;};'use strict';var _=require(_0xc421('0x0'));var util=require(_0xc421('0x1'));var moment=require(_0xc421('0x2'));var BPromise=require(_0xc421('0x3'));var rs=require(_0xc421('0x4'));var fs=require('fs');var Redis=require(_0xc421('0x5'));var db=require(_0xc421('0x6'))['db'];var utils=require(_0xc421('0x7'));var logger=require(_0xc421('0x8'))(_0xc421('0x9'));var config=require(_0xc421('0xa'));var jayson=require(_0xc421('0xb'));var client=jayson[_0xc421('0xc')][_0xc421('0xd')]({'port':0x232a});config[_0xc421('0xe')]=_[_0xc421('0xf')](config[_0xc421('0xe')],{'host':_0xc421('0x10'),'port':0x18eb});var socket=require(_0xc421('0x11'))(new Redis(config[_0xc421('0xe')]));require(_0xc421('0x12'))['register'](socket);function respondWithRpcPromise(_0x59a090,_0x5c4bfa,_0x3cd89d){return new BPromise(function(_0x2df8f6,_0x120316){return client[_0xc421('0x13')](_0x59a090,_0x3cd89d)['then'](function(_0x2a0c0e){logger[_0xc421('0x14')](_0xc421('0x15'),_0x5c4bfa,_0xc421('0x16'));logger['debug'](_0xc421('0x17'),_0x5c4bfa,_0xc421('0x16'),JSON[_0xc421('0x18')](_0x2a0c0e));if(_0x2a0c0e[_0xc421('0x19')]){if(_0x2a0c0e[_0xc421('0x19')]['code']===0x1f4){logger[_0xc421('0x19')](_0xc421('0x15'),_0x5c4bfa,_0x2a0c0e[_0xc421('0x19')][_0xc421('0x1a')]);return _0x120316(_0x2a0c0e['error'][_0xc421('0x1a')]);}logger[_0xc421('0x19')](_0xc421('0x15'),_0x5c4bfa,_0x2a0c0e['error'][_0xc421('0x1a')]);return _0x2df8f6(_0x2a0c0e[_0xc421('0x19')]['message']);}else{logger[_0xc421('0x14')](_0xc421('0x15'),_0x5c4bfa,'request\x20sent');_0x2df8f6(_0x2a0c0e[_0xc421('0x1b')]['message']);}})['catch'](function(_0x57dbca){logger[_0xc421('0x19')](_0xc421('0x15'),_0x5c4bfa,_0x57dbca);_0x120316(_0x57dbca);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 1501158..12b200d 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 _0x5068=['removeListener','register','length','./chatWebsite.events','update'];(function(_0x5b621b,_0x3df21e){var _0x8eda75=function(_0x27a64e){while(--_0x27a64e){_0x5b621b['push'](_0x5b621b['shift']());}};_0x8eda75(++_0x3df21e);}(_0x5068,0x152));var _0x8506=function(_0x5b1e8d,_0x5bcb25){_0x5b1e8d=_0x5b1e8d-0x0;var _0x51d2a9=_0x5068[_0x5b1e8d];return _0x51d2a9;};'use strict';var ChatWebsiteEvents=require(_0x8506('0x0'));var events=['save','remove',_0x8506('0x1')];function createListener(_0x499fec,_0x12d0ef){return function(_0x30867e){_0x12d0ef['emit'](_0x499fec,_0x30867e);};}function removeListener(_0x36b439,_0x13825f){return function(){ChatWebsiteEvents[_0x8506('0x2')](_0x36b439,_0x13825f);};}exports[_0x8506('0x3')]=function(_0x1c0914){for(var _0x38602f=0x0,_0x527e92=events[_0x8506('0x4')];_0x38602f<_0x527e92;_0x38602f++){var _0x387d4b=events[_0x38602f];var _0x1ec1f4=createListener('chatWebsite:'+_0x387d4b,_0x1c0914);ChatWebsiteEvents['on'](_0x387d4b,_0x1ec1f4);}};
\ No newline at end of file
+var _0xe48f=['save','remove','register','length','chatWebsite:'];(function(_0xb2b806,_0x2f8113){var _0x569b6d=function(_0x5596be){while(--_0x5596be){_0xb2b806['push'](_0xb2b806['shift']());}};_0x569b6d(++_0x2f8113);}(_0xe48f,0x1e5));var _0xfe48=function(_0x5cc655,_0x4b6145){_0x5cc655=_0x5cc655-0x0;var _0x244379=_0xe48f[_0x5cc655];return _0x244379;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0xfe48('0x0'),_0xfe48('0x1'),'update'];function createListener(_0x4c13ca,_0xaecdbb){return function(_0x49aa2c){_0xaecdbb['emit'](_0x4c13ca,_0x49aa2c);};}function removeListener(_0x209df9,_0x472ba1){return function(){ChatWebsiteEvents['removeListener'](_0x209df9,_0x472ba1);};}exports[_0xfe48('0x2')]=function(_0x4b7610){for(var _0x2faacb=0x0,_0x353965=events[_0xfe48('0x3')];_0x2faacb<_0x353965;_0x2faacb++){var _0x4e5dbd=events[_0x2faacb];var _0x5e011e=createListener(_0xfe48('0x4')+_0x4e5dbd,_0x4b7610);ChatWebsiteEvents['on'](_0x4e5dbd,_0x5e011e);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 946614e..21550b2 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 _0x9463=['express','fs-extra','../../components/auth/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','/:id/users','getAgents','post','addDisposition','addAnswer','diskStorage','root','format','%s-%s','now','originalname','single','file','server/files/images/avatars/','join','/:id/customer_avatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','addInteraction','addApplications','addProactiveActions','addAgents','put','delete','/:id/dispositions','removeDispositions','removeAnswers','removeAgents','util','path','connect-timeout'];(function(_0x340380,_0x4bd2a8){var _0x49ce1c=function(_0x4cb9e2){while(--_0x4cb9e2){_0x340380['push'](_0x340380['shift']());}};_0x49ce1c(++_0x4bd2a8);}(_0x9463,0x142));var _0x3946=function(_0x10fe86,_0x4e3e53){_0x10fe86=_0x10fe86-0x0;var _0x1acb8b=_0x9463[_0x10fe86];return _0x1acb8b;};'use strict';var multer=require('multer');var util=require(_0x3946('0x0'));var path=require(_0x3946('0x1'));var timeout=require(_0x3946('0x2'));var express=require(_0x3946('0x3'));var router=express['Router']();var fs_extra=require(_0x3946('0x4'));var auth=require(_0x3946('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3946('0x6'));var controller=require(_0x3946('0x7'));router[_0x3946('0x8')]('/',auth[_0x3946('0x9')](),controller['index']);router['get'](_0x3946('0xa'),auth[_0x3946('0x9')](),controller[_0x3946('0xb')]);router[_0x3946('0x8')](_0x3946('0xc'),auth['isAuthenticated'](),controller[_0x3946('0xd')]);router['get']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x3946('0xe')]);router[_0x3946('0x8')](_0x3946('0xf'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x3946('0x8')]('/:id/logo',controller['getLogo']);router[_0x3946('0x8')](_0x3946('0x10'),controller[_0x3946('0x11')]);router[_0x3946('0x8')]('/:id/customer_avatar',controller[_0x3946('0x12')]);router[_0x3946('0x8')](_0x3946('0x13'),controller['getSystemAvatar']);router[_0x3946('0x8')](_0x3946('0x14'),auth[_0x3946('0x9')](),controller[_0x3946('0x15')]);router['get']('/:id/snippet',controller[_0x3946('0x16')]);router[_0x3946('0x8')](_0x3946('0x17'),auth[_0x3946('0x9')](),controller['getApplications']);router[_0x3946('0x8')](_0x3946('0x18'),auth[_0x3946('0x9')](),controller[_0x3946('0x19')]);router[_0x3946('0x8')](_0x3946('0x1a'),controller[_0x3946('0x1b')]);router['get']('/:id/offline_messages',auth[_0x3946('0x9')](),controller[_0x3946('0x1c')]);router['get'](_0x3946('0x1d'),auth['isAuthenticated'](),controller[_0x3946('0x1e')]);router[_0x3946('0x1f')]('/',auth[_0x3946('0x9')](),controller['create']);router['post']('/:id/dispositions',auth[_0x3946('0x9')](),controller[_0x3946('0x20')]);router[_0x3946('0x1f')](_0x3946('0xf'),auth[_0x3946('0x9')](),controller[_0x3946('0x21')]);var upload=multer({'storage':multer[_0x3946('0x22')]({'destination':function(_0x145bac,_0x5dcf28,_0x11b78d){_0x11b78d(null,path['join'](config[_0x3946('0x23')],'server/files/images/logos/'));},'filename':function(_0x2dba28,_0x168feb,_0x61b715){_0x61b715(null,util[_0x3946('0x24')](_0x3946('0x25'),Date[_0x3946('0x26')](),_0x168feb[_0x3946('0x27')]));}})});router[_0x3946('0x1f')]('/:id/logo',upload[_0x3946('0x28')](_0x3946('0x29')),controller['addLogo']);var upload=multer({'storage':multer[_0x3946('0x22')]({'destination':function(_0x14c963,_0x45e11a,_0x1ec481){_0x1ec481(null,path['join'](config['root'],_0x3946('0x2a')));},'filename':function(_0x1f1607,_0x164ff0,_0x49386e){_0x49386e(null,util['format']('%s-%s',Date['now'](),_0x164ff0[_0x3946('0x27')]));}})});router[_0x3946('0x1f')](_0x3946('0x10'),upload[_0x3946('0x28')]('file'),controller['addAvatar']);var upload=multer({'storage':multer[_0x3946('0x22')]({'destination':function(_0x34f18a,_0x4f5c35,_0x3c04ce){_0x3c04ce(null,path[_0x3946('0x2b')](config['root'],_0x3946('0x2a')));},'filename':function(_0x44da5b,_0xb92993,_0x41ca06){_0x41ca06(null,util[_0x3946('0x24')]('%s-%s',Date[_0x3946('0x26')](),_0xb92993[_0x3946('0x27')]));}})});router[_0x3946('0x1f')](_0x3946('0x2c'),upload[_0x3946('0x28')](_0x3946('0x29')),controller[_0x3946('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3d1395,_0x5125f2,_0x412bc1){_0x412bc1(null,path[_0x3946('0x2b')](config[_0x3946('0x23')],_0x3946('0x2a')));},'filename':function(_0x5b8713,_0x5a9c1d,_0x196fe7){_0x196fe7(null,util[_0x3946('0x24')](_0x3946('0x25'),Date[_0x3946('0x26')](),_0x5a9c1d[_0x3946('0x27')]));}})});router[_0x3946('0x1f')]('/:id/system_avatar',upload[_0x3946('0x28')](_0x3946('0x29')),controller[_0x3946('0x2e')]);router[_0x3946('0x1f')](_0x3946('0x2f'),controller[_0x3946('0x30')]);const offlineUploadMulter=multer({'storage':multer[_0x3946('0x22')]({'destination':function(_0x3805a9,_0x118596,_0x1a7e6c){const _0x5b496c=path[_0x3946('0x2b')](config[_0x3946('0x23')],'server/files',_0x3946('0x31'),_0x3946('0x32'));fs_extra[_0x3946('0x33')](_0x5b496c,function(){_0x1a7e6c(null,_0x5b496c);});},'filename':function(_0x4e6125,_0x20438d,_0xbdd79){const _0x2afaa7=_0x20438d[_0x3946('0x27')][_0x3946('0x34')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0xfc04b3=path[_0x3946('0x35')](_0x2afaa7);const _0x6f9dab=Date[_0x3946('0x26')]()+'-'+_0x2afaa7[_0x3946('0x34')](_0xfc04b3,'')+_0xfc04b3;_0xbdd79(null,_0x6f9dab);}})});router['post'](_0x3946('0x36'),offlineUploadMulter['any'](),controller['offline']);router[_0x3946('0x1f')](_0x3946('0x14'),auth[_0x3946('0x9')](),controller[_0x3946('0x37')]);router[_0x3946('0x1f')](_0x3946('0x17'),auth[_0x3946('0x9')](),controller[_0x3946('0x38')]);router[_0x3946('0x1f')](_0x3946('0x18'),auth[_0x3946('0x9')](),controller[_0x3946('0x39')]);router[_0x3946('0x1f')](_0x3946('0x1d'),auth['isAuthenticated'](),controller[_0x3946('0x3a')]);router[_0x3946('0x3b')](_0x3946('0xc'),auth[_0x3946('0x9')](),controller['update']);router[_0x3946('0x3c')](_0x3946('0xc'),auth[_0x3946('0x9')](),controller['destroy']);router[_0x3946('0x3c')](_0x3946('0x3d'),auth[_0x3946('0x9')](),controller[_0x3946('0x3e')]);router['delete'](_0x3946('0xf'),auth[_0x3946('0x9')](),controller[_0x3946('0x3f')]);router[_0x3946('0x3c')](_0x3946('0x1d'),auth[_0x3946('0x9')](),controller[_0x3946('0x40')]);module['exports']=router;
\ No newline at end of file
+var _0x0bfb=['/:id/logo','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','originalname','single','file','addLogo','server/files/images/avatars/','now','addAvatar','/:id/customer_avatar','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','replace','extname','/:id/offline','addInteraction','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers'];(function(_0x49c24f,_0x39766f){var _0x5a3327=function(_0x29662d){while(--_0x29662d){_0x49c24f['push'](_0x49c24f['shift']());}};_0x5a3327(++_0x39766f);}(_0x0bfb,0x87));var _0xb0bf=function(_0x160efe,_0x109650){_0x160efe=_0x160efe-0x0;var _0x25592f=_0x0bfb[_0x160efe];return _0x25592f;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xb0bf('0x0'));var express=require(_0xb0bf('0x1'));var router=express[_0xb0bf('0x2')]();var fs_extra=require(_0xb0bf('0x3'));var auth=require(_0xb0bf('0x4'));var interaction=require(_0xb0bf('0x5'));var config=require('../../config/environment');var controller=require(_0xb0bf('0x6'));router[_0xb0bf('0x7')]('/',auth[_0xb0bf('0x8')](),controller['index']);router[_0xb0bf('0x7')](_0xb0bf('0x9'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0xa')]);router[_0xb0bf('0x7')](_0xb0bf('0xb'),auth['isAuthenticated'](),controller[_0xb0bf('0xc')]);router[_0xb0bf('0x7')](_0xb0bf('0xd'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0xe')]);router['get'](_0xb0bf('0xf'),auth['isAuthenticated'](),controller[_0xb0bf('0x10')]);router[_0xb0bf('0x7')](_0xb0bf('0x11'),controller[_0xb0bf('0x12')]);router[_0xb0bf('0x7')](_0xb0bf('0x13'),controller[_0xb0bf('0x14')]);router[_0xb0bf('0x7')]('/:id/customer_avatar',controller[_0xb0bf('0x15')]);router[_0xb0bf('0x7')]('/:id/system_avatar',controller[_0xb0bf('0x16')]);router[_0xb0bf('0x7')](_0xb0bf('0x17'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x18')]);router['get'](_0xb0bf('0x19'),controller['getSnippet']);router[_0xb0bf('0x7')](_0xb0bf('0x1a'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x1b')]);router['get'](_0xb0bf('0x1c'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x1d')]);router['get'](_0xb0bf('0x1e'),controller[_0xb0bf('0x1f')]);router['get'](_0xb0bf('0x20'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x21')]);router[_0xb0bf('0x7')](_0xb0bf('0x22'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x23')]);router[_0xb0bf('0x24')]('/',auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x25')]);router['post'](_0xb0bf('0xd'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x26')]);router[_0xb0bf('0x24')](_0xb0bf('0xf'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x27')]);var upload=multer({'storage':multer[_0xb0bf('0x28')]({'destination':function(_0x10daca,_0x1d250e,_0x4fc431){_0x4fc431(null,path[_0xb0bf('0x29')](config[_0xb0bf('0x2a')],_0xb0bf('0x2b')));},'filename':function(_0x200de6,_0x5eefbf,_0x75390b){_0x75390b(null,util[_0xb0bf('0x2c')](_0xb0bf('0x2d'),Date['now'](),_0x5eefbf[_0xb0bf('0x2e')]));}})});router[_0xb0bf('0x24')](_0xb0bf('0x11'),upload[_0xb0bf('0x2f')](_0xb0bf('0x30')),controller[_0xb0bf('0x31')]);var upload=multer({'storage':multer[_0xb0bf('0x28')]({'destination':function(_0x4d9e32,_0x5a526b,_0x368936){_0x368936(null,path[_0xb0bf('0x29')](config[_0xb0bf('0x2a')],_0xb0bf('0x32')));},'filename':function(_0x598110,_0x19fcc2,_0x35e542){_0x35e542(null,util[_0xb0bf('0x2c')](_0xb0bf('0x2d'),Date[_0xb0bf('0x33')](),_0x19fcc2[_0xb0bf('0x2e')]));}})});router['post']('/:id/avatar',upload['single'](_0xb0bf('0x30')),controller[_0xb0bf('0x34')]);var upload=multer({'storage':multer[_0xb0bf('0x28')]({'destination':function(_0x5e2a4c,_0x376bdb,_0x5f2691){_0x5f2691(null,path[_0xb0bf('0x29')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x4f01de,_0x43fe49,_0x1dde0b){_0x1dde0b(null,util[_0xb0bf('0x2c')](_0xb0bf('0x2d'),Date[_0xb0bf('0x33')](),_0x43fe49['originalname']));}})});router['post'](_0xb0bf('0x35'),upload[_0xb0bf('0x2f')](_0xb0bf('0x30')),controller[_0xb0bf('0x36')]);var upload=multer({'storage':multer[_0xb0bf('0x28')]({'destination':function(_0x497433,_0x398586,_0xe0f4e4){_0xe0f4e4(null,path[_0xb0bf('0x29')](config[_0xb0bf('0x2a')],_0xb0bf('0x32')));},'filename':function(_0x4b62a0,_0x559969,_0x629bd7){_0x629bd7(null,util[_0xb0bf('0x2c')](_0xb0bf('0x2d'),Date[_0xb0bf('0x33')](),_0x559969[_0xb0bf('0x2e')]));}})});router[_0xb0bf('0x24')](_0xb0bf('0x37'),upload[_0xb0bf('0x2f')]('file'),controller[_0xb0bf('0x38')]);router[_0xb0bf('0x24')](_0xb0bf('0x39'),controller[_0xb0bf('0x3a')]);const offlineUploadMulter=multer({'storage':multer[_0xb0bf('0x28')]({'destination':function(_0x983c1b,_0x6afb3b,_0xebfb8f){const _0x2bfa67=path['join'](config['root'],_0xb0bf('0x3b'),_0xb0bf('0x3c'),_0xb0bf('0x3d'));fs_extra['ensureDir'](_0x2bfa67,function(){_0xebfb8f(null,_0x2bfa67);});},'filename':function(_0x5e7377,_0x5b11ad,_0x4f771b){const _0x11dda6=_0x5b11ad[_0xb0bf('0x2e')][_0xb0bf('0x3e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0xa5d1a5=path[_0xb0bf('0x3f')](_0x11dda6);const _0x35b942=Date['now']()+'-'+_0x11dda6['replace'](_0xa5d1a5,'')+_0xa5d1a5;_0x4f771b(null,_0x35b942);}})});router['post'](_0xb0bf('0x40'),offlineUploadMulter['any'](),controller['offline']);router['post'](_0xb0bf('0x17'),auth['isAuthenticated'](),controller[_0xb0bf('0x41')]);router['post'](_0xb0bf('0x1a'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x42')]);router['post'](_0xb0bf('0x1c'),auth['isAuthenticated'](),controller[_0xb0bf('0x43')]);router[_0xb0bf('0x24')](_0xb0bf('0x22'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x44')]);router[_0xb0bf('0x45')]('/:id',auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x46')]);router[_0xb0bf('0x47')]('/:id',auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x48')]);router['delete'](_0xb0bf('0xd'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x49')]);router['delete'](_0xb0bf('0xf'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x4a')]);router[_0xb0bf('0x47')](_0xb0bf('0x22'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x4b')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index cd85d02..c05a4e4 100644
--- a/server/api/client-side-logs.js
+++ b/server/api/client-side-logs.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x45fb=['Client-Side\x20logger\x20not\x20found!','isAuthenticated','exports','express','../components/auth/service','../config/environment','Router','app','get'];(function(_0x1f62e4,_0x24435f){var _0x50014b=function(_0x1b4685){while(--_0x1b4685){_0x1f62e4['push'](_0x1f62e4['shift']());}};_0x50014b(++_0x24435f);}(_0x45fb,0x1e0));var _0xb45f=function(_0x4b5f85,_0x470f26){_0x4b5f85=_0x4b5f85-0x0;var _0x18bdc3=_0x45fb[_0x4b5f85];return _0x18bdc3;};var beaverLogger=require('beaver-logger/server');var express=require(_0xb45f('0x0'));var auth=require(_0xb45f('0x1'));var config=require(_0xb45f('0x2'));var router=express[_0xb45f('0x3')]();var isProduction=config['env']==='production'||![];function clientSideLogs(_0x1f2fc0,_0x3097cf,_0x17e842){var _0x3bd429=_0x1f2fc0[_0xb45f('0x4')][_0xb45f('0x5')]('client-side-logger');if(!_0x3bd429){throw new Error(_0xb45f('0x6'));}return beaverLogger['expressEndpoint']({'uri':'/client-logs','logger':_0x3bd429,'enableCors':!isProduction})(_0x1f2fc0,_0x3097cf,_0x17e842);}router['use'](auth[_0xb45f('0x7')](),clientSideLogs);module[_0xb45f('0x8')]=router;
\ No newline at end of file
+var _0x38f8=['use','isAuthenticated','express','../components/auth/service','../config/environment','Router','production','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs'];(function(_0x101cad,_0x4e873c){var _0x25d010=function(_0x18a2ed){while(--_0x18a2ed){_0x101cad['push'](_0x101cad['shift']());}};_0x25d010(++_0x4e873c);}(_0x38f8,0x141));var _0x838f=function(_0x311e9b,_0x2937f4){_0x311e9b=_0x311e9b-0x0;var _0x26284c=_0x38f8[_0x311e9b];return _0x26284c;};var beaverLogger=require('beaver-logger/server');var express=require(_0x838f('0x0'));var auth=require(_0x838f('0x1'));var config=require(_0x838f('0x2'));var router=express[_0x838f('0x3')]();var isProduction=config['env']===_0x838f('0x4')||![];function clientSideLogs(_0x4f5a79,_0x35c5dd,_0x348d0d){var _0x2adfab=_0x4f5a79['app']['get'](_0x838f('0x5'));if(!_0x2adfab){throw new Error(_0x838f('0x6'));}return beaverLogger[_0x838f('0x7')]({'uri':_0x838f('0x8'),'logger':_0x2adfab,'enableCors':!isProduction})(_0x4f5a79,_0x35c5dd,_0x348d0d);}router[_0x838f('0x9')](auth[_0x838f('0xa')](),clientSideLogs);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 0af557f..e3929e7 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 _0x5bc8=['STRING','ENUM','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','sequelize'];(function(_0x17f7c3,_0x461edb){var _0x2d5d98=function(_0x34393a){while(--_0x34393a){_0x17f7c3['push'](_0x17f7c3['shift']());}};_0x2d5d98(++_0x461edb);}(_0x5bc8,0xcf));var _0x85bc=function(_0x137d1d,_0x35c663){_0x137d1d=_0x137d1d-0x0;var _0x485108=_0x5bc8[_0x137d1d];return _0x485108;};'use strict';var Sequelize=require(_0x85bc('0x0'));module['exports']={'name':{'type':Sequelize[_0x85bc('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x85bc('0x2')]('AmazonAWS','Google',_0x85bc('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x85bc('0x4'),_0x85bc('0x5'))},'data1':{'type':Sequelize[_0x85bc('0x1')],'comment':_0x85bc('0x6')},'data2':{'type':Sequelize[_0x85bc('0x1')],'comment':_0x85bc('0x7')},'data3':{'type':Sequelize[_0x85bc('0x1')],'comment':_0x85bc('0x8')},'data4':{'type':Sequelize[_0x85bc('0x1')],'comment':_0x85bc('0x9')},'data5':{'type':Sequelize[_0x85bc('0xa')],'comment':_0x85bc('0xb')},'data6':{'type':Sequelize[_0x85bc('0xa')],'comment':_0x85bc('0xc')},'data7':{'type':Sequelize[_0x85bc('0xa')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}};
\ No newline at end of file
+var _0x7836=['sequelize','exports','ENUM','MicrosoftAzure','Outlook365','STRING','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'];(function(_0x3b4027,_0x375f0c){var _0x17080b=function(_0x12cbbd){while(--_0x12cbbd){_0x3b4027['push'](_0x3b4027['shift']());}};_0x17080b(++_0x375f0c);}(_0x7836,0x138));var _0x6783=function(_0x1d70e6,_0x31f6eb){_0x1d70e6=_0x1d70e6-0x0;var _0x2d61cb=_0x7836[_0x1d70e6];return _0x2d61cb;};'use strict';var Sequelize=require(_0x6783('0x0'));module[_0x6783('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x6783('0x2')]('AmazonAWS','Google',_0x6783('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x6783('0x2')](_0x6783('0x4'),'Dynamics365')},'data1':{'type':Sequelize[_0x6783('0x5')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0x6783('0x5')],'comment':_0x6783('0x6')},'data3':{'type':Sequelize[_0x6783('0x5')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0x6783('0x5')],'comment':_0x6783('0x7')},'data5':{'type':Sequelize[_0x6783('0x8')],'comment':_0x6783('0x9')},'data6':{'type':Sequelize[_0x6783('0x8')],'comment':_0x6783('0xa')},'data7':{'type':Sequelize[_0x6783('0x8')],'comment':_0x6783('0xb')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index eabc1cd..a731719 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 _0x804d=['includeAll','include','findAll','rows','service','decryptString','data3','catch','show','params','keys','fields','length','find','MicrosoftAzure','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','encryptString','destroy','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','isValidIdToken','oauth2Claims','Unable\x20to\x20validate\x20id_token','code','data5','access_token','data6','refresh_token','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','send','stringify','lodash','ioredis','../../components/parsers/qs','../../config/environment','../../config/logger','api','./cloudProvider.oauth','redis','defaults','localhost','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','then','error','stack','slice','index','map','CloudProvider','rawAttributes','fieldName','type','name','filters','intersection','model','query','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0x5305ad,_0x218c3b){var _0x494d19=function(_0x15a501){while(--_0x15a501){_0x5305ad['push'](_0x5305ad['shift']());}};_0x494d19(++_0x218c3b);}(_0x804d,0x92));var _0xd804=function(_0x58139f,_0x43bca5){_0x58139f=_0x58139f-0x0;var _0x52b78c=_0x804d[_0x58139f];return _0x52b78c;};'use strict';var _=require(_0xd804('0x0'));var Redis=require(_0xd804('0x1'));var qs=require(_0xd804('0x2'));var encryptor=require('../../components/encryptor');var config=require(_0xd804('0x3'));var logger=require(_0xd804('0x4'))(_0xd804('0x5'));var db=require('../../mysqldb')['db'];var oauth=require(_0xd804('0x6'));config[_0xd804('0x7')]=_[_0xd804('0x8')](config[_0xd804('0x7')],{'host':_0xd804('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd804('0x7')]));var redis=new Redis(config[_0xd804('0x7')]);function respondWithStatusCode(_0x2c32db,_0x1bc4fb){_0x1bc4fb=_0x1bc4fb||0xcc;return function(_0x50a669){if(_0x50a669){return _0x2c32db[_0xd804('0xa')](_0x1bc4fb);}return _0x2c32db[_0xd804('0xb')](_0x1bc4fb)[_0xd804('0xc')]();};}function respondWithResult(_0x1aa18e,_0x3ba37f){_0x3ba37f=_0x3ba37f||0xc8;return function(_0x4458cb){if(_0x4458cb){return _0x1aa18e[_0xd804('0xb')](_0x3ba37f)[_0xd804('0xd')](_0x4458cb);}};}function respondWithFilteredResult(_0x5840a2,_0x120088){return function(_0x42431d){if(_0x42431d){var _0x36bf91=typeof _0x120088[_0xd804('0xe')]===_0xd804('0xf')&&typeof _0x120088[_0xd804('0x10')]===_0xd804('0xf');var _0x36e27e=_0x42431d[_0xd804('0x11')];var _0x209822=_0x36bf91?0x0:_0x120088[_0xd804('0xe')];var _0x1a1123=_0x36bf91?_0x42431d[_0xd804('0x11')]:_0x120088['offset']+_0x120088[_0xd804('0x10')];var _0x1bae94;if(_0x1a1123>=_0x36e27e){_0x1a1123=_0x36e27e;_0x1bae94=0xc8;}else{_0x1bae94=0xce;}_0x5840a2[_0xd804('0xb')](_0x1bae94);return _0x5840a2['set'](_0xd804('0x12'),_0x209822+'-'+_0x1a1123+'/'+_0x36e27e)['json'](_0x42431d);}return null;};}function saveUpdates(_0x517330){return function(_0x2c0251){if(_0x2c0251){return _0x2c0251[_0xd804('0x13')](_0x517330)[_0xd804('0x14')](function(_0x56f55a){return _0x56f55a;});}return null;};}function removeEntity(_0x4258a8){return function(_0x4fce8d){if(_0x4fce8d){return _0x4fce8d['destroy']()[_0xd804('0x14')](function(){_0x4258a8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x31bb3e){return function(_0x1a6c14){if(!_0x1a6c14){_0x31bb3e['sendStatus'](0x194);}return _0x1a6c14;};}function handleError(_0x55240e,_0x48321f){_0x48321f=_0x48321f||0x1f4;return function(_0xab14e){logger[_0xd804('0x15')](_0xab14e[_0xd804('0x16')]);if(_0xab14e['name']){delete _0xab14e['name'];}_0x55240e[_0xd804('0xb')](_0x48321f)['send'](_0xab14e);};}function maskClientSecret(_0x44f6c2){return _['padEnd'](_0x44f6c2[_0xd804('0x17')](0x0,0x3),0x14,'*');}exports[_0xd804('0x18')]=function(_0x3fea52,_0x490e0f){var _0x33a304={},_0x3660d3={},_0x250f74={'count':0x0,'rows':[]};var _0x277796=_[_0xd804('0x19')](db[_0xd804('0x1a')][_0xd804('0x1b')],function(_0x4ce42c){return{'name':_0x4ce42c[_0xd804('0x1c')],'type':_0x4ce42c[_0xd804('0x1d')]['key']};});_0x3660d3['model']=_[_0xd804('0x19')](_0x277796,_0xd804('0x1e'));_0x3660d3['query']=_['keys'](_0x3fea52['query']);_0x3660d3[_0xd804('0x1f')]=_[_0xd804('0x20')](_0x3660d3[_0xd804('0x21')],_0x3660d3[_0xd804('0x22')]);_0x33a304[_0xd804('0x23')]=_[_0xd804('0x20')](_0x3660d3[_0xd804('0x21')],qs['fields'](_0x3fea52['query']['fields']));_0x33a304[_0xd804('0x23')]=_0x33a304[_0xd804('0x23')]['length']?_0x33a304[_0xd804('0x23')]:_0x3660d3[_0xd804('0x21')];if(!_0x3fea52['query'][_0xd804('0x24')](_0xd804('0x25'))){_0x33a304[_0xd804('0x10')]=qs[_0xd804('0x10')](_0x3fea52['query'][_0xd804('0x10')]);_0x33a304[_0xd804('0xe')]=qs[_0xd804('0xe')](_0x3fea52['query'][_0xd804('0xe')]);}_0x33a304[_0xd804('0x26')]=qs[_0xd804('0x27')](_0x3fea52[_0xd804('0x22')][_0xd804('0x27')]);_0x33a304[_0xd804('0x28')]=qs[_0xd804('0x1f')](_[_0xd804('0x29')](_0x3fea52[_0xd804('0x22')],_0x3660d3[_0xd804('0x1f')]),_0x277796);if(_0x3fea52['query'][_0xd804('0x2a')]){_0x33a304[_0xd804('0x28')]=_[_0xd804('0x2b')](_0x33a304[_0xd804('0x28')],{'$or':_[_0xd804('0x19')](_0x277796,function(_0x537a5a){if(_0x537a5a[_0xd804('0x1d')]!==_0xd804('0x2c')){var _0xf8dab3={};_0xf8dab3[_0x537a5a['name']]={'$like':'%'+_0x3fea52[_0xd804('0x22')][_0xd804('0x2a')]+'%'};return _0xf8dab3;}})});}_0x33a304=_[_0xd804('0x2b')]({},_0x33a304,_0x3fea52[_0xd804('0x2d')]);var _0x2cea0d={'where':_0x33a304[_0xd804('0x28')]};return db['CloudProvider'][_0xd804('0x11')](_0x2cea0d)['then'](function(_0x2a860b){_0x250f74['count']=_0x2a860b;if(_0x3fea52[_0xd804('0x22')][_0xd804('0x2e')]){_0x33a304[_0xd804('0x2f')]=[{'all':!![]}];}return db['CloudProvider'][_0xd804('0x30')](_0x33a304);})[_0xd804('0x14')](function(_0x22a1f1){_0x250f74[_0xd804('0x31')]=_['map'](_0x22a1f1,function(_0x4b8784){if(_0x4b8784[_0xd804('0x32')]==='MicrosoftAzure'){var _0x23aed7=encryptor[_0xd804('0x33')](_0x4b8784[_0xd804('0x34')]);_0x4b8784[_0xd804('0x34')]=maskClientSecret(_0x23aed7);}return _0x4b8784;});return _0x250f74;})[_0xd804('0x14')](respondWithFilteredResult(_0x490e0f,_0x33a304))[_0xd804('0x35')](handleError(_0x490e0f,null));};exports[_0xd804('0x36')]=function(_0x3ae2f3,_0x4e3a69){var _0x3c980f={'raw':!![],'where':{'id':_0x3ae2f3[_0xd804('0x37')]['id']}},_0x284851={};_0x284851[_0xd804('0x21')]=_[_0xd804('0x38')](db[_0xd804('0x1a')][_0xd804('0x1b')]);_0x284851[_0xd804('0x22')]=_[_0xd804('0x38')](_0x3ae2f3['query']);_0x284851[_0xd804('0x1f')]=_[_0xd804('0x20')](_0x284851[_0xd804('0x21')],_0x284851[_0xd804('0x22')]);_0x3c980f[_0xd804('0x23')]=_[_0xd804('0x20')](_0x284851[_0xd804('0x21')],qs[_0xd804('0x39')](_0x3ae2f3[_0xd804('0x22')][_0xd804('0x39')]));_0x3c980f[_0xd804('0x23')]=_0x3c980f[_0xd804('0x23')][_0xd804('0x3a')]?_0x3c980f['attributes']:_0x284851[_0xd804('0x21')];if(_0x3ae2f3[_0xd804('0x22')][_0xd804('0x2e')]){_0x3c980f[_0xd804('0x2f')]=[{'all':!![]}];}_0x3c980f=_[_0xd804('0x2b')]({},_0x3c980f,_0x3ae2f3[_0xd804('0x2d')]);return db[_0xd804('0x1a')][_0xd804('0x3b')](_0x3c980f)[_0xd804('0x14')](handleEntityNotFound(_0x4e3a69,null))[_0xd804('0x14')](function(_0xa368d0){if(_0xa368d0['service']===_0xd804('0x3c')){var _0x390c25=encryptor[_0xd804('0x33')](_0xa368d0[_0xd804('0x34')]);_0xa368d0[_0xd804('0x34')]=maskClientSecret(_0x390c25);}return _0xa368d0;})[_0xd804('0x14')](respondWithResult(_0x4e3a69,null))['catch'](handleError(_0x4e3a69,null));};exports[_0xd804('0x3d')]=function(_0x532e65,_0x130491){if(!_0x532e65[_0xd804('0x3e')]['name'])throw new Error(_0xd804('0x3f'));if(!_0x532e65[_0xd804('0x3e')][_0xd804('0x32')])throw new Error(_0xd804('0x40'));var _0xf7efa8=db[_0xd804('0x1a')][_0xd804('0x1b')][_0xd804('0x32')][_0xd804('0x41')];if(!_0xf7efa8['includes'](_0x532e65[_0xd804('0x3e')][_0xd804('0x32')]))throw new Error(_0xd804('0x42')+_0xf7efa8['join'](',\x20'));if(_0x532e65['body'][_0xd804('0x32')]==='MicrosoftAzure'&&_0x532e65[_0xd804('0x3e')][_0xd804('0x34')]){_0x532e65['body'][_0xd804('0x34')]=encryptor[_0xd804('0x43')](_0x532e65[_0xd804('0x3e')][_0xd804('0x34')]);}return db['CloudProvider'][_0xd804('0x3d')](_0x532e65['body'],{})['then'](respondWithResult(_0x130491,0xc9))[_0xd804('0x35')](handleError(_0x130491,null));};exports['update']=function(_0x3dbc20,_0x2a1f00){if(_0x3dbc20[_0xd804('0x3e')]['id']){delete _0x3dbc20[_0xd804('0x3e')]['id'];}return db['CloudProvider'][_0xd804('0x3b')]({'where':{'id':_0x3dbc20[_0xd804('0x37')]['id']}})[_0xd804('0x14')](handleEntityNotFound(_0x2a1f00,null))[_0xd804('0x14')](function(_0xe30001){if(_0xe30001[_0xd804('0x32')]===_0xd804('0x3c')&&_0x3dbc20[_0xd804('0x3e')]['data3']){_0x3dbc20['body'][_0xd804('0x34')]=encryptor[_0xd804('0x43')](_0x3dbc20[_0xd804('0x3e')][_0xd804('0x34')]);}return _0xe30001;})[_0xd804('0x14')](saveUpdates(_0x3dbc20['body'],null))[_0xd804('0x14')](respondWithResult(_0x2a1f00,null))[_0xd804('0x35')](handleError(_0x2a1f00,null));};exports[_0xd804('0x44')]=function(_0x55a442,_0x26e990){return db[_0xd804('0x1a')][_0xd804('0x3b')]({'where':{'id':_0x55a442[_0xd804('0x37')]['id']}})[_0xd804('0x14')](handleEntityNotFound(_0x26e990,null))['then'](removeEntity(_0x26e990,null))['catch'](handleError(_0x26e990,null));};exports[_0xd804('0x45')]=function(_0x190e54,_0x8450ef){return db[_0xd804('0x1a')][_0xd804('0x46')]({'where':{'id':_0x190e54[_0xd804('0x37')]['id']},'raw':!![]})[_0xd804('0x14')](function(_0xa72b39){if(!_0xa72b39)return _0x8450ef[_0xd804('0xa')](0x194);return{'url':oauth[_0xd804('0x47')](_0xa72b39,_0x190e54[_0xd804('0x48')]['id'])};})['then'](respondWithResult(_0x8450ef,null))[_0xd804('0x35')](handleError(_0x8450ef,null));};exports[_0xd804('0x49')]=function(_0x31cb28,_0x2d3239){var _0x1d5abd=_0x31cb28[_0xd804('0x3e')];var _0x15c214;var _0x3f4934;if(_0x1d5abd[_0xd804('0x15')])throw _0x1d5abd;redis[_0xd804('0x4a')](_0x1d5abd[_0xd804('0x4b')])[_0xd804('0x14')](function(_0x21b69a){if(!_0x21b69a)throw new Error(_0xd804('0x4c'));_0x15c214=JSON[_0xd804('0x4d')](_0x21b69a);var _0x3f18c0=Buffer[_0xd804('0x4e')](_0x1d5abd[_0xd804('0x4b')],_0xd804('0x4f'))[_0xd804('0x50')](_0xd804('0x51'));_0x3f4934=JSON[_0xd804('0x4d')](_0x3f18c0);if(!oauth[_0xd804('0x52')](_0x1d5abd['id_token'],_0x15c214[_0xd804('0x53')]))throw new Error(_0xd804('0x54'));redis['del'](_0x1d5abd['state']);return oauth['getOauth2MicrosoftAccessToken'](_0x1d5abd[_0xd804('0x55')],_0x15c214);})[_0xd804('0x14')](function(_0xf10562){_0x15c214[_0xd804('0x56')]=_0xf10562[_0xd804('0x57')];_0x15c214[_0xd804('0x58')]=_0xf10562[_0xd804('0x59')];return db[_0xd804('0x1a')][_0xd804('0x13')]({'data5':_0x15c214['data5'],'data6':_0x15c214[_0xd804('0x58')]},{'where':{'id':_0x15c214['id']}});})[_0xd804('0x14')](function(){oauth['startRefreshInterval'](_0x15c214);socket[_0xd804('0x5a')](_0xd804('0x5b'),{'id':_0x3f4934['id']});return;})['then'](respondWithStatusCode(_0x2d3239,null))[_0xd804('0x35')](function(_0xe193aa){if(_0x3f4934){socket[_0xd804('0x5a')](_0xd804('0x5c'),{'id':_0x3f4934['id']});}if(!_0x15c214){logger[_0xd804('0x15')](_0xd804('0x5d'),_0xe193aa);return _0x2d3239[_0xd804('0xb')](0x1f4)[_0xd804('0x5e')](_0xe193aa['message']);}logger[_0xd804('0x15')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x15c214['id'],JSON[_0xd804('0x5f')](_0xe193aa));});};
\ No newline at end of file
+var _0xe13a=['hasOwnProperty','nolimit','offset','sort','filters','filter','merge','where','options','CloudProvider','includeAll','findAll','MicrosoftAzure','decryptString','data3','catch','show','include','find','service','body','Name\x20parameter\x20not\x20specified','rawAttributes','values','join','encryptString','params','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','error','state','parse','from','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','del','getOauth2MicrosoftAccessToken','code','data5','access_token','refresh_token','startRefreshInterval','microsoftAuthorization:success','send','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','localhost','socket.io-emitter','sendStatus','status','end','undefined','limit','count','set','Content-Range','json','update','then','destroy','stack','name','padEnd','slice','index','fieldName','type','map','query','intersection','model','attributes','fields','length'];(function(_0x4637c9,_0x51126e){var _0x434a20=function(_0x325f90){while(--_0x325f90){_0x4637c9['push'](_0x4637c9['shift']());}};_0x434a20(++_0x51126e);}(_0xe13a,0xe9));var _0xae13=function(_0x2a5763,_0x76820e){_0x2a5763=_0x2a5763-0x0;var _0x114144=_0xe13a[_0x2a5763];return _0x114144;};'use strict';var _=require(_0xae13('0x0'));var Redis=require(_0xae13('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0xae13('0x2'));var config=require(_0xae13('0x3'));var logger=require(_0xae13('0x4'))(_0xae13('0x5'));var db=require(_0xae13('0x6'))['db'];var oauth=require(_0xae13('0x7'));config[_0xae13('0x8')]=_['defaults'](config[_0xae13('0x8')],{'host':_0xae13('0x9'),'port':0x18eb});var socket=require(_0xae13('0xa'))(new Redis(config[_0xae13('0x8')]));var redis=new Redis(config[_0xae13('0x8')]);function respondWithStatusCode(_0x10a913,_0x13ae1e){_0x13ae1e=_0x13ae1e||0xcc;return function(_0x18f7b7){if(_0x18f7b7){return _0x10a913[_0xae13('0xb')](_0x13ae1e);}return _0x10a913[_0xae13('0xc')](_0x13ae1e)[_0xae13('0xd')]();};}function respondWithResult(_0x107895,_0x37f7e1){_0x37f7e1=_0x37f7e1||0xc8;return function(_0x156b99){if(_0x156b99){return _0x107895[_0xae13('0xc')](_0x37f7e1)['json'](_0x156b99);}};}function respondWithFilteredResult(_0x5af625,_0x3506f5){return function(_0x166f8c){if(_0x166f8c){var _0x7cd23e=typeof _0x3506f5['offset']===_0xae13('0xe')&&typeof _0x3506f5[_0xae13('0xf')]===_0xae13('0xe');var _0x5d1bbd=_0x166f8c[_0xae13('0x10')];var _0x56e461=_0x7cd23e?0x0:_0x3506f5['offset'];var _0x37b51c=_0x7cd23e?_0x166f8c[_0xae13('0x10')]:_0x3506f5['offset']+_0x3506f5['limit'];var _0x18bf31;if(_0x37b51c>=_0x5d1bbd){_0x37b51c=_0x5d1bbd;_0x18bf31=0xc8;}else{_0x18bf31=0xce;}_0x5af625[_0xae13('0xc')](_0x18bf31);return _0x5af625[_0xae13('0x11')](_0xae13('0x12'),_0x56e461+'-'+_0x37b51c+'/'+_0x5d1bbd)[_0xae13('0x13')](_0x166f8c);}return null;};}function saveUpdates(_0x365dbb){return function(_0x565173){if(_0x565173){return _0x565173[_0xae13('0x14')](_0x365dbb)[_0xae13('0x15')](function(_0x401037){return _0x401037;});}return null;};}function removeEntity(_0x324f49){return function(_0x37a11a){if(_0x37a11a){return _0x37a11a[_0xae13('0x16')]()[_0xae13('0x15')](function(){_0x324f49[_0xae13('0xc')](0xcc)[_0xae13('0xd')]();});}};}function handleEntityNotFound(_0x23cbc7){return function(_0x25324a){if(!_0x25324a){_0x23cbc7[_0xae13('0xb')](0x194);}return _0x25324a;};}function handleError(_0x25e8df,_0x4531c8){_0x4531c8=_0x4531c8||0x1f4;return function(_0x1f2d45){logger['error'](_0x1f2d45[_0xae13('0x17')]);if(_0x1f2d45[_0xae13('0x18')]){delete _0x1f2d45['name'];}_0x25e8df[_0xae13('0xc')](_0x4531c8)['send'](_0x1f2d45);};}function maskClientSecret(_0x4b83b9){return _[_0xae13('0x19')](_0x4b83b9[_0xae13('0x1a')](0x0,0x3),0x14,'*');}exports[_0xae13('0x1b')]=function(_0x463a9f,_0x56b368){var _0x5e9092={},_0x1068b6={},_0x15a331={'count':0x0,'rows':[]};var _0x313aa6=_['map'](db['CloudProvider']['rawAttributes'],function(_0x2111d5){return{'name':_0x2111d5[_0xae13('0x1c')],'type':_0x2111d5[_0xae13('0x1d')]['key']};});_0x1068b6['model']=_[_0xae13('0x1e')](_0x313aa6,_0xae13('0x18'));_0x1068b6['query']=_['keys'](_0x463a9f[_0xae13('0x1f')]);_0x1068b6['filters']=_[_0xae13('0x20')](_0x1068b6[_0xae13('0x21')],_0x1068b6[_0xae13('0x1f')]);_0x5e9092[_0xae13('0x22')]=_[_0xae13('0x20')](_0x1068b6[_0xae13('0x21')],qs[_0xae13('0x23')](_0x463a9f[_0xae13('0x1f')][_0xae13('0x23')]));_0x5e9092[_0xae13('0x22')]=_0x5e9092['attributes'][_0xae13('0x24')]?_0x5e9092[_0xae13('0x22')]:_0x1068b6[_0xae13('0x21')];if(!_0x463a9f[_0xae13('0x1f')][_0xae13('0x25')](_0xae13('0x26'))){_0x5e9092['limit']=qs[_0xae13('0xf')](_0x463a9f[_0xae13('0x1f')]['limit']);_0x5e9092[_0xae13('0x27')]=qs['offset'](_0x463a9f[_0xae13('0x1f')]['offset']);}_0x5e9092['order']=qs['sort'](_0x463a9f[_0xae13('0x1f')][_0xae13('0x28')]);_0x5e9092['where']=qs[_0xae13('0x29')](_['pick'](_0x463a9f['query'],_0x1068b6['filters']),_0x313aa6);if(_0x463a9f[_0xae13('0x1f')][_0xae13('0x2a')]){_0x5e9092['where']=_[_0xae13('0x2b')](_0x5e9092[_0xae13('0x2c')],{'$or':_['map'](_0x313aa6,function(_0x37de1f){if(_0x37de1f['type']!=='VIRTUAL'){var _0x254bd7={};_0x254bd7[_0x37de1f[_0xae13('0x18')]]={'$like':'%'+_0x463a9f[_0xae13('0x1f')][_0xae13('0x2a')]+'%'};return _0x254bd7;}})});}_0x5e9092=_['merge']({},_0x5e9092,_0x463a9f[_0xae13('0x2d')]);var _0x168315={'where':_0x5e9092['where']};return db[_0xae13('0x2e')]['count'](_0x168315)[_0xae13('0x15')](function(_0x942c32){_0x15a331[_0xae13('0x10')]=_0x942c32;if(_0x463a9f[_0xae13('0x1f')][_0xae13('0x2f')]){_0x5e9092['include']=[{'all':!![]}];}return db[_0xae13('0x2e')][_0xae13('0x30')](_0x5e9092);})[_0xae13('0x15')](function(_0x22ae48){_0x15a331['rows']=_[_0xae13('0x1e')](_0x22ae48,function(_0x5b7e91){if(_0x5b7e91['service']===_0xae13('0x31')){var _0x5c9796=encryptor[_0xae13('0x32')](_0x5b7e91[_0xae13('0x33')]);_0x5b7e91['data3']=maskClientSecret(_0x5c9796);}return _0x5b7e91;});return _0x15a331;})[_0xae13('0x15')](respondWithFilteredResult(_0x56b368,_0x5e9092))[_0xae13('0x34')](handleError(_0x56b368,null));};exports[_0xae13('0x35')]=function(_0x5c1dcc,_0x56076e){var _0x305eef={'raw':!![],'where':{'id':_0x5c1dcc['params']['id']}},_0x56ebd5={};_0x56ebd5[_0xae13('0x21')]=_['keys'](db[_0xae13('0x2e')]['rawAttributes']);_0x56ebd5[_0xae13('0x1f')]=_['keys'](_0x5c1dcc['query']);_0x56ebd5[_0xae13('0x29')]=_['intersection'](_0x56ebd5[_0xae13('0x21')],_0x56ebd5[_0xae13('0x1f')]);_0x305eef[_0xae13('0x22')]=_[_0xae13('0x20')](_0x56ebd5[_0xae13('0x21')],qs[_0xae13('0x23')](_0x5c1dcc[_0xae13('0x1f')][_0xae13('0x23')]));_0x305eef[_0xae13('0x22')]=_0x305eef[_0xae13('0x22')]['length']?_0x305eef[_0xae13('0x22')]:_0x56ebd5[_0xae13('0x21')];if(_0x5c1dcc['query']['includeAll']){_0x305eef[_0xae13('0x36')]=[{'all':!![]}];}_0x305eef=_[_0xae13('0x2b')]({},_0x305eef,_0x5c1dcc[_0xae13('0x2d')]);return db[_0xae13('0x2e')][_0xae13('0x37')](_0x305eef)[_0xae13('0x15')](handleEntityNotFound(_0x56076e,null))[_0xae13('0x15')](function(_0x57c512){if(_0x57c512[_0xae13('0x38')]===_0xae13('0x31')){var _0x126bd8=encryptor[_0xae13('0x32')](_0x57c512[_0xae13('0x33')]);_0x57c512[_0xae13('0x33')]=maskClientSecret(_0x126bd8);}return _0x57c512;})[_0xae13('0x15')](respondWithResult(_0x56076e,null))[_0xae13('0x34')](handleError(_0x56076e,null));};exports['create']=function(_0x37338f,_0x2076f8){if(!_0x37338f[_0xae13('0x39')][_0xae13('0x18')])throw new Error(_0xae13('0x3a'));if(!_0x37338f[_0xae13('0x39')]['service'])throw new Error('Service\x20parameter\x20not\x20specified');var _0x419c53=db['CloudProvider'][_0xae13('0x3b')][_0xae13('0x38')][_0xae13('0x3c')];if(!_0x419c53['includes'](_0x37338f[_0xae13('0x39')][_0xae13('0x38')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x419c53[_0xae13('0x3d')](',\x20'));if(_0x37338f[_0xae13('0x39')]['service']===_0xae13('0x31')&&_0x37338f['body']['data3']){_0x37338f['body'][_0xae13('0x33')]=encryptor[_0xae13('0x3e')](_0x37338f[_0xae13('0x39')]['data3']);}return db[_0xae13('0x2e')]['create'](_0x37338f[_0xae13('0x39')],{})[_0xae13('0x15')](respondWithResult(_0x2076f8,0xc9))[_0xae13('0x34')](handleError(_0x2076f8,null));};exports[_0xae13('0x14')]=function(_0x23242a,_0x2827e5){if(_0x23242a[_0xae13('0x39')]['id']){delete _0x23242a[_0xae13('0x39')]['id'];}return db['CloudProvider'][_0xae13('0x37')]({'where':{'id':_0x23242a['params']['id']}})[_0xae13('0x15')](handleEntityNotFound(_0x2827e5,null))[_0xae13('0x15')](function(_0x3804d4){if(_0x3804d4['service']===_0xae13('0x31')&&_0x23242a[_0xae13('0x39')][_0xae13('0x33')]){_0x23242a[_0xae13('0x39')]['data3']=encryptor[_0xae13('0x3e')](_0x23242a['body'][_0xae13('0x33')]);}return _0x3804d4;})['then'](saveUpdates(_0x23242a[_0xae13('0x39')],null))[_0xae13('0x15')](respondWithResult(_0x2827e5,null))['catch'](handleError(_0x2827e5,null));};exports[_0xae13('0x16')]=function(_0x1aa1c4,_0x1742db){return db[_0xae13('0x2e')][_0xae13('0x37')]({'where':{'id':_0x1aa1c4[_0xae13('0x3f')]['id']}})[_0xae13('0x15')](handleEntityNotFound(_0x1742db,null))[_0xae13('0x15')](removeEntity(_0x1742db,null))[_0xae13('0x34')](handleError(_0x1742db,null));};exports[_0xae13('0x40')]=function(_0x180558,_0x1842a5){return db[_0xae13('0x2e')][_0xae13('0x41')]({'where':{'id':_0x180558[_0xae13('0x3f')]['id']},'raw':!![]})[_0xae13('0x15')](function(_0xd847d7){if(!_0xd847d7)return _0x1842a5['sendStatus'](0x194);return{'url':oauth[_0xae13('0x42')](_0xd847d7,_0x180558[_0xae13('0x43')]['id'])};})[_0xae13('0x15')](respondWithResult(_0x1842a5,null))['catch'](handleError(_0x1842a5,null));};exports['oauth2MicrosoftCallback']=function(_0x37c6ad,_0x220ee9){var _0x2b6634=_0x37c6ad[_0xae13('0x39')];var _0x5b04fb;var _0x61b922;if(_0x2b6634[_0xae13('0x44')])throw _0x2b6634;redis['get'](_0x2b6634[_0xae13('0x45')])[_0xae13('0x15')](function(_0x4c2614){if(!_0x4c2614)throw new Error('Invalid\x20state\x20parameter');_0x5b04fb=JSON[_0xae13('0x46')](_0x4c2614);var _0x10903c=Buffer[_0xae13('0x47')](_0x2b6634[_0xae13('0x45')],_0xae13('0x48'))[_0xae13('0x49')](_0xae13('0x4a'));_0x61b922=JSON[_0xae13('0x46')](_0x10903c);if(!oauth[_0xae13('0x4b')](_0x2b6634[_0xae13('0x4c')],_0x5b04fb[_0xae13('0x4d')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0xae13('0x4e')](_0x2b6634['state']);return oauth[_0xae13('0x4f')](_0x2b6634[_0xae13('0x50')],_0x5b04fb);})[_0xae13('0x15')](function(_0x3e7771){_0x5b04fb[_0xae13('0x51')]=_0x3e7771[_0xae13('0x52')];_0x5b04fb['data6']=_0x3e7771[_0xae13('0x53')];return db['CloudProvider'][_0xae13('0x14')]({'data5':_0x5b04fb[_0xae13('0x51')],'data6':_0x5b04fb['data6']},{'where':{'id':_0x5b04fb['id']}});})[_0xae13('0x15')](function(){oauth[_0xae13('0x54')](_0x5b04fb);socket['emit'](_0xae13('0x55'),{'id':_0x61b922['id']});return;})[_0xae13('0x15')](respondWithStatusCode(_0x220ee9,null))[_0xae13('0x34')](function(_0x3b3091){if(_0x61b922){socket['emit']('microsoftAuthorization:error',{'id':_0x61b922['id']});}if(!_0x5b04fb){logger['error']('Invalid\x20authentication\x20state\x20parameter',_0x3b3091);return _0x220ee9[_0xae13('0xc')](0x1f4)[_0xae13('0x56')](_0x3b3091[_0xae13('0x57')]);}logger[_0xae13('0x44')](_0xae13('0x58'),_0x5b04fb['id'],JSON[_0xae13('0x59')](_0x3b3091));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index b77faed..4a0dc2c 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 _0x12a9=['request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','CloudProvider','lodash','api','moment','bluebird'];(function(_0x3c8e9a,_0x384306){var _0x2d4c57=function(_0x43d408){while(--_0x43d408){_0x3c8e9a['push'](_0x3c8e9a['shift']());}};_0x2d4c57(++_0x384306);}(_0x12a9,0xba));var _0x912a=function(_0x429796,_0x4ad866){_0x429796=_0x429796-0x0;var _0x240151=_0x12a9[_0x429796];return _0x240151;};'use strict';var _=require(_0x912a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x912a('0x1'));var moment=require(_0x912a('0x2'));var BPromise=require(_0x912a('0x3'));var rp=require(_0x912a('0x4'));var fs=require('fs');var path=require(_0x912a('0x5'));var rimraf=require(_0x912a('0x6'));var config=require(_0x912a('0x7'));var attributes=require(_0x912a('0x8'));module['exports']=function(_0x3efd9f,_0x5c5a79){return _0x3efd9f['define'](_0x912a('0x9'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa64a=['lodash','moment','bluebird','request-promise','path','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0xa64a,0xc6));var _0xaa64=function(_0x18bcbf,_0x518845){_0x18bcbf=_0x18bcbf-0x0;var _0x1286e9=_0xa64a[_0x18bcbf];return _0x1286e9;};'use strict';var _=require(_0xaa64('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xaa64('0x1'));var BPromise=require(_0xaa64('0x2'));var rp=require(_0xaa64('0x3'));var fs=require('fs');var path=require(_0xaa64('0x4'));var rimraf=require('rimraf');var config=require(_0xaa64('0x5'));var attributes=require(_0xaa64('0x6'));module[_0xaa64('0x7')]=function(_0x4455fa,_0x5bb598){return _0x4455fa[_0xaa64('0x8')](_0xaa64('0x9'),attributes,{'tableName':_0xaa64('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js
index 2fbf60e..390b66e 100644
--- a/server/api/cloudProvider/cloudProvider.oauth.js
+++ b/server/api/cloudProvider/cloudProvider.oauth.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x970f=['crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','push','Outlook365','data7','/.default','replace','{TENANT_ID}','data2','code','id_token','from','toString','base64','randomBytes','client_id','join','redirect_uri','data4','response_mode','form_post','prompt','key','value','oauth2Claims','data1','set','stringify','decode','iss','issuer','aud','audience','unix','exp','resolve','then','data3','CloudProvider','findOne','refresh_token','data6','POST','data5','access_token','update','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','decryptString','intervals','bind','findAll','all','inspect','error','exports','lodash'];(function(_0x473105,_0x155107){var _0x1ce13d=function(_0x4b8c98){while(--_0x4b8c98){_0x473105['push'](_0x473105['shift']());}};_0x1ce13d(++_0x155107);}(_0x970f,0xf2));var _0xf970=function(_0x252862,_0x2040a6){_0x252862=_0x252862-0x0;var _0x3ab7e2=_0x970f[_0x252862];return _0x3ab7e2;};'use strict';var _=require(_0xf970('0x0'));var crypto=require(_0xf970('0x1'));var jwt=require(_0xf970('0x2'));var moment=require(_0xf970('0x3'));var Redis=require(_0xf970('0x4'));var rp=require(_0xf970('0x5'));var util=require(_0xf970('0x6'));var encryptor=require(_0xf970('0x7'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0xf970('0x8'));var schedule=require(_0xf970('0x9'));var db=require(_0xf970('0xa'))['db'];config[_0xf970('0xb')]=_[_0xf970('0xc')](config[_0xf970('0xb')],{'host':_0xf970('0xd'),'port':0x18eb});var redis=new Redis(config[_0xf970('0xb')]);var MICROSOFT_AUTH_URL=_0xf970('0xe');var AZURE_AUTH_SCOPES={'Outlook365':[_0xf970('0xf'),_0xf970('0x10'),_0xf970('0x11'),'offline_access',_0xf970('0x12'),_0xf970('0x13'),_0xf970('0x14')],'Dynamics365':[_0xf970('0xf'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0xf970('0x15');var MICROSOFT_TOKEN_ENDPOINT=_0xf970('0x16');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x46d8f9){var _0x27b532=_[_0xf970('0x17')](AZURE_AUTH_SCOPES[_0x46d8f9['type']]);if(_0x46d8f9[_0xf970('0x18')]===_0xf970('0x19'))_0x27b532[_0xf970('0x1a')](_0x46d8f9['data7']+'/.default');return _0x27b532['join']('\x20');}function getAccessTokenScope(_0x4ad76a){if(_0x4ad76a['type']===_0xf970('0x1b'))return _0xf970('0x12');if(_0x4ad76a[_0xf970('0x18')]===_0xf970('0x19'))return _0x4ad76a[_0xf970('0x1c')]+_0xf970('0x1d');}function generateMicrosoftAuthorizationUrl(_0x1ec238,_0x4c7312){var _0xcbbb6c=MICROSOFT_AUTH_URL[_0xf970('0x1e')](_0xf970('0x1f'),_0x1ec238[_0xf970('0x20')]);var _0x59fa05=[_0xf970('0x21'),_0xf970('0x22')];var _0x3a7a85=Buffer[_0xf970('0x23')](JSON['stringify']({'id':_0x4c7312}))[_0xf970('0x24')](_0xf970('0x25'));var _0x6698c0=crypto[_0xf970('0x26')](0x10)[_0xf970('0x24')]('hex');var _0x1fd730=getAuthorizationScopes(_0x1ec238);var _0x4ab9fb=[{'key':_0xf970('0x27'),'value':_0x1ec238['data1']},{'key':'response_type','value':encodeURIComponent(_0x59fa05[_0xf970('0x28')]('\x20'))},{'key':_0xf970('0x29'),'value':_0x1ec238[_0xf970('0x2a')]},{'key':_0xf970('0x2b'),'value':_0xf970('0x2c')},{'key':'scope','value':encodeURIComponent(_0x1fd730)},{'key':'state','value':_0x3a7a85},{'key':'nonce','value':_0x6698c0},{'key':_0xf970('0x2d'),'value':'login'}];var _0x2450ce=_0xcbbb6c+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xf970('0x17')](_0x4ab9fb,function(_0x224866){return _0x224866[_0xf970('0x2e')]+'='+_0x224866[_0xf970('0x2f')];})[_0xf970('0x28')]('&');_0x1ec238[_0xf970('0x30')]={'issuer':_0xcbbb6c[_0xf970('0x1e')]('oauth2/',''),'audience':_0x1ec238[_0xf970('0x31')],'state':_0x3a7a85,'nonce':_0x6698c0};redis[_0xf970('0x32')](_0x3a7a85,JSON[_0xf970('0x33')](_0x1ec238));return _0x2450ce;}function isValidIdToken(_0x2400b4,_0x1f802d){try{var _0x25cd26=jwt[_0xf970('0x34')](_0x2400b4,{'complete':!![]});var _0x57ff6d=_0x25cd26['payload'];if(_0x57ff6d[_0xf970('0x35')]!==_0x1f802d[_0xf970('0x36')])return![];if(_0x57ff6d[_0xf970('0x37')]!==_0x1f802d[_0xf970('0x38')])return![];if(_0x57ff6d['nonce']!==_0x1f802d['nonce'])return![];if(moment()['isAfter'](moment[_0xf970('0x39')](_0x57ff6d[_0xf970('0x3a')])))return![];return!![];}catch(_0x258de5){throw _0x258de5;}}function refreshOauth2MicrosoftAccessToken(_0x3825cb){return Promise[_0xf970('0x3b')]()[_0xf970('0x3c')](function(){if(_0x3825cb[_0xf970('0x3d')])return _0x3825cb;return db[_0xf970('0x3e')][_0xf970('0x3f')]({'where':{'id':_0x3825cb['id']},'raw':!![]});})['then'](function(_0x5823f4){var _0xe04c11={'grant_type':_0xf970('0x40'),'refresh_token':_0x5823f4[_0xf970('0x41')],'scope':getAccessTokenScope(_0x5823f4),'redirect_uri':_0x5823f4[_0xf970('0x2a')],'client_id':_0x5823f4['data1'],'client_secret':encryptor['decryptString'](_0x5823f4[_0xf970('0x3d')])};var _0x4067c4={'method':_0xf970('0x42'),'uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x5823f4[_0xf970('0x20')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0xe04c11,'json':!![]};return rp(_0x4067c4);})[_0xf970('0x3c')](function(_0xa18047){_0x3825cb[_0xf970('0x43')]=_0xa18047[_0xf970('0x44')];_0x3825cb[_0xf970('0x41')]=_0xa18047[_0xf970('0x40')];return db[_0xf970('0x3e')][_0xf970('0x45')]({'data5':_0x3825cb[_0xf970('0x43')],'data6':_0x3825cb['data6']},{'where':{'id':_0x3825cb['id']}});})[_0xf970('0x3c')](function(){return _0x3825cb;})[_0xf970('0x46')](function(_0x1cd41c){logger['error'](_0xf970('0x47'),_0x3825cb['id'],_0x1cd41c);});}function getOauth2MicrosoftAccessToken(_0x467733,_0x19c8fc){var _0xaa1163={'grant_type':_0xf970('0x48'),'code':_0x467733,'scope':getAccessTokenScope(_0x19c8fc),'redirect_uri':_0x19c8fc[_0xf970('0x2a')],'client_id':_0x19c8fc[_0xf970('0x31')],'client_secret':encryptor[_0xf970('0x49')](_0x19c8fc[_0xf970('0x3d')])};var _0x1b0d3b={'method':_0xf970('0x42'),'uri':MICROSOFT_AUTH_URL[_0xf970('0x1e')](_0xf970('0x1f'),_0x19c8fc[_0xf970('0x20')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0xaa1163,'json':!![]};return rp(_0x1b0d3b);}function startRefreshInterval(_0x52cdfe){var _0x52cbd5=schedule[_0xf970('0x4a')];if(_0x52cbd5[_0x52cdfe['id']])clearInterval(_0x52cbd5[_0x52cdfe['id']]);_0x52cbd5[_0x52cdfe['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xf970('0x4b')](this,{'id':_0x52cdfe['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xf970('0x4a')]=_0x52cbd5;}function startAllRefreshIntervals(){return db[_0xf970('0x3e')][_0xf970('0x4c')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xf970('0x3c')](function(_0x1d777f){var _0x18842d=_0x1d777f[_0xf970('0x17')](function(_0x410efc){return refreshOauth2MicrosoftAccessToken(_0x410efc)[_0xf970('0x3c')](function(_0x1d5982){startRefreshInterval(_0x1d5982);});});return Promise[_0xf970('0x4d')](_0x18842d);})['catch'](function(_0x5e0e49){var _0x2cf217=_0x5e0e49?util[_0xf970('0x4e')](_0x5e0e49,{'showHidden':![],'depth':null}):'';logger[_0xf970('0x4f')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x2cf217);});}module[_0xf970('0x50')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x35ae=['exp','resolve','then','data3','CloudProvider','decryptString','POST','data5','data6','refresh_token','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','{TENANT_ID}','intervals','findAll','map','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','offline_access','/authorize','/token','type','push','data7','join','Outlook365','/.default','replace','data2','code','id_token','from','stringify','toString','randomBytes','hex','client_id','response_type','redirect_uri','data4','response_mode','form_post','state','nonce','prompt','value','oauth2Claims','oauth2/','data1','set','decode','payload','iss','issuer','aud','isAfter','unix'];(function(_0x2612d6,_0x7357a2){var _0x1277b6=function(_0x1d704a){while(--_0x1d704a){_0x2612d6['push'](_0x2612d6['shift']());}};_0x1277b6(++_0x7357a2);}(_0x35ae,0x10f));var _0xe35a=function(_0xd94ba3,_0x5e2e97){_0xd94ba3=_0xd94ba3-0x0;var _0x3c5402=_0x35ae[_0xd94ba3];return _0x3c5402;};'use strict';var _=require(_0xe35a('0x0'));var crypto=require(_0xe35a('0x1'));var jwt=require(_0xe35a('0x2'));var moment=require('moment');var Redis=require(_0xe35a('0x3'));var rp=require(_0xe35a('0x4'));var util=require(_0xe35a('0x5'));var encryptor=require(_0xe35a('0x6'));var config=require(_0xe35a('0x7'));var logger=require(_0xe35a('0x8'))(_0xe35a('0x9'));var schedule=require(_0xe35a('0xa'));var db=require(_0xe35a('0xb'))['db'];config[_0xe35a('0xc')]=_[_0xe35a('0xd')](config[_0xe35a('0xc')],{'host':_0xe35a('0xe'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0xe35a('0xf');var AZURE_AUTH_SCOPES={'Outlook365':[_0xe35a('0x10'),_0xe35a('0x11'),_0xe35a('0x12'),'offline_access',_0xe35a('0x13'),_0xe35a('0x14'),_0xe35a('0x15')],'Dynamics365':[_0xe35a('0x10'),_0xe35a('0x16')]};var MICROSOFT_AUTH_ENDPOINT=_0xe35a('0x17');var MICROSOFT_TOKEN_ENDPOINT=_0xe35a('0x18');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x56e7fe){var _0x70b379=_['map'](AZURE_AUTH_SCOPES[_0x56e7fe[_0xe35a('0x19')]]);if(_0x56e7fe['type']==='Dynamics365')_0x70b379[_0xe35a('0x1a')](_0x56e7fe[_0xe35a('0x1b')]+'/.default');return _0x70b379[_0xe35a('0x1c')]('\x20');}function getAccessTokenScope(_0x58d268){if(_0x58d268[_0xe35a('0x19')]===_0xe35a('0x1d'))return _0xe35a('0x13');if(_0x58d268[_0xe35a('0x19')]==='Dynamics365')return _0x58d268['data7']+_0xe35a('0x1e');}function generateMicrosoftAuthorizationUrl(_0x539298,_0x5138a9){var _0x246154=MICROSOFT_AUTH_URL[_0xe35a('0x1f')]('{TENANT_ID}',_0x539298[_0xe35a('0x20')]);var _0x55173e=[_0xe35a('0x21'),_0xe35a('0x22')];var _0x2e59f6=Buffer[_0xe35a('0x23')](JSON[_0xe35a('0x24')]({'id':_0x5138a9}))[_0xe35a('0x25')]('base64');var _0x1e535e=crypto[_0xe35a('0x26')](0x10)[_0xe35a('0x25')](_0xe35a('0x27'));var _0x3519e3=getAuthorizationScopes(_0x539298);var _0x45352a=[{'key':_0xe35a('0x28'),'value':_0x539298['data1']},{'key':_0xe35a('0x29'),'value':encodeURIComponent(_0x55173e['join']('\x20'))},{'key':_0xe35a('0x2a'),'value':_0x539298[_0xe35a('0x2b')]},{'key':_0xe35a('0x2c'),'value':_0xe35a('0x2d')},{'key':'scope','value':encodeURIComponent(_0x3519e3)},{'key':_0xe35a('0x2e'),'value':_0x2e59f6},{'key':_0xe35a('0x2f'),'value':_0x1e535e},{'key':_0xe35a('0x30'),'value':'login'}];var _0x1d25fa=_0x246154+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x45352a,function(_0x17645c){return _0x17645c['key']+'='+_0x17645c[_0xe35a('0x31')];})[_0xe35a('0x1c')]('&');_0x539298[_0xe35a('0x32')]={'issuer':_0x246154[_0xe35a('0x1f')](_0xe35a('0x33'),''),'audience':_0x539298[_0xe35a('0x34')],'state':_0x2e59f6,'nonce':_0x1e535e};redis[_0xe35a('0x35')](_0x2e59f6,JSON[_0xe35a('0x24')](_0x539298));return _0x1d25fa;}function isValidIdToken(_0x5a33cf,_0x13f5a7){try{var _0x45173f=jwt[_0xe35a('0x36')](_0x5a33cf,{'complete':!![]});var _0x184f15=_0x45173f[_0xe35a('0x37')];if(_0x184f15[_0xe35a('0x38')]!==_0x13f5a7[_0xe35a('0x39')])return![];if(_0x184f15[_0xe35a('0x3a')]!==_0x13f5a7['audience'])return![];if(_0x184f15['nonce']!==_0x13f5a7[_0xe35a('0x2f')])return![];if(moment()[_0xe35a('0x3b')](moment[_0xe35a('0x3c')](_0x184f15[_0xe35a('0x3d')])))return![];return!![];}catch(_0x3efbcb){throw _0x3efbcb;}}function refreshOauth2MicrosoftAccessToken(_0x368b3d){return Promise[_0xe35a('0x3e')]()[_0xe35a('0x3f')](function(){if(_0x368b3d[_0xe35a('0x40')])return _0x368b3d;return db[_0xe35a('0x41')]['findOne']({'where':{'id':_0x368b3d['id']},'raw':!![]});})[_0xe35a('0x3f')](function(_0x4149fd){var _0x310fd9={'grant_type':'refresh_token','refresh_token':_0x4149fd['data6'],'scope':getAccessTokenScope(_0x4149fd),'redirect_uri':_0x4149fd[_0xe35a('0x2b')],'client_id':_0x4149fd[_0xe35a('0x34')],'client_secret':encryptor[_0xe35a('0x42')](_0x4149fd[_0xe35a('0x40')])};var _0x41a4c4={'method':_0xe35a('0x43'),'uri':MICROSOFT_AUTH_URL[_0xe35a('0x1f')]('{TENANT_ID}',_0x4149fd[_0xe35a('0x20')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x310fd9,'json':!![]};return rp(_0x41a4c4);})['then'](function(_0x92a9d6){_0x368b3d[_0xe35a('0x44')]=_0x92a9d6['access_token'];_0x368b3d[_0xe35a('0x45')]=_0x92a9d6[_0xe35a('0x46')];return db[_0xe35a('0x41')][_0xe35a('0x47')]({'data5':_0x368b3d[_0xe35a('0x44')],'data6':_0x368b3d[_0xe35a('0x45')]},{'where':{'id':_0x368b3d['id']}});})[_0xe35a('0x3f')](function(){return _0x368b3d;})[_0xe35a('0x48')](function(_0x54fd1a){logger[_0xe35a('0x49')](_0xe35a('0x4a'),_0x368b3d['id'],_0x54fd1a);});}function getOauth2MicrosoftAccessToken(_0x1542d6,_0x3c8587){var _0x974ae={'grant_type':_0xe35a('0x4b'),'code':_0x1542d6,'scope':getAccessTokenScope(_0x3c8587),'redirect_uri':_0x3c8587[_0xe35a('0x2b')],'client_id':_0x3c8587[_0xe35a('0x34')],'client_secret':encryptor[_0xe35a('0x42')](_0x3c8587['data3'])};var _0x1a285c={'method':'POST','uri':MICROSOFT_AUTH_URL[_0xe35a('0x1f')](_0xe35a('0x4c'),_0x3c8587[_0xe35a('0x20')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x974ae,'json':!![]};return rp(_0x1a285c);}function startRefreshInterval(_0x597c7e){var _0xcb86c8=schedule[_0xe35a('0x4d')];if(_0xcb86c8[_0x597c7e['id']])clearInterval(_0xcb86c8[_0x597c7e['id']]);_0xcb86c8[_0x597c7e['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x597c7e['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0xcb86c8;}function startAllRefreshIntervals(){return db[_0xe35a('0x41')][_0xe35a('0x4e')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xe35a('0x3f')](function(_0x1a238b){var _0x1bf494=_0x1a238b[_0xe35a('0x4f')](function(_0x5ccbc4){return refreshOauth2MicrosoftAccessToken(_0x5ccbc4)[_0xe35a('0x3f')](function(_0x1ca80e){startRefreshInterval(_0x1ca80e);});});return Promise['all'](_0x1bf494);})[_0xe35a('0x48')](function(_0x2a0cd1){var _0x315250=_0x2a0cd1?util[_0xe35a('0x50')](_0x2a0cd1,{'showHidden':![],'depth':null}):'';logger[_0xe35a('0x49')](_0xe35a('0x51'),_0x315250);});}module[_0xe35a('0x52')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index 45cad73..2f666f8 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 _0x4f2f=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CloudProvider,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','moment','bluebird','ioredis'];(function(_0xea6018,_0x4cf082){var _0x57b54d=function(_0x49099a){while(--_0x49099a){_0xea6018['push'](_0xea6018['shift']());}};_0x57b54d(++_0x4cf082);}(_0x4f2f,0x1cb));var _0xf4f2=function(_0x1e3c16,_0x372caa){_0x1e3c16=_0x1e3c16-0x0;var _0x47a0c9=_0x4f2f[_0x1e3c16];return _0x47a0c9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf4f2('0x0'));var BPromise=require(_0xf4f2('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf4f2('0x2'));var db=require(_0xf4f2('0x3'))['db'];var utils=require(_0xf4f2('0x4'));var logger=require(_0xf4f2('0x5'))(_0xf4f2('0x6'));var config=require(_0xf4f2('0x7'));var jayson=require(_0xf4f2('0x8'));var client=jayson[_0xf4f2('0x9')][_0xf4f2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5cc7c0,_0x478723,_0x5d14a9){return new BPromise(function(_0x7c1660,_0xe39952){return client['request'](_0x5cc7c0,_0x5d14a9)[_0xf4f2('0xb')](function(_0x53dc4e){logger[_0xf4f2('0xc')](_0xf4f2('0xd'),_0x478723,'request\x20sent');logger['debug']('CloudProvider,\x20%s,\x20%s,\x20%s',_0x478723,'request\x20sent',JSON[_0xf4f2('0xe')](_0x53dc4e));if(_0x53dc4e[_0xf4f2('0xf')]){if(_0x53dc4e['error'][_0xf4f2('0x10')]===0x1f4){logger[_0xf4f2('0xf')]('CloudProvider,\x20%s,\x20%s',_0x478723,_0x53dc4e[_0xf4f2('0xf')]['message']);return _0xe39952(_0x53dc4e[_0xf4f2('0xf')][_0xf4f2('0x11')]);}logger[_0xf4f2('0xf')]('CloudProvider,\x20%s,\x20%s',_0x478723,_0x53dc4e[_0xf4f2('0xf')][_0xf4f2('0x11')]);return _0x7c1660(_0x53dc4e[_0xf4f2('0xf')][_0xf4f2('0x11')]);}else{logger['info'](_0xf4f2('0xd'),_0x478723,_0xf4f2('0x12'));_0x7c1660(_0x53dc4e[_0xf4f2('0x13')][_0xf4f2('0x11')]);}})[_0xf4f2('0x14')](function(_0x545b43){logger[_0xf4f2('0xf')]('CloudProvider,\x20%s,\x20%s',_0x478723,_0x545b43);_0xe39952(_0x545b43);});});}
\ No newline at end of file
+var _0xb515=['debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','CloudProvider,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x4ca0a1,_0x6158d8){var _0x1c26c3=function(_0x3029e5){while(--_0x3029e5){_0x4ca0a1['push'](_0x4ca0a1['shift']());}};_0x1c26c3(++_0x6158d8);}(_0xb515,0x1b8));var _0x5b51=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xb515[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x5b51('0x0'));var util=require('util');var moment=require(_0x5b51('0x1'));var BPromise=require(_0x5b51('0x2'));var rs=require(_0x5b51('0x3'));var fs=require('fs');var Redis=require(_0x5b51('0x4'));var db=require(_0x5b51('0x5'))['db'];var utils=require(_0x5b51('0x6'));var logger=require(_0x5b51('0x7'))(_0x5b51('0x8'));var config=require('../../config/environment');var jayson=require(_0x5b51('0x9'));var client=jayson[_0x5b51('0xa')][_0x5b51('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x293d82,_0x396b3f,_0x2c6d86){return new BPromise(function(_0x1d5082,_0x226e9c){return client[_0x5b51('0xc')](_0x293d82,_0x2c6d86)[_0x5b51('0xd')](function(_0x1085e6){logger[_0x5b51('0xe')]('CloudProvider,\x20%s,\x20%s',_0x396b3f,_0x5b51('0xf'));logger[_0x5b51('0x10')](_0x5b51('0x11'),_0x396b3f,_0x5b51('0xf'),JSON[_0x5b51('0x12')](_0x1085e6));if(_0x1085e6[_0x5b51('0x13')]){if(_0x1085e6['error']['code']===0x1f4){logger['error'](_0x5b51('0x14'),_0x396b3f,_0x1085e6[_0x5b51('0x13')][_0x5b51('0x15')]);return _0x226e9c(_0x1085e6[_0x5b51('0x13')]['message']);}logger[_0x5b51('0x13')](_0x5b51('0x14'),_0x396b3f,_0x1085e6[_0x5b51('0x13')][_0x5b51('0x15')]);return _0x1d5082(_0x1085e6[_0x5b51('0x13')][_0x5b51('0x15')]);}else{logger[_0x5b51('0xe')](_0x5b51('0x14'),_0x396b3f,_0x5b51('0xf'));_0x1d5082(_0x1085e6[_0x5b51('0x16')][_0x5b51('0x15')]);}})[_0x5b51('0x17')](function(_0x520686){logger[_0x5b51('0x13')]('CloudProvider,\x20%s,\x20%s',_0x396b3f,_0x520686);_0x226e9c(_0x520686);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 7317bb4..8374d87 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 _0x5f2f=['exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback'];(function(_0x2181b1,_0x569637){var _0x530548=function(_0x4b31f1){while(--_0x4b31f1){_0x2181b1['push'](_0x2181b1['shift']());}};_0x530548(++_0x569637);}(_0x5f2f,0x73));var _0xf5f2=function(_0x404d14,_0x57e3c3){_0x404d14=_0x404d14-0x0;var _0x134ef5=_0x5f2f[_0x404d14];return _0x134ef5;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);router[_0xf5f2('0x4')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x7')]);router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x9')]);router[_0xf5f2('0xa')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xc')]);router[_0xf5f2('0xd')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0x4')](_0xf5f2('0xf'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router['post']('/oauth2/microsoft/callback',controller[_0xf5f2('0x11')]);module[_0xf5f2('0x12')]=router;
\ No newline at end of file
+var _0xc4aa=['put','/:id','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','show','post','create'];(function(_0x16e773,_0x8abfd7){var _0x54a3e8=function(_0x5a5f25){while(--_0x5a5f25){_0x16e773['push'](_0x16e773['shift']());}};_0x54a3e8(++_0x8abfd7);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xc4aa[_0x3b0731];return _0x4204d7;};'use strict';var express=require(_0xac4a('0x0'));var router=express[_0xac4a('0x1')]();var auth=require(_0xac4a('0x2'));var controller=require(_0xac4a('0x3'));router[_0xac4a('0x4')]('/',auth[_0xac4a('0x5')](),controller['index']);router['get']('/:id',auth[_0xac4a('0x5')](),controller[_0xac4a('0x6')]);router[_0xac4a('0x7')]('/',auth[_0xac4a('0x5')](),controller[_0xac4a('0x8')]);router[_0xac4a('0x9')](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller['update']);router['delete'](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xb')]);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xd')]);router['post'](_0xac4a('0xe'),controller['oauth2MicrosoftCallback']);module[_0xac4a('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 4b26260..907de49 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 _0x207d=['name','sequelize','exports','STRING'];(function(_0x5494f1,_0x2b7c7f){var _0x5d9384=function(_0x40dcef){while(--_0x40dcef){_0x5494f1['push'](_0x5494f1['shift']());}};_0x5d9384(++_0x2b7c7f);}(_0x207d,0x10d));var _0xd207=function(_0x50d407,_0x3613ce){_0x50d407=_0x50d407-0x0;var _0x575491=_0x207d[_0x50d407];return _0x575491;};'use strict';var Sequelize=require(_0xd207('0x0'));module[_0xd207('0x1')]={'name':{'type':Sequelize[_0xd207('0x2')],'unique':_0xd207('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0xd207('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xd207('0x2')]},'fax':{'type':Sequelize[_0xd207('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xd207('0x2')]},'postalCode':{'type':Sequelize[_0xd207('0x2')]},'city':{'type':Sequelize[_0xd207('0x2')]},'country':{'type':Sequelize[_0xd207('0x2')]},'email':{'type':Sequelize[_0xd207('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xd207('0x2')]},'sStreet':{'type':Sequelize[_0xd207('0x2')]},'sPostalCode':{'type':Sequelize[_0xd207('0x2')]},'sCity':{'type':Sequelize[_0xd207('0x2')]},'sCountry':{'type':Sequelize[_0xd207('0x2')]},'description':{'type':Sequelize[_0xd207('0x2')]}};
\ No newline at end of file
+var _0xbd94=['STRING','sequelize','name'];(function(_0xb119da,_0x42d325){var _0x3ecb48=function(_0x361539){while(--_0x361539){_0xb119da['push'](_0xb119da['shift']());}};_0x3ecb48(++_0x42d325);}(_0xbd94,0xfd));var _0x4bd9=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xbd94[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0x4bd9('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x4bd9('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x4bd9('0x2')]},'website':{'type':Sequelize[_0x4bd9('0x2')]},'phone':{'type':Sequelize[_0x4bd9('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x4bd9('0x2')]},'street':{'type':Sequelize[_0x4bd9('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x4bd9('0x2')]},'country':{'type':Sequelize[_0x4bd9('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x4bd9('0x2')]},'sStreet':{'type':Sequelize[_0x4bd9('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x4bd9('0x2')]},'sCountry':{'type':Sequelize[_0x4bd9('0x2')]},'description':{'type':Sequelize[_0x4bd9('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index bdea565..4805c4d 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 _0x9dfe=['findOne','rawAttributes','getContacts','hasOwnProperty','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','offset','undefined','limit','count','status','Content-Range','json','apply','reject','save','update','destroy','then','get','UserProfileResource','error','stack','send','index','CmCompany','describe','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','findAll','rows','catch','show','params','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','UserProfileSection','find','userProfileId','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','omit'];(function(_0x3d5f5b,_0x5d81c8){var _0x1bee6c=function(_0x2c1e6c){while(--_0x2c1e6c){_0x3d5f5b['push'](_0x3d5f5b['shift']());}};_0x1bee6c(++_0x5d81c8);}(_0x9dfe,0x1c1));var _0xe9df=function(_0x2d8357,_0x463fa4){_0x2d8357=_0x2d8357-0x0;var _0x442fc9=_0x9dfe[_0x2d8357];return _0x442fc9;};'use strict';var emlformat=require(_0xe9df('0x0'));var rimraf=require(_0xe9df('0x1'));var zipdir=require(_0xe9df('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe9df('0x3'));var BPromise=require(_0xe9df('0x4'));var Mustache=require(_0xe9df('0x5'));var util=require('util');var path=require(_0xe9df('0x6'));var sox=require(_0xe9df('0x7'));var csv=require('to-csv');var ejs=require(_0xe9df('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe9df('0x9'));var squel=require(_0xe9df('0xa'));var crypto=require(_0xe9df('0xb'));var jsforce=require(_0xe9df('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe9df('0xd'));var querystring=require(_0xe9df('0xe'));var Papa=require(_0xe9df('0xf'));var Redis=require(_0xe9df('0x10'));var authService=require(_0xe9df('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe9df('0x12'));var logger=require(_0xe9df('0x13'))(_0xe9df('0x14'));var utils=require('../../config/utils');var config=require(_0xe9df('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xe9df('0x16'))['db'];function respondWithStatusCode(_0x1d1154,_0x572380){_0x572380=_0x572380||0xcc;return function(_0x4aac2e){if(_0x4aac2e){return _0x1d1154[_0xe9df('0x17')](_0x572380);}return _0x1d1154['status'](_0x572380)[_0xe9df('0x18')]();};}function respondWithResult(_0x298421,_0x15f671){_0x15f671=_0x15f671||0xc8;return function(_0x3b3cdc){if(_0x3b3cdc){return _0x298421['status'](_0x15f671)['json'](_0x3b3cdc);}};}function respondWithFilteredResult(_0x494ac1,_0x161b83){return function(_0x4315e6){if(_0x4315e6){var _0x4dd78c=typeof _0x161b83[_0xe9df('0x19')]===_0xe9df('0x1a')&&typeof _0x161b83[_0xe9df('0x1b')]===_0xe9df('0x1a');var _0x3513fa=_0x4315e6['count'];var _0x109fdf=_0x4dd78c?0x0:_0x161b83[_0xe9df('0x19')];var _0x417500=_0x4dd78c?_0x4315e6[_0xe9df('0x1c')]:_0x161b83[_0xe9df('0x19')]+_0x161b83[_0xe9df('0x1b')];var _0x1e928e;if(_0x417500>=_0x3513fa){_0x417500=_0x3513fa;_0x1e928e=0xc8;}else{_0x1e928e=0xce;}_0x494ac1[_0xe9df('0x1d')](_0x1e928e);return _0x494ac1['set'](_0xe9df('0x1e'),_0x109fdf+'-'+_0x417500+'/'+_0x3513fa)[_0xe9df('0x1f')](_0x4315e6);}return null;};}function patchUpdates(_0x979983){return function(_0x3bef3a){try{jsonpatch[_0xe9df('0x20')](_0x3bef3a,_0x979983,!![]);}catch(_0xa9a07c){return BPromise[_0xe9df('0x21')](_0xa9a07c);}return _0x3bef3a[_0xe9df('0x22')]();};}function saveUpdates(_0x234f20,_0x2107cc){return function(_0x2dc83d){if(_0x2dc83d){return _0x2dc83d[_0xe9df('0x23')](_0x234f20)['then'](function(_0x26e980){return _0x26e980;});}return null;};}function removeEntity(_0x568492,_0x15eac0){return function(_0x1c3aac){if(_0x1c3aac){return _0x1c3aac[_0xe9df('0x24')]()[_0xe9df('0x25')](function(){var _0x5db09e=_0x1c3aac[_0xe9df('0x26')]({'plain':!![]});var _0x2c6e2f='Companies';return db[_0xe9df('0x27')][_0xe9df('0x24')]({'where':{'type':_0x2c6e2f,'resourceId':_0x5db09e['id']}})[_0xe9df('0x25')](function(){return _0x1c3aac;});})[_0xe9df('0x25')](function(){_0x568492[_0xe9df('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e1234,_0x27df9a){return function(_0x28d6e5){if(!_0x28d6e5){_0x4e1234[_0xe9df('0x17')](0x194);}return _0x28d6e5;};}function handleError(_0x3a332a,_0x4d3dcd){_0x4d3dcd=_0x4d3dcd||0x1f4;return function(_0x2ed32f){logger[_0xe9df('0x28')](_0x2ed32f[_0xe9df('0x29')]);if(_0x2ed32f['name']){delete _0x2ed32f['name'];}_0x3a332a[_0xe9df('0x1d')](_0x4d3dcd)[_0xe9df('0x2a')](_0x2ed32f);};}exports[_0xe9df('0x2b')]=function(_0x221c95,_0x116ecc){var _0x5952c7={},_0x168487={},_0x326101={'count':0x0,'rows':[]};return db[_0xe9df('0x2c')][_0xe9df('0x2d')]()[_0xe9df('0x25')](function(_0x2cad1b){_0x168487['model']=_[_0xe9df('0x2e')](_0x2cad1b);_0x168487[_0xe9df('0x2f')]=_[_0xe9df('0x2e')](_0x221c95[_0xe9df('0x2f')]);_0x168487[_0xe9df('0x30')]=_[_0xe9df('0x31')](_0x168487[_0xe9df('0x32')],_0x168487['query']);_0x5952c7[_0xe9df('0x33')]=_[_0xe9df('0x31')](_0x168487[_0xe9df('0x32')],qs[_0xe9df('0x34')](_0x221c95[_0xe9df('0x2f')][_0xe9df('0x34')]));_0x5952c7['attributes']=_0x5952c7[_0xe9df('0x33')][_0xe9df('0x35')]?_0x5952c7[_0xe9df('0x33')]:_0x168487[_0xe9df('0x32')];if(!_0x221c95['query']['hasOwnProperty'](_0xe9df('0x36'))){_0x5952c7[_0xe9df('0x1b')]=qs['limit'](_0x221c95['query']['limit']);_0x5952c7[_0xe9df('0x19')]=qs['offset'](_0x221c95[_0xe9df('0x2f')][_0xe9df('0x19')]);}_0x5952c7[_0xe9df('0x37')]=qs[_0xe9df('0x38')](_0x221c95[_0xe9df('0x2f')][_0xe9df('0x38')]);_0x5952c7[_0xe9df('0x39')]=qs[_0xe9df('0x30')](_[_0xe9df('0x3a')](_0x221c95[_0xe9df('0x2f')],_0x168487[_0xe9df('0x30')]),_0x2cad1b);if(_0x221c95[_0xe9df('0x2f')][_0xe9df('0x3b')]){_0x5952c7['where']=_[_0xe9df('0x3c')](_0x5952c7[_0xe9df('0x39')],{'$or':_[_0xe9df('0x3d')](_0x5952c7[_0xe9df('0x33')],function(_0x28a65f){var _0x595fda={};_0x595fda[_0x28a65f]={'$like':'%'+_0x221c95['query']['filter']+'%'};return _0x595fda;})});}_0x5952c7=_[_0xe9df('0x3c')]({},_0x5952c7,_0x221c95[_0xe9df('0x3e')]);var _0x2ac1cc={'where':_0x5952c7[_0xe9df('0x39')]};return db[_0xe9df('0x2c')][_0xe9df('0x1c')](_0x2ac1cc)[_0xe9df('0x25')](function(_0x82f740){_0x326101['count']=_0x82f740;if(_0x221c95[_0xe9df('0x2f')][_0xe9df('0x3f')]){_0x5952c7['include']=[{'all':!![]}];}return db[_0xe9df('0x2c')][_0xe9df('0x40')](_0x5952c7);})[_0xe9df('0x25')](function(_0x524f48){_0x326101[_0xe9df('0x41')]=_0x524f48;return _0x326101;})[_0xe9df('0x25')](respondWithFilteredResult(_0x116ecc,_0x5952c7))[_0xe9df('0x42')](handleError(_0x116ecc,null));})[_0xe9df('0x42')](handleError(_0x116ecc,null));};exports[_0xe9df('0x43')]=function(_0x124c98,_0x5571e8){var _0xbacc4c={'raw':![],'where':{'id':_0x124c98[_0xe9df('0x44')]['id']}},_0x5144b0={};_0x5144b0[_0xe9df('0x32')]=_[_0xe9df('0x2e')](db[_0xe9df('0x2c')]['rawAttributes']);_0x5144b0[_0xe9df('0x2f')]=_[_0xe9df('0x2e')](_0x124c98[_0xe9df('0x2f')]);_0x5144b0[_0xe9df('0x30')]=_[_0xe9df('0x31')](_0x5144b0[_0xe9df('0x32')],_0x5144b0[_0xe9df('0x2f')]);_0xbacc4c[_0xe9df('0x33')]=_['intersection'](_0x5144b0['model'],qs['fields'](_0x124c98[_0xe9df('0x2f')][_0xe9df('0x34')]));_0xbacc4c[_0xe9df('0x33')]=_0xbacc4c[_0xe9df('0x33')][_0xe9df('0x35')]?_0xbacc4c[_0xe9df('0x33')]:_0x5144b0[_0xe9df('0x32')];if(_0x124c98[_0xe9df('0x2f')][_0xe9df('0x3f')]){_0xbacc4c[_0xe9df('0x45')]=[{'all':!![]}];}_0xbacc4c=_['merge']({},_0xbacc4c,_0x124c98[_0xe9df('0x3e')]);return db[_0xe9df('0x2c')]['find'](_0xbacc4c)[_0xe9df('0x25')](handleEntityNotFound(_0x5571e8,null))[_0xe9df('0x25')](respondWithResult(_0x5571e8,null))[_0xe9df('0x42')](handleError(_0x5571e8,null));};exports[_0xe9df('0x46')]=function(_0x389545,_0x628b74){return db[_0xe9df('0x2c')][_0xe9df('0x46')](_0x389545[_0xe9df('0x47')],{})[_0xe9df('0x25')](function(_0x4b81c7){var _0x2ffc73=_0x389545[_0xe9df('0x48')]['get']({'plain':!![]});if(!_0x2ffc73)throw new Error(_0xe9df('0x49'));if(_0x2ffc73[_0xe9df('0x4a')]===_0xe9df('0x48')){var _0x2d1e60=_0x4b81c7[_0xe9df('0x26')]({'plain':!![]});var _0x372a3f=_0xe9df('0x4b');return db[_0xe9df('0x4c')][_0xe9df('0x4d')]({'where':{'name':_0x372a3f,'userProfileId':_0x2ffc73[_0xe9df('0x4e')]},'raw':!![]})[_0xe9df('0x25')](function(_0x3d1ceb){if(_0x3d1ceb&&_0x3d1ceb['autoAssociation']===0x0){return db[_0xe9df('0x27')][_0xe9df('0x46')]({'name':_0x2d1e60[_0xe9df('0x4f')],'resourceId':_0x2d1e60['id'],'type':_0x3d1ceb[_0xe9df('0x4f')],'sectionId':_0x3d1ceb['id']},{})[_0xe9df('0x25')](function(){return _0x4b81c7;});}else{return _0x4b81c7;}})[_0xe9df('0x42')](function(_0x4574d4){logger[_0xe9df('0x28')](_0xe9df('0x50'),_0x4574d4);throw _0x4574d4;});}return _0x4b81c7;})[_0xe9df('0x25')](respondWithResult(_0x628b74,0xc9))[_0xe9df('0x42')](handleError(_0x628b74,null));};exports[_0xe9df('0x23')]=function(_0x33e277,_0x101945){if(_0x33e277[_0xe9df('0x47')]['id']){delete _0x33e277[_0xe9df('0x47')]['id'];}return db['CmCompany'][_0xe9df('0x4d')]({'where':{'id':_0x33e277[_0xe9df('0x44')]['id']}})[_0xe9df('0x25')](handleEntityNotFound(_0x101945,null))[_0xe9df('0x25')](saveUpdates(_0x33e277[_0xe9df('0x47')],null))['then'](respondWithResult(_0x101945,null))[_0xe9df('0x42')](handleError(_0x101945,null));};exports[_0xe9df('0x24')]=function(_0x40fb29,_0x232b4d){return db[_0xe9df('0x2c')][_0xe9df('0x4d')]({'where':{'id':_0x40fb29[_0xe9df('0x44')]['id']}})['then'](handleEntityNotFound(_0x232b4d,null))[_0xe9df('0x25')](removeEntity(_0x232b4d,null))[_0xe9df('0x42')](handleError(_0x232b4d,null));};exports['describe']=function(_0x54e3cc,_0x3b44ca){return db[_0xe9df('0x2c')][_0xe9df('0x2d')]()[_0xe9df('0x25')](respondWithResult(_0x3b44ca,null))[_0xe9df('0x42')](handleError(_0x3b44ca,null));};exports[_0xe9df('0x51')]=function(_0x4c772c,_0x55922b,_0x58497d){return db[_0xe9df('0x52')][_0xe9df('0x4d')]({'where':{'id':_0x4c772c[_0xe9df('0x44')]['id']}})['then'](handleEntityNotFound(_0x55922b,null))[_0xe9df('0x25')](function(_0x12b779){if(_0x12b779){return _0x12b779[_0xe9df('0x51')](_0x4c772c[_0xe9df('0x47')][_0xe9df('0x53')],_[_0xe9df('0x54')](_0x4c772c['body'],[_0xe9df('0x53'),'id'])||{});}})['then'](respondWithResult(_0x55922b,null))[_0xe9df('0x42')](handleError(_0x55922b,null));};exports['getContacts']=function(_0x584f48,_0x519b2a,_0x17c468){var _0x2c0a1b={};var _0x4fe784={};var _0x253f90;var _0x26b14d;return db[_0xe9df('0x2c')][_0xe9df('0x55')]({'where':{'id':_0x584f48['params']['id']}})['then'](handleEntityNotFound(_0x519b2a,null))['then'](function(_0x21e994){if(_0x21e994){_0x253f90=_0x21e994;_0x4fe784[_0xe9df('0x32')]=_[_0xe9df('0x2e')](db[_0xe9df('0x52')][_0xe9df('0x56')]);_0x4fe784[_0xe9df('0x2f')]=_[_0xe9df('0x2e')](_0x584f48[_0xe9df('0x2f')]);_0x4fe784[_0xe9df('0x30')]=_['intersection'](_0x4fe784[_0xe9df('0x32')],_0x4fe784[_0xe9df('0x2f')]);_0x2c0a1b[_0xe9df('0x33')]=_[_0xe9df('0x31')](_0x4fe784[_0xe9df('0x32')],qs[_0xe9df('0x34')](_0x584f48[_0xe9df('0x2f')][_0xe9df('0x34')]));_0x2c0a1b[_0xe9df('0x33')]=_0x2c0a1b['attributes'][_0xe9df('0x35')]?_0x2c0a1b[_0xe9df('0x33')]:_0x4fe784[_0xe9df('0x32')];_0x2c0a1b[_0xe9df('0x37')]=qs[_0xe9df('0x38')](_0x584f48[_0xe9df('0x2f')][_0xe9df('0x38')]);_0x2c0a1b['where']=qs['filters'](_[_0xe9df('0x3a')](_0x584f48[_0xe9df('0x2f')],_0x4fe784[_0xe9df('0x30')]));if(_0x584f48[_0xe9df('0x2f')][_0xe9df('0x3b')]){_0x2c0a1b[_0xe9df('0x39')]=_[_0xe9df('0x3c')](_0x2c0a1b[_0xe9df('0x39')],{'$or':_[_0xe9df('0x3d')](_0x2c0a1b[_0xe9df('0x33')],function(_0x552751){var _0x235edb={};_0x235edb[_0x552751]={'$like':'%'+_0x584f48[_0xe9df('0x2f')]['filter']+'%'};return _0x235edb;})});}_0x2c0a1b=_['merge']({},_0x2c0a1b,_0x584f48[_0xe9df('0x3e')]);return _0x253f90[_0xe9df('0x57')](_0x2c0a1b);}})[_0xe9df('0x25')](function(_0x1b1204){if(_0x1b1204){_0x26b14d=_0x1b1204[_0xe9df('0x35')];if(!_0x584f48['query'][_0xe9df('0x58')](_0xe9df('0x36'))){_0x2c0a1b[_0xe9df('0x1b')]=qs['limit'](_0x584f48['query'][_0xe9df('0x1b')]);_0x2c0a1b['offset']=qs['offset'](_0x584f48[_0xe9df('0x2f')][_0xe9df('0x19')]);}return _0x253f90[_0xe9df('0x57')](_0x2c0a1b);}})[_0xe9df('0x25')](function(_0x904500){if(_0x904500){return _0x904500?{'count':_0x26b14d,'rows':_0x904500}:null;}})['then'](respondWithResult(_0x519b2a,null))[_0xe9df('0x42')](handleError(_0x519b2a,null));};
\ No newline at end of file
+var _0xa6b9=['filter','map','options','include','rows','catch','show','rawAttributes','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','describe','addContacts','CmContact','omit','ids','getContacts','pick','merge','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','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/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','then','destroy','get','Companies','UserProfileResource','stack','name','send','index','CmCompany','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where'];(function(_0x5a2c7b,_0x441265){var _0x3ad931=function(_0x3a3b19){while(--_0x3a3b19){_0x5a2c7b['push'](_0x5a2c7b['shift']());}};_0x3ad931(++_0x441265);}(_0xa6b9,0x75));var _0x9a6b=function(_0x23a2ac,_0x39d9d0){_0x23a2ac=_0x23a2ac-0x0;var _0x28bfb0=_0xa6b9[_0x23a2ac];return _0x28bfb0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9a6b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9a6b('0x1'));var rp=require(_0x9a6b('0x2'));var moment=require(_0x9a6b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9a6b('0x4'));var util=require(_0x9a6b('0x5'));var path=require(_0x9a6b('0x6'));var sox=require(_0x9a6b('0x7'));var csv=require('to-csv');var ejs=require(_0x9a6b('0x8'));var fs=require('fs');var fs_extra=require(_0x9a6b('0x9'));var _=require('lodash');var squel=require(_0x9a6b('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9a6b('0xb'));var toCsv=require(_0x9a6b('0xc'));var querystring=require(_0x9a6b('0xd'));var Papa=require(_0x9a6b('0xe'));var Redis=require(_0x9a6b('0xf'));var authService=require(_0x9a6b('0x10'));var qs=require(_0x9a6b('0x11'));var as=require(_0x9a6b('0x12'));var hardwareService=require(_0x9a6b('0x13'));var logger=require(_0x9a6b('0x14'))(_0x9a6b('0x15'));var utils=require(_0x9a6b('0x16'));var config=require(_0x9a6b('0x17'));var licenseUtil=require(_0x9a6b('0x18'));var db=require(_0x9a6b('0x19'))['db'];function respondWithStatusCode(_0xdb1b86,_0xa01b90){_0xa01b90=_0xa01b90||0xcc;return function(_0x33dea4){if(_0x33dea4){return _0xdb1b86[_0x9a6b('0x1a')](_0xa01b90);}return _0xdb1b86[_0x9a6b('0x1b')](_0xa01b90)[_0x9a6b('0x1c')]();};}function respondWithResult(_0x4fe70e,_0x566dff){_0x566dff=_0x566dff||0xc8;return function(_0x57001c){if(_0x57001c){return _0x4fe70e['status'](_0x566dff)[_0x9a6b('0x1d')](_0x57001c);}};}function respondWithFilteredResult(_0x1318de,_0x2badbc){return function(_0x3a65ab){if(_0x3a65ab){var _0xb54fbd=typeof _0x2badbc[_0x9a6b('0x1e')]===_0x9a6b('0x1f')&&typeof _0x2badbc[_0x9a6b('0x20')]===_0x9a6b('0x1f');var _0x1258b8=_0x3a65ab[_0x9a6b('0x21')];var _0x167cf2=_0xb54fbd?0x0:_0x2badbc[_0x9a6b('0x1e')];var _0x14d340=_0xb54fbd?_0x3a65ab[_0x9a6b('0x21')]:_0x2badbc[_0x9a6b('0x1e')]+_0x2badbc['limit'];var _0x3e25db;if(_0x14d340>=_0x1258b8){_0x14d340=_0x1258b8;_0x3e25db=0xc8;}else{_0x3e25db=0xce;}_0x1318de[_0x9a6b('0x1b')](_0x3e25db);return _0x1318de['set']('Content-Range',_0x167cf2+'-'+_0x14d340+'/'+_0x1258b8)[_0x9a6b('0x1d')](_0x3a65ab);}return null;};}function patchUpdates(_0x4ebe79){return function(_0x4aca36){try{jsonpatch[_0x9a6b('0x22')](_0x4aca36,_0x4ebe79,!![]);}catch(_0x35933a){return BPromise[_0x9a6b('0x23')](_0x35933a);}return _0x4aca36[_0x9a6b('0x24')]();};}function saveUpdates(_0x132acb,_0x1c7f84){return function(_0x498bc8){if(_0x498bc8){return _0x498bc8['update'](_0x132acb)[_0x9a6b('0x25')](function(_0x49c3ae){return _0x49c3ae;});}return null;};}function removeEntity(_0x93d18,_0xd45f86){return function(_0x5652c5){if(_0x5652c5){return _0x5652c5[_0x9a6b('0x26')]()[_0x9a6b('0x25')](function(){var _0x1ef65d=_0x5652c5[_0x9a6b('0x27')]({'plain':!![]});var _0x24a1d3=_0x9a6b('0x28');return db[_0x9a6b('0x29')]['destroy']({'where':{'type':_0x24a1d3,'resourceId':_0x1ef65d['id']}})[_0x9a6b('0x25')](function(){return _0x5652c5;});})[_0x9a6b('0x25')](function(){_0x93d18['status'](0xcc)[_0x9a6b('0x1c')]();});}};}function handleEntityNotFound(_0x4eac23,_0x327ffc){return function(_0x33fcee){if(!_0x33fcee){_0x4eac23[_0x9a6b('0x1a')](0x194);}return _0x33fcee;};}function handleError(_0x182daf,_0x3e4e4c){_0x3e4e4c=_0x3e4e4c||0x1f4;return function(_0x114042){logger['error'](_0x114042[_0x9a6b('0x2a')]);if(_0x114042[_0x9a6b('0x2b')]){delete _0x114042[_0x9a6b('0x2b')];}_0x182daf['status'](_0x3e4e4c)[_0x9a6b('0x2c')](_0x114042);};}exports[_0x9a6b('0x2d')]=function(_0x519e87,_0x86fc7d){var _0x3e6fe7={},_0x391940={},_0x290ea0={'count':0x0,'rows':[]};return db[_0x9a6b('0x2e')]['describe']()['then'](function(_0x2e9942){_0x391940[_0x9a6b('0x2f')]=_[_0x9a6b('0x30')](_0x2e9942);_0x391940[_0x9a6b('0x31')]=_[_0x9a6b('0x30')](_0x519e87[_0x9a6b('0x31')]);_0x391940[_0x9a6b('0x32')]=_[_0x9a6b('0x33')](_0x391940['model'],_0x391940[_0x9a6b('0x31')]);_0x3e6fe7[_0x9a6b('0x34')]=_[_0x9a6b('0x33')](_0x391940['model'],qs[_0x9a6b('0x35')](_0x519e87[_0x9a6b('0x31')]['fields']));_0x3e6fe7[_0x9a6b('0x34')]=_0x3e6fe7[_0x9a6b('0x34')][_0x9a6b('0x36')]?_0x3e6fe7[_0x9a6b('0x34')]:_0x391940['model'];if(!_0x519e87[_0x9a6b('0x31')][_0x9a6b('0x37')](_0x9a6b('0x38'))){_0x3e6fe7[_0x9a6b('0x20')]=qs[_0x9a6b('0x20')](_0x519e87[_0x9a6b('0x31')][_0x9a6b('0x20')]);_0x3e6fe7[_0x9a6b('0x1e')]=qs['offset'](_0x519e87['query'][_0x9a6b('0x1e')]);}_0x3e6fe7['order']=qs[_0x9a6b('0x39')](_0x519e87[_0x9a6b('0x31')]['sort']);_0x3e6fe7[_0x9a6b('0x3a')]=qs[_0x9a6b('0x32')](_['pick'](_0x519e87[_0x9a6b('0x31')],_0x391940[_0x9a6b('0x32')]),_0x2e9942);if(_0x519e87[_0x9a6b('0x31')][_0x9a6b('0x3b')]){_0x3e6fe7[_0x9a6b('0x3a')]=_['merge'](_0x3e6fe7[_0x9a6b('0x3a')],{'$or':_[_0x9a6b('0x3c')](_0x3e6fe7[_0x9a6b('0x34')],function(_0x554329){var _0x53034a={};_0x53034a[_0x554329]={'$like':'%'+_0x519e87[_0x9a6b('0x31')][_0x9a6b('0x3b')]+'%'};return _0x53034a;})});}_0x3e6fe7=_['merge']({},_0x3e6fe7,_0x519e87[_0x9a6b('0x3d')]);var _0x301b19={'where':_0x3e6fe7[_0x9a6b('0x3a')]};return db['CmCompany']['count'](_0x301b19)[_0x9a6b('0x25')](function(_0x1ed70d){_0x290ea0[_0x9a6b('0x21')]=_0x1ed70d;if(_0x519e87[_0x9a6b('0x31')]['includeAll']){_0x3e6fe7[_0x9a6b('0x3e')]=[{'all':!![]}];}return db['CmCompany']['findAll'](_0x3e6fe7);})[_0x9a6b('0x25')](function(_0x1b3dc8){_0x290ea0[_0x9a6b('0x3f')]=_0x1b3dc8;return _0x290ea0;})[_0x9a6b('0x25')](respondWithFilteredResult(_0x86fc7d,_0x3e6fe7))[_0x9a6b('0x40')](handleError(_0x86fc7d,null));})[_0x9a6b('0x40')](handleError(_0x86fc7d,null));};exports[_0x9a6b('0x41')]=function(_0x4f810e,_0x5d2974){var _0xe79f8a={'raw':![],'where':{'id':_0x4f810e['params']['id']}},_0x466eb0={};_0x466eb0['model']=_[_0x9a6b('0x30')](db['CmCompany'][_0x9a6b('0x42')]);_0x466eb0[_0x9a6b('0x31')]=_[_0x9a6b('0x30')](_0x4f810e[_0x9a6b('0x31')]);_0x466eb0[_0x9a6b('0x32')]=_[_0x9a6b('0x33')](_0x466eb0['model'],_0x466eb0[_0x9a6b('0x31')]);_0xe79f8a['attributes']=_[_0x9a6b('0x33')](_0x466eb0['model'],qs[_0x9a6b('0x35')](_0x4f810e[_0x9a6b('0x31')]['fields']));_0xe79f8a[_0x9a6b('0x34')]=_0xe79f8a[_0x9a6b('0x34')][_0x9a6b('0x36')]?_0xe79f8a[_0x9a6b('0x34')]:_0x466eb0[_0x9a6b('0x2f')];if(_0x4f810e[_0x9a6b('0x31')][_0x9a6b('0x43')]){_0xe79f8a[_0x9a6b('0x3e')]=[{'all':!![]}];}_0xe79f8a=_['merge']({},_0xe79f8a,_0x4f810e[_0x9a6b('0x3d')]);return db[_0x9a6b('0x2e')][_0x9a6b('0x44')](_0xe79f8a)[_0x9a6b('0x25')](handleEntityNotFound(_0x5d2974,null))[_0x9a6b('0x25')](respondWithResult(_0x5d2974,null))[_0x9a6b('0x40')](handleError(_0x5d2974,null));};exports['create']=function(_0x5f5bba,_0x48b54e){return db[_0x9a6b('0x2e')][_0x9a6b('0x45')](_0x5f5bba['body'],{})[_0x9a6b('0x25')](function(_0x25f162){var _0x3f918d=_0x5f5bba[_0x9a6b('0x46')]['get']({'plain':!![]});if(!_0x3f918d)throw new Error(_0x9a6b('0x47'));if(_0x3f918d[_0x9a6b('0x48')]===_0x9a6b('0x46')){var _0x1390c2=_0x25f162[_0x9a6b('0x27')]({'plain':!![]});var _0x2d6d21=_0x9a6b('0x28');return db[_0x9a6b('0x49')][_0x9a6b('0x44')]({'where':{'name':_0x2d6d21,'userProfileId':_0x3f918d['userProfileId']},'raw':!![]})[_0x9a6b('0x25')](function(_0x5e1381){if(_0x5e1381&&_0x5e1381[_0x9a6b('0x4a')]===0x0){return db[_0x9a6b('0x29')][_0x9a6b('0x45')]({'name':_0x1390c2[_0x9a6b('0x2b')],'resourceId':_0x1390c2['id'],'type':_0x5e1381[_0x9a6b('0x2b')],'sectionId':_0x5e1381['id']},{})['then'](function(){return _0x25f162;});}else{return _0x25f162;}})[_0x9a6b('0x40')](function(_0x2882af){logger[_0x9a6b('0x4b')](_0x9a6b('0x4c'),_0x2882af);throw _0x2882af;});}return _0x25f162;})['then'](respondWithResult(_0x48b54e,0xc9))[_0x9a6b('0x40')](handleError(_0x48b54e,null));};exports[_0x9a6b('0x4d')]=function(_0x812e4d,_0x59f3e5){if(_0x812e4d[_0x9a6b('0x4e')]['id']){delete _0x812e4d[_0x9a6b('0x4e')]['id'];}return db[_0x9a6b('0x2e')][_0x9a6b('0x44')]({'where':{'id':_0x812e4d['params']['id']}})[_0x9a6b('0x25')](handleEntityNotFound(_0x59f3e5,null))['then'](saveUpdates(_0x812e4d[_0x9a6b('0x4e')],null))['then'](respondWithResult(_0x59f3e5,null))['catch'](handleError(_0x59f3e5,null));};exports[_0x9a6b('0x26')]=function(_0x8166be,_0x56c4f4){return db['CmCompany']['find']({'where':{'id':_0x8166be[_0x9a6b('0x4f')]['id']}})[_0x9a6b('0x25')](handleEntityNotFound(_0x56c4f4,null))[_0x9a6b('0x25')](removeEntity(_0x56c4f4,null))[_0x9a6b('0x40')](handleError(_0x56c4f4,null));};exports['describe']=function(_0x5ae31d,_0x4ca200){return db[_0x9a6b('0x2e')][_0x9a6b('0x50')]()[_0x9a6b('0x25')](respondWithResult(_0x4ca200,null))[_0x9a6b('0x40')](handleError(_0x4ca200,null));};exports[_0x9a6b('0x51')]=function(_0x276373,_0x3f7d3b,_0x133daf){return db[_0x9a6b('0x52')][_0x9a6b('0x44')]({'where':{'id':_0x276373[_0x9a6b('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3f7d3b,null))[_0x9a6b('0x25')](function(_0x1dc44c){if(_0x1dc44c){return _0x1dc44c[_0x9a6b('0x51')](_0x276373['body']['ids'],_[_0x9a6b('0x53')](_0x276373[_0x9a6b('0x4e')],[_0x9a6b('0x54'),'id'])||{});}})[_0x9a6b('0x25')](respondWithResult(_0x3f7d3b,null))['catch'](handleError(_0x3f7d3b,null));};exports[_0x9a6b('0x55')]=function(_0x409253,_0x54b6ba,_0x5dfdc9){var _0x42ba25={};var _0x420732={};var _0x3572d0;var _0xd447bb;return db[_0x9a6b('0x2e')]['findOne']({'where':{'id':_0x409253['params']['id']}})[_0x9a6b('0x25')](handleEntityNotFound(_0x54b6ba,null))['then'](function(_0x57c5e4){if(_0x57c5e4){_0x3572d0=_0x57c5e4;_0x420732[_0x9a6b('0x2f')]=_[_0x9a6b('0x30')](db[_0x9a6b('0x52')][_0x9a6b('0x42')]);_0x420732[_0x9a6b('0x31')]=_[_0x9a6b('0x30')](_0x409253[_0x9a6b('0x31')]);_0x420732['filters']=_[_0x9a6b('0x33')](_0x420732[_0x9a6b('0x2f')],_0x420732[_0x9a6b('0x31')]);_0x42ba25[_0x9a6b('0x34')]=_[_0x9a6b('0x33')](_0x420732[_0x9a6b('0x2f')],qs[_0x9a6b('0x35')](_0x409253[_0x9a6b('0x31')]['fields']));_0x42ba25[_0x9a6b('0x34')]=_0x42ba25['attributes']['length']?_0x42ba25[_0x9a6b('0x34')]:_0x420732[_0x9a6b('0x2f')];_0x42ba25['order']=qs[_0x9a6b('0x39')](_0x409253[_0x9a6b('0x31')]['sort']);_0x42ba25[_0x9a6b('0x3a')]=qs[_0x9a6b('0x32')](_[_0x9a6b('0x56')](_0x409253[_0x9a6b('0x31')],_0x420732[_0x9a6b('0x32')]));if(_0x409253[_0x9a6b('0x31')][_0x9a6b('0x3b')]){_0x42ba25[_0x9a6b('0x3a')]=_[_0x9a6b('0x57')](_0x42ba25[_0x9a6b('0x3a')],{'$or':_[_0x9a6b('0x3c')](_0x42ba25['attributes'],function(_0xe2efb){var _0x29ee00={};_0x29ee00[_0xe2efb]={'$like':'%'+_0x409253[_0x9a6b('0x31')][_0x9a6b('0x3b')]+'%'};return _0x29ee00;})});}_0x42ba25=_[_0x9a6b('0x57')]({},_0x42ba25,_0x409253[_0x9a6b('0x3d')]);return _0x3572d0['getContacts'](_0x42ba25);}})[_0x9a6b('0x25')](function(_0x47471e){if(_0x47471e){_0xd447bb=_0x47471e['length'];if(!_0x409253[_0x9a6b('0x31')][_0x9a6b('0x37')](_0x9a6b('0x38'))){_0x42ba25[_0x9a6b('0x20')]=qs[_0x9a6b('0x20')](_0x409253[_0x9a6b('0x31')][_0x9a6b('0x20')]);_0x42ba25['offset']=qs[_0x9a6b('0x1e')](_0x409253[_0x9a6b('0x31')]['offset']);}return _0x3572d0[_0x9a6b('0x55')](_0x42ba25);}})[_0x9a6b('0x25')](function(_0x13758a){if(_0x13758a){return _0x13758a?{'count':_0xd447bb,'rows':_0x13758a}:null;}})['then'](respondWithResult(_0x54b6ba,null))[_0x9a6b('0x40')](handleError(_0x54b6ba,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index e646219..207ec88 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 _0xa947=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./cmCompany.attributes','exports','define','cm_companies','util'];(function(_0x544bca,_0x1f3106){var _0xb9f6b0=function(_0x2d0de9){while(--_0x2d0de9){_0x544bca['push'](_0x544bca['shift']());}};_0xb9f6b0(++_0x1f3106);}(_0xa947,0x1cd));var _0x7a94=function(_0x1470f7,_0x3df412){_0x1470f7=_0x1470f7-0x0;var _0x5473b3=_0xa947[_0x1470f7];return _0x5473b3;};'use strict';var _=require('lodash');var util=require(_0x7a94('0x0'));var logger=require(_0x7a94('0x1'))(_0x7a94('0x2'));var moment=require(_0x7a94('0x3'));var BPromise=require(_0x7a94('0x4'));var rp=require(_0x7a94('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7a94('0x6'));var attributes=require(_0x7a94('0x7'));module[_0x7a94('0x8')]=function(_0x3faa11,_0x370f4e){return _0x3faa11[_0x7a94('0x9')]('CmCompany',attributes,{'tableName':_0x7a94('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4edd=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','util','api'];(function(_0x3a450c,_0x9dced0){var _0x23a746=function(_0x34ac8a){while(--_0x34ac8a){_0x3a450c['push'](_0x3a450c['shift']());}};_0x23a746(++_0x9dced0);}(_0x4edd,0x193));var _0xd4ed=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4edd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd4ed('0x0'));var util=require(_0xd4ed('0x1'));var logger=require('../../config/logger')(_0xd4ed('0x2'));var moment=require(_0xd4ed('0x3'));var BPromise=require(_0xd4ed('0x4'));var rp=require(_0xd4ed('0x5'));var fs=require('fs');var path=require(_0xd4ed('0x6'));var rimraf=require(_0xd4ed('0x7'));var config=require(_0xd4ed('0x8'));var attributes=require(_0xd4ed('0x9'));module[_0xd4ed('0xa')]=function(_0x56bc60,_0x27495c){return _0x56bc60[_0xd4ed('0xb')](_0xd4ed('0xc'),attributes,{'tableName':_0xd4ed('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js
index 43dd8ad..ceba313 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 _0x2d50=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message','result','util','moment','bluebird','randomstring'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x2d50,0x127));var _0x02d5=function(_0x4f1e5e,_0x37c2a0){_0x4f1e5e=_0x4f1e5e-0x0;var _0x354ea1=_0x2d50[_0x4f1e5e];return _0x354ea1;};'use strict';var _=require('lodash');var util=require(_0x02d5('0x0'));var moment=require(_0x02d5('0x1'));var BPromise=require(_0x02d5('0x2'));var rs=require(_0x02d5('0x3'));var fs=require('fs');var Redis=require(_0x02d5('0x4'));var db=require(_0x02d5('0x5'))['db'];var utils=require(_0x02d5('0x6'));var logger=require(_0x02d5('0x7'))(_0x02d5('0x8'));var config=require('../../config/environment');var jayson=require(_0x02d5('0x9'));var client=jayson[_0x02d5('0xa')][_0x02d5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2b619f,_0x5c331d,_0xdb25ce){return new BPromise(function(_0x48bf27,_0x119b1f){return client[_0x02d5('0xc')](_0x2b619f,_0xdb25ce)[_0x02d5('0xd')](function(_0x6a52b5){logger[_0x02d5('0xe')](_0x02d5('0xf'),_0x5c331d,_0x02d5('0x10'));logger[_0x02d5('0x11')](_0x02d5('0x12'),_0x5c331d,'request\x20sent',JSON['stringify'](_0x6a52b5));if(_0x6a52b5[_0x02d5('0x13')]){if(_0x6a52b5[_0x02d5('0x13')][_0x02d5('0x14')]===0x1f4){logger[_0x02d5('0x13')]('CmCompany,\x20%s,\x20%s',_0x5c331d,_0x6a52b5[_0x02d5('0x13')][_0x02d5('0x15')]);return _0x119b1f(_0x6a52b5[_0x02d5('0x13')]['message']);}logger[_0x02d5('0x13')]('CmCompany,\x20%s,\x20%s',_0x5c331d,_0x6a52b5[_0x02d5('0x13')][_0x02d5('0x15')]);return _0x48bf27(_0x6a52b5['error']['message']);}else{logger['info'](_0x02d5('0xf'),_0x5c331d,_0x02d5('0x10'));_0x48bf27(_0x6a52b5[_0x02d5('0x16')][_0x02d5('0x15')]);}})['catch'](function(_0x3dc495){logger[_0x02d5('0x13')](_0x02d5('0xf'),_0x5c331d,_0x3dc495);_0x119b1f(_0x3dc495);});});}
\ No newline at end of file
+var _0xafe5=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code','CmCompany,\x20%s,\x20%s','message','result','lodash'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xafe5,0x15f));var _0x5afe=function(_0x1c63b2,_0x44eb5b){_0x1c63b2=_0x1c63b2-0x0;var _0x3fa7b8=_0xafe5[_0x1c63b2];return _0x3fa7b8;};'use strict';var _=require(_0x5afe('0x0'));var util=require(_0x5afe('0x1'));var moment=require(_0x5afe('0x2'));var BPromise=require('bluebird');var rs=require(_0x5afe('0x3'));var fs=require('fs');var Redis=require(_0x5afe('0x4'));var db=require(_0x5afe('0x5'))['db'];var utils=require(_0x5afe('0x6'));var logger=require(_0x5afe('0x7'))('rpc');var config=require(_0x5afe('0x8'));var jayson=require(_0x5afe('0x9'));var client=jayson[_0x5afe('0xa')][_0x5afe('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbaf35a,_0x18b10c,_0x597ad4){return new BPromise(function(_0x358b1f,_0xa7246){return client[_0x5afe('0xc')](_0xbaf35a,_0x597ad4)['then'](function(_0x723804){logger[_0x5afe('0xd')]('CmCompany,\x20%s,\x20%s',_0x18b10c,_0x5afe('0xe'));logger[_0x5afe('0xf')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x18b10c,_0x5afe('0xe'),JSON[_0x5afe('0x10')](_0x723804));if(_0x723804[_0x5afe('0x11')]){if(_0x723804[_0x5afe('0x11')][_0x5afe('0x12')]===0x1f4){logger['error'](_0x5afe('0x13'),_0x18b10c,_0x723804['error']['message']);return _0xa7246(_0x723804[_0x5afe('0x11')][_0x5afe('0x14')]);}logger['error'](_0x5afe('0x13'),_0x18b10c,_0x723804[_0x5afe('0x11')][_0x5afe('0x14')]);return _0x358b1f(_0x723804[_0x5afe('0x11')]['message']);}else{logger[_0x5afe('0xd')](_0x5afe('0x13'),_0x18b10c,_0x5afe('0xe'));_0x358b1f(_0x723804[_0x5afe('0x15')][_0x5afe('0x14')]);}})['catch'](function(_0x516978){logger[_0x5afe('0x11')](_0x5afe('0x13'),_0x18b10c,_0x516978);_0xa7246(_0x516978);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 98ca966..6cb6424 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 _0xf9ab=['get','isAuthenticated','index','/describe','/:id','show','getContacts','post','/:id/contacts','addContacts','put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./cmCompany.controller'];(function(_0xd9ab80,_0x1f1968){var _0x559fc7=function(_0x46504f){while(--_0x46504f){_0xd9ab80['push'](_0xd9ab80['shift']());}};_0x559fc7(++_0x1f1968);}(_0xf9ab,0x167));var _0xbf9a=function(_0x5ad04e,_0x1ab9ce){_0x5ad04e=_0x5ad04e-0x0;var _0x527186=_0xf9ab[_0x5ad04e];return _0x527186;};'use strict';var multer=require(_0xbf9a('0x0'));var util=require(_0xbf9a('0x1'));var path=require(_0xbf9a('0x2'));var timeout=require(_0xbf9a('0x3'));var express=require(_0xbf9a('0x4'));var router=express['Router']();var fs_extra=require(_0xbf9a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xbf9a('0x6'));var config=require(_0xbf9a('0x7'));var controller=require(_0xbf9a('0x8'));router[_0xbf9a('0x9')]('/',auth[_0xbf9a('0xa')](),controller[_0xbf9a('0xb')]);router[_0xbf9a('0x9')](_0xbf9a('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xbf9a('0x9')](_0xbf9a('0xd'),auth['isAuthenticated'](),controller[_0xbf9a('0xe')]);router[_0xbf9a('0x9')]('/:id/contacts',auth[_0xbf9a('0xa')](),controller[_0xbf9a('0xf')]);router[_0xbf9a('0x10')]('/',auth[_0xbf9a('0xa')](),controller['create']);router[_0xbf9a('0x10')](_0xbf9a('0x11'),auth[_0xbf9a('0xa')](),controller[_0xbf9a('0x12')]);router[_0xbf9a('0x13')](_0xbf9a('0xd'),auth[_0xbf9a('0xa')](),controller['update']);router[_0xbf9a('0x14')](_0xbf9a('0xd'),auth['isAuthenticated'](),controller[_0xbf9a('0x15')]);module[_0xbf9a('0x16')]=router;
\ No newline at end of file
+var _0x63a9=['get','index','/describe','isAuthenticated','/:id','/:id/contacts','getContacts','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller'];(function(_0x1823a0,_0x38947d){var _0x2b780c=function(_0x39d289){while(--_0x39d289){_0x1823a0['push'](_0x1823a0['shift']());}};_0x2b780c(++_0x38947d);}(_0x63a9,0x14f));var _0x963a=function(_0x5649c3,_0x111ee5){_0x5649c3=_0x5649c3-0x0;var _0x4006aa=_0x63a9[_0x5649c3];return _0x4006aa;};'use strict';var multer=require(_0x963a('0x0'));var util=require('util');var path=require(_0x963a('0x1'));var timeout=require(_0x963a('0x2'));var express=require(_0x963a('0x3'));var router=express[_0x963a('0x4')]();var fs_extra=require(_0x963a('0x5'));var auth=require(_0x963a('0x6'));var interaction=require(_0x963a('0x7'));var config=require(_0x963a('0x8'));var controller=require(_0x963a('0x9'));router[_0x963a('0xa')]('/',auth['isAuthenticated'](),controller[_0x963a('0xb')]);router['get'](_0x963a('0xc'),auth[_0x963a('0xd')](),controller['describe']);router['get'](_0x963a('0xe'),auth[_0x963a('0xd')](),controller['show']);router[_0x963a('0xa')](_0x963a('0xf'),auth['isAuthenticated'](),controller[_0x963a('0x10')]);router[_0x963a('0x11')]('/',auth[_0x963a('0xd')](),controller[_0x963a('0x12')]);router[_0x963a('0x11')]('/:id/contacts',auth[_0x963a('0xd')](),controller['addContacts']);router[_0x963a('0x13')](_0x963a('0xe'),auth[_0x963a('0xd')](),controller['update']);router[_0x963a('0x14')](_0x963a('0xe'),auth[_0x963a('0xd')](),controller[_0x963a('0x15')]);module[_0x963a('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 4179afe..b90de5b 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 _0x6a09=['DATE','NOW','lodash','sequelize','exports','STRING','TEXT','INTEGER'];(function(_0x3d616d,_0x461b27){var _0x92042d=function(_0x4bcacb){while(--_0x4bcacb){_0x3d616d['push'](_0x3d616d['shift']());}};_0x92042d(++_0x461b27);}(_0x6a09,0x14a));var _0x96a0=function(_0x5db1ce,_0x57ab66){_0x5db1ce=_0x5db1ce-0x0;var _0xb62cbb=_0x6a09[_0x5db1ce];return _0xb62cbb;};'use strict';var _=require(_0x96a0('0x0'));var Sequelize=require(_0x96a0('0x1'));module[_0x96a0('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x96a0('0x3')]},'postalCode':{'type':Sequelize[_0x96a0('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x96a0('0x3')]},'dateOfBirth':{'type':Sequelize[_0x96a0('0x3')]},'description':{'type':Sequelize[_0x96a0('0x4')]},'phone':{'type':Sequelize[_0x96a0('0x3')]},'mobile':{'type':Sequelize[_0x96a0('0x3')]},'fax':{'type':Sequelize[_0x96a0('0x3')]},'email':{'type':Sequelize[_0x96a0('0x3')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x96a0('0x3')]},'fb_data':{'type':Sequelize[_0x96a0('0x3')]},'twitter':{'type':Sequelize[_0x96a0('0x3')]},'skype':{'type':Sequelize[_0x96a0('0x3')]},'teams':{'type':Sequelize[_0x96a0('0x3')]},'viber':{'type':Sequelize[_0x96a0('0x3')]},'line':{'type':Sequelize[_0x96a0('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x96a0('0x3')]},'UserId':{'type':Sequelize[_0x96a0('0x5')]},'AdditionalPhones':{'type':Sequelize[_0x96a0('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x96a0('0x6')],'defaultValue':Sequelize[_0x96a0('0x7')]},'dialTimezone':{'type':Sequelize[_0x96a0('0x3')]},'utcOffset':{'type':Sequelize[_0x96a0('0x5')]}};
\ No newline at end of file
+var _0xc43e=['INTEGER','sequelize','STRING','TEXT','UNSIGNED','DATE','NOW'];(function(_0x143bb3,_0x3b1ff9){var _0x358977=function(_0x12743d){while(--_0x12743d){_0x143bb3['push'](_0x143bb3['shift']());}};_0x358977(++_0x3b1ff9);}(_0xc43e,0x13c));var _0xec43=function(_0xdfdcec,_0x5e4bc5){_0xdfdcec=_0xdfdcec-0x0;var _0x4dfb91=_0xc43e[_0xdfdcec];return _0x4dfb91;};'use strict';var _=require('lodash');var Sequelize=require(_0xec43('0x0'));module['exports']={'firstName':{'type':Sequelize[_0xec43('0x1')],'allowNull':![]},'lastName':{'type':Sequelize[_0xec43('0x1')]},'street':{'type':Sequelize[_0xec43('0x1')]},'postalCode':{'type':Sequelize[_0xec43('0x1')]},'city':{'type':Sequelize[_0xec43('0x1')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0xec43('0x1')]},'description':{'type':Sequelize[_0xec43('0x2')]},'phone':{'type':Sequelize[_0xec43('0x1')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xec43('0x1')]},'email':{'type':Sequelize[_0xec43('0x1')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xec43('0x1')]},'fb_data':{'type':Sequelize[_0xec43('0x1')]},'twitter':{'type':Sequelize[_0xec43('0x1')]},'skype':{'type':Sequelize[_0xec43('0x1')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0xec43('0x1')]},'telegram':{'type':Sequelize[_0xec43('0x1')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0xec43('0x1')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xec43('0x3')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xec43('0x4')],'defaultValue':Sequelize[_0xec43('0x5')]},'dialTimezone':{'type':Sequelize[_0xec43('0x1')]},'utcOffset':{'type':Sequelize[_0xec43('0x6')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 443ee26..e6c4b68 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 _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','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','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b6
','Attachments','Title','Data','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','base64','lodash','moment','path','node-tnef','../../../config/logger','email','head','address','anonymous','generate','@xcally.com','name','substring','indexOf','split','slice'];(function(_0x5acf41,_0x1a8225){var _0x3da82f=function(_0x51f506){while(--_0x51f506){_0x5acf41['push'](_0x5acf41['shift']());}};_0x3da82f(++_0x1a8225);}(_0xb75c,0x130));var _0xcb75=function(_0x40b0fe,_0x4eb9ff){_0x40b0fe=_0x40b0fe-0x0;var _0x33e9b5=_0xb75c[_0x40b0fe];return _0x33e9b5;};'use strict';var _=require(_0xcb75('0x0'));var moment=require(_0xcb75('0x1'));var random=require('randomstring');var fs=require('fs');var path=require(_0xcb75('0x2'));var util=require('util');var tnef=require(_0xcb75('0x3'));var logger=require(_0xcb75('0x4'))(_0xcb75('0x5'));var config=require('../../../config/environment');function getAddress(_0x2a5662){var _0x2b0055=_[_0xcb75('0x6')](_0x2a5662['value']);return _0x2b0055&&_0x2b0055[_0xcb75('0x7')]?_0x2b0055[_0xcb75('0x7')]:_0xcb75('0x8')+random[_0xcb75('0x9')](0x6)+_0xcb75('0xa');}function getFirstName(_0x320efa){var _0x5c6a1d=_[_0xcb75('0x6')](_0x320efa['value']);if(_0x5c6a1d&&_0x5c6a1d[_0xcb75('0xb')]){if(_0x5c6a1d[_0xcb75('0xb')]==_0x5c6a1d[_0xcb75('0x7')]){return _0x5c6a1d['name'][_0xcb75('0xc')](0x0,_0x5c6a1d[_0xcb75('0xb')][_0xcb75('0xd')]('@'));}var _0x104f49=_0x5c6a1d[_0xcb75('0xb')][_0xcb75('0xe')](/\s+/);return _0x104f49['length']>0x1?_0x104f49[_0xcb75('0xf')](0x0,-0x1)[_0xcb75('0x10')]('\x20'):_0x5c6a1d[_0xcb75('0xb')];}return _0xcb75('0x11');}function getLastName(_0xb5a93d){var _0x4fb5a5=_[_0xcb75('0x6')](_0xb5a93d[_0xcb75('0x12')]);if(_0x4fb5a5&&_0x4fb5a5[_0xcb75('0xb')]){var _0x319570=_0x4fb5a5[_0xcb75('0xb')][_0xcb75('0xe')](/\s+/);return _0x319570['length']>0x1?_0x319570[_0xcb75('0x13')]():'';}return'';}function getMails(_0x289355,_0x32eea6){var _0x579293='';for(var _0x34d60c=0x0;_0x34d60c<_0x32eea6[_0xcb75('0x12')]['length'];_0x34d60c+=0x1){if(_0x32eea6[_0xcb75('0x12')][_0x34d60c][_0xcb75('0x7')]!==_0x289355){if(!_[_0xcb75('0x14')](_0x579293)){_0x579293+=',';}_0x579293+=_0x32eea6[_0xcb75('0x12')][_0x34d60c][_0xcb75('0xb')]||_0x32eea6[_0xcb75('0x12')][_0x34d60c][_0xcb75('0x7')]||'';_0x579293+='\x20<';_0x579293+=_0x32eea6[_0xcb75('0x12')][_0x34d60c][_0xcb75('0x7')]?_0x32eea6['value'][_0x34d60c][_0xcb75('0x7')]:_0xcb75('0x8')+random[_0xcb75('0x9')](0x6)+_0xcb75('0xa');_0x579293+='>';}}return _0x579293;}function parseEmail(_0x4dd120,_0x4c702d,_0x237a53){if(_0x4c702d[_0xcb75('0x15')]){var _0x346457=/