From: support
Date: Mon, 23 Jan 2023 14:11:36 +0000 (+0000)
Subject: Built motion from commit 56b8093a.|2.6.29
X-Git-Url: http://repos.xcallymotion.com/base//%22angular-material.themes.css/%22?a=commitdiff_plain;h=f62d491c2e8107f16496a8b641a4b2b79f0145b6;p=motion2.git
Built motion from commit 56b8093a.|2.6.29
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 461c2e4..b0ba6b8 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2023-01-23T13:32:23.496Z",
+ "time": "2023-01-23T14:03:05.113Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 818dada..ef30049 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2023-01-23T13:32:23.496Z",
+ "time": "2023-01-23T14:03:05.113Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json
index 828fec0..bec345e 100644
--- a/npm-shrinkwrap.json
+++ b/npm-shrinkwrap.json
@@ -7177,11 +7177,6 @@
"from": "ret@>=0.1.10 <0.2.0",
"resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz"
},
- "retry": {
- "version": "0.13.1",
- "from": "retry@latest",
- "resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz"
- },
"retry-as-promised": {
"version": "2.3.2",
"from": "retry-as-promised@>=2.0.0 <3.0.0",
diff --git a/package.json b/package.json
index dc3bbc0..c430d50 100644
--- a/package.json
+++ b/package.json
@@ -133,7 +133,6 @@
"pm2": "2.10.4",
"randomstring": "1.1.5",
"request-promise": "4.2.6",
- "retry": "^0.13.1",
"retry-request": "^4.0.0",
"rimraf": "2.7.1",
"rr": "0.1.0",
diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js
index 9a7ef3e..d441de2 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 _0x1e93=['motionbar','jscripty','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','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]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','sequelize','exports','VIRTUAL','action','STRING'];(function(_0x19a49f,_0x444d74){var _0x5351ae=function(_0x58b1ed){while(--_0x58b1ed){_0x19a49f['push'](_0x19a49f['shift']());}};_0x5351ae(++_0x444d74);}(_0x1e93,0x14b));var _0x31e9=function(_0x5673f1,_0x3cc273){_0x5673f1=_0x5673f1-0x0;var _0x5bd0ee=_0x1e93[_0x5673f1];return _0x5bd0ee;};'use strict';var Sequelize=require(_0x31e9('0x0'));module[_0x31e9('0x1')]={'name':{'type':Sequelize[_0x31e9('0x2')],'get':function(_0x404393){return this['getDataValue'](_0x31e9('0x3'));}},'action':{'type':Sequelize[_0x31e9('0x4')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager','integration',_0x31e9('0x5'),_0x31e9('0x6'),'urlForward','browser','bot',_0x31e9('0x7')]],'msg':_0x31e9('0x8')}},'comment':_0x31e9('0x8')},'data1':{'type':Sequelize['STRING'](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[_0x31e9('0x4')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x31e9('0x4')](0x1000),'comment':_0x31e9('0x9')},'data4':{'type':Sequelize[_0x31e9('0x4')](0x1000),'comments':_0x31e9('0xa')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x31e9('0xb')},'data6':{'type':Sequelize[_0x31e9('0x4')],'comments':_0x31e9('0xc')},'data7':{'type':Sequelize['TEXT'],'comments':_0x31e9('0xd')}};
\ No newline at end of file
+var _0x9e84=['urlForward[body]','sequelize','exports','VIRTUAL','action','STRING','contactManager','integration','motionbar','urlForward','browser','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9e84,0x196));var _0x49e8=function(_0x1bb58c,_0x2c8a4d){_0x1bb58c=_0x1bb58c-0x0;var _0x277586=_0x9e84[_0x1bb58c];return _0x277586;};'use strict';var Sequelize=require(_0x49e8('0x0'));module[_0x49e8('0x1')]={'name':{'type':Sequelize[_0x49e8('0x2')],'get':function(_0x525f38){return this['getDataValue'](_0x49e8('0x3'));}},'action':{'type':Sequelize[_0x49e8('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x49e8('0x5'),_0x49e8('0x6'),_0x49e8('0x7'),'jscripty',_0x49e8('0x8'),_0x49e8('0x9'),_0x49e8('0xa'),'script']],'msg':_0x49e8('0xb')}},'comment':_0x49e8('0xb')},'data1':{'type':Sequelize[_0x49e8('0x4')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize[_0x49e8('0x4')](0x1000),'comment':_0x49e8('0xc')},'data3':{'type':Sequelize[_0x49e8('0x4')](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[_0x49e8('0x4')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x49e8('0xd')},'data6':{'type':Sequelize[_0x49e8('0x4')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize['TEXT'],'comments':_0x49e8('0xe')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 484e5ac..44f30d8 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 _0xfe07=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','update','body','Action','find','params','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring'];(function(_0x3f32d9,_0x3807f3){var _0x44375b=function(_0x2776b2){while(--_0x2776b2){_0x3f32d9['push'](_0x3f32d9['shift']());}};_0x44375b(++_0x3807f3);}(_0xfe07,0x161));var _0x7fe0=function(_0x1bf4f9,_0x48a7b2){_0x1bf4f9=_0x1bf4f9-0x0;var _0x2f0a77=_0xfe07[_0x1bf4f9];return _0x2f0a77;};'use strict';var emlformat=require(_0x7fe0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7fe0('0x1'));var jsonpatch=require(_0x7fe0('0x2'));var rp=require(_0x7fe0('0x3'));var moment=require(_0x7fe0('0x4'));var BPromise=require(_0x7fe0('0x5'));var Mustache=require(_0x7fe0('0x6'));var util=require('util');var path=require(_0x7fe0('0x7'));var sox=require('sox');var csv=require(_0x7fe0('0x8'));var ejs=require(_0x7fe0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7fe0('0xa'));var crypto=require(_0x7fe0('0xb'));var jsforce=require(_0x7fe0('0xc'));var deskjs=require(_0x7fe0('0xd'));var toCsv=require(_0x7fe0('0x8'));var querystring=require(_0x7fe0('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7fe0('0xf'));var qs=require(_0x7fe0('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7fe0('0x11'));var logger=require(_0x7fe0('0x12'))('api');var utils=require(_0x7fe0('0x13'));var config=require(_0x7fe0('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x7fe0('0x15'))['db'];function respondWithStatusCode(_0x2d8754,_0x26ba6f){_0x26ba6f=_0x26ba6f||0xcc;return function(_0x2dad86){if(_0x2dad86){return _0x2d8754[_0x7fe0('0x16')](_0x26ba6f);}return _0x2d8754[_0x7fe0('0x17')](_0x26ba6f)[_0x7fe0('0x18')]();};}function respondWithResult(_0x556edc,_0x3eee3f){_0x3eee3f=_0x3eee3f||0xc8;return function(_0x430059){if(_0x430059){return _0x556edc[_0x7fe0('0x17')](_0x3eee3f)[_0x7fe0('0x19')](_0x430059);}};}function respondWithFilteredResult(_0x2f03e7,_0x5616be){return function(_0x239088){if(_0x239088){var _0x485ad1=typeof _0x5616be['offset']===_0x7fe0('0x1a')&&typeof _0x5616be[_0x7fe0('0x1b')]===_0x7fe0('0x1a');var _0x7cc12=_0x239088[_0x7fe0('0x1c')];var _0x5d8f8f=_0x485ad1?0x0:_0x5616be[_0x7fe0('0x1d')];var _0x280fe6=_0x485ad1?_0x239088[_0x7fe0('0x1c')]:_0x5616be[_0x7fe0('0x1d')]+_0x5616be[_0x7fe0('0x1b')];var _0x94d2cb;if(_0x280fe6>=_0x7cc12){_0x280fe6=_0x7cc12;_0x94d2cb=0xc8;}else{_0x94d2cb=0xce;}_0x2f03e7[_0x7fe0('0x17')](_0x94d2cb);return _0x2f03e7[_0x7fe0('0x1e')](_0x7fe0('0x1f'),_0x5d8f8f+'-'+_0x280fe6+'/'+_0x7cc12)[_0x7fe0('0x19')](_0x239088);}return null;};}function patchUpdates(_0x29ade5){return function(_0x1bbe40){try{jsonpatch[_0x7fe0('0x20')](_0x1bbe40,_0x29ade5,!![]);}catch(_0x2787ce){return BPromise[_0x7fe0('0x21')](_0x2787ce);}return _0x1bbe40['save']();};}function saveUpdates(_0x2e1c73,_0x1788da){return function(_0x479cd1){if(_0x479cd1){return _0x479cd1['update'](_0x2e1c73)[_0x7fe0('0x22')](function(_0x3dd5d8){return _0x3dd5d8;});}return null;};}function removeEntity(_0x155286,_0x850f8a){return function(_0x1fdb6a){if(_0x1fdb6a){return _0x1fdb6a[_0x7fe0('0x23')]()[_0x7fe0('0x22')](function(){_0x155286[_0x7fe0('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2194c8,_0x3c84cf){return function(_0x38cf1e){if(!_0x38cf1e){_0x2194c8[_0x7fe0('0x16')](0x194);}return _0x38cf1e;};}function handleError(_0x3a882d,_0x40f335){_0x40f335=_0x40f335||0x1f4;return function(_0x1075d9){logger[_0x7fe0('0x24')](_0x1075d9[_0x7fe0('0x25')]);if(_0x1075d9['name']){delete _0x1075d9[_0x7fe0('0x26')];}_0x3a882d['status'](_0x40f335)[_0x7fe0('0x27')](_0x1075d9);};}exports[_0x7fe0('0x28')]=function(_0x5ba08b,_0x4cd937){if(_0x5ba08b['body']['id']){delete _0x5ba08b[_0x7fe0('0x29')]['id'];}return db[_0x7fe0('0x2a')][_0x7fe0('0x2b')]({'where':{'id':_0x5ba08b[_0x7fe0('0x2c')]['id']}})['then'](handleEntityNotFound(_0x4cd937,null))[_0x7fe0('0x22')](saveUpdates(_0x5ba08b['body'],null))[_0x7fe0('0x22')](respondWithResult(_0x4cd937,null))[_0x7fe0('0x2d')](handleError(_0x4cd937,null));};exports['destroy']=function(_0x4b2fb4,_0x3568ac){return db[_0x7fe0('0x2a')][_0x7fe0('0x2b')]({'where':{'id':_0x4b2fb4[_0x7fe0('0x2c')]['id']}})[_0x7fe0('0x22')](handleEntityNotFound(_0x3568ac,null))[_0x7fe0('0x22')](removeEntity(_0x3568ac,null))[_0x7fe0('0x2d')](handleError(_0x3568ac,null));};
\ No newline at end of file
+var _0x75bc=['destroy','then','error','stack','name','send','body','Action','find','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update'];(function(_0x5470ff,_0x1d46c3){var _0x547d3a=function(_0x430686){while(--_0x430686){_0x5470ff['push'](_0x5470ff['shift']());}};_0x547d3a(++_0x1d46c3);}(_0x75bc,0x10f));var _0xc75b=function(_0x5754cd,_0x2c655b){_0x5754cd=_0x5754cd-0x0;var _0xec0f7b=_0x75bc[_0x5754cd];return _0xec0f7b;};'use strict';var emlformat=require(_0xc75b('0x0'));var rimraf=require(_0xc75b('0x1'));var zipdir=require(_0xc75b('0x2'));var jsonpatch=require(_0xc75b('0x3'));var rp=require(_0xc75b('0x4'));var moment=require(_0xc75b('0x5'));var BPromise=require(_0xc75b('0x6'));var Mustache=require(_0xc75b('0x7'));var util=require(_0xc75b('0x8'));var path=require(_0xc75b('0x9'));var sox=require(_0xc75b('0xa'));var csv=require(_0xc75b('0xb'));var ejs=require(_0xc75b('0xc'));var fs=require('fs');var fs_extra=require(_0xc75b('0xd'));var _=require(_0xc75b('0xe'));var squel=require(_0xc75b('0xf'));var crypto=require(_0xc75b('0x10'));var jsforce=require(_0xc75b('0x11'));var deskjs=require(_0xc75b('0x12'));var toCsv=require(_0xc75b('0xb'));var querystring=require(_0xc75b('0x13'));var Papa=require('papaparse');var Redis=require(_0xc75b('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xc75b('0x15'));var as=require(_0xc75b('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc75b('0x17'));var utils=require('../../config/utils');var config=require(_0xc75b('0x18'));var licenseUtil=require(_0xc75b('0x19'));var db=require(_0xc75b('0x1a'))['db'];function respondWithStatusCode(_0x43e22e,_0x32921e){_0x32921e=_0x32921e||0xcc;return function(_0x8cf925){if(_0x8cf925){return _0x43e22e[_0xc75b('0x1b')](_0x32921e);}return _0x43e22e[_0xc75b('0x1c')](_0x32921e)[_0xc75b('0x1d')]();};}function respondWithResult(_0xcdc8fb,_0xdea2c){_0xdea2c=_0xdea2c||0xc8;return function(_0x453e0a){if(_0x453e0a){return _0xcdc8fb[_0xc75b('0x1c')](_0xdea2c)['json'](_0x453e0a);}};}function respondWithFilteredResult(_0x352684,_0x4a0eae){return function(_0x556f4c){if(_0x556f4c){var _0x21bfb6=typeof _0x4a0eae[_0xc75b('0x1e')]===_0xc75b('0x1f')&&typeof _0x4a0eae['limit']==='undefined';var _0x360d8b=_0x556f4c[_0xc75b('0x20')];var _0x3c6f1d=_0x21bfb6?0x0:_0x4a0eae[_0xc75b('0x1e')];var _0x43c547=_0x21bfb6?_0x556f4c['count']:_0x4a0eae[_0xc75b('0x1e')]+_0x4a0eae[_0xc75b('0x21')];var _0x2fe7a6;if(_0x43c547>=_0x360d8b){_0x43c547=_0x360d8b;_0x2fe7a6=0xc8;}else{_0x2fe7a6=0xce;}_0x352684['status'](_0x2fe7a6);return _0x352684[_0xc75b('0x22')](_0xc75b('0x23'),_0x3c6f1d+'-'+_0x43c547+'/'+_0x360d8b)[_0xc75b('0x24')](_0x556f4c);}return null;};}function patchUpdates(_0x141b19){return function(_0x494880){try{jsonpatch[_0xc75b('0x25')](_0x494880,_0x141b19,!![]);}catch(_0x1ba9cd){return BPromise[_0xc75b('0x26')](_0x1ba9cd);}return _0x494880[_0xc75b('0x27')]();};}function saveUpdates(_0x1960fa,_0x4bfc45){return function(_0x4777d8){if(_0x4777d8){return _0x4777d8[_0xc75b('0x28')](_0x1960fa)['then'](function(_0x50108e){return _0x50108e;});}return null;};}function removeEntity(_0x9dcc5c,_0x11d202){return function(_0x940da8){if(_0x940da8){return _0x940da8[_0xc75b('0x29')]()[_0xc75b('0x2a')](function(){_0x9dcc5c['status'](0xcc)[_0xc75b('0x1d')]();});}};}function handleEntityNotFound(_0x2b40d6,_0x2fa6a8){return function(_0x1dac54){if(!_0x1dac54){_0x2b40d6[_0xc75b('0x1b')](0x194);}return _0x1dac54;};}function handleError(_0x404b4e,_0x375aa5){_0x375aa5=_0x375aa5||0x1f4;return function(_0x5ea0ed){logger[_0xc75b('0x2b')](_0x5ea0ed[_0xc75b('0x2c')]);if(_0x5ea0ed[_0xc75b('0x2d')]){delete _0x5ea0ed[_0xc75b('0x2d')];}_0x404b4e[_0xc75b('0x1c')](_0x375aa5)[_0xc75b('0x2e')](_0x5ea0ed);};}exports[_0xc75b('0x28')]=function(_0x5ee7b4,_0x3da2fb){if(_0x5ee7b4[_0xc75b('0x2f')]['id']){delete _0x5ee7b4[_0xc75b('0x2f')]['id'];}return db[_0xc75b('0x30')][_0xc75b('0x31')]({'where':{'id':_0x5ee7b4[_0xc75b('0x32')]['id']}})[_0xc75b('0x2a')](handleEntityNotFound(_0x3da2fb,null))[_0xc75b('0x2a')](saveUpdates(_0x5ee7b4[_0xc75b('0x2f')],null))[_0xc75b('0x2a')](respondWithResult(_0x3da2fb,null))[_0xc75b('0x33')](handleError(_0x3da2fb,null));};exports[_0xc75b('0x29')]=function(_0x131e81,_0x352ff0){return db[_0xc75b('0x30')][_0xc75b('0x31')]({'where':{'id':_0x131e81[_0xc75b('0x32')]['id']}})['then'](handleEntityNotFound(_0x352ff0,null))[_0xc75b('0x2a')](removeEntity(_0x352ff0,null))[_0xc75b('0x33')](handleError(_0x352ff0,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 302cd1b..d8181a1 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 _0x31a3=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','exports','define','Action','tools_actions','lodash','util','../../config/logger'];(function(_0x23f659,_0x33bfcb){var _0x1edce0=function(_0x48ca3f){while(--_0x48ca3f){_0x23f659['push'](_0x23f659['shift']());}};_0x1edce0(++_0x33bfcb);}(_0x31a3,0x183));var _0x331a=function(_0x97ab47,_0x5cdab2){_0x97ab47=_0x97ab47-0x0;var _0x2d291f=_0x31a3[_0x97ab47];return _0x2d291f;};'use strict';var _=require(_0x331a('0x0'));var util=require(_0x331a('0x1'));var logger=require(_0x331a('0x2'))(_0x331a('0x3'));var moment=require(_0x331a('0x4'));var BPromise=require(_0x331a('0x5'));var rp=require(_0x331a('0x6'));var fs=require('fs');var path=require(_0x331a('0x7'));var rimraf=require(_0x331a('0x8'));var config=require(_0x331a('0x9'));var attributes=require(_0x331a('0xa'));module[_0x331a('0xb')]=function(_0x7665a9,_0x221b58){return _0x7665a9[_0x331a('0xc')](_0x331a('0xd'),attributes,{'tableName':_0x331a('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xaf42=['../../config/logger','api','moment','path','rimraf','../../config/environment','./action.attributes','exports','define','Action','tools_actions','util'];(function(_0x5be795,_0x1cb1b8){var _0x4e8a3b=function(_0x5584ef){while(--_0x5584ef){_0x5be795['push'](_0x5be795['shift']());}};_0x4e8a3b(++_0x1cb1b8);}(_0xaf42,0x11f));var _0x2af4=function(_0x502630,_0x55d533){_0x502630=_0x502630-0x0;var _0x3b4819=_0xaf42[_0x502630];return _0x3b4819;};'use strict';var _=require('lodash');var util=require(_0x2af4('0x0'));var logger=require(_0x2af4('0x1'))(_0x2af4('0x2'));var moment=require(_0x2af4('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2af4('0x4'));var rimraf=require(_0x2af4('0x5'));var config=require(_0x2af4('0x6'));var attributes=require(_0x2af4('0x7'));module[_0x2af4('0x8')]=function(_0x57c97d,_0x1f8cd3){return _0x57c97d[_0x2af4('0x9')](_0x2af4('0xa'),attributes,{'tableName':_0x2af4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index d706ba0..2fd49ea 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 _0x8ef6=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3e7088,_0x53f329){var _0x569c18=function(_0x3c09b9){while(--_0x3c09b9){_0x3e7088['push'](_0x3e7088['shift']());}};_0x569c18(++_0x53f329);}(_0x8ef6,0xf2));var _0x68ef=function(_0x333981,_0x344c4e){_0x333981=_0x333981-0x0;var _0xfcb54d=_0x8ef6[_0x333981];return _0xfcb54d;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));var BPromise=require(_0x68ef('0x3'));var rs=require(_0x68ef('0x4'));var fs=require('fs');var Redis=require(_0x68ef('0x5'));var db=require(_0x68ef('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x68ef('0x7'))(_0x68ef('0x8'));var config=require(_0x68ef('0x9'));var jayson=require(_0x68ef('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c2ff3,_0x4740e8,_0x2de776){return new BPromise(function(_0x4eb5eb,_0x228967){return client[_0x68ef('0xb')](_0x3c2ff3,_0x2de776)[_0x68ef('0xc')](function(_0x22ae26){logger[_0x68ef('0xd')](_0x68ef('0xe'),_0x4740e8,_0x68ef('0xf'));logger[_0x68ef('0x10')](_0x68ef('0x11'),_0x4740e8,_0x68ef('0xf'),JSON[_0x68ef('0x12')](_0x22ae26));if(_0x22ae26[_0x68ef('0x13')]){if(_0x22ae26['error'][_0x68ef('0x14')]===0x1f4){logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);return _0x228967(_0x22ae26[_0x68ef('0x13')]['message']);}logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')]['message']);return _0x4eb5eb(_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);}else{logger[_0x68ef('0xd')]('Action,\x20%s,\x20%s',_0x4740e8,_0x68ef('0xf'));_0x4eb5eb(_0x22ae26[_0x68ef('0x16')][_0x68ef('0x15')]);}})[_0x68ef('0x17')](function(_0x5c4456){logger[_0x68ef('0x13')]('Action,\x20%s,\x20%s',_0x4740e8,_0x5c4456);_0x228967(_0x5c4456);});});}
\ No newline at end of file
+var _0x1261=['then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x229f1b,_0x1eca63){var _0x7e7505=function(_0x2964e5){while(--_0x2964e5){_0x229f1b['push'](_0x229f1b['shift']());}};_0x7e7505(++_0x1eca63);}(_0x1261,0x144));var _0x1126=function(_0x2b6b89,_0x172ec0){_0x2b6b89=_0x2b6b89-0x0;var _0x5aa6af=_0x1261[_0x2b6b89];return _0x5aa6af;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('Action,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index b354062..c7ee77e 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 _0xb9e1=['../../components/auth/service','./action.controller','put','/:id','isAuthenticated','update','delete','destroy','connect-timeout','express','fs-extra'];(function(_0x53e3fa,_0x50c5f2){var _0xe8584a=function(_0x1771a5){while(--_0x1771a5){_0x53e3fa['push'](_0x53e3fa['shift']());}};_0xe8584a(++_0x50c5f2);}(_0xb9e1,0x126));var _0x1b9e=function(_0xab3157,_0x28ef0c){_0xab3157=_0xab3157-0x0;var _0x4045dc=_0xb9e1[_0xab3157];return _0x4045dc;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x1b9e('0x0'));var express=require(_0x1b9e('0x1'));var router=express['Router']();var fs_extra=require(_0x1b9e('0x2'));var auth=require(_0x1b9e('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1b9e('0x4'));router[_0x1b9e('0x5')](_0x1b9e('0x6'),auth[_0x1b9e('0x7')](),controller[_0x1b9e('0x8')]);router[_0x1b9e('0x9')]('/:id',auth[_0x1b9e('0x7')](),controller[_0x1b9e('0xa')]);module['exports']=router;
\ No newline at end of file
+var _0x3bcc=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','/:id','isAuthenticated','update','destroy'];(function(_0x150a39,_0x17ea5b){var _0x349f73=function(_0x8ac23a){while(--_0x8ac23a){_0x150a39['push'](_0x150a39['shift']());}};_0x349f73(++_0x17ea5b);}(_0x3bcc,0x9b));var _0xc3bc=function(_0x11c9b5,_0x589e4f){_0x11c9b5=_0x11c9b5-0x0;var _0x24d1f5=_0x3bcc[_0x11c9b5];return _0x24d1f5;};'use strict';var multer=require(_0xc3bc('0x0'));var util=require(_0xc3bc('0x1'));var path=require(_0xc3bc('0x2'));var timeout=require(_0xc3bc('0x3'));var express=require(_0xc3bc('0x4'));var router=express[_0xc3bc('0x5')]();var fs_extra=require(_0xc3bc('0x6'));var auth=require(_0xc3bc('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xc3bc('0x8'));var controller=require('./action.controller');router['put'](_0xc3bc('0x9'),auth[_0xc3bc('0xa')](),controller[_0xc3bc('0xb')]);router['delete'](_0xc3bc('0x9'),auth[_0xc3bc('0xa')](),controller[_0xc3bc('0xc')]);module[_0xc3bc('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 20f2ac2..f92605c 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 _0x5fc3=['sequelize','exports','STRING','TEXT'];(function(_0x33548b,_0x2887b2){var _0x1530ec=function(_0x2bcc62){while(--_0x2bcc62){_0x33548b['push'](_0x33548b['shift']());}};_0x1530ec(++_0x2887b2);}(_0x5fc3,0xa8));var _0x35fc=function(_0x219d87,_0x1cb6f7){_0x219d87=_0x219d87-0x0;var _0x22823d=_0x5fc3[_0x219d87];return _0x22823d;};'use strict';var Sequelize=require(_0x35fc('0x0'));module[_0x35fc('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x35fc('0x2')]},'parent':{'type':Sequelize[_0x35fc('0x2')]},'table':{'type':Sequelize[_0x35fc('0x2')]},'conditions':{'type':Sequelize[_0x35fc('0x3')]},'joins':{'type':Sequelize[_0x35fc('0x3')]}};
\ No newline at end of file
+var _0x5075=['exports','STRING','TEXT','sequelize'];(function(_0x100e36,_0x4da225){var _0x1df0c9=function(_0xe4b84f){while(--_0xe4b84f){_0x100e36['push'](_0x100e36['shift']());}};_0x1df0c9(++_0x4da225);}(_0x5075,0x73));var _0x5507=function(_0x2a608d,_0x298459){_0x2a608d=_0x2a608d-0x0;var _0x1bee3e=_0x5075[_0x2a608d];return _0x1bee3e;};'use strict';var Sequelize=require(_0x5507('0x0'));module[_0x5507('0x1')]={'name':{'type':Sequelize[_0x5507('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x5507('0x2')]},'parent':{'type':Sequelize[_0x5507('0x2')]},'table':{'type':Sequelize[_0x5507('0x2')]},'conditions':{'type':Sequelize[_0x5507('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index c1fd5a7..9ca24e4 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 _0x9f9d=['UserProfileResource','destroy','end','sendStatus','error','stack','name','send','map','AnalyticCustomReport','rawAttributes','type','key','model','query','keys','filters','attributes','fields','length','nolimit','order','sort','pick','filter','where','include','findAll','rows','catch','intersection','includeAll','merge','options','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Reports','UserProfileSection','find','userProfileId','autoAssociation','params','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','IS\x20NULL','IS\x20NOT\x20NULL','rules','group','field','condition','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','from','table','MetricId','metric','replace','format','groupBy','orderBy','DESC','alias','joins','parse','includes','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','toString','sequelize','QueryTypes','SELECT','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','value','getFields','keyBy','select','function','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','runReport','cross_join','IS\x20EMPTY','IS\x20NOT\x20EMPTY','operator','Limited\x20Query:','eml-format','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','dbH','status','offset','limit','undefined','count','set','json','apply','save','update','then','CustomReports'];(function(_0x50659e,_0x33de0d){var _0x55bd68=function(_0x413701){while(--_0x413701){_0x50659e['push'](_0x50659e['shift']());}};_0x55bd68(++_0x33de0d);}(_0x9f9d,0x1c2));var _0xd9f9=function(_0x19f670,_0x36d23f){_0x19f670=_0x19f670-0x0;var _0x3ffd49=_0x9f9d[_0x19f670];return _0x3ffd49;};'use strict';var emlformat=require(_0xd9f9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd9f9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd9f9('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd9f9('0x3'));var util=require(_0xd9f9('0x4'));var path=require(_0xd9f9('0x5'));var sox=require(_0xd9f9('0x6'));var csv=require(_0xd9f9('0x7'));var ejs=require(_0xd9f9('0x8'));var fs=require('fs');var fs_extra=require(_0xd9f9('0x9'));var _=require(_0xd9f9('0xa'));var squel=require(_0xd9f9('0xb'));var crypto=require(_0xd9f9('0xc'));var jsforce=require(_0xd9f9('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd9f9('0x7'));var querystring=require(_0xd9f9('0xe'));var Papa=require('papaparse');var Redis=require(_0xd9f9('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd9f9('0x10'));var hardwareService=require(_0xd9f9('0x11'));var logger=require(_0xd9f9('0x12'))(_0xd9f9('0x13'));var utils=require(_0xd9f9('0x14'));var config=require(_0xd9f9('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xd9f9('0x16'))['db'];var dbH=require(_0xd9f9('0x16'))[_0xd9f9('0x17')];function respondWithStatusCode(_0x1e6031,_0x542f12){_0x542f12=_0x542f12||0xcc;return function(_0x3bfebb){if(_0x3bfebb){return _0x1e6031['sendStatus'](_0x542f12);}return _0x1e6031[_0xd9f9('0x18')](_0x542f12)['end']();};}function respondWithResult(_0x41c423,_0x3e9191){_0x3e9191=_0x3e9191||0xc8;return function(_0x3bc627){if(_0x3bc627){return _0x41c423[_0xd9f9('0x18')](_0x3e9191)['json'](_0x3bc627);}};}function respondWithFilteredResult(_0x298e37,_0x2f066e){return function(_0x5168c9){if(_0x5168c9){var _0x19b738=typeof _0x2f066e[_0xd9f9('0x19')]==='undefined'&&typeof _0x2f066e[_0xd9f9('0x1a')]===_0xd9f9('0x1b');var _0x2b5257=_0x5168c9[_0xd9f9('0x1c')];var _0x13471f=_0x19b738?0x0:_0x2f066e[_0xd9f9('0x19')];var _0x3f0c43=_0x19b738?_0x5168c9['count']:_0x2f066e[_0xd9f9('0x19')]+_0x2f066e['limit'];var _0x1b3877;if(_0x3f0c43>=_0x2b5257){_0x3f0c43=_0x2b5257;_0x1b3877=0xc8;}else{_0x1b3877=0xce;}_0x298e37[_0xd9f9('0x18')](_0x1b3877);return _0x298e37[_0xd9f9('0x1d')]('Content-Range',_0x13471f+'-'+_0x3f0c43+'/'+_0x2b5257)[_0xd9f9('0x1e')](_0x5168c9);}return null;};}function patchUpdates(_0x1fa4fb){return function(_0x527dfa){try{jsonpatch[_0xd9f9('0x1f')](_0x527dfa,_0x1fa4fb,!![]);}catch(_0xf3c75b){return BPromise['reject'](_0xf3c75b);}return _0x527dfa[_0xd9f9('0x20')]();};}function saveUpdates(_0x26799c,_0x50efc1){return function(_0x1e554e){if(_0x1e554e){return _0x1e554e[_0xd9f9('0x21')](_0x26799c)['then'](function(_0x29cda8){return _0x29cda8;});}return null;};}function removeEntity(_0x5eb98b,_0x31dd51){return function(_0x49e10a){if(_0x49e10a){return _0x49e10a['destroy']()[_0xd9f9('0x22')](function(){var _0x6d4999=_0x49e10a['get']({'plain':!![]});var _0x144fb3=_0xd9f9('0x23');return db[_0xd9f9('0x24')][_0xd9f9('0x25')]({'where':{'type':_0x144fb3,'resourceId':_0x6d4999['id']}})[_0xd9f9('0x22')](function(){return _0x49e10a;});})[_0xd9f9('0x22')](function(){_0x5eb98b[_0xd9f9('0x18')](0xcc)[_0xd9f9('0x26')]();});}};}function handleEntityNotFound(_0x497631,_0x360a33){return function(_0x391d13){if(!_0x391d13){_0x497631[_0xd9f9('0x27')](0x194);}return _0x391d13;};}function handleError(_0x43b1ff,_0x5b7f0f){_0x5b7f0f=_0x5b7f0f||0x1f4;return function(_0x34e4b5){logger[_0xd9f9('0x28')](_0x34e4b5[_0xd9f9('0x29')]);if(_0x34e4b5[_0xd9f9('0x2a')]){delete _0x34e4b5[_0xd9f9('0x2a')];}_0x43b1ff[_0xd9f9('0x18')](_0x5b7f0f)[_0xd9f9('0x2b')](_0x34e4b5);};}exports['index']=function(_0x204c64,_0x21ccac){var _0x4e9aee={},_0x457c66={},_0x42ce37={'count':0x0,'rows':[]};var _0x436663=_[_0xd9f9('0x2c')](db[_0xd9f9('0x2d')][_0xd9f9('0x2e')],function(_0x2d96d5){return{'name':_0x2d96d5['fieldName'],'type':_0x2d96d5[_0xd9f9('0x2f')][_0xd9f9('0x30')]};});_0x457c66[_0xd9f9('0x31')]=_['map'](_0x436663,'name');_0x457c66[_0xd9f9('0x32')]=_[_0xd9f9('0x33')](_0x204c64[_0xd9f9('0x32')]);_0x457c66[_0xd9f9('0x34')]=_['intersection'](_0x457c66[_0xd9f9('0x31')],_0x457c66[_0xd9f9('0x32')]);_0x4e9aee[_0xd9f9('0x35')]=_['intersection'](_0x457c66[_0xd9f9('0x31')],qs['fields'](_0x204c64[_0xd9f9('0x32')][_0xd9f9('0x36')]));_0x4e9aee[_0xd9f9('0x35')]=_0x4e9aee[_0xd9f9('0x35')][_0xd9f9('0x37')]?_0x4e9aee['attributes']:_0x457c66['model'];if(!_0x204c64[_0xd9f9('0x32')]['hasOwnProperty'](_0xd9f9('0x38'))){_0x4e9aee[_0xd9f9('0x1a')]=qs['limit'](_0x204c64[_0xd9f9('0x32')][_0xd9f9('0x1a')]);_0x4e9aee[_0xd9f9('0x19')]=qs[_0xd9f9('0x19')](_0x204c64[_0xd9f9('0x32')][_0xd9f9('0x19')]);}_0x4e9aee[_0xd9f9('0x39')]=qs[_0xd9f9('0x3a')](_0x204c64[_0xd9f9('0x32')][_0xd9f9('0x3a')]);_0x4e9aee['where']=qs[_0xd9f9('0x34')](_[_0xd9f9('0x3b')](_0x204c64[_0xd9f9('0x32')],_0x457c66[_0xd9f9('0x34')]),_0x436663);if(_0x204c64['query'][_0xd9f9('0x3c')]){_0x4e9aee[_0xd9f9('0x3d')]=_['merge'](_0x4e9aee[_0xd9f9('0x3d')],{'$or':_[_0xd9f9('0x2c')](_0x436663,function(_0x1abb2c){if(_0x1abb2c['type']!=='VIRTUAL'){var _0x1a2975={};_0x1a2975[_0x1abb2c[_0xd9f9('0x2a')]]={'$like':'%'+_0x204c64[_0xd9f9('0x32')][_0xd9f9('0x3c')]+'%'};return _0x1a2975;}})});}_0x4e9aee=_['merge']({},_0x4e9aee,_0x204c64['options']);var _0x25b797={'where':_0x4e9aee[_0xd9f9('0x3d')]};return db['AnalyticCustomReport'][_0xd9f9('0x1c')](_0x25b797)[_0xd9f9('0x22')](function(_0x19826d){_0x42ce37[_0xd9f9('0x1c')]=_0x19826d;if(_0x204c64[_0xd9f9('0x32')]['includeAll']){_0x4e9aee[_0xd9f9('0x3e')]=[{'all':!![]}];}return db[_0xd9f9('0x2d')][_0xd9f9('0x3f')](_0x4e9aee);})[_0xd9f9('0x22')](function(_0x1e4314){_0x42ce37[_0xd9f9('0x40')]=_0x1e4314;return _0x42ce37;})[_0xd9f9('0x22')](respondWithFilteredResult(_0x21ccac,_0x4e9aee))[_0xd9f9('0x41')](handleError(_0x21ccac,null));};exports['show']=function(_0x4d7ad9,_0x54ef38){var _0x1301ec={'raw':![],'where':{'id':_0x4d7ad9['params']['id']}},_0x463bc1={};_0x463bc1[_0xd9f9('0x31')]=_['keys'](db[_0xd9f9('0x2d')]['rawAttributes']);_0x463bc1['query']=_[_0xd9f9('0x33')](_0x4d7ad9[_0xd9f9('0x32')]);_0x463bc1['filters']=_[_0xd9f9('0x42')](_0x463bc1['model'],_0x463bc1['query']);_0x1301ec[_0xd9f9('0x35')]=_[_0xd9f9('0x42')](_0x463bc1[_0xd9f9('0x31')],qs[_0xd9f9('0x36')](_0x4d7ad9[_0xd9f9('0x32')][_0xd9f9('0x36')]));_0x1301ec[_0xd9f9('0x35')]=_0x1301ec[_0xd9f9('0x35')][_0xd9f9('0x37')]?_0x1301ec[_0xd9f9('0x35')]:_0x463bc1['model'];if(_0x4d7ad9[_0xd9f9('0x32')][_0xd9f9('0x43')]){_0x1301ec[_0xd9f9('0x3e')]=[{'all':!![]}];}_0x1301ec=_[_0xd9f9('0x44')]({},_0x1301ec,_0x4d7ad9[_0xd9f9('0x45')]);return db['AnalyticCustomReport']['find'](_0x1301ec)['then'](handleEntityNotFound(_0x54ef38,null))[_0xd9f9('0x22')](respondWithResult(_0x54ef38,null))[_0xd9f9('0x41')](handleError(_0x54ef38,null));};exports[_0xd9f9('0x46')]=function(_0x57262c,_0x56cef4){return db[_0xd9f9('0x2d')][_0xd9f9('0x46')](_0x57262c[_0xd9f9('0x47')],{})[_0xd9f9('0x22')](function(_0x525a3d){var _0x320ee0=_0x57262c['user'][_0xd9f9('0x48')]({'plain':!![]});if(!_0x320ee0)throw new Error(_0xd9f9('0x49'));if(_0x320ee0['role']===_0xd9f9('0x4a')){var _0x490f10=_0x525a3d[_0xd9f9('0x48')]({'plain':!![]});var _0x1efd72=_0xd9f9('0x4b');return db[_0xd9f9('0x4c')][_0xd9f9('0x4d')]({'where':{'name':_0x1efd72,'userProfileId':_0x320ee0[_0xd9f9('0x4e')]},'raw':!![]})[_0xd9f9('0x22')](function(_0x26dc16){if(_0x26dc16&&_0x26dc16[_0xd9f9('0x4f')]===0x0){return db[_0xd9f9('0x24')][_0xd9f9('0x46')]({'name':_0x490f10['name'],'resourceId':_0x490f10['id'],'type':'CustomReports','sectionId':_0x26dc16['id']},{})[_0xd9f9('0x22')](function(){return _0x525a3d;});}else{return _0x525a3d;}})[_0xd9f9('0x41')](function(_0x467804){logger[_0xd9f9('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x467804);throw _0x467804;});}return _0x525a3d;})['then'](respondWithResult(_0x56cef4,0xc9))[_0xd9f9('0x41')](handleError(_0x56cef4,null));};exports[_0xd9f9('0x21')]=function(_0x885132,_0x36e6a6){if(_0x885132['body']['id']){delete _0x885132['body']['id'];}return db[_0xd9f9('0x2d')][_0xd9f9('0x4d')]({'where':{'id':_0x885132[_0xd9f9('0x50')]['id']}})[_0xd9f9('0x22')](handleEntityNotFound(_0x36e6a6,null))[_0xd9f9('0x22')](saveUpdates(_0x885132['body'],null))[_0xd9f9('0x22')](respondWithResult(_0x36e6a6,null))[_0xd9f9('0x41')](handleError(_0x36e6a6,null));};exports['destroy']=function(_0x18bba0,_0x68ec4){return db[_0xd9f9('0x2d')][_0xd9f9('0x4d')]({'where':{'id':_0x18bba0[_0xd9f9('0x50')]['id']}})[_0xd9f9('0x22')](handleEntityNotFound(_0x68ec4,null))['then'](removeEntity(_0x68ec4,null))[_0xd9f9('0x41')](handleError(_0x68ec4,null));};exports[_0xd9f9('0x51')]=function(_0x367501,_0x329e03){var _0x3018bc=0xa;var _0x22ad0d=[_0xd9f9('0x52'),_0xd9f9('0x53'),_0xd9f9('0x54'),'cross_join'];var _0x2eacbe={'SUM':_0xd9f9('0x55'),'COUNT':_0xd9f9('0x56'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xd9f9('0x57'),'MIN':_0xd9f9('0x58'),'AVG':_0xd9f9('0x59'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xd9f9('0x5a'),'GROUP_CONCAT DESC':_0xd9f9('0x5b')};var _0x309b3e={'SEC_TO_TIME':_0xd9f9('0x5c'),'DATE':_0xd9f9('0x5d'),'HOUR':'HOUR(%s)','ROUND':_0xd9f9('0x5e'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x194f8e=function(_0x86b4db){return!_['includes']([_0xd9f9('0x5f'),_0xd9f9('0x60'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x86b4db);};var _0x479ad3=function(_0x2bfc9){if(!_0x2bfc9||!_0x2bfc9[_0xd9f9('0x61')][_0xd9f9('0x37')]){return'';}for(var _0x7acda0='(',_0x26639f=0x0;_0x26639f<_0x2bfc9['rules']['length'];_0x26639f+=0x1){_0x26639f>0x0&&(_0x7acda0+='\x20'+_0x2bfc9['operator']+'\x20');_0x7acda0+=_0x2bfc9['rules'][_0x26639f][_0xd9f9('0x62')]?_0x479ad3(_0x2bfc9[_0xd9f9('0x61')][_0x26639f][_0xd9f9('0x62')]):_0x2bfc9[_0xd9f9('0x61')][_0x26639f][_0xd9f9('0x63')]+'\x20'+_0x2bfc9[_0xd9f9('0x61')][_0x26639f][_0xd9f9('0x64')]+(_0x194f8e(_0x2bfc9[_0xd9f9('0x61')][_0x26639f][_0xd9f9('0x64')])?'\x20'+_0x2bfc9[_0xd9f9('0x61')][_0x26639f]['value']:'');}return _0x7acda0+')';};var _0x5d8eb2={'where':{'id':_0x367501[_0xd9f9('0x50')]['id']}},_0x23ea88,_0x56fab0,_0x1c4481,_0x5afd30,_0x27d21a;_0x5d8eb2=_[_0xd9f9('0x44')]({},_0x5d8eb2,_0x367501['options']);return db['AnalyticCustomReport'][_0xd9f9('0x4d')](_0x5d8eb2)[_0xd9f9('0x22')](function(_0x3b994b){if(_0x3b994b){_0x23ea88=_0x3b994b;return _0x3b994b['getFields']();}return null;})['then'](function(_0xf4c3cb){if(_0xf4c3cb){if(!_0xf4c3cb[_0xd9f9('0x37')]){throw new db[(_0xd9f9('0x65'))][(_0xd9f9('0x66'))](_0xd9f9('0x67'),0x193);}_0x56fab0=_0xf4c3cb;return db[_0xd9f9('0x68')][_0xd9f9('0x3f')]({'raw':!![]});}return null;})[_0xd9f9('0x22')](function(_0x49e131){if(_0x49e131){_0x1c4481=_['keyBy'](_0x49e131,'id');var _0x49f86e;var _0x56e93d=squel['select']();_0x56e93d[_0xd9f9('0x69')](_0x23ea88[_0xd9f9('0x6a')]);for(var _0x5c49e1=0x0;_0x5c49e1<_0x56fab0[_0xd9f9('0x37')];_0x5c49e1+=0x1){_0x49f86e=_0x56fab0[_0x5c49e1][_0xd9f9('0x6b')]?_0x1c4481[_0x56fab0[_0x5c49e1][_0xd9f9('0x6b')]][_0xd9f9('0x6c')]:_0x56fab0[_0x5c49e1][_0xd9f9('0x63')];_0x49f86e=_0x56fab0[_0x5c49e1]['function']?_[_0xd9f9('0x6d')](_0x2eacbe[_0x56fab0[_0x5c49e1]['function']],'%s',_0x49f86e):_0x49f86e;_0x49f86e=_0x56fab0[_0x5c49e1][_0xd9f9('0x6e')]?_[_0xd9f9('0x6d')](_0x309b3e[_0x56fab0[_0x5c49e1][_0xd9f9('0x6e')]],'%s',_0x49f86e):_0x49f86e;if(_0x56fab0[_0x5c49e1][_0xd9f9('0x6f')]){_0x56e93d[_0xd9f9('0x62')](_0x49f86e);}_0x56fab0[_0x5c49e1][_0xd9f9('0x70')]&&_0x56e93d[_0xd9f9('0x39')](_0x49f86e,_0x56fab0[_0x5c49e1][_0xd9f9('0x70')]===_0xd9f9('0x71')?![]:!![]);_0x56e93d[_0xd9f9('0x63')](_0x49f86e,_0x56fab0[_0x5c49e1][_0xd9f9('0x72')]||_0x49f86e);}if(_0x23ea88[_0xd9f9('0x73')]){_0x23ea88[_0xd9f9('0x73')]=JSON[_0xd9f9('0x74')](_0x23ea88[_0xd9f9('0x73')]);for(var _0x3fffc2=0x0;_0x3fffc2<_0x23ea88['joins']['length'];_0x3fffc2+=0x1){if(_0x23ea88['joins'][_0x3fffc2][_0xd9f9('0x2f')]&&_[_0xd9f9('0x75')](_0x22ad0d,_0x23ea88[_0xd9f9('0x73')][_0x3fffc2][_0xd9f9('0x2f')])&&_0x23ea88[_0xd9f9('0x73')][_0x3fffc2][_0xd9f9('0x76')]&&_0x23ea88[_0xd9f9('0x73')][_0x3fffc2][_0xd9f9('0x77')]&&_0x23ea88[_0xd9f9('0x73')][_0x3fffc2][_0xd9f9('0x78')]){_0x56e93d[_0x23ea88[_0xd9f9('0x73')][_0x3fffc2][_0xd9f9('0x2f')]](_0x23ea88['joins'][_0x3fffc2][_0xd9f9('0x77')],null,util[_0xd9f9('0x6e')](_0xd9f9('0x79'),_0x23ea88[_0xd9f9('0x6a')],_0x23ea88['joins'][_0x3fffc2]['parentKey'],_0x23ea88['joins'][_0x3fffc2][_0xd9f9('0x77')],_0x23ea88[_0xd9f9('0x73')][_0x3fffc2][_0xd9f9('0x78')]));}}}if(_0x23ea88['conditions']){_0x23ea88['conditions']=JSON[_0xd9f9('0x74')](_0x23ea88[_0xd9f9('0x7a')]);_0x56e93d[_0xd9f9('0x3d')](_0x479ad3(_0x23ea88[_0xd9f9('0x7a')][_0xd9f9('0x62')]));}_0x27d21a=_0x56e93d[_0xd9f9('0x7b')]();_0x56e93d[_0xd9f9('0x1a')](_0x3018bc);_0x56e93d[_0xd9f9('0x19')](0x0);logger['debug']('Limited\x20Query:',_0x56e93d[_0xd9f9('0x7c')]());return dbH[_0xd9f9('0x7d')][_0xd9f9('0x32')](_0x56e93d[_0xd9f9('0x7c')](),{'type':dbH['sequelize'][_0xd9f9('0x7e')][_0xd9f9('0x7f')]});}})['then'](respondWithResult(_0x329e03,null))[_0xd9f9('0x41')](handleError(_0x329e03,null));};function runReport(_0x1399cf,_0x52bc86,_0x10260f){var _0xe764df=_0x52bc86[_0xd9f9('0x2a')];var _0x539672=0xa;var _0x41bcdf=[_0xd9f9('0x52'),_0xd9f9('0x53'),_0xd9f9('0x54'),'cross_join'];var _0x57dc01={'SUM':_0xd9f9('0x55'),'COUNT':_0xd9f9('0x56'),'COUNT DISTINCT':_0xd9f9('0x80'),'MAX':_0xd9f9('0x57'),'MIN':_0xd9f9('0x58'),'AVG':_0xd9f9('0x59'),'GROUP_CONCAT':_0xd9f9('0x81'),'GROUP_CONCAT ASC':_0xd9f9('0x5a'),'GROUP_CONCAT DESC':_0xd9f9('0x5b')};var _0x41990f={'SEC_TO_TIME':_0xd9f9('0x5c'),'DATE':'DATE(%s)','HOUR':_0xd9f9('0x82'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xd9f9('0x83')};var _0xe78925=function(_0x4b679f){return!_['includes']([_0xd9f9('0x5f'),_0xd9f9('0x60'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x4b679f);};var _0x347605=function(_0x309cb2){if(!_0x309cb2||!_0x309cb2[_0xd9f9('0x61')][_0xd9f9('0x37')]){return'';}for(var _0x251938='(',_0x753c69=0x0;_0x753c69<_0x309cb2[_0xd9f9('0x61')][_0xd9f9('0x37')];_0x753c69+=0x1){_0x753c69>0x0&&(_0x251938+='\x20'+_0x309cb2['operator']+'\x20');_0x251938+=_0x309cb2['rules'][_0x753c69][_0xd9f9('0x62')]?_0x347605(_0x309cb2[_0xd9f9('0x61')][_0x753c69][_0xd9f9('0x62')]):_0x309cb2[_0xd9f9('0x61')][_0x753c69]['field']+'\x20'+_0x309cb2[_0xd9f9('0x61')][_0x753c69][_0xd9f9('0x64')]+(_0xe78925(_0x309cb2['rules'][_0x753c69][_0xd9f9('0x64')])?'\x20'+_0x309cb2['rules'][_0x753c69][_0xd9f9('0x84')]:'');}return _0x251938+')';};var _0x4973a4={'where':{'id':_0x1399cf['id']}},_0x46d944,_0x388a8f,_0x128469,_0x49678c,_0x4bf675;_0x4973a4=_[_0xd9f9('0x44')]({},_0x4973a4,_0x10260f);return db[_0xd9f9('0x2d')][_0xd9f9('0x4d')](_0x4973a4)[_0xd9f9('0x22')](function(_0x30dc06){if(_0x30dc06){_0x46d944=_0x30dc06;return _0x30dc06[_0xd9f9('0x85')]();}return null;})[_0xd9f9('0x22')](function(_0x35963f){if(_0x35963f){if(!_0x35963f[_0xd9f9('0x37')]){throw new db[(_0xd9f9('0x65'))][(_0xd9f9('0x66'))](_0xd9f9('0x67'),0x193);}_0x388a8f=_0x35963f;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})['then'](function(_0x4d4229){if(_0x4d4229){_0x128469=_[_0xd9f9('0x86')](_0x4d4229,'id');var _0x5307a8;var _0x3d70bb=squel[_0xd9f9('0x87')]();_0x3d70bb[_0xd9f9('0x69')](_0x46d944[_0xd9f9('0x6a')]);for(var _0x22064b=0x0;_0x22064b<_0x388a8f[_0xd9f9('0x37')];_0x22064b+=0x1){_0x5307a8=_0x388a8f[_0x22064b][_0xd9f9('0x6b')]?_0x128469[_0x388a8f[_0x22064b][_0xd9f9('0x6b')]]['metric']:_0x388a8f[_0x22064b][_0xd9f9('0x63')];_0x5307a8=_0x388a8f[_0x22064b][_0xd9f9('0x88')]?_[_0xd9f9('0x6d')](_0x57dc01[_0x388a8f[_0x22064b]['function']],'%s',_0x5307a8):_0x5307a8;_0x5307a8=_0x388a8f[_0x22064b][_0xd9f9('0x6e')]?_[_0xd9f9('0x6d')](_0x41990f[_0x388a8f[_0x22064b][_0xd9f9('0x6e')]],'%s',_0x5307a8):_0x5307a8;if(_0x388a8f[_0x22064b]['groupBy']){_0x3d70bb[_0xd9f9('0x62')](_0x5307a8);}_0x388a8f[_0x22064b][_0xd9f9('0x70')]&&_0x3d70bb[_0xd9f9('0x39')](_0x5307a8,_0x388a8f[_0x22064b][_0xd9f9('0x70')]==='DESC'?![]:!![]);_0x3d70bb[_0xd9f9('0x63')](_0x5307a8,_0x388a8f[_0x22064b]['alias']||_0x5307a8);}if(_0x46d944[_0xd9f9('0x73')]){_0x46d944[_0xd9f9('0x73')]=JSON[_0xd9f9('0x74')](_0x46d944['joins']);for(var _0x354f2a=0x0;_0x354f2a<_0x46d944[_0xd9f9('0x73')]['length'];_0x354f2a+=0x1){if(_0x46d944['joins'][_0x354f2a][_0xd9f9('0x2f')]&&_[_0xd9f9('0x75')](_0x41bcdf,_0x46d944[_0xd9f9('0x73')][_0x354f2a][_0xd9f9('0x2f')])&&_0x46d944[_0xd9f9('0x73')][_0x354f2a][_0xd9f9('0x76')]&&_0x46d944[_0xd9f9('0x73')][_0x354f2a][_0xd9f9('0x77')]&&_0x46d944[_0xd9f9('0x73')][_0x354f2a]['foreignKey']){_0x3d70bb[_0x46d944[_0xd9f9('0x73')][_0x354f2a][_0xd9f9('0x2f')]](_0x46d944[_0xd9f9('0x73')][_0x354f2a][_0xd9f9('0x77')],null,util[_0xd9f9('0x6e')](_0xd9f9('0x79'),_0x46d944[_0xd9f9('0x6a')],_0x46d944['joins'][_0x354f2a][_0xd9f9('0x76')],_0x46d944['joins'][_0x354f2a][_0xd9f9('0x77')],_0x46d944[_0xd9f9('0x73')][_0x354f2a][_0xd9f9('0x78')]));}}}if(_0x46d944[_0xd9f9('0x7a')]){_0x46d944[_0xd9f9('0x7a')]=JSON['parse'](_0x46d944[_0xd9f9('0x7a')]);_0x3d70bb[_0xd9f9('0x3d')](_0x347605(_0x46d944['conditions'][_0xd9f9('0x62')]));}_0x4bf675=_0x3d70bb[_0xd9f9('0x7b')]();_0x3d70bb[_0xd9f9('0x1a')](_0x539672);_0x3d70bb[_0xd9f9('0x19')](0x0);return;}})[_0xd9f9('0x22')](function(){if(_0x52bc86[_0xd9f9('0x89')]===_0xd9f9('0x8a')){return null;}var _0x7cbb1b=_[_0xd9f9('0x44')](_0x52bc86,{'name':_0x52bc86[_0xd9f9('0x8b')]||_0x52bc86[_0xd9f9('0x2a')]||_0x46d944[_0xd9f9('0x2a')],'basename':_0xe764df,'savename':util[_0xd9f9('0x6e')](_0xd9f9('0x8c'),_0x52bc86[_0xd9f9('0x2a')]||_0x46d944[_0xd9f9('0x2a')],require(_0xd9f9('0x8d'))[_0xd9f9('0x8e')](0x4),_0x52bc86[_0xd9f9('0x89')]||_0xd9f9('0x8f')),'reportId':_0x46d944['id'],'reportType':'custom'});return db['AnalyticExtractedReport'][_0xd9f9('0x46')](_0x7cbb1b,{'raw':!![]});})[_0xd9f9('0x22')](function(_0x2f08ef){if(_0x46d944[_0xd9f9('0x6a')]===_0xd9f9('0x90')){_0x4bf675[_0xd9f9('0x3d')](_0x46d944[_0xd9f9('0x6a')]+_0xd9f9('0x91'),_0x52bc86[_0xd9f9('0x92')],_0x52bc86[_0xd9f9('0x93')]);}else{_0x4bf675['where'](_0x46d944['table']+_0xd9f9('0x94'),_0x52bc86[_0xd9f9('0x92')],_0x52bc86['endDate']);}if(_0x2f08ef){logger[_0xd9f9('0x95')]('Run\x20Query:',_0x4bf675[_0xd9f9('0x7c')]());require(_0xd9f9('0x96'))['fork'](path[_0xd9f9('0x52')](__dirname,_0xd9f9('0x97'),_0x2f08ef[_0xd9f9('0x89')]),[_0x2f08ef['id'],_0x4bf675[_0xd9f9('0x7c')](),path[_0xd9f9('0x52')](__dirname,_0xd9f9('0x98'),_0x2f08ef[_0xd9f9('0x99')]),_0xe764df]);return _0x2f08ef;}else{var _0x4eace6=squel[_0xd9f9('0x87')]();_0x4eace6['from']('('+_0x4bf675[_0xd9f9('0x7c')]()+')',_0xd9f9('0x9a'));_0x4eace6[_0xd9f9('0x63')](_0xd9f9('0x9b'),_0xd9f9('0x1c'));_0x4bf675[_0xd9f9('0x1a')](_0x52bc86[_0xd9f9('0x1a')]||_0x539672);_0x4bf675[_0xd9f9('0x19')](_0x52bc86[_0xd9f9('0x19')]||0x0);return dbH['sequelize']['query'](_0x4eace6[_0xd9f9('0x7c')](),{'type':dbH[_0xd9f9('0x7d')]['QueryTypes']['SELECT']})[_0xd9f9('0x22')](function(_0x1b13ed){if(!_0x1b13ed[_0xd9f9('0x37')]){_0x49678c=0x0;}else{_0x49678c=_0x1b13ed[0x0][_0xd9f9('0x1c')]||0x0;}return dbH[_0xd9f9('0x7d')]['query'](_0x4bf675[_0xd9f9('0x7c')](),{'type':dbH[_0xd9f9('0x7d')][_0xd9f9('0x7e')]['SELECT']});})[_0xd9f9('0x22')](function(_0x144eca){return{'rows':_0x144eca||[],'count':_0x49678c};});}});}exports['run']=function(_0x369a,_0x306062){return runReport(_0x369a[_0xd9f9('0x50')],_0x369a['query'],_0x369a[_0xd9f9('0x45')])[_0xd9f9('0x22')](respondWithResult(_0x306062,null))[_0xd9f9('0x41')](handleError(_0x306062,null));};exports[_0xd9f9('0x9c')]=runReport;exports[_0xd9f9('0x32')]=function(_0x46df74,_0x4e73a3){var _0x2b5985=0xa;var _0x1df17e=['join',_0xd9f9('0x53'),_0xd9f9('0x54'),_0xd9f9('0x9d')];var _0x452aa2={'SUM':_0xd9f9('0x55'),'COUNT':_0xd9f9('0x56'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xd9f9('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xd9f9('0x5a'),'GROUP_CONCAT DESC':_0xd9f9('0x5b')};var _0x525c40={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xd9f9('0x82'),'ROUND':_0xd9f9('0x5e'),'UNIX_TIMESTAMP':_0xd9f9('0x83')};var _0x5f3c63=function(_0x34b547){return!_[_0xd9f9('0x75')](['IS\x20NULL',_0xd9f9('0x60'),_0xd9f9('0x9e'),_0xd9f9('0x9f')],_0x34b547);};var _0x60289a=function(_0x505e5e){if(!_0x505e5e||!_0x505e5e[_0xd9f9('0x61')]['length']){return'';}for(var _0x16a2d6='(',_0x129e19=0x0;_0x129e19<_0x505e5e['rules'][_0xd9f9('0x37')];_0x129e19+=0x1){_0x129e19>0x0&&(_0x16a2d6+='\x20'+_0x505e5e[_0xd9f9('0xa0')]+'\x20');_0x16a2d6+=_0x505e5e[_0xd9f9('0x61')][_0x129e19][_0xd9f9('0x62')]?_0x60289a(_0x505e5e[_0xd9f9('0x61')][_0x129e19][_0xd9f9('0x62')]):_0x505e5e['rules'][_0x129e19]['field']+'\x20'+_0x505e5e['rules'][_0x129e19][_0xd9f9('0x64')]+(_0x5f3c63(_0x505e5e[_0xd9f9('0x61')][_0x129e19][_0xd9f9('0x64')])?'\x20'+_0x505e5e['rules'][_0x129e19]['value']:'');}return _0x16a2d6+')';};var _0x1bd85c={'where':{'id':_0x46df74['params']['id']}},_0x1b2ce1,_0x42bb52,_0x538721,_0x3709be,_0x556a30;_0x1bd85c=_[_0xd9f9('0x44')]({},_0x1bd85c,_0x46df74['options']);return db[_0xd9f9('0x2d')][_0xd9f9('0x4d')](_0x1bd85c)[_0xd9f9('0x22')](function(_0x75860a){if(_0x75860a){_0x1b2ce1=_0x75860a;return _0x75860a[_0xd9f9('0x85')]();}return null;})['then'](function(_0x4f9d39){if(_0x4f9d39){if(!_0x4f9d39[_0xd9f9('0x37')]){throw new db['Sequelize'][(_0xd9f9('0x66'))](_0xd9f9('0x67'),0x193);}_0x42bb52=_0x4f9d39;return db['AnalyticMetric'][_0xd9f9('0x3f')]({'raw':!![]});}return null;})[_0xd9f9('0x22')](function(_0x442a2f){if(_0x442a2f){_0x538721=_[_0xd9f9('0x86')](_0x442a2f,'id');var _0x11dacb;var _0x2e546a=squel[_0xd9f9('0x87')]();_0x2e546a[_0xd9f9('0x69')](_0x1b2ce1[_0xd9f9('0x6a')]);for(var _0x266734=0x0;_0x266734<_0x42bb52[_0xd9f9('0x37')];_0x266734+=0x1){_0x11dacb=_0x42bb52[_0x266734][_0xd9f9('0x6b')]?_0x538721[_0x42bb52[_0x266734][_0xd9f9('0x6b')]][_0xd9f9('0x6c')]:_0x42bb52[_0x266734][_0xd9f9('0x63')];_0x11dacb=_0x42bb52[_0x266734][_0xd9f9('0x88')]?_[_0xd9f9('0x6d')](_0x452aa2[_0x42bb52[_0x266734][_0xd9f9('0x88')]],'%s',_0x11dacb):_0x11dacb;_0x11dacb=_0x42bb52[_0x266734][_0xd9f9('0x6e')]?_[_0xd9f9('0x6d')](_0x525c40[_0x42bb52[_0x266734][_0xd9f9('0x6e')]],'%s',_0x11dacb):_0x11dacb;if(_0x42bb52[_0x266734][_0xd9f9('0x6f')]){_0x2e546a['group'](_0x11dacb);}_0x42bb52[_0x266734]['orderBy']&&_0x2e546a[_0xd9f9('0x39')](_0x11dacb,_0x42bb52[_0x266734][_0xd9f9('0x70')]==='DESC'?![]:!![]);_0x2e546a[_0xd9f9('0x63')](_0x11dacb,_0x42bb52[_0x266734]['alias']||_0x11dacb);}if(_0x1b2ce1['joins']){_0x1b2ce1[_0xd9f9('0x73')]=JSON[_0xd9f9('0x74')](_0x1b2ce1[_0xd9f9('0x73')]);for(var _0x32ee52=0x0;_0x32ee52<_0x1b2ce1[_0xd9f9('0x73')][_0xd9f9('0x37')];_0x32ee52+=0x1){if(_0x1b2ce1[_0xd9f9('0x73')][_0x32ee52][_0xd9f9('0x2f')]&&_[_0xd9f9('0x75')](_0x1df17e,_0x1b2ce1['joins'][_0x32ee52][_0xd9f9('0x2f')])&&_0x1b2ce1[_0xd9f9('0x73')][_0x32ee52][_0xd9f9('0x76')]&&_0x1b2ce1[_0xd9f9('0x73')][_0x32ee52]['foreignTable']&&_0x1b2ce1[_0xd9f9('0x73')][_0x32ee52][_0xd9f9('0x78')]){_0x2e546a[_0x1b2ce1[_0xd9f9('0x73')][_0x32ee52][_0xd9f9('0x2f')]](_0x1b2ce1[_0xd9f9('0x73')][_0x32ee52][_0xd9f9('0x77')],null,util['format'](_0xd9f9('0x79'),_0x1b2ce1['table'],_0x1b2ce1[_0xd9f9('0x73')][_0x32ee52][_0xd9f9('0x76')],_0x1b2ce1[_0xd9f9('0x73')][_0x32ee52][_0xd9f9('0x77')],_0x1b2ce1[_0xd9f9('0x73')][_0x32ee52][_0xd9f9('0x78')]));}}}if(_0x1b2ce1[_0xd9f9('0x7a')]){_0x1b2ce1[_0xd9f9('0x7a')]=JSON[_0xd9f9('0x74')](_0x1b2ce1['conditions']);_0x2e546a['where'](_0x60289a(_0x1b2ce1[_0xd9f9('0x7a')][_0xd9f9('0x62')]));}_0x556a30=_0x2e546a[_0xd9f9('0x7b')]();_0x2e546a[_0xd9f9('0x1a')](_0x2b5985);_0x2e546a[_0xd9f9('0x19')](0x0);logger['debug'](_0xd9f9('0xa1'),_0x2e546a[_0xd9f9('0x7c')]());return dbH[_0xd9f9('0x7d')][_0xd9f9('0x32')](_0x2e546a['toString'](),{'type':dbH[_0xd9f9('0x7d')][_0xd9f9('0x7e')]['SELECT']});}})['then'](function(){return{'sql':_0x556a30[_0xd9f9('0x7c')]()};})[_0xd9f9('0x22')](respondWithResult(_0x4e73a3,null))['catch'](handleError(_0x4e73a3,null));};
\ No newline at end of file
+var _0x6a4b=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','limit','set','Content-Range','update','then','destroy','CustomReports','UserProfileResource','name','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','keys','query','attributes','intersection','model','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','count','includeAll','include','rows','catch','show','params','options','find','create','body','user','get','role','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','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)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','ValidationErrorItem','AnalyticMetric','findAll','keyBy','MetricId','metric','function','replace','format','orderBy','order','DESC','alias','joins','parse','includes','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','right_join','cross_join','SUM(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','ROUND(%s)','IS\x20NOT\x20NULL','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','select','from','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','QueryTypes','run','runReport','rimraf','fast-json-patch','request-promise','moment','mustache','util','path'];(function(_0x1f37d5,_0x102bb8){var _0x3bbd99=function(_0x194067){while(--_0x194067){_0x1f37d5['push'](_0x1f37d5['shift']());}};_0x3bbd99(++_0x102bb8);}(_0x6a4b,0x9b));var _0xb6a4=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x6a4b[_0x4e676e];return _0x336a3c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb6a4('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb6a4('0x1'));var rp=require(_0xb6a4('0x2'));var moment=require(_0xb6a4('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb6a4('0x4'));var util=require(_0xb6a4('0x5'));var path=require(_0xb6a4('0x6'));var sox=require('sox');var csv=require(_0xb6a4('0x7'));var ejs=require(_0xb6a4('0x8'));var fs=require('fs');var fs_extra=require(_0xb6a4('0x9'));var _=require(_0xb6a4('0xa'));var squel=require(_0xb6a4('0xb'));var crypto=require(_0xb6a4('0xc'));var jsforce=require(_0xb6a4('0xd'));var deskjs=require(_0xb6a4('0xe'));var toCsv=require(_0xb6a4('0x7'));var querystring=require(_0xb6a4('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb6a4('0x10'));var qs=require(_0xb6a4('0x11'));var as=require(_0xb6a4('0x12'));var hardwareService=require(_0xb6a4('0x13'));var logger=require('../../config/logger')(_0xb6a4('0x14'));var utils=require(_0xb6a4('0x15'));var config=require(_0xb6a4('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var dbH=require(_0xb6a4('0x17'))[_0xb6a4('0x18')];function respondWithStatusCode(_0x349e78,_0x4350bd){_0x4350bd=_0x4350bd||0xcc;return function(_0x2fdcce){if(_0x2fdcce){return _0x349e78[_0xb6a4('0x19')](_0x4350bd);}return _0x349e78[_0xb6a4('0x1a')](_0x4350bd)['end']();};}function respondWithResult(_0x14f298,_0xfa3375){_0xfa3375=_0xfa3375||0xc8;return function(_0x8e1b98){if(_0x8e1b98){return _0x14f298[_0xb6a4('0x1a')](_0xfa3375)[_0xb6a4('0x1b')](_0x8e1b98);}};}function respondWithFilteredResult(_0xa3cbd7,_0x497eaf){return function(_0x39dd62){if(_0x39dd62){var _0x4794ef=typeof _0x497eaf[_0xb6a4('0x1c')]===_0xb6a4('0x1d')&&typeof _0x497eaf[_0xb6a4('0x1e')]===_0xb6a4('0x1d');var _0x37fda0=_0x39dd62['count'];var _0x545812=_0x4794ef?0x0:_0x497eaf['offset'];var _0x55e01e=_0x4794ef?_0x39dd62['count']:_0x497eaf[_0xb6a4('0x1c')]+_0x497eaf[_0xb6a4('0x1e')];var _0x6307ea;if(_0x55e01e>=_0x37fda0){_0x55e01e=_0x37fda0;_0x6307ea=0xc8;}else{_0x6307ea=0xce;}_0xa3cbd7['status'](_0x6307ea);return _0xa3cbd7[_0xb6a4('0x1f')](_0xb6a4('0x20'),_0x545812+'-'+_0x55e01e+'/'+_0x37fda0)['json'](_0x39dd62);}return null;};}function patchUpdates(_0x294d32){return function(_0x997c4c){try{jsonpatch['apply'](_0x997c4c,_0x294d32,!![]);}catch(_0xb30014){return BPromise['reject'](_0xb30014);}return _0x997c4c['save']();};}function saveUpdates(_0x2acd60,_0x351c8c){return function(_0x65dcbf){if(_0x65dcbf){return _0x65dcbf[_0xb6a4('0x21')](_0x2acd60)[_0xb6a4('0x22')](function(_0x3d8eb8){return _0x3d8eb8;});}return null;};}function removeEntity(_0x342817,_0xfd60c){return function(_0x381d74){if(_0x381d74){return _0x381d74[_0xb6a4('0x23')]()[_0xb6a4('0x22')](function(){var _0x1396f3=_0x381d74['get']({'plain':!![]});var _0x5870ee=_0xb6a4('0x24');return db[_0xb6a4('0x25')][_0xb6a4('0x23')]({'where':{'type':_0x5870ee,'resourceId':_0x1396f3['id']}})[_0xb6a4('0x22')](function(){return _0x381d74;});})['then'](function(){_0x342817['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xfbedf3,_0xdbcbd5){return function(_0x216877){if(!_0x216877){_0xfbedf3['sendStatus'](0x194);}return _0x216877;};}function handleError(_0x8b0c95,_0x5836d6){_0x5836d6=_0x5836d6||0x1f4;return function(_0x5cda10){logger['error'](_0x5cda10['stack']);if(_0x5cda10[_0xb6a4('0x26')]){delete _0x5cda10[_0xb6a4('0x26')];}_0x8b0c95['status'](_0x5836d6)['send'](_0x5cda10);};}exports[_0xb6a4('0x27')]=function(_0x268abe,_0x1c9b16){var _0x4d1a1f={},_0x4089ca={},_0x188d2f={'count':0x0,'rows':[]};var _0xa7b558=_[_0xb6a4('0x28')](db[_0xb6a4('0x29')][_0xb6a4('0x2a')],function(_0x3e4b7e){return{'name':_0x3e4b7e[_0xb6a4('0x2b')],'type':_0x3e4b7e[_0xb6a4('0x2c')][_0xb6a4('0x2d')]};});_0x4089ca['model']=_[_0xb6a4('0x28')](_0xa7b558,_0xb6a4('0x26'));_0x4089ca['query']=_[_0xb6a4('0x2e')](_0x268abe[_0xb6a4('0x2f')]);_0x4089ca['filters']=_['intersection'](_0x4089ca['model'],_0x4089ca[_0xb6a4('0x2f')]);_0x4d1a1f[_0xb6a4('0x30')]=_[_0xb6a4('0x31')](_0x4089ca[_0xb6a4('0x32')],qs[_0xb6a4('0x33')](_0x268abe['query']['fields']));_0x4d1a1f[_0xb6a4('0x30')]=_0x4d1a1f[_0xb6a4('0x30')][_0xb6a4('0x34')]?_0x4d1a1f['attributes']:_0x4089ca[_0xb6a4('0x32')];if(!_0x268abe[_0xb6a4('0x2f')][_0xb6a4('0x35')]('nolimit')){_0x4d1a1f[_0xb6a4('0x1e')]=qs['limit'](_0x268abe[_0xb6a4('0x2f')][_0xb6a4('0x1e')]);_0x4d1a1f[_0xb6a4('0x1c')]=qs['offset'](_0x268abe[_0xb6a4('0x2f')][_0xb6a4('0x1c')]);}_0x4d1a1f['order']=qs[_0xb6a4('0x36')](_0x268abe[_0xb6a4('0x2f')][_0xb6a4('0x36')]);_0x4d1a1f[_0xb6a4('0x37')]=qs[_0xb6a4('0x38')](_[_0xb6a4('0x39')](_0x268abe['query'],_0x4089ca[_0xb6a4('0x38')]),_0xa7b558);if(_0x268abe[_0xb6a4('0x2f')][_0xb6a4('0x3a')]){_0x4d1a1f[_0xb6a4('0x37')]=_[_0xb6a4('0x3b')](_0x4d1a1f[_0xb6a4('0x37')],{'$or':_[_0xb6a4('0x28')](_0xa7b558,function(_0x28189d){if(_0x28189d['type']!==_0xb6a4('0x3c')){var _0x1fba7d={};_0x1fba7d[_0x28189d[_0xb6a4('0x26')]]={'$like':'%'+_0x268abe['query'][_0xb6a4('0x3a')]+'%'};return _0x1fba7d;}})});}_0x4d1a1f=_['merge']({},_0x4d1a1f,_0x268abe['options']);var _0x7003b5={'where':_0x4d1a1f['where']};return db[_0xb6a4('0x29')][_0xb6a4('0x3d')](_0x7003b5)[_0xb6a4('0x22')](function(_0x2ccfb8){_0x188d2f[_0xb6a4('0x3d')]=_0x2ccfb8;if(_0x268abe[_0xb6a4('0x2f')][_0xb6a4('0x3e')]){_0x4d1a1f[_0xb6a4('0x3f')]=[{'all':!![]}];}return db['AnalyticCustomReport']['findAll'](_0x4d1a1f);})['then'](function(_0x137f9a){_0x188d2f[_0xb6a4('0x40')]=_0x137f9a;return _0x188d2f;})['then'](respondWithFilteredResult(_0x1c9b16,_0x4d1a1f))[_0xb6a4('0x41')](handleError(_0x1c9b16,null));};exports[_0xb6a4('0x42')]=function(_0x41b363,_0x4b9a3d){var _0x2486cc={'raw':![],'where':{'id':_0x41b363[_0xb6a4('0x43')]['id']}},_0x143986={};_0x143986[_0xb6a4('0x32')]=_['keys'](db['AnalyticCustomReport'][_0xb6a4('0x2a')]);_0x143986[_0xb6a4('0x2f')]=_[_0xb6a4('0x2e')](_0x41b363[_0xb6a4('0x2f')]);_0x143986[_0xb6a4('0x38')]=_[_0xb6a4('0x31')](_0x143986['model'],_0x143986[_0xb6a4('0x2f')]);_0x2486cc[_0xb6a4('0x30')]=_[_0xb6a4('0x31')](_0x143986['model'],qs[_0xb6a4('0x33')](_0x41b363['query'][_0xb6a4('0x33')]));_0x2486cc[_0xb6a4('0x30')]=_0x2486cc[_0xb6a4('0x30')]['length']?_0x2486cc['attributes']:_0x143986['model'];if(_0x41b363[_0xb6a4('0x2f')][_0xb6a4('0x3e')]){_0x2486cc['include']=[{'all':!![]}];}_0x2486cc=_[_0xb6a4('0x3b')]({},_0x2486cc,_0x41b363[_0xb6a4('0x44')]);return db[_0xb6a4('0x29')][_0xb6a4('0x45')](_0x2486cc)['then'](handleEntityNotFound(_0x4b9a3d,null))['then'](respondWithResult(_0x4b9a3d,null))[_0xb6a4('0x41')](handleError(_0x4b9a3d,null));};exports[_0xb6a4('0x46')]=function(_0x3e7557,_0x316de7){return db[_0xb6a4('0x29')][_0xb6a4('0x46')](_0x3e7557[_0xb6a4('0x47')],{})[_0xb6a4('0x22')](function(_0x2bfd4b){var _0x741a07=_0x3e7557[_0xb6a4('0x48')][_0xb6a4('0x49')]({'plain':!![]});if(!_0x741a07)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x741a07[_0xb6a4('0x4a')]===_0xb6a4('0x48')){var _0x201539=_0x2bfd4b[_0xb6a4('0x49')]({'plain':!![]});var _0x32b2fa='Reports';return db['UserProfileSection'][_0xb6a4('0x45')]({'where':{'name':_0x32b2fa,'userProfileId':_0x741a07['userProfileId']},'raw':!![]})[_0xb6a4('0x22')](function(_0x5d6c43){if(_0x5d6c43&&_0x5d6c43[_0xb6a4('0x4b')]===0x0){return db[_0xb6a4('0x25')][_0xb6a4('0x46')]({'name':_0x201539[_0xb6a4('0x26')],'resourceId':_0x201539['id'],'type':_0xb6a4('0x24'),'sectionId':_0x5d6c43['id']},{})[_0xb6a4('0x22')](function(){return _0x2bfd4b;});}else{return _0x2bfd4b;}})[_0xb6a4('0x41')](function(_0x2ce0ea){logger[_0xb6a4('0x4c')](_0xb6a4('0x4d'),_0x2ce0ea);throw _0x2ce0ea;});}return _0x2bfd4b;})[_0xb6a4('0x22')](respondWithResult(_0x316de7,0xc9))[_0xb6a4('0x41')](handleError(_0x316de7,null));};exports[_0xb6a4('0x21')]=function(_0x579b40,_0x4ed525){if(_0x579b40[_0xb6a4('0x47')]['id']){delete _0x579b40[_0xb6a4('0x47')]['id'];}return db['AnalyticCustomReport'][_0xb6a4('0x45')]({'where':{'id':_0x579b40[_0xb6a4('0x43')]['id']}})[_0xb6a4('0x22')](handleEntityNotFound(_0x4ed525,null))[_0xb6a4('0x22')](saveUpdates(_0x579b40[_0xb6a4('0x47')],null))[_0xb6a4('0x22')](respondWithResult(_0x4ed525,null))['catch'](handleError(_0x4ed525,null));};exports[_0xb6a4('0x23')]=function(_0x35a483,_0xbc3405){return db['AnalyticCustomReport'][_0xb6a4('0x45')]({'where':{'id':_0x35a483['params']['id']}})[_0xb6a4('0x22')](handleEntityNotFound(_0xbc3405,null))[_0xb6a4('0x22')](removeEntity(_0xbc3405,null))['catch'](handleError(_0xbc3405,null));};exports['preview']=function(_0x39a4d2,_0x22fce8){var _0x3c695f=0xa;var _0x42c34e=[_0xb6a4('0x4e'),_0xb6a4('0x4f'),'right_join','cross_join'];var _0x364021={'SUM':'SUM(%s)','COUNT':_0xb6a4('0x50'),'COUNT DISTINCT':_0xb6a4('0x51'),'MAX':_0xb6a4('0x52'),'MIN':_0xb6a4('0x53'),'AVG':_0xb6a4('0x54'),'GROUP_CONCAT':_0xb6a4('0x55'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb6a4('0x56')};var _0x12f27d={'SEC_TO_TIME':_0xb6a4('0x57'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb6a4('0x58')};var _0x5757c6=function(_0x21f6b3){return!_['includes']([_0xb6a4('0x59'),'IS\x20NOT\x20NULL',_0xb6a4('0x5a'),_0xb6a4('0x5b')],_0x21f6b3);};var _0x14a8c2=function(_0x276f3c){if(!_0x276f3c||!_0x276f3c['rules'][_0xb6a4('0x34')]){return'';}for(var _0x1ca2a2='(',_0x4fec2f=0x0;_0x4fec2f<_0x276f3c[_0xb6a4('0x5c')][_0xb6a4('0x34')];_0x4fec2f+=0x1){_0x4fec2f>0x0&&(_0x1ca2a2+='\x20'+_0x276f3c[_0xb6a4('0x5d')]+'\x20');_0x1ca2a2+=_0x276f3c[_0xb6a4('0x5c')][_0x4fec2f][_0xb6a4('0x5e')]?_0x14a8c2(_0x276f3c['rules'][_0x4fec2f]['group']):_0x276f3c['rules'][_0x4fec2f][_0xb6a4('0x5f')]+'\x20'+_0x276f3c['rules'][_0x4fec2f][_0xb6a4('0x60')]+(_0x5757c6(_0x276f3c['rules'][_0x4fec2f][_0xb6a4('0x60')])?'\x20'+_0x276f3c[_0xb6a4('0x5c')][_0x4fec2f][_0xb6a4('0x61')]:'');}return _0x1ca2a2+')';};var _0x1b07ac={'where':{'id':_0x39a4d2['params']['id']}},_0x5707a6,_0x482ef3,_0x47f2f9,_0x4095d5,_0x1b78bf;_0x1b07ac=_[_0xb6a4('0x3b')]({},_0x1b07ac,_0x39a4d2[_0xb6a4('0x44')]);return db[_0xb6a4('0x29')][_0xb6a4('0x45')](_0x1b07ac)['then'](function(_0x35a305){if(_0x35a305){_0x5707a6=_0x35a305;return _0x35a305['getFields']();}return null;})[_0xb6a4('0x22')](function(_0x21219b){if(_0x21219b){if(!_0x21219b[_0xb6a4('0x34')]){throw new db['Sequelize'][(_0xb6a4('0x62'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x482ef3=_0x21219b;return db[_0xb6a4('0x63')][_0xb6a4('0x64')]({'raw':!![]});}return null;})['then'](function(_0x444c92){if(_0x444c92){_0x47f2f9=_[_0xb6a4('0x65')](_0x444c92,'id');var _0x4134ff;var _0x4e93bb=squel['select']();_0x4e93bb['from'](_0x5707a6['table']);for(var _0x203961=0x0;_0x203961<_0x482ef3['length'];_0x203961+=0x1){_0x4134ff=_0x482ef3[_0x203961][_0xb6a4('0x66')]?_0x47f2f9[_0x482ef3[_0x203961]['MetricId']][_0xb6a4('0x67')]:_0x482ef3[_0x203961][_0xb6a4('0x5f')];_0x4134ff=_0x482ef3[_0x203961][_0xb6a4('0x68')]?_[_0xb6a4('0x69')](_0x364021[_0x482ef3[_0x203961][_0xb6a4('0x68')]],'%s',_0x4134ff):_0x4134ff;_0x4134ff=_0x482ef3[_0x203961][_0xb6a4('0x6a')]?_['replace'](_0x12f27d[_0x482ef3[_0x203961]['format']],'%s',_0x4134ff):_0x4134ff;if(_0x482ef3[_0x203961]['groupBy']){_0x4e93bb[_0xb6a4('0x5e')](_0x4134ff);}_0x482ef3[_0x203961][_0xb6a4('0x6b')]&&_0x4e93bb[_0xb6a4('0x6c')](_0x4134ff,_0x482ef3[_0x203961][_0xb6a4('0x6b')]===_0xb6a4('0x6d')?![]:!![]);_0x4e93bb[_0xb6a4('0x5f')](_0x4134ff,_0x482ef3[_0x203961][_0xb6a4('0x6e')]||_0x4134ff);}if(_0x5707a6[_0xb6a4('0x6f')]){_0x5707a6['joins']=JSON[_0xb6a4('0x70')](_0x5707a6[_0xb6a4('0x6f')]);for(var _0x5e5992=0x0;_0x5e5992<_0x5707a6['joins']['length'];_0x5e5992+=0x1){if(_0x5707a6[_0xb6a4('0x6f')][_0x5e5992]['type']&&_[_0xb6a4('0x71')](_0x42c34e,_0x5707a6[_0xb6a4('0x6f')][_0x5e5992][_0xb6a4('0x2c')])&&_0x5707a6['joins'][_0x5e5992][_0xb6a4('0x72')]&&_0x5707a6['joins'][_0x5e5992][_0xb6a4('0x73')]&&_0x5707a6[_0xb6a4('0x6f')][_0x5e5992][_0xb6a4('0x74')]){_0x4e93bb[_0x5707a6[_0xb6a4('0x6f')][_0x5e5992][_0xb6a4('0x2c')]](_0x5707a6['joins'][_0x5e5992][_0xb6a4('0x73')],null,util[_0xb6a4('0x6a')](_0xb6a4('0x75'),_0x5707a6[_0xb6a4('0x76')],_0x5707a6[_0xb6a4('0x6f')][_0x5e5992][_0xb6a4('0x72')],_0x5707a6['joins'][_0x5e5992]['foreignTable'],_0x5707a6['joins'][_0x5e5992][_0xb6a4('0x74')]));}}}if(_0x5707a6[_0xb6a4('0x77')]){_0x5707a6[_0xb6a4('0x77')]=JSON['parse'](_0x5707a6['conditions']);_0x4e93bb['where'](_0x14a8c2(_0x5707a6[_0xb6a4('0x77')][_0xb6a4('0x5e')]));}_0x1b78bf=_0x4e93bb[_0xb6a4('0x78')]();_0x4e93bb[_0xb6a4('0x1e')](_0x3c695f);_0x4e93bb[_0xb6a4('0x1c')](0x0);logger[_0xb6a4('0x79')](_0xb6a4('0x7a'),_0x4e93bb[_0xb6a4('0x7b')]());return dbH['sequelize'][_0xb6a4('0x2f')](_0x4e93bb[_0xb6a4('0x7b')](),{'type':dbH[_0xb6a4('0x7c')]['QueryTypes'][_0xb6a4('0x7d')]});}})[_0xb6a4('0x22')](respondWithResult(_0x22fce8,null))['catch'](handleError(_0x22fce8,null));};function runReport(_0x176806,_0x55bded,_0x36df7e){var _0x7dbaad=_0x55bded[_0xb6a4('0x26')];var _0x2ebd7e=0xa;var _0x5df5b4=['join',_0xb6a4('0x4f'),_0xb6a4('0x7e'),_0xb6a4('0x7f')];var _0x5034b6={'SUM':_0xb6a4('0x80'),'COUNT':_0xb6a4('0x50'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xb6a4('0x52'),'MIN':_0xb6a4('0x53'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xb6a4('0x81'),'GROUP_CONCAT DESC':_0xb6a4('0x56')};var _0x25b441={'SEC_TO_TIME':_0xb6a4('0x57'),'DATE':_0xb6a4('0x82'),'HOUR':'HOUR(%s)','ROUND':_0xb6a4('0x83'),'UNIX_TIMESTAMP':_0xb6a4('0x58')};var _0x94fd26=function(_0x5d6494){return!_['includes']([_0xb6a4('0x59'),_0xb6a4('0x84'),_0xb6a4('0x5a'),_0xb6a4('0x5b')],_0x5d6494);};var _0x5046db=function(_0x43c1cc){if(!_0x43c1cc||!_0x43c1cc[_0xb6a4('0x5c')][_0xb6a4('0x34')]){return'';}for(var _0x5dc549='(',_0x8b55d8=0x0;_0x8b55d8<_0x43c1cc[_0xb6a4('0x5c')][_0xb6a4('0x34')];_0x8b55d8+=0x1){_0x8b55d8>0x0&&(_0x5dc549+='\x20'+_0x43c1cc[_0xb6a4('0x5d')]+'\x20');_0x5dc549+=_0x43c1cc[_0xb6a4('0x5c')][_0x8b55d8][_0xb6a4('0x5e')]?_0x5046db(_0x43c1cc[_0xb6a4('0x5c')][_0x8b55d8][_0xb6a4('0x5e')]):_0x43c1cc['rules'][_0x8b55d8]['field']+'\x20'+_0x43c1cc['rules'][_0x8b55d8][_0xb6a4('0x60')]+(_0x94fd26(_0x43c1cc['rules'][_0x8b55d8][_0xb6a4('0x60')])?'\x20'+_0x43c1cc['rules'][_0x8b55d8][_0xb6a4('0x61')]:'');}return _0x5dc549+')';};var _0x2ca4ac={'where':{'id':_0x176806['id']}},_0x2810cc,_0x3558ee,_0xf88ba,_0x569397,_0x12afc7;_0x2ca4ac=_[_0xb6a4('0x3b')]({},_0x2ca4ac,_0x36df7e);return db[_0xb6a4('0x29')]['find'](_0x2ca4ac)[_0xb6a4('0x22')](function(_0x4ff02c){if(_0x4ff02c){_0x2810cc=_0x4ff02c;return _0x4ff02c[_0xb6a4('0x85')]();}return null;})[_0xb6a4('0x22')](function(_0x5e06fc){if(_0x5e06fc){if(!_0x5e06fc[_0xb6a4('0x34')]){throw new db[(_0xb6a4('0x86'))][(_0xb6a4('0x62'))](_0xb6a4('0x87'),0x193);}_0x3558ee=_0x5e06fc;return db[_0xb6a4('0x63')][_0xb6a4('0x64')]({'raw':!![]});}return null;})[_0xb6a4('0x22')](function(_0x8c7a6){if(_0x8c7a6){_0xf88ba=_['keyBy'](_0x8c7a6,'id');var _0x39c054;var _0x41ef94=squel[_0xb6a4('0x88')]();_0x41ef94[_0xb6a4('0x89')](_0x2810cc['table']);for(var _0x128be2=0x0;_0x128be2<_0x3558ee['length'];_0x128be2+=0x1){_0x39c054=_0x3558ee[_0x128be2]['MetricId']?_0xf88ba[_0x3558ee[_0x128be2][_0xb6a4('0x66')]][_0xb6a4('0x67')]:_0x3558ee[_0x128be2][_0xb6a4('0x5f')];_0x39c054=_0x3558ee[_0x128be2][_0xb6a4('0x68')]?_[_0xb6a4('0x69')](_0x5034b6[_0x3558ee[_0x128be2][_0xb6a4('0x68')]],'%s',_0x39c054):_0x39c054;_0x39c054=_0x3558ee[_0x128be2][_0xb6a4('0x6a')]?_['replace'](_0x25b441[_0x3558ee[_0x128be2]['format']],'%s',_0x39c054):_0x39c054;if(_0x3558ee[_0x128be2]['groupBy']){_0x41ef94['group'](_0x39c054);}_0x3558ee[_0x128be2]['orderBy']&&_0x41ef94[_0xb6a4('0x6c')](_0x39c054,_0x3558ee[_0x128be2][_0xb6a4('0x6b')]===_0xb6a4('0x6d')?![]:!![]);_0x41ef94[_0xb6a4('0x5f')](_0x39c054,_0x3558ee[_0x128be2]['alias']||_0x39c054);}if(_0x2810cc[_0xb6a4('0x6f')]){_0x2810cc[_0xb6a4('0x6f')]=JSON[_0xb6a4('0x70')](_0x2810cc[_0xb6a4('0x6f')]);for(var _0x3481e9=0x0;_0x3481e9<_0x2810cc['joins'][_0xb6a4('0x34')];_0x3481e9+=0x1){if(_0x2810cc[_0xb6a4('0x6f')][_0x3481e9][_0xb6a4('0x2c')]&&_[_0xb6a4('0x71')](_0x5df5b4,_0x2810cc['joins'][_0x3481e9][_0xb6a4('0x2c')])&&_0x2810cc[_0xb6a4('0x6f')][_0x3481e9]['parentKey']&&_0x2810cc[_0xb6a4('0x6f')][_0x3481e9][_0xb6a4('0x73')]&&_0x2810cc[_0xb6a4('0x6f')][_0x3481e9]['foreignKey']){_0x41ef94[_0x2810cc[_0xb6a4('0x6f')][_0x3481e9][_0xb6a4('0x2c')]](_0x2810cc[_0xb6a4('0x6f')][_0x3481e9][_0xb6a4('0x73')],null,util[_0xb6a4('0x6a')](_0xb6a4('0x75'),_0x2810cc[_0xb6a4('0x76')],_0x2810cc[_0xb6a4('0x6f')][_0x3481e9][_0xb6a4('0x72')],_0x2810cc[_0xb6a4('0x6f')][_0x3481e9][_0xb6a4('0x73')],_0x2810cc[_0xb6a4('0x6f')][_0x3481e9]['foreignKey']));}}}if(_0x2810cc[_0xb6a4('0x77')]){_0x2810cc[_0xb6a4('0x77')]=JSON[_0xb6a4('0x70')](_0x2810cc[_0xb6a4('0x77')]);_0x41ef94[_0xb6a4('0x37')](_0x5046db(_0x2810cc['conditions'][_0xb6a4('0x5e')]));}_0x12afc7=_0x41ef94[_0xb6a4('0x78')]();_0x41ef94[_0xb6a4('0x1e')](_0x2ebd7e);_0x41ef94[_0xb6a4('0x1c')](0x0);return;}})[_0xb6a4('0x22')](function(){if(_0x55bded[_0xb6a4('0x8a')]===_0xb6a4('0x8b')){return null;}var _0x583e26=_[_0xb6a4('0x3b')](_0x55bded,{'name':_0x55bded[_0xb6a4('0x8c')]||_0x55bded[_0xb6a4('0x26')]||_0x2810cc[_0xb6a4('0x26')],'basename':_0x7dbaad,'savename':util[_0xb6a4('0x6a')](_0xb6a4('0x8d'),_0x55bded[_0xb6a4('0x26')]||_0x2810cc['name'],require(_0xb6a4('0x8e'))[_0xb6a4('0x8f')](0x4),_0x55bded[_0xb6a4('0x8a')]||_0xb6a4('0x90')),'reportId':_0x2810cc['id'],'reportType':_0xb6a4('0x91')});return db[_0xb6a4('0x92')][_0xb6a4('0x46')](_0x583e26,{'raw':!![]});})['then'](function(_0x6fb011){if(_0x2810cc[_0xb6a4('0x76')]===_0xb6a4('0x93')){_0x12afc7[_0xb6a4('0x37')](_0x2810cc[_0xb6a4('0x76')]+_0xb6a4('0x94'),_0x55bded[_0xb6a4('0x95')],_0x55bded[_0xb6a4('0x96')]);}else{_0x12afc7[_0xb6a4('0x37')](_0x2810cc[_0xb6a4('0x76')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x55bded[_0xb6a4('0x95')],_0x55bded[_0xb6a4('0x96')]);}if(_0x6fb011){logger[_0xb6a4('0x97')]('Run\x20Query:',_0x12afc7['toString']());require(_0xb6a4('0x98'))[_0xb6a4('0x99')](path['join'](__dirname,_0xb6a4('0x9a'),_0x6fb011[_0xb6a4('0x8a')]),[_0x6fb011['id'],_0x12afc7['toString'](),path[_0xb6a4('0x4e')](__dirname,_0xb6a4('0x9b'),_0x6fb011[_0xb6a4('0x9c')]),_0x7dbaad]);return _0x6fb011;}else{var _0x466859=squel[_0xb6a4('0x88')]();_0x466859[_0xb6a4('0x89')]('('+_0x12afc7['toString']()+')',_0xb6a4('0x9d'));_0x466859[_0xb6a4('0x5f')](_0xb6a4('0x9e'),_0xb6a4('0x3d'));_0x12afc7[_0xb6a4('0x1e')](_0x55bded[_0xb6a4('0x1e')]||_0x2ebd7e);_0x12afc7[_0xb6a4('0x1c')](_0x55bded['offset']||0x0);return dbH['sequelize']['query'](_0x466859[_0xb6a4('0x7b')](),{'type':dbH[_0xb6a4('0x7c')][_0xb6a4('0x9f')][_0xb6a4('0x7d')]})[_0xb6a4('0x22')](function(_0x10dac9){if(!_0x10dac9['length']){_0x569397=0x0;}else{_0x569397=_0x10dac9[0x0][_0xb6a4('0x3d')]||0x0;}return dbH[_0xb6a4('0x7c')][_0xb6a4('0x2f')](_0x12afc7[_0xb6a4('0x7b')](),{'type':dbH[_0xb6a4('0x7c')]['QueryTypes'][_0xb6a4('0x7d')]});})[_0xb6a4('0x22')](function(_0x6b4e63){return{'rows':_0x6b4e63||[],'count':_0x569397};});}});}exports[_0xb6a4('0xa0')]=function(_0xd659c3,_0x50a194){return runReport(_0xd659c3[_0xb6a4('0x43')],_0xd659c3[_0xb6a4('0x2f')],_0xd659c3[_0xb6a4('0x44')])[_0xb6a4('0x22')](respondWithResult(_0x50a194,null))[_0xb6a4('0x41')](handleError(_0x50a194,null));};exports[_0xb6a4('0xa1')]=runReport;exports[_0xb6a4('0x2f')]=function(_0x30f2ba,_0x5a16aa){var _0x54ac15=0xa;var _0x146aca=[_0xb6a4('0x4e'),_0xb6a4('0x4f'),_0xb6a4('0x7e'),'cross_join'];var _0x5d7396={'SUM':_0xb6a4('0x80'),'COUNT':_0xb6a4('0x50'),'COUNT DISTINCT':_0xb6a4('0x51'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xb6a4('0x54'),'GROUP_CONCAT':_0xb6a4('0x55'),'GROUP_CONCAT ASC':_0xb6a4('0x81'),'GROUP_CONCAT DESC':_0xb6a4('0x56')};var _0x1f8615={'SEC_TO_TIME':_0xb6a4('0x57'),'DATE':_0xb6a4('0x82'),'HOUR':'HOUR(%s)','ROUND':_0xb6a4('0x83'),'UNIX_TIMESTAMP':_0xb6a4('0x58')};var _0x35b6e4=function(_0x1be94a){return!_[_0xb6a4('0x71')](['IS\x20NULL','IS\x20NOT\x20NULL',_0xb6a4('0x5a'),_0xb6a4('0x5b')],_0x1be94a);};var _0x33e5b7=function(_0x251cb3){if(!_0x251cb3||!_0x251cb3[_0xb6a4('0x5c')][_0xb6a4('0x34')]){return'';}for(var _0x51089b='(',_0x3d7e5b=0x0;_0x3d7e5b<_0x251cb3[_0xb6a4('0x5c')][_0xb6a4('0x34')];_0x3d7e5b+=0x1){_0x3d7e5b>0x0&&(_0x51089b+='\x20'+_0x251cb3[_0xb6a4('0x5d')]+'\x20');_0x51089b+=_0x251cb3[_0xb6a4('0x5c')][_0x3d7e5b]['group']?_0x33e5b7(_0x251cb3[_0xb6a4('0x5c')][_0x3d7e5b][_0xb6a4('0x5e')]):_0x251cb3[_0xb6a4('0x5c')][_0x3d7e5b][_0xb6a4('0x5f')]+'\x20'+_0x251cb3['rules'][_0x3d7e5b][_0xb6a4('0x60')]+(_0x35b6e4(_0x251cb3[_0xb6a4('0x5c')][_0x3d7e5b]['condition'])?'\x20'+_0x251cb3['rules'][_0x3d7e5b][_0xb6a4('0x61')]:'');}return _0x51089b+')';};var _0x38c8e4={'where':{'id':_0x30f2ba[_0xb6a4('0x43')]['id']}},_0x5db1e0,_0x5edf60,_0x3eaf8f,_0x187453,_0x73cca;_0x38c8e4=_[_0xb6a4('0x3b')]({},_0x38c8e4,_0x30f2ba[_0xb6a4('0x44')]);return db['AnalyticCustomReport'][_0xb6a4('0x45')](_0x38c8e4)[_0xb6a4('0x22')](function(_0x5d712e){if(_0x5d712e){_0x5db1e0=_0x5d712e;return _0x5d712e['getFields']();}return null;})[_0xb6a4('0x22')](function(_0x538c07){if(_0x538c07){if(!_0x538c07[_0xb6a4('0x34')]){throw new db[(_0xb6a4('0x86'))][(_0xb6a4('0x62'))](_0xb6a4('0x87'),0x193);}_0x5edf60=_0x538c07;return db[_0xb6a4('0x63')][_0xb6a4('0x64')]({'raw':!![]});}return null;})[_0xb6a4('0x22')](function(_0x493c0b){if(_0x493c0b){_0x3eaf8f=_[_0xb6a4('0x65')](_0x493c0b,'id');var _0x1453c1;var _0xb01795=squel['select']();_0xb01795[_0xb6a4('0x89')](_0x5db1e0[_0xb6a4('0x76')]);for(var _0x436e7b=0x0;_0x436e7b<_0x5edf60[_0xb6a4('0x34')];_0x436e7b+=0x1){_0x1453c1=_0x5edf60[_0x436e7b][_0xb6a4('0x66')]?_0x3eaf8f[_0x5edf60[_0x436e7b][_0xb6a4('0x66')]][_0xb6a4('0x67')]:_0x5edf60[_0x436e7b]['field'];_0x1453c1=_0x5edf60[_0x436e7b][_0xb6a4('0x68')]?_['replace'](_0x5d7396[_0x5edf60[_0x436e7b][_0xb6a4('0x68')]],'%s',_0x1453c1):_0x1453c1;_0x1453c1=_0x5edf60[_0x436e7b]['format']?_[_0xb6a4('0x69')](_0x1f8615[_0x5edf60[_0x436e7b][_0xb6a4('0x6a')]],'%s',_0x1453c1):_0x1453c1;if(_0x5edf60[_0x436e7b]['groupBy']){_0xb01795[_0xb6a4('0x5e')](_0x1453c1);}_0x5edf60[_0x436e7b][_0xb6a4('0x6b')]&&_0xb01795[_0xb6a4('0x6c')](_0x1453c1,_0x5edf60[_0x436e7b][_0xb6a4('0x6b')]==='DESC'?![]:!![]);_0xb01795['field'](_0x1453c1,_0x5edf60[_0x436e7b][_0xb6a4('0x6e')]||_0x1453c1);}if(_0x5db1e0[_0xb6a4('0x6f')]){_0x5db1e0[_0xb6a4('0x6f')]=JSON['parse'](_0x5db1e0[_0xb6a4('0x6f')]);for(var _0x38dc0d=0x0;_0x38dc0d<_0x5db1e0[_0xb6a4('0x6f')][_0xb6a4('0x34')];_0x38dc0d+=0x1){if(_0x5db1e0['joins'][_0x38dc0d][_0xb6a4('0x2c')]&&_[_0xb6a4('0x71')](_0x146aca,_0x5db1e0[_0xb6a4('0x6f')][_0x38dc0d]['type'])&&_0x5db1e0[_0xb6a4('0x6f')][_0x38dc0d]['parentKey']&&_0x5db1e0[_0xb6a4('0x6f')][_0x38dc0d]['foreignTable']&&_0x5db1e0['joins'][_0x38dc0d]['foreignKey']){_0xb01795[_0x5db1e0[_0xb6a4('0x6f')][_0x38dc0d][_0xb6a4('0x2c')]](_0x5db1e0[_0xb6a4('0x6f')][_0x38dc0d][_0xb6a4('0x73')],null,util[_0xb6a4('0x6a')]('%s.%s\x20=\x20%s.%s',_0x5db1e0[_0xb6a4('0x76')],_0x5db1e0[_0xb6a4('0x6f')][_0x38dc0d][_0xb6a4('0x72')],_0x5db1e0[_0xb6a4('0x6f')][_0x38dc0d][_0xb6a4('0x73')],_0x5db1e0[_0xb6a4('0x6f')][_0x38dc0d][_0xb6a4('0x74')]));}}}if(_0x5db1e0[_0xb6a4('0x77')]){_0x5db1e0[_0xb6a4('0x77')]=JSON['parse'](_0x5db1e0[_0xb6a4('0x77')]);_0xb01795[_0xb6a4('0x37')](_0x33e5b7(_0x5db1e0[_0xb6a4('0x77')][_0xb6a4('0x5e')]));}_0x73cca=_0xb01795[_0xb6a4('0x78')]();_0xb01795[_0xb6a4('0x1e')](_0x54ac15);_0xb01795['offset'](0x0);logger['debug']('Limited\x20Query:',_0xb01795['toString']());return dbH[_0xb6a4('0x7c')][_0xb6a4('0x2f')](_0xb01795[_0xb6a4('0x7b')](),{'type':dbH['sequelize'][_0xb6a4('0x9f')][_0xb6a4('0x7d')]});}})[_0xb6a4('0x22')](function(){return{'sql':_0x73cca[_0xb6a4('0x7b')]()};})[_0xb6a4('0x22')](respondWithResult(_0x5a16aa,null))[_0xb6a4('0x41')](handleError(_0x5a16aa,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 52d3271..11ffc28 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 _0x4222=['bluebird','path','rimraf','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','api','moment'];(function(_0x272f3c,_0x29817c){var _0x472053=function(_0xf7fbe9){while(--_0xf7fbe9){_0x272f3c['push'](_0x272f3c['shift']());}};_0x472053(++_0x29817c);}(_0x4222,0xd9));var _0x2422=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x4222[_0x209941];return _0x1e8729;};'use strict';var _=require(_0x2422('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2422('0x1'));var moment=require(_0x2422('0x2'));var BPromise=require(_0x2422('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2422('0x4'));var rimraf=require(_0x2422('0x5'));var config=require('../../config/environment');var attributes=require(_0x2422('0x6'));module[_0x2422('0x7')]=function(_0x2a014c,_0x199a5d){return _0x2a014c[_0x2422('0x8')](_0x2422('0x9'),attributes,{'tableName':_0x2422('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcc2b=['AnalyticCustomReport','analytics_custom_reports','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports'];(function(_0x185e2b,_0x569afd){var _0x1ec9fc=function(_0x182be1){while(--_0x182be1){_0x185e2b['push'](_0x185e2b['shift']());}};_0x1ec9fc(++_0x569afd);}(_0xcc2b,0x16d));var _0xbcc2=function(_0x2261ce,_0x9ed8b6){_0x2261ce=_0x2261ce-0x0;var _0x524640=_0xcc2b[_0x2261ce];return _0x524640;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xbcc2('0x0'))('api');var moment=require(_0xbcc2('0x1'));var BPromise=require(_0xbcc2('0x2'));var rp=require(_0xbcc2('0x3'));var fs=require('fs');var path=require(_0xbcc2('0x4'));var rimraf=require(_0xbcc2('0x5'));var config=require(_0xbcc2('0x6'));var attributes=require(_0xbcc2('0x7'));module[_0xbcc2('0x8')]=function(_0x448f74,_0x4d4ee9){return _0x448f74['define'](_0xbcc2('0x9'),attributes,{'tableName':_0xbcc2('0xa'),'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 1174544..1815567 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 _0xf955=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','AnalyticCustomReport,\x20%s,\x20%s','message','result','lodash','moment'];(function(_0xb301d4,_0x27ed18){var _0x3b5bde=function(_0x1fbc5f){while(--_0x1fbc5f){_0xb301d4['push'](_0xb301d4['shift']());}};_0x3b5bde(++_0x27ed18);}(_0xf955,0x106));var _0x5f95=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xf955[_0xea8947];return _0x2455e9;};'use strict';var _=require(_0x5f95('0x0'));var util=require('util');var moment=require(_0x5f95('0x1'));var BPromise=require(_0x5f95('0x2'));var rs=require(_0x5f95('0x3'));var fs=require('fs');var Redis=require(_0x5f95('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5f95('0x5'));var logger=require(_0x5f95('0x6'))(_0x5f95('0x7'));var config=require(_0x5f95('0x8'));var jayson=require(_0x5f95('0x9'));var client=jayson[_0x5f95('0xa')][_0x5f95('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1980c0,_0x6c66b7,_0x15d043){return new BPromise(function(_0x463981,_0x2ae040){return client[_0x5f95('0xc')](_0x1980c0,_0x15d043)['then'](function(_0x37755d){logger[_0x5f95('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0x6c66b7,_0x5f95('0xe'));logger[_0x5f95('0xf')](_0x5f95('0x10'),_0x6c66b7,'request\x20sent',JSON['stringify'](_0x37755d));if(_0x37755d[_0x5f95('0x11')]){if(_0x37755d[_0x5f95('0x11')][_0x5f95('0x12')]===0x1f4){logger[_0x5f95('0x11')](_0x5f95('0x13'),_0x6c66b7,_0x37755d['error']['message']);return _0x2ae040(_0x37755d['error'][_0x5f95('0x14')]);}logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x6c66b7,_0x37755d[_0x5f95('0x11')][_0x5f95('0x14')]);return _0x463981(_0x37755d[_0x5f95('0x11')][_0x5f95('0x14')]);}else{logger[_0x5f95('0xd')](_0x5f95('0x13'),_0x6c66b7,'request\x20sent');_0x463981(_0x37755d[_0x5f95('0x15')]['message']);}})['catch'](function(_0x4255d7){logger[_0x5f95('0x11')](_0x5f95('0x13'),_0x6c66b7,_0x4255d7);_0x2ae040(_0x4255d7);});});}
\ No newline at end of file
+var _0x1969=['info','AnalyticCustomReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','http','then'];(function(_0x5b48d5,_0x140014){var _0x485ff1=function(_0x5c641b){while(--_0x5c641b){_0x5b48d5['push'](_0x5b48d5['shift']());}};_0x485ff1(++_0x140014);}(_0x1969,0xb5));var _0x9196=function(_0x465d94,_0x404ea6){_0x465d94=_0x465d94-0x0;var _0x4e20c0=_0x1969[_0x465d94];return _0x4e20c0;};'use strict';var _=require(_0x9196('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9196('0x1'));var rs=require(_0x9196('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9196('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9196('0x4'));var config=require(_0x9196('0x5'));var jayson=require(_0x9196('0x6'));var client=jayson['client'][_0x9196('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3604ca,_0x4c2f5c,_0x5860d9){return new BPromise(function(_0x29baa8,_0x210522){return client['request'](_0x3604ca,_0x5860d9)[_0x9196('0x8')](function(_0x4813e8){logger[_0x9196('0x9')](_0x9196('0xa'),_0x4c2f5c,'request\x20sent');logger[_0x9196('0xb')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x4c2f5c,_0x9196('0xc'),JSON[_0x9196('0xd')](_0x4813e8));if(_0x4813e8[_0x9196('0xe')]){if(_0x4813e8[_0x9196('0xe')][_0x9196('0xf')]===0x1f4){logger[_0x9196('0xe')](_0x9196('0xa'),_0x4c2f5c,_0x4813e8[_0x9196('0xe')][_0x9196('0x10')]);return _0x210522(_0x4813e8[_0x9196('0xe')]['message']);}logger['error'](_0x9196('0xa'),_0x4c2f5c,_0x4813e8[_0x9196('0xe')][_0x9196('0x10')]);return _0x29baa8(_0x4813e8['error']['message']);}else{logger[_0x9196('0x9')](_0x9196('0xa'),_0x4c2f5c,'request\x20sent');_0x29baa8(_0x4813e8[_0x9196('0x11')]['message']);}})[_0x9196('0x12')](function(_0x16f539){logger[_0x9196('0xe')](_0x9196('0xa'),_0x4c2f5c,_0x16f539);_0x210522(_0x16f539);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index a36a570..e12cd21 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 _0x3b01=['preview','/:id/run','run','/:id/query','query','post','create','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','get','index','/:id','isAuthenticated','show','/:id/preview'];(function(_0x4e2148,_0x382a2c){var _0x323345=function(_0x426339){while(--_0x426339){_0x4e2148['push'](_0x4e2148['shift']());}};_0x323345(++_0x382a2c);}(_0x3b01,0x8e));var _0x13b0=function(_0x51a5fc,_0x4a1f5a){_0x51a5fc=_0x51a5fc-0x0;var _0x1afbfd=_0x3b01[_0x51a5fc];return _0x1afbfd;};'use strict';var multer=require('multer');var util=require(_0x13b0('0x0'));var path=require(_0x13b0('0x1'));var timeout=require('connect-timeout');var express=require(_0x13b0('0x2'));var router=express[_0x13b0('0x3')]();var fs_extra=require(_0x13b0('0x4'));var auth=require(_0x13b0('0x5'));var interaction=require(_0x13b0('0x6'));var config=require('../../config/environment');var controller=require(_0x13b0('0x7'));router[_0x13b0('0x8')]('/',auth['isAuthenticated'](),controller[_0x13b0('0x9')]);router[_0x13b0('0x8')](_0x13b0('0xa'),auth[_0x13b0('0xb')](),controller[_0x13b0('0xc')]);router[_0x13b0('0x8')](_0x13b0('0xd'),auth[_0x13b0('0xb')](),controller[_0x13b0('0xe')]);router[_0x13b0('0x8')](_0x13b0('0xf'),auth[_0x13b0('0xb')](),controller[_0x13b0('0x10')]);router[_0x13b0('0x8')](_0x13b0('0x11'),auth['isAuthenticated'](),controller[_0x13b0('0x12')]);router[_0x13b0('0x13')]('/',auth[_0x13b0('0xb')](),controller[_0x13b0('0x14')]);router[_0x13b0('0x15')](_0x13b0('0xa'),auth[_0x13b0('0xb')](),controller[_0x13b0('0x16')]);router[_0x13b0('0x17')](_0x13b0('0xa'),auth['isAuthenticated'](),controller[_0x13b0('0x18')]);module[_0x13b0('0x19')]=router;
\ No newline at end of file
+var _0xc110=['multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','put','delete','destroy','exports'];(function(_0xffd8b0,_0x12c51f){var _0x301ba0=function(_0x103c05){while(--_0x103c05){_0xffd8b0['push'](_0xffd8b0['shift']());}};_0x301ba0(++_0x12c51f);}(_0xc110,0x138));var _0x0c11=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc110[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x0c11('0x0'));var util=require(_0x0c11('0x1'));var path=require(_0x0c11('0x2'));var timeout=require('connect-timeout');var express=require(_0x0c11('0x3'));var router=express['Router']();var fs_extra=require(_0x0c11('0x4'));var auth=require(_0x0c11('0x5'));var interaction=require(_0x0c11('0x6'));var config=require(_0x0c11('0x7'));var controller=require('./analyticCustomReport.controller');router[_0x0c11('0x8')]('/',auth[_0x0c11('0x9')](),controller[_0x0c11('0xa')]);router[_0x0c11('0x8')](_0x0c11('0xb'),auth[_0x0c11('0x9')](),controller[_0x0c11('0xc')]);router['get'](_0x0c11('0xd'),auth[_0x0c11('0x9')](),controller[_0x0c11('0xe')]);router[_0x0c11('0x8')](_0x0c11('0xf'),auth[_0x0c11('0x9')](),controller[_0x0c11('0x10')]);router[_0x0c11('0x8')](_0x0c11('0x11'),auth['isAuthenticated'](),controller[_0x0c11('0x12')]);router[_0x0c11('0x13')]('/',auth[_0x0c11('0x9')](),controller['create']);router[_0x0c11('0x14')](_0x0c11('0xb'),auth[_0x0c11('0x9')](),controller['update']);router[_0x0c11('0x15')](_0x0c11('0xb'),auth['isAuthenticated'](),controller[_0x0c11('0x16')]);module[_0x0c11('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 22c3c04..f702197 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 _0x7fbe=['STRING','TEXT'];(function(_0x4589fd,_0x4c6f26){var _0x44084b=function(_0x1eeabd){while(--_0x1eeabd){_0x4589fd['push'](_0x4589fd['shift']());}};_0x44084b(++_0x4c6f26);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x52bbc9,_0xb342e0){_0x52bbc9=_0x52bbc9-0x0;var _0x5909d0=_0x7fbe[_0x52bbc9];return _0x5909d0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe7fb('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0xe7fb('0x0')]},'parent':{'type':Sequelize[_0xe7fb('0x0')]},'table':{'type':Sequelize[_0xe7fb('0x0')]},'conditions':{'type':Sequelize[_0xe7fb('0x1')]},'joins':{'type':Sequelize[_0xe7fb('0x1')]}};
\ No newline at end of file
+var _0xd8fb=['TEXT','sequelize','exports','STRING'];(function(_0x56cfa2,_0x4d9800){var _0x302037=function(_0x56a1ed){while(--_0x56a1ed){_0x56cfa2['push'](_0x56cfa2['shift']());}};_0x302037(++_0x4d9800);}(_0xd8fb,0x99));var _0xbd8f=function(_0x4ea664,_0x23e3cc){_0x4ea664=_0x4ea664-0x0;var _0x4e5f37=_0xd8fb[_0x4ea664];return _0x4e5f37;};'use strict';var Sequelize=require(_0xbd8f('0x0'));module[_0xbd8f('0x1')]={'name':{'type':Sequelize[_0xbd8f('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xbd8f('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xbd8f('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 370e13e..0131c21 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 _0xdbf5=['includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','function','replace','format','groupBy','orderBy','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','parentKey','conditions','debug','Limited\x20Query:','toString','SELECT','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','IS\x20EMPTY','ValidationErrorItem','metric','DESC','clone','output','fullPath','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','cdr','startDate','endDate','info','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','sequelize','QueryTypes','run','Sequelize','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','dbH','end','status','json','limit','undefined','count','set','Content-Range','reject','save','then','destroy','get','DefaultReports','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','catch','update','join','left_join','right_join','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x10d4ad,_0x53993e){_0x10d4ad=_0x10d4ad-0x0;var _0x5dfa22=_0xdbf5[_0x10d4ad];return _0x5dfa22;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5dbf('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5dbf('0x1'));var moment=require(_0x5dbf('0x2'));var BPromise=require(_0x5dbf('0x3'));var Mustache=require(_0x5dbf('0x4'));var util=require(_0x5dbf('0x5'));var path=require(_0x5dbf('0x6'));var sox=require(_0x5dbf('0x7'));var csv=require(_0x5dbf('0x8'));var ejs=require(_0x5dbf('0x9'));var fs=require('fs');var fs_extra=require(_0x5dbf('0xa'));var _=require(_0x5dbf('0xb'));var squel=require(_0x5dbf('0xc'));var crypto=require(_0x5dbf('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5dbf('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5dbf('0xf'));var Papa=require(_0x5dbf('0x10'));var Redis=require(_0x5dbf('0x11'));var authService=require(_0x5dbf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5dbf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5dbf('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5dbf('0x15'));var db=require('../../mysqldb')['db'];var dbH=require(_0x5dbf('0x16'))[_0x5dbf('0x17')];function respondWithStatusCode(_0x1453a9,_0x7cb848){_0x7cb848=_0x7cb848||0xcc;return function(_0x14493a){if(_0x14493a){return _0x1453a9['sendStatus'](_0x7cb848);}return _0x1453a9['status'](_0x7cb848)[_0x5dbf('0x18')]();};}function respondWithResult(_0x3480c8,_0x48e7fd){_0x48e7fd=_0x48e7fd||0xc8;return function(_0x19624e){if(_0x19624e){return _0x3480c8[_0x5dbf('0x19')](_0x48e7fd)[_0x5dbf('0x1a')](_0x19624e);}};}function respondWithFilteredResult(_0x2dfa44,_0x181816){return function(_0x472eb9){if(_0x472eb9){var _0x2d32cc=typeof _0x181816['offset']==='undefined'&&typeof _0x181816[_0x5dbf('0x1b')]===_0x5dbf('0x1c');var _0x39c7aa=_0x472eb9[_0x5dbf('0x1d')];var _0x20c2b0=_0x2d32cc?0x0:_0x181816['offset'];var _0x11cd00=_0x2d32cc?_0x472eb9['count']:_0x181816['offset']+_0x181816['limit'];var _0x23d1e7;if(_0x11cd00>=_0x39c7aa){_0x11cd00=_0x39c7aa;_0x23d1e7=0xc8;}else{_0x23d1e7=0xce;}_0x2dfa44[_0x5dbf('0x19')](_0x23d1e7);return _0x2dfa44[_0x5dbf('0x1e')](_0x5dbf('0x1f'),_0x20c2b0+'-'+_0x11cd00+'/'+_0x39c7aa)[_0x5dbf('0x1a')](_0x472eb9);}return null;};}function patchUpdates(_0x5b2518){return function(_0x2764ea){try{jsonpatch['apply'](_0x2764ea,_0x5b2518,!![]);}catch(_0xb68f92){return BPromise[_0x5dbf('0x20')](_0xb68f92);}return _0x2764ea[_0x5dbf('0x21')]();};}function saveUpdates(_0x43a612,_0x3b763c){return function(_0x2f154e){if(_0x2f154e){return _0x2f154e['update'](_0x43a612)[_0x5dbf('0x22')](function(_0x3e3a2d){return _0x3e3a2d;});}return null;};}function removeEntity(_0x2d3e1b,_0x2079fc){return function(_0x2763ec){if(_0x2763ec){return _0x2763ec[_0x5dbf('0x23')]()[_0x5dbf('0x22')](function(){var _0x20ab1b=_0x2763ec[_0x5dbf('0x24')]({'plain':!![]});var _0x15a790=_0x5dbf('0x25');return db[_0x5dbf('0x26')][_0x5dbf('0x23')]({'where':{'type':_0x15a790,'resourceId':_0x20ab1b['id']}})[_0x5dbf('0x22')](function(){return _0x2763ec;});})[_0x5dbf('0x22')](function(){_0x2d3e1b[_0x5dbf('0x19')](0xcc)[_0x5dbf('0x18')]();});}};}function handleEntityNotFound(_0x3f8341,_0x159e61){return function(_0x22ec42){if(!_0x22ec42){_0x3f8341[_0x5dbf('0x27')](0x194);}return _0x22ec42;};}function handleError(_0x471027,_0x21cd00){_0x21cd00=_0x21cd00||0x1f4;return function(_0x5768b7){logger[_0x5dbf('0x28')](_0x5768b7[_0x5dbf('0x29')]);if(_0x5768b7[_0x5dbf('0x2a')]){delete _0x5768b7[_0x5dbf('0x2a')];}_0x471027[_0x5dbf('0x19')](_0x21cd00)[_0x5dbf('0x2b')](_0x5768b7);};}exports[_0x5dbf('0x2c')]=function(_0x31d57a,_0x406ce6){var _0x273b63={},_0x294dd7={},_0x50a307={'count':0x0,'rows':[]};var _0x4c1587=_[_0x5dbf('0x2d')](db[_0x5dbf('0x2e')][_0x5dbf('0x2f')],function(_0x3b73ad){return{'name':_0x3b73ad[_0x5dbf('0x30')],'type':_0x3b73ad['type']['key']};});_0x294dd7[_0x5dbf('0x31')]=_[_0x5dbf('0x2d')](_0x4c1587,'name');_0x294dd7[_0x5dbf('0x32')]=_[_0x5dbf('0x33')](_0x31d57a[_0x5dbf('0x32')]);_0x294dd7[_0x5dbf('0x34')]=_[_0x5dbf('0x35')](_0x294dd7['model'],_0x294dd7[_0x5dbf('0x32')]);_0x273b63[_0x5dbf('0x36')]=_[_0x5dbf('0x35')](_0x294dd7[_0x5dbf('0x31')],qs[_0x5dbf('0x37')](_0x31d57a['query'][_0x5dbf('0x37')]));_0x273b63[_0x5dbf('0x36')]=_0x273b63[_0x5dbf('0x36')][_0x5dbf('0x38')]?_0x273b63['attributes']:_0x294dd7[_0x5dbf('0x31')];if(!_0x31d57a[_0x5dbf('0x32')][_0x5dbf('0x39')](_0x5dbf('0x3a'))){_0x273b63[_0x5dbf('0x1b')]=qs[_0x5dbf('0x1b')](_0x31d57a[_0x5dbf('0x32')][_0x5dbf('0x1b')]);_0x273b63[_0x5dbf('0x3b')]=qs[_0x5dbf('0x3b')](_0x31d57a[_0x5dbf('0x32')]['offset']);}_0x273b63[_0x5dbf('0x3c')]=qs[_0x5dbf('0x3d')](_0x31d57a[_0x5dbf('0x32')]['sort']);_0x273b63[_0x5dbf('0x3e')]=qs[_0x5dbf('0x34')](_[_0x5dbf('0x3f')](_0x31d57a['query'],_0x294dd7[_0x5dbf('0x34')]),_0x4c1587);if(_0x31d57a[_0x5dbf('0x32')][_0x5dbf('0x40')]){_0x273b63['where']=_[_0x5dbf('0x41')](_0x273b63[_0x5dbf('0x3e')],{'$or':_[_0x5dbf('0x2d')](_0x4c1587,function(_0x260c9f){if(_0x260c9f[_0x5dbf('0x42')]!==_0x5dbf('0x43')){var _0x321ae3={};_0x321ae3[_0x260c9f[_0x5dbf('0x2a')]]={'$like':'%'+_0x31d57a['query']['filter']+'%'};return _0x321ae3;}})});}_0x273b63=_['merge']({},_0x273b63,_0x31d57a['options']);var _0x28b28f={'where':_0x273b63[_0x5dbf('0x3e')]};return db['AnalyticDefaultReport'][_0x5dbf('0x1d')](_0x28b28f)[_0x5dbf('0x22')](function(_0x5a60e8){_0x50a307[_0x5dbf('0x1d')]=_0x5a60e8;if(_0x31d57a[_0x5dbf('0x32')][_0x5dbf('0x44')]){_0x273b63[_0x5dbf('0x45')]=[{'all':!![]}];}return db[_0x5dbf('0x2e')][_0x5dbf('0x46')](_0x273b63);})[_0x5dbf('0x22')](function(_0x1c020a){_0x50a307[_0x5dbf('0x47')]=_0x1c020a;return _0x50a307;})[_0x5dbf('0x22')](respondWithFilteredResult(_0x406ce6,_0x273b63))['catch'](handleError(_0x406ce6,null));};exports[_0x5dbf('0x48')]=function(_0x22f958,_0xec1d28){var _0x50880d={'raw':!![],'where':{'id':_0x22f958[_0x5dbf('0x49')]['id']}},_0x16b0ff={};_0x16b0ff[_0x5dbf('0x31')]=_[_0x5dbf('0x33')](db['AnalyticDefaultReport'][_0x5dbf('0x2f')]);_0x16b0ff['query']=_[_0x5dbf('0x33')](_0x22f958[_0x5dbf('0x32')]);_0x16b0ff[_0x5dbf('0x34')]=_[_0x5dbf('0x35')](_0x16b0ff['model'],_0x16b0ff['query']);_0x50880d[_0x5dbf('0x36')]=_[_0x5dbf('0x35')](_0x16b0ff[_0x5dbf('0x31')],qs['fields'](_0x22f958[_0x5dbf('0x32')]['fields']));_0x50880d['attributes']=_0x50880d['attributes']['length']?_0x50880d[_0x5dbf('0x36')]:_0x16b0ff[_0x5dbf('0x31')];if(_0x22f958['query'][_0x5dbf('0x44')]){_0x50880d[_0x5dbf('0x45')]=[{'all':!![]}];}_0x50880d=_['merge']({},_0x50880d,_0x22f958[_0x5dbf('0x4a')]);return db[_0x5dbf('0x2e')]['find'](_0x50880d)[_0x5dbf('0x22')](handleEntityNotFound(_0xec1d28,null))['then'](respondWithResult(_0xec1d28,null))['catch'](handleError(_0xec1d28,null));};exports[_0x5dbf('0x4b')]=function(_0x2a3d30,_0x17a1c0){return db['AnalyticDefaultReport']['create'](_0x2a3d30[_0x5dbf('0x4c')],{})[_0x5dbf('0x22')](function(_0x21f477){var _0x307a00=_0x2a3d30[_0x5dbf('0x4d')][_0x5dbf('0x24')]({'plain':!![]});if(!_0x307a00)throw new Error(_0x5dbf('0x4e'));if(_0x307a00[_0x5dbf('0x4f')]==='user'){var _0x3f38a0=_0x21f477[_0x5dbf('0x24')]({'plain':!![]});var _0x2927a3=_0x5dbf('0x50');return db[_0x5dbf('0x51')][_0x5dbf('0x52')]({'where':{'name':_0x2927a3,'userProfileId':_0x307a00[_0x5dbf('0x53')]},'raw':!![]})['then'](function(_0x1b0b13){if(_0x1b0b13&&_0x1b0b13['autoAssociation']===0x0){return db[_0x5dbf('0x26')][_0x5dbf('0x4b')]({'name':_0x3f38a0[_0x5dbf('0x2a')],'resourceId':_0x3f38a0['id'],'type':_0x5dbf('0x25'),'sectionId':_0x1b0b13['id']},{})[_0x5dbf('0x22')](function(){return _0x21f477;});}else{return _0x21f477;}})[_0x5dbf('0x54')](function(_0x353d0f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x353d0f);throw _0x353d0f;});}return _0x21f477;})['then'](respondWithResult(_0x17a1c0,0xc9))[_0x5dbf('0x54')](handleError(_0x17a1c0,null));};exports[_0x5dbf('0x55')]=function(_0x36a787,_0x56c8b2){if(_0x36a787['body']['id']){delete _0x36a787[_0x5dbf('0x4c')]['id'];}return db[_0x5dbf('0x2e')][_0x5dbf('0x52')]({'where':{'id':_0x36a787['params']['id']}})[_0x5dbf('0x22')](handleEntityNotFound(_0x56c8b2,null))['then'](saveUpdates(_0x36a787[_0x5dbf('0x4c')],null))[_0x5dbf('0x22')](respondWithResult(_0x56c8b2,null))[_0x5dbf('0x54')](handleError(_0x56c8b2,null));};exports['destroy']=function(_0x55fd51,_0x1b316d){return db[_0x5dbf('0x2e')][_0x5dbf('0x52')]({'where':{'id':_0x55fd51[_0x5dbf('0x49')]['id']}})['then'](handleEntityNotFound(_0x1b316d,null))[_0x5dbf('0x22')](removeEntity(_0x1b316d,null))[_0x5dbf('0x54')](handleError(_0x1b316d,null));};exports['preview']=function(_0x5485f3,_0x19ec03){var _0x14bdb1=0xa;var _0x197e8c=[_0x5dbf('0x56'),_0x5dbf('0x57'),_0x5dbf('0x58'),'cross_join'];var _0x4107f1={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x5dbf('0x59'),'MIN':'MIN(%s)','AVG':_0x5dbf('0x5a'),'GROUP_CONCAT':_0x5dbf('0x5b'),'GROUP_CONCAT ASC':_0x5dbf('0x5c'),'GROUP_CONCAT DESC':_0x5dbf('0x5d')};var _0x461ffb={'SEC_TO_TIME':_0x5dbf('0x5e'),'DATE':_0x5dbf('0x5f'),'HOUR':_0x5dbf('0x60'),'ROUND':_0x5dbf('0x61'),'UNIX_TIMESTAMP':_0x5dbf('0x62')};var _0x3a84c2=function(_0x2ca889){return!_[_0x5dbf('0x63')]([_0x5dbf('0x64'),_0x5dbf('0x65'),'IS\x20EMPTY',_0x5dbf('0x66')],_0x2ca889);};var _0x553be4=function(_0xb0a9bf){if(!_0xb0a9bf||!_0xb0a9bf[_0x5dbf('0x67')][_0x5dbf('0x38')]){return'';}for(var _0x110224='(',_0x5a975a=0x0;_0x5a975a<_0xb0a9bf[_0x5dbf('0x67')][_0x5dbf('0x38')];_0x5a975a+=0x1){_0x5a975a>0x0&&(_0x110224+='\x20'+_0xb0a9bf[_0x5dbf('0x68')]+'\x20');_0x110224+=_0xb0a9bf[_0x5dbf('0x67')][_0x5a975a][_0x5dbf('0x69')]?_0x553be4(_0xb0a9bf[_0x5dbf('0x67')][_0x5a975a]['group']):_0xb0a9bf[_0x5dbf('0x67')][_0x5a975a][_0x5dbf('0x6a')]+'\x20'+_0xb0a9bf[_0x5dbf('0x67')][_0x5a975a][_0x5dbf('0x6b')]+(_0x3a84c2(_0xb0a9bf[_0x5dbf('0x67')][_0x5a975a][_0x5dbf('0x6b')])?'\x20'+_0xb0a9bf[_0x5dbf('0x67')][_0x5a975a][_0x5dbf('0x6c')]:'');}return _0x110224+')';};var _0x12d69b={'where':{'id':_0x5485f3[_0x5dbf('0x49')]['id']}},_0x3b53da,_0x13c8ab,_0x2997a8,_0x5d7a37,_0x52109d;_0x12d69b=_[_0x5dbf('0x41')]({},_0x12d69b,_0x5485f3[_0x5dbf('0x4a')]);return db[_0x5dbf('0x2e')][_0x5dbf('0x52')](_0x12d69b)[_0x5dbf('0x22')](function(_0x1b42cf){if(_0x1b42cf){_0x3b53da=_0x1b42cf;return _0x1b42cf[_0x5dbf('0x6d')]();}return null;})[_0x5dbf('0x22')](function(_0x57c568){if(_0x57c568){if(!_0x57c568['length']){throw new db['Sequelize']['ValidationErrorItem'](_0x5dbf('0x6e'),0x193);}_0x13c8ab=_0x57c568;return db[_0x5dbf('0x6f')][_0x5dbf('0x46')]({'raw':!![]});}return null;})[_0x5dbf('0x22')](function(_0x29c4d9){if(_0x29c4d9){_0x2997a8=_[_0x5dbf('0x70')](_0x29c4d9,'id');var _0x5331ff;var _0x5bb990=squel[_0x5dbf('0x71')]();_0x5bb990[_0x5dbf('0x72')](_0x3b53da['table']);for(var _0x1728b9=0x0;_0x1728b9<_0x13c8ab[_0x5dbf('0x38')];_0x1728b9+=0x1){_0x5331ff=_0x13c8ab[_0x1728b9][_0x5dbf('0x73')]?_0x2997a8[_0x13c8ab[_0x1728b9][_0x5dbf('0x73')]]['metric']:_0x13c8ab[_0x1728b9][_0x5dbf('0x6a')];_0x5331ff=_0x13c8ab[_0x1728b9][_0x5dbf('0x74')]?_[_0x5dbf('0x75')](_0x4107f1[_0x13c8ab[_0x1728b9][_0x5dbf('0x74')]],'%s',_0x5331ff):_0x5331ff;_0x5331ff=_0x13c8ab[_0x1728b9][_0x5dbf('0x76')]?_['replace'](_0x461ffb[_0x13c8ab[_0x1728b9][_0x5dbf('0x76')]],'%s',_0x5331ff):_0x5331ff;if(_0x13c8ab[_0x1728b9][_0x5dbf('0x77')]){_0x5bb990[_0x5dbf('0x69')](_0x5331ff);}_0x13c8ab[_0x1728b9][_0x5dbf('0x78')]&&_0x5bb990['order'](_0x5331ff,_0x13c8ab[_0x1728b9][_0x5dbf('0x78')]==='DESC'?![]:!![]);_0x5bb990[_0x5dbf('0x6a')](_0x5331ff,_0x13c8ab[_0x1728b9][_0x5dbf('0x79')]||_0x5331ff);}if(_0x3b53da[_0x5dbf('0x7a')]){_0x3b53da['joins']=JSON[_0x5dbf('0x7b')](_0x3b53da[_0x5dbf('0x7a')]);for(var _0x4166ce=0x0;_0x4166ce<_0x3b53da[_0x5dbf('0x7a')]['length'];_0x4166ce+=0x1){if(_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x42')]&&_[_0x5dbf('0x63')](_0x197e8c,_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x42')])&&_0x3b53da[_0x5dbf('0x7a')][_0x4166ce]['parentKey']&&_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x7c')]&&_0x3b53da['joins'][_0x4166ce][_0x5dbf('0x7d')]){_0x5bb990[_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x42')]](_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x7c')],null,util[_0x5dbf('0x76')](_0x5dbf('0x7e'),_0x3b53da[_0x5dbf('0x7f')],_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x80')],_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x7c')],_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x7d')]));}}}if(_0x3b53da[_0x5dbf('0x81')]){_0x3b53da[_0x5dbf('0x81')]=JSON['parse'](_0x3b53da[_0x5dbf('0x81')]);_0x5bb990[_0x5dbf('0x3e')](_0x553be4(_0x3b53da[_0x5dbf('0x81')][_0x5dbf('0x69')]));}_0x52109d=_0x5bb990['clone']();_0x5bb990[_0x5dbf('0x1b')](_0x14bdb1);_0x5bb990[_0x5dbf('0x3b')](0x0);logger[_0x5dbf('0x82')](_0x5dbf('0x83'),_0x5bb990[_0x5dbf('0x84')]());return dbH['sequelize'][_0x5dbf('0x32')](_0x5bb990[_0x5dbf('0x84')](),{'type':dbH['sequelize']['QueryTypes'][_0x5dbf('0x85')]});}})[_0x5dbf('0x22')](respondWithResult(_0x19ec03,null))[_0x5dbf('0x54')](handleError(_0x19ec03,null));};function runReport(_0x8ca7de,_0x14b21b,_0x23ec75){var _0x22339b=_0x14b21b['name'];var _0x310078=0xa;var _0x3b01c0=[_0x5dbf('0x56'),_0x5dbf('0x57'),_0x5dbf('0x58'),_0x5dbf('0x86')];var _0x4cceb1={'SUM':_0x5dbf('0x87'),'COUNT':_0x5dbf('0x88'),'COUNT DISTINCT':_0x5dbf('0x89'),'MAX':_0x5dbf('0x59'),'MIN':_0x5dbf('0x8a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x5dbf('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5924d2={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x5dbf('0x5f'),'HOUR':_0x5dbf('0x60'),'ROUND':_0x5dbf('0x61'),'UNIX_TIMESTAMP':_0x5dbf('0x62')};var _0x4333db=function(_0x4cb92d){return!_['includes']([_0x5dbf('0x64'),'IS\x20NOT\x20NULL',_0x5dbf('0x8b'),_0x5dbf('0x66')],_0x4cb92d);};var _0x541241=function(_0x3c7eaa){if(!_0x3c7eaa||!_0x3c7eaa['rules'][_0x5dbf('0x38')]){return'';}for(var _0x24d90a='(',_0xa3e94f=0x0;_0xa3e94f<_0x3c7eaa[_0x5dbf('0x67')][_0x5dbf('0x38')];_0xa3e94f+=0x1){_0xa3e94f>0x0&&(_0x24d90a+='\x20'+_0x3c7eaa['operator']+'\x20');_0x24d90a+=_0x3c7eaa[_0x5dbf('0x67')][_0xa3e94f][_0x5dbf('0x69')]?_0x541241(_0x3c7eaa[_0x5dbf('0x67')][_0xa3e94f][_0x5dbf('0x69')]):_0x3c7eaa['rules'][_0xa3e94f][_0x5dbf('0x6a')]+'\x20'+_0x3c7eaa[_0x5dbf('0x67')][_0xa3e94f][_0x5dbf('0x6b')]+(_0x4333db(_0x3c7eaa[_0x5dbf('0x67')][_0xa3e94f][_0x5dbf('0x6b')])?'\x20'+_0x3c7eaa[_0x5dbf('0x67')][_0xa3e94f][_0x5dbf('0x6c')]:'');}return _0x24d90a+')';};var _0x334f63={'where':{'id':_0x8ca7de['id']}},_0x5ac29f,_0x533fdd,_0x5bf068,_0x1bd06b,_0x274497;_0x334f63=_['merge']({},_0x334f63,_0x23ec75);return db['AnalyticDefaultReport']['find'](_0x334f63)[_0x5dbf('0x22')](function(_0x20bda9){if(_0x20bda9){_0x5ac29f=_0x20bda9;return _0x20bda9[_0x5dbf('0x6d')]();}return null;})[_0x5dbf('0x22')](function(_0x12757d){if(_0x12757d){if(!_0x12757d[_0x5dbf('0x38')]){throw new db['Sequelize'][(_0x5dbf('0x8c'))](_0x5dbf('0x6e'),0x193);}_0x533fdd=_0x12757d;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x5dbf('0x22')](function(_0x5722b3){if(_0x5722b3){_0x5bf068=_['keyBy'](_0x5722b3,'id');var _0x3a27c4;var _0x3620d2=squel[_0x5dbf('0x71')]();_0x3620d2['from'](_0x5ac29f[_0x5dbf('0x7f')]);for(var _0x447259=0x0;_0x447259<_0x533fdd['length'];_0x447259+=0x1){_0x3a27c4=_0x533fdd[_0x447259][_0x5dbf('0x73')]?_0x5bf068[_0x533fdd[_0x447259][_0x5dbf('0x73')]][_0x5dbf('0x8d')]:_0x533fdd[_0x447259][_0x5dbf('0x6a')];_0x3a27c4=_0x533fdd[_0x447259][_0x5dbf('0x74')]?_[_0x5dbf('0x75')](_0x4cceb1[_0x533fdd[_0x447259][_0x5dbf('0x74')]],'%s',_0x3a27c4):_0x3a27c4;_0x3a27c4=_0x533fdd[_0x447259][_0x5dbf('0x76')]?_['replace'](_0x5924d2[_0x533fdd[_0x447259]['format']],'%s',_0x3a27c4):_0x3a27c4;if(_0x533fdd[_0x447259]['groupBy']){_0x3620d2[_0x5dbf('0x69')](_0x3a27c4);}_0x533fdd[_0x447259][_0x5dbf('0x78')]&&_0x3620d2[_0x5dbf('0x3c')](_0x3a27c4,_0x533fdd[_0x447259][_0x5dbf('0x78')]===_0x5dbf('0x8e')?![]:!![]);_0x3620d2[_0x5dbf('0x6a')](_0x3a27c4,_0x533fdd[_0x447259][_0x5dbf('0x79')]||_0x3a27c4);}if(_0x5ac29f[_0x5dbf('0x7a')]){_0x5ac29f[_0x5dbf('0x7a')]=JSON[_0x5dbf('0x7b')](_0x5ac29f['joins']);for(var _0x2ded2b=0x0;_0x2ded2b<_0x5ac29f[_0x5dbf('0x7a')][_0x5dbf('0x38')];_0x2ded2b+=0x1){if(_0x5ac29f[_0x5dbf('0x7a')][_0x2ded2b][_0x5dbf('0x42')]&&_[_0x5dbf('0x63')](_0x3b01c0,_0x5ac29f[_0x5dbf('0x7a')][_0x2ded2b][_0x5dbf('0x42')])&&_0x5ac29f['joins'][_0x2ded2b]['parentKey']&&_0x5ac29f[_0x5dbf('0x7a')][_0x2ded2b]['foreignTable']&&_0x5ac29f['joins'][_0x2ded2b][_0x5dbf('0x7d')]){_0x3620d2[_0x5ac29f['joins'][_0x2ded2b]['type']](_0x5ac29f['joins'][_0x2ded2b]['foreignTable'],null,util[_0x5dbf('0x76')]('%s.%s\x20=\x20%s.%s',_0x5ac29f[_0x5dbf('0x7f')],_0x5ac29f[_0x5dbf('0x7a')][_0x2ded2b][_0x5dbf('0x80')],_0x5ac29f['joins'][_0x2ded2b][_0x5dbf('0x7c')],_0x5ac29f[_0x5dbf('0x7a')][_0x2ded2b][_0x5dbf('0x7d')]));}}}if(_0x5ac29f['conditions']){_0x5ac29f[_0x5dbf('0x81')]=JSON[_0x5dbf('0x7b')](_0x5ac29f[_0x5dbf('0x81')]);_0x3620d2['where'](_0x541241(_0x5ac29f[_0x5dbf('0x81')][_0x5dbf('0x69')]));}_0x274497=_0x3620d2[_0x5dbf('0x8f')]();_0x3620d2['limit'](_0x310078);_0x3620d2[_0x5dbf('0x3b')](0x0);return;}})[_0x5dbf('0x22')](function(){if(_0x14b21b[_0x5dbf('0x90')]==='web'){return null;}var _0x48a8c5=_['merge'](_0x14b21b,{'name':_0x14b21b[_0x5dbf('0x91')]||_0x14b21b[_0x5dbf('0x2a')]||_0x5ac29f[_0x5dbf('0x2a')],'basename':_0x22339b,'savename':util[_0x5dbf('0x76')](_0x5dbf('0x92'),_0x14b21b[_0x5dbf('0x2a')]||_0x5ac29f['name'],require(_0x5dbf('0x93'))[_0x5dbf('0x94')](0x4),_0x14b21b[_0x5dbf('0x90')]||'csv'),'reportId':_0x5ac29f['id'],'reportType':_0x5dbf('0x95')});return db[_0x5dbf('0x96')][_0x5dbf('0x4b')](_0x48a8c5,{'raw':!![]});})[_0x5dbf('0x22')](function(_0x2afbd4){if(_0x5ac29f[_0x5dbf('0x7f')]===_0x5dbf('0x97')){_0x274497['where'](_0x5ac29f[_0x5dbf('0x7f')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x14b21b[_0x5dbf('0x98')],_0x14b21b[_0x5dbf('0x99')]);}else{_0x274497[_0x5dbf('0x3e')](_0x5ac29f['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x14b21b['startDate'],_0x14b21b[_0x5dbf('0x99')]);}if(_0x2afbd4){logger[_0x5dbf('0x9a')]('Run\x20Query:',_0x274497[_0x5dbf('0x84')]());require('child_process')[_0x5dbf('0x9b')](path[_0x5dbf('0x56')](__dirname,_0x5dbf('0x9c'),_0x2afbd4['output']),[_0x2afbd4['id'],_0x274497[_0x5dbf('0x84')](),path[_0x5dbf('0x56')](__dirname,_0x5dbf('0x9d'),_0x2afbd4[_0x5dbf('0x9e')]),_0x22339b]);return _0x2afbd4;}else{var _0x4bc5af=squel[_0x5dbf('0x71')]();_0x4bc5af[_0x5dbf('0x72')]('('+_0x274497['toString']()+')',_0x5dbf('0x9f'));_0x4bc5af['field'](_0x5dbf('0xa0'),_0x5dbf('0x1d'));_0x274497[_0x5dbf('0x1b')](_0x14b21b['limit']||_0x310078);_0x274497[_0x5dbf('0x3b')](_0x14b21b[_0x5dbf('0x3b')]||0x0);return dbH[_0x5dbf('0xa1')][_0x5dbf('0x32')](_0x4bc5af[_0x5dbf('0x84')](),{'type':dbH[_0x5dbf('0xa1')]['QueryTypes'][_0x5dbf('0x85')]})['then'](function(_0x6cfb82){if(!_0x6cfb82[_0x5dbf('0x38')]){_0x1bd06b=0x0;}else{_0x1bd06b=_0x6cfb82[0x0][_0x5dbf('0x1d')]||0x0;}return dbH[_0x5dbf('0xa1')][_0x5dbf('0x32')](_0x274497[_0x5dbf('0x84')](),{'type':dbH['sequelize'][_0x5dbf('0xa2')][_0x5dbf('0x85')]});})[_0x5dbf('0x22')](function(_0x4d68f6){return{'rows':_0x4d68f6||[],'count':_0x1bd06b};});}});}exports[_0x5dbf('0xa3')]=function(_0x47ac95,_0x51b241){return runReport(_0x47ac95[_0x5dbf('0x49')],_0x47ac95[_0x5dbf('0x32')],_0x47ac95[_0x5dbf('0x4a')])[_0x5dbf('0x22')](respondWithResult(_0x51b241,null))[_0x5dbf('0x54')](handleError(_0x51b241,null));};exports['runReport']=runReport;exports['query']=function(_0x4f38a0,_0x144300){var _0x1da1e3=0xa;var _0x25e681=[_0x5dbf('0x56'),_0x5dbf('0x57'),_0x5dbf('0x58'),_0x5dbf('0x86')];var _0x236754={'SUM':'SUM(%s)','COUNT':_0x5dbf('0x88'),'COUNT DISTINCT':_0x5dbf('0x89'),'MAX':_0x5dbf('0x59'),'MIN':_0x5dbf('0x8a'),'AVG':_0x5dbf('0x5a'),'GROUP_CONCAT':_0x5dbf('0x5b'),'GROUP_CONCAT ASC':_0x5dbf('0x5c'),'GROUP_CONCAT DESC':_0x5dbf('0x5d')};var _0x191a16={'SEC_TO_TIME':_0x5dbf('0x5e'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x5dbf('0x62')};var _0x51b0df=function(_0x48ea8a){return!_['includes']([_0x5dbf('0x64'),_0x5dbf('0x65'),_0x5dbf('0x8b'),_0x5dbf('0x66')],_0x48ea8a);};var _0x3de263=function(_0x4f8dde){if(!_0x4f8dde||!_0x4f8dde[_0x5dbf('0x67')][_0x5dbf('0x38')]){return'';}for(var _0x19effa='(',_0x29177e=0x0;_0x29177e<_0x4f8dde[_0x5dbf('0x67')]['length'];_0x29177e+=0x1){_0x29177e>0x0&&(_0x19effa+='\x20'+_0x4f8dde[_0x5dbf('0x68')]+'\x20');_0x19effa+=_0x4f8dde[_0x5dbf('0x67')][_0x29177e][_0x5dbf('0x69')]?_0x3de263(_0x4f8dde[_0x5dbf('0x67')][_0x29177e]['group']):_0x4f8dde[_0x5dbf('0x67')][_0x29177e][_0x5dbf('0x6a')]+'\x20'+_0x4f8dde[_0x5dbf('0x67')][_0x29177e][_0x5dbf('0x6b')]+(_0x51b0df(_0x4f8dde[_0x5dbf('0x67')][_0x29177e][_0x5dbf('0x6b')])?'\x20'+_0x4f8dde[_0x5dbf('0x67')][_0x29177e]['value']:'');}return _0x19effa+')';};var _0x4899ac={'where':{'id':_0x4f38a0['params']['id']}},_0x51864c,_0x4562a4,_0x240304,_0x5df275,_0xc588a2;_0x4899ac=_[_0x5dbf('0x41')]({},_0x4899ac,_0x4f38a0['options']);return db[_0x5dbf('0x2e')][_0x5dbf('0x52')](_0x4899ac)[_0x5dbf('0x22')](function(_0x2eafe0){if(_0x2eafe0){_0x51864c=_0x2eafe0;return _0x2eafe0[_0x5dbf('0x6d')]();}return null;})[_0x5dbf('0x22')](function(_0x414859){if(_0x414859){if(!_0x414859['length']){throw new db[(_0x5dbf('0xa4'))][(_0x5dbf('0x8c'))](_0x5dbf('0x6e'),0x193);}_0x4562a4=_0x414859;return db[_0x5dbf('0x6f')][_0x5dbf('0x46')]({'raw':!![]});}return null;})[_0x5dbf('0x22')](function(_0x153401){if(_0x153401){_0x240304=_[_0x5dbf('0x70')](_0x153401,'id');var _0xbe0ca0;var _0x521c72=squel[_0x5dbf('0x71')]();_0x521c72[_0x5dbf('0x72')](_0x51864c[_0x5dbf('0x7f')]);for(var _0x6b4262=0x0;_0x6b4262<_0x4562a4[_0x5dbf('0x38')];_0x6b4262+=0x1){_0xbe0ca0=_0x4562a4[_0x6b4262][_0x5dbf('0x73')]?_0x240304[_0x4562a4[_0x6b4262][_0x5dbf('0x73')]][_0x5dbf('0x8d')]:_0x4562a4[_0x6b4262][_0x5dbf('0x6a')];_0xbe0ca0=_0x4562a4[_0x6b4262][_0x5dbf('0x74')]?_[_0x5dbf('0x75')](_0x236754[_0x4562a4[_0x6b4262][_0x5dbf('0x74')]],'%s',_0xbe0ca0):_0xbe0ca0;_0xbe0ca0=_0x4562a4[_0x6b4262][_0x5dbf('0x76')]?_[_0x5dbf('0x75')](_0x191a16[_0x4562a4[_0x6b4262][_0x5dbf('0x76')]],'%s',_0xbe0ca0):_0xbe0ca0;if(_0x4562a4[_0x6b4262][_0x5dbf('0x77')]){_0x521c72[_0x5dbf('0x69')](_0xbe0ca0);}_0x4562a4[_0x6b4262][_0x5dbf('0x78')]&&_0x521c72[_0x5dbf('0x3c')](_0xbe0ca0,_0x4562a4[_0x6b4262]['orderBy']===_0x5dbf('0x8e')?![]:!![]);_0x521c72['field'](_0xbe0ca0,_0x4562a4[_0x6b4262][_0x5dbf('0x79')]||_0xbe0ca0);}if(_0x51864c['joins']){_0x51864c[_0x5dbf('0x7a')]=JSON['parse'](_0x51864c[_0x5dbf('0x7a')]);for(var _0x417869=0x0;_0x417869<_0x51864c[_0x5dbf('0x7a')]['length'];_0x417869+=0x1){if(_0x51864c[_0x5dbf('0x7a')][_0x417869][_0x5dbf('0x42')]&&_[_0x5dbf('0x63')](_0x25e681,_0x51864c[_0x5dbf('0x7a')][_0x417869][_0x5dbf('0x42')])&&_0x51864c[_0x5dbf('0x7a')][_0x417869][_0x5dbf('0x80')]&&_0x51864c['joins'][_0x417869][_0x5dbf('0x7c')]&&_0x51864c[_0x5dbf('0x7a')][_0x417869]['foreignKey']){_0x521c72[_0x51864c[_0x5dbf('0x7a')][_0x417869]['type']](_0x51864c['joins'][_0x417869][_0x5dbf('0x7c')],null,util[_0x5dbf('0x76')]('%s.%s\x20=\x20%s.%s',_0x51864c[_0x5dbf('0x7f')],_0x51864c['joins'][_0x417869]['parentKey'],_0x51864c[_0x5dbf('0x7a')][_0x417869]['foreignTable'],_0x51864c[_0x5dbf('0x7a')][_0x417869][_0x5dbf('0x7d')]));}}}if(_0x51864c[_0x5dbf('0x81')]){_0x51864c[_0x5dbf('0x81')]=JSON[_0x5dbf('0x7b')](_0x51864c[_0x5dbf('0x81')]);_0x521c72[_0x5dbf('0x3e')](_0x3de263(_0x51864c[_0x5dbf('0x81')][_0x5dbf('0x69')]));}_0xc588a2=_0x521c72[_0x5dbf('0x8f')]();_0x521c72[_0x5dbf('0x1b')](_0x1da1e3);_0x521c72[_0x5dbf('0x3b')](0x0);logger[_0x5dbf('0x82')]('Limited\x20Query:',_0x521c72[_0x5dbf('0x84')]());return dbH[_0x5dbf('0xa1')][_0x5dbf('0x32')](_0x521c72[_0x5dbf('0x84')](),{'type':dbH[_0x5dbf('0xa1')][_0x5dbf('0xa2')]['SELECT']});}})[_0x5dbf('0x22')](function(){return{'sql':_0xc588a2[_0x5dbf('0x84')]()};})[_0x5dbf('0x22')](respondWithResult(_0x144300,null))[_0x5dbf('0x54')](handleError(_0x144300,null));};
\ No newline at end of file
+var _0x7a54=['options','AnalyticDefaultReport','includeAll','include','show','keys','attributes','create','body','user','role','get','Reports','UserProfileSection','userProfileId','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','params','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','group','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','MetricId','metric','field','function','replace','format','orderBy','DESC','joins','parse','type','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','debug','toString','sequelize','QueryTypes','SELECT','join','left_join','COUNT(DISTINCT\x20%s)','MAX(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','operator','groupBy','alias','output','web','fullPath','%s-%s.%s','generate','default','AnalyticExtractedReport','cdr','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','getFields','clone','Limited\x20Query:','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','dbH','sendStatus','status','end','json','limit','count','offset','Content-Range','apply','save','then','destroy','DefaultReports','error','stack','name','index','map','fieldName','model','query','filters','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge'];(function(_0x1c6b61,_0x5d0fe0){var _0xb6c7e2=function(_0xda019f){while(--_0xda019f){_0x1c6b61['push'](_0x1c6b61['shift']());}};_0xb6c7e2(++_0x5d0fe0);}(_0x7a54,0x106));var _0x47a5=function(_0x31464b,_0x1ac4dd){_0x31464b=_0x31464b-0x0;var _0x91a0f9=_0x7a54[_0x31464b];return _0x91a0f9;};'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'];var dbH=require(_0x47a5('0x15'))[_0x47a5('0x16')];function respondWithStatusCode(_0x5beb89,_0x44bd3e){_0x44bd3e=_0x44bd3e||0xcc;return function(_0x221b54){if(_0x221b54){return _0x5beb89[_0x47a5('0x17')](_0x44bd3e);}return _0x5beb89[_0x47a5('0x18')](_0x44bd3e)[_0x47a5('0x19')]();};}function respondWithResult(_0x620ee9,_0x3c6c46){_0x3c6c46=_0x3c6c46||0xc8;return function(_0x190faa){if(_0x190faa){return _0x620ee9['status'](_0x3c6c46)[_0x47a5('0x1a')](_0x190faa);}};}function respondWithFilteredResult(_0x11faf5,_0x3b001e){return function(_0x2a2cbb){if(_0x2a2cbb){var _0x1ef44c=typeof _0x3b001e['offset']==='undefined'&&typeof _0x3b001e[_0x47a5('0x1b')]==='undefined';var _0x5247fd=_0x2a2cbb[_0x47a5('0x1c')];var _0xaf70a6=_0x1ef44c?0x0:_0x3b001e[_0x47a5('0x1d')];var _0x1ef371=_0x1ef44c?_0x2a2cbb[_0x47a5('0x1c')]:_0x3b001e[_0x47a5('0x1d')]+_0x3b001e[_0x47a5('0x1b')];var _0xe3c618;if(_0x1ef371>=_0x5247fd){_0x1ef371=_0x5247fd;_0xe3c618=0xc8;}else{_0xe3c618=0xce;}_0x11faf5[_0x47a5('0x18')](_0xe3c618);return _0x11faf5['set'](_0x47a5('0x1e'),_0xaf70a6+'-'+_0x1ef371+'/'+_0x5247fd)[_0x47a5('0x1a')](_0x2a2cbb);}return null;};}function patchUpdates(_0x47cf3c){return function(_0x2b0360){try{jsonpatch[_0x47a5('0x1f')](_0x2b0360,_0x47cf3c,!![]);}catch(_0x36874d){return BPromise['reject'](_0x36874d);}return _0x2b0360[_0x47a5('0x20')]();};}function saveUpdates(_0x2f142b,_0x23db32){return function(_0x7a9f9e){if(_0x7a9f9e){return _0x7a9f9e['update'](_0x2f142b)[_0x47a5('0x21')](function(_0x385687){return _0x385687;});}return null;};}function removeEntity(_0x513981,_0x28747d){return function(_0xc4cd63){if(_0xc4cd63){return _0xc4cd63[_0x47a5('0x22')]()[_0x47a5('0x21')](function(){var _0x3abd6a=_0xc4cd63['get']({'plain':!![]});var _0x53078a=_0x47a5('0x23');return db['UserProfileResource'][_0x47a5('0x22')]({'where':{'type':_0x53078a,'resourceId':_0x3abd6a['id']}})['then'](function(){return _0xc4cd63;});})[_0x47a5('0x21')](function(){_0x513981[_0x47a5('0x18')](0xcc)[_0x47a5('0x19')]();});}};}function handleEntityNotFound(_0x1dac65,_0x21f296){return function(_0x3ba0b7){if(!_0x3ba0b7){_0x1dac65[_0x47a5('0x17')](0x194);}return _0x3ba0b7;};}function handleError(_0x136b14,_0x16631f){_0x16631f=_0x16631f||0x1f4;return function(_0x361bfa){logger[_0x47a5('0x24')](_0x361bfa[_0x47a5('0x25')]);if(_0x361bfa[_0x47a5('0x26')]){delete _0x361bfa['name'];}_0x136b14[_0x47a5('0x18')](_0x16631f)['send'](_0x361bfa);};}exports[_0x47a5('0x27')]=function(_0x9ac908,_0x16901f){var _0x4d6b57={},_0x256650={},_0x625952={'count':0x0,'rows':[]};var _0x39b50b=_[_0x47a5('0x28')](db['AnalyticDefaultReport']['rawAttributes'],function(_0x6f9a12){return{'name':_0x6f9a12[_0x47a5('0x29')],'type':_0x6f9a12['type']['key']};});_0x256650[_0x47a5('0x2a')]=_[_0x47a5('0x28')](_0x39b50b,'name');_0x256650[_0x47a5('0x2b')]=_['keys'](_0x9ac908[_0x47a5('0x2b')]);_0x256650[_0x47a5('0x2c')]=_['intersection'](_0x256650['model'],_0x256650[_0x47a5('0x2b')]);_0x4d6b57['attributes']=_[_0x47a5('0x2d')](_0x256650[_0x47a5('0x2a')],qs[_0x47a5('0x2e')](_0x9ac908['query'][_0x47a5('0x2e')]));_0x4d6b57['attributes']=_0x4d6b57['attributes'][_0x47a5('0x2f')]?_0x4d6b57['attributes']:_0x256650[_0x47a5('0x2a')];if(!_0x9ac908['query'][_0x47a5('0x30')](_0x47a5('0x31'))){_0x4d6b57[_0x47a5('0x1b')]=qs[_0x47a5('0x1b')](_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x1b')]);_0x4d6b57[_0x47a5('0x1d')]=qs[_0x47a5('0x1d')](_0x9ac908[_0x47a5('0x2b')]['offset']);}_0x4d6b57[_0x47a5('0x32')]=qs[_0x47a5('0x33')](_0x9ac908['query'][_0x47a5('0x33')]);_0x4d6b57[_0x47a5('0x34')]=qs[_0x47a5('0x2c')](_['pick'](_0x9ac908[_0x47a5('0x2b')],_0x256650[_0x47a5('0x2c')]),_0x39b50b);if(_0x9ac908['query'][_0x47a5('0x35')]){_0x4d6b57[_0x47a5('0x34')]=_['merge'](_0x4d6b57['where'],{'$or':_['map'](_0x39b50b,function(_0x12d9f2){if(_0x12d9f2['type']!==_0x47a5('0x36')){var _0x1f9631={};_0x1f9631[_0x12d9f2[_0x47a5('0x26')]]={'$like':'%'+_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x35')]+'%'};return _0x1f9631;}})});}_0x4d6b57=_[_0x47a5('0x37')]({},_0x4d6b57,_0x9ac908[_0x47a5('0x38')]);var _0x1f3d01={'where':_0x4d6b57[_0x47a5('0x34')]};return db[_0x47a5('0x39')][_0x47a5('0x1c')](_0x1f3d01)[_0x47a5('0x21')](function(_0x23d6d8){_0x625952['count']=_0x23d6d8;if(_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x3a')]){_0x4d6b57[_0x47a5('0x3b')]=[{'all':!![]}];}return db[_0x47a5('0x39')]['findAll'](_0x4d6b57);})[_0x47a5('0x21')](function(_0x528ef3){_0x625952['rows']=_0x528ef3;return _0x625952;})['then'](respondWithFilteredResult(_0x16901f,_0x4d6b57))['catch'](handleError(_0x16901f,null));};exports[_0x47a5('0x3c')]=function(_0x5ec4e5,_0x2bb502){var _0x3a740b={'raw':!![],'where':{'id':_0x5ec4e5['params']['id']}},_0x448610={};_0x448610[_0x47a5('0x2a')]=_[_0x47a5('0x3d')](db['AnalyticDefaultReport']['rawAttributes']);_0x448610[_0x47a5('0x2b')]=_['keys'](_0x5ec4e5[_0x47a5('0x2b')]);_0x448610[_0x47a5('0x2c')]=_[_0x47a5('0x2d')](_0x448610[_0x47a5('0x2a')],_0x448610[_0x47a5('0x2b')]);_0x3a740b[_0x47a5('0x3e')]=_[_0x47a5('0x2d')](_0x448610[_0x47a5('0x2a')],qs[_0x47a5('0x2e')](_0x5ec4e5[_0x47a5('0x2b')][_0x47a5('0x2e')]));_0x3a740b[_0x47a5('0x3e')]=_0x3a740b[_0x47a5('0x3e')][_0x47a5('0x2f')]?_0x3a740b[_0x47a5('0x3e')]:_0x448610[_0x47a5('0x2a')];if(_0x5ec4e5['query'][_0x47a5('0x3a')]){_0x3a740b[_0x47a5('0x3b')]=[{'all':!![]}];}_0x3a740b=_['merge']({},_0x3a740b,_0x5ec4e5['options']);return db[_0x47a5('0x39')]['find'](_0x3a740b)[_0x47a5('0x21')](handleEntityNotFound(_0x2bb502,null))[_0x47a5('0x21')](respondWithResult(_0x2bb502,null))['catch'](handleError(_0x2bb502,null));};exports['create']=function(_0x3d85cc,_0x52d409){return db[_0x47a5('0x39')][_0x47a5('0x3f')](_0x3d85cc[_0x47a5('0x40')],{})[_0x47a5('0x21')](function(_0x44fe8a){var _0x26acd2=_0x3d85cc[_0x47a5('0x41')]['get']({'plain':!![]});if(!_0x26acd2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26acd2[_0x47a5('0x42')]===_0x47a5('0x41')){var _0x1163e3=_0x44fe8a[_0x47a5('0x43')]({'plain':!![]});var _0x2c7020=_0x47a5('0x44');return db[_0x47a5('0x45')]['find']({'where':{'name':_0x2c7020,'userProfileId':_0x26acd2[_0x47a5('0x46')]},'raw':!![]})[_0x47a5('0x21')](function(_0x5f6a){if(_0x5f6a&&_0x5f6a['autoAssociation']===0x0){return db[_0x47a5('0x47')]['create']({'name':_0x1163e3[_0x47a5('0x26')],'resourceId':_0x1163e3['id'],'type':_0x47a5('0x23'),'sectionId':_0x5f6a['id']},{})[_0x47a5('0x21')](function(){return _0x44fe8a;});}else{return _0x44fe8a;}})[_0x47a5('0x48')](function(_0x588551){logger[_0x47a5('0x24')](_0x47a5('0x49'),_0x588551);throw _0x588551;});}return _0x44fe8a;})[_0x47a5('0x21')](respondWithResult(_0x52d409,0xc9))[_0x47a5('0x48')](handleError(_0x52d409,null));};exports[_0x47a5('0x4a')]=function(_0x6a53b3,_0x24e9f4){if(_0x6a53b3['body']['id']){delete _0x6a53b3[_0x47a5('0x40')]['id'];}return db[_0x47a5('0x39')][_0x47a5('0x4b')]({'where':{'id':_0x6a53b3[_0x47a5('0x4c')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x24e9f4,null))[_0x47a5('0x21')](saveUpdates(_0x6a53b3['body'],null))[_0x47a5('0x21')](respondWithResult(_0x24e9f4,null))[_0x47a5('0x48')](handleError(_0x24e9f4,null));};exports[_0x47a5('0x22')]=function(_0x53871e,_0x4c5ed){return db[_0x47a5('0x39')][_0x47a5('0x4b')]({'where':{'id':_0x53871e['params']['id']}})['then'](handleEntityNotFound(_0x4c5ed,null))[_0x47a5('0x21')](removeEntity(_0x4c5ed,null))[_0x47a5('0x48')](handleError(_0x4c5ed,null));};exports['preview']=function(_0x4cf792,_0x6d6b2b){var _0x4d6a82=0xa;var _0x16bb8a=['join','left_join',_0x47a5('0x4d'),_0x47a5('0x4e')];var _0x53eedf={'SUM':_0x47a5('0x4f'),'COUNT':_0x47a5('0x50'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':_0x47a5('0x53'),'GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x199621={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':_0x47a5('0x56'),'HOUR':'HOUR(%s)','ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x485e3c=function(_0x470da6){return!_[_0x47a5('0x58')]([_0x47a5('0x59'),_0x47a5('0x5a'),'IS\x20EMPTY',_0x47a5('0x5b')],_0x470da6);};var _0x5d1550=function(_0x5cbe97){if(!_0x5cbe97||!_0x5cbe97['rules']['length']){return'';}for(var _0x212d92='(',_0x6cd4ea=0x0;_0x6cd4ea<_0x5cbe97[_0x47a5('0x5c')]['length'];_0x6cd4ea+=0x1){_0x6cd4ea>0x0&&(_0x212d92+='\x20'+_0x5cbe97['operator']+'\x20');_0x212d92+=_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5d')]?_0x5d1550(_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5d')]):_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea]['field']+'\x20'+_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea]['condition']+(_0x485e3c(_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5e')])?'\x20'+_0x5cbe97['rules'][_0x6cd4ea][_0x47a5('0x5f')]:'');}return _0x212d92+')';};var _0x345104={'where':{'id':_0x4cf792[_0x47a5('0x4c')]['id']}},_0x132854,_0x3e8274,_0x2d6494,_0x215634,_0x35cca8;_0x345104=_['merge']({},_0x345104,_0x4cf792[_0x47a5('0x38')]);return db[_0x47a5('0x39')][_0x47a5('0x4b')](_0x345104)[_0x47a5('0x21')](function(_0x396cb0){if(_0x396cb0){_0x132854=_0x396cb0;return _0x396cb0['getFields']();}return null;})[_0x47a5('0x21')](function(_0xdfcecc){if(_0xdfcecc){if(!_0xdfcecc[_0x47a5('0x2f')]){throw new db[(_0x47a5('0x60'))][(_0x47a5('0x61'))](_0x47a5('0x62'),0x193);}_0x3e8274=_0xdfcecc;return db[_0x47a5('0x63')][_0x47a5('0x64')]({'raw':!![]});}return null;})[_0x47a5('0x21')](function(_0x44cb90){if(_0x44cb90){_0x2d6494=_[_0x47a5('0x65')](_0x44cb90,'id');var _0x44fda9;var _0x3c0006=squel[_0x47a5('0x66')]();_0x3c0006[_0x47a5('0x67')](_0x132854['table']);for(var _0x42dd7d=0x0;_0x42dd7d<_0x3e8274[_0x47a5('0x2f')];_0x42dd7d+=0x1){_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x68')]?_0x2d6494[_0x3e8274[_0x42dd7d]['MetricId']][_0x47a5('0x69')]:_0x3e8274[_0x42dd7d][_0x47a5('0x6a')];_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x6b')]?_[_0x47a5('0x6c')](_0x53eedf[_0x3e8274[_0x42dd7d]['function']],'%s',_0x44fda9):_0x44fda9;_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x6d')]?_['replace'](_0x199621[_0x3e8274[_0x42dd7d][_0x47a5('0x6d')]],'%s',_0x44fda9):_0x44fda9;if(_0x3e8274[_0x42dd7d]['groupBy']){_0x3c0006[_0x47a5('0x5d')](_0x44fda9);}_0x3e8274[_0x42dd7d]['orderBy']&&_0x3c0006[_0x47a5('0x32')](_0x44fda9,_0x3e8274[_0x42dd7d][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x3c0006['field'](_0x44fda9,_0x3e8274[_0x42dd7d]['alias']||_0x44fda9);}if(_0x132854['joins']){_0x132854[_0x47a5('0x70')]=JSON[_0x47a5('0x71')](_0x132854[_0x47a5('0x70')]);for(var _0x117510=0x0;_0x117510<_0x132854['joins'][_0x47a5('0x2f')];_0x117510+=0x1){if(_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x72')]&&_[_0x47a5('0x58')](_0x16bb8a,_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x72')])&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x73')]&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x74')]&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x75')]){_0x3c0006[_0x132854['joins'][_0x117510][_0x47a5('0x72')]](_0x132854['joins'][_0x117510][_0x47a5('0x74')],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x132854[_0x47a5('0x77')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x73')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x74')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x75')]));}}}if(_0x132854[_0x47a5('0x78')]){_0x132854[_0x47a5('0x78')]=JSON[_0x47a5('0x71')](_0x132854[_0x47a5('0x78')]);_0x3c0006[_0x47a5('0x34')](_0x5d1550(_0x132854['conditions']['group']));}_0x35cca8=_0x3c0006['clone']();_0x3c0006['limit'](_0x4d6a82);_0x3c0006[_0x47a5('0x1d')](0x0);logger[_0x47a5('0x79')]('Limited\x20Query:',_0x3c0006[_0x47a5('0x7a')]());return dbH[_0x47a5('0x7b')][_0x47a5('0x2b')](_0x3c0006[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')][_0x47a5('0x7d')]});}})[_0x47a5('0x21')](respondWithResult(_0x6d6b2b,null))[_0x47a5('0x48')](handleError(_0x6d6b2b,null));};function runReport(_0x1ffe3c,_0x24a6c1,_0x5e5f16){var _0x18fa31=_0x24a6c1[_0x47a5('0x26')];var _0x420671=0xa;var _0x4f35ff=[_0x47a5('0x7e'),_0x47a5('0x7f'),_0x47a5('0x4d'),'cross_join'];var _0x19dc8c={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x47a5('0x80'),'MAX':_0x47a5('0x81'),'MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':_0x47a5('0x53'),'GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x592322={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':'DATE(%s)','HOUR':_0x47a5('0x82'),'ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':_0x47a5('0x83')};var _0xb16bdd=function(_0x53ea2b){return!_[_0x47a5('0x58')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x47a5('0x84'),_0x47a5('0x5b')],_0x53ea2b);};var _0x5b91f7=function(_0x1926bd){if(!_0x1926bd||!_0x1926bd[_0x47a5('0x5c')][_0x47a5('0x2f')]){return'';}for(var _0x4c25ec='(',_0x280372=0x0;_0x280372<_0x1926bd['rules'][_0x47a5('0x2f')];_0x280372+=0x1){_0x280372>0x0&&(_0x4c25ec+='\x20'+_0x1926bd[_0x47a5('0x85')]+'\x20');_0x4c25ec+=_0x1926bd[_0x47a5('0x5c')][_0x280372]['group']?_0x5b91f7(_0x1926bd[_0x47a5('0x5c')][_0x280372][_0x47a5('0x5d')]):_0x1926bd[_0x47a5('0x5c')][_0x280372]['field']+'\x20'+_0x1926bd[_0x47a5('0x5c')][_0x280372]['condition']+(_0xb16bdd(_0x1926bd[_0x47a5('0x5c')][_0x280372]['condition'])?'\x20'+_0x1926bd[_0x47a5('0x5c')][_0x280372][_0x47a5('0x5f')]:'');}return _0x4c25ec+')';};var _0x20a742={'where':{'id':_0x1ffe3c['id']}},_0x211fbf,_0x51738b,_0x42fcce,_0x2ae130,_0x23c393;_0x20a742=_[_0x47a5('0x37')]({},_0x20a742,_0x5e5f16);return db[_0x47a5('0x39')]['find'](_0x20a742)['then'](function(_0x569550){if(_0x569550){_0x211fbf=_0x569550;return _0x569550['getFields']();}return null;})[_0x47a5('0x21')](function(_0xa8809a){if(_0xa8809a){if(!_0xa8809a[_0x47a5('0x2f')]){throw new db['Sequelize'][(_0x47a5('0x61'))](_0x47a5('0x62'),0x193);}_0x51738b=_0xa8809a;return db['AnalyticMetric'][_0x47a5('0x64')]({'raw':!![]});}return null;})[_0x47a5('0x21')](function(_0x19acfa){if(_0x19acfa){_0x42fcce=_[_0x47a5('0x65')](_0x19acfa,'id');var _0x58dacd;var _0x4b5353=squel[_0x47a5('0x66')]();_0x4b5353[_0x47a5('0x67')](_0x211fbf['table']);for(var _0x27d422=0x0;_0x27d422<_0x51738b[_0x47a5('0x2f')];_0x27d422+=0x1){_0x58dacd=_0x51738b[_0x27d422]['MetricId']?_0x42fcce[_0x51738b[_0x27d422][_0x47a5('0x68')]][_0x47a5('0x69')]:_0x51738b[_0x27d422][_0x47a5('0x6a')];_0x58dacd=_0x51738b[_0x27d422]['function']?_[_0x47a5('0x6c')](_0x19dc8c[_0x51738b[_0x27d422]['function']],'%s',_0x58dacd):_0x58dacd;_0x58dacd=_0x51738b[_0x27d422][_0x47a5('0x6d')]?_['replace'](_0x592322[_0x51738b[_0x27d422][_0x47a5('0x6d')]],'%s',_0x58dacd):_0x58dacd;if(_0x51738b[_0x27d422][_0x47a5('0x86')]){_0x4b5353['group'](_0x58dacd);}_0x51738b[_0x27d422][_0x47a5('0x6e')]&&_0x4b5353['order'](_0x58dacd,_0x51738b[_0x27d422][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x4b5353[_0x47a5('0x6a')](_0x58dacd,_0x51738b[_0x27d422][_0x47a5('0x87')]||_0x58dacd);}if(_0x211fbf['joins']){_0x211fbf[_0x47a5('0x70')]=JSON['parse'](_0x211fbf['joins']);for(var _0x2bb2df=0x0;_0x2bb2df<_0x211fbf[_0x47a5('0x70')][_0x47a5('0x2f')];_0x2bb2df+=0x1){if(_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')]&&_['includes'](_0x4f35ff,_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')])&&_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x73')]&&_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x74')]&&_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x75')]){_0x4b5353[_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')]](_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x74')],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x211fbf[_0x47a5('0x77')],_0x211fbf[_0x47a5('0x70')][_0x2bb2df]['parentKey'],_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x74')],_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x75')]));}}}if(_0x211fbf[_0x47a5('0x78')]){_0x211fbf[_0x47a5('0x78')]=JSON['parse'](_0x211fbf['conditions']);_0x4b5353[_0x47a5('0x34')](_0x5b91f7(_0x211fbf[_0x47a5('0x78')]['group']));}_0x23c393=_0x4b5353['clone']();_0x4b5353[_0x47a5('0x1b')](_0x420671);_0x4b5353[_0x47a5('0x1d')](0x0);return;}})['then'](function(){if(_0x24a6c1[_0x47a5('0x88')]===_0x47a5('0x89')){return null;}var _0x4c9e6a=_[_0x47a5('0x37')](_0x24a6c1,{'name':_0x24a6c1[_0x47a5('0x8a')]||_0x24a6c1[_0x47a5('0x26')]||_0x211fbf[_0x47a5('0x26')],'basename':_0x18fa31,'savename':util[_0x47a5('0x6d')](_0x47a5('0x8b'),_0x24a6c1['name']||_0x211fbf['name'],require('randomstring')[_0x47a5('0x8c')](0x4),_0x24a6c1[_0x47a5('0x88')]||'csv'),'reportId':_0x211fbf['id'],'reportType':_0x47a5('0x8d')});return db[_0x47a5('0x8e')][_0x47a5('0x3f')](_0x4c9e6a,{'raw':!![]});})[_0x47a5('0x21')](function(_0xcdbfd7){if(_0x211fbf['table']===_0x47a5('0x8f')){_0x23c393['where'](_0x211fbf['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x24a6c1[_0x47a5('0x90')],_0x24a6c1['endDate']);}else{_0x23c393[_0x47a5('0x34')](_0x211fbf[_0x47a5('0x77')]+_0x47a5('0x91'),_0x24a6c1['startDate'],_0x24a6c1[_0x47a5('0x92')]);}if(_0xcdbfd7){logger[_0x47a5('0x93')](_0x47a5('0x94'),_0x23c393[_0x47a5('0x7a')]());require(_0x47a5('0x95'))['fork'](path[_0x47a5('0x7e')](__dirname,_0x47a5('0x96'),_0xcdbfd7['output']),[_0xcdbfd7['id'],_0x23c393[_0x47a5('0x7a')](),path[_0x47a5('0x7e')](__dirname,_0x47a5('0x97'),_0xcdbfd7[_0x47a5('0x98')]),_0x18fa31]);return _0xcdbfd7;}else{var _0x3c117a=squel[_0x47a5('0x66')]();_0x3c117a['from']('('+_0x23c393[_0x47a5('0x7a')]()+')',_0x47a5('0x99'));_0x3c117a['field'](_0x47a5('0x9a'),_0x47a5('0x1c'));_0x23c393[_0x47a5('0x1b')](_0x24a6c1[_0x47a5('0x1b')]||_0x420671);_0x23c393['offset'](_0x24a6c1['offset']||0x0);return dbH['sequelize']['query'](_0x3c117a[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')][_0x47a5('0x7d')]})[_0x47a5('0x21')](function(_0x6bc37b){if(!_0x6bc37b[_0x47a5('0x2f')]){_0x2ae130=0x0;}else{_0x2ae130=_0x6bc37b[0x0][_0x47a5('0x1c')]||0x0;}return dbH['sequelize'][_0x47a5('0x2b')](_0x23c393[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')]['SELECT']});})['then'](function(_0x3770ae){return{'rows':_0x3770ae||[],'count':_0x2ae130};});}});}exports['run']=function(_0x4cb8e4,_0x1b6a5c){return runReport(_0x4cb8e4[_0x47a5('0x4c')],_0x4cb8e4['query'],_0x4cb8e4[_0x47a5('0x38')])[_0x47a5('0x21')](respondWithResult(_0x1b6a5c,null))[_0x47a5('0x48')](handleError(_0x1b6a5c,null));};exports['runReport']=runReport;exports[_0x47a5('0x2b')]=function(_0xee23c7,_0x48a491){var _0x1172fd=0xa;var _0x280b7b=[_0x47a5('0x7e'),_0x47a5('0x7f'),_0x47a5('0x4d'),_0x47a5('0x4e')];var _0x482c87={'SUM':_0x47a5('0x4f'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x47a5('0x80'),'MAX':_0x47a5('0x81'),'MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':_0x47a5('0x9b')};var _0x151540={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':_0x47a5('0x56'),'HOUR':_0x47a5('0x82'),'ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':_0x47a5('0x83')};var _0x1b3e82=function(_0xa2045c){return!_[_0x47a5('0x58')]([_0x47a5('0x59'),'IS\x20NOT\x20NULL',_0x47a5('0x84'),_0x47a5('0x5b')],_0xa2045c);};var _0x591bde=function(_0x55d955){if(!_0x55d955||!_0x55d955[_0x47a5('0x5c')][_0x47a5('0x2f')]){return'';}for(var _0x2ccf21='(',_0x2ff467=0x0;_0x2ff467<_0x55d955['rules'][_0x47a5('0x2f')];_0x2ff467+=0x1){_0x2ff467>0x0&&(_0x2ccf21+='\x20'+_0x55d955[_0x47a5('0x85')]+'\x20');_0x2ccf21+=_0x55d955[_0x47a5('0x5c')][_0x2ff467][_0x47a5('0x5d')]?_0x591bde(_0x55d955[_0x47a5('0x5c')][_0x2ff467][_0x47a5('0x5d')]):_0x55d955[_0x47a5('0x5c')][_0x2ff467]['field']+'\x20'+_0x55d955['rules'][_0x2ff467][_0x47a5('0x5e')]+(_0x1b3e82(_0x55d955['rules'][_0x2ff467][_0x47a5('0x5e')])?'\x20'+_0x55d955['rules'][_0x2ff467][_0x47a5('0x5f')]:'');}return _0x2ccf21+')';};var _0x8b4354={'where':{'id':_0xee23c7[_0x47a5('0x4c')]['id']}},_0x134c1a,_0x2bc7ae,_0x49cb8c,_0x220557,_0x11f07b;_0x8b4354=_['merge']({},_0x8b4354,_0xee23c7['options']);return db[_0x47a5('0x39')][_0x47a5('0x4b')](_0x8b4354)[_0x47a5('0x21')](function(_0xfccf9c){if(_0xfccf9c){_0x134c1a=_0xfccf9c;return _0xfccf9c[_0x47a5('0x9c')]();}return null;})[_0x47a5('0x21')](function(_0x1c0323){if(_0x1c0323){if(!_0x1c0323[_0x47a5('0x2f')]){throw new db['Sequelize'][(_0x47a5('0x61'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2bc7ae=_0x1c0323;return db[_0x47a5('0x63')][_0x47a5('0x64')]({'raw':!![]});}return null;})['then'](function(_0x48d4cf){if(_0x48d4cf){_0x49cb8c=_[_0x47a5('0x65')](_0x48d4cf,'id');var _0x41d2da;var _0x530387=squel[_0x47a5('0x66')]();_0x530387[_0x47a5('0x67')](_0x134c1a[_0x47a5('0x77')]);for(var _0x44567e=0x0;_0x44567e<_0x2bc7ae['length'];_0x44567e+=0x1){_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x68')]?_0x49cb8c[_0x2bc7ae[_0x44567e]['MetricId']]['metric']:_0x2bc7ae[_0x44567e]['field'];_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x6b')]?_['replace'](_0x482c87[_0x2bc7ae[_0x44567e][_0x47a5('0x6b')]],'%s',_0x41d2da):_0x41d2da;_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x6d')]?_[_0x47a5('0x6c')](_0x151540[_0x2bc7ae[_0x44567e][_0x47a5('0x6d')]],'%s',_0x41d2da):_0x41d2da;if(_0x2bc7ae[_0x44567e][_0x47a5('0x86')]){_0x530387[_0x47a5('0x5d')](_0x41d2da);}_0x2bc7ae[_0x44567e][_0x47a5('0x6e')]&&_0x530387[_0x47a5('0x32')](_0x41d2da,_0x2bc7ae[_0x44567e][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x530387[_0x47a5('0x6a')](_0x41d2da,_0x2bc7ae[_0x44567e][_0x47a5('0x87')]||_0x41d2da);}if(_0x134c1a[_0x47a5('0x70')]){_0x134c1a[_0x47a5('0x70')]=JSON[_0x47a5('0x71')](_0x134c1a['joins']);for(var _0xdd95c8=0x0;_0xdd95c8<_0x134c1a[_0x47a5('0x70')][_0x47a5('0x2f')];_0xdd95c8+=0x1){if(_0x134c1a[_0x47a5('0x70')][_0xdd95c8]['type']&&_[_0x47a5('0x58')](_0x280b7b,_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x72')])&&_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x73')]&&_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x74')]&&_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x75')]){_0x530387[_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x72')]](_0x134c1a['joins'][_0xdd95c8]['foreignTable'],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x134c1a[_0x47a5('0x77')],_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x73')],_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x74')],_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x75')]));}}}if(_0x134c1a[_0x47a5('0x78')]){_0x134c1a[_0x47a5('0x78')]=JSON[_0x47a5('0x71')](_0x134c1a['conditions']);_0x530387['where'](_0x591bde(_0x134c1a[_0x47a5('0x78')][_0x47a5('0x5d')]));}_0x11f07b=_0x530387[_0x47a5('0x9d')]();_0x530387[_0x47a5('0x1b')](_0x1172fd);_0x530387[_0x47a5('0x1d')](0x0);logger[_0x47a5('0x79')](_0x47a5('0x9e'),_0x530387[_0x47a5('0x7a')]());return dbH[_0x47a5('0x7b')]['query'](_0x530387['toString'](),{'type':dbH[_0x47a5('0x7b')]['QueryTypes'][_0x47a5('0x7d')]});}})[_0x47a5('0x21')](function(){return{'sql':_0x11f07b[_0x47a5('0x7a')]()};})['then'](respondWithResult(_0x48a491,null))[_0x47a5('0x48')](handleError(_0x48a491,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index ef4d693..60d422f 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 _0xb243=['../../config/logger','bluebird','request-promise','path','../../config/environment','./analyticDefaultReport.attributes','exports','analytics_default_reports','lodash','util'];(function(_0x201304,_0x13e171){var _0x2396d1=function(_0x28f3a5){while(--_0x28f3a5){_0x201304['push'](_0x201304['shift']());}};_0x2396d1(++_0x13e171);}(_0xb243,0x8a));var _0x3b24=function(_0x5bf6c0,_0x5704d7){_0x5bf6c0=_0x5bf6c0-0x0;var _0x112107=_0xb243[_0x5bf6c0];return _0x112107;};'use strict';var _=require(_0x3b24('0x0'));var util=require(_0x3b24('0x1'));var logger=require(_0x3b24('0x2'))('api');var moment=require('moment');var BPromise=require(_0x3b24('0x3'));var rp=require(_0x3b24('0x4'));var fs=require('fs');var path=require(_0x3b24('0x5'));var rimraf=require('rimraf');var config=require(_0x3b24('0x6'));var attributes=require(_0x3b24('0x7'));module[_0x3b24('0x8')]=function(_0x4d3ed0,_0x5ecffe){return _0x4d3ed0['define']('AnalyticDefaultReport',attributes,{'tableName':_0x3b24('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4e78=['../../config/environment','./analyticDefaultReport.attributes','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x3a3005,_0x2c4d53){var _0x8dc531=function(_0x3dd274){while(--_0x3dd274){_0x3a3005['push'](_0x3a3005['shift']());}};_0x8dc531(++_0x2c4d53);}(_0x4e78,0x1cd));var _0x84e7=function(_0xe2c95e,_0x3e6545){_0xe2c95e=_0xe2c95e-0x0;var _0x42ce6f=_0x4e78[_0xe2c95e];return _0x42ce6f;};'use strict';var _=require(_0x84e7('0x0'));var util=require(_0x84e7('0x1'));var logger=require(_0x84e7('0x2'))(_0x84e7('0x3'));var moment=require(_0x84e7('0x4'));var BPromise=require('bluebird');var rp=require(_0x84e7('0x5'));var fs=require('fs');var path=require(_0x84e7('0x6'));var rimraf=require('rimraf');var config=require(_0x84e7('0x7'));var attributes=require(_0x84e7('0x8'));module['exports']=function(_0x487c5a,_0x393f50){return _0x487c5a[_0x84e7('0x9')](_0x84e7('0xa'),attributes,{'tableName':_0x84e7('0xb'),'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 6e4c860..074c0d7 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 _0xb87d=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x3284b8,_0x7058d7){var _0x3221de=function(_0x8e9bd9){while(--_0x8e9bd9){_0x3284b8['push'](_0x3284b8['shift']());}};_0x3221de(++_0x7058d7);}(_0xb87d,0x198));var _0xdb87=function(_0x2cb1d3,_0x4c2e55){_0x2cb1d3=_0x2cb1d3-0x0;var _0x223a9d=_0xb87d[_0x2cb1d3];return _0x223a9d;};'use strict';var _=require(_0xdb87('0x0'));var util=require(_0xdb87('0x1'));var moment=require(_0xdb87('0x2'));var BPromise=require(_0xdb87('0x3'));var rs=require(_0xdb87('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdb87('0x5'))['db'];var utils=require(_0xdb87('0x6'));var logger=require('../../config/logger')(_0xdb87('0x7'));var config=require(_0xdb87('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xdb87('0x9')][_0xdb87('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7f5469,_0x300790,_0x3c2d23){return new BPromise(function(_0x1e81a3,_0x1214e2){return client[_0xdb87('0xb')](_0x7f5469,_0x3c2d23)[_0xdb87('0xc')](function(_0x19a1ee){logger[_0xdb87('0xd')](_0xdb87('0xe'),_0x300790,_0xdb87('0xf'));logger[_0xdb87('0x10')](_0xdb87('0x11'),_0x300790,_0xdb87('0xf'),JSON[_0xdb87('0x12')](_0x19a1ee));if(_0x19a1ee['error']){if(_0x19a1ee[_0xdb87('0x13')][_0xdb87('0x14')]===0x1f4){logger[_0xdb87('0x13')](_0xdb87('0xe'),_0x300790,_0x19a1ee[_0xdb87('0x13')][_0xdb87('0x15')]);return _0x1214e2(_0x19a1ee[_0xdb87('0x13')][_0xdb87('0x15')]);}logger['error'](_0xdb87('0xe'),_0x300790,_0x19a1ee['error'][_0xdb87('0x15')]);return _0x1e81a3(_0x19a1ee[_0xdb87('0x13')][_0xdb87('0x15')]);}else{logger[_0xdb87('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x300790,'request\x20sent');_0x1e81a3(_0x19a1ee[_0xdb87('0x16')][_0xdb87('0x15')]);}})[_0xdb87('0x17')](function(_0x1be16c){logger[_0xdb87('0x13')](_0xdb87('0xe'),_0x300790,_0x1be16c);_0x1214e2(_0x1be16c);});});}
\ No newline at end of file
+var _0x4925=['message','AnalyticDefaultReport,\x20%s,\x20%s','info','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','then','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1db72a,_0x22f6bc){var _0x1c7ee7=function(_0x1b4fe8){while(--_0x1b4fe8){_0x1db72a['push'](_0x1db72a['shift']());}};_0x1c7ee7(++_0x22f6bc);}(_0x4925,0xf4));var _0x5492=function(_0x72a33d,_0x5691da){_0x72a33d=_0x72a33d-0x0;var _0x2621d5=_0x4925[_0x72a33d];return _0x2621d5;};'use strict';var _=require('lodash');var util=require(_0x5492('0x0'));var moment=require(_0x5492('0x1'));var BPromise=require(_0x5492('0x2'));var rs=require(_0x5492('0x3'));var fs=require('fs');var Redis=require(_0x5492('0x4'));var db=require(_0x5492('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5492('0x6'))('rpc');var config=require(_0x5492('0x7'));var jayson=require(_0x5492('0x8'));var client=jayson[_0x5492('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e04c7,_0x5e48f5,_0x77409c){return new BPromise(function(_0xf830d6,_0x3bae30){return client['request'](_0x2e04c7,_0x77409c)[_0x5492('0xa')](function(_0x1b6ff6){logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x5e48f5,_0x5492('0xb'));logger[_0x5492('0xc')](_0x5492('0xd'),_0x5e48f5,'request\x20sent',JSON[_0x5492('0xe')](_0x1b6ff6));if(_0x1b6ff6[_0x5492('0xf')]){if(_0x1b6ff6[_0x5492('0xf')]['code']===0x1f4){logger[_0x5492('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x5e48f5,_0x1b6ff6[_0x5492('0xf')][_0x5492('0x10')]);return _0x3bae30(_0x1b6ff6[_0x5492('0xf')][_0x5492('0x10')]);}logger[_0x5492('0xf')](_0x5492('0x11'),_0x5e48f5,_0x1b6ff6[_0x5492('0xf')][_0x5492('0x10')]);return _0xf830d6(_0x1b6ff6[_0x5492('0xf')][_0x5492('0x10')]);}else{logger[_0x5492('0x12')](_0x5492('0x11'),_0x5e48f5,_0x5492('0xb'));_0xf830d6(_0x1b6ff6['result'][_0x5492('0x10')]);}})[_0x5492('0x13')](function(_0x42ee36){logger[_0x5492('0xf')](_0x5492('0x11'),_0x5e48f5,_0x42ee36);_0x3bae30(_0x42ee36);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 6d364d7..c31320e 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 _0x6f7f=['path','connect-timeout','Router','fs-extra','../../components/interaction/service','./analyticDefaultReport.controller','get','/:id','isAuthenticated','show','preview','/:id/run','run','/:id/query','post','create','put','update','delete','destroy','multer','util'];(function(_0x4da21e,_0x302796){var _0x35d4cd=function(_0x14227e){while(--_0x14227e){_0x4da21e['push'](_0x4da21e['shift']());}};_0x35d4cd(++_0x302796);}(_0x6f7f,0x106));var _0xf6f7=function(_0x1be9d1,_0x1a1603){_0x1be9d1=_0x1be9d1-0x0;var _0x48629d=_0x6f7f[_0x1be9d1];return _0x48629d;};'use strict';var multer=require(_0xf6f7('0x0'));var util=require(_0xf6f7('0x1'));var path=require(_0xf6f7('0x2'));var timeout=require(_0xf6f7('0x3'));var express=require('express');var router=express[_0xf6f7('0x4')]();var fs_extra=require(_0xf6f7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf6f7('0x6'));var config=require('../../config/environment');var controller=require(_0xf6f7('0x7'));router[_0xf6f7('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf6f7('0x8')](_0xf6f7('0x9'),auth[_0xf6f7('0xa')](),controller[_0xf6f7('0xb')]);router['get']('/:id/preview',auth['isAuthenticated'](),controller[_0xf6f7('0xc')]);router[_0xf6f7('0x8')](_0xf6f7('0xd'),auth[_0xf6f7('0xa')](),controller[_0xf6f7('0xe')]);router[_0xf6f7('0x8')](_0xf6f7('0xf'),auth[_0xf6f7('0xa')](),controller['query']);router[_0xf6f7('0x10')]('/',auth[_0xf6f7('0xa')](),controller[_0xf6f7('0x11')]);router[_0xf6f7('0x12')](_0xf6f7('0x9'),auth[_0xf6f7('0xa')](),controller[_0xf6f7('0x13')]);router[_0xf6f7('0x14')](_0xf6f7('0x9'),auth[_0xf6f7('0xa')](),controller[_0xf6f7('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x788c=['index','get','/:id','isAuthenticated','show','/:id/run','run','/:id/query','post','create','put','update','delete','destroy','exports','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x788c,0xf6));var _0xc788=function(_0x20621d,_0x2bbc22){_0x20621d=_0x20621d-0x0;var _0x5b6dbd=_0x788c[_0x20621d];return _0x5b6dbd;};'use strict';var multer=require('multer');var util=require(_0xc788('0x0'));var path=require('path');var timeout=require(_0xc788('0x1'));var express=require('express');var router=express[_0xc788('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc788('0x3'));var config=require(_0xc788('0x4'));var controller=require(_0xc788('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xc788('0x6')]);router[_0xc788('0x7')](_0xc788('0x8'),auth[_0xc788('0x9')](),controller[_0xc788('0xa')]);router[_0xc788('0x7')]('/:id/preview',auth[_0xc788('0x9')](),controller['preview']);router[_0xc788('0x7')](_0xc788('0xb'),auth[_0xc788('0x9')](),controller[_0xc788('0xc')]);router[_0xc788('0x7')](_0xc788('0xd'),auth[_0xc788('0x9')](),controller['query']);router[_0xc788('0xe')]('/',auth[_0xc788('0x9')](),controller[_0xc788('0xf')]);router[_0xc788('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xc788('0x11')]);router[_0xc788('0x12')]('/:id',auth[_0xc788('0x9')](),controller[_0xc788('0x13')]);module[_0xc788('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index c0cb115..1b80794 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 _0x1639=['DATE','Loading','manual','scheduled','INTEGER','sequelize','exports','STRING','ENUM','csv','pdf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1639,0xaa));var _0x9163=function(_0x598b67,_0x478935){_0x598b67=_0x598b67-0x0;var _0x5ebe2e=_0x1639[_0x598b67];return _0x5ebe2e;};'use strict';var Sequelize=require(_0x9163('0x0'));var moment=require('moment');module[_0x9163('0x1')]={'name':{'type':Sequelize[_0x9163('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x9163('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x9163('0x3')](_0x9163('0x4'),_0x9163('0x5'),'xlsx'),'allowNull':![],'defaultValue':_0x9163('0x4')},'savename':{'type':Sequelize[_0x9163('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x9163('0x6')]},'endDate':{'type':Sequelize[_0x9163('0x6')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x9163('0x7')},'type':{'type':Sequelize['ENUM'](_0x9163('0x8'),_0x9163('0x9')),'allowNull':![],'defaultValue':_0x9163('0x8')},'reportId':{'type':Sequelize[_0x9163('0xa')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x9163('0x2')]}};
\ No newline at end of file
+var _0xce1e=['xlsx','DATE','manual','scheduled','INTEGER','UNSIGNED','sequelize','moment','STRING','ENUM','csv','pdf'];(function(_0x27fa03,_0x38a271){var _0x5c9f39=function(_0x4fb9ae){while(--_0x4fb9ae){_0x27fa03['push'](_0x27fa03['shift']());}};_0x5c9f39(++_0x38a271);}(_0xce1e,0x1aa));var _0xece1=function(_0x267c09,_0x33be6d){_0x267c09=_0x267c09-0x0;var _0x502b9e=_0xce1e[_0x267c09];return _0x502b9e;};'use strict';var Sequelize=require(_0xece1('0x0'));var moment=require(_0xece1('0x1'));module['exports']={'name':{'type':Sequelize[_0xece1('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xece1('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xece1('0x3')](_0xece1('0x4'),_0xece1('0x5'),_0xece1('0x6')),'allowNull':![],'defaultValue':_0xece1('0x4')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0xece1('0x7')]},'endDate':{'type':Sequelize[_0xece1('0x7')]},'status':{'type':Sequelize[_0xece1('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0xece1('0x3')](_0xece1('0x8'),_0xece1('0x9')),'allowNull':![],'defaultValue':_0xece1('0x8')},'reportId':{'type':Sequelize[_0xece1('0xa')](0xb)[_0xece1('0xb')]},'reportType':{'type':Sequelize[_0xece1('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 7a67012..718650d 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 _0xd6c2=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','ExtractedReports','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','AnalyticExtractedReport','includeAll','include','rows','show','params','keys','find','catch','create','body','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','output','existsSync','join','server/files/reports','Sequelize','ValidationError','exists','root','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x4c4920,_0x276b99){var _0x53d293=function(_0x29b8ec){while(--_0x29b8ec){_0x4c4920['push'](_0x4c4920['shift']());}};_0x53d293(++_0x276b99);}(_0xd6c2,0xc2));var _0x2d6c=function(_0x545af4,_0x1e9a7e){_0x545af4=_0x545af4-0x0;var _0x1768d4=_0xd6c2[_0x545af4];return _0x1768d4;};'use strict';var emlformat=require(_0x2d6c('0x0'));var rimraf=require(_0x2d6c('0x1'));var zipdir=require(_0x2d6c('0x2'));var jsonpatch=require(_0x2d6c('0x3'));var rp=require(_0x2d6c('0x4'));var moment=require(_0x2d6c('0x5'));var BPromise=require(_0x2d6c('0x6'));var Mustache=require(_0x2d6c('0x7'));var util=require(_0x2d6c('0x8'));var path=require(_0x2d6c('0x9'));var sox=require(_0x2d6c('0xa'));var csv=require(_0x2d6c('0xb'));var ejs=require(_0x2d6c('0xc'));var fs=require('fs');var fs_extra=require(_0x2d6c('0xd'));var _=require(_0x2d6c('0xe'));var squel=require(_0x2d6c('0xf'));var crypto=require(_0x2d6c('0x10'));var jsforce=require('jsforce');var deskjs=require(_0x2d6c('0x11'));var toCsv=require(_0x2d6c('0xb'));var querystring=require(_0x2d6c('0x12'));var Papa=require(_0x2d6c('0x13'));var Redis=require(_0x2d6c('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x2d6c('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2d6c('0x16'))(_0x2d6c('0x17'));var utils=require(_0x2d6c('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x2d6c('0x19'));var db=require(_0x2d6c('0x1a'))['db'];function respondWithStatusCode(_0xea4b70,_0x475523){_0x475523=_0x475523||0xcc;return function(_0x4740c0){if(_0x4740c0){return _0xea4b70[_0x2d6c('0x1b')](_0x475523);}return _0xea4b70[_0x2d6c('0x1c')](_0x475523)[_0x2d6c('0x1d')]();};}function respondWithResult(_0x1feb9f,_0x559f44){_0x559f44=_0x559f44||0xc8;return function(_0x4208fe){if(_0x4208fe){return _0x1feb9f[_0x2d6c('0x1c')](_0x559f44)['json'](_0x4208fe);}};}function respondWithFilteredResult(_0x3b869f,_0x42faae){return function(_0x4456f2){if(_0x4456f2){var _0x86d15=typeof _0x42faae[_0x2d6c('0x1e')]===_0x2d6c('0x1f')&&typeof _0x42faae[_0x2d6c('0x20')]===_0x2d6c('0x1f');var _0x2dc303=_0x4456f2[_0x2d6c('0x21')];var _0x2c06ef=_0x86d15?0x0:_0x42faae[_0x2d6c('0x1e')];var _0x4f897f=_0x86d15?_0x4456f2[_0x2d6c('0x21')]:_0x42faae[_0x2d6c('0x1e')]+_0x42faae[_0x2d6c('0x20')];var _0x5cbd47;if(_0x4f897f>=_0x2dc303){_0x4f897f=_0x2dc303;_0x5cbd47=0xc8;}else{_0x5cbd47=0xce;}_0x3b869f['status'](_0x5cbd47);return _0x3b869f[_0x2d6c('0x22')](_0x2d6c('0x23'),_0x2c06ef+'-'+_0x4f897f+'/'+_0x2dc303)['json'](_0x4456f2);}return null;};}function patchUpdates(_0x1c1d07){return function(_0x4e2ee0){try{jsonpatch[_0x2d6c('0x24')](_0x4e2ee0,_0x1c1d07,!![]);}catch(_0x1ca2bd){return BPromise[_0x2d6c('0x25')](_0x1ca2bd);}return _0x4e2ee0['save']();};}function saveUpdates(_0x18f60,_0x89e215){return function(_0x42f4af){if(_0x42f4af){return _0x42f4af[_0x2d6c('0x26')](_0x18f60)[_0x2d6c('0x27')](function(_0x45b774){return _0x45b774;});}return null;};}function removeEntity(_0x1b6098,_0x52ec34){return function(_0x30fbd1){if(_0x30fbd1){return _0x30fbd1[_0x2d6c('0x28')]()[_0x2d6c('0x27')](function(){var _0x427a8d=_0x30fbd1[_0x2d6c('0x29')]({'plain':!![]});var _0x371e98=_0x2d6c('0x2a');return db['UserProfileResource'][_0x2d6c('0x28')]({'where':{'type':_0x371e98,'resourceId':_0x427a8d['id']}})['then'](function(){return _0x30fbd1;});})['then'](function(){_0x1b6098[_0x2d6c('0x1c')](0xcc)[_0x2d6c('0x1d')]();});}};}function handleEntityNotFound(_0x10cd08,_0x292122){return function(_0x291813){if(!_0x291813){_0x10cd08[_0x2d6c('0x1b')](0x194);}return _0x291813;};}function handleError(_0x4a0f0e,_0x210175){_0x210175=_0x210175||0x1f4;return function(_0x119a3a){logger[_0x2d6c('0x2b')](_0x119a3a[_0x2d6c('0x2c')]);if(_0x119a3a['name']){delete _0x119a3a[_0x2d6c('0x2d')];}_0x4a0f0e['status'](_0x210175)[_0x2d6c('0x2e')](_0x119a3a);};}exports[_0x2d6c('0x2f')]=function(_0x167026,_0x5c6612){var _0x407ed1={},_0x57d102={},_0x2b4dad={'count':0x0,'rows':[]};var _0x17addd=_[_0x2d6c('0x30')](db['AnalyticExtractedReport'][_0x2d6c('0x31')],function(_0x8f49f8){return{'name':_0x8f49f8[_0x2d6c('0x32')],'type':_0x8f49f8['type'][_0x2d6c('0x33')]};});_0x57d102[_0x2d6c('0x34')]=_[_0x2d6c('0x30')](_0x17addd,_0x2d6c('0x2d'));_0x57d102[_0x2d6c('0x35')]=_['keys'](_0x167026[_0x2d6c('0x35')]);_0x57d102[_0x2d6c('0x36')]=_[_0x2d6c('0x37')](_0x57d102[_0x2d6c('0x34')],_0x57d102['query']);_0x407ed1[_0x2d6c('0x38')]=_['intersection'](_0x57d102['model'],qs['fields'](_0x167026[_0x2d6c('0x35')][_0x2d6c('0x39')]));_0x407ed1['attributes']=_0x407ed1[_0x2d6c('0x38')][_0x2d6c('0x3a')]?_0x407ed1[_0x2d6c('0x38')]:_0x57d102[_0x2d6c('0x34')];if(!_0x167026[_0x2d6c('0x35')][_0x2d6c('0x3b')](_0x2d6c('0x3c'))){_0x407ed1[_0x2d6c('0x20')]=qs['limit'](_0x167026[_0x2d6c('0x35')][_0x2d6c('0x20')]);_0x407ed1[_0x2d6c('0x1e')]=qs[_0x2d6c('0x1e')](_0x167026['query'][_0x2d6c('0x1e')]);}_0x407ed1['order']=qs[_0x2d6c('0x3d')](_0x167026[_0x2d6c('0x35')][_0x2d6c('0x3d')]);_0x407ed1[_0x2d6c('0x3e')]=qs[_0x2d6c('0x36')](_[_0x2d6c('0x3f')](_0x167026[_0x2d6c('0x35')],_0x57d102['filters']),_0x17addd);if(_0x167026[_0x2d6c('0x35')]['filter']){_0x407ed1[_0x2d6c('0x3e')]=_[_0x2d6c('0x40')](_0x407ed1[_0x2d6c('0x3e')],{'$or':_[_0x2d6c('0x30')](_0x17addd,function(_0xe1e3c9){if(_0xe1e3c9[_0x2d6c('0x41')]!==_0x2d6c('0x42')){var _0x326936={};_0x326936[_0xe1e3c9['name']]={'$like':'%'+_0x167026[_0x2d6c('0x35')][_0x2d6c('0x43')]+'%'};return _0x326936;}})});}_0x407ed1=_[_0x2d6c('0x40')]({},_0x407ed1,_0x167026[_0x2d6c('0x44')]);var _0x2a169a={'where':_0x407ed1['where']};return db[_0x2d6c('0x45')][_0x2d6c('0x21')](_0x2a169a)[_0x2d6c('0x27')](function(_0xa1126d){_0x2b4dad[_0x2d6c('0x21')]=_0xa1126d;if(_0x167026['query'][_0x2d6c('0x46')]){_0x407ed1[_0x2d6c('0x47')]=[{'all':!![]}];}return db[_0x2d6c('0x45')]['findAll'](_0x407ed1);})['then'](function(_0x29f059){_0x2b4dad[_0x2d6c('0x48')]=_0x29f059;return _0x2b4dad;})[_0x2d6c('0x27')](respondWithFilteredResult(_0x5c6612,_0x407ed1))['catch'](handleError(_0x5c6612,null));};exports[_0x2d6c('0x49')]=function(_0x381583,_0x192ed2){var _0x5f3597={'raw':!![],'where':{'id':_0x381583[_0x2d6c('0x4a')]['id']}},_0x79ce11={};_0x79ce11[_0x2d6c('0x34')]=_[_0x2d6c('0x4b')](db['AnalyticExtractedReport'][_0x2d6c('0x31')]);_0x79ce11[_0x2d6c('0x35')]=_[_0x2d6c('0x4b')](_0x381583[_0x2d6c('0x35')]);_0x79ce11[_0x2d6c('0x36')]=_['intersection'](_0x79ce11[_0x2d6c('0x34')],_0x79ce11['query']);_0x5f3597['attributes']=_[_0x2d6c('0x37')](_0x79ce11['model'],qs['fields'](_0x381583[_0x2d6c('0x35')][_0x2d6c('0x39')]));_0x5f3597['attributes']=_0x5f3597['attributes'][_0x2d6c('0x3a')]?_0x5f3597[_0x2d6c('0x38')]:_0x79ce11['model'];if(_0x381583[_0x2d6c('0x35')][_0x2d6c('0x46')]){_0x5f3597[_0x2d6c('0x47')]=[{'all':!![]}];}_0x5f3597=_['merge']({},_0x5f3597,_0x381583[_0x2d6c('0x44')]);return db['AnalyticExtractedReport'][_0x2d6c('0x4c')](_0x5f3597)[_0x2d6c('0x27')](handleEntityNotFound(_0x192ed2,null))['then'](respondWithResult(_0x192ed2,null))[_0x2d6c('0x4d')](handleError(_0x192ed2,null));};exports[_0x2d6c('0x4e')]=function(_0x42e8bc,_0x172f3f){return db['AnalyticExtractedReport'][_0x2d6c('0x4e')](_0x42e8bc[_0x2d6c('0x4f')],{})[_0x2d6c('0x27')](function(_0x574e8f){var _0x51c543=_0x42e8bc['user'][_0x2d6c('0x29')]({'plain':!![]});if(!_0x51c543)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x51c543['role']==='user'){var _0x32fd2a=_0x574e8f[_0x2d6c('0x29')]({'plain':!![]});var _0x33edbe=_0x2d6c('0x2a');return db[_0x2d6c('0x50')][_0x2d6c('0x4c')]({'where':{'name':_0x33edbe,'userProfileId':_0x51c543[_0x2d6c('0x51')]},'raw':!![]})[_0x2d6c('0x27')](function(_0x1a4716){if(_0x1a4716&&_0x1a4716[_0x2d6c('0x52')]===0x0){return db[_0x2d6c('0x53')][_0x2d6c('0x4e')]({'name':_0x32fd2a[_0x2d6c('0x2d')],'resourceId':_0x32fd2a['id'],'type':_0x1a4716[_0x2d6c('0x2d')],'sectionId':_0x1a4716['id']},{})[_0x2d6c('0x27')](function(){return _0x574e8f;});}else{return _0x574e8f;}})[_0x2d6c('0x4d')](function(_0x40caf0){logger[_0x2d6c('0x2b')](_0x2d6c('0x54'),_0x40caf0);throw _0x40caf0;});}return _0x574e8f;})['then'](respondWithResult(_0x172f3f,0xc9))[_0x2d6c('0x4d')](handleError(_0x172f3f,null));};exports['update']=function(_0x4631c1,_0x4cc862){if(_0x4631c1['body']['id']){delete _0x4631c1['body']['id'];}return db[_0x2d6c('0x45')][_0x2d6c('0x4c')]({'where':{'id':_0x4631c1['params']['id']}})['then'](handleEntityNotFound(_0x4cc862,null))[_0x2d6c('0x27')](saveUpdates(_0x4631c1[_0x2d6c('0x4f')],null))[_0x2d6c('0x27')](respondWithResult(_0x4cc862,null))[_0x2d6c('0x4d')](handleError(_0x4cc862,null));};exports[_0x2d6c('0x28')]=function(_0x1c11e2,_0x518621){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x1c11e2[_0x2d6c('0x4a')]['id']}})['then'](handleEntityNotFound(_0x518621,null))['then'](removeEntity(_0x518621,null))[_0x2d6c('0x4d')](handleError(_0x518621,null));};exports[_0x2d6c('0x55')]=function(_0x5ca7b0,_0x41d3a4,_0x59be14){return db[_0x2d6c('0x45')][_0x2d6c('0x4c')]({'where':{'id':_0x5ca7b0[_0x2d6c('0x4a')]['id']},'attributes':['name',_0x2d6c('0x56'),_0x2d6c('0x57'),_0x2d6c('0x58')],'raw':!![]})[_0x2d6c('0x27')](handleEntityNotFound(_0x41d3a4,null))[_0x2d6c('0x27')](function(_0x3f6a0b){if(_0x3f6a0b){if(!fs[_0x2d6c('0x59')](path[_0x2d6c('0x5a')](config['root'],_0x2d6c('0x5b'),_0x3f6a0b['savename']))){throw new db[(_0x2d6c('0x5c'))][(_0x2d6c('0x5d'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x5ca7b0[_0x2d6c('0x35')][_0x2d6c('0x5e')]){return _0x41d3a4[_0x2d6c('0x1b')](0xc8);}return _0x41d3a4[_0x2d6c('0x55')](path['join'](config[_0x2d6c('0x5f')],_0x2d6c('0x5b'),_0x3f6a0b['savename']),util[_0x2d6c('0x60')](_0x2d6c('0x61'),_0x3f6a0b[_0x2d6c('0x56')]||_0x3f6a0b[_0x2d6c('0x2d')],_0x3f6a0b['output'][_0x2d6c('0x62')]()));}})[_0x2d6c('0x4d')](handleError(_0x41d3a4,null));};
\ No newline at end of file
+var _0x2f3b=['lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','save','update','destroy','then','get','ExtractedReports','UserProfileResource','end','error','stack','name','index','map','AnalyticExtractedReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','user','role','UserProfileSection','autoAssociation','savename','output','join','root','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','format','basename','toLowerCase','rimraf','fast-json-patch','request-promise','mustache','util','path','ejs'];(function(_0x7c0646,_0x45d16b){var _0x32416d=function(_0x22abdd){while(--_0x22abdd){_0x7c0646['push'](_0x7c0646['shift']());}};_0x32416d(++_0x45d16b);}(_0x2f3b,0x14d));var _0xb2f3=function(_0x4293e5,_0x2e380a){_0x4293e5=_0x4293e5-0x0;var _0x46cdad=_0x2f3b[_0x4293e5];return _0x46cdad;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb2f3('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb2f3('0x1'));var rp=require(_0xb2f3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb2f3('0x3'));var util=require(_0xb2f3('0x4'));var path=require(_0xb2f3('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb2f3('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb2f3('0x7'));var squel=require(_0xb2f3('0x8'));var crypto=require(_0xb2f3('0x9'));var jsforce=require(_0xb2f3('0xa'));var deskjs=require(_0xb2f3('0xb'));var toCsv=require('to-csv');var querystring=require(_0xb2f3('0xc'));var Papa=require('papaparse');var Redis=require(_0xb2f3('0xd'));var authService=require(_0xb2f3('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xb2f3('0xf'));var hardwareService=require(_0xb2f3('0x10'));var logger=require(_0xb2f3('0x11'))(_0xb2f3('0x12'));var utils=require(_0xb2f3('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb2f3('0x14'))['db'];function respondWithStatusCode(_0x4694b9,_0x571a7a){_0x571a7a=_0x571a7a||0xcc;return function(_0x509055){if(_0x509055){return _0x4694b9[_0xb2f3('0x15')](_0x571a7a);}return _0x4694b9[_0xb2f3('0x16')](_0x571a7a)['end']();};}function respondWithResult(_0x3336c5,_0x4f5f27){_0x4f5f27=_0x4f5f27||0xc8;return function(_0x6fc8c){if(_0x6fc8c){return _0x3336c5[_0xb2f3('0x16')](_0x4f5f27)['json'](_0x6fc8c);}};}function respondWithFilteredResult(_0x26d444,_0x2bab57){return function(_0x42ed88){if(_0x42ed88){var _0x191bdc=typeof _0x2bab57[_0xb2f3('0x17')]===_0xb2f3('0x18')&&typeof _0x2bab57[_0xb2f3('0x19')]===_0xb2f3('0x18');var _0x3cc169=_0x42ed88[_0xb2f3('0x1a')];var _0x3e6263=_0x191bdc?0x0:_0x2bab57[_0xb2f3('0x17')];var _0x5a0b4e=_0x191bdc?_0x42ed88[_0xb2f3('0x1a')]:_0x2bab57[_0xb2f3('0x17')]+_0x2bab57[_0xb2f3('0x19')];var _0x2b0927;if(_0x5a0b4e>=_0x3cc169){_0x5a0b4e=_0x3cc169;_0x2b0927=0xc8;}else{_0x2b0927=0xce;}_0x26d444[_0xb2f3('0x16')](_0x2b0927);return _0x26d444[_0xb2f3('0x1b')](_0xb2f3('0x1c'),_0x3e6263+'-'+_0x5a0b4e+'/'+_0x3cc169)['json'](_0x42ed88);}return null;};}function patchUpdates(_0x553e20){return function(_0x16ac1b){try{jsonpatch['apply'](_0x16ac1b,_0x553e20,!![]);}catch(_0x155be3){return BPromise['reject'](_0x155be3);}return _0x16ac1b[_0xb2f3('0x1d')]();};}function saveUpdates(_0x3c3e02,_0x4c7657){return function(_0x200a04){if(_0x200a04){return _0x200a04[_0xb2f3('0x1e')](_0x3c3e02)['then'](function(_0x116ce6){return _0x116ce6;});}return null;};}function removeEntity(_0x2e30ce,_0x3096ee){return function(_0x145634){if(_0x145634){return _0x145634[_0xb2f3('0x1f')]()[_0xb2f3('0x20')](function(){var _0x56abc9=_0x145634[_0xb2f3('0x21')]({'plain':!![]});var _0x38ec4e=_0xb2f3('0x22');return db[_0xb2f3('0x23')][_0xb2f3('0x1f')]({'where':{'type':_0x38ec4e,'resourceId':_0x56abc9['id']}})['then'](function(){return _0x145634;});})['then'](function(){_0x2e30ce[_0xb2f3('0x16')](0xcc)[_0xb2f3('0x24')]();});}};}function handleEntityNotFound(_0x23a5f8,_0xe7414d){return function(_0x586d3b){if(!_0x586d3b){_0x23a5f8[_0xb2f3('0x15')](0x194);}return _0x586d3b;};}function handleError(_0x34611d,_0xd9b1ab){_0xd9b1ab=_0xd9b1ab||0x1f4;return function(_0x3a45c2){logger[_0xb2f3('0x25')](_0x3a45c2[_0xb2f3('0x26')]);if(_0x3a45c2[_0xb2f3('0x27')]){delete _0x3a45c2[_0xb2f3('0x27')];}_0x34611d[_0xb2f3('0x16')](_0xd9b1ab)['send'](_0x3a45c2);};}exports[_0xb2f3('0x28')]=function(_0x3aeff0,_0x4cfb66){var _0x34a517={},_0x1283bc={},_0x4e863d={'count':0x0,'rows':[]};var _0x48e9fc=_[_0xb2f3('0x29')](db[_0xb2f3('0x2a')][_0xb2f3('0x2b')],function(_0x5e6fa7){return{'name':_0x5e6fa7[_0xb2f3('0x2c')],'type':_0x5e6fa7['type'][_0xb2f3('0x2d')]};});_0x1283bc[_0xb2f3('0x2e')]=_[_0xb2f3('0x29')](_0x48e9fc,'name');_0x1283bc[_0xb2f3('0x2f')]=_[_0xb2f3('0x30')](_0x3aeff0[_0xb2f3('0x2f')]);_0x1283bc[_0xb2f3('0x31')]=_[_0xb2f3('0x32')](_0x1283bc['model'],_0x1283bc[_0xb2f3('0x2f')]);_0x34a517[_0xb2f3('0x33')]=_[_0xb2f3('0x32')](_0x1283bc[_0xb2f3('0x2e')],qs[_0xb2f3('0x34')](_0x3aeff0['query'][_0xb2f3('0x34')]));_0x34a517[_0xb2f3('0x33')]=_0x34a517[_0xb2f3('0x33')][_0xb2f3('0x35')]?_0x34a517[_0xb2f3('0x33')]:_0x1283bc[_0xb2f3('0x2e')];if(!_0x3aeff0['query'][_0xb2f3('0x36')]('nolimit')){_0x34a517['limit']=qs[_0xb2f3('0x19')](_0x3aeff0['query'][_0xb2f3('0x19')]);_0x34a517[_0xb2f3('0x17')]=qs[_0xb2f3('0x17')](_0x3aeff0[_0xb2f3('0x2f')][_0xb2f3('0x17')]);}_0x34a517['order']=qs[_0xb2f3('0x37')](_0x3aeff0['query']['sort']);_0x34a517[_0xb2f3('0x38')]=qs[_0xb2f3('0x31')](_['pick'](_0x3aeff0[_0xb2f3('0x2f')],_0x1283bc[_0xb2f3('0x31')]),_0x48e9fc);if(_0x3aeff0[_0xb2f3('0x2f')][_0xb2f3('0x39')]){_0x34a517[_0xb2f3('0x38')]=_[_0xb2f3('0x3a')](_0x34a517['where'],{'$or':_[_0xb2f3('0x29')](_0x48e9fc,function(_0x85ff37){if(_0x85ff37['type']!==_0xb2f3('0x3b')){var _0x28415c={};_0x28415c[_0x85ff37[_0xb2f3('0x27')]]={'$like':'%'+_0x3aeff0[_0xb2f3('0x2f')][_0xb2f3('0x39')]+'%'};return _0x28415c;}})});}_0x34a517=_[_0xb2f3('0x3a')]({},_0x34a517,_0x3aeff0[_0xb2f3('0x3c')]);var _0x573452={'where':_0x34a517[_0xb2f3('0x38')]};return db['AnalyticExtractedReport'][_0xb2f3('0x1a')](_0x573452)['then'](function(_0x35c284){_0x4e863d[_0xb2f3('0x1a')]=_0x35c284;if(_0x3aeff0[_0xb2f3('0x2f')][_0xb2f3('0x3d')]){_0x34a517[_0xb2f3('0x3e')]=[{'all':!![]}];}return db[_0xb2f3('0x2a')]['findAll'](_0x34a517);})['then'](function(_0x2d8c69){_0x4e863d['rows']=_0x2d8c69;return _0x4e863d;})[_0xb2f3('0x20')](respondWithFilteredResult(_0x4cfb66,_0x34a517))[_0xb2f3('0x3f')](handleError(_0x4cfb66,null));};exports[_0xb2f3('0x40')]=function(_0x19dfbc,_0x3444b9){var _0x4f5256={'raw':!![],'where':{'id':_0x19dfbc[_0xb2f3('0x41')]['id']}},_0x3040ea={};_0x3040ea[_0xb2f3('0x2e')]=_[_0xb2f3('0x30')](db[_0xb2f3('0x2a')][_0xb2f3('0x2b')]);_0x3040ea[_0xb2f3('0x2f')]=_[_0xb2f3('0x30')](_0x19dfbc[_0xb2f3('0x2f')]);_0x3040ea['filters']=_[_0xb2f3('0x32')](_0x3040ea[_0xb2f3('0x2e')],_0x3040ea[_0xb2f3('0x2f')]);_0x4f5256[_0xb2f3('0x33')]=_[_0xb2f3('0x32')](_0x3040ea[_0xb2f3('0x2e')],qs[_0xb2f3('0x34')](_0x19dfbc['query'][_0xb2f3('0x34')]));_0x4f5256[_0xb2f3('0x33')]=_0x4f5256[_0xb2f3('0x33')][_0xb2f3('0x35')]?_0x4f5256[_0xb2f3('0x33')]:_0x3040ea['model'];if(_0x19dfbc[_0xb2f3('0x2f')][_0xb2f3('0x3d')]){_0x4f5256['include']=[{'all':!![]}];}_0x4f5256=_['merge']({},_0x4f5256,_0x19dfbc[_0xb2f3('0x3c')]);return db[_0xb2f3('0x2a')][_0xb2f3('0x42')](_0x4f5256)[_0xb2f3('0x20')](handleEntityNotFound(_0x3444b9,null))[_0xb2f3('0x20')](respondWithResult(_0x3444b9,null))[_0xb2f3('0x3f')](handleError(_0x3444b9,null));};exports[_0xb2f3('0x43')]=function(_0x3d8010,_0x5e5e7b){return db['AnalyticExtractedReport'][_0xb2f3('0x43')](_0x3d8010[_0xb2f3('0x44')],{})[_0xb2f3('0x20')](function(_0x5d5039){var _0x14df3e=_0x3d8010[_0xb2f3('0x45')]['get']({'plain':!![]});if(!_0x14df3e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x14df3e[_0xb2f3('0x46')]===_0xb2f3('0x45')){var _0x3989bd=_0x5d5039['get']({'plain':!![]});var _0x138c23=_0xb2f3('0x22');return db[_0xb2f3('0x47')][_0xb2f3('0x42')]({'where':{'name':_0x138c23,'userProfileId':_0x14df3e['userProfileId']},'raw':!![]})['then'](function(_0x298052){if(_0x298052&&_0x298052[_0xb2f3('0x48')]===0x0){return db[_0xb2f3('0x23')]['create']({'name':_0x3989bd[_0xb2f3('0x27')],'resourceId':_0x3989bd['id'],'type':_0x298052['name'],'sectionId':_0x298052['id']},{})['then'](function(){return _0x5d5039;});}else{return _0x5d5039;}})[_0xb2f3('0x3f')](function(_0xd601a2){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xd601a2);throw _0xd601a2;});}return _0x5d5039;})[_0xb2f3('0x20')](respondWithResult(_0x5e5e7b,0xc9))['catch'](handleError(_0x5e5e7b,null));};exports[_0xb2f3('0x1e')]=function(_0x3ef26a,_0x168bc0){if(_0x3ef26a['body']['id']){delete _0x3ef26a[_0xb2f3('0x44')]['id'];}return db[_0xb2f3('0x2a')]['find']({'where':{'id':_0x3ef26a[_0xb2f3('0x41')]['id']}})[_0xb2f3('0x20')](handleEntityNotFound(_0x168bc0,null))[_0xb2f3('0x20')](saveUpdates(_0x3ef26a['body'],null))[_0xb2f3('0x20')](respondWithResult(_0x168bc0,null))[_0xb2f3('0x3f')](handleError(_0x168bc0,null));};exports['destroy']=function(_0x396f2b,_0x31c1f3){return db[_0xb2f3('0x2a')][_0xb2f3('0x42')]({'where':{'id':_0x396f2b[_0xb2f3('0x41')]['id']}})['then'](handleEntityNotFound(_0x31c1f3,null))[_0xb2f3('0x20')](removeEntity(_0x31c1f3,null))[_0xb2f3('0x3f')](handleError(_0x31c1f3,null));};exports['download']=function(_0x20d561,_0x37edb8,_0x5f468e){return db[_0xb2f3('0x2a')][_0xb2f3('0x42')]({'where':{'id':_0x20d561[_0xb2f3('0x41')]['id']},'attributes':[_0xb2f3('0x27'),'basename',_0xb2f3('0x49'),_0xb2f3('0x4a')],'raw':!![]})[_0xb2f3('0x20')](handleEntityNotFound(_0x37edb8,null))[_0xb2f3('0x20')](function(_0x508d3c){if(_0x508d3c){if(!fs['existsSync'](path[_0xb2f3('0x4b')](config[_0xb2f3('0x4c')],_0xb2f3('0x4d'),_0x508d3c['savename']))){throw new db['Sequelize'][(_0xb2f3('0x4e'))](_0xb2f3('0x4f'));}if(_0x20d561[_0xb2f3('0x2f')][_0xb2f3('0x50')]){return _0x37edb8[_0xb2f3('0x15')](0xc8);}return _0x37edb8[_0xb2f3('0x51')](path['join'](config['root'],'server/files/reports',_0x508d3c['savename']),util[_0xb2f3('0x52')]('%s.%s',_0x508d3c[_0xb2f3('0x53')]||_0x508d3c[_0xb2f3('0x27')],_0x508d3c['output'][_0xb2f3('0x54')]()));}})[_0xb2f3('0x3f')](handleError(_0x37edb8,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 30deecd..6ed0040 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 _0x7197=['define','AnalyticExtractedReport','analytics_extracted_reports','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports'];(function(_0x2bca5d,_0xc1727f){var _0x4dbca0=function(_0x2b1913){while(--_0x2b1913){_0x2bca5d['push'](_0x2bca5d['shift']());}};_0x4dbca0(++_0xc1727f);}(_0x7197,0x6b));var _0x7719=function(_0x43e414,_0x5deb2a){_0x43e414=_0x43e414-0x0;var _0x38805b=_0x7197[_0x43e414];return _0x38805b;};'use strict';var _=require('lodash');var util=require(_0x7719('0x0'));var logger=require(_0x7719('0x1'))(_0x7719('0x2'));var moment=require('moment');var BPromise=require(_0x7719('0x3'));var rp=require(_0x7719('0x4'));var fs=require('fs');var path=require(_0x7719('0x5'));var rimraf=require(_0x7719('0x6'));var config=require(_0x7719('0x7'));var attributes=require(_0x7719('0x8'));module[_0x7719('0x9')]=function(_0x5baf73,_0x4611af){return _0x5baf73[_0x7719('0xa')](_0x7719('0xb'),attributes,{'tableName':_0x7719('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x424b=['analytics_extracted_reports','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define'];(function(_0x552284,_0x4ddb09){var _0x4ac092=function(_0x5c2703){while(--_0x5c2703){_0x552284['push'](_0x552284['shift']());}};_0x4ac092(++_0x4ddb09);}(_0x424b,0x1a8));var _0xb424=function(_0x510ab3,_0x51e30f){_0x510ab3=_0x510ab3-0x0;var _0x552438=_0x424b[_0x510ab3];return _0x552438;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb424('0x0'))('api');var moment=require('moment');var BPromise=require(_0xb424('0x1'));var rp=require(_0xb424('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb424('0x3'));var config=require(_0xb424('0x4'));var attributes=require(_0xb424('0x5'));module[_0xb424('0x6')]=function(_0x14b4de,_0x56f698){return _0x14b4de[_0xb424('0x7')]('AnalyticExtractedReport',attributes,{'tableName':_0xb424('0x8'),'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 3b661fe..24d8b3b 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 _0xbdff=['message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','code','error','AnalyticExtractedReport,\x20%s,\x20%s'];(function(_0x1e997e,_0x319443){var _0x4f9955=function(_0x328735){while(--_0x328735){_0x1e997e['push'](_0x1e997e['shift']());}};_0x4f9955(++_0x319443);}(_0xbdff,0x19b));var _0xfbdf=function(_0x3098b6,_0x4cf9ed){_0x3098b6=_0x3098b6-0x0;var _0x5ce8f9=_0xbdff[_0x3098b6];return _0x5ce8f9;};'use strict';var _=require('lodash');var util=require(_0xfbdf('0x0'));var moment=require(_0xfbdf('0x1'));var BPromise=require(_0xfbdf('0x2'));var rs=require(_0xfbdf('0x3'));var fs=require('fs');var Redis=require(_0xfbdf('0x4'));var db=require(_0xfbdf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfbdf('0x6'))(_0xfbdf('0x7'));var config=require(_0xfbdf('0x8'));var jayson=require(_0xfbdf('0x9'));var client=jayson['client'][_0xfbdf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4bf742,_0x207459,_0x1b3bc3){return new BPromise(function(_0xb2ce4,_0x5bf2f1){return client[_0xfbdf('0xb')](_0x4bf742,_0x1b3bc3)[_0xfbdf('0xc')](function(_0x5707ad){logger[_0xfbdf('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x207459,_0xfbdf('0xe'));logger[_0xfbdf('0xf')](_0xfbdf('0x10'),_0x207459,'request\x20sent',JSON[_0xfbdf('0x11')](_0x5707ad));if(_0x5707ad['error']){if(_0x5707ad['error'][_0xfbdf('0x12')]===0x1f4){logger[_0xfbdf('0x13')](_0xfbdf('0x14'),_0x207459,_0x5707ad[_0xfbdf('0x13')][_0xfbdf('0x15')]);return _0x5bf2f1(_0x5707ad[_0xfbdf('0x13')][_0xfbdf('0x15')]);}logger[_0xfbdf('0x13')](_0xfbdf('0x14'),_0x207459,_0x5707ad[_0xfbdf('0x13')][_0xfbdf('0x15')]);return _0xb2ce4(_0x5707ad['error'][_0xfbdf('0x15')]);}else{logger[_0xfbdf('0xd')](_0xfbdf('0x14'),_0x207459,_0xfbdf('0xe'));_0xb2ce4(_0x5707ad[_0xfbdf('0x16')][_0xfbdf('0x15')]);}})[_0xfbdf('0x17')](function(_0x4a8133){logger[_0xfbdf('0x13')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x207459,_0x4a8133);_0x5bf2f1(_0x4a8133);});});}
\ No newline at end of file
+var _0xaebd=['AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','AnalyticExtractedReport,\x20%s,\x20%s','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent'];(function(_0x211419,_0x30cd6c){var _0x19dfdd=function(_0x857a03){while(--_0x857a03){_0x211419['push'](_0x211419['shift']());}};_0x19dfdd(++_0x30cd6c);}(_0xaebd,0x1e9));var _0xdaeb=function(_0x2acf04,_0x4ec7a1){_0x2acf04=_0x2acf04-0x0;var _0x4076bd=_0xaebd[_0x2acf04];return _0x4076bd;};'use strict';var _=require(_0xdaeb('0x0'));var util=require('util');var moment=require(_0xdaeb('0x1'));var BPromise=require(_0xdaeb('0x2'));var rs=require(_0xdaeb('0x3'));var fs=require('fs');var Redis=require(_0xdaeb('0x4'));var db=require(_0xdaeb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdaeb('0x6'))(_0xdaeb('0x7'));var config=require(_0xdaeb('0x8'));var jayson=require(_0xdaeb('0x9'));var client=jayson[_0xdaeb('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ea090,_0x3f7ba1,_0x52c717){return new BPromise(function(_0x550bd9,_0x1b9d37){return client[_0xdaeb('0xb')](_0x3ea090,_0x52c717)[_0xdaeb('0xc')](function(_0x5e0ae9){logger[_0xdaeb('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x3f7ba1,_0xdaeb('0xe'));logger['debug'](_0xdaeb('0xf'),_0x3f7ba1,'request\x20sent',JSON[_0xdaeb('0x10')](_0x5e0ae9));if(_0x5e0ae9[_0xdaeb('0x11')]){if(_0x5e0ae9['error']['code']===0x1f4){logger[_0xdaeb('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x3f7ba1,_0x5e0ae9[_0xdaeb('0x11')][_0xdaeb('0x12')]);return _0x1b9d37(_0x5e0ae9[_0xdaeb('0x11')][_0xdaeb('0x12')]);}logger[_0xdaeb('0x11')](_0xdaeb('0x13'),_0x3f7ba1,_0x5e0ae9[_0xdaeb('0x11')]['message']);return _0x550bd9(_0x5e0ae9['error'][_0xdaeb('0x12')]);}else{logger[_0xdaeb('0xd')](_0xdaeb('0x13'),_0x3f7ba1,_0xdaeb('0xe'));_0x550bd9(_0x5e0ae9['result']['message']);}})[_0xdaeb('0x14')](function(_0x4dd803){logger['error'](_0xdaeb('0x13'),_0x3f7ba1,_0x4dd803);_0x1b9d37(_0x4dd803);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 9e1aed3..41e9a5f 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 _0x3f80=['isAuthenticated','/:id','/:id/download','download','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get'];(function(_0x595b06,_0x103c7c){var _0x9688da=function(_0xe8250b){while(--_0xe8250b){_0x595b06['push'](_0x595b06['shift']());}};_0x9688da(++_0x103c7c);}(_0x3f80,0x1ea));var _0x03f8=function(_0x5f096e,_0x5cd76e){_0x5f096e=_0x5f096e-0x0;var _0x3c2cda=_0x3f80[_0x5f096e];return _0x3c2cda;};'use strict';var multer=require(_0x03f8('0x0'));var util=require(_0x03f8('0x1'));var path=require(_0x03f8('0x2'));var timeout=require(_0x03f8('0x3'));var express=require('express');var router=express[_0x03f8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x03f8('0x5'));var interaction=require(_0x03f8('0x6'));var config=require(_0x03f8('0x7'));var controller=require(_0x03f8('0x8'));router[_0x03f8('0x9')]('/',auth[_0x03f8('0xa')](),controller['index']);router['get'](_0x03f8('0xb'),auth[_0x03f8('0xa')](),controller['show']);router['get'](_0x03f8('0xc'),auth[_0x03f8('0xa')](),controller[_0x03f8('0xd')]);router[_0x03f8('0xe')]('/',auth['isAuthenticated'](),controller[_0x03f8('0xf')]);router['put'](_0x03f8('0xb'),auth[_0x03f8('0xa')](),controller[_0x03f8('0x10')]);router[_0x03f8('0x11')](_0x03f8('0xb'),auth[_0x03f8('0xa')](),controller[_0x03f8('0x12')]);module[_0x03f8('0x13')]=router;
\ No newline at end of file
+var _0x5fb1=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','/:id','/:id/download','download','post','create','put','update','delete','exports'];(function(_0x3a67f8,_0x38a2b9){var _0x52939c=function(_0x1b7270){while(--_0x1b7270){_0x3a67f8['push'](_0x3a67f8['shift']());}};_0x52939c(++_0x38a2b9);}(_0x5fb1,0xdd));var _0x15fb=function(_0x4aac5a,_0x15b04c){_0x4aac5a=_0x4aac5a-0x0;var _0x42e7bc=_0x5fb1[_0x4aac5a];return _0x42e7bc;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x15fb('0x0'));var timeout=require(_0x15fb('0x1'));var express=require(_0x15fb('0x2'));var router=express[_0x15fb('0x3')]();var fs_extra=require(_0x15fb('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x15fb('0x5'));var config=require('../../config/environment');var controller=require('./analyticExtractedReport.controller');router[_0x15fb('0x6')]('/',auth[_0x15fb('0x7')](),controller['index']);router[_0x15fb('0x6')](_0x15fb('0x8'),auth[_0x15fb('0x7')](),controller['show']);router[_0x15fb('0x6')](_0x15fb('0x9'),auth['isAuthenticated'](),controller[_0x15fb('0xa')]);router[_0x15fb('0xb')]('/',auth[_0x15fb('0x7')](),controller[_0x15fb('0xc')]);router[_0x15fb('0xd')](_0x15fb('0x8'),auth[_0x15fb('0x7')](),controller[_0x15fb('0xe')]);router[_0x15fb('0xf')](_0x15fb('0x8'),auth[_0x15fb('0x7')](),controller['destroy']);module[_0x15fb('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index bd1c192..1d31ff6 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 _0x8fe5=['sequelize','exports','STRING','BOOLEAN'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x8fe5,0x12c));var _0x58fe=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8fe5[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x58fe('0x0'));module[_0x58fe('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x58fe('0x2')]},'function':{'type':Sequelize[_0x58fe('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x58fe('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x58fe('0x2')]},'custom':{'type':Sequelize[_0x58fe('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0xbcfe=['TEXT','STRING','BOOLEAN','exports'];(function(_0xd1bd26,_0x52f570){var _0xd52e66=function(_0xca284){while(--_0xca284){_0xd1bd26['push'](_0xd1bd26['shift']());}};_0xd52e66(++_0x52f570);}(_0xbcfe,0x143));var _0xebcf=function(_0x406556,_0x40a28a){_0x406556=_0x406556-0x0;var _0x450e44=_0xbcfe[_0x406556];return _0x450e44;};'use strict';var Sequelize=require('sequelize');module[_0xebcf('0x0')]={'field':{'type':Sequelize[_0xebcf('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xebcf('0x2')]},'format':{'type':Sequelize[_0xebcf('0x2')]},'groupBy':{'type':Sequelize[_0xebcf('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 4a13efb..02e41f5 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 _0x8118=['key','model','keys','filters','intersection','query','fields','attributes','length','sort','where','pick','VIRTUAL','includeAll','include','findAll','rows','show','params','merge','options','find','catch','create','body','bulkCreate','bulkDestroy','addFields','AnalyticCustomReport','sequelize','transaction','CustomReportId','eml-format','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','stack','name','index','map','AnalyticFieldReport','rawAttributes','fieldName','type'];(function(_0x4ddbc5,_0x7f4e8b){var _0x18b5de=function(_0x342296){while(--_0x342296){_0x4ddbc5['push'](_0x4ddbc5['shift']());}};_0x18b5de(++_0x7f4e8b);}(_0x8118,0x148));var _0x8811=function(_0x1b81ae,_0x1941f7){_0x1b81ae=_0x1b81ae-0x0;var _0x33ba48=_0x8118[_0x1b81ae];return _0x33ba48;};'use strict';var emlformat=require(_0x8811('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8811('0x1'));var moment=require(_0x8811('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x8811('0x3'));var util=require(_0x8811('0x4'));var path=require(_0x8811('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8811('0x6'));var fs=require('fs');var fs_extra=require(_0x8811('0x7'));var _=require(_0x8811('0x8'));var squel=require('squel');var crypto=require(_0x8811('0x9'));var jsforce=require(_0x8811('0xa'));var deskjs=require(_0x8811('0xb'));var toCsv=require(_0x8811('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8811('0xd'));var authService=require(_0x8811('0xe'));var qs=require(_0x8811('0xf'));var as=require(_0x8811('0x10'));var hardwareService=require(_0x8811('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x8811('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x8811('0x13'));var db=require(_0x8811('0x14'))['db'];function respondWithStatusCode(_0x43279c,_0x445cd2){_0x445cd2=_0x445cd2||0xcc;return function(_0x44260f){if(_0x44260f){return _0x43279c['sendStatus'](_0x445cd2);}return _0x43279c[_0x8811('0x15')](_0x445cd2)[_0x8811('0x16')]();};}function respondWithResult(_0x767ce0,_0x52ebba){_0x52ebba=_0x52ebba||0xc8;return function(_0x44128d){if(_0x44128d){return _0x767ce0[_0x8811('0x15')](_0x52ebba)[_0x8811('0x17')](_0x44128d);}};}function respondWithFilteredResult(_0x2413e7,_0x206d3d){return function(_0x4ee4bc){if(_0x4ee4bc){var _0x194ae8=typeof _0x206d3d[_0x8811('0x18')]===_0x8811('0x19')&&typeof _0x206d3d[_0x8811('0x1a')]===_0x8811('0x19');var _0x1db676=_0x4ee4bc[_0x8811('0x1b')];var _0x546320=_0x194ae8?0x0:_0x206d3d['offset'];var _0x56f560=_0x194ae8?_0x4ee4bc[_0x8811('0x1b')]:_0x206d3d[_0x8811('0x18')]+_0x206d3d['limit'];var _0x39300c;if(_0x56f560>=_0x1db676){_0x56f560=_0x1db676;_0x39300c=0xc8;}else{_0x39300c=0xce;}_0x2413e7[_0x8811('0x15')](_0x39300c);return _0x2413e7['set']('Content-Range',_0x546320+'-'+_0x56f560+'/'+_0x1db676)[_0x8811('0x17')](_0x4ee4bc);}return null;};}function patchUpdates(_0x353a5c){return function(_0x318d71){try{jsonpatch[_0x8811('0x1c')](_0x318d71,_0x353a5c,!![]);}catch(_0x56b7e6){return BPromise[_0x8811('0x1d')](_0x56b7e6);}return _0x318d71[_0x8811('0x1e')]();};}function saveUpdates(_0x576dfe,_0xaaad36){return function(_0x882ea5){if(_0x882ea5){return _0x882ea5[_0x8811('0x1f')](_0x576dfe)[_0x8811('0x20')](function(_0x23f04e){return _0x23f04e;});}return null;};}function removeEntity(_0x1e7d89,_0x4dc7a0){return function(_0x44cd79){if(_0x44cd79){return _0x44cd79[_0x8811('0x21')]()[_0x8811('0x20')](function(){_0x1e7d89[_0x8811('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a3c10,_0x3cc5dd){return function(_0x5c80c0){if(!_0x5c80c0){_0x4a3c10['sendStatus'](0x194);}return _0x5c80c0;};}function handleError(_0x28fcae,_0x280c7){_0x280c7=_0x280c7||0x1f4;return function(_0x2e2254){logger['error'](_0x2e2254[_0x8811('0x22')]);if(_0x2e2254[_0x8811('0x23')]){delete _0x2e2254[_0x8811('0x23')];}_0x28fcae[_0x8811('0x15')](_0x280c7)['send'](_0x2e2254);};}exports[_0x8811('0x24')]=function(_0x142523,_0x34f841){var _0x2d2b88={},_0x317ba3={},_0xaba7ae={'count':0x0,'rows':[]};var _0x39bbc2=_[_0x8811('0x25')](db[_0x8811('0x26')][_0x8811('0x27')],function(_0x3c8e9b){return{'name':_0x3c8e9b[_0x8811('0x28')],'type':_0x3c8e9b[_0x8811('0x29')][_0x8811('0x2a')]};});_0x317ba3[_0x8811('0x2b')]=_[_0x8811('0x25')](_0x39bbc2,_0x8811('0x23'));_0x317ba3['query']=_[_0x8811('0x2c')](_0x142523['query']);_0x317ba3[_0x8811('0x2d')]=_[_0x8811('0x2e')](_0x317ba3['model'],_0x317ba3[_0x8811('0x2f')]);_0x2d2b88['attributes']=_[_0x8811('0x2e')](_0x317ba3[_0x8811('0x2b')],qs[_0x8811('0x30')](_0x142523[_0x8811('0x2f')][_0x8811('0x30')]));_0x2d2b88[_0x8811('0x31')]=_0x2d2b88[_0x8811('0x31')][_0x8811('0x32')]?_0x2d2b88['attributes']:_0x317ba3['model'];if(!_0x142523[_0x8811('0x2f')]['hasOwnProperty']('nolimit')){_0x2d2b88[_0x8811('0x1a')]=qs[_0x8811('0x1a')](_0x142523[_0x8811('0x2f')][_0x8811('0x1a')]);_0x2d2b88['offset']=qs['offset'](_0x142523[_0x8811('0x2f')]['offset']);}_0x2d2b88['order']=qs[_0x8811('0x33')](_0x142523['query']['sort']);_0x2d2b88[_0x8811('0x34')]=qs[_0x8811('0x2d')](_[_0x8811('0x35')](_0x142523[_0x8811('0x2f')],_0x317ba3[_0x8811('0x2d')]),_0x39bbc2);if(_0x142523[_0x8811('0x2f')]['filter']){_0x2d2b88[_0x8811('0x34')]=_['merge'](_0x2d2b88['where'],{'$or':_[_0x8811('0x25')](_0x39bbc2,function(_0x5d3cb0){if(_0x5d3cb0['type']!==_0x8811('0x36')){var _0x5339df={};_0x5339df[_0x5d3cb0['name']]={'$like':'%'+_0x142523['query']['filter']+'%'};return _0x5339df;}})});}_0x2d2b88=_['merge']({},_0x2d2b88,_0x142523['options']);var _0x2471c8={'where':_0x2d2b88['where']};return db[_0x8811('0x26')][_0x8811('0x1b')](_0x2471c8)['then'](function(_0x1ec322){_0xaba7ae['count']=_0x1ec322;if(_0x142523[_0x8811('0x2f')][_0x8811('0x37')]){_0x2d2b88[_0x8811('0x38')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x8811('0x39')](_0x2d2b88);})[_0x8811('0x20')](function(_0x5b155f){_0xaba7ae[_0x8811('0x3a')]=_0x5b155f;return _0xaba7ae;})[_0x8811('0x20')](respondWithFilteredResult(_0x34f841,_0x2d2b88))['catch'](handleError(_0x34f841,null));};exports[_0x8811('0x3b')]=function(_0x5bbfa3,_0x39c18c){var _0x27d3d4={'raw':![],'where':{'id':_0x5bbfa3[_0x8811('0x3c')]['id']}},_0x362dbd={};_0x362dbd[_0x8811('0x2b')]=_[_0x8811('0x2c')](db[_0x8811('0x26')][_0x8811('0x27')]);_0x362dbd[_0x8811('0x2f')]=_[_0x8811('0x2c')](_0x5bbfa3[_0x8811('0x2f')]);_0x362dbd[_0x8811('0x2d')]=_[_0x8811('0x2e')](_0x362dbd[_0x8811('0x2b')],_0x362dbd[_0x8811('0x2f')]);_0x27d3d4[_0x8811('0x31')]=_[_0x8811('0x2e')](_0x362dbd[_0x8811('0x2b')],qs[_0x8811('0x30')](_0x5bbfa3['query'][_0x8811('0x30')]));_0x27d3d4[_0x8811('0x31')]=_0x27d3d4['attributes'][_0x8811('0x32')]?_0x27d3d4[_0x8811('0x31')]:_0x362dbd[_0x8811('0x2b')];if(_0x5bbfa3[_0x8811('0x2f')][_0x8811('0x37')]){_0x27d3d4[_0x8811('0x38')]=[{'all':!![]}];}_0x27d3d4=_[_0x8811('0x3d')]({},_0x27d3d4,_0x5bbfa3[_0x8811('0x3e')]);return db[_0x8811('0x26')][_0x8811('0x3f')](_0x27d3d4)[_0x8811('0x20')](handleEntityNotFound(_0x39c18c,null))[_0x8811('0x20')](respondWithResult(_0x39c18c,null))[_0x8811('0x40')](handleError(_0x39c18c,null));};exports[_0x8811('0x41')]=function(_0x22a186,_0x26ce44){return db['AnalyticFieldReport']['create'](_0x22a186[_0x8811('0x42')],{})[_0x8811('0x20')](respondWithResult(_0x26ce44,0xc9))[_0x8811('0x40')](handleError(_0x26ce44,null));};exports[_0x8811('0x43')]=function(_0x1891e3,_0x160ca4){return db[_0x8811('0x26')][_0x8811('0x43')](_0x1891e3['body'],{'raw':![],'individualHooks':!![]})[_0x8811('0x20')](respondWithResult(_0x160ca4,0xc9))['catch'](handleError(_0x160ca4,null));};exports[_0x8811('0x1f')]=function(_0x461a07,_0x55798e){if(_0x461a07[_0x8811('0x42')]['id']){delete _0x461a07[_0x8811('0x42')]['id'];}return db[_0x8811('0x26')][_0x8811('0x3f')]({'where':{'id':_0x461a07['params']['id']}})[_0x8811('0x20')](handleEntityNotFound(_0x55798e,null))[_0x8811('0x20')](saveUpdates(_0x461a07[_0x8811('0x42')],null))[_0x8811('0x20')](respondWithResult(_0x55798e,null))[_0x8811('0x40')](handleError(_0x55798e,null));};exports[_0x8811('0x21')]=function(_0xdf0f37,_0x42d6bb){return db[_0x8811('0x26')][_0x8811('0x3f')]({'where':{'id':_0xdf0f37[_0x8811('0x3c')]['id']}})[_0x8811('0x20')](handleEntityNotFound(_0x42d6bb,null))[_0x8811('0x20')](removeEntity(_0x42d6bb,null))[_0x8811('0x40')](handleError(_0x42d6bb,null));};exports[_0x8811('0x44')]=function(_0x33cc36,_0x327024){return db[_0x8811('0x26')]['destroy']({'where':{'id':_0x33cc36['query']['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x327024,0xcc))[_0x8811('0x40')](handleError(_0x327024,null));};exports[_0x8811('0x45')]=function(_0x478f77,_0x5db529,_0x102431){return db[_0x8811('0x46')]['findOne']({'where':{'id':_0x478f77[_0x8811('0x3c')]['id']}})[_0x8811('0x20')](handleEntityNotFound(_0x5db529,null))['then'](function(_0x33f767){if(_0x33f767){return db[_0x8811('0x47')][_0x8811('0x48')](function(_0x5e45d9){return db[_0x8811('0x26')][_0x8811('0x21')]({'where':{'CustomReportId':_0x478f77[_0x8811('0x3c')]['id']},'transaction':_0x5e45d9})[_0x8811('0x20')](function(_0x32b1b1){var _0x305359=_[_0x8811('0x25')](_0x478f77['body'],function(_0x4546e5){delete _0x4546e5['id'];_0x4546e5[_0x8811('0x49')]=_0x478f77[_0x8811('0x3c')]['id'];return _0x4546e5;});return db[_0x8811('0x26')][_0x8811('0x43')](_0x305359,{'transaction':_0x5e45d9});});})[_0x8811('0x20')](function(){return db['AnalyticFieldReport'][_0x8811('0x39')]({'where':{'CustomReportId':_0x478f77[_0x8811('0x3c')]['id']}});});}})['then'](respondWithResult(_0x5db529,null))[_0x8811('0x40')](handleError(_0x5db529,null));};
\ No newline at end of file
+var _0xf760=['filter','where','merge','includeAll','include','AnalyticFieldReport','findAll','rows','catch','show','params','options','find','create','bulkCreate','body','destroy','ids','addFields','AnalyticCustomReport','sequelize','transaction','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick'];(function(_0x4bed75,_0x211cc7){var _0x2dd8e8=function(_0x6369c7){while(--_0x6369c7){_0x4bed75['push'](_0x4bed75['shift']());}};_0x2dd8e8(++_0x211cc7);}(_0xf760,0x1ab));var _0x0f76=function(_0x7cc95d,_0x958a71){_0x7cc95d=_0x7cc95d-0x0;var _0x2d3569=_0xf760[_0x7cc95d];return _0x2d3569;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0f76('0x0'));var zipdir=require(_0x0f76('0x1'));var jsonpatch=require(_0x0f76('0x2'));var rp=require('request-promise');var moment=require(_0x0f76('0x3'));var BPromise=require(_0x0f76('0x4'));var Mustache=require(_0x0f76('0x5'));var util=require('util');var path=require(_0x0f76('0x6'));var sox=require('sox');var csv=require(_0x0f76('0x7'));var ejs=require(_0x0f76('0x8'));var fs=require('fs');var fs_extra=require(_0x0f76('0x9'));var _=require(_0x0f76('0xa'));var squel=require('squel');var crypto=require(_0x0f76('0xb'));var jsforce=require(_0x0f76('0xc'));var deskjs=require(_0x0f76('0xd'));var toCsv=require(_0x0f76('0x7'));var querystring=require(_0x0f76('0xe'));var Papa=require(_0x0f76('0xf'));var Redis=require(_0x0f76('0x10'));var authService=require(_0x0f76('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0f76('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0f76('0x13'))(_0x0f76('0x14'));var utils=require(_0x0f76('0x15'));var config=require(_0x0f76('0x16'));var licenseUtil=require(_0x0f76('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4685f7,_0x485bbe){_0x485bbe=_0x485bbe||0xcc;return function(_0xfa95d0){if(_0xfa95d0){return _0x4685f7[_0x0f76('0x18')](_0x485bbe);}return _0x4685f7[_0x0f76('0x19')](_0x485bbe)['end']();};}function respondWithResult(_0x57e437,_0x4faf56){_0x4faf56=_0x4faf56||0xc8;return function(_0x1c72a0){if(_0x1c72a0){return _0x57e437[_0x0f76('0x19')](_0x4faf56)[_0x0f76('0x1a')](_0x1c72a0);}};}function respondWithFilteredResult(_0x366f75,_0x16c85b){return function(_0x45ece4){if(_0x45ece4){var _0x204ad2=typeof _0x16c85b['offset']===_0x0f76('0x1b')&&typeof _0x16c85b[_0x0f76('0x1c')]===_0x0f76('0x1b');var _0x3ec897=_0x45ece4[_0x0f76('0x1d')];var _0x16b6c1=_0x204ad2?0x0:_0x16c85b[_0x0f76('0x1e')];var _0x464803=_0x204ad2?_0x45ece4[_0x0f76('0x1d')]:_0x16c85b[_0x0f76('0x1e')]+_0x16c85b[_0x0f76('0x1c')];var _0x13f29a;if(_0x464803>=_0x3ec897){_0x464803=_0x3ec897;_0x13f29a=0xc8;}else{_0x13f29a=0xce;}_0x366f75[_0x0f76('0x19')](_0x13f29a);return _0x366f75['set'](_0x0f76('0x1f'),_0x16b6c1+'-'+_0x464803+'/'+_0x3ec897)[_0x0f76('0x1a')](_0x45ece4);}return null;};}function patchUpdates(_0x487162){return function(_0xb361e8){try{jsonpatch[_0x0f76('0x20')](_0xb361e8,_0x487162,!![]);}catch(_0x198123){return BPromise[_0x0f76('0x21')](_0x198123);}return _0xb361e8[_0x0f76('0x22')]();};}function saveUpdates(_0x284c5b,_0x34e73e){return function(_0x1d533e){if(_0x1d533e){return _0x1d533e[_0x0f76('0x23')](_0x284c5b)[_0x0f76('0x24')](function(_0xd9eb98){return _0xd9eb98;});}return null;};}function removeEntity(_0x10db05,_0x45a67e){return function(_0x5124b2){if(_0x5124b2){return _0x5124b2['destroy']()['then'](function(){_0x10db05[_0x0f76('0x19')](0xcc)[_0x0f76('0x25')]();});}};}function handleEntityNotFound(_0x10ebd0,_0x56b61c){return function(_0x3aef81){if(!_0x3aef81){_0x10ebd0[_0x0f76('0x18')](0x194);}return _0x3aef81;};}function handleError(_0xebe2ac,_0x117600){_0x117600=_0x117600||0x1f4;return function(_0x5d2f5c){logger[_0x0f76('0x26')](_0x5d2f5c[_0x0f76('0x27')]);if(_0x5d2f5c[_0x0f76('0x28')]){delete _0x5d2f5c[_0x0f76('0x28')];}_0xebe2ac[_0x0f76('0x19')](_0x117600)[_0x0f76('0x29')](_0x5d2f5c);};}exports['index']=function(_0x2a5f90,_0x1a4ac3){var _0x40f30d={},_0x373834={},_0x4df851={'count':0x0,'rows':[]};var _0x4ab9f6=_['map'](db['AnalyticFieldReport'][_0x0f76('0x2a')],function(_0x4f6ce4){return{'name':_0x4f6ce4['fieldName'],'type':_0x4f6ce4[_0x0f76('0x2b')][_0x0f76('0x2c')]};});_0x373834[_0x0f76('0x2d')]=_[_0x0f76('0x2e')](_0x4ab9f6,'name');_0x373834[_0x0f76('0x2f')]=_[_0x0f76('0x30')](_0x2a5f90[_0x0f76('0x2f')]);_0x373834[_0x0f76('0x31')]=_[_0x0f76('0x32')](_0x373834[_0x0f76('0x2d')],_0x373834['query']);_0x40f30d[_0x0f76('0x33')]=_[_0x0f76('0x32')](_0x373834[_0x0f76('0x2d')],qs[_0x0f76('0x34')](_0x2a5f90[_0x0f76('0x2f')][_0x0f76('0x34')]));_0x40f30d[_0x0f76('0x33')]=_0x40f30d['attributes'][_0x0f76('0x35')]?_0x40f30d['attributes']:_0x373834['model'];if(!_0x2a5f90[_0x0f76('0x2f')][_0x0f76('0x36')](_0x0f76('0x37'))){_0x40f30d[_0x0f76('0x1c')]=qs[_0x0f76('0x1c')](_0x2a5f90[_0x0f76('0x2f')][_0x0f76('0x1c')]);_0x40f30d[_0x0f76('0x1e')]=qs[_0x0f76('0x1e')](_0x2a5f90[_0x0f76('0x2f')][_0x0f76('0x1e')]);}_0x40f30d[_0x0f76('0x38')]=qs['sort'](_0x2a5f90[_0x0f76('0x2f')][_0x0f76('0x39')]);_0x40f30d['where']=qs[_0x0f76('0x31')](_[_0x0f76('0x3a')](_0x2a5f90[_0x0f76('0x2f')],_0x373834[_0x0f76('0x31')]),_0x4ab9f6);if(_0x2a5f90[_0x0f76('0x2f')][_0x0f76('0x3b')]){_0x40f30d[_0x0f76('0x3c')]=_[_0x0f76('0x3d')](_0x40f30d['where'],{'$or':_['map'](_0x4ab9f6,function(_0x1e0175){if(_0x1e0175['type']!=='VIRTUAL'){var _0x26630d={};_0x26630d[_0x1e0175[_0x0f76('0x28')]]={'$like':'%'+_0x2a5f90[_0x0f76('0x2f')]['filter']+'%'};return _0x26630d;}})});}_0x40f30d=_['merge']({},_0x40f30d,_0x2a5f90['options']);var _0x2cf3df={'where':_0x40f30d[_0x0f76('0x3c')]};return db['AnalyticFieldReport'][_0x0f76('0x1d')](_0x2cf3df)[_0x0f76('0x24')](function(_0x4fc533){_0x4df851[_0x0f76('0x1d')]=_0x4fc533;if(_0x2a5f90[_0x0f76('0x2f')][_0x0f76('0x3e')]){_0x40f30d[_0x0f76('0x3f')]=[{'all':!![]}];}return db[_0x0f76('0x40')][_0x0f76('0x41')](_0x40f30d);})[_0x0f76('0x24')](function(_0xe84af2){_0x4df851[_0x0f76('0x42')]=_0xe84af2;return _0x4df851;})[_0x0f76('0x24')](respondWithFilteredResult(_0x1a4ac3,_0x40f30d))[_0x0f76('0x43')](handleError(_0x1a4ac3,null));};exports[_0x0f76('0x44')]=function(_0xd54ce6,_0x27bbab){var _0x440550={'raw':![],'where':{'id':_0xd54ce6[_0x0f76('0x45')]['id']}},_0x4053d6={};_0x4053d6['model']=_[_0x0f76('0x30')](db[_0x0f76('0x40')][_0x0f76('0x2a')]);_0x4053d6[_0x0f76('0x2f')]=_['keys'](_0xd54ce6[_0x0f76('0x2f')]);_0x4053d6[_0x0f76('0x31')]=_[_0x0f76('0x32')](_0x4053d6[_0x0f76('0x2d')],_0x4053d6[_0x0f76('0x2f')]);_0x440550[_0x0f76('0x33')]=_[_0x0f76('0x32')](_0x4053d6[_0x0f76('0x2d')],qs['fields'](_0xd54ce6[_0x0f76('0x2f')][_0x0f76('0x34')]));_0x440550[_0x0f76('0x33')]=_0x440550[_0x0f76('0x33')][_0x0f76('0x35')]?_0x440550[_0x0f76('0x33')]:_0x4053d6[_0x0f76('0x2d')];if(_0xd54ce6[_0x0f76('0x2f')][_0x0f76('0x3e')]){_0x440550['include']=[{'all':!![]}];}_0x440550=_[_0x0f76('0x3d')]({},_0x440550,_0xd54ce6[_0x0f76('0x46')]);return db['AnalyticFieldReport'][_0x0f76('0x47')](_0x440550)[_0x0f76('0x24')](handleEntityNotFound(_0x27bbab,null))[_0x0f76('0x24')](respondWithResult(_0x27bbab,null))['catch'](handleError(_0x27bbab,null));};exports['create']=function(_0x29a69b,_0x33ac85){return db[_0x0f76('0x40')][_0x0f76('0x48')](_0x29a69b['body'],{})[_0x0f76('0x24')](respondWithResult(_0x33ac85,0xc9))[_0x0f76('0x43')](handleError(_0x33ac85,null));};exports[_0x0f76('0x49')]=function(_0x3fdb15,_0x2d54a3){return db[_0x0f76('0x40')][_0x0f76('0x49')](_0x3fdb15['body'],{'raw':![],'individualHooks':!![]})[_0x0f76('0x24')](respondWithResult(_0x2d54a3,0xc9))['catch'](handleError(_0x2d54a3,null));};exports['update']=function(_0x297eff,_0x501e94){if(_0x297eff[_0x0f76('0x4a')]['id']){delete _0x297eff[_0x0f76('0x4a')]['id'];}return db[_0x0f76('0x40')]['find']({'where':{'id':_0x297eff[_0x0f76('0x45')]['id']}})[_0x0f76('0x24')](handleEntityNotFound(_0x501e94,null))[_0x0f76('0x24')](saveUpdates(_0x297eff[_0x0f76('0x4a')],null))['then'](respondWithResult(_0x501e94,null))[_0x0f76('0x43')](handleError(_0x501e94,null));};exports[_0x0f76('0x4b')]=function(_0x4b8db0,_0x4a3737){return db[_0x0f76('0x40')][_0x0f76('0x47')]({'where':{'id':_0x4b8db0['params']['id']}})[_0x0f76('0x24')](handleEntityNotFound(_0x4a3737,null))[_0x0f76('0x24')](removeEntity(_0x4a3737,null))[_0x0f76('0x43')](handleError(_0x4a3737,null));};exports['bulkDestroy']=function(_0x5d8b20,_0x451d88){return db[_0x0f76('0x40')]['destroy']({'where':{'id':_0x5d8b20[_0x0f76('0x2f')][_0x0f76('0x4c')]||[]},'raw':![],'individualHooks':!![]})[_0x0f76('0x24')](respondWithResult(_0x451d88,0xcc))[_0x0f76('0x43')](handleError(_0x451d88,null));};exports[_0x0f76('0x4d')]=function(_0x31e010,_0x483fda,_0x4e7972){return db[_0x0f76('0x4e')]['findOne']({'where':{'id':_0x31e010['params']['id']}})[_0x0f76('0x24')](handleEntityNotFound(_0x483fda,null))[_0x0f76('0x24')](function(_0xf60380){if(_0xf60380){return db[_0x0f76('0x4f')][_0x0f76('0x50')](function(_0x10d8e0){return db[_0x0f76('0x40')][_0x0f76('0x4b')]({'where':{'CustomReportId':_0x31e010[_0x0f76('0x45')]['id']},'transaction':_0x10d8e0})['then'](function(_0x3390c6){var _0xb223e2=_['map'](_0x31e010[_0x0f76('0x4a')],function(_0xf35268){delete _0xf35268['id'];_0xf35268['CustomReportId']=_0x31e010[_0x0f76('0x45')]['id'];return _0xf35268;});return db[_0x0f76('0x40')][_0x0f76('0x49')](_0xb223e2,{'transaction':_0x10d8e0});});})[_0x0f76('0x24')](function(){return db[_0x0f76('0x40')][_0x0f76('0x41')]({'where':{'CustomReportId':_0x31e010[_0x0f76('0x45')]['id']}});});}})['then'](respondWithResult(_0x483fda,null))['catch'](handleError(_0x483fda,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 595aa20..60b550b 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 _0x6e95=['bluebird','exports','define','analytics_report_fields','moment'];(function(_0x23ba5f,_0x48e0d4){var _0x280358=function(_0x4cac5a){while(--_0x4cac5a){_0x23ba5f['push'](_0x23ba5f['shift']());}};_0x280358(++_0x48e0d4);}(_0x6e95,0x158));var _0x56e9=function(_0x967959,_0x53c5c1){_0x967959=_0x967959-0x0;var _0x5c4489=_0x6e95[_0x967959];return _0x5c4489;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x56e9('0x0'));var BPromise=require(_0x56e9('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./analyticFieldReport.attributes');module[_0x56e9('0x2')]=function(_0x3099c3,_0x1a3d55){return _0x3099c3[_0x56e9('0x3')]('AnalyticFieldReport',attributes,{'tableName':_0x56e9('0x4'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x620b=['request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','util','bluebird'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x620b,0xfb));var _0xb620=function(_0xbed95,_0x1deefd){_0xbed95=_0xbed95-0x0;var _0x20b697=_0x620b[_0xbed95];return _0x20b697;};'use strict';var _=require('lodash');var util=require(_0xb620('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xb620('0x1'));var rp=require(_0xb620('0x2'));var fs=require('fs');var path=require(_0xb620('0x3'));var rimraf=require(_0xb620('0x4'));var config=require(_0xb620('0x5'));var attributes=require(_0xb620('0x6'));module[_0xb620('0x7')]=function(_0x51f6da,_0x4c47a9){return _0x51f6da[_0xb620('0x8')](_0xb620('0x9'),attributes,{'tableName':_0xb620('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 c1d11c0..7d266eb 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 _0xcfa0=['ioredis','../../config/logger','rpc','jayson/promise','client','http','info','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x4cb7b1,_0x42bc9f){var _0x3b5fce=function(_0x3cab27){while(--_0x3cab27){_0x4cb7b1['push'](_0x4cb7b1['shift']());}};_0x3b5fce(++_0x42bc9f);}(_0xcfa0,0x150));var _0x0cfa=function(_0x53f1ee,_0x29cff6){_0x53f1ee=_0x53f1ee-0x0;var _0x3638da=_0xcfa0[_0x53f1ee];return _0x3638da;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0cfa('0x0'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0cfa('0x1'))(_0x0cfa('0x2'));var config=require('../../config/environment');var jayson=require(_0x0cfa('0x3'));var client=jayson[_0x0cfa('0x4')][_0x0cfa('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x36cf54,_0xd60f26,_0x4ff849){return new BPromise(function(_0x46673c,_0x2ce43a){return client['request'](_0x36cf54,_0x4ff849)['then'](function(_0x6ad738){logger[_0x0cfa('0x6')](_0x0cfa('0x7'),_0xd60f26,'request\x20sent');logger[_0x0cfa('0x8')](_0x0cfa('0x9'),_0xd60f26,_0x0cfa('0xa'),JSON[_0x0cfa('0xb')](_0x6ad738));if(_0x6ad738[_0x0cfa('0xc')]){if(_0x6ad738[_0x0cfa('0xc')][_0x0cfa('0xd')]===0x1f4){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0xd60f26,_0x6ad738[_0x0cfa('0xc')][_0x0cfa('0xe')]);return _0x2ce43a(_0x6ad738[_0x0cfa('0xc')][_0x0cfa('0xe')]);}logger[_0x0cfa('0xc')](_0x0cfa('0x7'),_0xd60f26,_0x6ad738[_0x0cfa('0xc')]['message']);return _0x46673c(_0x6ad738['error'][_0x0cfa('0xe')]);}else{logger[_0x0cfa('0x6')](_0x0cfa('0x7'),_0xd60f26,_0x0cfa('0xa'));_0x46673c(_0x6ad738[_0x0cfa('0xf')][_0x0cfa('0xe')]);}})['catch'](function(_0x3f3b9b){logger[_0x0cfa('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0xd60f26,_0x3f3b9b);_0x2ce43a(_0x3f3b9b);});});}
\ No newline at end of file
+var _0x0a9b=['stringify','error','code','message','AnalyticFieldReport,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug'];(function(_0x2b93c3,_0x4077ad){var _0x426b49=function(_0x581c8b){while(--_0x581c8b){_0x2b93c3['push'](_0x2b93c3['shift']());}};_0x426b49(++_0x4077ad);}(_0x0a9b,0x1d3));var _0xb0a9=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0a9b[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xb0a9('0x0'));var util=require(_0xb0a9('0x1'));var moment=require(_0xb0a9('0x2'));var BPromise=require(_0xb0a9('0x3'));var rs=require(_0xb0a9('0x4'));var fs=require('fs');var Redis=require(_0xb0a9('0x5'));var db=require(_0xb0a9('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xb0a9('0x7'))(_0xb0a9('0x8'));var config=require(_0xb0a9('0x9'));var jayson=require(_0xb0a9('0xa'));var client=jayson['client'][_0xb0a9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4af147,_0x510017,_0x229694){return new BPromise(function(_0x496233,_0x25ee08){return client[_0xb0a9('0xc')](_0x4af147,_0x229694)['then'](function(_0x43b2d1){logger[_0xb0a9('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x510017,_0xb0a9('0xe'));logger[_0xb0a9('0xf')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x510017,_0xb0a9('0xe'),JSON[_0xb0a9('0x10')](_0x43b2d1));if(_0x43b2d1['error']){if(_0x43b2d1[_0xb0a9('0x11')][_0xb0a9('0x12')]===0x1f4){logger[_0xb0a9('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x510017,_0x43b2d1[_0xb0a9('0x11')][_0xb0a9('0x13')]);return _0x25ee08(_0x43b2d1['error'][_0xb0a9('0x13')]);}logger[_0xb0a9('0x11')](_0xb0a9('0x14'),_0x510017,_0x43b2d1[_0xb0a9('0x11')][_0xb0a9('0x13')]);return _0x496233(_0x43b2d1[_0xb0a9('0x11')][_0xb0a9('0x13')]);}else{logger['info'](_0xb0a9('0x14'),_0x510017,_0xb0a9('0xe'));_0x496233(_0x43b2d1[_0xb0a9('0x15')][_0xb0a9('0x13')]);}})[_0xb0a9('0x16')](function(_0x21ec88){logger['error'](_0xb0a9('0x14'),_0x510017,_0x21ec88);_0x25ee08(_0x21ec88);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 8ea43ad..bcd3913 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(_0x3d57dd,_0x263837){var _0x1719e7=function(_0x3271f2){while(--_0x3271f2){_0x3d57dd['push'](_0x3d57dd['shift']());}};_0x1719e7(++_0x263837);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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(_0x33157f,_0x11827e){var _0x19264e=function(_0x90385f){while(--_0x90385f){_0x33157f['push'](_0x33157f['shift']());}};_0x19264e(++_0x11827e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'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 841269f..f29bef1 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 _0x122a=['STRING','name','sequelize','exports'];(function(_0x5b0df2,_0x30877c){var _0x3ec6ae=function(_0x106234){while(--_0x106234){_0x5b0df2['push'](_0x5b0df2['shift']());}};_0x3ec6ae(++_0x30877c);}(_0x122a,0xba));var _0xa122=function(_0xce1a3,_0x3bc785){_0xce1a3=_0xce1a3-0x0;var _0x487cca=_0x122a[_0xce1a3];return _0x487cca;};'use strict';var Sequelize=require(_0xa122('0x0'));module[_0xa122('0x1')]={'name':{'type':Sequelize[_0xa122('0x2')],'allowNull':![],'unique':_0xa122('0x3')},'table':{'type':Sequelize[_0xa122('0x2')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x85d3=['sequelize','exports','STRING','TEXT'];(function(_0x195c21,_0x332612){var _0x3576a8=function(_0xa4bde2){while(--_0xa4bde2){_0x195c21['push'](_0x195c21['shift']());}};_0x3576a8(++_0x332612);}(_0x85d3,0xc8));var _0x385d=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x85d3[_0x5ddb1c];return _0x354adc;};'use strict';var Sequelize=require(_0x385d('0x0'));module[_0x385d('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x385d('0x2')]},'metric':{'type':Sequelize[_0x385d('0x3')]},'description':{'type':Sequelize[_0x385d('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 9622883..ef468cd 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 _0x7217=['Content-Range','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticMetric','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set'];(function(_0x54aa8f,_0xa74c2a){var _0x14d0c8=function(_0x184152){while(--_0x184152){_0x54aa8f['push'](_0x54aa8f['shift']());}};_0x14d0c8(++_0xa74c2a);}(_0x7217,0x19e));var _0x7721=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0x7217[_0x1b349a];return _0x5d1f7c;};'use strict';var emlformat=require(_0x7721('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7721('0x1'));var jsonpatch=require(_0x7721('0x2'));var rp=require(_0x7721('0x3'));var moment=require(_0x7721('0x4'));var BPromise=require(_0x7721('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7721('0x6'));var sox=require(_0x7721('0x7'));var csv=require(_0x7721('0x8'));var ejs=require(_0x7721('0x9'));var fs=require('fs');var fs_extra=require(_0x7721('0xa'));var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x8'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7721('0x14'));var hardwareService=require(_0x7721('0x15'));var logger=require(_0x7721('0x16'))(_0x7721('0x17'));var utils=require(_0x7721('0x18'));var config=require(_0x7721('0x19'));var licenseUtil=require(_0x7721('0x1a'));var db=require(_0x7721('0x1b'))['db'];function respondWithStatusCode(_0x55b4ca,_0x2911ec){_0x2911ec=_0x2911ec||0xcc;return function(_0x199930){if(_0x199930){return _0x55b4ca['sendStatus'](_0x2911ec);}return _0x55b4ca[_0x7721('0x1c')](_0x2911ec)[_0x7721('0x1d')]();};}function respondWithResult(_0x3f01c5,_0x2e9752){_0x2e9752=_0x2e9752||0xc8;return function(_0x5069da){if(_0x5069da){return _0x3f01c5[_0x7721('0x1c')](_0x2e9752)[_0x7721('0x1e')](_0x5069da);}};}function respondWithFilteredResult(_0x534f1b,_0x4e199a){return function(_0x4b183e){if(_0x4b183e){var _0x5ed54=typeof _0x4e199a[_0x7721('0x1f')]===_0x7721('0x20')&&typeof _0x4e199a[_0x7721('0x21')]==='undefined';var _0x20f669=_0x4b183e['count'];var _0x3fc09e=_0x5ed54?0x0:_0x4e199a['offset'];var _0xfec626=_0x5ed54?_0x4b183e[_0x7721('0x22')]:_0x4e199a[_0x7721('0x1f')]+_0x4e199a[_0x7721('0x21')];var _0x2286e5;if(_0xfec626>=_0x20f669){_0xfec626=_0x20f669;_0x2286e5=0xc8;}else{_0x2286e5=0xce;}_0x534f1b[_0x7721('0x1c')](_0x2286e5);return _0x534f1b[_0x7721('0x23')](_0x7721('0x24'),_0x3fc09e+'-'+_0xfec626+'/'+_0x20f669)[_0x7721('0x1e')](_0x4b183e);}return null;};}function patchUpdates(_0xaeccc4){return function(_0x4ce1db){try{jsonpatch[_0x7721('0x25')](_0x4ce1db,_0xaeccc4,!![]);}catch(_0x2c1583){return BPromise[_0x7721('0x26')](_0x2c1583);}return _0x4ce1db[_0x7721('0x27')]();};}function saveUpdates(_0x57140c,_0x28f5a6){return function(_0x512f31){if(_0x512f31){return _0x512f31[_0x7721('0x28')](_0x57140c)[_0x7721('0x29')](function(_0x3e8a4e){return _0x3e8a4e;});}return null;};}function removeEntity(_0x1caad8,_0x121cc4){return function(_0x395b15){if(_0x395b15){return _0x395b15[_0x7721('0x2a')]()['then'](function(){var _0x216f20=_0x395b15[_0x7721('0x2b')]({'plain':!![]});var _0x125564=_0x7721('0x2c');return db[_0x7721('0x2d')][_0x7721('0x2a')]({'where':{'type':_0x125564,'resourceId':_0x216f20['id']}})[_0x7721('0x29')](function(){return _0x395b15;});})[_0x7721('0x29')](function(){_0x1caad8[_0x7721('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x258ddf,_0x5b0551){return function(_0x499b87){if(!_0x499b87){_0x258ddf[_0x7721('0x2e')](0x194);}return _0x499b87;};}function handleError(_0x343c19,_0x53c904){_0x53c904=_0x53c904||0x1f4;return function(_0x158d98){logger[_0x7721('0x2f')](_0x158d98[_0x7721('0x30')]);if(_0x158d98[_0x7721('0x31')]){delete _0x158d98[_0x7721('0x31')];}_0x343c19['status'](_0x53c904)[_0x7721('0x32')](_0x158d98);};}exports[_0x7721('0x33')]=function(_0x497f9f,_0x4a25c9){var _0xfde9ec={},_0x220bbf={},_0x48f329={'count':0x0,'rows':[]};var _0x46f772=_[_0x7721('0x34')](db[_0x7721('0x35')]['rawAttributes'],function(_0x3d9a32){return{'name':_0x3d9a32[_0x7721('0x36')],'type':_0x3d9a32[_0x7721('0x37')][_0x7721('0x38')]};});_0x220bbf[_0x7721('0x39')]=_['map'](_0x46f772,_0x7721('0x31'));_0x220bbf[_0x7721('0x3a')]=_[_0x7721('0x3b')](_0x497f9f['query']);_0x220bbf[_0x7721('0x3c')]=_[_0x7721('0x3d')](_0x220bbf['model'],_0x220bbf[_0x7721('0x3a')]);_0xfde9ec['attributes']=_[_0x7721('0x3d')](_0x220bbf[_0x7721('0x39')],qs[_0x7721('0x3e')](_0x497f9f[_0x7721('0x3a')][_0x7721('0x3e')]));_0xfde9ec[_0x7721('0x3f')]=_0xfde9ec[_0x7721('0x3f')][_0x7721('0x40')]?_0xfde9ec[_0x7721('0x3f')]:_0x220bbf[_0x7721('0x39')];if(!_0x497f9f[_0x7721('0x3a')]['hasOwnProperty'](_0x7721('0x41'))){_0xfde9ec['limit']=qs[_0x7721('0x21')](_0x497f9f[_0x7721('0x3a')][_0x7721('0x21')]);_0xfde9ec[_0x7721('0x1f')]=qs[_0x7721('0x1f')](_0x497f9f[_0x7721('0x3a')]['offset']);}_0xfde9ec['order']=qs['sort'](_0x497f9f['query'][_0x7721('0x42')]);_0xfde9ec[_0x7721('0x43')]=qs[_0x7721('0x3c')](_[_0x7721('0x44')](_0x497f9f['query'],_0x220bbf[_0x7721('0x3c')]),_0x46f772);if(_0x497f9f['query'][_0x7721('0x45')]){_0xfde9ec[_0x7721('0x43')]=_['merge'](_0xfde9ec[_0x7721('0x43')],{'$or':_[_0x7721('0x34')](_0x46f772,function(_0x4e77ff){if(_0x4e77ff['type']!==_0x7721('0x46')){var _0xfc4dc4={};_0xfc4dc4[_0x4e77ff[_0x7721('0x31')]]={'$like':'%'+_0x497f9f[_0x7721('0x3a')]['filter']+'%'};return _0xfc4dc4;}})});}_0xfde9ec=_[_0x7721('0x47')]({},_0xfde9ec,_0x497f9f[_0x7721('0x48')]);var _0x40ce8c={'where':_0xfde9ec[_0x7721('0x43')]};return db[_0x7721('0x35')]['count'](_0x40ce8c)[_0x7721('0x29')](function(_0x4a2c28){_0x48f329[_0x7721('0x22')]=_0x4a2c28;if(_0x497f9f['query'][_0x7721('0x49')]){_0xfde9ec[_0x7721('0x4a')]=[{'all':!![]}];}return db[_0x7721('0x35')]['findAll'](_0xfde9ec);})[_0x7721('0x29')](function(_0x11d853){_0x48f329[_0x7721('0x4b')]=_0x11d853;return _0x48f329;})['then'](respondWithFilteredResult(_0x4a25c9,_0xfde9ec))[_0x7721('0x4c')](handleError(_0x4a25c9,null));};exports[_0x7721('0x4d')]=function(_0xdb3033,_0x2d5f35){var _0x135dbc={'raw':!![],'where':{'id':_0xdb3033[_0x7721('0x4e')]['id']}},_0x57d09b={};_0x57d09b['model']=_['keys'](db[_0x7721('0x35')][_0x7721('0x4f')]);_0x57d09b[_0x7721('0x3a')]=_[_0x7721('0x3b')](_0xdb3033[_0x7721('0x3a')]);_0x57d09b[_0x7721('0x3c')]=_[_0x7721('0x3d')](_0x57d09b[_0x7721('0x39')],_0x57d09b[_0x7721('0x3a')]);_0x135dbc[_0x7721('0x3f')]=_['intersection'](_0x57d09b['model'],qs[_0x7721('0x3e')](_0xdb3033[_0x7721('0x3a')][_0x7721('0x3e')]));_0x135dbc[_0x7721('0x3f')]=_0x135dbc['attributes'][_0x7721('0x40')]?_0x135dbc[_0x7721('0x3f')]:_0x57d09b['model'];if(_0xdb3033[_0x7721('0x3a')]['includeAll']){_0x135dbc[_0x7721('0x4a')]=[{'all':!![]}];}_0x135dbc=_['merge']({},_0x135dbc,_0xdb3033[_0x7721('0x48')]);return db[_0x7721('0x35')][_0x7721('0x50')](_0x135dbc)['then'](handleEntityNotFound(_0x2d5f35,null))[_0x7721('0x29')](respondWithResult(_0x2d5f35,null))[_0x7721('0x4c')](handleError(_0x2d5f35,null));};exports['create']=function(_0x223d93,_0x1196c2){return db[_0x7721('0x35')]['create'](_0x223d93[_0x7721('0x51')],{})['then'](function(_0xdb1ca8){var _0x310549=_0x223d93[_0x7721('0x52')][_0x7721('0x2b')]({'plain':!![]});if(!_0x310549)throw new Error(_0x7721('0x53'));if(_0x310549[_0x7721('0x54')]===_0x7721('0x52')){var _0x7fbb73=_0xdb1ca8[_0x7721('0x2b')]({'plain':!![]});var _0x3386aa=_0x7721('0x2c');return db[_0x7721('0x55')][_0x7721('0x50')]({'where':{'name':_0x3386aa,'userProfileId':_0x310549[_0x7721('0x56')]},'raw':!![]})[_0x7721('0x29')](function(_0x5b741d){if(_0x5b741d&&_0x5b741d[_0x7721('0x57')]===0x0){return db[_0x7721('0x2d')][_0x7721('0x58')]({'name':_0x7fbb73[_0x7721('0x31')],'resourceId':_0x7fbb73['id'],'type':_0x5b741d[_0x7721('0x31')],'sectionId':_0x5b741d['id']},{})[_0x7721('0x29')](function(){return _0xdb1ca8;});}else{return _0xdb1ca8;}})[_0x7721('0x4c')](function(_0x57484c){logger[_0x7721('0x2f')](_0x7721('0x59'),_0x57484c);throw _0x57484c;});}return _0xdb1ca8;})[_0x7721('0x29')](respondWithResult(_0x1196c2,0xc9))[_0x7721('0x4c')](handleError(_0x1196c2,null));};exports[_0x7721('0x28')]=function(_0x9c0d4,_0x7fbd6c){if(_0x9c0d4[_0x7721('0x51')]['id']){delete _0x9c0d4[_0x7721('0x51')]['id'];}return db[_0x7721('0x35')][_0x7721('0x50')]({'where':{'id':_0x9c0d4['params']['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x7fbd6c,null))[_0x7721('0x29')](saveUpdates(_0x9c0d4[_0x7721('0x51')],null))[_0x7721('0x29')](respondWithResult(_0x7fbd6c,null))[_0x7721('0x4c')](handleError(_0x7fbd6c,null));};exports[_0x7721('0x2a')]=function(_0x41644f,_0x36fe6f){return db[_0x7721('0x35')][_0x7721('0x50')]({'where':{'id':_0x41644f[_0x7721('0x4e')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x36fe6f,null))[_0x7721('0x29')](removeEntity(_0x36fe6f,null))[_0x7721('0x4c')](handleError(_0x36fe6f,null));};
\ No newline at end of file
+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(_0x4bbe43,_0x1d6970){var _0x23d12d=function(_0x209c89){while(--_0x209c89){_0x4bbe43['push'](_0x4bbe43['shift']());}};_0x23d12d(++_0x1d6970);}(_0xdc97,0x13b));var _0x7dc9=function(_0x11ce14,_0x63b980){_0x11ce14=_0x11ce14-0x0;var _0x1a9497=_0xdc97[_0x11ce14];return _0x1a9497;};'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
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 593286e..4c180f4 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 _0xa13d=['lodash','../../config/logger','api','bluebird','path','rimraf','exports','define','AnalyticMetric','analytics_metrics'];(function(_0x1b01f6,_0x57d583){var _0x1f67af=function(_0x1838e2){while(--_0x1838e2){_0x1b01f6['push'](_0x1b01f6['shift']());}};_0x1f67af(++_0x57d583);}(_0xa13d,0x154));var _0xda13=function(_0x27a03c,_0x193b87){_0x27a03c=_0x27a03c-0x0;var _0x180b3d=_0xa13d[_0x27a03c];return _0x180b3d;};'use strict';var _=require(_0xda13('0x0'));var util=require('util');var logger=require(_0xda13('0x1'))(_0xda13('0x2'));var moment=require('moment');var BPromise=require(_0xda13('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xda13('0x4'));var rimraf=require(_0xda13('0x5'));var config=require('../../config/environment');var attributes=require('./analyticMetric.attributes');module[_0xda13('0x6')]=function(_0x3d5a0e,_0x4df317){return _0x3d5a0e[_0xda13('0x7')](_0xda13('0x8'),attributes,{'tableName':_0xda13('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x018c=['../../config/logger','bluebird','path','rimraf','../../config/environment','./analyticMetric.attributes','define','AnalyticMetric','analytics_metrics','lodash','util'];(function(_0x590aa0,_0x3a72f9){var _0x3022ae=function(_0x3e248e){while(--_0x3e248e){_0x590aa0['push'](_0x590aa0['shift']());}};_0x3022ae(++_0x3a72f9);}(_0x018c,0xda));var _0xc018=function(_0xd3bf4d,_0x1bf0ab){_0xd3bf4d=_0xd3bf4d-0x0;var _0x348d09=_0x018c[_0xd3bf4d];return _0x348d09;};'use strict';var _=require(_0xc018('0x0'));var util=require(_0xc018('0x1'));var logger=require(_0xc018('0x2'))('api');var moment=require('moment');var BPromise=require(_0xc018('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc018('0x4'));var rimraf=require(_0xc018('0x5'));var config=require(_0xc018('0x6'));var attributes=require(_0xc018('0x7'));module['exports']=function(_0x3785b0,_0x26e41a){return _0x3785b0[_0xc018('0x8')](_0xc018('0x9'),attributes,{'tableName':_0xc018('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 2e69f7b..471057d 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 _0x994c=['../../config/logger','jayson/promise','then','info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticMetric,\x20%s,\x20%s','message','result','catch','lodash','../../mysqldb','../../config/utils'];(function(_0x21a173,_0x1f6b9a){var _0x244d96=function(_0x2aea9f){while(--_0x2aea9f){_0x21a173['push'](_0x21a173['shift']());}};_0x244d96(++_0x1f6b9a);}(_0x994c,0x1a6));var _0xc994=function(_0x46867e,_0x90e3a2){_0x46867e=_0x46867e-0x0;var _0x19ff44=_0x994c[_0x46867e];return _0x19ff44;};'use strict';var _=require(_0xc994('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc994('0x1'))['db'];var utils=require(_0xc994('0x2'));var logger=require(_0xc994('0x3'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc994('0x4'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x43ee1c,_0x187ff1,_0xc826a6){return new BPromise(function(_0x33fdae,_0xfa7652){return client['request'](_0x43ee1c,_0xc826a6)[_0xc994('0x5')](function(_0x546f25){logger[_0xc994('0x6')]('AnalyticMetric,\x20%s,\x20%s',_0x187ff1,_0xc994('0x7'));logger[_0xc994('0x8')](_0xc994('0x9'),_0x187ff1,_0xc994('0x7'),JSON[_0xc994('0xa')](_0x546f25));if(_0x546f25['error']){if(_0x546f25[_0xc994('0xb')][_0xc994('0xc')]===0x1f4){logger[_0xc994('0xb')](_0xc994('0xd'),_0x187ff1,_0x546f25[_0xc994('0xb')]['message']);return _0xfa7652(_0x546f25[_0xc994('0xb')][_0xc994('0xe')]);}logger[_0xc994('0xb')](_0xc994('0xd'),_0x187ff1,_0x546f25[_0xc994('0xb')][_0xc994('0xe')]);return _0x33fdae(_0x546f25['error'][_0xc994('0xe')]);}else{logger[_0xc994('0x6')]('AnalyticMetric,\x20%s,\x20%s',_0x187ff1,_0xc994('0x7'));_0x33fdae(_0x546f25[_0xc994('0xf')]['message']);}})[_0xc994('0x10')](function(_0x4aca44){logger[_0xc994('0xb')](_0xc994('0xd'),_0x187ff1,_0x4aca44);_0xfa7652(_0x4aca44);});});}
\ No newline at end of file
+var _0xd56b=['AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','AnalyticMetric,\x20%s,\x20%s'];(function(_0x631749,_0xd9cf96){var _0x27fca1=function(_0x323bf5){while(--_0x323bf5){_0x631749['push'](_0x631749['shift']());}};_0x27fca1(++_0xd9cf96);}(_0xd56b,0xf6));var _0xbd56=function(_0x47e111,_0x43d53f){_0x47e111=_0x47e111-0x0;var _0x215e2a=_0xd56b[_0x47e111];return _0x215e2a;};'use strict';var _=require(_0xbd56('0x0'));var util=require(_0xbd56('0x1'));var moment=require('moment');var BPromise=require(_0xbd56('0x2'));var rs=require(_0xbd56('0x3'));var fs=require('fs');var Redis=require(_0xbd56('0x4'));var db=require(_0xbd56('0x5'))['db'];var utils=require(_0xbd56('0x6'));var logger=require(_0xbd56('0x7'))('rpc');var config=require(_0xbd56('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbd56('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x157247,_0x4344e7,_0x320697){return new BPromise(function(_0x6d970e,_0x2cbdce){return client[_0xbd56('0xa')](_0x157247,_0x320697)[_0xbd56('0xb')](function(_0x37bf96){logger[_0xbd56('0xc')](_0xbd56('0xd'),_0x4344e7,'request\x20sent');logger['debug'](_0xbd56('0xe'),_0x4344e7,_0xbd56('0xf'),JSON['stringify'](_0x37bf96));if(_0x37bf96[_0xbd56('0x10')]){if(_0x37bf96[_0xbd56('0x10')][_0xbd56('0x11')]===0x1f4){logger[_0xbd56('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x4344e7,_0x37bf96['error'][_0xbd56('0x12')]);return _0x2cbdce(_0x37bf96['error']['message']);}logger['error'](_0xbd56('0xd'),_0x4344e7,_0x37bf96['error'][_0xbd56('0x12')]);return _0x6d970e(_0x37bf96[_0xbd56('0x10')][_0xbd56('0x12')]);}else{logger[_0xbd56('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x4344e7,_0xbd56('0xf'));_0x6d970e(_0x37bf96[_0xbd56('0x13')][_0xbd56('0x12')]);}})['catch'](function(_0x55c19f){logger[_0xbd56('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x4344e7,_0x55c19f);_0x2cbdce(_0x55c19f);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index b916082..b29e2ac 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 _0xcd59=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x381332,_0x5a8b6c){var _0x4846e1=function(_0x4c31f8){while(--_0x4c31f8){_0x381332['push'](_0x381332['shift']());}};_0x4846e1(++_0x5a8b6c);}(_0xcd59,0x14b));var _0x9cd5=function(_0x214266,_0x1f6f52){_0x214266=_0x214266-0x0;var _0x568f75=_0xcd59[_0x214266];return _0x568f75;};'use strict';var multer=require(_0x9cd5('0x0'));var util=require(_0x9cd5('0x1'));var path=require(_0x9cd5('0x2'));var timeout=require(_0x9cd5('0x3'));var express=require(_0x9cd5('0x4'));var router=express[_0x9cd5('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9cd5('0x6'));var interaction=require(_0x9cd5('0x7'));var config=require(_0x9cd5('0x8'));var controller=require(_0x9cd5('0x9'));router[_0x9cd5('0xa')]('/',auth[_0x9cd5('0xb')](),controller[_0x9cd5('0xc')]);router[_0x9cd5('0xa')](_0x9cd5('0xd'),auth[_0x9cd5('0xb')](),controller['show']);router[_0x9cd5('0xe')]('/',auth[_0x9cd5('0xb')](),controller[_0x9cd5('0xf')]);router[_0x9cd5('0x10')](_0x9cd5('0xd'),auth[_0x9cd5('0xb')](),controller[_0x9cd5('0x11')]);router[_0x9cd5('0x12')]('/:id',auth[_0x9cd5('0xb')](),controller[_0x9cd5('0x13')]);module[_0x9cd5('0x14')]=router;
\ No newline at end of file
+var _0xe314=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','index','get','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports','util','path'];(function(_0x2895c4,_0x51c4fb){var _0x5864aa=function(_0x38b8d2){while(--_0x38b8d2){_0x2895c4['push'](_0x2895c4['shift']());}};_0x5864aa(++_0x51c4fb);}(_0xe314,0x7c));var _0x4e31=function(_0x3bcf4f,_0x507a7b){_0x3bcf4f=_0x3bcf4f-0x0;var _0x26d549=_0xe314[_0x3bcf4f];return _0x26d549;};'use strict';var multer=require('multer');var util=require(_0x4e31('0x0'));var path=require(_0x4e31('0x1'));var timeout=require(_0x4e31('0x2'));var express=require(_0x4e31('0x3'));var router=express[_0x4e31('0x4')]();var fs_extra=require(_0x4e31('0x5'));var auth=require(_0x4e31('0x6'));var interaction=require(_0x4e31('0x7'));var config=require(_0x4e31('0x8'));var controller=require(_0x4e31('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x4e31('0xa')]);router[_0x4e31('0xb')](_0x4e31('0xc'),auth[_0x4e31('0xd')](),controller[_0x4e31('0xe')]);router[_0x4e31('0xf')]('/',auth['isAuthenticated'](),controller[_0x4e31('0x10')]);router[_0x4e31('0x11')](_0x4e31('0xc'),auth[_0x4e31('0xd')](),controller['update']);router[_0x4e31('0x12')](_0x4e31('0xc'),auth[_0x4e31('0xd')](),controller[_0x4e31('0x13')]);module[_0x4e31('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 170a90f..dd16ef1 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 _0x6f93=['sequelize','exports','TEXT'];(function(_0x32bf8b,_0x2ac32b){var _0x1e5ef5=function(_0x36acec){while(--_0x36acec){_0x32bf8b['push'](_0x32bf8b['shift']());}};_0x1e5ef5(++_0x2ac32b);}(_0x6f93,0x1ef));var _0x36f9=function(_0x52be16,_0x4be7bf){_0x52be16=_0x52be16-0x0;var _0x56e3ac=_0x6f93[_0x52be16];return _0x56e3ac;};'use strict';var Sequelize=require(_0x36f9('0x0'));module[_0x36f9('0x1')]={'tree':{'type':Sequelize[_0x36f9('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0xb093=['sequelize','exports'];(function(_0x5ec55f,_0x589f0b){var _0x580939=function(_0x135003){while(--_0x135003){_0x5ec55f['push'](_0x5ec55f['shift']());}};_0x580939(++_0x589f0b);}(_0xb093,0xa2));var _0x3b09=function(_0x4ac5c4,_0x31fe47){_0x4ac5c4=_0x4ac5c4-0x0;var _0x3e2698=_0xb093[_0x4ac5c4];return _0x3e2698;};'use strict';var Sequelize=require(_0x3b09('0x0'));module[_0x3b09('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index ab3e1d6..02c2b14 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 _0x193d=['findAll','rows','catch','show','params','include','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','name','send','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll'];(function(_0x481e02,_0x3c99bb){var _0x10445d=function(_0x218071){while(--_0x218071){_0x481e02['push'](_0x481e02['shift']());}};_0x10445d(++_0x3c99bb);}(_0x193d,0xed));var _0xd193=function(_0x55821d,_0x27a22e){_0x55821d=_0x55821d-0x0;var _0x58ea8a=_0x193d[_0x55821d];return _0x58ea8a;};'use strict';var emlformat=require(_0xd193('0x0'));var rimraf=require(_0xd193('0x1'));var zipdir=require(_0xd193('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd193('0x3'));var moment=require(_0xd193('0x4'));var BPromise=require(_0xd193('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd193('0x6'));var sox=require(_0xd193('0x7'));var csv=require(_0xd193('0x8'));var ejs=require(_0xd193('0x9'));var fs=require('fs');var fs_extra=require(_0xd193('0xa'));var _=require(_0xd193('0xb'));var squel=require('squel');var crypto=require(_0xd193('0xc'));var jsforce=require(_0xd193('0xd'));var deskjs=require(_0xd193('0xe'));var toCsv=require(_0xd193('0x8'));var querystring=require('querystring');var Papa=require(_0xd193('0xf'));var Redis=require(_0xd193('0x10'));var authService=require(_0xd193('0x11'));var qs=require(_0xd193('0x12'));var as=require(_0xd193('0x13'));var hardwareService=require(_0xd193('0x14'));var logger=require(_0xd193('0x15'))(_0xd193('0x16'));var utils=require('../../config/utils');var config=require(_0xd193('0x17'));var licenseUtil=require(_0xd193('0x18'));var db=require(_0xd193('0x19'))['db'];function respondWithStatusCode(_0x39cee1,_0x297a7a){_0x297a7a=_0x297a7a||0xcc;return function(_0x1708a7){if(_0x1708a7){return _0x39cee1['sendStatus'](_0x297a7a);}return _0x39cee1[_0xd193('0x1a')](_0x297a7a)[_0xd193('0x1b')]();};}function respondWithResult(_0x33b518,_0x5c9135){_0x5c9135=_0x5c9135||0xc8;return function(_0x5970e6){if(_0x5970e6){return _0x33b518[_0xd193('0x1a')](_0x5c9135)[_0xd193('0x1c')](_0x5970e6);}};}function respondWithFilteredResult(_0x58d385,_0x2efe22){return function(_0x2cf664){if(_0x2cf664){var _0x3eecdd=typeof _0x2efe22[_0xd193('0x1d')]===_0xd193('0x1e')&&typeof _0x2efe22[_0xd193('0x1f')]===_0xd193('0x1e');var _0xb2311d=_0x2cf664[_0xd193('0x20')];var _0x5a4ce4=_0x3eecdd?0x0:_0x2efe22[_0xd193('0x1d')];var _0x4cfc0a=_0x3eecdd?_0x2cf664[_0xd193('0x20')]:_0x2efe22[_0xd193('0x1d')]+_0x2efe22['limit'];var _0x276155;if(_0x4cfc0a>=_0xb2311d){_0x4cfc0a=_0xb2311d;_0x276155=0xc8;}else{_0x276155=0xce;}_0x58d385[_0xd193('0x1a')](_0x276155);return _0x58d385[_0xd193('0x21')]('Content-Range',_0x5a4ce4+'-'+_0x4cfc0a+'/'+_0xb2311d)['json'](_0x2cf664);}return null;};}function patchUpdates(_0x3856e7){return function(_0x724308){try{jsonpatch[_0xd193('0x22')](_0x724308,_0x3856e7,!![]);}catch(_0x16071a){return BPromise[_0xd193('0x23')](_0x16071a);}return _0x724308[_0xd193('0x24')]();};}function saveUpdates(_0x528a13,_0x16070c){return function(_0x65a887){if(_0x65a887){return _0x65a887[_0xd193('0x25')](_0x528a13)[_0xd193('0x26')](function(_0x560376){return _0x560376;});}return null;};}function removeEntity(_0x17b746,_0x3b90a4){return function(_0x4ff4de){if(_0x4ff4de){return _0x4ff4de[_0xd193('0x27')]()[_0xd193('0x26')](function(){_0x17b746[_0xd193('0x1a')](0xcc)[_0xd193('0x1b')]();});}};}function handleEntityNotFound(_0x5ac428,_0x121985){return function(_0x530f12){if(!_0x530f12){_0x5ac428['sendStatus'](0x194);}return _0x530f12;};}function handleError(_0x4c7166,_0x42c096){_0x42c096=_0x42c096||0x1f4;return function(_0x5ed7c3){logger[_0xd193('0x28')](_0x5ed7c3['stack']);if(_0x5ed7c3[_0xd193('0x29')]){delete _0x5ed7c3[_0xd193('0x29')];}_0x4c7166[_0xd193('0x1a')](_0x42c096)[_0xd193('0x2a')](_0x5ed7c3);};}exports['index']=function(_0x4d344a,_0x308e84){var _0x4cc4af={},_0x55f16a={},_0x1e0769={'count':0x0,'rows':[]};var _0x46eead=_[_0xd193('0x2b')](db[_0xd193('0x2c')][_0xd193('0x2d')],function(_0xd81afe){return{'name':_0xd81afe[_0xd193('0x2e')],'type':_0xd81afe[_0xd193('0x2f')][_0xd193('0x30')]};});_0x55f16a[_0xd193('0x31')]=_[_0xd193('0x2b')](_0x46eead,_0xd193('0x29'));_0x55f16a[_0xd193('0x32')]=_[_0xd193('0x33')](_0x4d344a[_0xd193('0x32')]);_0x55f16a[_0xd193('0x34')]=_[_0xd193('0x35')](_0x55f16a[_0xd193('0x31')],_0x55f16a[_0xd193('0x32')]);_0x4cc4af[_0xd193('0x36')]=_[_0xd193('0x35')](_0x55f16a[_0xd193('0x31')],qs['fields'](_0x4d344a[_0xd193('0x32')][_0xd193('0x37')]));_0x4cc4af['attributes']=_0x4cc4af[_0xd193('0x36')][_0xd193('0x38')]?_0x4cc4af[_0xd193('0x36')]:_0x55f16a[_0xd193('0x31')];if(!_0x4d344a[_0xd193('0x32')][_0xd193('0x39')](_0xd193('0x3a'))){_0x4cc4af[_0xd193('0x1f')]=qs['limit'](_0x4d344a['query'][_0xd193('0x1f')]);_0x4cc4af['offset']=qs['offset'](_0x4d344a['query'][_0xd193('0x1d')]);}_0x4cc4af[_0xd193('0x3b')]=qs[_0xd193('0x3c')](_0x4d344a[_0xd193('0x32')]['sort']);_0x4cc4af[_0xd193('0x3d')]=qs['filters'](_['pick'](_0x4d344a[_0xd193('0x32')],_0x55f16a[_0xd193('0x34')]),_0x46eead);if(_0x4d344a[_0xd193('0x32')]['filter']){_0x4cc4af[_0xd193('0x3d')]=_[_0xd193('0x3e')](_0x4cc4af['where'],{'$or':_['map'](_0x46eead,function(_0x37fcf0){if(_0x37fcf0['type']!==_0xd193('0x3f')){var _0x1c8f54={};_0x1c8f54[_0x37fcf0[_0xd193('0x29')]]={'$like':'%'+_0x4d344a[_0xd193('0x32')][_0xd193('0x40')]+'%'};return _0x1c8f54;}})});}_0x4cc4af=_[_0xd193('0x3e')]({},_0x4cc4af,_0x4d344a[_0xd193('0x41')]);var _0x2fca26={'where':_0x4cc4af[_0xd193('0x3d')]};return db['AnalyticTreeReport'][_0xd193('0x20')](_0x2fca26)['then'](function(_0x23c6b9){_0x1e0769[_0xd193('0x20')]=_0x23c6b9;if(_0x4d344a['query'][_0xd193('0x42')]){_0x4cc4af['include']=[{'all':!![]}];}return db[_0xd193('0x2c')][_0xd193('0x43')](_0x4cc4af);})[_0xd193('0x26')](function(_0x1773d9){_0x1e0769[_0xd193('0x44')]=_0x1773d9;return _0x1e0769;})[_0xd193('0x26')](respondWithFilteredResult(_0x308e84,_0x4cc4af))[_0xd193('0x45')](handleError(_0x308e84,null));};exports[_0xd193('0x46')]=function(_0x4914df,_0x3b13ab){var _0x110c48={'raw':!![],'where':{'id':_0x4914df[_0xd193('0x47')]['id']}},_0x5cda81={};_0x5cda81[_0xd193('0x31')]=_[_0xd193('0x33')](db['AnalyticTreeReport'][_0xd193('0x2d')]);_0x5cda81['query']=_['keys'](_0x4914df[_0xd193('0x32')]);_0x5cda81[_0xd193('0x34')]=_[_0xd193('0x35')](_0x5cda81['model'],_0x5cda81[_0xd193('0x32')]);_0x110c48[_0xd193('0x36')]=_[_0xd193('0x35')](_0x5cda81[_0xd193('0x31')],qs[_0xd193('0x37')](_0x4914df[_0xd193('0x32')][_0xd193('0x37')]));_0x110c48[_0xd193('0x36')]=_0x110c48['attributes'][_0xd193('0x38')]?_0x110c48['attributes']:_0x5cda81[_0xd193('0x31')];if(_0x4914df[_0xd193('0x32')]['includeAll']){_0x110c48[_0xd193('0x48')]=[{'all':!![]}];}_0x110c48=_['merge']({},_0x110c48,_0x4914df[_0xd193('0x41')]);return db['AnalyticTreeReport'][_0xd193('0x49')](_0x110c48)[_0xd193('0x26')](handleEntityNotFound(_0x3b13ab,null))['then'](respondWithResult(_0x3b13ab,null))[_0xd193('0x45')](handleError(_0x3b13ab,null));};exports[_0xd193('0x4a')]=function(_0x1a46b1,_0xdc9c2f){return db['AnalyticTreeReport'][_0xd193('0x4a')](_0x1a46b1[_0xd193('0x4b')],{})[_0xd193('0x26')](respondWithResult(_0xdc9c2f,0xc9))[_0xd193('0x45')](handleError(_0xdc9c2f,null));};exports[_0xd193('0x25')]=function(_0x20bd64,_0x4c7766){if(_0x20bd64['body']['id']){delete _0x20bd64[_0xd193('0x4b')]['id'];}return db[_0xd193('0x2c')][_0xd193('0x49')]({'where':{'id':_0x20bd64[_0xd193('0x47')]['id']}})[_0xd193('0x26')](handleEntityNotFound(_0x4c7766,null))[_0xd193('0x26')](saveUpdates(_0x20bd64[_0xd193('0x4b')],null))[_0xd193('0x26')](respondWithResult(_0x4c7766,null))['catch'](handleError(_0x4c7766,null));};exports[_0xd193('0x27')]=function(_0x2b4a62,_0x5ade38){return db[_0xd193('0x2c')]['find']({'where':{'id':_0x2b4a62[_0xd193('0x47')]['id']}})[_0xd193('0x26')](handleEntityNotFound(_0x5ade38,null))['then'](removeEntity(_0x5ade38,null))[_0xd193('0x45')](handleError(_0x5ade38,null));};
\ No newline at end of file
+var _0xaf16=['fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','catch','show','params','options','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs'];(function(_0x5b1097,_0x3ed62f){var _0x57979c=function(_0x512f68){while(--_0x512f68){_0x5b1097['push'](_0x5b1097['shift']());}};_0x57979c(++_0x3ed62f);}(_0xaf16,0x1b1));var _0x6af1=function(_0x30fdf9,_0x89096d){_0x30fdf9=_0x30fdf9-0x0;var _0x3c43bb=_0xaf16[_0x30fdf9];return _0x3c43bb;};'use strict';var emlformat=require(_0x6af1('0x0'));var rimraf=require(_0x6af1('0x1'));var zipdir=require(_0x6af1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6af1('0x3'));var moment=require(_0x6af1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6af1('0x5'));var util=require(_0x6af1('0x6'));var path=require(_0x6af1('0x7'));var sox=require(_0x6af1('0x8'));var csv=require(_0x6af1('0x9'));var ejs=require(_0x6af1('0xa'));var fs=require('fs');var fs_extra=require(_0x6af1('0xb'));var _=require(_0x6af1('0xc'));var squel=require(_0x6af1('0xd'));var crypto=require(_0x6af1('0xe'));var jsforce=require(_0x6af1('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x6af1('0x9'));var querystring=require(_0x6af1('0x10'));var Papa=require(_0x6af1('0x11'));var Redis=require(_0x6af1('0x12'));var authService=require(_0x6af1('0x13'));var qs=require(_0x6af1('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6af1('0x15'));var logger=require(_0x6af1('0x16'))(_0x6af1('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6af1('0x18'))['db'];function respondWithStatusCode(_0x1e4ce3,_0x992e92){_0x992e92=_0x992e92||0xcc;return function(_0x3dc11f){if(_0x3dc11f){return _0x1e4ce3[_0x6af1('0x19')](_0x992e92);}return _0x1e4ce3[_0x6af1('0x1a')](_0x992e92)[_0x6af1('0x1b')]();};}function respondWithResult(_0x5ca7e1,_0x174690){_0x174690=_0x174690||0xc8;return function(_0x28e48e){if(_0x28e48e){return _0x5ca7e1[_0x6af1('0x1a')](_0x174690)['json'](_0x28e48e);}};}function respondWithFilteredResult(_0x42ea8f,_0x4f6e23){return function(_0x24da0f){if(_0x24da0f){var _0x2b0078=typeof _0x4f6e23[_0x6af1('0x1c')]===_0x6af1('0x1d')&&typeof _0x4f6e23[_0x6af1('0x1e')]===_0x6af1('0x1d');var _0x1bd6bc=_0x24da0f[_0x6af1('0x1f')];var _0x525ab8=_0x2b0078?0x0:_0x4f6e23[_0x6af1('0x1c')];var _0x2af040=_0x2b0078?_0x24da0f[_0x6af1('0x1f')]:_0x4f6e23[_0x6af1('0x1c')]+_0x4f6e23['limit'];var _0x1ca0ab;if(_0x2af040>=_0x1bd6bc){_0x2af040=_0x1bd6bc;_0x1ca0ab=0xc8;}else{_0x1ca0ab=0xce;}_0x42ea8f[_0x6af1('0x1a')](_0x1ca0ab);return _0x42ea8f[_0x6af1('0x20')](_0x6af1('0x21'),_0x525ab8+'-'+_0x2af040+'/'+_0x1bd6bc)['json'](_0x24da0f);}return null;};}function patchUpdates(_0x1d814e){return function(_0x4beb3a){try{jsonpatch[_0x6af1('0x22')](_0x4beb3a,_0x1d814e,!![]);}catch(_0x1abfce){return BPromise[_0x6af1('0x23')](_0x1abfce);}return _0x4beb3a['save']();};}function saveUpdates(_0x4011c4,_0x1edec5){return function(_0x1c3611){if(_0x1c3611){return _0x1c3611[_0x6af1('0x24')](_0x4011c4)[_0x6af1('0x25')](function(_0x165362){return _0x165362;});}return null;};}function removeEntity(_0xa4f7a8,_0x5b81f4){return function(_0xc46a2d){if(_0xc46a2d){return _0xc46a2d[_0x6af1('0x26')]()[_0x6af1('0x25')](function(){_0xa4f7a8[_0x6af1('0x1a')](0xcc)[_0x6af1('0x1b')]();});}};}function handleEntityNotFound(_0x7b5f5b,_0x13306f){return function(_0x3437ee){if(!_0x3437ee){_0x7b5f5b['sendStatus'](0x194);}return _0x3437ee;};}function handleError(_0x4df345,_0x267443){_0x267443=_0x267443||0x1f4;return function(_0x2ddc85){logger[_0x6af1('0x27')](_0x2ddc85[_0x6af1('0x28')]);if(_0x2ddc85[_0x6af1('0x29')]){delete _0x2ddc85[_0x6af1('0x29')];}_0x4df345[_0x6af1('0x1a')](_0x267443)[_0x6af1('0x2a')](_0x2ddc85);};}exports['index']=function(_0x4bd8a4,_0x3b8bc8){var _0x1f6ec1={},_0xce59eb={},_0x16b3ec={'count':0x0,'rows':[]};var _0x119ed2=_[_0x6af1('0x2b')](db[_0x6af1('0x2c')][_0x6af1('0x2d')],function(_0x53194a){return{'name':_0x53194a[_0x6af1('0x2e')],'type':_0x53194a[_0x6af1('0x2f')][_0x6af1('0x30')]};});_0xce59eb[_0x6af1('0x31')]=_[_0x6af1('0x2b')](_0x119ed2,_0x6af1('0x29'));_0xce59eb['query']=_[_0x6af1('0x32')](_0x4bd8a4['query']);_0xce59eb[_0x6af1('0x33')]=_[_0x6af1('0x34')](_0xce59eb[_0x6af1('0x31')],_0xce59eb[_0x6af1('0x35')]);_0x1f6ec1['attributes']=_['intersection'](_0xce59eb['model'],qs['fields'](_0x4bd8a4[_0x6af1('0x35')][_0x6af1('0x36')]));_0x1f6ec1[_0x6af1('0x37')]=_0x1f6ec1[_0x6af1('0x37')][_0x6af1('0x38')]?_0x1f6ec1['attributes']:_0xce59eb[_0x6af1('0x31')];if(!_0x4bd8a4[_0x6af1('0x35')]['hasOwnProperty'](_0x6af1('0x39'))){_0x1f6ec1[_0x6af1('0x1e')]=qs[_0x6af1('0x1e')](_0x4bd8a4[_0x6af1('0x35')][_0x6af1('0x1e')]);_0x1f6ec1[_0x6af1('0x1c')]=qs[_0x6af1('0x1c')](_0x4bd8a4['query'][_0x6af1('0x1c')]);}_0x1f6ec1[_0x6af1('0x3a')]=qs[_0x6af1('0x3b')](_0x4bd8a4[_0x6af1('0x35')]['sort']);_0x1f6ec1[_0x6af1('0x3c')]=qs[_0x6af1('0x33')](_[_0x6af1('0x3d')](_0x4bd8a4[_0x6af1('0x35')],_0xce59eb[_0x6af1('0x33')]),_0x119ed2);if(_0x4bd8a4[_0x6af1('0x35')][_0x6af1('0x3e')]){_0x1f6ec1['where']=_[_0x6af1('0x3f')](_0x1f6ec1[_0x6af1('0x3c')],{'$or':_[_0x6af1('0x2b')](_0x119ed2,function(_0x26df21){if(_0x26df21['type']!==_0x6af1('0x40')){var _0xd9e92a={};_0xd9e92a[_0x26df21[_0x6af1('0x29')]]={'$like':'%'+_0x4bd8a4[_0x6af1('0x35')][_0x6af1('0x3e')]+'%'};return _0xd9e92a;}})});}_0x1f6ec1=_[_0x6af1('0x3f')]({},_0x1f6ec1,_0x4bd8a4['options']);var _0xb0aef1={'where':_0x1f6ec1[_0x6af1('0x3c')]};return db[_0x6af1('0x2c')]['count'](_0xb0aef1)['then'](function(_0x37809b){_0x16b3ec[_0x6af1('0x1f')]=_0x37809b;if(_0x4bd8a4[_0x6af1('0x35')][_0x6af1('0x41')]){_0x1f6ec1[_0x6af1('0x42')]=[{'all':!![]}];}return db['AnalyticTreeReport']['findAll'](_0x1f6ec1);})[_0x6af1('0x25')](function(_0xc80213){_0x16b3ec['rows']=_0xc80213;return _0x16b3ec;})[_0x6af1('0x25')](respondWithFilteredResult(_0x3b8bc8,_0x1f6ec1))[_0x6af1('0x43')](handleError(_0x3b8bc8,null));};exports[_0x6af1('0x44')]=function(_0x59b7f8,_0x72b25){var _0x5c93c4={'raw':!![],'where':{'id':_0x59b7f8[_0x6af1('0x45')]['id']}},_0xf515c2={};_0xf515c2['model']=_[_0x6af1('0x32')](db[_0x6af1('0x2c')][_0x6af1('0x2d')]);_0xf515c2[_0x6af1('0x35')]=_[_0x6af1('0x32')](_0x59b7f8[_0x6af1('0x35')]);_0xf515c2[_0x6af1('0x33')]=_[_0x6af1('0x34')](_0xf515c2[_0x6af1('0x31')],_0xf515c2[_0x6af1('0x35')]);_0x5c93c4[_0x6af1('0x37')]=_[_0x6af1('0x34')](_0xf515c2[_0x6af1('0x31')],qs[_0x6af1('0x36')](_0x59b7f8[_0x6af1('0x35')][_0x6af1('0x36')]));_0x5c93c4[_0x6af1('0x37')]=_0x5c93c4[_0x6af1('0x37')]['length']?_0x5c93c4[_0x6af1('0x37')]:_0xf515c2[_0x6af1('0x31')];if(_0x59b7f8[_0x6af1('0x35')]['includeAll']){_0x5c93c4[_0x6af1('0x42')]=[{'all':!![]}];}_0x5c93c4=_[_0x6af1('0x3f')]({},_0x5c93c4,_0x59b7f8[_0x6af1('0x46')]);return db[_0x6af1('0x2c')][_0x6af1('0x47')](_0x5c93c4)[_0x6af1('0x25')](handleEntityNotFound(_0x72b25,null))['then'](respondWithResult(_0x72b25,null))['catch'](handleError(_0x72b25,null));};exports[_0x6af1('0x48')]=function(_0x5f1beb,_0x163ce2){return db['AnalyticTreeReport']['create'](_0x5f1beb['body'],{})[_0x6af1('0x25')](respondWithResult(_0x163ce2,0xc9))[_0x6af1('0x43')](handleError(_0x163ce2,null));};exports[_0x6af1('0x24')]=function(_0x3170de,_0x2fc29b){if(_0x3170de[_0x6af1('0x49')]['id']){delete _0x3170de[_0x6af1('0x49')]['id'];}return db[_0x6af1('0x2c')][_0x6af1('0x47')]({'where':{'id':_0x3170de['params']['id']}})['then'](handleEntityNotFound(_0x2fc29b,null))['then'](saveUpdates(_0x3170de[_0x6af1('0x49')],null))[_0x6af1('0x25')](respondWithResult(_0x2fc29b,null))[_0x6af1('0x43')](handleError(_0x2fc29b,null));};exports[_0x6af1('0x26')]=function(_0x2aee3d,_0x302a5e){return db[_0x6af1('0x2c')][_0x6af1('0x47')]({'where':{'id':_0x2aee3d[_0x6af1('0x45')]['id']}})[_0x6af1('0x25')](handleEntityNotFound(_0x302a5e,null))[_0x6af1('0x25')](removeEntity(_0x302a5e,null))[_0x6af1('0x43')](handleError(_0x302a5e,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 8a7bff4..3ea13a5 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 _0x0933=['exports','AnalyticTreeReport','analytics_report_trees','lodash','../../config/logger','api','moment','bluebird','path','rimraf','./analyticTreeReport.attributes'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x0933,0x1b0));var _0x3093=function(_0x5f4c21,_0x38ac14){_0x5f4c21=_0x5f4c21-0x0;var _0x4fc10a=_0x0933[_0x5f4c21];return _0x4fc10a;};'use strict';var _=require(_0x3093('0x0'));var util=require('util');var logger=require(_0x3093('0x1'))(_0x3093('0x2'));var moment=require(_0x3093('0x3'));var BPromise=require(_0x3093('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3093('0x5'));var rimraf=require(_0x3093('0x6'));var config=require('../../config/environment');var attributes=require(_0x3093('0x7'));module[_0x3093('0x8')]=function(_0x406415,_0x2051ab){return _0x406415['define'](_0x3093('0x9'),attributes,{'tableName':_0x3093('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf4f1=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','define','AnalyticTreeReport','analytics_report_trees'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xf4f1,0xb6));var _0x1f4f=function(_0x58abb7,_0x3bbc46){_0x58abb7=_0x58abb7-0x0;var _0x258ba5=_0xf4f1[_0x58abb7];return _0x258ba5;};'use strict';var _=require(_0x1f4f('0x0'));var util=require(_0x1f4f('0x1'));var logger=require(_0x1f4f('0x2'))(_0x1f4f('0x3'));var moment=require('moment');var BPromise=require(_0x1f4f('0x4'));var rp=require(_0x1f4f('0x5'));var fs=require('fs');var path=require(_0x1f4f('0x6'));var rimraf=require(_0x1f4f('0x7'));var config=require(_0x1f4f('0x8'));var attributes=require(_0x1f4f('0x9'));module['exports']=function(_0x5a196f,_0x196c93){return _0x5a196f[_0x1f4f('0xa')](_0x1f4f('0xb'),attributes,{'tableName':_0x1f4f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index 962f64a..840205b 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 _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x1ea520,_0x1a98e9){var _0x58455c=function(_0x48d933){while(--_0x48d933){_0x1ea520['push'](_0x1ea520['shift']());}};_0x58455c(++_0x1a98e9);}(_0x5f66,0x1a0));var _0x65f6=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x5f66[_0x164eca];return _0x2ce562;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('AnalyticTreeReport,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});}
\ No newline at end of file
+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(_0x2b28bb,_0x2b1ca7){var _0x1b4b59=function(_0x51b5de){while(--_0x51b5de){_0x2b28bb['push'](_0x2b28bb['shift']());}};_0x1b4b59(++_0x2b1ca7);}(_0x2ef3,0xba));var _0x32ef=function(_0x1c7268,_0x8eea27){_0x1c7268=_0x1c7268-0x0;var _0x368775=_0x2ef3[_0x1c7268];return _0x368775;};'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
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 6921870..39f4a88 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 _0x885d=['isAuthenticated','index','/:id','show','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x885d,0xd9));var _0xd885=function(_0x2ca616,_0x384ec8){_0x2ca616=_0x2ca616-0x0;var _0x53155f=_0x885d[_0x2ca616];return _0x53155f;};'use strict';var multer=require(_0xd885('0x0'));var util=require(_0xd885('0x1'));var path=require(_0xd885('0x2'));var timeout=require(_0xd885('0x3'));var express=require(_0xd885('0x4'));var router=express[_0xd885('0x5')]();var fs_extra=require(_0xd885('0x6'));var auth=require(_0xd885('0x7'));var interaction=require(_0xd885('0x8'));var config=require(_0xd885('0x9'));var controller=require('./analyticTreeReport.controller');router[_0xd885('0xa')]('/',auth[_0xd885('0xb')](),controller[_0xd885('0xc')]);router[_0xd885('0xa')](_0xd885('0xd'),auth['isAuthenticated'](),controller[_0xd885('0xe')]);router['post']('/',auth[_0xd885('0xb')](),controller['create']);router['put'](_0xd885('0xd'),auth[_0xd885('0xb')](),controller[_0xd885('0xf')]);router[_0xd885('0x10')](_0xd885('0xd'),auth[_0xd885('0xb')](),controller[_0xd885('0x11')]);module[_0xd885('0x12')]=router;
\ No newline at end of file
+var _0xe9a6=['path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','multer','util'];(function(_0x18b14e,_0x534b38){var _0x237952=function(_0x8878e6){while(--_0x8878e6){_0x18b14e['push'](_0x18b14e['shift']());}};_0x237952(++_0x534b38);}(_0xe9a6,0x102));var _0x6e9a=function(_0x4bec28,_0x86928e){_0x4bec28=_0x4bec28-0x0;var _0x242aec=_0xe9a6[_0x4bec28];return _0x242aec;};'use strict';var multer=require(_0x6e9a('0x0'));var util=require(_0x6e9a('0x1'));var path=require(_0x6e9a('0x2'));var timeout=require(_0x6e9a('0x3'));var express=require('express');var router=express[_0x6e9a('0x4')]();var fs_extra=require(_0x6e9a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6e9a('0x6'));var config=require(_0x6e9a('0x7'));var controller=require(_0x6e9a('0x8'));router[_0x6e9a('0x9')]('/',auth[_0x6e9a('0xa')](),controller[_0x6e9a('0xb')]);router['get'](_0x6e9a('0xc'),auth[_0x6e9a('0xa')](),controller[_0x6e9a('0xd')]);router[_0x6e9a('0xe')]('/',auth[_0x6e9a('0xa')](),controller[_0x6e9a('0xf')]);router[_0x6e9a('0x10')](_0x6e9a('0xc'),auth[_0x6e9a('0xa')](),controller[_0x6e9a('0x11')]);router[_0x6e9a('0x12')](_0x6e9a('0xc'),auth['isAuthenticated'](),controller[_0x6e9a('0x13')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index f648c62..f4b8f1b 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 _0x03bc=['sequelize','STRING'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0x03bc,0xb8));var _0xc03b=function(_0x29cdb8,_0x33a9d6){_0x29cdb8=_0x29cdb8-0x0;var _0x42f164=_0x03bc[_0x29cdb8];return _0x42f164;};'use strict';var Sequelize=require(_0xc03b('0x0'));module['exports']={'name':{'type':Sequelize[_0xc03b('0x1')]},'basename':{'type':Sequelize[_0xc03b('0x1')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xaced=['sequelize','exports','STRING'];(function(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0xaced,0x18c));var _0xdace=function(_0x4cb17e,_0x3db434){_0x4cb17e=_0x4cb17e-0x0;var _0x4e97d5=_0xaced[_0x4cb17e];return _0x4e97d5;};'use strict';var Sequelize=require(_0xdace('0x0'));module[_0xdace('0x1')]={'name':{'type':Sequelize[_0xdace('0x2')]},'basename':{'type':Sequelize[_0xdace('0x2')]},'type':{'type':Sequelize[_0xdace('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 544a618..536a139 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 _0x47c5=['findAll','rows','catch','show','params','rawAttributes','find','clone','get','omit','createdAt','updatedAt','body','create','originalname','basename','filename','download','findOne','join','root','server/files/attachments/','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','Attachment','model','keys','query','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','map','type','VIRTUAL','options','includeAll','include'];(function(_0x5a0a76,_0x22e7c0){var _0x24affc=function(_0x10335e){while(--_0x10335e){_0x5a0a76['push'](_0x5a0a76['shift']());}};_0x24affc(++_0x22e7c0);}(_0x47c5,0x71));var _0x547c=function(_0x5d6105,_0x1f5ca9){_0x5d6105=_0x5d6105-0x0;var _0x15f36e=_0x47c5[_0x5d6105];return _0x15f36e;};'use strict';var emlformat=require(_0x547c('0x0'));var rimraf=require(_0x547c('0x1'));var zipdir=require(_0x547c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x547c('0x3'));var moment=require(_0x547c('0x4'));var BPromise=require(_0x547c('0x5'));var Mustache=require(_0x547c('0x6'));var util=require(_0x547c('0x7'));var path=require(_0x547c('0x8'));var sox=require(_0x547c('0x9'));var csv=require(_0x547c('0xa'));var ejs=require(_0x547c('0xb'));var fs=require('fs');var fs_extra=require(_0x547c('0xc'));var _=require(_0x547c('0xd'));var squel=require(_0x547c('0xe'));var crypto=require(_0x547c('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x547c('0x10'));var toCsv=require(_0x547c('0xa'));var querystring=require(_0x547c('0x11'));var Papa=require(_0x547c('0x12'));var Redis=require(_0x547c('0x13'));var authService=require(_0x547c('0x14'));var qs=require(_0x547c('0x15'));var as=require(_0x547c('0x16'));var hardwareService=require(_0x547c('0x17'));var logger=require(_0x547c('0x18'))(_0x547c('0x19'));var utils=require('../../config/utils');var config=require(_0x547c('0x1a'));var licenseUtil=require(_0x547c('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27160c,_0x3b38fb){_0x3b38fb=_0x3b38fb||0xcc;return function(_0xa97d74){if(_0xa97d74){return _0x27160c[_0x547c('0x1c')](_0x3b38fb);}return _0x27160c[_0x547c('0x1d')](_0x3b38fb)[_0x547c('0x1e')]();};}function respondWithResult(_0x39c9cf,_0x50a4d8){_0x50a4d8=_0x50a4d8||0xc8;return function(_0x1c7480){if(_0x1c7480){return _0x39c9cf[_0x547c('0x1d')](_0x50a4d8)[_0x547c('0x1f')](_0x1c7480);}};}function respondWithFilteredResult(_0x5f4249,_0x49ef03){return function(_0x40f7da){if(_0x40f7da){var _0x5ef3db=typeof _0x49ef03[_0x547c('0x20')]===_0x547c('0x21')&&typeof _0x49ef03[_0x547c('0x22')]==='undefined';var _0x27301e=_0x40f7da[_0x547c('0x23')];var _0x3a47d4=_0x5ef3db?0x0:_0x49ef03[_0x547c('0x20')];var _0x3bd5f8=_0x5ef3db?_0x40f7da[_0x547c('0x23')]:_0x49ef03[_0x547c('0x20')]+_0x49ef03[_0x547c('0x22')];var _0x5c744c;if(_0x3bd5f8>=_0x27301e){_0x3bd5f8=_0x27301e;_0x5c744c=0xc8;}else{_0x5c744c=0xce;}_0x5f4249['status'](_0x5c744c);return _0x5f4249['set'](_0x547c('0x24'),_0x3a47d4+'-'+_0x3bd5f8+'/'+_0x27301e)[_0x547c('0x1f')](_0x40f7da);}return null;};}function patchUpdates(_0x745903){return function(_0x1d951b){try{jsonpatch[_0x547c('0x25')](_0x1d951b,_0x745903,!![]);}catch(_0x423370){return BPromise[_0x547c('0x26')](_0x423370);}return _0x1d951b[_0x547c('0x27')]();};}function saveUpdates(_0x42c422,_0x168897){return function(_0xfe3d31){if(_0xfe3d31){return _0xfe3d31[_0x547c('0x28')](_0x42c422)['then'](function(_0x46ae17){return _0x46ae17;});}return null;};}function removeEntity(_0x34c3da,_0x25ee1f){return function(_0xd7f740){if(_0xd7f740){return _0xd7f740[_0x547c('0x29')]()[_0x547c('0x2a')](function(){_0x34c3da['status'](0xcc)[_0x547c('0x1e')]();});}};}function handleEntityNotFound(_0x3a1f53,_0x536c9a){return function(_0x2f9331){if(!_0x2f9331){_0x3a1f53[_0x547c('0x1c')](0x194);}return _0x2f9331;};}function handleError(_0x15c1e6,_0x5edc6f){_0x5edc6f=_0x5edc6f||0x1f4;return function(_0x42ce16){logger[_0x547c('0x2b')](_0x42ce16[_0x547c('0x2c')]);if(_0x42ce16[_0x547c('0x2d')]){delete _0x42ce16[_0x547c('0x2d')];}_0x15c1e6['status'](_0x5edc6f)[_0x547c('0x2e')](_0x42ce16);};}exports[_0x547c('0x2f')]=function(_0x325b6a,_0xdcd61){var _0x19e589={},_0x19c883={},_0x10a188={'count':0x0,'rows':[]};var _0x117947=_['map'](db[_0x547c('0x30')]['rawAttributes'],function(_0x1d086a){return{'name':_0x1d086a['fieldName'],'type':_0x1d086a['type']['key']};});_0x19c883[_0x547c('0x31')]=_['map'](_0x117947,_0x547c('0x2d'));_0x19c883['query']=_[_0x547c('0x32')](_0x325b6a[_0x547c('0x33')]);_0x19c883['filters']=_[_0x547c('0x34')](_0x19c883[_0x547c('0x31')],_0x19c883[_0x547c('0x33')]);_0x19e589[_0x547c('0x35')]=_[_0x547c('0x34')](_0x19c883[_0x547c('0x31')],qs[_0x547c('0x36')](_0x325b6a[_0x547c('0x33')][_0x547c('0x36')]));_0x19e589[_0x547c('0x35')]=_0x19e589[_0x547c('0x35')][_0x547c('0x37')]?_0x19e589[_0x547c('0x35')]:_0x19c883[_0x547c('0x31')];if(!_0x325b6a[_0x547c('0x33')]['hasOwnProperty'](_0x547c('0x38'))){_0x19e589[_0x547c('0x22')]=qs[_0x547c('0x22')](_0x325b6a[_0x547c('0x33')][_0x547c('0x22')]);_0x19e589['offset']=qs[_0x547c('0x20')](_0x325b6a[_0x547c('0x33')][_0x547c('0x20')]);}_0x19e589[_0x547c('0x39')]=qs[_0x547c('0x3a')](_0x325b6a[_0x547c('0x33')]['sort']);_0x19e589['where']=qs['filters'](_[_0x547c('0x3b')](_0x325b6a['query'],_0x19c883['filters']),_0x117947);if(_0x325b6a[_0x547c('0x33')][_0x547c('0x3c')]){_0x19e589[_0x547c('0x3d')]=_[_0x547c('0x3e')](_0x19e589[_0x547c('0x3d')],{'$or':_[_0x547c('0x3f')](_0x117947,function(_0x4f323){if(_0x4f323[_0x547c('0x40')]!==_0x547c('0x41')){var _0x37e3cb={};_0x37e3cb[_0x4f323[_0x547c('0x2d')]]={'$like':'%'+_0x325b6a[_0x547c('0x33')][_0x547c('0x3c')]+'%'};return _0x37e3cb;}})});}_0x19e589=_[_0x547c('0x3e')]({},_0x19e589,_0x325b6a[_0x547c('0x42')]);var _0xde4749={'where':_0x19e589[_0x547c('0x3d')]};return db[_0x547c('0x30')][_0x547c('0x23')](_0xde4749)['then'](function(_0x3059b1){_0x10a188[_0x547c('0x23')]=_0x3059b1;if(_0x325b6a[_0x547c('0x33')][_0x547c('0x43')]){_0x19e589[_0x547c('0x44')]=[{'all':!![]}];}return db[_0x547c('0x30')][_0x547c('0x45')](_0x19e589);})[_0x547c('0x2a')](function(_0x85e4e0){_0x10a188[_0x547c('0x46')]=_0x85e4e0;return _0x10a188;})[_0x547c('0x2a')](respondWithFilteredResult(_0xdcd61,_0x19e589))[_0x547c('0x47')](handleError(_0xdcd61,null));};exports[_0x547c('0x48')]=function(_0x515f6c,_0xdd15e4){var _0x42268f={'raw':!![],'where':{'id':_0x515f6c[_0x547c('0x49')]['id']}},_0x327572={};_0x327572[_0x547c('0x31')]=_[_0x547c('0x32')](db[_0x547c('0x30')][_0x547c('0x4a')]);_0x327572[_0x547c('0x33')]=_['keys'](_0x515f6c[_0x547c('0x33')]);_0x327572['filters']=_['intersection'](_0x327572[_0x547c('0x31')],_0x327572['query']);_0x42268f[_0x547c('0x35')]=_['intersection'](_0x327572[_0x547c('0x31')],qs[_0x547c('0x36')](_0x515f6c[_0x547c('0x33')][_0x547c('0x36')]));_0x42268f[_0x547c('0x35')]=_0x42268f['attributes'][_0x547c('0x37')]?_0x42268f[_0x547c('0x35')]:_0x327572[_0x547c('0x31')];if(_0x515f6c[_0x547c('0x33')][_0x547c('0x43')]){_0x42268f[_0x547c('0x44')]=[{'all':!![]}];}_0x42268f=_[_0x547c('0x3e')]({},_0x42268f,_0x515f6c[_0x547c('0x42')]);return db[_0x547c('0x30')][_0x547c('0x4b')](_0x42268f)[_0x547c('0x2a')](handleEntityNotFound(_0xdd15e4,null))[_0x547c('0x2a')](respondWithResult(_0xdd15e4,null))[_0x547c('0x47')](handleError(_0xdd15e4,null));};exports[_0x547c('0x4c')]=function(_0x371cc7,_0x16871c){var _0x77476e={'where':{'id':_0x371cc7[_0x547c('0x49')]['id']}},_0x582342={};_0x582342[_0x547c('0x31')]=_['keys'](db[_0x547c('0x30')]['rawAttributes']);_0x77476e[_0x547c('0x35')]=_[_0x547c('0x34')](_0x582342[_0x547c('0x31')],qs[_0x547c('0x36')](_0x371cc7['query']['fields']));_0x77476e[_0x547c('0x35')]=_0x77476e[_0x547c('0x35')][_0x547c('0x37')]?_0x77476e[_0x547c('0x35')]:_0x582342[_0x547c('0x31')];if(_0x371cc7[_0x547c('0x33')]['includeAll']){_0x77476e[_0x547c('0x44')]=[{'all':!![]}];}_0x77476e=_['merge']({},_0x77476e,_0x371cc7[_0x547c('0x42')]);return db[_0x547c('0x30')][_0x547c('0x4b')](_0x77476e)[_0x547c('0x2a')](handleEntityNotFound(_0x16871c,null))[_0x547c('0x2a')](function(_0x89bda1){if(_0x89bda1){var _0x530adc=_0x89bda1[_0x547c('0x4d')]({'plain':!![]});_0x530adc=qs[_0x547c('0x4e')](_0x530adc,['id',_0x547c('0x4f'),_0x547c('0x50')]);_0x371cc7[_0x547c('0x51')]=_[_0x547c('0x4e')](_0x371cc7[_0x547c('0x51')],['id',_0x547c('0x4f'),_0x547c('0x50')]);return db[_0x547c('0x30')][_0x547c('0x52')](_[_0x547c('0x3e')](_0x530adc,_0x371cc7[_0x547c('0x51')]),{'include':_0x371cc7[_0x547c('0x33')][_0x547c('0x43')]?[{'all':!![]}]:undefined});}})[_0x547c('0x2a')](respondWithResult(_0x16871c,0xc9))[_0x547c('0x47')](handleError(_0x16871c,null));};exports[_0x547c('0x28')]=function(_0x58d68d,_0x490cc9){if(_0x58d68d[_0x547c('0x51')]['id']){delete _0x58d68d[_0x547c('0x51')]['id'];}return db['Attachment'][_0x547c('0x4b')]({'where':{'id':_0x58d68d[_0x547c('0x49')]['id']}})['then'](handleEntityNotFound(_0x490cc9,null))['then'](saveUpdates(_0x58d68d[_0x547c('0x51')],null))[_0x547c('0x2a')](respondWithResult(_0x490cc9,null))[_0x547c('0x47')](handleError(_0x490cc9,null));};exports['destroy']=function(_0x20bf1a,_0x20e0b3){return db[_0x547c('0x30')][_0x547c('0x4b')]({'where':{'id':_0x20bf1a['params']['id']}})[_0x547c('0x2a')](handleEntityNotFound(_0x20e0b3,null))['then'](removeEntity(_0x20e0b3,null))[_0x547c('0x47')](handleError(_0x20e0b3,null));};exports[_0x547c('0x52')]=function(_0x45c5d7,_0x3ee9a3,_0xe0453b){_0x45c5d7[_0x547c('0x51')][_0x547c('0x2d')]=_0x45c5d7['file'][_0x547c('0x53')];_0x45c5d7[_0x547c('0x51')][_0x547c('0x54')]=_0x45c5d7['file'][_0x547c('0x55')];_0x45c5d7[_0x547c('0x51')][_0x547c('0x40')]=_0x45c5d7['file']['mimetype'];return db['Attachment'][_0x547c('0x52')](_0x45c5d7[_0x547c('0x51')])[_0x547c('0x2a')](respondWithResult(_0x3ee9a3,0xc9))['catch'](handleError(_0x3ee9a3,null));};exports[_0x547c('0x56')]=function(_0xb671a1,_0x5aa0e5,_0xc768f){return db[_0x547c('0x30')][_0x547c('0x57')]({'where':{'id':_0xb671a1['params']['id']},'raw':!![]})[_0x547c('0x2a')](handleEntityNotFound(_0x5aa0e5,null))[_0x547c('0x2a')](function(_0x48d0c2){if(_0x48d0c2){var _0x45583d=_0x48d0c2['ChatOfflineMessageId']!==null;var _0x4a9aff=path[_0x547c('0x58')](config[_0x547c('0x59')],_0x547c('0x5a'));if(_0x45583d){_0x4a9aff=path[_0x547c('0x58')](_0x4a9aff,'offline-chat/');}var _0x7681ef=path['join'](_0x4a9aff,_0x48d0c2['basename']);return _0x5aa0e5[_0x547c('0x56')](_0x7681ef);}})[_0x547c('0x47')](handleError(_0x5aa0e5,null));};
\ No newline at end of file
+var _0xa841=['include','findAll','rows','catch','show','params','find','clone','get','createdAt','updatedAt','body','omit','create','update','destroy','file','mimetype','findOne','root','server/files/attachments/','join','basename','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','apply','save','then','stack','send','rawAttributes','fieldName','type','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','Attachment','includeAll'];(function(_0x3d8ea6,_0x206d58){var _0x395c96=function(_0x18601d){while(--_0x18601d){_0x3d8ea6['push'](_0x3d8ea6['shift']());}};_0x395c96(++_0x206d58);}(_0xa841,0x11d));var _0x1a84=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xa841[_0x413feb];return _0x40ee88;};'use strict';var emlformat=require(_0x1a84('0x0'));var rimraf=require(_0x1a84('0x1'));var zipdir=require(_0x1a84('0x2'));var jsonpatch=require(_0x1a84('0x3'));var rp=require(_0x1a84('0x4'));var moment=require(_0x1a84('0x5'));var BPromise=require(_0x1a84('0x6'));var Mustache=require(_0x1a84('0x7'));var util=require(_0x1a84('0x8'));var path=require('path');var sox=require(_0x1a84('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1a84('0xa'));var _=require('lodash');var squel=require(_0x1a84('0xb'));var crypto=require(_0x1a84('0xc'));var jsforce=require(_0x1a84('0xd'));var deskjs=require(_0x1a84('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1a84('0xf'));var Papa=require(_0x1a84('0x10'));var Redis=require(_0x1a84('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1a84('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1a84('0x13'))(_0x1a84('0x14'));var utils=require(_0x1a84('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1a84('0x16'));var db=require(_0x1a84('0x17'))['db'];function respondWithStatusCode(_0x4b4aef,_0x1b6fb1){_0x1b6fb1=_0x1b6fb1||0xcc;return function(_0x355cba){if(_0x355cba){return _0x4b4aef[_0x1a84('0x18')](_0x1b6fb1);}return _0x4b4aef['status'](_0x1b6fb1)[_0x1a84('0x19')]();};}function respondWithResult(_0x265fbf,_0x329851){_0x329851=_0x329851||0xc8;return function(_0x224cf5){if(_0x224cf5){return _0x265fbf[_0x1a84('0x1a')](_0x329851)[_0x1a84('0x1b')](_0x224cf5);}};}function respondWithFilteredResult(_0x4d4012,_0x2ef1ca){return function(_0x4ab2ca){if(_0x4ab2ca){var _0x1b703f=typeof _0x2ef1ca['offset']==='undefined'&&typeof _0x2ef1ca[_0x1a84('0x1c')]===_0x1a84('0x1d');var _0x1c25ee=_0x4ab2ca[_0x1a84('0x1e')];var _0x149384=_0x1b703f?0x0:_0x2ef1ca[_0x1a84('0x1f')];var _0xde855b=_0x1b703f?_0x4ab2ca[_0x1a84('0x1e')]:_0x2ef1ca[_0x1a84('0x1f')]+_0x2ef1ca[_0x1a84('0x1c')];var _0x4ca65b;if(_0xde855b>=_0x1c25ee){_0xde855b=_0x1c25ee;_0x4ca65b=0xc8;}else{_0x4ca65b=0xce;}_0x4d4012[_0x1a84('0x1a')](_0x4ca65b);return _0x4d4012[_0x1a84('0x20')](_0x1a84('0x21'),_0x149384+'-'+_0xde855b+'/'+_0x1c25ee)[_0x1a84('0x1b')](_0x4ab2ca);}return null;};}function patchUpdates(_0xb9f205){return function(_0x1b801e){try{jsonpatch[_0x1a84('0x22')](_0x1b801e,_0xb9f205,!![]);}catch(_0x2e291b){return BPromise['reject'](_0x2e291b);}return _0x1b801e[_0x1a84('0x23')]();};}function saveUpdates(_0x3476cb,_0x2ebe2e){return function(_0x2b2aaf){if(_0x2b2aaf){return _0x2b2aaf['update'](_0x3476cb)[_0x1a84('0x24')](function(_0x3d4f20){return _0x3d4f20;});}return null;};}function removeEntity(_0x10a960,_0x4831c0){return function(_0x42a919){if(_0x42a919){return _0x42a919['destroy']()['then'](function(){_0x10a960[_0x1a84('0x1a')](0xcc)[_0x1a84('0x19')]();});}};}function handleEntityNotFound(_0x37b4f0,_0xa1416){return function(_0x44ea9a){if(!_0x44ea9a){_0x37b4f0[_0x1a84('0x18')](0x194);}return _0x44ea9a;};}function handleError(_0x5d31c8,_0x482a6c){_0x482a6c=_0x482a6c||0x1f4;return function(_0x51b156){logger['error'](_0x51b156[_0x1a84('0x25')]);if(_0x51b156['name']){delete _0x51b156['name'];}_0x5d31c8[_0x1a84('0x1a')](_0x482a6c)[_0x1a84('0x26')](_0x51b156);};}exports['index']=function(_0x5ec742,_0x5b280e){var _0x4d96c9={},_0xcc2da2={},_0x4805e3={'count':0x0,'rows':[]};var _0x233395=_['map'](db['Attachment'][_0x1a84('0x27')],function(_0x2c1f76){return{'name':_0x2c1f76[_0x1a84('0x28')],'type':_0x2c1f76[_0x1a84('0x29')]['key']};});_0xcc2da2[_0x1a84('0x2a')]=_[_0x1a84('0x2b')](_0x233395,_0x1a84('0x2c'));_0xcc2da2[_0x1a84('0x2d')]=_[_0x1a84('0x2e')](_0x5ec742['query']);_0xcc2da2[_0x1a84('0x2f')]=_[_0x1a84('0x30')](_0xcc2da2['model'],_0xcc2da2[_0x1a84('0x2d')]);_0x4d96c9[_0x1a84('0x31')]=_[_0x1a84('0x30')](_0xcc2da2[_0x1a84('0x2a')],qs[_0x1a84('0x32')](_0x5ec742[_0x1a84('0x2d')]['fields']));_0x4d96c9[_0x1a84('0x31')]=_0x4d96c9[_0x1a84('0x31')][_0x1a84('0x33')]?_0x4d96c9[_0x1a84('0x31')]:_0xcc2da2[_0x1a84('0x2a')];if(!_0x5ec742[_0x1a84('0x2d')][_0x1a84('0x34')]('nolimit')){_0x4d96c9[_0x1a84('0x1c')]=qs[_0x1a84('0x1c')](_0x5ec742[_0x1a84('0x2d')][_0x1a84('0x1c')]);_0x4d96c9[_0x1a84('0x1f')]=qs[_0x1a84('0x1f')](_0x5ec742[_0x1a84('0x2d')][_0x1a84('0x1f')]);}_0x4d96c9[_0x1a84('0x35')]=qs[_0x1a84('0x36')](_0x5ec742[_0x1a84('0x2d')][_0x1a84('0x36')]);_0x4d96c9[_0x1a84('0x37')]=qs[_0x1a84('0x2f')](_[_0x1a84('0x38')](_0x5ec742[_0x1a84('0x2d')],_0xcc2da2[_0x1a84('0x2f')]),_0x233395);if(_0x5ec742[_0x1a84('0x2d')][_0x1a84('0x39')]){_0x4d96c9[_0x1a84('0x37')]=_[_0x1a84('0x3a')](_0x4d96c9['where'],{'$or':_[_0x1a84('0x2b')](_0x233395,function(_0x55838e){if(_0x55838e[_0x1a84('0x29')]!==_0x1a84('0x3b')){var _0x2efc0a={};_0x2efc0a[_0x55838e['name']]={'$like':'%'+_0x5ec742['query'][_0x1a84('0x39')]+'%'};return _0x2efc0a;}})});}_0x4d96c9=_[_0x1a84('0x3a')]({},_0x4d96c9,_0x5ec742[_0x1a84('0x3c')]);var _0x259621={'where':_0x4d96c9[_0x1a84('0x37')]};return db[_0x1a84('0x3d')]['count'](_0x259621)[_0x1a84('0x24')](function(_0x38c079){_0x4805e3[_0x1a84('0x1e')]=_0x38c079;if(_0x5ec742['query'][_0x1a84('0x3e')]){_0x4d96c9[_0x1a84('0x3f')]=[{'all':!![]}];}return db[_0x1a84('0x3d')][_0x1a84('0x40')](_0x4d96c9);})['then'](function(_0x5ac8f1){_0x4805e3[_0x1a84('0x41')]=_0x5ac8f1;return _0x4805e3;})[_0x1a84('0x24')](respondWithFilteredResult(_0x5b280e,_0x4d96c9))[_0x1a84('0x42')](handleError(_0x5b280e,null));};exports[_0x1a84('0x43')]=function(_0x3f1d85,_0x29b519){var _0x4ae1a3={'raw':!![],'where':{'id':_0x3f1d85[_0x1a84('0x44')]['id']}},_0x4be049={};_0x4be049[_0x1a84('0x2a')]=_[_0x1a84('0x2e')](db[_0x1a84('0x3d')]['rawAttributes']);_0x4be049[_0x1a84('0x2d')]=_[_0x1a84('0x2e')](_0x3f1d85[_0x1a84('0x2d')]);_0x4be049[_0x1a84('0x2f')]=_['intersection'](_0x4be049[_0x1a84('0x2a')],_0x4be049[_0x1a84('0x2d')]);_0x4ae1a3[_0x1a84('0x31')]=_[_0x1a84('0x30')](_0x4be049['model'],qs[_0x1a84('0x32')](_0x3f1d85[_0x1a84('0x2d')][_0x1a84('0x32')]));_0x4ae1a3[_0x1a84('0x31')]=_0x4ae1a3['attributes'][_0x1a84('0x33')]?_0x4ae1a3[_0x1a84('0x31')]:_0x4be049[_0x1a84('0x2a')];if(_0x3f1d85[_0x1a84('0x2d')]['includeAll']){_0x4ae1a3[_0x1a84('0x3f')]=[{'all':!![]}];}_0x4ae1a3=_[_0x1a84('0x3a')]({},_0x4ae1a3,_0x3f1d85['options']);return db[_0x1a84('0x3d')][_0x1a84('0x45')](_0x4ae1a3)[_0x1a84('0x24')](handleEntityNotFound(_0x29b519,null))[_0x1a84('0x24')](respondWithResult(_0x29b519,null))[_0x1a84('0x42')](handleError(_0x29b519,null));};exports[_0x1a84('0x46')]=function(_0x5f4900,_0x1b12c3){var _0x4c8552={'where':{'id':_0x5f4900[_0x1a84('0x44')]['id']}},_0x103879={};_0x103879[_0x1a84('0x2a')]=_[_0x1a84('0x2e')](db['Attachment'][_0x1a84('0x27')]);_0x4c8552[_0x1a84('0x31')]=_[_0x1a84('0x30')](_0x103879[_0x1a84('0x2a')],qs[_0x1a84('0x32')](_0x5f4900[_0x1a84('0x2d')][_0x1a84('0x32')]));_0x4c8552['attributes']=_0x4c8552['attributes'][_0x1a84('0x33')]?_0x4c8552['attributes']:_0x103879[_0x1a84('0x2a')];if(_0x5f4900[_0x1a84('0x2d')][_0x1a84('0x3e')]){_0x4c8552[_0x1a84('0x3f')]=[{'all':!![]}];}_0x4c8552=_['merge']({},_0x4c8552,_0x5f4900[_0x1a84('0x3c')]);return db['Attachment'][_0x1a84('0x45')](_0x4c8552)['then'](handleEntityNotFound(_0x1b12c3,null))[_0x1a84('0x24')](function(_0x205709){if(_0x205709){var _0xb7caf3=_0x205709[_0x1a84('0x47')]({'plain':!![]});_0xb7caf3=qs['omit'](_0xb7caf3,['id',_0x1a84('0x48'),_0x1a84('0x49')]);_0x5f4900[_0x1a84('0x4a')]=_[_0x1a84('0x4b')](_0x5f4900['body'],['id',_0x1a84('0x48'),_0x1a84('0x49')]);return db[_0x1a84('0x3d')][_0x1a84('0x4c')](_['merge'](_0xb7caf3,_0x5f4900[_0x1a84('0x4a')]),{'include':_0x5f4900[_0x1a84('0x2d')][_0x1a84('0x3e')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x1b12c3,0xc9))['catch'](handleError(_0x1b12c3,null));};exports[_0x1a84('0x4d')]=function(_0x4c3343,_0x396726){if(_0x4c3343['body']['id']){delete _0x4c3343[_0x1a84('0x4a')]['id'];}return db[_0x1a84('0x3d')][_0x1a84('0x45')]({'where':{'id':_0x4c3343[_0x1a84('0x44')]['id']}})[_0x1a84('0x24')](handleEntityNotFound(_0x396726,null))['then'](saveUpdates(_0x4c3343[_0x1a84('0x4a')],null))[_0x1a84('0x24')](respondWithResult(_0x396726,null))[_0x1a84('0x42')](handleError(_0x396726,null));};exports[_0x1a84('0x4e')]=function(_0x3ffceb,_0x10ee9e){return db[_0x1a84('0x3d')][_0x1a84('0x45')]({'where':{'id':_0x3ffceb[_0x1a84('0x44')]['id']}})['then'](handleEntityNotFound(_0x10ee9e,null))[_0x1a84('0x24')](removeEntity(_0x10ee9e,null))[_0x1a84('0x42')](handleError(_0x10ee9e,null));};exports[_0x1a84('0x4c')]=function(_0x2f9759,_0x2a89b1,_0x47e850){_0x2f9759[_0x1a84('0x4a')][_0x1a84('0x2c')]=_0x2f9759['file']['originalname'];_0x2f9759[_0x1a84('0x4a')]['basename']=_0x2f9759[_0x1a84('0x4f')]['filename'];_0x2f9759[_0x1a84('0x4a')]['type']=_0x2f9759['file'][_0x1a84('0x50')];return db[_0x1a84('0x3d')][_0x1a84('0x4c')](_0x2f9759[_0x1a84('0x4a')])[_0x1a84('0x24')](respondWithResult(_0x2a89b1,0xc9))[_0x1a84('0x42')](handleError(_0x2a89b1,null));};exports['download']=function(_0x4b9e1b,_0x5c4ff7,_0x4ea432){return db[_0x1a84('0x3d')][_0x1a84('0x51')]({'where':{'id':_0x4b9e1b['params']['id']},'raw':!![]})[_0x1a84('0x24')](handleEntityNotFound(_0x5c4ff7,null))['then'](function(_0x44655f){if(_0x44655f){var _0x74981c=_0x44655f['ChatOfflineMessageId']!==null;var _0x4016a8=path['join'](config[_0x1a84('0x52')],_0x1a84('0x53'));if(_0x74981c){_0x4016a8=path[_0x1a84('0x54')](_0x4016a8,'offline-chat/');}var _0x1163d5=path['join'](_0x4016a8,_0x44655f[_0x1a84('0x55')]);return _0x5c4ff7[_0x1a84('0x56')](_0x1163d5);}})[_0x1a84('0x42')](handleError(_0x5c4ff7,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 441a4c3..8843638 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 _0x7f37=['attachments','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','Attachment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7f37,0x85));var _0x77f3=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x7f37[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0x77f3('0x0'));var util=require('util');var logger=require(_0x77f3('0x1'))('api');var moment=require(_0x77f3('0x2'));var BPromise=require(_0x77f3('0x3'));var rp=require(_0x77f3('0x4'));var fs=require('fs');var path=require(_0x77f3('0x5'));var rimraf=require(_0x77f3('0x6'));var config=require(_0x77f3('0x7'));var attributes=require(_0x77f3('0x8'));module['exports']=function(_0x5909b0,_0x3dd55a){return _0x5909b0['define'](_0x77f3('0x9'),attributes,{'tableName':_0x77f3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6480=['bluebird','request-promise','rimraf','../../config/environment','./attachment.attributes','exports','Attachment','attachments','lodash','util','../../config/logger','api'];(function(_0x1530bb,_0x515427){var _0x334403=function(_0x4f3545){while(--_0x4f3545){_0x1530bb['push'](_0x1530bb['shift']());}};_0x334403(++_0x515427);}(_0x6480,0x1a0));var _0x0648=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6480[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x0648('0x0'));var util=require(_0x0648('0x1'));var logger=require(_0x0648('0x2'))(_0x0648('0x3'));var moment=require('moment');var BPromise=require(_0x0648('0x4'));var rp=require(_0x0648('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0648('0x6'));var config=require(_0x0648('0x7'));var attributes=require(_0x0648('0x8'));module[_0x0648('0x9')]=function(_0x5b0b09,_0x274f33){return _0x5b0b09['define'](_0x0648('0xa'),attributes,{'tableName':_0x0648('0xb'),'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 78e86b0..d03a548 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 _0xa9e0=['message','result','catch','Attachment','create','body','options','raw','then','CreateAttachment','stringify','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','code','error'];(function(_0x17c419,_0xf103b6){var _0x3cc17d=function(_0x21b5d3){while(--_0x21b5d3){_0x17c419['push'](_0x17c419['shift']());}};_0x3cc17d(++_0xf103b6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['CreateAttachment']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')](_0x459eb1[_0x0a9e('0x16')],{'raw':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')][_0x0a9e('0x18')]===undefined?!![]:![]:!![]})[_0x0a9e('0x19')](function(_0x105080){logger['info'](_0x0a9e('0x1a'),_0x459eb1);logger[_0x0a9e('0xd')]('CreateAttachment',_0x459eb1,JSON[_0x0a9e('0x1b')](_0x105080));_0x106033(_0x105080);})['catch'](function(_0x588269){logger[_0x0a9e('0x10')](_0x0a9e('0x1a'),_0x588269[_0x0a9e('0x11')],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x588269['message']));});});};
\ No newline at end of file
+var _0x80df=['catch','CreateAttachment','Attachment','create','options','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x2179f1,_0x21c653){var _0x176ec9=function(_0x4c4a4c){while(--_0x4c4a4c){_0x2179f1['push'](_0x2179f1['shift']());}};_0x176ec9(++_0x21c653);}(_0x80df,0x17e));var _0xf80d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x80df[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xf80d('0x0'));var util=require(_0xf80d('0x1'));var moment=require(_0xf80d('0x2'));var BPromise=require(_0xf80d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf80d('0x4'));var db=require(_0xf80d('0x5'))['db'];var utils=require(_0xf80d('0x6'));var logger=require(_0xf80d('0x7'))(_0xf80d('0x8'));var config=require(_0xf80d('0x9'));var jayson=require(_0xf80d('0xa'));var client=jayson[_0xf80d('0xb')][_0xf80d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x62e50f,_0x5068d4,_0x30e2b3){return new BPromise(function(_0x16b219,_0x2f56b3){return client[_0xf80d('0xd')](_0x62e50f,_0x30e2b3)[_0xf80d('0xe')](function(_0x186339){logger[_0xf80d('0xf')](_0xf80d('0x10'),_0x5068d4,_0xf80d('0x11'));logger[_0xf80d('0x12')](_0xf80d('0x13'),_0x5068d4,_0xf80d('0x11'),JSON[_0xf80d('0x14')](_0x186339));if(_0x186339[_0xf80d('0x15')]){if(_0x186339['error']['code']===0x1f4){logger[_0xf80d('0x15')](_0xf80d('0x10'),_0x5068d4,_0x186339['error'][_0xf80d('0x16')]);return _0x2f56b3(_0x186339['error'][_0xf80d('0x16')]);}logger['error'](_0xf80d('0x10'),_0x5068d4,_0x186339['error'][_0xf80d('0x16')]);return _0x16b219(_0x186339[_0xf80d('0x15')][_0xf80d('0x16')]);}else{logger[_0xf80d('0xf')](_0xf80d('0x10'),_0x5068d4,_0xf80d('0x11'));_0x16b219(_0x186339[_0xf80d('0x17')][_0xf80d('0x16')]);}})[_0xf80d('0x18')](function(_0x3b8a82){logger[_0xf80d('0x15')](_0xf80d('0x10'),_0x5068d4,_0x3b8a82);_0x2f56b3(_0x3b8a82);});});}exports[_0xf80d('0x19')]=function(_0x1d104a){var _0x34b49d=this;return new Promise(function(_0x2ea2c1,_0x7ba89c){return db[_0xf80d('0x1a')][_0xf80d('0x1b')](_0x1d104a['body'],{'raw':_0x1d104a[_0xf80d('0x1c')]?_0x1d104a[_0xf80d('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0xf80d('0xe')](function(_0x539c80){logger[_0xf80d('0xf')](_0xf80d('0x19'),_0x1d104a);logger[_0xf80d('0x12')](_0xf80d('0x19'),_0x1d104a,JSON[_0xf80d('0x14')](_0x539c80));_0x2ea2c1(_0x539c80);})[_0xf80d('0x18')](function(_0x446153){logger[_0xf80d('0x15')](_0xf80d('0x19'),_0x446153[_0xf80d('0x16')],_0x1d104a);_0x7ba89c(_0x34b49d[_0xf80d('0x15')](0x1f4,_0x446153[_0xf80d('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 6639a49..7686808 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 _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0x1e29d6,_0x45fb62){var _0x54beeb=function(_0x35c068){while(--_0x35c068){_0x1e29d6['push'](_0x1e29d6['shift']());}};_0x54beeb(++_0x45fb62);}(_0xb10b,0x12a));var _0xbb10=function(_0x23d0a1,_0x5011a){_0x23d0a1=_0x23d0a1-0x0;var _0x1ef866=_0xb10b[_0x23d0a1];return _0x1ef866;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router;
\ No newline at end of file
+var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xdb28,0x106));var _0x8db2=function(_0xb8c02d,_0x36967e){_0xb8c02d=_0xb8c02d-0x0;var _0x5e4eba=_0xdb28[_0xb8c02d];return _0x5e4eba;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 7655bb6..640de5d 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 _0xb9ba=['blockDuration','then','name','password','salt','role','disabled','blocked','blockedAt','online','user','add','minutes','clearBlockUser','getLicense','status','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','User','passport','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','adSsoEnabled'];(function(_0x4c5c97,_0x4f85bf){var _0xd5d2cb=function(_0x1e6100){while(--_0x1e6100){_0x4c5c97['push'](_0x4c5c97['shift']());}};_0xd5d2cb(++_0x4f85bf);}(_0xb9ba,0x136));var _0xab9b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xb9ba[_0x122ef9];return _0x42fba0;};'use strict';var passport=require(_0xab9b('0x0'));var LocalStrategy=require(_0xab9b('0x1'))[_0xab9b('0x2')];var moment=require(_0xab9b('0x3'));var ActiveDirectory=require(_0xab9b('0x4'));var BPromise=require(_0xab9b('0x5'));var util=require(_0xab9b('0x6'));var db=require(_0xab9b('0x7'))['db'];var authService=require(_0xab9b('0x8'));var utils=require('../../config/utils');var config=require(_0xab9b('0x9'));var logger=require(_0xab9b('0xa'))(_0xab9b('0xb'));function isActiveDirectoryConfigured(_0x1c6fdc){var _0x4f219b=![];if(typeof _0x1c6fdc[_0xab9b('0xc')]!==_0xab9b('0xd')){_0x4f219b=_0x1c6fdc['activedirectory'][_0xab9b('0xe')]&&_0x1c6fdc[_0xab9b('0xc')][_0xab9b('0xf')]&&_0x1c6fdc[_0xab9b('0xc')][_0xab9b('0x10')];}return _0x4f219b;}function adAuthenticate(_0x581556,_0x18ae69,_0x43c443){return new BPromise(function(_0x193a08,_0x547a8b){try{var _0x230bd3=new ActiveDirectory(_0x581556);_0x230bd3[_0xab9b('0x11')](_0x18ae69,_0x43c443,function(_0x18b4d1,_0x503a48){if(_0x18b4d1){logger[_0xab9b('0x12')](_0xab9b('0x13'),_0x18ae69,util[_0xab9b('0x14')](_0x18b4d1,{'showHidden':![],'depth':null}));_0x547a8b('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x503a48){logger['error'](_0xab9b('0x15'),_0x18ae69);_0x547a8b(_0xab9b('0x16'));}else{_0x193a08(_0x503a48);}});}catch(_0x509ffe){_0x547a8b(_0x509ffe);}});}function ActiveDirectoryAuthenticate(_0x4e5792,_0x5129f3,_0x50d95c,_0x13157a){var _0x5b53d9,_0x5d5dad;if(!isActiveDirectoryConfigured(config)){logger[_0xab9b('0x12')](_0xab9b('0x17'),_0x5129f3);return _0x13157a(null,![],{'message':_0xab9b('0x16')});}return db[_0xab9b('0x18')]['findOne']({'where':{'id':0x1},'attributes':[_0xab9b('0x19'),_0xab9b('0x1a')],'raw':!![]})[_0xab9b('0x1b')](function(_0x3aa2ed){_0x5b53d9=_0x3aa2ed;if(!_0x5b53d9['adSsoEnabled']){logger[_0xab9b('0x12')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x5129f3);throw new Error(_0xab9b('0x16'));}return _0x4e5792['findOne']({'attributes':['id',_0xab9b('0x1c'),_0xab9b('0x1d'),_0xab9b('0x1e'),_0xab9b('0x1f'),_0xab9b('0x20'),_0xab9b('0x21'),_0xab9b('0x22'),_0xab9b('0x23')],'where':{'name':_0x5129f3,'role':{'$or':['admin',_0xab9b('0x24'),'agent']},'adSsoEnabled':!![]}});})['then'](function(_0x166630){if(!_0x166630||_0x166630&&_0x166630[_0xab9b('0x1c')]!==_0x5129f3){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x5d5dad=_0x166630;var _0x24b0d7=_0x5d5dad['name']+'@'+config[_0xab9b('0xc')][_0xab9b('0x10')];return adAuthenticate(config[_0xab9b('0xc')],_0x24b0d7,_0x50d95c);})[_0xab9b('0x1b')](function(_0x35b27a){if(_0x5d5dad[_0xab9b('0x20')]){throw new Error(_0xab9b('0x16'));}if(_0x5b53d9[_0xab9b('0x1a')]>0x0){if(_0x5d5dad['blocked']){if(moment(_0x5d5dad[_0xab9b('0x22')])[_0xab9b('0x25')](_0x5b53d9['blockDuration'],_0xab9b('0x26'))>moment()){throw new Error(_0xab9b('0x16'));}return utils[_0xab9b('0x27')](_0x5d5dad,0x0,![],null)['then'](function(){return utils[_0xab9b('0x28')](_0x5d5dad);})[_0xab9b('0x1b')](function(){return _0x13157a(null,_0x5d5dad);});}else{return utils['getLicense'](_0x5d5dad)['then'](function(){return _0x13157a(null,_0x5d5dad);});}}else{return utils['getLicense'](_0x5d5dad)[_0xab9b('0x1b')](function(){return _0x13157a(null,_0x5d5dad);});}})['catch'](function(_0x23e614){return _0x13157a(null,![],_0x23e614);});}function handleError(_0x19e158,_0x2a0f7e,_0x1ea9af){return _0x19e158[_0xab9b('0x29')](_0x2a0f7e||0x1f4)[_0xab9b('0x2a')]({'message':_0x1ea9af?_0x1ea9af[_0xab9b('0x2b')]||_0x1ea9af:''});}exports[_0xab9b('0x2c')]=function(_0x5dd440,_0x2a72ef,_0x4d5db0){passport['authenticate'](_0xab9b('0x2d'),function(_0x497c7b,_0x37d560,_0x45147e){var _0x43c87e=_0x497c7b||_0x45147e;if(_0x43c87e){return handleError(_0x2a72ef,0x191,_0x43c87e);}if(!_0x37d560){return handleError(_0x2a72ef,0x194,{'message':_0xab9b('0x2e')});}else{var _0x416bf4={'payload':{'id':_0x37d560['id'],'role':_0x37d560[_0xab9b('0x1f')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x416bf4)['then'](function(_0x4de8ea){_0x2a72ef['json']({'id':_0x37d560['id'],'token':_0x4de8ea,'statusCall':'','isAlreadyLogged':_0x37d560['online']});});}})(_0x5dd440,_0x2a72ef,_0x4d5db0);};passport['use'](_0xab9b('0x2d'),new LocalStrategy({'usernameField':'name','passwordField':_0xab9b('0x1d')},function(_0x588c32,_0x5b01c4,_0x3afd4b){return ActiveDirectoryAuthenticate(db[_0xab9b('0x2f')],_0x588c32,_0x5b01c4,_0x3afd4b);}));
\ No newline at end of file
+var _0x12c7=['Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','salt','role','disabled','blockedAt','admin','user','agent','then','domain','blocked','minutes','clearBlockUser','getLicense','catch','send','message','authenticate','signToken','json','ad-login','password','User','passport','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../config/utils','../../config/logger','api','activedirectory','undefined','baseDN','url','error','Error\x20authenticate\x20%s:\x20%s','inspect','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','findOne','adSsoEnabled','blockDuration'];(function(_0x2b4399,_0x297e38){var _0x2adc0a=function(_0x459c1b){while(--_0x459c1b){_0x2b4399['push'](_0x2b4399['shift']());}};_0x2adc0a(++_0x297e38);}(_0x12c7,0x1ee));var _0x712c=function(_0x3c168d,_0x355c44){_0x3c168d=_0x3c168d-0x0;var _0x5c5028=_0x12c7[_0x3c168d];return _0x5c5028;};'use strict';var passport=require(_0x712c('0x0'));var LocalStrategy=require(_0x712c('0x1'))[_0x712c('0x2')];var moment=require(_0x712c('0x3'));var ActiveDirectory=require(_0x712c('0x4'));var BPromise=require(_0x712c('0x5'));var util=require(_0x712c('0x6'));var db=require(_0x712c('0x7'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x712c('0x8'));var config=require('../../config/environment');var logger=require(_0x712c('0x9'))(_0x712c('0xa'));function isActiveDirectoryConfigured(_0x40c49b){var _0x1b37fa=![];if(typeof _0x40c49b[_0x712c('0xb')]!==_0x712c('0xc')){_0x1b37fa=_0x40c49b['activedirectory'][_0x712c('0xd')]&&_0x40c49b['activedirectory'][_0x712c('0xe')]&&_0x40c49b[_0x712c('0xb')]['domain'];}return _0x1b37fa;}function adAuthenticate(_0x244064,_0x38addb,_0x3f63e9){return new BPromise(function(_0x572033,_0x33beb5){try{var _0x4e0d5c=new ActiveDirectory(_0x244064);_0x4e0d5c['authenticate'](_0x38addb,_0x3f63e9,function(_0x4b8152,_0x26d9fd){if(_0x4b8152){logger[_0x712c('0xf')](_0x712c('0x10'),_0x38addb,util[_0x712c('0x11')](_0x4b8152,{'showHidden':![],'depth':null}));_0x33beb5('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x26d9fd){logger[_0x712c('0xf')](_0x712c('0x12'),_0x38addb);_0x33beb5(_0x712c('0x13'));}else{_0x572033(_0x26d9fd);}});}catch(_0x2b5368){_0x33beb5(_0x2b5368);}});}function ActiveDirectoryAuthenticate(_0x3c4fc4,_0x30b160,_0x37de15,_0x1813c7){var _0x1fd699,_0x2a81e8;if(!isActiveDirectoryConfigured(config)){logger[_0x712c('0xf')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x30b160);return _0x1813c7(null,![],{'message':_0x712c('0x13')});}return db['Setting'][_0x712c('0x14')]({'where':{'id':0x1},'attributes':[_0x712c('0x15'),_0x712c('0x16')],'raw':!![]})['then'](function(_0x4ccb2e){_0x1fd699=_0x4ccb2e;if(!_0x1fd699[_0x712c('0x15')]){logger[_0x712c('0xf')](_0x712c('0x17'),_0x30b160);throw new Error(_0x712c('0x13'));}return _0x3c4fc4['findOne']({'attributes':['id',_0x712c('0x18'),'password',_0x712c('0x19'),_0x712c('0x1a'),_0x712c('0x1b'),'blocked',_0x712c('0x1c'),'online'],'where':{'name':_0x30b160,'role':{'$or':[_0x712c('0x1d'),_0x712c('0x1e'),_0x712c('0x1f')]},'adSsoEnabled':!![]}});})[_0x712c('0x20')](function(_0x3a78c8){if(!_0x3a78c8||_0x3a78c8&&_0x3a78c8[_0x712c('0x18')]!==_0x30b160){throw new Error(_0x712c('0x13'));}_0x2a81e8=_0x3a78c8;var _0xfb89a1=_0x2a81e8[_0x712c('0x18')]+'@'+config[_0x712c('0xb')][_0x712c('0x21')];return adAuthenticate(config[_0x712c('0xb')],_0xfb89a1,_0x37de15);})[_0x712c('0x20')](function(_0x273ec0){if(_0x2a81e8[_0x712c('0x1b')]){throw new Error(_0x712c('0x13'));}if(_0x1fd699[_0x712c('0x16')]>0x0){if(_0x2a81e8[_0x712c('0x22')]){if(moment(_0x2a81e8[_0x712c('0x1c')])['add'](_0x1fd699[_0x712c('0x16')],_0x712c('0x23'))>moment()){throw new Error(_0x712c('0x13'));}return utils[_0x712c('0x24')](_0x2a81e8,0x0,![],null)['then'](function(){return utils[_0x712c('0x25')](_0x2a81e8);})['then'](function(){return _0x1813c7(null,_0x2a81e8);});}else{return utils[_0x712c('0x25')](_0x2a81e8)[_0x712c('0x20')](function(){return _0x1813c7(null,_0x2a81e8);});}}else{return utils['getLicense'](_0x2a81e8)[_0x712c('0x20')](function(){return _0x1813c7(null,_0x2a81e8);});}})[_0x712c('0x26')](function(_0x13364a){return _0x1813c7(null,![],_0x13364a);});}function handleError(_0x3bf485,_0x1db933,_0xba4c46){return _0x3bf485['status'](_0x1db933||0x1f4)[_0x712c('0x27')]({'message':_0xba4c46?_0xba4c46[_0x712c('0x28')]||_0xba4c46:''});}exports['login']=function(_0x1e8ac3,_0x536310,_0x230f54){passport[_0x712c('0x29')]('ad-login',function(_0x45ff02,_0x52d5b0,_0x358fad){var _0x442577=_0x45ff02||_0x358fad;if(_0x442577){return handleError(_0x536310,0x191,_0x442577);}if(!_0x52d5b0){return handleError(_0x536310,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x3699ca={'payload':{'id':_0x52d5b0['id'],'role':_0x52d5b0[_0x712c('0x1a')]},'options':{'expiresIn':0x15180}};return authService[_0x712c('0x2a')](_0x3699ca)['then'](function(_0x243f2c){_0x536310[_0x712c('0x2b')]({'id':_0x52d5b0['id'],'token':_0x243f2c,'statusCall':'','isAlreadyLogged':_0x52d5b0['online']});});}})(_0x1e8ac3,_0x536310,_0x230f54);};passport['use'](_0x712c('0x2c'),new LocalStrategy({'usernameField':_0x712c('0x18'),'passwordField':_0x712c('0x2d')},function(_0x5e5a31,_0x3e63dd,_0x55c018){return ActiveDirectoryAuthenticate(db[_0x712c('0x2e')],_0x5e5a31,_0x3e63dd,_0x55c018);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index b8c6626..9687aa9 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 _0x8a2f=['exports','express','Router','./authActiveDirectory.controller'];(function(_0x46503b,_0x46b001){var _0x1c0789=function(_0x3ed085){while(--_0x3ed085){_0x46503b['push'](_0x46503b['shift']());}};_0x1c0789(++_0x46b001);}(_0x8a2f,0x195));var _0xf8a2=function(_0x3c389f,_0x217b16){_0x3c389f=_0x3c389f-0x0;var _0xff815=_0x8a2f[_0x3c389f];return _0xff815;};'use strict';var express=require(_0xf8a2('0x0'));var router=express[_0xf8a2('0x1')]();var controller=require(_0xf8a2('0x2'));router['post']('/',controller['login']);module[_0xf8a2('0x3')]=router;
\ No newline at end of file
+var _0x34f7=['Router','./authActiveDirectory.controller','post','login','express'];(function(_0x3f49a9,_0x108d68){var _0x56e82f=function(_0x20044a){while(--_0x20044a){_0x3f49a9['push'](_0x3f49a9['shift']());}};_0x56e82f(++_0x108d68);}(_0x34f7,0x1c6));var _0x734f=function(_0x30c00c,_0x1b2469){_0x30c00c=_0x30c00c-0x0;var _0x674a6a=_0x34f7[_0x30c00c];return _0x674a6a;};'use strict';var express=require(_0x734f('0x0'));var router=express[_0x734f('0x1')]();var controller=require(_0x734f('0x2'));router[_0x734f('0x3')]('/',controller[_0x734f('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 51090ce..2c74b3b 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(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0x7a54,0x106));var _0x47a5=function(_0xe773d3,_0x27bfc7){_0xe773d3=_0xe773d3-0x0;var _0x52a74f=_0x7a54[_0xe773d3];return _0x52a74f;};'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(_0x241633,_0x38b2a0){var _0x384081=function(_0x59dba1){while(--_0x59dba1){_0x241633['push'](_0x241633['shift']());}};_0x384081(++_0x38b2a0);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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 5e05e4a..05789d9 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 _0x09eb=['callback','isMiddleware','login','setTokenCookie','exports','express','passport','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','/callback'];(function(_0x5996c8,_0x32e9a3){var _0x420c87=function(_0x463b92){while(--_0x463b92){_0x5996c8['push'](_0x5996c8['shift']());}};_0x420c87(++_0x32e9a3);}(_0x09eb,0x1d9));var _0xb09e=function(_0x4e9f29,_0x1bbcbf){_0x4e9f29=_0x4e9f29-0x0;var _0x8e1ab3=_0x09eb[_0x4e9f29];return _0x8e1ab3;};'use strict';var express=require(_0xb09e('0x0'));var passport=require(_0xb09e('0x1'));var router=express['Router']();var controller=require(_0xb09e('0x2'));var userController=require(_0xb09e('0x3'));var authService=require(_0xb09e('0x4'));router[_0xb09e('0x5')]('/',controller['login']);router[_0xb09e('0x5')](_0xb09e('0x6'),controller[_0xb09e('0x7')],authService[_0xb09e('0x8')],userController[_0xb09e('0x9')],authService[_0xb09e('0xa')]);module[_0xb09e('0xb')]=router;
\ No newline at end of file
+var _0x1541=['./authGoogle.controller','../user/user.controller.js','../../components/auth/service','login','get','/callback','isMiddleware','setTokenCookie','exports','passport'];(function(_0x4bc204,_0x98dea9){var _0x476062=function(_0x1e13ff){while(--_0x1e13ff){_0x4bc204['push'](_0x4bc204['shift']());}};_0x476062(++_0x98dea9);}(_0x1541,0x1a3));var _0x1154=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x1541[_0x42245d];return _0x4b211a;};'use strict';var express=require('express');var passport=require(_0x1154('0x0'));var router=express['Router']();var controller=require(_0x1154('0x1'));var userController=require(_0x1154('0x2'));var authService=require(_0x1154('0x3'));router['get']('/',controller[_0x1154('0x4')]);router[_0x1154('0x5')](_0x1154('0x6'),controller['callback'],authService[_0x1154('0x7')],userController[_0x1154('0x4')],authService[_0x1154('0x8')]);module[_0x1154('0x9')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 08cb945..7306803 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 _0xa137=['Email\x20parameter\x20is\x20missing','generate','body','toLowerCase','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','host','/reset/','Reset\x20Email\x20sent!','reset','User','params','token','securePassword','enforcePasswordHistory','previousPasswords','validatePasswordHistory','passwordHistoryLimit','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../config/utils','client','http','Setting','findOne','blockDuration','then','name','password','salt','role','blocked','blockedAt','admin','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','disabled','allowedLoginAttempts','add','minutes','clearBlockUser','getLicense','catch','find','email','MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','Smtp','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','status','send','message','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online'];(function(_0xbaae28,_0x5657f5){var _0x542e54=function(_0x24e247){while(--_0x24e247){_0xbaae28['push'](_0xbaae28['shift']());}};_0x542e54(++_0x5657f5);}(_0xa137,0x111));var _0x7a13=function(_0x34843e,_0x4c4224){_0x34843e=_0x34843e-0x0;var _0x598f7f=_0xa137[_0x34843e];return _0x598f7f;};'use strict';var util=require(_0x7a13('0x0'));var passport=require(_0x7a13('0x1'));var LocalStrategy=require(_0x7a13('0x2'))[_0x7a13('0x3')];var jayson=require(_0x7a13('0x4'));var _=require(_0x7a13('0x5'));var rs=require(_0x7a13('0x6'));var moment=require(_0x7a13('0x7'));var db=require(_0x7a13('0x8'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x7a13('0x9'));var client=jayson[_0x7a13('0xa')][_0x7a13('0xb')]({'port':0x232b});function localAuthenticate(_0x273027,_0x4ea075,_0x2031ca,_0x50ce51){var _0x5c2453,_0x2aaa00;return db[_0x7a13('0xc')][_0x7a13('0xd')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x7a13('0xe')],'raw':!![]})[_0x7a13('0xf')](function(_0x221ca7){_0x5c2453=_0x221ca7;return _0x273027[_0x7a13('0xd')]({'attributes':['id',_0x7a13('0x10'),_0x7a13('0x11'),_0x7a13('0x12'),_0x7a13('0x13'),'disabled',_0x7a13('0x14'),_0x7a13('0x15'),'loginAttempts'],'where':{'name':_0x4ea075,'role':{'$or':[_0x7a13('0x16'),_0x7a13('0x17'),'agent']}}});})[_0x7a13('0xf')](function(_0x1e86cb){if(!_0x1e86cb||_0x1e86cb&&_0x1e86cb[_0x7a13('0x10')]!==_0x4ea075){throw new Error(_0x7a13('0x18'));}else{_0x2aaa00=_0x1e86cb;return _0x2aaa00;}})['then'](function(){_0x2aaa00[_0x7a13('0x19')](_0x2031ca,function(_0x499bfb,_0x98974d){var _0x295be2=_0x2aaa00[_0x7a13('0x1a')]+0x1;if(_0x499bfb){return _0x50ce51(_0x499bfb);}else if(!_0x98974d){if(_0x2aaa00[_0x7a13('0x1b')]){return _0x50ce51(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x5c2453[_0x7a13('0x1c')]>0x0){if(_0x2aaa00[_0x7a13('0x14')]){if(_0x5c2453[_0x7a13('0xe')]>0x0){if(moment(_0x2aaa00[_0x7a13('0x15')])[_0x7a13('0x1d')](_0x5c2453['blockDuration'],_0x7a13('0x1e'))>moment()){return _0x50ce51(null,![],{'message':_0x7a13('0x18')});}else{return utils['clearBlockUser'](_0x2aaa00,_0x295be2,![],null)[_0x7a13('0xf')](function(){return _0x50ce51(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x50ce51(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x295be2>=_0x5c2453[_0x7a13('0x1c')]){return utils[_0x7a13('0x1f')](_0x2aaa00,0x0,!![],moment())['then'](function(){return _0x50ce51(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils['clearBlockUser'](_0x2aaa00,_0x295be2,![],null)[_0x7a13('0xf')](function(){return _0x50ce51(null,![],{'message':_0x7a13('0x18')});});}}}else{return _0x50ce51(null,![],{'message':_0x7a13('0x18')});}}else{if(_0x2aaa00[_0x7a13('0x1b')]){return _0x50ce51(null,![],{'message':_0x7a13('0x18')});}else if(_0x5c2453[_0x7a13('0x1c')]>0x0){if(_0x2aaa00[_0x7a13('0x14')]){if(_0x5c2453['blockDuration']>0x0){if(moment(_0x2aaa00[_0x7a13('0x15')])[_0x7a13('0x1d')](_0x5c2453[_0x7a13('0xe')],'minutes')>moment()){return _0x50ce51(null,![],{'message':_0x7a13('0x18')});}else{return utils[_0x7a13('0x1f')](_0x2aaa00,0x0,![],null)[_0x7a13('0xf')](function(){return utils['getLicense'](_0x2aaa00);})[_0x7a13('0xf')](function(){return _0x50ce51(null,_0x2aaa00);});}}else{return _0x50ce51(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils['clearBlockUser'](_0x2aaa00,0x0,![],null)[_0x7a13('0xf')](function(){return utils[_0x7a13('0x20')](_0x2aaa00);})[_0x7a13('0xf')](function(){return _0x50ce51(null,_0x2aaa00);})[_0x7a13('0x21')](function(_0x58d730){return _0x50ce51(null,![],_0x58d730);});}}else{if(_0x2aaa00[_0x7a13('0x14')]){return _0x50ce51(null,![],{'message':_0x7a13('0x18')});}else{return utils['getLicense'](_0x2aaa00)[_0x7a13('0xf')](function(){return _0x50ce51(null,_0x2aaa00);});}}}});})[_0x7a13('0x21')](function(_0x241704){return _0x50ce51(null,![],_0x241704);});}function sendServiceMail(_0x145662){return db['MailAccount'][_0x7a13('0x22')]({'where':{'service':!![]},'attributes':['id','name',_0x7a13('0x23')],'include':[{'model':db[_0x7a13('0x24')],'as':'Smtp','include':[{'model':db[_0x7a13('0x25')],'as':_0x7a13('0x25')}]}]})[_0x7a13('0xf')](function(_0x2e94fe){if(!_0x2e94fe){throw new Error(_0x7a13('0x26'));}var _0x166e6f=_0x2e94fe[_0x7a13('0x27')]();var _0x8bebf8={'account':_0x166e6f,'message':_[_0x7a13('0x28')]({'from':util[_0x7a13('0x29')](_0x7a13('0x2a'),_0x2e94fe[_0x7a13('0x10')],_0x2e94fe['email']||_0x2e94fe[_0x7a13('0x2b')]['user'])},_0x145662)};return client[_0x7a13('0x2c')](_0x7a13('0x2d'),_0x8bebf8);})[_0x7a13('0xf')](function(_0x214386){if(_0x214386[_0x7a13('0x2e')]){throw new Error(util[_0x7a13('0x29')](_0x7a13('0x2f'),_0x214386[_0x7a13('0x2e')]['message']||JSON['stringify'](_0x214386['error'])));}return!![];});}function handleError(_0x5046c6,_0x27a7d5,_0x426ea6){return _0x5046c6[_0x7a13('0x30')](_0x27a7d5||0x1f4)[_0x7a13('0x31')]({'message':_0x426ea6?_0x426ea6[_0x7a13('0x32')]||_0x426ea6:''});}exports['login']=function(_0x2bd3fd,_0xb6db5d,_0x4c777d){passport[_0x7a13('0x19')](_0x7a13('0x33'),function(_0x4ca40d,_0x350915,_0x566d93){var _0xdb289d=_0x4ca40d||_0x566d93;if(_0xdb289d){return handleError(_0xb6db5d,0x191,_0xdb289d);}if(!_0x350915){return handleError(_0xb6db5d,0x194,{'message':_0x7a13('0x34')});}else{var _0x1ca61f={'payload':{'id':_0x350915['id'],'role':_0x350915[_0x7a13('0x13')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x1ca61f)[_0x7a13('0xf')](function(_0x2e7998){_0xb6db5d[_0x7a13('0x35')]({'id':_0x350915['id'],'token':_0x2e7998,'statusCall':'','isAlreadyLogged':_0x350915[_0x7a13('0x36')]});});}})(_0x2bd3fd,_0xb6db5d,_0x4c777d);};exports['forgot']=function(_0xe4e16f,_0x5b6a78){if(!_0xe4e16f['body'][_0x7a13('0x23')]){return handleError(_0x5b6a78,0x1f4,{'message':_0x7a13('0x37')});}var _0x567f78=rs[_0x7a13('0x38')]();_0xe4e16f['body']['email']=_0xe4e16f[_0x7a13('0x39')]['email']['trim']()[_0x7a13('0x3a')]();var _0x12a3d6;return db[_0x7a13('0xc')][_0x7a13('0xd')]({'where':{'id':0x1},'attributes':[_0x7a13('0x1c'),'blockDuration'],'raw':!![]})[_0x7a13('0xf')](function(_0x3f2db3){_0x12a3d6=_0x3f2db3;return db['User'][_0x7a13('0x22')]({'where':{'email':_0xe4e16f[_0x7a13('0x39')][_0x7a13('0x23')]}});})[_0x7a13('0xf')](function(_0x568e70){if(!_0x568e70){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x568e70[_0x7a13('0x1b')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x568e70[_0x7a13('0x14')]){if(moment(_0x568e70[_0x7a13('0x15')])['add'](_0x12a3d6[_0x7a13('0xe')],_0x7a13('0x1e'))>moment()){throw new Error(_0x7a13('0x3b'));}else{_0x568e70[_0x7a13('0x14')]=![];_0x568e70['blockedAt']=null;}}_0x568e70[_0x7a13('0x3c')]=_0x567f78;_0x568e70[_0x7a13('0x3d')]=Date[_0x7a13('0x3e')]()+0x36ee80;return _0x568e70[_0x7a13('0x3f')]();})[_0x7a13('0xf')](function(){return sendServiceMail({'to':_0xe4e16f['body']['email'],'subject':_0x7a13('0x40'),'text':_0x7a13('0x41')+_0x7a13('0x42')+'https://'+_0xe4e16f[_0x7a13('0x43')][_0x7a13('0x44')]+_0x7a13('0x45')+_0x567f78+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x7a13('0xf')](function(){_0x5b6a78[_0x7a13('0x30')](0xc8)['send']({'message':_0x7a13('0x46')});})[_0x7a13('0x21')](function(_0x11c88e){return handleError(_0x5b6a78,0x1f4,_0x11c88e);});};exports[_0x7a13('0x47')]=function(_0x44e62b,_0x33e00e){return db[_0x7a13('0x48')]['find']({'where':{'resetPasswordToken':_0x44e62b[_0x7a13('0x49')][_0x7a13('0x4a')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x7a13('0xf')](function(_0x5184df){if(!_0x5184df){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x7a13('0xc')][_0x7a13('0xd')]({'attributes':['id',_0x7a13('0x4b'),'enforcePasswordHistory','passwordHistoryLimit']})[_0x7a13('0xf')](function(_0x57ea33){if(_0x57ea33[_0x7a13('0x4b')])authService['validatePasswordPattern'](_0x44e62b['body']['password']);if(!_0x57ea33[_0x7a13('0x4c')]||!_0x5184df[_0x7a13('0x4d')])return _0x5184df;authService[_0x7a13('0x4e')](_0x44e62b[_0x7a13('0x39')]['password'],_0x5184df[_0x7a13('0x4d')],_0x57ea33[_0x7a13('0x4f')]);return _0x5184df;})[_0x7a13('0xf')](function(){_0x5184df[_0x7a13('0x11')]=_0x44e62b[_0x7a13('0x39')][_0x7a13('0x11')];_0x5184df[_0x7a13('0x3c')]=null;_0x5184df['resetPasswordExpires']=null;return _0x5184df[_0x7a13('0x3f')]();});})[_0x7a13('0xf')](function(){_0x33e00e['status'](0xc8)[_0x7a13('0x31')]({'message':_0x7a13('0x50')});})[_0x7a13('0x21')](function(_0x5ed891){return handleError(_0x33e00e,0x1f4,_0x5ed891);});};passport[_0x7a13('0x51')]('local-login',new LocalStrategy({'usernameField':_0x7a13('0x10'),'passwordField':'password'},function(_0x52845c,_0x57fed5,_0x36d1d1){return localAuthenticate(db[_0x7a13('0x48')],_0x52845c,_0x57fed5,_0x36d1d1);}));
\ No newline at end of file
+var _0x2136=['Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','minutes','clearBlockUser','blockedAt','add','getLicense','catch','MailAccount','find','email','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','request','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','status','send','message','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','User','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','password','previousPasswords','validatePasswordHistory','Password\x20reset!','use','util','passport','passport-local','Strategy','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','salt','blocked','loginAttempts','admin','user','agent','authenticate','disabled'];(function(_0x3255ae,_0x279cff){var _0x122d95=function(_0x65cac5){while(--_0x65cac5){_0x3255ae['push'](_0x3255ae['shift']());}};_0x122d95(++_0x279cff);}(_0x2136,0x96));var _0x6213=function(_0x101d5b,_0x40cfd){_0x101d5b=_0x101d5b-0x0;var _0x382a50=_0x2136[_0x101d5b];return _0x382a50;};'use strict';var util=require(_0x6213('0x0'));var passport=require(_0x6213('0x1'));var LocalStrategy=require(_0x6213('0x2'))[_0x6213('0x3')];var jayson=require('jayson/promise');var _=require(_0x6213('0x4'));var rs=require(_0x6213('0x5'));var moment=require(_0x6213('0x6'));var db=require(_0x6213('0x7'))['db'];var authService=require(_0x6213('0x8'));var utils=require(_0x6213('0x9'));var client=jayson[_0x6213('0xa')][_0x6213('0xb')]({'port':0x232b});function localAuthenticate(_0x27ed91,_0x53c82f,_0x7bc4b4,_0x2c8df1){var _0x505102,_0x1d84f5;return db[_0x6213('0xc')][_0x6213('0xd')]({'where':{'id':0x1},'attributes':[_0x6213('0xe'),_0x6213('0xf')],'raw':!![]})[_0x6213('0x10')](function(_0x1af751){_0x505102=_0x1af751;return _0x27ed91[_0x6213('0xd')]({'attributes':['id',_0x6213('0x11'),'password',_0x6213('0x12'),'role','disabled',_0x6213('0x13'),'blockedAt',_0x6213('0x14')],'where':{'name':_0x53c82f,'role':{'$or':[_0x6213('0x15'),_0x6213('0x16'),_0x6213('0x17')]}}});})['then'](function(_0x307c7b){if(!_0x307c7b||_0x307c7b&&_0x307c7b[_0x6213('0x11')]!==_0x53c82f){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x1d84f5=_0x307c7b;return _0x1d84f5;}})['then'](function(){_0x1d84f5[_0x6213('0x18')](_0x7bc4b4,function(_0x518fa0,_0xf0dd9){var _0x19e4fe=_0x1d84f5[_0x6213('0x14')]+0x1;if(_0x518fa0){return _0x2c8df1(_0x518fa0);}else if(!_0xf0dd9){if(_0x1d84f5[_0x6213('0x19')]){return _0x2c8df1(null,![],{'message':_0x6213('0x1a')});}else if(_0x505102[_0x6213('0xe')]>0x0){if(_0x1d84f5[_0x6213('0x13')]){if(_0x505102[_0x6213('0xf')]>0x0){if(moment(_0x1d84f5['blockedAt'])['add'](_0x505102[_0x6213('0xf')],_0x6213('0x1b'))>moment()){return _0x2c8df1(null,![],{'message':_0x6213('0x1a')});}else{return utils[_0x6213('0x1c')](_0x1d84f5,_0x19e4fe,![],null)['then'](function(){return _0x2c8df1(null,![],{'message':_0x6213('0x1a')});});}}else{return _0x2c8df1(null,![],{'message':_0x6213('0x1a')});}}else{if(_0x19e4fe>=_0x505102[_0x6213('0xe')]){return utils[_0x6213('0x1c')](_0x1d84f5,0x0,!![],moment())[_0x6213('0x10')](function(){return _0x2c8df1(null,![],{'message':_0x6213('0x1a')});});}else{return utils[_0x6213('0x1c')](_0x1d84f5,_0x19e4fe,![],null)['then'](function(){return _0x2c8df1(null,![],{'message':_0x6213('0x1a')});});}}}else{return _0x2c8df1(null,![],{'message':_0x6213('0x1a')});}}else{if(_0x1d84f5[_0x6213('0x19')]){return _0x2c8df1(null,![],{'message':_0x6213('0x1a')});}else if(_0x505102[_0x6213('0xe')]>0x0){if(_0x1d84f5[_0x6213('0x13')]){if(_0x505102[_0x6213('0xf')]>0x0){if(moment(_0x1d84f5[_0x6213('0x1d')])[_0x6213('0x1e')](_0x505102[_0x6213('0xf')],_0x6213('0x1b'))>moment()){return _0x2c8df1(null,![],{'message':_0x6213('0x1a')});}else{return utils[_0x6213('0x1c')](_0x1d84f5,0x0,![],null)[_0x6213('0x10')](function(){return utils[_0x6213('0x1f')](_0x1d84f5);})[_0x6213('0x10')](function(){return _0x2c8df1(null,_0x1d84f5);});}}else{return _0x2c8df1(null,![],{'message':_0x6213('0x1a')});}}else{return utils['clearBlockUser'](_0x1d84f5,0x0,![],null)[_0x6213('0x10')](function(){return utils[_0x6213('0x1f')](_0x1d84f5);})['then'](function(){return _0x2c8df1(null,_0x1d84f5);})['catch'](function(_0x50142b){return _0x2c8df1(null,![],_0x50142b);});}}else{if(_0x1d84f5[_0x6213('0x13')]){return _0x2c8df1(null,![],{'message':_0x6213('0x1a')});}else{return utils[_0x6213('0x1f')](_0x1d84f5)[_0x6213('0x10')](function(){return _0x2c8df1(null,_0x1d84f5);});}}}});})[_0x6213('0x20')](function(_0x2c3ebf){return _0x2c8df1(null,![],_0x2c3ebf);});}function sendServiceMail(_0x1068f3){return db[_0x6213('0x21')][_0x6213('0x22')]({'where':{'service':!![]},'attributes':['id',_0x6213('0x11'),_0x6213('0x23')],'include':[{'model':db['MailServerOut'],'as':_0x6213('0x24'),'include':[{'model':db[_0x6213('0x25')],'as':_0x6213('0x25')}]}]})[_0x6213('0x10')](function(_0x3dd062){if(!_0x3dd062){throw new Error(_0x6213('0x26'));}var _0xf35162=_0x3dd062[_0x6213('0x27')]();var _0x3dcb89={'account':_0xf35162,'message':_[_0x6213('0x28')]({'from':util[_0x6213('0x29')](_0x6213('0x2a'),_0x3dd062[_0x6213('0x11')],_0x3dd062[_0x6213('0x23')]||_0x3dd062[_0x6213('0x24')][_0x6213('0x16')])},_0x1068f3)};return client[_0x6213('0x2b')]('SendMail',_0x3dcb89);})['then'](function(_0x36317f){if(_0x36317f[_0x6213('0x2c')]){throw new Error(util[_0x6213('0x29')](_0x6213('0x2d'),_0x36317f['error']['message']||JSON[_0x6213('0x2e')](_0x36317f[_0x6213('0x2c')])));}return!![];});}function handleError(_0x1d9d1b,_0x4d9e85,_0x47cde3){return _0x1d9d1b[_0x6213('0x2f')](_0x4d9e85||0x1f4)[_0x6213('0x30')]({'message':_0x47cde3?_0x47cde3[_0x6213('0x31')]||_0x47cde3:''});}exports['login']=function(_0x2abfca,_0x27a262,_0x1f679c){passport[_0x6213('0x18')](_0x6213('0x32'),function(_0x3162d0,_0x43d17e,_0x100921){var _0x53ad34=_0x3162d0||_0x100921;if(_0x53ad34){return handleError(_0x27a262,0x191,_0x53ad34);}if(!_0x43d17e){return handleError(_0x27a262,0x194,{'message':_0x6213('0x33')});}else{var _0x1951e1={'payload':{'id':_0x43d17e['id'],'role':_0x43d17e[_0x6213('0x34')]},'options':{'expiresIn':0x15180}};return authService[_0x6213('0x35')](_0x1951e1)[_0x6213('0x10')](function(_0x48719a){_0x27a262[_0x6213('0x36')]({'id':_0x43d17e['id'],'token':_0x48719a,'statusCall':'','isAlreadyLogged':_0x43d17e['online']});});}})(_0x2abfca,_0x27a262,_0x1f679c);};exports['forgot']=function(_0x128d46,_0x999504){if(!_0x128d46[_0x6213('0x37')][_0x6213('0x23')]){return handleError(_0x999504,0x1f4,{'message':_0x6213('0x38')});}var _0x1435f9=rs[_0x6213('0x39')]();_0x128d46[_0x6213('0x37')][_0x6213('0x23')]=_0x128d46[_0x6213('0x37')][_0x6213('0x23')][_0x6213('0x3a')]()[_0x6213('0x3b')]();var _0x127f20;return db[_0x6213('0xc')][_0x6213('0xd')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x6213('0xf')],'raw':!![]})['then'](function(_0x34aaa9){_0x127f20=_0x34aaa9;return db['User'][_0x6213('0x22')]({'where':{'email':_0x128d46[_0x6213('0x37')][_0x6213('0x23')]}});})['then'](function(_0x1e4312){if(!_0x1e4312){throw new Error(_0x6213('0x3c'));}if(_0x1e4312[_0x6213('0x19')]){throw new Error(_0x6213('0x3d'));}if(_0x1e4312[_0x6213('0x13')]){if(moment(_0x1e4312['blockedAt'])[_0x6213('0x1e')](_0x127f20[_0x6213('0xf')],'minutes')>moment()){throw new Error(_0x6213('0x3e'));}else{_0x1e4312[_0x6213('0x13')]=![];_0x1e4312[_0x6213('0x1d')]=null;}}_0x1e4312[_0x6213('0x3f')]=_0x1435f9;_0x1e4312[_0x6213('0x40')]=Date[_0x6213('0x41')]()+0x36ee80;return _0x1e4312[_0x6213('0x42')]();})['then'](function(){return sendServiceMail({'to':_0x128d46[_0x6213('0x37')][_0x6213('0x23')],'subject':_0x6213('0x43'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x6213('0x44')+_0x6213('0x45')+_0x128d46[_0x6213('0x46')][_0x6213('0x47')]+_0x6213('0x48')+_0x1435f9+'\x0a\x0a'+_0x6213('0x49')});})[_0x6213('0x10')](function(){_0x999504[_0x6213('0x2f')](0xc8)['send']({'message':_0x6213('0x4a')});})[_0x6213('0x20')](function(_0x2dbdda){return handleError(_0x999504,0x1f4,_0x2dbdda);});};exports['reset']=function(_0x28dd66,_0x3f3b4b){return db[_0x6213('0x4b')][_0x6213('0x22')]({'where':{'resetPasswordToken':_0x28dd66[_0x6213('0x4c')][_0x6213('0x4d')],'resetPasswordExpires':{'$gt':Date[_0x6213('0x41')]()}}})[_0x6213('0x10')](function(_0x2892d8){if(!_0x2892d8){throw new Error(_0x6213('0x4e'));}return db[_0x6213('0xc')][_0x6213('0xd')]({'attributes':['id',_0x6213('0x4f'),_0x6213('0x50'),_0x6213('0x51')]})['then'](function(_0x1a6b35){if(_0x1a6b35[_0x6213('0x4f')])authService[_0x6213('0x52')](_0x28dd66[_0x6213('0x37')][_0x6213('0x53')]);if(!_0x1a6b35[_0x6213('0x50')]||!_0x2892d8[_0x6213('0x54')])return _0x2892d8;authService[_0x6213('0x55')](_0x28dd66[_0x6213('0x37')][_0x6213('0x53')],_0x2892d8[_0x6213('0x54')],_0x1a6b35[_0x6213('0x51')]);return _0x2892d8;})[_0x6213('0x10')](function(){_0x2892d8[_0x6213('0x53')]=_0x28dd66[_0x6213('0x37')][_0x6213('0x53')];_0x2892d8[_0x6213('0x3f')]=null;_0x2892d8[_0x6213('0x40')]=null;return _0x2892d8[_0x6213('0x42')]();});})[_0x6213('0x10')](function(){_0x3f3b4b[_0x6213('0x2f')](0xc8)[_0x6213('0x30')]({'message':_0x6213('0x56')});})[_0x6213('0x20')](function(_0x274ad3){return handleError(_0x3f3b4b,0x1f4,_0x274ad3);});};passport[_0x6213('0x57')](_0x6213('0x32'),new LocalStrategy({'usernameField':_0x6213('0x11'),'passwordField':_0x6213('0x53')},function(_0xe3bb4a,_0x768ece,_0x3d7880){return localAuthenticate(db[_0x6213('0x4b')],_0xe3bb4a,_0x768ece,_0x3d7880);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 1dc05a4..6891b22 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 _0x49ad=['express','Router','post','login','/reset/:token','reset','exports'];(function(_0x4dce4f,_0x2e433f){var _0x7d8bcf=function(_0x1c03d9){while(--_0x1c03d9){_0x4dce4f['push'](_0x4dce4f['shift']());}};_0x7d8bcf(++_0x2e433f);}(_0x49ad,0xe0));var _0xd49a=function(_0x2f5297,_0x2b93fc){_0x2f5297=_0x2f5297-0x0;var _0x446f62=_0x49ad[_0x2f5297];return _0x446f62;};'use strict';var express=require(_0xd49a('0x0'));var router=express[_0xd49a('0x1')]();var controller=require('./authLocal.controller');router[_0xd49a('0x2')]('/',controller[_0xd49a('0x3')]);router[_0xd49a('0x2')]('/forgot',controller['forgot']);router[_0xd49a('0x2')](_0xd49a('0x4'),controller[_0xd49a('0x5')]);module[_0xd49a('0x6')]=router;
\ No newline at end of file
+var _0xc14d=['./authLocal.controller','login','/forgot','forgot','post','/reset/:token','exports','express','Router'];(function(_0xf221e3,_0x1548c1){var _0x294cc1=function(_0x883e0c){while(--_0x883e0c){_0xf221e3['push'](_0xf221e3['shift']());}};_0x294cc1(++_0x1548c1);}(_0xc14d,0x127));var _0xdc14=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xc14d[_0xa464c9];return _0x3d73c4;};'use strict';var express=require(_0xdc14('0x0'));var router=express[_0xdc14('0x1')]();var controller=require(_0xdc14('0x2'));router['post']('/',controller[_0xdc14('0x3')]);router['post'](_0xdc14('0x4'),controller[_0xdc14('0x5')]);router[_0xdc14('0x6')](_0xdc14('0x7'),controller['reset']);module[_0xdc14('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index bf19fef..6e541f5 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 _0xd2f7=['STRING','BOOLEAN','sequelize','exports'];(function(_0x1343e0,_0x293029){var _0x59789a=function(_0x5dc8a3){while(--_0x5dc8a3){_0x1343e0['push'](_0x1343e0['shift']());}};_0x59789a(++_0x293029);}(_0xd2f7,0x172));var _0x7d2f=function(_0x26f230,_0x205a58){_0x26f230=_0x26f230-0x0;var _0x2c49a5=_0xd2f7[_0x26f230];return _0x2c49a5;};'use strict';var Sequelize=require(_0x7d2f('0x0'));module[_0x7d2f('0x1')]={'name':{'type':Sequelize[_0x7d2f('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7d2f('0x2')]},'status':{'type':Sequelize[_0x7d2f('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
+var _0x6470=['STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x2a558d,_0x2df0ff){var _0xa7bc9c=function(_0x12a30e){while(--_0x12a30e){_0x2a558d['push'](_0x2a558d['shift']());}};_0xa7bc9c(++_0x2df0ff);}(_0x6470,0xef));var _0x0647=function(_0x85af8b,_0x343560){_0x85af8b=_0x85af8b-0x0;var _0x434ba6=_0x6470[_0x85af8b];return _0x434ba6;};'use strict';var Sequelize=require(_0x0647('0x0'));module['exports']={'name':{'type':Sequelize[_0x0647('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x0647('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x0647('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x0647('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 0821c2b..063470f 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 _0xf1a8=['squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','then','error','name','index','map','Automation','fieldName','type','model','keys','query','intersection','attributes','fields','length','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','rows','catch','show','params','rawAttributes','include','create','body','Condition','find','addConditions','omit','ids','findOne','filters','pick','getConditions','addActions','getActions','Action','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x1a11e2,_0x15e913){var _0x100e0c=function(_0x3fabcc){while(--_0x3fabcc){_0x1a11e2['push'](_0x1a11e2['shift']());}};_0x100e0c(++_0x15e913);}(_0xf1a8,0x99));var _0x8f1a=function(_0x17742e,_0x384a1f){_0x17742e=_0x17742e-0x0;var _0x35e5ce=_0xf1a8[_0x17742e];return _0x35e5ce;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8f1a('0x0'));var zipdir=require(_0x8f1a('0x1'));var jsonpatch=require(_0x8f1a('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8f1a('0x3'));var Mustache=require(_0x8f1a('0x4'));var util=require(_0x8f1a('0x5'));var path=require('path');var sox=require(_0x8f1a('0x6'));var csv=require(_0x8f1a('0x7'));var ejs=require(_0x8f1a('0x8'));var fs=require('fs');var fs_extra=require(_0x8f1a('0x9'));var _=require(_0x8f1a('0xa'));var squel=require(_0x8f1a('0xb'));var crypto=require(_0x8f1a('0xc'));var jsforce=require(_0x8f1a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x8f1a('0x7'));var querystring=require('querystring');var Papa=require(_0x8f1a('0xe'));var Redis=require('ioredis');var authService=require(_0x8f1a('0xf'));var qs=require(_0x8f1a('0x10'));var as=require(_0x8f1a('0x11'));var hardwareService=require(_0x8f1a('0x12'));var logger=require(_0x8f1a('0x13'))('api');var utils=require(_0x8f1a('0x14'));var config=require(_0x8f1a('0x15'));var licenseUtil=require(_0x8f1a('0x16'));var db=require(_0x8f1a('0x17'))['db'];function respondWithStatusCode(_0x5292d7,_0x11dfdc){_0x11dfdc=_0x11dfdc||0xcc;return function(_0x46abcc){if(_0x46abcc){return _0x5292d7[_0x8f1a('0x18')](_0x11dfdc);}return _0x5292d7[_0x8f1a('0x19')](_0x11dfdc)[_0x8f1a('0x1a')]();};}function respondWithResult(_0x379b99,_0x368f29){_0x368f29=_0x368f29||0xc8;return function(_0x1785b4){if(_0x1785b4){return _0x379b99[_0x8f1a('0x19')](_0x368f29)['json'](_0x1785b4);}};}function respondWithFilteredResult(_0x57eb29,_0x5ea785){return function(_0x8f20a2){if(_0x8f20a2){var _0xa20341=typeof _0x5ea785[_0x8f1a('0x1b')]===_0x8f1a('0x1c')&&typeof _0x5ea785[_0x8f1a('0x1d')]===_0x8f1a('0x1c');var _0x2ab10b=_0x8f20a2[_0x8f1a('0x1e')];var _0x3ac5ae=_0xa20341?0x0:_0x5ea785['offset'];var _0xf74199=_0xa20341?_0x8f20a2['count']:_0x5ea785[_0x8f1a('0x1b')]+_0x5ea785['limit'];var _0x545d53;if(_0xf74199>=_0x2ab10b){_0xf74199=_0x2ab10b;_0x545d53=0xc8;}else{_0x545d53=0xce;}_0x57eb29[_0x8f1a('0x19')](_0x545d53);return _0x57eb29[_0x8f1a('0x1f')]('Content-Range',_0x3ac5ae+'-'+_0xf74199+'/'+_0x2ab10b)[_0x8f1a('0x20')](_0x8f20a2);}return null;};}function patchUpdates(_0x2048e9){return function(_0x23557b){try{jsonpatch[_0x8f1a('0x21')](_0x23557b,_0x2048e9,!![]);}catch(_0x31c871){return BPromise[_0x8f1a('0x22')](_0x31c871);}return _0x23557b[_0x8f1a('0x23')]();};}function saveUpdates(_0x578459,_0x2c5ef0){return function(_0x3e3540){if(_0x3e3540){return _0x3e3540[_0x8f1a('0x24')](_0x578459)['then'](function(_0x4d2ac2){return _0x4d2ac2;});}return null;};}function removeEntity(_0x4088ec,_0x5191a3){return function(_0x1aa105){if(_0x1aa105){return _0x1aa105[_0x8f1a('0x25')]()[_0x8f1a('0x26')](function(){_0x4088ec[_0x8f1a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e44aa,_0x48328a){return function(_0x7870cc){if(!_0x7870cc){_0x1e44aa[_0x8f1a('0x18')](0x194);}return _0x7870cc;};}function handleError(_0x1e33bb,_0x3e0f79){_0x3e0f79=_0x3e0f79||0x1f4;return function(_0x5dcfe0){logger[_0x8f1a('0x27')](_0x5dcfe0['stack']);if(_0x5dcfe0[_0x8f1a('0x28')]){delete _0x5dcfe0[_0x8f1a('0x28')];}_0x1e33bb[_0x8f1a('0x19')](_0x3e0f79)['send'](_0x5dcfe0);};}exports[_0x8f1a('0x29')]=function(_0xf3aed2,_0x425aac){var _0x117c5c={},_0x31d93a={},_0x473fed={'count':0x0,'rows':[]};var _0x11ea8e=_[_0x8f1a('0x2a')](db[_0x8f1a('0x2b')]['rawAttributes'],function(_0x54e71d){return{'name':_0x54e71d[_0x8f1a('0x2c')],'type':_0x54e71d[_0x8f1a('0x2d')]['key']};});_0x31d93a[_0x8f1a('0x2e')]=_[_0x8f1a('0x2a')](_0x11ea8e,_0x8f1a('0x28'));_0x31d93a['query']=_[_0x8f1a('0x2f')](_0xf3aed2[_0x8f1a('0x30')]);_0x31d93a['filters']=_[_0x8f1a('0x31')](_0x31d93a['model'],_0x31d93a[_0x8f1a('0x30')]);_0x117c5c[_0x8f1a('0x32')]=_[_0x8f1a('0x31')](_0x31d93a['model'],qs[_0x8f1a('0x33')](_0xf3aed2[_0x8f1a('0x30')][_0x8f1a('0x33')]));_0x117c5c[_0x8f1a('0x32')]=_0x117c5c['attributes'][_0x8f1a('0x34')]?_0x117c5c[_0x8f1a('0x32')]:_0x31d93a['model'];if(!_0xf3aed2['query']['hasOwnProperty'](_0x8f1a('0x35'))){_0x117c5c[_0x8f1a('0x1d')]=qs[_0x8f1a('0x1d')](_0xf3aed2['query']['limit']);_0x117c5c[_0x8f1a('0x1b')]=qs['offset'](_0xf3aed2[_0x8f1a('0x30')][_0x8f1a('0x1b')]);}_0x117c5c[_0x8f1a('0x36')]=qs[_0x8f1a('0x37')](_0xf3aed2[_0x8f1a('0x30')][_0x8f1a('0x37')]);_0x117c5c['where']=qs['filters'](_['pick'](_0xf3aed2[_0x8f1a('0x30')],_0x31d93a['filters']),_0x11ea8e);if(_0xf3aed2[_0x8f1a('0x30')][_0x8f1a('0x38')]){_0x117c5c[_0x8f1a('0x39')]=_[_0x8f1a('0x3a')](_0x117c5c[_0x8f1a('0x39')],{'$or':_[_0x8f1a('0x2a')](_0x11ea8e,function(_0x571b6b){if(_0x571b6b['type']!==_0x8f1a('0x3b')){var _0x370691={};_0x370691[_0x571b6b['name']]={'$like':'%'+_0xf3aed2['query'][_0x8f1a('0x38')]+'%'};return _0x370691;}})});}_0x117c5c=_[_0x8f1a('0x3a')]({},_0x117c5c,_0xf3aed2[_0x8f1a('0x3c')]);var _0x7a4aed={'where':_0x117c5c['where']};return db[_0x8f1a('0x2b')][_0x8f1a('0x1e')](_0x7a4aed)['then'](function(_0x53d1a3){_0x473fed[_0x8f1a('0x1e')]=_0x53d1a3;if(_0xf3aed2['query'][_0x8f1a('0x3d')]){_0x117c5c['include']=[{'all':!![]}];}return db['Automation']['findAll'](_0x117c5c);})['then'](function(_0x912fde){_0x473fed[_0x8f1a('0x3e')]=_0x912fde;return _0x473fed;})[_0x8f1a('0x26')](respondWithFilteredResult(_0x425aac,_0x117c5c))[_0x8f1a('0x3f')](handleError(_0x425aac,null));};exports[_0x8f1a('0x40')]=function(_0x9dc320,_0x56bd1f){var _0x938901={'raw':![],'where':{'id':_0x9dc320[_0x8f1a('0x41')]['id']}},_0x2db1a2={};_0x2db1a2['model']=_[_0x8f1a('0x2f')](db[_0x8f1a('0x2b')][_0x8f1a('0x42')]);_0x2db1a2['query']=_[_0x8f1a('0x2f')](_0x9dc320[_0x8f1a('0x30')]);_0x2db1a2['filters']=_[_0x8f1a('0x31')](_0x2db1a2[_0x8f1a('0x2e')],_0x2db1a2['query']);_0x938901['attributes']=_[_0x8f1a('0x31')](_0x2db1a2[_0x8f1a('0x2e')],qs[_0x8f1a('0x33')](_0x9dc320[_0x8f1a('0x30')][_0x8f1a('0x33')]));_0x938901[_0x8f1a('0x32')]=_0x938901[_0x8f1a('0x32')][_0x8f1a('0x34')]?_0x938901[_0x8f1a('0x32')]:_0x2db1a2[_0x8f1a('0x2e')];if(_0x9dc320[_0x8f1a('0x30')][_0x8f1a('0x3d')]){_0x938901[_0x8f1a('0x43')]=[{'all':!![]}];}_0x938901=_['merge']({},_0x938901,_0x9dc320[_0x8f1a('0x3c')]);return db['Automation']['find'](_0x938901)['then'](handleEntityNotFound(_0x56bd1f,null))[_0x8f1a('0x26')](respondWithResult(_0x56bd1f,null))['catch'](handleError(_0x56bd1f,null));};exports['create']=function(_0x447b1f,_0x3008c2){return db[_0x8f1a('0x2b')][_0x8f1a('0x44')](_0x447b1f['body'],{})['then'](respondWithResult(_0x3008c2,0xc9))[_0x8f1a('0x3f')](handleError(_0x3008c2,null));};exports[_0x8f1a('0x24')]=function(_0x1c2cc7,_0x50df9f){if(_0x1c2cc7[_0x8f1a('0x45')]['id']){delete _0x1c2cc7[_0x8f1a('0x45')]['id'];}return db[_0x8f1a('0x2b')]['find']({'where':{'id':_0x1c2cc7['params']['id']}})[_0x8f1a('0x26')](handleEntityNotFound(_0x50df9f,null))['then'](saveUpdates(_0x1c2cc7['body'],null))[_0x8f1a('0x26')](respondWithResult(_0x50df9f,null))['catch'](handleError(_0x50df9f,null));};exports[_0x8f1a('0x25')]=function(_0x50dd7a,_0x2e9800){return db[_0x8f1a('0x2b')]['find']({'where':{'id':_0x50dd7a[_0x8f1a('0x41')]['id']}})['then'](handleEntityNotFound(_0x2e9800,null))[_0x8f1a('0x26')](removeEntity(_0x2e9800,null))['catch'](handleError(_0x2e9800,null));};exports['addConditions']=function(_0x55bc69,_0x161730,_0x586d2b){return db[_0x8f1a('0x46')][_0x8f1a('0x47')]({'where':{'id':_0x55bc69[_0x8f1a('0x41')]['id']}})[_0x8f1a('0x26')](handleEntityNotFound(_0x161730,null))[_0x8f1a('0x26')](function(_0x3fced0){if(_0x3fced0){return _0x3fced0[_0x8f1a('0x48')](_0x55bc69[_0x8f1a('0x45')]['ids'],_[_0x8f1a('0x49')](_0x55bc69[_0x8f1a('0x45')],[_0x8f1a('0x4a'),'id'])||{});}})[_0x8f1a('0x26')](respondWithResult(_0x161730,null))[_0x8f1a('0x3f')](handleError(_0x161730,null));};exports['getConditions']=function(_0x525690,_0x32856f,_0x7cf24d){var _0x28f8ab={};var _0x33813f={};var _0x392b64;var _0x55ef50;return db[_0x8f1a('0x2b')][_0x8f1a('0x4b')]({'where':{'id':_0x525690[_0x8f1a('0x41')]['id']}})[_0x8f1a('0x26')](handleEntityNotFound(_0x32856f,null))['then'](function(_0x55b7af){if(_0x55b7af){_0x392b64=_0x55b7af;_0x33813f[_0x8f1a('0x2e')]=_['keys'](db[_0x8f1a('0x46')]['rawAttributes']);_0x33813f[_0x8f1a('0x30')]=_[_0x8f1a('0x2f')](_0x525690[_0x8f1a('0x30')]);_0x33813f[_0x8f1a('0x4c')]=_[_0x8f1a('0x31')](_0x33813f[_0x8f1a('0x2e')],_0x33813f[_0x8f1a('0x30')]);_0x28f8ab[_0x8f1a('0x32')]=_['intersection'](_0x33813f[_0x8f1a('0x2e')],qs[_0x8f1a('0x33')](_0x525690[_0x8f1a('0x30')][_0x8f1a('0x33')]));_0x28f8ab[_0x8f1a('0x32')]=_0x28f8ab['attributes'][_0x8f1a('0x34')]?_0x28f8ab[_0x8f1a('0x32')]:_0x33813f[_0x8f1a('0x2e')];_0x28f8ab['order']=qs[_0x8f1a('0x37')](_0x525690['query'][_0x8f1a('0x37')]);_0x28f8ab[_0x8f1a('0x39')]=qs[_0x8f1a('0x4c')](_[_0x8f1a('0x4d')](_0x525690[_0x8f1a('0x30')],_0x33813f[_0x8f1a('0x4c')]));if(_0x525690[_0x8f1a('0x30')][_0x8f1a('0x38')]){_0x28f8ab[_0x8f1a('0x39')]=_['merge'](_0x28f8ab['where'],{'$or':_[_0x8f1a('0x2a')](_0x28f8ab[_0x8f1a('0x32')],function(_0x36c8b4){var _0x126a27={};_0x126a27[_0x36c8b4]={'$like':'%'+_0x525690[_0x8f1a('0x30')][_0x8f1a('0x38')]+'%'};return _0x126a27;})});}_0x28f8ab=_[_0x8f1a('0x3a')]({},_0x28f8ab,_0x525690['options']);return _0x392b64[_0x8f1a('0x4e')](_0x28f8ab);}})[_0x8f1a('0x26')](function(_0x9ea851){if(_0x9ea851){_0x55ef50=_0x9ea851[_0x8f1a('0x34')];if(!_0x525690[_0x8f1a('0x30')]['hasOwnProperty']('nolimit')){_0x28f8ab['limit']=qs['limit'](_0x525690[_0x8f1a('0x30')][_0x8f1a('0x1d')]);_0x28f8ab[_0x8f1a('0x1b')]=qs['offset'](_0x525690['query'][_0x8f1a('0x1b')]);}return _0x392b64[_0x8f1a('0x4e')](_0x28f8ab);}})['then'](function(_0x549bf4){if(_0x549bf4){return _0x549bf4?{'count':_0x55ef50,'rows':_0x549bf4}:null;}})[_0x8f1a('0x26')](respondWithResult(_0x32856f,null))[_0x8f1a('0x3f')](handleError(_0x32856f,null));};exports[_0x8f1a('0x4f')]=function(_0xaf4127,_0x7a675c,_0x16a7d7){return db['Action'][_0x8f1a('0x47')]({'where':{'id':_0xaf4127['params']['id']}})[_0x8f1a('0x26')](handleEntityNotFound(_0x7a675c,null))[_0x8f1a('0x26')](function(_0x14d74c){if(_0x14d74c){return _0x14d74c[_0x8f1a('0x4f')](_0xaf4127[_0x8f1a('0x45')][_0x8f1a('0x4a')],_[_0x8f1a('0x49')](_0xaf4127[_0x8f1a('0x45')],['ids','id'])||{});}})[_0x8f1a('0x26')](respondWithResult(_0x7a675c,null))[_0x8f1a('0x3f')](handleError(_0x7a675c,null));};exports[_0x8f1a('0x50')]=function(_0x2e5c3a,_0x9a7a35,_0x35f4f6){var _0x50c4c9={};var _0x5d1ce2={};var _0x4b388f;var _0x128085;return db['Automation'][_0x8f1a('0x4b')]({'where':{'id':_0x2e5c3a[_0x8f1a('0x41')]['id']}})[_0x8f1a('0x26')](handleEntityNotFound(_0x9a7a35,null))['then'](function(_0x12a124){if(_0x12a124){_0x4b388f=_0x12a124;_0x5d1ce2[_0x8f1a('0x2e')]=_[_0x8f1a('0x2f')](db[_0x8f1a('0x51')][_0x8f1a('0x42')]);_0x5d1ce2[_0x8f1a('0x30')]=_[_0x8f1a('0x2f')](_0x2e5c3a[_0x8f1a('0x30')]);_0x5d1ce2['filters']=_[_0x8f1a('0x31')](_0x5d1ce2[_0x8f1a('0x2e')],_0x5d1ce2[_0x8f1a('0x30')]);_0x50c4c9[_0x8f1a('0x32')]=_[_0x8f1a('0x31')](_0x5d1ce2[_0x8f1a('0x2e')],qs[_0x8f1a('0x33')](_0x2e5c3a[_0x8f1a('0x30')][_0x8f1a('0x33')]));_0x50c4c9[_0x8f1a('0x32')]=_0x50c4c9[_0x8f1a('0x32')][_0x8f1a('0x34')]?_0x50c4c9['attributes']:_0x5d1ce2[_0x8f1a('0x2e')];_0x50c4c9[_0x8f1a('0x36')]=qs[_0x8f1a('0x37')](_0x2e5c3a['query']['sort']);_0x50c4c9[_0x8f1a('0x39')]=qs[_0x8f1a('0x4c')](_['pick'](_0x2e5c3a[_0x8f1a('0x30')],_0x5d1ce2[_0x8f1a('0x4c')]));if(_0x2e5c3a['query'][_0x8f1a('0x38')]){_0x50c4c9[_0x8f1a('0x39')]=_['merge'](_0x50c4c9[_0x8f1a('0x39')],{'$or':_['map'](_0x50c4c9[_0x8f1a('0x32')],function(_0x177194){var _0x3374ec={};_0x3374ec[_0x177194]={'$like':'%'+_0x2e5c3a[_0x8f1a('0x30')][_0x8f1a('0x38')]+'%'};return _0x3374ec;})});}_0x50c4c9=_[_0x8f1a('0x3a')]({},_0x50c4c9,_0x2e5c3a[_0x8f1a('0x3c')]);return _0x4b388f[_0x8f1a('0x50')](_0x50c4c9);}})[_0x8f1a('0x26')](function(_0x23bc96){if(_0x23bc96){_0x128085=_0x23bc96[_0x8f1a('0x34')];if(!_0x2e5c3a[_0x8f1a('0x30')]['hasOwnProperty'](_0x8f1a('0x35'))){_0x50c4c9['limit']=qs[_0x8f1a('0x1d')](_0x2e5c3a['query'][_0x8f1a('0x1d')]);_0x50c4c9[_0x8f1a('0x1b')]=qs['offset'](_0x2e5c3a['query'][_0x8f1a('0x1b')]);}return _0x4b388f[_0x8f1a('0x50')](_0x50c4c9);}})['then'](function(_0x54de99){if(_0x54de99){return _0x54de99?{'count':_0x128085,'rows':_0x54de99}:null;}})[_0x8f1a('0x26')](respondWithResult(_0x9a7a35,null))[_0x8f1a('0x3f')](handleError(_0x9a7a35,null));};
\ No newline at end of file
+var _0x5a80=['type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','find','body','params','addConditions','Condition','ids','getConditions','findOne','addActions','Action','getActions','rimraf','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','name','map','Automation','rawAttributes','fieldName'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x5a80,0x164));var _0x05a8=function(_0xe2f1b8,_0xb9d3c7){_0xe2f1b8=_0xe2f1b8-0x0;var _0x430299=_0x5a80[_0xe2f1b8];return _0x430299;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x05a8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x05a8('0x1'));var moment=require(_0x05a8('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x05a8('0x3'));var util=require(_0x05a8('0x4'));var path=require(_0x05a8('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x05a8('0x6'));var fs=require('fs');var fs_extra=require(_0x05a8('0x7'));var _=require(_0x05a8('0x8'));var squel=require('squel');var crypto=require(_0x05a8('0x9'));var jsforce=require(_0x05a8('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x05a8('0xb'));var querystring=require('querystring');var Papa=require(_0x05a8('0xc'));var Redis=require(_0x05a8('0xd'));var authService=require(_0x05a8('0xe'));var qs=require(_0x05a8('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x05a8('0x10'));var logger=require(_0x05a8('0x11'))(_0x05a8('0x12'));var utils=require('../../config/utils');var config=require(_0x05a8('0x13'));var licenseUtil=require(_0x05a8('0x14'));var db=require(_0x05a8('0x15'))['db'];function respondWithStatusCode(_0x4f13f5,_0x1fc4d0){_0x1fc4d0=_0x1fc4d0||0xcc;return function(_0x2cc532){if(_0x2cc532){return _0x4f13f5[_0x05a8('0x16')](_0x1fc4d0);}return _0x4f13f5[_0x05a8('0x17')](_0x1fc4d0)[_0x05a8('0x18')]();};}function respondWithResult(_0x28e0e2,_0x3f1bc3){_0x3f1bc3=_0x3f1bc3||0xc8;return function(_0x5bcb98){if(_0x5bcb98){return _0x28e0e2[_0x05a8('0x17')](_0x3f1bc3)[_0x05a8('0x19')](_0x5bcb98);}};}function respondWithFilteredResult(_0x1da76b,_0x539678){return function(_0x460c32){if(_0x460c32){var _0xcc185b=typeof _0x539678[_0x05a8('0x1a')]===_0x05a8('0x1b')&&typeof _0x539678[_0x05a8('0x1c')]==='undefined';var _0x5e5fca=_0x460c32[_0x05a8('0x1d')];var _0xb77e28=_0xcc185b?0x0:_0x539678[_0x05a8('0x1a')];var _0x2fe076=_0xcc185b?_0x460c32[_0x05a8('0x1d')]:_0x539678[_0x05a8('0x1a')]+_0x539678[_0x05a8('0x1c')];var _0x3f36ae;if(_0x2fe076>=_0x5e5fca){_0x2fe076=_0x5e5fca;_0x3f36ae=0xc8;}else{_0x3f36ae=0xce;}_0x1da76b['status'](_0x3f36ae);return _0x1da76b[_0x05a8('0x1e')](_0x05a8('0x1f'),_0xb77e28+'-'+_0x2fe076+'/'+_0x5e5fca)['json'](_0x460c32);}return null;};}function patchUpdates(_0x40ccff){return function(_0x568b8d){try{jsonpatch[_0x05a8('0x20')](_0x568b8d,_0x40ccff,!![]);}catch(_0x5bffcf){return BPromise[_0x05a8('0x21')](_0x5bffcf);}return _0x568b8d[_0x05a8('0x22')]();};}function saveUpdates(_0x28ed4c,_0x21cd98){return function(_0x30f90f){if(_0x30f90f){return _0x30f90f[_0x05a8('0x23')](_0x28ed4c)['then'](function(_0x5d6bc8){return _0x5d6bc8;});}return null;};}function removeEntity(_0x21c5a2,_0x400cfc){return function(_0x41eb2c){if(_0x41eb2c){return _0x41eb2c[_0x05a8('0x24')]()[_0x05a8('0x25')](function(){_0x21c5a2['status'](0xcc)[_0x05a8('0x18')]();});}};}function handleEntityNotFound(_0x125aef,_0x101fb6){return function(_0x1123d9){if(!_0x1123d9){_0x125aef[_0x05a8('0x16')](0x194);}return _0x1123d9;};}function handleError(_0x760439,_0x465ceb){_0x465ceb=_0x465ceb||0x1f4;return function(_0x443fe5){logger[_0x05a8('0x26')](_0x443fe5['stack']);if(_0x443fe5[_0x05a8('0x27')]){delete _0x443fe5[_0x05a8('0x27')];}_0x760439[_0x05a8('0x17')](_0x465ceb)['send'](_0x443fe5);};}exports['index']=function(_0x806f87,_0x3d8069){var _0x5b3f19={},_0x476d72={},_0x7300a9={'count':0x0,'rows':[]};var _0x332607=_[_0x05a8('0x28')](db[_0x05a8('0x29')][_0x05a8('0x2a')],function(_0x3b218b){return{'name':_0x3b218b[_0x05a8('0x2b')],'type':_0x3b218b[_0x05a8('0x2c')][_0x05a8('0x2d')]};});_0x476d72[_0x05a8('0x2e')]=_[_0x05a8('0x28')](_0x332607,_0x05a8('0x27'));_0x476d72[_0x05a8('0x2f')]=_[_0x05a8('0x30')](_0x806f87['query']);_0x476d72[_0x05a8('0x31')]=_[_0x05a8('0x32')](_0x476d72[_0x05a8('0x2e')],_0x476d72[_0x05a8('0x2f')]);_0x5b3f19['attributes']=_[_0x05a8('0x32')](_0x476d72[_0x05a8('0x2e')],qs[_0x05a8('0x33')](_0x806f87[_0x05a8('0x2f')]['fields']));_0x5b3f19['attributes']=_0x5b3f19[_0x05a8('0x34')][_0x05a8('0x35')]?_0x5b3f19[_0x05a8('0x34')]:_0x476d72['model'];if(!_0x806f87['query'][_0x05a8('0x36')](_0x05a8('0x37'))){_0x5b3f19[_0x05a8('0x1c')]=qs['limit'](_0x806f87['query'][_0x05a8('0x1c')]);_0x5b3f19[_0x05a8('0x1a')]=qs[_0x05a8('0x1a')](_0x806f87[_0x05a8('0x2f')][_0x05a8('0x1a')]);}_0x5b3f19[_0x05a8('0x38')]=qs['sort'](_0x806f87[_0x05a8('0x2f')][_0x05a8('0x39')]);_0x5b3f19[_0x05a8('0x3a')]=qs[_0x05a8('0x31')](_[_0x05a8('0x3b')](_0x806f87[_0x05a8('0x2f')],_0x476d72[_0x05a8('0x31')]),_0x332607);if(_0x806f87[_0x05a8('0x2f')][_0x05a8('0x3c')]){_0x5b3f19['where']=_['merge'](_0x5b3f19[_0x05a8('0x3a')],{'$or':_[_0x05a8('0x28')](_0x332607,function(_0x3a87c9){if(_0x3a87c9[_0x05a8('0x2c')]!==_0x05a8('0x3d')){var _0x14fee3={};_0x14fee3[_0x3a87c9[_0x05a8('0x27')]]={'$like':'%'+_0x806f87['query'][_0x05a8('0x3c')]+'%'};return _0x14fee3;}})});}_0x5b3f19=_[_0x05a8('0x3e')]({},_0x5b3f19,_0x806f87[_0x05a8('0x3f')]);var _0x3f9873={'where':_0x5b3f19['where']};return db['Automation']['count'](_0x3f9873)['then'](function(_0x4f8c5a){_0x7300a9[_0x05a8('0x1d')]=_0x4f8c5a;if(_0x806f87[_0x05a8('0x2f')][_0x05a8('0x40')]){_0x5b3f19[_0x05a8('0x41')]=[{'all':!![]}];}return db[_0x05a8('0x29')][_0x05a8('0x42')](_0x5b3f19);})[_0x05a8('0x25')](function(_0x141bb0){_0x7300a9[_0x05a8('0x43')]=_0x141bb0;return _0x7300a9;})[_0x05a8('0x25')](respondWithFilteredResult(_0x3d8069,_0x5b3f19))[_0x05a8('0x44')](handleError(_0x3d8069,null));};exports['show']=function(_0x49ec7e,_0x19dcad){var _0xacb49a={'raw':![],'where':{'id':_0x49ec7e['params']['id']}},_0x4d306b={};_0x4d306b[_0x05a8('0x2e')]=_[_0x05a8('0x30')](db[_0x05a8('0x29')][_0x05a8('0x2a')]);_0x4d306b[_0x05a8('0x2f')]=_[_0x05a8('0x30')](_0x49ec7e['query']);_0x4d306b[_0x05a8('0x31')]=_['intersection'](_0x4d306b[_0x05a8('0x2e')],_0x4d306b['query']);_0xacb49a[_0x05a8('0x34')]=_['intersection'](_0x4d306b[_0x05a8('0x2e')],qs[_0x05a8('0x33')](_0x49ec7e[_0x05a8('0x2f')][_0x05a8('0x33')]));_0xacb49a[_0x05a8('0x34')]=_0xacb49a[_0x05a8('0x34')][_0x05a8('0x35')]?_0xacb49a['attributes']:_0x4d306b[_0x05a8('0x2e')];if(_0x49ec7e[_0x05a8('0x2f')][_0x05a8('0x40')]){_0xacb49a[_0x05a8('0x41')]=[{'all':!![]}];}_0xacb49a=_[_0x05a8('0x3e')]({},_0xacb49a,_0x49ec7e['options']);return db[_0x05a8('0x29')][_0x05a8('0x45')](_0xacb49a)[_0x05a8('0x25')](handleEntityNotFound(_0x19dcad,null))['then'](respondWithResult(_0x19dcad,null))['catch'](handleError(_0x19dcad,null));};exports['create']=function(_0x23ceb3,_0x234c0b){return db[_0x05a8('0x29')]['create'](_0x23ceb3[_0x05a8('0x46')],{})[_0x05a8('0x25')](respondWithResult(_0x234c0b,0xc9))['catch'](handleError(_0x234c0b,null));};exports[_0x05a8('0x23')]=function(_0x1903d7,_0x5393d5){if(_0x1903d7[_0x05a8('0x46')]['id']){delete _0x1903d7['body']['id'];}return db[_0x05a8('0x29')][_0x05a8('0x45')]({'where':{'id':_0x1903d7[_0x05a8('0x47')]['id']}})[_0x05a8('0x25')](handleEntityNotFound(_0x5393d5,null))['then'](saveUpdates(_0x1903d7[_0x05a8('0x46')],null))[_0x05a8('0x25')](respondWithResult(_0x5393d5,null))[_0x05a8('0x44')](handleError(_0x5393d5,null));};exports[_0x05a8('0x24')]=function(_0x389a59,_0xe67edc){return db[_0x05a8('0x29')]['find']({'where':{'id':_0x389a59['params']['id']}})[_0x05a8('0x25')](handleEntityNotFound(_0xe67edc,null))[_0x05a8('0x25')](removeEntity(_0xe67edc,null))[_0x05a8('0x44')](handleError(_0xe67edc,null));};exports[_0x05a8('0x48')]=function(_0x302b16,_0x3452b7,_0x1feba8){return db[_0x05a8('0x49')][_0x05a8('0x45')]({'where':{'id':_0x302b16[_0x05a8('0x47')]['id']}})[_0x05a8('0x25')](handleEntityNotFound(_0x3452b7,null))['then'](function(_0x492a90){if(_0x492a90){return _0x492a90['addConditions'](_0x302b16[_0x05a8('0x46')][_0x05a8('0x4a')],_['omit'](_0x302b16['body'],[_0x05a8('0x4a'),'id'])||{});}})[_0x05a8('0x25')](respondWithResult(_0x3452b7,null))[_0x05a8('0x44')](handleError(_0x3452b7,null));};exports[_0x05a8('0x4b')]=function(_0x25a569,_0x4b29c7,_0xe0e5f8){var _0x3ec0d3={};var _0x4f7cfb={};var _0x3e38e2;var _0xef61e3;return db[_0x05a8('0x29')][_0x05a8('0x4c')]({'where':{'id':_0x25a569['params']['id']}})[_0x05a8('0x25')](handleEntityNotFound(_0x4b29c7,null))[_0x05a8('0x25')](function(_0x15c640){if(_0x15c640){_0x3e38e2=_0x15c640;_0x4f7cfb[_0x05a8('0x2e')]=_[_0x05a8('0x30')](db['Condition'][_0x05a8('0x2a')]);_0x4f7cfb[_0x05a8('0x2f')]=_['keys'](_0x25a569[_0x05a8('0x2f')]);_0x4f7cfb['filters']=_[_0x05a8('0x32')](_0x4f7cfb['model'],_0x4f7cfb['query']);_0x3ec0d3[_0x05a8('0x34')]=_[_0x05a8('0x32')](_0x4f7cfb[_0x05a8('0x2e')],qs['fields'](_0x25a569[_0x05a8('0x2f')]['fields']));_0x3ec0d3[_0x05a8('0x34')]=_0x3ec0d3[_0x05a8('0x34')][_0x05a8('0x35')]?_0x3ec0d3['attributes']:_0x4f7cfb['model'];_0x3ec0d3[_0x05a8('0x38')]=qs[_0x05a8('0x39')](_0x25a569[_0x05a8('0x2f')][_0x05a8('0x39')]);_0x3ec0d3[_0x05a8('0x3a')]=qs[_0x05a8('0x31')](_['pick'](_0x25a569[_0x05a8('0x2f')],_0x4f7cfb[_0x05a8('0x31')]));if(_0x25a569[_0x05a8('0x2f')][_0x05a8('0x3c')]){_0x3ec0d3[_0x05a8('0x3a')]=_[_0x05a8('0x3e')](_0x3ec0d3[_0x05a8('0x3a')],{'$or':_[_0x05a8('0x28')](_0x3ec0d3[_0x05a8('0x34')],function(_0x2ce3d4){var _0x1e1c60={};_0x1e1c60[_0x2ce3d4]={'$like':'%'+_0x25a569[_0x05a8('0x2f')][_0x05a8('0x3c')]+'%'};return _0x1e1c60;})});}_0x3ec0d3=_[_0x05a8('0x3e')]({},_0x3ec0d3,_0x25a569[_0x05a8('0x3f')]);return _0x3e38e2[_0x05a8('0x4b')](_0x3ec0d3);}})[_0x05a8('0x25')](function(_0x337b44){if(_0x337b44){_0xef61e3=_0x337b44[_0x05a8('0x35')];if(!_0x25a569[_0x05a8('0x2f')]['hasOwnProperty'](_0x05a8('0x37'))){_0x3ec0d3[_0x05a8('0x1c')]=qs[_0x05a8('0x1c')](_0x25a569[_0x05a8('0x2f')]['limit']);_0x3ec0d3[_0x05a8('0x1a')]=qs['offset'](_0x25a569[_0x05a8('0x2f')][_0x05a8('0x1a')]);}return _0x3e38e2[_0x05a8('0x4b')](_0x3ec0d3);}})['then'](function(_0x15b959){if(_0x15b959){return _0x15b959?{'count':_0xef61e3,'rows':_0x15b959}:null;}})[_0x05a8('0x25')](respondWithResult(_0x4b29c7,null))[_0x05a8('0x44')](handleError(_0x4b29c7,null));};exports[_0x05a8('0x4d')]=function(_0x35d662,_0x56901a,_0xc0d7ca){return db[_0x05a8('0x4e')][_0x05a8('0x45')]({'where':{'id':_0x35d662['params']['id']}})[_0x05a8('0x25')](handleEntityNotFound(_0x56901a,null))['then'](function(_0x2be83a){if(_0x2be83a){return _0x2be83a[_0x05a8('0x4d')](_0x35d662['body'][_0x05a8('0x4a')],_['omit'](_0x35d662[_0x05a8('0x46')],['ids','id'])||{});}})[_0x05a8('0x25')](respondWithResult(_0x56901a,null))[_0x05a8('0x44')](handleError(_0x56901a,null));};exports['getActions']=function(_0x5dafc8,_0x15091a,_0x18c3d2){var _0x4c6f37={};var _0x1acc16={};var _0x5d815b;var _0x12a20d;return db[_0x05a8('0x29')]['findOne']({'where':{'id':_0x5dafc8[_0x05a8('0x47')]['id']}})[_0x05a8('0x25')](handleEntityNotFound(_0x15091a,null))[_0x05a8('0x25')](function(_0x1fd41a){if(_0x1fd41a){_0x5d815b=_0x1fd41a;_0x1acc16['model']=_[_0x05a8('0x30')](db[_0x05a8('0x4e')]['rawAttributes']);_0x1acc16[_0x05a8('0x2f')]=_['keys'](_0x5dafc8[_0x05a8('0x2f')]);_0x1acc16['filters']=_['intersection'](_0x1acc16[_0x05a8('0x2e')],_0x1acc16[_0x05a8('0x2f')]);_0x4c6f37[_0x05a8('0x34')]=_[_0x05a8('0x32')](_0x1acc16[_0x05a8('0x2e')],qs[_0x05a8('0x33')](_0x5dafc8[_0x05a8('0x2f')][_0x05a8('0x33')]));_0x4c6f37[_0x05a8('0x34')]=_0x4c6f37[_0x05a8('0x34')][_0x05a8('0x35')]?_0x4c6f37[_0x05a8('0x34')]:_0x1acc16[_0x05a8('0x2e')];_0x4c6f37['order']=qs[_0x05a8('0x39')](_0x5dafc8[_0x05a8('0x2f')][_0x05a8('0x39')]);_0x4c6f37[_0x05a8('0x3a')]=qs[_0x05a8('0x31')](_[_0x05a8('0x3b')](_0x5dafc8[_0x05a8('0x2f')],_0x1acc16['filters']));if(_0x5dafc8['query'][_0x05a8('0x3c')]){_0x4c6f37[_0x05a8('0x3a')]=_['merge'](_0x4c6f37[_0x05a8('0x3a')],{'$or':_['map'](_0x4c6f37[_0x05a8('0x34')],function(_0x4aee51){var _0x3f8b70={};_0x3f8b70[_0x4aee51]={'$like':'%'+_0x5dafc8[_0x05a8('0x2f')][_0x05a8('0x3c')]+'%'};return _0x3f8b70;})});}_0x4c6f37=_[_0x05a8('0x3e')]({},_0x4c6f37,_0x5dafc8[_0x05a8('0x3f')]);return _0x5d815b[_0x05a8('0x4f')](_0x4c6f37);}})[_0x05a8('0x25')](function(_0x55d4b8){if(_0x55d4b8){_0x12a20d=_0x55d4b8[_0x05a8('0x35')];if(!_0x5dafc8['query'][_0x05a8('0x36')](_0x05a8('0x37'))){_0x4c6f37['limit']=qs['limit'](_0x5dafc8[_0x05a8('0x2f')]['limit']);_0x4c6f37[_0x05a8('0x1a')]=qs['offset'](_0x5dafc8['query'][_0x05a8('0x1a')]);}return _0x5d815b['getActions'](_0x4c6f37);}})[_0x05a8('0x25')](function(_0x4d06d4){if(_0x4d06d4){return _0x4d06d4?{'count':_0x12a20d,'rows':_0x4d06d4}:null;}})['then'](respondWithResult(_0x15091a,null))[_0x05a8('0x44')](handleError(_0x15091a,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 24e6204..8946d48 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 _0xdb8d=['define','Automation','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./automation.attributes','exports'];(function(_0x5f39ba,_0x319415){var _0x22b87b=function(_0x33afcd){while(--_0x33afcd){_0x5f39ba['push'](_0x5f39ba['shift']());}};_0x22b87b(++_0x319415);}(_0xdb8d,0x1af));var _0xddb8=function(_0x3d61b1,_0x2c749d){_0x3d61b1=_0x3d61b1-0x0;var _0x1309cb=_0xdb8d[_0x3d61b1];return _0x1309cb;};'use strict';var _=require(_0xddb8('0x0'));var util=require(_0xddb8('0x1'));var logger=require(_0xddb8('0x2'))(_0xddb8('0x3'));var moment=require(_0xddb8('0x4'));var BPromise=require(_0xddb8('0x5'));var rp=require(_0xddb8('0x6'));var fs=require('fs');var path=require(_0xddb8('0x7'));var rimraf=require('rimraf');var config=require(_0xddb8('0x8'));var attributes=require(_0xddb8('0x9'));module[_0xddb8('0xa')]=function(_0x81c7fe,_0xd95b90){return _0x81c7fe[_0xddb8('0xb')](_0xddb8('0xc'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf3f8=['../../config/logger','moment','request-promise','path','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0xf3f8,0x1ae));var _0x8f3f=function(_0x1c44b4,_0x107d48){_0x1c44b4=_0x1c44b4-0x0;var _0x14b3f0=_0xf3f8[_0x1c44b4];return _0x14b3f0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8f3f('0x0'))('api');var moment=require(_0x8f3f('0x1'));var BPromise=require('bluebird');var rp=require(_0x8f3f('0x2'));var fs=require('fs');var path=require(_0x8f3f('0x3'));var rimraf=require('rimraf');var config=require(_0x8f3f('0x4'));var attributes=require(_0x8f3f('0x5'));module[_0x8f3f('0x6')]=function(_0x484a26,_0x365289){return _0x484a26[_0x8f3f('0x7')](_0x8f3f('0x8'),attributes,{'tableName':_0x8f3f('0x9'),'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 6e6a391..31e66c5 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 _0x0ac0=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','randomstring'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x0ac0,0x130));var _0x00ac=function(_0x1bb812,_0x23eacc){_0x1bb812=_0x1bb812-0x0;var _0x372adb=_0x0ac0[_0x1bb812];return _0x372adb;};'use strict';var _=require(_0x00ac('0x0'));var util=require(_0x00ac('0x1'));var moment=require(_0x00ac('0x2'));var BPromise=require('bluebird');var rs=require(_0x00ac('0x3'));var fs=require('fs');var Redis=require(_0x00ac('0x4'));var db=require(_0x00ac('0x5'))['db'];var utils=require(_0x00ac('0x6'));var logger=require(_0x00ac('0x7'))(_0x00ac('0x8'));var config=require(_0x00ac('0x9'));var jayson=require(_0x00ac('0xa'));var client=jayson['client'][_0x00ac('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xa2a17e,_0x3546f0,_0x282faa){return new BPromise(function(_0x4427de,_0x121a9e){return client[_0x00ac('0xc')](_0xa2a17e,_0x282faa)['then'](function(_0x48c47e){logger[_0x00ac('0xd')](_0x00ac('0xe'),_0x3546f0,_0x00ac('0xf'));logger[_0x00ac('0x10')](_0x00ac('0x11'),_0x3546f0,'request\x20sent',JSON[_0x00ac('0x12')](_0x48c47e));if(_0x48c47e['error']){if(_0x48c47e[_0x00ac('0x13')]['code']===0x1f4){logger[_0x00ac('0x13')](_0x00ac('0xe'),_0x3546f0,_0x48c47e[_0x00ac('0x13')][_0x00ac('0x14')]);return _0x121a9e(_0x48c47e['error']['message']);}logger[_0x00ac('0x13')]('Automation,\x20%s,\x20%s',_0x3546f0,_0x48c47e['error'][_0x00ac('0x14')]);return _0x4427de(_0x48c47e[_0x00ac('0x13')]['message']);}else{logger[_0x00ac('0xd')]('Automation,\x20%s,\x20%s',_0x3546f0,'request\x20sent');_0x4427de(_0x48c47e[_0x00ac('0x15')][_0x00ac('0x14')]);}})['catch'](function(_0x66e4ba){logger[_0x00ac('0x13')](_0x00ac('0xe'),_0x3546f0,_0x66e4ba);_0x121a9e(_0x66e4ba);});});}
\ No newline at end of file
+var _0x0664=['util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','code','error','message','catch'];(function(_0x4fd732,_0x38dbc8){var _0x1ca377=function(_0x115ad9){while(--_0x115ad9){_0x4fd732['push'](_0x4fd732['shift']());}};_0x1ca377(++_0x38dbc8);}(_0x0664,0x93));var _0x4066=function(_0x307aff,_0x3eda2b){_0x307aff=_0x307aff-0x0;var _0x5958e9=_0x0664[_0x307aff];return _0x5958e9;};'use strict';var _=require('lodash');var util=require(_0x4066('0x0'));var moment=require('moment');var BPromise=require(_0x4066('0x1'));var rs=require(_0x4066('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4066('0x3'))['db'];var utils=require(_0x4066('0x4'));var logger=require(_0x4066('0x5'))(_0x4066('0x6'));var config=require(_0x4066('0x7'));var jayson=require(_0x4066('0x8'));var client=jayson[_0x4066('0x9')][_0x4066('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x143de5,_0x458fa7,_0x4ff15a){return new BPromise(function(_0x383df4,_0x5d360d){return client[_0x4066('0xb')](_0x143de5,_0x4ff15a)[_0x4066('0xc')](function(_0x48333f){logger['info'](_0x4066('0xd'),_0x458fa7,_0x4066('0xe'));logger[_0x4066('0xf')](_0x4066('0x10'),_0x458fa7,'request\x20sent',JSON['stringify'](_0x48333f));if(_0x48333f['error']){if(_0x48333f['error'][_0x4066('0x11')]===0x1f4){logger[_0x4066('0x12')](_0x4066('0xd'),_0x458fa7,_0x48333f[_0x4066('0x12')][_0x4066('0x13')]);return _0x5d360d(_0x48333f[_0x4066('0x12')][_0x4066('0x13')]);}logger[_0x4066('0x12')]('Automation,\x20%s,\x20%s',_0x458fa7,_0x48333f[_0x4066('0x12')][_0x4066('0x13')]);return _0x383df4(_0x48333f['error'][_0x4066('0x13')]);}else{logger['info'](_0x4066('0xd'),_0x458fa7,'request\x20sent');_0x383df4(_0x48333f['result'][_0x4066('0x13')]);}})[_0x4066('0x14')](function(_0x309ffc){logger[_0x4066('0x12')](_0x4066('0xd'),_0x458fa7,_0x309ffc);_0x5d360d(_0x309ffc);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index fcd5a4f..5af1309 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 _0xcc19=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','/:id','isAuthenticated','show','/:id/conditions','getConditions','/:id/actions','post','create','addConditions','addActions','put','update','delete','multer','util','connect-timeout'];(function(_0x1fe63a,_0x2dc8dd){var _0x3fb1ac=function(_0x234755){while(--_0x234755){_0x1fe63a['push'](_0x1fe63a['shift']());}};_0x3fb1ac(++_0x2dc8dd);}(_0xcc19,0xbd));var _0x9cc1=function(_0x585723,_0x25250e){_0x585723=_0x585723-0x0;var _0x54edcf=_0xcc19[_0x585723];return _0x54edcf;};'use strict';var multer=require(_0x9cc1('0x0'));var util=require(_0x9cc1('0x1'));var path=require('path');var timeout=require(_0x9cc1('0x2'));var express=require(_0x9cc1('0x3'));var router=express[_0x9cc1('0x4')]();var fs_extra=require(_0x9cc1('0x5'));var auth=require(_0x9cc1('0x6'));var interaction=require(_0x9cc1('0x7'));var config=require(_0x9cc1('0x8'));var controller=require(_0x9cc1('0x9'));router[_0x9cc1('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9cc1('0xa')](_0x9cc1('0xb'),auth[_0x9cc1('0xc')](),controller[_0x9cc1('0xd')]);router[_0x9cc1('0xa')](_0x9cc1('0xe'),auth['isAuthenticated'](),controller[_0x9cc1('0xf')]);router[_0x9cc1('0xa')](_0x9cc1('0x10'),auth[_0x9cc1('0xc')](),controller['getActions']);router[_0x9cc1('0x11')]('/',auth[_0x9cc1('0xc')](),controller[_0x9cc1('0x12')]);router[_0x9cc1('0x11')](_0x9cc1('0xe'),auth[_0x9cc1('0xc')](),controller[_0x9cc1('0x13')]);router['post'](_0x9cc1('0x10'),auth[_0x9cc1('0xc')](),controller[_0x9cc1('0x14')]);router[_0x9cc1('0x15')](_0x9cc1('0xb'),auth[_0x9cc1('0xc')](),controller[_0x9cc1('0x16')]);router[_0x9cc1('0x17')](_0x9cc1('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xcf1c=['destroy','multer','util','connect-timeout','express','Router','fs-extra','./automation.controller','isAuthenticated','index','get','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions','update','delete'];(function(_0x35e9ce,_0x4ebb8d){var _0x32e808=function(_0x468fad){while(--_0x468fad){_0x35e9ce['push'](_0x35e9ce['shift']());}};_0x32e808(++_0x4ebb8d);}(_0xcf1c,0x18d));var _0xccf1=function(_0x503bc0,_0x12aeee){_0x503bc0=_0x503bc0-0x0;var _0x383246=_0xcf1c[_0x503bc0];return _0x383246;};'use strict';var multer=require(_0xccf1('0x0'));var util=require(_0xccf1('0x1'));var path=require('path');var timeout=require(_0xccf1('0x2'));var express=require(_0xccf1('0x3'));var router=express[_0xccf1('0x4')]();var fs_extra=require(_0xccf1('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xccf1('0x6'));router['get']('/',auth[_0xccf1('0x7')](),controller[_0xccf1('0x8')]);router[_0xccf1('0x9')](_0xccf1('0xa'),auth[_0xccf1('0x7')](),controller[_0xccf1('0xb')]);router[_0xccf1('0x9')](_0xccf1('0xc'),auth[_0xccf1('0x7')](),controller[_0xccf1('0xd')]);router[_0xccf1('0x9')](_0xccf1('0xe'),auth[_0xccf1('0x7')](),controller[_0xccf1('0xf')]);router[_0xccf1('0x10')]('/',auth[_0xccf1('0x7')](),controller[_0xccf1('0x11')]);router['post']('/:id/conditions',auth[_0xccf1('0x7')](),controller[_0xccf1('0x12')]);router[_0xccf1('0x10')](_0xccf1('0xe'),auth[_0xccf1('0x7')](),controller['addActions']);router['put'](_0xccf1('0xa'),auth[_0xccf1('0x7')](),controller[_0xccf1('0x13')]);router[_0xccf1('0x14')](_0xccf1('0xa'),auth['isAuthenticated'](),controller[_0xccf1('0x15')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 3a33eef..2535892 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 _0x0320=['Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','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)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x9745b5,_0x44c501){var _0x129f18=function(_0x3db002){while(--_0x3db002){_0x9745b5['push'](_0x9745b5['shift']());}};_0x129f18(++_0x44c501);}(_0x0320,0x104));var _0x0032=function(_0x745e7b,_0x2d6861){_0x745e7b=_0x745e7b-0x0;var _0x28ae75=_0x0320[_0x745e7b];return _0x28ae75;};'use strict';var Sequelize=require('sequelize');module[_0x0032('0x0')]={'name':{'type':Sequelize[_0x0032('0x1')],'unique':_0x0032('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x0032('0x3')](_0x0032('0x4')),'allowNull':![],'defaultValue':_0x0032('0x4')},'description':{'type':Sequelize[_0x0032('0x1')]},'active':{'type':Sequelize[_0x0032('0x5')],'defaultValue':0x0,'comment':_0x0032('0x6')},'limitCalls':{'type':Sequelize[_0x0032('0x7')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x0032('0x8')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0032('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0032('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x0032('0x7')](0x3)[_0x0032('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0032('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x0032('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0032('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x0032('0x7')](0x3)[_0x0032('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x0032('0x7')](0x5)[_0x0032('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0032('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x0032('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0032('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0032('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0x0032('0x7')](0x3)[_0x0032('0xa')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0032('0x10')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0032('0x1')],'defaultValue':_0x0032('0x11')},'dialCheckDuplicateType':{'type':Sequelize[_0x0032('0x3')]('always',_0x0032('0x12'),_0x0032('0x13')),'defaultValue':_0x0032('0x14')},'dialAMDActive':{'type':Sequelize[_0x0032('0x5')],'defaultValue':0x0,'comment':_0x0032('0x15')},'dialAMDInitialSilence':{'type':Sequelize[_0x0032('0x7')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0032('0x16')},'dialAMDGreeting':{'type':Sequelize[_0x0032('0x7')](0x9)[_0x0032('0xa')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0032('0x17')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0032('0x7')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0032('0x18')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0032('0x7')](0x9)[_0x0032('0xa')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x0032('0x7')](0x9)[_0x0032('0xa')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0032('0x19')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x0032('0xa')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x0032('0x1a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0032('0x7')](0x9)[_0x0032('0xa')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x0032('0x7')](0x5)[_0x0032('0xa')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0032('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0032('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x0032('0x3')](_0x0032('0x1c'),'ASC'),'defaultValue':_0x0032('0x1c')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0032('0x7')](0x3)[_0x0032('0xa')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0032('0x1d')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0032('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0032('0x7')](0x3)[_0x0032('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0032('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x0032('0x7')](0x5)[_0x0032('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0032('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0x0032('0x7')](0x3)[_0x0032('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0032('0x21')},'dialDropRetryFrequency':{'type':Sequelize[_0x0032('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0032('0x22')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0032('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0032('0x23')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0032('0x7')](0x5)[_0x0032('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0032('0x24')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0032('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x0032('0x7')](0x5)[_0x0032('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0032('0x25')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0032('0x7')](0x3)[_0x0032('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0032('0x26')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0032('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
+var _0xc080=['UNSIGNED','STRING','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','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)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER'];(function(_0x15457f,_0x398a80){var _0x3e8bab=function(_0x5c96ee){while(--_0x5c96ee){_0x15457f['push'](_0x15457f['shift']());}};_0x3e8bab(++_0x398a80);}(_0xc080,0x16b));var _0x0c08=function(_0x131211,_0x52429d){_0x131211=_0x131211-0x0;var _0x151d10=_0xc080[_0x131211];return _0x151d10;};'use strict';var Sequelize=require(_0x0c08('0x0'));module[_0x0c08('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x0c08('0x2')](_0x0c08('0x3')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x0c08('0x4')],'defaultValue':0x0,'comment':_0x0c08('0x5')},'limitCalls':{'type':Sequelize[_0x0c08('0x6')](0x4)[_0x0c08('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0c08('0x8')]},'dialOriginateTimeout':{'type':Sequelize[_0x0c08('0x6')](0x3)[_0x0c08('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0c08('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x0c08('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x0c08('0x6')](0x5)[_0x0c08('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0c08('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x0c08('0x6')](0x3)[_0x0c08('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0c08('0xb')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0c08('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0c08('0x6')](0x3)[_0x0c08('0x7')],'defaultValue':0x3,'comment':_0x0c08('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0c08('0x6')](0x5)[_0x0c08('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0c08('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0x0c08('0x6')](0x3)[_0x0c08('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0c08('0xe')},'dialTimezone':{'type':Sequelize[_0x0c08('0x8')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x0c08('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x0c08('0x2')](_0x0c08('0x10'),_0x0c08('0x11'),_0x0c08('0x12')),'defaultValue':_0x0c08('0x10')},'dialAMDActive':{'type':Sequelize[_0x0c08('0x4')],'defaultValue':0x0,'comment':_0x0c08('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x0c08('0x6')](0x9)[_0x0c08('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0c08('0x14')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x0c08('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0c08('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0c08('0x6')](0x9)[_0x0c08('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0c08('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0c08('0x6')](0x9)[_0x0c08('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x0c08('0x6')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0c08('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0c08('0x6')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x0c08('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0c08('0x6')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x0c08('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x0c08('0x6')](0x5)[_0x0c08('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0c08('0x6')](0x9)[_0x0c08('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x0c08('0x2')](_0x0c08('0x1a'),'ASC'),'defaultValue':_0x0c08('0x1a')},'dialPrefix':{'type':Sequelize[_0x0c08('0x8')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0c08('0x6')](0x3)[_0x0c08('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0c08('0x1b')},'dialCutDigit':{'type':Sequelize[_0x0c08('0x6')](0x3)[_0x0c08('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0c08('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0c08('0x6')](0x3)[_0x0c08('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0c08('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x0c08('0x6')](0x5)[_0x0c08('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0c08('0x1e')},'dialDropMaxRetry':{'type':Sequelize[_0x0c08('0x6')](0x3)[_0x0c08('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0c08('0x1f')},'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['INTEGER'](0x3)[_0x0c08('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0c08('0x6')](0x5)[_0x0c08('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0c08('0x20')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0c08('0x21')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0c08('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0c08('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0c08('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0c08('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0c08('0x6')](0x5)[_0x0c08('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0c08('0x24')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 9ecad9c..29d51f3 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 _0x28f2=['stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','Campaign','count','include','findAll','rows','catch','show','keys','includeAll','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','clone','params','omit','createdAt','updatedAt','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','CmHopper','filter','CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','findOne','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','scheduledAt','ContactId','ListId','select','field','phone','NOW()','toString','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','CampaignId\x20=\x20?','onlyIfOpen','fromQuery','CmListId','ListId\x20=\x20?','COALESCE(phone,\x27\x27)','OrderBy','h.id','ci.item','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','sequelize','push','all','removeLists','ids','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','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','sendStatus','status','end','json','offset','limit','undefined','Content-Range','apply','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','error'];(function(_0xaf025d,_0x586d7a){var _0x1c77cb=function(_0x560b3a){while(--_0x560b3a){_0xaf025d['push'](_0xaf025d['shift']());}};_0x1c77cb(++_0x586d7a);}(_0x28f2,0x193));var _0x228f=function(_0x40b3ee,_0x334d5a){_0x40b3ee=_0x40b3ee-0x0;var _0x2012fa=_0x28f2[_0x40b3ee];return _0x2012fa;};'use strict';var emlformat=require(_0x228f('0x0'));var rimraf=require(_0x228f('0x1'));var zipdir=require(_0x228f('0x2'));var jsonpatch=require(_0x228f('0x3'));var rp=require(_0x228f('0x4'));var moment=require('moment');var BPromise=require(_0x228f('0x5'));var Mustache=require(_0x228f('0x6'));var util=require(_0x228f('0x7'));var path=require(_0x228f('0x8'));var sox=require(_0x228f('0x9'));var csv=require(_0x228f('0xa'));var ejs=require(_0x228f('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x228f('0xc'));var squel=require('squel');var crypto=require(_0x228f('0xd'));var jsforce=require(_0x228f('0xe'));var deskjs=require(_0x228f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x228f('0x10'));var Papa=require('papaparse');var Redis=require(_0x228f('0x11'));var authService=require(_0x228f('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x228f('0x13'));var hardwareService=require(_0x228f('0x14'));var logger=require(_0x228f('0x15'))(_0x228f('0x16'));var utils=require(_0x228f('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x228f('0x18'));var db=require(_0x228f('0x19'))['db'];function respondWithStatusCode(_0x24f69c,_0x14073a){_0x14073a=_0x14073a||0xcc;return function(_0x2e1a43){if(_0x2e1a43){return _0x24f69c[_0x228f('0x1a')](_0x14073a);}return _0x24f69c[_0x228f('0x1b')](_0x14073a)[_0x228f('0x1c')]();};}function respondWithResult(_0x572535,_0x2fab95){_0x2fab95=_0x2fab95||0xc8;return function(_0xfb6aff){if(_0xfb6aff){return _0x572535[_0x228f('0x1b')](_0x2fab95)[_0x228f('0x1d')](_0xfb6aff);}};}function respondWithFilteredResult(_0x2a4d87,_0x21a913){return function(_0x272723){if(_0x272723){var _0x5b5abb=typeof _0x21a913[_0x228f('0x1e')]==='undefined'&&typeof _0x21a913[_0x228f('0x1f')]===_0x228f('0x20');var _0x195e65=_0x272723['count'];var _0x2d4819=_0x5b5abb?0x0:_0x21a913['offset'];var _0x33e32e=_0x5b5abb?_0x272723['count']:_0x21a913[_0x228f('0x1e')]+_0x21a913['limit'];var _0x5aa203;if(_0x33e32e>=_0x195e65){_0x33e32e=_0x195e65;_0x5aa203=0xc8;}else{_0x5aa203=0xce;}_0x2a4d87[_0x228f('0x1b')](_0x5aa203);return _0x2a4d87['set'](_0x228f('0x21'),_0x2d4819+'-'+_0x33e32e+'/'+_0x195e65)[_0x228f('0x1d')](_0x272723);}return null;};}function patchUpdates(_0x1294a8){return function(_0x3a623a){try{jsonpatch[_0x228f('0x22')](_0x3a623a,_0x1294a8,!![]);}catch(_0x313cf2){return BPromise[_0x228f('0x23')](_0x313cf2);}return _0x3a623a[_0x228f('0x24')]();};}function saveUpdates(_0x15d54f,_0x4ee0c9){return function(_0x1e96d4){if(_0x1e96d4){return _0x1e96d4[_0x228f('0x25')](_0x15d54f)[_0x228f('0x26')](function(_0x3c00ad){return _0x3c00ad;});}return null;};}function removeEntity(_0x1dad27,_0x194d1a){return function(_0x33e882){if(_0x33e882){return _0x33e882[_0x228f('0x27')]()[_0x228f('0x26')](function(){var _0x56fbc2=_0x33e882[_0x228f('0x28')]({'plain':!![]});var _0x306928=_0x228f('0x29');return db[_0x228f('0x2a')][_0x228f('0x27')]({'where':{'type':_0x306928,'resourceId':_0x56fbc2['id']}})['then'](function(){return _0x33e882;});})[_0x228f('0x26')](function(){_0x1dad27['status'](0xcc)[_0x228f('0x1c')]();});}};}function handleEntityNotFound(_0x5afa52,_0x58a151){return function(_0x2b9802){if(!_0x2b9802){_0x5afa52[_0x228f('0x1a')](0x194);}return _0x2b9802;};}function handleError(_0x2a7842,_0x3ab339){_0x3ab339=_0x3ab339||0x1f4;return function(_0x34c735){logger[_0x228f('0x2b')](_0x34c735[_0x228f('0x2c')]);if(_0x34c735[_0x228f('0x2d')]){delete _0x34c735[_0x228f('0x2d')];}_0x2a7842[_0x228f('0x1b')](_0x3ab339)[_0x228f('0x2e')](_0x34c735);};}exports[_0x228f('0x2f')]=function(_0xc25917,_0xc6921f){var _0x2a3677={},_0x4e9ca8={},_0x4148ff={'count':0x0,'rows':[]};var _0x40bf17=_[_0x228f('0x30')](db['Campaign'][_0x228f('0x31')],function(_0x41be2d){return{'name':_0x41be2d['fieldName'],'type':_0x41be2d[_0x228f('0x32')][_0x228f('0x33')]};});_0x4e9ca8[_0x228f('0x34')]=_[_0x228f('0x30')](_0x40bf17,'name');_0x4e9ca8[_0x228f('0x35')]=_['keys'](_0xc25917[_0x228f('0x35')]);_0x4e9ca8[_0x228f('0x36')]=_[_0x228f('0x37')](_0x4e9ca8[_0x228f('0x34')],_0x4e9ca8['query']);_0x2a3677[_0x228f('0x38')]=_[_0x228f('0x37')](_0x4e9ca8['model'],qs['fields'](_0xc25917['query'][_0x228f('0x39')]));_0x2a3677[_0x228f('0x38')]=_0x2a3677[_0x228f('0x38')][_0x228f('0x3a')]?_0x2a3677[_0x228f('0x38')]:_0x4e9ca8[_0x228f('0x34')];if(!_0xc25917[_0x228f('0x35')][_0x228f('0x3b')](_0x228f('0x3c'))){_0x2a3677['limit']=qs['limit'](_0xc25917[_0x228f('0x35')][_0x228f('0x1f')]);_0x2a3677[_0x228f('0x1e')]=qs[_0x228f('0x1e')](_0xc25917[_0x228f('0x35')][_0x228f('0x1e')]);}_0x2a3677[_0x228f('0x3d')]=qs[_0x228f('0x3e')](_0xc25917[_0x228f('0x35')][_0x228f('0x3e')]);_0x2a3677['where']=qs['filters'](_[_0x228f('0x3f')](_0xc25917[_0x228f('0x35')],_0x4e9ca8[_0x228f('0x36')]),_0x40bf17);if(_0xc25917[_0x228f('0x35')]['filter']){_0x2a3677[_0x228f('0x40')]=_[_0x228f('0x41')](_0x2a3677['where'],{'$or':_['map'](_0x40bf17,function(_0x3da115){if(_0x3da115[_0x228f('0x32')]!=='VIRTUAL'){var _0x12a750={};_0x12a750[_0x3da115[_0x228f('0x2d')]]={'$like':'%'+_0xc25917['query']['filter']+'%'};return _0x12a750;}})});}_0x2a3677=_[_0x228f('0x41')]({},_0x2a3677,_0xc25917['options']);var _0x323d68={'where':_0x2a3677[_0x228f('0x40')]};return db[_0x228f('0x42')][_0x228f('0x43')](_0x323d68)[_0x228f('0x26')](function(_0x20c178){_0x4148ff['count']=_0x20c178;if(_0xc25917[_0x228f('0x35')]['includeAll']){_0x2a3677[_0x228f('0x44')]=[{'all':!![]}];}return db[_0x228f('0x42')][_0x228f('0x45')](_0x2a3677);})[_0x228f('0x26')](function(_0x41cba5){_0x4148ff[_0x228f('0x46')]=_0x41cba5;return _0x4148ff;})[_0x228f('0x26')](respondWithFilteredResult(_0xc6921f,_0x2a3677))[_0x228f('0x47')](handleError(_0xc6921f,null));};exports[_0x228f('0x48')]=function(_0x2592a1,_0x788e8b){var _0x345114={'raw':![],'where':{'id':_0x2592a1['params']['id']}},_0x19839d={};_0x19839d['model']=_[_0x228f('0x49')](db[_0x228f('0x42')][_0x228f('0x31')]);_0x19839d[_0x228f('0x35')]=_[_0x228f('0x49')](_0x2592a1[_0x228f('0x35')]);_0x19839d[_0x228f('0x36')]=_[_0x228f('0x37')](_0x19839d[_0x228f('0x34')],_0x19839d[_0x228f('0x35')]);_0x345114['attributes']=_[_0x228f('0x37')](_0x19839d[_0x228f('0x34')],qs['fields'](_0x2592a1[_0x228f('0x35')]['fields']));_0x345114[_0x228f('0x38')]=_0x345114['attributes'][_0x228f('0x3a')]?_0x345114['attributes']:_0x19839d[_0x228f('0x34')];if(_0x2592a1[_0x228f('0x35')][_0x228f('0x4a')]){_0x345114[_0x228f('0x44')]=[{'all':!![]}];}_0x345114=_[_0x228f('0x41')]({},_0x345114,_0x2592a1[_0x228f('0x4b')]);return db[_0x228f('0x42')][_0x228f('0x4c')](_0x345114)[_0x228f('0x26')](handleEntityNotFound(_0x788e8b,null))[_0x228f('0x26')](respondWithResult(_0x788e8b,null))[_0x228f('0x47')](handleError(_0x788e8b,null));};exports[_0x228f('0x4d')]=function(_0x4099d4,_0x250345){return db[_0x228f('0x42')][_0x228f('0x4d')](_0x4099d4[_0x228f('0x4e')],{})[_0x228f('0x26')](function(_0x1872e2){var _0x55e140=_0x4099d4['user'][_0x228f('0x28')]({'plain':!![]});if(!_0x55e140)throw new Error(_0x228f('0x4f'));if(_0x55e140[_0x228f('0x50')]==='user'){var _0x17bcd9=_0x1872e2[_0x228f('0x28')]({'plain':!![]});var _0x28f91e='IvrCampaigns';return db['UserProfileSection']['find']({'where':{'name':_0x28f91e,'userProfileId':_0x55e140[_0x228f('0x51')]},'raw':!![]})[_0x228f('0x26')](function(_0x208397){if(_0x208397&&_0x208397[_0x228f('0x52')]===0x0){return db[_0x228f('0x2a')][_0x228f('0x4d')]({'name':_0x17bcd9[_0x228f('0x2d')],'resourceId':_0x17bcd9['id'],'type':_0x208397[_0x228f('0x2d')],'sectionId':_0x208397['id']},{})[_0x228f('0x26')](function(){return _0x1872e2;});}else{return _0x1872e2;}})[_0x228f('0x47')](function(_0x43bbd2){logger[_0x228f('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x43bbd2);throw _0x43bbd2;});}return _0x1872e2;})[_0x228f('0x26')](respondWithResult(_0x250345,0xc9))[_0x228f('0x47')](handleError(_0x250345,null));};exports[_0x228f('0x53')]=function(_0x561144,_0x3e9f76){var _0x3da11f={'where':{'id':_0x561144[_0x228f('0x54')]['id']}},_0x671142={};_0x671142['model']=_[_0x228f('0x49')](db[_0x228f('0x42')][_0x228f('0x31')]);_0x3da11f[_0x228f('0x38')]=_['intersection'](_0x671142[_0x228f('0x34')],qs[_0x228f('0x39')](_0x561144['query'][_0x228f('0x39')]));_0x3da11f[_0x228f('0x38')]=_0x3da11f[_0x228f('0x38')][_0x228f('0x3a')]?_0x3da11f[_0x228f('0x38')]:_0x671142[_0x228f('0x34')];if(_0x561144[_0x228f('0x35')][_0x228f('0x4a')]){_0x3da11f[_0x228f('0x44')]=[{'all':!![]}];}_0x3da11f=_[_0x228f('0x41')]({},_0x3da11f,_0x561144['options']);return db[_0x228f('0x42')]['find'](_0x3da11f)[_0x228f('0x26')](handleEntityNotFound(_0x3e9f76,null))[_0x228f('0x26')](function(_0x159713){if(_0x159713){var _0x18e97b=_0x159713[_0x228f('0x28')]({'plain':!![]});_0x18e97b=qs[_0x228f('0x55')](_0x18e97b,['id',_0x228f('0x56'),_0x228f('0x57')]);_0x561144['body']=_[_0x228f('0x55')](_0x561144[_0x228f('0x4e')],['id',_0x228f('0x56'),'updatedAt']);return db[_0x228f('0x42')]['create'](_[_0x228f('0x41')](_0x18e97b,_0x561144[_0x228f('0x4e')]),{'include':_0x561144['query'][_0x228f('0x4a')]?[{'all':!![]}]:undefined})[_0x228f('0x26')](function(_0x16318d){var _0xb8200d=_0x561144[_0x228f('0x58')][_0x228f('0x28')]({'plain':!![]});if(!_0xb8200d)throw new Error(_0x228f('0x4f'));if(_0xb8200d[_0x228f('0x50')]===_0x228f('0x58')){var _0x45c9ed=_0x16318d[_0x228f('0x28')]({'plain':!![]});var _0x551133=_0x228f('0x29');return db[_0x228f('0x59')][_0x228f('0x4c')]({'where':{'name':_0x551133,'userProfileId':_0xb8200d[_0x228f('0x51')]},'raw':!![]})[_0x228f('0x26')](function(_0x506191){if(_0x506191&&_0x506191['autoAssociation']===0x0){return db[_0x228f('0x2a')]['create']({'name':_0x45c9ed[_0x228f('0x2d')],'resourceId':_0x45c9ed['id'],'type':_0x506191['name'],'sectionId':_0x506191['id']},{})[_0x228f('0x26')](function(){return _0x16318d;});}else{return _0x16318d;}})[_0x228f('0x47')](function(_0x53a6a5){logger[_0x228f('0x2b')](_0x228f('0x5a'),_0x53a6a5);throw _0x53a6a5;});}return _0x16318d;});}})[_0x228f('0x26')](respondWithResult(_0x3e9f76,0xc9))[_0x228f('0x47')](handleError(_0x3e9f76,null));};exports['update']=function(_0x42dd54,_0x21f860){if(_0x42dd54[_0x228f('0x4e')]['id']){delete _0x42dd54[_0x228f('0x4e')]['id'];}return db[_0x228f('0x42')][_0x228f('0x4c')]({'where':{'id':_0x42dd54[_0x228f('0x54')]['id']}})[_0x228f('0x26')](handleEntityNotFound(_0x21f860,null))['then'](saveUpdates(_0x42dd54[_0x228f('0x4e')],null))[_0x228f('0x26')](respondWithResult(_0x21f860,null))[_0x228f('0x47')](handleError(_0x21f860,null));};exports[_0x228f('0x27')]=function(_0x2844d2,_0x4ebf7a){return db[_0x228f('0x42')]['find']({'where':{'id':_0x2844d2[_0x228f('0x54')]['id']}})[_0x228f('0x26')](handleEntityNotFound(_0x4ebf7a,null))['then'](removeEntity(_0x4ebf7a,null))[_0x228f('0x47')](handleError(_0x4ebf7a,null));};exports[_0x228f('0x5b')]=function(_0x260e70,_0x5eb9ed,_0x3e7b01){var _0x2d5d67={'raw':!![],'where':{}};var _0x3d5769={};var _0x58a73f={'count':0x0,'rows':[]};return db[_0x228f('0x42')]['findOne']({'where':{'id':_0x260e70[_0x228f('0x54')]['id']}})[_0x228f('0x26')](handleEntityNotFound(_0x5eb9ed,null))['then'](function(_0x57e896){if(_0x57e896){_0x3d5769[_0x228f('0x34')]=_[_0x228f('0x49')](db[_0x228f('0x5c')][_0x228f('0x31')]);_0x3d5769[_0x228f('0x35')]=_[_0x228f('0x49')](_0x260e70[_0x228f('0x35')]);_0x3d5769[_0x228f('0x36')]=_['intersection'](_0x3d5769[_0x228f('0x34')],_0x3d5769['query']);_0x2d5d67[_0x228f('0x38')]=_[_0x228f('0x37')](_0x3d5769[_0x228f('0x34')],qs[_0x228f('0x39')](_0x260e70[_0x228f('0x35')][_0x228f('0x39')]));_0x2d5d67[_0x228f('0x38')]=_0x2d5d67['attributes']['length']?_0x2d5d67[_0x228f('0x38')]:_0x3d5769[_0x228f('0x34')];if(!_0x260e70[_0x228f('0x35')][_0x228f('0x3b')](_0x228f('0x3c'))){_0x2d5d67[_0x228f('0x1f')]=qs['limit'](_0x260e70[_0x228f('0x35')][_0x228f('0x1f')]);_0x2d5d67[_0x228f('0x1e')]=qs[_0x228f('0x1e')](_0x260e70[_0x228f('0x35')][_0x228f('0x1e')]);}_0x2d5d67[_0x228f('0x3d')]=qs[_0x228f('0x3e')](_0x260e70[_0x228f('0x35')]['sort']);_0x2d5d67[_0x228f('0x40')]=qs[_0x228f('0x36')](_['pick'](_0x260e70[_0x228f('0x35')],_0x3d5769[_0x228f('0x36')]));_0x2d5d67['where']['CampaignId']=_0x57e896['id'];if(_0x260e70['query'][_0x228f('0x5d')]){_0x2d5d67['where']=_[_0x228f('0x41')](_0x2d5d67['where'],{'$or':_[_0x228f('0x30')](_0x2d5d67[_0x228f('0x38')],function(_0x5c1a7e){var _0x27ffdd={};_0x27ffdd[_0x5c1a7e]={'$like':'%'+_0x260e70[_0x228f('0x35')][_0x228f('0x5d')]+'%'};return _0x27ffdd;})});}_0x2d5d67=_[_0x228f('0x41')]({},_0x2d5d67,_0x260e70[_0x228f('0x4b')]);return db['CmHopper'][_0x228f('0x43')]({'where':_0x2d5d67[_0x228f('0x40')]})[_0x228f('0x26')](function(_0x265b11){_0x58a73f[_0x228f('0x43')]=_0x265b11;if(_0x260e70[_0x228f('0x35')][_0x228f('0x4a')]){_0x2d5d67[_0x228f('0x44')]=[{'all':!![]}];}return db[_0x228f('0x5c')]['findAll'](_0x2d5d67);})[_0x228f('0x26')](function(_0x6be7c4){_0x58a73f[_0x228f('0x46')]=_0x6be7c4;return _0x58a73f;});}})['then'](respondWithFilteredResult(_0x5eb9ed,_0x2d5d67))['catch'](handleError(_0x5eb9ed,null));};exports['getHopperHistories']=function(_0x2b9d40,_0x5e3a6e,_0x2d8e23){var _0x304001={'raw':!![],'where':{}};var _0x4b07c4={};var _0x1e24fd={'count':0x0,'rows':[]};return db[_0x228f('0x42')]['findOne']({'where':{'id':_0x2b9d40[_0x228f('0x54')]['id']}})[_0x228f('0x26')](handleEntityNotFound(_0x5e3a6e,null))[_0x228f('0x26')](function(_0x32ea8d){if(_0x32ea8d){_0x4b07c4['model']=_[_0x228f('0x49')](db[_0x228f('0x5e')][_0x228f('0x31')]);_0x4b07c4[_0x228f('0x35')]=_[_0x228f('0x49')](_0x2b9d40[_0x228f('0x35')]);_0x4b07c4[_0x228f('0x36')]=_[_0x228f('0x37')](_0x4b07c4[_0x228f('0x34')],_0x4b07c4['query']);_0x304001[_0x228f('0x38')]=_[_0x228f('0x37')](_0x4b07c4[_0x228f('0x34')],qs[_0x228f('0x39')](_0x2b9d40[_0x228f('0x35')]['fields']));_0x304001['attributes']=_0x304001[_0x228f('0x38')]['length']?_0x304001[_0x228f('0x38')]:_0x4b07c4['model'];if(!_0x2b9d40[_0x228f('0x35')]['hasOwnProperty'](_0x228f('0x3c'))){_0x304001[_0x228f('0x1f')]=qs[_0x228f('0x1f')](_0x2b9d40[_0x228f('0x35')][_0x228f('0x1f')]);_0x304001[_0x228f('0x1e')]=qs[_0x228f('0x1e')](_0x2b9d40[_0x228f('0x35')][_0x228f('0x1e')]);}_0x304001[_0x228f('0x3d')]=qs[_0x228f('0x3e')](_0x2b9d40[_0x228f('0x35')][_0x228f('0x3e')]);_0x304001[_0x228f('0x40')]=qs[_0x228f('0x36')](_[_0x228f('0x3f')](_0x2b9d40['query'],_0x4b07c4[_0x228f('0x36')]));_0x304001[_0x228f('0x40')][_0x228f('0x5f')]=_0x32ea8d['id'];if(_0x2b9d40['query'][_0x228f('0x5d')]){_0x304001['where']=_['merge'](_0x304001['where'],{'$or':_[_0x228f('0x30')](_0x304001['attributes'],function(_0x22448b){var _0x11dd76={};_0x11dd76[_0x22448b]={'$like':'%'+_0x2b9d40['query'][_0x228f('0x5d')]+'%'};return _0x11dd76;})});}_0x304001=_[_0x228f('0x41')]({},_0x304001,_0x2b9d40['options']);return db[_0x228f('0x5e')][_0x228f('0x43')]({'where':_0x304001['where']})['then'](function(_0x2dfcee){_0x1e24fd[_0x228f('0x43')]=_0x2dfcee;if(_0x2b9d40[_0x228f('0x35')][_0x228f('0x4a')]){_0x304001['include']=[{'all':!![]}];}return db[_0x228f('0x5e')][_0x228f('0x45')](_0x304001);})['then'](function(_0x191bd5){_0x1e24fd[_0x228f('0x46')]=_0x191bd5;return _0x1e24fd;});}})[_0x228f('0x26')](respondWithFilteredResult(_0x5e3a6e,_0x304001))[_0x228f('0x47')](handleError(_0x5e3a6e,null));};exports[_0x228f('0x60')]=function(_0x30157c,_0x2dfaec,_0x25809c){var _0x5a1a8c={'raw':!![],'where':{}};var _0x5a7f73={};var _0x597271={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x30157c['params']['id']}})[_0x228f('0x26')](handleEntityNotFound(_0x2dfaec,null))[_0x228f('0x26')](function(_0x30e525){if(_0x30e525){_0x5a7f73[_0x228f('0x34')]=_[_0x228f('0x49')](db[_0x228f('0x61')][_0x228f('0x31')]);_0x5a7f73['query']=_[_0x228f('0x49')](_0x30157c['query']);_0x5a7f73['filters']=_['intersection'](_0x5a7f73['model'],_0x5a7f73[_0x228f('0x35')]);_0x5a1a8c['attributes']=_[_0x228f('0x37')](_0x5a7f73[_0x228f('0x34')],qs[_0x228f('0x39')](_0x30157c[_0x228f('0x35')]['fields']));_0x5a1a8c[_0x228f('0x38')]=_0x5a1a8c[_0x228f('0x38')][_0x228f('0x3a')]?_0x5a1a8c[_0x228f('0x38')]:_0x5a7f73[_0x228f('0x34')];if(!_0x30157c[_0x228f('0x35')][_0x228f('0x3b')](_0x228f('0x3c'))){_0x5a1a8c[_0x228f('0x1f')]=qs[_0x228f('0x1f')](_0x30157c[_0x228f('0x35')]['limit']);_0x5a1a8c['offset']=qs['offset'](_0x30157c[_0x228f('0x35')][_0x228f('0x1e')]);}_0x5a1a8c[_0x228f('0x3d')]=qs[_0x228f('0x3e')](_0x30157c[_0x228f('0x35')][_0x228f('0x3e')]);_0x5a1a8c[_0x228f('0x40')]=qs[_0x228f('0x36')](_['pick'](_0x30157c[_0x228f('0x35')],_0x5a7f73[_0x228f('0x36')]));_0x5a1a8c[_0x228f('0x40')][_0x228f('0x5f')]=_0x30e525['id'];if(_0x30157c[_0x228f('0x35')][_0x228f('0x5d')]){_0x5a1a8c[_0x228f('0x40')]=_[_0x228f('0x41')](_0x5a1a8c[_0x228f('0x40')],{'$or':_['map'](_0x5a1a8c[_0x228f('0x38')],function(_0xd9a90f){var _0xecea94={};_0xecea94[_0xd9a90f]={'$like':'%'+_0x30157c['query']['filter']+'%'};return _0xecea94;})});}_0x5a1a8c=_[_0x228f('0x41')]({},_0x5a1a8c,_0x30157c['options']);return db[_0x228f('0x61')][_0x228f('0x43')]({'where':_0x5a1a8c[_0x228f('0x40')]})[_0x228f('0x26')](function(_0x590b79){_0x597271[_0x228f('0x43')]=_0x590b79;if(_0x30157c[_0x228f('0x35')][_0x228f('0x4a')]){_0x5a1a8c[_0x228f('0x44')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x5a1a8c);})[_0x228f('0x26')](function(_0x578762){_0x597271[_0x228f('0x46')]=_0x578762;return _0x597271;});}})['then'](respondWithFilteredResult(_0x2dfaec,_0x5a1a8c))['catch'](handleError(_0x2dfaec,null));};exports['getHopperBlacks']=function(_0x2b1172,_0x4865e5,_0x3d20c9){var _0x3067d3={'raw':!![],'where':{}};var _0x21b11f={};var _0x45e5a0={'count':0x0,'rows':[]};return db[_0x228f('0x42')][_0x228f('0x62')]({'where':{'id':_0x2b1172[_0x228f('0x54')]['id']}})[_0x228f('0x26')](handleEntityNotFound(_0x4865e5,null))[_0x228f('0x26')](function(_0x1e8511){if(_0x1e8511){_0x21b11f[_0x228f('0x34')]=_[_0x228f('0x49')](db[_0x228f('0x63')][_0x228f('0x31')]);_0x21b11f[_0x228f('0x35')]=_[_0x228f('0x49')](_0x2b1172[_0x228f('0x35')]);_0x21b11f['filters']=_[_0x228f('0x37')](_0x21b11f[_0x228f('0x34')],_0x21b11f['query']);_0x3067d3[_0x228f('0x38')]=_[_0x228f('0x37')](_0x21b11f[_0x228f('0x34')],qs[_0x228f('0x39')](_0x2b1172['query'][_0x228f('0x39')]));_0x3067d3[_0x228f('0x38')]=_0x3067d3[_0x228f('0x38')][_0x228f('0x3a')]?_0x3067d3[_0x228f('0x38')]:_0x21b11f['model'];if(!_0x2b1172['query'][_0x228f('0x3b')](_0x228f('0x3c'))){_0x3067d3['limit']=qs[_0x228f('0x1f')](_0x2b1172[_0x228f('0x35')][_0x228f('0x1f')]);_0x3067d3['offset']=qs[_0x228f('0x1e')](_0x2b1172[_0x228f('0x35')]['offset']);}_0x3067d3[_0x228f('0x3d')]=qs['sort'](_0x2b1172[_0x228f('0x35')][_0x228f('0x3e')]);_0x3067d3[_0x228f('0x40')]=qs[_0x228f('0x36')](_['pick'](_0x2b1172['query'],_0x21b11f[_0x228f('0x36')]));_0x3067d3['where'][_0x228f('0x5f')]=_0x1e8511['id'];if(_0x2b1172[_0x228f('0x35')][_0x228f('0x5d')]){_0x3067d3[_0x228f('0x40')]=_[_0x228f('0x41')](_0x3067d3['where'],{'$or':_[_0x228f('0x30')](_0x3067d3[_0x228f('0x38')],function(_0x69a9a5){var _0x5e4782={};_0x5e4782[_0x69a9a5]={'$like':'%'+_0x2b1172[_0x228f('0x35')]['filter']+'%'};return _0x5e4782;})});}_0x3067d3=_[_0x228f('0x41')]({},_0x3067d3,_0x2b1172[_0x228f('0x4b')]);return db['CmHopperBlack'][_0x228f('0x43')]({'where':_0x3067d3[_0x228f('0x40')]})[_0x228f('0x26')](function(_0xfbf021){_0x45e5a0['count']=_0xfbf021;if(_0x2b1172[_0x228f('0x35')][_0x228f('0x4a')]){_0x3067d3[_0x228f('0x44')]=[{'all':!![]}];}return db[_0x228f('0x63')][_0x228f('0x45')](_0x3067d3);})[_0x228f('0x26')](function(_0x57b1d6){_0x45e5a0[_0x228f('0x46')]=_0x57b1d6;return _0x45e5a0;});}})[_0x228f('0x26')](respondWithFilteredResult(_0x4865e5,_0x3067d3))[_0x228f('0x47')](handleError(_0x4865e5,null));};exports[_0x228f('0x64')]=function(_0x43e23d,_0x12c7c1,_0x36c9f7){var _0x543a66={};var _0x4b2196={};var _0x17b3ee;var _0x3a7546;return db[_0x228f('0x42')]['findOne']({'where':{'id':_0x43e23d[_0x228f('0x54')]['id']}})[_0x228f('0x26')](handleEntityNotFound(_0x12c7c1,null))[_0x228f('0x26')](function(_0x46eac4){if(_0x46eac4){_0x17b3ee=_0x46eac4;_0x4b2196[_0x228f('0x34')]=_[_0x228f('0x49')](db[_0x228f('0x65')][_0x228f('0x31')]);_0x4b2196['query']=_[_0x228f('0x49')](_0x43e23d['query']);_0x4b2196[_0x228f('0x36')]=_['intersection'](_0x4b2196['model'],_0x4b2196['query']);_0x543a66['attributes']=_['intersection'](_0x4b2196[_0x228f('0x34')],qs[_0x228f('0x39')](_0x43e23d[_0x228f('0x35')][_0x228f('0x39')]));_0x543a66[_0x228f('0x38')]=_0x543a66[_0x228f('0x38')][_0x228f('0x3a')]?_0x543a66[_0x228f('0x38')]:_0x4b2196[_0x228f('0x34')];_0x543a66['order']=qs[_0x228f('0x3e')](_0x43e23d['query'][_0x228f('0x3e')]);_0x543a66['where']=qs['filters'](_[_0x228f('0x3f')](_0x43e23d[_0x228f('0x35')],_0x4b2196[_0x228f('0x36')]));if(_0x43e23d['query'][_0x228f('0x5d')]){_0x543a66['where']=_[_0x228f('0x41')](_0x543a66[_0x228f('0x40')],{'$or':_[_0x228f('0x30')](_0x543a66[_0x228f('0x38')],function(_0x29e0d7){var _0x13731f={};_0x13731f[_0x29e0d7]={'$like':'%'+_0x43e23d[_0x228f('0x35')]['filter']+'%'};return _0x13731f;})});}_0x543a66=_[_0x228f('0x41')]({},_0x543a66,_0x43e23d[_0x228f('0x4b')]);return _0x17b3ee['getLists'](_0x543a66);}})[_0x228f('0x26')](function(_0x7908b){if(_0x7908b){_0x3a7546=_0x7908b[_0x228f('0x3a')];if(!_0x43e23d[_0x228f('0x35')][_0x228f('0x3b')]('nolimit')){_0x543a66['limit']=qs[_0x228f('0x1f')](_0x43e23d[_0x228f('0x35')]['limit']);_0x543a66[_0x228f('0x1e')]=qs['offset'](_0x43e23d[_0x228f('0x35')][_0x228f('0x1e')]);}return _0x17b3ee['getLists'](_0x543a66);}})[_0x228f('0x26')](function(_0x234a90){if(_0x234a90){return _0x234a90?{'count':_0x3a7546,'rows':_0x234a90}:null;}})['then'](respondWithResult(_0x12c7c1,null))[_0x228f('0x47')](handleError(_0x12c7c1,null));};exports[_0x228f('0x66')]=function(_0x5d4958,_0x1d821a,_0x1a144e){var _0x39c19d,_0x140e7e;var _0x1cda20=[];var _0x21b396=moment()[_0x228f('0x67')](_0x228f('0x68'));return db['Campaign'][_0x228f('0x4c')]({'where':{'id':_0x5d4958[_0x228f('0x54')]['id']}})[_0x228f('0x26')](handleEntityNotFound(_0x1d821a,null))['then'](function(_0x4ee418){if(_0x4ee418){_0x140e7e=_0x4ee418;return _0x4ee418[_0x228f('0x66')](_0x5d4958[_0x228f('0x4e')]['ids'],_['omit'](_0x5d4958['body'],['ids','id'])||{});}return null;})[_0x228f('0x69')](function(_0x3d2266){var _0x4fde48;var _0xb37c02;_0x39c19d=_0x3d2266||[];var _0x3733e5=[];if(_0x3d2266){for(var _0x3eff08=0x0;_0x3eff08<_0x3d2266[_0x228f('0x3a')];_0x3eff08+=0x1){var _0x58ac49=_0x3d2266[_0x3eff08][_0x228f('0x28')]({'plain':!![]});_0x140e7e['dialCheckDuplicateType']=_0x5d4958[_0x228f('0x4e')][_0x228f('0x6a')]?_0x5d4958['body'][_0x228f('0x6a')]:_0x140e7e[_0x228f('0x6a')];switch(_0x140e7e[_0x228f('0x6a')]){case _0x228f('0x6b'):_0x4fde48=squel[_0x228f('0x6c')]()[_0x228f('0x6d')](_0x228f('0x6e'))['fromQuery'](['phone',_0x228f('0x6f'),_0x228f('0x70'),_0x228f('0x71'),_0x228f('0x5f'),_0x228f('0x56'),_0x228f('0x57')],squel[_0x228f('0x72')]()[_0x228f('0x73')](_0x228f('0x74'),_0x228f('0x74'))[_0x228f('0x73')](_0x228f('0x75'),'scheduledAt')[_0x228f('0x73')]('id',_0x228f('0x70'))[_0x228f('0x73')](_0x58ac49['CmListId'][_0x228f('0x76')](),_0x228f('0x71'))[_0x228f('0x73')](_0x5d4958[_0x228f('0x54')]['id']['toString'](),_0x228f('0x5f'))[_0x228f('0x73')]('\x27'+_0x21b396+'\x27',_0x228f('0x56'))[_0x228f('0x73')]('\x27'+_0x21b396+'\x27',_0x228f('0x57'))['from'](_0x228f('0x77'))[_0x228f('0x40')](_0x228f('0x78'))[_0x228f('0x40')]('ListId\x20=\x20?',_0x58ac49['CmListId']['toString']())[_0x228f('0x40')](_0x228f('0x79'))[_0x228f('0x40')](_0x228f('0x7a'),squel[_0x228f('0x72')]()['field'](_0x228f('0x7b'))[_0x228f('0x7c')](_0x228f('0x7d'))['where'](_0x228f('0x7e'),_0x5d4958[_0x228f('0x54')]['id'][_0x228f('0x76')]()))['where'](_0x228f('0x7a'),squel[_0x228f('0x72')]()[_0x228f('0x73')]('COALESCE(phone,\x27\x27)')[_0x228f('0x7c')](_0x228f('0x6e'))['where'](_0x228f('0x7e'),_0x5d4958[_0x228f('0x54')]['id'][_0x228f('0x76')]())))[_0x228f('0x76')]();break;case _0x228f('0x7f'):_0x4fde48=squel[_0x228f('0x6c')]()[_0x228f('0x6d')]('cm_hopper')[_0x228f('0x80')]([_0x228f('0x74'),'scheduledAt','ContactId',_0x228f('0x71'),'CampaignId',_0x228f('0x56'),_0x228f('0x57')],squel['select']()[_0x228f('0x73')](_0x228f('0x74'),_0x228f('0x74'))[_0x228f('0x73')](_0x228f('0x75'),_0x228f('0x6f'))[_0x228f('0x73')]('id','ContactId')[_0x228f('0x73')](_0x58ac49[_0x228f('0x81')][_0x228f('0x76')](),_0x228f('0x71'))[_0x228f('0x73')](_0x5d4958[_0x228f('0x54')]['id'][_0x228f('0x76')](),'CampaignId')[_0x228f('0x73')]('\x27'+_0x21b396+'\x27',_0x228f('0x56'))['field']('\x27'+_0x21b396+'\x27','updatedAt')[_0x228f('0x7c')](_0x228f('0x77'))[_0x228f('0x40')](_0x228f('0x78'))[_0x228f('0x40')](_0x228f('0x82'),_0x58ac49['CmListId'][_0x228f('0x76')]())[_0x228f('0x40')](_0x228f('0x79'))[_0x228f('0x40')](_0x228f('0x7a'),squel[_0x228f('0x72')]()[_0x228f('0x73')](_0x228f('0x83'))[_0x228f('0x7c')](_0x228f('0x6e'))[_0x228f('0x40')](_0x228f('0x7e'),_0x5d4958['params']['id'][_0x228f('0x76')]())))[_0x228f('0x76')]();break;default:_0x4fde48=squel[_0x228f('0x6c')]()[_0x228f('0x6d')](_0x228f('0x6e'))['fromQuery']([_0x228f('0x74'),'scheduledAt',_0x228f('0x70'),'ListId',_0x228f('0x5f'),_0x228f('0x56'),_0x228f('0x57')],squel[_0x228f('0x72')]()[_0x228f('0x73')](_0x228f('0x74'),_0x228f('0x74'))[_0x228f('0x73')](_0x228f('0x75'),_0x228f('0x6f'))[_0x228f('0x73')]('id',_0x228f('0x70'))[_0x228f('0x73')](_0x58ac49[_0x228f('0x81')][_0x228f('0x76')](),'ListId')[_0x228f('0x73')](_0x5d4958['params']['id'][_0x228f('0x76')](),_0x228f('0x5f'))[_0x228f('0x73')]('\x27'+_0x21b396+'\x27',_0x228f('0x56'))[_0x228f('0x73')]('\x27'+_0x21b396+'\x27','updatedAt')[_0x228f('0x7c')](_0x228f('0x77'))['where'](_0x228f('0x78'))[_0x228f('0x40')](_0x228f('0x82'),_0x58ac49[_0x228f('0x81')][_0x228f('0x76')]())['where'](_0x228f('0x79')))[_0x228f('0x76')]();}_0xb37c02=squel['insert']()[_0x228f('0x6d')]('cm_hopper_additional_phones')[_0x228f('0x80')](['cmHopperId',_0x228f('0x6f'),_0x228f('0x74'),_0x228f('0x84'),_0x228f('0x56'),_0x228f('0x57')],squel[_0x228f('0x72')]()['field'](_0x228f('0x85'),'id')[_0x228f('0x73')]('NOW()',_0x228f('0x6f'))[_0x228f('0x73')](_0x228f('0x86'),_0x228f('0x74'))['field']('ci.OrderBY','OrderBy')['field']('\x27'+_0x21b396+'\x27',_0x228f('0x56'))[_0x228f('0x73')]('\x27'+_0x21b396+'\x27',_0x228f('0x57'))[_0x228f('0x7c')](_0x228f('0x87'),'ci')['join'](_0x228f('0x6e'),'h',_0x228f('0x88'))[_0x228f('0x40')](_0x228f('0x89'),_0x58ac49[_0x228f('0x81')][_0x228f('0x76')]())[_0x228f('0x40')](_0x228f('0x8a'),_0x5d4958[_0x228f('0x54')]['id'][_0x228f('0x76')]())[_0x228f('0x40')](_0x228f('0x8b'),_0x21b396))[_0x228f('0x76')]();_0x3733e5['push'](db[_0x228f('0x8c')][_0x228f('0x35')](_0x4fde48));_0x1cda20[_0x228f('0x8d')](db[_0x228f('0x8c')]['query'](_0xb37c02));}return BPromise['all'](_0x3733e5);}})[_0x228f('0x26')](function(){return BPromise[_0x228f('0x8e')](_0x1cda20);})[_0x228f('0x26')](function(){return _0x39c19d;})[_0x228f('0x26')](respondWithResult(_0x1d821a,null))[_0x228f('0x47')](handleError(_0x1d821a,null));};exports[_0x228f('0x8f')]=function(_0x3c73ee,_0x57582d,_0x47e033){return db[_0x228f('0x42')]['find']({'where':{'id':_0x3c73ee[_0x228f('0x54')]['id']}})['then'](handleEntityNotFound(_0x57582d,null))['then'](function(_0x28abec){if(_0x28abec){return _0x28abec[_0x228f('0x8f')](_0x3c73ee[_0x228f('0x35')]['ids']);}})[_0x228f('0x26')](function(_0x48d339){if(_0x48d339){return db[_0x228f('0x5c')][_0x228f('0x27')]({'where':{'ListId':_0x3c73ee[_0x228f('0x35')][_0x228f('0x90')],'CampaignId':_0x3c73ee[_0x228f('0x54')]['id']}})['then'](function(){return _0x48d339;});}})[_0x228f('0x26')](respondWithStatusCode(_0x57582d,null))[_0x228f('0x47')](handleError(_0x57582d,null));};exports[_0x228f('0x91')]=function(_0x3267f4,_0x19ff0a,_0x5ea3a4){var _0x293723={};var _0x568259={};var _0x471f8e;var _0x57d2b5;return db[_0x228f('0x42')][_0x228f('0x62')]({'where':{'id':_0x3267f4[_0x228f('0x54')]['id']}})[_0x228f('0x26')](handleEntityNotFound(_0x19ff0a,null))[_0x228f('0x26')](function(_0x51a0e0){if(_0x51a0e0){_0x471f8e=_0x51a0e0;_0x568259[_0x228f('0x34')]=_[_0x228f('0x49')](db[_0x228f('0x65')][_0x228f('0x31')]);_0x568259[_0x228f('0x35')]=_[_0x228f('0x49')](_0x3267f4[_0x228f('0x35')]);_0x568259['filters']=_['intersection'](_0x568259['model'],_0x568259[_0x228f('0x35')]);_0x293723[_0x228f('0x38')]=_[_0x228f('0x37')](_0x568259[_0x228f('0x34')],qs[_0x228f('0x39')](_0x3267f4[_0x228f('0x35')][_0x228f('0x39')]));_0x293723[_0x228f('0x38')]=_0x293723['attributes'][_0x228f('0x3a')]?_0x293723[_0x228f('0x38')]:_0x568259['model'];_0x293723['order']=qs['sort'](_0x3267f4[_0x228f('0x35')][_0x228f('0x3e')]);_0x293723[_0x228f('0x40')]=qs[_0x228f('0x36')](_[_0x228f('0x3f')](_0x3267f4[_0x228f('0x35')],_0x568259['filters']));if(_0x3267f4['query'][_0x228f('0x5d')]){_0x293723[_0x228f('0x40')]=_['merge'](_0x293723[_0x228f('0x40')],{'$or':_[_0x228f('0x30')](_0x293723['attributes'],function(_0x205438){var _0x2eaeec={};_0x2eaeec[_0x205438]={'$like':'%'+_0x3267f4[_0x228f('0x35')][_0x228f('0x5d')]+'%'};return _0x2eaeec;})});}_0x293723=_[_0x228f('0x41')]({},_0x293723,_0x3267f4[_0x228f('0x4b')]);return _0x471f8e[_0x228f('0x91')](_0x293723);}})[_0x228f('0x26')](function(_0xe9476a){if(_0xe9476a){_0x57d2b5=_0xe9476a['length'];if(!_0x3267f4[_0x228f('0x35')][_0x228f('0x3b')]('nolimit')){_0x293723[_0x228f('0x1f')]=qs['limit'](_0x3267f4['query']['limit']);_0x293723[_0x228f('0x1e')]=qs['offset'](_0x3267f4[_0x228f('0x35')][_0x228f('0x1e')]);}return _0x471f8e[_0x228f('0x91')](_0x293723);}})[_0x228f('0x26')](function(_0x2bdcee){if(_0x2bdcee){return _0x2bdcee?{'count':_0x57d2b5,'rows':_0x2bdcee}:null;}})[_0x228f('0x26')](respondWithResult(_0x19ff0a,null))['catch'](handleError(_0x19ff0a,null));};exports[_0x228f('0x92')]=function(_0x5aaa0f,_0x305f7d,_0x43e0b0){var _0x5907b6,_0x1a7398;var _0x3bc62b=[];var _0x6278ff=moment()[_0x228f('0x67')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x228f('0x42')]['find']({'where':{'id':_0x5aaa0f[_0x228f('0x54')]['id']}})[_0x228f('0x26')](handleEntityNotFound(_0x305f7d,null))[_0x228f('0x26')](function(_0x272bc7){if(_0x272bc7){_0x1a7398=_0x272bc7;return _0x272bc7[_0x228f('0x92')](_0x5aaa0f[_0x228f('0x4e')][_0x228f('0x90')],_[_0x228f('0x55')](_0x5aaa0f['body'],[_0x228f('0x90'),'id'])||{});}return null;})[_0x228f('0x69')](function(_0x5cdd98){var _0x5ec163;var _0x435dd6;_0x5907b6=_0x5cdd98||[];var _0x2f6e93=[];if(_0x5cdd98){for(var _0x26dcbe=0x0;_0x26dcbe<_0x5cdd98['length'];_0x26dcbe+=0x1){var _0x318dcf=_0x5cdd98[_0x26dcbe][_0x228f('0x28')]({'plain':!![]});_0x5ec163=squel[_0x228f('0x6c')]()[_0x228f('0x6d')](_0x228f('0x93'))[_0x228f('0x80')]([_0x228f('0x74'),'ContactId',_0x228f('0x71'),'CampaignId',_0x228f('0x56'),_0x228f('0x57')],squel[_0x228f('0x72')]()[_0x228f('0x73')](_0x228f('0x74'),_0x228f('0x74'))[_0x228f('0x73')]('id',_0x228f('0x70'))[_0x228f('0x73')](_0x318dcf[_0x228f('0x81')][_0x228f('0x76')](),_0x228f('0x71'))['field'](_0x5aaa0f[_0x228f('0x54')]['id'][_0x228f('0x76')](),_0x228f('0x5f'))[_0x228f('0x73')]('NOW()',_0x228f('0x56'))[_0x228f('0x73')]('NOW()',_0x228f('0x57'))[_0x228f('0x7c')](_0x228f('0x77'))[_0x228f('0x40')](_0x228f('0x78'))['where'](_0x228f('0x82'),_0x318dcf[_0x228f('0x81')]['toString']())[_0x228f('0x40')](_0x228f('0x79')))[_0x228f('0x76')]();_0x2f6e93[_0x228f('0x8d')](db[_0x228f('0x8c')][_0x228f('0x35')](_0x5ec163));}return BPromise[_0x228f('0x8e')](_0x2f6e93);}})['then'](function(){return _0x5907b6;})['then'](respondWithResult(_0x305f7d,null))[_0x228f('0x47')](handleError(_0x305f7d,null));};exports[_0x228f('0x94')]=function(_0x1cd805,_0x3510ad,_0x44f9ec){return db[_0x228f('0x42')][_0x228f('0x4c')]({'where':{'id':_0x1cd805['params']['id']}})[_0x228f('0x26')](handleEntityNotFound(_0x3510ad,null))[_0x228f('0x26')](function(_0x3e1261){if(_0x3e1261){return _0x3e1261['removeBlackLists'](_0x1cd805['query'][_0x228f('0x90')]);}})[_0x228f('0x26')](function(_0x3a1136){if(_0x3a1136){return db[_0x228f('0x63')][_0x228f('0x27')]({'where':{'ListId':_0x1cd805[_0x228f('0x35')]['ids'],'CampaignId':_0x1cd805[_0x228f('0x54')]['id']}})['then'](function(){return _0x3a1136;});}})['then'](respondWithStatusCode(_0x3510ad,null))[_0x228f('0x47')](handleError(_0x3510ad,null));};
\ No newline at end of file
+var _0x36ee=['merge','VIRTUAL','include','rows','catch','show','params','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','userProfileId','findOne','CmHopper','CampaignId','findAll','CmHopperHistory','hasOwnProperty','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','spread','dialCheckDuplicateType','always','into','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','insert','NOW()','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','ids','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','IvrCampaigns','stack','index','map','Campaign','rawAttributes','fieldName','type','model','name','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0x36ee,0xe8));var _0xe36e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x36ee[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe36e('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe36e('0x1'));var moment=require(_0xe36e('0x2'));var BPromise=require(_0xe36e('0x3'));var Mustache=require(_0xe36e('0x4'));var util=require(_0xe36e('0x5'));var path=require(_0xe36e('0x6'));var sox=require(_0xe36e('0x7'));var csv=require(_0xe36e('0x8'));var ejs=require(_0xe36e('0x9'));var fs=require('fs');var fs_extra=require(_0xe36e('0xa'));var _=require(_0xe36e('0xb'));var squel=require(_0xe36e('0xc'));var crypto=require('crypto');var jsforce=require(_0xe36e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe36e('0x8'));var querystring=require(_0xe36e('0xe'));var Papa=require(_0xe36e('0xf'));var Redis=require('ioredis');var authService=require(_0xe36e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe36e('0x11'));var hardwareService=require(_0xe36e('0x12'));var logger=require(_0xe36e('0x13'))(_0xe36e('0x14'));var utils=require(_0xe36e('0x15'));var config=require(_0xe36e('0x16'));var licenseUtil=require(_0xe36e('0x17'));var db=require(_0xe36e('0x18'))['db'];function respondWithStatusCode(_0x4fbdb2,_0x32981d){_0x32981d=_0x32981d||0xcc;return function(_0x27841e){if(_0x27841e){return _0x4fbdb2[_0xe36e('0x19')](_0x32981d);}return _0x4fbdb2[_0xe36e('0x1a')](_0x32981d)['end']();};}function respondWithResult(_0x3e264a,_0x521afa){_0x521afa=_0x521afa||0xc8;return function(_0x525155){if(_0x525155){return _0x3e264a[_0xe36e('0x1a')](_0x521afa)[_0xe36e('0x1b')](_0x525155);}};}function respondWithFilteredResult(_0x26fb37,_0x278135){return function(_0xd6828e){if(_0xd6828e){var _0x924cd5=typeof _0x278135[_0xe36e('0x1c')]===_0xe36e('0x1d')&&typeof _0x278135[_0xe36e('0x1e')]===_0xe36e('0x1d');var _0x5792e8=_0xd6828e[_0xe36e('0x1f')];var _0x2184ae=_0x924cd5?0x0:_0x278135['offset'];var _0x21d9a3=_0x924cd5?_0xd6828e['count']:_0x278135[_0xe36e('0x1c')]+_0x278135[_0xe36e('0x1e')];var _0x5e15f5;if(_0x21d9a3>=_0x5792e8){_0x21d9a3=_0x5792e8;_0x5e15f5=0xc8;}else{_0x5e15f5=0xce;}_0x26fb37[_0xe36e('0x1a')](_0x5e15f5);return _0x26fb37[_0xe36e('0x20')](_0xe36e('0x21'),_0x2184ae+'-'+_0x21d9a3+'/'+_0x5792e8)['json'](_0xd6828e);}return null;};}function patchUpdates(_0x21e95e){return function(_0x21bcf9){try{jsonpatch[_0xe36e('0x22')](_0x21bcf9,_0x21e95e,!![]);}catch(_0x3c4017){return BPromise[_0xe36e('0x23')](_0x3c4017);}return _0x21bcf9[_0xe36e('0x24')]();};}function saveUpdates(_0x4f438a,_0xd71137){return function(_0x4f214a){if(_0x4f214a){return _0x4f214a[_0xe36e('0x25')](_0x4f438a)[_0xe36e('0x26')](function(_0x437f3f){return _0x437f3f;});}return null;};}function removeEntity(_0x53e13a,_0x598a7a){return function(_0x4749a8){if(_0x4749a8){return _0x4749a8[_0xe36e('0x27')]()[_0xe36e('0x26')](function(){var _0xb32195=_0x4749a8[_0xe36e('0x28')]({'plain':!![]});var _0x1507f9=_0xe36e('0x29');return db['UserProfileResource'][_0xe36e('0x27')]({'where':{'type':_0x1507f9,'resourceId':_0xb32195['id']}})[_0xe36e('0x26')](function(){return _0x4749a8;});})[_0xe36e('0x26')](function(){_0x53e13a[_0xe36e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d757c,_0x5a3133){return function(_0xf7b02e){if(!_0xf7b02e){_0x2d757c['sendStatus'](0x194);}return _0xf7b02e;};}function handleError(_0x19f001,_0x5884cb){_0x5884cb=_0x5884cb||0x1f4;return function(_0x410504){logger['error'](_0x410504[_0xe36e('0x2a')]);if(_0x410504['name']){delete _0x410504['name'];}_0x19f001['status'](_0x5884cb)['send'](_0x410504);};}exports[_0xe36e('0x2b')]=function(_0x1fc639,_0x4cf185){var _0x4ac819={},_0x1fa1ec={},_0xb8d44e={'count':0x0,'rows':[]};var _0x259e19=_[_0xe36e('0x2c')](db[_0xe36e('0x2d')][_0xe36e('0x2e')],function(_0x57bb9b){return{'name':_0x57bb9b[_0xe36e('0x2f')],'type':_0x57bb9b[_0xe36e('0x30')]['key']};});_0x1fa1ec[_0xe36e('0x31')]=_[_0xe36e('0x2c')](_0x259e19,_0xe36e('0x32'));_0x1fa1ec[_0xe36e('0x33')]=_[_0xe36e('0x34')](_0x1fc639[_0xe36e('0x33')]);_0x1fa1ec[_0xe36e('0x35')]=_[_0xe36e('0x36')](_0x1fa1ec[_0xe36e('0x31')],_0x1fa1ec[_0xe36e('0x33')]);_0x4ac819[_0xe36e('0x37')]=_['intersection'](_0x1fa1ec[_0xe36e('0x31')],qs['fields'](_0x1fc639['query'][_0xe36e('0x38')]));_0x4ac819['attributes']=_0x4ac819[_0xe36e('0x37')][_0xe36e('0x39')]?_0x4ac819[_0xe36e('0x37')]:_0x1fa1ec[_0xe36e('0x31')];if(!_0x1fc639['query']['hasOwnProperty'](_0xe36e('0x3a'))){_0x4ac819[_0xe36e('0x1e')]=qs[_0xe36e('0x1e')](_0x1fc639[_0xe36e('0x33')]['limit']);_0x4ac819[_0xe36e('0x1c')]=qs[_0xe36e('0x1c')](_0x1fc639[_0xe36e('0x33')]['offset']);}_0x4ac819[_0xe36e('0x3b')]=qs[_0xe36e('0x3c')](_0x1fc639['query'][_0xe36e('0x3c')]);_0x4ac819[_0xe36e('0x3d')]=qs[_0xe36e('0x35')](_[_0xe36e('0x3e')](_0x1fc639[_0xe36e('0x33')],_0x1fa1ec[_0xe36e('0x35')]),_0x259e19);if(_0x1fc639[_0xe36e('0x33')][_0xe36e('0x3f')]){_0x4ac819[_0xe36e('0x3d')]=_[_0xe36e('0x40')](_0x4ac819[_0xe36e('0x3d')],{'$or':_[_0xe36e('0x2c')](_0x259e19,function(_0x3c4703){if(_0x3c4703['type']!==_0xe36e('0x41')){var _0x134fb2={};_0x134fb2[_0x3c4703[_0xe36e('0x32')]]={'$like':'%'+_0x1fc639[_0xe36e('0x33')][_0xe36e('0x3f')]+'%'};return _0x134fb2;}})});}_0x4ac819=_['merge']({},_0x4ac819,_0x1fc639['options']);var _0x4094c6={'where':_0x4ac819[_0xe36e('0x3d')]};return db[_0xe36e('0x2d')][_0xe36e('0x1f')](_0x4094c6)[_0xe36e('0x26')](function(_0x34a1ba){_0xb8d44e[_0xe36e('0x1f')]=_0x34a1ba;if(_0x1fc639[_0xe36e('0x33')]['includeAll']){_0x4ac819[_0xe36e('0x42')]=[{'all':!![]}];}return db[_0xe36e('0x2d')]['findAll'](_0x4ac819);})[_0xe36e('0x26')](function(_0x5ef3e4){_0xb8d44e[_0xe36e('0x43')]=_0x5ef3e4;return _0xb8d44e;})[_0xe36e('0x26')](respondWithFilteredResult(_0x4cf185,_0x4ac819))[_0xe36e('0x44')](handleError(_0x4cf185,null));};exports[_0xe36e('0x45')]=function(_0x3b1269,_0x4c5e10){var _0x2ffc34={'raw':![],'where':{'id':_0x3b1269[_0xe36e('0x46')]['id']}},_0x2961c9={};_0x2961c9[_0xe36e('0x31')]=_[_0xe36e('0x34')](db[_0xe36e('0x2d')]['rawAttributes']);_0x2961c9[_0xe36e('0x33')]=_[_0xe36e('0x34')](_0x3b1269[_0xe36e('0x33')]);_0x2961c9[_0xe36e('0x35')]=_[_0xe36e('0x36')](_0x2961c9['model'],_0x2961c9[_0xe36e('0x33')]);_0x2ffc34[_0xe36e('0x37')]=_[_0xe36e('0x36')](_0x2961c9[_0xe36e('0x31')],qs[_0xe36e('0x38')](_0x3b1269[_0xe36e('0x33')][_0xe36e('0x38')]));_0x2ffc34[_0xe36e('0x37')]=_0x2ffc34[_0xe36e('0x37')]['length']?_0x2ffc34['attributes']:_0x2961c9[_0xe36e('0x31')];if(_0x3b1269['query'][_0xe36e('0x47')]){_0x2ffc34[_0xe36e('0x42')]=[{'all':!![]}];}_0x2ffc34=_[_0xe36e('0x40')]({},_0x2ffc34,_0x3b1269[_0xe36e('0x48')]);return db['Campaign'][_0xe36e('0x49')](_0x2ffc34)[_0xe36e('0x26')](handleEntityNotFound(_0x4c5e10,null))['then'](respondWithResult(_0x4c5e10,null))[_0xe36e('0x44')](handleError(_0x4c5e10,null));};exports[_0xe36e('0x4a')]=function(_0x2c26e6,_0x42eae5){return db[_0xe36e('0x2d')][_0xe36e('0x4a')](_0x2c26e6[_0xe36e('0x4b')],{})[_0xe36e('0x26')](function(_0x17555e){var _0x3a99aa=_0x2c26e6[_0xe36e('0x4c')][_0xe36e('0x28')]({'plain':!![]});if(!_0x3a99aa)throw new Error(_0xe36e('0x4d'));if(_0x3a99aa[_0xe36e('0x4e')]===_0xe36e('0x4c')){var _0x5678d3=_0x17555e[_0xe36e('0x28')]({'plain':!![]});var _0x55aadf='IvrCampaigns';return db[_0xe36e('0x4f')][_0xe36e('0x49')]({'where':{'name':_0x55aadf,'userProfileId':_0x3a99aa['userProfileId']},'raw':!![]})[_0xe36e('0x26')](function(_0x3814eb){if(_0x3814eb&&_0x3814eb[_0xe36e('0x50')]===0x0){return db[_0xe36e('0x51')][_0xe36e('0x4a')]({'name':_0x5678d3[_0xe36e('0x32')],'resourceId':_0x5678d3['id'],'type':_0x3814eb[_0xe36e('0x32')],'sectionId':_0x3814eb['id']},{})[_0xe36e('0x26')](function(){return _0x17555e;});}else{return _0x17555e;}})[_0xe36e('0x44')](function(_0x55d190){logger[_0xe36e('0x52')](_0xe36e('0x53'),_0x55d190);throw _0x55d190;});}return _0x17555e;})['then'](respondWithResult(_0x42eae5,0xc9))[_0xe36e('0x44')](handleError(_0x42eae5,null));};exports[_0xe36e('0x54')]=function(_0x3e1040,_0x206f75){var _0x3770bd={'where':{'id':_0x3e1040['params']['id']}},_0x53758e={};_0x53758e['model']=_['keys'](db[_0xe36e('0x2d')][_0xe36e('0x2e')]);_0x3770bd[_0xe36e('0x37')]=_[_0xe36e('0x36')](_0x53758e[_0xe36e('0x31')],qs[_0xe36e('0x38')](_0x3e1040[_0xe36e('0x33')][_0xe36e('0x38')]));_0x3770bd[_0xe36e('0x37')]=_0x3770bd['attributes'][_0xe36e('0x39')]?_0x3770bd[_0xe36e('0x37')]:_0x53758e['model'];if(_0x3e1040[_0xe36e('0x33')][_0xe36e('0x47')]){_0x3770bd[_0xe36e('0x42')]=[{'all':!![]}];}_0x3770bd=_[_0xe36e('0x40')]({},_0x3770bd,_0x3e1040[_0xe36e('0x48')]);return db[_0xe36e('0x2d')][_0xe36e('0x49')](_0x3770bd)[_0xe36e('0x26')](handleEntityNotFound(_0x206f75,null))[_0xe36e('0x26')](function(_0x374032){if(_0x374032){var _0x56718a=_0x374032[_0xe36e('0x28')]({'plain':!![]});_0x56718a=qs[_0xe36e('0x55')](_0x56718a,['id',_0xe36e('0x56'),_0xe36e('0x57')]);_0x3e1040[_0xe36e('0x4b')]=_[_0xe36e('0x55')](_0x3e1040[_0xe36e('0x4b')],['id',_0xe36e('0x56'),_0xe36e('0x57')]);return db[_0xe36e('0x2d')][_0xe36e('0x4a')](_[_0xe36e('0x40')](_0x56718a,_0x3e1040[_0xe36e('0x4b')]),{'include':_0x3e1040[_0xe36e('0x33')]['includeAll']?[{'all':!![]}]:undefined})[_0xe36e('0x26')](function(_0xedaa96){var _0x49336b=_0x3e1040[_0xe36e('0x4c')][_0xe36e('0x28')]({'plain':!![]});if(!_0x49336b)throw new Error(_0xe36e('0x4d'));if(_0x49336b[_0xe36e('0x4e')]===_0xe36e('0x4c')){var _0x34a2c3=_0xedaa96['get']({'plain':!![]});var _0x3db651='IvrCampaigns';return db[_0xe36e('0x4f')][_0xe36e('0x49')]({'where':{'name':_0x3db651,'userProfileId':_0x49336b[_0xe36e('0x58')]},'raw':!![]})[_0xe36e('0x26')](function(_0x2a767d){if(_0x2a767d&&_0x2a767d[_0xe36e('0x50')]===0x0){return db[_0xe36e('0x51')][_0xe36e('0x4a')]({'name':_0x34a2c3['name'],'resourceId':_0x34a2c3['id'],'type':_0x2a767d[_0xe36e('0x32')],'sectionId':_0x2a767d['id']},{})[_0xe36e('0x26')](function(){return _0xedaa96;});}else{return _0xedaa96;}})['catch'](function(_0x3068e1){logger[_0xe36e('0x52')](_0xe36e('0x53'),_0x3068e1);throw _0x3068e1;});}return _0xedaa96;});}})[_0xe36e('0x26')](respondWithResult(_0x206f75,0xc9))[_0xe36e('0x44')](handleError(_0x206f75,null));};exports[_0xe36e('0x25')]=function(_0x3d4874,_0x48ff05){if(_0x3d4874[_0xe36e('0x4b')]['id']){delete _0x3d4874[_0xe36e('0x4b')]['id'];}return db[_0xe36e('0x2d')][_0xe36e('0x49')]({'where':{'id':_0x3d4874[_0xe36e('0x46')]['id']}})[_0xe36e('0x26')](handleEntityNotFound(_0x48ff05,null))[_0xe36e('0x26')](saveUpdates(_0x3d4874[_0xe36e('0x4b')],null))[_0xe36e('0x26')](respondWithResult(_0x48ff05,null))[_0xe36e('0x44')](handleError(_0x48ff05,null));};exports[_0xe36e('0x27')]=function(_0x509733,_0x371af5){return db[_0xe36e('0x2d')][_0xe36e('0x49')]({'where':{'id':_0x509733[_0xe36e('0x46')]['id']}})['then'](handleEntityNotFound(_0x371af5,null))['then'](removeEntity(_0x371af5,null))[_0xe36e('0x44')](handleError(_0x371af5,null));};exports['getHoppers']=function(_0x585bd5,_0x59c454,_0xe0a282){var _0x51041b={'raw':!![],'where':{}};var _0x2cbd78={};var _0x2f7093={'count':0x0,'rows':[]};return db[_0xe36e('0x2d')][_0xe36e('0x59')]({'where':{'id':_0x585bd5[_0xe36e('0x46')]['id']}})[_0xe36e('0x26')](handleEntityNotFound(_0x59c454,null))[_0xe36e('0x26')](function(_0x14a9b4){if(_0x14a9b4){_0x2cbd78[_0xe36e('0x31')]=_['keys'](db[_0xe36e('0x5a')]['rawAttributes']);_0x2cbd78[_0xe36e('0x33')]=_['keys'](_0x585bd5[_0xe36e('0x33')]);_0x2cbd78[_0xe36e('0x35')]=_[_0xe36e('0x36')](_0x2cbd78[_0xe36e('0x31')],_0x2cbd78['query']);_0x51041b['attributes']=_[_0xe36e('0x36')](_0x2cbd78[_0xe36e('0x31')],qs[_0xe36e('0x38')](_0x585bd5[_0xe36e('0x33')][_0xe36e('0x38')]));_0x51041b[_0xe36e('0x37')]=_0x51041b['attributes'][_0xe36e('0x39')]?_0x51041b[_0xe36e('0x37')]:_0x2cbd78['model'];if(!_0x585bd5[_0xe36e('0x33')]['hasOwnProperty'](_0xe36e('0x3a'))){_0x51041b[_0xe36e('0x1e')]=qs[_0xe36e('0x1e')](_0x585bd5[_0xe36e('0x33')]['limit']);_0x51041b[_0xe36e('0x1c')]=qs['offset'](_0x585bd5['query'][_0xe36e('0x1c')]);}_0x51041b[_0xe36e('0x3b')]=qs['sort'](_0x585bd5['query'][_0xe36e('0x3c')]);_0x51041b['where']=qs[_0xe36e('0x35')](_[_0xe36e('0x3e')](_0x585bd5[_0xe36e('0x33')],_0x2cbd78[_0xe36e('0x35')]));_0x51041b[_0xe36e('0x3d')][_0xe36e('0x5b')]=_0x14a9b4['id'];if(_0x585bd5['query'][_0xe36e('0x3f')]){_0x51041b[_0xe36e('0x3d')]=_[_0xe36e('0x40')](_0x51041b[_0xe36e('0x3d')],{'$or':_['map'](_0x51041b[_0xe36e('0x37')],function(_0x37409f){var _0x2eef73={};_0x2eef73[_0x37409f]={'$like':'%'+_0x585bd5[_0xe36e('0x33')]['filter']+'%'};return _0x2eef73;})});}_0x51041b=_[_0xe36e('0x40')]({},_0x51041b,_0x585bd5['options']);return db[_0xe36e('0x5a')]['count']({'where':_0x51041b[_0xe36e('0x3d')]})['then'](function(_0x5e67bd){_0x2f7093[_0xe36e('0x1f')]=_0x5e67bd;if(_0x585bd5[_0xe36e('0x33')][_0xe36e('0x47')]){_0x51041b['include']=[{'all':!![]}];}return db[_0xe36e('0x5a')][_0xe36e('0x5c')](_0x51041b);})['then'](function(_0x3beba7){_0x2f7093[_0xe36e('0x43')]=_0x3beba7;return _0x2f7093;});}})[_0xe36e('0x26')](respondWithFilteredResult(_0x59c454,_0x51041b))['catch'](handleError(_0x59c454,null));};exports['getHopperHistories']=function(_0x72fcc,_0x2ba37a,_0x3bd3c2){var _0x327506={'raw':!![],'where':{}};var _0x411305={};var _0x51bc99={'count':0x0,'rows':[]};return db[_0xe36e('0x2d')][_0xe36e('0x59')]({'where':{'id':_0x72fcc[_0xe36e('0x46')]['id']}})[_0xe36e('0x26')](handleEntityNotFound(_0x2ba37a,null))[_0xe36e('0x26')](function(_0x5bdeea){if(_0x5bdeea){_0x411305[_0xe36e('0x31')]=_[_0xe36e('0x34')](db[_0xe36e('0x5d')]['rawAttributes']);_0x411305[_0xe36e('0x33')]=_['keys'](_0x72fcc[_0xe36e('0x33')]);_0x411305['filters']=_[_0xe36e('0x36')](_0x411305[_0xe36e('0x31')],_0x411305['query']);_0x327506[_0xe36e('0x37')]=_['intersection'](_0x411305[_0xe36e('0x31')],qs[_0xe36e('0x38')](_0x72fcc[_0xe36e('0x33')][_0xe36e('0x38')]));_0x327506[_0xe36e('0x37')]=_0x327506['attributes'][_0xe36e('0x39')]?_0x327506['attributes']:_0x411305[_0xe36e('0x31')];if(!_0x72fcc[_0xe36e('0x33')][_0xe36e('0x5e')](_0xe36e('0x3a'))){_0x327506[_0xe36e('0x1e')]=qs[_0xe36e('0x1e')](_0x72fcc['query'][_0xe36e('0x1e')]);_0x327506[_0xe36e('0x1c')]=qs[_0xe36e('0x1c')](_0x72fcc['query'][_0xe36e('0x1c')]);}_0x327506[_0xe36e('0x3b')]=qs[_0xe36e('0x3c')](_0x72fcc[_0xe36e('0x33')]['sort']);_0x327506[_0xe36e('0x3d')]=qs['filters'](_[_0xe36e('0x3e')](_0x72fcc['query'],_0x411305[_0xe36e('0x35')]));_0x327506[_0xe36e('0x3d')][_0xe36e('0x5b')]=_0x5bdeea['id'];if(_0x72fcc['query'][_0xe36e('0x3f')]){_0x327506[_0xe36e('0x3d')]=_['merge'](_0x327506[_0xe36e('0x3d')],{'$or':_[_0xe36e('0x2c')](_0x327506[_0xe36e('0x37')],function(_0x531eac){var _0x4acaa4={};_0x4acaa4[_0x531eac]={'$like':'%'+_0x72fcc[_0xe36e('0x33')][_0xe36e('0x3f')]+'%'};return _0x4acaa4;})});}_0x327506=_[_0xe36e('0x40')]({},_0x327506,_0x72fcc[_0xe36e('0x48')]);return db[_0xe36e('0x5d')]['count']({'where':_0x327506[_0xe36e('0x3d')]})[_0xe36e('0x26')](function(_0x2c923b){_0x51bc99[_0xe36e('0x1f')]=_0x2c923b;if(_0x72fcc['query'][_0xe36e('0x47')]){_0x327506[_0xe36e('0x42')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x327506);})['then'](function(_0x1acffb){_0x51bc99['rows']=_0x1acffb;return _0x51bc99;});}})['then'](respondWithFilteredResult(_0x2ba37a,_0x327506))[_0xe36e('0x44')](handleError(_0x2ba37a,null));};exports[_0xe36e('0x5f')]=function(_0x116f20,_0x266a5f,_0x295495){var _0x378126={'raw':!![],'where':{}};var _0x48fbed={};var _0x2ebe8e={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x116f20[_0xe36e('0x46')]['id']}})[_0xe36e('0x26')](handleEntityNotFound(_0x266a5f,null))[_0xe36e('0x26')](function(_0x14d3a3){if(_0x14d3a3){_0x48fbed['model']=_[_0xe36e('0x34')](db[_0xe36e('0x60')][_0xe36e('0x2e')]);_0x48fbed[_0xe36e('0x33')]=_['keys'](_0x116f20[_0xe36e('0x33')]);_0x48fbed['filters']=_[_0xe36e('0x36')](_0x48fbed[_0xe36e('0x31')],_0x48fbed[_0xe36e('0x33')]);_0x378126[_0xe36e('0x37')]=_[_0xe36e('0x36')](_0x48fbed['model'],qs[_0xe36e('0x38')](_0x116f20[_0xe36e('0x33')][_0xe36e('0x38')]));_0x378126[_0xe36e('0x37')]=_0x378126[_0xe36e('0x37')][_0xe36e('0x39')]?_0x378126[_0xe36e('0x37')]:_0x48fbed[_0xe36e('0x31')];if(!_0x116f20[_0xe36e('0x33')][_0xe36e('0x5e')](_0xe36e('0x3a'))){_0x378126[_0xe36e('0x1e')]=qs[_0xe36e('0x1e')](_0x116f20['query']['limit']);_0x378126['offset']=qs[_0xe36e('0x1c')](_0x116f20[_0xe36e('0x33')][_0xe36e('0x1c')]);}_0x378126[_0xe36e('0x3b')]=qs['sort'](_0x116f20[_0xe36e('0x33')][_0xe36e('0x3c')]);_0x378126[_0xe36e('0x3d')]=qs[_0xe36e('0x35')](_['pick'](_0x116f20[_0xe36e('0x33')],_0x48fbed[_0xe36e('0x35')]));_0x378126[_0xe36e('0x3d')][_0xe36e('0x5b')]=_0x14d3a3['id'];if(_0x116f20['query']['filter']){_0x378126[_0xe36e('0x3d')]=_[_0xe36e('0x40')](_0x378126['where'],{'$or':_['map'](_0x378126['attributes'],function(_0x3f54d3){var _0x3350ca={};_0x3350ca[_0x3f54d3]={'$like':'%'+_0x116f20[_0xe36e('0x33')]['filter']+'%'};return _0x3350ca;})});}_0x378126=_[_0xe36e('0x40')]({},_0x378126,_0x116f20[_0xe36e('0x48')]);return db[_0xe36e('0x60')][_0xe36e('0x1f')]({'where':_0x378126['where']})[_0xe36e('0x26')](function(_0xd25f52){_0x2ebe8e[_0xe36e('0x1f')]=_0xd25f52;if(_0x116f20[_0xe36e('0x33')]['includeAll']){_0x378126[_0xe36e('0x42')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xe36e('0x5c')](_0x378126);})['then'](function(_0x1c95cd){_0x2ebe8e[_0xe36e('0x43')]=_0x1c95cd;return _0x2ebe8e;});}})['then'](respondWithFilteredResult(_0x266a5f,_0x378126))[_0xe36e('0x44')](handleError(_0x266a5f,null));};exports[_0xe36e('0x61')]=function(_0x553509,_0x179b3f,_0x8f94f1){var _0x3bfb4c={'raw':!![],'where':{}};var _0x42944b={};var _0x1db9b3={'count':0x0,'rows':[]};return db[_0xe36e('0x2d')]['findOne']({'where':{'id':_0x553509[_0xe36e('0x46')]['id']}})[_0xe36e('0x26')](handleEntityNotFound(_0x179b3f,null))['then'](function(_0xda5f86){if(_0xda5f86){_0x42944b['model']=_[_0xe36e('0x34')](db[_0xe36e('0x62')][_0xe36e('0x2e')]);_0x42944b[_0xe36e('0x33')]=_['keys'](_0x553509[_0xe36e('0x33')]);_0x42944b[_0xe36e('0x35')]=_[_0xe36e('0x36')](_0x42944b[_0xe36e('0x31')],_0x42944b[_0xe36e('0x33')]);_0x3bfb4c['attributes']=_[_0xe36e('0x36')](_0x42944b[_0xe36e('0x31')],qs['fields'](_0x553509['query'][_0xe36e('0x38')]));_0x3bfb4c['attributes']=_0x3bfb4c[_0xe36e('0x37')][_0xe36e('0x39')]?_0x3bfb4c[_0xe36e('0x37')]:_0x42944b[_0xe36e('0x31')];if(!_0x553509[_0xe36e('0x33')][_0xe36e('0x5e')](_0xe36e('0x3a'))){_0x3bfb4c[_0xe36e('0x1e')]=qs[_0xe36e('0x1e')](_0x553509[_0xe36e('0x33')]['limit']);_0x3bfb4c[_0xe36e('0x1c')]=qs['offset'](_0x553509[_0xe36e('0x33')][_0xe36e('0x1c')]);}_0x3bfb4c[_0xe36e('0x3b')]=qs['sort'](_0x553509[_0xe36e('0x33')][_0xe36e('0x3c')]);_0x3bfb4c['where']=qs[_0xe36e('0x35')](_['pick'](_0x553509[_0xe36e('0x33')],_0x42944b[_0xe36e('0x35')]));_0x3bfb4c[_0xe36e('0x3d')][_0xe36e('0x5b')]=_0xda5f86['id'];if(_0x553509[_0xe36e('0x33')][_0xe36e('0x3f')]){_0x3bfb4c[_0xe36e('0x3d')]=_[_0xe36e('0x40')](_0x3bfb4c[_0xe36e('0x3d')],{'$or':_[_0xe36e('0x2c')](_0x3bfb4c[_0xe36e('0x37')],function(_0x47b082){var _0x5678e6={};_0x5678e6[_0x47b082]={'$like':'%'+_0x553509[_0xe36e('0x33')][_0xe36e('0x3f')]+'%'};return _0x5678e6;})});}_0x3bfb4c=_[_0xe36e('0x40')]({},_0x3bfb4c,_0x553509[_0xe36e('0x48')]);return db['CmHopperBlack'][_0xe36e('0x1f')]({'where':_0x3bfb4c[_0xe36e('0x3d')]})['then'](function(_0x281519){_0x1db9b3['count']=_0x281519;if(_0x553509[_0xe36e('0x33')][_0xe36e('0x47')]){_0x3bfb4c[_0xe36e('0x42')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xe36e('0x5c')](_0x3bfb4c);})[_0xe36e('0x26')](function(_0x2e0e12){_0x1db9b3[_0xe36e('0x43')]=_0x2e0e12;return _0x1db9b3;});}})[_0xe36e('0x26')](respondWithFilteredResult(_0x179b3f,_0x3bfb4c))[_0xe36e('0x44')](handleError(_0x179b3f,null));};exports[_0xe36e('0x63')]=function(_0x4f0396,_0x40595f,_0x2e796e){var _0x2d890a={};var _0x433d03={};var _0x2740cc;var _0x165372;return db[_0xe36e('0x2d')][_0xe36e('0x59')]({'where':{'id':_0x4f0396[_0xe36e('0x46')]['id']}})['then'](handleEntityNotFound(_0x40595f,null))[_0xe36e('0x26')](function(_0x14c6ca){if(_0x14c6ca){_0x2740cc=_0x14c6ca;_0x433d03['model']=_['keys'](db['CmList'][_0xe36e('0x2e')]);_0x433d03[_0xe36e('0x33')]=_['keys'](_0x4f0396[_0xe36e('0x33')]);_0x433d03['filters']=_['intersection'](_0x433d03['model'],_0x433d03[_0xe36e('0x33')]);_0x2d890a[_0xe36e('0x37')]=_['intersection'](_0x433d03[_0xe36e('0x31')],qs[_0xe36e('0x38')](_0x4f0396['query'][_0xe36e('0x38')]));_0x2d890a[_0xe36e('0x37')]=_0x2d890a['attributes'][_0xe36e('0x39')]?_0x2d890a[_0xe36e('0x37')]:_0x433d03['model'];_0x2d890a['order']=qs[_0xe36e('0x3c')](_0x4f0396[_0xe36e('0x33')][_0xe36e('0x3c')]);_0x2d890a[_0xe36e('0x3d')]=qs[_0xe36e('0x35')](_[_0xe36e('0x3e')](_0x4f0396[_0xe36e('0x33')],_0x433d03[_0xe36e('0x35')]));if(_0x4f0396['query'][_0xe36e('0x3f')]){_0x2d890a[_0xe36e('0x3d')]=_[_0xe36e('0x40')](_0x2d890a['where'],{'$or':_[_0xe36e('0x2c')](_0x2d890a[_0xe36e('0x37')],function(_0x45724e){var _0x10f9f1={};_0x10f9f1[_0x45724e]={'$like':'%'+_0x4f0396[_0xe36e('0x33')][_0xe36e('0x3f')]+'%'};return _0x10f9f1;})});}_0x2d890a=_['merge']({},_0x2d890a,_0x4f0396[_0xe36e('0x48')]);return _0x2740cc[_0xe36e('0x63')](_0x2d890a);}})['then'](function(_0x57eedc){if(_0x57eedc){_0x165372=_0x57eedc[_0xe36e('0x39')];if(!_0x4f0396['query'][_0xe36e('0x5e')](_0xe36e('0x3a'))){_0x2d890a['limit']=qs[_0xe36e('0x1e')](_0x4f0396[_0xe36e('0x33')][_0xe36e('0x1e')]);_0x2d890a[_0xe36e('0x1c')]=qs['offset'](_0x4f0396['query'][_0xe36e('0x1c')]);}return _0x2740cc[_0xe36e('0x63')](_0x2d890a);}})[_0xe36e('0x26')](function(_0x630101){if(_0x630101){return _0x630101?{'count':_0x165372,'rows':_0x630101}:null;}})[_0xe36e('0x26')](respondWithResult(_0x40595f,null))[_0xe36e('0x44')](handleError(_0x40595f,null));};exports[_0xe36e('0x64')]=function(_0x50ea2f,_0x4539d9,_0x45fce3){var _0x118335,_0xed2e0a;var _0x92ce16=[];var _0x322fc4=moment()[_0xe36e('0x65')](_0xe36e('0x66'));return db[_0xe36e('0x2d')][_0xe36e('0x49')]({'where':{'id':_0x50ea2f[_0xe36e('0x46')]['id']}})['then'](handleEntityNotFound(_0x4539d9,null))[_0xe36e('0x26')](function(_0x27102b){if(_0x27102b){_0xed2e0a=_0x27102b;return _0x27102b[_0xe36e('0x64')](_0x50ea2f[_0xe36e('0x4b')]['ids'],_['omit'](_0x50ea2f[_0xe36e('0x4b')],['ids','id'])||{});}return null;})[_0xe36e('0x67')](function(_0x57c1d5){var _0xc7ba07;var _0x52de0f;_0x118335=_0x57c1d5||[];var _0xa1f235=[];if(_0x57c1d5){for(var _0x30928a=0x0;_0x30928a<_0x57c1d5[_0xe36e('0x39')];_0x30928a+=0x1){var _0x16abdf=_0x57c1d5[_0x30928a][_0xe36e('0x28')]({'plain':!![]});_0xed2e0a['dialCheckDuplicateType']=_0x50ea2f[_0xe36e('0x4b')][_0xe36e('0x68')]?_0x50ea2f[_0xe36e('0x4b')]['dialCheckDuplicateType']:_0xed2e0a['dialCheckDuplicateType'];switch(_0xed2e0a[_0xe36e('0x68')]){case _0xe36e('0x69'):_0xc7ba07=squel['insert']()[_0xe36e('0x6a')]('cm_hopper')[_0xe36e('0x6b')]([_0xe36e('0x6c'),_0xe36e('0x6d'),_0xe36e('0x6e'),_0xe36e('0x6f'),_0xe36e('0x5b'),_0xe36e('0x56'),_0xe36e('0x57')],squel[_0xe36e('0x70')]()[_0xe36e('0x71')](_0xe36e('0x6c'),_0xe36e('0x6c'))[_0xe36e('0x71')]('NOW()',_0xe36e('0x6d'))['field']('id',_0xe36e('0x6e'))[_0xe36e('0x71')](_0x16abdf[_0xe36e('0x72')][_0xe36e('0x73')](),_0xe36e('0x6f'))['field'](_0x50ea2f[_0xe36e('0x46')]['id'][_0xe36e('0x73')](),_0xe36e('0x5b'))[_0xe36e('0x71')]('\x27'+_0x322fc4+'\x27',_0xe36e('0x56'))[_0xe36e('0x71')]('\x27'+_0x322fc4+'\x27',_0xe36e('0x57'))[_0xe36e('0x74')](_0xe36e('0x75'))[_0xe36e('0x3d')](_0xe36e('0x76'))[_0xe36e('0x3d')](_0xe36e('0x77'),_0x16abdf[_0xe36e('0x72')]['toString']())[_0xe36e('0x3d')](_0xe36e('0x78'))['where'](_0xe36e('0x79'),squel['select']()[_0xe36e('0x71')]('COALESCE(calleridnum,\x27\x27)')[_0xe36e('0x74')](_0xe36e('0x7a'))[_0xe36e('0x3d')](_0xe36e('0x7b'),_0x50ea2f['params']['id'][_0xe36e('0x73')]()))[_0xe36e('0x3d')](_0xe36e('0x79'),squel[_0xe36e('0x70')]()[_0xe36e('0x71')](_0xe36e('0x7c'))['from'](_0xe36e('0x7d'))[_0xe36e('0x3d')](_0xe36e('0x7b'),_0x50ea2f['params']['id']['toString']())))[_0xe36e('0x73')]();break;case'onlyIfOpen':_0xc7ba07=squel[_0xe36e('0x7e')]()['into'](_0xe36e('0x7d'))['fromQuery']([_0xe36e('0x6c'),_0xe36e('0x6d'),_0xe36e('0x6e'),_0xe36e('0x6f'),_0xe36e('0x5b'),_0xe36e('0x56'),'updatedAt'],squel['select']()[_0xe36e('0x71')](_0xe36e('0x6c'),_0xe36e('0x6c'))['field'](_0xe36e('0x7f'),_0xe36e('0x6d'))[_0xe36e('0x71')]('id',_0xe36e('0x6e'))[_0xe36e('0x71')](_0x16abdf[_0xe36e('0x72')][_0xe36e('0x73')](),'ListId')[_0xe36e('0x71')](_0x50ea2f[_0xe36e('0x46')]['id'][_0xe36e('0x73')](),'CampaignId')[_0xe36e('0x71')]('\x27'+_0x322fc4+'\x27',_0xe36e('0x56'))['field']('\x27'+_0x322fc4+'\x27',_0xe36e('0x57'))['from']('cm_contacts')[_0xe36e('0x3d')]('deletedAt\x20IS\x20NULL')[_0xe36e('0x3d')](_0xe36e('0x77'),_0x16abdf[_0xe36e('0x72')]['toString']())[_0xe36e('0x3d')](_0xe36e('0x78'))[_0xe36e('0x3d')](_0xe36e('0x79'),squel[_0xe36e('0x70')]()[_0xe36e('0x71')](_0xe36e('0x7c'))[_0xe36e('0x74')](_0xe36e('0x7d'))[_0xe36e('0x3d')](_0xe36e('0x7b'),_0x50ea2f[_0xe36e('0x46')]['id']['toString']())))[_0xe36e('0x73')]();break;default:_0xc7ba07=squel[_0xe36e('0x7e')]()['into'](_0xe36e('0x7d'))[_0xe36e('0x6b')](['phone',_0xe36e('0x6d'),_0xe36e('0x6e'),'ListId',_0xe36e('0x5b'),_0xe36e('0x56'),_0xe36e('0x57')],squel[_0xe36e('0x70')]()[_0xe36e('0x71')](_0xe36e('0x6c'),_0xe36e('0x6c'))[_0xe36e('0x71')](_0xe36e('0x7f'),_0xe36e('0x6d'))['field']('id',_0xe36e('0x6e'))[_0xe36e('0x71')](_0x16abdf['CmListId'][_0xe36e('0x73')](),'ListId')['field'](_0x50ea2f['params']['id'][_0xe36e('0x73')](),_0xe36e('0x5b'))[_0xe36e('0x71')]('\x27'+_0x322fc4+'\x27',_0xe36e('0x56'))[_0xe36e('0x71')]('\x27'+_0x322fc4+'\x27','updatedAt')[_0xe36e('0x74')](_0xe36e('0x75'))['where']('deletedAt\x20IS\x20NULL')[_0xe36e('0x3d')](_0xe36e('0x77'),_0x16abdf[_0xe36e('0x72')][_0xe36e('0x73')]())['where'](_0xe36e('0x78')))['toString']();}_0x52de0f=squel[_0xe36e('0x7e')]()[_0xe36e('0x6a')](_0xe36e('0x80'))['fromQuery']([_0xe36e('0x81'),'scheduledAt',_0xe36e('0x6c'),_0xe36e('0x82'),_0xe36e('0x56'),_0xe36e('0x57')],squel[_0xe36e('0x70')]()[_0xe36e('0x71')](_0xe36e('0x83'),'id')['field'](_0xe36e('0x7f'),_0xe36e('0x6d'))['field'](_0xe36e('0x84'),'phone')[_0xe36e('0x71')]('ci.OrderBY',_0xe36e('0x82'))['field']('\x27'+_0x322fc4+'\x27','createdAt')['field']('\x27'+_0x322fc4+'\x27',_0xe36e('0x57'))[_0xe36e('0x74')](_0xe36e('0x85'),'ci')[_0xe36e('0x86')](_0xe36e('0x7d'),'h',_0xe36e('0x87'))[_0xe36e('0x3d')](_0xe36e('0x88'),_0x16abdf[_0xe36e('0x72')]['toString']())[_0xe36e('0x3d')](_0xe36e('0x89'),_0x50ea2f[_0xe36e('0x46')]['id'][_0xe36e('0x73')]())[_0xe36e('0x3d')](_0xe36e('0x8a'),_0x322fc4))[_0xe36e('0x73')]();_0xa1f235[_0xe36e('0x8b')](db[_0xe36e('0x8c')][_0xe36e('0x33')](_0xc7ba07));_0x92ce16['push'](db[_0xe36e('0x8c')]['query'](_0x52de0f));}return BPromise[_0xe36e('0x8d')](_0xa1f235);}})[_0xe36e('0x26')](function(){return BPromise[_0xe36e('0x8d')](_0x92ce16);})[_0xe36e('0x26')](function(){return _0x118335;})[_0xe36e('0x26')](respondWithResult(_0x4539d9,null))['catch'](handleError(_0x4539d9,null));};exports[_0xe36e('0x8e')]=function(_0x5583d8,_0x542ae6,_0x2291e7){return db[_0xe36e('0x2d')]['find']({'where':{'id':_0x5583d8[_0xe36e('0x46')]['id']}})['then'](handleEntityNotFound(_0x542ae6,null))['then'](function(_0x12e580){if(_0x12e580){return _0x12e580['removeLists'](_0x5583d8[_0xe36e('0x33')][_0xe36e('0x8f')]);}})['then'](function(_0x9ca5f7){if(_0x9ca5f7){return db[_0xe36e('0x5a')]['destroy']({'where':{'ListId':_0x5583d8[_0xe36e('0x33')][_0xe36e('0x8f')],'CampaignId':_0x5583d8[_0xe36e('0x46')]['id']}})[_0xe36e('0x26')](function(){return _0x9ca5f7;});}})[_0xe36e('0x26')](respondWithStatusCode(_0x542ae6,null))[_0xe36e('0x44')](handleError(_0x542ae6,null));};exports[_0xe36e('0x90')]=function(_0x509b50,_0x2f4a06,_0x1eaedd){var _0x597767={};var _0x4fee40={};var _0x2ae8d7;var _0x28ebc5;return db['Campaign'][_0xe36e('0x59')]({'where':{'id':_0x509b50[_0xe36e('0x46')]['id']}})[_0xe36e('0x26')](handleEntityNotFound(_0x2f4a06,null))[_0xe36e('0x26')](function(_0x90e7a1){if(_0x90e7a1){_0x2ae8d7=_0x90e7a1;_0x4fee40[_0xe36e('0x31')]=_['keys'](db['CmList']['rawAttributes']);_0x4fee40[_0xe36e('0x33')]=_[_0xe36e('0x34')](_0x509b50['query']);_0x4fee40[_0xe36e('0x35')]=_['intersection'](_0x4fee40[_0xe36e('0x31')],_0x4fee40[_0xe36e('0x33')]);_0x597767['attributes']=_[_0xe36e('0x36')](_0x4fee40[_0xe36e('0x31')],qs[_0xe36e('0x38')](_0x509b50[_0xe36e('0x33')]['fields']));_0x597767[_0xe36e('0x37')]=_0x597767[_0xe36e('0x37')][_0xe36e('0x39')]?_0x597767[_0xe36e('0x37')]:_0x4fee40[_0xe36e('0x31')];_0x597767['order']=qs['sort'](_0x509b50[_0xe36e('0x33')]['sort']);_0x597767['where']=qs[_0xe36e('0x35')](_[_0xe36e('0x3e')](_0x509b50[_0xe36e('0x33')],_0x4fee40[_0xe36e('0x35')]));if(_0x509b50[_0xe36e('0x33')][_0xe36e('0x3f')]){_0x597767[_0xe36e('0x3d')]=_[_0xe36e('0x40')](_0x597767[_0xe36e('0x3d')],{'$or':_['map'](_0x597767[_0xe36e('0x37')],function(_0xf5ec44){var _0xef8bcb={};_0xef8bcb[_0xf5ec44]={'$like':'%'+_0x509b50[_0xe36e('0x33')][_0xe36e('0x3f')]+'%'};return _0xef8bcb;})});}_0x597767=_[_0xe36e('0x40')]({},_0x597767,_0x509b50[_0xe36e('0x48')]);return _0x2ae8d7['getBlackLists'](_0x597767);}})[_0xe36e('0x26')](function(_0x3f0fd2){if(_0x3f0fd2){_0x28ebc5=_0x3f0fd2[_0xe36e('0x39')];if(!_0x509b50[_0xe36e('0x33')][_0xe36e('0x5e')](_0xe36e('0x3a'))){_0x597767[_0xe36e('0x1e')]=qs[_0xe36e('0x1e')](_0x509b50[_0xe36e('0x33')][_0xe36e('0x1e')]);_0x597767[_0xe36e('0x1c')]=qs[_0xe36e('0x1c')](_0x509b50[_0xe36e('0x33')][_0xe36e('0x1c')]);}return _0x2ae8d7['getBlackLists'](_0x597767);}})[_0xe36e('0x26')](function(_0x3ccaa5){if(_0x3ccaa5){return _0x3ccaa5?{'count':_0x28ebc5,'rows':_0x3ccaa5}:null;}})[_0xe36e('0x26')](respondWithResult(_0x2f4a06,null))[_0xe36e('0x44')](handleError(_0x2f4a06,null));};exports['addBlackLists']=function(_0x5b2527,_0x3d2c55,_0x4e9fe0){var _0x2607b1,_0x4ceb64;var _0x21ffc7=[];var _0x40f6fc=moment()['format'](_0xe36e('0x66'));return db[_0xe36e('0x2d')][_0xe36e('0x49')]({'where':{'id':_0x5b2527['params']['id']}})[_0xe36e('0x26')](handleEntityNotFound(_0x3d2c55,null))[_0xe36e('0x26')](function(_0x475ffa){if(_0x475ffa){_0x4ceb64=_0x475ffa;return _0x475ffa[_0xe36e('0x91')](_0x5b2527[_0xe36e('0x4b')]['ids'],_[_0xe36e('0x55')](_0x5b2527[_0xe36e('0x4b')],[_0xe36e('0x8f'),'id'])||{});}return null;})[_0xe36e('0x67')](function(_0x2ba462){var _0x4989b9;var _0x3ccdf7;_0x2607b1=_0x2ba462||[];var _0x1d3442=[];if(_0x2ba462){for(var _0x194b71=0x0;_0x194b71<_0x2ba462[_0xe36e('0x39')];_0x194b71+=0x1){var _0x36ce00=_0x2ba462[_0x194b71]['get']({'plain':!![]});_0x4989b9=squel[_0xe36e('0x7e')]()['into'](_0xe36e('0x92'))['fromQuery']([_0xe36e('0x6c'),_0xe36e('0x6e'),_0xe36e('0x6f'),_0xe36e('0x5b'),_0xe36e('0x56'),_0xe36e('0x57')],squel[_0xe36e('0x70')]()[_0xe36e('0x71')](_0xe36e('0x6c'),_0xe36e('0x6c'))[_0xe36e('0x71')]('id',_0xe36e('0x6e'))[_0xe36e('0x71')](_0x36ce00['CmListId']['toString'](),_0xe36e('0x6f'))[_0xe36e('0x71')](_0x5b2527[_0xe36e('0x46')]['id'][_0xe36e('0x73')](),_0xe36e('0x5b'))[_0xe36e('0x71')](_0xe36e('0x7f'),_0xe36e('0x56'))[_0xe36e('0x71')]('NOW()',_0xe36e('0x57'))[_0xe36e('0x74')]('cm_contacts')['where'](_0xe36e('0x76'))[_0xe36e('0x3d')](_0xe36e('0x77'),_0x36ce00[_0xe36e('0x72')]['toString']())[_0xe36e('0x3d')]('phone\x20IS\x20NOT\x20NULL'))[_0xe36e('0x73')]();_0x1d3442[_0xe36e('0x8b')](db[_0xe36e('0x8c')][_0xe36e('0x33')](_0x4989b9));}return BPromise[_0xe36e('0x8d')](_0x1d3442);}})[_0xe36e('0x26')](function(){return _0x2607b1;})[_0xe36e('0x26')](respondWithResult(_0x3d2c55,null))['catch'](handleError(_0x3d2c55,null));};exports[_0xe36e('0x93')]=function(_0x463b04,_0x5aaee2,_0x3c4583){return db[_0xe36e('0x2d')][_0xe36e('0x49')]({'where':{'id':_0x463b04['params']['id']}})[_0xe36e('0x26')](handleEntityNotFound(_0x5aaee2,null))[_0xe36e('0x26')](function(_0x289c6f){if(_0x289c6f){return _0x289c6f['removeBlackLists'](_0x463b04[_0xe36e('0x33')][_0xe36e('0x8f')]);}})['then'](function(_0x212cec){if(_0x212cec){return db['CmHopperBlack'][_0xe36e('0x27')]({'where':{'ListId':_0x463b04[_0xe36e('0x33')]['ids'],'CampaignId':_0x463b04[_0xe36e('0x46')]['id']}})[_0xe36e('0x26')](function(){return _0x212cec;});}})['then'](respondWithStatusCode(_0x5aaee2,null))['catch'](handleError(_0x5aaee2,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 7384866..ee2502e 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(_0x4c2bc5,_0x4984e2){var _0x487209=function(_0x3cabbf){while(--_0x3cabbf){_0x4c2bc5['push'](_0x4c2bc5['shift']());}};_0x487209(++_0x4984e2);}(_0x7a54,0x106));var _0x47a5=function(_0x3cf7c0,_0x4ad985){_0x3cf7c0=_0x3cf7c0-0x0;var _0x15c2df=_0x7a54[_0x3cf7c0];return _0x15c2df;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x514038,_0x450ef3){var _0x589720=function(_0x1a356f){while(--_0x1a356f){_0x514038['push'](_0x514038['shift']());}};_0x589720(++_0x450ef3);}(_0x7a54,0x106));var _0x47a5=function(_0x215f4c,_0x52e5e9){_0x215f4c=_0x215f4c-0x0;var _0x876adf=_0x7a54[_0x215f4c];return _0x876adf;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index cfd89ec..1922fdc 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 _0xb2b3=['error','code','message','findAll','options','raw','where','attributes','limit','include','map','model','then','GetCampaign','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xb2b3,0x71));var _0x3b2b=function(_0x1d91a5,_0x41741c){_0x1d91a5=_0x1d91a5-0x0;var _0x1604e1=_0xb2b3[_0x1d91a5];return _0x1604e1;};'use strict';var _=require(_0x3b2b('0x0'));var util=require(_0x3b2b('0x1'));var moment=require(_0x3b2b('0x2'));var BPromise=require(_0x3b2b('0x3'));var rs=require(_0x3b2b('0x4'));var fs=require('fs');var Redis=require(_0x3b2b('0x5'));var db=require(_0x3b2b('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3b2b('0x7'))(_0x3b2b('0x8'));var config=require(_0x3b2b('0x9'));var jayson=require(_0x3b2b('0xa'));var client=jayson[_0x3b2b('0xb')][_0x3b2b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x83e7ef,_0x24b585,_0x1a9054){return new BPromise(function(_0x3ec416,_0x33b807){return client[_0x3b2b('0xd')](_0x83e7ef,_0x1a9054)['then'](function(_0x430be0){logger[_0x3b2b('0xe')](_0x3b2b('0xf'),_0x24b585,_0x3b2b('0x10'));logger[_0x3b2b('0x11')](_0x3b2b('0x12'),_0x24b585,'request\x20sent',JSON['stringify'](_0x430be0));if(_0x430be0[_0x3b2b('0x13')]){if(_0x430be0[_0x3b2b('0x13')][_0x3b2b('0x14')]===0x1f4){logger[_0x3b2b('0x13')]('Campaign,\x20%s,\x20%s',_0x24b585,_0x430be0[_0x3b2b('0x13')][_0x3b2b('0x15')]);return _0x33b807(_0x430be0[_0x3b2b('0x13')][_0x3b2b('0x15')]);}logger[_0x3b2b('0x13')](_0x3b2b('0xf'),_0x24b585,_0x430be0['error'][_0x3b2b('0x15')]);return _0x3ec416(_0x430be0[_0x3b2b('0x13')]['message']);}else{logger[_0x3b2b('0xe')](_0x3b2b('0xf'),_0x24b585,_0x3b2b('0x10'));_0x3ec416(_0x430be0['result'][_0x3b2b('0x15')]);}})['catch'](function(_0x21743d){logger[_0x3b2b('0x13')]('Campaign,\x20%s,\x20%s',_0x24b585,_0x21743d);_0x33b807(_0x21743d);});});}exports['GetCampaign']=function(_0x1a3bfb){var _0x52bba5=this;return new Promise(function(_0x157155,_0x30e4c2){return db['Campaign'][_0x3b2b('0x16')]({'raw':_0x1a3bfb['options']?_0x1a3bfb[_0x3b2b('0x17')][_0x3b2b('0x18')]===undefined?!![]:![]:!![],'where':_0x1a3bfb['options']?_0x1a3bfb['options'][_0x3b2b('0x19')]||null:null,'attributes':_0x1a3bfb[_0x3b2b('0x17')]?_0x1a3bfb[_0x3b2b('0x17')][_0x3b2b('0x1a')]||null:null,'limit':_0x1a3bfb[_0x3b2b('0x17')]?_0x1a3bfb[_0x3b2b('0x17')][_0x3b2b('0x1b')]||null:null,'include':_0x1a3bfb[_0x3b2b('0x17')]?_0x1a3bfb[_0x3b2b('0x17')][_0x3b2b('0x1c')]?_[_0x3b2b('0x1d')](_0x1a3bfb['options'][_0x3b2b('0x1c')],function(_0x35387c){return{'model':db[_0x35387c[_0x3b2b('0x1e')]],'as':_0x35387c['as'],'attributes':_0x35387c['attributes'],'include':_0x35387c[_0x3b2b('0x1c')]?_['map'](_0x35387c[_0x3b2b('0x1c')],function(_0x50d2e5){return{'model':db[_0x50d2e5[_0x3b2b('0x1e')]],'as':_0x50d2e5['as'],'attributes':_0x50d2e5['attributes'],'include':_0x50d2e5['include']?_[_0x3b2b('0x1d')](_0x50d2e5[_0x3b2b('0x1c')],function(_0x11313d){return{'model':db[_0x11313d[_0x3b2b('0x1e')]],'as':_0x11313d['as'],'attributes':_0x11313d[_0x3b2b('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x3b2b('0x1f')](function(_0x30574a){logger[_0x3b2b('0xe')](_0x3b2b('0x20'),_0x1a3bfb);logger['debug']('GetCampaign',_0x1a3bfb,JSON['stringify'](_0x30574a));_0x157155(_0x30574a);})['catch'](function(_0x3e2177){logger[_0x3b2b('0x13')](_0x3b2b('0x20'),_0x3e2177[_0x3b2b('0x15')],_0x1a3bfb);_0x30e4c2(_0x52bba5[_0x3b2b('0x13')](0x1f4,_0x3e2177[_0x3b2b('0x15')]));});});};
\ No newline at end of file
+var _0x6170=['request\x20sent','error','code','message','result','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','map','model','stringify','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','http','request','then','info','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s'];(function(_0x1aa199,_0x118e10){var _0x11eec1=function(_0x4de2fa){while(--_0x4de2fa){_0x1aa199['push'](_0x1aa199['shift']());}};_0x11eec1(++_0x118e10);}(_0x6170,0x17d));var _0x0617=function(_0x2997a2,_0x4332bc){_0x2997a2=_0x2997a2-0x0;var _0x166485=_0x6170[_0x2997a2];return _0x166485;};'use strict';var _=require(_0x0617('0x0'));var util=require(_0x0617('0x1'));var moment=require(_0x0617('0x2'));var BPromise=require(_0x0617('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0617('0x4'));var db=require(_0x0617('0x5'))['db'];var utils=require(_0x0617('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x0617('0x7'));var client=jayson['client'][_0x0617('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xff6363,_0x1f0aaa,_0x3562ee){return new BPromise(function(_0x7b2c3e,_0x11bfe5){return client[_0x0617('0x9')](_0xff6363,_0x3562ee)[_0x0617('0xa')](function(_0x3a98a6){logger[_0x0617('0xb')](_0x0617('0xc'),_0x1f0aaa,'request\x20sent');logger[_0x0617('0xd')](_0x0617('0xe'),_0x1f0aaa,_0x0617('0xf'),JSON['stringify'](_0x3a98a6));if(_0x3a98a6[_0x0617('0x10')]){if(_0x3a98a6[_0x0617('0x10')][_0x0617('0x11')]===0x1f4){logger['error'](_0x0617('0xc'),_0x1f0aaa,_0x3a98a6[_0x0617('0x10')][_0x0617('0x12')]);return _0x11bfe5(_0x3a98a6[_0x0617('0x10')][_0x0617('0x12')]);}logger[_0x0617('0x10')](_0x0617('0xc'),_0x1f0aaa,_0x3a98a6['error'][_0x0617('0x12')]);return _0x7b2c3e(_0x3a98a6['error']['message']);}else{logger[_0x0617('0xb')](_0x0617('0xc'),_0x1f0aaa,_0x0617('0xf'));_0x7b2c3e(_0x3a98a6[_0x0617('0x13')][_0x0617('0x12')]);}})['catch'](function(_0x4b0a56){logger[_0x0617('0x10')](_0x0617('0xc'),_0x1f0aaa,_0x4b0a56);_0x11bfe5(_0x4b0a56);});});}exports[_0x0617('0x14')]=function(_0x3177d3){var _0x20d9b0=this;return new Promise(function(_0x186655,_0x200428){return db[_0x0617('0x15')][_0x0617('0x16')]({'raw':_0x3177d3['options']?_0x3177d3[_0x0617('0x17')][_0x0617('0x18')]===undefined?!![]:![]:!![],'where':_0x3177d3[_0x0617('0x17')]?_0x3177d3['options'][_0x0617('0x19')]||null:null,'attributes':_0x3177d3[_0x0617('0x17')]?_0x3177d3['options'][_0x0617('0x1a')]||null:null,'limit':_0x3177d3[_0x0617('0x17')]?_0x3177d3['options'][_0x0617('0x1b')]||null:null,'include':_0x3177d3[_0x0617('0x17')]?_0x3177d3['options'][_0x0617('0x1c')]?_[_0x0617('0x1d')](_0x3177d3[_0x0617('0x17')][_0x0617('0x1c')],function(_0x5a3ad8){return{'model':db[_0x5a3ad8['model']],'as':_0x5a3ad8['as'],'attributes':_0x5a3ad8[_0x0617('0x1a')],'include':_0x5a3ad8[_0x0617('0x1c')]?_['map'](_0x5a3ad8[_0x0617('0x1c')],function(_0x40df17){return{'model':db[_0x40df17['model']],'as':_0x40df17['as'],'attributes':_0x40df17[_0x0617('0x1a')],'include':_0x40df17['include']?_[_0x0617('0x1d')](_0x40df17[_0x0617('0x1c')],function(_0xaba0f8){return{'model':db[_0xaba0f8[_0x0617('0x1e')]],'as':_0xaba0f8['as'],'attributes':_0xaba0f8[_0x0617('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0617('0xa')](function(_0x32ef28){logger[_0x0617('0xb')](_0x0617('0x14'),_0x3177d3);logger[_0x0617('0xd')]('GetCampaign',_0x3177d3,JSON[_0x0617('0x1f')](_0x32ef28));_0x186655(_0x32ef28);})[_0x0617('0x20')](function(_0x1ff68e){logger[_0x0617('0x10')](_0x0617('0x14'),_0x1ff68e[_0x0617('0x12')],_0x3177d3);_0x200428(_0x20d9b0['error'](0x1f4,_0x1ff68e[_0x0617('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 1bad427..619b467 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 _0x0d8d=['update','delete','destroy','removeLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','create','post','/:id/clone','addLists','addBlackLists','put'];(function(_0xd7acd8,_0xcdd9e6){var _0x4738de=function(_0x102739){while(--_0x102739){_0xd7acd8['push'](_0xd7acd8['shift']());}};_0x4738de(++_0xcdd9e6);}(_0x0d8d,0x1f4));var _0xd0d8=function(_0x51c529,_0x29e1b9){_0x51c529=_0x51c529-0x0;var _0x568d73=_0x0d8d[_0x51c529];return _0x568d73;};'use strict';var multer=require(_0xd0d8('0x0'));var util=require(_0xd0d8('0x1'));var path=require(_0xd0d8('0x2'));var timeout=require(_0xd0d8('0x3'));var express=require(_0xd0d8('0x4'));var router=express[_0xd0d8('0x5')]();var fs_extra=require(_0xd0d8('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xd0d8('0x7'));var config=require(_0xd0d8('0x8'));var controller=require('./campaign.controller');router[_0xd0d8('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xd0d8('0xa'),auth[_0xd0d8('0xb')](),controller[_0xd0d8('0xc')]);router[_0xd0d8('0x9')]('/:id/hoppers',auth[_0xd0d8('0xb')](),controller[_0xd0d8('0xd')]);router[_0xd0d8('0x9')](_0xd0d8('0xe'),auth[_0xd0d8('0xb')](),controller[_0xd0d8('0xf')]);router[_0xd0d8('0x9')]('/:id/hopper_finals',auth[_0xd0d8('0xb')](),controller[_0xd0d8('0x10')]);router[_0xd0d8('0x9')](_0xd0d8('0x11'),auth['isAuthenticated'](),controller[_0xd0d8('0x12')]);router[_0xd0d8('0x9')](_0xd0d8('0x13'),auth[_0xd0d8('0xb')](),controller[_0xd0d8('0x14')]);router['get'](_0xd0d8('0x15'),auth[_0xd0d8('0xb')](),controller['getBlackLists']);router['post']('/',auth[_0xd0d8('0xb')](),controller[_0xd0d8('0x16')]);router[_0xd0d8('0x17')](_0xd0d8('0x18'),auth[_0xd0d8('0xb')](),controller['clone']);router['post']('/:id/lists',auth['isAuthenticated'](),controller[_0xd0d8('0x19')]);router['post']('/:id/blacklists',auth['isAuthenticated'](),controller[_0xd0d8('0x1a')]);router[_0xd0d8('0x1b')]('/:id',auth['isAuthenticated'](),controller[_0xd0d8('0x1c')]);router[_0xd0d8('0x1d')](_0xd0d8('0xa'),auth[_0xd0d8('0xb')](),controller[_0xd0d8('0x1e')]);router[_0xd0d8('0x1d')]('/:id/lists',auth[_0xd0d8('0xb')](),controller[_0xd0d8('0x1f')]);router[_0xd0d8('0x1d')]('/:id/blacklists',auth[_0xd0d8('0xb')](),controller['removeBlackLists']);module[_0xd0d8('0x20')]=router;
\ No newline at end of file
+var _0x3881=['addLists','addBlackLists','put','update','delete','destroy','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','post','create','/:id/clone','clone'];(function(_0x1ce3aa,_0x473545){var _0x66df23=function(_0x16e44c){while(--_0x16e44c){_0x1ce3aa['push'](_0x1ce3aa['shift']());}};_0x66df23(++_0x473545);}(_0x3881,0xe6));var _0x1388=function(_0x306710,_0x12bb27){_0x306710=_0x306710-0x0;var _0x244170=_0x3881[_0x306710];return _0x244170;};'use strict';var multer=require(_0x1388('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1388('0x1'));var router=express[_0x1388('0x2')]();var fs_extra=require(_0x1388('0x3'));var auth=require(_0x1388('0x4'));var interaction=require(_0x1388('0x5'));var config=require(_0x1388('0x6'));var controller=require('./campaign.controller');router[_0x1388('0x7')]('/',auth[_0x1388('0x8')](),controller[_0x1388('0x9')]);router['get'](_0x1388('0xa'),auth[_0x1388('0x8')](),controller[_0x1388('0xb')]);router[_0x1388('0x7')](_0x1388('0xc'),auth[_0x1388('0x8')](),controller[_0x1388('0xd')]);router[_0x1388('0x7')](_0x1388('0xe'),auth[_0x1388('0x8')](),controller[_0x1388('0xf')]);router[_0x1388('0x7')](_0x1388('0x10'),auth[_0x1388('0x8')](),controller['getHopperFinals']);router[_0x1388('0x7')](_0x1388('0x11'),auth['isAuthenticated'](),controller[_0x1388('0x12')]);router[_0x1388('0x7')](_0x1388('0x13'),auth[_0x1388('0x8')](),controller[_0x1388('0x14')]);router[_0x1388('0x7')](_0x1388('0x15'),auth[_0x1388('0x8')](),controller['getBlackLists']);router[_0x1388('0x16')]('/',auth[_0x1388('0x8')](),controller[_0x1388('0x17')]);router[_0x1388('0x16')](_0x1388('0x18'),auth['isAuthenticated'](),controller[_0x1388('0x19')]);router[_0x1388('0x16')]('/:id/lists',auth[_0x1388('0x8')](),controller[_0x1388('0x1a')]);router[_0x1388('0x16')](_0x1388('0x15'),auth[_0x1388('0x8')](),controller[_0x1388('0x1b')]);router[_0x1388('0x1c')]('/:id',auth[_0x1388('0x8')](),controller[_0x1388('0x1d')]);router[_0x1388('0x1e')](_0x1388('0xa'),auth[_0x1388('0x8')](),controller[_0x1388('0x1f')]);router['delete'](_0x1388('0x13'),auth[_0x1388('0x8')](),controller['removeLists']);router[_0x1388('0x1e')](_0x1388('0x15'),auth[_0x1388('0x8')](),controller['removeBlackLists']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index f303716..c60a870 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 _0x08fd=['key','sequelize','exports','STRING','medium','getDataValue'];(function(_0x35351e,_0x47acc1){var _0x3eb15b=function(_0xd674b7){while(--_0xd674b7){_0x35351e['push'](_0x35351e['shift']());}};_0x3eb15b(++_0x47acc1);}(_0x08fd,0x19f));var _0xd08f=function(_0x79b328,_0x269454){_0x79b328=_0x79b328-0x0;var _0x1ac1de=_0x08fd[_0x79b328];return _0x1ac1de;};'use strict';var Sequelize=require(_0xd08f('0x0'));module[_0xd08f('0x1')]={'key':{'type':Sequelize[_0xd08f('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'length':_0xd08f('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xd08f('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xd08f('0x4')](_0xd08f('0x5'));}}};
\ No newline at end of file
+var _0x0415=['key','sequelize','STRING','TEXT','VIRTUAL'];(function(_0x2b5513,_0x3fe5cd){var _0x578fd2=function(_0x7a9106){while(--_0x7a9106){_0x2b5513['push'](_0x2b5513['shift']());}};_0x578fd2(++_0x3fe5cd);}(_0x0415,0x123));var _0x5041=function(_0x137154,_0xa22631){_0x137154=_0x137154-0x0;var _0x36bfbb=_0x0415[_0x137154];return _0x36bfbb;};'use strict';var Sequelize=require(_0x5041('0x0'));module['exports']={'key':{'type':Sequelize[_0x5041('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x5041('0x2')],'length':'medium','allowNull':![]},'description':{'type':Sequelize[_0x5041('0x1')]},'name':{'type':Sequelize[_0x5041('0x3')],'get':function(){return this['getDataValue'](_0x5041('0x4'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index c18f2f8..fc72f1e 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 _0x3a99=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','end','error','stack','send','index','map','rawAttributes','fieldName','type','name','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','where','merge','filter','options','CannedAnswer','includeAll','include','findAll','rows','catch','find','body','params','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','CannedAnswers','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','fs-extra','lodash'];(function(_0x2ca60d,_0x211489){var _0x5e3384=function(_0x532735){while(--_0x532735){_0x2ca60d['push'](_0x2ca60d['shift']());}};_0x5e3384(++_0x211489);}(_0x3a99,0x1a3));var _0x93a9=function(_0x550f2d,_0x42e613){_0x550f2d=_0x550f2d-0x0;var _0x38e658=_0x3a99[_0x550f2d];return _0x38e658;};'use strict';var emlformat=require(_0x93a9('0x0'));var rimraf=require(_0x93a9('0x1'));var zipdir=require(_0x93a9('0x2'));var jsonpatch=require(_0x93a9('0x3'));var rp=require(_0x93a9('0x4'));var moment=require(_0x93a9('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x93a9('0x6'));var sox=require(_0x93a9('0x7'));var csv=require(_0x93a9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x93a9('0x9'));var _=require(_0x93a9('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x93a9('0x8'));var querystring=require('querystring');var Papa=require(_0x93a9('0xb'));var Redis=require(_0x93a9('0xc'));var authService=require(_0x93a9('0xd'));var qs=require(_0x93a9('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x93a9('0xf'));var logger=require(_0x93a9('0x10'))(_0x93a9('0x11'));var utils=require('../../config/utils');var config=require(_0x93a9('0x12'));var licenseUtil=require(_0x93a9('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x81a2d8,_0x9b6fb4){_0x9b6fb4=_0x9b6fb4||0xcc;return function(_0x263d4d){if(_0x263d4d){return _0x81a2d8[_0x93a9('0x14')](_0x9b6fb4);}return _0x81a2d8[_0x93a9('0x15')](_0x9b6fb4)['end']();};}function respondWithResult(_0x42acc6,_0x33db1d){_0x33db1d=_0x33db1d||0xc8;return function(_0xff6b93){if(_0xff6b93){return _0x42acc6[_0x93a9('0x15')](_0x33db1d)[_0x93a9('0x16')](_0xff6b93);}};}function respondWithFilteredResult(_0x1a29e0,_0x3ea2ae){return function(_0x3bbfda){if(_0x3bbfda){var _0x38ad14=typeof _0x3ea2ae[_0x93a9('0x17')]===_0x93a9('0x18')&&typeof _0x3ea2ae[_0x93a9('0x19')]==='undefined';var _0xa0efbc=_0x3bbfda[_0x93a9('0x1a')];var _0x6fa007=_0x38ad14?0x0:_0x3ea2ae[_0x93a9('0x17')];var _0x21e614=_0x38ad14?_0x3bbfda[_0x93a9('0x1a')]:_0x3ea2ae[_0x93a9('0x17')]+_0x3ea2ae[_0x93a9('0x19')];var _0xc5673;if(_0x21e614>=_0xa0efbc){_0x21e614=_0xa0efbc;_0xc5673=0xc8;}else{_0xc5673=0xce;}_0x1a29e0['status'](_0xc5673);return _0x1a29e0[_0x93a9('0x1b')](_0x93a9('0x1c'),_0x6fa007+'-'+_0x21e614+'/'+_0xa0efbc)[_0x93a9('0x16')](_0x3bbfda);}return null;};}function patchUpdates(_0x2919ab){return function(_0x3c2556){try{jsonpatch['apply'](_0x3c2556,_0x2919ab,!![]);}catch(_0x304567){return BPromise[_0x93a9('0x1d')](_0x304567);}return _0x3c2556[_0x93a9('0x1e')]();};}function saveUpdates(_0x18ab87,_0x48e345){return function(_0x582231){if(_0x582231){return _0x582231[_0x93a9('0x1f')](_0x18ab87)[_0x93a9('0x20')](function(_0x1637b2){return _0x1637b2;});}return null;};}function removeEntity(_0x16bbbf,_0x55abc9){return function(_0x3d2b6a){if(_0x3d2b6a){return _0x3d2b6a[_0x93a9('0x21')]()[_0x93a9('0x20')](function(){var _0x27a0ba=_0x3d2b6a[_0x93a9('0x22')]({'plain':!![]});var _0xbdc2c5='CannedAnswers';return db[_0x93a9('0x23')][_0x93a9('0x21')]({'where':{'type':_0xbdc2c5,'resourceId':_0x27a0ba['id']}})[_0x93a9('0x20')](function(){return _0x3d2b6a;});})[_0x93a9('0x20')](function(){_0x16bbbf[_0x93a9('0x15')](0xcc)[_0x93a9('0x24')]();});}};}function handleEntityNotFound(_0x59f513,_0x345d56){return function(_0x99dbf9){if(!_0x99dbf9){_0x59f513['sendStatus'](0x194);}return _0x99dbf9;};}function handleError(_0x53f216,_0x39715f){_0x39715f=_0x39715f||0x1f4;return function(_0x2f1899){logger[_0x93a9('0x25')](_0x2f1899[_0x93a9('0x26')]);if(_0x2f1899['name']){delete _0x2f1899['name'];}_0x53f216[_0x93a9('0x15')](_0x39715f)[_0x93a9('0x27')](_0x2f1899);};}exports[_0x93a9('0x28')]=function(_0x35dd0f,_0x35d2b8){var _0x264ae5={},_0x141dfd={},_0x4b9e70={'count':0x0,'rows':[]};var _0x2e57f3=_[_0x93a9('0x29')](db['CannedAnswer'][_0x93a9('0x2a')],function(_0x131a87){return{'name':_0x131a87[_0x93a9('0x2b')],'type':_0x131a87[_0x93a9('0x2c')]['key']};});_0x141dfd['model']=_['map'](_0x2e57f3,_0x93a9('0x2d'));_0x141dfd[_0x93a9('0x2e')]=_[_0x93a9('0x2f')](_0x35dd0f['query']);_0x141dfd[_0x93a9('0x30')]=_['intersection'](_0x141dfd[_0x93a9('0x31')],_0x141dfd[_0x93a9('0x2e')]);_0x264ae5[_0x93a9('0x32')]=_[_0x93a9('0x33')](_0x141dfd['model'],qs[_0x93a9('0x34')](_0x35dd0f['query'][_0x93a9('0x34')]));_0x264ae5[_0x93a9('0x32')]=_0x264ae5['attributes'][_0x93a9('0x35')]?_0x264ae5[_0x93a9('0x32')]:_0x141dfd[_0x93a9('0x31')];if(!_0x35dd0f[_0x93a9('0x2e')][_0x93a9('0x36')]('nolimit')){_0x264ae5[_0x93a9('0x19')]=qs[_0x93a9('0x19')](_0x35dd0f['query']['limit']);_0x264ae5[_0x93a9('0x17')]=qs[_0x93a9('0x17')](_0x35dd0f['query']['offset']);}_0x264ae5[_0x93a9('0x37')]=qs[_0x93a9('0x38')](_0x35dd0f[_0x93a9('0x2e')][_0x93a9('0x38')]);_0x264ae5['where']=qs['filters'](_[_0x93a9('0x39')](_0x35dd0f[_0x93a9('0x2e')],_0x141dfd[_0x93a9('0x30')]),_0x2e57f3);if(_0x35dd0f[_0x93a9('0x2e')]['filter']){_0x264ae5[_0x93a9('0x3a')]=_[_0x93a9('0x3b')](_0x264ae5['where'],{'$or':[{'key':{'$like':'%'+_0x35dd0f[_0x93a9('0x2e')][_0x93a9('0x3c')]+'%'}},{'value':{'$like':'%'+_0x35dd0f[_0x93a9('0x2e')][_0x93a9('0x3c')]+'%'}}]});}_0x264ae5=_['merge']({},_0x264ae5,_0x35dd0f[_0x93a9('0x3d')]);var _0x46ef20={'where':_0x264ae5[_0x93a9('0x3a')]};return db[_0x93a9('0x3e')][_0x93a9('0x1a')](_0x46ef20)[_0x93a9('0x20')](function(_0x517050){_0x4b9e70[_0x93a9('0x1a')]=_0x517050;if(_0x35dd0f[_0x93a9('0x2e')][_0x93a9('0x3f')]){_0x264ae5[_0x93a9('0x40')]=[{'all':!![]}];}return db[_0x93a9('0x3e')][_0x93a9('0x41')](_0x264ae5);})[_0x93a9('0x20')](function(_0x30892b){_0x4b9e70[_0x93a9('0x42')]=_0x30892b;return _0x4b9e70;})[_0x93a9('0x20')](respondWithFilteredResult(_0x35d2b8,_0x264ae5))[_0x93a9('0x43')](handleError(_0x35d2b8,null));};exports['show']=function(_0x30b7da,_0x502049){var _0x21dba8={'raw':!![],'where':{'id':_0x30b7da['params']['id']}},_0x2b6b42={};_0x2b6b42[_0x93a9('0x31')]=_['keys'](db[_0x93a9('0x3e')]['rawAttributes']);_0x2b6b42[_0x93a9('0x2e')]=_[_0x93a9('0x2f')](_0x30b7da['query']);_0x2b6b42[_0x93a9('0x30')]=_[_0x93a9('0x33')](_0x2b6b42['model'],_0x2b6b42['query']);_0x21dba8[_0x93a9('0x32')]=_[_0x93a9('0x33')](_0x2b6b42[_0x93a9('0x31')],qs[_0x93a9('0x34')](_0x30b7da['query'][_0x93a9('0x34')]));_0x21dba8['attributes']=_0x21dba8['attributes']['length']?_0x21dba8[_0x93a9('0x32')]:_0x2b6b42[_0x93a9('0x31')];if(_0x30b7da[_0x93a9('0x2e')][_0x93a9('0x3f')]){_0x21dba8[_0x93a9('0x40')]=[{'all':!![]}];}_0x21dba8=_[_0x93a9('0x3b')]({},_0x21dba8,_0x30b7da['options']);return db['CannedAnswer'][_0x93a9('0x44')](_0x21dba8)[_0x93a9('0x20')](handleEntityNotFound(_0x502049,null))[_0x93a9('0x20')](respondWithResult(_0x502049,null))[_0x93a9('0x43')](handleError(_0x502049,null));};exports[_0x93a9('0x1f')]=function(_0x5a5b4b,_0x38e989){if(_0x5a5b4b[_0x93a9('0x45')]['id']){delete _0x5a5b4b[_0x93a9('0x45')]['id'];}return db[_0x93a9('0x3e')][_0x93a9('0x44')]({'where':{'id':_0x5a5b4b[_0x93a9('0x46')]['id']}})['then'](handleEntityNotFound(_0x38e989,null))['then'](saveUpdates(_0x5a5b4b['body'],null))[_0x93a9('0x20')](respondWithResult(_0x38e989,null))[_0x93a9('0x43')](handleError(_0x38e989,null));};exports[_0x93a9('0x21')]=function(_0x17ef7c,_0x2a248f){return db[_0x93a9('0x3e')][_0x93a9('0x44')]({'where':{'id':_0x17ef7c[_0x93a9('0x46')]['id']}})[_0x93a9('0x20')](handleEntityNotFound(_0x2a248f,null))[_0x93a9('0x20')](removeEntity(_0x2a248f,null))['catch'](handleError(_0x2a248f,null));};exports[_0x93a9('0x47')]=function(_0xea3460,_0x20cedd){var _0x2abde3={'key':_0xea3460[_0x93a9('0x45')][_0x93a9('0x48')]};if(_0xea3460[_0x93a9('0x45')][_0x93a9('0x49')]){_0x2abde3[_0x93a9('0x49')]=_0xea3460[_0x93a9('0x45')]['MailAccountId'];}else if(_0xea3460[_0x93a9('0x45')][_0x93a9('0x4a')]){_0x2abde3['SmsAccountId']=_0xea3460[_0x93a9('0x45')][_0x93a9('0x4a')];}else if(_0xea3460[_0x93a9('0x45')][_0x93a9('0x4b')]){_0x2abde3[_0x93a9('0x4b')]=_0xea3460[_0x93a9('0x45')][_0x93a9('0x4b')];}else if(_0xea3460['body']['ChatWebsiteId']){_0x2abde3[_0x93a9('0x4c')]=_0xea3460[_0x93a9('0x45')]['ChatWebsiteId'];}return db[_0x93a9('0x3e')][_0x93a9('0x44')]({'where':_0x2abde3})['then'](function(_0x4c1be0){if(_0x4c1be0){throw new db['Sequelize'][(_0x93a9('0x4d'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x93a9('0x3e')][_0x93a9('0x47')](_0xea3460['body']);})['then'](function(_0x52c57d){var _0x2d90d1=_0xea3460[_0x93a9('0x4e')][_0x93a9('0x22')]({'plain':!![]});if(!_0x2d90d1)throw new Error(_0x93a9('0x4f'));if(_0x2d90d1[_0x93a9('0x50')]===_0x93a9('0x4e')){var _0x5d0c64=_0x52c57d[_0x93a9('0x22')]({'plain':!![]});return db[_0x93a9('0x51')][_0x93a9('0x44')]({'where':{'name':_0x93a9('0x52'),'userProfileId':_0x2d90d1[_0x93a9('0x53')]},'raw':!![]})['then'](function(_0x127d38){if(_0x127d38&&_0x127d38[_0x93a9('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x5d0c64[_0x93a9('0x2d')],'resourceId':_0x5d0c64['id'],'type':_0x127d38[_0x93a9('0x2d')],'sectionId':_0x127d38['id']},{})[_0x93a9('0x20')](function(){return _0x52c57d;});}else{return _0x52c57d;}})['catch'](function(_0x3b343b){logger[_0x93a9('0x25')](_0x93a9('0x55'),_0x3b343b);throw _0x3b343b;});}return _0x52c57d;})['then'](respondWithResult(_0x20cedd,0xc9))[_0x93a9('0x43')](handleError(_0x20cedd,null));};
\ No newline at end of file
+var _0xa50a=['attributes','length','nolimit','order','sort','where','filters','pick','merge','filter','includeAll','include','rows','catch','params','options','find','update','body','MailAccountId','SmsAccountId','ChatWebsiteId','Sequelize','ValidationError','create','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','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','save','then','destroy','get','CannedAnswers','name','send','map','CannedAnswer','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields'];(function(_0x3f6b1b,_0x58d3d6){var _0x4a3d2b=function(_0x5648f0){while(--_0x5648f0){_0x3f6b1b['push'](_0x3f6b1b['shift']());}};_0x4a3d2b(++_0x58d3d6);}(_0xa50a,0x17e));var _0xaa50=function(_0x5958d2,_0x550300){_0x5958d2=_0x5958d2-0x0;var _0x2a4809=_0xa50a[_0x5958d2];return _0x2a4809;};'use strict';var emlformat=require(_0xaa50('0x0'));var rimraf=require(_0xaa50('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xaa50('0x2'));var moment=require(_0xaa50('0x3'));var BPromise=require(_0xaa50('0x4'));var Mustache=require(_0xaa50('0x5'));var util=require(_0xaa50('0x6'));var path=require(_0xaa50('0x7'));var sox=require(_0xaa50('0x8'));var csv=require(_0xaa50('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaa50('0xa'));var _=require(_0xaa50('0xb'));var squel=require(_0xaa50('0xc'));var crypto=require(_0xaa50('0xd'));var jsforce=require(_0xaa50('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaa50('0xf'));var Papa=require(_0xaa50('0x10'));var Redis=require(_0xaa50('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xaa50('0x12'));var as=require(_0xaa50('0x13'));var hardwareService=require(_0xaa50('0x14'));var logger=require(_0xaa50('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xaa50('0x16'));var licenseUtil=require(_0xaa50('0x17'));var db=require(_0xaa50('0x18'))['db'];function respondWithStatusCode(_0x2c3188,_0x5c2998){_0x5c2998=_0x5c2998||0xcc;return function(_0x45b50b){if(_0x45b50b){return _0x2c3188[_0xaa50('0x19')](_0x5c2998);}return _0x2c3188[_0xaa50('0x1a')](_0x5c2998)[_0xaa50('0x1b')]();};}function respondWithResult(_0x5df03b,_0x3477f7){_0x3477f7=_0x3477f7||0xc8;return function(_0x488456){if(_0x488456){return _0x5df03b[_0xaa50('0x1a')](_0x3477f7)[_0xaa50('0x1c')](_0x488456);}};}function respondWithFilteredResult(_0x21cd0c,_0x55ba86){return function(_0x427833){if(_0x427833){var _0x53cece=typeof _0x55ba86[_0xaa50('0x1d')]==='undefined'&&typeof _0x55ba86['limit']===_0xaa50('0x1e');var _0x1a1c83=_0x427833[_0xaa50('0x1f')];var _0x208351=_0x53cece?0x0:_0x55ba86[_0xaa50('0x1d')];var _0x3433be=_0x53cece?_0x427833[_0xaa50('0x1f')]:_0x55ba86[_0xaa50('0x1d')]+_0x55ba86[_0xaa50('0x20')];var _0x1ab452;if(_0x3433be>=_0x1a1c83){_0x3433be=_0x1a1c83;_0x1ab452=0xc8;}else{_0x1ab452=0xce;}_0x21cd0c[_0xaa50('0x1a')](_0x1ab452);return _0x21cd0c[_0xaa50('0x21')]('Content-Range',_0x208351+'-'+_0x3433be+'/'+_0x1a1c83)[_0xaa50('0x1c')](_0x427833);}return null;};}function patchUpdates(_0x46b711){return function(_0x57fe6f){try{jsonpatch['apply'](_0x57fe6f,_0x46b711,!![]);}catch(_0x2c1bc4){return BPromise[_0xaa50('0x22')](_0x2c1bc4);}return _0x57fe6f[_0xaa50('0x23')]();};}function saveUpdates(_0x4b1842,_0xed2775){return function(_0x9d0a1a){if(_0x9d0a1a){return _0x9d0a1a['update'](_0x4b1842)[_0xaa50('0x24')](function(_0xb1f14f){return _0xb1f14f;});}return null;};}function removeEntity(_0x3e76b8,_0x5089f2){return function(_0x16f7f6){if(_0x16f7f6){return _0x16f7f6[_0xaa50('0x25')]()['then'](function(){var _0x5b5cdf=_0x16f7f6[_0xaa50('0x26')]({'plain':!![]});var _0x112973=_0xaa50('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x112973,'resourceId':_0x5b5cdf['id']}})[_0xaa50('0x24')](function(){return _0x16f7f6;});})[_0xaa50('0x24')](function(){_0x3e76b8[_0xaa50('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x163fa9,_0x64480c){return function(_0x24fa04){if(!_0x24fa04){_0x163fa9[_0xaa50('0x19')](0x194);}return _0x24fa04;};}function handleError(_0x2c7061,_0x2b844a){_0x2b844a=_0x2b844a||0x1f4;return function(_0x5c32a0){logger['error'](_0x5c32a0['stack']);if(_0x5c32a0[_0xaa50('0x28')]){delete _0x5c32a0[_0xaa50('0x28')];}_0x2c7061[_0xaa50('0x1a')](_0x2b844a)[_0xaa50('0x29')](_0x5c32a0);};}exports['index']=function(_0xb4c2e4,_0x158402){var _0x5197b5={},_0x2d7e32={},_0x5de386={'count':0x0,'rows':[]};var _0x2b9ebb=_[_0xaa50('0x2a')](db[_0xaa50('0x2b')][_0xaa50('0x2c')],function(_0x292f91){return{'name':_0x292f91[_0xaa50('0x2d')],'type':_0x292f91[_0xaa50('0x2e')][_0xaa50('0x2f')]};});_0x2d7e32[_0xaa50('0x30')]=_[_0xaa50('0x2a')](_0x2b9ebb,_0xaa50('0x28'));_0x2d7e32['query']=_[_0xaa50('0x31')](_0xb4c2e4[_0xaa50('0x32')]);_0x2d7e32['filters']=_[_0xaa50('0x33')](_0x2d7e32[_0xaa50('0x30')],_0x2d7e32[_0xaa50('0x32')]);_0x5197b5['attributes']=_['intersection'](_0x2d7e32[_0xaa50('0x30')],qs[_0xaa50('0x34')](_0xb4c2e4[_0xaa50('0x32')][_0xaa50('0x34')]));_0x5197b5[_0xaa50('0x35')]=_0x5197b5[_0xaa50('0x35')][_0xaa50('0x36')]?_0x5197b5['attributes']:_0x2d7e32[_0xaa50('0x30')];if(!_0xb4c2e4[_0xaa50('0x32')]['hasOwnProperty'](_0xaa50('0x37'))){_0x5197b5['limit']=qs[_0xaa50('0x20')](_0xb4c2e4['query'][_0xaa50('0x20')]);_0x5197b5[_0xaa50('0x1d')]=qs[_0xaa50('0x1d')](_0xb4c2e4[_0xaa50('0x32')][_0xaa50('0x1d')]);}_0x5197b5[_0xaa50('0x38')]=qs['sort'](_0xb4c2e4[_0xaa50('0x32')][_0xaa50('0x39')]);_0x5197b5[_0xaa50('0x3a')]=qs[_0xaa50('0x3b')](_[_0xaa50('0x3c')](_0xb4c2e4[_0xaa50('0x32')],_0x2d7e32[_0xaa50('0x3b')]),_0x2b9ebb);if(_0xb4c2e4[_0xaa50('0x32')]['filter']){_0x5197b5[_0xaa50('0x3a')]=_[_0xaa50('0x3d')](_0x5197b5[_0xaa50('0x3a')],{'$or':[{'key':{'$like':'%'+_0xb4c2e4[_0xaa50('0x32')][_0xaa50('0x3e')]+'%'}},{'value':{'$like':'%'+_0xb4c2e4[_0xaa50('0x32')][_0xaa50('0x3e')]+'%'}}]});}_0x5197b5=_[_0xaa50('0x3d')]({},_0x5197b5,_0xb4c2e4['options']);var _0x315cd6={'where':_0x5197b5[_0xaa50('0x3a')]};return db[_0xaa50('0x2b')][_0xaa50('0x1f')](_0x315cd6)[_0xaa50('0x24')](function(_0x337013){_0x5de386[_0xaa50('0x1f')]=_0x337013;if(_0xb4c2e4[_0xaa50('0x32')][_0xaa50('0x3f')]){_0x5197b5[_0xaa50('0x40')]=[{'all':!![]}];}return db[_0xaa50('0x2b')]['findAll'](_0x5197b5);})['then'](function(_0x3666eb){_0x5de386[_0xaa50('0x41')]=_0x3666eb;return _0x5de386;})['then'](respondWithFilteredResult(_0x158402,_0x5197b5))[_0xaa50('0x42')](handleError(_0x158402,null));};exports['show']=function(_0x219b52,_0x255c6e){var _0x35f77f={'raw':!![],'where':{'id':_0x219b52[_0xaa50('0x43')]['id']}},_0xb211a1={};_0xb211a1[_0xaa50('0x30')]=_[_0xaa50('0x31')](db['CannedAnswer'][_0xaa50('0x2c')]);_0xb211a1['query']=_[_0xaa50('0x31')](_0x219b52['query']);_0xb211a1['filters']=_[_0xaa50('0x33')](_0xb211a1[_0xaa50('0x30')],_0xb211a1['query']);_0x35f77f['attributes']=_[_0xaa50('0x33')](_0xb211a1['model'],qs[_0xaa50('0x34')](_0x219b52[_0xaa50('0x32')]['fields']));_0x35f77f[_0xaa50('0x35')]=_0x35f77f[_0xaa50('0x35')][_0xaa50('0x36')]?_0x35f77f[_0xaa50('0x35')]:_0xb211a1['model'];if(_0x219b52[_0xaa50('0x32')][_0xaa50('0x3f')]){_0x35f77f[_0xaa50('0x40')]=[{'all':!![]}];}_0x35f77f=_[_0xaa50('0x3d')]({},_0x35f77f,_0x219b52[_0xaa50('0x44')]);return db[_0xaa50('0x2b')][_0xaa50('0x45')](_0x35f77f)[_0xaa50('0x24')](handleEntityNotFound(_0x255c6e,null))[_0xaa50('0x24')](respondWithResult(_0x255c6e,null))[_0xaa50('0x42')](handleError(_0x255c6e,null));};exports[_0xaa50('0x46')]=function(_0x43ced0,_0x424ca5){if(_0x43ced0[_0xaa50('0x47')]['id']){delete _0x43ced0[_0xaa50('0x47')]['id'];}return db['CannedAnswer']['find']({'where':{'id':_0x43ced0[_0xaa50('0x43')]['id']}})[_0xaa50('0x24')](handleEntityNotFound(_0x424ca5,null))[_0xaa50('0x24')](saveUpdates(_0x43ced0[_0xaa50('0x47')],null))[_0xaa50('0x24')](respondWithResult(_0x424ca5,null))[_0xaa50('0x42')](handleError(_0x424ca5,null));};exports[_0xaa50('0x25')]=function(_0x3197fd,_0x1c6941){return db[_0xaa50('0x2b')][_0xaa50('0x45')]({'where':{'id':_0x3197fd[_0xaa50('0x43')]['id']}})[_0xaa50('0x24')](handleEntityNotFound(_0x1c6941,null))[_0xaa50('0x24')](removeEntity(_0x1c6941,null))[_0xaa50('0x42')](handleError(_0x1c6941,null));};exports['create']=function(_0x1d364d,_0x22654d){var _0x4baadc={'key':_0x1d364d[_0xaa50('0x47')][_0xaa50('0x2f')]};if(_0x1d364d[_0xaa50('0x47')][_0xaa50('0x48')]){_0x4baadc[_0xaa50('0x48')]=_0x1d364d[_0xaa50('0x47')][_0xaa50('0x48')];}else if(_0x1d364d[_0xaa50('0x47')][_0xaa50('0x49')]){_0x4baadc[_0xaa50('0x49')]=_0x1d364d[_0xaa50('0x47')][_0xaa50('0x49')];}else if(_0x1d364d[_0xaa50('0x47')]['OpenchannelAccountId']){_0x4baadc['OpenchannelAccountId']=_0x1d364d[_0xaa50('0x47')]['OpenchannelAccountId'];}else if(_0x1d364d[_0xaa50('0x47')][_0xaa50('0x4a')]){_0x4baadc[_0xaa50('0x4a')]=_0x1d364d[_0xaa50('0x47')]['ChatWebsiteId'];}return db[_0xaa50('0x2b')][_0xaa50('0x45')]({'where':_0x4baadc})[_0xaa50('0x24')](function(_0x5884a4){if(_0x5884a4){throw new db[(_0xaa50('0x4b'))][(_0xaa50('0x4c'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0xaa50('0x2b')][_0xaa50('0x4d')](_0x1d364d[_0xaa50('0x47')]);})[_0xaa50('0x24')](function(_0x52adc7){var _0xf42584=_0x1d364d[_0xaa50('0x4e')][_0xaa50('0x26')]({'plain':!![]});if(!_0xf42584)throw new Error(_0xaa50('0x4f'));if(_0xf42584[_0xaa50('0x50')]===_0xaa50('0x4e')){var _0xfc945d=_0x52adc7[_0xaa50('0x26')]({'plain':!![]});return db[_0xaa50('0x51')]['find']({'where':{'name':_0xaa50('0x27'),'userProfileId':_0xf42584[_0xaa50('0x52')]},'raw':!![]})[_0xaa50('0x24')](function(_0x343de7){if(_0x343de7&&_0x343de7[_0xaa50('0x53')]===0x0){return db[_0xaa50('0x54')][_0xaa50('0x4d')]({'name':_0xfc945d[_0xaa50('0x28')],'resourceId':_0xfc945d['id'],'type':_0x343de7['name'],'sectionId':_0x343de7['id']},{})['then'](function(){return _0x52adc7;});}else{return _0x52adc7;}})[_0xaa50('0x42')](function(_0x11f322){logger[_0xaa50('0x55')](_0xaa50('0x56'),_0x11f322);throw _0x11f322;});}return _0x52adc7;})['then'](respondWithResult(_0x22654d,0xc9))[_0xaa50('0x42')](handleError(_0x22654d,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 4f7fa4f..093ccfa 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 _0x38c3=['request-promise','path','rimraf','../../config/environment','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird'];(function(_0x1977c4,_0x4bdcff){var _0x3a2a22=function(_0x3a6342){while(--_0x3a6342){_0x1977c4['push'](_0x1977c4['shift']());}};_0x3a2a22(++_0x4bdcff);}(_0x38c3,0x1cc));var _0x338c=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x38c3[_0x2070da];return _0x4f9fe1;};'use strict';var _=require(_0x338c('0x0'));var util=require(_0x338c('0x1'));var logger=require(_0x338c('0x2'))(_0x338c('0x3'));var moment=require('moment');var BPromise=require(_0x338c('0x4'));var rp=require(_0x338c('0x5'));var fs=require('fs');var path=require(_0x338c('0x6'));var rimraf=require(_0x338c('0x7'));var config=require(_0x338c('0x8'));var attributes=require('./cannedAnswer.attributes');module[_0x338c('0x9')]=function(_0x14d313,_0xed4adc){return _0x14d313[_0x338c('0xa')](_0x338c('0xb'),attributes,{'tableName':_0x338c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x338c('0xd'),'collate':_0x338c('0xe')});};
\ No newline at end of file
+var _0x0c83=['utf8mb4_unicode_ci','lodash','util','bluebird','request-promise','path','rimraf','./cannedAnswer.attributes','define','CannedAnswer','tools_canned_answers','utf8mb4'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x0c83,0xc1));var _0x30c8=function(_0x5743d7,_0x58e4a4){_0x5743d7=_0x5743d7-0x0;var _0x5e748b=_0x0c83[_0x5743d7];return _0x5e748b;};'use strict';var _=require(_0x30c8('0x0'));var util=require(_0x30c8('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x30c8('0x2'));var rp=require(_0x30c8('0x3'));var fs=require('fs');var path=require(_0x30c8('0x4'));var rimraf=require(_0x30c8('0x5'));var config=require('../../config/environment');var attributes=require(_0x30c8('0x6'));module['exports']=function(_0x4d3530,_0x590352){return _0x4d3530[_0x30c8('0x7')](_0x30c8('0x8'),attributes,{'tableName':_0x30c8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x30c8('0xa'),'collate':_0x30c8('0xb')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index a48c97a..033b669 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(_0x5293a8,_0x1ddfb2){var _0x42b121=function(_0x4502a9){while(--_0x4502a9){_0x5293a8['push'](_0x5293a8['shift']());}};_0x42b121(++_0x1ddfb2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x1ae4cb,_0x5767c3){var _0x278459=function(_0xbf21f7){while(--_0xbf21f7){_0x1ae4cb['push'](_0x1ae4cb['shift']());}};_0x278459(++_0x5767c3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'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 1c83a9e..32a54d0 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 _0x8d90=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','isAuthenticated','get','/:id','show','post','create','put','exports'];(function(_0xf94f9d,_0x55f715){var _0x1dc51c=function(_0x4ca302){while(--_0x4ca302){_0xf94f9d['push'](_0xf94f9d['shift']());}};_0x1dc51c(++_0x55f715);}(_0x8d90,0x66));var _0x08d9=function(_0x5f4963,_0x246a3d){_0x5f4963=_0x5f4963-0x0;var _0x20ac87=_0x8d90[_0x5f4963];return _0x20ac87;};'use strict';var multer=require(_0x08d9('0x0'));var util=require(_0x08d9('0x1'));var path=require(_0x08d9('0x2'));var timeout=require(_0x08d9('0x3'));var express=require('express');var router=express[_0x08d9('0x4')]();var fs_extra=require(_0x08d9('0x5'));var auth=require(_0x08d9('0x6'));var interaction=require(_0x08d9('0x7'));var config=require('../../config/environment');var controller=require(_0x08d9('0x8'));router['get']('/',auth[_0x08d9('0x9')](),controller['index']);router[_0x08d9('0xa')](_0x08d9('0xb'),auth[_0x08d9('0x9')](),controller[_0x08d9('0xc')]);router[_0x08d9('0xd')]('/',auth[_0x08d9('0x9')](),controller[_0x08d9('0xe')]);router[_0x08d9('0xf')](_0x08d9('0xb'),auth[_0x08d9('0x9')](),controller['update']);router['delete'](_0x08d9('0xb'),auth[_0x08d9('0x9')](),controller['destroy']);module[_0x08d9('0x10')]=router;
\ No newline at end of file
+var _0x0833=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','index','show','isAuthenticated','create','/:id','update','multer','util'];(function(_0x581c1d,_0xe71ced){var _0x5d252f=function(_0x46353f){while(--_0x46353f){_0x581c1d['push'](_0x581c1d['shift']());}};_0x5d252f(++_0xe71ced);}(_0x0833,0x11f));var _0x3083=function(_0x149c3d,_0x3dc1f8){_0x149c3d=_0x149c3d-0x0;var _0x4edda4=_0x0833[_0x149c3d];return _0x4edda4;};'use strict';var multer=require(_0x3083('0x0'));var util=require(_0x3083('0x1'));var path=require('path');var timeout=require(_0x3083('0x2'));var express=require(_0x3083('0x3'));var router=express[_0x3083('0x4')]();var fs_extra=require(_0x3083('0x5'));var auth=require(_0x3083('0x6'));var interaction=require(_0x3083('0x7'));var config=require(_0x3083('0x8'));var controller=require(_0x3083('0x9'));router[_0x3083('0xa')]('/',auth['isAuthenticated'](),controller[_0x3083('0xb')]);router[_0x3083('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x3083('0xc')]);router['post']('/',auth[_0x3083('0xd')](),controller[_0x3083('0xe')]);router['put'](_0x3083('0xf'),auth[_0x3083('0xd')](),controller[_0x3083('0x10')]);router['delete'](_0x3083('0xf'),auth[_0x3083('0xd')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 0dad7cd..1d0461a 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 _0x5374=['STRING','INTEGER','exports','DATE'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0x5374,0xd6));var _0x4537=function(_0x212a59,_0x113a9b){_0x212a59=_0x212a59-0x0;var _0x4f871d=_0x5374[_0x212a59];return _0x4f871d;};'use strict';var Sequelize=require('sequelize');module[_0x4537('0x0')]={'calldate':{'type':Sequelize[_0x4537('0x1')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x4537('0x2')]},'src':{'type':Sequelize[_0x4537('0x2')]},'dst':{'type':Sequelize[_0x4537('0x2')]},'dcontext':{'type':Sequelize[_0x4537('0x2')]},'channel':{'type':Sequelize[_0x4537('0x2')]},'dstchannel':{'type':Sequelize[_0x4537('0x2')]},'lastapp':{'type':Sequelize[_0x4537('0x2')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x4537('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x4537('0x2')]},'amaflags':{'type':Sequelize[_0x4537('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x4537('0x2')]},'userfield':{'type':Sequelize[_0x4537('0x2')]},'uniqueid':{'type':Sequelize[_0x4537('0x2')]},'linkedid':{'type':Sequelize[_0x4537('0x2')]},'sequence':{'type':Sequelize[_0x4537('0x2')]},'peeraccount':{'type':Sequelize[_0x4537('0x2')]},'type':{'type':Sequelize[_0x4537('0x2')]},'tag':{'type':Sequelize[_0x4537('0x2')]}};
\ No newline at end of file
+var _0x938c=['STRING','INTEGER','sequelize','exports','1970-01-01\x2000:00:01'];(function(_0x382993,_0x16327e){var _0x928ca4=function(_0x2bdfc9){while(--_0x2bdfc9){_0x382993['push'](_0x382993['shift']());}};_0x928ca4(++_0x16327e);}(_0x938c,0x11f));var _0xc938=function(_0x217383,_0x442609){_0x217383=_0x217383-0x0;var _0x286d60=_0x938c[_0x217383];return _0x286d60;};'use strict';var Sequelize=require(_0xc938('0x0'));module[_0xc938('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xc938('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xc938('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xc938('0x3')]},'dstchannel':{'type':Sequelize[_0xc938('0x3')]},'lastapp':{'type':Sequelize[_0xc938('0x3')]},'lastdata':{'type':Sequelize[_0xc938('0x3')]},'duration':{'type':Sequelize[_0xc938('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xc938('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xc938('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xc938('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xc938('0x3')]},'linkedid':{'type':Sequelize[_0xc938('0x3')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0xc938('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 43aed66..eb1074c 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 _0x826a=['key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','length','includeAll','find','create','body','describe','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','destroy','end','error','stack','name','send','index','Cdr','fieldName','type'];(function(_0xfdf7a4,_0x37da46){var _0x59ec89=function(_0x5a4094){while(--_0x5a4094){_0xfdf7a4['push'](_0xfdf7a4['shift']());}};_0x59ec89(++_0x37da46);}(_0x826a,0x1aa));var _0xa826=function(_0x577c48,_0xda52e1){_0x577c48=_0x577c48-0x0;var _0xe5ccb6=_0x826a[_0x577c48];return _0xe5ccb6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa826('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa826('0x1'));var rp=require('request-promise');var moment=require(_0xa826('0x2'));var BPromise=require(_0xa826('0x3'));var Mustache=require(_0xa826('0x4'));var util=require(_0xa826('0x5'));var path=require('path');var sox=require(_0xa826('0x6'));var csv=require(_0xa826('0x7'));var ejs=require(_0xa826('0x8'));var fs=require('fs');var fs_extra=require(_0xa826('0x9'));var _=require(_0xa826('0xa'));var squel=require(_0xa826('0xb'));var crypto=require(_0xa826('0xc'));var jsforce=require(_0xa826('0xd'));var deskjs=require(_0xa826('0xe'));var toCsv=require(_0xa826('0x7'));var querystring=require(_0xa826('0xf'));var Papa=require(_0xa826('0x10'));var Redis=require(_0xa826('0x11'));var authService=require(_0xa826('0x12'));var qs=require(_0xa826('0x13'));var as=require(_0xa826('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa826('0x15'))('api');var utils=require(_0xa826('0x16'));var config=require(_0xa826('0x17'));var licenseUtil=require(_0xa826('0x18'));var db=require(_0xa826('0x19'))['db'];function respondWithStatusCode(_0x212fac,_0x40838f){_0x40838f=_0x40838f||0xcc;return function(_0x2f1d39){if(_0x2f1d39){return _0x212fac['sendStatus'](_0x40838f);}return _0x212fac[_0xa826('0x1a')](_0x40838f)['end']();};}function respondWithResult(_0x3e99b0,_0x41c0c2){_0x41c0c2=_0x41c0c2||0xc8;return function(_0x5dc0c7){if(_0x5dc0c7){return _0x3e99b0['status'](_0x41c0c2)['json'](_0x5dc0c7);}};}function respondWithFilteredResult(_0x1b6d16,_0x4f25bd){return function(_0x4c546b){if(_0x4c546b){var _0x9a3788=typeof _0x4f25bd[_0xa826('0x1b')]===_0xa826('0x1c')&&typeof _0x4f25bd['limit']===_0xa826('0x1c');var _0x312e14=_0x4c546b[_0xa826('0x1d')];var _0x453c5d=_0x9a3788?0x0:_0x4f25bd[_0xa826('0x1b')];var _0x48930f=_0x9a3788?_0x4c546b[_0xa826('0x1d')]:_0x4f25bd[_0xa826('0x1b')]+_0x4f25bd[_0xa826('0x1e')];var _0x57e96e;if(_0x48930f>=_0x312e14){_0x48930f=_0x312e14;_0x57e96e=0xc8;}else{_0x57e96e=0xce;}_0x1b6d16['status'](_0x57e96e);return _0x1b6d16[_0xa826('0x1f')](_0xa826('0x20'),_0x453c5d+'-'+_0x48930f+'/'+_0x312e14)[_0xa826('0x21')](_0x4c546b);}return null;};}function patchUpdates(_0x8d1650){return function(_0x124564){try{jsonpatch['apply'](_0x124564,_0x8d1650,!![]);}catch(_0x3171ff){return BPromise[_0xa826('0x22')](_0x3171ff);}return _0x124564[_0xa826('0x23')]();};}function saveUpdates(_0x5d410f,_0x5ddeef){return function(_0x361ca5){if(_0x361ca5){return _0x361ca5[_0xa826('0x24')](_0x5d410f)[_0xa826('0x25')](function(_0x4eb4f3){return _0x4eb4f3;});}return null;};}function removeEntity(_0x1d7adf,_0x26ef25){return function(_0x1d4ade){if(_0x1d4ade){return _0x1d4ade[_0xa826('0x26')]()[_0xa826('0x25')](function(){_0x1d7adf['status'](0xcc)[_0xa826('0x27')]();});}};}function handleEntityNotFound(_0x4fa5db,_0x17ef2d){return function(_0x174f16){if(!_0x174f16){_0x4fa5db['sendStatus'](0x194);}return _0x174f16;};}function handleError(_0xfc0448,_0xfa4d94){_0xfa4d94=_0xfa4d94||0x1f4;return function(_0x38c919){logger[_0xa826('0x28')](_0x38c919[_0xa826('0x29')]);if(_0x38c919[_0xa826('0x2a')]){delete _0x38c919[_0xa826('0x2a')];}_0xfc0448[_0xa826('0x1a')](_0xfa4d94)[_0xa826('0x2b')](_0x38c919);};}exports[_0xa826('0x2c')]=function(_0x1e35de,_0x473d8d){var _0x1f2749={},_0x2cb586={},_0x2253c7={'count':0x0,'rows':[]};var _0x27f8f9=_['map'](db[_0xa826('0x2d')]['rawAttributes'],function(_0x2dd810){return{'name':_0x2dd810[_0xa826('0x2e')],'type':_0x2dd810[_0xa826('0x2f')][_0xa826('0x30')]};});_0x2cb586[_0xa826('0x31')]=_['map'](_0x27f8f9,'name');_0x2cb586[_0xa826('0x32')]=_[_0xa826('0x33')](_0x1e35de[_0xa826('0x32')]);_0x2cb586[_0xa826('0x34')]=_['intersection'](_0x2cb586[_0xa826('0x31')],_0x2cb586[_0xa826('0x32')]);_0x1f2749['attributes']=_[_0xa826('0x35')](_0x2cb586['model'],qs[_0xa826('0x36')](_0x1e35de[_0xa826('0x32')][_0xa826('0x36')]));_0x1f2749[_0xa826('0x37')]=_0x1f2749[_0xa826('0x37')]['length']?_0x1f2749[_0xa826('0x37')]:_0x2cb586[_0xa826('0x31')];if(!_0x1e35de[_0xa826('0x32')][_0xa826('0x38')](_0xa826('0x39'))){_0x1f2749[_0xa826('0x1e')]=qs[_0xa826('0x1e')](_0x1e35de[_0xa826('0x32')][_0xa826('0x1e')]);_0x1f2749[_0xa826('0x1b')]=qs[_0xa826('0x1b')](_0x1e35de['query'][_0xa826('0x1b')]);}_0x1f2749['order']=qs[_0xa826('0x3a')](_0x1e35de['query'][_0xa826('0x3a')]);_0x1f2749[_0xa826('0x3b')]=qs[_0xa826('0x34')](_[_0xa826('0x3c')](_0x1e35de[_0xa826('0x32')],_0x2cb586[_0xa826('0x34')]),_0x27f8f9);if(_0x1e35de[_0xa826('0x32')][_0xa826('0x3d')]){_0x1f2749[_0xa826('0x3b')]=_[_0xa826('0x3e')](_0x1f2749[_0xa826('0x3b')],{'$or':_[_0xa826('0x3f')](_0x27f8f9,function(_0x5911d3){if(_0x5911d3[_0xa826('0x2f')]!==_0xa826('0x40')){var _0x251208={};_0x251208[_0x5911d3['name']]={'$like':'%'+_0x1e35de[_0xa826('0x32')][_0xa826('0x3d')]+'%'};return _0x251208;}})});}_0x1f2749=_['merge']({},_0x1f2749,_0x1e35de[_0xa826('0x41')]);var _0x47d9f1={'where':_0x1f2749['where']};return db[_0xa826('0x2d')][_0xa826('0x1d')](_0x47d9f1)[_0xa826('0x25')](function(_0x308d4){_0x2253c7[_0xa826('0x1d')]=_0x308d4;if(_0x1e35de[_0xa826('0x32')]['includeAll']){_0x1f2749[_0xa826('0x42')]=[{'all':!![]}];}return db[_0xa826('0x2d')][_0xa826('0x43')](_0x1f2749);})[_0xa826('0x25')](function(_0x244fd3){_0x2253c7[_0xa826('0x44')]=_0x244fd3;return _0x2253c7;})['then'](respondWithFilteredResult(_0x473d8d,_0x1f2749))[_0xa826('0x45')](handleError(_0x473d8d,null));};exports[_0xa826('0x46')]=function(_0x405ee1,_0x162be1){var _0x258e57={'raw':!![],'where':{'id':_0x405ee1[_0xa826('0x47')]['id']}},_0x53b70e={};_0x53b70e[_0xa826('0x31')]=_[_0xa826('0x33')](db[_0xa826('0x2d')][_0xa826('0x48')]);_0x53b70e[_0xa826('0x32')]=_[_0xa826('0x33')](_0x405ee1[_0xa826('0x32')]);_0x53b70e[_0xa826('0x34')]=_[_0xa826('0x35')](_0x53b70e[_0xa826('0x31')],_0x53b70e[_0xa826('0x32')]);_0x258e57['attributes']=_[_0xa826('0x35')](_0x53b70e[_0xa826('0x31')],qs[_0xa826('0x36')](_0x405ee1['query'][_0xa826('0x36')]));_0x258e57[_0xa826('0x37')]=_0x258e57[_0xa826('0x37')][_0xa826('0x49')]?_0x258e57[_0xa826('0x37')]:_0x53b70e['model'];if(_0x405ee1[_0xa826('0x32')][_0xa826('0x4a')]){_0x258e57[_0xa826('0x42')]=[{'all':!![]}];}_0x258e57=_[_0xa826('0x3e')]({},_0x258e57,_0x405ee1[_0xa826('0x41')]);return db[_0xa826('0x2d')][_0xa826('0x4b')](_0x258e57)['then'](handleEntityNotFound(_0x162be1,null))[_0xa826('0x25')](respondWithResult(_0x162be1,null))['catch'](handleError(_0x162be1,null));};exports['create']=function(_0x4b4352,_0x26a858){return db[_0xa826('0x2d')][_0xa826('0x4c')](_0x4b4352[_0xa826('0x4d')],{})['then'](respondWithResult(_0x26a858,0xc9))[_0xa826('0x45')](handleError(_0x26a858,null));};exports['update']=function(_0x5e0947,_0xedcbc2){if(_0x5e0947[_0xa826('0x4d')]['id']){delete _0x5e0947['body']['id'];}return db[_0xa826('0x2d')][_0xa826('0x4b')]({'where':{'id':_0x5e0947['params']['id']}})['then'](handleEntityNotFound(_0xedcbc2,null))['then'](saveUpdates(_0x5e0947['body'],null))['then'](respondWithResult(_0xedcbc2,null))['catch'](handleError(_0xedcbc2,null));};exports['destroy']=function(_0xb3fae0,_0x5d5269){return db[_0xa826('0x2d')]['find']({'where':{'id':_0xb3fae0[_0xa826('0x47')]['id']}})[_0xa826('0x25')](handleEntityNotFound(_0x5d5269,null))[_0xa826('0x25')](removeEntity(_0x5d5269,null))[_0xa826('0x45')](handleError(_0x5d5269,null));};exports[_0xa826('0x4e')]=function(_0x52cf5e,_0x209704){return db['Cdr']['describe']()[_0xa826('0x25')](respondWithResult(_0x209704,null))[_0xa826('0x45')](handleError(_0x209704,null));};
\ No newline at end of file
+var _0x3937=['reject','save','update','destroy','then','error','stack','name','send','index','Cdr','rawAttributes','fieldName','type','key','model','map','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','merge','where','filter','options','includeAll','include','findAll','rows','catch','params','intersection','find','create','body','describe','eml-format','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply'];(function(_0x5bac13,_0x1c1a2d){var _0x373770=function(_0x43053a){while(--_0x43053a){_0x5bac13['push'](_0x5bac13['shift']());}};_0x373770(++_0x1c1a2d);}(_0x3937,0xbf));var _0x7393=function(_0x16a347,_0x33a0b0){_0x16a347=_0x16a347-0x0;var _0x3ee9bb=_0x3937[_0x16a347];return _0x3ee9bb;};'use strict';var emlformat=require(_0x7393('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7393('0x1'));var jsonpatch=require(_0x7393('0x2'));var rp=require('request-promise');var moment=require(_0x7393('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7393('0x4'));var util=require('util');var path=require(_0x7393('0x5'));var sox=require(_0x7393('0x6'));var csv=require(_0x7393('0x7'));var ejs=require(_0x7393('0x8'));var fs=require('fs');var fs_extra=require(_0x7393('0x9'));var _=require(_0x7393('0xa'));var squel=require(_0x7393('0xb'));var crypto=require(_0x7393('0xc'));var jsforce=require(_0x7393('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7393('0xe'));var Papa=require(_0x7393('0xf'));var Redis=require(_0x7393('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7393('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x7393('0x12'));var config=require(_0x7393('0x13'));var licenseUtil=require(_0x7393('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x79fc4e,_0x470f09){_0x470f09=_0x470f09||0xcc;return function(_0x20fb41){if(_0x20fb41){return _0x79fc4e[_0x7393('0x15')](_0x470f09);}return _0x79fc4e[_0x7393('0x16')](_0x470f09)[_0x7393('0x17')]();};}function respondWithResult(_0x38eaad,_0x212f44){_0x212f44=_0x212f44||0xc8;return function(_0x11030d){if(_0x11030d){return _0x38eaad['status'](_0x212f44)['json'](_0x11030d);}};}function respondWithFilteredResult(_0x414c37,_0x5d0d2b){return function(_0x5b91a9){if(_0x5b91a9){var _0x4e7ec6=typeof _0x5d0d2b[_0x7393('0x18')]==='undefined'&&typeof _0x5d0d2b[_0x7393('0x19')]===_0x7393('0x1a');var _0x5b8b03=_0x5b91a9[_0x7393('0x1b')];var _0x5745cb=_0x4e7ec6?0x0:_0x5d0d2b['offset'];var _0x31c8c2=_0x4e7ec6?_0x5b91a9[_0x7393('0x1b')]:_0x5d0d2b[_0x7393('0x18')]+_0x5d0d2b[_0x7393('0x19')];var _0x31902f;if(_0x31c8c2>=_0x5b8b03){_0x31c8c2=_0x5b8b03;_0x31902f=0xc8;}else{_0x31902f=0xce;}_0x414c37[_0x7393('0x16')](_0x31902f);return _0x414c37[_0x7393('0x1c')](_0x7393('0x1d'),_0x5745cb+'-'+_0x31c8c2+'/'+_0x5b8b03)['json'](_0x5b91a9);}return null;};}function patchUpdates(_0x52cd6a){return function(_0x30eae3){try{jsonpatch[_0x7393('0x1e')](_0x30eae3,_0x52cd6a,!![]);}catch(_0x3979b7){return BPromise[_0x7393('0x1f')](_0x3979b7);}return _0x30eae3[_0x7393('0x20')]();};}function saveUpdates(_0x52f716,_0x4d7870){return function(_0x544487){if(_0x544487){return _0x544487[_0x7393('0x21')](_0x52f716)['then'](function(_0x4cfdf6){return _0x4cfdf6;});}return null;};}function removeEntity(_0x2bf7a9,_0xa8f852){return function(_0x5b4498){if(_0x5b4498){return _0x5b4498[_0x7393('0x22')]()[_0x7393('0x23')](function(){_0x2bf7a9[_0x7393('0x16')](0xcc)[_0x7393('0x17')]();});}};}function handleEntityNotFound(_0x3fe456,_0x2c025f){return function(_0x1b31b8){if(!_0x1b31b8){_0x3fe456[_0x7393('0x15')](0x194);}return _0x1b31b8;};}function handleError(_0x328c47,_0x3d8773){_0x3d8773=_0x3d8773||0x1f4;return function(_0x1d7188){logger[_0x7393('0x24')](_0x1d7188[_0x7393('0x25')]);if(_0x1d7188['name']){delete _0x1d7188[_0x7393('0x26')];}_0x328c47[_0x7393('0x16')](_0x3d8773)[_0x7393('0x27')](_0x1d7188);};}exports[_0x7393('0x28')]=function(_0x1013aa,_0xd8dfae){var _0x4a865e={},_0x850b37={},_0x4befa4={'count':0x0,'rows':[]};var _0xc3c5c0=_['map'](db[_0x7393('0x29')][_0x7393('0x2a')],function(_0x45ebe1){return{'name':_0x45ebe1[_0x7393('0x2b')],'type':_0x45ebe1[_0x7393('0x2c')][_0x7393('0x2d')]};});_0x850b37[_0x7393('0x2e')]=_[_0x7393('0x2f')](_0xc3c5c0,_0x7393('0x26'));_0x850b37[_0x7393('0x30')]=_[_0x7393('0x31')](_0x1013aa[_0x7393('0x30')]);_0x850b37['filters']=_['intersection'](_0x850b37[_0x7393('0x2e')],_0x850b37['query']);_0x4a865e[_0x7393('0x32')]=_['intersection'](_0x850b37[_0x7393('0x2e')],qs['fields'](_0x1013aa[_0x7393('0x30')][_0x7393('0x33')]));_0x4a865e[_0x7393('0x32')]=_0x4a865e[_0x7393('0x32')][_0x7393('0x34')]?_0x4a865e[_0x7393('0x32')]:_0x850b37[_0x7393('0x2e')];if(!_0x1013aa[_0x7393('0x30')][_0x7393('0x35')](_0x7393('0x36'))){_0x4a865e['limit']=qs[_0x7393('0x19')](_0x1013aa['query'][_0x7393('0x19')]);_0x4a865e['offset']=qs[_0x7393('0x18')](_0x1013aa[_0x7393('0x30')][_0x7393('0x18')]);}_0x4a865e[_0x7393('0x37')]=qs[_0x7393('0x38')](_0x1013aa['query'][_0x7393('0x38')]);_0x4a865e['where']=qs[_0x7393('0x39')](_[_0x7393('0x3a')](_0x1013aa[_0x7393('0x30')],_0x850b37[_0x7393('0x39')]),_0xc3c5c0);if(_0x1013aa[_0x7393('0x30')]['filter']){_0x4a865e['where']=_[_0x7393('0x3b')](_0x4a865e[_0x7393('0x3c')],{'$or':_[_0x7393('0x2f')](_0xc3c5c0,function(_0x327d2e){if(_0x327d2e['type']!=='VIRTUAL'){var _0x594926={};_0x594926[_0x327d2e[_0x7393('0x26')]]={'$like':'%'+_0x1013aa[_0x7393('0x30')][_0x7393('0x3d')]+'%'};return _0x594926;}})});}_0x4a865e=_[_0x7393('0x3b')]({},_0x4a865e,_0x1013aa[_0x7393('0x3e')]);var _0x406b35={'where':_0x4a865e[_0x7393('0x3c')]};return db[_0x7393('0x29')][_0x7393('0x1b')](_0x406b35)[_0x7393('0x23')](function(_0xc39c05){_0x4befa4[_0x7393('0x1b')]=_0xc39c05;if(_0x1013aa[_0x7393('0x30')][_0x7393('0x3f')]){_0x4a865e[_0x7393('0x40')]=[{'all':!![]}];}return db[_0x7393('0x29')][_0x7393('0x41')](_0x4a865e);})[_0x7393('0x23')](function(_0x445b39){_0x4befa4[_0x7393('0x42')]=_0x445b39;return _0x4befa4;})[_0x7393('0x23')](respondWithFilteredResult(_0xd8dfae,_0x4a865e))[_0x7393('0x43')](handleError(_0xd8dfae,null));};exports['show']=function(_0x28dd3e,_0x16bcbf){var _0x25a2a6={'raw':!![],'where':{'id':_0x28dd3e[_0x7393('0x44')]['id']}},_0x40ab6d={};_0x40ab6d[_0x7393('0x2e')]=_[_0x7393('0x31')](db[_0x7393('0x29')]['rawAttributes']);_0x40ab6d['query']=_[_0x7393('0x31')](_0x28dd3e['query']);_0x40ab6d[_0x7393('0x39')]=_[_0x7393('0x45')](_0x40ab6d[_0x7393('0x2e')],_0x40ab6d[_0x7393('0x30')]);_0x25a2a6[_0x7393('0x32')]=_[_0x7393('0x45')](_0x40ab6d['model'],qs[_0x7393('0x33')](_0x28dd3e[_0x7393('0x30')][_0x7393('0x33')]));_0x25a2a6[_0x7393('0x32')]=_0x25a2a6[_0x7393('0x32')]['length']?_0x25a2a6['attributes']:_0x40ab6d[_0x7393('0x2e')];if(_0x28dd3e['query'][_0x7393('0x3f')]){_0x25a2a6[_0x7393('0x40')]=[{'all':!![]}];}_0x25a2a6=_[_0x7393('0x3b')]({},_0x25a2a6,_0x28dd3e[_0x7393('0x3e')]);return db[_0x7393('0x29')][_0x7393('0x46')](_0x25a2a6)[_0x7393('0x23')](handleEntityNotFound(_0x16bcbf,null))[_0x7393('0x23')](respondWithResult(_0x16bcbf,null))[_0x7393('0x43')](handleError(_0x16bcbf,null));};exports[_0x7393('0x47')]=function(_0x2f19b6,_0x26c327){return db[_0x7393('0x29')][_0x7393('0x47')](_0x2f19b6[_0x7393('0x48')],{})['then'](respondWithResult(_0x26c327,0xc9))[_0x7393('0x43')](handleError(_0x26c327,null));};exports[_0x7393('0x21')]=function(_0x27b796,_0x351ba9){if(_0x27b796['body']['id']){delete _0x27b796[_0x7393('0x48')]['id'];}return db[_0x7393('0x29')][_0x7393('0x46')]({'where':{'id':_0x27b796[_0x7393('0x44')]['id']}})[_0x7393('0x23')](handleEntityNotFound(_0x351ba9,null))[_0x7393('0x23')](saveUpdates(_0x27b796[_0x7393('0x48')],null))[_0x7393('0x23')](respondWithResult(_0x351ba9,null))[_0x7393('0x43')](handleError(_0x351ba9,null));};exports['destroy']=function(_0xd3d01d,_0x1f66cb){return db[_0x7393('0x29')]['find']({'where':{'id':_0xd3d01d[_0x7393('0x44')]['id']}})[_0x7393('0x23')](handleEntityNotFound(_0x1f66cb,null))['then'](removeEntity(_0x1f66cb,null))[_0x7393('0x43')](handleError(_0x1f66cb,null));};exports['describe']=function(_0x396992,_0x575df2){return db[_0x7393('0x29')][_0x7393('0x49')]()['then'](respondWithResult(_0x575df2,null))[_0x7393('0x43')](handleError(_0x575df2,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 4085fe4..cb2c770 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(_0xa4c049,_0xc51262){var _0x1fd90a=function(_0xeebae){while(--_0xeebae){_0xa4c049['push'](_0xa4c049['shift']());}};_0x1fd90a(++_0xc51262);}(_0x7a54,0x106));var _0x47a5=function(_0x4be0b5,_0x4f225e){_0x4be0b5=_0x4be0b5-0x0;var _0x2cf5bd=_0x7a54[_0x4be0b5];return _0x2cf5bd;};'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 _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x34c772,_0x3662b7){var _0x45b9b2=function(_0x5f3df3){while(--_0x5f3df3){_0x34c772['push'](_0x34c772['shift']());}};_0x45b9b2(++_0x3662b7);}(_0x7a54,0x106));var _0x47a5=function(_0x4ac4e9,_0x506a88){_0x4ac4e9=_0x4ac4e9-0x0;var _0x1677ee=_0x7a54[_0x4ac4e9];return _0x1677ee;};'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
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 8a6e8a6..ee4d821 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 _0xf11a=['catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0xd60c25,_0x45de3c){var _0x13e0cf=function(_0x27cda9){while(--_0x27cda9){_0xd60c25['push'](_0xd60c25['shift']());}};_0x13e0cf(++_0x45de3c);}(_0xf11a,0xf3));var _0xaf11=function(_0x4017b0,_0x4347db){_0x4017b0=_0x4017b0-0x0;var _0x5ed4f7=_0xf11a[_0x4017b0];return _0x5ed4f7;};'use strict';var _=require(_0xaf11('0x0'));var util=require(_0xaf11('0x1'));var moment=require('moment');var BPromise=require(_0xaf11('0x2'));var rs=require(_0xaf11('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaf11('0x4'))['db'];var utils=require(_0xaf11('0x5'));var logger=require(_0xaf11('0x6'))('rpc');var config=require(_0xaf11('0x7'));var jayson=require(_0xaf11('0x8'));var client=jayson[_0xaf11('0x9')][_0xaf11('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3815c1,_0x4e3bbb,_0x4736bb){return new BPromise(function(_0x33994f,_0x28149d){return client[_0xaf11('0xb')](_0x3815c1,_0x4736bb)[_0xaf11('0xc')](function(_0x37b97d){logger[_0xaf11('0xd')](_0xaf11('0xe'),_0x4e3bbb,_0xaf11('0xf'));logger[_0xaf11('0x10')](_0xaf11('0x11'),_0x4e3bbb,_0xaf11('0xf'),JSON[_0xaf11('0x12')](_0x37b97d));if(_0x37b97d[_0xaf11('0x13')]){if(_0x37b97d[_0xaf11('0x13')]['code']===0x1f4){logger[_0xaf11('0x13')](_0xaf11('0xe'),_0x4e3bbb,_0x37b97d[_0xaf11('0x13')][_0xaf11('0x14')]);return _0x28149d(_0x37b97d[_0xaf11('0x13')][_0xaf11('0x14')]);}logger[_0xaf11('0x13')](_0xaf11('0xe'),_0x4e3bbb,_0x37b97d[_0xaf11('0x13')][_0xaf11('0x14')]);return _0x33994f(_0x37b97d[_0xaf11('0x13')][_0xaf11('0x14')]);}else{logger[_0xaf11('0xd')]('Cdr,\x20%s,\x20%s',_0x4e3bbb,'request\x20sent');_0x33994f(_0x37b97d['result'][_0xaf11('0x14')]);}})[_0xaf11('0x15')](function(_0x387998){logger['error']('Cdr,\x20%s,\x20%s',_0x4e3bbb,_0x387998);_0x28149d(_0x387998);});});}
\ No newline at end of file
+var _0x675f=['message','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','Cdr,\x20%s,\x20%s'];(function(_0x2d85de,_0xea22c2){var _0x2cd00a=function(_0x41d607){while(--_0x41d607){_0x2d85de['push'](_0x2d85de['shift']());}};_0x2cd00a(++_0xea22c2);}(_0x675f,0xc9));var _0xf675=function(_0x439182,_0x5361b8){_0x439182=_0x439182-0x0;var _0x2f2698=_0x675f[_0x439182];return _0x2f2698;};'use strict';var _=require(_0xf675('0x0'));var util=require(_0xf675('0x1'));var moment=require(_0xf675('0x2'));var BPromise=require(_0xf675('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf675('0x4'))['db'];var utils=require(_0xf675('0x5'));var logger=require(_0xf675('0x6'))(_0xf675('0x7'));var config=require(_0xf675('0x8'));var jayson=require(_0xf675('0x9'));var client=jayson[_0xf675('0xa')][_0xf675('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3bc259,_0xc91685,_0x34997f){return new BPromise(function(_0x4e2da5,_0x2aedaa){return client[_0xf675('0xc')](_0x3bc259,_0x34997f)['then'](function(_0x677bf7){logger['info']('Cdr,\x20%s,\x20%s',_0xc91685,_0xf675('0xd'));logger['debug'](_0xf675('0xe'),_0xc91685,_0xf675('0xd'),JSON[_0xf675('0xf')](_0x677bf7));if(_0x677bf7[_0xf675('0x10')]){if(_0x677bf7[_0xf675('0x10')][_0xf675('0x11')]===0x1f4){logger[_0xf675('0x10')](_0xf675('0x12'),_0xc91685,_0x677bf7['error']['message']);return _0x2aedaa(_0x677bf7['error']['message']);}logger[_0xf675('0x10')]('Cdr,\x20%s,\x20%s',_0xc91685,_0x677bf7[_0xf675('0x10')][_0xf675('0x13')]);return _0x4e2da5(_0x677bf7['error']['message']);}else{logger['info']('Cdr,\x20%s,\x20%s',_0xc91685,_0xf675('0xd'));_0x4e2da5(_0x677bf7['result'][_0xf675('0x13')]);}})['catch'](function(_0x31b6d5){logger[_0xf675('0x10')]('Cdr,\x20%s,\x20%s',_0xc91685,_0x31b6d5);_0x2aedaa(_0x31b6d5);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 1594bfa..6a5abc8 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(_0x59bd6a,_0x540db8){var _0x54ffd0=function(_0x2549d0){while(--_0x2549d0){_0x59bd6a['push'](_0x59bd6a['shift']());}};_0x54ffd0(++_0x540db8);}(_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(_0x52bbc9,_0xb342e0){var _0x5909d0=function(_0x24370d){while(--_0x24370d){_0x52bbc9['push'](_0x52bbc9['shift']());}};_0x5909d0(++_0xb342e0);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'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 4af5504..d6f0a4f 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 _0x58b6=['*,*,*,*','sequelize','STRING','noop','TEXT'];(function(_0x4a0ca6,_0xff283e){var _0x2dcf8a=function(_0x47ca9c){while(--_0x47ca9c){_0x4a0ca6['push'](_0x4a0ca6['shift']());}};_0x2dcf8a(++_0xff283e);}(_0x58b6,0x128));var _0x658b=function(_0x5c8be4,_0x5c2266){_0x5c8be4=_0x5c8be4-0x0;var _0x3b6e26=_0x58b6[_0x5c8be4];return _0x3b6e26;};'use strict';var Sequelize=require(_0x658b('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x658b('0x1')],'allowNull':![],'defaultValue':_0x658b('0x2')},'appdata':{'type':Sequelize[_0x658b('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x658b('0x1')],'defaultValue':_0x658b('0x4')}};
\ No newline at end of file
+var _0xbac7=['INTEGER','STRING','noop','*,*,*,*','sequelize','exports'];(function(_0x2a1275,_0x20c2d2){var _0x2e4ed9=function(_0x2a2d1e){while(--_0x2a2d1e){_0x2a1275['push'](_0x2a1275['shift']());}};_0x2e4ed9(++_0x20c2d2);}(_0xbac7,0x1ae));var _0x7bac=function(_0x3165a7,_0x59a398){_0x3165a7=_0x3165a7-0x0;var _0x2d6dc9=_0xbac7[_0x3165a7];return _0x2d6dc9;};'use strict';var Sequelize=require(_0x7bac('0x0'));module[_0x7bac('0x1')]={'priority':{'type':Sequelize[_0x7bac('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x7bac('0x3')],'allowNull':![],'defaultValue':_0x7bac('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x7bac('0x3')]},'interval':{'type':Sequelize[_0x7bac('0x3')],'defaultValue':_0x7bac('0x5')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 91c8284..c06b225 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 _0x0cee=['zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','include','merge','body','find','catch','destroy','eml-format','rimraf'];(function(_0xbc0d7,_0x59a5b3){var _0x47578d=function(_0x5dff57){while(--_0x5dff57){_0xbc0d7['push'](_0xbc0d7['shift']());}};_0x47578d(++_0x59a5b3);}(_0x0cee,0x12f));var _0xe0ce=function(_0x56e51a,_0x3db67a){_0x56e51a=_0x56e51a-0x0;var _0x11d5e2=_0x0cee[_0x56e51a];return _0x11d5e2;};'use strict';var emlformat=require(_0xe0ce('0x0'));var rimraf=require(_0xe0ce('0x1'));var zipdir=require(_0xe0ce('0x2'));var jsonpatch=require(_0xe0ce('0x3'));var rp=require(_0xe0ce('0x4'));var moment=require(_0xe0ce('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe0ce('0x6'));var path=require(_0xe0ce('0x7'));var sox=require(_0xe0ce('0x8'));var csv=require(_0xe0ce('0x9'));var ejs=require(_0xe0ce('0xa'));var fs=require('fs');var fs_extra=require(_0xe0ce('0xb'));var _=require(_0xe0ce('0xc'));var squel=require(_0xe0ce('0xd'));var crypto=require('crypto');var jsforce=require(_0xe0ce('0xe'));var deskjs=require(_0xe0ce('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe0ce('0x10'));var Papa=require(_0xe0ce('0x11'));var Redis=require(_0xe0ce('0x12'));var authService=require(_0xe0ce('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe0ce('0x14'))(_0xe0ce('0x15'));var utils=require(_0xe0ce('0x16'));var config=require(_0xe0ce('0x17'));var licenseUtil=require(_0xe0ce('0x18'));var db=require(_0xe0ce('0x19'))['db'];function respondWithStatusCode(_0x17164a,_0x4598e1){_0x4598e1=_0x4598e1||0xcc;return function(_0x46152e){if(_0x46152e){return _0x17164a[_0xe0ce('0x1a')](_0x4598e1);}return _0x17164a[_0xe0ce('0x1b')](_0x4598e1)[_0xe0ce('0x1c')]();};}function respondWithResult(_0x4b4c80,_0x4c8662){_0x4c8662=_0x4c8662||0xc8;return function(_0x166f42){if(_0x166f42){return _0x4b4c80[_0xe0ce('0x1b')](_0x4c8662)['json'](_0x166f42);}};}function respondWithFilteredResult(_0x556cff,_0x81269b){return function(_0x220456){if(_0x220456){var _0x49e9d1=typeof _0x81269b[_0xe0ce('0x1d')]===_0xe0ce('0x1e')&&typeof _0x81269b['limit']===_0xe0ce('0x1e');var _0x4e4e19=_0x220456[_0xe0ce('0x1f')];var _0x2b5ec6=_0x49e9d1?0x0:_0x81269b[_0xe0ce('0x1d')];var _0x412b52=_0x49e9d1?_0x220456[_0xe0ce('0x1f')]:_0x81269b['offset']+_0x81269b['limit'];var _0xadcb66;if(_0x412b52>=_0x4e4e19){_0x412b52=_0x4e4e19;_0xadcb66=0xc8;}else{_0xadcb66=0xce;}_0x556cff['status'](_0xadcb66);return _0x556cff['set'](_0xe0ce('0x20'),_0x2b5ec6+'-'+_0x412b52+'/'+_0x4e4e19)[_0xe0ce('0x21')](_0x220456);}return null;};}function patchUpdates(_0x494c2a){return function(_0x408369){try{jsonpatch[_0xe0ce('0x22')](_0x408369,_0x494c2a,!![]);}catch(_0x196cee){return BPromise[_0xe0ce('0x23')](_0x196cee);}return _0x408369[_0xe0ce('0x24')]();};}function saveUpdates(_0x4ce716,_0xfcb09){return function(_0x5d31b2){if(_0x5d31b2){return _0x5d31b2[_0xe0ce('0x25')](_0x4ce716)['then'](function(_0x5916c9){return _0x5916c9;});}return null;};}function removeEntity(_0x51fe9f,_0x5b8c86){return function(_0xf04ba3){if(_0xf04ba3){return _0xf04ba3['destroy']()[_0xe0ce('0x26')](function(){_0x51fe9f[_0xe0ce('0x1b')](0xcc)[_0xe0ce('0x1c')]();});}};}function handleEntityNotFound(_0x19ad73,_0x3a8c3e){return function(_0x1a4bc0){if(!_0x1a4bc0){_0x19ad73[_0xe0ce('0x1a')](0x194);}return _0x1a4bc0;};}function handleError(_0x2b2dfc,_0x417fe3){_0x417fe3=_0x417fe3||0x1f4;return function(_0x188c56){logger[_0xe0ce('0x27')](_0x188c56[_0xe0ce('0x28')]);if(_0x188c56['name']){delete _0x188c56[_0xe0ce('0x29')];}_0x2b2dfc[_0xe0ce('0x1b')](_0x417fe3)[_0xe0ce('0x2a')](_0x188c56);};}exports[_0xe0ce('0x2b')]=function(_0x4cb733,_0x45e293){var _0x2ae22d={'raw':!![],'where':{'id':_0x4cb733[_0xe0ce('0x2c')]['id']}},_0x5ea327={};_0x5ea327[_0xe0ce('0x2d')]=_[_0xe0ce('0x2e')](db[_0xe0ce('0x2f')][_0xe0ce('0x30')]);_0x5ea327[_0xe0ce('0x31')]=_[_0xe0ce('0x2e')](_0x4cb733['query']);_0x5ea327[_0xe0ce('0x32')]=_[_0xe0ce('0x33')](_0x5ea327[_0xe0ce('0x2d')],_0x5ea327[_0xe0ce('0x31')]);_0x2ae22d[_0xe0ce('0x34')]=_[_0xe0ce('0x33')](_0x5ea327[_0xe0ce('0x2d')],qs['fields'](_0x4cb733['query'][_0xe0ce('0x35')]));_0x2ae22d['attributes']=_0x2ae22d[_0xe0ce('0x34')][_0xe0ce('0x36')]?_0x2ae22d[_0xe0ce('0x34')]:_0x5ea327[_0xe0ce('0x2d')];if(_0x4cb733[_0xe0ce('0x31')]['includeAll']){_0x2ae22d[_0xe0ce('0x37')]=[{'all':!![]}];}_0x2ae22d=_[_0xe0ce('0x38')]({},_0x2ae22d,_0x4cb733['options']);return db['ChatApplication']['find'](_0x2ae22d)[_0xe0ce('0x26')](handleEntityNotFound(_0x45e293,null))[_0xe0ce('0x26')](respondWithResult(_0x45e293,null))['catch'](handleError(_0x45e293,null));};exports[_0xe0ce('0x25')]=function(_0x269079,_0x1bf5f0){if(_0x269079[_0xe0ce('0x39')]['id']){delete _0x269079['body']['id'];}return db[_0xe0ce('0x2f')][_0xe0ce('0x3a')]({'where':{'id':_0x269079[_0xe0ce('0x2c')]['id']}})[_0xe0ce('0x26')](handleEntityNotFound(_0x1bf5f0,null))[_0xe0ce('0x26')](saveUpdates(_0x269079['body'],null))['then'](respondWithResult(_0x1bf5f0,null))[_0xe0ce('0x3b')](handleError(_0x1bf5f0,null));};exports[_0xe0ce('0x3c')]=function(_0x470a3f,_0x26df1b){return db['ChatApplication'][_0xe0ce('0x3a')]({'where':{'id':_0x470a3f[_0xe0ce('0x2c')]['id']}})['then'](handleEntityNotFound(_0x26df1b,null))[_0xe0ce('0x26')](removeEntity(_0x26df1b,null))[_0xe0ce('0x3b')](handleError(_0x26df1b,null));};
\ No newline at end of file
+var _0x8164=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','name','send','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','includeAll','include','merge','options','catch','body','find','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x5e2188,_0x71f651){var _0x462d62=function(_0x4c088b){while(--_0x4c088b){_0x5e2188['push'](_0x5e2188['shift']());}};_0x462d62(++_0x71f651);}(_0x8164,0x170));var _0x4816=function(_0x4688f3,_0x1d5a1a){_0x4688f3=_0x4688f3-0x0;var _0x470c84=_0x8164[_0x4688f3];return _0x470c84;};'use strict';var emlformat=require(_0x4816('0x0'));var rimraf=require(_0x4816('0x1'));var zipdir=require(_0x4816('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4816('0x3'));var moment=require(_0x4816('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4816('0x5'));var util=require('util');var path=require(_0x4816('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4816('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4816('0x8'));var crypto=require(_0x4816('0x9'));var jsforce=require(_0x4816('0xa'));var deskjs=require(_0x4816('0xb'));var toCsv=require(_0x4816('0xc'));var querystring=require(_0x4816('0xd'));var Papa=require(_0x4816('0xe'));var Redis=require(_0x4816('0xf'));var authService=require(_0x4816('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4816('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4816('0x12'))(_0x4816('0x13'));var utils=require('../../config/utils');var config=require(_0x4816('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c173b,_0x51a5f8){_0x51a5f8=_0x51a5f8||0xcc;return function(_0x5c4d42){if(_0x5c4d42){return _0x3c173b[_0x4816('0x15')](_0x51a5f8);}return _0x3c173b['status'](_0x51a5f8)[_0x4816('0x16')]();};}function respondWithResult(_0x2554b4,_0x13a685){_0x13a685=_0x13a685||0xc8;return function(_0x316f36){if(_0x316f36){return _0x2554b4[_0x4816('0x17')](_0x13a685)[_0x4816('0x18')](_0x316f36);}};}function respondWithFilteredResult(_0x1eb683,_0x2a58b7){return function(_0x45c006){if(_0x45c006){var _0x21354c=typeof _0x2a58b7[_0x4816('0x19')]===_0x4816('0x1a')&&typeof _0x2a58b7[_0x4816('0x1b')]===_0x4816('0x1a');var _0x1961a5=_0x45c006[_0x4816('0x1c')];var _0x4803d0=_0x21354c?0x0:_0x2a58b7['offset'];var _0x8d4393=_0x21354c?_0x45c006[_0x4816('0x1c')]:_0x2a58b7[_0x4816('0x19')]+_0x2a58b7[_0x4816('0x1b')];var _0xc8ffd5;if(_0x8d4393>=_0x1961a5){_0x8d4393=_0x1961a5;_0xc8ffd5=0xc8;}else{_0xc8ffd5=0xce;}_0x1eb683[_0x4816('0x17')](_0xc8ffd5);return _0x1eb683[_0x4816('0x1d')](_0x4816('0x1e'),_0x4803d0+'-'+_0x8d4393+'/'+_0x1961a5)[_0x4816('0x18')](_0x45c006);}return null;};}function patchUpdates(_0x53189e){return function(_0x1ab50d){try{jsonpatch['apply'](_0x1ab50d,_0x53189e,!![]);}catch(_0x521472){return BPromise[_0x4816('0x1f')](_0x521472);}return _0x1ab50d[_0x4816('0x20')]();};}function saveUpdates(_0x5de184,_0x2bbaf4){return function(_0x576221){if(_0x576221){return _0x576221[_0x4816('0x21')](_0x5de184)[_0x4816('0x22')](function(_0x571c81){return _0x571c81;});}return null;};}function removeEntity(_0x504851,_0xe484b2){return function(_0x2c8dc4){if(_0x2c8dc4){return _0x2c8dc4[_0x4816('0x23')]()['then'](function(){_0x504851[_0x4816('0x17')](0xcc)[_0x4816('0x16')]();});}};}function handleEntityNotFound(_0x126c60,_0x3f07f1){return function(_0x571a05){if(!_0x571a05){_0x126c60['sendStatus'](0x194);}return _0x571a05;};}function handleError(_0x901967,_0x47701a){_0x47701a=_0x47701a||0x1f4;return function(_0x590349){logger[_0x4816('0x24')](_0x590349['stack']);if(_0x590349['name']){delete _0x590349[_0x4816('0x25')];}_0x901967[_0x4816('0x17')](_0x47701a)[_0x4816('0x26')](_0x590349);};}exports['show']=function(_0xbeb8fb,_0x521259){var _0x39ddbd={'raw':!![],'where':{'id':_0xbeb8fb['params']['id']}},_0x229086={};_0x229086[_0x4816('0x27')]=_[_0x4816('0x28')](db[_0x4816('0x29')][_0x4816('0x2a')]);_0x229086[_0x4816('0x2b')]=_[_0x4816('0x28')](_0xbeb8fb[_0x4816('0x2b')]);_0x229086[_0x4816('0x2c')]=_[_0x4816('0x2d')](_0x229086['model'],_0x229086[_0x4816('0x2b')]);_0x39ddbd[_0x4816('0x2e')]=_['intersection'](_0x229086['model'],qs[_0x4816('0x2f')](_0xbeb8fb[_0x4816('0x2b')][_0x4816('0x2f')]));_0x39ddbd[_0x4816('0x2e')]=_0x39ddbd[_0x4816('0x2e')]['length']?_0x39ddbd['attributes']:_0x229086['model'];if(_0xbeb8fb[_0x4816('0x2b')][_0x4816('0x30')]){_0x39ddbd[_0x4816('0x31')]=[{'all':!![]}];}_0x39ddbd=_[_0x4816('0x32')]({},_0x39ddbd,_0xbeb8fb[_0x4816('0x33')]);return db[_0x4816('0x29')]['find'](_0x39ddbd)[_0x4816('0x22')](handleEntityNotFound(_0x521259,null))['then'](respondWithResult(_0x521259,null))[_0x4816('0x34')](handleError(_0x521259,null));};exports[_0x4816('0x21')]=function(_0x37a212,_0x30d55f){if(_0x37a212[_0x4816('0x35')]['id']){delete _0x37a212['body']['id'];}return db[_0x4816('0x29')]['find']({'where':{'id':_0x37a212['params']['id']}})[_0x4816('0x22')](handleEntityNotFound(_0x30d55f,null))['then'](saveUpdates(_0x37a212['body'],null))['then'](respondWithResult(_0x30d55f,null))['catch'](handleError(_0x30d55f,null));};exports[_0x4816('0x23')]=function(_0x3e6a11,_0x589f7d){return db[_0x4816('0x29')][_0x4816('0x36')]({'where':{'id':_0x3e6a11['params']['id']}})[_0x4816('0x22')](handleEntityNotFound(_0x589f7d,null))[_0x4816('0x22')](removeEntity(_0x589f7d,null))[_0x4816('0x34')](handleError(_0x589f7d,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index d95644a..f308bf1 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 _0x7cca=['lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x2a04bc,_0x19e6d7){var _0x2c8821=function(_0x378607){while(--_0x378607){_0x2a04bc['push'](_0x2a04bc['shift']());}};_0x2c8821(++_0x19e6d7);}(_0x7cca,0xff));var _0xa7cc=function(_0x312f92,_0x82db49){_0x312f92=_0x312f92-0x0;var _0x301bf2=_0x7cca[_0x312f92];return _0x301bf2;};'use strict';var _=require(_0xa7cc('0x0'));var util=require(_0xa7cc('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xa7cc('0x2'));var BPromise=require(_0xa7cc('0x3'));var rp=require(_0xa7cc('0x4'));var fs=require('fs');var path=require(_0xa7cc('0x5'));var rimraf=require(_0xa7cc('0x6'));var config=require(_0xa7cc('0x7'));var attributes=require(_0xa7cc('0x8'));module[_0xa7cc('0x9')]=function(_0x16d9a6,_0xb0f7a7){return _0x16d9a6[_0xa7cc('0xa')](_0xa7cc('0xb'),attributes,{'tableName':_0xa7cc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa7cc('0xd'),'collate':_0xa7cc('0xe')});};
\ No newline at end of file
+var _0x5c71=['moment','bluebird','path','exports','define','ChatApplication','chat_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x4c3406,_0x1d5d48){var _0x5df0a7=function(_0x18fba6){while(--_0x18fba6){_0x4c3406['push'](_0x4c3406['shift']());}};_0x5df0a7(++_0x1d5d48);}(_0x5c71,0x188));var _0x15c7=function(_0x35af98,_0x103f33){_0x35af98=_0x35af98-0x0;var _0x5f5a62=_0x5c71[_0x35af98];return _0x5f5a62;};'use strict';var _=require(_0x15c7('0x0'));var util=require(_0x15c7('0x1'));var logger=require(_0x15c7('0x2'))(_0x15c7('0x3'));var moment=require(_0x15c7('0x4'));var BPromise=require(_0x15c7('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x15c7('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatApplication.attributes');module[_0x15c7('0x7')]=function(_0x48fba1,_0xd64778){return _0x48fba1[_0x15c7('0x8')](_0x15c7('0x9'),attributes,{'tableName':_0x15c7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x15c7('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index cb69826..d7e5aae 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 _0xf8bf=['request\x20sent','stringify','error','code','ChatApplication,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ChatApplication,\x20%s,\x20%s,\x20%s'];(function(_0x563d41,_0xab55e9){var _0x5bb15f=function(_0x290ba8){while(--_0x290ba8){_0x563d41['push'](_0x563d41['shift']());}};_0x5bb15f(++_0xab55e9);}(_0xf8bf,0x1aa));var _0xff8b=function(_0x4e3253,_0x49f2cf){_0x4e3253=_0x4e3253-0x0;var _0x3702a8=_0xf8bf[_0x4e3253];return _0x3702a8;};'use strict';var _=require('lodash');var util=require(_0xff8b('0x0'));var moment=require(_0xff8b('0x1'));var BPromise=require('bluebird');var rs=require(_0xff8b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xff8b('0x3'))['db'];var utils=require(_0xff8b('0x4'));var logger=require(_0xff8b('0x5'))(_0xff8b('0x6'));var config=require('../../config/environment');var jayson=require(_0xff8b('0x7'));var client=jayson[_0xff8b('0x8')][_0xff8b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1be14a,_0x2ec4ce,_0x41261a){return new BPromise(function(_0x26e64d,_0x240c9f){return client[_0xff8b('0xa')](_0x1be14a,_0x41261a)[_0xff8b('0xb')](function(_0x26eedd){logger[_0xff8b('0xc')]('ChatApplication,\x20%s,\x20%s',_0x2ec4ce,'request\x20sent');logger['debug'](_0xff8b('0xd'),_0x2ec4ce,_0xff8b('0xe'),JSON[_0xff8b('0xf')](_0x26eedd));if(_0x26eedd[_0xff8b('0x10')]){if(_0x26eedd[_0xff8b('0x10')][_0xff8b('0x11')]===0x1f4){logger[_0xff8b('0x10')](_0xff8b('0x12'),_0x2ec4ce,_0x26eedd[_0xff8b('0x10')][_0xff8b('0x13')]);return _0x240c9f(_0x26eedd[_0xff8b('0x10')][_0xff8b('0x13')]);}logger[_0xff8b('0x10')](_0xff8b('0x12'),_0x2ec4ce,_0x26eedd[_0xff8b('0x10')]['message']);return _0x26e64d(_0x26eedd[_0xff8b('0x10')]['message']);}else{logger['info'](_0xff8b('0x12'),_0x2ec4ce,'request\x20sent');_0x26e64d(_0x26eedd[_0xff8b('0x14')][_0xff8b('0x13')]);}})[_0xff8b('0x15')](function(_0x28ceba){logger[_0xff8b('0x10')](_0xff8b('0x12'),_0x2ec4ce,_0x28ceba);_0x240c9f(_0x28ceba);});});}
\ No newline at end of file
+var _0xae46=['error','code','ChatApplication,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5500c2,_0x3db97e){var _0x2e4d11=function(_0x1f9917){while(--_0x1f9917){_0x5500c2['push'](_0x5500c2['shift']());}};_0x2e4d11(++_0x3db97e);}(_0xae46,0x10d));var _0x6ae4=function(_0x46fdf6,_0x3e1d7b){_0x46fdf6=_0x46fdf6-0x0;var _0x1eb206=_0xae46[_0x46fdf6];return _0x1eb206;};'use strict';var _=require(_0x6ae4('0x0'));var util=require(_0x6ae4('0x1'));var moment=require(_0x6ae4('0x2'));var BPromise=require(_0x6ae4('0x3'));var rs=require(_0x6ae4('0x4'));var fs=require('fs');var Redis=require(_0x6ae4('0x5'));var db=require(_0x6ae4('0x6'))['db'];var utils=require(_0x6ae4('0x7'));var logger=require('../../config/logger')(_0x6ae4('0x8'));var config=require(_0x6ae4('0x9'));var jayson=require(_0x6ae4('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x38478b,_0x1754ac,_0x2a4270){return new BPromise(function(_0x5d958b,_0x1cc575){return client[_0x6ae4('0xb')](_0x38478b,_0x2a4270)[_0x6ae4('0xc')](function(_0x508a26){logger['info']('ChatApplication,\x20%s,\x20%s',_0x1754ac,_0x6ae4('0xd'));logger[_0x6ae4('0xe')](_0x6ae4('0xf'),_0x1754ac,_0x6ae4('0xd'),JSON[_0x6ae4('0x10')](_0x508a26));if(_0x508a26[_0x6ae4('0x11')]){if(_0x508a26[_0x6ae4('0x11')][_0x6ae4('0x12')]===0x1f4){logger[_0x6ae4('0x11')](_0x6ae4('0x13'),_0x1754ac,_0x508a26[_0x6ae4('0x11')][_0x6ae4('0x14')]);return _0x1cc575(_0x508a26[_0x6ae4('0x11')][_0x6ae4('0x14')]);}logger[_0x6ae4('0x11')](_0x6ae4('0x13'),_0x1754ac,_0x508a26[_0x6ae4('0x11')][_0x6ae4('0x14')]);return _0x5d958b(_0x508a26['error'][_0x6ae4('0x14')]);}else{logger['info'](_0x6ae4('0x13'),_0x1754ac,_0x6ae4('0xd'));_0x5d958b(_0x508a26[_0x6ae4('0x15')][_0x6ae4('0x14')]);}})['catch'](function(_0x12e0fe){logger[_0x6ae4('0x11')](_0x6ae4('0x13'),_0x1754ac,_0x12e0fe);_0x1cc575(_0x12e0fe);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 90b02f6..b9ab58f 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 _0x455e=['./chatApplication.controller','get','/:id','isAuthenticated','put','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x57356a,_0x58a92b){var _0x3e5d73=function(_0x149928){while(--_0x149928){_0x57356a['push'](_0x57356a['shift']());}};_0x3e5d73(++_0x58a92b);}(_0x455e,0x133));var _0xe455=function(_0x5c0624,_0x4f4e34){_0x5c0624=_0x5c0624-0x0;var _0x1e5533=_0x455e[_0x5c0624];return _0x1e5533;};'use strict';var multer=require(_0xe455('0x0'));var util=require(_0xe455('0x1'));var path=require(_0xe455('0x2'));var timeout=require(_0xe455('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe455('0x4'));var auth=require(_0xe455('0x5'));var interaction=require(_0xe455('0x6'));var config=require(_0xe455('0x7'));var controller=require(_0xe455('0x8'));router[_0xe455('0x9')](_0xe455('0xa'),auth[_0xe455('0xb')](),controller['show']);router[_0xe455('0xc')](_0xe455('0xa'),auth[_0xe455('0xb')](),controller['update']);router['delete']('/:id',auth[_0xe455('0xb')](),controller[_0xe455('0xd')]);module[_0xe455('0xe')]=router;
\ No newline at end of file
+var _0x7aef=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','/:id','isAuthenticated','update','delete','destroy','multer','util'];(function(_0x17284b,_0x27aa78){var _0x54eafd=function(_0x377b71){while(--_0x377b71){_0x17284b['push'](_0x17284b['shift']());}};_0x54eafd(++_0x27aa78);}(_0x7aef,0x1ee));var _0xf7ae=function(_0x40b0ae,_0x6474c7){_0x40b0ae=_0x40b0ae-0x0;var _0xe05dcb=_0x7aef[_0x40b0ae];return _0xe05dcb;};'use strict';var multer=require(_0xf7ae('0x0'));var util=require(_0xf7ae('0x1'));var path=require(_0xf7ae('0x2'));var timeout=require(_0xf7ae('0x3'));var express=require(_0xf7ae('0x4'));var router=express[_0xf7ae('0x5')]();var fs_extra=require(_0xf7ae('0x6'));var auth=require(_0xf7ae('0x7'));var interaction=require(_0xf7ae('0x8'));var config=require(_0xf7ae('0x9'));var controller=require(_0xf7ae('0xa'));router['get'](_0xf7ae('0xb'),auth[_0xf7ae('0xc')](),controller['show']);router['put'](_0xf7ae('0xb'),auth[_0xf7ae('0xc')](),controller[_0xf7ae('0xd')]);router[_0xf7ae('0xe')](_0xf7ae('0xb'),auth[_0xf7ae('0xc')](),controller[_0xf7ae('0xf')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 2920d9e..b902bb7 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 _0x3c0c=['BOOLEAN','sequelize','STRING'];(function(_0x13f1c8,_0x49a872){var _0x1e716a=function(_0x1166ae){while(--_0x1166ae){_0x13f1c8['push'](_0x13f1c8['shift']());}};_0x1e716a(++_0x49a872);}(_0x3c0c,0x94));var _0xc3c0=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x3c0c[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require(_0xc3c0('0x0'));module['exports']={'name':{'type':Sequelize[_0xc3c0('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0xc3c0('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x4e0a=['STRING','sequelize'];(function(_0x53fb12,_0x327dd0){var _0x1ee597=function(_0x4e90c3){while(--_0x4e90c3){_0x53fb12['push'](_0x53fb12['shift']());}};_0x1ee597(++_0x327dd0);}(_0x4e0a,0x1d5));var _0xa4e0=function(_0x5067db,_0xf8d2f2){_0x5067db=_0x5067db-0x0;var _0x2771e4=_0x4e0a[_0x5067db];return _0x2771e4;};'use strict';var Sequelize=require(_0xa4e0('0x0'));module['exports']={'name':{'type':Sequelize[_0xa4e0('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa4e0('0x1')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index c380430..6788d75 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 _0xb798=['findOne','keys','User','removeMembers','addMessage','getMessages','$gte','format','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','destroy','end','error','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','ids','omit','getMembers'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0xb798,0xcc));var _0x8b79=function(_0x23648d,_0x593c56){_0x23648d=_0x23648d-0x0;var _0x1f7500=_0xb798[_0x23648d];return _0x1f7500;};'use strict';var emlformat=require(_0x8b79('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8b79('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8b79('0x2'));var moment=require('moment');var BPromise=require(_0x8b79('0x3'));var Mustache=require(_0x8b79('0x4'));var util=require(_0x8b79('0x5'));var path=require(_0x8b79('0x6'));var sox=require(_0x8b79('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8b79('0x8'));var _=require(_0x8b79('0x9'));var squel=require(_0x8b79('0xa'));var crypto=require(_0x8b79('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x8b79('0xc'));var toCsv=require(_0x8b79('0xd'));var querystring=require(_0x8b79('0xe'));var Papa=require(_0x8b79('0xf'));var Redis=require(_0x8b79('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8b79('0x11'));var hardwareService=require(_0x8b79('0x12'));var logger=require(_0x8b79('0x13'))(_0x8b79('0x14'));var utils=require(_0x8b79('0x15'));var config=require(_0x8b79('0x16'));var licenseUtil=require(_0x8b79('0x17'));var db=require(_0x8b79('0x18'))['db'];config[_0x8b79('0x19')]=_['defaults'](config[_0x8b79('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x8b79('0x1a'))(new Redis(config['redis']));require(_0x8b79('0x1b'))[_0x8b79('0x1c')](socket);function respondWithStatusCode(_0x4218b1,_0x377369){_0x377369=_0x377369||0xcc;return function(_0x20bcef){if(_0x20bcef){return _0x4218b1[_0x8b79('0x1d')](_0x377369);}return _0x4218b1[_0x8b79('0x1e')](_0x377369)['end']();};}function respondWithResult(_0x49fe46,_0x194559){_0x194559=_0x194559||0xc8;return function(_0xefc887){if(_0xefc887){return _0x49fe46[_0x8b79('0x1e')](_0x194559)[_0x8b79('0x1f')](_0xefc887);}};}function respondWithFilteredResult(_0x55331f,_0x346acf){return function(_0x450dab){if(_0x450dab){var _0x49e097=typeof _0x346acf[_0x8b79('0x20')]===_0x8b79('0x21')&&typeof _0x346acf['limit']===_0x8b79('0x21');var _0x19387f=_0x450dab[_0x8b79('0x22')];var _0x3bcd78=_0x49e097?0x0:_0x346acf['offset'];var _0x1ae3ab=_0x49e097?_0x450dab[_0x8b79('0x22')]:_0x346acf['offset']+_0x346acf[_0x8b79('0x23')];var _0x5b6b03;if(_0x1ae3ab>=_0x19387f){_0x1ae3ab=_0x19387f;_0x5b6b03=0xc8;}else{_0x5b6b03=0xce;}_0x55331f[_0x8b79('0x1e')](_0x5b6b03);return _0x55331f[_0x8b79('0x24')](_0x8b79('0x25'),_0x3bcd78+'-'+_0x1ae3ab+'/'+_0x19387f)[_0x8b79('0x1f')](_0x450dab);}return null;};}function patchUpdates(_0xe983eb){return function(_0x30a39f){try{jsonpatch[_0x8b79('0x26')](_0x30a39f,_0xe983eb,!![]);}catch(_0x5c8ada){return BPromise[_0x8b79('0x27')](_0x5c8ada);}return _0x30a39f['save']();};}function saveUpdates(_0x5e9a68,_0x178715){return function(_0x59eb9b){if(_0x59eb9b){return _0x59eb9b[_0x8b79('0x28')](_0x5e9a68)['then'](function(_0x116bf5){return _0x116bf5;});}return null;};}function removeEntity(_0x172534,_0x30b3cc){return function(_0x13575d){if(_0x13575d){return _0x13575d[_0x8b79('0x29')]()['then'](function(){_0x172534[_0x8b79('0x1e')](0xcc)[_0x8b79('0x2a')]();});}};}function handleEntityNotFound(_0x57955b,_0x1000f6){return function(_0x32322c){if(!_0x32322c){_0x57955b['sendStatus'](0x194);}return _0x32322c;};}function handleError(_0x177b45,_0x49bd97){_0x49bd97=_0x49bd97||0x1f4;return function(_0x2688b4){logger[_0x8b79('0x2b')](_0x2688b4[_0x8b79('0x2c')]);if(_0x2688b4[_0x8b79('0x2d')]){delete _0x2688b4[_0x8b79('0x2d')];}_0x177b45['status'](_0x49bd97)[_0x8b79('0x2e')](_0x2688b4);};}exports[_0x8b79('0x2f')]=function(_0x414abd,_0x58eb6e){var _0x58ce15={},_0x459500={},_0x541665={'count':0x0,'rows':[]};var _0x5bec69=_[_0x8b79('0x30')](db[_0x8b79('0x31')][_0x8b79('0x32')],function(_0x110361){return{'name':_0x110361[_0x8b79('0x33')],'type':_0x110361['type'][_0x8b79('0x34')]};});_0x459500[_0x8b79('0x35')]=_[_0x8b79('0x30')](_0x5bec69,_0x8b79('0x2d'));_0x459500[_0x8b79('0x36')]=_['keys'](_0x414abd['query']);_0x459500['filters']=_[_0x8b79('0x37')](_0x459500[_0x8b79('0x35')],_0x459500[_0x8b79('0x36')]);_0x58ce15[_0x8b79('0x38')]=_[_0x8b79('0x37')](_0x459500['model'],qs[_0x8b79('0x39')](_0x414abd[_0x8b79('0x36')]['fields']));_0x58ce15[_0x8b79('0x38')]=_0x58ce15[_0x8b79('0x38')]['length']?_0x58ce15[_0x8b79('0x38')]:_0x459500['model'];if(!_0x414abd[_0x8b79('0x36')][_0x8b79('0x3a')](_0x8b79('0x3b'))){_0x58ce15[_0x8b79('0x23')]=qs[_0x8b79('0x23')](_0x414abd[_0x8b79('0x36')][_0x8b79('0x23')]);_0x58ce15[_0x8b79('0x20')]=qs['offset'](_0x414abd[_0x8b79('0x36')][_0x8b79('0x20')]);}_0x58ce15[_0x8b79('0x3c')]=qs[_0x8b79('0x3d')](_0x414abd[_0x8b79('0x36')][_0x8b79('0x3d')]);_0x58ce15[_0x8b79('0x3e')]=qs[_0x8b79('0x3f')](_[_0x8b79('0x40')](_0x414abd[_0x8b79('0x36')],_0x459500[_0x8b79('0x3f')]),_0x5bec69);if(_0x414abd[_0x8b79('0x36')][_0x8b79('0x41')]){_0x58ce15[_0x8b79('0x3e')]=_[_0x8b79('0x42')](_0x58ce15[_0x8b79('0x3e')],{'$or':_['map'](_0x5bec69,function(_0x40bcd5){if(_0x40bcd5[_0x8b79('0x43')]!==_0x8b79('0x44')){var _0x1bd943={};_0x1bd943[_0x40bcd5[_0x8b79('0x2d')]]={'$like':'%'+_0x414abd[_0x8b79('0x36')][_0x8b79('0x41')]+'%'};return _0x1bd943;}})});}_0x58ce15=_[_0x8b79('0x42')]({},_0x58ce15,_0x414abd[_0x8b79('0x45')]);var _0x481c7c={'where':_0x58ce15['where']};return db[_0x8b79('0x31')][_0x8b79('0x22')](_0x481c7c)[_0x8b79('0x46')](function(_0x5419f3){_0x541665[_0x8b79('0x22')]=_0x5419f3;if(_0x414abd[_0x8b79('0x36')][_0x8b79('0x47')]){_0x58ce15[_0x8b79('0x48')]=[{'all':!![]}];}return db[_0x8b79('0x31')][_0x8b79('0x49')](_0x58ce15);})[_0x8b79('0x46')](function(_0x5deee3){_0x541665[_0x8b79('0x4a')]=_0x5deee3;return _0x541665;})[_0x8b79('0x46')](respondWithFilteredResult(_0x58eb6e,_0x58ce15))[_0x8b79('0x4b')](handleError(_0x58eb6e,null));};exports[_0x8b79('0x4c')]=function(_0x5d4bad,_0x161f8c){var _0x23c609={'raw':!![],'where':{'id':_0x5d4bad[_0x8b79('0x4d')]['id']}},_0x21ebd4={};_0x21ebd4[_0x8b79('0x35')]=_['keys'](db[_0x8b79('0x31')][_0x8b79('0x32')]);_0x21ebd4[_0x8b79('0x36')]=_['keys'](_0x5d4bad[_0x8b79('0x36')]);_0x21ebd4[_0x8b79('0x3f')]=_[_0x8b79('0x37')](_0x21ebd4['model'],_0x21ebd4[_0x8b79('0x36')]);_0x23c609[_0x8b79('0x38')]=_[_0x8b79('0x37')](_0x21ebd4[_0x8b79('0x35')],qs[_0x8b79('0x39')](_0x5d4bad[_0x8b79('0x36')][_0x8b79('0x39')]));_0x23c609['attributes']=_0x23c609[_0x8b79('0x38')][_0x8b79('0x4e')]?_0x23c609[_0x8b79('0x38')]:_0x21ebd4[_0x8b79('0x35')];if(_0x5d4bad[_0x8b79('0x36')]['includeAll']){_0x23c609[_0x8b79('0x48')]=[{'all':!![]}];}_0x23c609=_[_0x8b79('0x42')]({},_0x23c609,_0x5d4bad[_0x8b79('0x45')]);return db[_0x8b79('0x31')][_0x8b79('0x4f')](_0x23c609)['then'](handleEntityNotFound(_0x161f8c,null))[_0x8b79('0x46')](respondWithResult(_0x161f8c,null))[_0x8b79('0x4b')](handleError(_0x161f8c,null));};exports[_0x8b79('0x50')]=function(_0x55472f,_0x3ce74e){return db[_0x8b79('0x31')][_0x8b79('0x50')](_0x55472f[_0x8b79('0x51')],{})['then'](respondWithResult(_0x3ce74e,0xc9))['catch'](handleError(_0x3ce74e,null));};exports[_0x8b79('0x28')]=function(_0x1b2ec0,_0x21def){if(_0x1b2ec0[_0x8b79('0x51')]['id']){delete _0x1b2ec0['body']['id'];}return db[_0x8b79('0x31')][_0x8b79('0x4f')]({'where':{'id':_0x1b2ec0[_0x8b79('0x4d')]['id']}})[_0x8b79('0x46')](handleEntityNotFound(_0x21def,null))['then'](saveUpdates(_0x1b2ec0[_0x8b79('0x51')],null))[_0x8b79('0x46')](respondWithResult(_0x21def,null))[_0x8b79('0x4b')](handleError(_0x21def,null));};exports['destroy']=function(_0x2cdc05,_0x3ce29e){return db[_0x8b79('0x31')][_0x8b79('0x4f')]({'where':{'id':_0x2cdc05[_0x8b79('0x4d')]['id']}})[_0x8b79('0x46')](handleEntityNotFound(_0x3ce29e,null))['then'](removeEntity(_0x3ce29e,null))[_0x8b79('0x4b')](handleError(_0x3ce29e,null));};exports['describe']=function(_0x46bfef,_0x278939){return db[_0x8b79('0x31')][_0x8b79('0x52')]()['then'](respondWithResult(_0x278939,null))[_0x8b79('0x4b')](handleError(_0x278939,null));};exports[_0x8b79('0x53')]=function(_0x21df45,_0x3e35e6,_0x1dc777){return db[_0x8b79('0x54')][_0x8b79('0x22')]({'where':{'ChatGroupId':_0x21df45['params']['id'],'ToId':_0x21df45[_0x8b79('0x55')]['id'],'read':![]}})['then'](function(_0x6031ec){return{'id':_[_0x8b79('0x56')](_0x21df45[_0x8b79('0x4d')]['id']),'count':_0x6031ec};})[_0x8b79('0x46')](respondWithResult(_0x3e35e6,null))[_0x8b79('0x4b')](handleError(_0x3e35e6,null));};exports['addMembers']=function(_0x21a9ef,_0x493b35,_0x13b774){return db[_0x8b79('0x31')][_0x8b79('0x4f')]({'where':{'id':_0x21a9ef[_0x8b79('0x4d')]['id']}})[_0x8b79('0x46')](handleEntityNotFound(_0x493b35,null))[_0x8b79('0x46')](function(_0x204710){if(_0x204710){return _0x204710['addMembers'](_0x21a9ef[_0x8b79('0x51')][_0x8b79('0x57')],_[_0x8b79('0x58')](_0x21a9ef['body'],['ids','id'])||{});}})[_0x8b79('0x46')](respondWithResult(_0x493b35,null))['catch'](handleError(_0x493b35,null));};exports[_0x8b79('0x59')]=function(_0x5d493e,_0x515319,_0x3d2c8a){var _0x4cc60b={};var _0x503d3f={};var _0xb07e5a;var _0x33a469;return db[_0x8b79('0x31')][_0x8b79('0x5a')]({'where':{'id':_0x5d493e[_0x8b79('0x4d')]['id']}})[_0x8b79('0x46')](handleEntityNotFound(_0x515319,null))[_0x8b79('0x46')](function(_0x390bda){if(_0x390bda){_0xb07e5a=_0x390bda;_0x503d3f['model']=_[_0x8b79('0x5b')](db[_0x8b79('0x5c')][_0x8b79('0x32')]);_0x503d3f[_0x8b79('0x36')]=_[_0x8b79('0x5b')](_0x5d493e['query']);_0x503d3f['filters']=_[_0x8b79('0x37')](_0x503d3f[_0x8b79('0x35')],_0x503d3f[_0x8b79('0x36')]);_0x4cc60b[_0x8b79('0x38')]=_[_0x8b79('0x37')](_0x503d3f['model'],qs['fields'](_0x5d493e[_0x8b79('0x36')][_0x8b79('0x39')]));_0x4cc60b[_0x8b79('0x38')]=_0x4cc60b[_0x8b79('0x38')][_0x8b79('0x4e')]?_0x4cc60b[_0x8b79('0x38')]:_0x503d3f[_0x8b79('0x35')];_0x4cc60b['order']=qs[_0x8b79('0x3d')](_0x5d493e[_0x8b79('0x36')]['sort']);_0x4cc60b[_0x8b79('0x3e')]=qs[_0x8b79('0x3f')](_[_0x8b79('0x40')](_0x5d493e['query'],_0x503d3f[_0x8b79('0x3f')]));if(_0x5d493e[_0x8b79('0x36')][_0x8b79('0x41')]){_0x4cc60b[_0x8b79('0x3e')]=_[_0x8b79('0x42')](_0x4cc60b[_0x8b79('0x3e')],{'$or':_[_0x8b79('0x30')](_0x4cc60b[_0x8b79('0x38')],function(_0x12f65b){var _0x377ae1={};_0x377ae1[_0x12f65b]={'$like':'%'+_0x5d493e['query']['filter']+'%'};return _0x377ae1;})});}_0x4cc60b=_[_0x8b79('0x42')]({},_0x4cc60b,_0x5d493e[_0x8b79('0x45')]);return _0xb07e5a[_0x8b79('0x59')](_0x4cc60b);}})[_0x8b79('0x46')](function(_0x1c7a85){if(_0x1c7a85){_0x33a469=_0x1c7a85['length'];if(!_0x5d493e[_0x8b79('0x36')][_0x8b79('0x3a')](_0x8b79('0x3b'))){_0x4cc60b[_0x8b79('0x23')]=qs[_0x8b79('0x23')](_0x5d493e[_0x8b79('0x36')]['limit']);_0x4cc60b[_0x8b79('0x20')]=qs[_0x8b79('0x20')](_0x5d493e['query']['offset']);}return _0xb07e5a[_0x8b79('0x59')](_0x4cc60b);}})[_0x8b79('0x46')](function(_0x5775f1){if(_0x5775f1){return _0x5775f1?{'count':_0x33a469,'rows':_0x5775f1}:null;}})[_0x8b79('0x46')](respondWithResult(_0x515319,null))[_0x8b79('0x4b')](handleError(_0x515319,null));};exports[_0x8b79('0x5d')]=function(_0x4be273,_0xde1e74,_0x542c01){return db[_0x8b79('0x31')][_0x8b79('0x4f')]({'where':{'id':_0x4be273[_0x8b79('0x4d')]['id']}})['then'](handleEntityNotFound(_0xde1e74,null))[_0x8b79('0x46')](function(_0xbcb892){if(_0xbcb892){return _0xbcb892[_0x8b79('0x5d')](_0x4be273[_0x8b79('0x36')][_0x8b79('0x57')]);}})['then'](respondWithStatusCode(_0xde1e74,null))[_0x8b79('0x4b')](handleError(_0xde1e74,null));};exports[_0x8b79('0x5e')]=function(_0x3d730b,_0x2d51ce,_0x1742af){if(_0x3d730b[_0x8b79('0x51')]['id']){delete _0x3d730b['body']['id'];}return db[_0x8b79('0x31')][_0x8b79('0x4f')]({'where':{'id':_0x3d730b[_0x8b79('0x4d')]['id']}})[_0x8b79('0x46')](handleEntityNotFound(_0x2d51ce,null))[_0x8b79('0x46')](function(_0x4ee762){if(_0x4ee762){_0x3d730b[_0x8b79('0x51')]['ChatGroupId']=_0x4ee762['id'];return db[_0x8b79('0x54')][_0x8b79('0x50')](_0x3d730b[_0x8b79('0x51')]);}})[_0x8b79('0x46')](respondWithResult(_0x2d51ce,null))[_0x8b79('0x4b')](handleError(_0x2d51ce,null));};exports[_0x8b79('0x5f')]=function(_0x1035d1,_0x26e4e1,_0x46930c){var _0x56507c={};var _0x8ee065={};var _0x5b53b5;var _0x4158ce;return db['ChatGroup'][_0x8b79('0x5a')]({'where':{'id':_0x1035d1[_0x8b79('0x4d')]['id']}})[_0x8b79('0x46')](handleEntityNotFound(_0x26e4e1,null))[_0x8b79('0x46')](function(_0x261779){if(_0x261779){_0x5b53b5=_0x261779;_0x8ee065[_0x8b79('0x35')]=_[_0x8b79('0x5b')](db['ChatInternalMessage'][_0x8b79('0x32')]);_0x8ee065[_0x8b79('0x36')]=_['keys'](_0x1035d1['query']);_0x8ee065['filters']=_[_0x8b79('0x37')](_0x8ee065['model'],_0x8ee065[_0x8b79('0x36')]);_0x56507c[_0x8b79('0x38')]=_[_0x8b79('0x37')](_0x8ee065[_0x8b79('0x35')],qs[_0x8b79('0x39')](_0x1035d1[_0x8b79('0x36')][_0x8b79('0x39')]));_0x56507c['attributes']=_0x56507c[_0x8b79('0x38')][_0x8b79('0x4e')]?_0x56507c[_0x8b79('0x38')]:_0x8ee065[_0x8b79('0x35')];_0x56507c[_0x8b79('0x3c')]=qs['sort'](_0x1035d1['query'][_0x8b79('0x3d')]);_0x56507c['where']=qs[_0x8b79('0x3f')](_['pick'](_0x1035d1['query'],_0x8ee065['filters']));if(_0x1035d1[_0x8b79('0x36')]['filter']){_0x56507c[_0x8b79('0x3e')]=_[_0x8b79('0x42')](_0x56507c[_0x8b79('0x3e')],{'$or':_['map'](_0x56507c[_0x8b79('0x38')],function(_0x4adbd7){var _0x5e4fc5={};_0x5e4fc5[_0x4adbd7]={'$like':'%'+_0x1035d1[_0x8b79('0x36')][_0x8b79('0x41')]+'%'};return _0x5e4fc5;})});}if(_0x1035d1[_0x8b79('0x36')][_0x8b79('0x60')]){var _0x520603=_0x1035d1[_0x8b79('0x36')][_0x8b79('0x60')]['split'](',');var _0x2e6764={};_0x2e6764[_0x520603[0x0]]={'$gte':moment(_0x520603[0x1])[_0x8b79('0x61')]('YYYY-MM-DD\x20HH:mm:ss')};_0x56507c[_0x8b79('0x3e')]=_[_0x8b79('0x42')](_0x56507c[_0x8b79('0x3e')],_0x2e6764);}_0x56507c=_[_0x8b79('0x42')]({},_0x56507c,_0x1035d1[_0x8b79('0x45')]);return _0x5b53b5[_0x8b79('0x5f')](_0x56507c);}})['then'](function(_0x257c9d){if(_0x257c9d){_0x4158ce=_0x257c9d[_0x8b79('0x4e')];if(!_0x1035d1[_0x8b79('0x36')][_0x8b79('0x3a')](_0x8b79('0x3b'))){_0x56507c[_0x8b79('0x23')]=qs[_0x8b79('0x23')](_0x1035d1[_0x8b79('0x36')][_0x8b79('0x23')]);_0x56507c[_0x8b79('0x20')]=qs['offset'](_0x1035d1[_0x8b79('0x36')][_0x8b79('0x20')]);}return _0x5b53b5['getMessages'](_0x56507c);}})[_0x8b79('0x46')](function(_0x3f3b09){if(_0x3f3b09){return _0x3f3b09?{'count':_0x4158ce,'rows':_0x3f3b09}:null;}})[_0x8b79('0x46')](respondWithResult(_0x26e4e1,null))[_0x8b79('0x4b')](handleError(_0x26e4e1,null));};
\ No newline at end of file
+var _0xd9a2=['rawAttributes','intersection','include','find','create','body','params','destroy','describe','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','pick','removeMembers','addMessage','ChatGroupId','ChatInternalMessage','getMessages','order','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack','name','send','map','ChatGroup','fieldName','type','model','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','sort','filter','merge','where','VIRTUAL','options','then','includeAll','findAll','rows','catch','show'];(function(_0x928b87,_0x53480a){var _0x1e7638=function(_0x1e2184){while(--_0x1e2184){_0x928b87['push'](_0x928b87['shift']());}};_0x1e7638(++_0x53480a);}(_0xd9a2,0xe3));var _0x2d9a=function(_0x4eafc4,_0x17672d){_0x4eafc4=_0x4eafc4-0x0;var _0x52ee00=_0xd9a2[_0x4eafc4];return _0x52ee00;};'use strict';var emlformat=require(_0x2d9a('0x0'));var rimraf=require(_0x2d9a('0x1'));var zipdir=require(_0x2d9a('0x2'));var jsonpatch=require(_0x2d9a('0x3'));var rp=require(_0x2d9a('0x4'));var moment=require(_0x2d9a('0x5'));var BPromise=require(_0x2d9a('0x6'));var Mustache=require(_0x2d9a('0x7'));var util=require('util');var path=require(_0x2d9a('0x8'));var sox=require(_0x2d9a('0x9'));var csv=require('to-csv');var ejs=require(_0x2d9a('0xa'));var fs=require('fs');var fs_extra=require(_0x2d9a('0xb'));var _=require(_0x2d9a('0xc'));var squel=require(_0x2d9a('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2d9a('0xe'));var Redis=require(_0x2d9a('0xf'));var authService=require(_0x2d9a('0x10'));var qs=require(_0x2d9a('0x11'));var as=require(_0x2d9a('0x12'));var hardwareService=require(_0x2d9a('0x13'));var logger=require(_0x2d9a('0x14'))(_0x2d9a('0x15'));var utils=require(_0x2d9a('0x16'));var config=require(_0x2d9a('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x2d9a('0x18')](config[_0x2d9a('0x19')],{'host':_0x2d9a('0x1a'),'port':0x18eb});var socket=require(_0x2d9a('0x1b'))(new Redis(config[_0x2d9a('0x19')]));require(_0x2d9a('0x1c'))[_0x2d9a('0x1d')](socket);function respondWithStatusCode(_0x1ee042,_0x36efc2){_0x36efc2=_0x36efc2||0xcc;return function(_0x52a806){if(_0x52a806){return _0x1ee042[_0x2d9a('0x1e')](_0x36efc2);}return _0x1ee042['status'](_0x36efc2)[_0x2d9a('0x1f')]();};}function respondWithResult(_0x24e83c,_0x457bd3){_0x457bd3=_0x457bd3||0xc8;return function(_0x2605b9){if(_0x2605b9){return _0x24e83c[_0x2d9a('0x20')](_0x457bd3)[_0x2d9a('0x21')](_0x2605b9);}};}function respondWithFilteredResult(_0x5f41aa,_0x4ed5fe){return function(_0x434479){if(_0x434479){var _0x907cf5=typeof _0x4ed5fe[_0x2d9a('0x22')]===_0x2d9a('0x23')&&typeof _0x4ed5fe[_0x2d9a('0x24')]==='undefined';var _0x3ff554=_0x434479[_0x2d9a('0x25')];var _0x9937ee=_0x907cf5?0x0:_0x4ed5fe[_0x2d9a('0x22')];var _0xe452c9=_0x907cf5?_0x434479[_0x2d9a('0x25')]:_0x4ed5fe[_0x2d9a('0x22')]+_0x4ed5fe[_0x2d9a('0x24')];var _0x5886ff;if(_0xe452c9>=_0x3ff554){_0xe452c9=_0x3ff554;_0x5886ff=0xc8;}else{_0x5886ff=0xce;}_0x5f41aa[_0x2d9a('0x20')](_0x5886ff);return _0x5f41aa[_0x2d9a('0x26')](_0x2d9a('0x27'),_0x9937ee+'-'+_0xe452c9+'/'+_0x3ff554)[_0x2d9a('0x21')](_0x434479);}return null;};}function patchUpdates(_0x1e28fc){return function(_0x422598){try{jsonpatch[_0x2d9a('0x28')](_0x422598,_0x1e28fc,!![]);}catch(_0x4befd2){return BPromise[_0x2d9a('0x29')](_0x4befd2);}return _0x422598[_0x2d9a('0x2a')]();};}function saveUpdates(_0x2c68a6,_0x196d60){return function(_0x1aed37){if(_0x1aed37){return _0x1aed37[_0x2d9a('0x2b')](_0x2c68a6)['then'](function(_0x10b221){return _0x10b221;});}return null;};}function removeEntity(_0x3b46cd,_0x302cbd){return function(_0x55346b){if(_0x55346b){return _0x55346b['destroy']()['then'](function(){_0x3b46cd[_0x2d9a('0x20')](0xcc)[_0x2d9a('0x1f')]();});}};}function handleEntityNotFound(_0x3eae1d,_0x1b6dcd){return function(_0x5288c6){if(!_0x5288c6){_0x3eae1d[_0x2d9a('0x1e')](0x194);}return _0x5288c6;};}function handleError(_0x1464d0,_0x5214a4){_0x5214a4=_0x5214a4||0x1f4;return function(_0x12b5f9){logger[_0x2d9a('0x2c')](_0x12b5f9[_0x2d9a('0x2d')]);if(_0x12b5f9[_0x2d9a('0x2e')]){delete _0x12b5f9['name'];}_0x1464d0[_0x2d9a('0x20')](_0x5214a4)[_0x2d9a('0x2f')](_0x12b5f9);};}exports['index']=function(_0x35a088,_0x1ca864){var _0x4dfca6={},_0x3bd35c={},_0x31d6ae={'count':0x0,'rows':[]};var _0x2ae865=_[_0x2d9a('0x30')](db[_0x2d9a('0x31')]['rawAttributes'],function(_0x4c0bd2){return{'name':_0x4c0bd2[_0x2d9a('0x32')],'type':_0x4c0bd2[_0x2d9a('0x33')]['key']};});_0x3bd35c[_0x2d9a('0x34')]=_[_0x2d9a('0x30')](_0x2ae865,_0x2d9a('0x2e'));_0x3bd35c[_0x2d9a('0x35')]=_[_0x2d9a('0x36')](_0x35a088[_0x2d9a('0x35')]);_0x3bd35c[_0x2d9a('0x37')]=_['intersection'](_0x3bd35c[_0x2d9a('0x34')],_0x3bd35c[_0x2d9a('0x35')]);_0x4dfca6['attributes']=_['intersection'](_0x3bd35c[_0x2d9a('0x34')],qs[_0x2d9a('0x38')](_0x35a088['query'][_0x2d9a('0x38')]));_0x4dfca6[_0x2d9a('0x39')]=_0x4dfca6[_0x2d9a('0x39')][_0x2d9a('0x3a')]?_0x4dfca6[_0x2d9a('0x39')]:_0x3bd35c[_0x2d9a('0x34')];if(!_0x35a088[_0x2d9a('0x35')][_0x2d9a('0x3b')](_0x2d9a('0x3c'))){_0x4dfca6[_0x2d9a('0x24')]=qs['limit'](_0x35a088[_0x2d9a('0x35')]['limit']);_0x4dfca6[_0x2d9a('0x22')]=qs[_0x2d9a('0x22')](_0x35a088[_0x2d9a('0x35')]['offset']);}_0x4dfca6['order']=qs[_0x2d9a('0x3d')](_0x35a088[_0x2d9a('0x35')]['sort']);_0x4dfca6['where']=qs[_0x2d9a('0x37')](_['pick'](_0x35a088[_0x2d9a('0x35')],_0x3bd35c['filters']),_0x2ae865);if(_0x35a088['query'][_0x2d9a('0x3e')]){_0x4dfca6['where']=_[_0x2d9a('0x3f')](_0x4dfca6[_0x2d9a('0x40')],{'$or':_[_0x2d9a('0x30')](_0x2ae865,function(_0x5259de){if(_0x5259de[_0x2d9a('0x33')]!==_0x2d9a('0x41')){var _0x5108c6={};_0x5108c6[_0x5259de[_0x2d9a('0x2e')]]={'$like':'%'+_0x35a088['query'][_0x2d9a('0x3e')]+'%'};return _0x5108c6;}})});}_0x4dfca6=_['merge']({},_0x4dfca6,_0x35a088[_0x2d9a('0x42')]);var _0x18993e={'where':_0x4dfca6[_0x2d9a('0x40')]};return db[_0x2d9a('0x31')][_0x2d9a('0x25')](_0x18993e)[_0x2d9a('0x43')](function(_0x2ed5b2){_0x31d6ae[_0x2d9a('0x25')]=_0x2ed5b2;if(_0x35a088['query'][_0x2d9a('0x44')]){_0x4dfca6['include']=[{'all':!![]}];}return db[_0x2d9a('0x31')][_0x2d9a('0x45')](_0x4dfca6);})[_0x2d9a('0x43')](function(_0x24db61){_0x31d6ae[_0x2d9a('0x46')]=_0x24db61;return _0x31d6ae;})[_0x2d9a('0x43')](respondWithFilteredResult(_0x1ca864,_0x4dfca6))[_0x2d9a('0x47')](handleError(_0x1ca864,null));};exports[_0x2d9a('0x48')]=function(_0x1d3cb9,_0x565b22){var _0x328a63={'raw':!![],'where':{'id':_0x1d3cb9['params']['id']}},_0x476697={};_0x476697[_0x2d9a('0x34')]=_['keys'](db[_0x2d9a('0x31')][_0x2d9a('0x49')]);_0x476697[_0x2d9a('0x35')]=_[_0x2d9a('0x36')](_0x1d3cb9[_0x2d9a('0x35')]);_0x476697[_0x2d9a('0x37')]=_[_0x2d9a('0x4a')](_0x476697['model'],_0x476697['query']);_0x328a63[_0x2d9a('0x39')]=_['intersection'](_0x476697[_0x2d9a('0x34')],qs[_0x2d9a('0x38')](_0x1d3cb9[_0x2d9a('0x35')][_0x2d9a('0x38')]));_0x328a63['attributes']=_0x328a63['attributes'][_0x2d9a('0x3a')]?_0x328a63[_0x2d9a('0x39')]:_0x476697[_0x2d9a('0x34')];if(_0x1d3cb9[_0x2d9a('0x35')][_0x2d9a('0x44')]){_0x328a63[_0x2d9a('0x4b')]=[{'all':!![]}];}_0x328a63=_[_0x2d9a('0x3f')]({},_0x328a63,_0x1d3cb9['options']);return db[_0x2d9a('0x31')][_0x2d9a('0x4c')](_0x328a63)[_0x2d9a('0x43')](handleEntityNotFound(_0x565b22,null))[_0x2d9a('0x43')](respondWithResult(_0x565b22,null))[_0x2d9a('0x47')](handleError(_0x565b22,null));};exports[_0x2d9a('0x4d')]=function(_0xf1656e,_0x5a3b9d){return db[_0x2d9a('0x31')][_0x2d9a('0x4d')](_0xf1656e[_0x2d9a('0x4e')],{})[_0x2d9a('0x43')](respondWithResult(_0x5a3b9d,0xc9))[_0x2d9a('0x47')](handleError(_0x5a3b9d,null));};exports[_0x2d9a('0x2b')]=function(_0x4cbfa0,_0x3fe239){if(_0x4cbfa0[_0x2d9a('0x4e')]['id']){delete _0x4cbfa0[_0x2d9a('0x4e')]['id'];}return db[_0x2d9a('0x31')][_0x2d9a('0x4c')]({'where':{'id':_0x4cbfa0[_0x2d9a('0x4f')]['id']}})[_0x2d9a('0x43')](handleEntityNotFound(_0x3fe239,null))[_0x2d9a('0x43')](saveUpdates(_0x4cbfa0[_0x2d9a('0x4e')],null))[_0x2d9a('0x43')](respondWithResult(_0x3fe239,null))[_0x2d9a('0x47')](handleError(_0x3fe239,null));};exports[_0x2d9a('0x50')]=function(_0x2e77a7,_0x11024a){return db[_0x2d9a('0x31')][_0x2d9a('0x4c')]({'where':{'id':_0x2e77a7[_0x2d9a('0x4f')]['id']}})['then'](handleEntityNotFound(_0x11024a,null))[_0x2d9a('0x43')](removeEntity(_0x11024a,null))[_0x2d9a('0x47')](handleError(_0x11024a,null));};exports[_0x2d9a('0x51')]=function(_0x47e189,_0x5d9eea){return db[_0x2d9a('0x31')][_0x2d9a('0x51')]()[_0x2d9a('0x43')](respondWithResult(_0x5d9eea,null))['catch'](handleError(_0x5d9eea,null));};exports['getUnread']=function(_0x3c90b4,_0x133916,_0x11c3f8){return db['ChatInternalMessage'][_0x2d9a('0x25')]({'where':{'ChatGroupId':_0x3c90b4[_0x2d9a('0x4f')]['id'],'ToId':_0x3c90b4[_0x2d9a('0x52')]['id'],'read':![]}})[_0x2d9a('0x43')](function(_0x2a42e5){return{'id':_[_0x2d9a('0x53')](_0x3c90b4[_0x2d9a('0x4f')]['id']),'count':_0x2a42e5};})['then'](respondWithResult(_0x133916,null))[_0x2d9a('0x47')](handleError(_0x133916,null));};exports['addMembers']=function(_0x457191,_0x14b2c4,_0x39a19d){return db[_0x2d9a('0x31')][_0x2d9a('0x4c')]({'where':{'id':_0x457191[_0x2d9a('0x4f')]['id']}})[_0x2d9a('0x43')](handleEntityNotFound(_0x14b2c4,null))[_0x2d9a('0x43')](function(_0x5db16f){if(_0x5db16f){return _0x5db16f[_0x2d9a('0x54')](_0x457191[_0x2d9a('0x4e')][_0x2d9a('0x55')],_[_0x2d9a('0x56')](_0x457191[_0x2d9a('0x4e')],[_0x2d9a('0x55'),'id'])||{});}})[_0x2d9a('0x43')](respondWithResult(_0x14b2c4,null))[_0x2d9a('0x47')](handleError(_0x14b2c4,null));};exports[_0x2d9a('0x57')]=function(_0x450cc9,_0x4a6c08,_0x23206e){var _0xc69104={};var _0x7f48f={};var _0x3fc9da;var _0x2b8a4a;return db[_0x2d9a('0x31')][_0x2d9a('0x58')]({'where':{'id':_0x450cc9[_0x2d9a('0x4f')]['id']}})[_0x2d9a('0x43')](handleEntityNotFound(_0x4a6c08,null))['then'](function(_0x26ab9e){if(_0x26ab9e){_0x3fc9da=_0x26ab9e;_0x7f48f[_0x2d9a('0x34')]=_['keys'](db[_0x2d9a('0x59')][_0x2d9a('0x49')]);_0x7f48f[_0x2d9a('0x35')]=_[_0x2d9a('0x36')](_0x450cc9[_0x2d9a('0x35')]);_0x7f48f[_0x2d9a('0x37')]=_[_0x2d9a('0x4a')](_0x7f48f[_0x2d9a('0x34')],_0x7f48f[_0x2d9a('0x35')]);_0xc69104['attributes']=_['intersection'](_0x7f48f[_0x2d9a('0x34')],qs['fields'](_0x450cc9[_0x2d9a('0x35')]['fields']));_0xc69104[_0x2d9a('0x39')]=_0xc69104[_0x2d9a('0x39')][_0x2d9a('0x3a')]?_0xc69104['attributes']:_0x7f48f['model'];_0xc69104['order']=qs[_0x2d9a('0x3d')](_0x450cc9['query']['sort']);_0xc69104[_0x2d9a('0x40')]=qs[_0x2d9a('0x37')](_[_0x2d9a('0x5a')](_0x450cc9[_0x2d9a('0x35')],_0x7f48f['filters']));if(_0x450cc9[_0x2d9a('0x35')][_0x2d9a('0x3e')]){_0xc69104[_0x2d9a('0x40')]=_[_0x2d9a('0x3f')](_0xc69104[_0x2d9a('0x40')],{'$or':_[_0x2d9a('0x30')](_0xc69104['attributes'],function(_0x2dff97){var _0x35cb6e={};_0x35cb6e[_0x2dff97]={'$like':'%'+_0x450cc9['query'][_0x2d9a('0x3e')]+'%'};return _0x35cb6e;})});}_0xc69104=_[_0x2d9a('0x3f')]({},_0xc69104,_0x450cc9[_0x2d9a('0x42')]);return _0x3fc9da['getMembers'](_0xc69104);}})['then'](function(_0x51389c){if(_0x51389c){_0x2b8a4a=_0x51389c[_0x2d9a('0x3a')];if(!_0x450cc9[_0x2d9a('0x35')]['hasOwnProperty'](_0x2d9a('0x3c'))){_0xc69104[_0x2d9a('0x24')]=qs[_0x2d9a('0x24')](_0x450cc9[_0x2d9a('0x35')][_0x2d9a('0x24')]);_0xc69104[_0x2d9a('0x22')]=qs[_0x2d9a('0x22')](_0x450cc9[_0x2d9a('0x35')][_0x2d9a('0x22')]);}return _0x3fc9da[_0x2d9a('0x57')](_0xc69104);}})[_0x2d9a('0x43')](function(_0x31946e){if(_0x31946e){return _0x31946e?{'count':_0x2b8a4a,'rows':_0x31946e}:null;}})[_0x2d9a('0x43')](respondWithResult(_0x4a6c08,null))[_0x2d9a('0x47')](handleError(_0x4a6c08,null));};exports['removeMembers']=function(_0x4d1b3f,_0x40b3b8,_0x2fb4a5){return db[_0x2d9a('0x31')]['find']({'where':{'id':_0x4d1b3f[_0x2d9a('0x4f')]['id']}})[_0x2d9a('0x43')](handleEntityNotFound(_0x40b3b8,null))[_0x2d9a('0x43')](function(_0x2d3184){if(_0x2d3184){return _0x2d3184[_0x2d9a('0x5b')](_0x4d1b3f['query'][_0x2d9a('0x55')]);}})[_0x2d9a('0x43')](respondWithStatusCode(_0x40b3b8,null))[_0x2d9a('0x47')](handleError(_0x40b3b8,null));};exports[_0x2d9a('0x5c')]=function(_0x5b221b,_0xfc6a6f,_0x442e1c){if(_0x5b221b['body']['id']){delete _0x5b221b[_0x2d9a('0x4e')]['id'];}return db[_0x2d9a('0x31')]['find']({'where':{'id':_0x5b221b[_0x2d9a('0x4f')]['id']}})[_0x2d9a('0x43')](handleEntityNotFound(_0xfc6a6f,null))[_0x2d9a('0x43')](function(_0x3c5293){if(_0x3c5293){_0x5b221b[_0x2d9a('0x4e')][_0x2d9a('0x5d')]=_0x3c5293['id'];return db[_0x2d9a('0x5e')][_0x2d9a('0x4d')](_0x5b221b[_0x2d9a('0x4e')]);}})['then'](respondWithResult(_0xfc6a6f,null))[_0x2d9a('0x47')](handleError(_0xfc6a6f,null));};exports[_0x2d9a('0x5f')]=function(_0x5261b1,_0x380349,_0x491033){var _0x1018c9={};var _0x54f8d0={};var _0x183250;var _0x4f52d5;return db[_0x2d9a('0x31')][_0x2d9a('0x58')]({'where':{'id':_0x5261b1['params']['id']}})[_0x2d9a('0x43')](handleEntityNotFound(_0x380349,null))[_0x2d9a('0x43')](function(_0x2ed4b2){if(_0x2ed4b2){_0x183250=_0x2ed4b2;_0x54f8d0['model']=_[_0x2d9a('0x36')](db['ChatInternalMessage'][_0x2d9a('0x49')]);_0x54f8d0[_0x2d9a('0x35')]=_[_0x2d9a('0x36')](_0x5261b1['query']);_0x54f8d0[_0x2d9a('0x37')]=_[_0x2d9a('0x4a')](_0x54f8d0[_0x2d9a('0x34')],_0x54f8d0[_0x2d9a('0x35')]);_0x1018c9[_0x2d9a('0x39')]=_[_0x2d9a('0x4a')](_0x54f8d0[_0x2d9a('0x34')],qs['fields'](_0x5261b1[_0x2d9a('0x35')]['fields']));_0x1018c9[_0x2d9a('0x39')]=_0x1018c9[_0x2d9a('0x39')][_0x2d9a('0x3a')]?_0x1018c9[_0x2d9a('0x39')]:_0x54f8d0['model'];_0x1018c9[_0x2d9a('0x60')]=qs[_0x2d9a('0x3d')](_0x5261b1[_0x2d9a('0x35')][_0x2d9a('0x3d')]);_0x1018c9[_0x2d9a('0x40')]=qs[_0x2d9a('0x37')](_[_0x2d9a('0x5a')](_0x5261b1[_0x2d9a('0x35')],_0x54f8d0[_0x2d9a('0x37')]));if(_0x5261b1[_0x2d9a('0x35')]['filter']){_0x1018c9[_0x2d9a('0x40')]=_[_0x2d9a('0x3f')](_0x1018c9['where'],{'$or':_[_0x2d9a('0x30')](_0x1018c9[_0x2d9a('0x39')],function(_0x2d2915){var _0x3b4f6b={};_0x3b4f6b[_0x2d2915]={'$like':'%'+_0x5261b1['query'][_0x2d9a('0x3e')]+'%'};return _0x3b4f6b;})});}if(_0x5261b1[_0x2d9a('0x35')]['$gte']){var _0x3ddf4e=_0x5261b1[_0x2d9a('0x35')]['$gte'][_0x2d9a('0x61')](',');var _0x2ee9e5={};_0x2ee9e5[_0x3ddf4e[0x0]]={'$gte':moment(_0x3ddf4e[0x1])[_0x2d9a('0x62')](_0x2d9a('0x63'))};_0x1018c9[_0x2d9a('0x40')]=_[_0x2d9a('0x3f')](_0x1018c9[_0x2d9a('0x40')],_0x2ee9e5);}_0x1018c9=_['merge']({},_0x1018c9,_0x5261b1[_0x2d9a('0x42')]);return _0x183250['getMessages'](_0x1018c9);}})[_0x2d9a('0x43')](function(_0x4252c8){if(_0x4252c8){_0x4f52d5=_0x4252c8[_0x2d9a('0x3a')];if(!_0x5261b1[_0x2d9a('0x35')][_0x2d9a('0x3b')]('nolimit')){_0x1018c9[_0x2d9a('0x24')]=qs['limit'](_0x5261b1[_0x2d9a('0x35')][_0x2d9a('0x24')]);_0x1018c9['offset']=qs[_0x2d9a('0x22')](_0x5261b1[_0x2d9a('0x35')][_0x2d9a('0x22')]);}return _0x183250[_0x2d9a('0x5f')](_0x1018c9);}})[_0x2d9a('0x43')](function(_0x270e02){if(_0x270e02){return _0x270e02?{'count':_0x4f52d5,'rows':_0x270e02}:null;}})['then'](respondWithResult(_0x380349,null))[_0x2d9a('0x47')](handleError(_0x380349,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index b4d2699..b1c3d97 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 _0xf23c=['emit','hasOwnProperty','events','../../mysqldb','ChatGroup','setMaxListeners','save','update','remove'];(function(_0x510c60,_0x50247e){var _0x49c4aa=function(_0x3149c7){while(--_0x3149c7){_0x510c60['push'](_0x510c60['shift']());}};_0x49c4aa(++_0x50247e);}(_0xf23c,0x77));var _0xcf23=function(_0x529296,_0x1a6a23){_0x529296=_0x529296-0x0;var _0x1796bf=_0xf23c[_0x529296];return _0x1796bf;};'use strict';var EventEmitter=require(_0xcf23('0x0'));var ChatGroup=require(_0xcf23('0x1'))['db'][_0xcf23('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xcf23('0x3')](0x0);var events={'afterCreate':_0xcf23('0x4'),'afterUpdate':_0xcf23('0x5'),'afterDestroy':_0xcf23('0x6')};function emitEvent(_0x1b327e){return function(_0xa91945,_0x33f3de,_0x224af1){ChatGroupEvents[_0xcf23('0x7')](_0x1b327e+':'+_0xa91945['id'],_0xa91945);ChatGroupEvents[_0xcf23('0x7')](_0x1b327e,_0xa91945);_0x224af1(null);};}for(var e in events){if(events[_0xcf23('0x8')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
+var _0x5370=['ChatGroup','setMaxListeners','save','update','emit','hook','exports','../../mysqldb'];(function(_0xe7d30b,_0x525bf2){var _0x2bf356=function(_0x262321){while(--_0x262321){_0xe7d30b['push'](_0xe7d30b['shift']());}};_0x2bf356(++_0x525bf2);}(_0x5370,0x11f));var _0x0537=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x5370[_0x3947c9];return _0x2e7871;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x0537('0x0'))['db'][_0x0537('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x0537('0x2')](0x0);var events={'afterCreate':_0x0537('0x3'),'afterUpdate':_0x0537('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5b4b37){return function(_0x11a816,_0x49fdcc,_0x1d1758){ChatGroupEvents[_0x0537('0x5')](_0x5b4b37+':'+_0x11a816['id'],_0x11a816);ChatGroupEvents[_0x0537('0x5')](_0x5b4b37,_0x11a816);_0x1d1758(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x0537('0x6')](e,emitEvent(event));}}module[_0x0537('0x7')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 2bafd2e..7d05668 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 _0xad60=['request-promise','path','rimraf','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','util','api','moment','bluebird'];(function(_0xf1d988,_0x341f87){var _0x264fa0=function(_0x37f308){while(--_0x37f308){_0xf1d988['push'](_0xf1d988['shift']());}};_0x264fa0(++_0x341f87);}(_0xad60,0x1a0));var _0x0ad6=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xad60[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var util=require(_0x0ad6('0x0'));var logger=require('../../config/logger')(_0x0ad6('0x1'));var moment=require(_0x0ad6('0x2'));var BPromise=require(_0x0ad6('0x3'));var rp=require(_0x0ad6('0x4'));var fs=require('fs');var path=require(_0x0ad6('0x5'));var rimraf=require(_0x0ad6('0x6'));var config=require('../../config/environment');var attributes=require(_0x0ad6('0x7'));module[_0x0ad6('0x8')]=function(_0x4b0e32,_0x214e01){return _0x4b0e32[_0x0ad6('0x9')](_0x0ad6('0xa'),attributes,{'tableName':_0x0ad6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x97a0=['../../config/logger','api','moment','request-promise','path','./chatGroup.attributes','exports','define','chat_groups','util'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x97a0,0x1df));var _0x097a=function(_0x6cca03,_0x56d2c5){_0x6cca03=_0x6cca03-0x0;var _0xd48afc=_0x97a0[_0x6cca03];return _0xd48afc;};'use strict';var _=require('lodash');var util=require(_0x097a('0x0'));var logger=require(_0x097a('0x1'))(_0x097a('0x2'));var moment=require(_0x097a('0x3'));var BPromise=require('bluebird');var rp=require(_0x097a('0x4'));var fs=require('fs');var path=require(_0x097a('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x097a('0x6'));module[_0x097a('0x7')]=function(_0xce0c3d,_0x2b8608){return _0xce0c3d[_0x097a('0x8')]('ChatGroup',attributes,{'tableName':_0x097a('0x9'),'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 b159606..0b9cd29 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 _0xc923=['redis','defaults','socket.io-emitter','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x1a5f94,_0x19b888){var _0x352348=function(_0x16c899){while(--_0x16c899){_0x1a5f94['push'](_0x1a5f94['shift']());}};_0x352348(++_0x19b888);}(_0xc923,0x1ef));var _0x3c92=function(_0x513e90,_0x186a7c){_0x513e90=_0x513e90-0x0;var _0x5401be=_0xc923[_0x513e90];return _0x5401be;};'use strict';var _=require(_0x3c92('0x0'));var util=require(_0x3c92('0x1'));var moment=require(_0x3c92('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3c92('0x3'))(_0x3c92('0x4'));var config=require(_0x3c92('0x5'));var jayson=require(_0x3c92('0x6'));var client=jayson[_0x3c92('0x7')][_0x3c92('0x8')]({'port':0x232a});config[_0x3c92('0x9')]=_[_0x3c92('0xa')](config[_0x3c92('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x3c92('0xb'))(new Redis(config[_0x3c92('0x9')]));require(_0x3c92('0xc'))[_0x3c92('0xd')](socket);function respondWithRpcPromise(_0x5dcd73,_0x2e1eeb,_0x59300c){return new BPromise(function(_0x31addc,_0x4c3628){return client[_0x3c92('0xe')](_0x5dcd73,_0x59300c)[_0x3c92('0xf')](function(_0x1be3a3){logger[_0x3c92('0x10')](_0x3c92('0x11'),_0x2e1eeb,_0x3c92('0x12'));logger['debug'](_0x3c92('0x13'),_0x2e1eeb,_0x3c92('0x12'),JSON['stringify'](_0x1be3a3));if(_0x1be3a3[_0x3c92('0x14')]){if(_0x1be3a3[_0x3c92('0x14')]['code']===0x1f4){logger['error'](_0x3c92('0x11'),_0x2e1eeb,_0x1be3a3[_0x3c92('0x14')][_0x3c92('0x15')]);return _0x4c3628(_0x1be3a3[_0x3c92('0x14')][_0x3c92('0x15')]);}logger[_0x3c92('0x14')](_0x3c92('0x11'),_0x2e1eeb,_0x1be3a3['error'][_0x3c92('0x15')]);return _0x31addc(_0x1be3a3[_0x3c92('0x14')]['message']);}else{logger[_0x3c92('0x10')](_0x3c92('0x11'),_0x2e1eeb,_0x3c92('0x12'));_0x31addc(_0x1be3a3[_0x3c92('0x16')]['message']);}})[_0x3c92('0x17')](function(_0x6a6264){logger['error'](_0x3c92('0x11'),_0x2e1eeb,_0x6a6264);_0x4c3628(_0x6a6264);});});}
\ No newline at end of file
+var _0x42b0=['error','code','message','result','lodash','util','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s'];(function(_0x2a6d45,_0x3c9321){var _0x295253=function(_0x51d622){while(--_0x51d622){_0x2a6d45['push'](_0x2a6d45['shift']());}};_0x295253(++_0x3c9321);}(_0x42b0,0xbc));var _0x042b=function(_0x42afab,_0x1e14b4){_0x42afab=_0x42afab-0x0;var _0x40f14=_0x42b0[_0x42afab];return _0x40f14;};'use strict';var _=require(_0x042b('0x0'));var util=require(_0x042b('0x1'));var moment=require('moment');var BPromise=require(_0x042b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x042b('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x042b('0x4'))(_0x042b('0x5'));var config=require(_0x042b('0x6'));var jayson=require(_0x042b('0x7'));var client=jayson[_0x042b('0x8')]['http']({'port':0x232a});config['redis']=_[_0x042b('0x9')](config[_0x042b('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x042b('0xa')]));require('./chatGroup.socket')[_0x042b('0xb')](socket);function respondWithRpcPromise(_0x5686b7,_0x3f01e1,_0x2ba4c2){return new BPromise(function(_0x1d2796,_0x25dec5){return client[_0x042b('0xc')](_0x5686b7,_0x2ba4c2)[_0x042b('0xd')](function(_0x1bb764){logger[_0x042b('0xe')](_0x042b('0xf'),_0x3f01e1,_0x042b('0x10'));logger[_0x042b('0x11')](_0x042b('0x12'),_0x3f01e1,_0x042b('0x10'),JSON['stringify'](_0x1bb764));if(_0x1bb764[_0x042b('0x13')]){if(_0x1bb764['error'][_0x042b('0x14')]===0x1f4){logger['error'](_0x042b('0xf'),_0x3f01e1,_0x1bb764[_0x042b('0x13')][_0x042b('0x15')]);return _0x25dec5(_0x1bb764[_0x042b('0x13')][_0x042b('0x15')]);}logger[_0x042b('0x13')]('ChatGroup,\x20%s,\x20%s',_0x3f01e1,_0x1bb764[_0x042b('0x13')][_0x042b('0x15')]);return _0x1d2796(_0x1bb764[_0x042b('0x13')][_0x042b('0x15')]);}else{logger[_0x042b('0xe')]('ChatGroup,\x20%s,\x20%s',_0x3f01e1,_0x042b('0x10'));_0x1d2796(_0x1bb764[_0x042b('0x16')]['message']);}})['catch'](function(_0x25063e){logger[_0x042b('0x13')]('ChatGroup,\x20%s,\x20%s',_0x3f01e1,_0x25063e);_0x25dec5(_0x25063e);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 098b865..9a00f9b 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 _0xb3f8=['./chatGroup.events','save','remove','update','removeListener','register','length','chatGroup:'];(function(_0x540479,_0x340e8e){var _0x532937=function(_0x5e6a3e){while(--_0x5e6a3e){_0x540479['push'](_0x540479['shift']());}};_0x532937(++_0x340e8e);}(_0xb3f8,0xd8));var _0x8b3f=function(_0x1305e3,_0x43a724){_0x1305e3=_0x1305e3-0x0;var _0x1068e9=_0xb3f8[_0x1305e3];return _0x1068e9;};'use strict';var ChatGroupEvents=require(_0x8b3f('0x0'));var events=[_0x8b3f('0x1'),_0x8b3f('0x2'),_0x8b3f('0x3')];function createListener(_0xfa619e,_0x219282){return function(_0x4f19df){_0x219282['emit'](_0xfa619e,_0x4f19df);};}function removeListener(_0x28a818,_0x10855d){return function(){ChatGroupEvents[_0x8b3f('0x4')](_0x28a818,_0x10855d);};}exports[_0x8b3f('0x5')]=function(_0x3f0a75){for(var _0x306214=0x0,_0x218b7a=events[_0x8b3f('0x6')];_0x306214<_0x218b7a;_0x306214++){var _0x7c3f89=events[_0x306214];var _0x3c47d8=createListener(_0x8b3f('0x7')+_0x7c3f89,_0x3f0a75);ChatGroupEvents['on'](_0x7c3f89,_0x3c47d8);}};
\ No newline at end of file
+var _0x069d=['./chatGroup.events','remove','emit','removeListener','register','chatGroup:'];(function(_0x25d2fb,_0x18a774){var _0x1ded53=function(_0x4c0715){while(--_0x4c0715){_0x25d2fb['push'](_0x25d2fb['shift']());}};_0x1ded53(++_0x18a774);}(_0x069d,0x11a));var _0xd069=function(_0x3116fa,_0x63ef5b){_0x3116fa=_0x3116fa-0x0;var _0x568b53=_0x069d[_0x3116fa];return _0x568b53;};'use strict';var ChatGroupEvents=require(_0xd069('0x0'));var events=['save',_0xd069('0x1'),'update'];function createListener(_0x17cee0,_0x17a266){return function(_0x5b2eb9){_0x17a266[_0xd069('0x2')](_0x17cee0,_0x5b2eb9);};}function removeListener(_0x441e2a,_0x4b64b3){return function(){ChatGroupEvents[_0xd069('0x3')](_0x441e2a,_0x4b64b3);};}exports[_0xd069('0x4')]=function(_0x50ee01){for(var _0x2935b6=0x0,_0x349aaf=events['length'];_0x2935b6<_0x349aaf;_0x2935b6++){var _0x12428d=events[_0x2935b6];var _0x1c04de=createListener(_0xd069('0x5')+_0x12428d,_0x50ee01);ChatGroupEvents['on'](_0x12428d,_0x1c04de);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index e278a11..6948b29 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 _0x8322=['getUnread','/:id/members','/:id/messages','getMessages','create','post','addMembers','addMessage','put','update','delete','removeMembers','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','get','isAuthenticated','index','describe','/:id','/:id/unread'];(function(_0x39dd6f,_0x28cfe1){var _0x1d0a8a=function(_0x40b4cd){while(--_0x40b4cd){_0x39dd6f['push'](_0x39dd6f['shift']());}};_0x1d0a8a(++_0x28cfe1);}(_0x8322,0x109));var _0x2832=function(_0x55ff3e,_0x41077f){_0x55ff3e=_0x55ff3e-0x0;var _0x2709eb=_0x8322[_0x55ff3e];return _0x2709eb;};'use strict';var multer=require(_0x2832('0x0'));var util=require(_0x2832('0x1'));var path=require(_0x2832('0x2'));var timeout=require(_0x2832('0x3'));var express=require(_0x2832('0x4'));var router=express[_0x2832('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2832('0x6'));var interaction=require(_0x2832('0x7'));var config=require('../../config/environment');var controller=require(_0x2832('0x8'));router[_0x2832('0x9')]('/',auth[_0x2832('0xa')](),controller[_0x2832('0xb')]);router['get']('/describe',auth[_0x2832('0xa')](),controller[_0x2832('0xc')]);router[_0x2832('0x9')](_0x2832('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x2832('0x9')](_0x2832('0xe'),auth[_0x2832('0xa')](),controller[_0x2832('0xf')]);router['get'](_0x2832('0x10'),auth[_0x2832('0xa')](),controller['getMembers']);router[_0x2832('0x9')](_0x2832('0x11'),auth['isAuthenticated'](),controller[_0x2832('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2832('0x13')]);router[_0x2832('0x14')](_0x2832('0x10'),auth[_0x2832('0xa')](),controller[_0x2832('0x15')]);router[_0x2832('0x14')](_0x2832('0x11'),auth['isAuthenticated'](),controller[_0x2832('0x16')]);router[_0x2832('0x17')](_0x2832('0xd'),auth[_0x2832('0xa')](),controller[_0x2832('0x18')]);router[_0x2832('0x19')](_0x2832('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0x2832('0x19')](_0x2832('0x10'),auth[_0x2832('0xa')](),controller[_0x2832('0x1a')]);module[_0x2832('0x1b')]=router;
\ No newline at end of file
+var _0x05c9=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','put','update','delete','destroy','removeMembers','exports','util','path'];(function(_0x391b19,_0x214efa){var _0x4789ff=function(_0x7fffe5){while(--_0x7fffe5){_0x391b19['push'](_0x391b19['shift']());}};_0x4789ff(++_0x214efa);}(_0x05c9,0x153));var _0x905c=function(_0x3a6da7,_0x1943ff){_0x3a6da7=_0x3a6da7-0x0;var _0x3aa944=_0x05c9[_0x3a6da7];return _0x3aa944;};'use strict';var multer=require('multer');var util=require(_0x905c('0x0'));var path=require(_0x905c('0x1'));var timeout=require(_0x905c('0x2'));var express=require(_0x905c('0x3'));var router=express[_0x905c('0x4')]();var fs_extra=require(_0x905c('0x5'));var auth=require(_0x905c('0x6'));var interaction=require(_0x905c('0x7'));var config=require('../../config/environment');var controller=require(_0x905c('0x8'));router[_0x905c('0x9')]('/',auth[_0x905c('0xa')](),controller[_0x905c('0xb')]);router['get'](_0x905c('0xc'),auth[_0x905c('0xa')](),controller[_0x905c('0xd')]);router[_0x905c('0x9')](_0x905c('0xe'),auth['isAuthenticated'](),controller[_0x905c('0xf')]);router[_0x905c('0x9')](_0x905c('0x10'),auth[_0x905c('0xa')](),controller[_0x905c('0x11')]);router[_0x905c('0x9')](_0x905c('0x12'),auth[_0x905c('0xa')](),controller[_0x905c('0x13')]);router[_0x905c('0x9')](_0x905c('0x14'),auth[_0x905c('0xa')](),controller[_0x905c('0x15')]);router[_0x905c('0x16')]('/',auth[_0x905c('0xa')](),controller[_0x905c('0x17')]);router['post'](_0x905c('0x12'),auth[_0x905c('0xa')](),controller[_0x905c('0x18')]);router[_0x905c('0x16')](_0x905c('0x14'),auth[_0x905c('0xa')](),controller['addMessage']);router[_0x905c('0x19')]('/:id',auth[_0x905c('0xa')](),controller[_0x905c('0x1a')]);router[_0x905c('0x1b')](_0x905c('0xe'),auth[_0x905c('0xa')](),controller[_0x905c('0x1c')]);router[_0x905c('0x1b')]('/:id/members',auth[_0x905c('0xa')](),controller[_0x905c('0x1d')]);module[_0x905c('0x1e')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index b41d884..ce725e3 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 _0x5eb6=['INTEGER','ENUM','star','TEXT','STRING','long','DATE','out','sequelize','exports','BOOLEAN'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5eb6,0x81));var _0x65eb=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x5eb6[_0x199572];return _0x13cfa3;};'use strict';var Sequelize=require(_0x65eb('0x0'));module[_0x65eb('0x1')]={'closed':{'type':Sequelize[_0x65eb('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x65eb('0x3')]},'ratingType':{'type':Sequelize[_0x65eb('0x4')](_0x65eb('0x5'),'thumb'),'defaultValue':_0x65eb('0x5')},'ratingMessage':{'type':Sequelize[_0x65eb('0x6')]},'pathTranscript':{'type':Sequelize[_0x65eb('0x6')]},'mailTranscript':{'type':Sequelize[_0x65eb('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x65eb('0x7')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x65eb('0x7')]},'note':{'type':Sequelize[_0x65eb('0x7')]},'browserName':{'type':Sequelize[_0x65eb('0x7')]},'browserVersion':{'type':Sequelize[_0x65eb('0x7')]},'osName':{'type':Sequelize[_0x65eb('0x7')]},'osVersion':{'type':Sequelize[_0x65eb('0x7')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x65eb('0x7')]},'deviceType':{'type':Sequelize[_0x65eb('0x7')]},'referer':{'type':Sequelize[_0x65eb('0x6')]},'customerIp':{'type':Sequelize[_0x65eb('0x7')]},'formData':{'type':Sequelize[_0x65eb('0x6')](_0x65eb('0x8'))},'read1stAt':{'type':Sequelize[_0x65eb('0x9')]},'lastMsgAt':{'type':Sequelize[_0x65eb('0x9')]},'lastMsgDirection':{'type':Sequelize[_0x65eb('0x4')]('in',_0x65eb('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x65eb('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x65eb('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x65eb('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x65eb('0x3')]}};
\ No newline at end of file
+var _0xa239=['thumb','star','TEXT','STRING','DATE','long','out','sequelize','BOOLEAN','INTEGER','ENUM'];(function(_0x317204,_0x3a8d53){var _0x29bed7=function(_0x29c8a5){while(--_0x29c8a5){_0x317204['push'](_0x317204['shift']());}};_0x29bed7(++_0x3a8d53);}(_0xa239,0x96));var _0x9a23=function(_0x25c476,_0x47ad6d){_0x25c476=_0x25c476-0x0;var _0x4640b4=_0xa239[_0x25c476];return _0x4640b4;};'use strict';var Sequelize=require(_0x9a23('0x0'));module['exports']={'closed':{'type':Sequelize[_0x9a23('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x9a23('0x2')]},'ratingType':{'type':Sequelize[_0x9a23('0x3')]('star',_0x9a23('0x4')),'defaultValue':_0x9a23('0x5')},'ratingMessage':{'type':Sequelize[_0x9a23('0x6')]},'pathTranscript':{'type':Sequelize[_0x9a23('0x6')]},'mailTranscript':{'type':Sequelize[_0x9a23('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x9a23('0x8')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x9a23('0x7')]},'thirdDisposition':{'type':Sequelize[_0x9a23('0x7')]},'note':{'type':Sequelize[_0x9a23('0x7')]},'browserName':{'type':Sequelize[_0x9a23('0x7')]},'browserVersion':{'type':Sequelize[_0x9a23('0x7')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x9a23('0x7')]},'deviceModel':{'type':Sequelize[_0x9a23('0x7')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x9a23('0x6')]},'customerIp':{'type':Sequelize[_0x9a23('0x7')]},'formData':{'type':Sequelize[_0x9a23('0x6')](_0x9a23('0x9'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x9a23('0x8')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x9a23('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x9a23('0x7')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x9a23('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x9a23('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x9a23('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 52640e2..b446c05 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 _0xfd1c=['result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','stack','name','render','merge','body','contact','agent','index','map','rawAttributes','type','key','getOptions','findAll','chat','query','user','show','params','model','keys','ChatInteraction','filters','intersection','attributes','fields','length','includeAll','include','options','create','find','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','vidaooApiKey','fullname','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','parse','metadata','Sequelize','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','ValidationError','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','closed','attachId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','User','ContactId','Messages','UserId','%s%d','System','customer','website_alias','agentAlias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','hasOwnProperty','nolimit','order','where','pick','ChatInteractionId','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','rows','sort','includeAgent','push','setTags','spread','Tag','chatInteractionTags:save','removeTags','unix','toString','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','read','Account','Owner','get','Chat','N.A.','closedAt','browserName','osName','referer','customerIp','tail','existsSync','createReadStream','pipe','createWriteStream','value','renderFile','createPdfFromHTML','err','rimraf','zip-dir','request-promise','moment','bluebird','util','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0x28e32c,_0x33fe75){var _0x17d631=function(_0xc41bb4){while(--_0xc41bb4){_0x28e32c['push'](_0x28e32c['shift']());}};_0x17d631(++_0x33fe75);}(_0xfd1c,0xb4));var _0xcfd1=function(_0x39a04c,_0x2b4002){_0x39a04c=_0x39a04c-0x0;var _0x580cb0=_0xfd1c[_0x39a04c];return _0x580cb0;};'use strict';var rimraf=require(_0xcfd1('0x0'));var zipdir=require(_0xcfd1('0x1'));var rp=require(_0xcfd1('0x2'));var moment=require(_0xcfd1('0x3'));var BPromise=require(_0xcfd1('0x4'));var Mustache=require('mustache');var util=require(_0xcfd1('0x5'));var path=require('path');var ejs=require(_0xcfd1('0x6'));var fs=require('fs');var _=require(_0xcfd1('0x7'));var Redis=require(_0xcfd1('0x8'));var interaction=require(_0xcfd1('0x9'));var qs=require(_0xcfd1('0xa'));var pdf=require(_0xcfd1('0xb'));var logger=require(_0xcfd1('0xc'))('api');var config=require(_0xcfd1('0xd'));var db=require(_0xcfd1('0xe'))['db'];config[_0xcfd1('0xf')]=_[_0xcfd1('0x10')](config[_0xcfd1('0xf')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcfd1('0xf')]));require(_0xcfd1('0x11'))[_0xcfd1('0x12')](socket);var jayson=require(_0xcfd1('0x13'));var client=jayson[_0xcfd1('0x14')][_0xcfd1('0x15')]({'port':0x232b});var client9004=jayson[_0xcfd1('0x14')][_0xcfd1('0x15')]({'port':0x232c});function respondWithRpcPromise(_0x18b57f,_0x2374ff,_0x49bf54,_0x45ca98){return new BPromise(function(_0x26e097,_0x581c5a){var _0x44ab9e=_0x45ca98||client;return _0x44ab9e[_0xcfd1('0x16')](_0x18b57f,_0x49bf54)[_0xcfd1('0x17')](function(_0x265b91){logger[_0xcfd1('0x18')](_0xcfd1('0x19'),_0x2374ff,_0xcfd1('0x1a'));logger[_0xcfd1('0x1b')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x2374ff,_0xcfd1('0x1a'),JSON['stringify'](_0x265b91));if(_0x265b91[_0xcfd1('0x1c')]){if(_0x265b91['error'][_0xcfd1('0x1d')]===0x1f4){logger[_0xcfd1('0x1c')](_0xcfd1('0x19'),_0x2374ff,_0x265b91[_0xcfd1('0x1c')][_0xcfd1('0x1e')]);return _0x581c5a(_0x265b91['error'][_0xcfd1('0x1e')]);}logger[_0xcfd1('0x1c')]('ChatInteraction,\x20%s,\x20%s',_0x2374ff,_0x265b91[_0xcfd1('0x1c')][_0xcfd1('0x1e')]);return _0x26e097(_0x265b91[_0xcfd1('0x1c')][_0xcfd1('0x1e')]);}else{logger['info'](_0xcfd1('0x19'),_0x2374ff,_0xcfd1('0x1a'));_0x26e097(_0x265b91[_0xcfd1('0x1f')]['message']);}})[_0xcfd1('0x20')](function(_0x5df472){logger[_0xcfd1('0x1c')]('ChatInteraction,\x20%s,\x20%s',_0x2374ff,_0x5df472);_0x581c5a(_0x5df472);});});}function respondWithStatusCode(_0x43f734,_0x14738e){_0x14738e=_0x14738e||0xcc;return function(_0xc57912){if(_0xc57912){return _0x43f734[_0xcfd1('0x21')](_0x14738e);}return _0x43f734['status'](_0x14738e)[_0xcfd1('0x22')]();};}function respondWithResult(_0xec2e61,_0x2a8852){_0x2a8852=_0x2a8852||0xc8;return function(_0x4463dc){if(_0x4463dc){return _0xec2e61[_0xcfd1('0x23')](_0x2a8852)[_0xcfd1('0x24')](_0x4463dc);}};}function respondWithFilteredResult(_0x189860,_0xb049d2){return function(_0x1fea49){if(_0x1fea49){var _0x3a43eb=typeof _0xb049d2[_0xcfd1('0x25')]===_0xcfd1('0x26')&&typeof _0xb049d2[_0xcfd1('0x27')]===_0xcfd1('0x26');var _0x2de5c0=_0x1fea49[_0xcfd1('0x28')];var _0x1c0b21=_0x3a43eb?0x0:_0xb049d2[_0xcfd1('0x25')];var _0x159c7d=_0x3a43eb?_0x1fea49[_0xcfd1('0x28')]:_0xb049d2[_0xcfd1('0x25')]+_0xb049d2[_0xcfd1('0x27')];var _0x4964ff;if(_0x159c7d>=_0x2de5c0){_0x159c7d=_0x2de5c0;_0x4964ff=0xc8;}else{_0x4964ff=0xce;}_0x189860[_0xcfd1('0x23')](_0x4964ff);return _0x189860[_0xcfd1('0x29')](_0xcfd1('0x2a'),_0x1c0b21+'-'+_0x159c7d+'/'+_0x2de5c0)[_0xcfd1('0x24')](_0x1fea49);}return null;};}function saveUpdates(_0x154534){return function(_0x45107d){if(_0x45107d){return _0x45107d[_0xcfd1('0x2b')](_0x154534)[_0xcfd1('0x17')](function(_0x355b77){return _0x355b77;});}return null;};}function removeEntity(_0x21dd45){return function(_0x13740){if(_0x13740){return _0x13740[_0xcfd1('0x2c')]()[_0xcfd1('0x17')](function(){_0x21dd45['status'](0xcc)[_0xcfd1('0x22')]();});}};}function handleEntityNotFound(_0x1c6e37){return function(_0x34d7c1){if(!_0x34d7c1){_0x1c6e37['sendStatus'](0x194);}return _0x34d7c1;};}function handleError(_0x3fc990,_0x24a8b8){_0x24a8b8=_0x24a8b8||0x1f4;return function(_0x859981){logger[_0xcfd1('0x1c')](_0x859981[_0xcfd1('0x2d')]);if(_0x859981[_0xcfd1('0x2e')]){delete _0x859981[_0xcfd1('0x2e')];}_0x3fc990[_0xcfd1('0x23')](_0x24a8b8)['send'](_0x859981);};}function getMustacheRender(_0x511344,_0x432122){return Mustache[_0xcfd1('0x2f')](_0x511344,_[_0xcfd1('0x30')](_0x432122[_0xcfd1('0x31')],{'contact':_0x432122[_0xcfd1('0x32')],'message':_0x432122[_0xcfd1('0x1e')],'agent':_0x432122[_0xcfd1('0x33')],'interaction':_0x432122['interaction'],'account':_0x432122['account']}))||'';}exports[_0xcfd1('0x34')]=function(_0x2f4ba1,_0x490898){var _0x28efd4={};var _0x365e74=_[_0xcfd1('0x35')](db['ChatInteraction'][_0xcfd1('0x36')],function(_0x15e7ce){return{'name':_0x15e7ce['fieldName'],'type':_0x15e7ce[_0xcfd1('0x37')][_0xcfd1('0x38')]};});_0x28efd4=qs[_0xcfd1('0x39')](_0x365e74,_0x2f4ba1);return interaction[_0xcfd1('0x3a')](_0xcfd1('0x3b'),_0x2f4ba1[_0xcfd1('0x3c')],_0x2f4ba1[_0xcfd1('0x3d')],_0x28efd4,_0x365e74)[_0xcfd1('0x17')](respondWithFilteredResult(_0x490898,_0x28efd4))['catch'](handleError(_0x490898,null));};exports[_0xcfd1('0x3e')]=function(_0x2c35ae,_0x4508e4){var _0x3c2d00={'raw':![],'where':{'id':_0x2c35ae[_0xcfd1('0x3f')]['id']}},_0x665a3e={};_0x665a3e[_0xcfd1('0x40')]=_[_0xcfd1('0x41')](db[_0xcfd1('0x42')][_0xcfd1('0x36')]);_0x665a3e[_0xcfd1('0x3c')]=_[_0xcfd1('0x41')](_0x2c35ae[_0xcfd1('0x3c')]);_0x665a3e[_0xcfd1('0x43')]=_[_0xcfd1('0x44')](_0x665a3e['model'],_0x665a3e[_0xcfd1('0x3c')]);_0x3c2d00[_0xcfd1('0x45')]=_['intersection'](_0x665a3e['model'],qs[_0xcfd1('0x46')](_0x2c35ae[_0xcfd1('0x3c')]['fields']));_0x3c2d00['attributes']=_0x3c2d00['attributes'][_0xcfd1('0x47')]?_0x3c2d00[_0xcfd1('0x45')]:_0x665a3e[_0xcfd1('0x40')];if(_0x2c35ae[_0xcfd1('0x3c')][_0xcfd1('0x48')]){_0x3c2d00[_0xcfd1('0x49')]=[{'all':!![]}];}_0x3c2d00=_[_0xcfd1('0x30')]({},_0x3c2d00,_0x2c35ae[_0xcfd1('0x4a')]);return db[_0xcfd1('0x42')]['find'](_0x3c2d00)['then'](handleEntityNotFound(_0x4508e4,null))[_0xcfd1('0x17')](respondWithResult(_0x4508e4,null))[_0xcfd1('0x20')](handleError(_0x4508e4,null));};exports[_0xcfd1('0x4b')]=function(_0x11b4f6,_0x30274c){return db[_0xcfd1('0x42')][_0xcfd1('0x4b')](_0x11b4f6[_0xcfd1('0x31')],{})[_0xcfd1('0x17')](respondWithResult(_0x30274c,0xc9))[_0xcfd1('0x20')](handleError(_0x30274c,null));};exports[_0xcfd1('0x2b')]=function(_0x33b961,_0x3a59a7){if(_0x33b961[_0xcfd1('0x31')]['id']){delete _0x33b961[_0xcfd1('0x31')]['id'];}return db[_0xcfd1('0x42')][_0xcfd1('0x4c')]({'where':{'id':_0x33b961[_0xcfd1('0x3f')]['id']}})[_0xcfd1('0x17')](handleEntityNotFound(_0x3a59a7,null))[_0xcfd1('0x17')](saveUpdates(_0x33b961['body'],null))[_0xcfd1('0x17')](respondWithResult(_0x3a59a7,null))[_0xcfd1('0x20')](handleError(_0x3a59a7,null));};exports['destroy']=function(_0x4c7af9,_0x54aebb){return db[_0xcfd1('0x42')][_0xcfd1('0x4c')]({'where':{'id':_0x4c7af9[_0xcfd1('0x3f')]['id']}})[_0xcfd1('0x17')](handleEntityNotFound(_0x54aebb,null))[_0xcfd1('0x17')](removeEntity(_0x54aebb,null))['catch'](handleError(_0x54aebb,null));};exports[_0xcfd1('0x4d')]=function(_0x58d248,_0x377646){return db[_0xcfd1('0x42')][_0xcfd1('0x4d')]()['then'](respondWithResult(_0x377646,null))[_0xcfd1('0x20')](handleError(_0x377646,null));};exports[_0xcfd1('0x4e')]=function(_0x3a2110,_0x39869d){var _0x2d571e=_0x3a2110[_0xcfd1('0x3f')]['id'];var _0x1d2afc;var _0x57123c;var _0x532c3d;return db[_0xcfd1('0x42')][_0xcfd1('0x4f')]({'where':{'id':_0x2d571e}})[_0xcfd1('0x17')](function(_0x40e929){_0x1d2afc=_0x40e929;return db[_0xcfd1('0x50')][_0xcfd1('0x4f')]({'where':{'id':_0x40e929[_0xcfd1('0x51')]},'attributes':['id','vidaooApiKey',_0xcfd1('0x52'),_0xcfd1('0x53'),_0xcfd1('0x54'),_0xcfd1('0x55')],'raw':!![]});})[_0xcfd1('0x17')](function(_0x2dbe9d){if(_0x2dbe9d&&_0x2dbe9d[_0xcfd1('0x56')]&&_0x2dbe9d['vidaooEscalation']){_0x57123c=_0x2dbe9d;var _0x2098b7={'interaction':{'id':_0x2d571e},'agent':{'id':_0x3a2110[_0xcfd1('0x3d')]['id'],'name':_0x3a2110[_0xcfd1('0x3d')][_0xcfd1('0x2e')],'fullname':_0x3a2110[_0xcfd1('0x3d')][_0xcfd1('0x57')],'email':_0x3a2110[_0xcfd1('0x3d')]['email']},'contact':_0x3a2110[_0xcfd1('0x31')][_0xcfd1('0x32')],'account':_0x3a2110[_0xcfd1('0x31')]['account']};var _0x3e41d7={'rejectUnauthorized':![],'method':_0xcfd1('0x58'),'url':_0xcfd1('0x59'),'headers':{'X-APIKEY':_0x2dbe9d[_0xcfd1('0x56')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x3a2110[_0xcfd1('0x3d')]['email']],'buttons':null,'topic':_0x57123c[_0xcfd1('0x53')],'note':_['isNull'](_0x57123c[_0xcfd1('0x54')])?null:getMustacheRender(_0x57123c[_0xcfd1('0x54')],_0x2098b7),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0xcfd1('0x5a')](_0x57123c[_0xcfd1('0x55')])){var _0x54d513=getMustacheRender(_0x57123c[_0xcfd1('0x55')],_0x2098b7);var _0x2cd245=JSON[_0xcfd1('0x5b')](_0x54d513);_0x3e41d7['body'][_0xcfd1('0x5c')]=_0x2cd245;}}catch(_0x21f3d2){throw new db[(_0xcfd1('0x5d'))]['ValidationError']('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x3e41d7);}else{throw new db[(_0xcfd1('0x5d'))]['ValidationError'](_0xcfd1('0x5e'));}})[_0xcfd1('0x17')](function(_0x3c9f23){_0x532c3d=_0x3c9f23;if(_0x532c3d['id']){var _0x33b0d0={'body':_0x532c3d[_0xcfd1('0x5f')],'ChatWebsiteId':_0x57123c['id'],'ChatInteractionId':_0x1d2afc['id'],'direction':_0xcfd1('0x60'),'UserId':_0x3a2110[_0xcfd1('0x3d')]['id']};return db[_0xcfd1('0x61')][_0xcfd1('0x4b')](_0x33b0d0,{});}else{throw new db[(_0xcfd1('0x5d'))][(_0xcfd1('0x62'))](_0xcfd1('0x63'));}})['then'](function(){return _0x1d2afc[_0xcfd1('0x64')]({'vidaooSessionId':_0x532c3d['id']});})['then'](respondWithResult(_0x39869d,null))[_0xcfd1('0x20')](handleError(_0x39869d,null));};exports['customUpdate']=function(_0x430d5d,_0x39f857){if(_0x430d5d[_0xcfd1('0x31')]['id']){delete _0x430d5d['body']['id'];}return db[_0xcfd1('0x42')][_0xcfd1('0x4c')]({'where':{'id':_0x430d5d[_0xcfd1('0x3f')]['id']},'include':[{'model':db[_0xcfd1('0x65')],'as':_0xcfd1('0x66')}]})[_0xcfd1('0x17')](handleEntityNotFound(_0x39f857,null))[_0xcfd1('0x17')](saveUpdates(_0x430d5d[_0xcfd1('0x31')],null))[_0xcfd1('0x17')](respondWithResult(_0x39f857,null))['catch'](handleError(_0x39f857,null));};exports[_0xcfd1('0x67')]=function(_0x5ac6d3,_0x46eb82){if(_0x5ac6d3[_0xcfd1('0x31')]['id']){delete _0x5ac6d3['body']['id'];}return db['ChatInteraction'][_0xcfd1('0x4c')]({'where':{'id':_0x5ac6d3[_0xcfd1('0x3f')]['id']}})[_0xcfd1('0x17')](function(_0x3c392c){if(!_0x3c392c){logger['error'](_0xcfd1('0x68'),'abandon',0x194,_0xcfd1('0x69'));_0x46eb82[_0xcfd1('0x21')](0x194);}else{if(_0x3c392c['UserId']){throw new db[(_0xcfd1('0x5d'))][(_0xcfd1('0x62'))](_0xcfd1('0x6a'));}}return _0x3c392c;})[_0xcfd1('0x17')](function(_0x32738f){if(_0x32738f){return _0x32738f[_0xcfd1('0x2b')]({'closed':_0x5ac6d3[_0xcfd1('0x31')]['closed'],'disposition':_0x5ac6d3[_0xcfd1('0x31')][_0xcfd1('0x6b')]})[_0xcfd1('0x17')](function(_0x1f467c){return _0x1f467c;});}})[_0xcfd1('0x17')](function(){return respondWithRpcPromise(_0xcfd1('0x6c'),_0xcfd1('0x67'),_0x5ac6d3['body'],client9004);})[_0xcfd1('0x17')](respondWithResult(_0x46eb82,null))[_0xcfd1('0x20')](handleError(_0x46eb82,null));};exports[_0xcfd1('0x6d')]=function(_0xa6960b,_0x21da91){_0xa6960b[_0xcfd1('0x31')]['name']=_0xa6960b[_0xcfd1('0x6e')][_0xcfd1('0x6f')];_0xa6960b[_0xcfd1('0x31')][_0xcfd1('0x70')]=_0xa6960b['file'][_0xcfd1('0x71')];_0xa6960b[_0xcfd1('0x31')][_0xcfd1('0x37')]=_0xa6960b[_0xcfd1('0x6e')][_0xcfd1('0x72')];return db[_0xcfd1('0x73')][_0xcfd1('0x4b')](_0xa6960b[_0xcfd1('0x31')])[_0xcfd1('0x17')](respondWithResult(_0x21da91,0xc9))['catch'](handleError(_0x21da91,null));};exports[_0xcfd1('0x74')]=function(_0x511568,_0x157382){return db[_0xcfd1('0x42')]['findOne']({'where':{'id':_0x511568[_0xcfd1('0x3f')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x157382,null))['then'](function(_0x22be54){if(_0x22be54){if(_0x22be54[_0xcfd1('0x75')]){return _0x157382[_0xcfd1('0x23')](0x193)[_0xcfd1('0x24')]({'status':0x193,'message':'Unauthorized'});}return db[_0xcfd1('0x73')]['findOne']({'where':{'id':_0x511568['query'][_0xcfd1('0x76')]},'raw':!![]})['then'](handleEntityNotFound(_0x157382,null));}})['then'](function(_0x3dde84){if(_0x3dde84){var _0x40b7b5=_0x3dde84['ChatOfflineMessageId']!==null;var _0x45f045=path[_0xcfd1('0x77')](config[_0xcfd1('0x78')],_0xcfd1('0x79'));if(_0x40b7b5){_0x45f045=path['join'](_0x45f045,_0xcfd1('0x7a'));}var _0x134eca=path[_0xcfd1('0x77')](_0x45f045,_0x3dde84[_0xcfd1('0x70')]);return _0x157382[_0xcfd1('0x7b')](_0x134eca);}})[_0xcfd1('0x20')](handleError(_0x157382,null));};exports[_0xcfd1('0x7c')]=function(_0x9ac1e1,_0x2a5fec){var _0x45badc=null;var _0x45f656=null;var _0x348145=null;if(_0x9ac1e1['body']['id']){delete _0x9ac1e1['body']['id'];}if(_0x9ac1e1[_0xcfd1('0x31')][_0xcfd1('0x7d')]){_0x348145=path[_0xcfd1('0x77')](config[_0xcfd1('0x78')],_0xcfd1('0x7e'),util[_0xcfd1('0x7f')](_0xcfd1('0x80'),Date[_0xcfd1('0x81')]()));_0x9ac1e1['body'][_0xcfd1('0x82')]=_0x348145;}return db['ChatInteraction'][_0xcfd1('0x4c')]({'where':{'id':_0x9ac1e1[_0xcfd1('0x3f')]['id']},'include':[{'model':db[_0xcfd1('0x61')],'as':'Messages','include':[{'model':db[_0xcfd1('0x83')],'as':_0xcfd1('0x83')}]}]})[_0xcfd1('0x17')](handleEntityNotFound(_0x2a5fec,null))[_0xcfd1('0x17')](saveUpdates(_0x9ac1e1[_0xcfd1('0x31')],null))['then'](function(_0x45cb24){if(_0x45cb24){_0x45badc=_0x45cb24;return db['ChatWebsite']['find']({'where':{'id':_0x45badc[_0xcfd1('0x51')]}});}})[_0xcfd1('0x17')](function(_0xc6b764){if(_0xc6b764){_0x45f656=_0xc6b764;return db['CmContact'][_0xcfd1('0x4c')]({'where':{'id':_0x45badc[_0xcfd1('0x84')]}});}})[_0xcfd1('0x17')](function(_0x43351f){if(_0x43351f){if(_0x348145){var _0x3e44cd=null;for(var _0x1f07c3=0x1;_0x1f07c3<_0x45badc['Messages']['length'];++_0x1f07c3){_0x3e44cd=_0x45badc[_0xcfd1('0x85')][_0x1f07c3];var _0x12c2c0=_0x3e44cd[_0xcfd1('0x86')]?util[_0xcfd1('0x7f')](_0xcfd1('0x87'),_0x45f656['agentAlias'],_0x3e44cd['UserId']):_0xcfd1('0x88');var _0x543d14=_0x9ac1e1[_0xcfd1('0x31')][_0xcfd1('0x89')]||util['format']('%s%d','Visitor',_0x3e44cd['ContactId']);switch(_0x45f656['agentIdentifier']){case _0xcfd1('0x8a'):_0x12c2c0=_0x3e44cd[_0xcfd1('0x86')]?util[_0xcfd1('0x7f')](_0xcfd1('0x87'),_0x45f656[_0xcfd1('0x8b')],_0x3e44cd[_0xcfd1('0x86')]):_0xcfd1('0x88');break;case _0xcfd1('0x8c'):_0x12c2c0=_0x3e44cd[_0xcfd1('0x86')]?_0x3e44cd[_0xcfd1('0x83')][_0xcfd1('0x8d')]||_0x3e44cd[_0xcfd1('0x83')]['fullname']:_0xcfd1('0x88');break;case _0xcfd1('0x8e'):_0x12c2c0=_0x3e44cd[_0xcfd1('0x86')]?_0x3e44cd[_0xcfd1('0x83')][_0xcfd1('0x57')]:_0xcfd1('0x88');break;default:_0x12c2c0=_0x3e44cd[_0xcfd1('0x86')]?util['format']('%s%d',_0x45f656[_0xcfd1('0x8b')],_0x3e44cd[_0xcfd1('0x86')]):_0xcfd1('0x88');}var _0x59bebd=util[_0xcfd1('0x7f')](_0xcfd1('0x8f'),moment(_0x3e44cd[_0xcfd1('0x90')])[_0xcfd1('0x7f')](_0xcfd1('0x91')),_0x3e44cd[_0xcfd1('0x92')]==='in'?_0x543d14:_0x12c2c0,_0x3e44cd['body']);if(!_0x3e44cd[_0xcfd1('0x93')]){fs[_0xcfd1('0x94')](_0x348145,_0x59bebd);}}return db[_0xcfd1('0x95')][_0xcfd1('0x4f')]({'where':{'service':!![]},'include':[{'model':db[_0xcfd1('0x96')],'as':_0xcfd1('0x97'),'raw':!![],'include':[{'model':db[_0xcfd1('0x98')],'as':'CloudProvider','raw':!![]}]}]});}}})['then'](function(_0x41240b){if(!_0x41240b||!_0x41240b[_0xcfd1('0x97')]||!_0x9ac1e1['body'])return _0x45badc;var _0x457d03=_0x41240b[_0xcfd1('0x99')]();return respondWithRpcPromise(_0xcfd1('0x9a'),_0xcfd1('0x9b'),{'account':_0x457d03,'message':{'from':util[_0xcfd1('0x7f')](_0xcfd1('0x9c'),_0x41240b[_0xcfd1('0x2e')],_0x41240b[_0xcfd1('0x9d')]||_0x41240b[_0xcfd1('0x97')][_0xcfd1('0x3d')]),'to':_0x9ac1e1[_0xcfd1('0x31')][_0xcfd1('0x7d')],'subject':_0xcfd1('0x9e'),'text':util['format'](_0xcfd1('0x9f'),_0x9ac1e1[_0xcfd1('0x31')]['mailTranscript']),'attachments':[{'path':_0x348145}]}})['then'](function(){return _0x45badc;})[_0xcfd1('0x20')](function(_0x2214f9){logger['error'](_0x2214f9);});})[_0xcfd1('0x17')](respondWithStatusCode(_0x2a5fec,0xc8))[_0xcfd1('0x20')](handleError(_0x2a5fec,null));};exports[_0xcfd1('0xa0')]=function(_0x36bea8,_0x44cb76){return db[_0xcfd1('0x61')]['find']({'where':{'id':_0x36bea8[_0xcfd1('0x3f')]['id']}})[_0xcfd1('0x17')](handleEntityNotFound(_0x44cb76,null))['then'](function(_0x18318f){if(_0x18318f){return _0x18318f['addMessage'](_0x36bea8[_0xcfd1('0x31')][_0xcfd1('0xa1')],_[_0xcfd1('0xa2')](_0x36bea8[_0xcfd1('0x31')],[_0xcfd1('0xa1'),'id'])||{});}})[_0xcfd1('0x17')](respondWithResult(_0x44cb76,null))[_0xcfd1('0x20')](handleError(_0x44cb76,null));};exports[_0xcfd1('0xa3')]=function(_0x58a2b0,_0x3df92e){var _0x310a90={'raw':![],'where':{}};var _0x14a192={};var _0x761217={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xcfd1('0x4f')]({'where':{'id':_0x58a2b0[_0xcfd1('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3df92e,null))[_0xcfd1('0x17')](function(_0x14c1a6){if(_0x14c1a6){_0x14a192[_0xcfd1('0x40')]=_[_0xcfd1('0x41')](db['ChatMessage'][_0xcfd1('0x36')]);_0x14a192[_0xcfd1('0x3c')]=_[_0xcfd1('0x41')](_0x58a2b0[_0xcfd1('0x3c')]);_0x14a192[_0xcfd1('0x43')]=_[_0xcfd1('0x44')](_0x14a192[_0xcfd1('0x40')],_0x14a192[_0xcfd1('0x3c')]);_0x310a90[_0xcfd1('0x45')]=_['intersection'](_0x14a192[_0xcfd1('0x40')],qs[_0xcfd1('0x46')](_0x58a2b0['query'][_0xcfd1('0x46')]));_0x310a90['attributes']=_0x310a90[_0xcfd1('0x45')]['length']?_0x310a90[_0xcfd1('0x45')]:_0x14a192[_0xcfd1('0x40')];if(!_0x58a2b0[_0xcfd1('0x3c')][_0xcfd1('0xa4')](_0xcfd1('0xa5'))){_0x310a90[_0xcfd1('0x27')]=qs[_0xcfd1('0x27')](_0x58a2b0['query'][_0xcfd1('0x27')]);_0x310a90['offset']=qs[_0xcfd1('0x25')](_0x58a2b0[_0xcfd1('0x3c')]['offset']);}_0x310a90[_0xcfd1('0xa6')]=qs['sort'](_0x58a2b0['query']['sort']);_0x310a90[_0xcfd1('0xa7')]=qs[_0xcfd1('0x43')](_[_0xcfd1('0xa8')](_0x58a2b0[_0xcfd1('0x3c')],_0x14a192['filters']));_0x310a90[_0xcfd1('0xa7')][_0xcfd1('0xa9')]=_0x14c1a6['id'];if(_0x58a2b0['query'][_0xcfd1('0xaa')]){_0x310a90[_0xcfd1('0xa7')]=_['merge'](_0x310a90[_0xcfd1('0xa7')],{'$or':_[_0xcfd1('0x35')](_0x310a90[_0xcfd1('0x45')],function(_0x14fefe){var _0x3df1ff={};_0x3df1ff[_0x14fefe]={'$like':'%'+_0x58a2b0[_0xcfd1('0x3c')][_0xcfd1('0xaa')]+'%'};return _0x3df1ff;})});}if(_0x58a2b0[_0xcfd1('0x3c')][_0xcfd1('0xab')]){var _0x55ba18=_0x58a2b0['query'][_0xcfd1('0xab')]['split'](',');var _0x1b5b90={};_0x1b5b90[_0x55ba18[0x0]]={'$gte':moment(_0x55ba18[0x1])['format'](_0xcfd1('0xac'))};_0x310a90[_0xcfd1('0xa7')]=_[_0xcfd1('0x30')](_0x310a90['where'],_0x1b5b90);}_0x310a90=_[_0xcfd1('0x30')]({},_0x310a90,_0x58a2b0['options']);return db[_0xcfd1('0x61')][_0xcfd1('0x28')]({'where':_0x310a90[_0xcfd1('0xa7')]})['then'](function(_0x574aa8){_0x761217[_0xcfd1('0x28')]=_0x574aa8;if(_0x58a2b0[_0xcfd1('0x3c')][_0xcfd1('0x48')]){_0x310a90[_0xcfd1('0x49')]=[{'all':!![]}];}return db[_0xcfd1('0x61')][_0xcfd1('0x3a')](_0x310a90);})[_0xcfd1('0x17')](function(_0x265115){_0x761217[_0xcfd1('0xad')]=_0x265115;return _0x761217;});}})['then'](respondWithFilteredResult(_0x3df92e,_0x310a90))[_0xcfd1('0x20')](handleError(_0x3df92e,null));};exports['getMyMessages']=function(_0x3beedb,_0x5258d7){var _0x141c67={'where':{}},_0x188d3f={},_0x4abd00={'count':0x0,'rows':[]};return db[_0xcfd1('0x42')][_0xcfd1('0x4f')]({'where':{'id':_0x3beedb['params']['id']}})[_0xcfd1('0x17')](handleEntityNotFound(_0x5258d7,null))[_0xcfd1('0x17')](function(_0x355ddb){if(_0x355ddb){_0x188d3f[_0xcfd1('0x40')]=_[_0xcfd1('0x41')](db['ChatMessage'][_0xcfd1('0x36')]);_0x188d3f[_0xcfd1('0x3c')]=_[_0xcfd1('0x41')](_0x3beedb[_0xcfd1('0x3c')]);_0x188d3f[_0xcfd1('0x43')]=_[_0xcfd1('0x44')](_0x188d3f[_0xcfd1('0x40')],_0x188d3f[_0xcfd1('0x3c')]);_0x141c67[_0xcfd1('0x45')]=_[_0xcfd1('0x44')](_0x188d3f[_0xcfd1('0x40')],qs[_0xcfd1('0x46')](_0x3beedb[_0xcfd1('0x3c')][_0xcfd1('0x46')]));_0x141c67['attributes']=_0x141c67[_0xcfd1('0x45')][_0xcfd1('0x47')]?_0x141c67['attributes']:_0x188d3f[_0xcfd1('0x40')];if(!_0x3beedb[_0xcfd1('0x3c')][_0xcfd1('0xa4')]('nolimit')){_0x141c67[_0xcfd1('0x27')]=qs['limit'](_0x3beedb[_0xcfd1('0x3c')][_0xcfd1('0x27')]);_0x141c67[_0xcfd1('0x25')]=qs[_0xcfd1('0x25')](_0x3beedb[_0xcfd1('0x3c')][_0xcfd1('0x25')]);}_0x141c67['order']=qs[_0xcfd1('0xae')](_0x3beedb[_0xcfd1('0x3c')]['sort']);_0x141c67[_0xcfd1('0xa7')]=qs[_0xcfd1('0x43')](_[_0xcfd1('0xa8')](_0x3beedb['query'],_0x188d3f[_0xcfd1('0x43')]));_0x141c67[_0xcfd1('0xa7')][_0xcfd1('0xa9')]=_0x355ddb['id'];if(_0x3beedb[_0xcfd1('0x3c')]['filter']){_0x141c67[_0xcfd1('0xa7')]=_[_0xcfd1('0x30')](_0x141c67[_0xcfd1('0xa7')],{'$or':_[_0xcfd1('0x35')](_0x141c67[_0xcfd1('0x45')],function(_0x408118){var _0x31f07d={};_0x31f07d[_0x408118]={'$like':'%'+_0x3beedb['query'][_0xcfd1('0xaa')]+'%'};return _0x31f07d;})});}_0x141c67[_0xcfd1('0xa7')][_0xcfd1('0x93')]=![];if(_0x3beedb[_0xcfd1('0x3c')]['id']){_0x141c67[_0xcfd1('0xa7')]['id']={'$gt':_0x3beedb['query']['id']};}_0x141c67=_[_0xcfd1('0x30')]({},_0x141c67,_0x3beedb['options']);return db[_0xcfd1('0x61')][_0xcfd1('0x28')]({'where':_0x141c67[_0xcfd1('0xa7')]})[_0xcfd1('0x17')](function(_0xfd70fa){_0x4abd00[_0xcfd1('0x28')]=_0xfd70fa;_0x141c67['include']=[];if(_0x3beedb['query'][_0xcfd1('0xaf')]){_0x141c67[_0xcfd1('0x49')][_0xcfd1('0xb0')]({'model':db[_0xcfd1('0x83')],'as':_0xcfd1('0x83'),'attributes':['id',_0xcfd1('0x57'),_0xcfd1('0x8d')]});}if(_0x3beedb[_0xcfd1('0x3c')][_0xcfd1('0x48')]){_0x141c67[_0xcfd1('0x49')]=[{'all':!![]}];}return db[_0xcfd1('0x61')][_0xcfd1('0x3a')](_0x141c67);})[_0xcfd1('0x17')](function(_0x44a7b0){_0x4abd00[_0xcfd1('0xad')]=_0x44a7b0;return _0x4abd00;});}})[_0xcfd1('0x17')](respondWithFilteredResult(_0x5258d7,_0x141c67))[_0xcfd1('0x20')](handleError(_0x5258d7,null));};exports['addTags']=function(_0xc653fd,_0x89d1c1){return db[_0xcfd1('0x42')]['find']({'where':{'id':_0xc653fd[_0xcfd1('0x3f')]['id']}})[_0xcfd1('0x17')](handleEntityNotFound(_0x89d1c1,null))[_0xcfd1('0x17')](function(_0x52aa1f){if(_0x52aa1f){return _0x52aa1f[_0xcfd1('0xb1')](_0xc653fd[_0xcfd1('0x31')][_0xcfd1('0xa1')],_[_0xcfd1('0xa2')](_0xc653fd[_0xcfd1('0x31')],[_0xcfd1('0xa1'),'id'])||{})[_0xcfd1('0xb2')](function(){return db[_0xcfd1('0xb3')][_0xcfd1('0x3a')]({'attributes':['id','name','color'],'where':{'id':_0xc653fd['body'][_0xcfd1('0xa1')]}});})['then'](function(_0x3aa651){socket['emit'](_0xcfd1('0xb4'),{'id':Number(_0xc653fd[_0xcfd1('0x3f')]['id']),'tags':_0x3aa651||[]});return{'id':Number(_0xc653fd[_0xcfd1('0x3f')]['id']),'tags':_0x3aa651||[]};});}})['then'](respondWithResult(_0x89d1c1,null))['catch'](handleError(_0x89d1c1,null));};exports[_0xcfd1('0xb5')]=function(_0x82e6a3,_0x4d105){return db[_0xcfd1('0x42')][_0xcfd1('0x4c')]({'where':{'id':_0x82e6a3[_0xcfd1('0x3f')]['id']}})[_0xcfd1('0x17')](handleEntityNotFound(_0x4d105,null))[_0xcfd1('0x17')](function(_0x52751b){if(_0x52751b){return _0x52751b[_0xcfd1('0xb5')](_0x82e6a3['query'][_0xcfd1('0xa1')]);}})['then'](respondWithStatusCode(_0x4d105,null))[_0xcfd1('0x20')](handleError(_0x4d105,null));};exports[_0xcfd1('0x7b')]=function(_0x3e6f82,_0x25a460){var _0x3fef40=moment()[_0xcfd1('0xb6')]()[_0xcfd1('0xb7')]();var _0x376f0f=path[_0xcfd1('0x77')](config[_0xcfd1('0x78')],_0xcfd1('0xb8'),_0xcfd1('0xb9'),_0xcfd1('0xba'));var _0xdd4612=path[_0xcfd1('0x77')](config[_0xcfd1('0x78')],_0xcfd1('0xb8'),'files',_0xcfd1('0xbb'));var _0x5d7518=path[_0xcfd1('0x77')](_0x376f0f,_0x3fef40);var _0x524729=util[_0xcfd1('0x7f')](_0xcfd1('0xbc'),_0x3e6f82[_0xcfd1('0x3f')]['id'],_0x3fef40);var _0x5ae5b9=path[_0xcfd1('0x77')](_0x376f0f,_0x524729);var _0x464184=[];_0x464184['push']({'model':db[_0xcfd1('0x83')],'as':_0xcfd1('0x83'),'attributes':['id',_0xcfd1('0x57')],'raw':!![]});_0x464184[_0xcfd1('0xb0')]({'model':db[_0xcfd1('0x65')],'as':_0xcfd1('0x66'),'attributes':['id',_0xcfd1('0xbd'),_0xcfd1('0xbe')],'raw':!![]});if(_0x3e6f82['query'][_0xcfd1('0xbb')]){_0x464184[_0xcfd1('0xb0')]({'model':db[_0xcfd1('0x73')],'as':_0xcfd1('0x73'),'raw':!![]});}var _0x5542f4=[{'model':db[_0xcfd1('0x61')],'as':'Messages','attributes':['id',_0xcfd1('0x31'),_0xcfd1('0x90'),_0xcfd1('0x92'),'secret',_0xcfd1('0xbf')],'include':_0x464184}];_0x5542f4[_0xcfd1('0xb0')]({'model':db[_0xcfd1('0x50')],'as':_0xcfd1('0xc0'),'attributes':['id',_0xcfd1('0x2e')]});_0x5542f4[_0xcfd1('0xb0')]({'model':db['User'],'as':_0xcfd1('0xc1'),'attributes':['id',_0xcfd1('0x57')]});return db[_0xcfd1('0x42')][_0xcfd1('0x4c')]({'where':{'id':_0x3e6f82['params']['id']},'include':_0x5542f4})[_0xcfd1('0x17')](handleEntityNotFound(_0x25a460,null))[_0xcfd1('0x17')](function(_0x15d30f){if(_0x15d30f){var _0x4fa0b0=_0x15d30f[_0xcfd1('0xc2')]({'plain':!![]});fs['mkdirSync'](_0x5d7518);var _0x4e8b24={'channel':_0xcfd1('0xc3'),'account':_0x4fa0b0[_0xcfd1('0xc0')]['name'],'agent':_0x4fa0b0['Owner']?_0x4fa0b0[_0xcfd1('0xc1')][_0xcfd1('0x57')]:_0xcfd1('0xc4'),'createdAt':moment(_0x4fa0b0[_0xcfd1('0x90')])[_0xcfd1('0x7f')](_0xcfd1('0xac'))[_0xcfd1('0xb7')](),'closedAt':_0x4fa0b0[_0xcfd1('0x75')]?moment(_0x4fa0b0[_0xcfd1('0xc5')])[_0xcfd1('0x7f')](_0xcfd1('0xac'))[_0xcfd1('0xb7')]():'','disposition':_0x4fa0b0[_0xcfd1('0x6b')],'chatInfo':{'browser':_0x4fa0b0[_0xcfd1('0xc6')],'os':_0x4fa0b0[_0xcfd1('0xc7')],'referer':_0x4fa0b0[_0xcfd1('0xc8')],'customerIp':_0x4fa0b0[_0xcfd1('0xc9')],'customerPort':_0x4fa0b0['customerPort']?_0x4fa0b0['customerPort']:_0xcfd1('0xc4')},'messages':_(_0x4fa0b0[_0xcfd1('0x85')])[_0xcfd1('0xca')]()[_0xcfd1('0xaa')]({'secret':![]})[_0xcfd1('0x35')](function(_0x4585a){if(_0x4585a['Attachment']){var _0x75edb0=path['join'](_0xdd4612,_0x4585a[_0xcfd1('0x73')][_0xcfd1('0x70')]);if(fs[_0xcfd1('0xcb')](_0x75edb0)){fs[_0xcfd1('0xcc')](_0x75edb0)[_0xcfd1('0xcd')](fs[_0xcfd1('0xce')](path[_0xcfd1('0x77')](_0x5d7518,_0x4585a[_0xcfd1('0x73')][_0xcfd1('0x70')])));}}return{'date':moment(_0x4585a[_0xcfd1('0x90')])[_0xcfd1('0x7f')](_0xcfd1('0xac'))[_0xcfd1('0xb7')](),'sender':_0x4585a[_0xcfd1('0x92')]===_0xcfd1('0x60')?_0x4585a['User']?_0x4585a['User'][_0xcfd1('0x57')]:_0xcfd1('0x88'):_0x4585a[_0xcfd1('0x66')]['firstName']+(_0x4585a[_0xcfd1('0x66')][_0xcfd1('0xbe')]?'\x20'+_0x4585a['Contact'][_0xcfd1('0xbe')]:''),'body':_0x4585a[_0xcfd1('0x73')]?_0x4585a['Attachment'][_0xcfd1('0x70')]:_0x4585a[_0xcfd1('0x31')],'direction':_0x4585a['direction']===_0xcfd1('0x60')?'A':'C','secret':_0x4585a[_0xcfd1('0x93')],'read':_0x4585a['read'],'attachment':_0x4585a['Attachment']};})[_0xcfd1('0xcf')]()};return ejs[_0xcfd1('0xd0')](path[_0xcfd1('0x77')](config[_0xcfd1('0x78')],_0xcfd1('0xb8'),'views','downloadInteraction.ejs'),{'interaction':_0x4e8b24})[_0xcfd1('0x17')](function(_0x3e3ba6){var _0x3500a8=path[_0xcfd1('0x77')](_0x5d7518,'transcript-'+_0x4fa0b0['id']+'-'+_0x3fef40+'.pdf');var _0x2e7c72={'path':_0x3500a8,'channel':_0xcfd1('0xc3'),'interactionId':_0x4fa0b0['id']};return pdf[_0xcfd1('0xd1')](_0x3e3ba6,_0x2e7c72);})[_0xcfd1('0x17')](function(){return new Promise(function(_0x112608,_0x2c4446){zipdir(_0x5d7518,{'saveTo':_0x5ae5b9},function(_0x254981,_0x18ed24){if(_0x254981)return _0x2c4446(_0x254981);return _0x112608(_0x18ed24);});})[_0xcfd1('0x17')](function(){return new BPromise(function(_0x4d46f2,_0x4745ad){rimraf(_0x5d7518,function(_0x16cc3a){if(_0x16cc3a)_0x4745ad(_0x16cc3a);return _0x4d46f2();});});})[_0xcfd1('0x17')](function(){return _0x25a460[_0xcfd1('0x7b')](_0x5ae5b9,_0x524729,function(_0x57c799){if(_0x57c799){logger[_0xcfd1('0x1c')](_0xcfd1('0xd2'),_0x57c799);}else{fs['unlinkSync'](_0x5ae5b9);}});});});}else{return _0x25a460[_0xcfd1('0x21')](0xc8);}})['catch'](handleError(_0x25a460,null));};
\ No newline at end of file
+var _0xa455=['undefined','limit','count','status','set','Content-Range','update','stack','name','send','render','merge','body','contact','agent','interaction','account','rawAttributes','fieldName','type','key','getOptions','findAll','chat','query','user','catch','show','params','model','keys','ChatInteraction','intersection','attributes','fields','length','find','create','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','fullname','email','POST','isNull','vidaooNote','metadata','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','file','basename','filename','mimetype','attachmentDownload','Unauthorized','Attachment','attachId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','now','pathTranscript','Messages','User','customer','%s%d','Visitor','ContactId','agentIdentifier','website_alias','agentAlias','System','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','ids','getMessages','filters','hasOwnProperty','nolimit','order','sort','where','filter','map','$gte','options','includeAll','include','getMyMessages','pick','ChatInteractionId','push','rows','addTags','setTags','spread','Tag','chatInteractionTags:save','removeTags','toString','server','files','tmp','transcript-%d-%s.zip','firstName','attachments','read','Account','mkdirSync','Chat','Owner','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','browserName','osName','referer','customerPort','tail','existsSync','pipe','createWriteStream','lastName','value','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','../../components/interaction/service','../../config/logger','../../config/environment','../../mysqldb','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','message','result','sendStatus','end','json','offset'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa455,0xb1));var _0x5a45=function(_0x56c697,_0xe08bde){_0x56c697=_0x56c697-0x0;var _0x47ff9a=_0xa455[_0x56c697];return _0x47ff9a;};'use strict';var rimraf=require(_0x5a45('0x0'));var zipdir=require('zip-dir');var rp=require(_0x5a45('0x1'));var moment=require(_0x5a45('0x2'));var BPromise=require(_0x5a45('0x3'));var Mustache=require(_0x5a45('0x4'));var util=require(_0x5a45('0x5'));var path=require(_0x5a45('0x6'));var ejs=require(_0x5a45('0x7'));var fs=require('fs');var _=require(_0x5a45('0x8'));var Redis=require('ioredis');var interaction=require(_0x5a45('0x9'));var qs=require('../../components/parsers/qs');var pdf=require('../../components/export/pdf');var logger=require(_0x5a45('0xa'))('api');var config=require(_0x5a45('0xb'));var db=require(_0x5a45('0xc'))['db'];config[_0x5a45('0xd')]=_[_0x5a45('0xe')](config[_0x5a45('0xd')],{'host':_0x5a45('0xf'),'port':0x18eb});var socket=require(_0x5a45('0x10'))(new Redis(config['redis']));require('./chatInteraction.socket')[_0x5a45('0x11')](socket);var jayson=require(_0x5a45('0x12'));var client=jayson[_0x5a45('0x13')][_0x5a45('0x14')]({'port':0x232b});var client9004=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x1abde1,_0x18e631,_0x39b930,_0x34e674){return new BPromise(function(_0xe10641,_0x32e3b8){var _0x4e4ff7=_0x34e674||client;return _0x4e4ff7[_0x5a45('0x15')](_0x1abde1,_0x39b930)[_0x5a45('0x16')](function(_0x10a6cc){logger[_0x5a45('0x17')](_0x5a45('0x18'),_0x18e631,_0x5a45('0x19'));logger[_0x5a45('0x1a')](_0x5a45('0x1b'),_0x18e631,_0x5a45('0x19'),JSON[_0x5a45('0x1c')](_0x10a6cc));if(_0x10a6cc[_0x5a45('0x1d')]){if(_0x10a6cc[_0x5a45('0x1d')]['code']===0x1f4){logger[_0x5a45('0x1d')](_0x5a45('0x18'),_0x18e631,_0x10a6cc['error'][_0x5a45('0x1e')]);return _0x32e3b8(_0x10a6cc['error'][_0x5a45('0x1e')]);}logger['error'](_0x5a45('0x18'),_0x18e631,_0x10a6cc['error'][_0x5a45('0x1e')]);return _0xe10641(_0x10a6cc[_0x5a45('0x1d')][_0x5a45('0x1e')]);}else{logger[_0x5a45('0x17')](_0x5a45('0x18'),_0x18e631,_0x5a45('0x19'));_0xe10641(_0x10a6cc[_0x5a45('0x1f')][_0x5a45('0x1e')]);}})['catch'](function(_0x15375a){logger[_0x5a45('0x1d')](_0x5a45('0x18'),_0x18e631,_0x15375a);_0x32e3b8(_0x15375a);});});}function respondWithStatusCode(_0x4e6ada,_0x1ce739){_0x1ce739=_0x1ce739||0xcc;return function(_0x5dab6f){if(_0x5dab6f){return _0x4e6ada[_0x5a45('0x20')](_0x1ce739);}return _0x4e6ada['status'](_0x1ce739)[_0x5a45('0x21')]();};}function respondWithResult(_0x4fbf85,_0x28f8a0){_0x28f8a0=_0x28f8a0||0xc8;return function(_0x4942ae){if(_0x4942ae){return _0x4fbf85['status'](_0x28f8a0)[_0x5a45('0x22')](_0x4942ae);}};}function respondWithFilteredResult(_0x4b2ef3,_0x4052dd){return function(_0x4fb176){if(_0x4fb176){var _0x36e045=typeof _0x4052dd[_0x5a45('0x23')]===_0x5a45('0x24')&&typeof _0x4052dd[_0x5a45('0x25')]===_0x5a45('0x24');var _0x2f1164=_0x4fb176[_0x5a45('0x26')];var _0x5022fb=_0x36e045?0x0:_0x4052dd['offset'];var _0x2a71e2=_0x36e045?_0x4fb176[_0x5a45('0x26')]:_0x4052dd[_0x5a45('0x23')]+_0x4052dd[_0x5a45('0x25')];var _0x171b35;if(_0x2a71e2>=_0x2f1164){_0x2a71e2=_0x2f1164;_0x171b35=0xc8;}else{_0x171b35=0xce;}_0x4b2ef3[_0x5a45('0x27')](_0x171b35);return _0x4b2ef3[_0x5a45('0x28')](_0x5a45('0x29'),_0x5022fb+'-'+_0x2a71e2+'/'+_0x2f1164)['json'](_0x4fb176);}return null;};}function saveUpdates(_0x5de451){return function(_0x98755c){if(_0x98755c){return _0x98755c[_0x5a45('0x2a')](_0x5de451)['then'](function(_0x528a62){return _0x528a62;});}return null;};}function removeEntity(_0x15a00c){return function(_0x16b3f2){if(_0x16b3f2){return _0x16b3f2['destroy']()[_0x5a45('0x16')](function(){_0x15a00c[_0x5a45('0x27')](0xcc)[_0x5a45('0x21')]();});}};}function handleEntityNotFound(_0x39c80c){return function(_0x25dfd4){if(!_0x25dfd4){_0x39c80c[_0x5a45('0x20')](0x194);}return _0x25dfd4;};}function handleError(_0x28bf37,_0x2ab5cc){_0x2ab5cc=_0x2ab5cc||0x1f4;return function(_0x2abf1e){logger['error'](_0x2abf1e[_0x5a45('0x2b')]);if(_0x2abf1e[_0x5a45('0x2c')]){delete _0x2abf1e[_0x5a45('0x2c')];}_0x28bf37[_0x5a45('0x27')](_0x2ab5cc)[_0x5a45('0x2d')](_0x2abf1e);};}function getMustacheRender(_0x55db1b,_0x462cb2){return Mustache[_0x5a45('0x2e')](_0x55db1b,_[_0x5a45('0x2f')](_0x462cb2[_0x5a45('0x30')],{'contact':_0x462cb2[_0x5a45('0x31')],'message':_0x462cb2[_0x5a45('0x1e')],'agent':_0x462cb2[_0x5a45('0x32')],'interaction':_0x462cb2[_0x5a45('0x33')],'account':_0x462cb2[_0x5a45('0x34')]}))||'';}exports['index']=function(_0x2b377b,_0x4a630b){var _0x981523={};var _0x3a65cb=_['map'](db['ChatInteraction'][_0x5a45('0x35')],function(_0x2f11db){return{'name':_0x2f11db[_0x5a45('0x36')],'type':_0x2f11db[_0x5a45('0x37')][_0x5a45('0x38')]};});_0x981523=qs[_0x5a45('0x39')](_0x3a65cb,_0x2b377b);return interaction[_0x5a45('0x3a')](_0x5a45('0x3b'),_0x2b377b[_0x5a45('0x3c')],_0x2b377b[_0x5a45('0x3d')],_0x981523,_0x3a65cb)['then'](respondWithFilteredResult(_0x4a630b,_0x981523))[_0x5a45('0x3e')](handleError(_0x4a630b,null));};exports[_0x5a45('0x3f')]=function(_0x3a14b9,_0x2a7966){var _0x36ff95={'raw':![],'where':{'id':_0x3a14b9[_0x5a45('0x40')]['id']}},_0x1ea5d5={};_0x1ea5d5[_0x5a45('0x41')]=_[_0x5a45('0x42')](db[_0x5a45('0x43')][_0x5a45('0x35')]);_0x1ea5d5[_0x5a45('0x3c')]=_[_0x5a45('0x42')](_0x3a14b9[_0x5a45('0x3c')]);_0x1ea5d5['filters']=_[_0x5a45('0x44')](_0x1ea5d5['model'],_0x1ea5d5[_0x5a45('0x3c')]);_0x36ff95[_0x5a45('0x45')]=_[_0x5a45('0x44')](_0x1ea5d5[_0x5a45('0x41')],qs[_0x5a45('0x46')](_0x3a14b9['query'][_0x5a45('0x46')]));_0x36ff95[_0x5a45('0x45')]=_0x36ff95[_0x5a45('0x45')][_0x5a45('0x47')]?_0x36ff95[_0x5a45('0x45')]:_0x1ea5d5[_0x5a45('0x41')];if(_0x3a14b9[_0x5a45('0x3c')]['includeAll']){_0x36ff95['include']=[{'all':!![]}];}_0x36ff95=_[_0x5a45('0x2f')]({},_0x36ff95,_0x3a14b9['options']);return db[_0x5a45('0x43')][_0x5a45('0x48')](_0x36ff95)[_0x5a45('0x16')](handleEntityNotFound(_0x2a7966,null))[_0x5a45('0x16')](respondWithResult(_0x2a7966,null))[_0x5a45('0x3e')](handleError(_0x2a7966,null));};exports[_0x5a45('0x49')]=function(_0x404620,_0x279955){return db[_0x5a45('0x43')][_0x5a45('0x49')](_0x404620[_0x5a45('0x30')],{})[_0x5a45('0x16')](respondWithResult(_0x279955,0xc9))['catch'](handleError(_0x279955,null));};exports[_0x5a45('0x2a')]=function(_0x1b3b05,_0x1a4099){if(_0x1b3b05[_0x5a45('0x30')]['id']){delete _0x1b3b05[_0x5a45('0x30')]['id'];}return db['ChatInteraction'][_0x5a45('0x48')]({'where':{'id':_0x1b3b05['params']['id']}})['then'](handleEntityNotFound(_0x1a4099,null))[_0x5a45('0x16')](saveUpdates(_0x1b3b05['body'],null))[_0x5a45('0x16')](respondWithResult(_0x1a4099,null))['catch'](handleError(_0x1a4099,null));};exports['destroy']=function(_0x451993,_0x505616){return db[_0x5a45('0x43')]['find']({'where':{'id':_0x451993[_0x5a45('0x40')]['id']}})[_0x5a45('0x16')](handleEntityNotFound(_0x505616,null))['then'](removeEntity(_0x505616,null))['catch'](handleError(_0x505616,null));};exports[_0x5a45('0x4a')]=function(_0x1c9acf,_0x2a3075){return db[_0x5a45('0x43')][_0x5a45('0x4a')]()[_0x5a45('0x16')](respondWithResult(_0x2a3075,null))['catch'](handleError(_0x2a3075,null));};exports[_0x5a45('0x4b')]=function(_0x511d23,_0x28336){var _0x434a73=_0x511d23['params']['id'];var _0x577c20;var _0x2a78e0;var _0xa66262;return db[_0x5a45('0x43')][_0x5a45('0x4c')]({'where':{'id':_0x434a73}})[_0x5a45('0x16')](function(_0x4acb4f){_0x577c20=_0x4acb4f;return db[_0x5a45('0x4d')][_0x5a45('0x4c')]({'where':{'id':_0x4acb4f[_0x5a45('0x4e')]},'attributes':['id',_0x5a45('0x4f'),_0x5a45('0x50'),_0x5a45('0x51'),'vidaooNote','vidaooMetadata'],'raw':!![]});})[_0x5a45('0x16')](function(_0x352b32){if(_0x352b32&&_0x352b32[_0x5a45('0x4f')]&&_0x352b32[_0x5a45('0x50')]){_0x2a78e0=_0x352b32;var _0x4feeca={'interaction':{'id':_0x434a73},'agent':{'id':_0x511d23[_0x5a45('0x3d')]['id'],'name':_0x511d23['user'][_0x5a45('0x2c')],'fullname':_0x511d23[_0x5a45('0x3d')][_0x5a45('0x52')],'email':_0x511d23[_0x5a45('0x3d')][_0x5a45('0x53')]},'contact':_0x511d23['body']['contact'],'account':_0x511d23[_0x5a45('0x30')][_0x5a45('0x34')]};var _0x40f1f9={'rejectUnauthorized':![],'method':_0x5a45('0x54'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x352b32['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x511d23[_0x5a45('0x3d')]['email']],'buttons':null,'topic':_0x2a78e0[_0x5a45('0x51')],'note':_[_0x5a45('0x55')](_0x2a78e0['vidaooNote'])?null:getMustacheRender(_0x2a78e0[_0x5a45('0x56')],_0x4feeca),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x5a45('0x55')](_0x2a78e0['vidaooMetadata'])){var _0x4f6cb0=getMustacheRender(_0x2a78e0['vidaooMetadata'],_0x4feeca);var _0x1a7d9d=JSON['parse'](_0x4f6cb0);_0x40f1f9[_0x5a45('0x30')][_0x5a45('0x57')]=_0x1a7d9d;}}catch(_0x29c23c){throw new db[(_0x5a45('0x58'))][(_0x5a45('0x59'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x40f1f9);}else{throw new db['Sequelize'][(_0x5a45('0x59'))](_0x5a45('0x5a'));}})[_0x5a45('0x16')](function(_0x1648b9){_0xa66262=_0x1648b9;if(_0xa66262['id']){var _0x10a024={'body':_0xa66262['join_url'],'ChatWebsiteId':_0x2a78e0['id'],'ChatInteractionId':_0x577c20['id'],'direction':_0x5a45('0x5b'),'UserId':_0x511d23[_0x5a45('0x3d')]['id']};return db[_0x5a45('0x5c')]['create'](_0x10a024,{});}else{throw new db[(_0x5a45('0x58'))][(_0x5a45('0x59'))](_0x5a45('0x5d'));}})[_0x5a45('0x16')](function(){return _0x577c20[_0x5a45('0x5e')]({'vidaooSessionId':_0xa66262['id']});})[_0x5a45('0x16')](respondWithResult(_0x28336,null))[_0x5a45('0x3e')](handleError(_0x28336,null));};exports[_0x5a45('0x5f')]=function(_0x18801f,_0x2759f6){if(_0x18801f[_0x5a45('0x30')]['id']){delete _0x18801f[_0x5a45('0x30')]['id'];}return db[_0x5a45('0x43')]['find']({'where':{'id':_0x18801f[_0x5a45('0x40')]['id']},'include':[{'model':db[_0x5a45('0x60')],'as':_0x5a45('0x61')}]})[_0x5a45('0x16')](handleEntityNotFound(_0x2759f6,null))['then'](saveUpdates(_0x18801f[_0x5a45('0x30')],null))['then'](respondWithResult(_0x2759f6,null))['catch'](handleError(_0x2759f6,null));};exports[_0x5a45('0x62')]=function(_0x2a4b7a,_0x140e8c){if(_0x2a4b7a[_0x5a45('0x30')]['id']){delete _0x2a4b7a[_0x5a45('0x30')]['id'];}return db[_0x5a45('0x43')][_0x5a45('0x48')]({'where':{'id':_0x2a4b7a[_0x5a45('0x40')]['id']}})[_0x5a45('0x16')](function(_0x40c6c5){if(!_0x40c6c5){logger[_0x5a45('0x1d')](_0x5a45('0x63'),_0x5a45('0x62'),0x194,_0x5a45('0x64'));_0x140e8c['sendStatus'](0x194);}else{if(_0x40c6c5[_0x5a45('0x65')]){throw new db[(_0x5a45('0x58'))][(_0x5a45('0x59'))](_0x5a45('0x66'));}}return _0x40c6c5;})[_0x5a45('0x16')](function(_0x4ea1f8){if(_0x4ea1f8){return _0x4ea1f8['update']({'closed':_0x2a4b7a[_0x5a45('0x30')][_0x5a45('0x67')],'disposition':_0x2a4b7a[_0x5a45('0x30')][_0x5a45('0x68')]})[_0x5a45('0x16')](function(_0x3c8343){return _0x3c8343;});}})['then'](function(){return respondWithRpcPromise(_0x5a45('0x69'),_0x5a45('0x62'),_0x2a4b7a[_0x5a45('0x30')],client9004);})[_0x5a45('0x16')](respondWithResult(_0x140e8c,null))[_0x5a45('0x3e')](handleError(_0x140e8c,null));};exports['attachmentUpload']=function(_0x4714e1,_0x569bd2){_0x4714e1[_0x5a45('0x30')][_0x5a45('0x2c')]=_0x4714e1[_0x5a45('0x6a')]['originalname'];_0x4714e1[_0x5a45('0x30')][_0x5a45('0x6b')]=_0x4714e1['file'][_0x5a45('0x6c')];_0x4714e1['body'][_0x5a45('0x37')]=_0x4714e1[_0x5a45('0x6a')][_0x5a45('0x6d')];return db['Attachment'][_0x5a45('0x49')](_0x4714e1[_0x5a45('0x30')])[_0x5a45('0x16')](respondWithResult(_0x569bd2,0xc9))['catch'](handleError(_0x569bd2,null));};exports[_0x5a45('0x6e')]=function(_0x6b8c70,_0x4c1caf){return db[_0x5a45('0x43')][_0x5a45('0x4c')]({'where':{'id':_0x6b8c70['params']['id']},'raw':!![]})[_0x5a45('0x16')](handleEntityNotFound(_0x4c1caf,null))[_0x5a45('0x16')](function(_0x594107){if(_0x594107){if(_0x594107[_0x5a45('0x67')]){return _0x4c1caf[_0x5a45('0x27')](0x193)[_0x5a45('0x22')]({'status':0x193,'message':_0x5a45('0x6f')});}return db[_0x5a45('0x70')]['findOne']({'where':{'id':_0x6b8c70[_0x5a45('0x3c')][_0x5a45('0x71')]},'raw':!![]})[_0x5a45('0x16')](handleEntityNotFound(_0x4c1caf,null));}})[_0x5a45('0x16')](function(_0x16a4b5){if(_0x16a4b5){var _0x316f8d=_0x16a4b5['ChatOfflineMessageId']!==null;var _0x29aa12=path[_0x5a45('0x72')](config[_0x5a45('0x73')],_0x5a45('0x74'));if(_0x316f8d){_0x29aa12=path[_0x5a45('0x72')](_0x29aa12,_0x5a45('0x75'));}var _0x255280=path['join'](_0x29aa12,_0x16a4b5['basename']);return _0x4c1caf[_0x5a45('0x76')](_0x255280);}})[_0x5a45('0x3e')](handleError(_0x4c1caf,null));};exports[_0x5a45('0x77')]=function(_0x4ac7a3,_0x16d6b2){var _0x319ad0=null;var _0x2f9564=null;var _0x49f63b=null;if(_0x4ac7a3['body']['id']){delete _0x4ac7a3[_0x5a45('0x30')]['id'];}if(_0x4ac7a3[_0x5a45('0x30')][_0x5a45('0x78')]){_0x49f63b=path[_0x5a45('0x72')](config['root'],_0x5a45('0x79'),util[_0x5a45('0x7a')]('transcript-%s.txt',Date[_0x5a45('0x7b')]()));_0x4ac7a3[_0x5a45('0x30')][_0x5a45('0x7c')]=_0x49f63b;}return db[_0x5a45('0x43')][_0x5a45('0x48')]({'where':{'id':_0x4ac7a3[_0x5a45('0x40')]['id']},'include':[{'model':db[_0x5a45('0x5c')],'as':_0x5a45('0x7d'),'include':[{'model':db[_0x5a45('0x7e')],'as':_0x5a45('0x7e')}]}]})[_0x5a45('0x16')](handleEntityNotFound(_0x16d6b2,null))[_0x5a45('0x16')](saveUpdates(_0x4ac7a3[_0x5a45('0x30')],null))[_0x5a45('0x16')](function(_0x3f2378){if(_0x3f2378){_0x319ad0=_0x3f2378;return db['ChatWebsite'][_0x5a45('0x48')]({'where':{'id':_0x319ad0['ChatWebsiteId']}});}})['then'](function(_0x3bc53f){if(_0x3bc53f){_0x2f9564=_0x3bc53f;return db[_0x5a45('0x60')][_0x5a45('0x48')]({'where':{'id':_0x319ad0['ContactId']}});}})['then'](function(_0x1cb195){if(_0x1cb195){if(_0x49f63b){var _0x2faf37=null;for(var _0x48801c=0x1;_0x48801c<_0x319ad0['Messages']['length'];++_0x48801c){_0x2faf37=_0x319ad0[_0x5a45('0x7d')][_0x48801c];var _0x31cb43=_0x2faf37['UserId']?util[_0x5a45('0x7a')]('%s%d',_0x2f9564['agentAlias'],_0x2faf37[_0x5a45('0x65')]):'System';var _0x414da4=_0x4ac7a3['body'][_0x5a45('0x7f')]||util[_0x5a45('0x7a')](_0x5a45('0x80'),_0x5a45('0x81'),_0x2faf37[_0x5a45('0x82')]);switch(_0x2f9564[_0x5a45('0x83')]){case _0x5a45('0x84'):_0x31cb43=_0x2faf37['UserId']?util[_0x5a45('0x7a')](_0x5a45('0x80'),_0x2f9564[_0x5a45('0x85')],_0x2faf37[_0x5a45('0x65')]):_0x5a45('0x86');break;case _0x5a45('0x87'):_0x31cb43=_0x2faf37[_0x5a45('0x65')]?_0x2faf37[_0x5a45('0x7e')][_0x5a45('0x88')]||_0x2faf37[_0x5a45('0x7e')]['fullname']:'System';break;case _0x5a45('0x89'):_0x31cb43=_0x2faf37['UserId']?_0x2faf37[_0x5a45('0x7e')][_0x5a45('0x52')]:_0x5a45('0x86');break;default:_0x31cb43=_0x2faf37[_0x5a45('0x65')]?util[_0x5a45('0x7a')](_0x5a45('0x80'),_0x2f9564[_0x5a45('0x85')],_0x2faf37[_0x5a45('0x65')]):_0x5a45('0x86');}var _0x1038c9=util[_0x5a45('0x7a')](_0x5a45('0x8a'),moment(_0x2faf37[_0x5a45('0x8b')])[_0x5a45('0x7a')](_0x5a45('0x8c')),_0x2faf37[_0x5a45('0x8d')]==='in'?_0x414da4:_0x31cb43,_0x2faf37['body']);if(!_0x2faf37[_0x5a45('0x8e')]){fs[_0x5a45('0x8f')](_0x49f63b,_0x1038c9);}}return db[_0x5a45('0x90')][_0x5a45('0x4c')]({'where':{'service':!![]},'include':[{'model':db[_0x5a45('0x91')],'as':_0x5a45('0x92'),'raw':!![],'include':[{'model':db[_0x5a45('0x93')],'as':_0x5a45('0x93'),'raw':!![]}]}]});}}})[_0x5a45('0x16')](function(_0x50c3a0){if(!_0x50c3a0||!_0x50c3a0[_0x5a45('0x92')]||!_0x4ac7a3[_0x5a45('0x30')])return _0x319ad0;var _0x2f859e=_0x50c3a0[_0x5a45('0x94')]();return respondWithRpcPromise(_0x5a45('0x95'),_0x5a45('0x96'),{'account':_0x2f859e,'message':{'from':util[_0x5a45('0x7a')](_0x5a45('0x97'),_0x50c3a0['name'],_0x50c3a0[_0x5a45('0x53')]||_0x50c3a0[_0x5a45('0x92')][_0x5a45('0x3d')]),'to':_0x4ac7a3[_0x5a45('0x30')][_0x5a45('0x78')],'subject':_0x5a45('0x98'),'text':util['format'](_0x5a45('0x99'),_0x4ac7a3['body'][_0x5a45('0x78')]),'attachments':[{'path':_0x49f63b}]}})['then'](function(){return _0x319ad0;})[_0x5a45('0x3e')](function(_0x3b6afe){logger[_0x5a45('0x1d')](_0x3b6afe);});})['then'](respondWithStatusCode(_0x16d6b2,0xc8))[_0x5a45('0x3e')](handleError(_0x16d6b2,null));};exports[_0x5a45('0x9a')]=function(_0x345c7b,_0x584da6){return db[_0x5a45('0x5c')][_0x5a45('0x48')]({'where':{'id':_0x345c7b['params']['id']}})[_0x5a45('0x16')](handleEntityNotFound(_0x584da6,null))['then'](function(_0x2b7c4a){if(_0x2b7c4a){return _0x2b7c4a[_0x5a45('0x9a')](_0x345c7b[_0x5a45('0x30')]['ids'],_[_0x5a45('0x9b')](_0x345c7b[_0x5a45('0x30')],[_0x5a45('0x9c'),'id'])||{});}})[_0x5a45('0x16')](respondWithResult(_0x584da6,null))[_0x5a45('0x3e')](handleError(_0x584da6,null));};exports[_0x5a45('0x9d')]=function(_0x3a35e4,_0x16de05){var _0x7d6213={'raw':![],'where':{}};var _0x170b52={};var _0x20498c={'count':0x0,'rows':[]};return db[_0x5a45('0x43')][_0x5a45('0x4c')]({'where':{'id':_0x3a35e4[_0x5a45('0x40')]['id']}})[_0x5a45('0x16')](handleEntityNotFound(_0x16de05,null))[_0x5a45('0x16')](function(_0x19c746){if(_0x19c746){_0x170b52[_0x5a45('0x41')]=_[_0x5a45('0x42')](db[_0x5a45('0x5c')][_0x5a45('0x35')]);_0x170b52['query']=_[_0x5a45('0x42')](_0x3a35e4['query']);_0x170b52[_0x5a45('0x9e')]=_[_0x5a45('0x44')](_0x170b52[_0x5a45('0x41')],_0x170b52[_0x5a45('0x3c')]);_0x7d6213[_0x5a45('0x45')]=_[_0x5a45('0x44')](_0x170b52[_0x5a45('0x41')],qs[_0x5a45('0x46')](_0x3a35e4[_0x5a45('0x3c')][_0x5a45('0x46')]));_0x7d6213['attributes']=_0x7d6213[_0x5a45('0x45')][_0x5a45('0x47')]?_0x7d6213[_0x5a45('0x45')]:_0x170b52['model'];if(!_0x3a35e4[_0x5a45('0x3c')][_0x5a45('0x9f')](_0x5a45('0xa0'))){_0x7d6213[_0x5a45('0x25')]=qs[_0x5a45('0x25')](_0x3a35e4[_0x5a45('0x3c')]['limit']);_0x7d6213[_0x5a45('0x23')]=qs[_0x5a45('0x23')](_0x3a35e4[_0x5a45('0x3c')][_0x5a45('0x23')]);}_0x7d6213[_0x5a45('0xa1')]=qs[_0x5a45('0xa2')](_0x3a35e4[_0x5a45('0x3c')]['sort']);_0x7d6213['where']=qs[_0x5a45('0x9e')](_['pick'](_0x3a35e4[_0x5a45('0x3c')],_0x170b52['filters']));_0x7d6213[_0x5a45('0xa3')]['ChatInteractionId']=_0x19c746['id'];if(_0x3a35e4[_0x5a45('0x3c')][_0x5a45('0xa4')]){_0x7d6213[_0x5a45('0xa3')]=_[_0x5a45('0x2f')](_0x7d6213[_0x5a45('0xa3')],{'$or':_[_0x5a45('0xa5')](_0x7d6213[_0x5a45('0x45')],function(_0x34ef9e){var _0x1b2e57={};_0x1b2e57[_0x34ef9e]={'$like':'%'+_0x3a35e4['query'][_0x5a45('0xa4')]+'%'};return _0x1b2e57;})});}if(_0x3a35e4[_0x5a45('0x3c')][_0x5a45('0xa6')]){var _0x1a63d1=_0x3a35e4['query']['$gte']['split'](',');var _0x5c99bf={};_0x5c99bf[_0x1a63d1[0x0]]={'$gte':moment(_0x1a63d1[0x1])[_0x5a45('0x7a')]('YYYY-MM-DD\x20HH:mm:ss')};_0x7d6213[_0x5a45('0xa3')]=_[_0x5a45('0x2f')](_0x7d6213[_0x5a45('0xa3')],_0x5c99bf);}_0x7d6213=_[_0x5a45('0x2f')]({},_0x7d6213,_0x3a35e4[_0x5a45('0xa7')]);return db[_0x5a45('0x5c')][_0x5a45('0x26')]({'where':_0x7d6213['where']})[_0x5a45('0x16')](function(_0x5496a1){_0x20498c['count']=_0x5496a1;if(_0x3a35e4[_0x5a45('0x3c')][_0x5a45('0xa8')]){_0x7d6213[_0x5a45('0xa9')]=[{'all':!![]}];}return db[_0x5a45('0x5c')]['findAll'](_0x7d6213);})['then'](function(_0x4866a8){_0x20498c['rows']=_0x4866a8;return _0x20498c;});}})['then'](respondWithFilteredResult(_0x16de05,_0x7d6213))[_0x5a45('0x3e')](handleError(_0x16de05,null));};exports[_0x5a45('0xaa')]=function(_0x3c6dc4,_0x494cad){var _0x3c11bd={'where':{}},_0x4ea70f={},_0x50bf70={'count':0x0,'rows':[]};return db[_0x5a45('0x43')][_0x5a45('0x4c')]({'where':{'id':_0x3c6dc4[_0x5a45('0x40')]['id']}})[_0x5a45('0x16')](handleEntityNotFound(_0x494cad,null))[_0x5a45('0x16')](function(_0x801467){if(_0x801467){_0x4ea70f[_0x5a45('0x41')]=_[_0x5a45('0x42')](db[_0x5a45('0x5c')][_0x5a45('0x35')]);_0x4ea70f[_0x5a45('0x3c')]=_[_0x5a45('0x42')](_0x3c6dc4['query']);_0x4ea70f[_0x5a45('0x9e')]=_[_0x5a45('0x44')](_0x4ea70f[_0x5a45('0x41')],_0x4ea70f[_0x5a45('0x3c')]);_0x3c11bd['attributes']=_[_0x5a45('0x44')](_0x4ea70f[_0x5a45('0x41')],qs[_0x5a45('0x46')](_0x3c6dc4['query'][_0x5a45('0x46')]));_0x3c11bd['attributes']=_0x3c11bd['attributes']['length']?_0x3c11bd[_0x5a45('0x45')]:_0x4ea70f[_0x5a45('0x41')];if(!_0x3c6dc4[_0x5a45('0x3c')][_0x5a45('0x9f')]('nolimit')){_0x3c11bd[_0x5a45('0x25')]=qs[_0x5a45('0x25')](_0x3c6dc4[_0x5a45('0x3c')][_0x5a45('0x25')]);_0x3c11bd[_0x5a45('0x23')]=qs[_0x5a45('0x23')](_0x3c6dc4['query']['offset']);}_0x3c11bd[_0x5a45('0xa1')]=qs[_0x5a45('0xa2')](_0x3c6dc4[_0x5a45('0x3c')][_0x5a45('0xa2')]);_0x3c11bd[_0x5a45('0xa3')]=qs[_0x5a45('0x9e')](_[_0x5a45('0xab')](_0x3c6dc4[_0x5a45('0x3c')],_0x4ea70f['filters']));_0x3c11bd[_0x5a45('0xa3')][_0x5a45('0xac')]=_0x801467['id'];if(_0x3c6dc4[_0x5a45('0x3c')]['filter']){_0x3c11bd[_0x5a45('0xa3')]=_['merge'](_0x3c11bd[_0x5a45('0xa3')],{'$or':_['map'](_0x3c11bd[_0x5a45('0x45')],function(_0x282483){var _0x2cfeb0={};_0x2cfeb0[_0x282483]={'$like':'%'+_0x3c6dc4['query']['filter']+'%'};return _0x2cfeb0;})});}_0x3c11bd['where'][_0x5a45('0x8e')]=![];if(_0x3c6dc4['query']['id']){_0x3c11bd['where']['id']={'$gt':_0x3c6dc4['query']['id']};}_0x3c11bd=_[_0x5a45('0x2f')]({},_0x3c11bd,_0x3c6dc4['options']);return db[_0x5a45('0x5c')]['count']({'where':_0x3c11bd[_0x5a45('0xa3')]})[_0x5a45('0x16')](function(_0x2ae8c8){_0x50bf70[_0x5a45('0x26')]=_0x2ae8c8;_0x3c11bd[_0x5a45('0xa9')]=[];if(_0x3c6dc4[_0x5a45('0x3c')]['includeAgent']){_0x3c11bd[_0x5a45('0xa9')][_0x5a45('0xad')]({'model':db[_0x5a45('0x7e')],'as':_0x5a45('0x7e'),'attributes':['id',_0x5a45('0x52'),_0x5a45('0x88')]});}if(_0x3c6dc4[_0x5a45('0x3c')][_0x5a45('0xa8')]){_0x3c11bd[_0x5a45('0xa9')]=[{'all':!![]}];}return db[_0x5a45('0x5c')]['findAll'](_0x3c11bd);})[_0x5a45('0x16')](function(_0x25e098){_0x50bf70[_0x5a45('0xae')]=_0x25e098;return _0x50bf70;});}})[_0x5a45('0x16')](respondWithFilteredResult(_0x494cad,_0x3c11bd))[_0x5a45('0x3e')](handleError(_0x494cad,null));};exports[_0x5a45('0xaf')]=function(_0x24b047,_0x5cf499){return db[_0x5a45('0x43')][_0x5a45('0x48')]({'where':{'id':_0x24b047[_0x5a45('0x40')]['id']}})[_0x5a45('0x16')](handleEntityNotFound(_0x5cf499,null))[_0x5a45('0x16')](function(_0x4bcf61){if(_0x4bcf61){return _0x4bcf61[_0x5a45('0xb0')](_0x24b047[_0x5a45('0x30')][_0x5a45('0x9c')],_[_0x5a45('0x9b')](_0x24b047[_0x5a45('0x30')],[_0x5a45('0x9c'),'id'])||{})[_0x5a45('0xb1')](function(){return db[_0x5a45('0xb2')][_0x5a45('0x3a')]({'attributes':['id','name','color'],'where':{'id':_0x24b047[_0x5a45('0x30')][_0x5a45('0x9c')]}});})['then'](function(_0x249ebe){socket['emit'](_0x5a45('0xb3'),{'id':Number(_0x24b047[_0x5a45('0x40')]['id']),'tags':_0x249ebe||[]});return{'id':Number(_0x24b047[_0x5a45('0x40')]['id']),'tags':_0x249ebe||[]};});}})[_0x5a45('0x16')](respondWithResult(_0x5cf499,null))[_0x5a45('0x3e')](handleError(_0x5cf499,null));};exports['removeTags']=function(_0x6a1ffb,_0x32fca2){return db[_0x5a45('0x43')][_0x5a45('0x48')]({'where':{'id':_0x6a1ffb[_0x5a45('0x40')]['id']}})['then'](handleEntityNotFound(_0x32fca2,null))[_0x5a45('0x16')](function(_0x27b564){if(_0x27b564){return _0x27b564[_0x5a45('0xb4')](_0x6a1ffb[_0x5a45('0x3c')][_0x5a45('0x9c')]);}})[_0x5a45('0x16')](respondWithStatusCode(_0x32fca2,null))[_0x5a45('0x3e')](handleError(_0x32fca2,null));};exports['download']=function(_0x2c295c,_0x6bb5){var _0x418bde=moment()['unix']()[_0x5a45('0xb5')]();var _0x4e92bc=path['join'](config[_0x5a45('0x73')],_0x5a45('0xb6'),_0x5a45('0xb7'),_0x5a45('0xb8'));var _0x19a471=path['join'](config[_0x5a45('0x73')],_0x5a45('0xb6'),_0x5a45('0xb7'),'attachments');var _0x27e602=path['join'](_0x4e92bc,_0x418bde);var _0xc5198f=util['format'](_0x5a45('0xb9'),_0x2c295c[_0x5a45('0x40')]['id'],_0x418bde);var _0x549e98=path['join'](_0x4e92bc,_0xc5198f);var _0x4b5de9=[];_0x4b5de9[_0x5a45('0xad')]({'model':db[_0x5a45('0x7e')],'as':'User','attributes':['id',_0x5a45('0x52')],'raw':!![]});_0x4b5de9['push']({'model':db[_0x5a45('0x60')],'as':_0x5a45('0x61'),'attributes':['id',_0x5a45('0xba'),'lastName'],'raw':!![]});if(_0x2c295c[_0x5a45('0x3c')][_0x5a45('0xbb')]){_0x4b5de9['push']({'model':db[_0x5a45('0x70')],'as':_0x5a45('0x70'),'raw':!![]});}var _0x26172e=[{'model':db['ChatMessage'],'as':_0x5a45('0x7d'),'attributes':['id',_0x5a45('0x30'),_0x5a45('0x8b'),_0x5a45('0x8d'),_0x5a45('0x8e'),_0x5a45('0xbc')],'include':_0x4b5de9}];_0x26172e[_0x5a45('0xad')]({'model':db[_0x5a45('0x4d')],'as':_0x5a45('0xbd'),'attributes':['id',_0x5a45('0x2c')]});_0x26172e['push']({'model':db[_0x5a45('0x7e')],'as':'Owner','attributes':['id','fullname']});return db[_0x5a45('0x43')][_0x5a45('0x48')]({'where':{'id':_0x2c295c['params']['id']},'include':_0x26172e})[_0x5a45('0x16')](handleEntityNotFound(_0x6bb5,null))[_0x5a45('0x16')](function(_0x402650){if(_0x402650){var _0x4df848=_0x402650['get']({'plain':!![]});fs[_0x5a45('0xbe')](_0x27e602);var _0x4463b4={'channel':_0x5a45('0xbf'),'account':_0x4df848['Account'][_0x5a45('0x2c')],'agent':_0x4df848[_0x5a45('0xc0')]?_0x4df848['Owner'][_0x5a45('0x52')]:_0x5a45('0xc1'),'createdAt':moment(_0x4df848[_0x5a45('0x8b')])[_0x5a45('0x7a')](_0x5a45('0xc2'))[_0x5a45('0xb5')](),'closedAt':_0x4df848[_0x5a45('0x67')]?moment(_0x4df848[_0x5a45('0xc3')])[_0x5a45('0x7a')](_0x5a45('0xc2'))['toString']():'','disposition':_0x4df848['disposition'],'chatInfo':{'browser':_0x4df848[_0x5a45('0xc4')],'os':_0x4df848[_0x5a45('0xc5')],'referer':_0x4df848[_0x5a45('0xc6')],'customerIp':_0x4df848['customerIp'],'customerPort':_0x4df848[_0x5a45('0xc7')]?_0x4df848[_0x5a45('0xc7')]:'N.A.'},'messages':_(_0x4df848[_0x5a45('0x7d')])[_0x5a45('0xc8')]()['filter']({'secret':![]})[_0x5a45('0xa5')](function(_0x4a67f3){if(_0x4a67f3['Attachment']){var _0xaf4d38=path[_0x5a45('0x72')](_0x19a471,_0x4a67f3[_0x5a45('0x70')][_0x5a45('0x6b')]);if(fs[_0x5a45('0xc9')](_0xaf4d38)){fs['createReadStream'](_0xaf4d38)[_0x5a45('0xca')](fs[_0x5a45('0xcb')](path['join'](_0x27e602,_0x4a67f3[_0x5a45('0x70')]['basename'])));}}return{'date':moment(_0x4a67f3[_0x5a45('0x8b')])[_0x5a45('0x7a')](_0x5a45('0xc2'))[_0x5a45('0xb5')](),'sender':_0x4a67f3['direction']===_0x5a45('0x5b')?_0x4a67f3[_0x5a45('0x7e')]?_0x4a67f3[_0x5a45('0x7e')][_0x5a45('0x52')]:_0x5a45('0x86'):_0x4a67f3[_0x5a45('0x61')][_0x5a45('0xba')]+(_0x4a67f3['Contact'][_0x5a45('0xcc')]?'\x20'+_0x4a67f3['Contact'][_0x5a45('0xcc')]:''),'body':_0x4a67f3[_0x5a45('0x70')]?_0x4a67f3['Attachment']['basename']:_0x4a67f3[_0x5a45('0x30')],'direction':_0x4a67f3[_0x5a45('0x8d')]===_0x5a45('0x5b')?'A':'C','secret':_0x4a67f3[_0x5a45('0x8e')],'read':_0x4a67f3[_0x5a45('0xbc')],'attachment':_0x4a67f3[_0x5a45('0x70')]};})[_0x5a45('0xcd')]()};return ejs[_0x5a45('0xce')](path[_0x5a45('0x72')](config[_0x5a45('0x73')],'server','views',_0x5a45('0xcf')),{'interaction':_0x4463b4})[_0x5a45('0x16')](function(_0xc5179c){var _0x1b82f0=path[_0x5a45('0x72')](_0x27e602,_0x5a45('0xd0')+_0x4df848['id']+'-'+_0x418bde+_0x5a45('0xd1'));var _0x1921b7={'path':_0x1b82f0,'channel':'Chat','interactionId':_0x4df848['id']};return pdf[_0x5a45('0xd2')](_0xc5179c,_0x1921b7);})[_0x5a45('0x16')](function(){return new Promise(function(_0x4642a1,_0x224fd6){zipdir(_0x27e602,{'saveTo':_0x549e98},function(_0x56add9,_0x3d5c42){if(_0x56add9)return _0x224fd6(_0x56add9);return _0x4642a1(_0x3d5c42);});})['then'](function(){return new BPromise(function(_0xcc20ab,_0x25972e){rimraf(_0x27e602,function(_0x582f5a){if(_0x582f5a)_0x25972e(_0x582f5a);return _0xcc20ab();});});})[_0x5a45('0x16')](function(){return _0x6bb5['download'](_0x549e98,_0xc5198f,function(_0x31b15d){if(_0x31b15d){logger[_0x5a45('0x1d')](_0x5a45('0xd3'),_0x31b15d);}else{fs[_0x5a45('0xd4')](_0x549e98);}});});});}else{return _0x6bb5[_0x5a45('0x20')](0xc8);}})[_0x5a45('0x3e')](handleError(_0x6bb5,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index d4e7c3e..3997959 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 _0x8be0=['exports','../../mysqldb','ChatInteraction','setMaxListeners','save','update','getUsers','then','setDataValue','Users','map','findAll','length','emit','catch','hasOwnProperty','hook'];(function(_0x296923,_0x4adaed){var _0x29af70=function(_0x4eeedb){while(--_0x4eeedb){_0x296923['push'](_0x296923['shift']());}};_0x29af70(++_0x4adaed);}(_0x8be0,0x1bb));var _0x08be=function(_0x28c90d,_0x8b6881){_0x28c90d=_0x28c90d-0x0;var _0x11192c=_0x8be0[_0x28c90d];return _0x11192c;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x08be('0x0'))['db'][_0x08be('0x1')];var ChatMessage=require(_0x08be('0x0'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x08be('0x2')](0x0);var events={'afterCreate':_0x08be('0x3'),'afterUpdate':_0x08be('0x4'),'afterDestroy':'remove'};function emitEvent(_0x531916){return function(_0x551966,_0x4e79e1,_0xfcd226){_0x551966[_0x08be('0x5')]({'attributes':['id'],'raw':!![]})[_0x08be('0x6')](function(_0x581453){_0x551966[_0x08be('0x7')](_0x08be('0x8'),_0x581453[_0x08be('0x9')](function(_0x29c9f0){return{'id':_0x29c9f0['id']};}));return ChatMessage[_0x08be('0xa')]({'where':{'ChatInteractionId':_0x551966['id'],'direction':'in','read':![]},'raw':!![]});})[_0x08be('0x6')](function(_0x5e940a){_0x551966[_0x08be('0x7')]('unreadMessages',_0x5e940a[_0x08be('0xb')]);ChatInteractionEvents['emit'](_0x531916+':'+_0x551966['id'],_0x551966);ChatInteractionEvents[_0x08be('0xc')](_0x531916,_0x551966);_0xfcd226(null);})[_0x08be('0xd')](_0xfcd226(null));};}for(var e in events){if(events[_0x08be('0xe')](e)){var event=events[e];ChatInteraction[_0x08be('0xf')](e,emitEvent(event));}}module[_0x08be('0x10')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x71c3=['Users','length','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save','update','getUsers','then','setDataValue'];(function(_0x58788d,_0x88b74f){var _0x58ceba=function(_0x16a416){while(--_0x16a416){_0x58788d['push'](_0x58788d['shift']());}};_0x58ceba(++_0x88b74f);}(_0x71c3,0x94));var _0x371c=function(_0x8260fc,_0x3a6497){_0x8260fc=_0x8260fc-0x0;var _0x37bc17=_0x71c3[_0x8260fc];return _0x37bc17;};'use strict';var EventEmitter=require(_0x371c('0x0'));var ChatInteraction=require(_0x371c('0x1'))['db']['ChatInteraction'];var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x371c('0x2')](0x0);var events={'afterCreate':_0x371c('0x3'),'afterUpdate':_0x371c('0x4'),'afterDestroy':'remove'};function emitEvent(_0x50a708){return function(_0x4aaf00,_0x25da25,_0x1c7ffb){_0x4aaf00[_0x371c('0x5')]({'attributes':['id'],'raw':!![]})[_0x371c('0x6')](function(_0x113f10){_0x4aaf00[_0x371c('0x7')](_0x371c('0x8'),_0x113f10['map'](function(_0x2fc240){return{'id':_0x2fc240['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x4aaf00['id'],'direction':'in','read':![]},'raw':!![]});})[_0x371c('0x6')](function(_0xa55d26){_0x4aaf00[_0x371c('0x7')]('unreadMessages',_0xa55d26[_0x371c('0x9')]);ChatInteractionEvents[_0x371c('0xa')](_0x50a708+':'+_0x4aaf00['id'],_0x4aaf00);ChatInteractionEvents[_0x371c('0xa')](_0x50a708,_0x4aaf00);_0x1c7ffb(null);})['catch'](_0x1c7ffb(null));};}for(var e in events){if(events[_0x371c('0xb')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x371c('0xc')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 1a3ab7e..1d14121 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 _0x44b0=['path','rimraf','../../config/environment','./chatInteraction.attributes','ChatInteraction','chat_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise'];(function(_0x261739,_0x105b65){var _0xac23e2=function(_0x28167c){while(--_0x28167c){_0x261739['push'](_0x261739['shift']());}};_0xac23e2(++_0x105b65);}(_0x44b0,0xe4));var _0x044b=function(_0x3b7606,_0x1ec1fd){_0x3b7606=_0x3b7606-0x0;var _0x1c6a0c=_0x44b0[_0x3b7606];return _0x1c6a0c;};'use strict';var _=require(_0x044b('0x0'));var util=require(_0x044b('0x1'));var logger=require('../../config/logger')(_0x044b('0x2'));var moment=require(_0x044b('0x3'));var BPromise=require(_0x044b('0x4'));var rp=require(_0x044b('0x5'));var fs=require('fs');var path=require(_0x044b('0x6'));var rimraf=require(_0x044b('0x7'));var config=require(_0x044b('0x8'));var attributes=require(_0x044b('0x9'));module['exports']=function(_0x580771,_0x1871a8){return _0x580771['define'](_0x044b('0xa'),attributes,{'tableName':_0x044b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x51d9a5,_0x24ce5b,_0x1be1e5){if(_0x51d9a5[_0x044b('0xc')]('closed')){_0x51d9a5[_0x044b('0xd')]=moment()[_0x044b('0xe')](_0x044b('0xf'));}_0x1be1e5(null,_0x51d9a5);}},'charset':_0x044b('0x10'),'collate':_0x044b('0x11')});};
\ No newline at end of file
+var _0xbe4d=['request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','chat_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2a5099,_0x329e92){var _0x2802f1=function(_0x53f99b){while(--_0x53f99b){_0x2a5099['push'](_0x2a5099['shift']());}};_0x2802f1(++_0x329e92);}(_0xbe4d,0xc2));var _0xdbe4=function(_0x3617f1,_0x39b6a2){_0x3617f1=_0x3617f1-0x0;var _0x5b09a6=_0xbe4d[_0x3617f1];return _0x5b09a6;};'use strict';var _=require(_0xdbe4('0x0'));var util=require(_0xdbe4('0x1'));var logger=require(_0xdbe4('0x2'))(_0xdbe4('0x3'));var moment=require(_0xdbe4('0x4'));var BPromise=require(_0xdbe4('0x5'));var rp=require(_0xdbe4('0x6'));var fs=require('fs');var path=require(_0xdbe4('0x7'));var rimraf=require(_0xdbe4('0x8'));var config=require(_0xdbe4('0x9'));var attributes=require(_0xdbe4('0xa'));module[_0xdbe4('0xb')]=function(_0x4fa111,_0x2f6d84){return _0x4fa111[_0xdbe4('0xc')]('ChatInteraction',attributes,{'tableName':_0xdbe4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x19f46e,_0x4f1282,_0xce7aa1){if(_0x19f46e[_0xdbe4('0xe')](_0xdbe4('0xf'))){_0x19f46e[_0xdbe4('0x10')]=moment()['format'](_0xdbe4('0x11'));}_0xce7aa1(null,_0x19f46e);}},'charset':_0xdbe4('0x12'),'collate':_0xdbe4('0x13')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index b854d0b..1a5ae5e 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 _0x4590=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','register','request','then','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','body','options','raw','where','attributes','limit','UpdateChatInteraction','stringify','catch','AddTagsToChatInteraction','ChatInteraction','addTags','ids','omit','AddTags','lodash','util'];(function(_0x3c929e,_0x55dea5){var _0x42adbb=function(_0x4d97ca){while(--_0x4d97ca){_0x3c929e['push'](_0x3c929e['shift']());}};_0x42adbb(++_0x55dea5);}(_0x4590,0x198));var _0x0459=function(_0x4d36a4,_0x303dd0){_0x4d36a4=_0x4d36a4-0x0;var _0x8d4548=_0x4590[_0x4d36a4];return _0x8d4548;};'use strict';var _=require(_0x0459('0x0'));var util=require(_0x0459('0x1'));var moment=require(_0x0459('0x2'));var BPromise=require(_0x0459('0x3'));var rs=require(_0x0459('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0459('0x5'))['db'];var utils=require(_0x0459('0x6'));var logger=require(_0x0459('0x7'))('rpc');var config=require(_0x0459('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0459('0x9')]['http']({'port':0x232a});config[_0x0459('0xa')]=_[_0x0459('0xb')](config[_0x0459('0xa')],{'host':_0x0459('0xc'),'port':0x18eb});var socket=require(_0x0459('0xd'))(new Redis(config[_0x0459('0xa')]));require('./chatInteraction.socket')[_0x0459('0xe')](socket);function respondWithRpcPromise(_0x39f3fa,_0x28dc30,_0x1eb4bb){return new BPromise(function(_0x44f20e,_0x197faf){return client[_0x0459('0xf')](_0x39f3fa,_0x1eb4bb)[_0x0459('0x10')](function(_0x3dc0cd){logger['info'](_0x0459('0x11'),_0x28dc30,'request\x20sent');logger[_0x0459('0x12')](_0x0459('0x13'),_0x28dc30,_0x0459('0x14'),JSON['stringify'](_0x3dc0cd));if(_0x3dc0cd['error']){if(_0x3dc0cd[_0x0459('0x15')][_0x0459('0x16')]===0x1f4){logger[_0x0459('0x15')](_0x0459('0x11'),_0x28dc30,_0x3dc0cd[_0x0459('0x15')][_0x0459('0x17')]);return _0x197faf(_0x3dc0cd[_0x0459('0x15')][_0x0459('0x17')]);}logger[_0x0459('0x15')](_0x0459('0x11'),_0x28dc30,_0x3dc0cd[_0x0459('0x15')][_0x0459('0x17')]);return _0x44f20e(_0x3dc0cd[_0x0459('0x15')][_0x0459('0x17')]);}else{logger[_0x0459('0x18')](_0x0459('0x11'),_0x28dc30,_0x0459('0x14'));_0x44f20e(_0x3dc0cd[_0x0459('0x19')]['message']);}})['catch'](function(_0x4a20f2){logger[_0x0459('0x15')](_0x0459('0x11'),_0x28dc30,_0x4a20f2);_0x197faf(_0x4a20f2);});});}exports['UpdateChatInteraction']=function(_0x24a7d2){var _0x18db53=this;return new Promise(function(_0x1cc1da,_0x217392){return db['ChatInteraction']['update'](_0x24a7d2[_0x0459('0x1a')],{'raw':_0x24a7d2[_0x0459('0x1b')]?_0x24a7d2[_0x0459('0x1b')][_0x0459('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24a7d2['options']?_0x24a7d2['options'][_0x0459('0x1d')]||null:null,'attributes':_0x24a7d2[_0x0459('0x1b')]?_0x24a7d2['options'][_0x0459('0x1e')]||null:null,'limit':_0x24a7d2[_0x0459('0x1b')]?_0x24a7d2[_0x0459('0x1b')][_0x0459('0x1f')]||null:null})['then'](function(_0x6d59f8){logger['info'](_0x0459('0x20'),_0x24a7d2);logger[_0x0459('0x12')](_0x0459('0x20'),_0x24a7d2,JSON[_0x0459('0x21')](_0x6d59f8));_0x1cc1da(_0x6d59f8);})[_0x0459('0x22')](function(_0x4aba61){logger['error'](_0x0459('0x20'),_0x4aba61['message'],_0x24a7d2);_0x217392(_0x18db53[_0x0459('0x15')](0x1f4,_0x4aba61[_0x0459('0x17')]));});});};exports[_0x0459('0x23')]=function(_0xc21bd5){return new Promise(function(_0x1ebf5c,_0x49e6e4){return db[_0x0459('0x24')]['find']({'where':_0xc21bd5[_0x0459('0x1b')]?_0xc21bd5[_0x0459('0x1b')][_0x0459('0x1d')]||null:null})[_0x0459('0x10')](function(_0x4843b4){if(_0x4843b4){return _0x4843b4[_0x0459('0x25')](_0xc21bd5['body'][_0x0459('0x26')],_[_0x0459('0x27')](_0xc21bd5[_0x0459('0x1a')],['ids','id'])||{});}})['spread'](function(_0x58690d){logger[_0x0459('0x18')](_0x0459('0x28'),_0xc21bd5);logger[_0x0459('0x12')](_0x0459('0x28'),_0xc21bd5,JSON[_0x0459('0x21')](_0x58690d));_0x1ebf5c(_0x58690d);})[_0x0459('0x22')](function(_0x52de7d){logger[_0x0459('0x15')](_0x0459('0x28'),_0x52de7d['message'],_0xc21bd5);_0x49e6e4(_this[_0x0459('0x15')](0x1f4,_0x52de7d['message']));});});};
\ No newline at end of file
+var _0x3f9f=['message','result','UpdateChatInteraction','update','body','options','raw','where','then','AddTagsToChatInteraction','ChatInteraction','omit','ids','spread','AddTags','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatInteraction.socket','register','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x5ec2b1,_0x45b985){var _0x5966a1=function(_0x4251a7){while(--_0x4251a7){_0x5ec2b1['push'](_0x5ec2b1['shift']());}};_0x5966a1(++_0x45b985);}(_0x3f9f,0xd3));var _0xf3f9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3f9f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf3f9('0x0'));var util=require(_0xf3f9('0x1'));var moment=require(_0xf3f9('0x2'));var BPromise=require(_0xf3f9('0x3'));var rs=require(_0xf3f9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf3f9('0x5'));var logger=require('../../config/logger')(_0xf3f9('0x6'));var config=require(_0xf3f9('0x7'));var jayson=require(_0xf3f9('0x8'));var client=jayson[_0xf3f9('0x9')][_0xf3f9('0xa')]({'port':0x232a});config[_0xf3f9('0xb')]=_[_0xf3f9('0xc')](config['redis'],{'host':_0xf3f9('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf3f9('0xb')]));require(_0xf3f9('0xe'))[_0xf3f9('0xf')](socket);function respondWithRpcPromise(_0x22542a,_0x20a8e0,_0x3db040){return new BPromise(function(_0x505a78,_0xc72294){return client['request'](_0x22542a,_0x3db040)['then'](function(_0x373f81){logger[_0xf3f9('0x10')](_0xf3f9('0x11'),_0x20a8e0,_0xf3f9('0x12'));logger[_0xf3f9('0x13')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x20a8e0,_0xf3f9('0x12'),JSON[_0xf3f9('0x14')](_0x373f81));if(_0x373f81['error']){if(_0x373f81[_0xf3f9('0x15')][_0xf3f9('0x16')]===0x1f4){logger[_0xf3f9('0x15')](_0xf3f9('0x11'),_0x20a8e0,_0x373f81[_0xf3f9('0x15')][_0xf3f9('0x17')]);return _0xc72294(_0x373f81[_0xf3f9('0x15')][_0xf3f9('0x17')]);}logger['error'](_0xf3f9('0x11'),_0x20a8e0,_0x373f81[_0xf3f9('0x15')][_0xf3f9('0x17')]);return _0x505a78(_0x373f81[_0xf3f9('0x15')]['message']);}else{logger[_0xf3f9('0x10')](_0xf3f9('0x11'),_0x20a8e0,_0xf3f9('0x12'));_0x505a78(_0x373f81[_0xf3f9('0x18')][_0xf3f9('0x17')]);}})['catch'](function(_0x10273c){logger['error'](_0xf3f9('0x11'),_0x20a8e0,_0x10273c);_0xc72294(_0x10273c);});});}exports[_0xf3f9('0x19')]=function(_0x4a44ec){var _0x3ff0d9=this;return new Promise(function(_0x58aa55,_0x3157e3){return db['ChatInteraction'][_0xf3f9('0x1a')](_0x4a44ec[_0xf3f9('0x1b')],{'raw':_0x4a44ec[_0xf3f9('0x1c')]?_0x4a44ec['options'][_0xf3f9('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a44ec[_0xf3f9('0x1c')]?_0x4a44ec[_0xf3f9('0x1c')][_0xf3f9('0x1e')]||null:null,'attributes':_0x4a44ec[_0xf3f9('0x1c')]?_0x4a44ec['options']['attributes']||null:null,'limit':_0x4a44ec[_0xf3f9('0x1c')]?_0x4a44ec['options']['limit']||null:null})[_0xf3f9('0x1f')](function(_0x28da3a){logger['info'](_0xf3f9('0x19'),_0x4a44ec);logger[_0xf3f9('0x13')](_0xf3f9('0x19'),_0x4a44ec,JSON['stringify'](_0x28da3a));_0x58aa55(_0x28da3a);})['catch'](function(_0x56e6b8){logger['error'](_0xf3f9('0x19'),_0x56e6b8[_0xf3f9('0x17')],_0x4a44ec);_0x3157e3(_0x3ff0d9[_0xf3f9('0x15')](0x1f4,_0x56e6b8[_0xf3f9('0x17')]));});});};exports[_0xf3f9('0x20')]=function(_0x5f3bb5){return new Promise(function(_0x5f0638,_0x383e80){return db[_0xf3f9('0x21')]['find']({'where':_0x5f3bb5[_0xf3f9('0x1c')]?_0x5f3bb5['options'][_0xf3f9('0x1e')]||null:null})[_0xf3f9('0x1f')](function(_0x35557e){if(_0x35557e){return _0x35557e['addTags'](_0x5f3bb5[_0xf3f9('0x1b')]['ids'],_[_0xf3f9('0x22')](_0x5f3bb5[_0xf3f9('0x1b')],[_0xf3f9('0x23'),'id'])||{});}})[_0xf3f9('0x24')](function(_0x58c3e2){logger['info']('AddTags',_0x5f3bb5);logger[_0xf3f9('0x13')](_0xf3f9('0x25'),_0x5f3bb5,JSON['stringify'](_0x58c3e2));_0x5f0638(_0x58c3e2);})[_0xf3f9('0x26')](function(_0x17d548){logger[_0xf3f9('0x15')](_0xf3f9('0x25'),_0x17d548['message'],_0x5f3bb5);_0x383e80(_this[_0xf3f9('0x15')](0x1f4,_0x17d548['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 076b964..1ce37ac 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 _0xe168=['length','./chatInteraction.events','save','remove','update','emit','removeListener','register'];(function(_0x27fc19,_0x4d0f5a){var _0x475511=function(_0x4e91b3){while(--_0x4e91b3){_0x27fc19['push'](_0x27fc19['shift']());}};_0x475511(++_0x4d0f5a);}(_0xe168,0x159));var _0x8e16=function(_0x4890cb,_0x58b6ec){_0x4890cb=_0x4890cb-0x0;var _0x40b461=_0xe168[_0x4890cb];return _0x40b461;};'use strict';var ChatInteractionEvents=require(_0x8e16('0x0'));var events=[_0x8e16('0x1'),_0x8e16('0x2'),_0x8e16('0x3')];function createListener(_0x2b4f30,_0x3bcd25){return function(_0x3120ab){_0x3bcd25[_0x8e16('0x4')](_0x2b4f30,_0x3120ab);};}function removeListener(_0x2f2e59,_0x5fddf9){return function(){ChatInteractionEvents[_0x8e16('0x5')](_0x2f2e59,_0x5fddf9);};}exports[_0x8e16('0x6')]=function(_0x1da151){for(var _0x5e01ef=0x0,_0x122315=events[_0x8e16('0x7')];_0x5e01ef<_0x122315;_0x5e01ef++){var _0xbab5e4=events[_0x5e01ef];var _0xb901dc=createListener('chatInteraction:'+_0xbab5e4,_0x1da151);ChatInteractionEvents['on'](_0xbab5e4,_0xb901dc);}};
\ No newline at end of file
+var _0x8b7c=['length','chatInteraction:','./chatInteraction.events','save','remove','update','emit','removeListener','register'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x8b7c,0x119));var _0xc8b7=function(_0x20ff64,_0x5c3677){_0x20ff64=_0x20ff64-0x0;var _0x5580db=_0x8b7c[_0x20ff64];return _0x5580db;};'use strict';var ChatInteractionEvents=require(_0xc8b7('0x0'));var events=[_0xc8b7('0x1'),_0xc8b7('0x2'),_0xc8b7('0x3')];function createListener(_0x2473cc,_0x47766d){return function(_0x47089d){_0x47766d[_0xc8b7('0x4')](_0x2473cc,_0x47089d);};}function removeListener(_0x4f66ab,_0x85fa34){return function(){ChatInteractionEvents[_0xc8b7('0x5')](_0x4f66ab,_0x85fa34);};}exports[_0xc8b7('0x6')]=function(_0x4a8b93){for(var _0x256c78=0x0,_0x90cb38=events[_0xc8b7('0x7')];_0x256c78<_0x90cb38;_0x256c78++){var _0x2c7807=events[_0x256c78];var _0x9e4763=createListener(_0xc8b7('0x8')+_0x2c7807,_0x4a8b93);ChatInteractionEvents['on'](_0x2c7807,_0x9e4763);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index f96b8e9..32a218c 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 _0xaa6c=['join','format','%s-%s','originalname','replace','post','/:id/attachment_upload','file','attachmentUpload','tracked','chatinteraction:addtags','addTags','put','chat','chatinteraction:update','update','/:id/custom_update','customUpdate','abandon','/:id/close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','/:id/messages','/:id/my_messages','download','/:id/vidaoo','createVidaooSession','diskStorage'];(function(_0x3005d5,_0xf588c7){var _0x547c7e=function(_0x4514dc){while(--_0x4514dc){_0x3005d5['push'](_0x3005d5['shift']());}};_0x547c7e(++_0xf588c7);}(_0xaa6c,0x1c9));var _0xcaa6=function(_0x504df1,_0x289598){_0x504df1=_0x504df1-0x0;var _0x1063b5=_0xaa6c[_0x504df1];return _0x1063b5;};'use strict';var multer=require(_0xcaa6('0x0'));var util=require(_0xcaa6('0x1'));var path=require('path');var timeout=require(_0xcaa6('0x2'));var express=require(_0xcaa6('0x3'));var router=express['Router']();var fs_extra=require(_0xcaa6('0x4'));var auth=require(_0xcaa6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xcaa6('0x6'));var controller=require(_0xcaa6('0x7'));router[_0xcaa6('0x8')]('/',auth[_0xcaa6('0x9')](),controller[_0xcaa6('0xa')]);router[_0xcaa6('0x8')](_0xcaa6('0xb'),auth[_0xcaa6('0x9')](),controller[_0xcaa6('0xc')]);router[_0xcaa6('0x8')](_0xcaa6('0xd'),auth[_0xcaa6('0xe')](),controller['show']);router[_0xcaa6('0x8')](_0xcaa6('0xf'),auth[_0xcaa6('0xe')](),controller[_0xcaa6('0x10')]);router[_0xcaa6('0x8')](_0xcaa6('0x11'),auth[_0xcaa6('0x9')](),controller['getMessages']);router[_0xcaa6('0x8')](_0xcaa6('0x12'),auth[_0xcaa6('0xe')](),controller['getMyMessages']);router[_0xcaa6('0x8')]('/:id/download',auth[_0xcaa6('0x9')](),controller[_0xcaa6('0x13')]);router['post']('/',auth[_0xcaa6('0x9')](),controller['create']);router['post'](_0xcaa6('0x14'),auth[_0xcaa6('0x9')](),controller[_0xcaa6('0x15')]);var upload=multer({'storage':multer[_0xcaa6('0x16')]({'destination':function(_0x1a7f96,_0x202d45,_0x562b75){_0x562b75(null,path[_0xcaa6('0x17')](config['root'],'server/files/attachments/'));},'filename':function(_0x5c746b,_0x4766b3,_0x4e2bf9){_0x4e2bf9(null,util[_0xcaa6('0x18')](_0xcaa6('0x19'),Date['now'](),_0x4766b3[_0xcaa6('0x1a')][_0xcaa6('0x1b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xcaa6('0x1c')](_0xcaa6('0x1d'),upload['single'](_0xcaa6('0x1e')),controller[_0xcaa6('0x1f')]);router[_0xcaa6('0x1c')]('/:id/messages',auth[_0xcaa6('0xe')](),controller['addMessage']);router[_0xcaa6('0x1c')]('/:id/tags',auth['isAuthenticated'](),interaction[_0xcaa6('0x20')]('chat',_0xcaa6('0x21')),controller[_0xcaa6('0x22')]);router[_0xcaa6('0x23')]('/:id',auth[_0xcaa6('0x9')](),interaction[_0xcaa6('0x20')](_0xcaa6('0x24'),_0xcaa6('0x25')),controller[_0xcaa6('0x26')]);router[_0xcaa6('0x23')](_0xcaa6('0x27'),controller[_0xcaa6('0x28')]);router[_0xcaa6('0x23')]('/:id/abandon',auth[_0xcaa6('0xe')](),controller[_0xcaa6('0x29')]);router[_0xcaa6('0x23')](_0xcaa6('0x2a'),controller['close']);router[_0xcaa6('0x2b')]('/:id',auth[_0xcaa6('0x9')](),interaction['tracked'](_0xcaa6('0x24'),_0xcaa6('0x2c')),controller[_0xcaa6('0x2d')]);router[_0xcaa6('0x2b')]('/:id/tags',auth[_0xcaa6('0x9')](),controller[_0xcaa6('0x2e')]);module[_0xcaa6('0x2f')]=router;
\ No newline at end of file
+var _0xe0de=['single','file','attachmentUpload','addMessage','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','./chatInteraction.controller','get','index','isAuthenticated','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages','/:id/my_messages','/:id/download','download','post','/:id/vidaoo','diskStorage','join','format','%s-%s','now','replace','/:id/attachment_upload'];(function(_0x4f3367,_0x5b29b2){var _0x354b00=function(_0x35c813){while(--_0x35c813){_0x4f3367['push'](_0x4f3367['shift']());}};_0x354b00(++_0x5b29b2);}(_0xe0de,0x116));var _0xee0d=function(_0x199586,_0x51bd4e){_0x199586=_0x199586-0x0;var _0x1e822b=_0xe0de[_0x199586];return _0x1e822b;};'use strict';var multer=require(_0xee0d('0x0'));var util=require(_0xee0d('0x1'));var path=require('path');var timeout=require(_0xee0d('0x2'));var express=require(_0xee0d('0x3'));var router=express[_0xee0d('0x4')]();var fs_extra=require(_0xee0d('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xee0d('0x6'));router[_0xee0d('0x7')]('/',auth['isAuthenticated'](),controller[_0xee0d('0x8')]);router[_0xee0d('0x7')]('/describe',auth[_0xee0d('0x9')](),controller['describe']);router['get'](_0xee0d('0xa'),auth['isChatInteractionAuthorized'](),controller[_0xee0d('0xb')]);router[_0xee0d('0x7')](_0xee0d('0xc'),auth[_0xee0d('0xd')](),controller[_0xee0d('0xe')]);router[_0xee0d('0x7')](_0xee0d('0xf'),auth[_0xee0d('0x9')](),controller['getMessages']);router[_0xee0d('0x7')](_0xee0d('0x10'),auth[_0xee0d('0xd')](),controller['getMyMessages']);router[_0xee0d('0x7')](_0xee0d('0x11'),auth['isAuthenticated'](),controller[_0xee0d('0x12')]);router[_0xee0d('0x13')]('/',auth[_0xee0d('0x9')](),controller['create']);router['post'](_0xee0d('0x14'),auth[_0xee0d('0x9')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0xee0d('0x15')]({'destination':function(_0x3ca726,_0x53c53f,_0x29e024){_0x29e024(null,path[_0xee0d('0x16')](config['root'],'server/files/attachments/'));},'filename':function(_0x4e4db1,_0xe83562,_0x44c186){_0x44c186(null,util[_0xee0d('0x17')](_0xee0d('0x18'),Date[_0xee0d('0x19')](),_0xe83562['originalname'][_0xee0d('0x1a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xee0d('0x13')](_0xee0d('0x1b'),upload[_0xee0d('0x1c')](_0xee0d('0x1d')),controller[_0xee0d('0x1e')]);router[_0xee0d('0x13')](_0xee0d('0xf'),auth[_0xee0d('0xd')](),controller[_0xee0d('0x1f')]);router[_0xee0d('0x13')]('/:id/tags',auth['isAuthenticated'](),interaction[_0xee0d('0x20')](_0xee0d('0x21'),_0xee0d('0x22')),controller[_0xee0d('0x23')]);router[_0xee0d('0x24')](_0xee0d('0xa'),auth[_0xee0d('0x9')](),interaction[_0xee0d('0x20')]('chat',_0xee0d('0x25')),controller[_0xee0d('0x26')]);router['put'](_0xee0d('0x27'),controller[_0xee0d('0x28')]);router[_0xee0d('0x24')](_0xee0d('0x29'),auth[_0xee0d('0xd')](),controller[_0xee0d('0x2a')]);router[_0xee0d('0x24')](_0xee0d('0x2b'),controller[_0xee0d('0x2c')]);router[_0xee0d('0x2d')](_0xee0d('0xa'),auth['isAuthenticated'](),interaction[_0xee0d('0x20')](_0xee0d('0x21'),_0xee0d('0x2e')),controller[_0xee0d('0x2f')]);router[_0xee0d('0x2d')](_0xee0d('0x30'),auth[_0xee0d('0x9')](),controller[_0xee0d('0x31')]);module[_0xee0d('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 24d934e..0b42713 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 _0x1fa4=['sequelize','exports','medium','INTEGER'];(function(_0x33016a,_0xf0fba8){var _0x7c659b=function(_0x3f82cf){while(--_0x3f82cf){_0x33016a['push'](_0x33016a['shift']());}};_0x7c659b(++_0xf0fba8);}(_0x1fa4,0xf0));var _0x41fa=function(_0x109407,_0x2d87fb){_0x109407=_0x109407-0x0;var _0x3ec159=_0x1fa4[_0x109407];return _0x3ec159;};'use strict';var Sequelize=require(_0x41fa('0x0'));module[_0x41fa('0x1')]={'body':{'type':Sequelize['TEXT'](_0x41fa('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x41fa('0x3')]}};
\ No newline at end of file
+var _0xf31e=['INTEGER','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x58fe5a,_0x53d1d9){var _0x1f788b=function(_0x31d773){while(--_0x31d773){_0x58fe5a['push'](_0x58fe5a['shift']());}};_0x1f788b(++_0x53d1d9);}(_0xf31e,0xdf));var _0xef31=function(_0x3a0c29,_0x325570){_0x3a0c29=_0x3a0c29-0x0;var _0x5b0b9c=_0xf31e[_0x3a0c29];return _0x5b0b9c;};'use strict';var Sequelize=require(_0xef31('0x0'));module[_0xef31('0x1')]={'body':{'type':Sequelize[_0xef31('0x2')](_0xef31('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xef31('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xef31('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 1557927..ad8d14f 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 _0x5192=['zip-dir','fast-json-patch','bluebird','util','path','sox','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','end','stack','name','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','ChatInternalMessage','includeAll','include','catch','show','params','keys','options','find','create','body','describe','get','messages','lastMessageAt','createdAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','user','userpic','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Agents','autoAssociation','UserProfileResource','findAll','isEmpty','agent','push','FromId','ToId','read','-createdAt','all','eml-format','rimraf'];(function(_0x1886c8,_0x1179d3){var _0x3e26e5=function(_0x557191){while(--_0x557191){_0x1886c8['push'](_0x1886c8['shift']());}};_0x3e26e5(++_0x1179d3);}(_0x5192,0xce));var _0x2519=function(_0x572dc4,_0x48dec4){_0x572dc4=_0x572dc4-0x0;var _0x18a792=_0x5192[_0x572dc4];return _0x18a792;};'use strict';var emlformat=require(_0x2519('0x0'));var rimraf=require(_0x2519('0x1'));var zipdir=require(_0x2519('0x2'));var jsonpatch=require(_0x2519('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2519('0x4'));var Mustache=require('mustache');var util=require(_0x2519('0x5'));var path=require(_0x2519('0x6'));var sox=require(_0x2519('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2519('0x8'));var _=require(_0x2519('0x9'));var squel=require('squel');var crypto=require(_0x2519('0xa'));var jsforce=require(_0x2519('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2519('0xc'));var Papa=require(_0x2519('0xd'));var Redis=require(_0x2519('0xe'));var authService=require(_0x2519('0xf'));var qs=require(_0x2519('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2519('0x11'))('api');var utils=require(_0x2519('0x12'));var config=require(_0x2519('0x13'));var licenseUtil=require(_0x2519('0x14'));var db=require(_0x2519('0x15'))['db'];config['redis']=_['defaults'](config[_0x2519('0x16')],{'host':_0x2519('0x17'),'port':0x18eb});var socket=require(_0x2519('0x18'))(new Redis(config[_0x2519('0x16')]));require(_0x2519('0x19'))[_0x2519('0x1a')](socket);function respondWithStatusCode(_0x3c4dbc,_0x364930){_0x364930=_0x364930||0xcc;return function(_0x21d97d){if(_0x21d97d){return _0x3c4dbc['sendStatus'](_0x364930);}return _0x3c4dbc[_0x2519('0x1b')](_0x364930)['end']();};}function respondWithResult(_0x451e63,_0x58f555){_0x58f555=_0x58f555||0xc8;return function(_0x56ce38){if(_0x56ce38){return _0x451e63['status'](_0x58f555)[_0x2519('0x1c')](_0x56ce38);}};}function respondWithFilteredResult(_0x1949bd,_0x59f649){return function(_0x37df53){if(_0x37df53){var _0x424c26=typeof _0x59f649[_0x2519('0x1d')]===_0x2519('0x1e')&&typeof _0x59f649[_0x2519('0x1f')]===_0x2519('0x1e');var _0x2a8691=_0x37df53['count'];var _0x3a5223=_0x424c26?0x0:_0x59f649[_0x2519('0x1d')];var _0x42f68a=_0x424c26?_0x37df53[_0x2519('0x20')]:_0x59f649[_0x2519('0x1d')]+_0x59f649['limit'];var _0x43c474;if(_0x42f68a>=_0x2a8691){_0x42f68a=_0x2a8691;_0x43c474=0xc8;}else{_0x43c474=0xce;}_0x1949bd[_0x2519('0x1b')](_0x43c474);return _0x1949bd[_0x2519('0x21')]('Content-Range',_0x3a5223+'-'+_0x42f68a+'/'+_0x2a8691)[_0x2519('0x1c')](_0x37df53);}return null;};}function patchUpdates(_0x1779db){return function(_0x16a3c6){try{jsonpatch[_0x2519('0x22')](_0x16a3c6,_0x1779db,!![]);}catch(_0x563de7){return BPromise[_0x2519('0x23')](_0x563de7);}return _0x16a3c6[_0x2519('0x24')]();};}function saveUpdates(_0x382a19,_0x1b03a1){return function(_0x22061d){if(_0x22061d){return _0x22061d[_0x2519('0x25')](_0x382a19)[_0x2519('0x26')](function(_0x4b507c){return _0x4b507c;});}return null;};}function removeEntity(_0x52a908,_0x8512d5){return function(_0xbc1147){if(_0xbc1147){return _0xbc1147[_0x2519('0x27')]()[_0x2519('0x26')](function(){_0x52a908['status'](0xcc)[_0x2519('0x28')]();});}};}function handleEntityNotFound(_0x340a58,_0x3f05fa){return function(_0xf62d14){if(!_0xf62d14){_0x340a58['sendStatus'](0x194);}return _0xf62d14;};}function handleError(_0x536c48,_0x292b65){_0x292b65=_0x292b65||0x1f4;return function(_0x38dbdf){logger['error'](_0x38dbdf[_0x2519('0x29')]);if(_0x38dbdf[_0x2519('0x2a')]){delete _0x38dbdf[_0x2519('0x2a')];}_0x536c48[_0x2519('0x1b')](_0x292b65)['send'](_0x38dbdf);};}exports[_0x2519('0x2b')]=function(_0x429ca5,_0x5f0a4c){var _0x556c64={},_0x393bad={},_0x33ddff={'count':0x0,'rows':[]};var _0x3a37e8=_[_0x2519('0x2c')](db['ChatInternalMessage'][_0x2519('0x2d')],function(_0x20ba66){return{'name':_0x20ba66[_0x2519('0x2e')],'type':_0x20ba66[_0x2519('0x2f')][_0x2519('0x30')]};});_0x393bad['model']=_[_0x2519('0x2c')](_0x3a37e8,_0x2519('0x2a'));_0x393bad[_0x2519('0x31')]=_['keys'](_0x429ca5[_0x2519('0x31')]);_0x393bad[_0x2519('0x32')]=_[_0x2519('0x33')](_0x393bad[_0x2519('0x34')],_0x393bad[_0x2519('0x31')]);_0x556c64[_0x2519('0x35')]=_[_0x2519('0x33')](_0x393bad[_0x2519('0x34')],qs[_0x2519('0x36')](_0x429ca5[_0x2519('0x31')][_0x2519('0x36')]));_0x556c64[_0x2519('0x35')]=_0x556c64[_0x2519('0x35')][_0x2519('0x37')]?_0x556c64[_0x2519('0x35')]:_0x393bad['model'];if(!_0x429ca5['query']['hasOwnProperty'](_0x2519('0x38'))){_0x556c64[_0x2519('0x1f')]=qs[_0x2519('0x1f')](_0x429ca5['query'][_0x2519('0x1f')]);_0x556c64[_0x2519('0x1d')]=qs[_0x2519('0x1d')](_0x429ca5['query'][_0x2519('0x1d')]);}_0x556c64[_0x2519('0x39')]=qs[_0x2519('0x3a')](_0x429ca5[_0x2519('0x31')][_0x2519('0x3a')]);_0x556c64[_0x2519('0x3b')]=qs['filters'](_[_0x2519('0x3c')](_0x429ca5[_0x2519('0x31')],_0x393bad[_0x2519('0x32')]),_0x3a37e8);if(_0x429ca5[_0x2519('0x31')]['filter']){_0x556c64[_0x2519('0x3b')]=_[_0x2519('0x3d')](_0x556c64['where'],{'$or':_[_0x2519('0x2c')](_0x3a37e8,function(_0x1bc9a6){if(_0x1bc9a6['type']!==_0x2519('0x3e')){var _0x520bde={};_0x520bde[_0x1bc9a6['name']]={'$like':'%'+_0x429ca5['query'][_0x2519('0x3f')]+'%'};return _0x520bde;}})});}_0x556c64=_['merge']({},_0x556c64,_0x429ca5['options']);var _0x5c0d9b={'where':_0x556c64['where']};return db[_0x2519('0x40')][_0x2519('0x20')](_0x5c0d9b)[_0x2519('0x26')](function(_0x552933){_0x33ddff['count']=_0x552933;if(_0x429ca5[_0x2519('0x31')][_0x2519('0x41')]){_0x556c64[_0x2519('0x42')]=[{'all':!![]}];}return db[_0x2519('0x40')]['findAll'](_0x556c64);})[_0x2519('0x26')](function(_0x2376d6){_0x33ddff['rows']=_0x2376d6;return _0x33ddff;})[_0x2519('0x26')](respondWithFilteredResult(_0x5f0a4c,_0x556c64))[_0x2519('0x43')](handleError(_0x5f0a4c,null));};exports[_0x2519('0x44')]=function(_0x1599b1,_0x189064){var _0x55fa3d={'raw':!![],'where':{'id':_0x1599b1[_0x2519('0x45')]['id']}},_0x3e7bc9={};_0x3e7bc9[_0x2519('0x34')]=_['keys'](db[_0x2519('0x40')][_0x2519('0x2d')]);_0x3e7bc9[_0x2519('0x31')]=_[_0x2519('0x46')](_0x1599b1[_0x2519('0x31')]);_0x3e7bc9[_0x2519('0x32')]=_[_0x2519('0x33')](_0x3e7bc9[_0x2519('0x34')],_0x3e7bc9['query']);_0x55fa3d['attributes']=_['intersection'](_0x3e7bc9['model'],qs[_0x2519('0x36')](_0x1599b1['query'][_0x2519('0x36')]));_0x55fa3d[_0x2519('0x35')]=_0x55fa3d[_0x2519('0x35')]['length']?_0x55fa3d[_0x2519('0x35')]:_0x3e7bc9['model'];if(_0x1599b1['query'][_0x2519('0x41')]){_0x55fa3d['include']=[{'all':!![]}];}_0x55fa3d=_[_0x2519('0x3d')]({},_0x55fa3d,_0x1599b1[_0x2519('0x47')]);return db['ChatInternalMessage'][_0x2519('0x48')](_0x55fa3d)[_0x2519('0x26')](handleEntityNotFound(_0x189064,null))['then'](respondWithResult(_0x189064,null))[_0x2519('0x43')](handleError(_0x189064,null));};exports[_0x2519('0x49')]=function(_0x11fc7d,_0x3dccec){return db['ChatInternalMessage']['create'](_0x11fc7d[_0x2519('0x4a')],{})[_0x2519('0x26')](respondWithResult(_0x3dccec,0xc9))['catch'](handleError(_0x3dccec,null));};exports[_0x2519('0x25')]=function(_0x5255f9,_0x44dcf7){if(_0x5255f9[_0x2519('0x4a')]['id']){delete _0x5255f9[_0x2519('0x4a')]['id'];}return db[_0x2519('0x40')]['find']({'where':{'id':_0x5255f9[_0x2519('0x45')]['id']}})[_0x2519('0x26')](handleEntityNotFound(_0x44dcf7,null))[_0x2519('0x26')](saveUpdates(_0x5255f9[_0x2519('0x4a')],null))[_0x2519('0x26')](respondWithResult(_0x44dcf7,null))[_0x2519('0x43')](handleError(_0x44dcf7,null));};exports[_0x2519('0x27')]=function(_0x556b88,_0xbcb7aa){return db[_0x2519('0x40')][_0x2519('0x48')]({'where':{'id':_0x556b88[_0x2519('0x45')]['id']}})[_0x2519('0x26')](handleEntityNotFound(_0xbcb7aa,null))[_0x2519('0x26')](removeEntity(_0xbcb7aa,null))[_0x2519('0x43')](handleError(_0xbcb7aa,null));};exports[_0x2519('0x4b')]=function(_0x1bfd04,_0x23ab4a){return db['ChatInternalMessage'][_0x2519('0x4b')]()[_0x2519('0x26')](respondWithResult(_0x23ab4a,null))[_0x2519('0x43')](handleError(_0x23ab4a,null));};function wrapUser(_0x27718f){return function(_0x2fe6b3){var _0x1745cf=_0x27718f[_0x2519('0x4c')]({'plain':!![]});_0x1745cf[_0x2519('0x4d')]=[];if(_0x2fe6b3){_0x1745cf[_0x2519('0x4e')]=_0x2fe6b3[_0x2519('0x4f')];_0x1745cf[_0x2519('0x50')]=_0x2fe6b3;}else{_0x1745cf[_0x2519('0x4e')]=moment(0x0)['format'](_0x2519('0x51'));_0x1745cf['lastMessage']={};}return _0x1745cf;};}exports['getUsers']=function(_0x43e5f4,_0x3fb717,_0x172b89){var _0x18cb49=[];return db['User']['findAll']({'where':{'role':['agent','admin',_0x2519('0x52')]},'attributes':['id','fullname',_0x2519('0x2a'),'role',_0x2519('0x53'),'internal','online',_0x2519('0x54'),_0x2519('0x55'),_0x2519('0x56')],'order':qs[_0x2519('0x3a')]('-online'),'include':[{'model':db[_0x2519('0x57')],'as':_0x2519('0x58'),'attributes':['id',_0x2519('0x2a'),_0x2519('0x2f')],'through':{'attributes':[]}}]})[_0x2519('0x26')](function(_0x474788){if(_0x474788){var _0x3bdfbf=_0x43e5f4['user'][_0x2519('0x4c')]({'plain':!![]});if(!_0x3bdfbf)throw new Error(_0x2519('0x59'));if(_0x3bdfbf[_0x2519('0x5a')]===_0x2519('0x52')){return db[_0x2519('0x5b')]['find']({'where':{'name':_0x2519('0x5c'),'userProfileId':_0x3bdfbf['userProfileId']},'raw':!![]})[_0x2519('0x26')](function(_0x8e8259){if(_0x8e8259){if(_0x8e8259[_0x2519('0x5d')]===0x0){return db[_0x2519('0x5e')][_0x2519('0x5f')]({'where':{'sectionId':_0x8e8259['id']},'raw':!![]})['then'](function(_0x384ac6){var _0x46a9bd=[];if(_[_0x2519('0x60')](_0x384ac6)){_0x46a9bd=_[_0x2519('0x3f')](_0x474788,function(_0x6c04a9){if(_0x6c04a9['role']!=='agent'){return _0x6c04a9;}});return _0x46a9bd;}else{for(var _0x388461=0x0;_0x388461<_0x474788[_0x2519('0x37')];_0x388461++){var _0x347f49=_0x474788[_0x388461];if(_0x347f49[_0x2519('0x5a')]===_0x2519('0x61')){var _0x4de8d5=_['find'](_0x384ac6,function(_0x2adcfe){return _0x2adcfe['resourceId']===_0x347f49['id'];});if(_0x4de8d5)_0x46a9bd[_0x2519('0x62')](_0x347f49);}else{_0x46a9bd[_0x2519('0x62')](_0x347f49);}}return _0x46a9bd;}});}else{return _0x474788;}}else{var _0x293ec9=_[_0x2519('0x3f')](_0x474788,function(_0x3dfbc8){if(_0x3dfbc8['role']!==_0x2519('0x61')){return _0x3dfbc8;}});return _0x293ec9;}});}else{return _0x474788;}}})[_0x2519('0x26')](function(_0x283d28){var _0xff57a9=[];if(_0x283d28){_0x18cb49=_0x283d28;for(var _0x356b0a=0x0;_0x356b0a<_0x283d28[_0x2519('0x37')];_0x356b0a+=0x1){_0x18cb49[_0x356b0a][_0x2519('0x4d')]=[];_0xff57a9['push'](db[_0x2519('0x40')][_0x2519('0x48')]({'where':{'FromId':[_0x43e5f4[_0x2519('0x52')]['id'],_0x283d28[_0x356b0a]['id']],'ToId':[_0x43e5f4[_0x2519('0x52')]['id'],_0x283d28[_0x356b0a]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x2519('0x63'),_0x2519('0x64'),_0x2519('0x65'),_0x2519('0x4a')],'order':qs[_0x2519('0x3a')](_0x2519('0x66')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x2519('0x26')](wrapUser(_0x283d28[_0x356b0a])));}return BPromise[_0x2519('0x67')](_0xff57a9);}return[];})[_0x2519('0x26')](function(_0x286889){return{'rows':_0x286889,'count':_0x286889['length']};})['then'](respondWithResult(_0x3fb717,null))[_0x2519('0x43')](handleError(_0x3fb717,null));};
\ No newline at end of file
+var _0x4ca5=['includeAll','include','findAll','catch','show','params','options','find','create','body','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','-online','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','isEmpty','agent','resourceId','push','FromId','read','-createdAt','all','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x4ca5,0x1ec));var _0x54ca=function(_0x43dab4,_0x112f40){_0x43dab4=_0x43dab4-0x0;var _0x289fad=_0x4ca5[_0x43dab4];return _0x289fad;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x54ca('0x0'));var jsonpatch=require(_0x54ca('0x1'));var rp=require(_0x54ca('0x2'));var moment=require(_0x54ca('0x3'));var BPromise=require(_0x54ca('0x4'));var Mustache=require(_0x54ca('0x5'));var util=require(_0x54ca('0x6'));var path=require('path');var sox=require(_0x54ca('0x7'));var csv=require(_0x54ca('0x8'));var ejs=require(_0x54ca('0x9'));var fs=require('fs');var fs_extra=require(_0x54ca('0xa'));var _=require(_0x54ca('0xb'));var squel=require(_0x54ca('0xc'));var crypto=require('crypto');var jsforce=require(_0x54ca('0xd'));var deskjs=require(_0x54ca('0xe'));var toCsv=require(_0x54ca('0x8'));var querystring=require(_0x54ca('0xf'));var Papa=require(_0x54ca('0x10'));var Redis=require(_0x54ca('0x11'));var authService=require(_0x54ca('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x54ca('0x13'));var hardwareService=require(_0x54ca('0x14'));var logger=require(_0x54ca('0x15'))(_0x54ca('0x16'));var utils=require(_0x54ca('0x17'));var config=require(_0x54ca('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x54ca('0x19'))['db'];config['redis']=_[_0x54ca('0x1a')](config[_0x54ca('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x54ca('0x1c'))(new Redis(config[_0x54ca('0x1b')]));require('./chatInternalMessage.socket')[_0x54ca('0x1d')](socket);function respondWithStatusCode(_0x85b1e2,_0x3df142){_0x3df142=_0x3df142||0xcc;return function(_0x5a542a){if(_0x5a542a){return _0x85b1e2[_0x54ca('0x1e')](_0x3df142);}return _0x85b1e2[_0x54ca('0x1f')](_0x3df142)[_0x54ca('0x20')]();};}function respondWithResult(_0xa90419,_0x36f6c9){_0x36f6c9=_0x36f6c9||0xc8;return function(_0x599d83){if(_0x599d83){return _0xa90419[_0x54ca('0x1f')](_0x36f6c9)['json'](_0x599d83);}};}function respondWithFilteredResult(_0x46c0e9,_0xc2cc2c){return function(_0x29cca0){if(_0x29cca0){var _0x381be4=typeof _0xc2cc2c[_0x54ca('0x21')]===_0x54ca('0x22')&&typeof _0xc2cc2c[_0x54ca('0x23')]===_0x54ca('0x22');var _0x3e8917=_0x29cca0[_0x54ca('0x24')];var _0x1867f4=_0x381be4?0x0:_0xc2cc2c[_0x54ca('0x21')];var _0x11a297=_0x381be4?_0x29cca0[_0x54ca('0x24')]:_0xc2cc2c[_0x54ca('0x21')]+_0xc2cc2c[_0x54ca('0x23')];var _0x1ba494;if(_0x11a297>=_0x3e8917){_0x11a297=_0x3e8917;_0x1ba494=0xc8;}else{_0x1ba494=0xce;}_0x46c0e9[_0x54ca('0x1f')](_0x1ba494);return _0x46c0e9[_0x54ca('0x25')](_0x54ca('0x26'),_0x1867f4+'-'+_0x11a297+'/'+_0x3e8917)[_0x54ca('0x27')](_0x29cca0);}return null;};}function patchUpdates(_0x221f8d){return function(_0x52615d){try{jsonpatch[_0x54ca('0x28')](_0x52615d,_0x221f8d,!![]);}catch(_0x5ab031){return BPromise[_0x54ca('0x29')](_0x5ab031);}return _0x52615d[_0x54ca('0x2a')]();};}function saveUpdates(_0xa51a79,_0x1ef138){return function(_0x23fe5a){if(_0x23fe5a){return _0x23fe5a[_0x54ca('0x2b')](_0xa51a79)[_0x54ca('0x2c')](function(_0x2c6a39){return _0x2c6a39;});}return null;};}function removeEntity(_0x49475e,_0x1b7262){return function(_0x1e2283){if(_0x1e2283){return _0x1e2283[_0x54ca('0x2d')]()['then'](function(){_0x49475e[_0x54ca('0x1f')](0xcc)[_0x54ca('0x20')]();});}};}function handleEntityNotFound(_0x3e113f,_0x27acda){return function(_0xbe121){if(!_0xbe121){_0x3e113f[_0x54ca('0x1e')](0x194);}return _0xbe121;};}function handleError(_0x5f42e8,_0x388c52){_0x388c52=_0x388c52||0x1f4;return function(_0x4d760a){logger[_0x54ca('0x2e')](_0x4d760a[_0x54ca('0x2f')]);if(_0x4d760a['name']){delete _0x4d760a['name'];}_0x5f42e8[_0x54ca('0x1f')](_0x388c52)[_0x54ca('0x30')](_0x4d760a);};}exports[_0x54ca('0x31')]=function(_0x43359b,_0x363dbc){var _0x13a49a={},_0x19ef99={},_0x31f585={'count':0x0,'rows':[]};var _0xce9745=_[_0x54ca('0x32')](db[_0x54ca('0x33')][_0x54ca('0x34')],function(_0x45acbe){return{'name':_0x45acbe[_0x54ca('0x35')],'type':_0x45acbe[_0x54ca('0x36')]['key']};});_0x19ef99[_0x54ca('0x37')]=_[_0x54ca('0x32')](_0xce9745,_0x54ca('0x38'));_0x19ef99[_0x54ca('0x39')]=_[_0x54ca('0x3a')](_0x43359b[_0x54ca('0x39')]);_0x19ef99['filters']=_[_0x54ca('0x3b')](_0x19ef99[_0x54ca('0x37')],_0x19ef99[_0x54ca('0x39')]);_0x13a49a[_0x54ca('0x3c')]=_[_0x54ca('0x3b')](_0x19ef99[_0x54ca('0x37')],qs[_0x54ca('0x3d')](_0x43359b[_0x54ca('0x39')][_0x54ca('0x3d')]));_0x13a49a[_0x54ca('0x3c')]=_0x13a49a[_0x54ca('0x3c')][_0x54ca('0x3e')]?_0x13a49a[_0x54ca('0x3c')]:_0x19ef99[_0x54ca('0x37')];if(!_0x43359b[_0x54ca('0x39')][_0x54ca('0x3f')](_0x54ca('0x40'))){_0x13a49a[_0x54ca('0x23')]=qs['limit'](_0x43359b[_0x54ca('0x39')][_0x54ca('0x23')]);_0x13a49a[_0x54ca('0x21')]=qs[_0x54ca('0x21')](_0x43359b['query']['offset']);}_0x13a49a[_0x54ca('0x41')]=qs[_0x54ca('0x42')](_0x43359b['query']['sort']);_0x13a49a[_0x54ca('0x43')]=qs[_0x54ca('0x44')](_[_0x54ca('0x45')](_0x43359b['query'],_0x19ef99[_0x54ca('0x44')]),_0xce9745);if(_0x43359b[_0x54ca('0x39')]['filter']){_0x13a49a[_0x54ca('0x43')]=_[_0x54ca('0x46')](_0x13a49a[_0x54ca('0x43')],{'$or':_['map'](_0xce9745,function(_0x508f80){if(_0x508f80[_0x54ca('0x36')]!==_0x54ca('0x47')){var _0x3008a4={};_0x3008a4[_0x508f80[_0x54ca('0x38')]]={'$like':'%'+_0x43359b['query'][_0x54ca('0x48')]+'%'};return _0x3008a4;}})});}_0x13a49a=_[_0x54ca('0x46')]({},_0x13a49a,_0x43359b['options']);var _0x3f369e={'where':_0x13a49a[_0x54ca('0x43')]};return db[_0x54ca('0x33')]['count'](_0x3f369e)[_0x54ca('0x2c')](function(_0x10298f){_0x31f585[_0x54ca('0x24')]=_0x10298f;if(_0x43359b[_0x54ca('0x39')][_0x54ca('0x49')]){_0x13a49a[_0x54ca('0x4a')]=[{'all':!![]}];}return db[_0x54ca('0x33')][_0x54ca('0x4b')](_0x13a49a);})['then'](function(_0x31a219){_0x31f585['rows']=_0x31a219;return _0x31f585;})['then'](respondWithFilteredResult(_0x363dbc,_0x13a49a))[_0x54ca('0x4c')](handleError(_0x363dbc,null));};exports[_0x54ca('0x4d')]=function(_0x14e602,_0x3c3a6a){var _0x137bb8={'raw':!![],'where':{'id':_0x14e602[_0x54ca('0x4e')]['id']}},_0x518c5d={};_0x518c5d[_0x54ca('0x37')]=_[_0x54ca('0x3a')](db[_0x54ca('0x33')][_0x54ca('0x34')]);_0x518c5d[_0x54ca('0x39')]=_[_0x54ca('0x3a')](_0x14e602[_0x54ca('0x39')]);_0x518c5d['filters']=_[_0x54ca('0x3b')](_0x518c5d[_0x54ca('0x37')],_0x518c5d[_0x54ca('0x39')]);_0x137bb8[_0x54ca('0x3c')]=_[_0x54ca('0x3b')](_0x518c5d[_0x54ca('0x37')],qs[_0x54ca('0x3d')](_0x14e602[_0x54ca('0x39')]['fields']));_0x137bb8[_0x54ca('0x3c')]=_0x137bb8[_0x54ca('0x3c')][_0x54ca('0x3e')]?_0x137bb8[_0x54ca('0x3c')]:_0x518c5d['model'];if(_0x14e602[_0x54ca('0x39')]['includeAll']){_0x137bb8['include']=[{'all':!![]}];}_0x137bb8=_[_0x54ca('0x46')]({},_0x137bb8,_0x14e602[_0x54ca('0x4f')]);return db['ChatInternalMessage'][_0x54ca('0x50')](_0x137bb8)['then'](handleEntityNotFound(_0x3c3a6a,null))[_0x54ca('0x2c')](respondWithResult(_0x3c3a6a,null))['catch'](handleError(_0x3c3a6a,null));};exports[_0x54ca('0x51')]=function(_0x4c94c2,_0x404911){return db[_0x54ca('0x33')][_0x54ca('0x51')](_0x4c94c2[_0x54ca('0x52')],{})['then'](respondWithResult(_0x404911,0xc9))[_0x54ca('0x4c')](handleError(_0x404911,null));};exports[_0x54ca('0x2b')]=function(_0x50eea7,_0x318868){if(_0x50eea7[_0x54ca('0x52')]['id']){delete _0x50eea7[_0x54ca('0x52')]['id'];}return db[_0x54ca('0x33')][_0x54ca('0x50')]({'where':{'id':_0x50eea7[_0x54ca('0x4e')]['id']}})[_0x54ca('0x2c')](handleEntityNotFound(_0x318868,null))[_0x54ca('0x2c')](saveUpdates(_0x50eea7[_0x54ca('0x52')],null))[_0x54ca('0x2c')](respondWithResult(_0x318868,null))[_0x54ca('0x4c')](handleError(_0x318868,null));};exports[_0x54ca('0x2d')]=function(_0x5d8f2d,_0x3ebb9e){return db['ChatInternalMessage'][_0x54ca('0x50')]({'where':{'id':_0x5d8f2d[_0x54ca('0x4e')]['id']}})[_0x54ca('0x2c')](handleEntityNotFound(_0x3ebb9e,null))[_0x54ca('0x2c')](removeEntity(_0x3ebb9e,null))[_0x54ca('0x4c')](handleError(_0x3ebb9e,null));};exports[_0x54ca('0x53')]=function(_0x231f59,_0x291953){return db[_0x54ca('0x33')][_0x54ca('0x53')]()[_0x54ca('0x2c')](respondWithResult(_0x291953,null))['catch'](handleError(_0x291953,null));};function wrapUser(_0x4b38d0){return function(_0x3c55cb){var _0x31e707=_0x4b38d0[_0x54ca('0x54')]({'plain':!![]});_0x31e707[_0x54ca('0x55')]=[];if(_0x3c55cb){_0x31e707[_0x54ca('0x56')]=_0x3c55cb[_0x54ca('0x57')];_0x31e707[_0x54ca('0x58')]=_0x3c55cb;}else{_0x31e707[_0x54ca('0x56')]=moment(0x0)[_0x54ca('0x59')](_0x54ca('0x5a'));_0x31e707[_0x54ca('0x58')]={};}return _0x31e707;};}exports['getUsers']=function(_0x583a31,_0x22cdf1,_0x40c472){var _0x2c269e=[];return db['User'][_0x54ca('0x4b')]({'where':{'role':['agent','admin',_0x54ca('0x5b')]},'attributes':['id',_0x54ca('0x5c'),_0x54ca('0x38'),_0x54ca('0x5d'),_0x54ca('0x5e'),_0x54ca('0x5f'),_0x54ca('0x60'),_0x54ca('0x61'),_0x54ca('0x62'),'showWebBar'],'order':qs[_0x54ca('0x42')](_0x54ca('0x63')),'include':[{'model':db['VoiceQueue'],'as':_0x54ca('0x64'),'attributes':['id',_0x54ca('0x38'),'type'],'through':{'attributes':[]}}]})[_0x54ca('0x2c')](function(_0x4edc94){if(_0x4edc94){var _0x49898e=_0x583a31[_0x54ca('0x5b')][_0x54ca('0x54')]({'plain':!![]});if(!_0x49898e)throw new Error(_0x54ca('0x65'));if(_0x49898e[_0x54ca('0x5d')]===_0x54ca('0x5b')){return db[_0x54ca('0x66')]['find']({'where':{'name':'Agents','userProfileId':_0x49898e[_0x54ca('0x67')]},'raw':!![]})[_0x54ca('0x2c')](function(_0x1a5b32){if(_0x1a5b32){if(_0x1a5b32[_0x54ca('0x68')]===0x0){return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x1a5b32['id']},'raw':!![]})['then'](function(_0x2861c3){var _0x52ce92=[];if(_[_0x54ca('0x69')](_0x2861c3)){_0x52ce92=_[_0x54ca('0x48')](_0x4edc94,function(_0x5b43d4){if(_0x5b43d4[_0x54ca('0x5d')]!=='agent'){return _0x5b43d4;}});return _0x52ce92;}else{for(var _0x7d1fc8=0x0;_0x7d1fc8<_0x4edc94[_0x54ca('0x3e')];_0x7d1fc8++){var _0x332e0d=_0x4edc94[_0x7d1fc8];if(_0x332e0d[_0x54ca('0x5d')]===_0x54ca('0x6a')){var _0x46d6db=_[_0x54ca('0x50')](_0x2861c3,function(_0x88c483){return _0x88c483[_0x54ca('0x6b')]===_0x332e0d['id'];});if(_0x46d6db)_0x52ce92[_0x54ca('0x6c')](_0x332e0d);}else{_0x52ce92[_0x54ca('0x6c')](_0x332e0d);}}return _0x52ce92;}});}else{return _0x4edc94;}}else{var _0x5d5816=_[_0x54ca('0x48')](_0x4edc94,function(_0x26e42e){if(_0x26e42e['role']!==_0x54ca('0x6a')){return _0x26e42e;}});return _0x5d5816;}});}else{return _0x4edc94;}}})[_0x54ca('0x2c')](function(_0x52dad6){var _0x490dde=[];if(_0x52dad6){_0x2c269e=_0x52dad6;for(var _0x438683=0x0;_0x438683<_0x52dad6['length'];_0x438683+=0x1){_0x2c269e[_0x438683]['messages']=[];_0x490dde[_0x54ca('0x6c')](db[_0x54ca('0x33')][_0x54ca('0x50')]({'where':{'FromId':[_0x583a31['user']['id'],_0x52dad6[_0x438683]['id']],'ToId':[_0x583a31[_0x54ca('0x5b')]['id'],_0x52dad6[_0x438683]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x54ca('0x6d'),'ToId',_0x54ca('0x6e'),_0x54ca('0x52')],'order':qs[_0x54ca('0x42')](_0x54ca('0x6f')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x54ca('0x2c')](wrapUser(_0x52dad6[_0x438683])));}return BPromise[_0x54ca('0x70')](_0x490dde);}return[];})[_0x54ca('0x2c')](function(_0x4df760){return{'rows':_0x4df760,'count':_0x4df760[_0x54ca('0x3e')]};})[_0x54ca('0x2c')](respondWithResult(_0x22cdf1,null))[_0x54ca('0x4c')](handleError(_0x22cdf1,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 44a8393..38cf7bf 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 _0xfaec=['ChatInternalMessage','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x599901,_0x414dff){var _0x212569=function(_0x13b83d){while(--_0x13b83d){_0x599901['push'](_0x599901['shift']());}};_0x212569(++_0x414dff);}(_0xfaec,0x139));var _0xcfae=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xfaec[_0x501510];return _0x1e6ee5;};'use strict';var EventEmitter=require(_0xcfae('0x0'));var ChatInternalMessage=require(_0xcfae('0x1'))['db'][_0xcfae('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcfae('0x3'),'afterUpdate':_0xcfae('0x4'),'afterDestroy':'remove'};function emitEvent(_0x52b878){return function(_0x142688,_0x44cad5,_0xeaeb70){ChatInternalMessageEvents[_0xcfae('0x5')](_0x52b878+':'+_0x142688['id'],_0x142688);ChatInternalMessageEvents[_0xcfae('0x5')](_0x52b878,_0x142688);_0xeaeb70(null);};}for(var e in events){if(events[_0xcfae('0x6')](e)){var event=events[e];ChatInternalMessage[_0xcfae('0x7')](e,emitEvent(event));}}module[_0xcfae('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xe83b=['setMaxListeners','save','update','emit','hasOwnProperty','exports','events','../../mysqldb','ChatInternalMessage'];(function(_0x549e70,_0x8a5460){var _0x9a9d8c=function(_0x3408c5){while(--_0x3408c5){_0x549e70['push'](_0x549e70['shift']());}};_0x9a9d8c(++_0x8a5460);}(_0xe83b,0x114));var _0xbe83=function(_0x2dae0c,_0x3b578c){_0x2dae0c=_0x2dae0c-0x0;var _0x36c35b=_0xe83b[_0x2dae0c];return _0x36c35b;};'use strict';var EventEmitter=require(_0xbe83('0x0'));var ChatInternalMessage=require(_0xbe83('0x1'))['db'][_0xbe83('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xbe83('0x3')](0x0);var events={'afterCreate':_0xbe83('0x4'),'afterUpdate':_0xbe83('0x5'),'afterDestroy':'remove'};function emitEvent(_0x31ed17){return function(_0x3b8c11,_0x27c177,_0x880bd7){ChatInternalMessageEvents['emit'](_0x31ed17+':'+_0x3b8c11['id'],_0x3b8c11);ChatInternalMessageEvents[_0xbe83('0x6')](_0x31ed17,_0x3b8c11);_0x880bd7(null);};}for(var e in events){if(events[_0xbe83('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xbe83('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 6e4000f..667910d 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 _0x79ec=['ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','rimraf','./chatInternalMessage.attributes','exports','define'];(function(_0x2aff86,_0x213964){var _0xb63464=function(_0x3e024b){while(--_0x3e024b){_0x2aff86['push'](_0x2aff86['shift']());}};_0xb63464(++_0x213964);}(_0x79ec,0x1bf));var _0xc79e=function(_0x458edc,_0x9baf98){_0x458edc=_0x458edc-0x0;var _0x44af29=_0x79ec[_0x458edc];return _0x44af29;};'use strict';var _=require('lodash');var util=require(_0xc79e('0x0'));var logger=require('../../config/logger')(_0xc79e('0x1'));var moment=require(_0xc79e('0x2'));var BPromise=require(_0xc79e('0x3'));var rp=require(_0xc79e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc79e('0x5'));var config=require('../../config/environment');var attributes=require(_0xc79e('0x6'));module[_0xc79e('0x7')]=function(_0x27da3c,_0x5a5610){return _0x27da3c[_0xc79e('0x8')](_0xc79e('0x9'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc79e('0xa'),'collate':_0xc79e('0xb')});};
\ No newline at end of file
+var _0x44b7=['chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','ChatInternalMessage'];(function(_0x2371d4,_0x218bfb){var _0x101f05=function(_0x334911){while(--_0x334911){_0x2371d4['push'](_0x2371d4['shift']());}};_0x101f05(++_0x218bfb);}(_0x44b7,0x1c3));var _0x744b=function(_0x3c6e06,_0x59be65){_0x3c6e06=_0x3c6e06-0x0;var _0x4f6ffc=_0x44b7[_0x3c6e06];return _0x4f6ffc;};'use strict';var _=require(_0x744b('0x0'));var util=require('util');var logger=require(_0x744b('0x1'))(_0x744b('0x2'));var moment=require(_0x744b('0x3'));var BPromise=require('bluebird');var rp=require(_0x744b('0x4'));var fs=require('fs');var path=require(_0x744b('0x5'));var rimraf=require(_0x744b('0x6'));var config=require(_0x744b('0x7'));var attributes=require(_0x744b('0x8'));module[_0x744b('0x9')]=function(_0x23056a,_0x3cd4bd){return _0x23056a['define'](_0x744b('0xa'),attributes,{'tableName':_0x744b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x744b('0xc'),'collate':_0x744b('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 770b2b0..f6c9d5e 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 _0xf4e5=['request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','request','then','info','ChatInternalMessage,\x20%s,\x20%s'];(function(_0x21a2b3,_0x5d6564){var _0x4651a7=function(_0x285f59){while(--_0x285f59){_0x21a2b3['push'](_0x21a2b3['shift']());}};_0x4651a7(++_0x5d6564);}(_0xf4e5,0xd4));var _0x5f4e=function(_0x314565,_0x233ee6){_0x314565=_0x314565-0x0;var _0x54acc1=_0xf4e5[_0x314565];return _0x54acc1;};'use strict';var _=require(_0x5f4e('0x0'));var util=require(_0x5f4e('0x1'));var moment=require(_0x5f4e('0x2'));var BPromise=require(_0x5f4e('0x3'));var rs=require(_0x5f4e('0x4'));var fs=require('fs');var Redis=require(_0x5f4e('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5f4e('0x6'))(_0x5f4e('0x7'));var config=require(_0x5f4e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5f4e('0x9')][_0x5f4e('0xa')]({'port':0x232a});config[_0x5f4e('0xb')]=_[_0x5f4e('0xc')](config[_0x5f4e('0xb')],{'host':_0x5f4e('0xd'),'port':0x18eb});var socket=require(_0x5f4e('0xe'))(new Redis(config[_0x5f4e('0xb')]));require(_0x5f4e('0xf'))['register'](socket);function respondWithRpcPromise(_0x553d3e,_0x1f27b7,_0xa89bfe){return new BPromise(function(_0x434957,_0x4e227a){return client[_0x5f4e('0x10')](_0x553d3e,_0xa89bfe)[_0x5f4e('0x11')](function(_0x1d0060){logger[_0x5f4e('0x12')](_0x5f4e('0x13'),_0x1f27b7,_0x5f4e('0x14'));logger[_0x5f4e('0x15')](_0x5f4e('0x16'),_0x1f27b7,_0x5f4e('0x14'),JSON[_0x5f4e('0x17')](_0x1d0060));if(_0x1d0060[_0x5f4e('0x18')]){if(_0x1d0060['error'][_0x5f4e('0x19')]===0x1f4){logger[_0x5f4e('0x18')]('ChatInternalMessage,\x20%s,\x20%s',_0x1f27b7,_0x1d0060[_0x5f4e('0x18')][_0x5f4e('0x1a')]);return _0x4e227a(_0x1d0060[_0x5f4e('0x18')]['message']);}logger[_0x5f4e('0x18')](_0x5f4e('0x13'),_0x1f27b7,_0x1d0060[_0x5f4e('0x18')]['message']);return _0x434957(_0x1d0060[_0x5f4e('0x18')][_0x5f4e('0x1a')]);}else{logger['info'](_0x5f4e('0x13'),_0x1f27b7,_0x5f4e('0x14'));_0x434957(_0x1d0060[_0x5f4e('0x1b')][_0x5f4e('0x1a')]);}})[_0x5f4e('0x1c')](function(_0x540920){logger[_0x5f4e('0x18')]('ChatInternalMessage,\x20%s,\x20%s',_0x1f27b7,_0x540920);_0x4e227a(_0x540920);});});}
\ No newline at end of file
+var _0x8f97=['stringify','error','code','message','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5e6bec,_0x1eb54d){var _0x5dc5cf=function(_0x59429a){while(--_0x59429a){_0x5e6bec['push'](_0x5e6bec['shift']());}};_0x5dc5cf(++_0x1eb54d);}(_0x8f97,0x13e));var _0x78f9=function(_0x1fd4d7,_0x2feafd){_0x1fd4d7=_0x1fd4d7-0x0;var _0x7efe8a=_0x8f97[_0x1fd4d7];return _0x7efe8a;};'use strict';var _=require('lodash');var util=require(_0x78f9('0x0'));var moment=require(_0x78f9('0x1'));var BPromise=require(_0x78f9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x78f9('0x3'))['db'];var utils=require(_0x78f9('0x4'));var logger=require(_0x78f9('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x78f9('0x6'));var client=jayson['client'][_0x78f9('0x7')]({'port':0x232a});config[_0x78f9('0x8')]=_[_0x78f9('0x9')](config['redis'],{'host':_0x78f9('0xa'),'port':0x18eb});var socket=require(_0x78f9('0xb'))(new Redis(config[_0x78f9('0x8')]));require(_0x78f9('0xc'))[_0x78f9('0xd')](socket);function respondWithRpcPromise(_0x23691a,_0xde5456,_0x5e4a4b){return new BPromise(function(_0x250f6b,_0x14dcea){return client[_0x78f9('0xe')](_0x23691a,_0x5e4a4b)[_0x78f9('0xf')](function(_0x5d4d1f){logger[_0x78f9('0x10')](_0x78f9('0x11'),_0xde5456,_0x78f9('0x12'));logger[_0x78f9('0x13')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0xde5456,_0x78f9('0x12'),JSON[_0x78f9('0x14')](_0x5d4d1f));if(_0x5d4d1f[_0x78f9('0x15')]){if(_0x5d4d1f['error'][_0x78f9('0x16')]===0x1f4){logger[_0x78f9('0x15')](_0x78f9('0x11'),_0xde5456,_0x5d4d1f['error'][_0x78f9('0x17')]);return _0x14dcea(_0x5d4d1f['error'][_0x78f9('0x17')]);}logger[_0x78f9('0x15')](_0x78f9('0x11'),_0xde5456,_0x5d4d1f[_0x78f9('0x15')][_0x78f9('0x17')]);return _0x250f6b(_0x5d4d1f['error'][_0x78f9('0x17')]);}else{logger[_0x78f9('0x10')](_0x78f9('0x11'),_0xde5456,_0x78f9('0x12'));_0x250f6b(_0x5d4d1f[_0x78f9('0x18')]['message']);}})[_0x78f9('0x19')](function(_0x5e7878){logger[_0x78f9('0x15')](_0x78f9('0x11'),_0xde5456,_0x5e7878);_0x14dcea(_0x5e7878);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index ff60cbc..7915a4e 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 _0x10ec=['./chatInternalMessage.events','save','remove','emit','removeListener','register','length','chatInternalMessage:'];(function(_0x69a451,_0x49fd37){var _0x3d6ef5=function(_0x27ebf4){while(--_0x27ebf4){_0x69a451['push'](_0x69a451['shift']());}};_0x3d6ef5(++_0x49fd37);}(_0x10ec,0x110));var _0xc10e=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x10ec[_0x5d6456];return _0x4d66c1;};'use strict';var ChatInternalMessageEvents=require(_0xc10e('0x0'));var events=[_0xc10e('0x1'),_0xc10e('0x2'),'update'];function createListener(_0xac748b,_0x21e1d8){return function(_0xcae70b){_0x21e1d8[_0xc10e('0x3')](_0xac748b,_0xcae70b);};}function removeListener(_0xc778c9,_0x570598){return function(){ChatInternalMessageEvents[_0xc10e('0x4')](_0xc778c9,_0x570598);};}exports[_0xc10e('0x5')]=function(_0x58917a){for(var _0x3f82a8=0x0,_0x2894b0=events[_0xc10e('0x6')];_0x3f82a8<_0x2894b0;_0x3f82a8++){var _0x373be8=events[_0x3f82a8];var _0x522c04=createListener(_0xc10e('0x7')+_0x373be8,_0x58917a);ChatInternalMessageEvents['on'](_0x373be8,_0x522c04);}};
\ No newline at end of file
+var _0x43f2=['chatInternalMessage:','register'];(function(_0x3833b1,_0x12fd9a){var _0x3fa099=function(_0x958aec){while(--_0x958aec){_0x3833b1['push'](_0x3833b1['shift']());}};_0x3fa099(++_0x12fd9a);}(_0x43f2,0x18f));var _0x243f=function(_0x96c154,_0x2db1aa){_0x96c154=_0x96c154-0x0;var _0x43fb6d=_0x43f2[_0x96c154];return _0x43fb6d;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=['save','remove','update'];function createListener(_0xe2090d,_0x4ef9de){return function(_0x142ac4){_0x4ef9de['emit'](_0xe2090d,_0x142ac4);};}function removeListener(_0x359260,_0xdaeab){return function(){ChatInternalMessageEvents['removeListener'](_0x359260,_0xdaeab);};}exports[_0x243f('0x0')]=function(_0x3195b7){for(var _0x33d5da=0x0,_0x513b7a=events['length'];_0x33d5da<_0x513b7a;_0x33d5da++){var _0x3fcf78=events[_0x33d5da];var _0x3cfb80=createListener(_0x243f('0x1')+_0x3fcf78,_0x3195b7);ChatInternalMessageEvents['on'](_0x3fcf78,_0x3cfb80);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 0f8416e..9197972 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 _0xbe3e=['./chatInternalMessage.controller','get','isAuthenticated','/describe','describe','/users','getUsers','/:id','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x48f801,_0x1cc751){var _0x1e5ecb=function(_0x55587d){while(--_0x55587d){_0x48f801['push'](_0x48f801['shift']());}};_0x1e5ecb(++_0x1cc751);}(_0xbe3e,0x1b0));var _0xebe3=function(_0x4f6eb2,_0x4f3253){_0x4f6eb2=_0x4f6eb2-0x0;var _0x128bab=_0xbe3e[_0x4f6eb2];return _0x128bab;};'use strict';var multer=require(_0xebe3('0x0'));var util=require(_0xebe3('0x1'));var path=require(_0xebe3('0x2'));var timeout=require(_0xebe3('0x3'));var express=require(_0xebe3('0x4'));var router=express[_0xebe3('0x5')]();var fs_extra=require(_0xebe3('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xebe3('0x7'));var config=require('../../config/environment');var controller=require(_0xebe3('0x8'));router[_0xebe3('0x9')]('/',auth[_0xebe3('0xa')](),controller['index']);router[_0xebe3('0x9')](_0xebe3('0xb'),auth[_0xebe3('0xa')](),controller[_0xebe3('0xc')]);router[_0xebe3('0x9')](_0xebe3('0xd'),auth[_0xebe3('0xa')](),controller[_0xebe3('0xe')]);router[_0xebe3('0x9')](_0xebe3('0xf'),auth[_0xebe3('0xa')](),controller['show']);router['post']('/',auth[_0xebe3('0xa')](),controller['create']);router[_0xebe3('0x10')](_0xebe3('0xf'),controller[_0xebe3('0x11')]);router[_0xebe3('0x12')](_0xebe3('0xf'),auth[_0xebe3('0xa')](),controller['destroy']);module[_0xebe3('0x13')]=router;
\ No newline at end of file
+var _0x14b9=['../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','getUsers','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x14b9,0x191));var _0x914b=function(_0x531c55,_0x1d57f7){_0x531c55=_0x531c55-0x0;var _0x4ba729=_0x14b9[_0x531c55];return _0x4ba729;};'use strict';var multer=require(_0x914b('0x0'));var util=require('util');var path=require(_0x914b('0x1'));var timeout=require(_0x914b('0x2'));var express=require(_0x914b('0x3'));var router=express[_0x914b('0x4')]();var fs_extra=require(_0x914b('0x5'));var auth=require(_0x914b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x914b('0x7'));var controller=require(_0x914b('0x8'));router[_0x914b('0x9')]('/',auth[_0x914b('0xa')](),controller[_0x914b('0xb')]);router['get'](_0x914b('0xc'),auth[_0x914b('0xa')](),controller[_0x914b('0xd')]);router[_0x914b('0x9')]('/users',auth[_0x914b('0xa')](),controller[_0x914b('0xe')]);router['get'](_0x914b('0xf'),auth[_0x914b('0xa')](),controller[_0x914b('0x10')]);router[_0x914b('0x11')]('/',auth[_0x914b('0xa')](),controller[_0x914b('0x12')]);router[_0x914b('0x13')](_0x914b('0xf'),controller[_0x914b('0x14')]);router[_0x914b('0x15')](_0x914b('0xf'),auth[_0x914b('0xa')](),controller[_0x914b('0x16')]);module[_0x914b('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 8935263..0741ce6 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 _0xf45e=['ENUM','out','DATE','STRING','sequelize','TEXT','BOOLEAN'];(function(_0xd2eaac,_0x331cff){var _0x30495a=function(_0x5c582f){while(--_0x5c582f){_0xd2eaac['push'](_0xd2eaac['shift']());}};_0x30495a(++_0x331cff);}(_0xf45e,0x115));var _0xef45=function(_0x325aa2,_0x29bd7f){_0x325aa2=_0x325aa2-0x0;var _0x451a67=_0xf45e[_0x325aa2];return _0x451a67;};'use strict';var Sequelize=require(_0xef45('0x0'));module['exports']={'body':{'type':Sequelize[_0xef45('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xef45('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0xef45('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xef45('0x3')]('in',_0xef45('0x4')),'defaultValue':_0xef45('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xef45('0x5')]},'providerName':{'type':Sequelize[_0xef45('0x6')]},'providerResponse':{'type':Sequelize[_0xef45('0x1')]}};
\ No newline at end of file
+var _0x4024=['BOOLEAN','ENUM','out','DATE','sequelize','exports','medium'];(function(_0x160cbc,_0x3025a6){var _0x4ac8c6=function(_0x27e1d3){while(--_0x27e1d3){_0x160cbc['push'](_0x160cbc['shift']());}};_0x4ac8c6(++_0x3025a6);}(_0x4024,0x89));var _0x4402=function(_0x47c80e,_0x1bce79){_0x47c80e=_0x47c80e-0x0;var _0x17db83=_0x4024[_0x47c80e];return _0x17db83;};'use strict';var Sequelize=require(_0x4402('0x0'));module[_0x4402('0x1')]={'body':{'type':Sequelize['TEXT'](_0x4402('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x4402('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x4402('0x4')]('in','out'),'defaultValue':_0x4402('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x4402('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 4111777..40ce0db 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 _0x3e90=['../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','./chatMessage.socket','client','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','ChatMessage','findAll','rows','params','includeAll','find','create','body','describe','chat-interactions','accept','read','readAt','format','UserId','user','agent','ChatInteractionId','isNil','read1stAt','interaction','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','fullname','email','internal','manual','channel','event','EventManager','acceptmessage','parse','formData','chat','get','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','rejectMessage','sequelize','interface','SIP/%s','motionChannel','rejectmessage','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x2d7345,_0x131853){var _0x4c6ec9=function(_0x3df5c3){while(--_0x3df5c3){_0x2d7345['push'](_0x2d7345['shift']());}};_0x4c6ec9(++_0x131853);}(_0x3e90,0xf0));var _0x03e9=function(_0x499caf,_0x34744f){_0x499caf=_0x499caf-0x0;var _0x47b9bb=_0x3e90[_0x499caf];return _0x47b9bb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x03e9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x03e9('0x1'));var rp=require(_0x03e9('0x2'));var moment=require(_0x03e9('0x3'));var BPromise=require(_0x03e9('0x4'));var Mustache=require(_0x03e9('0x5'));var util=require(_0x03e9('0x6'));var path=require(_0x03e9('0x7'));var sox=require(_0x03e9('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x03e9('0x9'));var squel=require(_0x03e9('0xa'));var crypto=require('crypto');var jsforce=require(_0x03e9('0xb'));var deskjs=require(_0x03e9('0xc'));var toCsv=require(_0x03e9('0xd'));var querystring=require('querystring');var Papa=require(_0x03e9('0xe'));var Redis=require(_0x03e9('0xf'));var authService=require(_0x03e9('0x10'));var qs=require(_0x03e9('0x11'));var as=require(_0x03e9('0x12'));var hardwareService=require(_0x03e9('0x13'));var logger=require(_0x03e9('0x14'))(_0x03e9('0x15'));var utils=require(_0x03e9('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x03e9('0x17'));var db=require(_0x03e9('0x18'))['db'];config['redis']=_[_0x03e9('0x19')](config[_0x03e9('0x1a')],{'host':_0x03e9('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x03e9('0x1a')]));require(_0x03e9('0x1c'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x03e9('0x1d')]['http']({'port':0x232c});var client9002=jayson[_0x03e9('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7fb436,_0x1602bf,_0x315fa5,_0x588185){return new BPromise(function(_0xda4569,_0x5ed953){var _0x3c5737=_0x588185||client;return _0x3c5737[_0x03e9('0x1e')](_0x7fb436,_0x315fa5)[_0x03e9('0x1f')](function(_0x15053a){logger[_0x03e9('0x20')](_0x03e9('0x21'),_0x1602bf,_0x03e9('0x22'));logger[_0x03e9('0x23')](_0x03e9('0x24'),_0x1602bf,_0x03e9('0x22'),JSON['stringify'](_0x15053a));if(_0x15053a[_0x03e9('0x25')]){if(_0x15053a[_0x03e9('0x25')]['code']===0x1f4){logger[_0x03e9('0x25')](_0x03e9('0x21'),_0x1602bf,_0x15053a[_0x03e9('0x25')][_0x03e9('0x26')]);return _0x5ed953(_0x15053a[_0x03e9('0x25')][_0x03e9('0x26')]);}logger[_0x03e9('0x25')](_0x03e9('0x21'),_0x1602bf,_0x15053a[_0x03e9('0x25')][_0x03e9('0x26')]);return _0xda4569(_0x15053a[_0x03e9('0x25')][_0x03e9('0x26')]);}else{logger[_0x03e9('0x20')](_0x03e9('0x21'),_0x1602bf,_0x03e9('0x22'));_0xda4569(_0x15053a['result'][_0x03e9('0x26')]);}})[_0x03e9('0x27')](function(_0x16996e){logger[_0x03e9('0x25')](_0x03e9('0x21'),_0x1602bf,_0x16996e);_0x5ed953(_0x16996e);});});}function respondWithStatusCode(_0x16558a,_0x1ed055){_0x1ed055=_0x1ed055||0xcc;return function(_0xfc6f66){if(_0xfc6f66){return _0x16558a[_0x03e9('0x28')](_0x1ed055);}return _0x16558a[_0x03e9('0x29')](_0x1ed055)[_0x03e9('0x2a')]();};}function respondWithResult(_0x555b02,_0x4e8ed8){_0x4e8ed8=_0x4e8ed8||0xc8;return function(_0x299ed9){if(_0x299ed9){return _0x555b02['status'](_0x4e8ed8)[_0x03e9('0x2b')](_0x299ed9);}};}function respondWithFilteredResult(_0x24e6bb,_0x3ea37a){return function(_0x13150d){if(_0x13150d){var _0x1d172a=typeof _0x3ea37a[_0x03e9('0x2c')]===_0x03e9('0x2d')&&typeof _0x3ea37a[_0x03e9('0x2e')]===_0x03e9('0x2d');var _0x1fadbe=_0x13150d[_0x03e9('0x2f')];var _0x1a441d=_0x1d172a?0x0:_0x3ea37a[_0x03e9('0x2c')];var _0x50a2bf=_0x1d172a?_0x13150d[_0x03e9('0x2f')]:_0x3ea37a[_0x03e9('0x2c')]+_0x3ea37a['limit'];var _0xd62754;if(_0x50a2bf>=_0x1fadbe){_0x50a2bf=_0x1fadbe;_0xd62754=0xc8;}else{_0xd62754=0xce;}_0x24e6bb[_0x03e9('0x29')](_0xd62754);return _0x24e6bb['set'](_0x03e9('0x30'),_0x1a441d+'-'+_0x50a2bf+'/'+_0x1fadbe)[_0x03e9('0x2b')](_0x13150d);}return null;};}function patchUpdates(_0x139ad0){return function(_0xc11e66){try{jsonpatch[_0x03e9('0x31')](_0xc11e66,_0x139ad0,!![]);}catch(_0x20fa63){return BPromise[_0x03e9('0x32')](_0x20fa63);}return _0xc11e66[_0x03e9('0x33')]();};}function saveUpdates(_0x5e3ce6,_0x47b0c3){return function(_0x2f36ec){if(_0x2f36ec){return _0x2f36ec[_0x03e9('0x34')](_0x5e3ce6)[_0x03e9('0x1f')](function(_0x2bb373){return _0x2bb373;});}return null;};}function removeEntity(_0x5cde5c,_0x62c9fb){return function(_0x4f0aca){if(_0x4f0aca){return _0x4f0aca[_0x03e9('0x35')]()[_0x03e9('0x1f')](function(){_0x5cde5c['status'](0xcc)[_0x03e9('0x2a')]();});}};}function handleEntityNotFound(_0x3273d5,_0x120af8){return function(_0x115ba1){if(!_0x115ba1){_0x3273d5[_0x03e9('0x28')](0x194);}return _0x115ba1;};}function handleError(_0x597165,_0x4afc46){_0x4afc46=_0x4afc46||0x1f4;return function(_0x3a02fb){logger[_0x03e9('0x25')](_0x3a02fb[_0x03e9('0x36')]);if(_0x3a02fb['name']){delete _0x3a02fb[_0x03e9('0x37')];}_0x597165[_0x03e9('0x29')](_0x4afc46)[_0x03e9('0x38')](_0x3a02fb);};}exports[_0x03e9('0x39')]=function(_0x3520cc,_0x2cdf6b){var _0x2137e1={},_0x25bdba={},_0x12f094={'count':0x0,'rows':[]};var _0x162ac3=_[_0x03e9('0x3a')](db['ChatMessage'][_0x03e9('0x3b')],function(_0xce94fb){return{'name':_0xce94fb[_0x03e9('0x3c')],'type':_0xce94fb[_0x03e9('0x3d')][_0x03e9('0x3e')]};});_0x25bdba[_0x03e9('0x3f')]=_[_0x03e9('0x3a')](_0x162ac3,_0x03e9('0x37'));_0x25bdba['query']=_[_0x03e9('0x40')](_0x3520cc['query']);_0x25bdba[_0x03e9('0x41')]=_[_0x03e9('0x42')](_0x25bdba[_0x03e9('0x3f')],_0x25bdba[_0x03e9('0x43')]);_0x2137e1[_0x03e9('0x44')]=_['intersection'](_0x25bdba[_0x03e9('0x3f')],qs[_0x03e9('0x45')](_0x3520cc[_0x03e9('0x43')][_0x03e9('0x45')]));_0x2137e1[_0x03e9('0x44')]=_0x2137e1['attributes'][_0x03e9('0x46')]?_0x2137e1[_0x03e9('0x44')]:_0x25bdba[_0x03e9('0x3f')];if(!_0x3520cc[_0x03e9('0x43')][_0x03e9('0x47')](_0x03e9('0x48'))){_0x2137e1['limit']=qs[_0x03e9('0x2e')](_0x3520cc[_0x03e9('0x43')][_0x03e9('0x2e')]);_0x2137e1[_0x03e9('0x2c')]=qs[_0x03e9('0x2c')](_0x3520cc[_0x03e9('0x43')][_0x03e9('0x2c')]);}_0x2137e1['order']=qs['sort'](_0x3520cc[_0x03e9('0x43')][_0x03e9('0x49')]);_0x2137e1[_0x03e9('0x4a')]=qs[_0x03e9('0x41')](_[_0x03e9('0x4b')](_0x3520cc[_0x03e9('0x43')],_0x25bdba[_0x03e9('0x41')]),_0x162ac3);if(_0x3520cc[_0x03e9('0x43')][_0x03e9('0x4c')]){_0x2137e1[_0x03e9('0x4a')]=_[_0x03e9('0x4d')](_0x2137e1[_0x03e9('0x4a')],{'$or':_[_0x03e9('0x3a')](_0x162ac3,function(_0x38d3b7){if(_0x38d3b7[_0x03e9('0x3d')]!==_0x03e9('0x4e')){var _0x4f5a0f={};_0x4f5a0f[_0x38d3b7['name']]={'$like':'%'+_0x3520cc[_0x03e9('0x43')][_0x03e9('0x4c')]+'%'};return _0x4f5a0f;}})});}_0x2137e1=_['merge']({},_0x2137e1,_0x3520cc[_0x03e9('0x4f')]);var _0x118af2={'where':_0x2137e1['where']};return db[_0x03e9('0x50')]['count'](_0x118af2)[_0x03e9('0x1f')](function(_0x18071a){_0x12f094['count']=_0x18071a;if(_0x3520cc[_0x03e9('0x43')]['includeAll']){_0x2137e1['include']=[{'all':!![]}];}return db[_0x03e9('0x50')][_0x03e9('0x51')](_0x2137e1);})[_0x03e9('0x1f')](function(_0x352755){_0x12f094[_0x03e9('0x52')]=_0x352755;return _0x12f094;})[_0x03e9('0x1f')](respondWithFilteredResult(_0x2cdf6b,_0x2137e1))[_0x03e9('0x27')](handleError(_0x2cdf6b,null));};exports['show']=function(_0x497372,_0x157295){var _0x49c815={'raw':!![],'where':{'id':_0x497372[_0x03e9('0x53')]['id']}},_0x219b7a={};_0x219b7a[_0x03e9('0x3f')]=_[_0x03e9('0x40')](db[_0x03e9('0x50')][_0x03e9('0x3b')]);_0x219b7a[_0x03e9('0x43')]=_[_0x03e9('0x40')](_0x497372[_0x03e9('0x43')]);_0x219b7a['filters']=_['intersection'](_0x219b7a['model'],_0x219b7a[_0x03e9('0x43')]);_0x49c815['attributes']=_[_0x03e9('0x42')](_0x219b7a[_0x03e9('0x3f')],qs[_0x03e9('0x45')](_0x497372[_0x03e9('0x43')]['fields']));_0x49c815[_0x03e9('0x44')]=_0x49c815['attributes'][_0x03e9('0x46')]?_0x49c815[_0x03e9('0x44')]:_0x219b7a['model'];if(_0x497372[_0x03e9('0x43')][_0x03e9('0x54')]){_0x49c815['include']=[{'all':!![]}];}_0x49c815=_['merge']({},_0x49c815,_0x497372[_0x03e9('0x4f')]);return db['ChatMessage'][_0x03e9('0x55')](_0x49c815)[_0x03e9('0x1f')](handleEntityNotFound(_0x157295,null))[_0x03e9('0x1f')](respondWithResult(_0x157295,null))[_0x03e9('0x27')](handleError(_0x157295,null));};exports[_0x03e9('0x56')]=function(_0x5eb138,_0x4f9506){return db['ChatMessage'][_0x03e9('0x56')](_0x5eb138[_0x03e9('0x57')],{})[_0x03e9('0x1f')](respondWithResult(_0x4f9506,0xc9))[_0x03e9('0x27')](handleError(_0x4f9506,null));};exports[_0x03e9('0x34')]=function(_0x318d33,_0x458ae8){if(_0x318d33[_0x03e9('0x57')]['id']){delete _0x318d33[_0x03e9('0x57')]['id'];}return db[_0x03e9('0x50')][_0x03e9('0x55')]({'where':{'id':_0x318d33['params']['id']}})[_0x03e9('0x1f')](handleEntityNotFound(_0x458ae8,null))[_0x03e9('0x1f')](saveUpdates(_0x318d33[_0x03e9('0x57')],null))[_0x03e9('0x1f')](respondWithResult(_0x458ae8,null))[_0x03e9('0x27')](handleError(_0x458ae8,null));};exports[_0x03e9('0x35')]=function(_0xad2d81,_0x3eac88){return db[_0x03e9('0x50')][_0x03e9('0x55')]({'where':{'id':_0xad2d81['params']['id']}})[_0x03e9('0x1f')](handleEntityNotFound(_0x3eac88,null))[_0x03e9('0x1f')](removeEntity(_0x3eac88,null))[_0x03e9('0x27')](handleError(_0x3eac88,null));};exports[_0x03e9('0x58')]=function(_0x124c8e,_0x31cd95){return db[_0x03e9('0x50')][_0x03e9('0x58')]()['then'](respondWithResult(_0x31cd95,null))[_0x03e9('0x27')](handleError(_0x31cd95,null));};var interaction_log=require(_0x03e9('0x14'))(_0x03e9('0x59'));exports[_0x03e9('0x5a')]=function(_0x476316,_0x27709c,_0x40c3e8){var _0x2403f0={'agent':{},'channel':'chat'};if(_0x476316[_0x03e9('0x57')]['id']){delete _0x476316[_0x03e9('0x57')]['id'];}_0x476316[_0x03e9('0x57')][_0x03e9('0x5b')]=!![];_0x476316[_0x03e9('0x57')][_0x03e9('0x5c')]=moment()[_0x03e9('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');_0x476316[_0x03e9('0x57')][_0x03e9('0x5e')]=_0x476316[_0x03e9('0x57')][_0x03e9('0x5e')]||_0x476316[_0x03e9('0x5f')]['id'];_0x2403f0[_0x03e9('0x60')]['id']=_0x476316[_0x03e9('0x57')][_0x03e9('0x5e')];return db[_0x03e9('0x50')][_0x03e9('0x55')]({'where':{'id':_0x476316[_0x03e9('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x27709c,null))['then'](saveUpdates(_0x476316['body'],null))[_0x03e9('0x1f')](function(_0x361ed1){if(_0x361ed1){_0x2403f0[_0x03e9('0x26')]=_0x361ed1['get']({'plain':!![]});return db['ChatInteraction'][_0x03e9('0x55')]({'where':{'id':_0x361ed1[_0x03e9('0x61')]}});}return null;})[_0x03e9('0x1f')](handleEntityNotFound(_0x27709c,null))[_0x03e9('0x1f')](function(_0x425027){if(_0x425027){return _0x425027['update']({'UserId':_0x476316['body'][_0x03e9('0x5e')],'read1stAt':_[_0x03e9('0x62')](_0x425027[_0x03e9('0x63')])?moment()[_0x03e9('0x5d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x03e9('0x1f')](function(_0x3d36d3){if(_0x3d36d3){_0x2403f0[_0x03e9('0x64')]=_0x3d36d3['get']({'plain':!![]});interaction_log[_0x03e9('0x20')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x476316[_0x03e9('0x5f')]['id'],_0x476316[_0x03e9('0x5f')]['name'],_0x476316[_0x03e9('0x5f')]['role'],_0x2403f0[_0x03e9('0x64')]['id'],_0x476316['body']?JSON[_0x03e9('0x65')](_0x476316[_0x03e9('0x57')]):_0x03e9('0x66'));return respondWithRpcPromise(_0x03e9('0x67'),_0x03e9('0x68'),_0x2403f0);}return null;})[_0x03e9('0x1f')](function(_0x42d07f){var _0x447d54=_0x03e9('0x69')+_0x42d07f[_0x03e9('0x26')][_0x03e9('0x6a')];return db['sequelize'][_0x03e9('0x43')](_0x447d54,{'type':db[_0x03e9('0x6b')][_0x03e9('0x6c')][_0x03e9('0x6d')],'raw':!![]})[_0x03e9('0x1f')](function(_0x58d27a){return _0x58d27a;});})['then'](function(_0x603f02){if(_0x603f02){_0x2403f0[_0x03e9('0x26')][_0x03e9('0x6e')]=_0x603f02[0x0];if(!_0x476316[_0x03e9('0x57')][_0x03e9('0x5e')])return;return db['User'][_0x03e9('0x55')]({'where':{'id':_0x476316[_0x03e9('0x57')][_0x03e9('0x5e')],'role':_0x03e9('0x60')},'attributes':['id',_0x03e9('0x37'),_0x03e9('0x6f'),_0x03e9('0x70'),_0x03e9('0x71')],'raw':!![]});}return null;})[_0x03e9('0x1f')](function(_0x5add66){if(!_0x5add66)return null;_0x2403f0[_0x03e9('0x26')][_0x03e9('0x60')]=_0x5add66;return _0x2403f0;})[_0x03e9('0x1f')](function(_0x1ca915){if(_0x1ca915){if(_0x476316[_0x03e9('0x57')][_0x03e9('0x72')]){_0x2403f0[_0x03e9('0x26')]['interface']=util[_0x03e9('0x5d')]('SIP/%s',_0x476316['user'][_0x03e9('0x37')]);_0x2403f0[_0x03e9('0x26')][_0x03e9('0x73')]=_0x2403f0[_0x03e9('0x73')];_0x2403f0[_0x03e9('0x26')]['motionChannel']=_0x2403f0[_0x03e9('0x73')];_0x2403f0[_0x03e9('0x26')][_0x03e9('0x74')]=_0x03e9('0x5a');return respondWithRpcPromise('EventManager',_0x03e9('0x75'),{'event':_0x03e9('0x76'),'message':_['merge'](_0x2403f0['message'],JSON[_0x03e9('0x77')](_0x2403f0[_0x03e9('0x64')][_0x03e9('0x78')]))},client9002)[_0x03e9('0x1f')](function(){return _0x2403f0;});}return _0x2403f0;}return null;})[_0x03e9('0x1f')](respondWithResult(_0x27709c,null))[_0x03e9('0x27')](handleError(_0x27709c,null));};var interaction_log=require(_0x03e9('0x14'))(_0x03e9('0x59'));exports[_0x03e9('0x32')]=function(_0x22502a,_0x28f453,_0xe8e12b){var _0x4bac9a={'agent':{},'channel':_0x03e9('0x79')};if(_0x22502a[_0x03e9('0x57')]['id']){delete _0x22502a[_0x03e9('0x57')]['id'];}_0x22502a['body'][_0x03e9('0x5e')]=_0x22502a['body'][_0x03e9('0x5e')]||_0x22502a[_0x03e9('0x5f')]['id'];_0x4bac9a['agent']['id']=_0x22502a[_0x03e9('0x57')]['UserId'];return db['ChatMessage'][_0x03e9('0x55')]({'where':{'id':_0x22502a['params']['id'],'UserId':null}})[_0x03e9('0x1f')](handleEntityNotFound(_0x28f453,null))['then'](function(_0xcea1e3){if(_0xcea1e3){_0x4bac9a['message']=_0xcea1e3['get']({'plain':!![]});return db['ChatInteraction'][_0x03e9('0x55')]({'where':{'id':_0xcea1e3[_0x03e9('0x61')]}});}return null;})['then'](handleEntityNotFound(_0x28f453,null))[_0x03e9('0x1f')](function(_0x1c5e2f){if(_0x1c5e2f){_0x4bac9a['interaction']=_0x1c5e2f[_0x03e9('0x7a')]({'plain':!![]});interaction_log[_0x03e9('0x20')](_0x03e9('0x7b'),_0x22502a[_0x03e9('0x5f')]['id'],_0x22502a[_0x03e9('0x5f')]['name'],_0x22502a[_0x03e9('0x5f')][_0x03e9('0x7c')],_0x4bac9a['interaction']['id'],_0x22502a[_0x03e9('0x57')]?JSON[_0x03e9('0x65')](_0x22502a[_0x03e9('0x57')]):_0x03e9('0x66'));return respondWithRpcPromise('RejectMessage',_0x03e9('0x7d'),_0x4bac9a);}return null;})[_0x03e9('0x1f')](function(_0x565552){var _0x47c5ec='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x565552[_0x03e9('0x26')]['ContactId'];return db[_0x03e9('0x7e')][_0x03e9('0x43')](_0x47c5ec,{'type':db[_0x03e9('0x6b')]['QueryTypes'][_0x03e9('0x6d')],'raw':!![]})[_0x03e9('0x1f')](function(_0x1835ef){return _0x1835ef;});})['then'](function(_0x44042f){if(_0x44042f){_0x4bac9a[_0x03e9('0x26')][_0x03e9('0x6e')]=_0x44042f[0x0];if(!_0x22502a[_0x03e9('0x57')][_0x03e9('0x5e')])return;return db['User'][_0x03e9('0x55')]({'where':{'id':_0x22502a[_0x03e9('0x57')]['UserId'],'role':_0x03e9('0x60')},'attributes':['id','name',_0x03e9('0x6f'),_0x03e9('0x70'),'internal'],'raw':!![]});}return null;})['then'](function(_0x6f1b0b){if(!_0x6f1b0b)return null;_0x4bac9a[_0x03e9('0x26')]['agent']=_0x6f1b0b;return _0x4bac9a;})[_0x03e9('0x1f')](function(_0x563066){if(_0x563066){_0x563066[_0x03e9('0x26')][_0x03e9('0x7f')]=util[_0x03e9('0x5d')](_0x03e9('0x80'),_0x22502a[_0x03e9('0x5f')][_0x03e9('0x37')]);_0x563066[_0x03e9('0x26')][_0x03e9('0x73')]=_0x4bac9a[_0x03e9('0x73')];_0x563066[_0x03e9('0x26')][_0x03e9('0x81')]=_0x4bac9a[_0x03e9('0x73')];_0x563066[_0x03e9('0x26')][_0x03e9('0x74')]=_0x03e9('0x32');respondWithRpcPromise(_0x03e9('0x75'),_0x03e9('0x75'),{'event':_0x03e9('0x82'),'message':_[_0x03e9('0x4d')](_0x4bac9a['message'],JSON[_0x03e9('0x77')](_0x4bac9a[_0x03e9('0x64')][_0x03e9('0x78')]))},client9002);return _0x4bac9a;}return null;})[_0x03e9('0x1f')](respondWithResult(_0x28f453,null))['catch'](handleError(_0x28f453,null));};
\ No newline at end of file
+var _0xa2d4=['count','set','Content-Range','reject','save','update','destroy','end','sendStatus','stack','name','index','map','ChatMessage','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','accept','YYYY-MM-DD\x20HH:mm:ss','UserId','user','ChatInteraction','ChatInteractionId','format','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','User','agent','fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','formData','chat-interactions','chat','get','rejectMessage','QueryTypes','contact','interface','rejectmessage','parse','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./chatMessage.socket','jayson/promise','client','request','then','info','request\x20sent','debug','error','code','ChatMessage,\x20%s,\x20%s','message','result','status','offset','undefined','limit'];(function(_0x5890ed,_0x5eec7c){var _0x49ef9b=function(_0x3d68eb){while(--_0x3d68eb){_0x5890ed['push'](_0x5890ed['shift']());}};_0x49ef9b(++_0x5eec7c);}(_0xa2d4,0x159));var _0x4a2d=function(_0x3f1c5a,_0x388a1b){_0x3f1c5a=_0x3f1c5a-0x0;var _0x395b16=_0xa2d4[_0x3f1c5a];return _0x395b16;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4a2d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4a2d('0x1'));var rp=require(_0x4a2d('0x2'));var moment=require(_0x4a2d('0x3'));var BPromise=require(_0x4a2d('0x4'));var Mustache=require(_0x4a2d('0x5'));var util=require(_0x4a2d('0x6'));var path=require(_0x4a2d('0x7'));var sox=require(_0x4a2d('0x8'));var csv=require(_0x4a2d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4a2d('0xa'));var _=require(_0x4a2d('0xb'));var squel=require(_0x4a2d('0xc'));var crypto=require(_0x4a2d('0xd'));var jsforce=require(_0x4a2d('0xe'));var deskjs=require(_0x4a2d('0xf'));var toCsv=require(_0x4a2d('0x9'));var querystring=require('querystring');var Papa=require(_0x4a2d('0x10'));var Redis=require(_0x4a2d('0x11'));var authService=require(_0x4a2d('0x12'));var qs=require(_0x4a2d('0x13'));var as=require(_0x4a2d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4a2d('0x15'))('api');var utils=require(_0x4a2d('0x16'));var config=require(_0x4a2d('0x17'));var licenseUtil=require(_0x4a2d('0x18'));var db=require(_0x4a2d('0x19'))['db'];config[_0x4a2d('0x1a')]=_['defaults'](config[_0x4a2d('0x1a')],{'host':_0x4a2d('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4a2d('0x1a')]));require(_0x4a2d('0x1c'))['register'](socket);var jayson=require(_0x4a2d('0x1d'));var client=jayson[_0x4a2d('0x1e')]['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5546a9,_0x5a0ebe,_0x3de0a7,_0x3c8174){return new BPromise(function(_0x5abdd2,_0x36e75e){var _0x1d0248=_0x3c8174||client;return _0x1d0248[_0x4a2d('0x1f')](_0x5546a9,_0x3de0a7)[_0x4a2d('0x20')](function(_0x3bacab){logger[_0x4a2d('0x21')]('ChatMessage,\x20%s,\x20%s',_0x5a0ebe,_0x4a2d('0x22'));logger[_0x4a2d('0x23')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x5a0ebe,_0x4a2d('0x22'),JSON['stringify'](_0x3bacab));if(_0x3bacab['error']){if(_0x3bacab[_0x4a2d('0x24')][_0x4a2d('0x25')]===0x1f4){logger['error'](_0x4a2d('0x26'),_0x5a0ebe,_0x3bacab['error'][_0x4a2d('0x27')]);return _0x36e75e(_0x3bacab[_0x4a2d('0x24')][_0x4a2d('0x27')]);}logger[_0x4a2d('0x24')](_0x4a2d('0x26'),_0x5a0ebe,_0x3bacab[_0x4a2d('0x24')][_0x4a2d('0x27')]);return _0x5abdd2(_0x3bacab[_0x4a2d('0x24')]['message']);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x5a0ebe,'request\x20sent');_0x5abdd2(_0x3bacab[_0x4a2d('0x28')][_0x4a2d('0x27')]);}})['catch'](function(_0x35510a){logger[_0x4a2d('0x24')](_0x4a2d('0x26'),_0x5a0ebe,_0x35510a);_0x36e75e(_0x35510a);});});}function respondWithStatusCode(_0x73e2d4,_0x14496b){_0x14496b=_0x14496b||0xcc;return function(_0x3114ed){if(_0x3114ed){return _0x73e2d4['sendStatus'](_0x14496b);}return _0x73e2d4[_0x4a2d('0x29')](_0x14496b)['end']();};}function respondWithResult(_0x5cc051,_0x59ed27){_0x59ed27=_0x59ed27||0xc8;return function(_0x56d63d){if(_0x56d63d){return _0x5cc051[_0x4a2d('0x29')](_0x59ed27)['json'](_0x56d63d);}};}function respondWithFilteredResult(_0x1981c3,_0x2786fc){return function(_0x370d61){if(_0x370d61){var _0x79dabd=typeof _0x2786fc[_0x4a2d('0x2a')]===_0x4a2d('0x2b')&&typeof _0x2786fc[_0x4a2d('0x2c')]===_0x4a2d('0x2b');var _0x4f7587=_0x370d61[_0x4a2d('0x2d')];var _0x3f7b68=_0x79dabd?0x0:_0x2786fc['offset'];var _0x2937b9=_0x79dabd?_0x370d61[_0x4a2d('0x2d')]:_0x2786fc[_0x4a2d('0x2a')]+_0x2786fc['limit'];var _0x1c2e19;if(_0x2937b9>=_0x4f7587){_0x2937b9=_0x4f7587;_0x1c2e19=0xc8;}else{_0x1c2e19=0xce;}_0x1981c3[_0x4a2d('0x29')](_0x1c2e19);return _0x1981c3[_0x4a2d('0x2e')](_0x4a2d('0x2f'),_0x3f7b68+'-'+_0x2937b9+'/'+_0x4f7587)['json'](_0x370d61);}return null;};}function patchUpdates(_0xe26245){return function(_0x4c0cd7){try{jsonpatch['apply'](_0x4c0cd7,_0xe26245,!![]);}catch(_0x4e34e7){return BPromise[_0x4a2d('0x30')](_0x4e34e7);}return _0x4c0cd7[_0x4a2d('0x31')]();};}function saveUpdates(_0x578f75,_0x524125){return function(_0x477e0a){if(_0x477e0a){return _0x477e0a[_0x4a2d('0x32')](_0x578f75)['then'](function(_0x13319f){return _0x13319f;});}return null;};}function removeEntity(_0x239938,_0x61b054){return function(_0x44b20e){if(_0x44b20e){return _0x44b20e[_0x4a2d('0x33')]()['then'](function(){_0x239938[_0x4a2d('0x29')](0xcc)[_0x4a2d('0x34')]();});}};}function handleEntityNotFound(_0x4a33bf,_0x25750d){return function(_0x3fc615){if(!_0x3fc615){_0x4a33bf[_0x4a2d('0x35')](0x194);}return _0x3fc615;};}function handleError(_0x3bdc45,_0x2b62f2){_0x2b62f2=_0x2b62f2||0x1f4;return function(_0xac5860){logger[_0x4a2d('0x24')](_0xac5860[_0x4a2d('0x36')]);if(_0xac5860['name']){delete _0xac5860[_0x4a2d('0x37')];}_0x3bdc45['status'](_0x2b62f2)['send'](_0xac5860);};}exports[_0x4a2d('0x38')]=function(_0x2d9449,_0x429615){var _0x2e749c={},_0x289552={},_0x1e760c={'count':0x0,'rows':[]};var _0x216f5e=_[_0x4a2d('0x39')](db[_0x4a2d('0x3a')][_0x4a2d('0x3b')],function(_0x1380ff){return{'name':_0x1380ff['fieldName'],'type':_0x1380ff[_0x4a2d('0x3c')][_0x4a2d('0x3d')]};});_0x289552[_0x4a2d('0x3e')]=_[_0x4a2d('0x39')](_0x216f5e,'name');_0x289552[_0x4a2d('0x3f')]=_['keys'](_0x2d9449[_0x4a2d('0x3f')]);_0x289552[_0x4a2d('0x40')]=_[_0x4a2d('0x41')](_0x289552[_0x4a2d('0x3e')],_0x289552[_0x4a2d('0x3f')]);_0x2e749c[_0x4a2d('0x42')]=_[_0x4a2d('0x41')](_0x289552[_0x4a2d('0x3e')],qs[_0x4a2d('0x43')](_0x2d9449[_0x4a2d('0x3f')][_0x4a2d('0x43')]));_0x2e749c[_0x4a2d('0x42')]=_0x2e749c[_0x4a2d('0x42')][_0x4a2d('0x44')]?_0x2e749c['attributes']:_0x289552[_0x4a2d('0x3e')];if(!_0x2d9449[_0x4a2d('0x3f')]['hasOwnProperty'](_0x4a2d('0x45'))){_0x2e749c[_0x4a2d('0x2c')]=qs[_0x4a2d('0x2c')](_0x2d9449[_0x4a2d('0x3f')][_0x4a2d('0x2c')]);_0x2e749c[_0x4a2d('0x2a')]=qs[_0x4a2d('0x2a')](_0x2d9449[_0x4a2d('0x3f')][_0x4a2d('0x2a')]);}_0x2e749c[_0x4a2d('0x46')]=qs['sort'](_0x2d9449[_0x4a2d('0x3f')][_0x4a2d('0x47')]);_0x2e749c[_0x4a2d('0x48')]=qs[_0x4a2d('0x40')](_[_0x4a2d('0x49')](_0x2d9449[_0x4a2d('0x3f')],_0x289552[_0x4a2d('0x40')]),_0x216f5e);if(_0x2d9449[_0x4a2d('0x3f')][_0x4a2d('0x4a')]){_0x2e749c[_0x4a2d('0x48')]=_[_0x4a2d('0x4b')](_0x2e749c[_0x4a2d('0x48')],{'$or':_[_0x4a2d('0x39')](_0x216f5e,function(_0x5f2850){if(_0x5f2850[_0x4a2d('0x3c')]!==_0x4a2d('0x4c')){var _0x39a45f={};_0x39a45f[_0x5f2850['name']]={'$like':'%'+_0x2d9449[_0x4a2d('0x3f')][_0x4a2d('0x4a')]+'%'};return _0x39a45f;}})});}_0x2e749c=_[_0x4a2d('0x4b')]({},_0x2e749c,_0x2d9449[_0x4a2d('0x4d')]);var _0x27cdfe={'where':_0x2e749c[_0x4a2d('0x48')]};return db[_0x4a2d('0x3a')][_0x4a2d('0x2d')](_0x27cdfe)[_0x4a2d('0x20')](function(_0x3515e5){_0x1e760c['count']=_0x3515e5;if(_0x2d9449[_0x4a2d('0x3f')][_0x4a2d('0x4e')]){_0x2e749c[_0x4a2d('0x4f')]=[{'all':!![]}];}return db[_0x4a2d('0x3a')][_0x4a2d('0x50')](_0x2e749c);})[_0x4a2d('0x20')](function(_0x35b944){_0x1e760c[_0x4a2d('0x51')]=_0x35b944;return _0x1e760c;})['then'](respondWithFilteredResult(_0x429615,_0x2e749c))[_0x4a2d('0x52')](handleError(_0x429615,null));};exports[_0x4a2d('0x53')]=function(_0x1fd144,_0x45c710){var _0x1030a6={'raw':!![],'where':{'id':_0x1fd144[_0x4a2d('0x54')]['id']}},_0x3f48f1={};_0x3f48f1['model']=_[_0x4a2d('0x55')](db[_0x4a2d('0x3a')]['rawAttributes']);_0x3f48f1[_0x4a2d('0x3f')]=_['keys'](_0x1fd144[_0x4a2d('0x3f')]);_0x3f48f1[_0x4a2d('0x40')]=_['intersection'](_0x3f48f1[_0x4a2d('0x3e')],_0x3f48f1[_0x4a2d('0x3f')]);_0x1030a6[_0x4a2d('0x42')]=_[_0x4a2d('0x41')](_0x3f48f1['model'],qs[_0x4a2d('0x43')](_0x1fd144[_0x4a2d('0x3f')]['fields']));_0x1030a6[_0x4a2d('0x42')]=_0x1030a6['attributes'][_0x4a2d('0x44')]?_0x1030a6[_0x4a2d('0x42')]:_0x3f48f1[_0x4a2d('0x3e')];if(_0x1fd144['query'][_0x4a2d('0x4e')]){_0x1030a6['include']=[{'all':!![]}];}_0x1030a6=_[_0x4a2d('0x4b')]({},_0x1030a6,_0x1fd144['options']);return db[_0x4a2d('0x3a')][_0x4a2d('0x56')](_0x1030a6)['then'](handleEntityNotFound(_0x45c710,null))[_0x4a2d('0x20')](respondWithResult(_0x45c710,null))[_0x4a2d('0x52')](handleError(_0x45c710,null));};exports[_0x4a2d('0x57')]=function(_0x2b6306,_0x1e7efb){return db[_0x4a2d('0x3a')][_0x4a2d('0x57')](_0x2b6306[_0x4a2d('0x58')],{})[_0x4a2d('0x20')](respondWithResult(_0x1e7efb,0xc9))[_0x4a2d('0x52')](handleError(_0x1e7efb,null));};exports['update']=function(_0x4d5b47,_0x42f533){if(_0x4d5b47[_0x4a2d('0x58')]['id']){delete _0x4d5b47['body']['id'];}return db[_0x4a2d('0x3a')][_0x4a2d('0x56')]({'where':{'id':_0x4d5b47[_0x4a2d('0x54')]['id']}})[_0x4a2d('0x20')](handleEntityNotFound(_0x42f533,null))[_0x4a2d('0x20')](saveUpdates(_0x4d5b47[_0x4a2d('0x58')],null))[_0x4a2d('0x20')](respondWithResult(_0x42f533,null))[_0x4a2d('0x52')](handleError(_0x42f533,null));};exports[_0x4a2d('0x33')]=function(_0x347079,_0x5e7b9c){return db[_0x4a2d('0x3a')][_0x4a2d('0x56')]({'where':{'id':_0x347079[_0x4a2d('0x54')]['id']}})[_0x4a2d('0x20')](handleEntityNotFound(_0x5e7b9c,null))[_0x4a2d('0x20')](removeEntity(_0x5e7b9c,null))[_0x4a2d('0x52')](handleError(_0x5e7b9c,null));};exports[_0x4a2d('0x59')]=function(_0x335785,_0x4efd90){return db[_0x4a2d('0x3a')][_0x4a2d('0x59')]()[_0x4a2d('0x20')](respondWithResult(_0x4efd90,null))[_0x4a2d('0x52')](handleError(_0x4efd90,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports[_0x4a2d('0x5a')]=function(_0x4dedc4,_0x48839b,_0x5edbf4){var _0x38ac7b={'agent':{},'channel':'chat'};if(_0x4dedc4[_0x4a2d('0x58')]['id']){delete _0x4dedc4[_0x4a2d('0x58')]['id'];}_0x4dedc4['body']['read']=!![];_0x4dedc4['body']['readAt']=moment()['format'](_0x4a2d('0x5b'));_0x4dedc4[_0x4a2d('0x58')][_0x4a2d('0x5c')]=_0x4dedc4[_0x4a2d('0x58')][_0x4a2d('0x5c')]||_0x4dedc4[_0x4a2d('0x5d')]['id'];_0x38ac7b['agent']['id']=_0x4dedc4[_0x4a2d('0x58')]['UserId'];return db[_0x4a2d('0x3a')]['find']({'where':{'id':_0x4dedc4['params']['id'],'UserId':null}})[_0x4a2d('0x20')](handleEntityNotFound(_0x48839b,null))['then'](saveUpdates(_0x4dedc4[_0x4a2d('0x58')],null))[_0x4a2d('0x20')](function(_0x1c0d07){if(_0x1c0d07){_0x38ac7b[_0x4a2d('0x27')]=_0x1c0d07['get']({'plain':!![]});return db[_0x4a2d('0x5e')][_0x4a2d('0x56')]({'where':{'id':_0x1c0d07[_0x4a2d('0x5f')]}});}return null;})[_0x4a2d('0x20')](handleEntityNotFound(_0x48839b,null))[_0x4a2d('0x20')](function(_0x2f4e1e){if(_0x2f4e1e){return _0x2f4e1e[_0x4a2d('0x32')]({'UserId':_0x4dedc4[_0x4a2d('0x58')]['UserId'],'read1stAt':_['isNil'](_0x2f4e1e['read1stAt'])?moment()[_0x4a2d('0x60')](_0x4a2d('0x5b')):undefined});}return null;})[_0x4a2d('0x20')](function(_0x5caec3){if(_0x5caec3){_0x38ac7b[_0x4a2d('0x61')]=_0x5caec3['get']({'plain':!![]});interaction_log[_0x4a2d('0x21')](_0x4a2d('0x62'),_0x4dedc4['user']['id'],_0x4dedc4[_0x4a2d('0x5d')]['name'],_0x4dedc4[_0x4a2d('0x5d')][_0x4a2d('0x63')],_0x38ac7b[_0x4a2d('0x61')]['id'],_0x4dedc4[_0x4a2d('0x58')]?JSON[_0x4a2d('0x64')](_0x4dedc4[_0x4a2d('0x58')]):_0x4a2d('0x65'));return respondWithRpcPromise(_0x4a2d('0x66'),_0x4a2d('0x67'),_0x38ac7b);}return null;})[_0x4a2d('0x20')](function(_0x308600){var _0x23ea47=_0x4a2d('0x68')+_0x308600['message'][_0x4a2d('0x69')];return db[_0x4a2d('0x6a')][_0x4a2d('0x3f')](_0x23ea47,{'type':db[_0x4a2d('0x6b')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x50bb35){return _0x50bb35;});})[_0x4a2d('0x20')](function(_0x5efa06){if(_0x5efa06){_0x38ac7b[_0x4a2d('0x27')]['contact']=_0x5efa06[0x0];if(!_0x4dedc4[_0x4a2d('0x58')]['UserId'])return;return db[_0x4a2d('0x6c')][_0x4a2d('0x56')]({'where':{'id':_0x4dedc4[_0x4a2d('0x58')][_0x4a2d('0x5c')],'role':_0x4a2d('0x6d')},'attributes':['id',_0x4a2d('0x37'),_0x4a2d('0x6e'),_0x4a2d('0x6f'),_0x4a2d('0x70')],'raw':!![]});}return null;})[_0x4a2d('0x20')](function(_0x42490a){if(!_0x42490a)return null;_0x38ac7b[_0x4a2d('0x27')]['agent']=_0x42490a;return _0x38ac7b;})[_0x4a2d('0x20')](function(_0x27ca96){if(_0x27ca96){if(_0x4dedc4[_0x4a2d('0x58')][_0x4a2d('0x71')]){_0x38ac7b[_0x4a2d('0x27')]['interface']=util[_0x4a2d('0x60')](_0x4a2d('0x72'),_0x4dedc4[_0x4a2d('0x5d')][_0x4a2d('0x37')]);_0x38ac7b['message'][_0x4a2d('0x73')]=_0x38ac7b[_0x4a2d('0x73')];_0x38ac7b[_0x4a2d('0x27')][_0x4a2d('0x74')]=_0x38ac7b['channel'];_0x38ac7b['message'][_0x4a2d('0x75')]=_0x4a2d('0x5a');return respondWithRpcPromise(_0x4a2d('0x76'),_0x4a2d('0x76'),{'event':_0x4a2d('0x77'),'message':_[_0x4a2d('0x4b')](_0x38ac7b[_0x4a2d('0x27')],JSON['parse'](_0x38ac7b['interaction'][_0x4a2d('0x78')]))},client9002)['then'](function(){return _0x38ac7b;});}return _0x38ac7b;}return null;})[_0x4a2d('0x20')](respondWithResult(_0x48839b,null))[_0x4a2d('0x52')](handleError(_0x48839b,null));};var interaction_log=require(_0x4a2d('0x15'))(_0x4a2d('0x79'));exports[_0x4a2d('0x30')]=function(_0x3241ce,_0x2b77e3,_0x59f989){var _0xf34cce={'agent':{},'channel':_0x4a2d('0x7a')};if(_0x3241ce[_0x4a2d('0x58')]['id']){delete _0x3241ce[_0x4a2d('0x58')]['id'];}_0x3241ce[_0x4a2d('0x58')][_0x4a2d('0x5c')]=_0x3241ce[_0x4a2d('0x58')][_0x4a2d('0x5c')]||_0x3241ce[_0x4a2d('0x5d')]['id'];_0xf34cce['agent']['id']=_0x3241ce['body'][_0x4a2d('0x5c')];return db[_0x4a2d('0x3a')][_0x4a2d('0x56')]({'where':{'id':_0x3241ce[_0x4a2d('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2b77e3,null))[_0x4a2d('0x20')](function(_0x327ca2){if(_0x327ca2){_0xf34cce['message']=_0x327ca2[_0x4a2d('0x7b')]({'plain':!![]});return db[_0x4a2d('0x5e')]['find']({'where':{'id':_0x327ca2['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x2b77e3,null))['then'](function(_0x2cb244){if(_0x2cb244){_0xf34cce[_0x4a2d('0x61')]=_0x2cb244[_0x4a2d('0x7b')]({'plain':!![]});interaction_log[_0x4a2d('0x21')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3241ce['user']['id'],_0x3241ce[_0x4a2d('0x5d')][_0x4a2d('0x37')],_0x3241ce[_0x4a2d('0x5d')][_0x4a2d('0x63')],_0xf34cce[_0x4a2d('0x61')]['id'],_0x3241ce[_0x4a2d('0x58')]?JSON[_0x4a2d('0x64')](_0x3241ce[_0x4a2d('0x58')]):_0x4a2d('0x65'));return respondWithRpcPromise('RejectMessage',_0x4a2d('0x7c'),_0xf34cce);}return null;})[_0x4a2d('0x20')](function(_0x2e6184){var _0x3cccfa='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2e6184[_0x4a2d('0x27')][_0x4a2d('0x69')];return db[_0x4a2d('0x6a')][_0x4a2d('0x3f')](_0x3cccfa,{'type':db['Sequelize'][_0x4a2d('0x7d')]['SELECT'],'raw':!![]})['then'](function(_0x1e3da4){return _0x1e3da4;});})[_0x4a2d('0x20')](function(_0x788d70){if(_0x788d70){_0xf34cce[_0x4a2d('0x27')][_0x4a2d('0x7e')]=_0x788d70[0x0];if(!_0x3241ce[_0x4a2d('0x58')][_0x4a2d('0x5c')])return;return db['User'][_0x4a2d('0x56')]({'where':{'id':_0x3241ce[_0x4a2d('0x58')][_0x4a2d('0x5c')],'role':_0x4a2d('0x6d')},'attributes':['id',_0x4a2d('0x37'),_0x4a2d('0x6e'),_0x4a2d('0x6f'),'internal'],'raw':!![]});}return null;})[_0x4a2d('0x20')](function(_0x39f650){if(!_0x39f650)return null;_0xf34cce[_0x4a2d('0x27')][_0x4a2d('0x6d')]=_0x39f650;return _0xf34cce;})['then'](function(_0x2cffda){if(_0x2cffda){_0x2cffda[_0x4a2d('0x27')][_0x4a2d('0x7f')]=util[_0x4a2d('0x60')]('SIP/%s',_0x3241ce[_0x4a2d('0x5d')][_0x4a2d('0x37')]);_0x2cffda['message'][_0x4a2d('0x73')]=_0xf34cce[_0x4a2d('0x73')];_0x2cffda['message'][_0x4a2d('0x74')]=_0xf34cce[_0x4a2d('0x73')];_0x2cffda[_0x4a2d('0x27')][_0x4a2d('0x75')]=_0x4a2d('0x30');respondWithRpcPromise(_0x4a2d('0x76'),_0x4a2d('0x76'),{'event':_0x4a2d('0x80'),'message':_[_0x4a2d('0x4b')](_0xf34cce['message'],JSON[_0x4a2d('0x81')](_0xf34cce[_0x4a2d('0x61')][_0x4a2d('0x78')]))},client9002);return _0xf34cce;}return null;})['then'](respondWithResult(_0x2b77e3,null))[_0x4a2d('0x52')](handleError(_0x2b77e3,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 67d27bd..e21d8de 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 _0xfe8d=['save','update','remove','emit','hook','exports','events','ChatMessage','setMaxListeners'];(function(_0x45b28e,_0x2f0198){var _0x4e5c9f=function(_0x54de6f){while(--_0x54de6f){_0x45b28e['push'](_0x45b28e['shift']());}};_0x4e5c9f(++_0x2f0198);}(_0xfe8d,0x9f));var _0xdfe8=function(_0x283ec6,_0x219a59){_0x283ec6=_0x283ec6-0x0;var _0x312d15=_0xfe8d[_0x283ec6];return _0x312d15;};'use strict';var EventEmitter=require(_0xdfe8('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0xdfe8('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xdfe8('0x2')](0x0);var events={'afterCreate':_0xdfe8('0x3'),'afterUpdate':_0xdfe8('0x4'),'afterDestroy':_0xdfe8('0x5')};function emitEvent(_0x1d4c42){return function(_0x968f1f,_0x18010b,_0x2ff5b1){ChatMessageEvents[_0xdfe8('0x6')](_0x1d4c42+':'+_0x968f1f['id'],_0x968f1f);ChatMessageEvents[_0xdfe8('0x6')](_0x1d4c42,_0x968f1f);_0x2ff5b1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xdfe8('0x7')](e,emitEvent(event));}}module[_0xdfe8('0x8')]=ChatMessageEvents;
\ No newline at end of file
+var _0xfc35=['ChatMessage','setMaxListeners','save','remove','emit','exports','events','../../mysqldb'];(function(_0x301ea6,_0x202cf3){var _0x3bd1ae=function(_0xc27c01){while(--_0xc27c01){_0x301ea6['push'](_0x301ea6['shift']());}};_0x3bd1ae(++_0x202cf3);}(_0xfc35,0x146));var _0x5fc3=function(_0x3958fc,_0x2b42cd){_0x3958fc=_0x3958fc-0x0;var _0x28fd60=_0xfc35[_0x3958fc];return _0x28fd60;};'use strict';var EventEmitter=require(_0x5fc3('0x0'));var ChatMessage=require(_0x5fc3('0x1'))['db'][_0x5fc3('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x5fc3('0x3')](0x0);var events={'afterCreate':_0x5fc3('0x4'),'afterUpdate':'update','afterDestroy':_0x5fc3('0x5')};function emitEvent(_0x3d0b03){return function(_0x16ca3d,_0x5343cc,_0x12a790){ChatMessageEvents[_0x5fc3('0x6')](_0x3d0b03+':'+_0x16ca3d['id'],_0x16ca3d);ChatMessageEvents['emit'](_0x3d0b03,_0x16ca3d);_0x12a790(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x5fc3('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 81adfc8..5dc2fa4 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 _0xe141=['then','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','direction','toLowerCase','isNil','UserId','ChatInteraction','findOne','ChatInteractionId'];(function(_0x350119,_0x3db5eb){var _0x297b6e=function(_0x515def){while(--_0x515def){_0x350119['push'](_0x350119['shift']());}};_0x297b6e(++_0x3db5eb);}(_0xe141,0x17f));var _0x1e14=function(_0x256d6a,_0x2f002f){_0x256d6a=_0x256d6a-0x0;var _0x460058=_0xe141[_0x256d6a];return _0x460058;};'use strict';var _=require(_0x1e14('0x0'));var util=require(_0x1e14('0x1'));var logger=require(_0x1e14('0x2'))(_0x1e14('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1e14('0x4'));var fs=require('fs');var path=require(_0x1e14('0x5'));var rimraf=require(_0x1e14('0x6'));var config=require(_0x1e14('0x7'));var attributes=require(_0x1e14('0x8'));module['exports']=function(_0x3ae6d4,_0x3d6b87){return _0x3ae6d4[_0x1e14('0x9')](_0x1e14('0xa'),attributes,{'tableName':_0x1e14('0xb'),'paranoid':![],'indexes':[{'name':_0x1e14('0xc'),'fields':[_0x1e14('0xd')],'type':_0x1e14('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x593cd8,_0x1e9346,_0x199eee){var _0x161be1=_0x3ae6d4[_0x1e14('0xf')];var _0x5d3fb9=_0x593cd8['get']({'plain':!![]});if(_0x5d3fb9[_0x1e14('0x10')][_0x1e14('0x11')]()==='in'||_0x5d3fb9[_0x1e14('0x10')][_0x1e14('0x11')]()==='out'&&!_0x5d3fb9['secret']&&!_[_0x1e14('0x12')](_0x5d3fb9[_0x1e14('0x13')])){_0x161be1[_0x1e14('0x14')][_0x1e14('0x15')]({'where':{'id':_0x5d3fb9[_0x1e14('0x16')]}})[_0x1e14('0x17')](function(_0x5840df){if(_0x5840df){_0x5840df[_0x1e14('0x18')]({'lastMsgAt':_0x5d3fb9[_0x1e14('0x19')],'lastMsgDirection':_0x5d3fb9['direction'][_0x1e14('0x11')]()});}})['catch'](function(_0x323a4b){console[_0x1e14('0x1a')](_0x323a4b);});}_0x199eee();}},'charset':_0x1e14('0x1b'),'collate':_0x1e14('0x1c')});};
\ No newline at end of file
+var _0xa61b=['ChatInteractionId','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatMessage','chat_messages','body','get','direction','toLowerCase','out','secret','isNil','UserId','findOne'];(function(_0x2338ba,_0x3a197e){var _0x1aaac0=function(_0x4fc2d1){while(--_0x4fc2d1){_0x2338ba['push'](_0x2338ba['shift']());}};_0x1aaac0(++_0x3a197e);}(_0xa61b,0x115));var _0xba61=function(_0x2559d1,_0x35bdea){_0x2559d1=_0x2559d1-0x0;var _0x4b8ab9=_0xa61b[_0x2559d1];return _0x4b8ab9;};'use strict';var _=require(_0xba61('0x0'));var util=require(_0xba61('0x1'));var logger=require(_0xba61('0x2'))(_0xba61('0x3'));var moment=require(_0xba61('0x4'));var BPromise=require(_0xba61('0x5'));var rp=require(_0xba61('0x6'));var fs=require('fs');var path=require(_0xba61('0x7'));var rimraf=require(_0xba61('0x8'));var config=require(_0xba61('0x9'));var attributes=require('./chatMessage.attributes');module[_0xba61('0xa')]=function(_0x167f37,_0x6d12f0){return _0x167f37[_0xba61('0xb')](_0xba61('0xc'),attributes,{'tableName':_0xba61('0xd'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0xba61('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2a488d,_0x1f89da,_0x4e16fc){var _0x4d3f60=_0x167f37['models'];var _0x2c5a6b=_0x2a488d[_0xba61('0xf')]({'plain':!![]});if(_0x2c5a6b[_0xba61('0x10')][_0xba61('0x11')]()==='in'||_0x2c5a6b[_0xba61('0x10')][_0xba61('0x11')]()===_0xba61('0x12')&&!_0x2c5a6b[_0xba61('0x13')]&&!_[_0xba61('0x14')](_0x2c5a6b[_0xba61('0x15')])){_0x4d3f60['ChatInteraction'][_0xba61('0x16')]({'where':{'id':_0x2c5a6b[_0xba61('0x17')]}})['then'](function(_0x1f7cea){if(_0x1f7cea){_0x1f7cea[_0xba61('0x18')]({'lastMsgAt':_0x2c5a6b[_0xba61('0x19')],'lastMsgDirection':_0x2c5a6b['direction'][_0xba61('0x11')]()});}})[_0xba61('0x1a')](function(_0xe81657){console[_0xba61('0x1b')](_0xe81657);});}_0x4e16fc();}},'charset':_0xba61('0x1c'),'collate':_0xba61('0x1d')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index e5e50f5..2c49dbd 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 _0xfc51=['info','result','catch','CreateChatMessage','create','options','raw','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','redis','localhost','./chatMessage.socket','register','request','then','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','ChatMessage,\x20%s,\x20%s','message'];(function(_0x3f4750,_0x5ee1c7){var _0xea4b0c=function(_0xb64051){while(--_0xb64051){_0x3f4750['push'](_0x3f4750['shift']());}};_0xea4b0c(++_0x5ee1c7);}(_0xfc51,0xbb));var _0x1fc5=function(_0x1a6655,_0x2e7d78){_0x1a6655=_0x1a6655-0x0;var _0x4af9ca=_0xfc51[_0x1a6655];return _0x4af9ca;};'use strict';var _=require('lodash');var util=require(_0x1fc5('0x0'));var moment=require(_0x1fc5('0x1'));var BPromise=require(_0x1fc5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1fc5('0x3'));var db=require(_0x1fc5('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1fc5('0x5'))(_0x1fc5('0x6'));var config=require(_0x1fc5('0x7'));var jayson=require(_0x1fc5('0x8'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x1fc5('0x9')](config[_0x1fc5('0xa')],{'host':_0x1fc5('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1fc5('0xa')]));require(_0x1fc5('0xc'))[_0x1fc5('0xd')](socket);function respondWithRpcPromise(_0x146708,_0x2db19c,_0xb75fa){return new BPromise(function(_0x34a96b,_0x5a0578){return client[_0x1fc5('0xe')](_0x146708,_0xb75fa)[_0x1fc5('0xf')](function(_0x3c3cf9){logger['info']('ChatMessage,\x20%s,\x20%s',_0x2db19c,_0x1fc5('0x10'));logger[_0x1fc5('0x11')](_0x1fc5('0x12'),_0x2db19c,'request\x20sent',JSON[_0x1fc5('0x13')](_0x3c3cf9));if(_0x3c3cf9[_0x1fc5('0x14')]){if(_0x3c3cf9[_0x1fc5('0x14')]['code']===0x1f4){logger[_0x1fc5('0x14')](_0x1fc5('0x15'),_0x2db19c,_0x3c3cf9[_0x1fc5('0x14')][_0x1fc5('0x16')]);return _0x5a0578(_0x3c3cf9[_0x1fc5('0x14')]['message']);}logger[_0x1fc5('0x14')](_0x1fc5('0x15'),_0x2db19c,_0x3c3cf9[_0x1fc5('0x14')]['message']);return _0x34a96b(_0x3c3cf9['error'][_0x1fc5('0x16')]);}else{logger[_0x1fc5('0x17')](_0x1fc5('0x15'),_0x2db19c,_0x1fc5('0x10'));_0x34a96b(_0x3c3cf9[_0x1fc5('0x18')]['message']);}})[_0x1fc5('0x19')](function(_0x2f80d6){logger[_0x1fc5('0x14')](_0x1fc5('0x15'),_0x2db19c,_0x2f80d6);_0x5a0578(_0x2f80d6);});});}exports[_0x1fc5('0x1a')]=function(_0xedf040){var _0x44ca83=this;return new Promise(function(_0x2d9fff,_0x517e0f){return db['ChatMessage'][_0x1fc5('0x1b')](_0xedf040['body'],{'raw':_0xedf040[_0x1fc5('0x1c')]?_0xedf040[_0x1fc5('0x1c')][_0x1fc5('0x1d')]===undefined?!![]:![]:!![]})[_0x1fc5('0xf')](function(_0x554f38){logger[_0x1fc5('0x17')](_0x1fc5('0x1a'),_0xedf040);logger[_0x1fc5('0x11')](_0x1fc5('0x1a'),_0xedf040,JSON['stringify'](_0x554f38));_0x2d9fff(_0x554f38);})[_0x1fc5('0x19')](function(_0x5915e7){logger[_0x1fc5('0x14')](_0x1fc5('0x1a'),_0x5915e7[_0x1fc5('0x16')],_0xedf040);_0x517e0f(_0x44ca83['error'](0x1f4,_0x5915e7[_0x1fc5('0x16')]));});});};
\ No newline at end of file
+var _0x881e=['then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateChatMessage','ChatMessage','create','options','raw','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','./chatMessage.socket','register','request'];(function(_0x8401bf,_0x295987){var _0x3a2808=function(_0x3735b5){while(--_0x3735b5){_0x8401bf['push'](_0x8401bf['shift']());}};_0x3a2808(++_0x295987);}(_0x881e,0x1c2));var _0xe881=function(_0x398d85,_0x284b81){_0x398d85=_0x398d85-0x0;var _0x4b5faa=_0x881e[_0x398d85];return _0x4b5faa;};'use strict';var _=require(_0xe881('0x0'));var util=require('util');var moment=require(_0xe881('0x1'));var BPromise=require(_0xe881('0x2'));var rs=require(_0xe881('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe881('0x4'))['db'];var utils=require(_0xe881('0x5'));var logger=require(_0xe881('0x6'))(_0xe881('0x7'));var config=require(_0xe881('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe881('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0xe881('0xa')],{'host':_0xe881('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe881('0xc'))[_0xe881('0xd')](socket);function respondWithRpcPromise(_0x3a6a4f,_0x499bd3,_0x25f281){return new BPromise(function(_0x530aec,_0x30fed4){return client[_0xe881('0xe')](_0x3a6a4f,_0x25f281)[_0xe881('0xf')](function(_0x29d1d2){logger[_0xe881('0x10')](_0xe881('0x11'),_0x499bd3,_0xe881('0x12'));logger[_0xe881('0x13')](_0xe881('0x14'),_0x499bd3,_0xe881('0x12'),JSON[_0xe881('0x15')](_0x29d1d2));if(_0x29d1d2['error']){if(_0x29d1d2['error']['code']===0x1f4){logger['error'](_0xe881('0x11'),_0x499bd3,_0x29d1d2[_0xe881('0x16')][_0xe881('0x17')]);return _0x30fed4(_0x29d1d2[_0xe881('0x16')][_0xe881('0x17')]);}logger[_0xe881('0x16')](_0xe881('0x11'),_0x499bd3,_0x29d1d2[_0xe881('0x16')][_0xe881('0x17')]);return _0x530aec(_0x29d1d2[_0xe881('0x16')][_0xe881('0x17')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x499bd3,_0xe881('0x12'));_0x530aec(_0x29d1d2[_0xe881('0x18')]['message']);}})['catch'](function(_0x58d478){logger[_0xe881('0x16')](_0xe881('0x11'),_0x499bd3,_0x58d478);_0x30fed4(_0x58d478);});});}exports[_0xe881('0x19')]=function(_0x780286){var _0xbd3116=this;return new Promise(function(_0x1b8dc0,_0x2b823d){return db[_0xe881('0x1a')][_0xe881('0x1b')](_0x780286['body'],{'raw':_0x780286['options']?_0x780286[_0xe881('0x1c')][_0xe881('0x1d')]===undefined?!![]:![]:!![]})[_0xe881('0xf')](function(_0x46a277){logger[_0xe881('0x10')](_0xe881('0x19'),_0x780286);logger[_0xe881('0x13')](_0xe881('0x19'),_0x780286,JSON['stringify'](_0x46a277));_0x1b8dc0(_0x46a277);})[_0xe881('0x1e')](function(_0x19043b){logger['error']('CreateChatMessage',_0x19043b[_0xe881('0x17')],_0x780286);_0x2b823d(_0xbd3116[_0xe881('0x16')](0x1f4,_0x19043b[_0xe881('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index f40bc29..302cd9c 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 _0xa23f=['save','emit','register','chatMessage:','./chatMessage.events'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa23f,0x7c));var _0xfa23=function(_0x583cab,_0x57c9ee){_0x583cab=_0x583cab-0x0;var _0x5178ed=_0xa23f[_0x583cab];return _0x5178ed;};'use strict';var ChatMessageEvents=require(_0xfa23('0x0'));var events=[_0xfa23('0x1'),'remove','update'];function createListener(_0xb81edf,_0x3f714c){return function(_0x1c85a9){_0x3f714c[_0xfa23('0x2')](_0xb81edf,_0x1c85a9);};}function removeListener(_0x5643b1,_0x86778e){return function(){ChatMessageEvents['removeListener'](_0x5643b1,_0x86778e);};}exports[_0xfa23('0x3')]=function(_0x2df2f5){for(var _0x4c3f4=0x0,_0x3696ef=events['length'];_0x4c3f4<_0x3696ef;_0x4c3f4++){var _0x5a7882=events[_0x4c3f4];var _0x59d53e=createListener(_0xfa23('0x4')+_0x5a7882,_0x2df2f5);ChatMessageEvents['on'](_0x5a7882,_0x59d53e);}};
\ No newline at end of file
+var _0xa93e=['update','emit','removeListener','register','length','remove'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0xa93e,0x1df));var _0xea93=function(_0x4eed29,_0x2abab3){_0x4eed29=_0x4eed29-0x0;var _0x163d68=_0xa93e[_0x4eed29];return _0x163d68;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=['save',_0xea93('0x0'),_0xea93('0x1')];function createListener(_0x47d9db,_0xd64380){return function(_0x50af65){_0xd64380[_0xea93('0x2')](_0x47d9db,_0x50af65);};}function removeListener(_0x5b5341,_0x5398ba){return function(){ChatMessageEvents[_0xea93('0x3')](_0x5b5341,_0x5398ba);};}exports[_0xea93('0x4')]=function(_0x6c6985){for(var _0x26def3=0x0,_0x477a7d=events[_0xea93('0x5')];_0x26def3<_0x477a7d;_0x26def3++){var _0x54ebdf=events[_0x26def3];var _0x12876e=createListener('chatMessage:'+_0x54ebdf,_0x6c6985);ChatMessageEvents['on'](_0x54ebdf,_0x12876e);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 0130d30..88b5a32 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 _0x7409=['tracked','chat','chatmessage:create','create','put','update','/:id/accept','/:id/reject','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','/describe','isAuthenticated','describe','/:id','show'];(function(_0x18c907,_0x5ec1d5){var _0xef1d9c=function(_0x5e989b){while(--_0x5e989b){_0x18c907['push'](_0x18c907['shift']());}};_0xef1d9c(++_0x5ec1d5);}(_0x7409,0x1a7));var _0x9740=function(_0x1bfe2b,_0x34856e){_0x1bfe2b=_0x1bfe2b-0x0;var _0x1477d4=_0x7409[_0x1bfe2b];return _0x1477d4;};'use strict';var multer=require(_0x9740('0x0'));var util=require(_0x9740('0x1'));var path=require(_0x9740('0x2'));var timeout=require(_0x9740('0x3'));var express=require(_0x9740('0x4'));var router=express[_0x9740('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9740('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9740('0x7'));var controller=require('./chatMessage.controller');router[_0x9740('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9740('0x8')](_0x9740('0x9'),auth[_0x9740('0xa')](),controller[_0x9740('0xb')]);router[_0x9740('0x8')](_0x9740('0xc'),auth[_0x9740('0xa')](),controller[_0x9740('0xd')]);router['post']('/',auth[_0x9740('0xa')](),interaction[_0x9740('0xe')](_0x9740('0xf'),_0x9740('0x10')),controller[_0x9740('0x11')]);router[_0x9740('0x12')]('/:id',controller[_0x9740('0x13')]);router[_0x9740('0x12')](_0x9740('0x14'),auth[_0x9740('0xa')](),controller['accept']);router[_0x9740('0x12')](_0x9740('0x15'),auth['isAuthenticated'](),controller['reject']);router['delete'](_0x9740('0xc'),auth[_0x9740('0xa')](),controller['destroy']);module[_0x9740('0x16')]=router;
\ No newline at end of file
+var _0x0415=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/describe','describe','/:id','post','chat','chatmessage:create','create','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x224a12,_0x386edf){var _0x506817=function(_0x1623e6){while(--_0x1623e6){_0x224a12['push'](_0x224a12['shift']());}};_0x506817(++_0x386edf);}(_0x0415,0xc5));var _0x5041=function(_0x3093a4,_0x13d353){_0x3093a4=_0x3093a4-0x0;var _0x204931=_0x0415[_0x3093a4];return _0x204931;};'use strict';var multer=require(_0x5041('0x0'));var util=require('util');var path=require(_0x5041('0x1'));var timeout=require(_0x5041('0x2'));var express=require(_0x5041('0x3'));var router=express[_0x5041('0x4')]();var fs_extra=require(_0x5041('0x5'));var auth=require(_0x5041('0x6'));var interaction=require(_0x5041('0x7'));var config=require('../../config/environment');var controller=require('./chatMessage.controller');router['get']('/',auth[_0x5041('0x8')](),controller['index']);router[_0x5041('0x9')](_0x5041('0xa'),auth[_0x5041('0x8')](),controller[_0x5041('0xb')]);router[_0x5041('0x9')](_0x5041('0xc'),auth[_0x5041('0x8')](),controller['show']);router[_0x5041('0xd')]('/',auth[_0x5041('0x8')](),interaction['tracked'](_0x5041('0xe'),_0x5041('0xf')),controller[_0x5041('0x10')]);router['put'](_0x5041('0xc'),controller['update']);router[_0x5041('0x11')](_0x5041('0x12'),auth['isAuthenticated'](),controller[_0x5041('0x13')]);router[_0x5041('0x11')](_0x5041('0x14'),auth[_0x5041('0x8')](),controller[_0x5041('0x15')]);router[_0x5041('0x16')](_0x5041('0xc'),auth[_0x5041('0x8')](),controller[_0x5041('0x17')]);module[_0x5041('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index afad223..8a6201c 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 _0x5f2f=['exports','TEXT','medium','sequelize'];(function(_0x3f4157,_0x1d0ac5){var _0x4d5d1d=function(_0x4d857c){while(--_0x4d857c){_0x3f4157['push'](_0x3f4157['shift']());}};_0x4d5d1d(++_0x1d0ac5);}(_0x5f2f,0x73));var _0xf5f2=function(_0x515df6,_0x4286cf){_0x515df6=_0x515df6-0x0;var _0x442370=_0x5f2f[_0x515df6];return _0x442370;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'body':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]}};
\ No newline at end of file
+var _0xdb28=['TEXT','medium','sequelize','exports'];(function(_0x141b6d,_0x5384f4){var _0x40f2b7=function(_0x51336f){while(--_0x51336f){_0x141b6d['push'](_0x141b6d['shift']());}};_0x40f2b7(++_0x5384f4);}(_0xdb28,0x106));var _0x8db2=function(_0x57ff4b,_0x17c342){_0x57ff4b=_0x57ff4b-0x0;var _0x5e86bf=_0xdb28[_0x57ff4b];return _0x5e86bf;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'body':{'type':Sequelize[_0x8db2('0x2')](_0x8db2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x8db2('0x3')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 90824f9..9475017 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x4c7fb5,_0x2548ef){var _0x2e10ac=function(_0xf7e27c){while(--_0xf7e27c){_0x4c7fb5['push'](_0x4c7fb5['shift']());}};_0x2e10ac(++_0x2548ef);}(_0x7a54,0x106));var _0x47a5=function(_0x316041,_0x5daa29){_0x316041=_0x316041-0x0;var _0x38640f=_0x7a54[_0x316041];return _0x38640f;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x5eca55,_0x37a307){var _0x4b8ae7=function(_0x383c17){while(--_0x383c17){_0x5eca55['push'](_0x5eca55['shift']());}};_0x4b8ae7(++_0x37a307);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index a200767..47402be 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 _0xc8ca=['emit','hasOwnProperty','hook','events','../../mysqldb','remove'];(function(_0x2a8907,_0x5df696){var _0x435f90=function(_0xe2c907){while(--_0xe2c907){_0x2a8907['push'](_0x2a8907['shift']());}};_0x435f90(++_0x5df696);}(_0xc8ca,0x1b3));var _0xac8c=function(_0x348db0,_0x103906){_0x348db0=_0x348db0-0x0;var _0x405e55=_0xc8ca[_0x348db0];return _0x405e55;};'use strict';var EventEmitter=require(_0xac8c('0x0'));var ChatOfflineMessage=require(_0xac8c('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xac8c('0x2')};function emitEvent(_0x30b008){return function(_0x5d2752,_0x393ea5,_0x22417b){ChatOfflineMessageEvents[_0xac8c('0x3')](_0x30b008+':'+_0x5d2752['id'],_0x5d2752);ChatOfflineMessageEvents['emit'](_0x30b008,_0x5d2752);_0x22417b(null);};}for(var e in events){if(events[_0xac8c('0x4')](e)){var event=events[e];ChatOfflineMessage[_0xac8c('0x5')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x79c0=['remove','emit','hasOwnProperty','exports','events','ChatOfflineMessage','setMaxListeners','save','update'];(function(_0x56e0e8,_0x16ef91){var _0x2dab50=function(_0x4fe720){while(--_0x4fe720){_0x56e0e8['push'](_0x56e0e8['shift']());}};_0x2dab50(++_0x16ef91);}(_0x79c0,0x82));var _0x079c=function(_0xd73c87,_0x3ea3bb){_0xd73c87=_0xd73c87-0x0;var _0x5d0898=_0x79c0[_0xd73c87];return _0x5d0898;};'use strict';var EventEmitter=require(_0x079c('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0x079c('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x079c('0x2')](0x0);var events={'afterCreate':_0x079c('0x3'),'afterUpdate':_0x079c('0x4'),'afterDestroy':_0x079c('0x5')};function emitEvent(_0x53f551){return function(_0x8c5b44,_0x5884db,_0x215798){ChatOfflineMessageEvents[_0x079c('0x6')](_0x53f551+':'+_0x8c5b44['id'],_0x8c5b44);ChatOfflineMessageEvents[_0x079c('0x6')](_0x53f551,_0x8c5b44);_0x215798(null);};}for(var e in events){if(events[_0x079c('0x7')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0x079c('0x8')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index f47b4f0..63cb18b 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 _0xf68d=['chat_offline_messages','utf8mb4','./chatOfflineMessage.attributes','exports','ChatOfflineMessage'];(function(_0x394b23,_0x36d244){var _0xccfc8b=function(_0x2609f6){while(--_0x2609f6){_0x394b23['push'](_0x394b23['shift']());}};_0xccfc8b(++_0x36d244);}(_0xf68d,0x133));var _0xdf68=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xf68d[_0x53ccf2];return _0x5a2964;};'use strict';var attributes=require(_0xdf68('0x0'));module[_0xdf68('0x1')]=function(_0x3dec34){return _0x3dec34['define'](_0xdf68('0x2'),attributes,{'tableName':_0xdf68('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdf68('0x4'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x8810=['ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports'];(function(_0x2353fe,_0x4b0bca){var _0x4d43f6=function(_0x5d0bd9){while(--_0x5d0bd9){_0x2353fe['push'](_0x2353fe['shift']());}};_0x4d43f6(++_0x4b0bca);}(_0x8810,0x82));var _0x0881=function(_0x5957ce,_0x1ebd2d){_0x5957ce=_0x5957ce-0x0;var _0xc94f7b=_0x8810[_0x5957ce];return _0xc94f7b;};'use strict';var attributes=require(_0x0881('0x0'));module[_0x0881('0x1')]=function(_0x2cadf3){return _0x2cadf3['define'](_0x0881('0x2'),attributes,{'tableName':_0x0881('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0881('0x4'),'collate':_0x0881('0x5')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 7082479..434c8d3 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 _0xec25=['catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x2e6dd3,_0x8426ec){var _0x86721e=function(_0xae1509){while(--_0xae1509){_0x2e6dd3['push'](_0x2e6dd3['shift']());}};_0x86721e(++_0x8426ec);}(_0xec25,0x1b9));var _0x5ec2=function(_0x3eb3b9,_0x5b04ba){_0x3eb3b9=_0x3eb3b9-0x0;var _0x1b56f7=_0xec25[_0x3eb3b9];return _0x1b56f7;};'use strict';var _=require('lodash');var util=require(_0x5ec2('0x0'));var moment=require('moment');var BPromise=require(_0x5ec2('0x1'));var rs=require(_0x5ec2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5ec2('0x3'))['db'];var utils=require(_0x5ec2('0x4'));var logger=require(_0x5ec2('0x5'))(_0x5ec2('0x6'));var config=require('../../config/environment');var jayson=require(_0x5ec2('0x7'));var client=jayson[_0x5ec2('0x8')][_0x5ec2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x10cc1d,_0x2e4bae,_0x48d0a1){return new BPromise(function(_0x5c7158,_0x1a8e63){return client[_0x5ec2('0xa')](_0x10cc1d,_0x48d0a1)['then'](function(_0x53193e){logger['info'](_0x5ec2('0xb'),_0x2e4bae,_0x5ec2('0xc'));logger[_0x5ec2('0xd')](_0x5ec2('0xe'),_0x2e4bae,'request\x20sent',JSON[_0x5ec2('0xf')](_0x53193e));if(_0x53193e[_0x5ec2('0x10')]){if(_0x53193e[_0x5ec2('0x10')][_0x5ec2('0x11')]===0x1f4){logger[_0x5ec2('0x10')](_0x5ec2('0xb'),_0x2e4bae,_0x53193e[_0x5ec2('0x10')][_0x5ec2('0x12')]);return _0x1a8e63(_0x53193e['error']['message']);}logger[_0x5ec2('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x2e4bae,_0x53193e[_0x5ec2('0x10')][_0x5ec2('0x12')]);return _0x5c7158(_0x53193e[_0x5ec2('0x10')]['message']);}else{logger[_0x5ec2('0x13')](_0x5ec2('0xb'),_0x2e4bae,'request\x20sent');_0x5c7158(_0x53193e[_0x5ec2('0x14')][_0x5ec2('0x12')]);}})[_0x5ec2('0x15')](function(_0x24c496){logger['error'](_0x5ec2('0xb'),_0x2e4bae,_0x24c496);_0x1a8e63(_0x24c496);});});}
\ No newline at end of file
+var _0xd5bf=['ChatOfflineMessage,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','request','info','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3e83e8,_0x35bbb4){var _0x57fcca=function(_0x1ee0bf){while(--_0x1ee0bf){_0x3e83e8['push'](_0x3e83e8['shift']());}};_0x57fcca(++_0x35bbb4);}(_0xd5bf,0x66));var _0xfd5b=function(_0x14dc4c,_0x2516a7){_0x14dc4c=_0x14dc4c-0x0;var _0x486b53=_0xd5bf[_0x14dc4c];return _0x486b53;};'use strict';var _=require(_0xfd5b('0x0'));var util=require(_0xfd5b('0x1'));var moment=require(_0xfd5b('0x2'));var BPromise=require(_0xfd5b('0x3'));var rs=require(_0xfd5b('0x4'));var fs=require('fs');var Redis=require(_0xfd5b('0x5'));var db=require(_0xfd5b('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfd5b('0x7'));var config=require(_0xfd5b('0x8'));var jayson=require(_0xfd5b('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c61da,_0x3cc261,_0x42b565){return new BPromise(function(_0x485158,_0x15022d){return client[_0xfd5b('0xa')](_0x2c61da,_0x42b565)['then'](function(_0x1ec371){logger[_0xfd5b('0xb')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3cc261,_0xfd5b('0xc'));logger['debug'](_0xfd5b('0xd'),_0x3cc261,'request\x20sent',JSON[_0xfd5b('0xe')](_0x1ec371));if(_0x1ec371['error']){if(_0x1ec371[_0xfd5b('0xf')][_0xfd5b('0x10')]===0x1f4){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x3cc261,_0x1ec371[_0xfd5b('0xf')][_0xfd5b('0x11')]);return _0x15022d(_0x1ec371['error'][_0xfd5b('0x11')]);}logger[_0xfd5b('0xf')](_0xfd5b('0x12'),_0x3cc261,_0x1ec371[_0xfd5b('0xf')][_0xfd5b('0x11')]);return _0x485158(_0x1ec371[_0xfd5b('0xf')][_0xfd5b('0x11')]);}else{logger[_0xfd5b('0xb')](_0xfd5b('0x12'),_0x3cc261,_0xfd5b('0xc'));_0x485158(_0x1ec371['result'][_0xfd5b('0x11')]);}})[_0xfd5b('0x13')](function(_0x4289ab){logger[_0xfd5b('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3cc261,_0x4289ab);_0x15022d(_0x4289ab);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 3387c10..67ddfb0 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 _0xf27a=['../../components/interaction/service','./chatOfflineMessage.controller','isAuthenticated','get','/describe','describe','show','post','update','delete','/:id','destroy','exports','multer','util','Router','fs-extra','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf27a,0x187));var _0xaf27=function(_0x5a40f2,_0x3616a0){_0x5a40f2=_0x5a40f2-0x0;var _0x2de00c=_0xf27a[_0x5a40f2];return _0x2de00c;};'use strict';var multer=require(_0xaf27('0x0'));var util=require(_0xaf27('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xaf27('0x2')]();var fs_extra=require(_0xaf27('0x3'));var auth=require(_0xaf27('0x4'));var interaction=require(_0xaf27('0x5'));var config=require('../../config/environment');var controller=require(_0xaf27('0x6'));router['get']('/',auth[_0xaf27('0x7')](),controller['index']);router[_0xaf27('0x8')](_0xaf27('0x9'),auth[_0xaf27('0x7')](),controller[_0xaf27('0xa')]);router[_0xaf27('0x8')]('/:id',auth[_0xaf27('0x7')](),controller[_0xaf27('0xb')]);router[_0xaf27('0xc')]('/',auth[_0xaf27('0x7')](),controller['create']);router['put']('/:id',auth[_0xaf27('0x7')](),controller[_0xaf27('0xd')]);router[_0xaf27('0xe')](_0xaf27('0xf'),auth[_0xaf27('0x7')](),controller[_0xaf27('0x10')]);module[_0xaf27('0x11')]=router;
\ No newline at end of file
+var _0xf0e0=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','get','/describe','/:id'];(function(_0x2d2005,_0x4949db){var _0x45df97=function(_0x119e20){while(--_0x119e20){_0x2d2005['push'](_0x2d2005['shift']());}};_0x45df97(++_0x4949db);}(_0xf0e0,0xee));var _0x0f0e=function(_0x586d62,_0x5ab1c4){_0x586d62=_0x586d62-0x0;var _0x1edea7=_0xf0e0[_0x586d62];return _0x1edea7;};'use strict';var multer=require(_0x0f0e('0x0'));var util=require(_0x0f0e('0x1'));var path=require(_0x0f0e('0x2'));var timeout=require(_0x0f0e('0x3'));var express=require(_0x0f0e('0x4'));var router=express[_0x0f0e('0x5')]();var fs_extra=require(_0x0f0e('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x0f0e('0x7'));var config=require(_0x0f0e('0x8'));var controller=require(_0x0f0e('0x9'));router['get']('/',auth[_0x0f0e('0xa')](),controller['index']);router[_0x0f0e('0xb')](_0x0f0e('0xc'),auth[_0x0f0e('0xa')](),controller['describe']);router[_0x0f0e('0xb')](_0x0f0e('0xd'),auth[_0x0f0e('0xa')](),controller['show']);router[_0x0f0e('0xe')]('/',auth[_0x0f0e('0xa')](),controller[_0x0f0e('0xf')]);router[_0x0f0e('0x10')](_0x0f0e('0xd'),auth['isAuthenticated'](),controller[_0x0f0e('0x11')]);router[_0x0f0e('0x12')](_0x0f0e('0xd'),auth[_0x0f0e('0xa')](),controller[_0x0f0e('0x13')]);module[_0x0f0e('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 950eea1..523f44d 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 _0xa41a=['exports','STRING','ENUM','mouseOver','timeout','INTEGER','sequelize'];(function(_0x34bb68,_0x5b0079){var _0x3db9fb=function(_0x2c87bd){while(--_0x2c87bd){_0x34bb68['push'](_0x34bb68['shift']());}};_0x3db9fb(++_0x5b0079);}(_0xa41a,0x1a3));var _0xaa41=function(_0x2b47fc,_0x213ead){_0x2b47fc=_0x2b47fc-0x0;var _0x220b85=_0xa41a[_0x2b47fc];return _0x220b85;};'use strict';var Sequelize=require(_0xaa41('0x0'));module[_0xaa41('0x1')]={'name':{'type':Sequelize[_0xaa41('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xaa41('0x3')](_0xaa41('0x4'),_0xaa41('0x5')),'defaultValue':_0xaa41('0x4')},'selector':{'type':Sequelize[_0xaa41('0x2')]},'timeout':{'type':Sequelize[_0xaa41('0x6')]}};
\ No newline at end of file
+var _0x58e8=['timeout','INTEGER','sequelize','exports','STRING','ENUM','mouseOver'];(function(_0x2a8f27,_0xd1c855){var _0x52a38d=function(_0x28d4a9){while(--_0x28d4a9){_0x2a8f27['push'](_0x2a8f27['shift']());}};_0x52a38d(++_0xd1c855);}(_0x58e8,0x121));var _0x858e=function(_0x579af2,_0x12f52a){_0x579af2=_0x579af2-0x0;var _0x4da03d=_0x58e8[_0x579af2];return _0x4da03d;};'use strict';var Sequelize=require(_0x858e('0x0'));module[_0x858e('0x1')]={'name':{'type':Sequelize[_0x858e('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x858e('0x3')](_0x858e('0x4'),_0x858e('0x5')),'defaultValue':_0x858e('0x4')},'selector':{'type':Sequelize[_0x858e('0x2')]},'timeout':{'type':Sequelize[_0x858e('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index de1cea5..c41608b 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 _0x3a32=['undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','show','params','model','ChatProactiveAction','rawAttributes','query','keys','intersection','attributes','fields','length','includeAll','include','options','catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset'];(function(_0x16e8fa,_0x2fad34){var _0x7f1bcc=function(_0x352efb){while(--_0x352efb){_0x16e8fa['push'](_0x16e8fa['shift']());}};_0x7f1bcc(++_0x2fad34);}(_0x3a32,0x9b));var _0x23a3=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0x3a32[_0x3de8a4];return _0x4635cf;};'use strict';var emlformat=require(_0x23a3('0x0'));var rimraf=require(_0x23a3('0x1'));var zipdir=require(_0x23a3('0x2'));var jsonpatch=require(_0x23a3('0x3'));var rp=require(_0x23a3('0x4'));var moment=require(_0x23a3('0x5'));var BPromise=require(_0x23a3('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x23a3('0x7'));var sox=require(_0x23a3('0x8'));var csv=require('to-csv');var ejs=require(_0x23a3('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x23a3('0xa'));var squel=require(_0x23a3('0xb'));var crypto=require(_0x23a3('0xc'));var jsforce=require(_0x23a3('0xd'));var deskjs=require(_0x23a3('0xe'));var toCsv=require(_0x23a3('0xf'));var querystring=require('querystring');var Papa=require(_0x23a3('0x10'));var Redis=require(_0x23a3('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x23a3('0x12'));var hardwareService=require(_0x23a3('0x13'));var logger=require(_0x23a3('0x14'))('api');var utils=require(_0x23a3('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x23a3('0x16'));var db=require(_0x23a3('0x17'))['db'];function respondWithStatusCode(_0x1ebeae,_0x4b65d9){_0x4b65d9=_0x4b65d9||0xcc;return function(_0x5f31f2){if(_0x5f31f2){return _0x1ebeae[_0x23a3('0x18')](_0x4b65d9);}return _0x1ebeae[_0x23a3('0x19')](_0x4b65d9)[_0x23a3('0x1a')]();};}function respondWithResult(_0x2af741,_0x52243b){_0x52243b=_0x52243b||0xc8;return function(_0x3c0e0e){if(_0x3c0e0e){return _0x2af741[_0x23a3('0x19')](_0x52243b)['json'](_0x3c0e0e);}};}function respondWithFilteredResult(_0x73759f,_0xcd0167){return function(_0x480bcd){if(_0x480bcd){var _0x2e9730=typeof _0xcd0167[_0x23a3('0x1b')]===_0x23a3('0x1c')&&typeof _0xcd0167[_0x23a3('0x1d')]===_0x23a3('0x1c');var _0x16fb78=_0x480bcd[_0x23a3('0x1e')];var _0xc33cbd=_0x2e9730?0x0:_0xcd0167['offset'];var _0x3961e9=_0x2e9730?_0x480bcd[_0x23a3('0x1e')]:_0xcd0167['offset']+_0xcd0167['limit'];var _0x289eb7;if(_0x3961e9>=_0x16fb78){_0x3961e9=_0x16fb78;_0x289eb7=0xc8;}else{_0x289eb7=0xce;}_0x73759f[_0x23a3('0x19')](_0x289eb7);return _0x73759f[_0x23a3('0x1f')](_0x23a3('0x20'),_0xc33cbd+'-'+_0x3961e9+'/'+_0x16fb78)[_0x23a3('0x21')](_0x480bcd);}return null;};}function patchUpdates(_0x1dd837){return function(_0x1a4cfc){try{jsonpatch[_0x23a3('0x22')](_0x1a4cfc,_0x1dd837,!![]);}catch(_0x1a9d86){return BPromise[_0x23a3('0x23')](_0x1a9d86);}return _0x1a4cfc[_0x23a3('0x24')]();};}function saveUpdates(_0x53ccdf,_0x51885){return function(_0x2bfe31){if(_0x2bfe31){return _0x2bfe31[_0x23a3('0x25')](_0x53ccdf)[_0x23a3('0x26')](function(_0x239e4b){return _0x239e4b;});}return null;};}function removeEntity(_0x264d1a,_0x509aa3){return function(_0x48a73c){if(_0x48a73c){return _0x48a73c['destroy']()[_0x23a3('0x26')](function(){_0x264d1a['status'](0xcc)[_0x23a3('0x1a')]();});}};}function handleEntityNotFound(_0x525b5f,_0x47539d){return function(_0x4f5583){if(!_0x4f5583){_0x525b5f[_0x23a3('0x18')](0x194);}return _0x4f5583;};}function handleError(_0x307493,_0x5d7cbc){_0x5d7cbc=_0x5d7cbc||0x1f4;return function(_0x333998){logger[_0x23a3('0x27')](_0x333998[_0x23a3('0x28')]);if(_0x333998[_0x23a3('0x29')]){delete _0x333998[_0x23a3('0x29')];}_0x307493['status'](_0x5d7cbc)[_0x23a3('0x2a')](_0x333998);};}exports[_0x23a3('0x2b')]=function(_0x3be09c,_0x6ab5f1){var _0x6bdfa8={'raw':!![],'where':{'id':_0x3be09c[_0x23a3('0x2c')]['id']}},_0x35519f={};_0x35519f[_0x23a3('0x2d')]=_['keys'](db[_0x23a3('0x2e')][_0x23a3('0x2f')]);_0x35519f[_0x23a3('0x30')]=_[_0x23a3('0x31')](_0x3be09c[_0x23a3('0x30')]);_0x35519f['filters']=_[_0x23a3('0x32')](_0x35519f[_0x23a3('0x2d')],_0x35519f[_0x23a3('0x30')]);_0x6bdfa8[_0x23a3('0x33')]=_[_0x23a3('0x32')](_0x35519f[_0x23a3('0x2d')],qs[_0x23a3('0x34')](_0x3be09c[_0x23a3('0x30')][_0x23a3('0x34')]));_0x6bdfa8[_0x23a3('0x33')]=_0x6bdfa8[_0x23a3('0x33')][_0x23a3('0x35')]?_0x6bdfa8['attributes']:_0x35519f[_0x23a3('0x2d')];if(_0x3be09c[_0x23a3('0x30')][_0x23a3('0x36')]){_0x6bdfa8[_0x23a3('0x37')]=[{'all':!![]}];}_0x6bdfa8=_['merge']({},_0x6bdfa8,_0x3be09c[_0x23a3('0x38')]);return db[_0x23a3('0x2e')]['find'](_0x6bdfa8)['then'](handleEntityNotFound(_0x6ab5f1,null))[_0x23a3('0x26')](respondWithResult(_0x6ab5f1,null))[_0x23a3('0x39')](handleError(_0x6ab5f1,null));};exports[_0x23a3('0x3a')]=function(_0x1596a2,_0x45bfca){return db['ChatProactiveAction'][_0x23a3('0x3a')](_0x1596a2[_0x23a3('0x3b')],{})[_0x23a3('0x26')](respondWithResult(_0x45bfca,0xc9))['catch'](handleError(_0x45bfca,null));};exports[_0x23a3('0x25')]=function(_0x542274,_0xd57d5d){if(_0x542274['body']['id']){delete _0x542274[_0x23a3('0x3b')]['id'];}return db[_0x23a3('0x2e')][_0x23a3('0x3c')]({'where':{'id':_0x542274[_0x23a3('0x2c')]['id']}})[_0x23a3('0x26')](handleEntityNotFound(_0xd57d5d,null))[_0x23a3('0x26')](saveUpdates(_0x542274[_0x23a3('0x3b')],null))[_0x23a3('0x26')](respondWithResult(_0xd57d5d,null))[_0x23a3('0x39')](handleError(_0xd57d5d,null));};exports['destroy']=function(_0x43a02a,_0x39b1c1){return db[_0x23a3('0x2e')][_0x23a3('0x3c')]({'where':{'id':_0x43a02a[_0x23a3('0x2c')]['id']}})[_0x23a3('0x26')](handleEntityNotFound(_0x39b1c1,null))[_0x23a3('0x26')](removeEntity(_0x39b1c1,null))[_0x23a3('0x39')](handleError(_0x39b1c1,null));};
\ No newline at end of file
+var _0xd6d2=['intersection','query','fields','attributes','length','include','merge','options','find','create','body','catch','params','destroy','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','model','ChatProactiveAction','keys','filters'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xd6d2,0xcb));var _0x2d6d=function(_0x16235d,_0x46234b){_0x16235d=_0x16235d-0x0;var _0x4f2629=_0xd6d2[_0x16235d];return _0x4f2629;};'use strict';var emlformat=require(_0x2d6d('0x0'));var rimraf=require(_0x2d6d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2d6d('0x2'));var rp=require(_0x2d6d('0x3'));var moment=require('moment');var BPromise=require(_0x2d6d('0x4'));var Mustache=require('mustache');var util=require(_0x2d6d('0x5'));var path=require(_0x2d6d('0x6'));var sox=require(_0x2d6d('0x7'));var csv=require('to-csv');var ejs=require(_0x2d6d('0x8'));var fs=require('fs');var fs_extra=require(_0x2d6d('0x9'));var _=require(_0x2d6d('0xa'));var squel=require(_0x2d6d('0xb'));var crypto=require(_0x2d6d('0xc'));var jsforce=require(_0x2d6d('0xd'));var deskjs=require(_0x2d6d('0xe'));var toCsv=require(_0x2d6d('0xf'));var querystring=require(_0x2d6d('0x10'));var Papa=require(_0x2d6d('0x11'));var Redis=require(_0x2d6d('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x2d6d('0x13'));var as=require(_0x2d6d('0x14'));var hardwareService=require(_0x2d6d('0x15'));var logger=require(_0x2d6d('0x16'))(_0x2d6d('0x17'));var utils=require('../../config/utils');var config=require(_0x2d6d('0x18'));var licenseUtil=require(_0x2d6d('0x19'));var db=require(_0x2d6d('0x1a'))['db'];function respondWithStatusCode(_0x2ad9fc,_0x5c4bf6){_0x5c4bf6=_0x5c4bf6||0xcc;return function(_0x5ef174){if(_0x5ef174){return _0x2ad9fc[_0x2d6d('0x1b')](_0x5c4bf6);}return _0x2ad9fc[_0x2d6d('0x1c')](_0x5c4bf6)[_0x2d6d('0x1d')]();};}function respondWithResult(_0x3528de,_0x58bd29){_0x58bd29=_0x58bd29||0xc8;return function(_0x1ec6aa){if(_0x1ec6aa){return _0x3528de[_0x2d6d('0x1c')](_0x58bd29)['json'](_0x1ec6aa);}};}function respondWithFilteredResult(_0x586085,_0x370096){return function(_0x17340f){if(_0x17340f){var _0x109b49=typeof _0x370096['offset']===_0x2d6d('0x1e')&&typeof _0x370096['limit']==='undefined';var _0x4c3092=_0x17340f[_0x2d6d('0x1f')];var _0x4179f2=_0x109b49?0x0:_0x370096[_0x2d6d('0x20')];var _0x3c527e=_0x109b49?_0x17340f[_0x2d6d('0x1f')]:_0x370096[_0x2d6d('0x20')]+_0x370096[_0x2d6d('0x21')];var _0xa2c4a7;if(_0x3c527e>=_0x4c3092){_0x3c527e=_0x4c3092;_0xa2c4a7=0xc8;}else{_0xa2c4a7=0xce;}_0x586085[_0x2d6d('0x1c')](_0xa2c4a7);return _0x586085['set'](_0x2d6d('0x22'),_0x4179f2+'-'+_0x3c527e+'/'+_0x4c3092)[_0x2d6d('0x23')](_0x17340f);}return null;};}function patchUpdates(_0x5b0c61){return function(_0x227e44){try{jsonpatch[_0x2d6d('0x24')](_0x227e44,_0x5b0c61,!![]);}catch(_0x15cb80){return BPromise[_0x2d6d('0x25')](_0x15cb80);}return _0x227e44[_0x2d6d('0x26')]();};}function saveUpdates(_0x59234a,_0x4aaa62){return function(_0x42c2f2){if(_0x42c2f2){return _0x42c2f2[_0x2d6d('0x27')](_0x59234a)[_0x2d6d('0x28')](function(_0x585b54){return _0x585b54;});}return null;};}function removeEntity(_0x47eb0e,_0x3ae8ad){return function(_0x4e7ec8){if(_0x4e7ec8){return _0x4e7ec8['destroy']()['then'](function(){_0x47eb0e[_0x2d6d('0x1c')](0xcc)[_0x2d6d('0x1d')]();});}};}function handleEntityNotFound(_0x3da83d,_0x3f89dd){return function(_0x3e5a92){if(!_0x3e5a92){_0x3da83d['sendStatus'](0x194);}return _0x3e5a92;};}function handleError(_0x16634d,_0x1b4964){_0x1b4964=_0x1b4964||0x1f4;return function(_0x455e71){logger[_0x2d6d('0x29')](_0x455e71[_0x2d6d('0x2a')]);if(_0x455e71[_0x2d6d('0x2b')]){delete _0x455e71[_0x2d6d('0x2b')];}_0x16634d[_0x2d6d('0x1c')](_0x1b4964)[_0x2d6d('0x2c')](_0x455e71);};}exports['show']=function(_0x1016e1,_0x26d299){var _0x2e7b32={'raw':!![],'where':{'id':_0x1016e1['params']['id']}},_0x34d485={};_0x34d485[_0x2d6d('0x2d')]=_['keys'](db[_0x2d6d('0x2e')]['rawAttributes']);_0x34d485['query']=_[_0x2d6d('0x2f')](_0x1016e1['query']);_0x34d485[_0x2d6d('0x30')]=_[_0x2d6d('0x31')](_0x34d485['model'],_0x34d485[_0x2d6d('0x32')]);_0x2e7b32['attributes']=_[_0x2d6d('0x31')](_0x34d485[_0x2d6d('0x2d')],qs[_0x2d6d('0x33')](_0x1016e1[_0x2d6d('0x32')][_0x2d6d('0x33')]));_0x2e7b32[_0x2d6d('0x34')]=_0x2e7b32[_0x2d6d('0x34')][_0x2d6d('0x35')]?_0x2e7b32['attributes']:_0x34d485[_0x2d6d('0x2d')];if(_0x1016e1[_0x2d6d('0x32')]['includeAll']){_0x2e7b32[_0x2d6d('0x36')]=[{'all':!![]}];}_0x2e7b32=_[_0x2d6d('0x37')]({},_0x2e7b32,_0x1016e1[_0x2d6d('0x38')]);return db[_0x2d6d('0x2e')][_0x2d6d('0x39')](_0x2e7b32)['then'](handleEntityNotFound(_0x26d299,null))['then'](respondWithResult(_0x26d299,null))['catch'](handleError(_0x26d299,null));};exports[_0x2d6d('0x3a')]=function(_0x9edb2a,_0x1043e2){return db['ChatProactiveAction'][_0x2d6d('0x3a')](_0x9edb2a[_0x2d6d('0x3b')],{})[_0x2d6d('0x28')](respondWithResult(_0x1043e2,0xc9))[_0x2d6d('0x3c')](handleError(_0x1043e2,null));};exports['update']=function(_0x78354,_0x2bdc1b){if(_0x78354[_0x2d6d('0x3b')]['id']){delete _0x78354[_0x2d6d('0x3b')]['id'];}return db[_0x2d6d('0x2e')][_0x2d6d('0x39')]({'where':{'id':_0x78354[_0x2d6d('0x3d')]['id']}})['then'](handleEntityNotFound(_0x2bdc1b,null))[_0x2d6d('0x28')](saveUpdates(_0x78354[_0x2d6d('0x3b')],null))[_0x2d6d('0x28')](respondWithResult(_0x2bdc1b,null))[_0x2d6d('0x3c')](handleError(_0x2bdc1b,null));};exports[_0x2d6d('0x3e')]=function(_0x5e5446,_0x1cad57){return db[_0x2d6d('0x2e')][_0x2d6d('0x39')]({'where':{'id':_0x5e5446[_0x2d6d('0x3d')]['id']}})[_0x2d6d('0x28')](handleEntityNotFound(_0x1cad57,null))[_0x2d6d('0x28')](removeEntity(_0x1cad57,null))[_0x2d6d('0x3c')](handleError(_0x1cad57,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 0085cf9..6d2fbdc 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 _0x313a=['request-promise','path','rimraf','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','api','moment'];(function(_0x11d291,_0x36072a){var _0x3253dc=function(_0x34c889){while(--_0x34c889){_0x11d291['push'](_0x11d291['shift']());}};_0x3253dc(++_0x36072a);}(_0x313a,0xb0));var _0xa313=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0x313a[_0x68ee8b];return _0x5148f7;};'use strict';var _=require(_0xa313('0x0'));var util=require(_0xa313('0x1'));var logger=require('../../config/logger')(_0xa313('0x2'));var moment=require(_0xa313('0x3'));var BPromise=require('bluebird');var rp=require(_0xa313('0x4'));var fs=require('fs');var path=require(_0xa313('0x5'));var rimraf=require(_0xa313('0x6'));var config=require('../../config/environment');var attributes=require(_0xa313('0x7'));module[_0xa313('0x8')]=function(_0x138a50,_0x36c3ad){return _0x138a50[_0xa313('0x9')](_0xa313('0xa'),attributes,{'tableName':_0xa313('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x270f=['rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','chat_proactive_actions','../../config/logger','api','moment','request-promise'];(function(_0x5c0313,_0xfa3255){var _0x13e129=function(_0x279248){while(--_0x279248){_0x5c0313['push'](_0x5c0313['shift']());}};_0x13e129(++_0xfa3255);}(_0x270f,0x132));var _0xf270=function(_0x297c55,_0x34fa75){_0x297c55=_0x297c55-0x0;var _0x120389=_0x270f[_0x297c55];return _0x120389;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf270('0x0'))(_0xf270('0x1'));var moment=require(_0xf270('0x2'));var BPromise=require('bluebird');var rp=require(_0xf270('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf270('0x4'));var config=require(_0xf270('0x5'));var attributes=require(_0xf270('0x6'));module[_0xf270('0x7')]=function(_0x4636f4,_0xf9cd5f){return _0x4636f4[_0xf270('0x8')]('ChatProactiveAction',attributes,{'tableName':_0xf270('0x9'),'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 1a91829..22dfc9c 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 _0x91bd=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','ChatProactiveAction,\x20%s,\x20%s','message','catch'];(function(_0x9fd078,_0x742637){var _0x64e139=function(_0x28b39b){while(--_0x28b39b){_0x9fd078['push'](_0x9fd078['shift']());}};_0x64e139(++_0x742637);}(_0x91bd,0x150));var _0xd91b=function(_0xf73c09,_0x4e424e){_0xf73c09=_0xf73c09-0x0;var _0xa8923c=_0x91bd[_0xf73c09];return _0xa8923c;};'use strict';var _=require(_0xd91b('0x0'));var util=require(_0xd91b('0x1'));var moment=require(_0xd91b('0x2'));var BPromise=require(_0xd91b('0x3'));var rs=require(_0xd91b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd91b('0x5'))['db'];var utils=require(_0xd91b('0x6'));var logger=require(_0xd91b('0x7'))(_0xd91b('0x8'));var config=require(_0xd91b('0x9'));var jayson=require(_0xd91b('0xa'));var client=jayson[_0xd91b('0xb')][_0xd91b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xa9422f,_0x2c208c,_0xe4d1cc){return new BPromise(function(_0x29791b,_0x529308){return client[_0xd91b('0xd')](_0xa9422f,_0xe4d1cc)[_0xd91b('0xe')](function(_0x18d90c){logger[_0xd91b('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x2c208c,_0xd91b('0x10'));logger[_0xd91b('0x11')](_0xd91b('0x12'),_0x2c208c,'request\x20sent',JSON['stringify'](_0x18d90c));if(_0x18d90c[_0xd91b('0x13')]){if(_0x18d90c[_0xd91b('0x13')][_0xd91b('0x14')]===0x1f4){logger[_0xd91b('0x13')](_0xd91b('0x15'),_0x2c208c,_0x18d90c[_0xd91b('0x13')][_0xd91b('0x16')]);return _0x529308(_0x18d90c[_0xd91b('0x13')][_0xd91b('0x16')]);}logger[_0xd91b('0x13')](_0xd91b('0x15'),_0x2c208c,_0x18d90c['error'][_0xd91b('0x16')]);return _0x29791b(_0x18d90c[_0xd91b('0x13')]['message']);}else{logger[_0xd91b('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x2c208c,_0xd91b('0x10'));_0x29791b(_0x18d90c['result']['message']);}})[_0xd91b('0x17')](function(_0x1d0f9d){logger[_0xd91b('0x13')](_0xd91b('0x15'),_0x2c208c,_0x1d0f9d);_0x529308(_0x1d0f9d);});});}
\ No newline at end of file
+var _0x7b66=['jayson/promise','client','http','request','then','info','request\x20sent','debug','error','code','message','ChatProactiveAction,\x20%s,\x20%s','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x448422,_0x362248){var _0xcc0afd=function(_0x576b07){while(--_0x576b07){_0x448422['push'](_0x448422['shift']());}};_0xcc0afd(++_0x362248);}(_0x7b66,0x98));var _0x67b6=function(_0x1ab32d,_0x4240d1){_0x1ab32d=_0x1ab32d-0x0;var _0x30849c=_0x7b66[_0x1ab32d];return _0x30849c;};'use strict';var _=require(_0x67b6('0x0'));var util=require(_0x67b6('0x1'));var moment=require(_0x67b6('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x67b6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x67b6('0x4'));var logger=require(_0x67b6('0x5'))(_0x67b6('0x6'));var config=require(_0x67b6('0x7'));var jayson=require(_0x67b6('0x8'));var client=jayson[_0x67b6('0x9')][_0x67b6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2d8ccf,_0x4879e8,_0x1639c8){return new BPromise(function(_0x396b61,_0x4ad6de){return client[_0x67b6('0xb')](_0x2d8ccf,_0x1639c8)[_0x67b6('0xc')](function(_0x13dcd0){logger[_0x67b6('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x4879e8,_0x67b6('0xe'));logger[_0x67b6('0xf')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x4879e8,_0x67b6('0xe'),JSON['stringify'](_0x13dcd0));if(_0x13dcd0['error']){if(_0x13dcd0[_0x67b6('0x10')][_0x67b6('0x11')]===0x1f4){logger[_0x67b6('0x10')]('ChatProactiveAction,\x20%s,\x20%s',_0x4879e8,_0x13dcd0['error'][_0x67b6('0x12')]);return _0x4ad6de(_0x13dcd0[_0x67b6('0x10')][_0x67b6('0x12')]);}logger['error'](_0x67b6('0x13'),_0x4879e8,_0x13dcd0['error'][_0x67b6('0x12')]);return _0x396b61(_0x13dcd0[_0x67b6('0x10')][_0x67b6('0x12')]);}else{logger['info'](_0x67b6('0x13'),_0x4879e8,'request\x20sent');_0x396b61(_0x13dcd0['result']['message']);}})['catch'](function(_0x49520f){logger[_0x67b6('0x10')]('ChatProactiveAction,\x20%s,\x20%s',_0x4879e8,_0x49520f);_0x4ad6de(_0x49520f);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index f7af320..ef7f0a3 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 _0x032e=['post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show'];(function(_0x4256aa,_0x16af5c){var _0x15ca3b=function(_0x5b161b){while(--_0x5b161b){_0x4256aa['push'](_0x4256aa['shift']());}};_0x15ca3b(++_0x16af5c);}(_0x032e,0x124));var _0xe032=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x032e[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0xe032('0x0'));var util=require('util');var path=require(_0xe032('0x1'));var timeout=require(_0xe032('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe032('0x3'));var auth=require(_0xe032('0x4'));var interaction=require(_0xe032('0x5'));var config=require(_0xe032('0x6'));var controller=require(_0xe032('0x7'));router[_0xe032('0x8')](_0xe032('0x9'),auth[_0xe032('0xa')](),controller[_0xe032('0xb')]);router[_0xe032('0xc')]('/',auth[_0xe032('0xa')](),controller[_0xe032('0xd')]);router[_0xe032('0xe')](_0xe032('0x9'),auth[_0xe032('0xa')](),controller[_0xe032('0xf')]);router[_0xe032('0x10')](_0xe032('0x9'),auth['isAuthenticated'](),controller[_0xe032('0x11')]);module[_0xe032('0x12')]=router;
\ No newline at end of file
+var _0x7dfd=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','put','update','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x218c70,_0x4ce15e){var _0xc5022c=function(_0x23d15c){while(--_0x23d15c){_0x218c70['push'](_0x218c70['shift']());}};_0xc5022c(++_0x4ce15e);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd7df('0x0'));var util=require(_0xd7df('0x1'));var path=require(_0xd7df('0x2'));var timeout=require(_0xd7df('0x3'));var express=require(_0xd7df('0x4'));var router=express[_0xd7df('0x5')]();var fs_extra=require(_0xd7df('0x6'));var auth=require(_0xd7df('0x7'));var interaction=require(_0xd7df('0x8'));var config=require(_0xd7df('0x9'));var controller=require(_0xd7df('0xa'));router[_0xd7df('0xb')](_0xd7df('0xc'),auth[_0xd7df('0xd')](),controller[_0xd7df('0xe')]);router[_0xd7df('0xf')]('/',auth[_0xd7df('0xd')](),controller['create']);router[_0xd7df('0x10')](_0xd7df('0xc'),auth[_0xd7df('0xd')](),controller[_0xd7df('0x11')]);router['delete'](_0xd7df('0xc'),auth['isAuthenticated'](),controller[_0xd7df('0x12')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 0c6370c..eb8fed7 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 _0xc2cc=['beepall','roundrobin','sequelize','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x24d982,_0x1d638b){var _0x2441c4=function(_0x290e43){while(--_0x290e43){_0x24d982['push'](_0x24d982['shift']());}};_0x2441c4(++_0x1d638b);}(_0xc2cc,0x92));var _0xcc2c=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc2cc[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0xcc2c('0x0'));module['exports']={'name':{'type':Sequelize[_0xcc2c('0x1')],'unique':_0xcc2c('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xcc2c('0x1')]},'timeout':{'type':Sequelize[_0xcc2c('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xcc2c('0x4')](_0xcc2c('0x5'),_0xcc2c('0x6'),_0xcc2c('0x7'))}};
\ No newline at end of file
+var _0x8375=['roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x115a07,_0xc16ec1){var _0x5a8ead=function(_0x439166){while(--_0x439166){_0x115a07['push'](_0x115a07['shift']());}};_0x5a8ead(++_0xc16ec1);}(_0x8375,0xb5));var _0x5837=function(_0x15b68d,_0x4de6a8){_0x15b68d=_0x15b68d-0x0;var _0x1ee804=_0x8375[_0x15b68d];return _0x1ee804;};'use strict';var Sequelize=require(_0x5837('0x0'));module[_0x5837('0x1')]={'name':{'type':Sequelize[_0x5837('0x2')],'unique':_0x5837('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x5837('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5837('0x5')](_0x5837('0x6'),_0x5837('0x7'),_0x5837('0x8'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 60482f8..0230294 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 _0xa2c2=['Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','userChatQueue:save','removeTeams','field','tq.TeamId','from','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','QueryTypes','SELECT','every','TeamId','all','compact','forEach','emit','addAgents','omit','spread','removeAgents','isArray','userChatQueue:remove','getAgents','bluebird','util','lodash','squel','ioredis','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','then','destroy','get','ChatQueues','error','stack','name','send','index','map','fieldName','type','where','ChatQueue','include','query','findAll','catch','model','rawAttributes','keys','filters','intersection','attributes','length','merge','options','find','create','user','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','findOne','fields','hasOwnProperty','nolimit','order','sort','pick','ChatQueueId','filter','UserChatQueue','User','findAndCountAll','UserId','agent','createdAt','format','%s/%s','SIP','chatPause','updatedAt','getTeams'];(function(_0x495f22,_0x392ea1){var _0x593b86=function(_0x18c8a9){while(--_0x18c8a9){_0x495f22['push'](_0x495f22['shift']());}};_0x593b86(++_0x392ea1);}(_0xa2c2,0x10c));var _0x2a2c=function(_0x3051e2,_0x33ca33){_0x3051e2=_0x3051e2-0x0;var _0x593aa1=_0xa2c2[_0x3051e2];return _0x593aa1;};'use strict';var BPromise=require(_0x2a2c('0x0'));var util=require(_0x2a2c('0x1'));var _=require(_0x2a2c('0x2'));var squel=require(_0x2a2c('0x3'));var Redis=require(_0x2a2c('0x4'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var config=require(_0x2a2c('0x5'));var db=require(_0x2a2c('0x6'))['db'];config[_0x2a2c('0x7')]=_['defaults'](config[_0x2a2c('0x7')],{'host':_0x2a2c('0x8'),'port':0x18eb});var socket=require(_0x2a2c('0x9'))(new Redis(config[_0x2a2c('0x7')]));require(_0x2a2c('0xa'))[_0x2a2c('0xb')](socket);function respondWithStatusCode(_0xa6ae15,_0x544934){_0x544934=_0x544934||0xcc;return function(_0x1052d8){if(_0x1052d8){return _0xa6ae15[_0x2a2c('0xc')](_0x544934);}return _0xa6ae15[_0x2a2c('0xd')](_0x544934)[_0x2a2c('0xe')]();};}function respondWithResult(_0x53aab0,_0x5bca2a){_0x5bca2a=_0x5bca2a||0xc8;return function(_0x30b47a){if(_0x30b47a){return _0x53aab0[_0x2a2c('0xd')](_0x5bca2a)[_0x2a2c('0xf')](_0x30b47a);}};}function respondWithFilteredResult(_0x57b3b6,_0x4d1ca1){return function(_0x152120){if(_0x152120){var _0x2f887c=typeof _0x4d1ca1[_0x2a2c('0x10')]===_0x2a2c('0x11')&&typeof _0x4d1ca1[_0x2a2c('0x12')]===_0x2a2c('0x11');var _0x2e0a47=_0x152120['count'];var _0x9947e9=_0x2f887c?0x0:_0x4d1ca1[_0x2a2c('0x10')];var _0x1e8fcf=_0x2f887c?_0x152120[_0x2a2c('0x13')]:_0x4d1ca1[_0x2a2c('0x10')]+_0x4d1ca1[_0x2a2c('0x12')];var _0x2b2f36;if(_0x1e8fcf>=_0x2e0a47){_0x1e8fcf=_0x2e0a47;_0x2b2f36=0xc8;}else{_0x2b2f36=0xce;}_0x57b3b6[_0x2a2c('0xd')](_0x2b2f36);return _0x57b3b6['set'](_0x2a2c('0x14'),_0x9947e9+'-'+_0x1e8fcf+'/'+_0x2e0a47)[_0x2a2c('0xf')](_0x152120);}return null;};}function saveUpdates(_0x2274ff){return function(_0x54694d){if(_0x54694d){return _0x54694d[_0x2a2c('0x15')](_0x2274ff)[_0x2a2c('0x16')](function(_0xb453d8){return _0xb453d8;});}return null;};}function removeEntity(_0xc3121a){return function(_0x2e980e){if(_0x2e980e){return _0x2e980e[_0x2a2c('0x17')]()[_0x2a2c('0x16')](function(){var _0x27c9ae=_0x2e980e[_0x2a2c('0x18')]({'plain':!![]});var _0x104dda=_0x2a2c('0x19');return db['UserProfileResource'][_0x2a2c('0x17')]({'where':{'type':_0x104dda,'resourceId':_0x27c9ae['id']}})[_0x2a2c('0x16')](function(){return _0x2e980e;});})[_0x2a2c('0x16')](function(){_0xc3121a[_0x2a2c('0xd')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a6287){return function(_0x27d2f5){if(!_0x27d2f5){_0x1a6287[_0x2a2c('0xc')](0x194);}return _0x27d2f5;};}function handleError(_0x43e9e5,_0x117f3e){_0x117f3e=_0x117f3e||0x1f4;return function(_0x2aa877){logger[_0x2a2c('0x1a')](_0x2aa877[_0x2a2c('0x1b')]);if(_0x2aa877[_0x2a2c('0x1c')]){delete _0x2aa877[_0x2a2c('0x1c')];}_0x43e9e5[_0x2a2c('0xd')](_0x117f3e)[_0x2a2c('0x1d')](_0x2aa877);};}exports[_0x2a2c('0x1e')]=function(_0x5181d9,_0x339986){var _0x520b24={};var _0x2574c8={'count':0x0,'rows':[]};var _0x1e09e9=_[_0x2a2c('0x1f')](db['ChatQueue']['rawAttributes'],function(_0x3fceb5){return{'name':_0x3fceb5[_0x2a2c('0x20')],'type':_0x3fceb5[_0x2a2c('0x21')]['key']};});_0x520b24=qs['getOptions'](_0x1e09e9,_0x5181d9);var _0x373892={'where':_0x520b24[_0x2a2c('0x22')]};return db[_0x2a2c('0x23')]['count'](_0x373892)[_0x2a2c('0x16')](function(_0x162596){_0x2574c8[_0x2a2c('0x13')]=_0x162596;_0x520b24[_0x2a2c('0x24')]=qs[_0x2a2c('0x24')](_0x5181d9[_0x2a2c('0x25')]);return db['ChatQueue'][_0x2a2c('0x26')](_0x520b24);})['then'](function(_0x3c793a){_0x2574c8['rows']=_0x3c793a;return _0x2574c8;})[_0x2a2c('0x16')](respondWithFilteredResult(_0x339986,_0x520b24))[_0x2a2c('0x27')](handleError(_0x339986,null));};exports['show']=function(_0x51871f,_0x45e943){var _0x5e47b1={'raw':!![],'where':{'id':_0x51871f['params']['id']}},_0x235aed={};_0x235aed[_0x2a2c('0x28')]=_['keys'](db[_0x2a2c('0x23')][_0x2a2c('0x29')]);_0x235aed['query']=_[_0x2a2c('0x2a')](_0x51871f['query']);_0x235aed[_0x2a2c('0x2b')]=_[_0x2a2c('0x2c')](_0x235aed[_0x2a2c('0x28')],_0x235aed[_0x2a2c('0x25')]);_0x5e47b1['attributes']=_[_0x2a2c('0x2c')](_0x235aed[_0x2a2c('0x28')],qs['fields'](_0x51871f[_0x2a2c('0x25')]['fields']));_0x5e47b1[_0x2a2c('0x2d')]=_0x5e47b1[_0x2a2c('0x2d')][_0x2a2c('0x2e')]?_0x5e47b1[_0x2a2c('0x2d')]:_0x235aed[_0x2a2c('0x28')];if(_0x51871f[_0x2a2c('0x25')]['includeAll']){_0x5e47b1['include']=[{'all':!![]}];}_0x5e47b1=_[_0x2a2c('0x2f')]({},_0x5e47b1,_0x51871f[_0x2a2c('0x30')]);return db[_0x2a2c('0x23')][_0x2a2c('0x31')](_0x5e47b1)[_0x2a2c('0x16')](handleEntityNotFound(_0x45e943,null))[_0x2a2c('0x16')](respondWithResult(_0x45e943,null))['catch'](handleError(_0x45e943,null));};exports[_0x2a2c('0x32')]=function(_0x54273d,_0x14c9d8){return db[_0x2a2c('0x23')][_0x2a2c('0x32')](_0x54273d['body'],{})[_0x2a2c('0x16')](function(_0x2534d9){var _0x431fe6=_0x54273d['user'][_0x2a2c('0x18')]({'plain':!![]});if(!_0x431fe6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x431fe6['role']===_0x2a2c('0x33')){var _0x23c3a4=_0x2534d9[_0x2a2c('0x18')]({'plain':!![]});var _0x33f96e='ChatQueues';return db[_0x2a2c('0x34')][_0x2a2c('0x31')]({'where':{'name':_0x33f96e,'userProfileId':_0x431fe6['userProfileId']},'raw':!![]})['then'](function(_0x2529f0){if(_0x2529f0&&_0x2529f0['autoAssociation']===0x0){return db[_0x2a2c('0x35')][_0x2a2c('0x32')]({'name':_0x23c3a4[_0x2a2c('0x1c')],'resourceId':_0x23c3a4['id'],'type':_0x2529f0[_0x2a2c('0x1c')],'sectionId':_0x2529f0['id']},{})['then'](function(){return _0x2534d9;});}else{return _0x2534d9;}})[_0x2a2c('0x27')](function(_0x54e9ed){logger[_0x2a2c('0x1a')](_0x2a2c('0x36'),_0x54e9ed);throw _0x54e9ed;});}return _0x2534d9;})[_0x2a2c('0x16')](respondWithResult(_0x14c9d8,0xc9))[_0x2a2c('0x27')](handleError(_0x14c9d8,null));};exports['update']=function(_0x3229e8,_0x1ee563){if(_0x3229e8[_0x2a2c('0x37')]['id']){delete _0x3229e8[_0x2a2c('0x37')]['id'];}return db['ChatQueue'][_0x2a2c('0x31')]({'where':{'id':_0x3229e8['params']['id']}})[_0x2a2c('0x16')](handleEntityNotFound(_0x1ee563,null))[_0x2a2c('0x16')](saveUpdates(_0x3229e8['body'],null))[_0x2a2c('0x16')](respondWithResult(_0x1ee563,null))[_0x2a2c('0x27')](handleError(_0x1ee563,null));};exports['destroy']=function(_0x3cd050,_0x391fcb){return db[_0x2a2c('0x23')][_0x2a2c('0x31')]({'where':{'id':_0x3cd050[_0x2a2c('0x38')]['id']}})[_0x2a2c('0x16')](handleEntityNotFound(_0x391fcb,null))[_0x2a2c('0x16')](removeEntity(_0x391fcb,null))[_0x2a2c('0x27')](handleError(_0x391fcb,null));};exports[_0x2a2c('0x39')]=function(_0x3512be,_0x5405aa){return db[_0x2a2c('0x23')][_0x2a2c('0x39')]()['then'](respondWithResult(_0x5405aa,null))['catch'](handleError(_0x5405aa,null));};exports[_0x2a2c('0x3a')]=function(_0x2fd083,_0x36e534){var _0x34d52b={'raw':!![],'where':{}},_0x4e4bd9={},_0x84d351;return db[_0x2a2c('0x23')][_0x2a2c('0x3b')]({'where':{'id':_0x2fd083['params']['id']}})[_0x2a2c('0x16')](handleEntityNotFound(_0x36e534,null))[_0x2a2c('0x16')](function(_0xaa32bf){if(_0xaa32bf){_0x84d351=_0xaa32bf['get']({'plain':!![]});_0x4e4bd9[_0x2a2c('0x28')]=_[_0x2a2c('0x2a')](db['UserChatQueue'][_0x2a2c('0x29')]);_0x4e4bd9[_0x2a2c('0x25')]=_[_0x2a2c('0x2a')](_0x2fd083[_0x2a2c('0x25')]);_0x4e4bd9[_0x2a2c('0x2b')]=_[_0x2a2c('0x2c')](_0x4e4bd9[_0x2a2c('0x28')],_0x4e4bd9[_0x2a2c('0x25')]);_0x34d52b[_0x2a2c('0x2d')]=_['intersection'](_0x4e4bd9[_0x2a2c('0x28')],qs[_0x2a2c('0x3c')](_0x2fd083[_0x2a2c('0x25')][_0x2a2c('0x3c')]));_0x34d52b['attributes']=_0x34d52b[_0x2a2c('0x2d')][_0x2a2c('0x2e')]?_0x34d52b[_0x2a2c('0x2d')]:_0x4e4bd9[_0x2a2c('0x28')];if(!_0x2fd083[_0x2a2c('0x25')][_0x2a2c('0x3d')](_0x2a2c('0x3e'))){_0x34d52b[_0x2a2c('0x12')]=qs[_0x2a2c('0x12')](_0x2fd083[_0x2a2c('0x25')]['limit']);_0x34d52b[_0x2a2c('0x10')]=qs[_0x2a2c('0x10')](_0x2fd083[_0x2a2c('0x25')]['offset']);}_0x34d52b[_0x2a2c('0x3f')]=qs[_0x2a2c('0x40')](_0x2fd083[_0x2a2c('0x25')][_0x2a2c('0x40')]);_0x34d52b[_0x2a2c('0x22')]=qs[_0x2a2c('0x2b')](_[_0x2a2c('0x41')](_0x2fd083['query'],_0x4e4bd9[_0x2a2c('0x2b')]));_0x34d52b[_0x2a2c('0x22')][_0x2a2c('0x42')]=_0xaa32bf['id'];if(_0x2fd083['query'][_0x2a2c('0x43')]){_0x34d52b[_0x2a2c('0x22')]=_[_0x2a2c('0x2f')](_0x34d52b[_0x2a2c('0x22')],{'$or':_[_0x2a2c('0x1f')](_0x34d52b[_0x2a2c('0x2d')],function(_0x53ffee){var _0x1f9afc={};_0x1f9afc[_0x53ffee]={'$like':'%'+_0x2fd083[_0x2a2c('0x25')]['filter']+'%'};return _0x1f9afc;})});}_0x34d52b=_[_0x2a2c('0x2f')]({},_0x34d52b,_0x2fd083[_0x2a2c('0x30')]);return db[_0x2a2c('0x44')][_0x2a2c('0x26')](_0x34d52b);}})[_0x2a2c('0x16')](function(_0x3c1b1c){if(_0x3c1b1c){return db[_0x2a2c('0x45')][_0x2a2c('0x46')]({'where':{'id':_['map'](_0x3c1b1c,_0x2a2c('0x47')),'role':_0x2a2c('0x48')},'attributes':['id',_0x2a2c('0x1c'),'chatPause','updatedAt',_0x2a2c('0x49')]});}})[_0x2a2c('0x16')](function(_0x15d5ae){if(_0x15d5ae){return{'count':_0x15d5ae[_0x2a2c('0x13')],'rows':_[_0x2a2c('0x1f')](_0x15d5ae['rows'],function(_0x5de732){return{'membername':_0x5de732[_0x2a2c('0x1c')],'UserId':_0x5de732['id'],'queue_name':_0x84d351[_0x2a2c('0x1c')],'ChatQueueId':_0x84d351['id'],'interface':util[_0x2a2c('0x4a')](_0x2a2c('0x4b'),_0x2a2c('0x4c'),_0x5de732[_0x2a2c('0x1c')]),'penalty':0x0,'paused':_0x5de732[_0x2a2c('0x4d')],'createdAt':_0x5de732['createdAt'],'updatedAt':_0x5de732[_0x2a2c('0x4e')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x36e534,_0x34d52b))[_0x2a2c('0x27')](handleError(_0x36e534,null));};exports[_0x2a2c('0x4f')]=function(_0x248a54,_0x53e483){var _0x406108={};var _0x403878={};var _0x118df9;var _0x1cdaf9;return db[_0x2a2c('0x23')][_0x2a2c('0x3b')]({'where':{'id':_0x248a54[_0x2a2c('0x38')]['id']}})['then'](handleEntityNotFound(_0x53e483,null))[_0x2a2c('0x16')](function(_0x38675c){if(_0x38675c){_0x118df9=_0x38675c;_0x403878[_0x2a2c('0x28')]=_['keys'](db[_0x2a2c('0x50')][_0x2a2c('0x29')]);_0x403878[_0x2a2c('0x25')]=_[_0x2a2c('0x2a')](_0x248a54[_0x2a2c('0x25')]);_0x403878[_0x2a2c('0x2b')]=_[_0x2a2c('0x2c')](_0x403878['model'],_0x403878['query']);_0x406108['attributes']=_[_0x2a2c('0x2c')](_0x403878['model'],qs[_0x2a2c('0x3c')](_0x248a54[_0x2a2c('0x25')][_0x2a2c('0x3c')]));_0x406108[_0x2a2c('0x2d')]=_0x406108[_0x2a2c('0x2d')]['length']?_0x406108[_0x2a2c('0x2d')]:_0x403878[_0x2a2c('0x28')];_0x406108[_0x2a2c('0x3f')]=qs[_0x2a2c('0x40')](_0x248a54[_0x2a2c('0x25')][_0x2a2c('0x40')]);_0x406108[_0x2a2c('0x22')]=qs['filters'](_[_0x2a2c('0x41')](_0x248a54['query'],_0x403878[_0x2a2c('0x2b')]));if(_0x248a54['query'][_0x2a2c('0x43')]){_0x406108[_0x2a2c('0x22')]=_[_0x2a2c('0x2f')](_0x406108[_0x2a2c('0x22')],{'$or':_[_0x2a2c('0x1f')](_0x406108[_0x2a2c('0x2d')],function(_0x417d00){var _0xedd2eb={};_0xedd2eb[_0x417d00]={'$like':'%'+_0x248a54[_0x2a2c('0x25')][_0x2a2c('0x43')]+'%'};return _0xedd2eb;})});}_0x406108=_[_0x2a2c('0x2f')]({},_0x406108,_0x248a54[_0x2a2c('0x30')]);return _0x118df9[_0x2a2c('0x4f')](_0x406108);}})[_0x2a2c('0x16')](function(_0x69a71b){if(_0x69a71b){_0x1cdaf9=_0x69a71b['length'];if(!_0x248a54[_0x2a2c('0x25')]['hasOwnProperty'](_0x2a2c('0x3e'))){_0x406108[_0x2a2c('0x12')]=qs[_0x2a2c('0x12')](_0x248a54[_0x2a2c('0x25')][_0x2a2c('0x12')]);_0x406108[_0x2a2c('0x10')]=qs[_0x2a2c('0x10')](_0x248a54[_0x2a2c('0x25')][_0x2a2c('0x10')]);}return _0x118df9[_0x2a2c('0x4f')](_0x406108);}})[_0x2a2c('0x16')](function(_0x2d8f67){if(_0x2d8f67){return _0x2d8f67?{'count':_0x1cdaf9,'rows':_0x2d8f67}:null;}})[_0x2a2c('0x16')](respondWithResult(_0x53e483,null))[_0x2a2c('0x27')](handleError(_0x53e483,null));};exports[_0x2a2c('0x51')]=function(_0x51bc88,_0x349caf){var _0x422cf0=_0x51bc88[_0x2a2c('0x37')][_0x2a2c('0x52')];return db['Team'][_0x2a2c('0x26')]({'where':{'id':_0x422cf0},'attributes':['id'],'include':[{'model':db[_0x2a2c('0x45')],'as':_0x2a2c('0x53'),'attributes':['id','name',_0x2a2c('0x54'),_0x2a2c('0x55'),_0x2a2c('0x56')],'raw':!![]}]})['then'](function(_0xd76206){if(_0xd76206){var _0x58511f=_[_0x2a2c('0x57')](_0xd76206,function(_0x4dda22){var _0xf26432=_0x4dda22['get']({'plain':!![]});return _0xf26432['Agents'];});return db[_0x2a2c('0x23')][_0x2a2c('0x31')]({'where':{'id':_0x51bc88['params']['id']}})[_0x2a2c('0x16')](function(_0x405745){return db[_0x2a2c('0x58')][_0x2a2c('0x59')](function(_0x3a81fd){return _0x405745[_0x2a2c('0x51')](_0x422cf0,{'transaction':_0x3a81fd})[_0x2a2c('0x16')](function(){return BPromise[_0x2a2c('0x5a')](_0x58511f,function(_0xafcbac){return db[_0x2a2c('0x44')][_0x2a2c('0x5b')]({'where':{'UserId':_0xafcbac['id'],'ChatQueueId':_0x51bc88[_0x2a2c('0x38')]['id']},'transaction':_0x3a81fd});});})[_0x2a2c('0x16')](function(){_0x58511f['forEach'](function(_0x13c657){socket['emit'](_0x2a2c('0x5c'),{'UserId':_0x13c657['id'],'ChatQueueId':_0x405745['id']});});});});});}})[_0x2a2c('0x16')](respondWithStatusCode(_0x349caf,null))[_0x2a2c('0x27')](handleError(_0x349caf,null));};exports[_0x2a2c('0x5d')]=function(_0x224594,_0x31c368){return db['Team']['findAll']({'where':{'id':_0x224594['query'][_0x2a2c('0x52')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x2a2c('0x53'),'attributes':['id'],'raw':!![]}]})[_0x2a2c('0x16')](handleEntityNotFound(_0x31c368,null))[_0x2a2c('0x16')](function(_0x5e961f){var _0x55e1b=_[_0x2a2c('0x1f')](_0x5e961f,'id');var _0x27e858=[];var _0x481f63=[];var _0x21fab6=squel['select']();_0x21fab6[_0x2a2c('0x5e')](_0x2a2c('0x5f'))[_0x2a2c('0x60')]('team_has_chat_queues','tq')[_0x2a2c('0x61')]('user_has_teams','ut',_0x2a2c('0x62'))[_0x2a2c('0x22')](_0x2a2c('0x63'),_0x224594[_0x2a2c('0x38')]['id']);for(var _0x282efe=0x0;_0x282efe<_0x5e961f[_0x2a2c('0x2e')];_0x282efe+=0x1){let _0x2790b1=_0x5e961f[_0x282efe];for(var _0x34d8ff=0x0;_0x34d8ff<_0x2790b1[_0x2a2c('0x53')][_0x2a2c('0x2e')];_0x34d8ff+=0x1){let _0x4211e5=_0x2790b1[_0x2a2c('0x53')][_0x34d8ff];var _0x3b96e2=_0x21fab6[_0x2a2c('0x64')]();_0x3b96e2[_0x2a2c('0x22')]('ut.UserId\x20=\x20?',_0x4211e5['id']);_0x481f63['push'](db['sequelize']['query'](_0x3b96e2['toString'](),{'type':db[_0x2a2c('0x58')][_0x2a2c('0x65')][_0x2a2c('0x66')]})[_0x2a2c('0x16')](function(_0x5622b0){if(_0x5622b0[_0x2a2c('0x2e')]===0x1){return _0x4211e5['id'];}else{var _0x1c5c44=_[_0x2a2c('0x67')](_[_0x2a2c('0x1f')](_0x5622b0,_0x2a2c('0x68')),function(_0x36a46f){return _['includes'](_0x55e1b,_0x36a46f);});if(_0x1c5c44){return _0x4211e5['id'];}}}));}}return BPromise[_0x2a2c('0x69')](_0x481f63)[_0x2a2c('0x16')](function(_0x2896ee){_0x27e858=_(_0x27e858)['union'](_0x2896ee)[_0x2a2c('0x6a')]()['value']();return db[_0x2a2c('0x23')][_0x2a2c('0x31')]({'where':{'id':_0x224594[_0x2a2c('0x38')]['id']}})['then'](function(_0x16797d){return db[_0x2a2c('0x58')]['transaction'](function(_0x3ee0b4){return _0x16797d['removeTeams'](_0x224594['query']['ids'],{'transaction':_0x3ee0b4})['then'](function(){if(!_['isEmpty'](_0x27e858)){return _0x16797d['removeAgents'](_0x27e858,{'transaction':_0x3ee0b4});}})['then'](function(){_0x27e858[_0x2a2c('0x6b')](function(_0x111424){socket[_0x2a2c('0x6c')]('userChatQueue:remove',{'UserId':_0x111424,'ChatQueueId':_0x16797d['id']});});});});});});})[_0x2a2c('0x16')](respondWithStatusCode(_0x31c368,null))[_0x2a2c('0x27')](handleError(_0x31c368,null));};exports[_0x2a2c('0x6d')]=function(_0x4f7269,_0x23de46){return db[_0x2a2c('0x23')]['find']({'where':{'id':_0x4f7269['params']['id']}})[_0x2a2c('0x16')](handleEntityNotFound(_0x23de46,null))[_0x2a2c('0x16')](function(_0x522843){if(_0x522843){return _0x522843['addAgents'](_0x4f7269[_0x2a2c('0x37')][_0x2a2c('0x52')],_[_0x2a2c('0x6e')](_0x4f7269[_0x2a2c('0x37')],[_0x2a2c('0x52'),'id'])||{})[_0x2a2c('0x6f')](function(_0x173ec1){for(var _0x149e57=0x0;_0x149e57<_0x4f7269[_0x2a2c('0x37')][_0x2a2c('0x52')][_0x2a2c('0x2e')];_0x149e57+=0x1){socket[_0x2a2c('0x6c')]('userChatQueue:save',{'UserId':Number(_0x4f7269[_0x2a2c('0x37')]['ids'][_0x149e57]),'ChatQueueId':Number(_0x4f7269[_0x2a2c('0x38')]['id'])});}return _0x173ec1;});}})['then'](respondWithResult(_0x23de46,null))[_0x2a2c('0x27')](handleError(_0x23de46,null));};exports[_0x2a2c('0x70')]=function(_0x362945,_0x105a42){return db[_0x2a2c('0x23')][_0x2a2c('0x31')]({'where':{'id':_0x362945[_0x2a2c('0x38')]['id']}})['then'](handleEntityNotFound(_0x105a42,null))[_0x2a2c('0x16')](function(_0x1fa4c4){if(_0x1fa4c4){return _0x1fa4c4[_0x2a2c('0x70')](_0x362945[_0x2a2c('0x25')][_0x2a2c('0x52')])[_0x2a2c('0x16')](function(){if(_[_0x2a2c('0x71')](_0x362945[_0x2a2c('0x25')][_0x2a2c('0x52')])){for(var _0x4c3f9a=0x0;_0x4c3f9a<_0x362945['query']['ids'][_0x2a2c('0x2e')];_0x4c3f9a+=0x1){socket[_0x2a2c('0x6c')](_0x2a2c('0x72'),{'UserId':Number(_0x362945[_0x2a2c('0x25')][_0x2a2c('0x52')][_0x4c3f9a]),'ChatQueueId':Number(_0x362945[_0x2a2c('0x38')]['id'])});}}else{socket[_0x2a2c('0x6c')](_0x2a2c('0x72'),{'UserId':Number(_0x362945[_0x2a2c('0x25')][_0x2a2c('0x52')]),'ChatQueueId':Number(_0x362945['params']['id'])});}});}})[_0x2a2c('0x16')](respondWithStatusCode(_0x105a42,null))['catch'](handleError(_0x105a42,null));};exports[_0x2a2c('0x73')]=function(_0x55237a,_0x56ed26){var _0x1476fd={};var _0x32cc41={};var _0x1cb1fa;var _0x2f7605;return db[_0x2a2c('0x23')][_0x2a2c('0x3b')]({'where':{'id':_0x55237a['params']['id']}})['then'](handleEntityNotFound(_0x56ed26,null))[_0x2a2c('0x16')](function(_0x452047){if(_0x452047){_0x1cb1fa=_0x452047;_0x32cc41[_0x2a2c('0x28')]=_['keys'](db[_0x2a2c('0x45')][_0x2a2c('0x29')]);_0x32cc41[_0x2a2c('0x25')]=_['keys'](_0x55237a[_0x2a2c('0x25')]);_0x32cc41[_0x2a2c('0x2b')]=_[_0x2a2c('0x2c')](_0x32cc41[_0x2a2c('0x28')],_0x32cc41[_0x2a2c('0x25')]);_0x1476fd[_0x2a2c('0x2d')]=_[_0x2a2c('0x2c')](_0x32cc41[_0x2a2c('0x28')],qs['fields'](_0x55237a[_0x2a2c('0x25')][_0x2a2c('0x3c')]));_0x1476fd['attributes']=_0x1476fd[_0x2a2c('0x2d')][_0x2a2c('0x2e')]?_0x1476fd[_0x2a2c('0x2d')]:_0x32cc41[_0x2a2c('0x28')];_0x1476fd['order']=qs[_0x2a2c('0x40')](_0x55237a[_0x2a2c('0x25')]['sort']);_0x1476fd[_0x2a2c('0x22')]=qs[_0x2a2c('0x2b')](_[_0x2a2c('0x41')](_0x55237a[_0x2a2c('0x25')],_0x32cc41['filters']));if(_0x55237a[_0x2a2c('0x25')]['filter']){_0x1476fd[_0x2a2c('0x22')]=_[_0x2a2c('0x2f')](_0x1476fd[_0x2a2c('0x22')],{'$or':_[_0x2a2c('0x1f')](_0x1476fd[_0x2a2c('0x2d')],function(_0x2a4a67){var _0x20c19e={};_0x20c19e[_0x2a4a67]={'$like':'%'+_0x55237a['query'][_0x2a2c('0x43')]+'%'};return _0x20c19e;})});}_0x1476fd=_['merge']({},_0x1476fd,_0x55237a[_0x2a2c('0x30')]);return _0x1cb1fa[_0x2a2c('0x73')](_0x1476fd);}})[_0x2a2c('0x16')](function(_0x4d633a){if(_0x4d633a){_0x2f7605=_0x4d633a[_0x2a2c('0x2e')];if(!_0x55237a[_0x2a2c('0x25')][_0x2a2c('0x3d')](_0x2a2c('0x3e'))){_0x1476fd[_0x2a2c('0x12')]=qs[_0x2a2c('0x12')](_0x55237a[_0x2a2c('0x25')][_0x2a2c('0x12')]);_0x1476fd[_0x2a2c('0x10')]=qs[_0x2a2c('0x10')](_0x55237a[_0x2a2c('0x25')]['offset']);}return _0x1cb1fa['getAgents'](_0x1476fd);}})[_0x2a2c('0x16')](function(_0x142dc9){if(_0x142dc9){return _0x142dc9?{'count':_0x2f7605,'rows':_0x142dc9}:null;}})[_0x2a2c('0x16')](respondWithResult(_0x56ed26,null))[_0x2a2c('0x27')](handleError(_0x56ed26,null));};
\ No newline at end of file
+var _0xa81e=['Content-Range','update','then','get','ChatQueues','UserProfileResource','destroy','stack','name','send','map','ChatQueue','fieldName','type','key','where','rows','catch','params','rawAttributes','query','keys','filters','model','attributes','intersection','fields','length','include','merge','options','find','create','body','user','role','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','nolimit','order','sort','pick','ChatQueueId','filter','findAll','User','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','forEach','removeTeams','select','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','toString','SELECT','every','TeamId','all','union','compact','value','userChatQueue:remove','addAgents','omit','emit','userChatQueue:save','removeAgents','isArray','getAgents','bluebird','lodash','squel','ioredis','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','sendStatus','end','status','json','offset','undefined','limit','count','set'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa81e,0xd9));var _0xea81=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xa81e[_0x36c5b0];return _0xf19333;};'use strict';var BPromise=require(_0xea81('0x0'));var util=require('util');var _=require(_0xea81('0x1'));var squel=require(_0xea81('0x2'));var Redis=require(_0xea81('0x3'));var qs=require('../../components/parsers/qs');var logger=require(_0xea81('0x4'))(_0xea81('0x5'));var config=require('../../config/environment');var db=require(_0xea81('0x6'))['db'];config[_0xea81('0x7')]=_[_0xea81('0x8')](config[_0xea81('0x7')],{'host':_0xea81('0x9'),'port':0x18eb});var socket=require(_0xea81('0xa'))(new Redis(config[_0xea81('0x7')]));require(_0xea81('0xb'))['register'](socket);function respondWithStatusCode(_0x35c403,_0x8611bc){_0x8611bc=_0x8611bc||0xcc;return function(_0x6e6ba5){if(_0x6e6ba5){return _0x35c403[_0xea81('0xc')](_0x8611bc);}return _0x35c403['status'](_0x8611bc)[_0xea81('0xd')]();};}function respondWithResult(_0x24e608,_0x3f7272){_0x3f7272=_0x3f7272||0xc8;return function(_0x4ce4b6){if(_0x4ce4b6){return _0x24e608[_0xea81('0xe')](_0x3f7272)[_0xea81('0xf')](_0x4ce4b6);}};}function respondWithFilteredResult(_0xe52be8,_0x471a17){return function(_0x188b6b){if(_0x188b6b){var _0x32466c=typeof _0x471a17[_0xea81('0x10')]===_0xea81('0x11')&&typeof _0x471a17[_0xea81('0x12')]===_0xea81('0x11');var _0x3c948f=_0x188b6b[_0xea81('0x13')];var _0x1e21e0=_0x32466c?0x0:_0x471a17[_0xea81('0x10')];var _0x310935=_0x32466c?_0x188b6b[_0xea81('0x13')]:_0x471a17[_0xea81('0x10')]+_0x471a17[_0xea81('0x12')];var _0x2f81a8;if(_0x310935>=_0x3c948f){_0x310935=_0x3c948f;_0x2f81a8=0xc8;}else{_0x2f81a8=0xce;}_0xe52be8[_0xea81('0xe')](_0x2f81a8);return _0xe52be8[_0xea81('0x14')](_0xea81('0x15'),_0x1e21e0+'-'+_0x310935+'/'+_0x3c948f)['json'](_0x188b6b);}return null;};}function saveUpdates(_0x921d59){return function(_0x1b83dd){if(_0x1b83dd){return _0x1b83dd[_0xea81('0x16')](_0x921d59)[_0xea81('0x17')](function(_0x382ad6){return _0x382ad6;});}return null;};}function removeEntity(_0x20d38){return function(_0x2cddbb){if(_0x2cddbb){return _0x2cddbb['destroy']()[_0xea81('0x17')](function(){var _0x26abfb=_0x2cddbb[_0xea81('0x18')]({'plain':!![]});var _0x1cd072=_0xea81('0x19');return db[_0xea81('0x1a')][_0xea81('0x1b')]({'where':{'type':_0x1cd072,'resourceId':_0x26abfb['id']}})[_0xea81('0x17')](function(){return _0x2cddbb;});})[_0xea81('0x17')](function(){_0x20d38[_0xea81('0xe')](0xcc)[_0xea81('0xd')]();});}};}function handleEntityNotFound(_0x3cf60d){return function(_0x3a2631){if(!_0x3a2631){_0x3cf60d[_0xea81('0xc')](0x194);}return _0x3a2631;};}function handleError(_0x18522f,_0x499a47){_0x499a47=_0x499a47||0x1f4;return function(_0x18a866){logger['error'](_0x18a866[_0xea81('0x1c')]);if(_0x18a866[_0xea81('0x1d')]){delete _0x18a866['name'];}_0x18522f[_0xea81('0xe')](_0x499a47)[_0xea81('0x1e')](_0x18a866);};}exports['index']=function(_0x15800a,_0x28b69e){var _0x3e3ed1={};var _0x19e02f={'count':0x0,'rows':[]};var _0x51601d=_[_0xea81('0x1f')](db[_0xea81('0x20')]['rawAttributes'],function(_0x582738){return{'name':_0x582738[_0xea81('0x21')],'type':_0x582738[_0xea81('0x22')][_0xea81('0x23')]};});_0x3e3ed1=qs['getOptions'](_0x51601d,_0x15800a);var _0x59d540={'where':_0x3e3ed1[_0xea81('0x24')]};return db[_0xea81('0x20')]['count'](_0x59d540)[_0xea81('0x17')](function(_0x272b93){_0x19e02f[_0xea81('0x13')]=_0x272b93;_0x3e3ed1['include']=qs['include'](_0x15800a['query']);return db[_0xea81('0x20')]['findAll'](_0x3e3ed1);})['then'](function(_0x1950e2){_0x19e02f[_0xea81('0x25')]=_0x1950e2;return _0x19e02f;})[_0xea81('0x17')](respondWithFilteredResult(_0x28b69e,_0x3e3ed1))[_0xea81('0x26')](handleError(_0x28b69e,null));};exports['show']=function(_0x232f2e,_0x27c162){var _0x395e28={'raw':!![],'where':{'id':_0x232f2e[_0xea81('0x27')]['id']}},_0x5ab885={};_0x5ab885['model']=_['keys'](db[_0xea81('0x20')][_0xea81('0x28')]);_0x5ab885[_0xea81('0x29')]=_[_0xea81('0x2a')](_0x232f2e[_0xea81('0x29')]);_0x5ab885[_0xea81('0x2b')]=_['intersection'](_0x5ab885[_0xea81('0x2c')],_0x5ab885[_0xea81('0x29')]);_0x395e28[_0xea81('0x2d')]=_[_0xea81('0x2e')](_0x5ab885[_0xea81('0x2c')],qs[_0xea81('0x2f')](_0x232f2e[_0xea81('0x29')][_0xea81('0x2f')]));_0x395e28['attributes']=_0x395e28[_0xea81('0x2d')][_0xea81('0x30')]?_0x395e28['attributes']:_0x5ab885[_0xea81('0x2c')];if(_0x232f2e[_0xea81('0x29')]['includeAll']){_0x395e28[_0xea81('0x31')]=[{'all':!![]}];}_0x395e28=_[_0xea81('0x32')]({},_0x395e28,_0x232f2e[_0xea81('0x33')]);return db['ChatQueue'][_0xea81('0x34')](_0x395e28)[_0xea81('0x17')](handleEntityNotFound(_0x27c162,null))[_0xea81('0x17')](respondWithResult(_0x27c162,null))[_0xea81('0x26')](handleError(_0x27c162,null));};exports[_0xea81('0x35')]=function(_0x4f8956,_0x110c4c){return db[_0xea81('0x20')][_0xea81('0x35')](_0x4f8956[_0xea81('0x36')],{})['then'](function(_0x5519b9){var _0x535048=_0x4f8956[_0xea81('0x37')][_0xea81('0x18')]({'plain':!![]});if(!_0x535048)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x535048[_0xea81('0x38')]==='user'){var _0x17012c=_0x5519b9[_0xea81('0x18')]({'plain':!![]});var _0x318c7f=_0xea81('0x19');return db[_0xea81('0x39')]['find']({'where':{'name':_0x318c7f,'userProfileId':_0x535048['userProfileId']},'raw':!![]})['then'](function(_0x38fea1){if(_0x38fea1&&_0x38fea1['autoAssociation']===0x0){return db[_0xea81('0x1a')][_0xea81('0x35')]({'name':_0x17012c['name'],'resourceId':_0x17012c['id'],'type':_0x38fea1[_0xea81('0x1d')],'sectionId':_0x38fea1['id']},{})[_0xea81('0x17')](function(){return _0x5519b9;});}else{return _0x5519b9;}})[_0xea81('0x26')](function(_0x3be0f4){logger[_0xea81('0x3a')](_0xea81('0x3b'),_0x3be0f4);throw _0x3be0f4;});}return _0x5519b9;})[_0xea81('0x17')](respondWithResult(_0x110c4c,0xc9))[_0xea81('0x26')](handleError(_0x110c4c,null));};exports['update']=function(_0x56c528,_0x1b5a4e){if(_0x56c528[_0xea81('0x36')]['id']){delete _0x56c528[_0xea81('0x36')]['id'];}return db['ChatQueue'][_0xea81('0x34')]({'where':{'id':_0x56c528[_0xea81('0x27')]['id']}})[_0xea81('0x17')](handleEntityNotFound(_0x1b5a4e,null))['then'](saveUpdates(_0x56c528[_0xea81('0x36')],null))[_0xea81('0x17')](respondWithResult(_0x1b5a4e,null))[_0xea81('0x26')](handleError(_0x1b5a4e,null));};exports[_0xea81('0x1b')]=function(_0x3ad254,_0x563e5b){return db[_0xea81('0x20')][_0xea81('0x34')]({'where':{'id':_0x3ad254[_0xea81('0x27')]['id']}})[_0xea81('0x17')](handleEntityNotFound(_0x563e5b,null))[_0xea81('0x17')](removeEntity(_0x563e5b,null))[_0xea81('0x26')](handleError(_0x563e5b,null));};exports['describe']=function(_0x607467,_0x2282a8){return db[_0xea81('0x20')][_0xea81('0x3c')]()[_0xea81('0x17')](respondWithResult(_0x2282a8,null))[_0xea81('0x26')](handleError(_0x2282a8,null));};exports[_0xea81('0x3d')]=function(_0x2afd28,_0x4e24cc){var _0x2df835={'raw':!![],'where':{}},_0x4190fa={},_0x1be9a0;return db['ChatQueue'][_0xea81('0x3e')]({'where':{'id':_0x2afd28['params']['id']}})[_0xea81('0x17')](handleEntityNotFound(_0x4e24cc,null))['then'](function(_0x2dcc4a){if(_0x2dcc4a){_0x1be9a0=_0x2dcc4a[_0xea81('0x18')]({'plain':!![]});_0x4190fa[_0xea81('0x2c')]=_[_0xea81('0x2a')](db[_0xea81('0x3f')]['rawAttributes']);_0x4190fa[_0xea81('0x29')]=_[_0xea81('0x2a')](_0x2afd28[_0xea81('0x29')]);_0x4190fa[_0xea81('0x2b')]=_[_0xea81('0x2e')](_0x4190fa[_0xea81('0x2c')],_0x4190fa['query']);_0x2df835[_0xea81('0x2d')]=_[_0xea81('0x2e')](_0x4190fa[_0xea81('0x2c')],qs[_0xea81('0x2f')](_0x2afd28['query'][_0xea81('0x2f')]));_0x2df835[_0xea81('0x2d')]=_0x2df835[_0xea81('0x2d')][_0xea81('0x30')]?_0x2df835[_0xea81('0x2d')]:_0x4190fa[_0xea81('0x2c')];if(!_0x2afd28[_0xea81('0x29')][_0xea81('0x40')](_0xea81('0x41'))){_0x2df835[_0xea81('0x12')]=qs[_0xea81('0x12')](_0x2afd28['query'][_0xea81('0x12')]);_0x2df835[_0xea81('0x10')]=qs[_0xea81('0x10')](_0x2afd28['query'][_0xea81('0x10')]);}_0x2df835[_0xea81('0x42')]=qs[_0xea81('0x43')](_0x2afd28[_0xea81('0x29')][_0xea81('0x43')]);_0x2df835[_0xea81('0x24')]=qs['filters'](_[_0xea81('0x44')](_0x2afd28[_0xea81('0x29')],_0x4190fa[_0xea81('0x2b')]));_0x2df835[_0xea81('0x24')][_0xea81('0x45')]=_0x2dcc4a['id'];if(_0x2afd28[_0xea81('0x29')][_0xea81('0x46')]){_0x2df835[_0xea81('0x24')]=_[_0xea81('0x32')](_0x2df835[_0xea81('0x24')],{'$or':_[_0xea81('0x1f')](_0x2df835[_0xea81('0x2d')],function(_0x22bcbf){var _0x53ec52={};_0x53ec52[_0x22bcbf]={'$like':'%'+_0x2afd28['query'][_0xea81('0x46')]+'%'};return _0x53ec52;})});}_0x2df835=_['merge']({},_0x2df835,_0x2afd28[_0xea81('0x33')]);return db['UserChatQueue'][_0xea81('0x47')](_0x2df835);}})[_0xea81('0x17')](function(_0x5898c7){if(_0x5898c7){return db[_0xea81('0x48')]['findAndCountAll']({'where':{'id':_[_0xea81('0x1f')](_0x5898c7,_0xea81('0x49')),'role':_0xea81('0x4a')},'attributes':['id','name',_0xea81('0x4b'),_0xea81('0x4c'),_0xea81('0x4d')]});}})[_0xea81('0x17')](function(_0x57bf4b){if(_0x57bf4b){return{'count':_0x57bf4b['count'],'rows':_[_0xea81('0x1f')](_0x57bf4b[_0xea81('0x25')],function(_0x285c57){return{'membername':_0x285c57[_0xea81('0x1d')],'UserId':_0x285c57['id'],'queue_name':_0x1be9a0[_0xea81('0x1d')],'ChatQueueId':_0x1be9a0['id'],'interface':util[_0xea81('0x4e')](_0xea81('0x4f'),_0xea81('0x50'),_0x285c57[_0xea81('0x1d')]),'penalty':0x0,'paused':_0x285c57['chatPause'],'createdAt':_0x285c57[_0xea81('0x4d')],'updatedAt':_0x285c57['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xea81('0x17')](respondWithFilteredResult(_0x4e24cc,_0x2df835))[_0xea81('0x26')](handleError(_0x4e24cc,null));};exports[_0xea81('0x51')]=function(_0x5f20b0,_0x19aafc){var _0x4f9e15={};var _0x406385={};var _0x49f0cc;var _0x35a932;return db[_0xea81('0x20')][_0xea81('0x3e')]({'where':{'id':_0x5f20b0[_0xea81('0x27')]['id']}})[_0xea81('0x17')](handleEntityNotFound(_0x19aafc,null))[_0xea81('0x17')](function(_0x52faa7){if(_0x52faa7){_0x49f0cc=_0x52faa7;_0x406385[_0xea81('0x2c')]=_[_0xea81('0x2a')](db[_0xea81('0x52')][_0xea81('0x28')]);_0x406385[_0xea81('0x29')]=_[_0xea81('0x2a')](_0x5f20b0[_0xea81('0x29')]);_0x406385['filters']=_[_0xea81('0x2e')](_0x406385[_0xea81('0x2c')],_0x406385[_0xea81('0x29')]);_0x4f9e15[_0xea81('0x2d')]=_['intersection'](_0x406385[_0xea81('0x2c')],qs[_0xea81('0x2f')](_0x5f20b0[_0xea81('0x29')][_0xea81('0x2f')]));_0x4f9e15[_0xea81('0x2d')]=_0x4f9e15[_0xea81('0x2d')]['length']?_0x4f9e15['attributes']:_0x406385[_0xea81('0x2c')];_0x4f9e15[_0xea81('0x42')]=qs[_0xea81('0x43')](_0x5f20b0[_0xea81('0x29')][_0xea81('0x43')]);_0x4f9e15[_0xea81('0x24')]=qs[_0xea81('0x2b')](_[_0xea81('0x44')](_0x5f20b0['query'],_0x406385[_0xea81('0x2b')]));if(_0x5f20b0[_0xea81('0x29')][_0xea81('0x46')]){_0x4f9e15[_0xea81('0x24')]=_[_0xea81('0x32')](_0x4f9e15['where'],{'$or':_[_0xea81('0x1f')](_0x4f9e15[_0xea81('0x2d')],function(_0x447507){var _0x337183={};_0x337183[_0x447507]={'$like':'%'+_0x5f20b0[_0xea81('0x29')]['filter']+'%'};return _0x337183;})});}_0x4f9e15=_['merge']({},_0x4f9e15,_0x5f20b0[_0xea81('0x33')]);return _0x49f0cc[_0xea81('0x51')](_0x4f9e15);}})[_0xea81('0x17')](function(_0x26269e){if(_0x26269e){_0x35a932=_0x26269e[_0xea81('0x30')];if(!_0x5f20b0[_0xea81('0x29')]['hasOwnProperty'](_0xea81('0x41'))){_0x4f9e15[_0xea81('0x12')]=qs['limit'](_0x5f20b0['query']['limit']);_0x4f9e15[_0xea81('0x10')]=qs[_0xea81('0x10')](_0x5f20b0['query']['offset']);}return _0x49f0cc[_0xea81('0x51')](_0x4f9e15);}})[_0xea81('0x17')](function(_0x1db5ad){if(_0x1db5ad){return _0x1db5ad?{'count':_0x35a932,'rows':_0x1db5ad}:null;}})['then'](respondWithResult(_0x19aafc,null))[_0xea81('0x26')](handleError(_0x19aafc,null));};exports[_0xea81('0x53')]=function(_0xf0bfc6,_0xf3bfb7){var _0x4b73f8=_0xf0bfc6[_0xea81('0x36')][_0xea81('0x54')];return db[_0xea81('0x52')][_0xea81('0x47')]({'where':{'id':_0x4b73f8},'attributes':['id'],'include':[{'model':db[_0xea81('0x48')],'as':_0xea81('0x55'),'attributes':['id',_0xea81('0x1d'),_0xea81('0x56'),_0xea81('0x57'),_0xea81('0x58')],'raw':!![]}]})[_0xea81('0x17')](function(_0x1fffc8){if(_0x1fffc8){var _0xe998=_[_0xea81('0x59')](_0x1fffc8,function(_0x1259fe){var _0x149ef7=_0x1259fe[_0xea81('0x18')]({'plain':!![]});return _0x149ef7[_0xea81('0x55')];});return db[_0xea81('0x20')][_0xea81('0x34')]({'where':{'id':_0xf0bfc6[_0xea81('0x27')]['id']}})['then'](function(_0x25c6d6){return db[_0xea81('0x5a')][_0xea81('0x5b')](function(_0x440f58){return _0x25c6d6[_0xea81('0x53')](_0x4b73f8,{'transaction':_0x440f58})[_0xea81('0x17')](function(){return BPromise[_0xea81('0x5c')](_0xe998,function(_0x46c397){return db['UserChatQueue']['findOrCreate']({'where':{'UserId':_0x46c397['id'],'ChatQueueId':_0xf0bfc6['params']['id']},'transaction':_0x440f58});});})[_0xea81('0x17')](function(){_0xe998[_0xea81('0x5d')](function(_0x5be78a){socket['emit']('userChatQueue:save',{'UserId':_0x5be78a['id'],'ChatQueueId':_0x25c6d6['id']});});});});});}})[_0xea81('0x17')](respondWithStatusCode(_0xf3bfb7,null))['catch'](handleError(_0xf3bfb7,null));};exports[_0xea81('0x5e')]=function(_0x5bce8b,_0x164283){return db[_0xea81('0x52')][_0xea81('0x47')]({'where':{'id':_0x5bce8b[_0xea81('0x29')]['ids']},'attributes':['id'],'include':[{'model':db[_0xea81('0x48')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xea81('0x17')](handleEntityNotFound(_0x164283,null))[_0xea81('0x17')](function(_0xb4982c){var _0x5a89a9=_['map'](_0xb4982c,'id');var _0x3b3eb8=[];var _0x105f49=[];var _0x49294e=squel[_0xea81('0x5f')]();_0x49294e['field'](_0xea81('0x60'))[_0xea81('0x61')]('team_has_chat_queues','tq')[_0xea81('0x62')](_0xea81('0x63'),'ut',_0xea81('0x64'))[_0xea81('0x24')]('ChatQueueId\x20=\x20?',_0x5bce8b['params']['id']);for(var _0x480825=0x0;_0x480825<_0xb4982c[_0xea81('0x30')];_0x480825+=0x1){let _0x5eb610=_0xb4982c[_0x480825];for(var _0x5ae51f=0x0;_0x5ae51f<_0x5eb610[_0xea81('0x55')]['length'];_0x5ae51f+=0x1){let _0x25d5ee=_0x5eb610[_0xea81('0x55')][_0x5ae51f];var _0x3070dc=_0x49294e[_0xea81('0x65')]();_0x3070dc[_0xea81('0x24')]('ut.UserId\x20=\x20?',_0x25d5ee['id']);_0x105f49[_0xea81('0x66')](db['sequelize'][_0xea81('0x29')](_0x3070dc[_0xea81('0x67')](),{'type':db['sequelize']['QueryTypes'][_0xea81('0x68')]})[_0xea81('0x17')](function(_0x18b9b3){if(_0x18b9b3[_0xea81('0x30')]===0x1){return _0x25d5ee['id'];}else{var _0x58d4cc=_[_0xea81('0x69')](_[_0xea81('0x1f')](_0x18b9b3,_0xea81('0x6a')),function(_0x365748){return _['includes'](_0x5a89a9,_0x365748);});if(_0x58d4cc){return _0x25d5ee['id'];}}}));}}return BPromise[_0xea81('0x6b')](_0x105f49)[_0xea81('0x17')](function(_0x1f50f7){_0x3b3eb8=_(_0x3b3eb8)[_0xea81('0x6c')](_0x1f50f7)[_0xea81('0x6d')]()[_0xea81('0x6e')]();return db[_0xea81('0x20')][_0xea81('0x34')]({'where':{'id':_0x5bce8b[_0xea81('0x27')]['id']}})[_0xea81('0x17')](function(_0x125721){return db[_0xea81('0x5a')]['transaction'](function(_0x4c13ea){return _0x125721['removeTeams'](_0x5bce8b[_0xea81('0x29')][_0xea81('0x54')],{'transaction':_0x4c13ea})['then'](function(){if(!_['isEmpty'](_0x3b3eb8)){return _0x125721['removeAgents'](_0x3b3eb8,{'transaction':_0x4c13ea});}})[_0xea81('0x17')](function(){_0x3b3eb8[_0xea81('0x5d')](function(_0x36ddd8){socket['emit'](_0xea81('0x6f'),{'UserId':_0x36ddd8,'ChatQueueId':_0x125721['id']});});});});});});})[_0xea81('0x17')](respondWithStatusCode(_0x164283,null))[_0xea81('0x26')](handleError(_0x164283,null));};exports[_0xea81('0x70')]=function(_0x30a205,_0x1111d2){return db['ChatQueue']['find']({'where':{'id':_0x30a205[_0xea81('0x27')]['id']}})[_0xea81('0x17')](handleEntityNotFound(_0x1111d2,null))[_0xea81('0x17')](function(_0x48f1ba){if(_0x48f1ba){return _0x48f1ba[_0xea81('0x70')](_0x30a205[_0xea81('0x36')][_0xea81('0x54')],_[_0xea81('0x71')](_0x30a205[_0xea81('0x36')],[_0xea81('0x54'),'id'])||{})['spread'](function(_0x31ddf3){for(var _0x3af40c=0x0;_0x3af40c<_0x30a205[_0xea81('0x36')]['ids'][_0xea81('0x30')];_0x3af40c+=0x1){socket[_0xea81('0x72')](_0xea81('0x73'),{'UserId':Number(_0x30a205[_0xea81('0x36')]['ids'][_0x3af40c]),'ChatQueueId':Number(_0x30a205[_0xea81('0x27')]['id'])});}return _0x31ddf3;});}})[_0xea81('0x17')](respondWithResult(_0x1111d2,null))[_0xea81('0x26')](handleError(_0x1111d2,null));};exports[_0xea81('0x74')]=function(_0x2a5658,_0x29f591){return db[_0xea81('0x20')][_0xea81('0x34')]({'where':{'id':_0x2a5658[_0xea81('0x27')]['id']}})['then'](handleEntityNotFound(_0x29f591,null))[_0xea81('0x17')](function(_0x1cc1f9){if(_0x1cc1f9){return _0x1cc1f9[_0xea81('0x74')](_0x2a5658[_0xea81('0x29')][_0xea81('0x54')])[_0xea81('0x17')](function(){if(_[_0xea81('0x75')](_0x2a5658['query'][_0xea81('0x54')])){for(var _0x5b8b8f=0x0;_0x5b8b8f<_0x2a5658[_0xea81('0x29')][_0xea81('0x54')][_0xea81('0x30')];_0x5b8b8f+=0x1){socket[_0xea81('0x72')](_0xea81('0x6f'),{'UserId':Number(_0x2a5658[_0xea81('0x29')][_0xea81('0x54')][_0x5b8b8f]),'ChatQueueId':Number(_0x2a5658[_0xea81('0x27')]['id'])});}}else{socket['emit'](_0xea81('0x6f'),{'UserId':Number(_0x2a5658['query'][_0xea81('0x54')]),'ChatQueueId':Number(_0x2a5658[_0xea81('0x27')]['id'])});}});}})[_0xea81('0x17')](respondWithStatusCode(_0x29f591,null))[_0xea81('0x26')](handleError(_0x29f591,null));};exports[_0xea81('0x76')]=function(_0x5742a1,_0x980b0a){var _0x1b5ee0={};var _0x27e2d6={};var _0x338793;var _0xeba39b;return db[_0xea81('0x20')][_0xea81('0x3e')]({'where':{'id':_0x5742a1['params']['id']}})[_0xea81('0x17')](handleEntityNotFound(_0x980b0a,null))[_0xea81('0x17')](function(_0x369149){if(_0x369149){_0x338793=_0x369149;_0x27e2d6[_0xea81('0x2c')]=_[_0xea81('0x2a')](db['User'][_0xea81('0x28')]);_0x27e2d6[_0xea81('0x29')]=_[_0xea81('0x2a')](_0x5742a1[_0xea81('0x29')]);_0x27e2d6['filters']=_['intersection'](_0x27e2d6[_0xea81('0x2c')],_0x27e2d6[_0xea81('0x29')]);_0x1b5ee0[_0xea81('0x2d')]=_[_0xea81('0x2e')](_0x27e2d6[_0xea81('0x2c')],qs[_0xea81('0x2f')](_0x5742a1['query'][_0xea81('0x2f')]));_0x1b5ee0[_0xea81('0x2d')]=_0x1b5ee0[_0xea81('0x2d')][_0xea81('0x30')]?_0x1b5ee0[_0xea81('0x2d')]:_0x27e2d6[_0xea81('0x2c')];_0x1b5ee0[_0xea81('0x42')]=qs[_0xea81('0x43')](_0x5742a1[_0xea81('0x29')]['sort']);_0x1b5ee0[_0xea81('0x24')]=qs[_0xea81('0x2b')](_[_0xea81('0x44')](_0x5742a1[_0xea81('0x29')],_0x27e2d6[_0xea81('0x2b')]));if(_0x5742a1[_0xea81('0x29')][_0xea81('0x46')]){_0x1b5ee0[_0xea81('0x24')]=_[_0xea81('0x32')](_0x1b5ee0[_0xea81('0x24')],{'$or':_['map'](_0x1b5ee0['attributes'],function(_0x831de3){var _0x3260d1={};_0x3260d1[_0x831de3]={'$like':'%'+_0x5742a1[_0xea81('0x29')][_0xea81('0x46')]+'%'};return _0x3260d1;})});}_0x1b5ee0=_[_0xea81('0x32')]({},_0x1b5ee0,_0x5742a1[_0xea81('0x33')]);return _0x338793[_0xea81('0x76')](_0x1b5ee0);}})[_0xea81('0x17')](function(_0x13af19){if(_0x13af19){_0xeba39b=_0x13af19[_0xea81('0x30')];if(!_0x5742a1[_0xea81('0x29')][_0xea81('0x40')]('nolimit')){_0x1b5ee0[_0xea81('0x12')]=qs['limit'](_0x5742a1[_0xea81('0x29')][_0xea81('0x12')]);_0x1b5ee0[_0xea81('0x10')]=qs[_0xea81('0x10')](_0x5742a1[_0xea81('0x29')]['offset']);}return _0x338793[_0xea81('0x76')](_0x1b5ee0);}})[_0xea81('0x17')](function(_0x52a096){if(_0x52a096){return _0x52a096?{'count':_0xeba39b,'rows':_0x52a096}:null;}})['then'](respondWithResult(_0x980b0a,null))[_0xea81('0x26')](handleError(_0x980b0a,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 5245041..f58e26b 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 _0x3c17=['exports','events','ChatQueue','setMaxListeners','save','remove','emit','hook'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x3c17,0xe1));var _0x73c1=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x3c17[_0xbb091];return _0x467a04;};'use strict';var EventEmitter=require(_0x73c1('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x73c1('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x73c1('0x2')](0x0);var events={'afterCreate':_0x73c1('0x3'),'afterUpdate':'update','afterDestroy':_0x73c1('0x4')};function emitEvent(_0x534a6d){return function(_0x4802c2,_0x283ff3,_0x3d477b){ChatQueueEvents[_0x73c1('0x5')](_0x534a6d+':'+_0x4802c2['id'],_0x4802c2);ChatQueueEvents['emit'](_0x534a6d,_0x4802c2);_0x3d477b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x73c1('0x6')](e,emitEvent(event));}}module[_0x73c1('0x7')]=ChatQueueEvents;
\ No newline at end of file
+var _0x1fc9=['setMaxListeners','save','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x3f9b27,_0x4e2807){var _0x4e08e6=function(_0x32a9da){while(--_0x32a9da){_0x3f9b27['push'](_0x3f9b27['shift']());}};_0x4e08e6(++_0x4e2807);}(_0x1fc9,0x136));var _0x91fc=function(_0x13a42e,_0x1078ba){_0x13a42e=_0x13a42e-0x0;var _0x293c67=_0x1fc9[_0x13a42e];return _0x293c67;};'use strict';var EventEmitter=require(_0x91fc('0x0'));var ChatQueue=require(_0x91fc('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x91fc('0x2')](0x0);var events={'afterCreate':_0x91fc('0x3'),'afterUpdate':'update','afterDestroy':_0x91fc('0x4')};function emitEvent(_0xb05d6f){return function(_0x1452d6,_0x33aeb2,_0x1dca20){ChatQueueEvents[_0x91fc('0x5')](_0xb05d6f+':'+_0x1452d6['id'],_0x1452d6);ChatQueueEvents[_0x91fc('0x5')](_0xb05d6f,_0x1452d6);_0x1dca20(null);};}for(var e in events){if(events[_0x91fc('0x6')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x91fc('0x7')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 7938f6e..48ee680 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 _0x9f6c=['path','rimraf','../../config/environment','./chatQueue.attributes','exports','ChatQueue','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x37c767,_0x4f2a84){var _0x3f711f=function(_0x566246){while(--_0x566246){_0x37c767['push'](_0x37c767['shift']());}};_0x3f711f(++_0x4f2a84);}(_0x9f6c,0x74));var _0xc9f6=function(_0x26299e,_0x394ad1){_0x26299e=_0x26299e-0x0;var _0x6c4f4a=_0x9f6c[_0x26299e];return _0x6c4f4a;};'use strict';var _=require(_0xc9f6('0x0'));var util=require(_0xc9f6('0x1'));var logger=require(_0xc9f6('0x2'))('api');var moment=require('moment');var BPromise=require(_0xc9f6('0x3'));var rp=require(_0xc9f6('0x4'));var fs=require('fs');var path=require(_0xc9f6('0x5'));var rimraf=require(_0xc9f6('0x6'));var config=require(_0xc9f6('0x7'));var attributes=require(_0xc9f6('0x8'));module[_0xc9f6('0x9')]=function(_0x5828bc,_0x7b3049){return _0x5828bc['define'](_0xc9f6('0xa'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4ee0=['../../config/environment','./chatQueue.attributes','exports','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x1b1c55,_0x23903f){var _0x508da1=function(_0x52747d){while(--_0x52747d){_0x1b1c55['push'](_0x1b1c55['shift']());}};_0x508da1(++_0x23903f);}(_0x4ee0,0x1f2));var _0x04ee=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0x4ee0[_0x1573ea];return _0x51c0e2;};'use strict';var _=require(_0x04ee('0x0'));var util=require(_0x04ee('0x1'));var logger=require(_0x04ee('0x2'))('api');var moment=require(_0x04ee('0x3'));var BPromise=require(_0x04ee('0x4'));var rp=require(_0x04ee('0x5'));var fs=require('fs');var path=require(_0x04ee('0x6'));var rimraf=require(_0x04ee('0x7'));var config=require(_0x04ee('0x8'));var attributes=require(_0x04ee('0x9'));module[_0x04ee('0xa')]=function(_0x45021d,_0x565051){return _0x45021d['define']('ChatQueue',attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index e77570f..595c247 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 _0x3eae=['http','redis','defaults','localhost','./chatQueue.socket','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','ChatQueue,\x20%s,\x20%s','message','result','catch','ChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','GetChatQueue','ShowChatQueue','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client'];(function(_0x100257,_0x4ab625){var _0x39abbc=function(_0x30c635){while(--_0x30c635){_0x100257['push'](_0x100257['shift']());}};_0x39abbc(++_0x4ab625);}(_0x3eae,0x126));var _0xe3ea=function(_0x473738,_0x15ea31){_0x473738=_0x473738-0x0;var _0x1df4ae=_0x3eae[_0x473738];return _0x1df4ae;};'use strict';var _=require(_0xe3ea('0x0'));var util=require(_0xe3ea('0x1'));var moment=require(_0xe3ea('0x2'));var BPromise=require(_0xe3ea('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe3ea('0x4'));var db=require(_0xe3ea('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe3ea('0x6'))(_0xe3ea('0x7'));var config=require(_0xe3ea('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe3ea('0x9')][_0xe3ea('0xa')]({'port':0x232a});config[_0xe3ea('0xb')]=_[_0xe3ea('0xc')](config[_0xe3ea('0xb')],{'host':_0xe3ea('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe3ea('0xb')]));require(_0xe3ea('0xe'))['register'](socket);function respondWithRpcPromise(_0x32a059,_0x23ca3e,_0x23134e){return new BPromise(function(_0x2afd60,_0x1db54c){return client['request'](_0x32a059,_0x23134e)[_0xe3ea('0xf')](function(_0x3236c0){logger[_0xe3ea('0x10')]('ChatQueue,\x20%s,\x20%s',_0x23ca3e,_0xe3ea('0x11'));logger[_0xe3ea('0x12')](_0xe3ea('0x13'),_0x23ca3e,_0xe3ea('0x11'),JSON[_0xe3ea('0x14')](_0x3236c0));if(_0x3236c0[_0xe3ea('0x15')]){if(_0x3236c0['error']['code']===0x1f4){logger[_0xe3ea('0x15')](_0xe3ea('0x16'),_0x23ca3e,_0x3236c0[_0xe3ea('0x15')][_0xe3ea('0x17')]);return _0x1db54c(_0x3236c0[_0xe3ea('0x15')]['message']);}logger['error'](_0xe3ea('0x16'),_0x23ca3e,_0x3236c0[_0xe3ea('0x15')]['message']);return _0x2afd60(_0x3236c0[_0xe3ea('0x15')][_0xe3ea('0x17')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x23ca3e,_0xe3ea('0x11'));_0x2afd60(_0x3236c0[_0xe3ea('0x18')][_0xe3ea('0x17')]);}})[_0xe3ea('0x19')](function(_0x12de73){logger[_0xe3ea('0x15')]('ChatQueue,\x20%s,\x20%s',_0x23ca3e,_0x12de73);_0x1db54c(_0x12de73);});});}exports['GetChatQueue']=function(_0x165f53){var _0x5d0ca4=this;return new Promise(function(_0x52df79,_0xcbb4db){return db[_0xe3ea('0x1a')][_0xe3ea('0x1b')]({'raw':_0x165f53[_0xe3ea('0x1c')]?_0x165f53[_0xe3ea('0x1c')][_0xe3ea('0x1d')]===undefined?!![]:![]:!![],'where':_0x165f53[_0xe3ea('0x1c')]?_0x165f53[_0xe3ea('0x1c')][_0xe3ea('0x1e')]||null:null,'attributes':_0x165f53[_0xe3ea('0x1c')]?_0x165f53[_0xe3ea('0x1c')][_0xe3ea('0x1f')]||null:null,'limit':_0x165f53[_0xe3ea('0x1c')]?_0x165f53['options'][_0xe3ea('0x20')]||null:null,'include':_0x165f53[_0xe3ea('0x1c')]?_0x165f53[_0xe3ea('0x1c')][_0xe3ea('0x21')]?_[_0xe3ea('0x22')](_0x165f53[_0xe3ea('0x1c')][_0xe3ea('0x21')],function(_0x5305e1){return{'model':db[_0x5305e1[_0xe3ea('0x23')]],'as':_0x5305e1['as'],'attributes':_0x5305e1[_0xe3ea('0x1f')],'include':_0x5305e1['include']?_[_0xe3ea('0x22')](_0x5305e1[_0xe3ea('0x21')],function(_0x218dcb){return{'model':db[_0x218dcb[_0xe3ea('0x23')]],'as':_0x218dcb['as'],'attributes':_0x218dcb['attributes'],'include':_0x218dcb['include']?_[_0xe3ea('0x22')](_0x218dcb['include'],function(_0x3032b1){return{'model':db[_0x3032b1[_0xe3ea('0x23')]],'as':_0x3032b1['as'],'attributes':_0x3032b1[_0xe3ea('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x115a78){logger['info'](_0xe3ea('0x24'),_0x165f53);logger[_0xe3ea('0x12')](_0xe3ea('0x24'),_0x165f53,JSON[_0xe3ea('0x14')](_0x115a78));_0x52df79(_0x115a78);})[_0xe3ea('0x19')](function(_0x56be4a){logger[_0xe3ea('0x15')](_0xe3ea('0x24'),_0x56be4a[_0xe3ea('0x17')],_0x165f53);_0xcbb4db(_0x5d0ca4[_0xe3ea('0x15')](0x1f4,_0x56be4a['message']));});});};exports['ShowChatQueue']=function(_0x2ab595){var _0x42be18=this;return new Promise(function(_0x723a3a,_0xcbfea2){return db[_0xe3ea('0x1a')]['find']({'raw':_0x2ab595[_0xe3ea('0x1c')]?_0x2ab595['options']['raw']===undefined?!![]:![]:!![],'where':_0x2ab595[_0xe3ea('0x1c')]?_0x2ab595[_0xe3ea('0x1c')]['where']||null:null,'attributes':_0x2ab595['options']?_0x2ab595[_0xe3ea('0x1c')][_0xe3ea('0x1f')]||null:null,'include':_0x2ab595[_0xe3ea('0x1c')]?_0x2ab595[_0xe3ea('0x1c')][_0xe3ea('0x21')]?_[_0xe3ea('0x22')](_0x2ab595['options'][_0xe3ea('0x21')],function(_0x419b5f){return{'model':db[_0x419b5f[_0xe3ea('0x23')]],'as':_0x419b5f['as'],'attributes':_0x419b5f[_0xe3ea('0x1f')],'include':_0x419b5f[_0xe3ea('0x21')]?_[_0xe3ea('0x22')](_0x419b5f[_0xe3ea('0x21')],function(_0xbfc054){return{'model':db[_0xbfc054[_0xe3ea('0x23')]],'as':_0xbfc054['as'],'attributes':_0xbfc054[_0xe3ea('0x1f')],'include':_0xbfc054[_0xe3ea('0x21')]?_[_0xe3ea('0x22')](_0xbfc054[_0xe3ea('0x21')],function(_0x3f6f3a){return{'model':db[_0x3f6f3a['model']],'as':_0x3f6f3a['as'],'attributes':_0x3f6f3a['attributes']};}):[]};}):[]};}):[]:[]})[_0xe3ea('0xf')](function(_0x28d670){logger[_0xe3ea('0x10')]('ShowChatQueue',_0x2ab595);logger[_0xe3ea('0x12')](_0xe3ea('0x25'),_0x2ab595,JSON[_0xe3ea('0x14')](_0x28d670));_0x723a3a(_0x28d670);})[_0xe3ea('0x19')](function(_0x369818){logger['error'](_0xe3ea('0x25'),_0x369818['message'],_0x2ab595);_0xcbfea2(_0x42be18['error'](0x1f4,_0x369818[_0xe3ea('0x17')]));});});};
\ No newline at end of file
+var _0x8dd6=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','info','result','catch','GetChatQueue','findAll','options','raw','limit','include','map','attributes','model','then','ShowChatQueue','ChatQueue','find','where','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x5a9c0c,_0x4ec485){var _0x53c77d=function(_0x1cf384){while(--_0x1cf384){_0x5a9c0c['push'](_0x5a9c0c['shift']());}};_0x53c77d(++_0x4ec485);}(_0x8dd6,0xcd));var _0x68dd=function(_0x2caf55,_0xb80b11){_0x2caf55=_0x2caf55-0x0;var _0xfbaf=_0x8dd6[_0x2caf55];return _0xfbaf;};'use strict';var _=require(_0x68dd('0x0'));var util=require('util');var moment=require(_0x68dd('0x1'));var BPromise=require(_0x68dd('0x2'));var rs=require(_0x68dd('0x3'));var fs=require('fs');var Redis=require(_0x68dd('0x4'));var db=require(_0x68dd('0x5'))['db'];var utils=require(_0x68dd('0x6'));var logger=require(_0x68dd('0x7'))(_0x68dd('0x8'));var config=require('../../config/environment');var jayson=require(_0x68dd('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x68dd('0xa')]=_[_0x68dd('0xb')](config[_0x68dd('0xa')],{'host':_0x68dd('0xc'),'port':0x18eb});var socket=require(_0x68dd('0xd'))(new Redis(config[_0x68dd('0xa')]));require(_0x68dd('0xe'))[_0x68dd('0xf')](socket);function respondWithRpcPromise(_0x986a9a,_0x5173df,_0x5bfd09){return new BPromise(function(_0x2b0b2b,_0x3e9fc1){return client[_0x68dd('0x10')](_0x986a9a,_0x5bfd09)['then'](function(_0x2672a2){logger['info']('ChatQueue,\x20%s,\x20%s',_0x5173df,'request\x20sent');logger[_0x68dd('0x11')](_0x68dd('0x12'),_0x5173df,_0x68dd('0x13'),JSON[_0x68dd('0x14')](_0x2672a2));if(_0x2672a2[_0x68dd('0x15')]){if(_0x2672a2['error'][_0x68dd('0x16')]===0x1f4){logger[_0x68dd('0x15')](_0x68dd('0x17'),_0x5173df,_0x2672a2[_0x68dd('0x15')][_0x68dd('0x18')]);return _0x3e9fc1(_0x2672a2[_0x68dd('0x15')][_0x68dd('0x18')]);}logger[_0x68dd('0x15')]('ChatQueue,\x20%s,\x20%s',_0x5173df,_0x2672a2['error'][_0x68dd('0x18')]);return _0x2b0b2b(_0x2672a2[_0x68dd('0x15')]['message']);}else{logger[_0x68dd('0x19')](_0x68dd('0x17'),_0x5173df,_0x68dd('0x13'));_0x2b0b2b(_0x2672a2[_0x68dd('0x1a')][_0x68dd('0x18')]);}})[_0x68dd('0x1b')](function(_0x439aa5){logger[_0x68dd('0x15')]('ChatQueue,\x20%s,\x20%s',_0x5173df,_0x439aa5);_0x3e9fc1(_0x439aa5);});});}exports[_0x68dd('0x1c')]=function(_0x30bfd8){var _0x3aec26=this;return new Promise(function(_0x19594f,_0x20aad5){return db['ChatQueue'][_0x68dd('0x1d')]({'raw':_0x30bfd8[_0x68dd('0x1e')]?_0x30bfd8[_0x68dd('0x1e')][_0x68dd('0x1f')]===undefined?!![]:![]:!![],'where':_0x30bfd8[_0x68dd('0x1e')]?_0x30bfd8[_0x68dd('0x1e')]['where']||null:null,'attributes':_0x30bfd8[_0x68dd('0x1e')]?_0x30bfd8['options']['attributes']||null:null,'limit':_0x30bfd8[_0x68dd('0x1e')]?_0x30bfd8[_0x68dd('0x1e')][_0x68dd('0x20')]||null:null,'include':_0x30bfd8[_0x68dd('0x1e')]?_0x30bfd8['options'][_0x68dd('0x21')]?_[_0x68dd('0x22')](_0x30bfd8[_0x68dd('0x1e')]['include'],function(_0x1505d6){return{'model':db[_0x1505d6['model']],'as':_0x1505d6['as'],'attributes':_0x1505d6[_0x68dd('0x23')],'include':_0x1505d6[_0x68dd('0x21')]?_[_0x68dd('0x22')](_0x1505d6[_0x68dd('0x21')],function(_0x3f9e01){return{'model':db[_0x3f9e01['model']],'as':_0x3f9e01['as'],'attributes':_0x3f9e01[_0x68dd('0x23')],'include':_0x3f9e01['include']?_['map'](_0x3f9e01['include'],function(_0x1b75ab){return{'model':db[_0x1b75ab[_0x68dd('0x24')]],'as':_0x1b75ab['as'],'attributes':_0x1b75ab[_0x68dd('0x23')]};}):[]};}):[]};}):[]:[]})[_0x68dd('0x25')](function(_0x1b1299){logger['info'](_0x68dd('0x1c'),_0x30bfd8);logger[_0x68dd('0x11')]('GetChatQueue',_0x30bfd8,JSON[_0x68dd('0x14')](_0x1b1299));_0x19594f(_0x1b1299);})[_0x68dd('0x1b')](function(_0xd64e08){logger[_0x68dd('0x15')](_0x68dd('0x1c'),_0xd64e08[_0x68dd('0x18')],_0x30bfd8);_0x20aad5(_0x3aec26['error'](0x1f4,_0xd64e08[_0x68dd('0x18')]));});});};exports[_0x68dd('0x26')]=function(_0x376e84){var _0x1ea727=this;return new Promise(function(_0x563d33,_0x297563){return db[_0x68dd('0x27')][_0x68dd('0x28')]({'raw':_0x376e84[_0x68dd('0x1e')]?_0x376e84[_0x68dd('0x1e')][_0x68dd('0x1f')]===undefined?!![]:![]:!![],'where':_0x376e84['options']?_0x376e84['options'][_0x68dd('0x29')]||null:null,'attributes':_0x376e84['options']?_0x376e84[_0x68dd('0x1e')][_0x68dd('0x23')]||null:null,'include':_0x376e84[_0x68dd('0x1e')]?_0x376e84[_0x68dd('0x1e')][_0x68dd('0x21')]?_['map'](_0x376e84['options'][_0x68dd('0x21')],function(_0x1e2245){return{'model':db[_0x1e2245[_0x68dd('0x24')]],'as':_0x1e2245['as'],'attributes':_0x1e2245['attributes'],'include':_0x1e2245['include']?_[_0x68dd('0x22')](_0x1e2245[_0x68dd('0x21')],function(_0x2f9854){return{'model':db[_0x2f9854[_0x68dd('0x24')]],'as':_0x2f9854['as'],'attributes':_0x2f9854[_0x68dd('0x23')],'include':_0x2f9854[_0x68dd('0x21')]?_['map'](_0x2f9854[_0x68dd('0x21')],function(_0x264dae){return{'model':db[_0x264dae['model']],'as':_0x264dae['as'],'attributes':_0x264dae[_0x68dd('0x23')]};}):[]};}):[]};}):[]:[]})[_0x68dd('0x25')](function(_0x1a9f77){logger[_0x68dd('0x19')](_0x68dd('0x26'),_0x376e84);logger[_0x68dd('0x11')](_0x68dd('0x26'),_0x376e84,JSON[_0x68dd('0x14')](_0x1a9f77));_0x563d33(_0x1a9f77);})[_0x68dd('0x1b')](function(_0x369af0){logger[_0x68dd('0x15')](_0x68dd('0x26'),_0x369af0['message'],_0x376e84);_0x297563(_0x1ea727['error'](0x1f4,_0x369af0['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 6ce3932..70f07aa 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 _0x72b1=['register','length','./chatQueue.events','remove','update','emit','removeListener'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x72b1,0x16e));var _0x172b=function(_0x4fe957,_0x490d45){_0x4fe957=_0x4fe957-0x0;var _0x3419a0=_0x72b1[_0x4fe957];return _0x3419a0;};'use strict';var ChatQueueEvents=require(_0x172b('0x0'));var events=['save',_0x172b('0x1'),_0x172b('0x2')];function createListener(_0x42b795,_0x18fd16){return function(_0x23bc7a){_0x18fd16[_0x172b('0x3')](_0x42b795,_0x23bc7a);};}function removeListener(_0x2c1d6e,_0x558038){return function(){ChatQueueEvents[_0x172b('0x4')](_0x2c1d6e,_0x558038);};}exports[_0x172b('0x5')]=function(_0x475fd6){for(var _0x222624=0x0,_0x571994=events[_0x172b('0x6')];_0x222624<_0x571994;_0x222624++){var _0x517363=events[_0x222624];var _0x1f98e9=createListener('chatQueue:'+_0x517363,_0x475fd6);ChatQueueEvents['on'](_0x517363,_0x1f98e9);}};
\ No newline at end of file
+var _0x4bc3=['register','chatQueue:','./chatQueue.events','save','update','emit','removeListener'];(function(_0x1a89a1,_0x56d889){var _0x3d5b46=function(_0x56debf){while(--_0x56debf){_0x1a89a1['push'](_0x1a89a1['shift']());}};_0x3d5b46(++_0x56d889);}(_0x4bc3,0x16e));var _0x34bc=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0x4bc3[_0x3070dc];return _0x431489;};'use strict';var ChatQueueEvents=require(_0x34bc('0x0'));var events=[_0x34bc('0x1'),'remove',_0x34bc('0x2')];function createListener(_0x2c0897,_0x5b45c7){return function(_0x178fc0){_0x5b45c7[_0x34bc('0x3')](_0x2c0897,_0x178fc0);};}function removeListener(_0x3ce1c3,_0x2e043e){return function(){ChatQueueEvents[_0x34bc('0x4')](_0x3ce1c3,_0x2e043e);};}exports[_0x34bc('0x5')]=function(_0x2cc9c2){for(var _0x4c63a1=0x0,_0x21451b=events['length'];_0x4c63a1<_0x21451b;_0x4c63a1++){var _0x502087=events[_0x4c63a1];var _0x18a01c=createListener(_0x34bc('0x6')+_0x502087,_0x2cc9c2);ChatQueueEvents['on'](_0x502087,_0x18a01c);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 910bb41..55b2a9c 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 _0x008c=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','show','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','/:id','removeTeams','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x23b83e,_0x372f4b){var _0x19e3bd=function(_0x6b7c5b){while(--_0x6b7c5b){_0x23b83e['push'](_0x23b83e['shift']());}};_0x19e3bd(++_0x372f4b);}(_0x008c,0x188));var _0xc008=function(_0x2b6854,_0xf09496){_0x2b6854=_0x2b6854-0x0;var _0x3a17df=_0x008c[_0x2b6854];return _0x3a17df;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x12')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x15')]);router[_0xc008('0x16')](_0xc008('0x17'),auth[_0xc008('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xc008('0x18')]);router[_0xc008('0x16')]('/:id/users',auth[_0xc008('0xb')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x3e74,0x175));var _0x43e7=function(_0x2fe130,_0x1bf216){_0x2fe130=_0x2fe130-0x0;var _0x46580c=_0x3e74[_0x2fe130];return _0x46580c;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index cc9551f..7506bba 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 _0xd1c5=['sequelize','STRING','DATE','moment'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xd1c5,0x18f));var _0x5d1c=function(_0x37ab60,_0x172f30){_0x37ab60=_0x37ab60-0x0;var _0x332e35=_0xd1c5[_0x37ab60];return _0x332e35;};'use strict';var moment=require(_0x5d1c('0x0'));var Sequelize=require(_0x5d1c('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x5d1c('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x5d1c('0x2')]},'joinAt':{'type':Sequelize[_0x5d1c('0x3')]},'leaveAt':{'type':Sequelize[_0x5d1c('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x5d1c('0x3')]},'reason':{'type':Sequelize[_0x5d1c('0x2')]}};
\ No newline at end of file
+var _0xe8f7=['exports','STRING','DATE','moment'];(function(_0x1bb0be,_0x1de4da){var _0x4f9d06=function(_0x130e2c){while(--_0x130e2c){_0x1bb0be['push'](_0x1bb0be['shift']());}};_0x4f9d06(++_0x1de4da);}(_0xe8f7,0x137));var _0x7e8f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe8f7[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x7e8f('0x0'));var Sequelize=require('sequelize');module[_0x7e8f('0x1')]={'uniqueid':{'type':Sequelize[_0x7e8f('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7e8f('0x2')]},'joinAt':{'type':Sequelize[_0x7e8f('0x3')]},'leaveAt':{'type':Sequelize[_0x7e8f('0x3')]},'acceptAt':{'type':Sequelize[_0x7e8f('0x3')]},'exitAt':{'type':Sequelize[_0x7e8f('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 292b8cb..a87b37d 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 _0x7a12=['create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','set','apply','save','update','destroy','then','end','error','name','send','ChatQueueReport','rawAttributes','fieldName','type','model','query','intersection','fields','attributes','length','hasOwnProperty','offset','order','sort','where','filters','pick','filter','map','merge','options','includeAll','include','findAll','rows','catch','show','keys','find'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7a12,0xe8));var _0x27a1=function(_0x1e8bd0,_0x30bfde){_0x1e8bd0=_0x1e8bd0-0x0;var _0x315809=_0x7a12[_0x1e8bd0];return _0x315809;};'use strict';var emlformat=require(_0x27a1('0x0'));var rimraf=require(_0x27a1('0x1'));var zipdir=require(_0x27a1('0x2'));var jsonpatch=require(_0x27a1('0x3'));var rp=require(_0x27a1('0x4'));var moment=require(_0x27a1('0x5'));var BPromise=require(_0x27a1('0x6'));var Mustache=require(_0x27a1('0x7'));var util=require('util');var path=require(_0x27a1('0x8'));var sox=require(_0x27a1('0x9'));var csv=require(_0x27a1('0xa'));var ejs=require(_0x27a1('0xb'));var fs=require('fs');var fs_extra=require(_0x27a1('0xc'));var _=require(_0x27a1('0xd'));var squel=require('squel');var crypto=require(_0x27a1('0xe'));var jsforce=require(_0x27a1('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x27a1('0xa'));var querystring=require(_0x27a1('0x10'));var Papa=require('papaparse');var Redis=require(_0x27a1('0x11'));var authService=require(_0x27a1('0x12'));var qs=require(_0x27a1('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x27a1('0x14'));var logger=require(_0x27a1('0x15'))(_0x27a1('0x16'));var utils=require(_0x27a1('0x17'));var config=require(_0x27a1('0x18'));var licenseUtil=require(_0x27a1('0x19'));var db=require(_0x27a1('0x1a'))['db'];function respondWithStatusCode(_0x52cf92,_0x11d503){_0x11d503=_0x11d503||0xcc;return function(_0x37aec2){if(_0x37aec2){return _0x52cf92[_0x27a1('0x1b')](_0x11d503);}return _0x52cf92[_0x27a1('0x1c')](_0x11d503)['end']();};}function respondWithResult(_0x303b65,_0x11d840){_0x11d840=_0x11d840||0xc8;return function(_0x4e5cdd){if(_0x4e5cdd){return _0x303b65['status'](_0x11d840)[_0x27a1('0x1d')](_0x4e5cdd);}};}function respondWithFilteredResult(_0x3fc406,_0x4f6871){return function(_0x443cff){if(_0x443cff){var _0x17ebb1=typeof _0x4f6871['offset']===_0x27a1('0x1e')&&typeof _0x4f6871[_0x27a1('0x1f')]===_0x27a1('0x1e');var _0xbd87d1=_0x443cff['count'];var _0x18512a=_0x17ebb1?0x0:_0x4f6871['offset'];var _0x8c969=_0x17ebb1?_0x443cff[_0x27a1('0x20')]:_0x4f6871['offset']+_0x4f6871[_0x27a1('0x1f')];var _0x28a621;if(_0x8c969>=_0xbd87d1){_0x8c969=_0xbd87d1;_0x28a621=0xc8;}else{_0x28a621=0xce;}_0x3fc406[_0x27a1('0x1c')](_0x28a621);return _0x3fc406[_0x27a1('0x21')]('Content-Range',_0x18512a+'-'+_0x8c969+'/'+_0xbd87d1)[_0x27a1('0x1d')](_0x443cff);}return null;};}function patchUpdates(_0x4271e7){return function(_0x38c9ca){try{jsonpatch[_0x27a1('0x22')](_0x38c9ca,_0x4271e7,!![]);}catch(_0x1b6531){return BPromise['reject'](_0x1b6531);}return _0x38c9ca[_0x27a1('0x23')]();};}function saveUpdates(_0xd6cc72,_0x4f11d3){return function(_0x4c02f8){if(_0x4c02f8){return _0x4c02f8[_0x27a1('0x24')](_0xd6cc72)['then'](function(_0x17e881){return _0x17e881;});}return null;};}function removeEntity(_0x2a3b02,_0x21c37e){return function(_0x2a1f12){if(_0x2a1f12){return _0x2a1f12[_0x27a1('0x25')]()[_0x27a1('0x26')](function(){_0x2a3b02['status'](0xcc)[_0x27a1('0x27')]();});}};}function handleEntityNotFound(_0x25307a,_0x5b58a2){return function(_0x348605){if(!_0x348605){_0x25307a['sendStatus'](0x194);}return _0x348605;};}function handleError(_0x1ef90c,_0x5d4b36){_0x5d4b36=_0x5d4b36||0x1f4;return function(_0x19d9b5){logger[_0x27a1('0x28')](_0x19d9b5['stack']);if(_0x19d9b5[_0x27a1('0x29')]){delete _0x19d9b5[_0x27a1('0x29')];}_0x1ef90c[_0x27a1('0x1c')](_0x5d4b36)[_0x27a1('0x2a')](_0x19d9b5);};}exports['index']=function(_0x353b18,_0x4ecc83){var _0x2089aa={},_0x23e8b2={},_0x3f0194={'count':0x0,'rows':[]};var _0x376f32=_['map'](db[_0x27a1('0x2b')][_0x27a1('0x2c')],function(_0x36c597){return{'name':_0x36c597[_0x27a1('0x2d')],'type':_0x36c597[_0x27a1('0x2e')]['key']};});_0x23e8b2[_0x27a1('0x2f')]=_['map'](_0x376f32,_0x27a1('0x29'));_0x23e8b2[_0x27a1('0x30')]=_['keys'](_0x353b18[_0x27a1('0x30')]);_0x23e8b2['filters']=_[_0x27a1('0x31')](_0x23e8b2[_0x27a1('0x2f')],_0x23e8b2[_0x27a1('0x30')]);_0x2089aa['attributes']=_['intersection'](_0x23e8b2[_0x27a1('0x2f')],qs['fields'](_0x353b18['query'][_0x27a1('0x32')]));_0x2089aa[_0x27a1('0x33')]=_0x2089aa[_0x27a1('0x33')][_0x27a1('0x34')]?_0x2089aa[_0x27a1('0x33')]:_0x23e8b2[_0x27a1('0x2f')];if(!_0x353b18[_0x27a1('0x30')][_0x27a1('0x35')]('nolimit')){_0x2089aa['limit']=qs['limit'](_0x353b18[_0x27a1('0x30')][_0x27a1('0x1f')]);_0x2089aa[_0x27a1('0x36')]=qs[_0x27a1('0x36')](_0x353b18['query']['offset']);}_0x2089aa[_0x27a1('0x37')]=qs[_0x27a1('0x38')](_0x353b18[_0x27a1('0x30')][_0x27a1('0x38')]);_0x2089aa[_0x27a1('0x39')]=qs[_0x27a1('0x3a')](_[_0x27a1('0x3b')](_0x353b18['query'],_0x23e8b2['filters']),_0x376f32);if(_0x353b18[_0x27a1('0x30')][_0x27a1('0x3c')]){_0x2089aa[_0x27a1('0x39')]=_['merge'](_0x2089aa[_0x27a1('0x39')],{'$or':_[_0x27a1('0x3d')](_0x376f32,function(_0x1193a6){if(_0x1193a6[_0x27a1('0x2e')]!=='VIRTUAL'){var _0x146352={};_0x146352[_0x1193a6[_0x27a1('0x29')]]={'$like':'%'+_0x353b18[_0x27a1('0x30')][_0x27a1('0x3c')]+'%'};return _0x146352;}})});}_0x2089aa=_[_0x27a1('0x3e')]({},_0x2089aa,_0x353b18[_0x27a1('0x3f')]);var _0x2a5bd1={'where':_0x2089aa[_0x27a1('0x39')]};return db[_0x27a1('0x2b')][_0x27a1('0x20')](_0x2a5bd1)[_0x27a1('0x26')](function(_0x1b9e37){_0x3f0194['count']=_0x1b9e37;if(_0x353b18[_0x27a1('0x30')][_0x27a1('0x40')]){_0x2089aa[_0x27a1('0x41')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x27a1('0x42')](_0x2089aa);})['then'](function(_0x1e3922){_0x3f0194[_0x27a1('0x43')]=_0x1e3922;return _0x3f0194;})['then'](respondWithFilteredResult(_0x4ecc83,_0x2089aa))[_0x27a1('0x44')](handleError(_0x4ecc83,null));};exports[_0x27a1('0x45')]=function(_0x496edf,_0x4ccc9c){var _0xe4e38d={'raw':!![],'where':{'id':_0x496edf['params']['id']}},_0x56553b={};_0x56553b[_0x27a1('0x2f')]=_[_0x27a1('0x46')](db[_0x27a1('0x2b')][_0x27a1('0x2c')]);_0x56553b[_0x27a1('0x30')]=_['keys'](_0x496edf['query']);_0x56553b[_0x27a1('0x3a')]=_[_0x27a1('0x31')](_0x56553b[_0x27a1('0x2f')],_0x56553b[_0x27a1('0x30')]);_0xe4e38d[_0x27a1('0x33')]=_[_0x27a1('0x31')](_0x56553b[_0x27a1('0x2f')],qs[_0x27a1('0x32')](_0x496edf[_0x27a1('0x30')][_0x27a1('0x32')]));_0xe4e38d[_0x27a1('0x33')]=_0xe4e38d[_0x27a1('0x33')]['length']?_0xe4e38d['attributes']:_0x56553b[_0x27a1('0x2f')];if(_0x496edf[_0x27a1('0x30')]['includeAll']){_0xe4e38d[_0x27a1('0x41')]=[{'all':!![]}];}_0xe4e38d=_[_0x27a1('0x3e')]({},_0xe4e38d,_0x496edf['options']);return db[_0x27a1('0x2b')][_0x27a1('0x47')](_0xe4e38d)[_0x27a1('0x26')](handleEntityNotFound(_0x4ccc9c,null))['then'](respondWithResult(_0x4ccc9c,null))[_0x27a1('0x44')](handleError(_0x4ccc9c,null));};exports[_0x27a1('0x48')]=function(_0x2fac06,_0x269c33){return db[_0x27a1('0x2b')]['create'](_0x2fac06[_0x27a1('0x49')],{})[_0x27a1('0x26')](respondWithResult(_0x269c33,0xc9))['catch'](handleError(_0x269c33,null));};exports[_0x27a1('0x24')]=function(_0x287250,_0x52c916){if(_0x287250[_0x27a1('0x49')]['id']){delete _0x287250[_0x27a1('0x49')]['id'];}return db[_0x27a1('0x2b')][_0x27a1('0x47')]({'where':{'id':_0x287250[_0x27a1('0x4a')]['id']}})['then'](handleEntityNotFound(_0x52c916,null))[_0x27a1('0x26')](saveUpdates(_0x287250['body'],null))[_0x27a1('0x26')](respondWithResult(_0x52c916,null))[_0x27a1('0x44')](handleError(_0x52c916,null));};exports['destroy']=function(_0x22eab2,_0x288bd0){return db[_0x27a1('0x2b')]['find']({'where':{'id':_0x22eab2[_0x27a1('0x4a')]['id']}})[_0x27a1('0x26')](handleEntityNotFound(_0x288bd0,null))[_0x27a1('0x26')](removeEntity(_0x288bd0,null))[_0x27a1('0x44')](handleError(_0x288bd0,null));};exports[_0x27a1('0x4b')]=function(_0x46a12d,_0x5a832a){return db[_0x27a1('0x2b')][_0x27a1('0x4b')]()['then'](respondWithResult(_0x5a832a,null))[_0x27a1('0x44')](handleError(_0x5a832a,null));};
\ No newline at end of file
+var _0x0755=['util','path','to-csv','ejs','fs-extra','lodash','desk.js','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','name','index','map','ChatQueueReport','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','length','sort','where','filters','pick','filter','merge','findAll','show','params','includeAll','options','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x2df724,_0x411382){var _0x1b2504=function(_0x1d3cd1){while(--_0x1d3cd1){_0x2df724['push'](_0x2df724['shift']());}};_0x1b2504(++_0x411382);}(_0x0755,0x7c));var _0x5075=function(_0x35027c,_0x4af623){_0x35027c=_0x35027c-0x0;var _0x4bba7d=_0x0755[_0x35027c];return _0x4bba7d;};'use strict';var emlformat=require(_0x5075('0x0'));var rimraf=require(_0x5075('0x1'));var zipdir=require(_0x5075('0x2'));var jsonpatch=require(_0x5075('0x3'));var rp=require(_0x5075('0x4'));var moment=require(_0x5075('0x5'));var BPromise=require(_0x5075('0x6'));var Mustache=require(_0x5075('0x7'));var util=require(_0x5075('0x8'));var path=require(_0x5075('0x9'));var sox=require('sox');var csv=require(_0x5075('0xa'));var ejs=require(_0x5075('0xb'));var fs=require('fs');var fs_extra=require(_0x5075('0xc'));var _=require(_0x5075('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5075('0xe'));var toCsv=require(_0x5075('0xa'));var querystring=require('querystring');var Papa=require(_0x5075('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5075('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5075('0x11'))(_0x5075('0x12'));var utils=require(_0x5075('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x5075('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11c5e3,_0x1a131e){_0x1a131e=_0x1a131e||0xcc;return function(_0x413cec){if(_0x413cec){return _0x11c5e3[_0x5075('0x15')](_0x1a131e);}return _0x11c5e3[_0x5075('0x16')](_0x1a131e)[_0x5075('0x17')]();};}function respondWithResult(_0x92710a,_0x32b1a1){_0x32b1a1=_0x32b1a1||0xc8;return function(_0x339420){if(_0x339420){return _0x92710a[_0x5075('0x16')](_0x32b1a1)[_0x5075('0x18')](_0x339420);}};}function respondWithFilteredResult(_0x13e267,_0x4235cd){return function(_0x49ff22){if(_0x49ff22){var _0x128a1b=typeof _0x4235cd[_0x5075('0x19')]===_0x5075('0x1a')&&typeof _0x4235cd[_0x5075('0x1b')]===_0x5075('0x1a');var _0x57fedb=_0x49ff22[_0x5075('0x1c')];var _0xc8b69a=_0x128a1b?0x0:_0x4235cd['offset'];var _0x2159a8=_0x128a1b?_0x49ff22[_0x5075('0x1c')]:_0x4235cd[_0x5075('0x19')]+_0x4235cd[_0x5075('0x1b')];var _0x53232c;if(_0x2159a8>=_0x57fedb){_0x2159a8=_0x57fedb;_0x53232c=0xc8;}else{_0x53232c=0xce;}_0x13e267[_0x5075('0x16')](_0x53232c);return _0x13e267['set'](_0x5075('0x1d'),_0xc8b69a+'-'+_0x2159a8+'/'+_0x57fedb)['json'](_0x49ff22);}return null;};}function patchUpdates(_0x17382e){return function(_0x545364){try{jsonpatch[_0x5075('0x1e')](_0x545364,_0x17382e,!![]);}catch(_0x4c65c7){return BPromise[_0x5075('0x1f')](_0x4c65c7);}return _0x545364[_0x5075('0x20')]();};}function saveUpdates(_0x5ea539,_0x530244){return function(_0x510d4e){if(_0x510d4e){return _0x510d4e[_0x5075('0x21')](_0x5ea539)[_0x5075('0x22')](function(_0xd48fad){return _0xd48fad;});}return null;};}function removeEntity(_0x396c08,_0x1d7758){return function(_0x4e2c16){if(_0x4e2c16){return _0x4e2c16[_0x5075('0x23')]()[_0x5075('0x22')](function(){_0x396c08[_0x5075('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f16cc,_0x212438){return function(_0x57fcb5){if(!_0x57fcb5){_0x1f16cc[_0x5075('0x15')](0x194);}return _0x57fcb5;};}function handleError(_0x3b178d,_0x1340ea){_0x1340ea=_0x1340ea||0x1f4;return function(_0x38a4ea){logger['error'](_0x38a4ea['stack']);if(_0x38a4ea['name']){delete _0x38a4ea[_0x5075('0x24')];}_0x3b178d[_0x5075('0x16')](_0x1340ea)['send'](_0x38a4ea);};}exports[_0x5075('0x25')]=function(_0x36dbf7,_0x444c06){var _0x4efb14={},_0x264777={},_0x514349={'count':0x0,'rows':[]};var _0x5d3a5c=_[_0x5075('0x26')](db[_0x5075('0x27')][_0x5075('0x28')],function(_0x1102cc){return{'name':_0x1102cc['fieldName'],'type':_0x1102cc[_0x5075('0x29')][_0x5075('0x2a')]};});_0x264777[_0x5075('0x2b')]=_['map'](_0x5d3a5c,_0x5075('0x24'));_0x264777[_0x5075('0x2c')]=_[_0x5075('0x2d')](_0x36dbf7[_0x5075('0x2c')]);_0x264777['filters']=_[_0x5075('0x2e')](_0x264777[_0x5075('0x2b')],_0x264777[_0x5075('0x2c')]);_0x4efb14['attributes']=_[_0x5075('0x2e')](_0x264777[_0x5075('0x2b')],qs[_0x5075('0x2f')](_0x36dbf7[_0x5075('0x2c')][_0x5075('0x2f')]));_0x4efb14['attributes']=_0x4efb14[_0x5075('0x30')][_0x5075('0x31')]?_0x4efb14['attributes']:_0x264777[_0x5075('0x2b')];if(!_0x36dbf7['query']['hasOwnProperty']('nolimit')){_0x4efb14[_0x5075('0x1b')]=qs[_0x5075('0x1b')](_0x36dbf7[_0x5075('0x2c')]['limit']);_0x4efb14[_0x5075('0x19')]=qs['offset'](_0x36dbf7['query'][_0x5075('0x19')]);}_0x4efb14['order']=qs[_0x5075('0x32')](_0x36dbf7[_0x5075('0x2c')]['sort']);_0x4efb14[_0x5075('0x33')]=qs[_0x5075('0x34')](_[_0x5075('0x35')](_0x36dbf7['query'],_0x264777[_0x5075('0x34')]),_0x5d3a5c);if(_0x36dbf7[_0x5075('0x2c')][_0x5075('0x36')]){_0x4efb14[_0x5075('0x33')]=_[_0x5075('0x37')](_0x4efb14[_0x5075('0x33')],{'$or':_[_0x5075('0x26')](_0x5d3a5c,function(_0x1f230a){if(_0x1f230a[_0x5075('0x29')]!=='VIRTUAL'){var _0x4c9568={};_0x4c9568[_0x1f230a[_0x5075('0x24')]]={'$like':'%'+_0x36dbf7[_0x5075('0x2c')][_0x5075('0x36')]+'%'};return _0x4c9568;}})});}_0x4efb14=_[_0x5075('0x37')]({},_0x4efb14,_0x36dbf7['options']);var _0x63b935={'where':_0x4efb14[_0x5075('0x33')]};return db[_0x5075('0x27')][_0x5075('0x1c')](_0x63b935)[_0x5075('0x22')](function(_0xbb29e8){_0x514349[_0x5075('0x1c')]=_0xbb29e8;if(_0x36dbf7['query']['includeAll']){_0x4efb14['include']=[{'all':!![]}];}return db['ChatQueueReport'][_0x5075('0x38')](_0x4efb14);})[_0x5075('0x22')](function(_0x12f169){_0x514349['rows']=_0x12f169;return _0x514349;})[_0x5075('0x22')](respondWithFilteredResult(_0x444c06,_0x4efb14))['catch'](handleError(_0x444c06,null));};exports[_0x5075('0x39')]=function(_0x1e5a34,_0x1f9165){var _0x2afa26={'raw':!![],'where':{'id':_0x1e5a34[_0x5075('0x3a')]['id']}},_0x42d4b4={};_0x42d4b4['model']=_[_0x5075('0x2d')](db[_0x5075('0x27')][_0x5075('0x28')]);_0x42d4b4[_0x5075('0x2c')]=_[_0x5075('0x2d')](_0x1e5a34['query']);_0x42d4b4[_0x5075('0x34')]=_[_0x5075('0x2e')](_0x42d4b4[_0x5075('0x2b')],_0x42d4b4['query']);_0x2afa26[_0x5075('0x30')]=_[_0x5075('0x2e')](_0x42d4b4[_0x5075('0x2b')],qs[_0x5075('0x2f')](_0x1e5a34[_0x5075('0x2c')][_0x5075('0x2f')]));_0x2afa26[_0x5075('0x30')]=_0x2afa26[_0x5075('0x30')][_0x5075('0x31')]?_0x2afa26[_0x5075('0x30')]:_0x42d4b4[_0x5075('0x2b')];if(_0x1e5a34[_0x5075('0x2c')][_0x5075('0x3b')]){_0x2afa26['include']=[{'all':!![]}];}_0x2afa26=_['merge']({},_0x2afa26,_0x1e5a34[_0x5075('0x3c')]);return db['ChatQueueReport']['find'](_0x2afa26)[_0x5075('0x22')](handleEntityNotFound(_0x1f9165,null))[_0x5075('0x22')](respondWithResult(_0x1f9165,null))[_0x5075('0x3d')](handleError(_0x1f9165,null));};exports['create']=function(_0x49b9a0,_0x35f55d){return db['ChatQueueReport'][_0x5075('0x3e')](_0x49b9a0['body'],{})['then'](respondWithResult(_0x35f55d,0xc9))[_0x5075('0x3d')](handleError(_0x35f55d,null));};exports[_0x5075('0x21')]=function(_0x137e67,_0x3cbcf5){if(_0x137e67['body']['id']){delete _0x137e67[_0x5075('0x3f')]['id'];}return db[_0x5075('0x27')][_0x5075('0x40')]({'where':{'id':_0x137e67[_0x5075('0x3a')]['id']}})[_0x5075('0x22')](handleEntityNotFound(_0x3cbcf5,null))[_0x5075('0x22')](saveUpdates(_0x137e67[_0x5075('0x3f')],null))['then'](respondWithResult(_0x3cbcf5,null))[_0x5075('0x3d')](handleError(_0x3cbcf5,null));};exports['destroy']=function(_0x4d386c,_0x4113e7){return db['ChatQueueReport']['find']({'where':{'id':_0x4d386c['params']['id']}})['then'](handleEntityNotFound(_0x4113e7,null))[_0x5075('0x22')](removeEntity(_0x4113e7,null))[_0x5075('0x3d')](handleError(_0x4113e7,null));};exports[_0x5075('0x41')]=function(_0x207329,_0x12c3a5){return db[_0x5075('0x27')]['describe']()[_0x5075('0x22')](respondWithResult(_0x12c3a5,null))[_0x5075('0x3d')](handleError(_0x12c3a5,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index c2ecf23..a138977 100644
--- a/server/api/chatQueueReport/chatQueueReport.model.js
+++ b/server/api/chatQueueReport/chatQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x2d2bcb,_0x3051fc){var _0x303f0f=function(_0x3fd68f){while(--_0x3fd68f){_0x2d2bcb['push'](_0x2d2bcb['shift']());}};_0x303f0f(++_0x3051fc);}(_0xe706,0xa3));var _0x6e70=function(_0x5dc927,_0x49f4a1){_0x5dc927=_0x5dc927-0x0;var _0x416440=_0xe706[_0x5dc927];return _0x416440;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xe3e397,_0x2b8583){var _0x35646b=function(_0x4491e9){while(--_0x4491e9){_0xe3e397['push'](_0xe3e397['shift']());}};_0x35646b(++_0x2b8583);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index c32f6bd..a8aca8b 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 _0x6b20=['util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','ChatQueueReport,\x20%s,\x20%s','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','CreateChatQueueReport','ChatQueueReport','create','options','raw','then','stringify','catch','UpdateChatQueueReport','update','body','where','attributes','limit','debug','lodash'];(function(_0x1b49e3,_0x4a46a4){var _0x13d36f=function(_0x3b0ae7){while(--_0x3b0ae7){_0x1b49e3['push'](_0x1b49e3['shift']());}};_0x13d36f(++_0x4a46a4);}(_0x6b20,0xd1));var _0x06b2=function(_0x156550,_0xade448){_0x156550=_0x156550-0x0;var _0x185c40=_0x6b20[_0x156550];return _0x185c40;};'use strict';var _=require(_0x06b2('0x0'));var util=require(_0x06b2('0x1'));var moment=require('moment');var BPromise=require(_0x06b2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x06b2('0x3'));var db=require(_0x06b2('0x4'))['db'];var utils=require(_0x06b2('0x5'));var logger=require('../../config/logger')(_0x06b2('0x6'));var config=require(_0x06b2('0x7'));var jayson=require(_0x06b2('0x8'));var client=jayson[_0x06b2('0x9')][_0x06b2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37b825,_0x26a325,_0x4e6d3b){return new BPromise(function(_0x21cd31,_0x1828e4){return client[_0x06b2('0xb')](_0x37b825,_0x4e6d3b)['then'](function(_0x37ace0){logger['info'](_0x06b2('0xc'),_0x26a325,'request\x20sent');logger['debug'](_0x06b2('0xd'),_0x26a325,_0x06b2('0xe'),JSON['stringify'](_0x37ace0));if(_0x37ace0[_0x06b2('0xf')]){if(_0x37ace0[_0x06b2('0xf')][_0x06b2('0x10')]===0x1f4){logger[_0x06b2('0xf')](_0x06b2('0xc'),_0x26a325,_0x37ace0[_0x06b2('0xf')][_0x06b2('0x11')]);return _0x1828e4(_0x37ace0[_0x06b2('0xf')][_0x06b2('0x11')]);}logger[_0x06b2('0xf')](_0x06b2('0xc'),_0x26a325,_0x37ace0[_0x06b2('0xf')][_0x06b2('0x11')]);return _0x21cd31(_0x37ace0['error'][_0x06b2('0x11')]);}else{logger[_0x06b2('0x12')](_0x06b2('0xc'),_0x26a325,_0x06b2('0xe'));_0x21cd31(_0x37ace0[_0x06b2('0x13')][_0x06b2('0x11')]);}})['catch'](function(_0x17e69b){logger[_0x06b2('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x26a325,_0x17e69b);_0x1828e4(_0x17e69b);});});}exports[_0x06b2('0x14')]=function(_0x594b48){var _0x4c9cae=this;return new Promise(function(_0x192270,_0x1b4ab0){return db[_0x06b2('0x15')][_0x06b2('0x16')](_0x594b48['body'],{'raw':_0x594b48[_0x06b2('0x17')]?_0x594b48[_0x06b2('0x17')][_0x06b2('0x18')]===undefined?!![]:![]:!![]})[_0x06b2('0x19')](function(_0xe28985){logger[_0x06b2('0x12')](_0x06b2('0x14'),_0x594b48);logger['debug'](_0x06b2('0x14'),_0x594b48,JSON[_0x06b2('0x1a')](_0xe28985));_0x192270(_0xe28985);})[_0x06b2('0x1b')](function(_0x208384){logger['error']('CreateChatQueueReport',_0x208384[_0x06b2('0x11')],_0x594b48);_0x1b4ab0(_0x4c9cae[_0x06b2('0xf')](0x1f4,_0x208384['message']));});});};exports[_0x06b2('0x1c')]=function(_0x5e40f2){var _0x3d58c6=this;return new Promise(function(_0x38987b,_0x2a0645){return db['ChatQueueReport'][_0x06b2('0x1d')](_0x5e40f2[_0x06b2('0x1e')],{'raw':_0x5e40f2[_0x06b2('0x17')]?_0x5e40f2[_0x06b2('0x17')][_0x06b2('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e40f2['options']?_0x5e40f2[_0x06b2('0x17')][_0x06b2('0x1f')]||null:null,'attributes':_0x5e40f2[_0x06b2('0x17')]?_0x5e40f2[_0x06b2('0x17')][_0x06b2('0x20')]||null:null,'limit':_0x5e40f2[_0x06b2('0x17')]?_0x5e40f2['options'][_0x06b2('0x21')]||null:null})[_0x06b2('0x19')](function(_0x2720fa){logger[_0x06b2('0x12')](_0x06b2('0x1c'),_0x5e40f2);logger[_0x06b2('0x22')](_0x06b2('0x1c'),_0x5e40f2,JSON['stringify'](_0x2720fa));_0x38987b(_0x2720fa);})[_0x06b2('0x1b')](function(_0x32eeea){logger[_0x06b2('0xf')](_0x06b2('0x1c'),_0x32eeea[_0x06b2('0x11')],_0x5e40f2);_0x2a0645(_0x3d58c6[_0x06b2('0xf')](0x1f4,_0x32eeea[_0x06b2('0x11')]));});});};
\ No newline at end of file
+var _0xd64e=['attributes','limit','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','ChatQueueReport,\x20%s,\x20%s','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','debug','stringify','UpdateChatQueueReport','where'];(function(_0x220de4,_0x43fd18){var _0x4a837d=function(_0x1465f6){while(--_0x1465f6){_0x220de4['push'](_0x220de4['shift']());}};_0x4a837d(++_0x43fd18);}(_0xd64e,0x102));var _0xed64=function(_0x40e3d5,_0x4d1779){_0x40e3d5=_0x40e3d5-0x0;var _0x3f2e92=_0xd64e[_0x40e3d5];return _0x3f2e92;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xed64('0x0'));var BPromise=require(_0xed64('0x1'));var rs=require(_0xed64('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xed64('0x3'))['db'];var utils=require(_0xed64('0x4'));var logger=require(_0xed64('0x5'))(_0xed64('0x6'));var config=require(_0xed64('0x7'));var jayson=require(_0xed64('0x8'));var client=jayson['client'][_0xed64('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x296daf,_0x192750,_0x14d3e8){return new BPromise(function(_0x5783e5,_0x2d99d7){return client['request'](_0x296daf,_0x14d3e8)[_0xed64('0xa')](function(_0xf20332){logger[_0xed64('0xb')]('ChatQueueReport,\x20%s,\x20%s',_0x192750,_0xed64('0xc'));logger['debug'](_0xed64('0xd'),_0x192750,_0xed64('0xc'),JSON['stringify'](_0xf20332));if(_0xf20332[_0xed64('0xe')]){if(_0xf20332[_0xed64('0xe')][_0xed64('0xf')]===0x1f4){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x192750,_0xf20332[_0xed64('0xe')][_0xed64('0x10')]);return _0x2d99d7(_0xf20332[_0xed64('0xe')][_0xed64('0x10')]);}logger[_0xed64('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x192750,_0xf20332[_0xed64('0xe')]['message']);return _0x5783e5(_0xf20332['error'][_0xed64('0x10')]);}else{logger[_0xed64('0xb')](_0xed64('0x11'),_0x192750,_0xed64('0xc'));_0x5783e5(_0xf20332[_0xed64('0x12')]['message']);}})[_0xed64('0x13')](function(_0x22ef05){logger[_0xed64('0xe')](_0xed64('0x11'),_0x192750,_0x22ef05);_0x2d99d7(_0x22ef05);});});}exports[_0xed64('0x14')]=function(_0x4a340e){var _0x2c7ef7=this;return new Promise(function(_0x2b9b6c,_0x41a871){return db[_0xed64('0x15')][_0xed64('0x16')](_0x4a340e[_0xed64('0x17')],{'raw':_0x4a340e[_0xed64('0x18')]?_0x4a340e[_0xed64('0x18')][_0xed64('0x19')]===undefined?!![]:![]:!![]})[_0xed64('0xa')](function(_0x228c25){logger[_0xed64('0xb')](_0xed64('0x14'),_0x4a340e);logger[_0xed64('0x1a')](_0xed64('0x14'),_0x4a340e,JSON[_0xed64('0x1b')](_0x228c25));_0x2b9b6c(_0x228c25);})[_0xed64('0x13')](function(_0x435e44){logger[_0xed64('0xe')]('CreateChatQueueReport',_0x435e44[_0xed64('0x10')],_0x4a340e);_0x41a871(_0x2c7ef7[_0xed64('0xe')](0x1f4,_0x435e44[_0xed64('0x10')]));});});};exports[_0xed64('0x1c')]=function(_0x5be016){var _0x191309=this;return new Promise(function(_0x3298a2,_0x413dfc){return db['ChatQueueReport']['update'](_0x5be016['body'],{'raw':_0x5be016[_0xed64('0x18')]?_0x5be016[_0xed64('0x18')][_0xed64('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5be016['options']?_0x5be016[_0xed64('0x18')][_0xed64('0x1d')]||null:null,'attributes':_0x5be016[_0xed64('0x18')]?_0x5be016['options'][_0xed64('0x1e')]||null:null,'limit':_0x5be016[_0xed64('0x18')]?_0x5be016[_0xed64('0x18')][_0xed64('0x1f')]||null:null})[_0xed64('0xa')](function(_0x50df6b){logger[_0xed64('0xb')](_0xed64('0x1c'),_0x5be016);logger[_0xed64('0x1a')](_0xed64('0x1c'),_0x5be016,JSON[_0xed64('0x1b')](_0x50df6b));_0x3298a2(_0x50df6b);})[_0xed64('0x13')](function(_0x4e5472){logger[_0xed64('0xe')](_0xed64('0x1c'),_0x4e5472[_0xed64('0x10')],_0x5be016);_0x413dfc(_0x191309[_0xed64('0xe')](0x1f4,_0x4e5472[_0xed64('0x10')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 700fe3d..fb1cc8a 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 _0x5b29=['post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','/describe','isAuthenticated','describe','/:id','show'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x5b29,0x74));var _0x95b2=function(_0x398ade,_0x16dab1){_0x398ade=_0x398ade-0x0;var _0x3cba29=_0x5b29[_0x398ade];return _0x3cba29;};'use strict';var multer=require(_0x95b2('0x0'));var util=require(_0x95b2('0x1'));var path=require(_0x95b2('0x2'));var timeout=require(_0x95b2('0x3'));var express=require('express');var router=express[_0x95b2('0x4')]();var fs_extra=require(_0x95b2('0x5'));var auth=require(_0x95b2('0x6'));var interaction=require(_0x95b2('0x7'));var config=require(_0x95b2('0x8'));var controller=require(_0x95b2('0x9'));router[_0x95b2('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x95b2('0xa')](_0x95b2('0xb'),auth[_0x95b2('0xc')](),controller[_0x95b2('0xd')]);router[_0x95b2('0xa')](_0x95b2('0xe'),auth['isAuthenticated'](),controller[_0x95b2('0xf')]);router[_0x95b2('0x10')]('/',auth[_0x95b2('0xc')](),controller[_0x95b2('0x11')]);router[_0x95b2('0x12')]('/:id',auth[_0x95b2('0xc')](),controller['update']);router[_0x95b2('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x95b2('0x14')]);module[_0x95b2('0x15')]=router;
\ No newline at end of file
+var _0xc4d9=['show','post','put','update','delete','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','describe','/:id'];(function(_0xa1b262,_0x1688f1){var _0x4230f4=function(_0x181c8c){while(--_0x181c8c){_0xa1b262['push'](_0xa1b262['shift']());}};_0x4230f4(++_0x1688f1);}(_0xc4d9,0x105));var _0x9c4d=function(_0x26b433,_0x23abbd){_0x26b433=_0x26b433-0x0;var _0x25a8cc=_0xc4d9[_0x26b433];return _0x25a8cc;};'use strict';var multer=require('multer');var util=require(_0x9c4d('0x0'));var path=require('path');var timeout=require(_0x9c4d('0x1'));var express=require(_0x9c4d('0x2'));var router=express[_0x9c4d('0x3')]();var fs_extra=require(_0x9c4d('0x4'));var auth=require(_0x9c4d('0x5'));var interaction=require(_0x9c4d('0x6'));var config=require('../../config/environment');var controller=require('./chatQueueReport.controller');router[_0x9c4d('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9c4d('0x7')]('/describe',auth[_0x9c4d('0x8')](),controller[_0x9c4d('0x9')]);router[_0x9c4d('0x7')](_0x9c4d('0xa'),auth['isAuthenticated'](),controller[_0x9c4d('0xb')]);router[_0x9c4d('0xc')]('/',auth[_0x9c4d('0x8')](),controller['create']);router[_0x9c4d('0xd')](_0x9c4d('0xa'),auth[_0x9c4d('0x8')](),controller[_0x9c4d('0xe')]);router[_0x9c4d('0xf')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x9c4d('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 94d5140..46e960c 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 _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x53fe97,_0x544271){var _0x5c49a2=function(_0x3fa2b4){while(--_0x3fa2b4){_0x53fe97['push'](_0x53fe97['shift']());}};_0x5c49a2(++_0x544271);}(_0x9c44,0x178));var _0x49c4=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x9c44[_0x273c39];return _0x46d6b5;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}};
\ No newline at end of file
+var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x500785,_0x15e5ff){var _0x1f8bcc=function(_0x406983){while(--_0x406983){_0x500785['push'](_0x500785['shift']());}};_0x1f8bcc(++_0x15e5ff);}(_0xb43b,0x1b2));var _0xbb43=function(_0x1cd7d1,_0x528bf8){_0x1cd7d1=_0x1cd7d1-0x0;var _0x522682=_0xb43b[_0x1cd7d1];return _0x522682;};'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 8f062d1..88e184f 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 _0x33a2=['name','send','ChatTransferReport','rawAttributes','type','key','model','query','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','filters','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end','json','offset','limit','undefined','count','status','set','Content-Range','reject','update','then','error','stack'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x33a2,0xff));var _0x233a=function(_0x2d3d91,_0x58b9bc){_0x2d3d91=_0x2d3d91-0x0;var _0x3624d8=_0x33a2[_0x2d3d91];return _0x3624d8;};'use strict';var emlformat=require(_0x233a('0x0'));var rimraf=require(_0x233a('0x1'));var zipdir=require(_0x233a('0x2'));var jsonpatch=require(_0x233a('0x3'));var rp=require(_0x233a('0x4'));var moment=require(_0x233a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x233a('0x6'));var util=require('util');var path=require('path');var sox=require(_0x233a('0x7'));var csv=require(_0x233a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x233a('0x9'));var _=require(_0x233a('0xa'));var squel=require('squel');var crypto=require(_0x233a('0xb'));var jsforce=require(_0x233a('0xc'));var deskjs=require(_0x233a('0xd'));var toCsv=require(_0x233a('0x8'));var querystring=require('querystring');var Papa=require(_0x233a('0xe'));var Redis=require('ioredis');var authService=require(_0x233a('0xf'));var qs=require(_0x233a('0x10'));var as=require(_0x233a('0x11'));var hardwareService=require(_0x233a('0x12'));var logger=require(_0x233a('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x233a('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x233a('0x15'))['db'];function respondWithStatusCode(_0x3c562f,_0x26084c){_0x26084c=_0x26084c||0xcc;return function(_0x1bfa7b){if(_0x1bfa7b){return _0x3c562f[_0x233a('0x16')](_0x26084c);}return _0x3c562f['status'](_0x26084c)[_0x233a('0x17')]();};}function respondWithResult(_0x11f433,_0x151252){_0x151252=_0x151252||0xc8;return function(_0x4e4b1c){if(_0x4e4b1c){return _0x11f433['status'](_0x151252)[_0x233a('0x18')](_0x4e4b1c);}};}function respondWithFilteredResult(_0x324657,_0x1fa280){return function(_0x1baea8){if(_0x1baea8){var _0x277118=typeof _0x1fa280[_0x233a('0x19')]==='undefined'&&typeof _0x1fa280[_0x233a('0x1a')]===_0x233a('0x1b');var _0xaf8cbd=_0x1baea8[_0x233a('0x1c')];var _0x53492d=_0x277118?0x0:_0x1fa280['offset'];var _0x29e54e=_0x277118?_0x1baea8['count']:_0x1fa280[_0x233a('0x19')]+_0x1fa280[_0x233a('0x1a')];var _0x51ccac;if(_0x29e54e>=_0xaf8cbd){_0x29e54e=_0xaf8cbd;_0x51ccac=0xc8;}else{_0x51ccac=0xce;}_0x324657[_0x233a('0x1d')](_0x51ccac);return _0x324657[_0x233a('0x1e')](_0x233a('0x1f'),_0x53492d+'-'+_0x29e54e+'/'+_0xaf8cbd)[_0x233a('0x18')](_0x1baea8);}return null;};}function patchUpdates(_0x200954){return function(_0x2d1e06){try{jsonpatch['apply'](_0x2d1e06,_0x200954,!![]);}catch(_0x19c43c){return BPromise[_0x233a('0x20')](_0x19c43c);}return _0x2d1e06['save']();};}function saveUpdates(_0x149b3b,_0x1303f2){return function(_0x197844){if(_0x197844){return _0x197844[_0x233a('0x21')](_0x149b3b)[_0x233a('0x22')](function(_0x27e3d6){return _0x27e3d6;});}return null;};}function removeEntity(_0x2b9403,_0x5f59bd){return function(_0x29448f){if(_0x29448f){return _0x29448f['destroy']()['then'](function(){_0x2b9403[_0x233a('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e76bf,_0x16ffd5){return function(_0x57541d){if(!_0x57541d){_0x4e76bf[_0x233a('0x16')](0x194);}return _0x57541d;};}function handleError(_0x37aeb3,_0xc571b6){_0xc571b6=_0xc571b6||0x1f4;return function(_0x5eb6a6){logger[_0x233a('0x23')](_0x5eb6a6[_0x233a('0x24')]);if(_0x5eb6a6['name']){delete _0x5eb6a6[_0x233a('0x25')];}_0x37aeb3['status'](_0xc571b6)[_0x233a('0x26')](_0x5eb6a6);};}exports['index']=function(_0x3856fd,_0x291769){var _0x5ebb10={},_0x33130a={},_0x311047={'count':0x0,'rows':[]};var _0x330829=_['map'](db[_0x233a('0x27')][_0x233a('0x28')],function(_0x201fc1){return{'name':_0x201fc1['fieldName'],'type':_0x201fc1[_0x233a('0x29')][_0x233a('0x2a')]};});_0x33130a[_0x233a('0x2b')]=_['map'](_0x330829,_0x233a('0x25'));_0x33130a['query']=_['keys'](_0x3856fd[_0x233a('0x2c')]);_0x33130a['filters']=_[_0x233a('0x2d')](_0x33130a[_0x233a('0x2b')],_0x33130a[_0x233a('0x2c')]);_0x5ebb10[_0x233a('0x2e')]=_[_0x233a('0x2d')](_0x33130a[_0x233a('0x2b')],qs[_0x233a('0x2f')](_0x3856fd[_0x233a('0x2c')][_0x233a('0x2f')]));_0x5ebb10[_0x233a('0x2e')]=_0x5ebb10[_0x233a('0x2e')][_0x233a('0x30')]?_0x5ebb10[_0x233a('0x2e')]:_0x33130a[_0x233a('0x2b')];if(!_0x3856fd[_0x233a('0x2c')]['hasOwnProperty'](_0x233a('0x31'))){_0x5ebb10[_0x233a('0x1a')]=qs[_0x233a('0x1a')](_0x3856fd[_0x233a('0x2c')][_0x233a('0x1a')]);_0x5ebb10[_0x233a('0x19')]=qs['offset'](_0x3856fd[_0x233a('0x2c')][_0x233a('0x19')]);}_0x5ebb10[_0x233a('0x32')]=qs['sort'](_0x3856fd[_0x233a('0x2c')][_0x233a('0x33')]);_0x5ebb10[_0x233a('0x34')]=qs['filters'](_[_0x233a('0x35')](_0x3856fd[_0x233a('0x2c')],_0x33130a['filters']),_0x330829);if(_0x3856fd[_0x233a('0x2c')][_0x233a('0x36')]){_0x5ebb10['where']=_[_0x233a('0x37')](_0x5ebb10[_0x233a('0x34')],{'$or':_[_0x233a('0x38')](_0x330829,function(_0x2aa550){if(_0x2aa550[_0x233a('0x29')]!==_0x233a('0x39')){var _0x197be2={};_0x197be2[_0x2aa550['name']]={'$like':'%'+_0x3856fd[_0x233a('0x2c')][_0x233a('0x36')]+'%'};return _0x197be2;}})});}_0x5ebb10=_[_0x233a('0x37')]({},_0x5ebb10,_0x3856fd[_0x233a('0x3a')]);var _0x4cd2af={'where':_0x5ebb10[_0x233a('0x34')]};return db['ChatTransferReport'][_0x233a('0x1c')](_0x4cd2af)[_0x233a('0x22')](function(_0x826ca5){_0x311047[_0x233a('0x1c')]=_0x826ca5;if(_0x3856fd['query'][_0x233a('0x3b')]){_0x5ebb10[_0x233a('0x3c')]=[{'all':!![]}];}return db[_0x233a('0x27')][_0x233a('0x3d')](_0x5ebb10);})[_0x233a('0x22')](function(_0x5801d1){_0x311047[_0x233a('0x3e')]=_0x5801d1;return _0x311047;})[_0x233a('0x22')](respondWithFilteredResult(_0x291769,_0x5ebb10))[_0x233a('0x3f')](handleError(_0x291769,null));};exports[_0x233a('0x40')]=function(_0x2810e2,_0x58412d){var _0x1c22a9={'raw':!![],'where':{'id':_0x2810e2[_0x233a('0x41')]['id']}},_0x50a5cd={};_0x50a5cd['model']=_[_0x233a('0x42')](db[_0x233a('0x27')][_0x233a('0x28')]);_0x50a5cd[_0x233a('0x2c')]=_[_0x233a('0x42')](_0x2810e2['query']);_0x50a5cd[_0x233a('0x43')]=_[_0x233a('0x2d')](_0x50a5cd[_0x233a('0x2b')],_0x50a5cd['query']);_0x1c22a9[_0x233a('0x2e')]=_[_0x233a('0x2d')](_0x50a5cd[_0x233a('0x2b')],qs['fields'](_0x2810e2[_0x233a('0x2c')]['fields']));_0x1c22a9['attributes']=_0x1c22a9['attributes'][_0x233a('0x30')]?_0x1c22a9[_0x233a('0x2e')]:_0x50a5cd['model'];if(_0x2810e2[_0x233a('0x2c')][_0x233a('0x3b')]){_0x1c22a9[_0x233a('0x3c')]=[{'all':!![]}];}_0x1c22a9=_[_0x233a('0x37')]({},_0x1c22a9,_0x2810e2[_0x233a('0x3a')]);return db[_0x233a('0x27')]['find'](_0x1c22a9)[_0x233a('0x22')](handleEntityNotFound(_0x58412d,null))['then'](respondWithResult(_0x58412d,null))[_0x233a('0x3f')](handleError(_0x58412d,null));};exports['create']=function(_0x547fbb,_0x2b9ef6){return db[_0x233a('0x27')][_0x233a('0x44')](_0x547fbb[_0x233a('0x45')],{})[_0x233a('0x22')](respondWithResult(_0x2b9ef6,0xc9))[_0x233a('0x3f')](handleError(_0x2b9ef6,null));};exports['update']=function(_0x3d4f32,_0x461c90){if(_0x3d4f32[_0x233a('0x45')]['id']){delete _0x3d4f32[_0x233a('0x45')]['id'];}return db[_0x233a('0x27')][_0x233a('0x46')]({'where':{'id':_0x3d4f32[_0x233a('0x41')]['id']}})['then'](handleEntityNotFound(_0x461c90,null))['then'](saveUpdates(_0x3d4f32['body'],null))[_0x233a('0x22')](respondWithResult(_0x461c90,null))[_0x233a('0x3f')](handleError(_0x461c90,null));};exports[_0x233a('0x47')]=function(_0x1f1a68,_0x249d95){return db[_0x233a('0x27')]['find']({'where':{'id':_0x1f1a68['params']['id']}})[_0x233a('0x22')](handleEntityNotFound(_0x249d95,null))[_0x233a('0x22')](removeEntity(_0x249d95,null))['catch'](handleError(_0x249d95,null));};exports[_0x233a('0x48')]=function(_0x4181f5,_0x160652){return db[_0x233a('0x27')][_0x233a('0x48')]()[_0x233a('0x22')](respondWithResult(_0x160652,null))[_0x233a('0x3f')](handleError(_0x160652,null));};
\ No newline at end of file
+var _0x84bb=['query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','rows','catch','show','params','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','apply','reject','save','then','error','stack','name','send','index','ChatTransferReport','key','model','map'];(function(_0x133cb3,_0x37c6d0){var _0x5f58e6=function(_0x5d868a){while(--_0x5d868a){_0x133cb3['push'](_0x133cb3['shift']());}};_0x5f58e6(++_0x37c6d0);}(_0x84bb,0x1d7));var _0xb84b=function(_0x992fd0,_0x53feeb){_0x992fd0=_0x992fd0-0x0;var _0x5a4785=_0x84bb[_0x992fd0];return _0x5a4785;};'use strict';var emlformat=require(_0xb84b('0x0'));var rimraf=require(_0xb84b('0x1'));var zipdir=require(_0xb84b('0x2'));var jsonpatch=require(_0xb84b('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb84b('0x4'));var Mustache=require(_0xb84b('0x5'));var util=require(_0xb84b('0x6'));var path=require(_0xb84b('0x7'));var sox=require(_0xb84b('0x8'));var csv=require(_0xb84b('0x9'));var ejs=require(_0xb84b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb84b('0xb'));var squel=require(_0xb84b('0xc'));var crypto=require(_0xb84b('0xd'));var jsforce=require(_0xb84b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb84b('0x9'));var querystring=require(_0xb84b('0xf'));var Papa=require(_0xb84b('0x10'));var Redis=require(_0xb84b('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb84b('0x12'));var hardwareService=require(_0xb84b('0x13'));var logger=require(_0xb84b('0x14'))(_0xb84b('0x15'));var utils=require('../../config/utils');var config=require(_0xb84b('0x16'));var licenseUtil=require(_0xb84b('0x17'));var db=require(_0xb84b('0x18'))['db'];function respondWithStatusCode(_0x5f5ddb,_0x52ea08){_0x52ea08=_0x52ea08||0xcc;return function(_0x169a68){if(_0x169a68){return _0x5f5ddb[_0xb84b('0x19')](_0x52ea08);}return _0x5f5ddb[_0xb84b('0x1a')](_0x52ea08)[_0xb84b('0x1b')]();};}function respondWithResult(_0x3b21d7,_0x56e72b){_0x56e72b=_0x56e72b||0xc8;return function(_0x310c05){if(_0x310c05){return _0x3b21d7[_0xb84b('0x1a')](_0x56e72b)['json'](_0x310c05);}};}function respondWithFilteredResult(_0x1baf8d,_0x414790){return function(_0x226dc){if(_0x226dc){var _0x1781aa=typeof _0x414790[_0xb84b('0x1c')]==='undefined'&&typeof _0x414790[_0xb84b('0x1d')]===_0xb84b('0x1e');var _0x4d2f59=_0x226dc[_0xb84b('0x1f')];var _0x4c4dc2=_0x1781aa?0x0:_0x414790[_0xb84b('0x1c')];var _0x8d9d84=_0x1781aa?_0x226dc['count']:_0x414790[_0xb84b('0x1c')]+_0x414790[_0xb84b('0x1d')];var _0xdbaf2c;if(_0x8d9d84>=_0x4d2f59){_0x8d9d84=_0x4d2f59;_0xdbaf2c=0xc8;}else{_0xdbaf2c=0xce;}_0x1baf8d[_0xb84b('0x1a')](_0xdbaf2c);return _0x1baf8d['set'](_0xb84b('0x20'),_0x4c4dc2+'-'+_0x8d9d84+'/'+_0x4d2f59)[_0xb84b('0x21')](_0x226dc);}return null;};}function patchUpdates(_0x220a3f){return function(_0x1bd13f){try{jsonpatch[_0xb84b('0x22')](_0x1bd13f,_0x220a3f,!![]);}catch(_0x28f00f){return BPromise[_0xb84b('0x23')](_0x28f00f);}return _0x1bd13f[_0xb84b('0x24')]();};}function saveUpdates(_0x1b6b91,_0x4072cc){return function(_0x15d20b){if(_0x15d20b){return _0x15d20b['update'](_0x1b6b91)[_0xb84b('0x25')](function(_0x2c1f87){return _0x2c1f87;});}return null;};}function removeEntity(_0x30ed04,_0x58bd87){return function(_0x20fbec){if(_0x20fbec){return _0x20fbec['destroy']()[_0xb84b('0x25')](function(){_0x30ed04[_0xb84b('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc67236,_0x212e00){return function(_0x43e00a){if(!_0x43e00a){_0xc67236['sendStatus'](0x194);}return _0x43e00a;};}function handleError(_0x2ca18d,_0x3674dc){_0x3674dc=_0x3674dc||0x1f4;return function(_0x3b97fa){logger[_0xb84b('0x26')](_0x3b97fa[_0xb84b('0x27')]);if(_0x3b97fa['name']){delete _0x3b97fa[_0xb84b('0x28')];}_0x2ca18d[_0xb84b('0x1a')](_0x3674dc)[_0xb84b('0x29')](_0x3b97fa);};}exports[_0xb84b('0x2a')]=function(_0x3271ee,_0x211248){var _0x4d1ca3={},_0x57b8f9={},_0x45293d={'count':0x0,'rows':[]};var _0x6a7e8f=_['map'](db[_0xb84b('0x2b')]['rawAttributes'],function(_0x170cd7){return{'name':_0x170cd7['fieldName'],'type':_0x170cd7['type'][_0xb84b('0x2c')]};});_0x57b8f9[_0xb84b('0x2d')]=_[_0xb84b('0x2e')](_0x6a7e8f,'name');_0x57b8f9[_0xb84b('0x2f')]=_[_0xb84b('0x30')](_0x3271ee[_0xb84b('0x2f')]);_0x57b8f9[_0xb84b('0x31')]=_[_0xb84b('0x32')](_0x57b8f9[_0xb84b('0x2d')],_0x57b8f9[_0xb84b('0x2f')]);_0x4d1ca3[_0xb84b('0x33')]=_[_0xb84b('0x32')](_0x57b8f9['model'],qs[_0xb84b('0x34')](_0x3271ee['query'][_0xb84b('0x34')]));_0x4d1ca3[_0xb84b('0x33')]=_0x4d1ca3['attributes'][_0xb84b('0x35')]?_0x4d1ca3[_0xb84b('0x33')]:_0x57b8f9[_0xb84b('0x2d')];if(!_0x3271ee[_0xb84b('0x2f')]['hasOwnProperty'](_0xb84b('0x36'))){_0x4d1ca3['limit']=qs[_0xb84b('0x1d')](_0x3271ee['query'][_0xb84b('0x1d')]);_0x4d1ca3[_0xb84b('0x1c')]=qs[_0xb84b('0x1c')](_0x3271ee[_0xb84b('0x2f')][_0xb84b('0x1c')]);}_0x4d1ca3[_0xb84b('0x37')]=qs[_0xb84b('0x38')](_0x3271ee[_0xb84b('0x2f')][_0xb84b('0x38')]);_0x4d1ca3[_0xb84b('0x39')]=qs['filters'](_[_0xb84b('0x3a')](_0x3271ee[_0xb84b('0x2f')],_0x57b8f9[_0xb84b('0x31')]),_0x6a7e8f);if(_0x3271ee['query'][_0xb84b('0x3b')]){_0x4d1ca3[_0xb84b('0x39')]=_[_0xb84b('0x3c')](_0x4d1ca3[_0xb84b('0x39')],{'$or':_[_0xb84b('0x2e')](_0x6a7e8f,function(_0x163dd0){if(_0x163dd0[_0xb84b('0x3d')]!=='VIRTUAL'){var _0x343020={};_0x343020[_0x163dd0[_0xb84b('0x28')]]={'$like':'%'+_0x3271ee[_0xb84b('0x2f')]['filter']+'%'};return _0x343020;}})});}_0x4d1ca3=_['merge']({},_0x4d1ca3,_0x3271ee[_0xb84b('0x3e')]);var _0x5e75e4={'where':_0x4d1ca3[_0xb84b('0x39')]};return db[_0xb84b('0x2b')][_0xb84b('0x1f')](_0x5e75e4)['then'](function(_0x45e6e6){_0x45293d[_0xb84b('0x1f')]=_0x45e6e6;if(_0x3271ee[_0xb84b('0x2f')][_0xb84b('0x3f')]){_0x4d1ca3[_0xb84b('0x40')]=[{'all':!![]}];}return db[_0xb84b('0x2b')]['findAll'](_0x4d1ca3);})[_0xb84b('0x25')](function(_0x24d3da){_0x45293d[_0xb84b('0x41')]=_0x24d3da;return _0x45293d;})[_0xb84b('0x25')](respondWithFilteredResult(_0x211248,_0x4d1ca3))[_0xb84b('0x42')](handleError(_0x211248,null));};exports[_0xb84b('0x43')]=function(_0xee0856,_0x40cbcb){var _0x33650c={'raw':!![],'where':{'id':_0xee0856[_0xb84b('0x44')]['id']}},_0x1da96f={};_0x1da96f['model']=_['keys'](db[_0xb84b('0x2b')]['rawAttributes']);_0x1da96f['query']=_[_0xb84b('0x30')](_0xee0856['query']);_0x1da96f['filters']=_[_0xb84b('0x32')](_0x1da96f[_0xb84b('0x2d')],_0x1da96f[_0xb84b('0x2f')]);_0x33650c[_0xb84b('0x33')]=_[_0xb84b('0x32')](_0x1da96f['model'],qs['fields'](_0xee0856['query'][_0xb84b('0x34')]));_0x33650c[_0xb84b('0x33')]=_0x33650c[_0xb84b('0x33')][_0xb84b('0x35')]?_0x33650c[_0xb84b('0x33')]:_0x1da96f[_0xb84b('0x2d')];if(_0xee0856[_0xb84b('0x2f')][_0xb84b('0x3f')]){_0x33650c[_0xb84b('0x40')]=[{'all':!![]}];}_0x33650c=_['merge']({},_0x33650c,_0xee0856[_0xb84b('0x3e')]);return db[_0xb84b('0x2b')][_0xb84b('0x45')](_0x33650c)[_0xb84b('0x25')](handleEntityNotFound(_0x40cbcb,null))[_0xb84b('0x25')](respondWithResult(_0x40cbcb,null))['catch'](handleError(_0x40cbcb,null));};exports['create']=function(_0x709615,_0x263ca3){return db[_0xb84b('0x2b')][_0xb84b('0x46')](_0x709615[_0xb84b('0x47')],{})[_0xb84b('0x25')](respondWithResult(_0x263ca3,0xc9))[_0xb84b('0x42')](handleError(_0x263ca3,null));};exports[_0xb84b('0x48')]=function(_0x44ead1,_0x370f0f){if(_0x44ead1[_0xb84b('0x47')]['id']){delete _0x44ead1[_0xb84b('0x47')]['id'];}return db[_0xb84b('0x2b')][_0xb84b('0x45')]({'where':{'id':_0x44ead1[_0xb84b('0x44')]['id']}})[_0xb84b('0x25')](handleEntityNotFound(_0x370f0f,null))[_0xb84b('0x25')](saveUpdates(_0x44ead1[_0xb84b('0x47')],null))[_0xb84b('0x25')](respondWithResult(_0x370f0f,null))[_0xb84b('0x42')](handleError(_0x370f0f,null));};exports['destroy']=function(_0x4d6a08,_0x44ff71){return db[_0xb84b('0x2b')]['find']({'where':{'id':_0x4d6a08[_0xb84b('0x44')]['id']}})[_0xb84b('0x25')](handleEntityNotFound(_0x44ff71,null))[_0xb84b('0x25')](removeEntity(_0x44ff71,null))['catch'](handleError(_0x44ff71,null));};exports[_0xb84b('0x49')]=function(_0x17aa02,_0x3c084f){return db[_0xb84b('0x2b')]['describe']()[_0xb84b('0x25')](respondWithResult(_0x3c084f,null))[_0xb84b('0x42')](handleError(_0x3c084f,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index a873a4e..09c11b5 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 _0x9901=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatTransferReport','report_chat_transfer','../../config/logger'];(function(_0x141e03,_0x18340e){var _0x2074e3=function(_0x2b7ece){while(--_0x2b7ece){_0x141e03['push'](_0x141e03['shift']());}};_0x2074e3(++_0x18340e);}(_0x9901,0xe3));var _0x1990=function(_0x41ee64,_0x206c94){_0x41ee64=_0x41ee64-0x0;var _0x468e47=_0x9901[_0x41ee64];return _0x468e47;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1990('0x0'))(_0x1990('0x1'));var moment=require(_0x1990('0x2'));var BPromise=require(_0x1990('0x3'));var rp=require(_0x1990('0x4'));var fs=require('fs');var path=require(_0x1990('0x5'));var rimraf=require(_0x1990('0x6'));var config=require(_0x1990('0x7'));var attributes=require('./chatTransferReport.attributes');module[_0x1990('0x8')]=function(_0x2d09f3,_0x25cb10){return _0x2d09f3[_0x1990('0x9')](_0x1990('0xa'),attributes,{'tableName':_0x1990('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd63b=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x3eed92,_0x47610a){var _0x35e816=function(_0x30a5ee){while(--_0x30a5ee){_0x3eed92['push'](_0x3eed92['shift']());}};_0x35e816(++_0x47610a);}(_0xd63b,0x16d));var _0xbd63=function(_0x48bc88,_0xeda379){_0x48bc88=_0x48bc88-0x0;var _0x3ca4fd=_0xd63b[_0x48bc88];return _0x3ca4fd;};'use strict';var _=require(_0xbd63('0x0'));var util=require(_0xbd63('0x1'));var logger=require(_0xbd63('0x2'))(_0xbd63('0x3'));var moment=require(_0xbd63('0x4'));var BPromise=require(_0xbd63('0x5'));var rp=require(_0xbd63('0x6'));var fs=require('fs');var path=require(_0xbd63('0x7'));var rimraf=require(_0xbd63('0x8'));var config=require(_0xbd63('0x9'));var attributes=require(_0xbd63('0xa'));module[_0xbd63('0xb')]=function(_0x3cc0f3,_0x57ed35){return _0x3cc0f3[_0xbd63('0xc')](_0xbd63('0xd'),attributes,{'tableName':_0xbd63('0xe'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xbd63('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 6271417..b3db941 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 _0x86f4=['then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request'];(function(_0x13f3af,_0x2ac326){var _0xda3c9f=function(_0x5d96e9){while(--_0x5d96e9){_0x13f3af['push'](_0x13f3af['shift']());}};_0xda3c9f(++_0x2ac326);}(_0x86f4,0x16a));var _0x486f=function(_0x3bebac,_0x371dab){_0x3bebac=_0x3bebac-0x0;var _0x33f955=_0x86f4[_0x3bebac];return _0x33f955;};'use strict';var _=require(_0x486f('0x0'));var util=require(_0x486f('0x1'));var moment=require(_0x486f('0x2'));var BPromise=require(_0x486f('0x3'));var rs=require(_0x486f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x486f('0x5'))['db'];var utils=require(_0x486f('0x6'));var logger=require(_0x486f('0x7'))(_0x486f('0x8'));var config=require(_0x486f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x486f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f394d,_0x1a8152,_0x1248f4){return new BPromise(function(_0x2565eb,_0x39ca7b){return client[_0x486f('0xb')](_0x1f394d,_0x1248f4)[_0x486f('0xc')](function(_0xacae2b){logger['info'](_0x486f('0xd'),_0x1a8152,_0x486f('0xe'));logger['debug'](_0x486f('0xf'),_0x1a8152,_0x486f('0xe'),JSON[_0x486f('0x10')](_0xacae2b));if(_0xacae2b[_0x486f('0x11')]){if(_0xacae2b['error'][_0x486f('0x12')]===0x1f4){logger[_0x486f('0x11')](_0x486f('0xd'),_0x1a8152,_0xacae2b['error'][_0x486f('0x13')]);return _0x39ca7b(_0xacae2b[_0x486f('0x11')]['message']);}logger[_0x486f('0x11')](_0x486f('0xd'),_0x1a8152,_0xacae2b['error'][_0x486f('0x13')]);return _0x2565eb(_0xacae2b[_0x486f('0x11')][_0x486f('0x13')]);}else{logger[_0x486f('0x14')](_0x486f('0xd'),_0x1a8152,'request\x20sent');_0x2565eb(_0xacae2b['result'][_0x486f('0x13')]);}})[_0x486f('0x15')](function(_0x5e8e0e){logger[_0x486f('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x1a8152,_0x5e8e0e);_0x39ca7b(_0x5e8e0e);});});}
\ No newline at end of file
+var _0x7537=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util'];(function(_0x20589d,_0x55d5bf){var _0x422de9=function(_0x44cbbb){while(--_0x44cbbb){_0x20589d['push'](_0x20589d['shift']());}};_0x422de9(++_0x55d5bf);}(_0x7537,0xf5));var _0x7753=function(_0x1ed311,_0xb346e7){_0x1ed311=_0x1ed311-0x0;var _0x34f63b=_0x7537[_0x1ed311];return _0x34f63b;};'use strict';var _=require(_0x7753('0x0'));var util=require(_0x7753('0x1'));var moment=require(_0x7753('0x2'));var BPromise=require(_0x7753('0x3'));var rs=require(_0x7753('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7753('0x5'))['db'];var utils=require(_0x7753('0x6'));var logger=require(_0x7753('0x7'))('rpc');var config=require(_0x7753('0x8'));var jayson=require(_0x7753('0x9'));var client=jayson['client'][_0x7753('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x371905,_0x5be031,_0x509dce){return new BPromise(function(_0x6e7807,_0x212336){return client['request'](_0x371905,_0x509dce)['then'](function(_0x326298){logger[_0x7753('0xb')](_0x7753('0xc'),_0x5be031,'request\x20sent');logger['debug']('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x5be031,_0x7753('0xd'),JSON[_0x7753('0xe')](_0x326298));if(_0x326298['error']){if(_0x326298[_0x7753('0xf')]['code']===0x1f4){logger[_0x7753('0xf')](_0x7753('0xc'),_0x5be031,_0x326298[_0x7753('0xf')][_0x7753('0x10')]);return _0x212336(_0x326298['error']['message']);}logger['error'](_0x7753('0xc'),_0x5be031,_0x326298[_0x7753('0xf')][_0x7753('0x10')]);return _0x6e7807(_0x326298[_0x7753('0xf')]['message']);}else{logger[_0x7753('0xb')]('ChatTransferReport,\x20%s,\x20%s',_0x5be031,_0x7753('0xd'));_0x6e7807(_0x326298[_0x7753('0x11')][_0x7753('0x10')]);}})[_0x7753('0x12')](function(_0x5466bf){logger[_0x7753('0xf')](_0x7753('0xc'),_0x5be031,_0x5466bf);_0x212336(_0x5466bf);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 98de0ee..40b9874 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 _0x24c7=['exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','update','destroy'];(function(_0x3d0012,_0x84ac9f){var _0x21339f=function(_0x3448a4){while(--_0x3448a4){_0x3d0012['push'](_0x3d0012['shift']());}};_0x21339f(++_0x84ac9f);}(_0x24c7,0x17b));var _0x724c=function(_0x4e672c,_0x250417){_0x4e672c=_0x4e672c-0x0;var _0x4fc013=_0x24c7[_0x4e672c];return _0x4fc013;};'use strict';var multer=require(_0x724c('0x0'));var util=require('util');var path=require(_0x724c('0x1'));var timeout=require('connect-timeout');var express=require(_0x724c('0x2'));var router=express['Router']();var fs_extra=require(_0x724c('0x3'));var auth=require(_0x724c('0x4'));var interaction=require(_0x724c('0x5'));var config=require('../../config/environment');var controller=require(_0x724c('0x6'));router[_0x724c('0x7')]('/',auth[_0x724c('0x8')](),controller[_0x724c('0x9')]);router[_0x724c('0x7')](_0x724c('0xa'),auth[_0x724c('0x8')](),controller[_0x724c('0xb')]);router[_0x724c('0x7')](_0x724c('0xc'),auth[_0x724c('0x8')](),controller[_0x724c('0xd')]);router['post']('/',auth[_0x724c('0x8')](),controller['create']);router[_0x724c('0xe')](_0x724c('0xc'),auth[_0x724c('0x8')](),controller[_0x724c('0xf')]);router['delete'](_0x724c('0xc'),auth[_0x724c('0x8')](),controller[_0x724c('0x10')]);module[_0x724c('0x11')]=router;
\ No newline at end of file
+var _0x8802=['util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','destroy','exports','multer'];(function(_0x410b37,_0x133090){var _0x221d1d=function(_0x2ac019){while(--_0x2ac019){_0x410b37['push'](_0x410b37['shift']());}};_0x221d1d(++_0x133090);}(_0x8802,0x1b7));var _0x2880=function(_0x3c1b2d,_0x23b1b9){_0x3c1b2d=_0x3c1b2d-0x0;var _0x412475=_0x8802[_0x3c1b2d];return _0x412475;};'use strict';var multer=require(_0x2880('0x0'));var util=require(_0x2880('0x1'));var path=require(_0x2880('0x2'));var timeout=require('connect-timeout');var express=require(_0x2880('0x3'));var router=express[_0x2880('0x4')]();var fs_extra=require(_0x2880('0x5'));var auth=require(_0x2880('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2880('0x7'));var controller=require(_0x2880('0x8'));router[_0x2880('0x9')]('/',auth[_0x2880('0xa')](),controller[_0x2880('0xb')]);router['get'](_0x2880('0xc'),auth[_0x2880('0xa')](),controller[_0x2880('0xd')]);router[_0x2880('0x9')](_0x2880('0xe'),auth['isAuthenticated'](),controller[_0x2880('0xf')]);router[_0x2880('0x10')]('/',auth[_0x2880('0xa')](),controller['create']);router[_0x2880('0x11')](_0x2880('0xe'),auth['isAuthenticated'](),controller[_0x2880('0x12')]);router[_0x2880('0x13')](_0x2880('0xe'),auth[_0x2880('0xa')](),controller[_0x2880('0x14')]);module[_0x2880('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 5f705ed..fb8f8e3 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 _0x3c33=['Note','Type\x20a\x20message','Skip','star','thumb','TEXT','input','name','text','email','getDataValue','onlineForm','setDataValue','stringify','Comments','offlineForm','parse','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.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','We\x20are\x20here!','Chat','Send','Contact\x20us','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error'];(function(_0x4c4b99,_0x3a290f){var _0x150415=function(_0x4b9e37){while(--_0x4b9e37){_0x4c4b99['push'](_0x4c4b99['shift']());}};_0x150415(++_0x3a290f);}(_0x3c33,0xb7));var _0x33c3=function(_0x35228c,_0x1e6824){_0x35228c=_0x35228c-0x0;var _0x56b5c0=_0x3c33[_0x35228c];return _0x56b5c0;};'use strict';var Sequelize=require(_0x33c3('0x0'));var rs=require(_0x33c3('0x1'));module[_0x33c3('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x33c3('0x3')],'allowNull':![],'unique':_0x33c3('0x4')},'description':{'type':Sequelize[_0x33c3('0x3')]},'mapKey':{'type':Sequelize[_0x33c3('0x3')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0x33c3('0x3')],'defaultValue':'email'},'key':{'type':Sequelize[_0x33c3('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x33c3('0x3')],'defaultValue':_0x33c3('0x5')},'customerAlias':{'type':Sequelize[_0x33c3('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x33c3('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x33c3('0x3')],'allowNull':![],'defaultValue':_0x33c3('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x33c3('0x3')],'allowNull':![],'defaultValue':_0x33c3('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x33c3('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x33c3('0x3')]},'animation':{'type':Sequelize[_0x33c3('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x33c3('0xa')]('rounded','squared'),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x33c3('0x3')],'defaultValue':_0x33c3('0xb')},'start_chat_button':{'type':Sequelize[_0x33c3('0x3')],'defaultValue':_0x33c3('0xc')},'offline_chat_button':{'type':Sequelize[_0x33c3('0x3')],'defaultValue':_0x33c3('0xd')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x33c3('0xe')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x33c3('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x33c3('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x33c3('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x33c3('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0x33c3('0x3')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x33c3('0x3')],'defaultValue':_0x33c3('0x10')},'noteTitle':{'type':Sequelize[_0x33c3('0x3')],'defaultValue':_0x33c3('0x11')},'placeholderMessage':{'type':Sequelize[_0x33c3('0x3')],'defaultValue':_0x33c3('0x12')},'closingMessage':{'type':Sequelize[_0x33c3('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x33c3('0x3')],'defaultValue':_0x33c3('0x13')},'conditionAgreement':{'type':Sequelize[_0x33c3('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x33c3('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x33c3('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x33c3('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x33c3('0x3')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x33c3('0xa')](_0x33c3('0x14'),_0x33c3('0x15')),'defaultValue':_0x33c3('0x14')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x33c3('0x16')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x33c3('0x17'),'variable':null,'config':{'placeholder':_0x33c3('0x18'),'type':_0x33c3('0x19'),'required':!![]},'props':{'title':_0x33c3('0x18'),'helpText':''}},{'type':_0x33c3('0x17'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x33c3('0x1a'),'type':_0x33c3('0x1a')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x33c3('0x1b')](_0x33c3('0x1c'))?JSON['parse'](this[_0x33c3('0x1b')](_0x33c3('0x1c'))):{};},'set':function(_0x22a37a){return this[_0x33c3('0x1d')]('onlineForm',JSON[_0x33c3('0x1e')](_0x22a37a));}},'offlineForm':{'type':Sequelize[_0x33c3('0x16')],'defaultValue':function(){return JSON[_0x33c3('0x1e')]({'items':[{'type':_0x33c3('0x17'),'props':{'title':_0x33c3('0x1a'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x33c3('0x1a')},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':_0x33c3('0x1f'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x33c3('0x1b')](_0x33c3('0x20'))?JSON[_0x33c3('0x21')](this[_0x33c3('0x1b')]('offlineForm')):{};},'set':function(_0x1cb183){return this[_0x33c3('0x1d')](_0x33c3('0x20'),JSON[_0x33c3('0x1e')](_0x1cb183));}},'token':{'type':Sequelize[_0x33c3('0x3')],'defaultValue':function(){return rs[_0x33c3('0x22')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x33c3('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x33c3('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x33c3('0x3')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x33c3('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x33c3('0x23')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x33c3('0x24')},'offlineMessageSubject':{'type':Sequelize[_0x33c3('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x33c3('0x3')],'defaultValue':_0x33c3('0x25')},'enableUnmanagedNote':{'type':Sequelize[_0x33c3('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x33c3('0x3')],'defaultValue':_0x33c3('0x26')},'skipUnmanaged':{'type':Sequelize[_0x33c3('0x3')],'defaultValue':_0x33c3('0x13')},'sendUnmanaged':{'type':Sequelize[_0x33c3('0x3')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x33c3('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x33c3('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x33c3('0x16')]},'showAgentAvatar':{'type':Sequelize[_0x33c3('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x33c3('0x3')]},'notificationTemplate':{'type':Sequelize[_0x33c3('0x16')],'defaultValue':function(){return _0x33c3('0x27');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x33c3('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x33c3('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x33c3('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0x33c3('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x33c3('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x33c3('0x3')],'defaultValue':_0x33c3('0x29')},'verticalAlignment':{'type':Sequelize[_0x33c3('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x33c3('0x3')],'defaultValue':_0x33c3('0x2a')},'messagesAlignment':{'type':Sequelize[_0x33c3('0x3')],'defaultValue':_0x33c3('0x2b')},'defaultTitle':{'type':Sequelize[_0x33c3('0x3')]},'customerAvatar':{'type':Sequelize[_0x33c3('0x16')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x33c3('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x33c3('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x33c3('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x33c3('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x33c3('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x33c3('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':'System'},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x33c3('0x8')],'comment':_0x33c3('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0x33c3('0x9')],'defaultValue':![],'comment':_0x33c3('0x2e'),'set':function(_0x2f2009){if(!_0x2f2009)this[_0x33c3('0x1d')](_0x33c3('0x2f'),null);this['setDataValue']('mandatoryDisposition',_0x2f2009);}},'vidaooEscalation':{'type':Sequelize[_0x33c3('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x33c3('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x33c3('0x30')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x33c3('0x31');}},'vidaooMetadata':{'type':Sequelize[_0x33c3('0x16')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x33c3('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x7b53=['thumb','star','stringify','name','input','email','getDataValue','onlineForm','parse','setDataValue','TEXT','Comments','Leave\x20your\x20comments','offlineForm','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','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','We\x20are\x20here!','Chat','Send','Powered\x20by\x20xCALLY','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!'];(function(_0x2ea238,_0x3ff941){var _0x5e1c8c=function(_0x285495){while(--_0x285495){_0x2ea238['push'](_0x2ea238['shift']());}};_0x5e1c8c(++_0x3ff941);}(_0x7b53,0x11a));var _0x37b5=function(_0x3c28a0,_0xb835c0){_0x3c28a0=_0x3c28a0-0x0;var _0x2ad751=_0x7b53[_0x3c28a0];return _0x2ad751;};'use strict';var Sequelize=require(_0x37b5('0x0'));var rs=require(_0x37b5('0x1'));module[_0x37b5('0x2')]={'name':{'type':Sequelize[_0x37b5('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':'address'},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x37b5('0x3')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':'email'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x37b5('0x4')},'customerAlias':{'type':Sequelize[_0x37b5('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x37b5('0x3')],'allowNull':![],'defaultValue':_0x37b5('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x37b5('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x37b5('0x3')],'allowNull':![],'defaultValue':_0x37b5('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x37b5('0x3')],'allowNull':![],'defaultValue':_0x37b5('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x37b5('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x37b5('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x37b5('0x9')]('rounded','squared'),'defaultValue':'rounded'},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x37b5('0xa')},'start_chat_button':{'type':Sequelize[_0x37b5('0x3')],'defaultValue':_0x37b5('0xb')},'offline_chat_button':{'type':Sequelize[_0x37b5('0x3')],'defaultValue':_0x37b5('0xc')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x37b5('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x37b5('0x3')],'defaultValue':_0x37b5('0xd')},'defaultWhiteLabel':{'type':Sequelize[_0x37b5('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x37b5('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x37b5('0x3')],'defaultValue':_0x37b5('0xe')},'formSubmitFailureMessage':{'type':Sequelize[_0x37b5('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x37b5('0x3')],'defaultValue':_0x37b5('0xf')},'placeholderMessage':{'type':Sequelize[_0x37b5('0x3')],'defaultValue':_0x37b5('0x10')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x37b5('0x11')},'closingMessageButton':{'type':Sequelize[_0x37b5('0x3')],'defaultValue':_0x37b5('0xc')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x37b5('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x37b5('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x37b5('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x37b5('0x3')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x37b5('0x9')]('star',_0x37b5('0x12')),'defaultValue':_0x37b5('0x13')},'ratingStarsNumber':{'type':Sequelize[_0x37b5('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x37b5('0x14')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x37b5('0x15'),'type':'text','required':!![]},'props':{'title':_0x37b5('0x15'),'helpText':''}},{'type':_0x37b5('0x16'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x37b5('0x17'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x37b5('0x18')](_0x37b5('0x19'))?JSON[_0x37b5('0x1a')](this['getDataValue']('onlineForm')):{};},'set':function(_0x57cc89){return this[_0x37b5('0x1b')]('onlineForm',JSON[_0x37b5('0x14')](_0x57cc89));}},'offlineForm':{'type':Sequelize[_0x37b5('0x1c')],'defaultValue':function(){return JSON[_0x37b5('0x14')]({'items':[{'type':_0x37b5('0x16'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x37b5('0x17')},'variable':null},{'type':'textarea','config':{'placeholder':_0x37b5('0x1d')},'props':{'title':_0x37b5('0x1d'),'helpText':_0x37b5('0x1e')}}],'fromKey':0x0});},'get':function(){return this[_0x37b5('0x18')]('offlineForm')?JSON['parse'](this[_0x37b5('0x18')](_0x37b5('0x1f'))):{};},'set':function(_0x262018){return this[_0x37b5('0x1b')]('offlineForm',JSON[_0x37b5('0x14')](_0x262018));}},'token':{'type':Sequelize[_0x37b5('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x37b5('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x37b5('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x37b5('0x3')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x37b5('0x3')],'defaultValue':_0x37b5('0x20')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x37b5('0x21')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x37b5('0x22')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x37b5('0x23')},'enableUnmanagedNote':{'type':Sequelize[_0x37b5('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x37b5('0x3')],'defaultValue':_0x37b5('0x24')},'skipUnmanaged':{'type':Sequelize[_0x37b5('0x3')],'defaultValue':_0x37b5('0x25')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x37b5('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0x37b5('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x37b5('0x1c')]},'showAgentAvatar':{'type':Sequelize[_0x37b5('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x37b5('0x3')]},'notificationTemplate':{'type':Sequelize[_0x37b5('0x1c')],'defaultValue':function(){return _0x37b5('0x26');}},'notificationSound':{'type':Sequelize[_0x37b5('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x37b5('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x37b5('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x37b5('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x37b5('0x27')},'verticalAlignment':{'type':Sequelize[_0x37b5('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x37b5('0x3')],'defaultValue':_0x37b5('0x28')},'messagesAlignment':{'type':Sequelize[_0x37b5('0x3')],'defaultValue':_0x37b5('0x29')},'defaultTitle':{'type':Sequelize[_0x37b5('0x3')]},'customerAvatar':{'type':Sequelize[_0x37b5('0x1c')]},'showCustomerAvatar':{'type':Sequelize[_0x37b5('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x37b5('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x37b5('0x3')],'allowNull':![],'defaultValue':_0x37b5('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x37b5('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x37b5('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x37b5('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x37b5('0x2b')},'systemAvatar':{'type':Sequelize[_0x37b5('0x1c')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x37b5('0x7')],'comment':_0x37b5('0x2c')},'mandatoryDisposition':{'type':Sequelize[_0x37b5('0x8')],'defaultValue':![],'comment':_0x37b5('0x2d'),'set':function(_0x36b5eb){if(!_0x36b5eb)this[_0x37b5('0x1b')](_0x37b5('0x2e'),null);this[_0x37b5('0x1b')](_0x37b5('0x2f'),_0x36b5eb);}},'vidaooEscalation':{'type':Sequelize[_0x37b5('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x37b5('0x3')]},'vidaooTopic':{'type':Sequelize[_0x37b5('0x3')],'allowNull':![],'defaultValue':_0x37b5('0x30')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x37b5('0x31');}},'vidaooMetadata':{'type':Sequelize[_0x37b5('0x1c')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 1888971..0180207 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 _0x5b8f=['stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','destroy','get','ChatWebsites','UserProfileResource','end','stack','name','send','user-agent-parser','setUA','user-agent','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','%s\x20%s','unknown','format','device','vendor','model','type','index','Pause','mandatoryDispositionPause','map','ChatWebsite','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','show','rawAttributes','length','includeAll','body','address','forEach','trim','testWildcardValidity','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression','params','describe','ChatWebsiteId','Disposition','getDispositions','findAll','removeDispositions','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','ids','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','download','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','Interval','ifTime','notify','chat','from','From\x20is\x20mandatory','mapKey','MapKey\x20is\x20mandatory','Body\x20is\x20mandatory','createdAt','updatedAt','CompanyId','ListId','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','CmList','Applications','Intervals','interval','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','applications','priority','asc','List','list','Contacts','defaults','CmContact','contact','headers','threadId','closed','ChatInteraction','Writing\x20on\x20closed\x20interaction','externalUrl','ContactId','interaction','messageId','created','autoclose','push','close','*,*,*,*','ChatMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','forcedOwnership','queueId','ChatQueue','unshift','waitForTheAssignedQueue','EventManager','offline','files','Sequelize','ValidationError','no\x20available\x20attributes','difference','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','MailAccount','spread','readFileSync','render','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','offline-chat','basename','openNewInteraction','sequelize','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','SendMail','email','MailAccountId','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Owner','fullname','Tag','color','tag','getSnippet','getProactiveActions','virtual','License','chatLicenseExceeded','timezone','server/files/chat/iframe.ejs','utf8','3.9.0','origin','http://localhost:9000','testWebsiteWithWildcard','remote','x-real-ip','connection','remoteAddress','alignment','verticalAlignment','labelText','textColor','backgroundColor','hideWhenOffline','IntervalId','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','onlineForm','items','fromKey','getOfflineMessages','Contact','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','mustache','util','path','ejs','querystring','html-to-text','ioredis','jayson/promise','../../components/parsers/qs','../../config/logger','APIBadRequestError','../../errors/api','handleError','APIConflictError','./helpers/wildcard-expressions','URL','../../mysqldb','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','http','client','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s'];(function(_0x35af23,_0x9190f6){var _0x340506=function(_0xd4c26b){while(--_0xd4c26b){_0x35af23['push'](_0x35af23['shift']());}};_0x340506(++_0x9190f6);}(_0x5b8f,0x115));var _0xf5b8=function(_0x190681,_0x590f58){_0x190681=_0x190681-0x0;var _0x4f2ada=_0x5b8f[_0x190681];return _0x4f2ada;};'use strict';var Mustache=require(_0xf5b8('0x0'));var util=require(_0xf5b8('0x1'));var path=require(_0xf5b8('0x2'));var ejs=require(_0xf5b8('0x3'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var querystring=require(_0xf5b8('0x4'));var htmlToText=require(_0xf5b8('0x5'));var Redis=require(_0xf5b8('0x6'));var jayson=require(_0xf5b8('0x7'));var qs=require(_0xf5b8('0x8'));var logger=require(_0xf5b8('0x9'))('api');var config=require('../../config/environment');var APIBadRequestError=require('../../errors/api')[_0xf5b8('0xa')];var APINotFoundError=require(_0xf5b8('0xb'))['APINotFoundError'];var APIOutOfIntervalError=require(_0xf5b8('0xb'))['APIOutOfIntervalError'];var APIHandleError=require(_0xf5b8('0xb'))[_0xf5b8('0xc')];var APIConflictError=require(_0xf5b8('0xb'))[_0xf5b8('0xd')];var wildcardUtils=require(_0xf5b8('0xe'));var URL=require('url')[_0xf5b8('0xf')];var db=require(_0xf5b8('0x10'))['db'];config[_0xf5b8('0x11')]=_['defaults'](config['redis'],{'host':_0xf5b8('0x12'),'port':0x18eb});var socket=require(_0xf5b8('0x13'))(new Redis(config[_0xf5b8('0x11')]));require(_0xf5b8('0x14'))[_0xf5b8('0x15')](socket);var client=jayson['client'][_0xf5b8('0x16')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});var client9003=jayson[_0xf5b8('0x17')]['http']({'port':0x232b});var client9001=jayson[_0xf5b8('0x17')][_0xf5b8('0x16')]({'port':0x2329});function respondWithRpcPromise(_0x181827,_0x6d2f2d,_0x40b924,_0x613cb1){return new Promise(function(_0x16abd6,_0x3f6574){var _0x1618c6=_0x613cb1||client;return _0x1618c6['request'](_0x181827,_0x40b924)[_0xf5b8('0x18')](function(_0x9ca0f){logger[_0xf5b8('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x6d2f2d,_0xf5b8('0x1a'));logger[_0xf5b8('0x1b')](_0xf5b8('0x1c'),_0x6d2f2d,'request\x20sent',JSON[_0xf5b8('0x1d')](_0x9ca0f));if(_0x9ca0f[_0xf5b8('0x1e')]){if(_0x9ca0f[_0xf5b8('0x1e')][_0xf5b8('0x1f')]===0x1f4){logger['error'](_0xf5b8('0x20'),_0x6d2f2d,_0x9ca0f[_0xf5b8('0x1e')][_0xf5b8('0x21')]);return _0x3f6574(_0x9ca0f[_0xf5b8('0x1e')][_0xf5b8('0x21')]);}logger['error'](_0xf5b8('0x20'),_0x6d2f2d,_0x9ca0f[_0xf5b8('0x1e')][_0xf5b8('0x21')]);return _0x16abd6(_0x9ca0f[_0xf5b8('0x1e')][_0xf5b8('0x21')]);}else{logger[_0xf5b8('0x19')](_0xf5b8('0x20'),_0x6d2f2d,_0xf5b8('0x1a'));_0x16abd6(_0x9ca0f[_0xf5b8('0x22')][_0xf5b8('0x21')]);}})[_0xf5b8('0x23')](function(_0x50510e){logger[_0xf5b8('0x1e')](_0xf5b8('0x20'),_0x6d2f2d,_0x50510e);_0x3f6574(_0x50510e);});});}function respondWithStatusCode(_0x18ca29,_0x3a3ca4){_0x3a3ca4=_0x3a3ca4||0xcc;return function(_0xce19a6){if(_0xce19a6){return _0x18ca29[_0xf5b8('0x24')](_0x3a3ca4);}return _0x18ca29[_0xf5b8('0x25')](_0x3a3ca4)['end']();};}function respondWithResult(_0x28dda7,_0x598b44){_0x598b44=_0x598b44||0xc8;return function(_0x379334){if(_0x379334){return _0x28dda7[_0xf5b8('0x25')](_0x598b44)[_0xf5b8('0x26')](_0x379334);}};}function respondWithFilteredResult(_0x1fa029,_0x5a04af){return function(_0x351d37){if(_0x351d37){var _0x41010e=typeof _0x5a04af[_0xf5b8('0x27')]===_0xf5b8('0x28')&&typeof _0x5a04af['limit']==='undefined';var _0x196102=_0x351d37[_0xf5b8('0x29')];var _0x100fdf=_0x41010e?0x0:_0x5a04af[_0xf5b8('0x27')];var _0x2db2ea=_0x41010e?_0x351d37['count']:_0x5a04af[_0xf5b8('0x27')]+_0x5a04af[_0xf5b8('0x2a')];var _0x4e7d6b;if(_0x2db2ea>=_0x196102){_0x2db2ea=_0x196102;_0x4e7d6b=0xc8;}else{_0x4e7d6b=0xce;}_0x1fa029['status'](_0x4e7d6b);return _0x1fa029[_0xf5b8('0x2b')](_0xf5b8('0x2c'),_0x100fdf+'-'+_0x2db2ea+'/'+_0x196102)[_0xf5b8('0x26')](_0x351d37);}return null;};}function saveUpdates(_0x2958e1){return function(_0x163f2d){if(_0x163f2d){return _0x163f2d['update'](_0x2958e1)[_0xf5b8('0x18')](function(_0x25ffaf){return _0x25ffaf;});}return null;};}function removeEntity(_0x2f8b1a){return function(_0x593543){if(_0x593543){return _0x593543[_0xf5b8('0x2d')]()[_0xf5b8('0x18')](function(){var _0x2f9f20=_0x593543[_0xf5b8('0x2e')]({'plain':!![]});var _0x12754f=_0xf5b8('0x2f');return db[_0xf5b8('0x30')]['destroy']({'where':{'type':_0x12754f,'resourceId':_0x2f9f20['id']}})[_0xf5b8('0x18')](function(){return _0x593543;});})['then'](function(){_0x2f8b1a[_0xf5b8('0x25')](0xcc)[_0xf5b8('0x31')]();});}};}function handleEntityNotFound(_0x256317){return function(_0x53ba09){if(!_0x53ba09){_0x256317[_0xf5b8('0x24')](0x194);}return _0x53ba09;};}function handleError(_0x277af4,_0x43fdb8){_0x43fdb8=_0x43fdb8||0x1f4;return function(_0x9f7f98){logger['error'](_0x9f7f98[_0xf5b8('0x32')]);if(_0x9f7f98['name']){delete _0x9f7f98[_0xf5b8('0x33')];}_0x277af4[_0xf5b8('0x25')](_0x43fdb8)[_0xf5b8('0x34')](_0x9f7f98);};}function createInteractionObject(_0x75c4f,_0x169c1a,_0x2f6205,_0x266b01){var _0x13ae2a=require(_0xf5b8('0x35'));var _0x51c5dd=new _0x13ae2a();var _0x1461bf=_0x51c5dd[_0xf5b8('0x36')](_0x2f6205[_0xf5b8('0x37')])['getResult']();var _0x350bf8=_0x169c1a[_0xf5b8('0x38')];if(_0x2f6205['cf-connecting-ip']){_0x350bf8=_0x2f6205[_0xf5b8('0x39')];}else if(_0x2f6205['x-forwarded-for']){_0x350bf8=_[_0xf5b8('0x3a')](_0x2f6205[_0xf5b8('0x3b')][_0xf5b8('0x3c')](','));}return{'ContactId':_0x266b01['id'],'ChatWebsiteId':_0x75c4f,'from':(_0x266b01[_0xf5b8('0x3d')]||'')+'\x20'+(_0x266b01[_0xf5b8('0x3e')]||''),'customerIp':_0x350bf8,'customerPort':_0x2f6205[_0xf5b8('0x3f')]?_0x2f6205[_0xf5b8('0x3f')]:null,'referer':_0x169c1a[_0xf5b8('0x40')],'browserName':_0x1461bf[_0xf5b8('0x41')][_0xf5b8('0x33')]&&_0x1461bf[_0xf5b8('0x41')][_0xf5b8('0x42')]?util['format'](_0xf5b8('0x43'),_0x1461bf['browser']['name'],_0x1461bf['browser'][_0xf5b8('0x42')]):'unknown','browserVersion':_0x1461bf[_0xf5b8('0x41')][_0xf5b8('0x42')]||_0xf5b8('0x44'),'osName':util[_0xf5b8('0x45')](_0xf5b8('0x43'),_0x1461bf['os'][_0xf5b8('0x33')],_0x1461bf['os'][_0xf5b8('0x42')]),'osVersion':_0x1461bf['os'][_0xf5b8('0x42')],'deviceModel':_0x1461bf[_0xf5b8('0x46')]['model']&&_0x1461bf[_0xf5b8('0x46')][_0xf5b8('0x47')]?util['format']('%s\x20%s\x20%s',_0x1461bf[_0xf5b8('0x46')][_0xf5b8('0x48')],_0x1461bf[_0xf5b8('0x46')][_0xf5b8('0x47')],_0x1461bf[_0xf5b8('0x46')][_0xf5b8('0x49')]):null,'deviceVendor':_0x1461bf['device'][_0xf5b8('0x47')],'deviceType':_0x1461bf[_0xf5b8('0x46')][_0xf5b8('0x49')],'formData':JSON['stringify'](_0x169c1a)};}exports[_0xf5b8('0x4a')]=function(_0x14a30d,_0x40ae5c){var _0x421cb3={'include':[{'model':db[_0xf5b8('0x4b')],'as':_0xf5b8('0x4c')}]},_0x28f310={},_0x14628c={'count':0x0,'rows':[]};var _0x2f7165=_[_0xf5b8('0x4d')](db[_0xf5b8('0x4e')]['rawAttributes'],function(_0x48a7fb){return{'name':_0x48a7fb['fieldName'],'type':_0x48a7fb['type']['key']};});_0x28f310[_0xf5b8('0x48')]=_[_0xf5b8('0x4d')](_0x2f7165,_0xf5b8('0x33'));_0x28f310[_0xf5b8('0x4f')]=_[_0xf5b8('0x50')](_0x14a30d[_0xf5b8('0x4f')]);_0x28f310[_0xf5b8('0x51')]=_[_0xf5b8('0x52')](_0x28f310[_0xf5b8('0x48')],_0x28f310[_0xf5b8('0x4f')]);_0x421cb3[_0xf5b8('0x53')]=_[_0xf5b8('0x52')](_0x28f310[_0xf5b8('0x48')],qs[_0xf5b8('0x54')](_0x14a30d['query'][_0xf5b8('0x54')]));_0x421cb3[_0xf5b8('0x53')]=_0x421cb3[_0xf5b8('0x53')]['length']?_0x421cb3[_0xf5b8('0x53')]:_0x28f310[_0xf5b8('0x48')];if(!_0x14a30d['query'][_0xf5b8('0x55')](_0xf5b8('0x56'))){_0x421cb3[_0xf5b8('0x2a')]=qs['limit'](_0x14a30d[_0xf5b8('0x4f')][_0xf5b8('0x2a')]);_0x421cb3['offset']=qs['offset'](_0x14a30d[_0xf5b8('0x4f')]['offset']);}_0x421cb3[_0xf5b8('0x57')]=qs[_0xf5b8('0x58')](_0x14a30d['query']['sort']);_0x421cb3[_0xf5b8('0x59')]=qs[_0xf5b8('0x51')](_[_0xf5b8('0x5a')](_0x14a30d[_0xf5b8('0x4f')],_0x28f310[_0xf5b8('0x51')]),_0x2f7165);if(_0x14a30d[_0xf5b8('0x4f')][_0xf5b8('0x5b')]){_0x421cb3[_0xf5b8('0x59')]=_[_0xf5b8('0x5c')](_0x421cb3[_0xf5b8('0x59')],{'$or':_[_0xf5b8('0x4d')](_0x2f7165,function(_0x33eeb7){if(_0x33eeb7[_0xf5b8('0x49')]!==_0xf5b8('0x5d')){var _0x2f5c55={};_0x2f5c55[_0x33eeb7[_0xf5b8('0x33')]]={'$like':'%'+_0x14a30d[_0xf5b8('0x4f')]['filter']+'%'};return _0x2f5c55;}})});}_0x421cb3=_[_0xf5b8('0x5c')]({},_0x421cb3,_0x14a30d[_0xf5b8('0x5e')]);var _0x5cfcd4={'where':_0x421cb3[_0xf5b8('0x59')]};return db['ChatWebsite'][_0xf5b8('0x29')](_0x5cfcd4)['then'](function(_0x456140){_0x14628c[_0xf5b8('0x29')]=_0x456140;if(_0x14a30d[_0xf5b8('0x4f')]['includeAll']){_0x421cb3[_0xf5b8('0x5f')]=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0x421cb3);})['then'](function(_0x344c2c){_0x14628c[_0xf5b8('0x60')]=_0x344c2c;return _0x14628c;})[_0xf5b8('0x18')](respondWithFilteredResult(_0x40ae5c,_0x421cb3))[_0xf5b8('0x23')](handleError(_0x40ae5c,null));};exports[_0xf5b8('0x61')]=function(_0x521585,_0x21445b){var _0x1678ca={'raw':![],'where':{'id':_0x521585['params']['id']},'include':[{'model':db['Pause'],'as':_0xf5b8('0x4c')}]},_0x576923={};_0x576923[_0xf5b8('0x48')]=_[_0xf5b8('0x50')](db[_0xf5b8('0x4e')][_0xf5b8('0x62')]);_0x576923[_0xf5b8('0x4f')]=_[_0xf5b8('0x50')](_0x521585['query']);_0x576923['filters']=_['intersection'](_0x576923[_0xf5b8('0x48')],_0x576923['query']);_0x1678ca[_0xf5b8('0x53')]=_[_0xf5b8('0x52')](_0x576923['model'],qs['fields'](_0x521585[_0xf5b8('0x4f')][_0xf5b8('0x54')]));_0x1678ca[_0xf5b8('0x53')]=_0x1678ca['attributes'][_0xf5b8('0x63')]?_0x1678ca[_0xf5b8('0x53')]:_0x576923[_0xf5b8('0x48')];if(_0x521585['query'][_0xf5b8('0x64')]){_0x1678ca[_0xf5b8('0x5f')]=[{'all':!![]}];}_0x1678ca=_['merge']({},_0x1678ca,_0x521585['options']);return db[_0xf5b8('0x4e')]['find'](_0x1678ca)['then'](handleEntityNotFound(_0x21445b,null))[_0xf5b8('0x18')](respondWithResult(_0x21445b,null))['catch'](handleError(_0x21445b,null));};exports['create']=function(_0x4c08df,_0x3e8e70){var _0x419dc8=null;_0x4c08df[_0xf5b8('0x65')][_0xf5b8('0x66')]['split'](',')[_0xf5b8('0x67')](_0x5c8901=>{if(_0x5c8901[_0xf5b8('0x68')]()!==''&&!wildcardUtils[_0xf5b8('0x69')](_0x5c8901[_0xf5b8('0x68')]())){_0x419dc8=new APIBadRequestError('\x22'+_0x5c8901+'\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression');}});if(_0x419dc8){return handleError(_0x3e8e70,null)(_0x419dc8);}return db[_0xf5b8('0x4e')][_0xf5b8('0x6a')](_0x4c08df['body'],{})['then'](function(_0x249f1e){var _0x2903dc=_0x4c08df['user'][_0xf5b8('0x2e')]({'plain':!![]});if(!_0x2903dc)throw new Error(_0xf5b8('0x6b'));if(_0x2903dc[_0xf5b8('0x6c')]===_0xf5b8('0x6d')){var _0x3a9ecd=_0x249f1e[_0xf5b8('0x2e')]({'plain':!![]});var _0x45870c=_0xf5b8('0x2f');return db[_0xf5b8('0x6e')][_0xf5b8('0x6f')]({'where':{'name':_0x45870c,'userProfileId':_0x2903dc['userProfileId']},'raw':!![]})[_0xf5b8('0x18')](function(_0xd27aa9){if(_0xd27aa9&&_0xd27aa9[_0xf5b8('0x70')]===0x0){return db[_0xf5b8('0x30')][_0xf5b8('0x6a')]({'name':_0x3a9ecd[_0xf5b8('0x33')],'resourceId':_0x3a9ecd['id'],'type':_0xd27aa9['name'],'sectionId':_0xd27aa9['id']},{})[_0xf5b8('0x18')](function(){return _0x249f1e;});}else{return _0x249f1e;}})[_0xf5b8('0x23')](function(_0x7d106c){logger[_0xf5b8('0x1e')](_0xf5b8('0x71'),_0x7d106c);throw _0x7d106c;});}return _0x249f1e;})[_0xf5b8('0x18')](respondWithResult(_0x3e8e70,0xc9))[_0xf5b8('0x23')](handleError(_0x3e8e70,null));};exports['update']=function(_0x317d59,_0x3c65b4){var _0xa4458d=null;_0x317d59[_0xf5b8('0x65')][_0xf5b8('0x66')][_0xf5b8('0x3c')](',')[_0xf5b8('0x67')](_0x2f3912=>{if(_0x2f3912[_0xf5b8('0x68')]()!==''&&!wildcardUtils['testWildcardValidity'](_0x2f3912[_0xf5b8('0x68')]())){_0xa4458d=new APIBadRequestError('\x22'+_0x2f3912+_0xf5b8('0x72'));}});if(_0xa4458d){return handleError(_0x3c65b4,null)(_0xa4458d);}if(_0x317d59[_0xf5b8('0x65')]['id']){delete _0x317d59['body']['id'];}return db[_0xf5b8('0x4e')][_0xf5b8('0x6f')]({'where':{'id':_0x317d59[_0xf5b8('0x73')]['id']},'include':[{'model':db[_0xf5b8('0x4b')],'as':_0xf5b8('0x4c')}]})['then'](handleEntityNotFound(_0x3c65b4,null))[_0xf5b8('0x18')](saveUpdates(_0x317d59[_0xf5b8('0x65')],null))[_0xf5b8('0x18')](respondWithResult(_0x3c65b4,null))[_0xf5b8('0x23')](handleError(_0x3c65b4,null));};exports[_0xf5b8('0x2d')]=function(_0x138280,_0x515aaa){return db['ChatWebsite'][_0xf5b8('0x6f')]({'where':{'id':_0x138280[_0xf5b8('0x73')]['id']}})[_0xf5b8('0x18')](handleEntityNotFound(_0x515aaa,null))['then'](removeEntity(_0x515aaa,null))[_0xf5b8('0x23')](handleError(_0x515aaa,null));};exports['describe']=function(_0x40be06,_0x4eb070){return db[_0xf5b8('0x4e')][_0xf5b8('0x74')]()[_0xf5b8('0x18')](respondWithResult(_0x4eb070,null))[_0xf5b8('0x23')](handleError(_0x4eb070,null));};exports['addDisposition']=function(_0xa73b6f,_0x4f4004){if(_0xa73b6f[_0xf5b8('0x65')]['id']){delete _0xa73b6f[_0xf5b8('0x65')]['id'];}return db[_0xf5b8('0x4e')][_0xf5b8('0x6f')]({'where':{'id':_0xa73b6f['params']['id']}})[_0xf5b8('0x18')](handleEntityNotFound(_0x4f4004,null))[_0xf5b8('0x18')](function(_0x18f7c4){if(_0x18f7c4){_0xa73b6f['body'][_0xf5b8('0x75')]=_0x18f7c4['id'];return db[_0xf5b8('0x76')][_0xf5b8('0x6a')](_0xa73b6f[_0xf5b8('0x65')]);}})[_0xf5b8('0x18')](respondWithResult(_0x4f4004,null))[_0xf5b8('0x23')](handleError(_0x4f4004,null));};exports[_0xf5b8('0x77')]=function(_0x95206,_0x2ce202){var _0x36456c={'raw':![],'where':{}};var _0x42b2a1={};var _0x382790={'count':0x0,'rows':[]};return db[_0xf5b8('0x4e')]['findOne']({'where':{'id':_0x95206['params']['id']}})[_0xf5b8('0x18')](handleEntityNotFound(_0x2ce202,null))['then'](function(_0x547749){if(_0x547749){_0x42b2a1[_0xf5b8('0x48')]=_[_0xf5b8('0x50')](db[_0xf5b8('0x76')]['rawAttributes']);_0x42b2a1['query']=_[_0xf5b8('0x50')](_0x95206[_0xf5b8('0x4f')]);_0x42b2a1[_0xf5b8('0x51')]=_[_0xf5b8('0x52')](_0x42b2a1['model'],_0x42b2a1[_0xf5b8('0x4f')]);_0x36456c[_0xf5b8('0x53')]=_[_0xf5b8('0x52')](_0x42b2a1[_0xf5b8('0x48')],qs[_0xf5b8('0x54')](_0x95206['query'][_0xf5b8('0x54')]));_0x36456c['attributes']=_0x36456c['attributes'][_0xf5b8('0x63')]?_0x36456c[_0xf5b8('0x53')]:_0x42b2a1[_0xf5b8('0x48')];if(!_0x95206[_0xf5b8('0x4f')][_0xf5b8('0x55')](_0xf5b8('0x56'))){_0x36456c[_0xf5b8('0x2a')]=qs['limit'](_0x95206[_0xf5b8('0x4f')][_0xf5b8('0x2a')]);_0x36456c[_0xf5b8('0x27')]=qs[_0xf5b8('0x27')](_0x95206['query'][_0xf5b8('0x27')]);}_0x36456c['order']=qs[_0xf5b8('0x58')](_0x95206[_0xf5b8('0x4f')]['sort']);_0x36456c[_0xf5b8('0x59')]=qs[_0xf5b8('0x51')](_['pick'](_0x95206['query'],_0x42b2a1['filters']));_0x36456c['where'][_0xf5b8('0x75')]=_0x547749['id'];if(_0x95206['query'][_0xf5b8('0x5b')]){_0x36456c[_0xf5b8('0x59')]=_[_0xf5b8('0x5c')](_0x36456c[_0xf5b8('0x59')],{'$or':_[_0xf5b8('0x4d')](_0x36456c[_0xf5b8('0x53')],function(_0x3a5f0a){var _0x4c0131={};_0x4c0131[_0x3a5f0a]={'$like':'%'+_0x95206[_0xf5b8('0x4f')]['filter']+'%'};return _0x4c0131;})});}_0x36456c=_[_0xf5b8('0x5c')]({},_0x36456c,_0x95206['options']);return db['Disposition'][_0xf5b8('0x29')]({'where':_0x36456c[_0xf5b8('0x59')]})[_0xf5b8('0x18')](function(_0x48794e){_0x382790[_0xf5b8('0x29')]=_0x48794e;if(_0x95206[_0xf5b8('0x4f')][_0xf5b8('0x64')]){_0x36456c[_0xf5b8('0x5f')]=[{'all':!![]}];}return db['Disposition'][_0xf5b8('0x78')](_0x36456c);})[_0xf5b8('0x18')](function(_0x2d7951){_0x382790[_0xf5b8('0x60')]=_0x2d7951;return _0x382790;});}})['then'](respondWithFilteredResult(_0x2ce202,_0x36456c))[_0xf5b8('0x23')](handleError(_0x2ce202,null));};exports[_0xf5b8('0x79')]=function(_0x2aaf11,_0x34966f){return db['ChatWebsite']['find']({'where':{'id':_0x2aaf11[_0xf5b8('0x73')]['id']}})[_0xf5b8('0x18')](handleEntityNotFound(_0x34966f,null))[_0xf5b8('0x18')](function(_0x284c80){if(_0x284c80){return _0x284c80[_0xf5b8('0x79')](_0x2aaf11[_0xf5b8('0x4f')]['ids']);}})['then'](respondWithStatusCode(_0x34966f,null))['catch'](handleError(_0x34966f,null));};exports[_0xf5b8('0x7a')]=function(_0x576bda,_0xd86aa1){if(_0x576bda[_0xf5b8('0x65')]['id']){delete _0x576bda[_0xf5b8('0x65')]['id'];}return db[_0xf5b8('0x4e')][_0xf5b8('0x6f')]({'where':{'id':_0x576bda[_0xf5b8('0x73')]['id']}})[_0xf5b8('0x18')](handleEntityNotFound(_0xd86aa1,null))[_0xf5b8('0x18')](function(_0x2a12b9){if(_0x2a12b9){_0x576bda[_0xf5b8('0x65')][_0xf5b8('0x75')]=_0x2a12b9['id'];return db['CannedAnswer'][_0xf5b8('0x6a')](_0x576bda[_0xf5b8('0x65')]);}})[_0xf5b8('0x18')](respondWithResult(_0xd86aa1,null))[_0xf5b8('0x23')](handleError(_0xd86aa1,null));};exports[_0xf5b8('0x7b')]=function(_0x34a19a,_0x497851){var _0x4d589b={'raw':![],'where':{}};var _0x3c7afe={};var _0x5175fd={'count':0x0,'rows':[]};return db[_0xf5b8('0x4e')][_0xf5b8('0x7c')]({'where':{'id':_0x34a19a[_0xf5b8('0x73')]['id']}})['then'](handleEntityNotFound(_0x497851,null))[_0xf5b8('0x18')](function(_0x404a90){if(_0x404a90){_0x3c7afe[_0xf5b8('0x48')]=_[_0xf5b8('0x50')](db[_0xf5b8('0x7d')][_0xf5b8('0x62')]);_0x3c7afe['query']=_[_0xf5b8('0x50')](_0x34a19a[_0xf5b8('0x4f')]);_0x3c7afe[_0xf5b8('0x51')]=_[_0xf5b8('0x52')](_0x3c7afe[_0xf5b8('0x48')],_0x3c7afe['query']);_0x4d589b[_0xf5b8('0x53')]=_[_0xf5b8('0x52')](_0x3c7afe[_0xf5b8('0x48')],qs[_0xf5b8('0x54')](_0x34a19a['query'][_0xf5b8('0x54')]));_0x4d589b[_0xf5b8('0x53')]=_0x4d589b[_0xf5b8('0x53')][_0xf5b8('0x63')]?_0x4d589b[_0xf5b8('0x53')]:_0x3c7afe['model'];if(!_0x34a19a['query'][_0xf5b8('0x55')](_0xf5b8('0x56'))){_0x4d589b['limit']=qs['limit'](_0x34a19a[_0xf5b8('0x4f')][_0xf5b8('0x2a')]);_0x4d589b[_0xf5b8('0x27')]=qs['offset'](_0x34a19a[_0xf5b8('0x4f')][_0xf5b8('0x27')]);}_0x4d589b[_0xf5b8('0x57')]=qs[_0xf5b8('0x58')](_0x34a19a[_0xf5b8('0x4f')][_0xf5b8('0x58')]);_0x4d589b['where']=qs[_0xf5b8('0x51')](_[_0xf5b8('0x5a')](_0x34a19a[_0xf5b8('0x4f')],_0x3c7afe[_0xf5b8('0x51')]));_0x4d589b[_0xf5b8('0x59')][_0xf5b8('0x75')]=_0x404a90['id'];if(_0x34a19a[_0xf5b8('0x4f')][_0xf5b8('0x5b')]){_0x4d589b[_0xf5b8('0x59')]=_['merge'](_0x4d589b[_0xf5b8('0x59')],{'$or':_['map'](_0x4d589b['attributes'],function(_0x9957f6){var _0x4d160={};_0x4d160[_0x9957f6]={'$like':'%'+_0x34a19a[_0xf5b8('0x4f')][_0xf5b8('0x5b')]+'%'};return _0x4d160;})});}_0x4d589b=_[_0xf5b8('0x5c')]({},_0x4d589b,_0x34a19a[_0xf5b8('0x5e')]);return db[_0xf5b8('0x7d')]['count']({'where':_0x4d589b['where']})[_0xf5b8('0x18')](function(_0x30e65b){_0x5175fd[_0xf5b8('0x29')]=_0x30e65b;if(_0x34a19a[_0xf5b8('0x4f')]['includeAll']){_0x4d589b[_0xf5b8('0x5f')]=[{'all':!![]}];}return db[_0xf5b8('0x7d')][_0xf5b8('0x78')](_0x4d589b);})[_0xf5b8('0x18')](function(_0xffbece){_0x5175fd['rows']=_0xffbece;return _0x5175fd;});}})['then'](respondWithFilteredResult(_0x497851,_0x4d589b))['catch'](handleError(_0x497851,null));};exports[_0xf5b8('0x7e')]=function(_0x35133d,_0x17a949){return db[_0xf5b8('0x4e')][_0xf5b8('0x6f')]({'where':{'id':_0x35133d[_0xf5b8('0x73')]['id']}})['then'](handleEntityNotFound(_0x17a949,null))[_0xf5b8('0x18')](function(_0x3369b4){if(_0x3369b4){return _0x3369b4[_0xf5b8('0x7e')](_0x35133d[_0xf5b8('0x4f')][_0xf5b8('0x7f')]);}})[_0xf5b8('0x18')](respondWithStatusCode(_0x17a949,null))['catch'](handleError(_0x17a949,null));};exports['addLogo']=function(_0x1bccf0,_0x288cf3){_0x1bccf0['body'][_0xf5b8('0x80')]=_0x1bccf0[_0xf5b8('0x81')][_0xf5b8('0x82')];return db[_0xf5b8('0x4e')]['find']({'where':{'id':_0x1bccf0[_0xf5b8('0x73')]['id']}})['then'](handleEntityNotFound(_0x288cf3,null))[_0xf5b8('0x18')](saveUpdates(_0x1bccf0[_0xf5b8('0x65')],null))[_0xf5b8('0x18')](respondWithResult(_0x288cf3,null))[_0xf5b8('0x23')](handleError(_0x288cf3,null));};exports[_0xf5b8('0x83')]=function(_0x119ed1,_0x183c64){_0x119ed1[_0xf5b8('0x65')][_0xf5b8('0x84')]=_0x119ed1[_0xf5b8('0x81')][_0xf5b8('0x82')];return db['ChatWebsite'][_0xf5b8('0x6f')]({'where':{'id':_0x119ed1[_0xf5b8('0x73')]['id']}})['then'](handleEntityNotFound(_0x183c64,null))['then'](saveUpdates(_0x119ed1[_0xf5b8('0x65')],null))[_0xf5b8('0x18')](respondWithResult(_0x183c64,null))['catch'](handleError(_0x183c64,null));};exports[_0xf5b8('0x85')]=function(_0x1bfdde,_0x5d4d9c){_0x1bfdde[_0xf5b8('0x65')][_0xf5b8('0x86')]=_0x1bfdde[_0xf5b8('0x81')][_0xf5b8('0x82')];return db[_0xf5b8('0x4e')][_0xf5b8('0x6f')]({'where':{'id':_0x1bfdde[_0xf5b8('0x73')]['id']}})[_0xf5b8('0x18')](handleEntityNotFound(_0x5d4d9c,null))[_0xf5b8('0x18')](saveUpdates(_0x1bfdde[_0xf5b8('0x65')],null))[_0xf5b8('0x18')](respondWithResult(_0x5d4d9c,null))['catch'](handleError(_0x5d4d9c,null));};exports[_0xf5b8('0x87')]=function(_0x375e3e,_0xc16a21){_0x375e3e[_0xf5b8('0x65')][_0xf5b8('0x88')]=_0x375e3e['file'][_0xf5b8('0x82')];return db['ChatWebsite'][_0xf5b8('0x6f')]({'where':{'id':_0x375e3e[_0xf5b8('0x73')]['id']}})[_0xf5b8('0x18')](handleEntityNotFound(_0xc16a21,null))['then'](saveUpdates(_0x375e3e[_0xf5b8('0x65')],null))['then'](respondWithResult(_0xc16a21,null))[_0xf5b8('0x23')](handleError(_0xc16a21,null));};exports[_0xf5b8('0x89')]=function(_0x29560d,_0x267f70){var _0x565aa7=path[_0xf5b8('0x8a')](config[_0xf5b8('0x8b')],'server/files/images/logos/default_logo.svg');var _0x978db3={'where':{'id':_0x29560d['params']['id']},'attributes':['id',_0xf5b8('0x80')],'raw':!![]};var _0x3c70ca=![];return require(_0xf5b8('0x8c'))[_0xf5b8('0x8d')]()[_0xf5b8('0x18')](function(_0x2dda92){if(_0x2dda92){_0x3c70ca=_0x2dda92[_0xf5b8('0x8e')];}})['then'](function(){return db[_0xf5b8('0x4e')]['find'](_0x978db3);})[_0xf5b8('0x18')](handleEntityNotFound(_0x267f70,null))[_0xf5b8('0x18')](function(_0x303e54){if(_0x303e54){if(!_[_0xf5b8('0x8f')](_0x303e54[_0xf5b8('0x80')])){if(fs[_0xf5b8('0x90')](path[_0xf5b8('0x8a')](config[_0xf5b8('0x8b')],_0xf5b8('0x91'),_0x303e54[_0xf5b8('0x80')]))&&_0x3c70ca){_0x565aa7=path[_0xf5b8('0x8a')](config[_0xf5b8('0x8b')],'server/files/images/logos/',_0x303e54['sitepic']);}}return _0x267f70['download'](_0x565aa7);}})[_0xf5b8('0x23')](handleError(_0x267f70,null));};exports[_0xf5b8('0x92')]=function(_0x2e81e6,_0x2e3788){var _0x2cc48a=path[_0xf5b8('0x8a')](config[_0xf5b8('0x8b')],_0xf5b8('0x93'));var _0x1f3d7c={'where':{'id':_0x2e81e6[_0xf5b8('0x73')]['id']},'attributes':['id',_0xf5b8('0x84')],'raw':!![]};return db[_0xf5b8('0x4e')][_0xf5b8('0x6f')](_0x1f3d7c)['then'](handleEntityNotFound(_0x2e3788,null))[_0xf5b8('0x18')](function(_0x30617e){if(_0x30617e){if(!_[_0xf5b8('0x8f')](_0x30617e[_0xf5b8('0x84')])){if(fs['existsSync'](path[_0xf5b8('0x8a')](config['root'],_0xf5b8('0x94'),_0x30617e[_0xf5b8('0x84')]))){_0x2cc48a=path['join'](config['root'],_0xf5b8('0x94'),_0x30617e[_0xf5b8('0x84')]);}}return _0x2e3788[_0xf5b8('0x95')](_0x2cc48a);}})['catch'](handleError(_0x2e3788,null));};exports[_0xf5b8('0x96')]=function(_0x1bc8e4,_0x2131dc){var _0x36c777=path[_0xf5b8('0x8a')](config['root'],_0xf5b8('0x97'));var _0x4fa447={'where':{'id':_0x1bc8e4[_0xf5b8('0x73')]['id']},'attributes':['id',_0xf5b8('0x86'),_0xf5b8('0x98')],'raw':!![]};return db[_0xf5b8('0x4e')][_0xf5b8('0x6f')](_0x4fa447)[_0xf5b8('0x18')](handleEntityNotFound(_0x2131dc,null))[_0xf5b8('0x18')](function(_0x1c7be7){if(_0x1c7be7){if(!_['isNil'](_0x1c7be7[_0xf5b8('0x86')])){if(fs[_0xf5b8('0x90')](path['join'](config[_0xf5b8('0x8b')],'server/files/images/avatars/',_0x1c7be7[_0xf5b8('0x86')]))&&_0x1c7be7[_0xf5b8('0x98')]){_0x36c777=path['join'](config[_0xf5b8('0x8b')],_0xf5b8('0x94'),_0x1c7be7['customerAvatar']);}}return _0x2131dc[_0xf5b8('0x95')](_0x36c777);}})[_0xf5b8('0x23')](handleError(_0x2131dc,null));};exports[_0xf5b8('0x99')]=function(_0xd38b80,_0x5129bd){var _0x5387ea=path[_0xf5b8('0x8a')](config[_0xf5b8('0x8b')],_0xf5b8('0x9a'));var _0x5cfdab={'where':{'id':_0xd38b80[_0xf5b8('0x73')]['id']},'attributes':['id',_0xf5b8('0x88')],'raw':!![]};return db['ChatWebsite']['find'](_0x5cfdab)[_0xf5b8('0x18')](handleEntityNotFound(_0x5129bd,null))['then'](function(_0x4d072d){if(_0x4d072d){if(!_[_0xf5b8('0x8f')](_0x4d072d[_0xf5b8('0x88')])){if(fs['existsSync'](path[_0xf5b8('0x8a')](config[_0xf5b8('0x8b')],_0xf5b8('0x94'),_0x4d072d[_0xf5b8('0x88')]))){_0x5387ea=path[_0xf5b8('0x8a')](config['root'],_0xf5b8('0x94'),_0x4d072d[_0xf5b8('0x88')]);}}return _0x5129bd[_0xf5b8('0x95')](_0x5387ea);}})[_0xf5b8('0x23')](handleError(_0x5129bd,null));};function checkWebsiteInterval(_0x4fed03){var _0x44480b=_0x4fed03[_0xf5b8('0x9b')];if(!_0x44480b){return Promise['resolve'](_0x4fed03);}var _0x2aedd1=_0x4fed03['timezone']||undefined;return _0x44480b[_0xf5b8('0x9c')](_0x2aedd1)[_0xf5b8('0x18')](function(_0x569fb6){if(!_0x569fb6){throw new APIOutOfIntervalError();}return _0x4fed03;});}exports[_0xf5b8('0x9d')]=function(_0x39e1c5,_0x1a728f){var _0x1081a5={'body':_0x39e1c5[_0xf5b8('0x65')],'channel':_0xf5b8('0x9e')};var _0x45112b=[];var _0x561421=[];var _0x4d5687={};var _0x2f7370=![];if(_0x39e1c5['body']['id']){delete _0x39e1c5[_0xf5b8('0x65')]['id'];}if(_[_0xf5b8('0x8f')](_0x39e1c5[_0xf5b8('0x65')][_0xf5b8('0x9f')])){throw new APIBadRequestError(_0xf5b8('0xa0'));}if(_['isNil'](_0x39e1c5['body'][_0xf5b8('0xa1')])){throw new APIBadRequestError(_0xf5b8('0xa2'));}if(_['isEmpty'](_0x39e1c5[_0xf5b8('0x65')][_0xf5b8('0x65')])){throw new APIBadRequestError(_0xf5b8('0xa3'));}var _0x271355=_0x39e1c5[_0xf5b8('0x65')]['customerIp']&&_0x39e1c5[_0xf5b8('0x65')][_0xf5b8('0x40')];return db['CmContact'][_0xf5b8('0x74')]()['then'](function(_0x2ca6fc){if(!_0x2ca6fc){throw new Error('No\x20available\x20attributes');}_0x45112b=Object['keys'](_0x2ca6fc)[_0xf5b8('0x5b')](function(_0xed9c7e){return![_0xf5b8('0xa4'),_0xf5b8('0xa5')]['includes'](_0xed9c7e);});_0x561421=Object['keys'](_0x2ca6fc)[_0xf5b8('0x5b')](function(_0x41bcf2){return![_0xf5b8('0xa4'),'updatedAt',_0xf5b8('0xa6'),_0xf5b8('0xa7')]['includes'](_0x41bcf2);});if(!_['includes'](_0x561421,_0x39e1c5[_0xf5b8('0x65')][_0xf5b8('0xa1')])){throw new APIBadRequestError(_0xf5b8('0xa8')+_0x561421[_0xf5b8('0x8a')](',\x20'));}_0x4d5687[_0x39e1c5[_0xf5b8('0x65')]['mapKey']]=_0x39e1c5[_0xf5b8('0x65')][_0xf5b8('0x9f')];})['then'](function(){return db[_0xf5b8('0x4e')][_0xf5b8('0x6f')]({'where':{'id':_0x39e1c5['params']['id']},'include':[{'model':db[_0xf5b8('0xa9')],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':_0x4d5687,'limit':0x1,'order':[[_0xf5b8('0xa5'),'DESC']]}]},{'model':db['ChatApplication'],'as':_0xf5b8('0xaa')},{'model':db[_0xf5b8('0x9b')],'as':_0xf5b8('0x9b'),'include':[{'model':db[_0xf5b8('0x9b')],'as':_0xf5b8('0xab'),'attributes':['id',_0xf5b8('0xac')],'raw':!![]}]}]});})[_0xf5b8('0x18')](function(_0x9da925){if(!_0x9da925){throw new APINotFoundError(util[_0xf5b8('0x45')](_0xf5b8('0xad'),_0x39e1c5[_0xf5b8('0x73')]['id']));}if(_0x271355){return checkWebsiteInterval(_0x9da925);}return _0x9da925;})[_0xf5b8('0x18')](function(_0x186f21){_0x1081a5['account']=_0x186f21;_0x1081a5[_0xf5b8('0xae')]=_['orderBy'](_0x186f21[_0xf5b8('0xaa')],[_0xf5b8('0xaf')],[_0xf5b8('0xb0')]);if(_0x1081a5['account'][_0xf5b8('0xaa')]){delete _0x1081a5['account']['Applications'];}_0x1081a5['list']=_0x186f21[_0xf5b8('0xb1')]||{'id':_0x186f21[_0xf5b8('0xa7')]};if(_0x1081a5[_0xf5b8('0xb2')]&&_0x1081a5[_0xf5b8('0xb2')][_0xf5b8('0xb3')]['length']){return _0x1081a5[_0xf5b8('0xb2')][_0xf5b8('0xb3')][0x0];}var _0x5df38c=_[_0xf5b8('0xb4')](_0x39e1c5[_0xf5b8('0x65')],{'firstName':_0x39e1c5[_0xf5b8('0x65')]['from'],'ListId':_0x186f21[_0xf5b8('0xa7')]});_0x5df38c[_0x39e1c5[_0xf5b8('0x65')][_0xf5b8('0xa1')]]=_0x39e1c5[_0xf5b8('0x65')][_0xf5b8('0x9f')];return db[_0xf5b8('0xb5')][_0xf5b8('0x6a')](_0x5df38c,{'fields':_0x45112b,'raw':!![]});})['then'](function(_0x131052){_0x1081a5[_0xf5b8('0xb6')]=_0x131052;var _0x55a7a1=createInteractionObject(_0x39e1c5['params']['id'],_0x39e1c5[_0xf5b8('0x65')],_0x39e1c5[_0xf5b8('0xb7')],_0x131052);var _0x213550={'ChatWebsiteId':_0x39e1c5[_0xf5b8('0x73')]['id']};if(_0x39e1c5[_0xf5b8('0x65')][_0xf5b8('0xb8')]){_0x213550[_0xf5b8('0xb8')]=_0x39e1c5[_0xf5b8('0x65')][_0xf5b8('0xb8')];_0x213550[_0xf5b8('0xb9')]=![];return db[_0xf5b8('0xba')][_0xf5b8('0x6f')]({'where':_0x213550})[_0xf5b8('0x18')](function(_0x2e4e92){var _0x39370f=_0x39e1c5[_0xf5b8('0x65')][_0xf5b8('0x38')]&&_0x39e1c5[_0xf5b8('0x65')][_0xf5b8('0x40')];if(_0x2e4e92){_0x2f7370=!![];return _0x2e4e92;}else if(!_0x39370f&&_0x2e4e92&&_0x2e4e92['closed']){throw new APIConflictError(_0xf5b8('0xbb'));}_0x55a7a1[_0xf5b8('0xb8')]=_0x39e1c5[_0xf5b8('0x65')]['threadId'];_0x55a7a1['externalUrl']=_0x39e1c5['body'][_0xf5b8('0xbc')];return db['ChatInteraction'][_0xf5b8('0x6a')](_0x55a7a1);});}_0x213550[_0xf5b8('0xbd')]=_0x131052['id'];if(_0x39e1c5[_0xf5b8('0x65')][_0xf5b8('0xbe')]&&_0x39e1c5[_0xf5b8('0x65')][_0xf5b8('0xbe')]['id']){_0x213550['id']=_0x39e1c5[_0xf5b8('0x65')][_0xf5b8('0xbe')]['id'];return db[_0xf5b8('0xba')][_0xf5b8('0x6f')]({'where':_0x213550})[_0xf5b8('0x18')](function(_0x38ad78){var _0x1f6e87=_0x39e1c5['body'][_0xf5b8('0x38')]&&_0x39e1c5[_0xf5b8('0x65')][_0xf5b8('0x40')];if(!_0x1f6e87&&_0x38ad78&&_0x38ad78[_0xf5b8('0xb9')]){throw new APIConflictError(_0xf5b8('0xbb'));}else if(_0x38ad78){_0x2f7370=!![];return _0x38ad78;}else{return db[_0xf5b8('0xba')][_0xf5b8('0x6a')](_0x55a7a1);}});}return db[_0xf5b8('0xba')]['create'](_0x55a7a1);})['then'](function(_0x460139){if(!_0x2f7370){return _0x460139;}var _0x278d07={'from':(_0x1081a5[_0xf5b8('0xb6')]['firstName']||'')+'\x20'+(_0x1081a5[_0xf5b8('0xb6')][_0xf5b8('0x3e')]||'')};if(_0x39e1c5[_0xf5b8('0x65')][_0xf5b8('0xb8')]&&_0x39e1c5[_0xf5b8('0x65')][_0xf5b8('0xbf')]&&_0x39e1c5[_0xf5b8('0x65')][_0xf5b8('0xb8')]!=_0x39e1c5[_0xf5b8('0x65')][_0xf5b8('0xbf')]){_0x278d07['threadId']=_0x39e1c5[_0xf5b8('0x65')]['messageId'];}return _0x460139['update'](_0x278d07);})[_0xf5b8('0x18')](function(_0xfeb07c){_0x1081a5[_0xf5b8('0xbe')]=_0xfeb07c[_0xf5b8('0x2e')]({'plain':!![]});_0x1081a5['interaction'][_0xf5b8('0xc0')]=!_0x2f7370;if(_0x1081a5[_0xf5b8('0xbe')][_0xf5b8('0xc0')]){if(_0x1081a5['account'][_0xf5b8('0xc1')]){_0x1081a5[_0xf5b8('0xae')][_0xf5b8('0xc2')]({'id':0x0,'priority':_0x1081a5['applications'][_0xf5b8('0x63')]+0x1,'app':_0xf5b8('0xc3'),'appdata':'unmanaged','interval':_0xf5b8('0xc4')});}}return db[_0xf5b8('0xc5')][_0xf5b8('0x6a')]({'body':_0x39e1c5[_0xf5b8('0x65')][_0xf5b8('0x65')],'ChatWebsiteId':_0x39e1c5[_0xf5b8('0x73')]['id'],'ChatInteractionId':_0xfeb07c['id'],'direction':'in','ContactId':_0x1081a5[_0xf5b8('0xb6')]['id'],'AttachmentId':_0x39e1c5[_0xf5b8('0x65')][_0xf5b8('0xc6')]});})[_0xf5b8('0x18')](function(_0x282dfe){_0x1081a5[_0xf5b8('0x21')]=_0x282dfe;if(!_0x1081a5[_0xf5b8('0xbe')][_0xf5b8('0xc7')]){return;}return db[_0xf5b8('0xc8')]['find']({'attributes':['id',_0xf5b8('0x33')],'where':{'id':_0x1081a5[_0xf5b8('0xbe')][_0xf5b8('0xc7')]}});})[_0xf5b8('0x18')](function(_0x238ff4){if(_0x238ff4){_0x1081a5[_0xf5b8('0xae')]['unshift']({'id':0x0,'priority':0x0,'app':_0xf5b8('0xc9'),'appdata':_0x238ff4[_0xf5b8('0x33')]+','+(_0x1081a5['account'][_0xf5b8('0xca')]||0xa),'interval':_0xf5b8('0xc4')});_0x1081a5[_0xf5b8('0xcb')]=!![];}if(!_0x1081a5[_0xf5b8('0xbe')][_0xf5b8('0xcc')]){return;}return db[_0xf5b8('0xcd')][_0xf5b8('0x6f')]({'attributes':['id',_0xf5b8('0x33')],'where':{'id':_0x1081a5[_0xf5b8('0xbe')][_0xf5b8('0xcc')]}});})['then'](function(_0x4b78ef){if(_0x4b78ef){_0x1081a5['applications'][_0xf5b8('0xce')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x4b78ef[_0xf5b8('0x33')]+','+(_0x1081a5['account'][_0xf5b8('0xcf')]||0x12c),'interval':_0xf5b8('0xc4')});}return respondWithRpcPromise('Start','startRouting',_0x1081a5);})[_0xf5b8('0x18')](function(_0x36b4c5){respondWithRpcPromise(_0xf5b8('0xd0'),_0xf5b8('0xd0'),{'event':_0xf5b8('0x9d'),'message':_0x36b4c5},client9002);return _0x36b4c5;})[_0xf5b8('0x18')](respondWithResult(_0x1a728f,null))[_0xf5b8('0x23')](APIHandleError(_0x1a728f));};exports[_0xf5b8('0xd1')]=function(_0x26aaa3,_0x3a0bfe){var _0x47772a,_0x43f722,_0x1f786d;var _0x152d92=[];var _0x3183c8={};var _0x186787=_0x26aaa3[_0xf5b8('0xd2')]||[];var _0x24e741=[];var _0xb7a643;return db['CmContact'][_0xf5b8('0x74')]()[_0xf5b8('0x18')](function(_0x1b4cc9){if(!_0x1b4cc9){throw new db[(_0xf5b8('0xd3'))][(_0xf5b8('0xd4'))](_0xf5b8('0xd5'));}_0x152d92=_[_0xf5b8('0xd6')](_[_0xf5b8('0x50')](_0x1b4cc9),[_0xf5b8('0xa4'),_0xf5b8('0xa5'),_0xf5b8('0xa6'),_0xf5b8('0xa7')]);if(_0x26aaa3['body']['id']){delete _0x26aaa3['body']['id'];}if(_[_0xf5b8('0x8f')](_0x26aaa3['body'][_0xf5b8('0x9f')])){throw _0x3a0bfe[_0xf5b8('0x25')](0x1f4)['send'](new db[(_0xf5b8('0xd3'))][(_0xf5b8('0xd4'))](_0xf5b8('0xd7')));}if(_[_0xf5b8('0x8f')](_0x26aaa3[_0xf5b8('0x65')][_0xf5b8('0x65')])||_0x26aaa3['body']['body']===''){throw _0x3a0bfe[_0xf5b8('0x25')](0x1f4)[_0xf5b8('0x34')](new db['Sequelize']['ValidationError'](_0xf5b8('0xd8')));}if(_[_0xf5b8('0x8f')](_0x26aaa3['body']['mapKeyOffline'])){throw _0x3a0bfe['status'](0x1f4)[_0xf5b8('0x34')](new db[(_0xf5b8('0xd3'))][(_0xf5b8('0xd4'))](_0xf5b8('0xd9')+_0x152d92));}if(!_[_0xf5b8('0xda')](_0x152d92,_0x26aaa3[_0xf5b8('0x65')]['mapKeyOffline'])){throw _0x3a0bfe[_0xf5b8('0x25')](0x1f4)[_0xf5b8('0x34')](new db[(_0xf5b8('0xd3'))]['ValidationError'](_0xf5b8('0xdb')+_0x152d92));}_0x3183c8[_0x26aaa3[_0xf5b8('0x65')][_0xf5b8('0xdc')]]=_0x26aaa3[_0xf5b8('0x65')]['from'];})[_0xf5b8('0x18')](function(){return db[_0xf5b8('0x4e')]['find']({'where':{'id':_0x26aaa3[_0xf5b8('0x73')]['id']},'include':[{'model':db[_0xf5b8('0xa9')],'as':_0xf5b8('0xb1')},{'model':db[_0xf5b8('0xdd')],'as':_0xf5b8('0xdd')}]});})[_0xf5b8('0x18')](handleEntityNotFound(_0x3a0bfe,null))[_0xf5b8('0x18')](function(_0x5cfa21){if(_0x5cfa21&&_0x5cfa21[_0xf5b8('0xb1')]){_0x43f722=_0x5cfa21;var _0x241e93=_[_0xf5b8('0xb4')](_0x26aaa3['body'],{'firstName':_0x26aaa3[_0xf5b8('0x65')][_0xf5b8('0x9f')],'phone':_0x26aaa3[_0xf5b8('0x65')][_0xf5b8('0x9f')],'ListId':_0x5cfa21[_0xf5b8('0xa7')]});_0x241e93[_0x26aaa3[_0xf5b8('0x65')][_0xf5b8('0xdc')]]=_0x26aaa3[_0xf5b8('0x65')][_0xf5b8('0x9f')];return db[_0xf5b8('0xb5')]['findOrCreate']({'where':_0x3183c8,'defaults':_0x241e93});}})[_0xf5b8('0xde')](function(_0x53b8d7){if(_0x53b8d7){_0x1f786d=_0x53b8d7;var _0x3277ef=fs[_0xf5b8('0xdf')](path[_0xf5b8('0x8a')](config['root'],'server/files/templates/chatOfflineMessage.ejs'),'utf8');var _0x597be9=ejs[_0xf5b8('0xe0')](_0x3277ef,{'body':_['toPairs'](_0x26aaa3[_0xf5b8('0x65')]['body']),'bodyTitle':_0x43f722[_0xf5b8('0xe1')]});return db[_0xf5b8('0xe2')][_0xf5b8('0x6a')]({'body':_0x597be9,'plainBody':htmlToText[_0xf5b8('0xe3')](_0x597be9),'ContactId':_0x53b8d7['id'],'ChatWebsiteId':_0x43f722['id']});}})[_0xf5b8('0x18')](function(_0x1bd931){_0xb7a643=_0x1bd931;if(_0x186787[_0xf5b8('0x63')]){var _0x57ff00=_0x186787[_0xf5b8('0x4d')](function(_0x24ce4d){return{'name':_0x24ce4d[_0xf5b8('0xe4')],'basename':_0x24ce4d[_0xf5b8('0x82')],'type':_0x24ce4d[_0xf5b8('0xe5')],'ChatOfflineMessageId':_0x1bd931['id']};});_0x24e741=_0x57ff00['map'](_0x41044c=>{var _0x4d3b24={'filename':_0x41044c[_0xf5b8('0x33')],'path':path[_0xf5b8('0x8a')](config[_0xf5b8('0x8b')],_0xf5b8('0xe6'),'files','attachments',_0xf5b8('0xe7'),_0x41044c[_0xf5b8('0xe8')])};return _0x4d3b24;});if(!_0x43f722[_0xf5b8('0xe9')]){return db[_0xf5b8('0xea')]['transaction'](function(_0x4dbc1b){return db[_0xf5b8('0xeb')][_0xf5b8('0xec')](_0x57ff00,{'transaction':_0x4dbc1b});});}}})['then'](function(){if(_0xb7a643){_0x47772a=_0xb7a643;return db[_0xf5b8('0xdd')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xf5b8('0xed')],'as':_0xf5b8('0xee'),'raw':!![],'include':[{'model':db[_0xf5b8('0xef')],'as':'CloudProvider','raw':!![]}]}]});}})[_0xf5b8('0x18')](function(_0x2352e7){if(_0x2352e7&&_0x2352e7[_0xf5b8('0xee')]&&_0x43f722[_0xf5b8('0xf0')]&&_0x43f722[_0xf5b8('0xf1')]){var _0x40557f=_0x2352e7['getSmtpOptions']();return respondWithRpcPromise(_0xf5b8('0xf2'),'sendMail',{'account':_0x40557f,'message':{'from':util[_0xf5b8('0x45')]('\x22%s\x22\x20<%s>',_0x2352e7[_0xf5b8('0x33')],_0x2352e7[_0xf5b8('0xf3')]||_0x2352e7[_0xf5b8('0xee')][_0xf5b8('0x6d')]),'to':_0x43f722[_0xf5b8('0xf1')],'subject':_0x43f722['offlineMessageSubject'],'html':_0x47772a[_0xf5b8('0x65')],'attachments':_0x24e741}},client9003)[_0xf5b8('0x18')](function(){return _0x47772a;})['catch'](function(_0x19bf82){logger[_0xf5b8('0x1e')](_0x19bf82);});}})[_0xf5b8('0x18')](function(){if(_0x43f722&&_0x43f722[_0xf5b8('0xe9')]&&_0x43f722[_0xf5b8('0xf4')]){var _0x2de543=[];if(_0x186787[_0xf5b8('0x63')]){_0x2de543=_0x186787[_0xf5b8('0x4d')](function(_0x1b5bbc){return{'name':_0x1b5bbc[_0xf5b8('0xe4')],'basename':_0x1b5bbc['filename'],'type':_0x1b5bbc[_0xf5b8('0xe5')],'ChatOfflineMessageId':_0xb7a643['id']};});}var _0x5d7b6f;if(!_[_0xf5b8('0x8f')](_0x43f722[_0xf5b8('0xf5')])){var _0x3a133c=_['map'](_0x26aaa3[_0xf5b8('0x65')],function(_0x489f34){return _0x489f34;});var _0x23de58=_[_0xf5b8('0xf6')](_0x3a133c)[0x0];var _0x17c449=_[_0xf5b8('0xf7')](_0x23de58,function(_0x2cbcb2){return _0x2cbcb2;});_0x5d7b6f=_0x17c449[0x1][_0x43f722[_0xf5b8('0xf5')]];}var _0x123206={'from':_0x1f786d[_0xf5b8('0xf3')],'firstName':_0x1f786d[_0xf5b8('0x3d')],'lastName':_0x1f786d[_0xf5b8('0x3e')],'mapKey':_0xf5b8('0xf3'),'message':{'from':_0x1f786d[_0xf5b8('0xf3')],'to':_0x43f722['MailAccount']['email'],'cc':'','subject':_[_0xf5b8('0x8f')](_0x5d7b6f)?_0x43f722['offlineMessageSubject']:_0x5d7b6f,'messageId':'','sentAt':new Date(),'attach':_0x2de543['length'],'attachments':_0x2de543,'originChannel':_0xf5b8('0xf8'),'ChatWebsiteId':_0x43f722['id'],'ChatOfflineMessageId':_0x47772a['id'],'originTo':_0x43f722[_0xf5b8('0xdd')][_0xf5b8('0xf3')]},'body':_0x47772a[_0xf5b8('0x65')]};var _0x41a88b={'account':{'id':_0x43f722[_0xf5b8('0xf4')]},'body':_0x123206,'log':_0xf5b8('0xf9')};return respondWithRpcPromise('NotifyMailAccount',_0xf5b8('0xfa'),_0x41a88b,client9001)[_0xf5b8('0x18')](function(){return _0x47772a;})['catch'](function(_0xf12104){logger['error'](_0xf12104);});}return;})[_0xf5b8('0x18')](function(){if(_0x47772a){return _0x47772a;}})[_0xf5b8('0x18')](respondWithResult(_0x3a0bfe,null))[_0xf5b8('0x23')](function(){for(var _0x71c0a8 of _0x186787){var _0x4cfdfd=path[_0xf5b8('0x8a')](config[_0xf5b8('0x8b')],_0xf5b8('0xe6'),'files','attachments',_0xf5b8('0xe7'),_0x71c0a8['filename']);fs_extra[_0xf5b8('0xfb')](_0x4cfdfd)[_0xf5b8('0x23')](function(_0xa5ce09){logger[_0xf5b8('0x1e')](_0xf5b8('0xfc'),_0x4cfdfd,_0xa5ce09);});}});};exports[_0xf5b8('0xfd')]=function(_0x4938d2,_0x3a60a3){return db[_0xf5b8('0xba')][_0xf5b8('0x6f')]({'where':{'id':_0x4938d2[_0xf5b8('0x73')]['id']}})[_0xf5b8('0x18')](handleEntityNotFound(_0x3a60a3,null))[_0xf5b8('0x18')](function(_0x573ef9){if(_0x573ef9){return _0x573ef9[_0xf5b8('0xfd')](_0x4938d2[_0xf5b8('0x65')][_0xf5b8('0x7f')],_[_0xf5b8('0xfe')](_0x4938d2['body'],[_0xf5b8('0x7f'),'id'])||{});}})[_0xf5b8('0x18')](respondWithResult(_0x3a60a3,null))[_0xf5b8('0x23')](handleError(_0x3a60a3,null));};exports['getInteractions']=function(_0xed9e3f,_0x1b6188){var _0x1c04af={'raw':![],'where':{}};var _0x2f91c9={};var _0x142055={'count':0x0,'rows':[]};return db[_0xf5b8('0x4e')][_0xf5b8('0x7c')]({'where':{'id':_0xed9e3f['params']['id']}})[_0xf5b8('0x18')](handleEntityNotFound(_0x1b6188,null))[_0xf5b8('0x18')](function(_0x3fa075){if(_0x3fa075){_0x2f91c9[_0xf5b8('0x48')]=_[_0xf5b8('0x50')](db[_0xf5b8('0xba')][_0xf5b8('0x62')]);_0x2f91c9[_0xf5b8('0x4f')]=_[_0xf5b8('0x50')](_0xed9e3f['query']);_0x2f91c9[_0xf5b8('0x51')]=_['intersection'](_0x2f91c9[_0xf5b8('0x48')],_0x2f91c9[_0xf5b8('0x4f')]);_0x1c04af[_0xf5b8('0x53')]=_[_0xf5b8('0x52')](_0x2f91c9[_0xf5b8('0x48')],qs[_0xf5b8('0x54')](_0xed9e3f[_0xf5b8('0x4f')][_0xf5b8('0x54')]));_0x1c04af['attributes']=_0x1c04af[_0xf5b8('0x53')]['length']?_0x1c04af['attributes']:_0x2f91c9[_0xf5b8('0x48')];if(!_0xed9e3f[_0xf5b8('0x4f')]['hasOwnProperty'](_0xf5b8('0x56'))){_0x1c04af[_0xf5b8('0x2a')]=qs[_0xf5b8('0x2a')](_0xed9e3f[_0xf5b8('0x4f')][_0xf5b8('0x2a')]);_0x1c04af['offset']=qs[_0xf5b8('0x27')](_0xed9e3f['query'][_0xf5b8('0x27')]);}_0x1c04af[_0xf5b8('0x57')]=qs['sort'](_0xed9e3f[_0xf5b8('0x4f')][_0xf5b8('0x58')]);_0x1c04af['where']=qs['filters'](_[_0xf5b8('0x5a')](_0xed9e3f[_0xf5b8('0x4f')],_0x2f91c9[_0xf5b8('0x51')]));_0x1c04af[_0xf5b8('0x59')][_0xf5b8('0x75')]=_0x3fa075['id'];if(_0xed9e3f['query'][_0xf5b8('0x5b')]){_0x1c04af[_0xf5b8('0x59')]=_[_0xf5b8('0x5c')](_0x1c04af[_0xf5b8('0x59')],{'$or':_[_0xf5b8('0x4d')](_0x1c04af[_0xf5b8('0x53')],function(_0x5840a6){var _0x52fb3d={};_0x52fb3d[_0x5840a6]={'$like':'%'+_0xed9e3f[_0xf5b8('0x4f')][_0xf5b8('0x5b')]+'%'};return _0x52fb3d;})});}_0x1c04af=_['merge']({},_0x1c04af,_0xed9e3f[_0xf5b8('0x5e')]);return db[_0xf5b8('0xba')][_0xf5b8('0x29')]({'where':_0x1c04af['where']})['then'](function(_0x57903c){_0x142055[_0xf5b8('0x29')]=_0x57903c;if(_0xed9e3f[_0xf5b8('0x4f')][_0xf5b8('0x64')]){_0x1c04af[_0xf5b8('0x5f')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0xf5b8('0xc8')],'as':_0xf5b8('0xff'),'attributes':[_0xf5b8('0x33'),_0xf5b8('0x100'),'internal'],'required':![]},{'model':db[_0xf5b8('0x101')],'as':'Tags','attributes':['id','name',_0xf5b8('0x102')],'where':_0xed9e3f[_0xf5b8('0x4f')][_0xf5b8('0x103')]?{'id':_0xed9e3f[_0xf5b8('0x4f')][_0xf5b8('0x103')]}:undefined,'required':_0xed9e3f[_0xf5b8('0x4f')][_0xf5b8('0x103')]?!![]:![]}];}return db[_0xf5b8('0xba')][_0xf5b8('0x78')](_0x1c04af);})[_0xf5b8('0x18')](function(_0x36d403){_0x142055[_0xf5b8('0x60')]=_0x36d403;return _0x142055;});}})[_0xf5b8('0x18')](respondWithFilteredResult(_0x1b6188,_0x1c04af))[_0xf5b8('0x23')](handleError(_0x1b6188,null));};exports[_0xf5b8('0x104')]=function(_0xc3ce98,_0x16a3d4){var _0x28f996=0x0;var _0x30e09b=0x0;var _0x2f815b=![];var _0x2ad683;var _0x478fe2;return db[_0xf5b8('0x4e')][_0xf5b8('0x6f')]({'where':{'id':_0xc3ce98[_0xf5b8('0x73')]['id']},'include':[{'model':db[_0xf5b8('0x9b')],'as':_0xf5b8('0x9b'),'include':[{'model':db[_0xf5b8('0x9b')],'as':'Intervals','attributes':['id',_0xf5b8('0xac')]}]}]})[_0xf5b8('0x18')](handleEntityNotFound(_0x16a3d4,null))[_0xf5b8('0x18')](function(_0x3b73e4){if(_0x3b73e4){_0x2ad683=_0x3b73e4;return _0x3b73e4[_0xf5b8('0x105')]({'raw':!![]});}})[_0xf5b8('0x18')](function(_0x13b138){if(_0x2ad683){if(_0x13b138){_0x478fe2=_0x13b138;}}return require(_0xf5b8('0x8c'))[_0xf5b8('0x8d')]();})[_0xf5b8('0x18')](function(_0x511b5e){if(_0x511b5e){_0x30e09b=_0x511b5e[_0xf5b8('0x106')];_0x2f815b=_0x511b5e[_0xf5b8('0x8e')];}})[_0xf5b8('0x18')](function(){return db[_0xf5b8('0xba')][_0xf5b8('0x29')]({'where':{'closed':![]}});})[_0xf5b8('0x18')](function(_0x4bce1e){_0x28f996=_0x4bce1e;if(_0x30e09b&&_0x4bce1e>_0x30e09b){return db[_0xf5b8('0x107')]['findOne']({'where':{'id':0x1}})[_0xf5b8('0x18')](function(_0x1b587a){if(_0x1b587a){_0x1b587a['increment'](_0xf5b8('0x108'));}});}})['then'](function(){var _0x39ccf1=_0x2ad683['Interval'];var _0x54e76=_0x2ad683[_0xf5b8('0x109')]||undefined;return _0x39ccf1?_0x39ccf1[_0xf5b8('0x9c')](_0x54e76):!![];})[_0xf5b8('0x18')](function(_0x1ca2d6){var _0x2da0ba=fs[_0xf5b8('0xdf')](path[_0xf5b8('0x8a')](config['root'],_0xf5b8('0x10a')),_0xf5b8('0x10b'));var _0x5654a4=_0xf5b8('0x10c');var _0xb3acd4=![];var _0x1a4861,_0x1fcd89;if(_0xc3ce98[_0xf5b8('0xb7')][_0xf5b8('0x40')]){_0x1a4861=new URL(_0xc3ce98['headers'][_0xf5b8('0x40')])['origin'];}else if(_0xc3ce98[_0xf5b8('0xb7')][_0xf5b8('0x10d')]){_0x1a4861=new URL(_0xc3ce98[_0xf5b8('0xb7')][_0xf5b8('0x10d')])[_0xf5b8('0x10d')];}else{_0x1a4861=_0xf5b8('0x10e');}_0x1fcd89=typeof _0x2ad683[_0xf5b8('0x66')][_0xf5b8('0x3c')](',')[_0xf5b8('0x6f')](function(_0x101faa){return wildcardUtils[_0xf5b8('0x10f')](_0x101faa,_0x1a4861);})!==_0xf5b8('0x28');var _0x206e47={'chatVersion':_0x5654a4,'chatWebsiteAddressOrigin':_0x1fcd89?_0xc3ce98[_0xf5b8('0xb7')][_0xf5b8('0x40')]:_0x2ad683[_0xf5b8('0x66')],'remote':_0x2ad683[_0xf5b8('0x110')],'query':querystring['stringify'](_[_0xf5b8('0x5c')](_0x2ad683[_0xf5b8('0x2e')]({'plain':!![]}),{'customerIp':_0xc3ce98[_0xf5b8('0xb7')]['x-forwarded-for']||_0xc3ce98[_0xf5b8('0xb7')][_0xf5b8('0x111')]||_0xc3ce98[_0xf5b8('0x112')][_0xf5b8('0x113')]||_0xc3ce98['ip'],'referer':_0xc3ce98[_0xf5b8('0xb7')][_0xf5b8('0x40')],'openedInteractions':_0x28f996,'maxInteractions':_0x30e09b,'virtual':_0x2f815b[_0xf5b8('0x106')],'online':_0x1ca2d6,'custom':_0x2f815b,'address':_0x1fcd89?_0xc3ce98[_0xf5b8('0xb7')]['referer']:null}))['replace'](/'/g,'\x5c\x27')};_0x16a3d4[_0xf5b8('0x34')](ejs[_0xf5b8('0xe0')](Mustache[_0xf5b8('0xe0')](_0x2da0ba,_0x206e47),{'proactiveActions':_0x478fe2,'alignment':_0x2ad683[_0xf5b8('0x114')],'verticalAlignment':_0x2ad683[_0xf5b8('0x115')],'div_color':_0x2ad683[_0xf5b8('0x102')],'labelText':_0x2ad683[_0xf5b8('0x116')],'text_color':_0x2ad683[_0xf5b8('0x117')],'text_button_color':_0x2ad683['textButtonColor'],'button_color':_0x2ad683['color_button'],'background_color':_0x2ad683[_0xf5b8('0x118')],'hideWhenOffline':_0x2ad683[_0xf5b8('0x119')],'intervalId':_0x2ad683[_0xf5b8('0x11a')],'isDevelopment':_0xb3acd4,'chatVersion':_0x5654a4}));})[_0xf5b8('0x23')](handleError(_0x16a3d4,null));};exports['addApplications']=function(_0x1c984d,_0x446ed5){var _0xeed1f1=_0x1c984d['params']['id'];var _0x5ea232=_0x1c984d['body'];var _0x2706a0=0xc8;var _0x301622=null;return db[_0xf5b8('0xea')]['transaction']({'isolationLevel':db[_0xf5b8('0xea')]['Transaction'][_0xf5b8('0x11b')][_0xf5b8('0x11c')]},function(_0xaaf983){return db['ChatWebsite'][_0xf5b8('0x7c')]({'where':{'id':_0xeed1f1},'transaction':_0xaaf983})[_0xf5b8('0x18')](function(_0x5e5b3a){if(_0x5e5b3a){return db[_0xf5b8('0x11d')][_0xf5b8('0x2d')]({'where':{'ChatWebsiteId':_0xeed1f1},'transaction':_0xaaf983})[_0xf5b8('0x18')](function(){var _0x54234c=_['map'](_0x5ea232,function(_0x53794c){_0x53794c[_0xf5b8('0x75')]=_0xeed1f1;return _0x53794c;});return db[_0xf5b8('0x11d')][_0xf5b8('0xec')](_0x54234c,{'transaction':_0xaaf983});});}else{_0x2706a0=0x194;_0x301622=[];}});})[_0xf5b8('0x18')](function(){if(_0x2706a0!==0x194){return db['ChatApplication'][_0xf5b8('0x11e')]({'where':{'ChatWebsiteId':_0xeed1f1},'order':_0xf5b8('0xaf')})[_0xf5b8('0x18')](function(_0x1c1c55){_0x301622=_0x1c1c55;});}})[_0xf5b8('0x23')](function(_0x535a9c){_0x2706a0=0x1f4;logger[_0xf5b8('0x1e')](_0x535a9c[_0xf5b8('0x32')]);if(_0x535a9c['name']){delete _0x535a9c[_0xf5b8('0x33')];}_0x301622=_0x535a9c;})['finally'](function(){if(_0x301622===null){_0x446ed5['sendStatus'](_0x2706a0);}else{if(_0x2706a0===0x1f4){_0x446ed5['status'](_0x2706a0)[_0xf5b8('0x34')](_0x301622);}else{_0x446ed5[_0xf5b8('0x25')](_0x2706a0)[_0xf5b8('0x26')](_0x301622);}}});};exports[_0xf5b8('0x11f')]=function(_0x5a1575,_0x13e040){var _0x59c45f={};var _0x36caec={};var _0x4934cb;var _0x31bebc;return db[_0xf5b8('0x4e')]['findOne']({'where':{'id':_0x5a1575[_0xf5b8('0x73')]['id']}})[_0xf5b8('0x18')](handleEntityNotFound(_0x13e040,null))[_0xf5b8('0x18')](function(_0xddf334){if(_0xddf334){_0x4934cb=_0xddf334;_0x36caec['model']=_[_0xf5b8('0x50')](db[_0xf5b8('0x11d')][_0xf5b8('0x62')]);_0x36caec['query']=_[_0xf5b8('0x50')](_0x5a1575[_0xf5b8('0x4f')]);_0x36caec[_0xf5b8('0x51')]=_[_0xf5b8('0x52')](_0x36caec['model'],_0x36caec['query']);_0x59c45f[_0xf5b8('0x53')]=_[_0xf5b8('0x52')](_0x36caec[_0xf5b8('0x48')],qs[_0xf5b8('0x54')](_0x5a1575['query'][_0xf5b8('0x54')]));_0x59c45f['attributes']=_0x59c45f['attributes'][_0xf5b8('0x63')]?_0x59c45f[_0xf5b8('0x53')]:_0x36caec[_0xf5b8('0x48')];_0x59c45f['order']=qs['sort'](_0x5a1575[_0xf5b8('0x4f')][_0xf5b8('0x58')]);_0x59c45f[_0xf5b8('0x59')]=qs[_0xf5b8('0x51')](_[_0xf5b8('0x5a')](_0x5a1575[_0xf5b8('0x4f')],_0x36caec[_0xf5b8('0x51')]));if(_0x5a1575['query']['filter']){_0x59c45f[_0xf5b8('0x59')]=_['merge'](_0x59c45f[_0xf5b8('0x59')],{'$or':_[_0xf5b8('0x4d')](_0x59c45f[_0xf5b8('0x53')],function(_0x45e3ec){var _0x305cab={};_0x305cab[_0x45e3ec]={'$like':'%'+_0x5a1575['query'][_0xf5b8('0x5b')]+'%'};return _0x305cab;})});}_0x59c45f=_[_0xf5b8('0x5c')]({},_0x59c45f,_0x5a1575[_0xf5b8('0x5e')]);return _0x4934cb['getApplications'](_0x59c45f);}})[_0xf5b8('0x18')](function(_0x388bd2){if(_0x388bd2){_0x31bebc=_0x388bd2[_0xf5b8('0x63')];if(!_0x5a1575[_0xf5b8('0x4f')][_0xf5b8('0x55')]('nolimit')){_0x59c45f[_0xf5b8('0x2a')]=qs[_0xf5b8('0x2a')](_0x5a1575[_0xf5b8('0x4f')][_0xf5b8('0x2a')]);_0x59c45f[_0xf5b8('0x27')]=qs['offset'](_0x5a1575[_0xf5b8('0x4f')]['offset']);}return _0x4934cb['getApplications'](_0x59c45f);}})[_0xf5b8('0x18')](function(_0x5d485a){if(_0x5d485a){return _0x5d485a?{'count':_0x31bebc,'rows':_0x5d485a}:null;}})[_0xf5b8('0x18')](respondWithResult(_0x13e040,null))['catch'](handleError(_0x13e040,null));};exports[_0xf5b8('0x120')]=function(_0x5a1422,_0x415397){return db[_0xf5b8('0x121')]['find']({'where':{'id':_0x5a1422[_0xf5b8('0x73')]['id']}})[_0xf5b8('0x18')](handleEntityNotFound(_0x415397,null))[_0xf5b8('0x18')](function(_0x420ab1){if(_0x420ab1){return _0x420ab1['addProactiveActions'](_0x5a1422[_0xf5b8('0x65')][_0xf5b8('0x7f')],_[_0xf5b8('0xfe')](_0x5a1422[_0xf5b8('0x65')],[_0xf5b8('0x7f'),'id'])||{});}})['then'](respondWithResult(_0x415397,null))[_0xf5b8('0x23')](handleError(_0x415397,null));};exports[_0xf5b8('0x105')]=function(_0x48083c,_0x4b5353){var _0x4b6dd1={};var _0x532f9d={};var _0x564ff1;var _0x164da9;return db[_0xf5b8('0x4e')][_0xf5b8('0x7c')]({'where':{'id':_0x48083c[_0xf5b8('0x73')]['id']}})[_0xf5b8('0x18')](handleEntityNotFound(_0x4b5353,null))[_0xf5b8('0x18')](function(_0x1aa8b0){if(_0x1aa8b0){_0x564ff1=_0x1aa8b0;_0x532f9d['model']=_[_0xf5b8('0x50')](db[_0xf5b8('0x122')][_0xf5b8('0x62')]);_0x532f9d[_0xf5b8('0x4f')]=_[_0xf5b8('0x50')](_0x48083c[_0xf5b8('0x4f')]);_0x532f9d[_0xf5b8('0x51')]=_[_0xf5b8('0x52')](_0x532f9d[_0xf5b8('0x48')],_0x532f9d[_0xf5b8('0x4f')]);_0x4b6dd1[_0xf5b8('0x53')]=_[_0xf5b8('0x52')](_0x532f9d[_0xf5b8('0x48')],qs[_0xf5b8('0x54')](_0x48083c[_0xf5b8('0x4f')]['fields']));_0x4b6dd1[_0xf5b8('0x53')]=_0x4b6dd1[_0xf5b8('0x53')][_0xf5b8('0x63')]?_0x4b6dd1[_0xf5b8('0x53')]:_0x532f9d['model'];_0x4b6dd1[_0xf5b8('0x57')]=qs[_0xf5b8('0x58')](_0x48083c['query']['sort']);_0x4b6dd1['where']=qs[_0xf5b8('0x51')](_[_0xf5b8('0x5a')](_0x48083c[_0xf5b8('0x4f')],_0x532f9d[_0xf5b8('0x51')]));if(_0x48083c[_0xf5b8('0x4f')][_0xf5b8('0x5b')]){_0x4b6dd1[_0xf5b8('0x59')]=_[_0xf5b8('0x5c')](_0x4b6dd1['where'],{'$or':_[_0xf5b8('0x4d')](_0x4b6dd1['attributes'],function(_0x472e58){var _0x3e9fd3={};_0x3e9fd3[_0x472e58]={'$like':'%'+_0x48083c[_0xf5b8('0x4f')][_0xf5b8('0x5b')]+'%'};return _0x3e9fd3;})});}_0x4b6dd1=_[_0xf5b8('0x5c')]({},_0x4b6dd1,_0x48083c[_0xf5b8('0x5e')]);return _0x564ff1[_0xf5b8('0x105')](_0x4b6dd1);}})['then'](function(_0x30ba73){if(_0x30ba73){_0x164da9=_0x30ba73[_0xf5b8('0x63')];if(!_0x48083c[_0xf5b8('0x4f')][_0xf5b8('0x55')](_0xf5b8('0x56'))){_0x4b6dd1[_0xf5b8('0x2a')]=qs['limit'](_0x48083c['query'][_0xf5b8('0x2a')]);_0x4b6dd1[_0xf5b8('0x27')]=qs['offset'](_0x48083c[_0xf5b8('0x4f')][_0xf5b8('0x27')]);}return _0x564ff1[_0xf5b8('0x105')](_0x4b6dd1);}})[_0xf5b8('0x18')](function(_0x276df8){if(_0x276df8){return _0x276df8?{'count':_0x164da9,'rows':_0x276df8}:null;}})[_0xf5b8('0x18')](respondWithResult(_0x4b5353,null))[_0xf5b8('0x23')](handleError(_0x4b5353,null));};exports[_0xf5b8('0x123')]=function(_0x230794,_0x73d8b4){var _0x59eaf5=_0x230794['query'][_0xf5b8('0x124')]===_0xf5b8('0x125')?'offlineForm':_0xf5b8('0x126');return db[_0xf5b8('0x4e')][_0xf5b8('0x6f')]({'attributes':['id',_0x59eaf5],'where':{'id':_0x230794[_0xf5b8('0x73')]['id']}})['then'](handleEntityNotFound(_0x73d8b4,null))[_0xf5b8('0x18')](function(_0x1648d8){if(_0x1648d8){var _0x7cb0c5=_0x1648d8[_0x59eaf5];var _0x3689f1=_0x7cb0c5&&_0x7cb0c5['items']?_0x7cb0c5[_0xf5b8('0x127')]:[];_0x73d8b4[_0xf5b8('0x34')]({'fromKey':_[_0xf5b8('0x8f')](_0x7cb0c5[_0xf5b8('0x128')])?undefined:_0x7cb0c5[_0xf5b8('0x128')],'count':_0x3689f1[_0xf5b8('0x63')],'rows':_0x3689f1});}})[_0xf5b8('0x23')](handleError(_0x73d8b4,null));};exports[_0xf5b8('0x129')]=function(_0x48b1f6,_0x4a2d32){var _0x51ff7d={'raw':![],'where':{}};var _0x58d110={};var _0x10d940={'count':0x0,'rows':[]};return db[_0xf5b8('0x4e')][_0xf5b8('0x7c')]({'where':{'id':_0x48b1f6['params']['id']}})[_0xf5b8('0x18')](handleEntityNotFound(_0x4a2d32,null))[_0xf5b8('0x18')](function(_0x236ed6){if(_0x236ed6){_0x58d110[_0xf5b8('0x48')]=_[_0xf5b8('0x50')](db[_0xf5b8('0xe2')]['rawAttributes']);_0x58d110[_0xf5b8('0x4f')]=_[_0xf5b8('0x50')](_0x48b1f6[_0xf5b8('0x4f')]);_0x58d110[_0xf5b8('0x51')]=_[_0xf5b8('0x52')](_0x58d110[_0xf5b8('0x48')],_0x58d110[_0xf5b8('0x4f')]);_0x51ff7d[_0xf5b8('0x53')]=_[_0xf5b8('0x52')](_0x58d110[_0xf5b8('0x48')],qs['fields'](_0x48b1f6[_0xf5b8('0x4f')]['fields']));_0x51ff7d[_0xf5b8('0x53')]=_0x51ff7d[_0xf5b8('0x53')]['length']?_0x51ff7d[_0xf5b8('0x53')]:_0x58d110[_0xf5b8('0x48')];if(!_0x48b1f6[_0xf5b8('0x4f')][_0xf5b8('0x55')](_0xf5b8('0x56'))){_0x51ff7d[_0xf5b8('0x2a')]=qs[_0xf5b8('0x2a')](_0x48b1f6[_0xf5b8('0x4f')]['limit']);_0x51ff7d[_0xf5b8('0x27')]=qs['offset'](_0x48b1f6[_0xf5b8('0x4f')][_0xf5b8('0x27')]);}_0x51ff7d[_0xf5b8('0x57')]=qs[_0xf5b8('0x58')](_0x48b1f6[_0xf5b8('0x4f')][_0xf5b8('0x58')]);_0x51ff7d[_0xf5b8('0x59')]=qs[_0xf5b8('0x51')](_[_0xf5b8('0x5a')](_0x48b1f6['query'],_0x58d110[_0xf5b8('0x51')]));_0x51ff7d['where'][_0xf5b8('0x75')]=_0x236ed6['id'];if(_0x48b1f6[_0xf5b8('0x4f')]['filter']){_0x51ff7d[_0xf5b8('0x59')]=_[_0xf5b8('0x5c')](_0x51ff7d[_0xf5b8('0x59')],{'$or':_[_0xf5b8('0x4d')](_0x51ff7d[_0xf5b8('0x53')],function(_0x3e6925){var _0x13c9e8={};_0x13c9e8[_0x3e6925]={'$like':'%'+_0x48b1f6[_0xf5b8('0x4f')]['filter']+'%'};return _0x13c9e8;})});}_0x51ff7d=_[_0xf5b8('0x5c')]({},_0x51ff7d,_0x48b1f6['options']);return db['ChatOfflineMessage'][_0xf5b8('0x29')]({'where':_0x51ff7d[_0xf5b8('0x59')]})[_0xf5b8('0x18')](function(_0x45c3e8){_0x10d940[_0xf5b8('0x29')]=_0x45c3e8;if(_0x48b1f6['query'][_0xf5b8('0x64')]){_0x51ff7d['include']=[{'all':!![]}];}else{_0x51ff7d[_0xf5b8('0x5f')]=[{'model':db[_0xf5b8('0xb5')],'as':_0xf5b8('0x12a'),'required':![]},{'model':db[_0xf5b8('0xeb')],'as':_0xf5b8('0x12b'),'required':![]}];}return db[_0xf5b8('0xe2')][_0xf5b8('0x78')](_0x51ff7d);})[_0xf5b8('0x18')](function(_0xf70ada){_0x10d940[_0xf5b8('0x60')]=_0xf70ada;return _0x10d940;});}})[_0xf5b8('0x18')](respondWithFilteredResult(_0x4a2d32,_0x51ff7d))[_0xf5b8('0x23')](handleError(_0x4a2d32,null));};exports[_0xf5b8('0x12c')]=function(_0x4361b3,_0x4ccefc){return db[_0xf5b8('0x4e')][_0xf5b8('0x6f')]({'where':{'id':_0x4361b3[_0xf5b8('0x73')]['id']}})[_0xf5b8('0x18')](handleEntityNotFound(_0x4ccefc,null))[_0xf5b8('0x18')](function(_0x5b7b93){if(_0x5b7b93){return _0x5b7b93[_0xf5b8('0x12c')](_0x4361b3[_0xf5b8('0x65')][_0xf5b8('0x7f')],_[_0xf5b8('0xfe')](_0x4361b3[_0xf5b8('0x65')],[_0xf5b8('0x7f'),'id'])||{})[_0xf5b8('0xde')](function(_0x53b36e){for(var _0xf1b184=0x0;_0xf1b184<_0x4361b3[_0xf5b8('0x65')][_0xf5b8('0x7f')][_0xf5b8('0x63')];_0xf1b184+=0x1){socket[_0xf5b8('0x12d')](_0xf5b8('0x12e'),{'UserId':Number(_0x4361b3[_0xf5b8('0x65')][_0xf5b8('0x7f')][_0xf1b184]),'ChatWebsiteId':Number(_0x4361b3[_0xf5b8('0x73')]['id'])});}return _0x53b36e;});}})['then'](respondWithResult(_0x4ccefc,null))[_0xf5b8('0x23')](handleError(_0x4ccefc,null));};exports[_0xf5b8('0x12f')]=function(_0x254bf7,_0x274a96){return db[_0xf5b8('0x4e')]['find']({'where':{'id':_0x254bf7['params']['id']}})[_0xf5b8('0x18')](handleEntityNotFound(_0x274a96,null))['then'](function(_0x4d134c){if(_0x4d134c){return _0x4d134c[_0xf5b8('0x12f')](_0x254bf7[_0xf5b8('0x4f')][_0xf5b8('0x7f')])[_0xf5b8('0x18')](function(){if(_['isArray'](_0x254bf7[_0xf5b8('0x4f')][_0xf5b8('0x7f')])){for(var _0x1f6fac=0x0;_0x1f6fac<_0x254bf7[_0xf5b8('0x4f')]['ids'][_0xf5b8('0x63')];_0x1f6fac+=0x1){socket[_0xf5b8('0x12d')](_0xf5b8('0x130'),{'UserId':Number(_0x254bf7['query'][_0xf5b8('0x7f')][_0x1f6fac]),'ChatWebsiteId':Number(_0x254bf7[_0xf5b8('0x73')]['id'])});}}else{socket[_0xf5b8('0x12d')](_0xf5b8('0x130'),{'UserId':Number(_0x254bf7[_0xf5b8('0x4f')][_0xf5b8('0x7f')]),'ChatWebsiteId':Number(_0x254bf7[_0xf5b8('0x73')]['id'])});}});}})[_0xf5b8('0x18')](respondWithStatusCode(_0x274a96,null))['catch'](handleError(_0x274a96,null));};exports[_0xf5b8('0x131')]=function(_0x3cd565,_0x441036){var _0x4790bc={};var _0x24415d={};var _0xf9110c;var _0x3eab19;return db[_0xf5b8('0x4e')]['findOne']({'where':{'id':_0x3cd565['params']['id']}})['then'](handleEntityNotFound(_0x441036,null))[_0xf5b8('0x18')](function(_0x574040){if(_0x574040){_0xf9110c=_0x574040;_0x24415d[_0xf5b8('0x48')]=_[_0xf5b8('0x50')](db['User']['rawAttributes']);_0x24415d['query']=_[_0xf5b8('0x50')](_0x3cd565['query']);_0x24415d[_0xf5b8('0x51')]=_[_0xf5b8('0x52')](_0x24415d['model'],_0x24415d[_0xf5b8('0x4f')]);_0x4790bc[_0xf5b8('0x53')]=_[_0xf5b8('0x52')](_0x24415d[_0xf5b8('0x48')],qs[_0xf5b8('0x54')](_0x3cd565[_0xf5b8('0x4f')][_0xf5b8('0x54')]));_0x4790bc[_0xf5b8('0x53')]=_0x4790bc[_0xf5b8('0x53')][_0xf5b8('0x63')]?_0x4790bc['attributes']:_0x24415d[_0xf5b8('0x48')];_0x4790bc[_0xf5b8('0x57')]=qs[_0xf5b8('0x58')](_0x3cd565[_0xf5b8('0x4f')][_0xf5b8('0x58')]);_0x4790bc[_0xf5b8('0x59')]=qs[_0xf5b8('0x51')](_['pick'](_0x3cd565['query'],_0x24415d[_0xf5b8('0x51')]));if(_0x3cd565['query'][_0xf5b8('0x5b')]){_0x4790bc[_0xf5b8('0x59')]=_[_0xf5b8('0x5c')](_0x4790bc[_0xf5b8('0x59')],{'$or':_['map'](_0x4790bc[_0xf5b8('0x53')],function(_0x17081b){var _0x1b978d={};_0x1b978d[_0x17081b]={'$like':'%'+_0x3cd565[_0xf5b8('0x4f')][_0xf5b8('0x5b')]+'%'};return _0x1b978d;})});}_0x4790bc=_['merge']({},_0x4790bc,_0x3cd565[_0xf5b8('0x5e')]);return _0xf9110c['getAgents'](_0x4790bc);}})[_0xf5b8('0x18')](function(_0x1a6480){if(_0x1a6480){_0x3eab19=_0x1a6480[_0xf5b8('0x63')];if(!_0x3cd565[_0xf5b8('0x4f')][_0xf5b8('0x55')](_0xf5b8('0x56'))){_0x4790bc[_0xf5b8('0x2a')]=qs[_0xf5b8('0x2a')](_0x3cd565[_0xf5b8('0x4f')][_0xf5b8('0x2a')]);_0x4790bc[_0xf5b8('0x27')]=qs[_0xf5b8('0x27')](_0x3cd565[_0xf5b8('0x4f')]['offset']);}return _0xf9110c['getAgents'](_0x4790bc);}})[_0xf5b8('0x18')](function(_0x55e783){if(_0x55e783){return _0x55e783?{'count':_0x3eab19,'rows':_0x55e783}:null;}})['then'](respondWithResult(_0x441036,null))[_0xf5b8('0x23')](handleError(_0x441036,null));};
\ No newline at end of file
+var _0x1d3d=['*,*,*,*','Start','startRouting','EventManager','notify','offline','files','ValidationError','difference','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','Sequelize','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','offlineMessageBody','fromString','server','attachments','offline-chat','basename','sequelize','transaction','Attachment','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','email','offlineMessageSubject','openNewInteraction','MailAccountId','originalname','subjectOffline','toPairsIn','Chat','NotifyMailAccount','notifyMail','remove','addInteraction','omit','Owner','fullname','internal','Tag','Tags','tag','getSnippet','Intervals','interval','getProactiveActions','virtual','License','increment','chatLicenseExceeded','ifTime','3.9.0','headers','origin','http://localhost:9000','testWebsiteWithWildcard','remote','x-real-ip','connection','replace','verticalAlignment','labelText','textColor','textButtonColor','color_button','hideWhenOffline','IntervalId','addApplications','READ_COMMITTED','bulkCreate','findAndCountAll','stack','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','offlineForm','onlineForm','items','fromKey','ChatOfflineMessage','Contact','addAgents','userChatWebsite:save','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','mustache','util','path','ejs','lodash','html-to-text','ioredis','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../config/environment','APIBadRequestError','../../errors/api','APINotFoundError','APIOutOfIntervalError','handleError','url','defaults','redis','localhost','socket.io-emitter','register','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','name','send','user-agent-parser','setUA','getResult','customerIp','cf-connecting-ip','x-forwarded-for','first','firstName','lastName','x-real-port','browser','version','format','%s\x20%s','unknown','device','model','vendor','%s\x20%s\x20%s','type','Pause','map','ChatWebsite','fieldName','key','intersection','query','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','show','mandatoryDispositionPause','keys','fields','include','options','find','create','body','address','split','forEach','trim','testWildcardValidity','user','role','UserProfileSection','autoAssociation','params','describe','addDisposition','getDispositions','findOne','Disposition','rawAttributes','ChatWebsiteId','removeDispositions','getAnswers','CannedAnswer','removeAnswers','ids','addLogo','sitepic','file','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','join','root','../../config/license/util','getLicense','custom','existsSync','server/files/images/logos/','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','showCustomerAvatar','isNil','download','getSystemAvatar','server/files/images/avatars/system_avatar.png','resolve','timezone','chat','from','isEmpty','Body\x20is\x20mandatory','No\x20available\x20attributes','createdAt','includes','updatedAt','CompanyId','ListId','mapKey','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','CmList','List','CmContact','Contacts','DESC','ChatApplication','Applications','Interval','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','applications','orderBy','priority','asc','list','contact','threadId','closed','referer','externalUrl','ChatInteraction','ContactId','interaction','messageId','created','autoclose','push','close','unmanaged','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','queueId','queue'];(function(_0x1f7a00,_0x341591){var _0x4b151c=function(_0x51fceb){while(--_0x51fceb){_0x1f7a00['push'](_0x1f7a00['shift']());}};_0x4b151c(++_0x341591);}(_0x1d3d,0x69));var _0xd1d3=function(_0x4fa2bc,_0x58ec5f){_0x4fa2bc=_0x4fa2bc-0x0;var _0x45946b=_0x1d3d[_0x4fa2bc];return _0x45946b;};'use strict';var Mustache=require(_0xd1d3('0x0'));var util=require(_0xd1d3('0x1'));var path=require(_0xd1d3('0x2'));var ejs=require(_0xd1d3('0x3'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd1d3('0x4'));var querystring=require('querystring');var htmlToText=require(_0xd1d3('0x5'));var Redis=require(_0xd1d3('0x6'));var jayson=require(_0xd1d3('0x7'));var qs=require(_0xd1d3('0x8'));var logger=require(_0xd1d3('0x9'))(_0xd1d3('0xa'));var config=require(_0xd1d3('0xb'));var APIBadRequestError=require('../../errors/api')[_0xd1d3('0xc')];var APINotFoundError=require(_0xd1d3('0xd'))[_0xd1d3('0xe')];var APIOutOfIntervalError=require(_0xd1d3('0xd'))[_0xd1d3('0xf')];var APIHandleError=require(_0xd1d3('0xd'))[_0xd1d3('0x10')];var APIConflictError=require('../../errors/api')['APIConflictError'];var wildcardUtils=require('./helpers/wildcard-expressions');var URL=require(_0xd1d3('0x11'))['URL'];var db=require('../../mysqldb')['db'];config['redis']=_[_0xd1d3('0x12')](config[_0xd1d3('0x13')],{'host':_0xd1d3('0x14'),'port':0x18eb});var socket=require(_0xd1d3('0x15'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0xd1d3('0x16')](socket);var client=jayson[_0xd1d3('0x17')][_0xd1d3('0x18')]({'port':0x232c});var client9002=jayson[_0xd1d3('0x17')]['http']({'port':0x232a});var client9003=jayson[_0xd1d3('0x17')][_0xd1d3('0x18')]({'port':0x232b});var client9001=jayson[_0xd1d3('0x17')][_0xd1d3('0x18')]({'port':0x2329});function respondWithRpcPromise(_0x24d8e9,_0x1c03a0,_0x41ee0f,_0x508274){return new Promise(function(_0x1dfd68,_0x13b2ed){var _0x43b57d=_0x508274||client;return _0x43b57d[_0xd1d3('0x19')](_0x24d8e9,_0x41ee0f)[_0xd1d3('0x1a')](function(_0x584753){logger[_0xd1d3('0x1b')](_0xd1d3('0x1c'),_0x1c03a0,_0xd1d3('0x1d'));logger[_0xd1d3('0x1e')](_0xd1d3('0x1f'),_0x1c03a0,_0xd1d3('0x1d'),JSON[_0xd1d3('0x20')](_0x584753));if(_0x584753[_0xd1d3('0x21')]){if(_0x584753[_0xd1d3('0x21')]['code']===0x1f4){logger[_0xd1d3('0x21')](_0xd1d3('0x1c'),_0x1c03a0,_0x584753[_0xd1d3('0x21')][_0xd1d3('0x22')]);return _0x13b2ed(_0x584753[_0xd1d3('0x21')]['message']);}logger[_0xd1d3('0x21')](_0xd1d3('0x1c'),_0x1c03a0,_0x584753[_0xd1d3('0x21')][_0xd1d3('0x22')]);return _0x1dfd68(_0x584753['error'][_0xd1d3('0x22')]);}else{logger[_0xd1d3('0x1b')]('ChatWebsite,\x20%s,\x20%s',_0x1c03a0,_0xd1d3('0x1d'));_0x1dfd68(_0x584753[_0xd1d3('0x23')]['message']);}})[_0xd1d3('0x24')](function(_0x303162){logger[_0xd1d3('0x21')](_0xd1d3('0x1c'),_0x1c03a0,_0x303162);_0x13b2ed(_0x303162);});});}function respondWithStatusCode(_0x119881,_0x22c7d){_0x22c7d=_0x22c7d||0xcc;return function(_0x425fe2){if(_0x425fe2){return _0x119881[_0xd1d3('0x25')](_0x22c7d);}return _0x119881[_0xd1d3('0x26')](_0x22c7d)[_0xd1d3('0x27')]();};}function respondWithResult(_0x3c5d90,_0x3a9801){_0x3a9801=_0x3a9801||0xc8;return function(_0xdfc671){if(_0xdfc671){return _0x3c5d90['status'](_0x3a9801)[_0xd1d3('0x28')](_0xdfc671);}};}function respondWithFilteredResult(_0x323fc5,_0x2f61fb){return function(_0x3b1dcc){if(_0x3b1dcc){var _0x5975c1=typeof _0x2f61fb[_0xd1d3('0x29')]===_0xd1d3('0x2a')&&typeof _0x2f61fb[_0xd1d3('0x2b')]===_0xd1d3('0x2a');var _0x1ab985=_0x3b1dcc[_0xd1d3('0x2c')];var _0x59c8a3=_0x5975c1?0x0:_0x2f61fb['offset'];var _0x2ac2ef=_0x5975c1?_0x3b1dcc['count']:_0x2f61fb['offset']+_0x2f61fb[_0xd1d3('0x2b')];var _0x1b5ebf;if(_0x2ac2ef>=_0x1ab985){_0x2ac2ef=_0x1ab985;_0x1b5ebf=0xc8;}else{_0x1b5ebf=0xce;}_0x323fc5['status'](_0x1b5ebf);return _0x323fc5[_0xd1d3('0x2d')](_0xd1d3('0x2e'),_0x59c8a3+'-'+_0x2ac2ef+'/'+_0x1ab985)[_0xd1d3('0x28')](_0x3b1dcc);}return null;};}function saveUpdates(_0x56e66a){return function(_0x56d626){if(_0x56d626){return _0x56d626[_0xd1d3('0x2f')](_0x56e66a)[_0xd1d3('0x1a')](function(_0x11ab4d){return _0x11ab4d;});}return null;};}function removeEntity(_0x440cce){return function(_0x42e8a3){if(_0x42e8a3){return _0x42e8a3[_0xd1d3('0x30')]()['then'](function(){var _0x3a0cda=_0x42e8a3[_0xd1d3('0x31')]({'plain':!![]});var _0x4513d0=_0xd1d3('0x32');return db[_0xd1d3('0x33')]['destroy']({'where':{'type':_0x4513d0,'resourceId':_0x3a0cda['id']}})['then'](function(){return _0x42e8a3;});})['then'](function(){_0x440cce['status'](0xcc)[_0xd1d3('0x27')]();});}};}function handleEntityNotFound(_0x40a414){return function(_0x54289c){if(!_0x54289c){_0x40a414[_0xd1d3('0x25')](0x194);}return _0x54289c;};}function handleError(_0x4e2f9f,_0x20575a){_0x20575a=_0x20575a||0x1f4;return function(_0x2007c2){logger[_0xd1d3('0x21')](_0x2007c2['stack']);if(_0x2007c2['name']){delete _0x2007c2[_0xd1d3('0x34')];}_0x4e2f9f[_0xd1d3('0x26')](_0x20575a)[_0xd1d3('0x35')](_0x2007c2);};}function createInteractionObject(_0x1f7af1,_0x55d6d7,_0x4177f8,_0x51ba60){var _0x443e6c=require(_0xd1d3('0x36'));var _0x118174=new _0x443e6c();var _0x325c06=_0x118174[_0xd1d3('0x37')](_0x4177f8['user-agent'])[_0xd1d3('0x38')]();var _0x52de92=_0x55d6d7[_0xd1d3('0x39')];if(_0x4177f8[_0xd1d3('0x3a')]){_0x52de92=_0x4177f8[_0xd1d3('0x3a')];}else if(_0x4177f8[_0xd1d3('0x3b')]){_0x52de92=_[_0xd1d3('0x3c')](_0x4177f8[_0xd1d3('0x3b')]['split'](','));}return{'ContactId':_0x51ba60['id'],'ChatWebsiteId':_0x1f7af1,'from':(_0x51ba60[_0xd1d3('0x3d')]||'')+'\x20'+(_0x51ba60[_0xd1d3('0x3e')]||''),'customerIp':_0x52de92,'customerPort':_0x4177f8[_0xd1d3('0x3f')]?_0x4177f8[_0xd1d3('0x3f')]:null,'referer':_0x55d6d7['referer'],'browserName':_0x325c06[_0xd1d3('0x40')][_0xd1d3('0x34')]&&_0x325c06[_0xd1d3('0x40')][_0xd1d3('0x41')]?util[_0xd1d3('0x42')](_0xd1d3('0x43'),_0x325c06[_0xd1d3('0x40')][_0xd1d3('0x34')],_0x325c06[_0xd1d3('0x40')][_0xd1d3('0x41')]):_0xd1d3('0x44'),'browserVersion':_0x325c06[_0xd1d3('0x40')][_0xd1d3('0x41')]||'unknown','osName':util[_0xd1d3('0x42')](_0xd1d3('0x43'),_0x325c06['os']['name'],_0x325c06['os'][_0xd1d3('0x41')]),'osVersion':_0x325c06['os']['version'],'deviceModel':_0x325c06[_0xd1d3('0x45')][_0xd1d3('0x46')]&&_0x325c06['device'][_0xd1d3('0x47')]?util[_0xd1d3('0x42')](_0xd1d3('0x48'),_0x325c06['device'][_0xd1d3('0x46')],_0x325c06[_0xd1d3('0x45')][_0xd1d3('0x47')],_0x325c06[_0xd1d3('0x45')][_0xd1d3('0x49')]):null,'deviceVendor':_0x325c06[_0xd1d3('0x45')]['vendor'],'deviceType':_0x325c06[_0xd1d3('0x45')][_0xd1d3('0x49')],'formData':JSON['stringify'](_0x55d6d7)};}exports['index']=function(_0x1b96f5,_0xed4d41){var _0x9f37bc={'include':[{'model':db[_0xd1d3('0x4a')],'as':'mandatoryDispositionPause'}]},_0x2dfa16={},_0x4d06ea={'count':0x0,'rows':[]};var _0x4630dc=_[_0xd1d3('0x4b')](db[_0xd1d3('0x4c')]['rawAttributes'],function(_0x34f4ef){return{'name':_0x34f4ef[_0xd1d3('0x4d')],'type':_0x34f4ef[_0xd1d3('0x49')][_0xd1d3('0x4e')]};});_0x2dfa16[_0xd1d3('0x46')]=_[_0xd1d3('0x4b')](_0x4630dc,_0xd1d3('0x34'));_0x2dfa16['query']=_['keys'](_0x1b96f5['query']);_0x2dfa16['filters']=_[_0xd1d3('0x4f')](_0x2dfa16[_0xd1d3('0x46')],_0x2dfa16[_0xd1d3('0x50')]);_0x9f37bc[_0xd1d3('0x51')]=_[_0xd1d3('0x4f')](_0x2dfa16[_0xd1d3('0x46')],qs['fields'](_0x1b96f5[_0xd1d3('0x50')]['fields']));_0x9f37bc[_0xd1d3('0x51')]=_0x9f37bc[_0xd1d3('0x51')][_0xd1d3('0x52')]?_0x9f37bc['attributes']:_0x2dfa16[_0xd1d3('0x46')];if(!_0x1b96f5[_0xd1d3('0x50')][_0xd1d3('0x53')](_0xd1d3('0x54'))){_0x9f37bc['limit']=qs[_0xd1d3('0x2b')](_0x1b96f5[_0xd1d3('0x50')][_0xd1d3('0x2b')]);_0x9f37bc[_0xd1d3('0x29')]=qs[_0xd1d3('0x29')](_0x1b96f5[_0xd1d3('0x50')][_0xd1d3('0x29')]);}_0x9f37bc[_0xd1d3('0x55')]=qs[_0xd1d3('0x56')](_0x1b96f5[_0xd1d3('0x50')]['sort']);_0x9f37bc[_0xd1d3('0x57')]=qs[_0xd1d3('0x58')](_[_0xd1d3('0x59')](_0x1b96f5['query'],_0x2dfa16[_0xd1d3('0x58')]),_0x4630dc);if(_0x1b96f5[_0xd1d3('0x50')][_0xd1d3('0x5a')]){_0x9f37bc[_0xd1d3('0x57')]=_[_0xd1d3('0x5b')](_0x9f37bc[_0xd1d3('0x57')],{'$or':_[_0xd1d3('0x4b')](_0x4630dc,function(_0x58135d){if(_0x58135d[_0xd1d3('0x49')]!==_0xd1d3('0x5c')){var _0x34f16f={};_0x34f16f[_0x58135d[_0xd1d3('0x34')]]={'$like':'%'+_0x1b96f5['query']['filter']+'%'};return _0x34f16f;}})});}_0x9f37bc=_[_0xd1d3('0x5b')]({},_0x9f37bc,_0x1b96f5['options']);var _0x45dadf={'where':_0x9f37bc['where']};return db[_0xd1d3('0x4c')]['count'](_0x45dadf)['then'](function(_0x136faf){_0x4d06ea['count']=_0x136faf;if(_0x1b96f5['query'][_0xd1d3('0x5d')]){_0x9f37bc['include']=[{'all':!![]}];}return db[_0xd1d3('0x4c')][_0xd1d3('0x5e')](_0x9f37bc);})[_0xd1d3('0x1a')](function(_0x211d14){_0x4d06ea[_0xd1d3('0x5f')]=_0x211d14;return _0x4d06ea;})['then'](respondWithFilteredResult(_0xed4d41,_0x9f37bc))[_0xd1d3('0x24')](handleError(_0xed4d41,null));};exports[_0xd1d3('0x60')]=function(_0x4879fc,_0x727481){var _0x5baef7={'raw':![],'where':{'id':_0x4879fc['params']['id']},'include':[{'model':db['Pause'],'as':_0xd1d3('0x61')}]},_0xe8939e={};_0xe8939e[_0xd1d3('0x46')]=_[_0xd1d3('0x62')](db[_0xd1d3('0x4c')]['rawAttributes']);_0xe8939e[_0xd1d3('0x50')]=_['keys'](_0x4879fc[_0xd1d3('0x50')]);_0xe8939e[_0xd1d3('0x58')]=_[_0xd1d3('0x4f')](_0xe8939e[_0xd1d3('0x46')],_0xe8939e[_0xd1d3('0x50')]);_0x5baef7[_0xd1d3('0x51')]=_['intersection'](_0xe8939e[_0xd1d3('0x46')],qs[_0xd1d3('0x63')](_0x4879fc[_0xd1d3('0x50')]['fields']));_0x5baef7['attributes']=_0x5baef7['attributes']['length']?_0x5baef7[_0xd1d3('0x51')]:_0xe8939e[_0xd1d3('0x46')];if(_0x4879fc[_0xd1d3('0x50')][_0xd1d3('0x5d')]){_0x5baef7[_0xd1d3('0x64')]=[{'all':!![]}];}_0x5baef7=_[_0xd1d3('0x5b')]({},_0x5baef7,_0x4879fc[_0xd1d3('0x65')]);return db[_0xd1d3('0x4c')][_0xd1d3('0x66')](_0x5baef7)[_0xd1d3('0x1a')](handleEntityNotFound(_0x727481,null))['then'](respondWithResult(_0x727481,null))[_0xd1d3('0x24')](handleError(_0x727481,null));};exports[_0xd1d3('0x67')]=function(_0x51d534,_0x1d2681){var _0x5e7bce=null;_0x51d534[_0xd1d3('0x68')][_0xd1d3('0x69')][_0xd1d3('0x6a')](',')[_0xd1d3('0x6b')](_0x572ff4=>{if(_0x572ff4[_0xd1d3('0x6c')]()!==''&&!wildcardUtils[_0xd1d3('0x6d')](_0x572ff4[_0xd1d3('0x6c')]())){_0x5e7bce=new APIBadRequestError('\x22'+_0x572ff4+'\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression');}});if(_0x5e7bce){return handleError(_0x1d2681,null)(_0x5e7bce);}return db[_0xd1d3('0x4c')][_0xd1d3('0x67')](_0x51d534[_0xd1d3('0x68')],{})['then'](function(_0x50dfa8){var _0x115857=_0x51d534[_0xd1d3('0x6e')]['get']({'plain':!![]});if(!_0x115857)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x115857[_0xd1d3('0x6f')]===_0xd1d3('0x6e')){var _0x21e9fc=_0x50dfa8['get']({'plain':!![]});var _0x22e753=_0xd1d3('0x32');return db[_0xd1d3('0x70')][_0xd1d3('0x66')]({'where':{'name':_0x22e753,'userProfileId':_0x115857['userProfileId']},'raw':!![]})['then'](function(_0x2be71f){if(_0x2be71f&&_0x2be71f[_0xd1d3('0x71')]===0x0){return db[_0xd1d3('0x33')][_0xd1d3('0x67')]({'name':_0x21e9fc[_0xd1d3('0x34')],'resourceId':_0x21e9fc['id'],'type':_0x2be71f[_0xd1d3('0x34')],'sectionId':_0x2be71f['id']},{})[_0xd1d3('0x1a')](function(){return _0x50dfa8;});}else{return _0x50dfa8;}})[_0xd1d3('0x24')](function(_0x245799){logger[_0xd1d3('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x245799);throw _0x245799;});}return _0x50dfa8;})[_0xd1d3('0x1a')](respondWithResult(_0x1d2681,0xc9))[_0xd1d3('0x24')](handleError(_0x1d2681,null));};exports[_0xd1d3('0x2f')]=function(_0x501f45,_0x404782){var _0x3f1eed=null;_0x501f45[_0xd1d3('0x68')][_0xd1d3('0x69')][_0xd1d3('0x6a')](',')[_0xd1d3('0x6b')](_0x4c347f=>{if(_0x4c347f[_0xd1d3('0x6c')]()!==''&&!wildcardUtils['testWildcardValidity'](_0x4c347f[_0xd1d3('0x6c')]())){_0x3f1eed=new APIBadRequestError('\x22'+_0x4c347f+'\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression');}});if(_0x3f1eed){return handleError(_0x404782,null)(_0x3f1eed);}if(_0x501f45[_0xd1d3('0x68')]['id']){delete _0x501f45[_0xd1d3('0x68')]['id'];}return db[_0xd1d3('0x4c')]['find']({'where':{'id':_0x501f45['params']['id']},'include':[{'model':db['Pause'],'as':_0xd1d3('0x61')}]})[_0xd1d3('0x1a')](handleEntityNotFound(_0x404782,null))[_0xd1d3('0x1a')](saveUpdates(_0x501f45[_0xd1d3('0x68')],null))[_0xd1d3('0x1a')](respondWithResult(_0x404782,null))[_0xd1d3('0x24')](handleError(_0x404782,null));};exports['destroy']=function(_0x4557c1,_0x7776ef){return db['ChatWebsite'][_0xd1d3('0x66')]({'where':{'id':_0x4557c1[_0xd1d3('0x72')]['id']}})[_0xd1d3('0x1a')](handleEntityNotFound(_0x7776ef,null))[_0xd1d3('0x1a')](removeEntity(_0x7776ef,null))['catch'](handleError(_0x7776ef,null));};exports[_0xd1d3('0x73')]=function(_0x13cee7,_0x137d76){return db['ChatWebsite'][_0xd1d3('0x73')]()[_0xd1d3('0x1a')](respondWithResult(_0x137d76,null))[_0xd1d3('0x24')](handleError(_0x137d76,null));};exports[_0xd1d3('0x74')]=function(_0x18d6dd,_0x25d229){if(_0x18d6dd['body']['id']){delete _0x18d6dd[_0xd1d3('0x68')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x18d6dd['params']['id']}})[_0xd1d3('0x1a')](handleEntityNotFound(_0x25d229,null))['then'](function(_0x41152a){if(_0x41152a){_0x18d6dd[_0xd1d3('0x68')]['ChatWebsiteId']=_0x41152a['id'];return db['Disposition']['create'](_0x18d6dd['body']);}})['then'](respondWithResult(_0x25d229,null))[_0xd1d3('0x24')](handleError(_0x25d229,null));};exports[_0xd1d3('0x75')]=function(_0x3caa0f,_0x1edf79){var _0xe6aaca={'raw':![],'where':{}};var _0x367306={};var _0x551bea={'count':0x0,'rows':[]};return db[_0xd1d3('0x4c')][_0xd1d3('0x76')]({'where':{'id':_0x3caa0f[_0xd1d3('0x72')]['id']}})[_0xd1d3('0x1a')](handleEntityNotFound(_0x1edf79,null))['then'](function(_0x2c3a63){if(_0x2c3a63){_0x367306['model']=_[_0xd1d3('0x62')](db[_0xd1d3('0x77')][_0xd1d3('0x78')]);_0x367306[_0xd1d3('0x50')]=_[_0xd1d3('0x62')](_0x3caa0f['query']);_0x367306[_0xd1d3('0x58')]=_[_0xd1d3('0x4f')](_0x367306[_0xd1d3('0x46')],_0x367306[_0xd1d3('0x50')]);_0xe6aaca[_0xd1d3('0x51')]=_[_0xd1d3('0x4f')](_0x367306['model'],qs[_0xd1d3('0x63')](_0x3caa0f[_0xd1d3('0x50')][_0xd1d3('0x63')]));_0xe6aaca['attributes']=_0xe6aaca[_0xd1d3('0x51')]['length']?_0xe6aaca[_0xd1d3('0x51')]:_0x367306[_0xd1d3('0x46')];if(!_0x3caa0f[_0xd1d3('0x50')]['hasOwnProperty'](_0xd1d3('0x54'))){_0xe6aaca[_0xd1d3('0x2b')]=qs[_0xd1d3('0x2b')](_0x3caa0f[_0xd1d3('0x50')]['limit']);_0xe6aaca[_0xd1d3('0x29')]=qs[_0xd1d3('0x29')](_0x3caa0f[_0xd1d3('0x50')][_0xd1d3('0x29')]);}_0xe6aaca['order']=qs['sort'](_0x3caa0f['query'][_0xd1d3('0x56')]);_0xe6aaca[_0xd1d3('0x57')]=qs[_0xd1d3('0x58')](_[_0xd1d3('0x59')](_0x3caa0f['query'],_0x367306[_0xd1d3('0x58')]));_0xe6aaca[_0xd1d3('0x57')][_0xd1d3('0x79')]=_0x2c3a63['id'];if(_0x3caa0f[_0xd1d3('0x50')]['filter']){_0xe6aaca['where']=_[_0xd1d3('0x5b')](_0xe6aaca[_0xd1d3('0x57')],{'$or':_['map'](_0xe6aaca[_0xd1d3('0x51')],function(_0x2190e5){var _0x43ae54={};_0x43ae54[_0x2190e5]={'$like':'%'+_0x3caa0f[_0xd1d3('0x50')][_0xd1d3('0x5a')]+'%'};return _0x43ae54;})});}_0xe6aaca=_[_0xd1d3('0x5b')]({},_0xe6aaca,_0x3caa0f[_0xd1d3('0x65')]);return db['Disposition']['count']({'where':_0xe6aaca[_0xd1d3('0x57')]})[_0xd1d3('0x1a')](function(_0x1d284b){_0x551bea[_0xd1d3('0x2c')]=_0x1d284b;if(_0x3caa0f['query'][_0xd1d3('0x5d')]){_0xe6aaca[_0xd1d3('0x64')]=[{'all':!![]}];}return db['Disposition'][_0xd1d3('0x5e')](_0xe6aaca);})[_0xd1d3('0x1a')](function(_0x164d6e){_0x551bea[_0xd1d3('0x5f')]=_0x164d6e;return _0x551bea;});}})['then'](respondWithFilteredResult(_0x1edf79,_0xe6aaca))[_0xd1d3('0x24')](handleError(_0x1edf79,null));};exports[_0xd1d3('0x7a')]=function(_0x431faa,_0x27edfb){return db[_0xd1d3('0x4c')][_0xd1d3('0x66')]({'where':{'id':_0x431faa[_0xd1d3('0x72')]['id']}})['then'](handleEntityNotFound(_0x27edfb,null))[_0xd1d3('0x1a')](function(_0x23d85e){if(_0x23d85e){return _0x23d85e[_0xd1d3('0x7a')](_0x431faa[_0xd1d3('0x50')]['ids']);}})[_0xd1d3('0x1a')](respondWithStatusCode(_0x27edfb,null))[_0xd1d3('0x24')](handleError(_0x27edfb,null));};exports['addAnswer']=function(_0x49597f,_0x1b8d3f){if(_0x49597f['body']['id']){delete _0x49597f[_0xd1d3('0x68')]['id'];}return db[_0xd1d3('0x4c')]['find']({'where':{'id':_0x49597f['params']['id']}})[_0xd1d3('0x1a')](handleEntityNotFound(_0x1b8d3f,null))['then'](function(_0x304943){if(_0x304943){_0x49597f['body'][_0xd1d3('0x79')]=_0x304943['id'];return db['CannedAnswer'][_0xd1d3('0x67')](_0x49597f[_0xd1d3('0x68')]);}})[_0xd1d3('0x1a')](respondWithResult(_0x1b8d3f,null))[_0xd1d3('0x24')](handleError(_0x1b8d3f,null));};exports[_0xd1d3('0x7b')]=function(_0x574adc,_0x4e20ec){var _0x27da62={'raw':![],'where':{}};var _0x33c8b0={};var _0x27308e={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x574adc[_0xd1d3('0x72')]['id']}})[_0xd1d3('0x1a')](handleEntityNotFound(_0x4e20ec,null))[_0xd1d3('0x1a')](function(_0x7453f8){if(_0x7453f8){_0x33c8b0[_0xd1d3('0x46')]=_[_0xd1d3('0x62')](db[_0xd1d3('0x7c')]['rawAttributes']);_0x33c8b0[_0xd1d3('0x50')]=_[_0xd1d3('0x62')](_0x574adc[_0xd1d3('0x50')]);_0x33c8b0[_0xd1d3('0x58')]=_[_0xd1d3('0x4f')](_0x33c8b0['model'],_0x33c8b0[_0xd1d3('0x50')]);_0x27da62[_0xd1d3('0x51')]=_[_0xd1d3('0x4f')](_0x33c8b0[_0xd1d3('0x46')],qs[_0xd1d3('0x63')](_0x574adc['query'][_0xd1d3('0x63')]));_0x27da62[_0xd1d3('0x51')]=_0x27da62[_0xd1d3('0x51')]['length']?_0x27da62['attributes']:_0x33c8b0['model'];if(!_0x574adc[_0xd1d3('0x50')][_0xd1d3('0x53')](_0xd1d3('0x54'))){_0x27da62[_0xd1d3('0x2b')]=qs[_0xd1d3('0x2b')](_0x574adc[_0xd1d3('0x50')]['limit']);_0x27da62[_0xd1d3('0x29')]=qs[_0xd1d3('0x29')](_0x574adc[_0xd1d3('0x50')]['offset']);}_0x27da62[_0xd1d3('0x55')]=qs[_0xd1d3('0x56')](_0x574adc['query']['sort']);_0x27da62['where']=qs['filters'](_[_0xd1d3('0x59')](_0x574adc[_0xd1d3('0x50')],_0x33c8b0[_0xd1d3('0x58')]));_0x27da62[_0xd1d3('0x57')][_0xd1d3('0x79')]=_0x7453f8['id'];if(_0x574adc[_0xd1d3('0x50')]['filter']){_0x27da62[_0xd1d3('0x57')]=_[_0xd1d3('0x5b')](_0x27da62[_0xd1d3('0x57')],{'$or':_[_0xd1d3('0x4b')](_0x27da62[_0xd1d3('0x51')],function(_0xc8ae3d){var _0x484f45={};_0x484f45[_0xc8ae3d]={'$like':'%'+_0x574adc[_0xd1d3('0x50')]['filter']+'%'};return _0x484f45;})});}_0x27da62=_[_0xd1d3('0x5b')]({},_0x27da62,_0x574adc['options']);return db[_0xd1d3('0x7c')][_0xd1d3('0x2c')]({'where':_0x27da62[_0xd1d3('0x57')]})[_0xd1d3('0x1a')](function(_0x16a50f){_0x27308e[_0xd1d3('0x2c')]=_0x16a50f;if(_0x574adc['query']['includeAll']){_0x27da62[_0xd1d3('0x64')]=[{'all':!![]}];}return db[_0xd1d3('0x7c')][_0xd1d3('0x5e')](_0x27da62);})[_0xd1d3('0x1a')](function(_0x19170d){_0x27308e[_0xd1d3('0x5f')]=_0x19170d;return _0x27308e;});}})[_0xd1d3('0x1a')](respondWithFilteredResult(_0x4e20ec,_0x27da62))[_0xd1d3('0x24')](handleError(_0x4e20ec,null));};exports[_0xd1d3('0x7d')]=function(_0x3d408e,_0x45cab3){return db[_0xd1d3('0x4c')]['find']({'where':{'id':_0x3d408e[_0xd1d3('0x72')]['id']}})[_0xd1d3('0x1a')](handleEntityNotFound(_0x45cab3,null))[_0xd1d3('0x1a')](function(_0x1021a7){if(_0x1021a7){return _0x1021a7[_0xd1d3('0x7d')](_0x3d408e[_0xd1d3('0x50')][_0xd1d3('0x7e')]);}})['then'](respondWithStatusCode(_0x45cab3,null))[_0xd1d3('0x24')](handleError(_0x45cab3,null));};exports[_0xd1d3('0x7f')]=function(_0x502782,_0x33f4d6){_0x502782[_0xd1d3('0x68')][_0xd1d3('0x80')]=_0x502782[_0xd1d3('0x81')][_0xd1d3('0x82')];return db[_0xd1d3('0x4c')][_0xd1d3('0x66')]({'where':{'id':_0x502782[_0xd1d3('0x72')]['id']}})[_0xd1d3('0x1a')](handleEntityNotFound(_0x33f4d6,null))['then'](saveUpdates(_0x502782['body'],null))[_0xd1d3('0x1a')](respondWithResult(_0x33f4d6,null))[_0xd1d3('0x24')](handleError(_0x33f4d6,null));};exports['addAvatar']=function(_0x198be5,_0x3eeb2a){_0x198be5['body']['agentAvatar']=_0x198be5[_0xd1d3('0x81')][_0xd1d3('0x82')];return db[_0xd1d3('0x4c')]['find']({'where':{'id':_0x198be5[_0xd1d3('0x72')]['id']}})[_0xd1d3('0x1a')](handleEntityNotFound(_0x3eeb2a,null))[_0xd1d3('0x1a')](saveUpdates(_0x198be5[_0xd1d3('0x68')],null))['then'](respondWithResult(_0x3eeb2a,null))['catch'](handleError(_0x3eeb2a,null));};exports[_0xd1d3('0x83')]=function(_0x54eb92,_0x21f8a6){_0x54eb92[_0xd1d3('0x68')][_0xd1d3('0x84')]=_0x54eb92['file']['filename'];return db[_0xd1d3('0x4c')][_0xd1d3('0x66')]({'where':{'id':_0x54eb92[_0xd1d3('0x72')]['id']}})[_0xd1d3('0x1a')](handleEntityNotFound(_0x21f8a6,null))[_0xd1d3('0x1a')](saveUpdates(_0x54eb92[_0xd1d3('0x68')],null))['then'](respondWithResult(_0x21f8a6,null))['catch'](handleError(_0x21f8a6,null));};exports[_0xd1d3('0x85')]=function(_0xa4aba0,_0x383583){_0xa4aba0[_0xd1d3('0x68')][_0xd1d3('0x86')]=_0xa4aba0[_0xd1d3('0x81')][_0xd1d3('0x82')];return db['ChatWebsite'][_0xd1d3('0x66')]({'where':{'id':_0xa4aba0[_0xd1d3('0x72')]['id']}})['then'](handleEntityNotFound(_0x383583,null))['then'](saveUpdates(_0xa4aba0[_0xd1d3('0x68')],null))[_0xd1d3('0x1a')](respondWithResult(_0x383583,null))['catch'](handleError(_0x383583,null));};exports['getLogo']=function(_0xf4bc24,_0x2718b7){var _0x180011=path[_0xd1d3('0x87')](config[_0xd1d3('0x88')],'server/files/images/logos/default_logo.svg');var _0x4990bb={'where':{'id':_0xf4bc24[_0xd1d3('0x72')]['id']},'attributes':['id',_0xd1d3('0x80')],'raw':!![]};var _0x449262=![];return require(_0xd1d3('0x89'))[_0xd1d3('0x8a')]()[_0xd1d3('0x1a')](function(_0x14496f){if(_0x14496f){_0x449262=_0x14496f[_0xd1d3('0x8b')];}})[_0xd1d3('0x1a')](function(){return db[_0xd1d3('0x4c')][_0xd1d3('0x66')](_0x4990bb);})[_0xd1d3('0x1a')](handleEntityNotFound(_0x2718b7,null))[_0xd1d3('0x1a')](function(_0x584441){if(_0x584441){if(!_['isNil'](_0x584441[_0xd1d3('0x80')])){if(fs[_0xd1d3('0x8c')](path[_0xd1d3('0x87')](config['root'],_0xd1d3('0x8d'),_0x584441[_0xd1d3('0x80')]))&&_0x449262){_0x180011=path['join'](config[_0xd1d3('0x88')],_0xd1d3('0x8d'),_0x584441[_0xd1d3('0x80')]);}}return _0x2718b7['download'](_0x180011);}})['catch'](handleError(_0x2718b7,null));};exports['getAvatar']=function(_0x5c38c7,_0xad7631){var _0x30cf91=path['join'](config['root'],_0xd1d3('0x8e'));var _0x294d52={'where':{'id':_0x5c38c7['params']['id']},'attributes':['id',_0xd1d3('0x8f')],'raw':!![]};return db['ChatWebsite']['find'](_0x294d52)[_0xd1d3('0x1a')](handleEntityNotFound(_0xad7631,null))[_0xd1d3('0x1a')](function(_0x44b137){if(_0x44b137){if(!_['isNil'](_0x44b137[_0xd1d3('0x8f')])){if(fs[_0xd1d3('0x8c')](path['join'](config['root'],_0xd1d3('0x90'),_0x44b137[_0xd1d3('0x8f')]))){_0x30cf91=path['join'](config[_0xd1d3('0x88')],_0xd1d3('0x90'),_0x44b137['agentAvatar']);}}return _0xad7631['download'](_0x30cf91);}})[_0xd1d3('0x24')](handleError(_0xad7631,null));};exports['getCustomerAvatar']=function(_0x577dcd,_0x1aabad){var _0x10ab86=path[_0xd1d3('0x87')](config[_0xd1d3('0x88')],'server/files/images/avatars/customer_avatar.png');var _0x38d09a={'where':{'id':_0x577dcd['params']['id']},'attributes':['id','customerAvatar',_0xd1d3('0x91')],'raw':!![]};return db[_0xd1d3('0x4c')]['find'](_0x38d09a)[_0xd1d3('0x1a')](handleEntityNotFound(_0x1aabad,null))[_0xd1d3('0x1a')](function(_0x230b4b){if(_0x230b4b){if(!_[_0xd1d3('0x92')](_0x230b4b[_0xd1d3('0x84')])){if(fs[_0xd1d3('0x8c')](path['join'](config['root'],'server/files/images/avatars/',_0x230b4b[_0xd1d3('0x84')]))&&_0x230b4b[_0xd1d3('0x91')]){_0x10ab86=path['join'](config[_0xd1d3('0x88')],_0xd1d3('0x90'),_0x230b4b[_0xd1d3('0x84')]);}}return _0x1aabad[_0xd1d3('0x93')](_0x10ab86);}})[_0xd1d3('0x24')](handleError(_0x1aabad,null));};exports[_0xd1d3('0x94')]=function(_0x2949b5,_0x4d82e5){var _0xe0e3a=path[_0xd1d3('0x87')](config[_0xd1d3('0x88')],_0xd1d3('0x95'));var _0x236dda={'where':{'id':_0x2949b5[_0xd1d3('0x72')]['id']},'attributes':['id',_0xd1d3('0x86')],'raw':!![]};return db[_0xd1d3('0x4c')][_0xd1d3('0x66')](_0x236dda)[_0xd1d3('0x1a')](handleEntityNotFound(_0x4d82e5,null))[_0xd1d3('0x1a')](function(_0x1109dc){if(_0x1109dc){if(!_[_0xd1d3('0x92')](_0x1109dc[_0xd1d3('0x86')])){if(fs[_0xd1d3('0x8c')](path[_0xd1d3('0x87')](config[_0xd1d3('0x88')],_0xd1d3('0x90'),_0x1109dc[_0xd1d3('0x86')]))){_0xe0e3a=path['join'](config[_0xd1d3('0x88')],_0xd1d3('0x90'),_0x1109dc[_0xd1d3('0x86')]);}}return _0x4d82e5[_0xd1d3('0x93')](_0xe0e3a);}})[_0xd1d3('0x24')](handleError(_0x4d82e5,null));};function checkWebsiteInterval(_0x368e95){var _0x12b983=_0x368e95['Interval'];if(!_0x12b983){return Promise[_0xd1d3('0x96')](_0x368e95);}var _0x10145e=_0x368e95[_0xd1d3('0x97')]||undefined;return _0x12b983['ifTime'](_0x10145e)[_0xd1d3('0x1a')](function(_0x43aac7){if(!_0x43aac7){throw new APIOutOfIntervalError();}return _0x368e95;});}exports['notify']=function(_0x4017bd,_0x52f926){var _0x200429={'body':_0x4017bd[_0xd1d3('0x68')],'channel':_0xd1d3('0x98')};var _0x54d003=[];var _0x520b90=[];var _0x761929={};var _0x3e2e67=![];if(_0x4017bd[_0xd1d3('0x68')]['id']){delete _0x4017bd[_0xd1d3('0x68')]['id'];}if(_[_0xd1d3('0x92')](_0x4017bd[_0xd1d3('0x68')][_0xd1d3('0x99')])){throw new APIBadRequestError('From\x20is\x20mandatory');}if(_[_0xd1d3('0x92')](_0x4017bd['body']['mapKey'])){throw new APIBadRequestError('MapKey\x20is\x20mandatory');}if(_[_0xd1d3('0x9a')](_0x4017bd['body']['body'])){throw new APIBadRequestError(_0xd1d3('0x9b'));}var _0xc20d2e=_0x4017bd[_0xd1d3('0x68')][_0xd1d3('0x39')]&&_0x4017bd[_0xd1d3('0x68')]['referer'];return db['CmContact'][_0xd1d3('0x73')]()[_0xd1d3('0x1a')](function(_0x3ff871){if(!_0x3ff871){throw new Error(_0xd1d3('0x9c'));}_0x54d003=Object[_0xd1d3('0x62')](_0x3ff871)[_0xd1d3('0x5a')](function(_0x47d46e){return![_0xd1d3('0x9d'),'updatedAt'][_0xd1d3('0x9e')](_0x47d46e);});_0x520b90=Object[_0xd1d3('0x62')](_0x3ff871)['filter'](function(_0x3ba105){return![_0xd1d3('0x9d'),_0xd1d3('0x9f'),_0xd1d3('0xa0'),_0xd1d3('0xa1')][_0xd1d3('0x9e')](_0x3ba105);});if(!_[_0xd1d3('0x9e')](_0x520b90,_0x4017bd[_0xd1d3('0x68')][_0xd1d3('0xa2')])){throw new APIBadRequestError(_0xd1d3('0xa3')+_0x520b90[_0xd1d3('0x87')](',\x20'));}_0x761929[_0x4017bd['body'][_0xd1d3('0xa2')]]=_0x4017bd[_0xd1d3('0x68')][_0xd1d3('0x99')];})[_0xd1d3('0x1a')](function(){return db[_0xd1d3('0x4c')][_0xd1d3('0x66')]({'where':{'id':_0x4017bd['params']['id']},'include':[{'model':db[_0xd1d3('0xa4')],'as':_0xd1d3('0xa5'),'include':[{'model':db[_0xd1d3('0xa6')],'as':_0xd1d3('0xa7'),'where':_0x761929,'limit':0x1,'order':[['updatedAt',_0xd1d3('0xa8')]]}]},{'model':db[_0xd1d3('0xa9')],'as':_0xd1d3('0xaa')},{'model':db['Interval'],'as':_0xd1d3('0xab'),'include':[{'model':db['Interval'],'as':'Intervals','attributes':['id','interval'],'raw':!![]}]}]});})[_0xd1d3('0x1a')](function(_0x455f51){if(!_0x455f51){throw new APINotFoundError(util[_0xd1d3('0x42')](_0xd1d3('0xac'),_0x4017bd[_0xd1d3('0x72')]['id']));}if(_0xc20d2e){return checkWebsiteInterval(_0x455f51);}return _0x455f51;})[_0xd1d3('0x1a')](function(_0x3f1c6a){_0x200429[_0xd1d3('0xad')]=_0x3f1c6a;_0x200429[_0xd1d3('0xae')]=_[_0xd1d3('0xaf')](_0x3f1c6a[_0xd1d3('0xaa')],[_0xd1d3('0xb0')],[_0xd1d3('0xb1')]);if(_0x200429[_0xd1d3('0xad')][_0xd1d3('0xaa')]){delete _0x200429['account'][_0xd1d3('0xaa')];}_0x200429[_0xd1d3('0xb2')]=_0x3f1c6a['List']||{'id':_0x3f1c6a[_0xd1d3('0xa1')]};if(_0x200429[_0xd1d3('0xb2')]&&_0x200429[_0xd1d3('0xb2')][_0xd1d3('0xa7')][_0xd1d3('0x52')]){return _0x200429[_0xd1d3('0xb2')]['Contacts'][0x0];}var _0x375e91=_[_0xd1d3('0x12')](_0x4017bd['body'],{'firstName':_0x4017bd[_0xd1d3('0x68')][_0xd1d3('0x99')],'ListId':_0x3f1c6a['ListId']});_0x375e91[_0x4017bd[_0xd1d3('0x68')][_0xd1d3('0xa2')]]=_0x4017bd[_0xd1d3('0x68')][_0xd1d3('0x99')];return db['CmContact'][_0xd1d3('0x67')](_0x375e91,{'fields':_0x54d003,'raw':!![]});})[_0xd1d3('0x1a')](function(_0x1c428a){_0x200429[_0xd1d3('0xb3')]=_0x1c428a;var _0x24c557=createInteractionObject(_0x4017bd['params']['id'],_0x4017bd[_0xd1d3('0x68')],_0x4017bd['headers'],_0x1c428a);var _0x24489a={'ChatWebsiteId':_0x4017bd['params']['id']};if(_0x4017bd[_0xd1d3('0x68')][_0xd1d3('0xb4')]){_0x24489a[_0xd1d3('0xb4')]=_0x4017bd[_0xd1d3('0x68')][_0xd1d3('0xb4')];_0x24489a[_0xd1d3('0xb5')]=![];return db['ChatInteraction'][_0xd1d3('0x66')]({'where':_0x24489a})[_0xd1d3('0x1a')](function(_0x2528ab){var _0x170da8=_0x4017bd['body'][_0xd1d3('0x39')]&&_0x4017bd[_0xd1d3('0x68')][_0xd1d3('0xb6')];if(_0x2528ab){_0x3e2e67=!![];return _0x2528ab;}else if(!_0x170da8&&_0x2528ab&&_0x2528ab[_0xd1d3('0xb5')]){throw new APIConflictError('Writing\x20on\x20closed\x20interaction');}_0x24c557[_0xd1d3('0xb4')]=_0x4017bd[_0xd1d3('0x68')][_0xd1d3('0xb4')];_0x24c557['externalUrl']=_0x4017bd[_0xd1d3('0x68')][_0xd1d3('0xb7')];return db[_0xd1d3('0xb8')][_0xd1d3('0x67')](_0x24c557);});}_0x24489a[_0xd1d3('0xb9')]=_0x1c428a['id'];if(_0x4017bd['body'][_0xd1d3('0xba')]&&_0x4017bd['body'][_0xd1d3('0xba')]['id']){_0x24489a['id']=_0x4017bd[_0xd1d3('0x68')][_0xd1d3('0xba')]['id'];return db[_0xd1d3('0xb8')][_0xd1d3('0x66')]({'where':_0x24489a})[_0xd1d3('0x1a')](function(_0x1f89f0){var _0x442ac1=_0x4017bd[_0xd1d3('0x68')][_0xd1d3('0x39')]&&_0x4017bd[_0xd1d3('0x68')][_0xd1d3('0xb6')];if(!_0x442ac1&&_0x1f89f0&&_0x1f89f0['closed']){throw new APIConflictError('Writing\x20on\x20closed\x20interaction');}else if(_0x1f89f0){_0x3e2e67=!![];return _0x1f89f0;}else{return db[_0xd1d3('0xb8')][_0xd1d3('0x67')](_0x24c557);}});}return db[_0xd1d3('0xb8')]['create'](_0x24c557);})[_0xd1d3('0x1a')](function(_0x8c5810){if(!_0x3e2e67){return _0x8c5810;}var _0xc2e30e={'from':(_0x200429['contact'][_0xd1d3('0x3d')]||'')+'\x20'+(_0x200429[_0xd1d3('0xb3')][_0xd1d3('0x3e')]||'')};if(_0x4017bd[_0xd1d3('0x68')][_0xd1d3('0xb4')]&&_0x4017bd['body'][_0xd1d3('0xbb')]&&_0x4017bd[_0xd1d3('0x68')][_0xd1d3('0xb4')]!=_0x4017bd[_0xd1d3('0x68')][_0xd1d3('0xbb')]){_0xc2e30e[_0xd1d3('0xb4')]=_0x4017bd[_0xd1d3('0x68')][_0xd1d3('0xbb')];}return _0x8c5810[_0xd1d3('0x2f')](_0xc2e30e);})[_0xd1d3('0x1a')](function(_0x1b0bc6){_0x200429[_0xd1d3('0xba')]=_0x1b0bc6['get']({'plain':!![]});_0x200429[_0xd1d3('0xba')][_0xd1d3('0xbc')]=!_0x3e2e67;if(_0x200429[_0xd1d3('0xba')][_0xd1d3('0xbc')]){if(_0x200429['account'][_0xd1d3('0xbd')]){_0x200429['applications'][_0xd1d3('0xbe')]({'id':0x0,'priority':_0x200429['applications'][_0xd1d3('0x52')]+0x1,'app':_0xd1d3('0xbf'),'appdata':_0xd1d3('0xc0'),'interval':'*,*,*,*'});}}return db['ChatMessage']['create']({'body':_0x4017bd[_0xd1d3('0x68')]['body'],'ChatWebsiteId':_0x4017bd[_0xd1d3('0x72')]['id'],'ChatInteractionId':_0x1b0bc6['id'],'direction':'in','ContactId':_0x200429[_0xd1d3('0xb3')]['id'],'AttachmentId':_0x4017bd['body'][_0xd1d3('0xc1')]});})['then'](function(_0x4ca6d9){_0x200429[_0xd1d3('0x22')]=_0x4ca6d9;if(!_0x200429['interaction'][_0xd1d3('0xc2')]){return;}return db[_0xd1d3('0xc3')]['find']({'attributes':['id',_0xd1d3('0x34')],'where':{'id':_0x200429[_0xd1d3('0xba')][_0xd1d3('0xc2')]}});})[_0xd1d3('0x1a')](function(_0x253e76){if(_0x253e76){_0x200429[_0xd1d3('0xae')][_0xd1d3('0xc4')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x253e76[_0xd1d3('0x34')]+','+(_0x200429[_0xd1d3('0xad')][_0xd1d3('0xc5')]||0xa),'interval':'*,*,*,*'});_0x200429[_0xd1d3('0xc6')]=!![];}if(!_0x200429['interaction'][_0xd1d3('0xc7')]){return;}return db['ChatQueue']['find']({'attributes':['id',_0xd1d3('0x34')],'where':{'id':_0x200429['interaction']['queueId']}});})['then'](function(_0x1b350b){if(_0x1b350b){_0x200429[_0xd1d3('0xae')][_0xd1d3('0xc4')]({'id':0x0,'priority':0x1,'app':_0xd1d3('0xc8'),'appdata':_0x1b350b[_0xd1d3('0x34')]+','+(_0x200429[_0xd1d3('0xad')]['waitForTheAssignedQueue']||0x12c),'interval':_0xd1d3('0xc9')});}return respondWithRpcPromise(_0xd1d3('0xca'),_0xd1d3('0xcb'),_0x200429);})[_0xd1d3('0x1a')](function(_0x1cb9a0){respondWithRpcPromise(_0xd1d3('0xcc'),'EventManager',{'event':_0xd1d3('0xcd'),'message':_0x1cb9a0},client9002);return _0x1cb9a0;})[_0xd1d3('0x1a')](respondWithResult(_0x52f926,null))[_0xd1d3('0x24')](APIHandleError(_0x52f926));};exports[_0xd1d3('0xce')]=function(_0xcd1e7e,_0x419a51){var _0x53945a,_0x4f779b,_0x47ffe0;var _0x3da2d1=[];var _0x3ea91f={};var _0x4e8caf=_0xcd1e7e[_0xd1d3('0xcf')]||[];var _0x188d31=[];var _0x311614;return db[_0xd1d3('0xa6')]['describe']()[_0xd1d3('0x1a')](function(_0x13edb9){if(!_0x13edb9){throw new db['Sequelize'][(_0xd1d3('0xd0'))]('no\x20available\x20attributes');}_0x3da2d1=_[_0xd1d3('0xd1')](_[_0xd1d3('0x62')](_0x13edb9),['createdAt',_0xd1d3('0x9f'),'CompanyId','ListId']);if(_0xcd1e7e[_0xd1d3('0x68')]['id']){delete _0xcd1e7e['body']['id'];}if(_[_0xd1d3('0x92')](_0xcd1e7e['body'][_0xd1d3('0x99')])){throw _0x419a51[_0xd1d3('0x26')](0x1f4)[_0xd1d3('0x35')](new db['Sequelize'][(_0xd1d3('0xd0'))](_0xd1d3('0xd2')));}if(_[_0xd1d3('0x92')](_0xcd1e7e['body'][_0xd1d3('0x68')])||_0xcd1e7e[_0xd1d3('0x68')][_0xd1d3('0x68')]===''){throw _0x419a51['status'](0x1f4)[_0xd1d3('0x35')](new db['Sequelize'][(_0xd1d3('0xd0'))](_0xd1d3('0xd3')));}if(_[_0xd1d3('0x92')](_0xcd1e7e[_0xd1d3('0x68')][_0xd1d3('0xd4')])){throw _0x419a51[_0xd1d3('0x26')](0x1f4)['send'](new db[(_0xd1d3('0xd5'))][(_0xd1d3('0xd0'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3da2d1));}if(!_[_0xd1d3('0x9e')](_0x3da2d1,_0xcd1e7e[_0xd1d3('0x68')][_0xd1d3('0xd4')])){throw _0x419a51[_0xd1d3('0x26')](0x1f4)[_0xd1d3('0x35')](new db[(_0xd1d3('0xd5'))][(_0xd1d3('0xd0'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3da2d1));}_0x3ea91f[_0xcd1e7e['body'][_0xd1d3('0xd4')]]=_0xcd1e7e['body'][_0xd1d3('0x99')];})[_0xd1d3('0x1a')](function(){return db[_0xd1d3('0x4c')][_0xd1d3('0x66')]({'where':{'id':_0xcd1e7e[_0xd1d3('0x72')]['id']},'include':[{'model':db[_0xd1d3('0xa4')],'as':_0xd1d3('0xa5')},{'model':db[_0xd1d3('0xd6')],'as':_0xd1d3('0xd6')}]});})[_0xd1d3('0x1a')](handleEntityNotFound(_0x419a51,null))['then'](function(_0x342bd8){if(_0x342bd8&&_0x342bd8[_0xd1d3('0xa5')]){_0x4f779b=_0x342bd8;var _0x48467a=_[_0xd1d3('0x12')](_0xcd1e7e['body'],{'firstName':_0xcd1e7e['body'][_0xd1d3('0x99')],'phone':_0xcd1e7e[_0xd1d3('0x68')]['from'],'ListId':_0x342bd8[_0xd1d3('0xa1')]});_0x48467a[_0xcd1e7e[_0xd1d3('0x68')]['mapKeyOffline']]=_0xcd1e7e['body'][_0xd1d3('0x99')];return db['CmContact'][_0xd1d3('0xd7')]({'where':_0x3ea91f,'defaults':_0x48467a});}})[_0xd1d3('0xd8')](function(_0x358d28){if(_0x358d28){_0x47ffe0=_0x358d28;var _0x4f6a01=fs[_0xd1d3('0xd9')](path[_0xd1d3('0x87')](config['root'],_0xd1d3('0xda')),_0xd1d3('0xdb'));var _0x1e7c6c=ejs[_0xd1d3('0xdc')](_0x4f6a01,{'body':_['toPairs'](_0xcd1e7e[_0xd1d3('0x68')][_0xd1d3('0x68')]),'bodyTitle':_0x4f779b[_0xd1d3('0xdd')]});return db['ChatOfflineMessage']['create']({'body':_0x1e7c6c,'plainBody':htmlToText[_0xd1d3('0xde')](_0x1e7c6c),'ContactId':_0x358d28['id'],'ChatWebsiteId':_0x4f779b['id']});}})[_0xd1d3('0x1a')](function(_0x16127f){_0x311614=_0x16127f;if(_0x4e8caf[_0xd1d3('0x52')]){var _0x265bbb=_0x4e8caf['map'](function(_0x306bd8){return{'name':_0x306bd8['originalname'],'basename':_0x306bd8[_0xd1d3('0x82')],'type':_0x306bd8['mimetype'],'ChatOfflineMessageId':_0x16127f['id']};});_0x188d31=_0x265bbb[_0xd1d3('0x4b')](_0x2f2333=>{var _0x5b23f7={'filename':_0x2f2333['name'],'path':path['join'](config[_0xd1d3('0x88')],_0xd1d3('0xdf'),'files',_0xd1d3('0xe0'),_0xd1d3('0xe1'),_0x2f2333[_0xd1d3('0xe2')])};return _0x5b23f7;});if(!_0x4f779b['openNewInteraction']){return db[_0xd1d3('0xe3')][_0xd1d3('0xe4')](function(_0x1ece1b){return db[_0xd1d3('0xe5')]['bulkCreate'](_0x265bbb,{'transaction':_0x1ece1b});});}}})[_0xd1d3('0x1a')](function(){if(_0x311614){_0x53945a=_0x311614;return db['MailAccount'][_0xd1d3('0x76')]({'where':{'service':!![]},'include':[{'model':db[_0xd1d3('0xe6')],'as':_0xd1d3('0xe7'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xd1d3('0xe8'),'raw':!![]}]}]});}})[_0xd1d3('0x1a')](function(_0x2ec270){if(_0x2ec270&&_0x2ec270['Smtp']&&_0x4f779b[_0xd1d3('0xe9')]&&_0x4f779b[_0xd1d3('0xea')]){var _0x28ba8a=_0x2ec270[_0xd1d3('0xeb')]();return respondWithRpcPromise(_0xd1d3('0xec'),_0xd1d3('0xed'),{'account':_0x28ba8a,'message':{'from':util[_0xd1d3('0x42')]('\x22%s\x22\x20<%s>',_0x2ec270[_0xd1d3('0x34')],_0x2ec270[_0xd1d3('0xee')]||_0x2ec270[_0xd1d3('0xe7')][_0xd1d3('0x6e')]),'to':_0x4f779b[_0xd1d3('0xea')],'subject':_0x4f779b[_0xd1d3('0xef')],'html':_0x53945a[_0xd1d3('0x68')],'attachments':_0x188d31}},client9003)[_0xd1d3('0x1a')](function(){return _0x53945a;})[_0xd1d3('0x24')](function(_0x45e04d){logger[_0xd1d3('0x21')](_0x45e04d);});}})[_0xd1d3('0x1a')](function(){if(_0x4f779b&&_0x4f779b[_0xd1d3('0xf0')]&&_0x4f779b[_0xd1d3('0xf1')]){var _0x1fca97=[];if(_0x4e8caf[_0xd1d3('0x52')]){_0x1fca97=_0x4e8caf[_0xd1d3('0x4b')](function(_0x235afc){return{'name':_0x235afc[_0xd1d3('0xf2')],'basename':_0x235afc[_0xd1d3('0x82')],'type':_0x235afc['mimetype'],'ChatOfflineMessageId':_0x311614['id']};});}var _0xc4b16a;if(!_['isNil'](_0x4f779b[_0xd1d3('0xf3')])){var _0x85520a=_['map'](_0xcd1e7e[_0xd1d3('0x68')],function(_0x551587){return _0x551587;});var _0x1485e9=_[_0xd1d3('0xf4')](_0x85520a)[0x0];var _0x580cf1=_['mapValues'](_0x1485e9,function(_0x1ea71b){return _0x1ea71b;});_0xc4b16a=_0x580cf1[0x1][_0x4f779b['subjectOffline']];}var _0x311625={'from':_0x47ffe0[_0xd1d3('0xee')],'firstName':_0x47ffe0[_0xd1d3('0x3d')],'lastName':_0x47ffe0[_0xd1d3('0x3e')],'mapKey':_0xd1d3('0xee'),'message':{'from':_0x47ffe0[_0xd1d3('0xee')],'to':_0x4f779b[_0xd1d3('0xd6')][_0xd1d3('0xee')],'cc':'','subject':_[_0xd1d3('0x92')](_0xc4b16a)?_0x4f779b['offlineMessageSubject']:_0xc4b16a,'messageId':'','sentAt':new Date(),'attach':_0x1fca97['length'],'attachments':_0x1fca97,'originChannel':_0xd1d3('0xf5'),'ChatWebsiteId':_0x4f779b['id'],'ChatOfflineMessageId':_0x53945a['id'],'originTo':_0x4f779b[_0xd1d3('0xd6')]['email']},'body':_0x53945a[_0xd1d3('0x68')]};var _0x2923e3={'account':{'id':_0x4f779b[_0xd1d3('0xf1')]},'body':_0x311625,'log':_0xd1d3('0xf6')};return respondWithRpcPromise(_0xd1d3('0xf6'),_0xd1d3('0xf7'),_0x2923e3,client9001)[_0xd1d3('0x1a')](function(){return _0x53945a;})[_0xd1d3('0x24')](function(_0x2eeaef){logger[_0xd1d3('0x21')](_0x2eeaef);});}return;})[_0xd1d3('0x1a')](function(){if(_0x53945a){return _0x53945a;}})[_0xd1d3('0x1a')](respondWithResult(_0x419a51,null))[_0xd1d3('0x24')](function(){for(var _0x51e9d3 of _0x4e8caf){var _0x166dec=path['join'](config[_0xd1d3('0x88')],_0xd1d3('0xdf'),_0xd1d3('0xcf'),_0xd1d3('0xe0'),_0xd1d3('0xe1'),_0x51e9d3['filename']);fs_extra[_0xd1d3('0xf8')](_0x166dec)['catch'](function(_0x51cf10){logger[_0xd1d3('0x21')]('Could\x20not\x20remove\x20attachment\x20file',_0x166dec,_0x51cf10);});}});};exports[_0xd1d3('0xf9')]=function(_0x1bf7f6,_0x5ea151){return db[_0xd1d3('0xb8')][_0xd1d3('0x66')]({'where':{'id':_0x1bf7f6[_0xd1d3('0x72')]['id']}})['then'](handleEntityNotFound(_0x5ea151,null))[_0xd1d3('0x1a')](function(_0x3950da){if(_0x3950da){return _0x3950da[_0xd1d3('0xf9')](_0x1bf7f6[_0xd1d3('0x68')][_0xd1d3('0x7e')],_[_0xd1d3('0xfa')](_0x1bf7f6[_0xd1d3('0x68')],['ids','id'])||{});}})[_0xd1d3('0x1a')](respondWithResult(_0x5ea151,null))[_0xd1d3('0x24')](handleError(_0x5ea151,null));};exports['getInteractions']=function(_0x40c0ce,_0x2cb09b){var _0x515097={'raw':![],'where':{}};var _0x371b41={};var _0x5aab4a={'count':0x0,'rows':[]};return db[_0xd1d3('0x4c')][_0xd1d3('0x76')]({'where':{'id':_0x40c0ce['params']['id']}})['then'](handleEntityNotFound(_0x2cb09b,null))['then'](function(_0x3c9d64){if(_0x3c9d64){_0x371b41[_0xd1d3('0x46')]=_[_0xd1d3('0x62')](db[_0xd1d3('0xb8')]['rawAttributes']);_0x371b41['query']=_[_0xd1d3('0x62')](_0x40c0ce[_0xd1d3('0x50')]);_0x371b41[_0xd1d3('0x58')]=_[_0xd1d3('0x4f')](_0x371b41[_0xd1d3('0x46')],_0x371b41[_0xd1d3('0x50')]);_0x515097[_0xd1d3('0x51')]=_[_0xd1d3('0x4f')](_0x371b41['model'],qs[_0xd1d3('0x63')](_0x40c0ce[_0xd1d3('0x50')][_0xd1d3('0x63')]));_0x515097[_0xd1d3('0x51')]=_0x515097[_0xd1d3('0x51')][_0xd1d3('0x52')]?_0x515097[_0xd1d3('0x51')]:_0x371b41[_0xd1d3('0x46')];if(!_0x40c0ce[_0xd1d3('0x50')][_0xd1d3('0x53')]('nolimit')){_0x515097['limit']=qs[_0xd1d3('0x2b')](_0x40c0ce[_0xd1d3('0x50')][_0xd1d3('0x2b')]);_0x515097[_0xd1d3('0x29')]=qs[_0xd1d3('0x29')](_0x40c0ce[_0xd1d3('0x50')][_0xd1d3('0x29')]);}_0x515097[_0xd1d3('0x55')]=qs[_0xd1d3('0x56')](_0x40c0ce[_0xd1d3('0x50')][_0xd1d3('0x56')]);_0x515097[_0xd1d3('0x57')]=qs[_0xd1d3('0x58')](_[_0xd1d3('0x59')](_0x40c0ce['query'],_0x371b41[_0xd1d3('0x58')]));_0x515097[_0xd1d3('0x57')][_0xd1d3('0x79')]=_0x3c9d64['id'];if(_0x40c0ce[_0xd1d3('0x50')]['filter']){_0x515097['where']=_[_0xd1d3('0x5b')](_0x515097[_0xd1d3('0x57')],{'$or':_['map'](_0x515097[_0xd1d3('0x51')],function(_0x564aa8){var _0x29eb84={};_0x29eb84[_0x564aa8]={'$like':'%'+_0x40c0ce[_0xd1d3('0x50')]['filter']+'%'};return _0x29eb84;})});}_0x515097=_[_0xd1d3('0x5b')]({},_0x515097,_0x40c0ce[_0xd1d3('0x65')]);return db[_0xd1d3('0xb8')][_0xd1d3('0x2c')]({'where':_0x515097['where']})['then'](function(_0x5bb647){_0x5aab4a[_0xd1d3('0x2c')]=_0x5bb647;if(_0x40c0ce[_0xd1d3('0x50')][_0xd1d3('0x5d')]){_0x515097['include']=[{'model':db[_0xd1d3('0xa6')],'as':'Contact','required':![]},{'model':db['User'],'as':_0xd1d3('0xfb'),'attributes':[_0xd1d3('0x34'),_0xd1d3('0xfc'),_0xd1d3('0xfd')],'required':![]},{'model':db[_0xd1d3('0xfe')],'as':_0xd1d3('0xff'),'attributes':['id',_0xd1d3('0x34'),'color'],'where':_0x40c0ce[_0xd1d3('0x50')][_0xd1d3('0x100')]?{'id':_0x40c0ce[_0xd1d3('0x50')][_0xd1d3('0x100')]}:undefined,'required':_0x40c0ce[_0xd1d3('0x50')]['tag']?!![]:![]}];}return db[_0xd1d3('0xb8')][_0xd1d3('0x5e')](_0x515097);})['then'](function(_0x4f5ca7){_0x5aab4a[_0xd1d3('0x5f')]=_0x4f5ca7;return _0x5aab4a;});}})[_0xd1d3('0x1a')](respondWithFilteredResult(_0x2cb09b,_0x515097))['catch'](handleError(_0x2cb09b,null));};exports[_0xd1d3('0x101')]=function(_0x27ac99,_0x474904){var _0x545e70=0x0;var _0x30a03e=0x0;var _0xce0ab4=![];var _0x4e2861;var _0x2df672;return db['ChatWebsite'][_0xd1d3('0x66')]({'where':{'id':_0x27ac99[_0xd1d3('0x72')]['id']},'include':[{'model':db['Interval'],'as':'Interval','include':[{'model':db[_0xd1d3('0xab')],'as':_0xd1d3('0x102'),'attributes':['id',_0xd1d3('0x103')]}]}]})[_0xd1d3('0x1a')](handleEntityNotFound(_0x474904,null))[_0xd1d3('0x1a')](function(_0x3e6bf6){if(_0x3e6bf6){_0x4e2861=_0x3e6bf6;return _0x3e6bf6[_0xd1d3('0x104')]({'raw':!![]});}})[_0xd1d3('0x1a')](function(_0x719893){if(_0x4e2861){if(_0x719893){_0x2df672=_0x719893;}}return require(_0xd1d3('0x89'))[_0xd1d3('0x8a')]();})[_0xd1d3('0x1a')](function(_0x370e5d){if(_0x370e5d){_0x30a03e=_0x370e5d[_0xd1d3('0x105')];_0xce0ab4=_0x370e5d['custom'];}})['then'](function(){return db[_0xd1d3('0xb8')][_0xd1d3('0x2c')]({'where':{'closed':![]}});})[_0xd1d3('0x1a')](function(_0x24e2fb){_0x545e70=_0x24e2fb;if(_0x30a03e&&_0x24e2fb>_0x30a03e){return db[_0xd1d3('0x106')][_0xd1d3('0x76')]({'where':{'id':0x1}})[_0xd1d3('0x1a')](function(_0x5e0cb6){if(_0x5e0cb6){_0x5e0cb6[_0xd1d3('0x107')](_0xd1d3('0x108'));}});}})[_0xd1d3('0x1a')](function(){var _0x171e2d=_0x4e2861[_0xd1d3('0xab')];var _0x56032f=_0x4e2861[_0xd1d3('0x97')]||undefined;return _0x171e2d?_0x171e2d[_0xd1d3('0x109')](_0x56032f):!![];})[_0xd1d3('0x1a')](function(_0x59cc22){var _0x2295e8=fs['readFileSync'](path[_0xd1d3('0x87')](config[_0xd1d3('0x88')],'server/files/chat/iframe.ejs'),_0xd1d3('0xdb'));var _0x43b9cc=_0xd1d3('0x10a');var _0x552f3e=![];var _0x124c2e,_0x2ac560;if(_0x27ac99[_0xd1d3('0x10b')][_0xd1d3('0xb6')]){_0x124c2e=new URL(_0x27ac99[_0xd1d3('0x10b')]['referer'])[_0xd1d3('0x10c')];}else if(_0x27ac99[_0xd1d3('0x10b')][_0xd1d3('0x10c')]){_0x124c2e=new URL(_0x27ac99[_0xd1d3('0x10b')][_0xd1d3('0x10c')])[_0xd1d3('0x10c')];}else{_0x124c2e=_0xd1d3('0x10d');}_0x2ac560=typeof _0x4e2861['address'][_0xd1d3('0x6a')](',')['find'](function(_0x4ee754){return wildcardUtils[_0xd1d3('0x10e')](_0x4ee754,_0x124c2e);})!=='undefined';var _0x22c3d2={'chatVersion':_0x43b9cc,'chatWebsiteAddressOrigin':_0x2ac560?_0x27ac99['headers'][_0xd1d3('0xb6')]:_0x4e2861[_0xd1d3('0x69')],'remote':_0x4e2861[_0xd1d3('0x10f')],'query':querystring['stringify'](_['merge'](_0x4e2861['get']({'plain':!![]}),{'customerIp':_0x27ac99[_0xd1d3('0x10b')][_0xd1d3('0x3b')]||_0x27ac99[_0xd1d3('0x10b')][_0xd1d3('0x110')]||_0x27ac99[_0xd1d3('0x111')]['remoteAddress']||_0x27ac99['ip'],'referer':_0x27ac99[_0xd1d3('0x10b')]['referer'],'openedInteractions':_0x545e70,'maxInteractions':_0x30a03e,'virtual':_0xce0ab4[_0xd1d3('0x105')],'online':_0x59cc22,'custom':_0xce0ab4,'address':_0x2ac560?_0x27ac99[_0xd1d3('0x10b')][_0xd1d3('0xb6')]:null}))[_0xd1d3('0x112')](/'/g,'\x5c\x27')};_0x474904[_0xd1d3('0x35')](ejs[_0xd1d3('0xdc')](Mustache[_0xd1d3('0xdc')](_0x2295e8,_0x22c3d2),{'proactiveActions':_0x2df672,'alignment':_0x4e2861['alignment'],'verticalAlignment':_0x4e2861[_0xd1d3('0x113')],'div_color':_0x4e2861['color'],'labelText':_0x4e2861[_0xd1d3('0x114')],'text_color':_0x4e2861[_0xd1d3('0x115')],'text_button_color':_0x4e2861[_0xd1d3('0x116')],'button_color':_0x4e2861[_0xd1d3('0x117')],'background_color':_0x4e2861['backgroundColor'],'hideWhenOffline':_0x4e2861[_0xd1d3('0x118')],'intervalId':_0x4e2861[_0xd1d3('0x119')],'isDevelopment':_0x552f3e,'chatVersion':_0x43b9cc}));})[_0xd1d3('0x24')](handleError(_0x474904,null));};exports[_0xd1d3('0x11a')]=function(_0x218b5a,_0x22ab3e){var _0x49085d=_0x218b5a[_0xd1d3('0x72')]['id'];var _0x4e30e3=_0x218b5a['body'];var _0x256a82=0xc8;var _0x2c9f0c=null;return db['sequelize'][_0xd1d3('0xe4')]({'isolationLevel':db[_0xd1d3('0xe3')]['Transaction']['ISOLATION_LEVELS'][_0xd1d3('0x11b')]},function(_0x3e25ac){return db[_0xd1d3('0x4c')][_0xd1d3('0x76')]({'where':{'id':_0x49085d},'transaction':_0x3e25ac})['then'](function(_0x40983a){if(_0x40983a){return db[_0xd1d3('0xa9')][_0xd1d3('0x30')]({'where':{'ChatWebsiteId':_0x49085d},'transaction':_0x3e25ac})[_0xd1d3('0x1a')](function(){var _0x3fbd9b=_['map'](_0x4e30e3,function(_0x3c5dd5){_0x3c5dd5[_0xd1d3('0x79')]=_0x49085d;return _0x3c5dd5;});return db[_0xd1d3('0xa9')][_0xd1d3('0x11c')](_0x3fbd9b,{'transaction':_0x3e25ac});});}else{_0x256a82=0x194;_0x2c9f0c=[];}});})[_0xd1d3('0x1a')](function(){if(_0x256a82!==0x194){return db[_0xd1d3('0xa9')][_0xd1d3('0x11d')]({'where':{'ChatWebsiteId':_0x49085d},'order':_0xd1d3('0xb0')})[_0xd1d3('0x1a')](function(_0x1cae8a){_0x2c9f0c=_0x1cae8a;});}})['catch'](function(_0x554054){_0x256a82=0x1f4;logger[_0xd1d3('0x21')](_0x554054[_0xd1d3('0x11e')]);if(_0x554054[_0xd1d3('0x34')]){delete _0x554054['name'];}_0x2c9f0c=_0x554054;})['finally'](function(){if(_0x2c9f0c===null){_0x22ab3e[_0xd1d3('0x25')](_0x256a82);}else{if(_0x256a82===0x1f4){_0x22ab3e['status'](_0x256a82)['send'](_0x2c9f0c);}else{_0x22ab3e[_0xd1d3('0x26')](_0x256a82)['json'](_0x2c9f0c);}}});};exports[_0xd1d3('0x11f')]=function(_0x1ec35c,_0x4b7145){var _0x1a6dec={};var _0x168f36={};var _0x40b7b4;var _0x56a8ce;return db[_0xd1d3('0x4c')][_0xd1d3('0x76')]({'where':{'id':_0x1ec35c[_0xd1d3('0x72')]['id']}})[_0xd1d3('0x1a')](handleEntityNotFound(_0x4b7145,null))[_0xd1d3('0x1a')](function(_0x13d184){if(_0x13d184){_0x40b7b4=_0x13d184;_0x168f36[_0xd1d3('0x46')]=_[_0xd1d3('0x62')](db['ChatApplication']['rawAttributes']);_0x168f36['query']=_['keys'](_0x1ec35c['query']);_0x168f36[_0xd1d3('0x58')]=_[_0xd1d3('0x4f')](_0x168f36[_0xd1d3('0x46')],_0x168f36[_0xd1d3('0x50')]);_0x1a6dec[_0xd1d3('0x51')]=_[_0xd1d3('0x4f')](_0x168f36['model'],qs[_0xd1d3('0x63')](_0x1ec35c[_0xd1d3('0x50')][_0xd1d3('0x63')]));_0x1a6dec['attributes']=_0x1a6dec[_0xd1d3('0x51')][_0xd1d3('0x52')]?_0x1a6dec[_0xd1d3('0x51')]:_0x168f36[_0xd1d3('0x46')];_0x1a6dec[_0xd1d3('0x55')]=qs['sort'](_0x1ec35c['query'][_0xd1d3('0x56')]);_0x1a6dec[_0xd1d3('0x57')]=qs[_0xd1d3('0x58')](_[_0xd1d3('0x59')](_0x1ec35c[_0xd1d3('0x50')],_0x168f36[_0xd1d3('0x58')]));if(_0x1ec35c[_0xd1d3('0x50')][_0xd1d3('0x5a')]){_0x1a6dec[_0xd1d3('0x57')]=_[_0xd1d3('0x5b')](_0x1a6dec[_0xd1d3('0x57')],{'$or':_[_0xd1d3('0x4b')](_0x1a6dec[_0xd1d3('0x51')],function(_0x20a3e5){var _0x1973bd={};_0x1973bd[_0x20a3e5]={'$like':'%'+_0x1ec35c[_0xd1d3('0x50')]['filter']+'%'};return _0x1973bd;})});}_0x1a6dec=_[_0xd1d3('0x5b')]({},_0x1a6dec,_0x1ec35c['options']);return _0x40b7b4['getApplications'](_0x1a6dec);}})[_0xd1d3('0x1a')](function(_0x59d0a4){if(_0x59d0a4){_0x56a8ce=_0x59d0a4[_0xd1d3('0x52')];if(!_0x1ec35c[_0xd1d3('0x50')]['hasOwnProperty'](_0xd1d3('0x54'))){_0x1a6dec['limit']=qs[_0xd1d3('0x2b')](_0x1ec35c[_0xd1d3('0x50')]['limit']);_0x1a6dec[_0xd1d3('0x29')]=qs['offset'](_0x1ec35c[_0xd1d3('0x50')][_0xd1d3('0x29')]);}return _0x40b7b4[_0xd1d3('0x11f')](_0x1a6dec);}})[_0xd1d3('0x1a')](function(_0x301115){if(_0x301115){return _0x301115?{'count':_0x56a8ce,'rows':_0x301115}:null;}})[_0xd1d3('0x1a')](respondWithResult(_0x4b7145,null))[_0xd1d3('0x24')](handleError(_0x4b7145,null));};exports[_0xd1d3('0x120')]=function(_0x28107a,_0x59d53f){return db[_0xd1d3('0x121')]['find']({'where':{'id':_0x28107a[_0xd1d3('0x72')]['id']}})[_0xd1d3('0x1a')](handleEntityNotFound(_0x59d53f,null))[_0xd1d3('0x1a')](function(_0x246eb5){if(_0x246eb5){return _0x246eb5[_0xd1d3('0x120')](_0x28107a['body'][_0xd1d3('0x7e')],_[_0xd1d3('0xfa')](_0x28107a[_0xd1d3('0x68')],[_0xd1d3('0x7e'),'id'])||{});}})['then'](respondWithResult(_0x59d53f,null))[_0xd1d3('0x24')](handleError(_0x59d53f,null));};exports[_0xd1d3('0x104')]=function(_0x5ad3d5,_0x1ae557){var _0x38a33b={};var _0x4c0497={};var _0x30fbd1;var _0x5138dd;return db['ChatWebsite'][_0xd1d3('0x76')]({'where':{'id':_0x5ad3d5[_0xd1d3('0x72')]['id']}})['then'](handleEntityNotFound(_0x1ae557,null))[_0xd1d3('0x1a')](function(_0x206793){if(_0x206793){_0x30fbd1=_0x206793;_0x4c0497[_0xd1d3('0x46')]=_[_0xd1d3('0x62')](db[_0xd1d3('0x122')][_0xd1d3('0x78')]);_0x4c0497[_0xd1d3('0x50')]=_[_0xd1d3('0x62')](_0x5ad3d5[_0xd1d3('0x50')]);_0x4c0497[_0xd1d3('0x58')]=_[_0xd1d3('0x4f')](_0x4c0497[_0xd1d3('0x46')],_0x4c0497[_0xd1d3('0x50')]);_0x38a33b[_0xd1d3('0x51')]=_[_0xd1d3('0x4f')](_0x4c0497[_0xd1d3('0x46')],qs[_0xd1d3('0x63')](_0x5ad3d5['query'][_0xd1d3('0x63')]));_0x38a33b[_0xd1d3('0x51')]=_0x38a33b[_0xd1d3('0x51')][_0xd1d3('0x52')]?_0x38a33b['attributes']:_0x4c0497['model'];_0x38a33b[_0xd1d3('0x55')]=qs['sort'](_0x5ad3d5[_0xd1d3('0x50')]['sort']);_0x38a33b[_0xd1d3('0x57')]=qs[_0xd1d3('0x58')](_['pick'](_0x5ad3d5[_0xd1d3('0x50')],_0x4c0497[_0xd1d3('0x58')]));if(_0x5ad3d5[_0xd1d3('0x50')][_0xd1d3('0x5a')]){_0x38a33b[_0xd1d3('0x57')]=_[_0xd1d3('0x5b')](_0x38a33b[_0xd1d3('0x57')],{'$or':_[_0xd1d3('0x4b')](_0x38a33b[_0xd1d3('0x51')],function(_0x3a0fcc){var _0x123f7e={};_0x123f7e[_0x3a0fcc]={'$like':'%'+_0x5ad3d5['query'][_0xd1d3('0x5a')]+'%'};return _0x123f7e;})});}_0x38a33b=_['merge']({},_0x38a33b,_0x5ad3d5[_0xd1d3('0x65')]);return _0x30fbd1[_0xd1d3('0x104')](_0x38a33b);}})[_0xd1d3('0x1a')](function(_0x29f0e6){if(_0x29f0e6){_0x5138dd=_0x29f0e6[_0xd1d3('0x52')];if(!_0x5ad3d5[_0xd1d3('0x50')][_0xd1d3('0x53')](_0xd1d3('0x54'))){_0x38a33b[_0xd1d3('0x2b')]=qs[_0xd1d3('0x2b')](_0x5ad3d5[_0xd1d3('0x50')][_0xd1d3('0x2b')]);_0x38a33b['offset']=qs['offset'](_0x5ad3d5[_0xd1d3('0x50')][_0xd1d3('0x29')]);}return _0x30fbd1[_0xd1d3('0x104')](_0x38a33b);}})[_0xd1d3('0x1a')](function(_0x151eb7){if(_0x151eb7){return _0x151eb7?{'count':_0x5138dd,'rows':_0x151eb7}:null;}})['then'](respondWithResult(_0x1ae557,null))[_0xd1d3('0x24')](handleError(_0x1ae557,null));};exports[_0xd1d3('0x123')]=function(_0x15d323,_0x4fe8c8){var _0x3e8a1e=_0x15d323['query'][_0xd1d3('0x124')]==='false'?_0xd1d3('0x125'):_0xd1d3('0x126');return db[_0xd1d3('0x4c')]['find']({'attributes':['id',_0x3e8a1e],'where':{'id':_0x15d323[_0xd1d3('0x72')]['id']}})['then'](handleEntityNotFound(_0x4fe8c8,null))[_0xd1d3('0x1a')](function(_0x35484a){if(_0x35484a){var _0x3309b0=_0x35484a[_0x3e8a1e];var _0x2ea32c=_0x3309b0&&_0x3309b0[_0xd1d3('0x127')]?_0x3309b0['items']:[];_0x4fe8c8[_0xd1d3('0x35')]({'fromKey':_[_0xd1d3('0x92')](_0x3309b0[_0xd1d3('0x128')])?undefined:_0x3309b0[_0xd1d3('0x128')],'count':_0x2ea32c[_0xd1d3('0x52')],'rows':_0x2ea32c});}})[_0xd1d3('0x24')](handleError(_0x4fe8c8,null));};exports['getOfflineMessages']=function(_0x1ee90e,_0xb41b3a){var _0x2eb45c={'raw':![],'where':{}};var _0x20c25e={};var _0x28e5c3={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xd1d3('0x76')]({'where':{'id':_0x1ee90e[_0xd1d3('0x72')]['id']}})[_0xd1d3('0x1a')](handleEntityNotFound(_0xb41b3a,null))[_0xd1d3('0x1a')](function(_0x101981){if(_0x101981){_0x20c25e[_0xd1d3('0x46')]=_[_0xd1d3('0x62')](db[_0xd1d3('0x129')][_0xd1d3('0x78')]);_0x20c25e[_0xd1d3('0x50')]=_[_0xd1d3('0x62')](_0x1ee90e[_0xd1d3('0x50')]);_0x20c25e[_0xd1d3('0x58')]=_['intersection'](_0x20c25e[_0xd1d3('0x46')],_0x20c25e[_0xd1d3('0x50')]);_0x2eb45c[_0xd1d3('0x51')]=_['intersection'](_0x20c25e[_0xd1d3('0x46')],qs[_0xd1d3('0x63')](_0x1ee90e[_0xd1d3('0x50')][_0xd1d3('0x63')]));_0x2eb45c[_0xd1d3('0x51')]=_0x2eb45c['attributes'][_0xd1d3('0x52')]?_0x2eb45c[_0xd1d3('0x51')]:_0x20c25e[_0xd1d3('0x46')];if(!_0x1ee90e['query'][_0xd1d3('0x53')]('nolimit')){_0x2eb45c[_0xd1d3('0x2b')]=qs['limit'](_0x1ee90e[_0xd1d3('0x50')]['limit']);_0x2eb45c[_0xd1d3('0x29')]=qs[_0xd1d3('0x29')](_0x1ee90e[_0xd1d3('0x50')]['offset']);}_0x2eb45c[_0xd1d3('0x55')]=qs[_0xd1d3('0x56')](_0x1ee90e[_0xd1d3('0x50')][_0xd1d3('0x56')]);_0x2eb45c[_0xd1d3('0x57')]=qs[_0xd1d3('0x58')](_['pick'](_0x1ee90e[_0xd1d3('0x50')],_0x20c25e['filters']));_0x2eb45c[_0xd1d3('0x57')][_0xd1d3('0x79')]=_0x101981['id'];if(_0x1ee90e[_0xd1d3('0x50')][_0xd1d3('0x5a')]){_0x2eb45c[_0xd1d3('0x57')]=_[_0xd1d3('0x5b')](_0x2eb45c['where'],{'$or':_[_0xd1d3('0x4b')](_0x2eb45c[_0xd1d3('0x51')],function(_0x424aad){var _0x24ff8f={};_0x24ff8f[_0x424aad]={'$like':'%'+_0x1ee90e[_0xd1d3('0x50')]['filter']+'%'};return _0x24ff8f;})});}_0x2eb45c=_[_0xd1d3('0x5b')]({},_0x2eb45c,_0x1ee90e[_0xd1d3('0x65')]);return db['ChatOfflineMessage'][_0xd1d3('0x2c')]({'where':_0x2eb45c['where']})[_0xd1d3('0x1a')](function(_0x4a792b){_0x28e5c3[_0xd1d3('0x2c')]=_0x4a792b;if(_0x1ee90e[_0xd1d3('0x50')][_0xd1d3('0x5d')]){_0x2eb45c[_0xd1d3('0x64')]=[{'all':!![]}];}else{_0x2eb45c[_0xd1d3('0x64')]=[{'model':db[_0xd1d3('0xa6')],'as':_0xd1d3('0x12a'),'required':![]},{'model':db['Attachment'],'as':'Attachments','required':![]}];}return db[_0xd1d3('0x129')][_0xd1d3('0x5e')](_0x2eb45c);})[_0xd1d3('0x1a')](function(_0x341c3a){_0x28e5c3[_0xd1d3('0x5f')]=_0x341c3a;return _0x28e5c3;});}})['then'](respondWithFilteredResult(_0xb41b3a,_0x2eb45c))['catch'](handleError(_0xb41b3a,null));};exports[_0xd1d3('0x12b')]=function(_0x391524,_0x7b7d69){return db[_0xd1d3('0x4c')][_0xd1d3('0x66')]({'where':{'id':_0x391524['params']['id']}})[_0xd1d3('0x1a')](handleEntityNotFound(_0x7b7d69,null))[_0xd1d3('0x1a')](function(_0x486a75){if(_0x486a75){return _0x486a75['addAgents'](_0x391524['body'][_0xd1d3('0x7e')],_['omit'](_0x391524['body'],[_0xd1d3('0x7e'),'id'])||{})['spread'](function(_0x1422a2){for(var _0x48630f=0x0;_0x48630f<_0x391524[_0xd1d3('0x68')]['ids'][_0xd1d3('0x52')];_0x48630f+=0x1){socket['emit'](_0xd1d3('0x12c'),{'UserId':Number(_0x391524[_0xd1d3('0x68')][_0xd1d3('0x7e')][_0x48630f]),'ChatWebsiteId':Number(_0x391524['params']['id'])});}return _0x1422a2;});}})['then'](respondWithResult(_0x7b7d69,null))[_0xd1d3('0x24')](handleError(_0x7b7d69,null));};exports[_0xd1d3('0x12d')]=function(_0x11629e,_0xa99139){return db[_0xd1d3('0x4c')][_0xd1d3('0x66')]({'where':{'id':_0x11629e[_0xd1d3('0x72')]['id']}})[_0xd1d3('0x1a')](handleEntityNotFound(_0xa99139,null))['then'](function(_0x1f7457){if(_0x1f7457){return _0x1f7457[_0xd1d3('0x12d')](_0x11629e[_0xd1d3('0x50')][_0xd1d3('0x7e')])['then'](function(){if(_[_0xd1d3('0x12e')](_0x11629e[_0xd1d3('0x50')]['ids'])){for(var _0x18785c=0x0;_0x18785c<_0x11629e[_0xd1d3('0x50')]['ids'][_0xd1d3('0x52')];_0x18785c+=0x1){socket[_0xd1d3('0x12f')](_0xd1d3('0x130'),{'UserId':Number(_0x11629e[_0xd1d3('0x50')][_0xd1d3('0x7e')][_0x18785c]),'ChatWebsiteId':Number(_0x11629e[_0xd1d3('0x72')]['id'])});}}else{socket['emit'](_0xd1d3('0x130'),{'UserId':Number(_0x11629e['query'][_0xd1d3('0x7e')]),'ChatWebsiteId':Number(_0x11629e[_0xd1d3('0x72')]['id'])});}});}})[_0xd1d3('0x1a')](respondWithStatusCode(_0xa99139,null))['catch'](handleError(_0xa99139,null));};exports[_0xd1d3('0x131')]=function(_0x45078e,_0x14e0b0){var _0x176b4d={};var _0x16eb67={};var _0x4947d2;var _0x50dc43;return db[_0xd1d3('0x4c')][_0xd1d3('0x76')]({'where':{'id':_0x45078e['params']['id']}})['then'](handleEntityNotFound(_0x14e0b0,null))['then'](function(_0x2df6da){if(_0x2df6da){_0x4947d2=_0x2df6da;_0x16eb67[_0xd1d3('0x46')]=_['keys'](db[_0xd1d3('0xc3')][_0xd1d3('0x78')]);_0x16eb67['query']=_[_0xd1d3('0x62')](_0x45078e[_0xd1d3('0x50')]);_0x16eb67['filters']=_[_0xd1d3('0x4f')](_0x16eb67[_0xd1d3('0x46')],_0x16eb67[_0xd1d3('0x50')]);_0x176b4d[_0xd1d3('0x51')]=_[_0xd1d3('0x4f')](_0x16eb67['model'],qs['fields'](_0x45078e[_0xd1d3('0x50')][_0xd1d3('0x63')]));_0x176b4d['attributes']=_0x176b4d[_0xd1d3('0x51')][_0xd1d3('0x52')]?_0x176b4d[_0xd1d3('0x51')]:_0x16eb67[_0xd1d3('0x46')];_0x176b4d[_0xd1d3('0x55')]=qs[_0xd1d3('0x56')](_0x45078e['query'][_0xd1d3('0x56')]);_0x176b4d[_0xd1d3('0x57')]=qs['filters'](_['pick'](_0x45078e['query'],_0x16eb67[_0xd1d3('0x58')]));if(_0x45078e['query']['filter']){_0x176b4d[_0xd1d3('0x57')]=_['merge'](_0x176b4d['where'],{'$or':_[_0xd1d3('0x4b')](_0x176b4d[_0xd1d3('0x51')],function(_0x35ada2){var _0xd26d80={};_0xd26d80[_0x35ada2]={'$like':'%'+_0x45078e[_0xd1d3('0x50')][_0xd1d3('0x5a')]+'%'};return _0xd26d80;})});}_0x176b4d=_['merge']({},_0x176b4d,_0x45078e[_0xd1d3('0x65')]);return _0x4947d2[_0xd1d3('0x131')](_0x176b4d);}})['then'](function(_0x56ee24){if(_0x56ee24){_0x50dc43=_0x56ee24[_0xd1d3('0x52')];if(!_0x45078e[_0xd1d3('0x50')][_0xd1d3('0x53')](_0xd1d3('0x54'))){_0x176b4d[_0xd1d3('0x2b')]=qs[_0xd1d3('0x2b')](_0x45078e['query'][_0xd1d3('0x2b')]);_0x176b4d['offset']=qs['offset'](_0x45078e[_0xd1d3('0x50')][_0xd1d3('0x29')]);}return _0x4947d2[_0xd1d3('0x131')](_0x176b4d);}})[_0xd1d3('0x1a')](function(_0x2c00af){if(_0x2c00af){return _0x2c00af?{'count':_0x50dc43,'rows':_0x2c00af}:null;}})[_0xd1d3('0x1a')](respondWithResult(_0x14e0b0,null))[_0xd1d3('0x24')](handleError(_0x14e0b0,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 56c327d..327b3db 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 _0x291c=['save','update','remove','emit','exports','events','../../mysqldb','ChatWebsite','setMaxListeners'];(function(_0x3d0dc3,_0x1e5e5a){var _0x3435c7=function(_0x30b7a9){while(--_0x30b7a9){_0x3d0dc3['push'](_0x3d0dc3['shift']());}};_0x3435c7(++_0x1e5e5a);}(_0x291c,0x137));var _0xc291=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x291c[_0x21a9d9];return _0x46adce;};'use strict';var EventEmitter=require(_0xc291('0x0'));var ChatWebsite=require(_0xc291('0x1'))['db'][_0xc291('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xc291('0x3')](0x0);var events={'afterCreate':_0xc291('0x4'),'afterUpdate':_0xc291('0x5'),'afterDestroy':_0xc291('0x6')};function emitEvent(_0x7b34d6){return function(_0xafdfee,_0x118ddf,_0x187a34){ChatWebsiteEvents['emit'](_0x7b34d6+':'+_0xafdfee['id'],_0xafdfee);ChatWebsiteEvents[_0xc291('0x7')](_0x7b34d6,_0xafdfee);_0x187a34(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0xc291('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x6597=['ChatWebsite','save','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x4f3e95,_0x3a4cd5){var _0x2bd7db=function(_0x1a4b91){while(--_0x1a4b91){_0x4f3e95['push'](_0x4f3e95['shift']());}};_0x2bd7db(++_0x3a4cd5);}(_0x6597,0x16e));var _0x7659=function(_0x4b41e0,_0x4292d2){_0x4b41e0=_0x4b41e0-0x0;var _0x1647c3=_0x6597[_0x4b41e0];return _0x1647c3;};'use strict';var EventEmitter=require(_0x7659('0x0'));var ChatWebsite=require(_0x7659('0x1'))['db'][_0x7659('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7659('0x3'),'afterUpdate':'update','afterDestroy':_0x7659('0x4')};function emitEvent(_0x4f5b89){return function(_0x5e96ed,_0x576e8b,_0xbcb138){ChatWebsiteEvents[_0x7659('0x5')](_0x4f5b89+':'+_0x5e96ed['id'],_0x5e96ed);ChatWebsiteEvents[_0x7659('0x5')](_0x4f5b89,_0x5e96ed);_0xbcb138(null);};}for(var e in events){if(events[_0x7659('0x6')](e)){var event=events[e];ChatWebsite[_0x7659('0x7')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index c9120a2..619fc8e 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 _0xe9d9=['path','rimraf','../../config/environment','define','ChatWebsite','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x17dbdd,_0x8a27d5){var _0x15ed0c=function(_0x41c2ca){while(--_0x41c2ca){_0x17dbdd['push'](_0x17dbdd['shift']());}};_0x15ed0c(++_0x8a27d5);}(_0xe9d9,0x87));var _0x9e9d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe9d9[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x9e9d('0x0'));var util=require('util');var logger=require(_0x9e9d('0x1'))(_0x9e9d('0x2'));var moment=require('moment');var BPromise=require(_0x9e9d('0x3'));var rp=require(_0x9e9d('0x4'));var fs=require('fs');var path=require(_0x9e9d('0x5'));var rimraf=require(_0x9e9d('0x6'));var config=require(_0x9e9d('0x7'));var attributes=require('./chatWebsite.attributes');module['exports']=function(_0x3a08be,_0x55bcdf){return _0x3a08be[_0x9e9d('0x8')](_0x9e9d('0x9'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa23d=['./chatWebsite.attributes','exports','ChatWebsite','chat_websites','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x58893d,_0x8c2367){var _0x2d123b=function(_0x2ab330){while(--_0x2ab330){_0x58893d['push'](_0x58893d['shift']());}};_0x2d123b(++_0x8c2367);}(_0xa23d,0x1ee));var _0xda23=function(_0x220ea8,_0x593a07){_0x220ea8=_0x220ea8-0x0;var _0x301497=_0xa23d[_0x220ea8];return _0x301497;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xda23('0x0'));var moment=require(_0xda23('0x1'));var BPromise=require(_0xda23('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xda23('0x3'));var rimraf=require(_0xda23('0x4'));var config=require(_0xda23('0x5'));var attributes=require(_0xda23('0x6'));module[_0xda23('0x7')]=function(_0x2a0a5a,_0x3ebd3e){return _0x2a0a5a['define'](_0xda23('0x8'),attributes,{'tableName':_0xda23('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index 4f359c6..a048868 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 _0xae70=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatWebsite.socket','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info'];(function(_0x58d4ce,_0x154425){var _0x3c5170=function(_0x235a0a){while(--_0x235a0a){_0x58d4ce['push'](_0x58d4ce['shift']());}};_0x3c5170(++_0x154425);}(_0xae70,0x17c));var _0x0ae7=function(_0x1ee80c,_0x1e99ad){_0x1ee80c=_0x1ee80c-0x0;var _0x1185b3=_0xae70[_0x1ee80c];return _0x1185b3;};'use strict';var _=require(_0x0ae7('0x0'));var util=require(_0x0ae7('0x1'));var moment=require('moment');var BPromise=require(_0x0ae7('0x2'));var rs=require(_0x0ae7('0x3'));var fs=require('fs');var Redis=require(_0x0ae7('0x4'));var db=require(_0x0ae7('0x5'))['db'];var utils=require(_0x0ae7('0x6'));var logger=require(_0x0ae7('0x7'))('rpc');var config=require(_0x0ae7('0x8'));var jayson=require(_0x0ae7('0x9'));var client=jayson[_0x0ae7('0xa')][_0x0ae7('0xb')]({'port':0x232a});config[_0x0ae7('0xc')]=_['defaults'](config[_0x0ae7('0xc')],{'host':_0x0ae7('0xd'),'port':0x18eb});var socket=require(_0x0ae7('0xe'))(new Redis(config[_0x0ae7('0xc')]));require(_0x0ae7('0xf'))['register'](socket);function respondWithRpcPromise(_0x490178,_0xa92f6b,_0x3b4b52){return new BPromise(function(_0x23d9ef,_0x55367a){return client[_0x0ae7('0x10')](_0x490178,_0x3b4b52)[_0x0ae7('0x11')](function(_0x126851){logger['info'](_0x0ae7('0x12'),_0xa92f6b,_0x0ae7('0x13'));logger[_0x0ae7('0x14')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0xa92f6b,_0x0ae7('0x13'),JSON[_0x0ae7('0x15')](_0x126851));if(_0x126851[_0x0ae7('0x16')]){if(_0x126851[_0x0ae7('0x16')]['code']===0x1f4){logger[_0x0ae7('0x16')](_0x0ae7('0x12'),_0xa92f6b,_0x126851[_0x0ae7('0x16')][_0x0ae7('0x17')]);return _0x55367a(_0x126851['error'][_0x0ae7('0x17')]);}logger[_0x0ae7('0x16')]('ChatWebsite,\x20%s,\x20%s',_0xa92f6b,_0x126851[_0x0ae7('0x16')][_0x0ae7('0x17')]);return _0x23d9ef(_0x126851[_0x0ae7('0x16')][_0x0ae7('0x17')]);}else{logger[_0x0ae7('0x18')](_0x0ae7('0x12'),_0xa92f6b,_0x0ae7('0x13'));_0x23d9ef(_0x126851[_0x0ae7('0x19')][_0x0ae7('0x17')]);}})[_0x0ae7('0x1a')](function(_0xa3615c){logger['error'](_0x0ae7('0x12'),_0xa92f6b,_0xa3615c);_0x55367a(_0xa3615c);});});}
\ No newline at end of file
+var _0x95c7=['../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','request\x20sent','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','info','result','lodash','moment','randomstring','ioredis','../../mysqldb'];(function(_0x2805d3,_0x57fb0b){var _0x4329c8=function(_0x562384){while(--_0x562384){_0x2805d3['push'](_0x2805d3['shift']());}};_0x4329c8(++_0x57fb0b);}(_0x95c7,0xe5));var _0x795c=function(_0x487ab0,_0x531a77){_0x487ab0=_0x487ab0-0x0;var _0x283d8d=_0x95c7[_0x487ab0];return _0x283d8d;};'use strict';var _=require(_0x795c('0x0'));var util=require('util');var moment=require(_0x795c('0x1'));var BPromise=require('bluebird');var rs=require(_0x795c('0x2'));var fs=require('fs');var Redis=require(_0x795c('0x3'));var db=require(_0x795c('0x4'))['db'];var utils=require(_0x795c('0x5'));var logger=require(_0x795c('0x6'))(_0x795c('0x7'));var config=require('../../config/environment');var jayson=require(_0x795c('0x8'));var client=jayson['client'][_0x795c('0x9')]({'port':0x232a});config[_0x795c('0xa')]=_[_0x795c('0xb')](config[_0x795c('0xa')],{'host':_0x795c('0xc'),'port':0x18eb});var socket=require(_0x795c('0xd'))(new Redis(config[_0x795c('0xa')]));require(_0x795c('0xe'))[_0x795c('0xf')](socket);function respondWithRpcPromise(_0x3875e2,_0xe097b4,_0x1af1a9){return new BPromise(function(_0x3b2b4e,_0x31845b){return client[_0x795c('0x10')](_0x3875e2,_0x1af1a9)[_0x795c('0x11')](function(_0x4f613d){logger['info']('ChatWebsite,\x20%s,\x20%s',_0xe097b4,_0x795c('0x12'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0xe097b4,_0x795c('0x12'),JSON[_0x795c('0x13')](_0x4f613d));if(_0x4f613d['error']){if(_0x4f613d[_0x795c('0x14')][_0x795c('0x15')]===0x1f4){logger['error'](_0x795c('0x16'),_0xe097b4,_0x4f613d['error'][_0x795c('0x17')]);return _0x31845b(_0x4f613d[_0x795c('0x14')][_0x795c('0x17')]);}logger[_0x795c('0x14')](_0x795c('0x16'),_0xe097b4,_0x4f613d['error'][_0x795c('0x17')]);return _0x3b2b4e(_0x4f613d[_0x795c('0x14')][_0x795c('0x17')]);}else{logger[_0x795c('0x18')]('ChatWebsite,\x20%s,\x20%s',_0xe097b4,'request\x20sent');_0x3b2b4e(_0x4f613d[_0x795c('0x19')][_0x795c('0x17')]);}})['catch'](function(_0x3c464d){logger[_0x795c('0x14')](_0x795c('0x16'),_0xe097b4,_0x3c464d);_0x31845b(_0x3c464d);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 65c4298..ade0360 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 _0xdc92=['removeListener','register','length','chatWebsite:','./chatWebsite.events','save','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdc92,0xc8));var _0x2dc9=function(_0x4ea413,_0x51ff3a){_0x4ea413=_0x4ea413-0x0;var _0x51cf25=_0xdc92[_0x4ea413];return _0x51cf25;};'use strict';var ChatWebsiteEvents=require(_0x2dc9('0x0'));var events=[_0x2dc9('0x1'),'remove',_0x2dc9('0x2')];function createListener(_0x109d6a,_0x2c0a07){return function(_0x2d4b40){_0x2c0a07['emit'](_0x109d6a,_0x2d4b40);};}function removeListener(_0x2157b0,_0x395c98){return function(){ChatWebsiteEvents[_0x2dc9('0x3')](_0x2157b0,_0x395c98);};}exports[_0x2dc9('0x4')]=function(_0x524a32){for(var _0x43377a=0x0,_0x161494=events[_0x2dc9('0x5')];_0x43377a<_0x161494;_0x43377a++){var _0xbd7aa5=events[_0x43377a];var _0x53851d=createListener(_0x2dc9('0x6')+_0xbd7aa5,_0x524a32);ChatWebsiteEvents['on'](_0xbd7aa5,_0x53851d);}};
\ No newline at end of file
+var _0x7429=['remove','update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x15ea80,_0x19b281){var _0x345373=function(_0x3b000d){while(--_0x3b000d){_0x15ea80['push'](_0x15ea80['shift']());}};_0x345373(++_0x19b281);}(_0x7429,0xa0));var _0x9742=function(_0x492165,_0x59e63c){_0x492165=_0x492165-0x0;var _0x425a13=_0x7429[_0x492165];return _0x425a13;};'use strict';var ChatWebsiteEvents=require(_0x9742('0x0'));var events=[_0x9742('0x1'),_0x9742('0x2'),_0x9742('0x3')];function createListener(_0x3fe68f,_0x466a4b){return function(_0x2a250e){_0x466a4b[_0x9742('0x4')](_0x3fe68f,_0x2a250e);};}function removeListener(_0x19f2f0,_0x22a8e7){return function(){ChatWebsiteEvents[_0x9742('0x5')](_0x19f2f0,_0x22a8e7);};}exports[_0x9742('0x6')]=function(_0x6e40c8){for(var _0x7a22d3=0x0,_0x535ee2=events[_0x9742('0x7')];_0x7a22d3<_0x535ee2;_0x7a22d3++){var _0x12db59=events[_0x7a22d3];var _0x31ec85=createListener(_0x9742('0x8')+_0x12db59,_0x6e40c8);ChatWebsiteEvents['on'](_0x12db59,_0x31ec85);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/helpers/wildcard-expressions.js b/server/api/chatWebsite/helpers/wildcard-expressions.js
index b7d3fe2..500747a 100644
--- a/server/api/chatWebsite/helpers/wildcard-expressions.js
+++ b/server/api/chatWebsite/helpers/wildcard-expressions.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe77c=['url','replace','localhost','test','([\x5cw]+)','exports','../../../utils/misc','escapeRegExp'];(function(_0x946518,_0x22816f){var _0x909b69=function(_0x2fa5a4){while(--_0x2fa5a4){_0x946518['push'](_0x946518['shift']());}};_0x909b69(++_0x22816f);}(_0xe77c,0x176));var _0xce77=function(_0x1c72ac,_0x380a0e){_0x1c72ac=_0x1c72ac-0x0;var _0x274e46=_0xe77c[_0x1c72ac];return _0x274e46;};var escapeRegExp=require(_0xce77('0x0'))[_0xce77('0x1')];var URL=require(_0xce77('0x2'))['URL'];function testWildcardValidity(_0x2b8db3){var _0x1e3ae4=!![];try{new URL(_0x2b8db3[_0xce77('0x3')]('*',_0xce77('0x4')));}catch(_0x3da792){_0x1e3ae4=![];}return _0x1e3ae4&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0xce77('0x5')](_0x2b8db3);}function testWebsiteWithWildcard(_0x9fc8f0,_0x5adf97){var _0x5aea39;var _0xed47c5=escapeRegExp(_0x9fc8f0['trim']()[_0xce77('0x3')](/\/$/,''))[_0xce77('0x3')]('\x5c*',_0xce77('0x6'));try{new URL(_0x9fc8f0['replace']('\x5c*',_0xce77('0x4')));_0x5aea39=new RegExp(_0xed47c5)[_0xce77('0x5')](_0x5adf97);}catch(_0x82cc7e){_0x5aea39=![];}return _0x5aea39;}module[_0xce77('0x7')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity};
\ No newline at end of file
+var _0x292c=['localhost','test','exports','../../../utils/misc','url','URL','replace','trim','([\x5cw]+)'];(function(_0x33a78a,_0x174c0d){var _0x26742f=function(_0x5f1481){while(--_0x5f1481){_0x33a78a['push'](_0x33a78a['shift']());}};_0x26742f(++_0x174c0d);}(_0x292c,0x66));var _0xc292=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x292c[_0x501510];return _0x1e6ee5;};var escapeRegExp=require(_0xc292('0x0'))['escapeRegExp'];var URL=require(_0xc292('0x1'))[_0xc292('0x2')];function testWildcardValidity(_0x61f2da){var _0x1931ea=!![];try{new URL(_0x61f2da[_0xc292('0x3')]('*','localhost'));}catch(_0x1f14f9){_0x1931ea=![];}return _0x1931ea&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)['test'](_0x61f2da);}function testWebsiteWithWildcard(_0x516f54,_0x23c98f){var _0x1c45ed;var _0x2c01eb=escapeRegExp(_0x516f54[_0xc292('0x4')]()[_0xc292('0x3')](/\/$/,''))[_0xc292('0x3')]('\x5c*',_0xc292('0x5'));try{new URL(_0x516f54[_0xc292('0x3')]('\x5c*',_0xc292('0x6')));_0x1c45ed=new RegExp(_0x2c01eb)[_0xc292('0x7')](_0x23c98f);}catch(_0x5a548a){_0x1c45ed=![];}return _0x1c45ed;}module[_0xc292('0x8')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index c532b82..0e20806 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 _0x9d3a=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/describe','isAuthenticated','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','post','addDisposition','addAnswer','diskStorage','join','root','format','%s-%s','originalname','/:id/logo','single','file','server/files/images/avatars/','now','addAvatar','/:id/customer_avatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','extname','replace','any','offline','addInteraction','addApplications','addProactiveActions','/:id/users','addAgents','put','delete','/:id','destroy','removeDispositions','removeAgents','exports'];(function(_0x5746a1,_0x45b96f){var _0x105a24=function(_0x53cf64){while(--_0x53cf64){_0x5746a1['push'](_0x5746a1['shift']());}};_0x105a24(++_0x45b96f);}(_0x9d3a,0x114));var _0xa9d3=function(_0x215f9e,_0x438b14){_0x215f9e=_0x215f9e-0x0;var _0x217ce4=_0x9d3a[_0x215f9e];return _0x217ce4;};'use strict';var multer=require('multer');var util=require(_0xa9d3('0x0'));var path=require('path');var timeout=require(_0xa9d3('0x1'));var express=require(_0xa9d3('0x2'));var router=express[_0xa9d3('0x3')]();var fs_extra=require(_0xa9d3('0x4'));var auth=require(_0xa9d3('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa9d3('0x6'));var controller=require('./chatWebsite.controller');router[_0xa9d3('0x7')]('/',auth['isAuthenticated'](),controller[_0xa9d3('0x8')]);router[_0xa9d3('0x7')](_0xa9d3('0x9'),auth[_0xa9d3('0xa')](),controller['describe']);router[_0xa9d3('0x7')]('/:id',auth[_0xa9d3('0xa')](),controller[_0xa9d3('0xb')]);router['get'](_0xa9d3('0xc'),auth['isAuthenticated'](),controller[_0xa9d3('0xd')]);router[_0xa9d3('0x7')](_0xa9d3('0xe'),auth[_0xa9d3('0xa')](),controller[_0xa9d3('0xf')]);router[_0xa9d3('0x7')]('/:id/logo',controller[_0xa9d3('0x10')]);router['get'](_0xa9d3('0x11'),controller[_0xa9d3('0x12')]);router[_0xa9d3('0x7')]('/:id/customer_avatar',controller[_0xa9d3('0x13')]);router[_0xa9d3('0x7')](_0xa9d3('0x14'),controller[_0xa9d3('0x15')]);router[_0xa9d3('0x7')](_0xa9d3('0x16'),auth['isAuthenticated'](),controller['getInteractions']);router[_0xa9d3('0x7')](_0xa9d3('0x17'),controller[_0xa9d3('0x18')]);router[_0xa9d3('0x7')](_0xa9d3('0x19'),auth[_0xa9d3('0xa')](),controller[_0xa9d3('0x1a')]);router[_0xa9d3('0x7')](_0xa9d3('0x1b'),auth[_0xa9d3('0xa')](),controller[_0xa9d3('0x1c')]);router[_0xa9d3('0x7')](_0xa9d3('0x1d'),controller[_0xa9d3('0x1e')]);router[_0xa9d3('0x7')](_0xa9d3('0x1f'),auth[_0xa9d3('0xa')](),controller[_0xa9d3('0x20')]);router[_0xa9d3('0x7')]('/:id/users',auth[_0xa9d3('0xa')](),controller['getAgents']);router[_0xa9d3('0x21')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa9d3('0x21')](_0xa9d3('0xc'),auth[_0xa9d3('0xa')](),controller[_0xa9d3('0x22')]);router[_0xa9d3('0x21')]('/:id/canned_answers',auth[_0xa9d3('0xa')](),controller[_0xa9d3('0x23')]);var upload=multer({'storage':multer[_0xa9d3('0x24')]({'destination':function(_0x85d4dc,_0x1ca97e,_0x1c64d0){_0x1c64d0(null,path[_0xa9d3('0x25')](config[_0xa9d3('0x26')],'server/files/images/logos/'));},'filename':function(_0x4e5aa1,_0x3f5648,_0x401924){_0x401924(null,util[_0xa9d3('0x27')](_0xa9d3('0x28'),Date['now'](),_0x3f5648[_0xa9d3('0x29')]));}})});router[_0xa9d3('0x21')](_0xa9d3('0x2a'),upload[_0xa9d3('0x2b')](_0xa9d3('0x2c')),controller['addLogo']);var upload=multer({'storage':multer[_0xa9d3('0x24')]({'destination':function(_0x5e5bca,_0x4e7c17,_0x27ba82){_0x27ba82(null,path[_0xa9d3('0x25')](config['root'],_0xa9d3('0x2d')));},'filename':function(_0x41f019,_0xa9a149,_0x35ec88){_0x35ec88(null,util['format']('%s-%s',Date[_0xa9d3('0x2e')](),_0xa9a149['originalname']));}})});router['post'](_0xa9d3('0x11'),upload[_0xa9d3('0x2b')](_0xa9d3('0x2c')),controller[_0xa9d3('0x2f')]);var upload=multer({'storage':multer[_0xa9d3('0x24')]({'destination':function(_0x187d2e,_0x12f415,_0x50479c){_0x50479c(null,path['join'](config[_0xa9d3('0x26')],_0xa9d3('0x2d')));},'filename':function(_0x37238d,_0xca13fd,_0x297a3c){_0x297a3c(null,util[_0xa9d3('0x27')](_0xa9d3('0x28'),Date['now'](),_0xca13fd['originalname']));}})});router[_0xa9d3('0x21')](_0xa9d3('0x30'),upload[_0xa9d3('0x2b')]('file'),controller[_0xa9d3('0x31')]);var upload=multer({'storage':multer[_0xa9d3('0x24')]({'destination':function(_0x29253a,_0x12d88a,_0x2ce1e5){_0x2ce1e5(null,path['join'](config['root'],_0xa9d3('0x2d')));},'filename':function(_0x3cdefb,_0x230440,_0x5a8c68){_0x5a8c68(null,util[_0xa9d3('0x27')]('%s-%s',Date[_0xa9d3('0x2e')](),_0x230440[_0xa9d3('0x29')]));}})});router[_0xa9d3('0x21')](_0xa9d3('0x14'),upload[_0xa9d3('0x2b')](_0xa9d3('0x2c')),controller[_0xa9d3('0x32')]);router['post'](_0xa9d3('0x33'),controller[_0xa9d3('0x34')]);const offlineUploadMulter=multer({'storage':multer[_0xa9d3('0x24')]({'destination':function(_0x1b4e72,_0x5b743e,_0x4fb459){const _0x79244e=path[_0xa9d3('0x25')](config[_0xa9d3('0x26')],'server/files','attachments','offline-chat');fs_extra['ensureDir'](_0x79244e,function(){_0x4fb459(null,_0x79244e);});},'filename':function(_0x3e61fd,_0x24d420,_0xfbdead){const _0xdb33c0=_0x24d420[_0xa9d3('0x29')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x208169=path[_0xa9d3('0x35')](_0xdb33c0);const _0x19c3bd=Date[_0xa9d3('0x2e')]()+'-'+_0xdb33c0[_0xa9d3('0x36')](_0x208169,'')+_0x208169;_0xfbdead(null,_0x19c3bd);}})});router[_0xa9d3('0x21')]('/:id/offline',offlineUploadMulter[_0xa9d3('0x37')](),controller[_0xa9d3('0x38')]);router[_0xa9d3('0x21')](_0xa9d3('0x16'),auth[_0xa9d3('0xa')](),controller[_0xa9d3('0x39')]);router[_0xa9d3('0x21')](_0xa9d3('0x19'),auth[_0xa9d3('0xa')](),controller[_0xa9d3('0x3a')]);router[_0xa9d3('0x21')]('/:id/proactive_actions',auth[_0xa9d3('0xa')](),controller[_0xa9d3('0x3b')]);router[_0xa9d3('0x21')](_0xa9d3('0x3c'),auth['isAuthenticated'](),controller[_0xa9d3('0x3d')]);router[_0xa9d3('0x3e')]('/:id',auth[_0xa9d3('0xa')](),controller['update']);router[_0xa9d3('0x3f')](_0xa9d3('0x40'),auth[_0xa9d3('0xa')](),controller[_0xa9d3('0x41')]);router[_0xa9d3('0x3f')](_0xa9d3('0xc'),auth[_0xa9d3('0xa')](),controller[_0xa9d3('0x42')]);router[_0xa9d3('0x3f')](_0xa9d3('0xe'),auth[_0xa9d3('0xa')](),controller['removeAnswers']);router[_0xa9d3('0x3f')](_0xa9d3('0x3c'),auth[_0xa9d3('0xa')](),controller[_0xa9d3('0x43')]);module[_0xa9d3('0x44')]=router;
\ No newline at end of file
+var _0x0f54=['/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','/:id/users','post','create','/:id/dispositions','addAnswer','diskStorage','join','root','format','now','originalname','/:id/logo','single','file','addLogo','%s-%s','/:id/avatar','addAvatar','server/files/images/avatars/','addCustomerAvatar','notify','server/files','attachments','ensureDir','replace','/:id/offline','offline','/:id/interactions','addInteraction','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeAnswers','removeAgents','exports','multer','path','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/canned_answers','getAnswers','getLogo','getAvatar'];(function(_0x108a76,_0x160eee){var _0x495260=function(_0x1e9008){while(--_0x1e9008){_0x108a76['push'](_0x108a76['shift']());}};_0x495260(++_0x160eee);}(_0x0f54,0x100));var _0x40f5=function(_0x10f3f8,_0x114a4f){_0x10f3f8=_0x10f3f8-0x0;var _0x59dec6=_0x0f54[_0x10f3f8];return _0x59dec6;};'use strict';var multer=require(_0x40f5('0x0'));var util=require('util');var path=require(_0x40f5('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x40f5('0x2'));var interaction=require(_0x40f5('0x3'));var config=require(_0x40f5('0x4'));var controller=require(_0x40f5('0x5'));router[_0x40f5('0x6')]('/',auth[_0x40f5('0x7')](),controller[_0x40f5('0x8')]);router[_0x40f5('0x6')](_0x40f5('0x9'),auth['isAuthenticated'](),controller[_0x40f5('0xa')]);router[_0x40f5('0x6')](_0x40f5('0xb'),auth[_0x40f5('0x7')](),controller['show']);router[_0x40f5('0x6')]('/:id/dispositions',auth[_0x40f5('0x7')](),controller['getDispositions']);router['get'](_0x40f5('0xc'),auth['isAuthenticated'](),controller[_0x40f5('0xd')]);router[_0x40f5('0x6')]('/:id/logo',controller[_0x40f5('0xe')]);router[_0x40f5('0x6')]('/:id/avatar',controller[_0x40f5('0xf')]);router[_0x40f5('0x6')](_0x40f5('0x10'),controller[_0x40f5('0x11')]);router[_0x40f5('0x6')](_0x40f5('0x12'),controller['getSystemAvatar']);router['get']('/:id/interactions',auth[_0x40f5('0x7')](),controller[_0x40f5('0x13')]);router[_0x40f5('0x6')](_0x40f5('0x14'),controller[_0x40f5('0x15')]);router[_0x40f5('0x6')](_0x40f5('0x16'),auth[_0x40f5('0x7')](),controller[_0x40f5('0x17')]);router[_0x40f5('0x6')](_0x40f5('0x18'),auth['isAuthenticated'](),controller[_0x40f5('0x19')]);router[_0x40f5('0x6')](_0x40f5('0x1a'),controller[_0x40f5('0x1b')]);router['get']('/:id/offline_messages',auth[_0x40f5('0x7')](),controller[_0x40f5('0x1c')]);router[_0x40f5('0x6')](_0x40f5('0x1d'),auth[_0x40f5('0x7')](),controller['getAgents']);router[_0x40f5('0x1e')]('/',auth['isAuthenticated'](),controller[_0x40f5('0x1f')]);router['post'](_0x40f5('0x20'),auth[_0x40f5('0x7')](),controller['addDisposition']);router[_0x40f5('0x1e')](_0x40f5('0xc'),auth['isAuthenticated'](),controller[_0x40f5('0x21')]);var upload=multer({'storage':multer[_0x40f5('0x22')]({'destination':function(_0x12a6c7,_0x3fee45,_0x594f05){_0x594f05(null,path[_0x40f5('0x23')](config[_0x40f5('0x24')],'server/files/images/logos/'));},'filename':function(_0x7c5269,_0x40920f,_0x31b74e){_0x31b74e(null,util[_0x40f5('0x25')]('%s-%s',Date[_0x40f5('0x26')](),_0x40920f[_0x40f5('0x27')]));}})});router[_0x40f5('0x1e')](_0x40f5('0x28'),upload[_0x40f5('0x29')](_0x40f5('0x2a')),controller[_0x40f5('0x2b')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xbd172f,_0x35e78f,_0x27278f){_0x27278f(null,path[_0x40f5('0x23')](config[_0x40f5('0x24')],'server/files/images/avatars/'));},'filename':function(_0x48227d,_0x430764,_0x1d8a3f){_0x1d8a3f(null,util[_0x40f5('0x25')](_0x40f5('0x2c'),Date[_0x40f5('0x26')](),_0x430764[_0x40f5('0x27')]));}})});router[_0x40f5('0x1e')](_0x40f5('0x2d'),upload[_0x40f5('0x29')](_0x40f5('0x2a')),controller[_0x40f5('0x2e')]);var upload=multer({'storage':multer[_0x40f5('0x22')]({'destination':function(_0x522a19,_0x290fac,_0x2cfe46){_0x2cfe46(null,path[_0x40f5('0x23')](config[_0x40f5('0x24')],_0x40f5('0x2f')));},'filename':function(_0xa30319,_0x4aa451,_0x2a16e4){_0x2a16e4(null,util['format'](_0x40f5('0x2c'),Date['now'](),_0x4aa451[_0x40f5('0x27')]));}})});router[_0x40f5('0x1e')](_0x40f5('0x10'),upload['single'](_0x40f5('0x2a')),controller[_0x40f5('0x30')]);var upload=multer({'storage':multer[_0x40f5('0x22')]({'destination':function(_0x1a9a91,_0xad35f8,_0x2e664f){_0x2e664f(null,path[_0x40f5('0x23')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x30feca,_0x53fda4,_0x3d4280){_0x3d4280(null,util[_0x40f5('0x25')](_0x40f5('0x2c'),Date[_0x40f5('0x26')](),_0x53fda4[_0x40f5('0x27')]));}})});router[_0x40f5('0x1e')](_0x40f5('0x12'),upload[_0x40f5('0x29')](_0x40f5('0x2a')),controller['addSystemAvatar']);router[_0x40f5('0x1e')]('/:id/notify',controller[_0x40f5('0x31')]);const offlineUploadMulter=multer({'storage':multer[_0x40f5('0x22')]({'destination':function(_0x2a83ef,_0x329e60,_0x46148f){const _0x5a2913=path['join'](config[_0x40f5('0x24')],_0x40f5('0x32'),_0x40f5('0x33'),'offline-chat');fs_extra[_0x40f5('0x34')](_0x5a2913,function(){_0x46148f(null,_0x5a2913);});},'filename':function(_0x19934d,_0x4239df,_0x192d47){const _0x1abb2b=_0x4239df[_0x40f5('0x27')][_0x40f5('0x35')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2c763a=path['extname'](_0x1abb2b);const _0x5433eb=Date[_0x40f5('0x26')]()+'-'+_0x1abb2b[_0x40f5('0x35')](_0x2c763a,'')+_0x2c763a;_0x192d47(null,_0x5433eb);}})});router[_0x40f5('0x1e')](_0x40f5('0x36'),offlineUploadMulter['any'](),controller[_0x40f5('0x37')]);router[_0x40f5('0x1e')](_0x40f5('0x38'),auth['isAuthenticated'](),controller[_0x40f5('0x39')]);router[_0x40f5('0x1e')]('/:id/applications',auth[_0x40f5('0x7')](),controller[_0x40f5('0x3a')]);router[_0x40f5('0x1e')]('/:id/proactive_actions',auth[_0x40f5('0x7')](),controller[_0x40f5('0x3b')]);router['post']('/:id/users',auth['isAuthenticated'](),controller[_0x40f5('0x3c')]);router[_0x40f5('0x3d')](_0x40f5('0xb'),auth[_0x40f5('0x7')](),controller[_0x40f5('0x3e')]);router[_0x40f5('0x3f')]('/:id',auth['isAuthenticated'](),controller[_0x40f5('0x40')]);router['delete'](_0x40f5('0x20'),auth[_0x40f5('0x7')](),controller['removeDispositions']);router[_0x40f5('0x3f')]('/:id/canned_answers',auth[_0x40f5('0x7')](),controller[_0x40f5('0x41')]);router['delete']('/:id/users',auth[_0x40f5('0x7')](),controller[_0x40f5('0x42')]);module[_0x40f5('0x43')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index d1e057c..aa2b382 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 _0xd0de=['/client-logs','use','isAuthenticated','exports','beaver-logger/server','../components/auth/service','../config/environment','Router','env','production','app','Client-Side\x20logger\x20not\x20found!','expressEndpoint'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0xd0de,0xfb));var _0xed0d=function(_0x5e9876,_0x16052d){_0x5e9876=_0x5e9876-0x0;var _0x576c48=_0xd0de[_0x5e9876];return _0x576c48;};var beaverLogger=require(_0xed0d('0x0'));var express=require('express');var auth=require(_0xed0d('0x1'));var config=require(_0xed0d('0x2'));var router=express[_0xed0d('0x3')]();var isProduction=config[_0xed0d('0x4')]===_0xed0d('0x5')||![];function clientSideLogs(_0x403782,_0x5baca6,_0x5605e8){var _0x111490=_0x403782[_0xed0d('0x6')]['get']('client-side-logger');if(!_0x111490){throw new Error(_0xed0d('0x7'));}return beaverLogger[_0xed0d('0x8')]({'uri':_0xed0d('0x9'),'logger':_0x111490,'enableCors':!isProduction})(_0x403782,_0x5baca6,_0x5605e8);}router[_0xed0d('0xa')](auth[_0xed0d('0xb')](),clientSideLogs);module[_0xed0d('0xc')]=router;
\ No newline at end of file
+var _0xde42=['expressEndpoint','/client-logs','use','exports','beaver-logger/server','../config/environment','production','client-side-logger','Client-Side\x20logger\x20not\x20found!'];(function(_0x5d804a,_0x80be7b){var _0x170749=function(_0x5e2a02){while(--_0x5e2a02){_0x5d804a['push'](_0x5d804a['shift']());}};_0x170749(++_0x80be7b);}(_0xde42,0x1e1));var _0x2de4=function(_0x24bd83,_0x1830c4){_0x24bd83=_0x24bd83-0x0;var _0x3a047e=_0xde42[_0x24bd83];return _0x3a047e;};var beaverLogger=require(_0x2de4('0x0'));var express=require('express');var auth=require('../components/auth/service');var config=require(_0x2de4('0x1'));var router=express['Router']();var isProduction=config['env']===_0x2de4('0x2')||![];function clientSideLogs(_0x493831,_0x39fbab,_0x2c68de){var _0x2d9cd2=_0x493831['app']['get'](_0x2de4('0x3'));if(!_0x2d9cd2){throw new Error(_0x2de4('0x4'));}return beaverLogger[_0x2de4('0x5')]({'uri':_0x2de4('0x6'),'logger':_0x2d9cd2,'enableCors':!isProduction})(_0x493831,_0x39fbab,_0x2c68de);}router[_0x2de4('0x7')](auth['isAuthenticated'](),clientSideLogs);module[_0x2de4('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 9b84d39..ec2150f 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 _0x97a5=['MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','AmazonAWS','Google','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret'];(function(_0xf87945,_0x4e43b0){var _0x3c9881=function(_0x5eb0a7){while(--_0x5eb0a7){_0xf87945['push'](_0xf87945['shift']());}};_0x3c9881(++_0x4e43b0);}(_0x97a5,0x18b));var _0x597a=function(_0x450075,_0x1003c3){_0x450075=_0x450075-0x0;var _0x31598d=_0x97a5[_0x450075];return _0x31598d;};'use strict';var Sequelize=require(_0x597a('0x0'));module[_0x597a('0x1')]={'name':{'type':Sequelize[_0x597a('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x597a('0x3'),_0x597a('0x4'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x597a('0x5'),_0x597a('0x6'))},'data1':{'type':Sequelize[_0x597a('0x2')],'comment':_0x597a('0x7')},'data2':{'type':Sequelize[_0x597a('0x2')],'comment':_0x597a('0x8')},'data3':{'type':Sequelize['STRING'],'comment':_0x597a('0x9')},'data4':{'type':Sequelize[_0x597a('0x2')],'comment':_0x597a('0xa')},'data5':{'type':Sequelize['TEXT'],'comment':_0x597a('0xb')},'data6':{'type':Sequelize[_0x597a('0xc')],'comment':_0x597a('0xd')},'data7':{'type':Sequelize['TEXT'],'comment':_0x597a('0xe')}};
\ No newline at end of file
+var _0x3162=['Dynamics365','MicrosoftAzure\x20=>\x20client_id','STRING','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','AmazonAWS','Google','MicrosoftAzure','ENUM','Outlook365'];(function(_0x355878,_0x51d04b){var _0xbd952e=function(_0x3351e2){while(--_0x3351e2){_0x355878['push'](_0x355878['shift']());}};_0xbd952e(++_0x51d04b);}(_0x3162,0x18e));var _0x2316=function(_0x5a7fbc,_0xa081de){_0x5a7fbc=_0x5a7fbc-0x0;var _0xcba0fc=_0x3162[_0x5a7fbc];return _0xcba0fc;};'use strict';var Sequelize=require(_0x2316('0x0'));module[_0x2316('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x2316('0x2'),_0x2316('0x3'),_0x2316('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x2316('0x5')](_0x2316('0x6'),_0x2316('0x7'))},'data1':{'type':Sequelize['STRING'],'comment':_0x2316('0x8')},'data2':{'type':Sequelize[_0x2316('0x9')],'comment':_0x2316('0xa')},'data3':{'type':Sequelize[_0x2316('0x9')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0x2316('0x9')],'comment':_0x2316('0xb')},'data5':{'type':Sequelize[_0x2316('0xc')],'comment':_0x2316('0xd')},'data6':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0x2316('0xc')],'comment':_0x2316('0xe')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index ffa8129..ca92144 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 _0x4aa7=['redis','defaults','localhost','socket.io-emitter','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','end','error','name','padEnd','index','map','CloudProvider','fieldName','type','key','model','query','keys','attributes','nolimit','order','sort','where','filters','merge','options','includeAll','findAll','service','data3','catch','show','params','intersection','fields','length','include','find','MicrosoftAzure','create','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','rawAttributes','values','includes','body','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','oauth2MicrosoftAuthorize','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','parse','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:error','send','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/encryptor','../../config/environment','../../config/logger','../../mysqldb'];(function(_0x46e371,_0x54a672){var _0x5ca433=function(_0x34c74f){while(--_0x34c74f){_0x46e371['push'](_0x46e371['shift']());}};_0x5ca433(++_0x54a672);}(_0x4aa7,0x111));var _0x74aa=function(_0x18a276,_0x48c9d5){_0x18a276=_0x18a276-0x0;var _0x3c3cb8=_0x4aa7[_0x18a276];return _0x3c3cb8;};'use strict';var _=require(_0x74aa('0x0'));var Redis=require(_0x74aa('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0x74aa('0x2'));var config=require(_0x74aa('0x3'));var logger=require(_0x74aa('0x4'))('api');var db=require(_0x74aa('0x5'))['db'];var oauth=require('./cloudProvider.oauth');config[_0x74aa('0x6')]=_[_0x74aa('0x7')](config[_0x74aa('0x6')],{'host':_0x74aa('0x8'),'port':0x18eb});var socket=require(_0x74aa('0x9'))(new Redis(config['redis']));var redis=new Redis(config[_0x74aa('0x6')]);function respondWithStatusCode(_0x2374ba,_0x4803b1){_0x4803b1=_0x4803b1||0xcc;return function(_0x425fc5){if(_0x425fc5){return _0x2374ba[_0x74aa('0xa')](_0x4803b1);}return _0x2374ba[_0x74aa('0xb')](_0x4803b1)['end']();};}function respondWithResult(_0x5e1c4b,_0x6e14ff){_0x6e14ff=_0x6e14ff||0xc8;return function(_0x2c03dc){if(_0x2c03dc){return _0x5e1c4b[_0x74aa('0xb')](_0x6e14ff)[_0x74aa('0xc')](_0x2c03dc);}};}function respondWithFilteredResult(_0x4cf7ed,_0x6a601){return function(_0x2bab01){if(_0x2bab01){var _0x44f9dd=typeof _0x6a601[_0x74aa('0xd')]===_0x74aa('0xe')&&typeof _0x6a601[_0x74aa('0xf')]===_0x74aa('0xe');var _0x8383c=_0x2bab01[_0x74aa('0x10')];var _0x250f2a=_0x44f9dd?0x0:_0x6a601['offset'];var _0x3b494c=_0x44f9dd?_0x2bab01['count']:_0x6a601[_0x74aa('0xd')]+_0x6a601[_0x74aa('0xf')];var _0x529caf;if(_0x3b494c>=_0x8383c){_0x3b494c=_0x8383c;_0x529caf=0xc8;}else{_0x529caf=0xce;}_0x4cf7ed['status'](_0x529caf);return _0x4cf7ed[_0x74aa('0x11')](_0x74aa('0x12'),_0x250f2a+'-'+_0x3b494c+'/'+_0x8383c)[_0x74aa('0xc')](_0x2bab01);}return null;};}function saveUpdates(_0x289e2d){return function(_0x18cb75){if(_0x18cb75){return _0x18cb75[_0x74aa('0x13')](_0x289e2d)['then'](function(_0x5824a7){return _0x5824a7;});}return null;};}function removeEntity(_0x372bb5){return function(_0x33f093){if(_0x33f093){return _0x33f093[_0x74aa('0x14')]()[_0x74aa('0x15')](function(){_0x372bb5[_0x74aa('0xb')](0xcc)[_0x74aa('0x16')]();});}};}function handleEntityNotFound(_0x2397be){return function(_0x5a843b){if(!_0x5a843b){_0x2397be['sendStatus'](0x194);}return _0x5a843b;};}function handleError(_0x53f4f9,_0x2d482b){_0x2d482b=_0x2d482b||0x1f4;return function(_0x279de4){logger[_0x74aa('0x17')](_0x279de4['stack']);if(_0x279de4[_0x74aa('0x18')]){delete _0x279de4[_0x74aa('0x18')];}_0x53f4f9[_0x74aa('0xb')](_0x2d482b)['send'](_0x279de4);};}function maskClientSecret(_0x48531d){return _[_0x74aa('0x19')](_0x48531d['slice'](0x0,0x3),0x14,'*');}exports[_0x74aa('0x1a')]=function(_0x2fd866,_0x4fdcdc){var _0x3b85d4={},_0x474b5f={},_0xadc2c6={'count':0x0,'rows':[]};var _0x156036=_[_0x74aa('0x1b')](db[_0x74aa('0x1c')]['rawAttributes'],function(_0x451b97){return{'name':_0x451b97[_0x74aa('0x1d')],'type':_0x451b97[_0x74aa('0x1e')][_0x74aa('0x1f')]};});_0x474b5f[_0x74aa('0x20')]=_[_0x74aa('0x1b')](_0x156036,'name');_0x474b5f[_0x74aa('0x21')]=_[_0x74aa('0x22')](_0x2fd866['query']);_0x474b5f['filters']=_['intersection'](_0x474b5f[_0x74aa('0x20')],_0x474b5f[_0x74aa('0x21')]);_0x3b85d4['attributes']=_['intersection'](_0x474b5f[_0x74aa('0x20')],qs['fields'](_0x2fd866[_0x74aa('0x21')]['fields']));_0x3b85d4[_0x74aa('0x23')]=_0x3b85d4['attributes']['length']?_0x3b85d4[_0x74aa('0x23')]:_0x474b5f['model'];if(!_0x2fd866['query']['hasOwnProperty'](_0x74aa('0x24'))){_0x3b85d4[_0x74aa('0xf')]=qs[_0x74aa('0xf')](_0x2fd866[_0x74aa('0x21')][_0x74aa('0xf')]);_0x3b85d4[_0x74aa('0xd')]=qs[_0x74aa('0xd')](_0x2fd866[_0x74aa('0x21')]['offset']);}_0x3b85d4[_0x74aa('0x25')]=qs[_0x74aa('0x26')](_0x2fd866[_0x74aa('0x21')]['sort']);_0x3b85d4[_0x74aa('0x27')]=qs['filters'](_['pick'](_0x2fd866[_0x74aa('0x21')],_0x474b5f[_0x74aa('0x28')]),_0x156036);if(_0x2fd866[_0x74aa('0x21')]['filter']){_0x3b85d4[_0x74aa('0x27')]=_[_0x74aa('0x29')](_0x3b85d4[_0x74aa('0x27')],{'$or':_[_0x74aa('0x1b')](_0x156036,function(_0x40917b){if(_0x40917b[_0x74aa('0x1e')]!=='VIRTUAL'){var _0x44d1ab={};_0x44d1ab[_0x40917b['name']]={'$like':'%'+_0x2fd866[_0x74aa('0x21')]['filter']+'%'};return _0x44d1ab;}})});}_0x3b85d4=_[_0x74aa('0x29')]({},_0x3b85d4,_0x2fd866[_0x74aa('0x2a')]);var _0x10827f={'where':_0x3b85d4[_0x74aa('0x27')]};return db['CloudProvider']['count'](_0x10827f)[_0x74aa('0x15')](function(_0x24bd3f){_0xadc2c6[_0x74aa('0x10')]=_0x24bd3f;if(_0x2fd866[_0x74aa('0x21')][_0x74aa('0x2b')]){_0x3b85d4['include']=[{'all':!![]}];}return db['CloudProvider'][_0x74aa('0x2c')](_0x3b85d4);})[_0x74aa('0x15')](function(_0x44380d){_0xadc2c6['rows']=_['map'](_0x44380d,function(_0xf4d756){if(_0xf4d756[_0x74aa('0x2d')]==='MicrosoftAzure'){var _0x554fcc=encryptor['decryptString'](_0xf4d756['data3']);_0xf4d756[_0x74aa('0x2e')]=maskClientSecret(_0x554fcc);}return _0xf4d756;});return _0xadc2c6;})[_0x74aa('0x15')](respondWithFilteredResult(_0x4fdcdc,_0x3b85d4))[_0x74aa('0x2f')](handleError(_0x4fdcdc,null));};exports[_0x74aa('0x30')]=function(_0x54a63b,_0x2e5aa8){var _0x3acada={'raw':!![],'where':{'id':_0x54a63b[_0x74aa('0x31')]['id']}},_0x53f249={};_0x53f249[_0x74aa('0x20')]=_[_0x74aa('0x22')](db[_0x74aa('0x1c')]['rawAttributes']);_0x53f249[_0x74aa('0x21')]=_[_0x74aa('0x22')](_0x54a63b[_0x74aa('0x21')]);_0x53f249['filters']=_[_0x74aa('0x32')](_0x53f249[_0x74aa('0x20')],_0x53f249[_0x74aa('0x21')]);_0x3acada[_0x74aa('0x23')]=_[_0x74aa('0x32')](_0x53f249['model'],qs[_0x74aa('0x33')](_0x54a63b['query'][_0x74aa('0x33')]));_0x3acada['attributes']=_0x3acada[_0x74aa('0x23')][_0x74aa('0x34')]?_0x3acada[_0x74aa('0x23')]:_0x53f249['model'];if(_0x54a63b[_0x74aa('0x21')][_0x74aa('0x2b')]){_0x3acada[_0x74aa('0x35')]=[{'all':!![]}];}_0x3acada=_[_0x74aa('0x29')]({},_0x3acada,_0x54a63b[_0x74aa('0x2a')]);return db[_0x74aa('0x1c')][_0x74aa('0x36')](_0x3acada)[_0x74aa('0x15')](handleEntityNotFound(_0x2e5aa8,null))['then'](function(_0xe3d5b3){if(_0xe3d5b3[_0x74aa('0x2d')]===_0x74aa('0x37')){var _0x1cbcc8=encryptor['decryptString'](_0xe3d5b3['data3']);_0xe3d5b3[_0x74aa('0x2e')]=maskClientSecret(_0x1cbcc8);}return _0xe3d5b3;})[_0x74aa('0x15')](respondWithResult(_0x2e5aa8,null))[_0x74aa('0x2f')](handleError(_0x2e5aa8,null));};exports[_0x74aa('0x38')]=function(_0x5b6223,_0x3a48a0){if(!_0x5b6223['body'][_0x74aa('0x18')])throw new Error(_0x74aa('0x39'));if(!_0x5b6223['body'][_0x74aa('0x2d')])throw new Error(_0x74aa('0x3a'));var _0x5c9661=db[_0x74aa('0x1c')][_0x74aa('0x3b')][_0x74aa('0x2d')][_0x74aa('0x3c')];if(!_0x5c9661[_0x74aa('0x3d')](_0x5b6223[_0x74aa('0x3e')][_0x74aa('0x2d')]))throw new Error(_0x74aa('0x3f')+_0x5c9661[_0x74aa('0x40')](',\x20'));if(_0x5b6223[_0x74aa('0x3e')][_0x74aa('0x2d')]==='MicrosoftAzure'&&_0x5b6223[_0x74aa('0x3e')][_0x74aa('0x2e')]){_0x5b6223[_0x74aa('0x3e')]['data3']=encryptor[_0x74aa('0x41')](_0x5b6223[_0x74aa('0x3e')]['data3']);}return db['CloudProvider'][_0x74aa('0x38')](_0x5b6223['body'],{})[_0x74aa('0x15')](respondWithResult(_0x3a48a0,0xc9))[_0x74aa('0x2f')](handleError(_0x3a48a0,null));};exports[_0x74aa('0x13')]=function(_0x19ba21,_0x1323c9){if(_0x19ba21[_0x74aa('0x3e')]['id']){delete _0x19ba21['body']['id'];}return db['CloudProvider'][_0x74aa('0x36')]({'where':{'id':_0x19ba21[_0x74aa('0x31')]['id']}})[_0x74aa('0x15')](handleEntityNotFound(_0x1323c9,null))[_0x74aa('0x15')](function(_0x1142fd){if(_0x1142fd[_0x74aa('0x2d')]===_0x74aa('0x37')&&_0x19ba21[_0x74aa('0x3e')]['data3']){_0x19ba21[_0x74aa('0x3e')][_0x74aa('0x2e')]=encryptor['encryptString'](_0x19ba21[_0x74aa('0x3e')][_0x74aa('0x2e')]);}return _0x1142fd;})[_0x74aa('0x15')](saveUpdates(_0x19ba21[_0x74aa('0x3e')],null))[_0x74aa('0x15')](respondWithResult(_0x1323c9,null))[_0x74aa('0x2f')](handleError(_0x1323c9,null));};exports['destroy']=function(_0x26a9d2,_0x566c0e){return db['CloudProvider'][_0x74aa('0x36')]({'where':{'id':_0x26a9d2[_0x74aa('0x31')]['id']}})[_0x74aa('0x15')](handleEntityNotFound(_0x566c0e,null))[_0x74aa('0x15')](removeEntity(_0x566c0e,null))[_0x74aa('0x2f')](handleError(_0x566c0e,null));};exports[_0x74aa('0x42')]=function(_0x17338b,_0x1f665c){return db[_0x74aa('0x1c')]['findOne']({'where':{'id':_0x17338b[_0x74aa('0x31')]['id']},'raw':!![]})[_0x74aa('0x15')](function(_0x1cdaf7){if(!_0x1cdaf7)return _0x1f665c[_0x74aa('0xa')](0x194);return{'url':oauth[_0x74aa('0x43')](_0x1cdaf7,_0x17338b[_0x74aa('0x44')]['id'])};})['then'](respondWithResult(_0x1f665c,null))[_0x74aa('0x2f')](handleError(_0x1f665c,null));};exports[_0x74aa('0x45')]=function(_0x26599d,_0x206c09){var _0x3c453d=_0x26599d['body'];var _0x4cc8ef;var _0x2c08be;if(_0x3c453d[_0x74aa('0x17')])throw _0x3c453d;redis[_0x74aa('0x46')](_0x3c453d[_0x74aa('0x47')])[_0x74aa('0x15')](function(_0x22b26b){if(!_0x22b26b)throw new Error('Invalid\x20state\x20parameter');_0x4cc8ef=JSON[_0x74aa('0x48')](_0x22b26b);var _0x338ff3=Buffer['from'](_0x3c453d[_0x74aa('0x47')],_0x74aa('0x49'))[_0x74aa('0x4a')](_0x74aa('0x4b'));_0x2c08be=JSON[_0x74aa('0x48')](_0x338ff3);if(!oauth[_0x74aa('0x4c')](_0x3c453d[_0x74aa('0x4d')],_0x4cc8ef[_0x74aa('0x4e')]))throw new Error(_0x74aa('0x4f'));redis[_0x74aa('0x50')](_0x3c453d[_0x74aa('0x47')]);return oauth['getOauth2MicrosoftAccessToken'](_0x3c453d[_0x74aa('0x51')],_0x4cc8ef);})[_0x74aa('0x15')](function(_0x13a630){_0x4cc8ef[_0x74aa('0x52')]=_0x13a630[_0x74aa('0x53')];_0x4cc8ef[_0x74aa('0x54')]=_0x13a630[_0x74aa('0x55')];return db[_0x74aa('0x1c')]['update']({'data5':_0x4cc8ef['data5'],'data6':_0x4cc8ef[_0x74aa('0x54')]},{'where':{'id':_0x4cc8ef['id']}});})[_0x74aa('0x15')](function(){oauth[_0x74aa('0x56')](_0x4cc8ef);socket['emit']('microsoftAuthorization:success',{'id':_0x2c08be['id']});return;})['then'](respondWithStatusCode(_0x206c09,null))['catch'](function(_0x30d628){if(_0x2c08be){socket[_0x74aa('0x57')](_0x74aa('0x58'),{'id':_0x2c08be['id']});}if(!_0x4cc8ef){logger[_0x74aa('0x17')]('Invalid\x20authentication\x20state\x20parameter',_0x30d628);return _0x206c09[_0x74aa('0xb')](0x1f4)[_0x74aa('0x59')](_0x30d628[_0x74aa('0x5a')]);}logger['error'](_0x74aa('0x5b'),_0x4cc8ef['id'],JSON[_0x74aa('0x5c')](_0x30d628));});};
\ No newline at end of file
+var _0x06a6=['access_token','data6','startRefreshInterval','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/encryptor','../../config/environment','../../config/logger','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','sendStatus','end','status','json','undefined','offset','count','set','update','then','destroy','error','stack','name','send','padEnd','slice','map','CloudProvider','rawAttributes','type','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','limit','where','merge','VIRTUAL','filter','options','includeAll','include','rows','service','MicrosoftAzure','decryptString','data3','catch','show','params','length','create','Name\x20parameter\x20not\x20specified','body','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','encryptString','find','oauth2MicrosoftAuthorize','findOne','oauth2MicrosoftCallback','get','state','from','base64','toString','ascii','parse','isValidIdToken','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','code','data5'];(function(_0x3302fe,_0x158512){var _0x1e2248=function(_0xfa3b78){while(--_0xfa3b78){_0x3302fe['push'](_0x3302fe['shift']());}};_0x1e2248(++_0x158512);}(_0x06a6,0x1ca));var _0x606a=function(_0x5add8e,_0x4372f6){_0x5add8e=_0x5add8e-0x0;var _0x285479=_0x06a6[_0x5add8e];return _0x285479;};'use strict';var _=require(_0x606a('0x0'));var Redis=require(_0x606a('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0x606a('0x2'));var config=require(_0x606a('0x3'));var logger=require(_0x606a('0x4'))('api');var db=require('../../mysqldb')['db'];var oauth=require(_0x606a('0x5'));config[_0x606a('0x6')]=_[_0x606a('0x7')](config[_0x606a('0x6')],{'host':_0x606a('0x8'),'port':0x18eb});var socket=require(_0x606a('0x9'))(new Redis(config[_0x606a('0x6')]));var redis=new Redis(config[_0x606a('0x6')]);function respondWithStatusCode(_0x533d5f,_0x9a1631){_0x9a1631=_0x9a1631||0xcc;return function(_0x32ab82){if(_0x32ab82){return _0x533d5f[_0x606a('0xa')](_0x9a1631);}return _0x533d5f['status'](_0x9a1631)[_0x606a('0xb')]();};}function respondWithResult(_0x17484,_0x455904){_0x455904=_0x455904||0xc8;return function(_0x4239a4){if(_0x4239a4){return _0x17484[_0x606a('0xc')](_0x455904)[_0x606a('0xd')](_0x4239a4);}};}function respondWithFilteredResult(_0x57b2ce,_0x58892d){return function(_0xf63f6b){if(_0xf63f6b){var _0xec7707=typeof _0x58892d['offset']===_0x606a('0xe')&&typeof _0x58892d['limit']===_0x606a('0xe');var _0x483d4f=_0xf63f6b['count'];var _0x144454=_0xec7707?0x0:_0x58892d[_0x606a('0xf')];var _0x102187=_0xec7707?_0xf63f6b[_0x606a('0x10')]:_0x58892d[_0x606a('0xf')]+_0x58892d['limit'];var _0x56fe76;if(_0x102187>=_0x483d4f){_0x102187=_0x483d4f;_0x56fe76=0xc8;}else{_0x56fe76=0xce;}_0x57b2ce[_0x606a('0xc')](_0x56fe76);return _0x57b2ce[_0x606a('0x11')]('Content-Range',_0x144454+'-'+_0x102187+'/'+_0x483d4f)[_0x606a('0xd')](_0xf63f6b);}return null;};}function saveUpdates(_0x3a851f){return function(_0x244e23){if(_0x244e23){return _0x244e23[_0x606a('0x12')](_0x3a851f)[_0x606a('0x13')](function(_0x2205e3){return _0x2205e3;});}return null;};}function removeEntity(_0x4f1fa6){return function(_0x80a5e8){if(_0x80a5e8){return _0x80a5e8[_0x606a('0x14')]()[_0x606a('0x13')](function(){_0x4f1fa6[_0x606a('0xc')](0xcc)[_0x606a('0xb')]();});}};}function handleEntityNotFound(_0x46d808){return function(_0x55ff42){if(!_0x55ff42){_0x46d808[_0x606a('0xa')](0x194);}return _0x55ff42;};}function handleError(_0x544abf,_0x5c4089){_0x5c4089=_0x5c4089||0x1f4;return function(_0x322919){logger[_0x606a('0x15')](_0x322919[_0x606a('0x16')]);if(_0x322919[_0x606a('0x17')]){delete _0x322919['name'];}_0x544abf[_0x606a('0xc')](_0x5c4089)[_0x606a('0x18')](_0x322919);};}function maskClientSecret(_0x2aed2d){return _[_0x606a('0x19')](_0x2aed2d[_0x606a('0x1a')](0x0,0x3),0x14,'*');}exports['index']=function(_0xafd4bb,_0x582d4d){var _0x5e36fd={},_0xace308={},_0x16b528={'count':0x0,'rows':[]};var _0x53c34e=_[_0x606a('0x1b')](db[_0x606a('0x1c')][_0x606a('0x1d')],function(_0x5bc441){return{'name':_0x5bc441['fieldName'],'type':_0x5bc441[_0x606a('0x1e')]['key']};});_0xace308['model']=_[_0x606a('0x1b')](_0x53c34e,_0x606a('0x17'));_0xace308[_0x606a('0x1f')]=_[_0x606a('0x20')](_0xafd4bb[_0x606a('0x1f')]);_0xace308[_0x606a('0x21')]=_['intersection'](_0xace308[_0x606a('0x22')],_0xace308[_0x606a('0x1f')]);_0x5e36fd[_0x606a('0x23')]=_[_0x606a('0x24')](_0xace308[_0x606a('0x22')],qs[_0x606a('0x25')](_0xafd4bb[_0x606a('0x1f')]['fields']));_0x5e36fd[_0x606a('0x23')]=_0x5e36fd['attributes']['length']?_0x5e36fd[_0x606a('0x23')]:_0xace308['model'];if(!_0xafd4bb[_0x606a('0x1f')][_0x606a('0x26')](_0x606a('0x27'))){_0x5e36fd['limit']=qs[_0x606a('0x28')](_0xafd4bb[_0x606a('0x1f')][_0x606a('0x28')]);_0x5e36fd['offset']=qs[_0x606a('0xf')](_0xafd4bb[_0x606a('0x1f')][_0x606a('0xf')]);}_0x5e36fd['order']=qs['sort'](_0xafd4bb[_0x606a('0x1f')]['sort']);_0x5e36fd['where']=qs[_0x606a('0x21')](_['pick'](_0xafd4bb[_0x606a('0x1f')],_0xace308[_0x606a('0x21')]),_0x53c34e);if(_0xafd4bb[_0x606a('0x1f')]['filter']){_0x5e36fd[_0x606a('0x29')]=_[_0x606a('0x2a')](_0x5e36fd[_0x606a('0x29')],{'$or':_[_0x606a('0x1b')](_0x53c34e,function(_0x12355e){if(_0x12355e[_0x606a('0x1e')]!==_0x606a('0x2b')){var _0x408248={};_0x408248[_0x12355e[_0x606a('0x17')]]={'$like':'%'+_0xafd4bb[_0x606a('0x1f')][_0x606a('0x2c')]+'%'};return _0x408248;}})});}_0x5e36fd=_['merge']({},_0x5e36fd,_0xafd4bb[_0x606a('0x2d')]);var _0x546cfb={'where':_0x5e36fd[_0x606a('0x29')]};return db[_0x606a('0x1c')][_0x606a('0x10')](_0x546cfb)['then'](function(_0x2ebc6f){_0x16b528['count']=_0x2ebc6f;if(_0xafd4bb['query'][_0x606a('0x2e')]){_0x5e36fd[_0x606a('0x2f')]=[{'all':!![]}];}return db[_0x606a('0x1c')]['findAll'](_0x5e36fd);})[_0x606a('0x13')](function(_0x5410bb){_0x16b528[_0x606a('0x30')]=_[_0x606a('0x1b')](_0x5410bb,function(_0x6ed2b8){if(_0x6ed2b8[_0x606a('0x31')]===_0x606a('0x32')){var _0x1079b6=encryptor[_0x606a('0x33')](_0x6ed2b8[_0x606a('0x34')]);_0x6ed2b8[_0x606a('0x34')]=maskClientSecret(_0x1079b6);}return _0x6ed2b8;});return _0x16b528;})[_0x606a('0x13')](respondWithFilteredResult(_0x582d4d,_0x5e36fd))[_0x606a('0x35')](handleError(_0x582d4d,null));};exports[_0x606a('0x36')]=function(_0x141f77,_0x54da13){var _0x209d4e={'raw':!![],'where':{'id':_0x141f77[_0x606a('0x37')]['id']}},_0x2eed61={};_0x2eed61['model']=_[_0x606a('0x20')](db[_0x606a('0x1c')][_0x606a('0x1d')]);_0x2eed61['query']=_[_0x606a('0x20')](_0x141f77[_0x606a('0x1f')]);_0x2eed61[_0x606a('0x21')]=_['intersection'](_0x2eed61['model'],_0x2eed61[_0x606a('0x1f')]);_0x209d4e['attributes']=_['intersection'](_0x2eed61['model'],qs[_0x606a('0x25')](_0x141f77[_0x606a('0x1f')]['fields']));_0x209d4e['attributes']=_0x209d4e[_0x606a('0x23')][_0x606a('0x38')]?_0x209d4e[_0x606a('0x23')]:_0x2eed61[_0x606a('0x22')];if(_0x141f77[_0x606a('0x1f')]['includeAll']){_0x209d4e[_0x606a('0x2f')]=[{'all':!![]}];}_0x209d4e=_[_0x606a('0x2a')]({},_0x209d4e,_0x141f77['options']);return db[_0x606a('0x1c')]['find'](_0x209d4e)['then'](handleEntityNotFound(_0x54da13,null))[_0x606a('0x13')](function(_0x1b8068){if(_0x1b8068[_0x606a('0x31')]===_0x606a('0x32')){var _0x1ecbf0=encryptor[_0x606a('0x33')](_0x1b8068['data3']);_0x1b8068[_0x606a('0x34')]=maskClientSecret(_0x1ecbf0);}return _0x1b8068;})[_0x606a('0x13')](respondWithResult(_0x54da13,null))['catch'](handleError(_0x54da13,null));};exports[_0x606a('0x39')]=function(_0x266ce9,_0x50cb3c){if(!_0x266ce9['body'][_0x606a('0x17')])throw new Error(_0x606a('0x3a'));if(!_0x266ce9[_0x606a('0x3b')][_0x606a('0x31')])throw new Error(_0x606a('0x3c'));var _0x486d76=db[_0x606a('0x1c')]['rawAttributes'][_0x606a('0x31')][_0x606a('0x3d')];if(!_0x486d76[_0x606a('0x3e')](_0x266ce9[_0x606a('0x3b')][_0x606a('0x31')]))throw new Error(_0x606a('0x3f')+_0x486d76['join'](',\x20'));if(_0x266ce9[_0x606a('0x3b')][_0x606a('0x31')]==='MicrosoftAzure'&&_0x266ce9['body'][_0x606a('0x34')]){_0x266ce9[_0x606a('0x3b')][_0x606a('0x34')]=encryptor[_0x606a('0x40')](_0x266ce9[_0x606a('0x3b')]['data3']);}return db[_0x606a('0x1c')]['create'](_0x266ce9['body'],{})[_0x606a('0x13')](respondWithResult(_0x50cb3c,0xc9))[_0x606a('0x35')](handleError(_0x50cb3c,null));};exports['update']=function(_0x310015,_0x50770b){if(_0x310015[_0x606a('0x3b')]['id']){delete _0x310015[_0x606a('0x3b')]['id'];}return db[_0x606a('0x1c')][_0x606a('0x41')]({'where':{'id':_0x310015['params']['id']}})[_0x606a('0x13')](handleEntityNotFound(_0x50770b,null))[_0x606a('0x13')](function(_0x10c647){if(_0x10c647[_0x606a('0x31')]===_0x606a('0x32')&&_0x310015['body'][_0x606a('0x34')]){_0x310015['body'][_0x606a('0x34')]=encryptor[_0x606a('0x40')](_0x310015[_0x606a('0x3b')][_0x606a('0x34')]);}return _0x10c647;})[_0x606a('0x13')](saveUpdates(_0x310015[_0x606a('0x3b')],null))['then'](respondWithResult(_0x50770b,null))['catch'](handleError(_0x50770b,null));};exports[_0x606a('0x14')]=function(_0x2bd0bd,_0x195e52){return db[_0x606a('0x1c')]['find']({'where':{'id':_0x2bd0bd[_0x606a('0x37')]['id']}})[_0x606a('0x13')](handleEntityNotFound(_0x195e52,null))[_0x606a('0x13')](removeEntity(_0x195e52,null))[_0x606a('0x35')](handleError(_0x195e52,null));};exports[_0x606a('0x42')]=function(_0x2c7bb9,_0x20b44c){return db['CloudProvider'][_0x606a('0x43')]({'where':{'id':_0x2c7bb9[_0x606a('0x37')]['id']},'raw':!![]})[_0x606a('0x13')](function(_0x18bff5){if(!_0x18bff5)return _0x20b44c[_0x606a('0xa')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x18bff5,_0x2c7bb9['user']['id'])};})[_0x606a('0x13')](respondWithResult(_0x20b44c,null))['catch'](handleError(_0x20b44c,null));};exports[_0x606a('0x44')]=function(_0x476d2b,_0x489b22){var _0x1b62e3=_0x476d2b[_0x606a('0x3b')];var _0x3bac45;var _0x537f2f;if(_0x1b62e3[_0x606a('0x15')])throw _0x1b62e3;redis[_0x606a('0x45')](_0x1b62e3[_0x606a('0x46')])['then'](function(_0x400129){if(!_0x400129)throw new Error('Invalid\x20state\x20parameter');_0x3bac45=JSON['parse'](_0x400129);var _0x1b3707=Buffer[_0x606a('0x47')](_0x1b62e3[_0x606a('0x46')],_0x606a('0x48'))[_0x606a('0x49')](_0x606a('0x4a'));_0x537f2f=JSON[_0x606a('0x4b')](_0x1b3707);if(!oauth[_0x606a('0x4c')](_0x1b62e3['id_token'],_0x3bac45[_0x606a('0x4d')]))throw new Error(_0x606a('0x4e'));redis[_0x606a('0x4f')](_0x1b62e3[_0x606a('0x46')]);return oauth['getOauth2MicrosoftAccessToken'](_0x1b62e3[_0x606a('0x50')],_0x3bac45);})[_0x606a('0x13')](function(_0x1752db){_0x3bac45[_0x606a('0x51')]=_0x1752db[_0x606a('0x52')];_0x3bac45[_0x606a('0x53')]=_0x1752db['refresh_token'];return db[_0x606a('0x1c')][_0x606a('0x12')]({'data5':_0x3bac45[_0x606a('0x51')],'data6':_0x3bac45[_0x606a('0x53')]},{'where':{'id':_0x3bac45['id']}});})[_0x606a('0x13')](function(){oauth[_0x606a('0x54')](_0x3bac45);socket['emit']('microsoftAuthorization:success',{'id':_0x537f2f['id']});return;})[_0x606a('0x13')](respondWithStatusCode(_0x489b22,null))[_0x606a('0x35')](function(_0x551dbd){if(_0x537f2f){socket[_0x606a('0x55')](_0x606a('0x56'),{'id':_0x537f2f['id']});}if(!_0x3bac45){logger[_0x606a('0x15')](_0x606a('0x57'),_0x551dbd);return _0x489b22[_0x606a('0xc')](0x1f4)['send'](_0x551dbd['message']);}logger[_0x606a('0x15')](_0x606a('0x58'),_0x3bac45['id'],JSON[_0x606a('0x59')](_0x551dbd));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index e9f9299..d52f22c 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 _0x72c5=['cloud_providers','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider'];(function(_0x3890b5,_0x2092ef){var _0x5836cd=function(_0xcef6c1){while(--_0xcef6c1){_0x3890b5['push'](_0x3890b5['shift']());}};_0x5836cd(++_0x2092ef);}(_0x72c5,0xde));var _0x572c=function(_0x2d69a4,_0x32935e){_0x2d69a4=_0x2d69a4-0x0;var _0xe0705b=_0x72c5[_0x2d69a4];return _0xe0705b;};'use strict';var _=require(_0x572c('0x0'));var util=require('util');var logger=require(_0x572c('0x1'))(_0x572c('0x2'));var moment=require(_0x572c('0x3'));var BPromise=require('bluebird');var rp=require(_0x572c('0x4'));var fs=require('fs');var path=require(_0x572c('0x5'));var rimraf=require(_0x572c('0x6'));var config=require(_0x572c('0x7'));var attributes=require(_0x572c('0x8'));module[_0x572c('0x9')]=function(_0x1b0b7f,_0x4287cd){return _0x1b0b7f[_0x572c('0xa')](_0x572c('0xb'),attributes,{'tableName':_0x572c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfa7f=['moment','request-promise','rimraf','define','CloudProvider','cloud_providers','util','../../config/logger'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0xfa7f,0x136));var _0xffa7=function(_0x4bd13b,_0x157a13){_0x4bd13b=_0x4bd13b-0x0;var _0x5d1e33=_0xfa7f[_0x4bd13b];return _0x5d1e33;};'use strict';var _=require('lodash');var util=require(_0xffa7('0x0'));var logger=require(_0xffa7('0x1'))('api');var moment=require(_0xffa7('0x2'));var BPromise=require('bluebird');var rp=require(_0xffa7('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xffa7('0x4'));var config=require('../../config/environment');var attributes=require('./cloudProvider.attributes');module['exports']=function(_0x7648f6,_0x54f951){return _0x7648f6[_0xffa7('0x5')](_0xffa7('0x6'),attributes,{'tableName':_0xffa7('0x7'),'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 cab8a85..61120da 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 _0x1071=['payload','iss','audience','isAfter','unix','resolve','then','data3','CloudProvider','findOne','refresh_token','data6','decryptString','access_token','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','POST','intervals','bind','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','../../components/encryptor','../../config/environment','../../config/logger','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','openid','/authorize','/token','Dynamics365','push','data7','join','type','Outlook365','/.default','replace','{TENANT_ID}','data2','code','id_token','from','base64','randomBytes','toString','hex','client_id','data1','response_type','redirect_uri','response_mode','form_post','scope','state','nonce','login','map','key','value','oauth2Claims','oauth2/','set','stringify','decode'];(function(_0x4066d1,_0xddaabe){var _0x4d38cd=function(_0x41f589){while(--_0x41f589){_0x4066d1['push'](_0x4066d1['shift']());}};_0x4d38cd(++_0xddaabe);}(_0x1071,0x1bf));var _0x1107=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x1071[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x1107('0x0'));var crypto=require(_0x1107('0x1'));var jwt=require(_0x1107('0x2'));var moment=require(_0x1107('0x3'));var Redis=require(_0x1107('0x4'));var rp=require(_0x1107('0x5'));var util=require('util');var encryptor=require(_0x1107('0x6'));var config=require(_0x1107('0x7'));var logger=require(_0x1107('0x8'))('api');var schedule=require(_0x1107('0x9'));var db=require(_0x1107('0xa'))['db'];config[_0x1107('0xb')]=_[_0x1107('0xc')](config[_0x1107('0xb')],{'host':_0x1107('0xd'),'port':0x18eb});var redis=new Redis(config[_0x1107('0xb')]);var MICROSOFT_AUTH_URL=_0x1107('0xe');var AZURE_AUTH_SCOPES={'Outlook365':['openid','profile',_0x1107('0xf'),_0x1107('0x10'),_0x1107('0x11'),'https://outlook.office.com/POP.AccessAsUser.All',_0x1107('0x12')],'Dynamics365':[_0x1107('0x13'),_0x1107('0x10')]};var MICROSOFT_AUTH_ENDPOINT=_0x1107('0x14');var MICROSOFT_TOKEN_ENDPOINT=_0x1107('0x15');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x270111){var _0xe79d24=_['map'](AZURE_AUTH_SCOPES[_0x270111['type']]);if(_0x270111['type']===_0x1107('0x16'))_0xe79d24[_0x1107('0x17')](_0x270111[_0x1107('0x18')]+'/.default');return _0xe79d24[_0x1107('0x19')]('\x20');}function getAccessTokenScope(_0x505aab){if(_0x505aab[_0x1107('0x1a')]===_0x1107('0x1b'))return _0x1107('0x11');if(_0x505aab[_0x1107('0x1a')]===_0x1107('0x16'))return _0x505aab[_0x1107('0x18')]+_0x1107('0x1c');}function generateMicrosoftAuthorizationUrl(_0xb681a,_0x39556a){var _0x2003cd=MICROSOFT_AUTH_URL[_0x1107('0x1d')](_0x1107('0x1e'),_0xb681a[_0x1107('0x1f')]);var _0x5db5ed=[_0x1107('0x20'),_0x1107('0x21')];var _0x1cc553=Buffer[_0x1107('0x22')](JSON['stringify']({'id':_0x39556a}))['toString'](_0x1107('0x23'));var _0x3d2e20=crypto[_0x1107('0x24')](0x10)[_0x1107('0x25')](_0x1107('0x26'));var _0x387a54=getAuthorizationScopes(_0xb681a);var _0x4aa4bf=[{'key':_0x1107('0x27'),'value':_0xb681a[_0x1107('0x28')]},{'key':_0x1107('0x29'),'value':encodeURIComponent(_0x5db5ed[_0x1107('0x19')]('\x20'))},{'key':_0x1107('0x2a'),'value':_0xb681a['data4']},{'key':_0x1107('0x2b'),'value':_0x1107('0x2c')},{'key':_0x1107('0x2d'),'value':encodeURIComponent(_0x387a54)},{'key':_0x1107('0x2e'),'value':_0x1cc553},{'key':_0x1107('0x2f'),'value':_0x3d2e20},{'key':'prompt','value':_0x1107('0x30')}];var _0x175eab=_0x2003cd+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x1107('0x31')](_0x4aa4bf,function(_0x2166e5){return _0x2166e5[_0x1107('0x32')]+'='+_0x2166e5[_0x1107('0x33')];})[_0x1107('0x19')]('&');_0xb681a[_0x1107('0x34')]={'issuer':_0x2003cd[_0x1107('0x1d')](_0x1107('0x35'),''),'audience':_0xb681a['data1'],'state':_0x1cc553,'nonce':_0x3d2e20};redis[_0x1107('0x36')](_0x1cc553,JSON[_0x1107('0x37')](_0xb681a));return _0x175eab;}function isValidIdToken(_0x4d0db0,_0x226d7d){try{var _0x365bd1=jwt[_0x1107('0x38')](_0x4d0db0,{'complete':!![]});var _0x1efe62=_0x365bd1[_0x1107('0x39')];if(_0x1efe62[_0x1107('0x3a')]!==_0x226d7d['issuer'])return![];if(_0x1efe62['aud']!==_0x226d7d[_0x1107('0x3b')])return![];if(_0x1efe62[_0x1107('0x2f')]!==_0x226d7d[_0x1107('0x2f')])return![];if(moment()[_0x1107('0x3c')](moment[_0x1107('0x3d')](_0x1efe62['exp'])))return![];return!![];}catch(_0x29f355){throw _0x29f355;}}function refreshOauth2MicrosoftAccessToken(_0x200f7c){return Promise[_0x1107('0x3e')]()[_0x1107('0x3f')](function(){if(_0x200f7c[_0x1107('0x40')])return _0x200f7c;return db[_0x1107('0x41')][_0x1107('0x42')]({'where':{'id':_0x200f7c['id']},'raw':!![]});})[_0x1107('0x3f')](function(_0xdbb40e){var _0x3955af={'grant_type':_0x1107('0x43'),'refresh_token':_0xdbb40e[_0x1107('0x44')],'scope':getAccessTokenScope(_0xdbb40e),'redirect_uri':_0xdbb40e['data4'],'client_id':_0xdbb40e[_0x1107('0x28')],'client_secret':encryptor[_0x1107('0x45')](_0xdbb40e[_0x1107('0x40')])};var _0x511fe4={'method':'POST','uri':MICROSOFT_AUTH_URL['replace'](_0x1107('0x1e'),_0xdbb40e[_0x1107('0x1f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3955af,'json':!![]};return rp(_0x511fe4);})[_0x1107('0x3f')](function(_0x32f163){_0x200f7c['data5']=_0x32f163[_0x1107('0x46')];_0x200f7c[_0x1107('0x44')]=_0x32f163[_0x1107('0x43')];return db['CloudProvider'][_0x1107('0x47')]({'data5':_0x200f7c['data5'],'data6':_0x200f7c[_0x1107('0x44')]},{'where':{'id':_0x200f7c['id']}});})[_0x1107('0x3f')](function(){return _0x200f7c;})[_0x1107('0x48')](function(_0x14c12e){logger[_0x1107('0x49')](_0x1107('0x4a'),_0x200f7c['id'],_0x14c12e);});}function getOauth2MicrosoftAccessToken(_0x4f42be,_0x32fd90){var _0xf74519={'grant_type':_0x1107('0x4b'),'code':_0x4f42be,'scope':getAccessTokenScope(_0x32fd90),'redirect_uri':_0x32fd90['data4'],'client_id':_0x32fd90[_0x1107('0x28')],'client_secret':encryptor[_0x1107('0x45')](_0x32fd90[_0x1107('0x40')])};var _0x2dfe10={'method':_0x1107('0x4c'),'uri':MICROSOFT_AUTH_URL[_0x1107('0x1d')](_0x1107('0x1e'),_0x32fd90[_0x1107('0x1f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0xf74519,'json':!![]};return rp(_0x2dfe10);}function startRefreshInterval(_0xb9c36d){var _0x485e25=schedule[_0x1107('0x4d')];if(_0x485e25[_0xb9c36d['id']])clearInterval(_0x485e25[_0xb9c36d['id']]);_0x485e25[_0xb9c36d['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x1107('0x4e')](this,{'id':_0xb9c36d['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x485e25;}function startAllRefreshIntervals(){return db[_0x1107('0x41')][_0x1107('0x4f')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x1107('0x3f')](function(_0x67ec11){var _0x5d1834=_0x67ec11[_0x1107('0x31')](function(_0xdc5a60){return refreshOauth2MicrosoftAccessToken(_0xdc5a60)['then'](function(_0x28a157){startRefreshInterval(_0x28a157);});});return Promise[_0x1107('0x50')](_0x5d1834);})[_0x1107('0x48')](function(_0x22d80a){var _0x3e6a64=_0x22d80a?util[_0x1107('0x51')](_0x22d80a,{'showHidden':![],'depth':null}):'';logger[_0x1107('0x49')](_0x1107('0x52'),_0x3e6a64);});}module[_0x1107('0x53')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0xf1de=['request-promise','util','../../components/encryptor','api','../../config/schedule/cloud-provider','redis','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','email','offline_access','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','push','data7','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','/.default','replace','{TENANT_ID}','data2','code','id_token','from','randomBytes','toString','hex','client_id','data1','redirect_uri','data4','response_mode','form_post','scope','state','nonce','prompt','login','key','value','join','oauth2Claims','oauth2/','set','decode','payload','issuer','aud','unix','exp','resolve','then','findOne','data6','decryptString','POST','data5','access_token','refresh_token','CloudProvider','update','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','data3','bind','intervals','inspect','error','lodash','jsonwebtoken','moment','ioredis'];(function(_0x101a17,_0x5d047a){var _0x3b76ee=function(_0x89be1b){while(--_0x89be1b){_0x101a17['push'](_0x101a17['shift']());}};_0x3b76ee(++_0x5d047a);}(_0xf1de,0x1ca));var _0xef1d=function(_0x150715,_0x1f1d09){_0x150715=_0x150715-0x0;var _0x152535=_0xf1de[_0x150715];return _0x152535;};'use strict';var _=require(_0xef1d('0x0'));var crypto=require('crypto');var jwt=require(_0xef1d('0x1'));var moment=require(_0xef1d('0x2'));var Redis=require(_0xef1d('0x3'));var rp=require(_0xef1d('0x4'));var util=require(_0xef1d('0x5'));var encryptor=require(_0xef1d('0x6'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0xef1d('0x7'));var schedule=require(_0xef1d('0x8'));var db=require('../../mysqldb')['db'];config[_0xef1d('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0xef1d('0x9')]);var MICROSOFT_AUTH_URL=_0xef1d('0xa');var AZURE_AUTH_SCOPES={'Outlook365':[_0xef1d('0xb'),'profile',_0xef1d('0xc'),_0xef1d('0xd'),'https://outlook.office365.com/IMAP.AccessAsUser.All',_0xef1d('0xe'),_0xef1d('0xf')],'Dynamics365':[_0xef1d('0xb'),_0xef1d('0xd')]};var MICROSOFT_AUTH_ENDPOINT=_0xef1d('0x10');var MICROSOFT_TOKEN_ENDPOINT=_0xef1d('0x11');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x8fa5d8){var _0x39ae1a=_[_0xef1d('0x12')](AZURE_AUTH_SCOPES[_0x8fa5d8[_0xef1d('0x13')]]);if(_0x8fa5d8['type']===_0xef1d('0x14'))_0x39ae1a[_0xef1d('0x15')](_0x8fa5d8[_0xef1d('0x16')]+'/.default');return _0x39ae1a['join']('\x20');}function getAccessTokenScope(_0x4bcebf){if(_0x4bcebf[_0xef1d('0x13')]===_0xef1d('0x17'))return _0xef1d('0x18');if(_0x4bcebf[_0xef1d('0x13')]===_0xef1d('0x14'))return _0x4bcebf[_0xef1d('0x16')]+_0xef1d('0x19');}function generateMicrosoftAuthorizationUrl(_0x5642d9,_0x351a7){var _0x4c0f5d=MICROSOFT_AUTH_URL[_0xef1d('0x1a')](_0xef1d('0x1b'),_0x5642d9[_0xef1d('0x1c')]);var _0x15c90c=[_0xef1d('0x1d'),_0xef1d('0x1e')];var _0x5062bd=Buffer[_0xef1d('0x1f')](JSON['stringify']({'id':_0x351a7}))['toString']('base64');var _0x3ef881=crypto[_0xef1d('0x20')](0x10)[_0xef1d('0x21')](_0xef1d('0x22'));var _0x2bd3b8=getAuthorizationScopes(_0x5642d9);var _0x2003f6=[{'key':_0xef1d('0x23'),'value':_0x5642d9[_0xef1d('0x24')]},{'key':'response_type','value':encodeURIComponent(_0x15c90c['join']('\x20'))},{'key':_0xef1d('0x25'),'value':_0x5642d9[_0xef1d('0x26')]},{'key':_0xef1d('0x27'),'value':_0xef1d('0x28')},{'key':_0xef1d('0x29'),'value':encodeURIComponent(_0x2bd3b8)},{'key':_0xef1d('0x2a'),'value':_0x5062bd},{'key':_0xef1d('0x2b'),'value':_0x3ef881},{'key':_0xef1d('0x2c'),'value':_0xef1d('0x2d')}];var _0x587a06=_0x4c0f5d+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x2003f6,function(_0x1335d0){return _0x1335d0[_0xef1d('0x2e')]+'='+_0x1335d0[_0xef1d('0x2f')];})[_0xef1d('0x30')]('&');_0x5642d9[_0xef1d('0x31')]={'issuer':_0x4c0f5d['replace'](_0xef1d('0x32'),''),'audience':_0x5642d9['data1'],'state':_0x5062bd,'nonce':_0x3ef881};redis[_0xef1d('0x33')](_0x5062bd,JSON['stringify'](_0x5642d9));return _0x587a06;}function isValidIdToken(_0x201d9,_0x417a27){try{var _0xd54af=jwt[_0xef1d('0x34')](_0x201d9,{'complete':!![]});var _0x2096a0=_0xd54af[_0xef1d('0x35')];if(_0x2096a0['iss']!==_0x417a27[_0xef1d('0x36')])return![];if(_0x2096a0[_0xef1d('0x37')]!==_0x417a27['audience'])return![];if(_0x2096a0[_0xef1d('0x2b')]!==_0x417a27[_0xef1d('0x2b')])return![];if(moment()['isAfter'](moment[_0xef1d('0x38')](_0x2096a0[_0xef1d('0x39')])))return![];return!![];}catch(_0x5d389f){throw _0x5d389f;}}function refreshOauth2MicrosoftAccessToken(_0x18e5be){return Promise[_0xef1d('0x3a')]()[_0xef1d('0x3b')](function(){if(_0x18e5be['data3'])return _0x18e5be;return db['CloudProvider'][_0xef1d('0x3c')]({'where':{'id':_0x18e5be['id']},'raw':!![]});})[_0xef1d('0x3b')](function(_0x5e4d87){var _0x31b378={'grant_type':'refresh_token','refresh_token':_0x5e4d87[_0xef1d('0x3d')],'scope':getAccessTokenScope(_0x5e4d87),'redirect_uri':_0x5e4d87[_0xef1d('0x26')],'client_id':_0x5e4d87[_0xef1d('0x24')],'client_secret':encryptor[_0xef1d('0x3e')](_0x5e4d87['data3'])};var _0x4c005f={'method':_0xef1d('0x3f'),'uri':MICROSOFT_AUTH_URL[_0xef1d('0x1a')](_0xef1d('0x1b'),_0x5e4d87[_0xef1d('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x31b378,'json':!![]};return rp(_0x4c005f);})[_0xef1d('0x3b')](function(_0x4b927c){_0x18e5be[_0xef1d('0x40')]=_0x4b927c[_0xef1d('0x41')];_0x18e5be[_0xef1d('0x3d')]=_0x4b927c[_0xef1d('0x42')];return db[_0xef1d('0x43')][_0xef1d('0x44')]({'data5':_0x18e5be[_0xef1d('0x40')],'data6':_0x18e5be[_0xef1d('0x3d')]},{'where':{'id':_0x18e5be['id']}});})[_0xef1d('0x3b')](function(){return _0x18e5be;})[_0xef1d('0x45')](function(_0x5d2d82){logger['error'](_0xef1d('0x46'),_0x18e5be['id'],_0x5d2d82);});}function getOauth2MicrosoftAccessToken(_0x4fdf42,_0x58a07e){var _0x4df9a8={'grant_type':_0xef1d('0x47'),'code':_0x4fdf42,'scope':getAccessTokenScope(_0x58a07e),'redirect_uri':_0x58a07e[_0xef1d('0x26')],'client_id':_0x58a07e[_0xef1d('0x24')],'client_secret':encryptor[_0xef1d('0x3e')](_0x58a07e[_0xef1d('0x48')])};var _0x5f3303={'method':_0xef1d('0x3f'),'uri':MICROSOFT_AUTH_URL['replace'](_0xef1d('0x1b'),_0x58a07e['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4df9a8,'json':!![]};return rp(_0x5f3303);}function startRefreshInterval(_0x4a5e2f){var _0x1fdaac=schedule['intervals'];if(_0x1fdaac[_0x4a5e2f['id']])clearInterval(_0x1fdaac[_0x4a5e2f['id']]);_0x1fdaac[_0x4a5e2f['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xef1d('0x49')](this,{'id':_0x4a5e2f['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xef1d('0x4a')]=_0x1fdaac;}function startAllRefreshIntervals(){return db[_0xef1d('0x43')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xef1d('0x3b')](function(_0x8b9c80){var _0x187744=_0x8b9c80['map'](function(_0x2104c8){return refreshOauth2MicrosoftAccessToken(_0x2104c8)[_0xef1d('0x3b')](function(_0x46ee16){startRefreshInterval(_0x46ee16);});});return Promise['all'](_0x187744);})[_0xef1d('0x45')](function(_0x3548fa){var _0x3e5eb7=_0x3548fa?util[_0xef1d('0x4b')](_0x3548fa,{'showHidden':![],'depth':null}):'';logger[_0xef1d('0x4c')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x3e5eb7);});}module['exports']={'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 792e5c0..1657abb 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 _0x28f2=['debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','CloudProvider,\x20%s,\x20%s'];(function(_0x2c2954,_0x3cadf4){var _0x1e834e=function(_0x9f157e){while(--_0x9f157e){_0x2c2954['push'](_0x2c2954['shift']());}};_0x1e834e(++_0x3cadf4);}(_0x28f2,0x193));var _0x228f=function(_0x4672d4,_0x6c9725){_0x4672d4=_0x4672d4-0x0;var _0x1a2f2d=_0x28f2[_0x4672d4];return _0x1a2f2d;};'use strict';var _=require(_0x228f('0x0'));var util=require(_0x228f('0x1'));var moment=require(_0x228f('0x2'));var BPromise=require(_0x228f('0x3'));var rs=require(_0x228f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x228f('0x5'))['db'];var utils=require(_0x228f('0x6'));var logger=require(_0x228f('0x7'))(_0x228f('0x8'));var config=require(_0x228f('0x9'));var jayson=require(_0x228f('0xa'));var client=jayson[_0x228f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10da58,_0x4a4a44,_0x3ca074){return new BPromise(function(_0x455eb6,_0xf4b011){return client['request'](_0x10da58,_0x3ca074)[_0x228f('0xc')](function(_0x4d0038){logger[_0x228f('0xd')](_0x228f('0xe'),_0x4a4a44,'request\x20sent');logger[_0x228f('0xf')](_0x228f('0x10'),_0x4a4a44,_0x228f('0x11'),JSON[_0x228f('0x12')](_0x4d0038));if(_0x4d0038[_0x228f('0x13')]){if(_0x4d0038['error'][_0x228f('0x14')]===0x1f4){logger[_0x228f('0x13')](_0x228f('0xe'),_0x4a4a44,_0x4d0038[_0x228f('0x13')][_0x228f('0x15')]);return _0xf4b011(_0x4d0038[_0x228f('0x13')][_0x228f('0x15')]);}logger[_0x228f('0x13')]('CloudProvider,\x20%s,\x20%s',_0x4a4a44,_0x4d0038[_0x228f('0x13')][_0x228f('0x15')]);return _0x455eb6(_0x4d0038[_0x228f('0x13')][_0x228f('0x15')]);}else{logger[_0x228f('0xd')](_0x228f('0xe'),_0x4a4a44,_0x228f('0x11'));_0x455eb6(_0x4d0038['result'][_0x228f('0x15')]);}})['catch'](function(_0x20e687){logger[_0x228f('0x13')](_0x228f('0xe'),_0x4a4a44,_0x20e687);_0xf4b011(_0x20e687);});});}
\ No newline at end of file
+var _0x2d0b=['code','message','CloudProvider,\x20%s,\x20%s','request\x20sent','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','CloudProvider,\x20%s,\x20%s,\x20%s','error'];(function(_0x48ff3d,_0x316a7d){var _0x466514=function(_0x5b6555){while(--_0x5b6555){_0x48ff3d['push'](_0x48ff3d['shift']());}};_0x466514(++_0x316a7d);}(_0x2d0b,0x102));var _0xb2d0=function(_0x3584e3,_0x5802d0){_0x3584e3=_0x3584e3-0x0;var _0x30a6c1=_0x2d0b[_0x3584e3];return _0x30a6c1;};'use strict';var _=require('lodash');var util=require(_0xb2d0('0x0'));var moment=require(_0xb2d0('0x1'));var BPromise=require(_0xb2d0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb2d0('0x3'));var db=require(_0xb2d0('0x4'))['db'];var utils=require(_0xb2d0('0x5'));var logger=require(_0xb2d0('0x6'))('rpc');var config=require(_0xb2d0('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb2d0('0x8')][_0xb2d0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d3bff,_0x28fee3,_0xb1c30c){return new BPromise(function(_0x17f561,_0x31340b){return client[_0xb2d0('0xa')](_0x1d3bff,_0xb1c30c)[_0xb2d0('0xb')](function(_0x1a6fac){logger[_0xb2d0('0xc')]('CloudProvider,\x20%s,\x20%s',_0x28fee3,'request\x20sent');logger['debug'](_0xb2d0('0xd'),_0x28fee3,'request\x20sent',JSON['stringify'](_0x1a6fac));if(_0x1a6fac['error']){if(_0x1a6fac[_0xb2d0('0xe')][_0xb2d0('0xf')]===0x1f4){logger[_0xb2d0('0xe')]('CloudProvider,\x20%s,\x20%s',_0x28fee3,_0x1a6fac[_0xb2d0('0xe')]['message']);return _0x31340b(_0x1a6fac[_0xb2d0('0xe')][_0xb2d0('0x10')]);}logger[_0xb2d0('0xe')](_0xb2d0('0x11'),_0x28fee3,_0x1a6fac[_0xb2d0('0xe')][_0xb2d0('0x10')]);return _0x17f561(_0x1a6fac[_0xb2d0('0xe')][_0xb2d0('0x10')]);}else{logger[_0xb2d0('0xc')](_0xb2d0('0x11'),_0x28fee3,_0xb2d0('0x12'));_0x17f561(_0x1a6fac[_0xb2d0('0x13')][_0xb2d0('0x10')]);}})[_0xb2d0('0x14')](function(_0x223ae8){logger['error'](_0xb2d0('0x11'),_0x28fee3,_0x223ae8);_0x31340b(_0x223ae8);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index dd08dfb..d915dd5 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 _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0x1d2bc8,_0x2860bc){var _0x1857e1=function(_0x3a3073){while(--_0x3a3073){_0x1d2bc8['push'](_0x1d2bc8['shift']());}};_0x1857e1(++_0x2860bc);}(_0x1261,0x144));var _0x1126=function(_0x35a779,_0x27f8fb){_0x35a779=_0x35a779-0x0;var _0xca723b=_0x1261[_0x35a779];return _0xca723b;};'use strict';var express=require('express');var router=express[_0x1126('0x0')]();var auth=require(_0x1126('0x1'));var controller=require(_0x1126('0x2'));router[_0x1126('0x3')]('/',auth[_0x1126('0x4')](),controller[_0x1126('0x5')]);router[_0x1126('0x3')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller[_0x1126('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1126('0x8')]);router[_0x1126('0x9')]('/:id',auth[_0x1126('0x4')](),controller[_0x1126('0xa')]);router[_0x1126('0xb')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller['destroy']);router[_0x1126('0x3')](_0x1126('0xc'),auth[_0x1126('0x4')](),controller['oauth2MicrosoftAuthorize']);router[_0x1126('0xd')]('/oauth2/microsoft/callback',controller['oauth2MicrosoftCallback']);module[_0x1126('0xe')]=router;
\ No newline at end of file
+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(_0x61b3ab,_0x1fc298){var _0x57097f=function(_0x25970b){while(--_0x25970b){_0x61b3ab['push'](_0x61b3ab['shift']());}};_0x57097f(++_0x1fc298);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4cb2fa,_0x277e7f){_0x4cb2fa=_0x4cb2fa-0x0;var _0x41b318=_0x5f2f[_0x4cb2fa];return _0x41b318;};'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
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index ea3263c..ba788c0 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 _0x4703=['name','STRING','sequelize','exports'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0x4703,0xd2));var _0x3470=function(_0x1da655,_0x2285e9){_0x1da655=_0x1da655-0x0;var _0x27b05e=_0x4703[_0x1da655];return _0x27b05e;};'use strict';var Sequelize=require(_0x3470('0x0'));module[_0x3470('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x3470('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x3470('0x3')]},'companyId':{'type':Sequelize[_0x3470('0x3')]},'website':{'type':Sequelize[_0x3470('0x3')]},'phone':{'type':Sequelize[_0x3470('0x3')]},'fax':{'type':Sequelize[_0x3470('0x3')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x3470('0x3')]},'postalCode':{'type':Sequelize[_0x3470('0x3')]},'city':{'type':Sequelize[_0x3470('0x3')]},'country':{'type':Sequelize[_0x3470('0x3')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x3470('0x3')]},'sStreet':{'type':Sequelize[_0x3470('0x3')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x3470('0x3')]},'sCountry':{'type':Sequelize[_0x3470('0x3')]},'description':{'type':Sequelize[_0x3470('0x3')]}};
\ No newline at end of file
+var _0x024c=['STRING','sequelize','exports'];(function(_0x3d867d,_0x2b706e){var _0x340b24=function(_0x5c155d){while(--_0x5c155d){_0x3d867d['push'](_0x3d867d['shift']());}};_0x340b24(++_0x2b706e);}(_0x024c,0x1c0));var _0xc024=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x024c[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xc024('0x0'));module[_0xc024('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xc024('0x2')]},'companyId':{'type':Sequelize[_0xc024('0x2')]},'website':{'type':Sequelize[_0xc024('0x2')]},'phone':{'type':Sequelize[_0xc024('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xc024('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xc024('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xc024('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xc024('0x2')]},'sStreet':{'type':Sequelize[_0xc024('0x2')]},'sPostalCode':{'type':Sequelize[_0xc024('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0xc024('0x2')]},'description':{'type':Sequelize[_0xc024('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index b57b40c..d626135 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 _0xb59b=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','CmContact','addContacts','omit','ids','getContacts','findOne','eml-format','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Companies','UserProfileResource','sendStatus','stack','name','send','index','CmCompany','describe','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','include','rows','catch','rawAttributes','includeAll','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','error'];(function(_0x2dc1a0,_0x29cf94){var _0x3d7e3d=function(_0x25b5d9){while(--_0x25b5d9){_0x2dc1a0['push'](_0x2dc1a0['shift']());}};_0x3d7e3d(++_0x29cf94);}(_0xb59b,0xb9));var _0xbb59=function(_0x54fab4,_0x1fb905){_0x54fab4=_0x54fab4-0x0;var _0x221350=_0xb59b[_0x54fab4];return _0x221350;};'use strict';var emlformat=require(_0xbb59('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbb59('0x1'));var moment=require(_0xbb59('0x2'));var BPromise=require(_0xbb59('0x3'));var Mustache=require(_0xbb59('0x4'));var util=require('util');var path=require(_0xbb59('0x5'));var sox=require(_0xbb59('0x6'));var csv=require(_0xbb59('0x7'));var ejs=require(_0xbb59('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbb59('0x9'));var squel=require(_0xbb59('0xa'));var crypto=require('crypto');var jsforce=require(_0xbb59('0xb'));var deskjs=require(_0xbb59('0xc'));var toCsv=require(_0xbb59('0x7'));var querystring=require(_0xbb59('0xd'));var Papa=require(_0xbb59('0xe'));var Redis=require(_0xbb59('0xf'));var authService=require(_0xbb59('0x10'));var qs=require(_0xbb59('0x11'));var as=require(_0xbb59('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbb59('0x13'));var utils=require(_0xbb59('0x14'));var config=require(_0xbb59('0x15'));var licenseUtil=require(_0xbb59('0x16'));var db=require(_0xbb59('0x17'))['db'];function respondWithStatusCode(_0x536338,_0x43e60a){_0x43e60a=_0x43e60a||0xcc;return function(_0x3729ef){if(_0x3729ef){return _0x536338['sendStatus'](_0x43e60a);}return _0x536338[_0xbb59('0x18')](_0x43e60a)[_0xbb59('0x19')]();};}function respondWithResult(_0x1401a4,_0xcd98fc){_0xcd98fc=_0xcd98fc||0xc8;return function(_0x5aa28b){if(_0x5aa28b){return _0x1401a4[_0xbb59('0x18')](_0xcd98fc)[_0xbb59('0x1a')](_0x5aa28b);}};}function respondWithFilteredResult(_0x25b6b2,_0x4a20ac){return function(_0x34bc47){if(_0x34bc47){var _0x2eddcc=typeof _0x4a20ac[_0xbb59('0x1b')]===_0xbb59('0x1c')&&typeof _0x4a20ac[_0xbb59('0x1d')]===_0xbb59('0x1c');var _0x1cc2a2=_0x34bc47[_0xbb59('0x1e')];var _0x558a1d=_0x2eddcc?0x0:_0x4a20ac['offset'];var _0x2c0bd6=_0x2eddcc?_0x34bc47[_0xbb59('0x1e')]:_0x4a20ac[_0xbb59('0x1b')]+_0x4a20ac[_0xbb59('0x1d')];var _0x9f51e9;if(_0x2c0bd6>=_0x1cc2a2){_0x2c0bd6=_0x1cc2a2;_0x9f51e9=0xc8;}else{_0x9f51e9=0xce;}_0x25b6b2[_0xbb59('0x18')](_0x9f51e9);return _0x25b6b2[_0xbb59('0x1f')](_0xbb59('0x20'),_0x558a1d+'-'+_0x2c0bd6+'/'+_0x1cc2a2)[_0xbb59('0x1a')](_0x34bc47);}return null;};}function patchUpdates(_0x54af2f){return function(_0x3b73af){try{jsonpatch[_0xbb59('0x21')](_0x3b73af,_0x54af2f,!![]);}catch(_0x1af15a){return BPromise[_0xbb59('0x22')](_0x1af15a);}return _0x3b73af[_0xbb59('0x23')]();};}function saveUpdates(_0x3d2557,_0x4ab04f){return function(_0x5707a3){if(_0x5707a3){return _0x5707a3[_0xbb59('0x24')](_0x3d2557)[_0xbb59('0x25')](function(_0x4392de){return _0x4392de;});}return null;};}function removeEntity(_0x428c80,_0x26830c){return function(_0x1e2c21){if(_0x1e2c21){return _0x1e2c21[_0xbb59('0x26')]()[_0xbb59('0x25')](function(){var _0x154d90=_0x1e2c21[_0xbb59('0x27')]({'plain':!![]});var _0x27148b=_0xbb59('0x28');return db[_0xbb59('0x29')][_0xbb59('0x26')]({'where':{'type':_0x27148b,'resourceId':_0x154d90['id']}})[_0xbb59('0x25')](function(){return _0x1e2c21;});})[_0xbb59('0x25')](function(){_0x428c80[_0xbb59('0x18')](0xcc)[_0xbb59('0x19')]();});}};}function handleEntityNotFound(_0x3e9c86,_0x362888){return function(_0x19718f){if(!_0x19718f){_0x3e9c86[_0xbb59('0x2a')](0x194);}return _0x19718f;};}function handleError(_0xafe6ac,_0x2dca91){_0x2dca91=_0x2dca91||0x1f4;return function(_0x3df290){logger['error'](_0x3df290[_0xbb59('0x2b')]);if(_0x3df290[_0xbb59('0x2c')]){delete _0x3df290['name'];}_0xafe6ac[_0xbb59('0x18')](_0x2dca91)[_0xbb59('0x2d')](_0x3df290);};}exports[_0xbb59('0x2e')]=function(_0x1ba77f,_0x5c5271){var _0xf06c99={},_0x54ffc8={},_0x46d193={'count':0x0,'rows':[]};return db[_0xbb59('0x2f')][_0xbb59('0x30')]()[_0xbb59('0x25')](function(_0x3227df){_0x54ffc8['model']=_[_0xbb59('0x31')](_0x3227df);_0x54ffc8[_0xbb59('0x32')]=_[_0xbb59('0x31')](_0x1ba77f[_0xbb59('0x32')]);_0x54ffc8[_0xbb59('0x33')]=_[_0xbb59('0x34')](_0x54ffc8[_0xbb59('0x35')],_0x54ffc8[_0xbb59('0x32')]);_0xf06c99[_0xbb59('0x36')]=_['intersection'](_0x54ffc8['model'],qs[_0xbb59('0x37')](_0x1ba77f[_0xbb59('0x32')]['fields']));_0xf06c99[_0xbb59('0x36')]=_0xf06c99[_0xbb59('0x36')][_0xbb59('0x38')]?_0xf06c99[_0xbb59('0x36')]:_0x54ffc8[_0xbb59('0x35')];if(!_0x1ba77f[_0xbb59('0x32')][_0xbb59('0x39')](_0xbb59('0x3a'))){_0xf06c99[_0xbb59('0x1d')]=qs['limit'](_0x1ba77f[_0xbb59('0x32')][_0xbb59('0x1d')]);_0xf06c99[_0xbb59('0x1b')]=qs[_0xbb59('0x1b')](_0x1ba77f['query'][_0xbb59('0x1b')]);}_0xf06c99[_0xbb59('0x3b')]=qs[_0xbb59('0x3c')](_0x1ba77f[_0xbb59('0x32')]['sort']);_0xf06c99[_0xbb59('0x3d')]=qs[_0xbb59('0x33')](_[_0xbb59('0x3e')](_0x1ba77f[_0xbb59('0x32')],_0x54ffc8[_0xbb59('0x33')]),_0x3227df);if(_0x1ba77f[_0xbb59('0x32')][_0xbb59('0x3f')]){_0xf06c99['where']=_[_0xbb59('0x40')](_0xf06c99['where'],{'$or':_[_0xbb59('0x41')](_0xf06c99[_0xbb59('0x36')],function(_0x38bcf9){var _0x14fc15={};_0x14fc15[_0x38bcf9]={'$like':'%'+_0x1ba77f[_0xbb59('0x32')][_0xbb59('0x3f')]+'%'};return _0x14fc15;})});}_0xf06c99=_[_0xbb59('0x40')]({},_0xf06c99,_0x1ba77f['options']);var _0x424a71={'where':_0xf06c99[_0xbb59('0x3d')]};return db[_0xbb59('0x2f')][_0xbb59('0x1e')](_0x424a71)[_0xbb59('0x25')](function(_0x41eb13){_0x46d193[_0xbb59('0x1e')]=_0x41eb13;if(_0x1ba77f[_0xbb59('0x32')]['includeAll']){_0xf06c99[_0xbb59('0x42')]=[{'all':!![]}];}return db[_0xbb59('0x2f')]['findAll'](_0xf06c99);})[_0xbb59('0x25')](function(_0x3faae1){_0x46d193[_0xbb59('0x43')]=_0x3faae1;return _0x46d193;})[_0xbb59('0x25')](respondWithFilteredResult(_0x5c5271,_0xf06c99))[_0xbb59('0x44')](handleError(_0x5c5271,null));})['catch'](handleError(_0x5c5271,null));};exports['show']=function(_0x3b8fb9,_0x47e168){var _0x5ea783={'raw':![],'where':{'id':_0x3b8fb9['params']['id']}},_0x1fe0f4={};_0x1fe0f4[_0xbb59('0x35')]=_['keys'](db[_0xbb59('0x2f')][_0xbb59('0x45')]);_0x1fe0f4['query']=_['keys'](_0x3b8fb9[_0xbb59('0x32')]);_0x1fe0f4[_0xbb59('0x33')]=_[_0xbb59('0x34')](_0x1fe0f4[_0xbb59('0x35')],_0x1fe0f4[_0xbb59('0x32')]);_0x5ea783[_0xbb59('0x36')]=_['intersection'](_0x1fe0f4[_0xbb59('0x35')],qs[_0xbb59('0x37')](_0x3b8fb9[_0xbb59('0x32')][_0xbb59('0x37')]));_0x5ea783[_0xbb59('0x36')]=_0x5ea783[_0xbb59('0x36')]['length']?_0x5ea783[_0xbb59('0x36')]:_0x1fe0f4['model'];if(_0x3b8fb9[_0xbb59('0x32')][_0xbb59('0x46')]){_0x5ea783['include']=[{'all':!![]}];}_0x5ea783=_['merge']({},_0x5ea783,_0x3b8fb9[_0xbb59('0x47')]);return db[_0xbb59('0x2f')][_0xbb59('0x48')](_0x5ea783)['then'](handleEntityNotFound(_0x47e168,null))[_0xbb59('0x25')](respondWithResult(_0x47e168,null))[_0xbb59('0x44')](handleError(_0x47e168,null));};exports[_0xbb59('0x49')]=function(_0x108a29,_0x11cff4){return db['CmCompany']['create'](_0x108a29['body'],{})[_0xbb59('0x25')](function(_0x4b9ee0){var _0x4fd5cf=_0x108a29[_0xbb59('0x4a')][_0xbb59('0x27')]({'plain':!![]});if(!_0x4fd5cf)throw new Error(_0xbb59('0x4b'));if(_0x4fd5cf['role']==='user'){var _0x5d2217=_0x4b9ee0[_0xbb59('0x27')]({'plain':!![]});var _0x31df6a=_0xbb59('0x28');return db[_0xbb59('0x4c')][_0xbb59('0x48')]({'where':{'name':_0x31df6a,'userProfileId':_0x4fd5cf['userProfileId']},'raw':!![]})['then'](function(_0x28643c){if(_0x28643c&&_0x28643c[_0xbb59('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x5d2217[_0xbb59('0x2c')],'resourceId':_0x5d2217['id'],'type':_0x28643c['name'],'sectionId':_0x28643c['id']},{})[_0xbb59('0x25')](function(){return _0x4b9ee0;});}else{return _0x4b9ee0;}})[_0xbb59('0x44')](function(_0x42f35e){logger[_0xbb59('0x4e')](_0xbb59('0x4f'),_0x42f35e);throw _0x42f35e;});}return _0x4b9ee0;})[_0xbb59('0x25')](respondWithResult(_0x11cff4,0xc9))[_0xbb59('0x44')](handleError(_0x11cff4,null));};exports['update']=function(_0x19f9c8,_0xf7682f){if(_0x19f9c8['body']['id']){delete _0x19f9c8[_0xbb59('0x50')]['id'];}return db[_0xbb59('0x2f')][_0xbb59('0x48')]({'where':{'id':_0x19f9c8[_0xbb59('0x51')]['id']}})['then'](handleEntityNotFound(_0xf7682f,null))['then'](saveUpdates(_0x19f9c8[_0xbb59('0x50')],null))[_0xbb59('0x25')](respondWithResult(_0xf7682f,null))[_0xbb59('0x44')](handleError(_0xf7682f,null));};exports[_0xbb59('0x26')]=function(_0x5ca638,_0x42957f){return db[_0xbb59('0x2f')][_0xbb59('0x48')]({'where':{'id':_0x5ca638[_0xbb59('0x51')]['id']}})[_0xbb59('0x25')](handleEntityNotFound(_0x42957f,null))[_0xbb59('0x25')](removeEntity(_0x42957f,null))[_0xbb59('0x44')](handleError(_0x42957f,null));};exports[_0xbb59('0x30')]=function(_0x147f08,_0x5c2b1e){return db[_0xbb59('0x2f')][_0xbb59('0x30')]()[_0xbb59('0x25')](respondWithResult(_0x5c2b1e,null))['catch'](handleError(_0x5c2b1e,null));};exports['addContacts']=function(_0x554108,_0x2226a3,_0x21d902){return db[_0xbb59('0x52')][_0xbb59('0x48')]({'where':{'id':_0x554108['params']['id']}})[_0xbb59('0x25')](handleEntityNotFound(_0x2226a3,null))[_0xbb59('0x25')](function(_0xc277d6){if(_0xc277d6){return _0xc277d6[_0xbb59('0x53')](_0x554108['body']['ids'],_[_0xbb59('0x54')](_0x554108['body'],[_0xbb59('0x55'),'id'])||{});}})[_0xbb59('0x25')](respondWithResult(_0x2226a3,null))[_0xbb59('0x44')](handleError(_0x2226a3,null));};exports[_0xbb59('0x56')]=function(_0x358cd3,_0x2a4e9d,_0x37688a){var _0x3bd7ac={};var _0x5d03b8={};var _0x46f6cd;var _0x36a6fd;return db[_0xbb59('0x2f')][_0xbb59('0x57')]({'where':{'id':_0x358cd3[_0xbb59('0x51')]['id']}})[_0xbb59('0x25')](handleEntityNotFound(_0x2a4e9d,null))['then'](function(_0x4d20c2){if(_0x4d20c2){_0x46f6cd=_0x4d20c2;_0x5d03b8['model']=_[_0xbb59('0x31')](db['CmContact']['rawAttributes']);_0x5d03b8[_0xbb59('0x32')]=_[_0xbb59('0x31')](_0x358cd3[_0xbb59('0x32')]);_0x5d03b8[_0xbb59('0x33')]=_['intersection'](_0x5d03b8[_0xbb59('0x35')],_0x5d03b8[_0xbb59('0x32')]);_0x3bd7ac[_0xbb59('0x36')]=_[_0xbb59('0x34')](_0x5d03b8[_0xbb59('0x35')],qs['fields'](_0x358cd3['query']['fields']));_0x3bd7ac[_0xbb59('0x36')]=_0x3bd7ac[_0xbb59('0x36')][_0xbb59('0x38')]?_0x3bd7ac['attributes']:_0x5d03b8[_0xbb59('0x35')];_0x3bd7ac[_0xbb59('0x3b')]=qs[_0xbb59('0x3c')](_0x358cd3['query']['sort']);_0x3bd7ac[_0xbb59('0x3d')]=qs[_0xbb59('0x33')](_['pick'](_0x358cd3[_0xbb59('0x32')],_0x5d03b8[_0xbb59('0x33')]));if(_0x358cd3[_0xbb59('0x32')]['filter']){_0x3bd7ac[_0xbb59('0x3d')]=_['merge'](_0x3bd7ac[_0xbb59('0x3d')],{'$or':_['map'](_0x3bd7ac[_0xbb59('0x36')],function(_0x34f3ca){var _0x195bca={};_0x195bca[_0x34f3ca]={'$like':'%'+_0x358cd3[_0xbb59('0x32')][_0xbb59('0x3f')]+'%'};return _0x195bca;})});}_0x3bd7ac=_['merge']({},_0x3bd7ac,_0x358cd3['options']);return _0x46f6cd[_0xbb59('0x56')](_0x3bd7ac);}})['then'](function(_0x118f15){if(_0x118f15){_0x36a6fd=_0x118f15[_0xbb59('0x38')];if(!_0x358cd3['query']['hasOwnProperty'](_0xbb59('0x3a'))){_0x3bd7ac[_0xbb59('0x1d')]=qs['limit'](_0x358cd3[_0xbb59('0x32')]['limit']);_0x3bd7ac[_0xbb59('0x1b')]=qs[_0xbb59('0x1b')](_0x358cd3[_0xbb59('0x32')][_0xbb59('0x1b')]);}return _0x46f6cd['getContacts'](_0x3bd7ac);}})[_0xbb59('0x25')](function(_0x346445){if(_0x346445){return _0x346445?{'count':_0x36a6fd,'rows':_0x346445}:null;}})['then'](respondWithResult(_0x2a4e9d,null))['catch'](handleError(_0x2a4e9d,null));};
\ No newline at end of file
+var _0xd840=['filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','get','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','omit','getContacts','findOne','order','map','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','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/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','set','Content-Range','json','reject','update','then','Companies','UserProfileResource','destroy','end','stack','name','send','CmCompany','describe','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','limit','sort','pick'];(function(_0x6e46f,_0x10152e){var _0x2ef67a=function(_0x2d1b23){while(--_0x2d1b23){_0x6e46f['push'](_0x6e46f['shift']());}};_0x2ef67a(++_0x10152e);}(_0xd840,0xd0));var _0x0d84=function(_0x13d157,_0x202826){_0x13d157=_0x13d157-0x0;var _0x38924b=_0xd840[_0x13d157];return _0x38924b;};'use strict';var emlformat=require(_0x0d84('0x0'));var rimraf=require(_0x0d84('0x1'));var zipdir=require(_0x0d84('0x2'));var jsonpatch=require(_0x0d84('0x3'));var rp=require('request-promise');var moment=require(_0x0d84('0x4'));var BPromise=require(_0x0d84('0x5'));var Mustache=require(_0x0d84('0x6'));var util=require('util');var path=require('path');var sox=require(_0x0d84('0x7'));var csv=require(_0x0d84('0x8'));var ejs=require(_0x0d84('0x9'));var fs=require('fs');var fs_extra=require(_0x0d84('0xa'));var _=require(_0x0d84('0xb'));var squel=require(_0x0d84('0xc'));var crypto=require(_0x0d84('0xd'));var jsforce=require(_0x0d84('0xe'));var deskjs=require(_0x0d84('0xf'));var toCsv=require(_0x0d84('0x8'));var querystring=require('querystring');var Papa=require(_0x0d84('0x10'));var Redis=require(_0x0d84('0x11'));var authService=require(_0x0d84('0x12'));var qs=require(_0x0d84('0x13'));var as=require(_0x0d84('0x14'));var hardwareService=require(_0x0d84('0x15'));var logger=require(_0x0d84('0x16'))(_0x0d84('0x17'));var utils=require('../../config/utils');var config=require(_0x0d84('0x18'));var licenseUtil=require(_0x0d84('0x19'));var db=require(_0x0d84('0x1a'))['db'];function respondWithStatusCode(_0x2c3a56,_0x581ebd){_0x581ebd=_0x581ebd||0xcc;return function(_0x2660d3){if(_0x2660d3){return _0x2c3a56[_0x0d84('0x1b')](_0x581ebd);}return _0x2c3a56[_0x0d84('0x1c')](_0x581ebd)['end']();};}function respondWithResult(_0x3a8d4d,_0x29b734){_0x29b734=_0x29b734||0xc8;return function(_0x57c758){if(_0x57c758){return _0x3a8d4d['status'](_0x29b734)['json'](_0x57c758);}};}function respondWithFilteredResult(_0x52a812,_0x4d2001){return function(_0x1ec94d){if(_0x1ec94d){var _0x510e53=typeof _0x4d2001[_0x0d84('0x1d')]===_0x0d84('0x1e')&&typeof _0x4d2001['limit']===_0x0d84('0x1e');var _0x6053b7=_0x1ec94d['count'];var _0xf61a3e=_0x510e53?0x0:_0x4d2001['offset'];var _0x130f22=_0x510e53?_0x1ec94d[_0x0d84('0x1f')]:_0x4d2001[_0x0d84('0x1d')]+_0x4d2001['limit'];var _0x1c16c7;if(_0x130f22>=_0x6053b7){_0x130f22=_0x6053b7;_0x1c16c7=0xc8;}else{_0x1c16c7=0xce;}_0x52a812[_0x0d84('0x1c')](_0x1c16c7);return _0x52a812[_0x0d84('0x20')](_0x0d84('0x21'),_0xf61a3e+'-'+_0x130f22+'/'+_0x6053b7)[_0x0d84('0x22')](_0x1ec94d);}return null;};}function patchUpdates(_0x1a2395){return function(_0x5d5c78){try{jsonpatch['apply'](_0x5d5c78,_0x1a2395,!![]);}catch(_0x13cd1e){return BPromise[_0x0d84('0x23')](_0x13cd1e);}return _0x5d5c78['save']();};}function saveUpdates(_0x2f312b,_0x44b861){return function(_0x2d09b3){if(_0x2d09b3){return _0x2d09b3[_0x0d84('0x24')](_0x2f312b)[_0x0d84('0x25')](function(_0x5eb6b1){return _0x5eb6b1;});}return null;};}function removeEntity(_0xc67be4,_0x44f82f){return function(_0x2f69ed){if(_0x2f69ed){return _0x2f69ed['destroy']()[_0x0d84('0x25')](function(){var _0x43d9e9=_0x2f69ed['get']({'plain':!![]});var _0x43c1cc=_0x0d84('0x26');return db[_0x0d84('0x27')][_0x0d84('0x28')]({'where':{'type':_0x43c1cc,'resourceId':_0x43d9e9['id']}})[_0x0d84('0x25')](function(){return _0x2f69ed;});})[_0x0d84('0x25')](function(){_0xc67be4[_0x0d84('0x1c')](0xcc)[_0x0d84('0x29')]();});}};}function handleEntityNotFound(_0x3bc3c3,_0x186a33){return function(_0x177c73){if(!_0x177c73){_0x3bc3c3['sendStatus'](0x194);}return _0x177c73;};}function handleError(_0x5b0188,_0x103b2d){_0x103b2d=_0x103b2d||0x1f4;return function(_0x11afa6){logger['error'](_0x11afa6[_0x0d84('0x2a')]);if(_0x11afa6[_0x0d84('0x2b')]){delete _0x11afa6[_0x0d84('0x2b')];}_0x5b0188[_0x0d84('0x1c')](_0x103b2d)[_0x0d84('0x2c')](_0x11afa6);};}exports['index']=function(_0x5d7967,_0x2fb903){var _0x2f5499={},_0x3ba01c={},_0x4b36f={'count':0x0,'rows':[]};return db[_0x0d84('0x2d')][_0x0d84('0x2e')]()[_0x0d84('0x25')](function(_0x3f8d5b){_0x3ba01c[_0x0d84('0x2f')]=_[_0x0d84('0x30')](_0x3f8d5b);_0x3ba01c[_0x0d84('0x31')]=_['keys'](_0x5d7967[_0x0d84('0x31')]);_0x3ba01c[_0x0d84('0x32')]=_['intersection'](_0x3ba01c['model'],_0x3ba01c[_0x0d84('0x31')]);_0x2f5499['attributes']=_[_0x0d84('0x33')](_0x3ba01c[_0x0d84('0x2f')],qs[_0x0d84('0x34')](_0x5d7967[_0x0d84('0x31')][_0x0d84('0x34')]));_0x2f5499[_0x0d84('0x35')]=_0x2f5499['attributes'][_0x0d84('0x36')]?_0x2f5499[_0x0d84('0x35')]:_0x3ba01c['model'];if(!_0x5d7967[_0x0d84('0x31')][_0x0d84('0x37')]('nolimit')){_0x2f5499[_0x0d84('0x38')]=qs[_0x0d84('0x38')](_0x5d7967[_0x0d84('0x31')]['limit']);_0x2f5499[_0x0d84('0x1d')]=qs[_0x0d84('0x1d')](_0x5d7967[_0x0d84('0x31')][_0x0d84('0x1d')]);}_0x2f5499['order']=qs[_0x0d84('0x39')](_0x5d7967[_0x0d84('0x31')][_0x0d84('0x39')]);_0x2f5499['where']=qs['filters'](_[_0x0d84('0x3a')](_0x5d7967[_0x0d84('0x31')],_0x3ba01c[_0x0d84('0x32')]),_0x3f8d5b);if(_0x5d7967[_0x0d84('0x31')][_0x0d84('0x3b')]){_0x2f5499[_0x0d84('0x3c')]=_[_0x0d84('0x3d')](_0x2f5499['where'],{'$or':_['map'](_0x2f5499[_0x0d84('0x35')],function(_0x55584d){var _0x39060b={};_0x39060b[_0x55584d]={'$like':'%'+_0x5d7967[_0x0d84('0x31')][_0x0d84('0x3b')]+'%'};return _0x39060b;})});}_0x2f5499=_[_0x0d84('0x3d')]({},_0x2f5499,_0x5d7967[_0x0d84('0x3e')]);var _0x464f25={'where':_0x2f5499[_0x0d84('0x3c')]};return db['CmCompany'][_0x0d84('0x1f')](_0x464f25)[_0x0d84('0x25')](function(_0x2e8c1b){_0x4b36f['count']=_0x2e8c1b;if(_0x5d7967[_0x0d84('0x31')][_0x0d84('0x3f')]){_0x2f5499[_0x0d84('0x40')]=[{'all':!![]}];}return db[_0x0d84('0x2d')][_0x0d84('0x41')](_0x2f5499);})['then'](function(_0x272a73){_0x4b36f[_0x0d84('0x42')]=_0x272a73;return _0x4b36f;})[_0x0d84('0x25')](respondWithFilteredResult(_0x2fb903,_0x2f5499))[_0x0d84('0x43')](handleError(_0x2fb903,null));})[_0x0d84('0x43')](handleError(_0x2fb903,null));};exports[_0x0d84('0x44')]=function(_0x1e88db,_0x401b3e){var _0x1365ef={'raw':![],'where':{'id':_0x1e88db[_0x0d84('0x45')]['id']}},_0x496f89={};_0x496f89[_0x0d84('0x2f')]=_[_0x0d84('0x30')](db['CmCompany'][_0x0d84('0x46')]);_0x496f89[_0x0d84('0x31')]=_[_0x0d84('0x30')](_0x1e88db[_0x0d84('0x31')]);_0x496f89['filters']=_['intersection'](_0x496f89['model'],_0x496f89['query']);_0x1365ef[_0x0d84('0x35')]=_['intersection'](_0x496f89['model'],qs[_0x0d84('0x34')](_0x1e88db[_0x0d84('0x31')][_0x0d84('0x34')]));_0x1365ef['attributes']=_0x1365ef[_0x0d84('0x35')][_0x0d84('0x36')]?_0x1365ef[_0x0d84('0x35')]:_0x496f89[_0x0d84('0x2f')];if(_0x1e88db[_0x0d84('0x31')]['includeAll']){_0x1365ef[_0x0d84('0x40')]=[{'all':!![]}];}_0x1365ef=_[_0x0d84('0x3d')]({},_0x1365ef,_0x1e88db[_0x0d84('0x3e')]);return db[_0x0d84('0x2d')][_0x0d84('0x47')](_0x1365ef)[_0x0d84('0x25')](handleEntityNotFound(_0x401b3e,null))['then'](respondWithResult(_0x401b3e,null))[_0x0d84('0x43')](handleError(_0x401b3e,null));};exports[_0x0d84('0x48')]=function(_0x4a1efc,_0x4cf914){return db[_0x0d84('0x2d')][_0x0d84('0x48')](_0x4a1efc[_0x0d84('0x49')],{})[_0x0d84('0x25')](function(_0x29c3ee){var _0x3ddac0=_0x4a1efc['user']['get']({'plain':!![]});if(!_0x3ddac0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3ddac0['role']==='user'){var _0x61024d=_0x29c3ee[_0x0d84('0x4a')]({'plain':!![]});var _0x49109e=_0x0d84('0x26');return db[_0x0d84('0x4b')]['find']({'where':{'name':_0x49109e,'userProfileId':_0x3ddac0[_0x0d84('0x4c')]},'raw':!![]})[_0x0d84('0x25')](function(_0x17adec){if(_0x17adec&&_0x17adec[_0x0d84('0x4d')]===0x0){return db['UserProfileResource'][_0x0d84('0x48')]({'name':_0x61024d[_0x0d84('0x2b')],'resourceId':_0x61024d['id'],'type':_0x17adec[_0x0d84('0x2b')],'sectionId':_0x17adec['id']},{})[_0x0d84('0x25')](function(){return _0x29c3ee;});}else{return _0x29c3ee;}})[_0x0d84('0x43')](function(_0x2356b7){logger[_0x0d84('0x4e')](_0x0d84('0x4f'),_0x2356b7);throw _0x2356b7;});}return _0x29c3ee;})[_0x0d84('0x25')](respondWithResult(_0x4cf914,0xc9))[_0x0d84('0x43')](handleError(_0x4cf914,null));};exports[_0x0d84('0x24')]=function(_0x5d3de2,_0x5b1f80){if(_0x5d3de2[_0x0d84('0x49')]['id']){delete _0x5d3de2[_0x0d84('0x49')]['id'];}return db[_0x0d84('0x2d')][_0x0d84('0x47')]({'where':{'id':_0x5d3de2[_0x0d84('0x45')]['id']}})[_0x0d84('0x25')](handleEntityNotFound(_0x5b1f80,null))['then'](saveUpdates(_0x5d3de2[_0x0d84('0x49')],null))[_0x0d84('0x25')](respondWithResult(_0x5b1f80,null))[_0x0d84('0x43')](handleError(_0x5b1f80,null));};exports['destroy']=function(_0x114e7c,_0x4fd2bd){return db['CmCompany'][_0x0d84('0x47')]({'where':{'id':_0x114e7c[_0x0d84('0x45')]['id']}})['then'](handleEntityNotFound(_0x4fd2bd,null))['then'](removeEntity(_0x4fd2bd,null))[_0x0d84('0x43')](handleError(_0x4fd2bd,null));};exports[_0x0d84('0x2e')]=function(_0x1d12c8,_0x5f4482){return db['CmCompany'][_0x0d84('0x2e')]()['then'](respondWithResult(_0x5f4482,null))['catch'](handleError(_0x5f4482,null));};exports[_0x0d84('0x50')]=function(_0x510b28,_0x4257b4,_0x2b4ad9){return db[_0x0d84('0x51')]['find']({'where':{'id':_0x510b28[_0x0d84('0x45')]['id']}})[_0x0d84('0x25')](handleEntityNotFound(_0x4257b4,null))['then'](function(_0x5ca976){if(_0x5ca976){return _0x5ca976[_0x0d84('0x50')](_0x510b28['body'][_0x0d84('0x52')],_[_0x0d84('0x53')](_0x510b28[_0x0d84('0x49')],['ids','id'])||{});}})[_0x0d84('0x25')](respondWithResult(_0x4257b4,null))[_0x0d84('0x43')](handleError(_0x4257b4,null));};exports[_0x0d84('0x54')]=function(_0xbe1468,_0x6f5977,_0x10588b){var _0x507ce5={};var _0x756e64={};var _0xb5a29;var _0x4b6e2e;return db['CmCompany'][_0x0d84('0x55')]({'where':{'id':_0xbe1468[_0x0d84('0x45')]['id']}})['then'](handleEntityNotFound(_0x6f5977,null))[_0x0d84('0x25')](function(_0x5afc14){if(_0x5afc14){_0xb5a29=_0x5afc14;_0x756e64[_0x0d84('0x2f')]=_['keys'](db['CmContact']['rawAttributes']);_0x756e64[_0x0d84('0x31')]=_[_0x0d84('0x30')](_0xbe1468[_0x0d84('0x31')]);_0x756e64[_0x0d84('0x32')]=_[_0x0d84('0x33')](_0x756e64[_0x0d84('0x2f')],_0x756e64[_0x0d84('0x31')]);_0x507ce5[_0x0d84('0x35')]=_[_0x0d84('0x33')](_0x756e64['model'],qs[_0x0d84('0x34')](_0xbe1468[_0x0d84('0x31')][_0x0d84('0x34')]));_0x507ce5[_0x0d84('0x35')]=_0x507ce5[_0x0d84('0x35')]['length']?_0x507ce5[_0x0d84('0x35')]:_0x756e64[_0x0d84('0x2f')];_0x507ce5[_0x0d84('0x56')]=qs[_0x0d84('0x39')](_0xbe1468[_0x0d84('0x31')][_0x0d84('0x39')]);_0x507ce5[_0x0d84('0x3c')]=qs[_0x0d84('0x32')](_[_0x0d84('0x3a')](_0xbe1468[_0x0d84('0x31')],_0x756e64[_0x0d84('0x32')]));if(_0xbe1468[_0x0d84('0x31')][_0x0d84('0x3b')]){_0x507ce5['where']=_[_0x0d84('0x3d')](_0x507ce5[_0x0d84('0x3c')],{'$or':_[_0x0d84('0x57')](_0x507ce5[_0x0d84('0x35')],function(_0x46b3a8){var _0x472945={};_0x472945[_0x46b3a8]={'$like':'%'+_0xbe1468['query'][_0x0d84('0x3b')]+'%'};return _0x472945;})});}_0x507ce5=_['merge']({},_0x507ce5,_0xbe1468[_0x0d84('0x3e')]);return _0xb5a29[_0x0d84('0x54')](_0x507ce5);}})['then'](function(_0x3a8eb4){if(_0x3a8eb4){_0x4b6e2e=_0x3a8eb4[_0x0d84('0x36')];if(!_0xbe1468[_0x0d84('0x31')]['hasOwnProperty'](_0x0d84('0x58'))){_0x507ce5[_0x0d84('0x38')]=qs[_0x0d84('0x38')](_0xbe1468[_0x0d84('0x31')][_0x0d84('0x38')]);_0x507ce5[_0x0d84('0x1d')]=qs['offset'](_0xbe1468[_0x0d84('0x31')][_0x0d84('0x1d')]);}return _0xb5a29['getContacts'](_0x507ce5);}})[_0x0d84('0x25')](function(_0xbc4e54){if(_0xbc4e54){return _0xbc4e54?{'count':_0x4b6e2e,'rows':_0xbc4e54}:null;}})[_0x0d84('0x25')](respondWithResult(_0x6f5977,null))[_0x0d84('0x43')](handleError(_0x6f5977,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 1572675..4ae2b03 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 _0x6932=['api','moment','bluebird','path','../../config/environment','./cmCompany.attributes','define','CmCompany','cm_companies','lodash','../../config/logger'];(function(_0x4c3fa1,_0x13f193){var _0x6f73be=function(_0x3802be){while(--_0x3802be){_0x4c3fa1['push'](_0x4c3fa1['shift']());}};_0x6f73be(++_0x13f193);}(_0x6932,0x132));var _0x2693=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x6932[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0x2693('0x0'));var util=require('util');var logger=require(_0x2693('0x1'))(_0x2693('0x2'));var moment=require(_0x2693('0x3'));var BPromise=require(_0x2693('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2693('0x5'));var rimraf=require('rimraf');var config=require(_0x2693('0x6'));var attributes=require(_0x2693('0x7'));module['exports']=function(_0x2ca330,_0x4f45ba){return _0x2ca330[_0x2693('0x8')](_0x2693('0x9'),attributes,{'tableName':_0x2693('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd887=['exports','define','cm_companies','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes'];(function(_0x35f591,_0x4f401c){var _0x5ade4f=function(_0x1a4fc2){while(--_0x1a4fc2){_0x35f591['push'](_0x35f591['shift']());}};_0x5ade4f(++_0x4f401c);}(_0xd887,0x177));var _0x7d88=function(_0x4dbdc3,_0x5a525d){_0x4dbdc3=_0x4dbdc3-0x0;var _0x1765ad=_0xd887[_0x4dbdc3];return _0x1765ad;};'use strict';var _=require(_0x7d88('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7d88('0x1'));var moment=require(_0x7d88('0x2'));var BPromise=require(_0x7d88('0x3'));var rp=require(_0x7d88('0x4'));var fs=require('fs');var path=require(_0x7d88('0x5'));var rimraf=require(_0x7d88('0x6'));var config=require(_0x7d88('0x7'));var attributes=require(_0x7d88('0x8'));module[_0x7d88('0x9')]=function(_0xf8e042,_0x573edf){return _0xf8e042[_0x7d88('0xa')]('CmCompany',attributes,{'tableName':_0x7d88('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js
index 9fcb3cc..cda4e86 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 _0xc063=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird'];(function(_0x34f7bb,_0x547eb3){var _0x2efee3=function(_0x1fc766){while(--_0x1fc766){_0x34f7bb['push'](_0x34f7bb['shift']());}};_0x2efee3(++_0x547eb3);}(_0xc063,0x172));var _0x3c06=function(_0x539eb6,_0x3843f8){_0x539eb6=_0x539eb6-0x0;var _0x2e3478=_0xc063[_0x539eb6];return _0x2e3478;};'use strict';var _=require(_0x3c06('0x0'));var util=require(_0x3c06('0x1'));var moment=require(_0x3c06('0x2'));var BPromise=require(_0x3c06('0x3'));var rs=require(_0x3c06('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3c06('0x5'))['db'];var utils=require(_0x3c06('0x6'));var logger=require(_0x3c06('0x7'))(_0x3c06('0x8'));var config=require(_0x3c06('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3c06('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a0d8a,_0x24c46b,_0x5ee827){return new BPromise(function(_0x545cdd,_0x1f7abc){return client['request'](_0x5a0d8a,_0x5ee827)[_0x3c06('0xb')](function(_0x572a62){logger[_0x3c06('0xc')](_0x3c06('0xd'),_0x24c46b,_0x3c06('0xe'));logger[_0x3c06('0xf')](_0x3c06('0x10'),_0x24c46b,_0x3c06('0xe'),JSON[_0x3c06('0x11')](_0x572a62));if(_0x572a62[_0x3c06('0x12')]){if(_0x572a62[_0x3c06('0x12')][_0x3c06('0x13')]===0x1f4){logger[_0x3c06('0x12')](_0x3c06('0xd'),_0x24c46b,_0x572a62['error']['message']);return _0x1f7abc(_0x572a62[_0x3c06('0x12')]['message']);}logger['error'](_0x3c06('0xd'),_0x24c46b,_0x572a62[_0x3c06('0x12')][_0x3c06('0x14')]);return _0x545cdd(_0x572a62['error'][_0x3c06('0x14')]);}else{logger[_0x3c06('0xc')]('CmCompany,\x20%s,\x20%s',_0x24c46b,'request\x20sent');_0x545cdd(_0x572a62[_0x3c06('0x15')][_0x3c06('0x14')]);}})['catch'](function(_0x123575){logger[_0x3c06('0x12')](_0x3c06('0xd'),_0x24c46b,_0x123575);_0x1f7abc(_0x123575);});});}
\ No newline at end of file
+var _0x2274=['CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','then','info','CmCompany,\x20%s,\x20%s','request\x20sent'];(function(_0x109b16,_0x255826){var _0x4e47a4=function(_0x1a4a8f){while(--_0x1a4a8f){_0x109b16['push'](_0x109b16['shift']());}};_0x4e47a4(++_0x255826);}(_0x2274,0x16b));var _0x4227=function(_0x4164ff,_0x2e9593){_0x4164ff=_0x4164ff-0x0;var _0x226d47=_0x2274[_0x4164ff];return _0x226d47;};'use strict';var _=require(_0x4227('0x0'));var util=require(_0x4227('0x1'));var moment=require(_0x4227('0x2'));var BPromise=require(_0x4227('0x3'));var rs=require(_0x4227('0x4'));var fs=require('fs');var Redis=require(_0x4227('0x5'));var db=require(_0x4227('0x6'))['db'];var utils=require(_0x4227('0x7'));var logger=require('../../config/logger')(_0x4227('0x8'));var config=require(_0x4227('0x9'));var jayson=require(_0x4227('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x209752,_0x58a018,_0x1c6527){return new BPromise(function(_0x51498b,_0x274b78){return client['request'](_0x209752,_0x1c6527)[_0x4227('0xb')](function(_0x44e8ef){logger[_0x4227('0xc')](_0x4227('0xd'),_0x58a018,_0x4227('0xe'));logger['debug'](_0x4227('0xf'),_0x58a018,_0x4227('0xe'),JSON[_0x4227('0x10')](_0x44e8ef));if(_0x44e8ef[_0x4227('0x11')]){if(_0x44e8ef[_0x4227('0x11')][_0x4227('0x12')]===0x1f4){logger[_0x4227('0x11')](_0x4227('0xd'),_0x58a018,_0x44e8ef[_0x4227('0x11')]['message']);return _0x274b78(_0x44e8ef[_0x4227('0x11')][_0x4227('0x13')]);}logger[_0x4227('0x11')](_0x4227('0xd'),_0x58a018,_0x44e8ef['error']['message']);return _0x51498b(_0x44e8ef['error']['message']);}else{logger[_0x4227('0xc')](_0x4227('0xd'),_0x58a018,_0x4227('0xe'));_0x51498b(_0x44e8ef['result'][_0x4227('0x13')]);}})[_0x4227('0x14')](function(_0x507864){logger[_0x4227('0x11')](_0x4227('0xd'),_0x58a018,_0x507864);_0x274b78(_0x507864);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index a06c4da..2589c0d 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 _0xaf8d=['getContacts','post','create','put','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/contacts'];(function(_0x2002a6,_0x2b870f){var _0x5e605e=function(_0x270382){while(--_0x270382){_0x2002a6['push'](_0x2002a6['shift']());}};_0x5e605e(++_0x2b870f);}(_0xaf8d,0x1d4));var _0xdaf8=function(_0x50248c,_0x1f7c71){_0x50248c=_0x50248c-0x0;var _0x20094f=_0xaf8d[_0x50248c];return _0x20094f;};'use strict';var multer=require(_0xdaf8('0x0'));var util=require(_0xdaf8('0x1'));var path=require(_0xdaf8('0x2'));var timeout=require(_0xdaf8('0x3'));var express=require(_0xdaf8('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xdaf8('0x5'));var interaction=require(_0xdaf8('0x6'));var config=require(_0xdaf8('0x7'));var controller=require('./cmCompany.controller');router[_0xdaf8('0x8')]('/',auth[_0xdaf8('0x9')](),controller[_0xdaf8('0xa')]);router[_0xdaf8('0x8')](_0xdaf8('0xb'),auth[_0xdaf8('0x9')](),controller[_0xdaf8('0xc')]);router['get'](_0xdaf8('0xd'),auth[_0xdaf8('0x9')](),controller[_0xdaf8('0xe')]);router['get'](_0xdaf8('0xf'),auth[_0xdaf8('0x9')](),controller[_0xdaf8('0x10')]);router[_0xdaf8('0x11')]('/',auth[_0xdaf8('0x9')](),controller[_0xdaf8('0x12')]);router['post']('/:id/contacts',auth[_0xdaf8('0x9')](),controller['addContacts']);router[_0xdaf8('0x13')](_0xdaf8('0xd'),auth[_0xdaf8('0x9')](),controller['update']);router['delete'](_0xdaf8('0xd'),auth['isAuthenticated'](),controller[_0xdaf8('0x14')]);module[_0xdaf8('0x15')]=router;
\ No newline at end of file
+var _0x532c=['/:id/contacts','post','create','addContacts','update','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','describe','/:id','isAuthenticated','show'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x532c,0xbb));var _0xc532=function(_0xe6f4dc,_0x4bd94a){_0xe6f4dc=_0xe6f4dc-0x0;var _0x1e9ede=_0x532c[_0xe6f4dc];return _0x1e9ede;};'use strict';var multer=require(_0xc532('0x0'));var util=require(_0xc532('0x1'));var path=require('path');var timeout=require(_0xc532('0x2'));var express=require(_0xc532('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc532('0x4'));var interaction=require(_0xc532('0x5'));var config=require(_0xc532('0x6'));var controller=require(_0xc532('0x7'));router[_0xc532('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0xc532('0x9')]);router[_0xc532('0x8')](_0xc532('0xa'),auth[_0xc532('0xb')](),controller[_0xc532('0xc')]);router[_0xc532('0x8')](_0xc532('0xd'),auth[_0xc532('0xb')](),controller['getContacts']);router[_0xc532('0xe')]('/',auth['isAuthenticated'](),controller[_0xc532('0xf')]);router[_0xc532('0xe')](_0xc532('0xd'),auth[_0xc532('0xb')](),controller[_0xc532('0x10')]);router['put'](_0xc532('0xa'),auth[_0xc532('0xb')](),controller[_0xc532('0x11')]);router['delete'](_0xc532('0xa'),auth['isAuthenticated'](),controller[_0xc532('0x12')]);module[_0xc532('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 81e89f8..ddd24c2 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 _0xb690=['sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xb690,0x1af));var _0x0b69=function(_0x183256,_0x1a596d){_0x183256=_0x183256-0x0;var _0x5394a2=_0xb690[_0x183256];return _0x5394a2;};'use strict';var _=require(_0x0b69('0x0'));var Sequelize=require(_0x0b69('0x1'));module[_0x0b69('0x2')]={'firstName':{'type':Sequelize[_0x0b69('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x0b69('0x3')]},'street':{'type':Sequelize[_0x0b69('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x0b69('0x3')]},'dateOfBirth':{'type':Sequelize[_0x0b69('0x3')]},'description':{'type':Sequelize[_0x0b69('0x4')]},'phone':{'type':Sequelize[_0x0b69('0x3')]},'mobile':{'type':Sequelize[_0x0b69('0x3')]},'fax':{'type':Sequelize[_0x0b69('0x3')]},'email':{'type':Sequelize[_0x0b69('0x3')]},'url':{'type':Sequelize[_0x0b69('0x3')]},'facebook':{'type':Sequelize[_0x0b69('0x3')]},'fb_data':{'type':Sequelize[_0x0b69('0x3')]},'twitter':{'type':Sequelize[_0x0b69('0x3')]},'skype':{'type':Sequelize[_0x0b69('0x3')]},'teams':{'type':Sequelize[_0x0b69('0x3')]},'viber':{'type':Sequelize[_0x0b69('0x3')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x0b69('0x3')]},'telegram':{'type':Sequelize[_0x0b69('0x3')]},'UserId':{'type':Sequelize[_0x0b69('0x5')]},'AdditionalPhones':{'type':Sequelize[_0x0b69('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x0b69('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x0b69('0x7')],'defaultValue':Sequelize[_0x0b69('0x8')]},'dialTimezone':{'type':Sequelize[_0x0b69('0x3')]},'utcOffset':{'type':Sequelize[_0x0b69('0x5')]}};
\ No newline at end of file
+var _0xc6cb=['sequelize','exports','STRING','TEXT','INTEGER','NOW'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0xc6cb,0xc6));var _0xbc6c=function(_0x547a87,_0x4d4e24){_0x547a87=_0x547a87-0x0;var _0x11fde1=_0xc6cb[_0x547a87];return _0x11fde1;};'use strict';var _=require('lodash');var Sequelize=require(_0xbc6c('0x0'));module[_0xbc6c('0x1')]={'firstName':{'type':Sequelize[_0xbc6c('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xbc6c('0x2')]},'street':{'type':Sequelize[_0xbc6c('0x2')]},'postalCode':{'type':Sequelize[_0xbc6c('0x2')]},'city':{'type':Sequelize[_0xbc6c('0x2')]},'country':{'type':Sequelize[_0xbc6c('0x2')]},'dateOfBirth':{'type':Sequelize[_0xbc6c('0x2')]},'description':{'type':Sequelize[_0xbc6c('0x3')]},'phone':{'type':Sequelize[_0xbc6c('0x2')]},'mobile':{'type':Sequelize[_0xbc6c('0x2')]},'fax':{'type':Sequelize[_0xbc6c('0x2')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0xbc6c('0x2')]},'facebook':{'type':Sequelize[_0xbc6c('0x2')]},'fb_data':{'type':Sequelize[_0xbc6c('0x2')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0xbc6c('0x2')]},'teams':{'type':Sequelize[_0xbc6c('0x2')]},'viber':{'type':Sequelize[_0xbc6c('0x2')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0xbc6c('0x4')]},'AdditionalPhones':{'type':Sequelize[_0xbc6c('0x2')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0xbc6c('0x5')]},'dialTimezone':{'type':Sequelize[_0xbc6c('0x2')]},'utcOffset':{'type':Sequelize[_0xbc6c('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index ffdf8ed..1c47c58 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 _0xc9ac=['sms','openchannel','whatsapp','-createdAt','resolve','channel','includes','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','voice','uniqueid','source','destination','callerid','starttime','userSecondDisposition','userThirdDisposition','UserId','alias','createdAt','DESC','findAndCountAll','fullname','startCase','chat','Website','Account','closed','closedAt','note','secondDisposition','key','Owner','color','browserName','customerIp','customerPort','deviceModel','ratingMessage','ratingType','ratingValue','referer','subject','Interaction','flatten','sortBy','reverse','value','slice','moment','bluebird','util','path','papaparse','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','../../config/environment/shared','../../mysqldb','redis','defaults','./cmContact.socket','status','offset','undefined','count','set','json','update','then','end','sendStatus','error','stack','name','send','getOptions','findAll','query','user','CmContact','describe','tags','keys','cf_','columnName','CmCustomField','length','displayName','custom','type','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','hasOwnProperty','catch','merge','body','from','get','isArray','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','destroy','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','create','ChatMessage','MailInteraction','MailMessage','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','SmsQueueReport','WhatsappQueueReport','isNil','dialTimezone','timezones','utcOffset','additionalPhones','each','duplicates','where','$or','push','ListId','spread','contact','all','show','find','params','Tags','CmContactHasItem','ItemType','sequelize','Phones.OrderBy','cf_%d','$and','omit','pickBy','startsWith','map','format','isEmpty','table','cm_contacts','id\x20=\x20?','toParam','values','phone','getTags','findOne','model','Tag','rawAttributes','filters','intersection','fields','attributes','order','sort','pick','filter','options','limit','setTags','ids','setAdditionalPhones','ContactItemType','OrderBy','items','item_types','ItemTypeId','contact\x20phone\x20exists','item','literal','`ItemType`.OrderBy','CmHopperId','CmHopperAdditionalPhone','bulkCreate','getAdditionalPhones','duplicateAdditionalPhones','fromContactId','toContactId','rescheduleAdditionalPhones','hopperId','nolimit','ContactId','includeAll','include','rows','getHopperHistories','getJscriptySessions','JscriptySessionReport','uploadCsv','binding_keys','No\x20association\x20keys\x20specified!','binding_values','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','server/files/tmp','file','filename','0777','child_process','../../components/import/cm/csv','CompanyId','socket_timestamp','File\x20uploaded\x20correctly!','createReadStream','parse','import','User','agent','No\x20ListId\x20specified','binding','fork','stringify','message','start\x20child\x20process\x20correctly!','pid','exit','error\x20child\x20process','importUpdates','../../components/import/cm/csvUpdates','getJourney'];(function(_0x40911a,_0x55ec99){var _0x27e8e3=function(_0x2ba910){while(--_0x2ba910){_0x40911a['push'](_0x40911a['shift']());}};_0x27e8e3(++_0x55ec99);}(_0xc9ac,0x129));var _0xcc9a=function(_0x499210,_0x325b29){_0x499210=_0x499210-0x0;var _0x2e153d=_0xc9ac[_0x499210];return _0x2e153d;};'use strict';var moment=require(_0xcc9a('0x0'));var BPromise=require(_0xcc9a('0x1'));var util=require(_0xcc9a('0x2'));var path=require(_0xcc9a('0x3'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var Papa=require(_0xcc9a('0x4'));var Redis=require(_0xcc9a('0x5'));var contacts=require(_0xcc9a('0x6'));var qs=require(_0xcc9a('0x7'));var logger=require(_0xcc9a('0x8'))('api');var config=require('../../config/environment');var shared=require(_0xcc9a('0x9'));var db=require(_0xcc9a('0xa'))['db'];config[_0xcc9a('0xb')]=_[_0xcc9a('0xc')](config[_0xcc9a('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xcc9a('0xd'))['register'](socket);function respondWithResult(_0x2fa5e8,_0x22ce6c){_0x22ce6c=_0x22ce6c||0xc8;return function(_0x37a2b5){if(_0x37a2b5){return _0x2fa5e8[_0xcc9a('0xe')](_0x22ce6c)['json'](_0x37a2b5);}};}function respondWithFilteredResult(_0x8d133f,_0x46927b){return function(_0x595258){if(_0x595258){var _0x3a22f8=typeof _0x46927b[_0xcc9a('0xf')]===_0xcc9a('0x10')&&typeof _0x46927b['limit']===_0xcc9a('0x10');var _0x2d0ab1=_0x595258[_0xcc9a('0x11')];var _0x234c92=_0x3a22f8?0x0:_0x46927b[_0xcc9a('0xf')];var _0xcc13e4=_0x3a22f8?_0x595258['count']:_0x46927b[_0xcc9a('0xf')]+_0x46927b['limit'];var _0x129f17;if(_0xcc13e4>=_0x2d0ab1){_0xcc13e4=_0x2d0ab1;_0x129f17=0xc8;}else{_0x129f17=0xce;}_0x8d133f[_0xcc9a('0xe')](_0x129f17);return _0x8d133f[_0xcc9a('0x12')]('Content-Range',_0x234c92+'-'+_0xcc13e4+'/'+_0x2d0ab1)[_0xcc9a('0x13')](_0x595258);}return null;};}function saveUpdates(_0x38c374){return function(_0x3bce33){if(_0x3bce33){return _0x3bce33[_0xcc9a('0x14')](_0x38c374)[_0xcc9a('0x15')](function(_0x52961a){return _0x52961a;});}return null;};}function removeEntity(_0x3a92b6){return function(_0x1277e9){if(_0x1277e9){return _0x1277e9['destroy']()['then'](function(){_0x3a92b6[_0xcc9a('0xe')](0xcc)[_0xcc9a('0x16')]();});}};}function handleEntityNotFound(_0x29ccbf){return function(_0x5efd87){if(!_0x5efd87){_0x29ccbf[_0xcc9a('0x17')](0x194);}return _0x5efd87;};}function handleError(_0x35ce5e,_0x4d8e91){_0x4d8e91=_0x4d8e91||0x1f4;return function(_0x142f85){logger[_0xcc9a('0x18')](_0x142f85[_0xcc9a('0x19')]);if(_0x142f85[_0xcc9a('0x1a')]){delete _0x142f85[_0xcc9a('0x1a')];}_0x35ce5e[_0xcc9a('0xe')](_0x4d8e91)[_0xcc9a('0x1b')](_0x142f85);};}exports['index']=function(_0x3aa33d,_0x20916b){var _0x34768b={};return contacts['describe']()[_0xcc9a('0x15')](function(_0x5ec790){_0x34768b=qs[_0xcc9a('0x1c')](_0x5ec790,_0x3aa33d);return contacts[_0xcc9a('0x1d')](_0x3aa33d[_0xcc9a('0x1e')],_0x3aa33d[_0xcc9a('0x1f')],_0x34768b,_0x5ec790);})[_0xcc9a('0x15')](respondWithFilteredResult(_0x20916b,_0x34768b))['catch'](handleError(_0x20916b,null));};exports['destroy']=function(_0x248402,_0x4a216d){return db[_0xcc9a('0x20')]['find']({'where':{'id':_0x248402['params']['id']}})[_0xcc9a('0x15')](handleEntityNotFound(_0x4a216d,null))[_0xcc9a('0x15')](removeEntity(_0x4a216d,null))['catch'](handleError(_0x4a216d,null));};exports['describe']=function(_0x513021,_0x3defba){return db['CmContact'][_0xcc9a('0x21')]()[_0xcc9a('0x15')](function(_0xcde81e){delete _0xcde81e[_0xcc9a('0x22')];for(var _0x5e5287=0x0;_0x5e5287
','generateXOAuth2Token','user=','auth=Bearer\x20','join','utf-8','toString','base64','lodash','moment','randomstring','path','../../../config/logger','email','value'];(function(_0x4b55e8,_0x41ba7e){var _0x46e844=function(_0x2b1e4f){while(--_0x2b1e4f){_0x4b55e8['push'](_0x4b55e8['shift']());}};_0x46e844(++_0x41ba7e);}(_0x4139,0x121));var _0x9413=function(_0x2306fb,_0x4b1726){_0x2306fb=_0x2306fb-0x0;var _0x1e035f=_0x4139[_0x2306fb];return _0x1e035f;};'use strict';var _=require(_0x9413('0x0'));var moment=require(_0x9413('0x1'));var random=require(_0x9413('0x2'));var fs=require('fs');var path=require(_0x9413('0x3'));var util=require('util');var tnef=require('node-tnef');var logger=require(_0x9413('0x4'))(_0x9413('0x5'));var config=require('../../../config/environment');function getAddress(_0x3d390d){var _0x33219b=_['head'](_0x3d390d[_0x9413('0x6')]);return _0x33219b&&_0x33219b['address']?_0x33219b[_0x9413('0x7')]:_0x9413('0x8')+random[_0x9413('0x9')](0x6)+_0x9413('0xa');}function getFirstName(_0x3255a2){var _0x1c57d8=_['head'](_0x3255a2[_0x9413('0x6')]);if(_0x1c57d8&&_0x1c57d8[_0x9413('0xb')]){if(_0x1c57d8['name']==_0x1c57d8[_0x9413('0x7')]){return _0x1c57d8[_0x9413('0xb')][_0x9413('0xc')](0x0,_0x1c57d8['name']['indexOf']('@'));}var _0x4e49b2=_0x1c57d8[_0x9413('0xb')]['split'](/\s+/);return _0x4e49b2[_0x9413('0xd')]>0x1?_0x4e49b2[_0x9413('0xe')](0x0,-0x1)['join']('\x20'):_0x1c57d8[_0x9413('0xb')];}return'Anonymous';}function getLastName(_0x482a8b){var _0x1dd208=_[_0x9413('0xf')](_0x482a8b['value']);if(_0x1dd208&&_0x1dd208['name']){var _0x4ac332=_0x1dd208[_0x9413('0xb')][_0x9413('0x10')](/\s+/);return _0x4ac332[_0x9413('0xd')]>0x1?_0x4ac332[_0x9413('0x11')]():'';}return'';}function getMails(_0x1edf23,_0x2d4568){var _0x4f83ea='';for(var _0x5e9427=0x0;_0x5e9427<_0x2d4568[_0x9413('0x6')]['length'];_0x5e9427+=0x1){if(_0x2d4568[_0x9413('0x6')][_0x5e9427][_0x9413('0x7')]!==_0x1edf23){if(!_['isEmpty'](_0x4f83ea)){_0x4f83ea+=',';}_0x4f83ea+=_0x2d4568[_0x9413('0x6')][_0x5e9427][_0x9413('0xb')]||_0x2d4568[_0x9413('0x6')][_0x5e9427][_0x9413('0x7')]||'';_0x4f83ea+='\x20<';_0x4f83ea+=_0x2d4568['value'][_0x5e9427][_0x9413('0x7')]?_0x2d4568[_0x9413('0x6')][_0x5e9427][_0x9413('0x7')]:_0x9413('0x8')+random['generate'](0x6)+'@xcally.com';_0x4f83ea+='>';}}return _0x4f83ea;}function parseEmail(_0xb2ae8c,_0x3e13b0,_0x4d1ce4){if(_0x3e13b0[_0x9413('0x12')]){var _0x256318=/