From: support
Date: Fri, 5 Aug 2022 14:55:20 +0000 (+0000)
Subject: Built motion from commit f296b652.|2.6.15
X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css//%22?a=commitdiff_plain;h=4d378eba7823715e202489f5fb76c11949e4d526;p=motion2.git
Built motion from commit f296b652.|2.6.15
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 93d4309..fa6b94f 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-08-05T14:31:26.768Z",
+ "time": "2022-08-05T14:47:37.431Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 6062e3b..d77469f 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-08-05T14:31:26.768Z",
+ "time": "2022-08-05T14:47:37.431Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js
index 306a599..7f16194 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 _0xc613=['integration','jscripty','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','sequelize','action','STRING'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xc613,0x115));var _0x3c61=function(_0x40b22f,_0x446b2b){_0x40b22f=_0x40b22f-0x0;var _0x1d42e7=_0xc613[_0x40b22f];return _0x1d42e7;};'use strict';var Sequelize=require(_0x3c61('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5cb0b3){return this['getDataValue'](_0x3c61('0x1'));}},'action':{'type':Sequelize[_0x3c61('0x2')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x3c61('0x3'),'motionbar',_0x3c61('0x4'),'urlForward',_0x3c61('0x5'),'bot',_0x3c61('0x6')]],'msg':_0x3c61('0x7')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x3c61('0x8')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x3c61('0x9')},'data3':{'type':Sequelize[_0x3c61('0x2')](0x1000),'comment':_0x3c61('0xa')},'data4':{'type':Sequelize[_0x3c61('0x2')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x3c61('0x2')](0x1000),'comments':_0x3c61('0xb')},'data6':{'type':Sequelize[_0x3c61('0x2')],'comments':_0x3c61('0xc')},'data7':{'type':Sequelize['TEXT'],'comments':_0x3c61('0xd')}};
\ No newline at end of file
+var _0xf143=['action','STRING','contactManager','motionbar','jscripty','browser','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','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[headers],\x20browser[wsindowHeight]','TEXT','VIRTUAL','getDataValue'];(function(_0x14f386,_0x201f09){var _0x3c46a1=function(_0x320d87){while(--_0x320d87){_0x14f386['push'](_0x14f386['shift']());}};_0x3c46a1(++_0x201f09);}(_0xf143,0x12a));var _0x3f14=function(_0x2be004,_0x7393c3){_0x2be004=_0x2be004-0x0;var _0x1722ea=_0xf143[_0x2be004];return _0x1722ea;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3f14('0x0')],'get':function(_0x5969b5){return this[_0x3f14('0x1')](_0x3f14('0x2'));}},'action':{'type':Sequelize[_0x3f14('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x3f14('0x4'),'integration',_0x3f14('0x5'),_0x3f14('0x6'),'urlForward',_0x3f14('0x7'),_0x3f14('0x8'),'script']],'msg':_0x3f14('0x9')}},'comment':_0x3f14('0x9')},'data1':{'type':Sequelize[_0x3f14('0x3')](0x1000),'comment':_0x3f14('0xa')},'data2':{'type':Sequelize[_0x3f14('0x3')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x3f14('0xb')},'data4':{'type':Sequelize[_0x3f14('0x3')](0x1000),'comments':_0x3f14('0xc')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x3f14('0x3')],'comments':_0x3f14('0xd')},'data7':{'type':Sequelize[_0x3f14('0xe')],'comments':'urlForward[body]'}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 3c356a8..ec2006c 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 _0x6a18=['stack','name','send','Action','find','body','catch','params','eml-format','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../mysqldb','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6a18,0xb8));var _0x86a1=function(_0x2a2dc5,_0x41d63c){_0x2a2dc5=_0x2a2dc5-0x0;var _0x3d8e98=_0x6a18[_0x2a2dc5];return _0x3d8e98;};'use strict';var emlformat=require(_0x86a1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x86a1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x86a1('0x2'));var moment=require(_0x86a1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x86a1('0x4'));var util=require(_0x86a1('0x5'));var path=require('path');var sox=require(_0x86a1('0x6'));var csv=require(_0x86a1('0x7'));var ejs=require(_0x86a1('0x8'));var fs=require('fs');var fs_extra=require(_0x86a1('0x9'));var _=require(_0x86a1('0xa'));var squel=require(_0x86a1('0xb'));var crypto=require('crypto');var jsforce=require(_0x86a1('0xc'));var deskjs=require(_0x86a1('0xd'));var toCsv=require(_0x86a1('0x7'));var querystring=require(_0x86a1('0xe'));var Papa=require(_0x86a1('0xf'));var Redis=require(_0x86a1('0x10'));var authService=require(_0x86a1('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x86a1('0x12'));var logger=require('../../config/logger')(_0x86a1('0x13'));var utils=require(_0x86a1('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x86a1('0x15'))['db'];function respondWithStatusCode(_0x2d4fb6,_0x158dc8){_0x158dc8=_0x158dc8||0xcc;return function(_0x5bc1eb){if(_0x5bc1eb){return _0x2d4fb6['sendStatus'](_0x158dc8);}return _0x2d4fb6[_0x86a1('0x16')](_0x158dc8)['end']();};}function respondWithResult(_0x2bd513,_0x144bb8){_0x144bb8=_0x144bb8||0xc8;return function(_0x1a7ecd){if(_0x1a7ecd){return _0x2bd513['status'](_0x144bb8)[_0x86a1('0x17')](_0x1a7ecd);}};}function respondWithFilteredResult(_0x28eb80,_0x37c1ea){return function(_0x442209){if(_0x442209){var _0x428454=typeof _0x37c1ea[_0x86a1('0x18')]===_0x86a1('0x19')&&typeof _0x37c1ea['limit']===_0x86a1('0x19');var _0x90bd7a=_0x442209[_0x86a1('0x1a')];var _0x3d2f63=_0x428454?0x0:_0x37c1ea[_0x86a1('0x18')];var _0x3c539b=_0x428454?_0x442209[_0x86a1('0x1a')]:_0x37c1ea[_0x86a1('0x18')]+_0x37c1ea['limit'];var _0x3e56e7;if(_0x3c539b>=_0x90bd7a){_0x3c539b=_0x90bd7a;_0x3e56e7=0xc8;}else{_0x3e56e7=0xce;}_0x28eb80[_0x86a1('0x16')](_0x3e56e7);return _0x28eb80[_0x86a1('0x1b')](_0x86a1('0x1c'),_0x3d2f63+'-'+_0x3c539b+'/'+_0x90bd7a)[_0x86a1('0x17')](_0x442209);}return null;};}function patchUpdates(_0x37bf23){return function(_0x5ca061){try{jsonpatch[_0x86a1('0x1d')](_0x5ca061,_0x37bf23,!![]);}catch(_0x3b0881){return BPromise[_0x86a1('0x1e')](_0x3b0881);}return _0x5ca061[_0x86a1('0x1f')]();};}function saveUpdates(_0x44690e,_0x597c94){return function(_0x222091){if(_0x222091){return _0x222091[_0x86a1('0x20')](_0x44690e)[_0x86a1('0x21')](function(_0x172dac){return _0x172dac;});}return null;};}function removeEntity(_0x4aa2e3,_0x225d86){return function(_0x3d5ffd){if(_0x3d5ffd){return _0x3d5ffd[_0x86a1('0x22')]()['then'](function(){_0x4aa2e3[_0x86a1('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1439b6,_0x5f5bee){return function(_0x2ca7f4){if(!_0x2ca7f4){_0x1439b6['sendStatus'](0x194);}return _0x2ca7f4;};}function handleError(_0x195ea9,_0x796b3c){_0x796b3c=_0x796b3c||0x1f4;return function(_0x55ab6a){logger[_0x86a1('0x23')](_0x55ab6a[_0x86a1('0x24')]);if(_0x55ab6a[_0x86a1('0x25')]){delete _0x55ab6a[_0x86a1('0x25')];}_0x195ea9['status'](_0x796b3c)[_0x86a1('0x26')](_0x55ab6a);};}exports[_0x86a1('0x20')]=function(_0x5aa04c,_0x3d0519){if(_0x5aa04c['body']['id']){delete _0x5aa04c['body']['id'];}return db[_0x86a1('0x27')][_0x86a1('0x28')]({'where':{'id':_0x5aa04c['params']['id']}})['then'](handleEntityNotFound(_0x3d0519,null))[_0x86a1('0x21')](saveUpdates(_0x5aa04c[_0x86a1('0x29')],null))[_0x86a1('0x21')](respondWithResult(_0x3d0519,null))[_0x86a1('0x2a')](handleError(_0x3d0519,null));};exports['destroy']=function(_0x3af52,_0xe7e593){return db[_0x86a1('0x27')][_0x86a1('0x28')]({'where':{'id':_0x3af52[_0x86a1('0x2b')]['id']}})['then'](handleEntityNotFound(_0xe7e593,null))['then'](removeEntity(_0xe7e593,null))[_0x86a1('0x2a')](handleError(_0xe7e593,null));};
\ No newline at end of file
+var _0x1531=['limit','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','body','Action','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count'];(function(_0x1b6783,_0x2857e6){var _0x587b50=function(_0x48b634){while(--_0x48b634){_0x1b6783['push'](_0x1b6783['shift']());}};_0x587b50(++_0x2857e6);}(_0x1531,0xfc));var _0x1153=function(_0x3441cc,_0x1f5e2c){_0x3441cc=_0x3441cc-0x0;var _0x3ce7a6=_0x1531[_0x3441cc];return _0x3ce7a6;};'use strict';var emlformat=require(_0x1153('0x0'));var rimraf=require(_0x1153('0x1'));var zipdir=require(_0x1153('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1153('0x3'));var moment=require(_0x1153('0x4'));var BPromise=require(_0x1153('0x5'));var Mustache=require('mustache');var util=require(_0x1153('0x6'));var path=require(_0x1153('0x7'));var sox=require(_0x1153('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1153('0x9'));var _=require(_0x1153('0xa'));var squel=require('squel');var crypto=require(_0x1153('0xb'));var jsforce=require(_0x1153('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x1153('0xd'));var querystring=require(_0x1153('0xe'));var Papa=require(_0x1153('0xf'));var Redis=require('ioredis');var authService=require(_0x1153('0x10'));var qs=require(_0x1153('0x11'));var as=require(_0x1153('0x12'));var hardwareService=require(_0x1153('0x13'));var logger=require(_0x1153('0x14'))('api');var utils=require(_0x1153('0x15'));var config=require(_0x1153('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x1153('0x17'))['db'];function respondWithStatusCode(_0x417b1e,_0x45cd66){_0x45cd66=_0x45cd66||0xcc;return function(_0x427911){if(_0x427911){return _0x417b1e[_0x1153('0x18')](_0x45cd66);}return _0x417b1e[_0x1153('0x19')](_0x45cd66)[_0x1153('0x1a')]();};}function respondWithResult(_0x434e72,_0x56b830){_0x56b830=_0x56b830||0xc8;return function(_0x2395d1){if(_0x2395d1){return _0x434e72[_0x1153('0x19')](_0x56b830)['json'](_0x2395d1);}};}function respondWithFilteredResult(_0x13a1d2,_0x2ddee0){return function(_0x12ef9c){if(_0x12ef9c){var _0x4d12da=typeof _0x2ddee0[_0x1153('0x1b')]===_0x1153('0x1c')&&typeof _0x2ddee0['limit']==='undefined';var _0x4b1cc7=_0x12ef9c[_0x1153('0x1d')];var _0x1ea8b0=_0x4d12da?0x0:_0x2ddee0[_0x1153('0x1b')];var _0x1e40d3=_0x4d12da?_0x12ef9c[_0x1153('0x1d')]:_0x2ddee0[_0x1153('0x1b')]+_0x2ddee0[_0x1153('0x1e')];var _0x41dd67;if(_0x1e40d3>=_0x4b1cc7){_0x1e40d3=_0x4b1cc7;_0x41dd67=0xc8;}else{_0x41dd67=0xce;}_0x13a1d2['status'](_0x41dd67);return _0x13a1d2[_0x1153('0x1f')](_0x1153('0x20'),_0x1ea8b0+'-'+_0x1e40d3+'/'+_0x4b1cc7)[_0x1153('0x21')](_0x12ef9c);}return null;};}function patchUpdates(_0x3b5cc7){return function(_0x8f8158){try{jsonpatch[_0x1153('0x22')](_0x8f8158,_0x3b5cc7,!![]);}catch(_0x4cccf7){return BPromise[_0x1153('0x23')](_0x4cccf7);}return _0x8f8158[_0x1153('0x24')]();};}function saveUpdates(_0x3447b5,_0x7e3c86){return function(_0x43b2fc){if(_0x43b2fc){return _0x43b2fc[_0x1153('0x25')](_0x3447b5)[_0x1153('0x26')](function(_0x166370){return _0x166370;});}return null;};}function removeEntity(_0x5d95c5,_0x42991f){return function(_0x507da0){if(_0x507da0){return _0x507da0[_0x1153('0x27')]()['then'](function(){_0x5d95c5['status'](0xcc)[_0x1153('0x1a')]();});}};}function handleEntityNotFound(_0x31b3f3,_0x13a030){return function(_0xc420f){if(!_0xc420f){_0x31b3f3['sendStatus'](0x194);}return _0xc420f;};}function handleError(_0x49cafc,_0x2eebfe){_0x2eebfe=_0x2eebfe||0x1f4;return function(_0x4705a8){logger['error'](_0x4705a8[_0x1153('0x28')]);if(_0x4705a8[_0x1153('0x29')]){delete _0x4705a8[_0x1153('0x29')];}_0x49cafc[_0x1153('0x19')](_0x2eebfe)[_0x1153('0x2a')](_0x4705a8);};}exports[_0x1153('0x25')]=function(_0x4ab194,_0x50401b){if(_0x4ab194[_0x1153('0x2b')]['id']){delete _0x4ab194[_0x1153('0x2b')]['id'];}return db[_0x1153('0x2c')][_0x1153('0x2d')]({'where':{'id':_0x4ab194['params']['id']}})[_0x1153('0x26')](handleEntityNotFound(_0x50401b,null))['then'](saveUpdates(_0x4ab194[_0x1153('0x2b')],null))[_0x1153('0x26')](respondWithResult(_0x50401b,null))[_0x1153('0x2e')](handleError(_0x50401b,null));};exports['destroy']=function(_0x2043bb,_0x36f555){return db[_0x1153('0x2c')]['find']({'where':{'id':_0x2043bb['params']['id']}})[_0x1153('0x26')](handleEntityNotFound(_0x36f555,null))[_0x1153('0x26')](removeEntity(_0x36f555,null))['catch'](handleError(_0x36f555,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 8d72fff..4183304 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 _0x1cd8=['Action','tools_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x32f4df,_0x22d11a){var _0x5762fe=function(_0x58314a){while(--_0x58314a){_0x32f4df['push'](_0x32f4df['shift']());}};_0x5762fe(++_0x22d11a);}(_0x1cd8,0x198));var _0x81cd=function(_0x54bb83,_0x48f73f){_0x54bb83=_0x54bb83-0x0;var _0x33abd6=_0x1cd8[_0x54bb83];return _0x33abd6;};'use strict';var _=require(_0x81cd('0x0'));var util=require(_0x81cd('0x1'));var logger=require(_0x81cd('0x2'))(_0x81cd('0x3'));var moment=require(_0x81cd('0x4'));var BPromise=require(_0x81cd('0x5'));var rp=require(_0x81cd('0x6'));var fs=require('fs');var path=require(_0x81cd('0x7'));var rimraf=require(_0x81cd('0x8'));var config=require(_0x81cd('0x9'));var attributes=require('./action.attributes');module[_0x81cd('0xa')]=function(_0x410147,_0x4f1ddc){return _0x410147[_0x81cd('0xb')](_0x81cd('0xc'),attributes,{'tableName':_0x81cd('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x76da=['lodash','../../config/logger','api','bluebird','rimraf','../../config/environment','./action.attributes'];(function(_0x12a390,_0x3af63a){var _0x1f66cd=function(_0x359905){while(--_0x359905){_0x12a390['push'](_0x12a390['shift']());}};_0x1f66cd(++_0x3af63a);}(_0x76da,0x111));var _0xa76d=function(_0x42b6e8,_0x11872){_0x42b6e8=_0x42b6e8-0x0;var _0x2eb988=_0x76da[_0x42b6e8];return _0x2eb988;};'use strict';var _=require(_0xa76d('0x0'));var util=require('util');var logger=require(_0xa76d('0x1'))(_0xa76d('0x2'));var moment=require('moment');var BPromise=require(_0xa76d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa76d('0x4'));var config=require(_0xa76d('0x5'));var attributes=require(_0xa76d('0x6'));module['exports']=function(_0x45fe23,_0x5b0733){return _0x45fe23['define']('Action',attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index f33538a..9aa65d8 100644
--- a/server/api/action/action.rpc.js
+++ b/server/api/action/action.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5fc3=['../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0xe74fe4,_0x413858){var _0x2bbbb0=function(_0xeab6f5){while(--_0xeab6f5){_0xe74fe4['push'](_0xe74fe4['shift']());}};_0x2bbbb0(++_0x413858);}(_0x5fc3,0xa8));var _0x35fc=function(_0x5e8c32,_0x1b1f3f){_0x5e8c32=_0x5e8c32-0x0;var _0x595f7b=_0x5fc3[_0x5e8c32];return _0x595f7b;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('Action,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('Action,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});}
\ No newline at end of file
+var _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x43158c,_0x1bdae4){var _0x43f861=function(_0x28726d){while(--_0x28726d){_0x43158c['push'](_0x43158c['shift']());}};_0x43f861(++_0x1bdae4);}(_0xabce,0x103));var _0xeabc=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xabce[_0x220dbb];return _0x2b77de;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Action,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 94fad69..29788ce 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 _0x25f5=['/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./action.controller','put','isAuthenticated'];(function(_0x1ce9ea,_0x32e6f4){var _0x2a95b9=function(_0x1a0496){while(--_0x1a0496){_0x1ce9ea['push'](_0x1ce9ea['shift']());}};_0x2a95b9(++_0x32e6f4);}(_0x25f5,0x9f));var _0x525f=function(_0x12742e,_0x43f6fa){_0x12742e=_0x12742e-0x0;var _0x173452=_0x25f5[_0x12742e];return _0x173452;};'use strict';var multer=require(_0x525f('0x0'));var util=require(_0x525f('0x1'));var path=require(_0x525f('0x2'));var timeout=require(_0x525f('0x3'));var express=require(_0x525f('0x4'));var router=express[_0x525f('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x525f('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x525f('0x7'));router[_0x525f('0x8')]('/:id',auth[_0x525f('0x9')](),controller['update']);router['delete'](_0x525f('0xa'),auth[_0x525f('0x9')](),controller[_0x525f('0xb')]);module[_0x525f('0xc')]=router;
\ No newline at end of file
+var _0x6ea5=['isAuthenticated','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','delete'];(function(_0x4230aa,_0x4dbfe7){var _0x120199=function(_0x189cb2){while(--_0x189cb2){_0x4230aa['push'](_0x4230aa['shift']());}};_0x120199(++_0x4dbfe7);}(_0x6ea5,0x1b5));var _0x56ea=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6ea5[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x56ea('0x0'));var util=require('util');var path=require(_0x56ea('0x1'));var timeout=require(_0x56ea('0x2'));var express=require(_0x56ea('0x3'));var router=express[_0x56ea('0x4')]();var fs_extra=require(_0x56ea('0x5'));var auth=require(_0x56ea('0x6'));var interaction=require(_0x56ea('0x7'));var config=require(_0x56ea('0x8'));var controller=require(_0x56ea('0x9'));router[_0x56ea('0xa')](_0x56ea('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x56ea('0xc')](_0x56ea('0xb'),auth[_0x56ea('0xd')](),controller[_0x56ea('0xe')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 8e63fc4..346a12c 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 _0x98a8=['sequelize','exports','STRING','TEXT'];(function(_0x3ea5d1,_0x5389a0){var _0x11d23b=function(_0x475b43){while(--_0x475b43){_0x3ea5d1['push'](_0x3ea5d1['shift']());}};_0x11d23b(++_0x5389a0);}(_0x98a8,0x12c));var _0x898a=function(_0x2cc5e8,_0x348744){_0x2cc5e8=_0x2cc5e8-0x0;var _0xd45523=_0x98a8[_0x2cc5e8];return _0xd45523;};'use strict';var Sequelize=require(_0x898a('0x0'));module[_0x898a('0x1')]={'name':{'type':Sequelize[_0x898a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x898a('0x2')]},'parent':{'type':Sequelize[_0x898a('0x2')]},'table':{'type':Sequelize[_0x898a('0x2')]},'conditions':{'type':Sequelize[_0x898a('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xf494=['STRING','TEXT','sequelize','exports'];(function(_0x89100d,_0x59c43d){var _0x15974a=function(_0x2fb1ac){while(--_0x2fb1ac){_0x89100d['push'](_0x89100d['shift']());}};_0x15974a(++_0x59c43d);}(_0xf494,0x1c6));var _0x4f49=function(_0xaa0e2,_0x3aa20f){_0xaa0e2=_0xaa0e2-0x0;var _0x19a563=_0xf494[_0xaa0e2];return _0x19a563;};'use strict';var Sequelize=require(_0x4f49('0x0'));module[_0x4f49('0x1')]={'name':{'type':Sequelize[_0x4f49('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x4f49('0x2')]},'table':{'type':Sequelize[_0x4f49('0x2')]},'conditions':{'type':Sequelize[_0x4f49('0x3')]},'joins':{'type':Sequelize[_0x4f49('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 161e45b..b3d8a4e 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 _0xb0cc=['HOUR(%s)','Limited\x20Query:','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','dbH','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','error','stack','name','send','index','map','AnalyticCustomReport','fieldName','type','key','model','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','query','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','rawAttributes','includeAll','find','create','body','role','user','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','field','condition','value','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','metric','replace','function','format','groupBy','group','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','clone','debug','toString','sequelize','QueryTypes','SELECT','MIN(%s)','SEC_TO_TIME(%s)','IS\x20NOT\x20NULL','IS\x20EMPTY','getFields','Please\x20insert\x20at\x20least\x20one\x20field','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','../../files/reports','savename','countTable','COUNT(*)','runReport'];(function(_0x1a156e,_0x4e3646){var _0x2a7230=function(_0x7a72a8){while(--_0x7a72a8){_0x1a156e['push'](_0x1a156e['shift']());}};_0x2a7230(++_0x4e3646);}(_0xb0cc,0xab));var _0xcb0c=function(_0x474314,_0x439f08){_0x474314=_0x474314-0x0;var _0x2c414f=_0xb0cc[_0x474314];return _0x2c414f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcb0c('0x0'));var zipdir=require(_0xcb0c('0x1'));var jsonpatch=require(_0xcb0c('0x2'));var rp=require(_0xcb0c('0x3'));var moment=require(_0xcb0c('0x4'));var BPromise=require(_0xcb0c('0x5'));var Mustache=require(_0xcb0c('0x6'));var util=require(_0xcb0c('0x7'));var path=require('path');var sox=require(_0xcb0c('0x8'));var csv=require('to-csv');var ejs=require(_0xcb0c('0x9'));var fs=require('fs');var fs_extra=require(_0xcb0c('0xa'));var _=require(_0xcb0c('0xb'));var squel=require('squel');var crypto=require(_0xcb0c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xcb0c('0xd'));var toCsv=require('to-csv');var querystring=require(_0xcb0c('0xe'));var Papa=require(_0xcb0c('0xf'));var Redis=require(_0xcb0c('0x10'));var authService=require(_0xcb0c('0x11'));var qs=require(_0xcb0c('0x12'));var as=require(_0xcb0c('0x13'));var hardwareService=require(_0xcb0c('0x14'));var logger=require('../../config/logger')(_0xcb0c('0x15'));var utils=require(_0xcb0c('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var dbH=require(_0xcb0c('0x17'))[_0xcb0c('0x18')];function respondWithStatusCode(_0x230071,_0x5d3598){_0x5d3598=_0x5d3598||0xcc;return function(_0x2144da){if(_0x2144da){return _0x230071[_0xcb0c('0x19')](_0x5d3598);}return _0x230071[_0xcb0c('0x1a')](_0x5d3598)[_0xcb0c('0x1b')]();};}function respondWithResult(_0x557787,_0x3a6374){_0x3a6374=_0x3a6374||0xc8;return function(_0x58d85f){if(_0x58d85f){return _0x557787[_0xcb0c('0x1a')](_0x3a6374)['json'](_0x58d85f);}};}function respondWithFilteredResult(_0x121d93,_0xff1739){return function(_0x59c3b1){if(_0x59c3b1){var _0x1ed553=typeof _0xff1739[_0xcb0c('0x1c')]===_0xcb0c('0x1d')&&typeof _0xff1739[_0xcb0c('0x1e')]===_0xcb0c('0x1d');var _0x2770da=_0x59c3b1[_0xcb0c('0x1f')];var _0x5adc6d=_0x1ed553?0x0:_0xff1739[_0xcb0c('0x1c')];var _0x47d278=_0x1ed553?_0x59c3b1[_0xcb0c('0x1f')]:_0xff1739[_0xcb0c('0x1c')]+_0xff1739[_0xcb0c('0x1e')];var _0x53d3b7;if(_0x47d278>=_0x2770da){_0x47d278=_0x2770da;_0x53d3b7=0xc8;}else{_0x53d3b7=0xce;}_0x121d93[_0xcb0c('0x1a')](_0x53d3b7);return _0x121d93['set'](_0xcb0c('0x20'),_0x5adc6d+'-'+_0x47d278+'/'+_0x2770da)[_0xcb0c('0x21')](_0x59c3b1);}return null;};}function patchUpdates(_0x8c8029){return function(_0x37c8e9){try{jsonpatch['apply'](_0x37c8e9,_0x8c8029,!![]);}catch(_0x3c02a9){return BPromise[_0xcb0c('0x22')](_0x3c02a9);}return _0x37c8e9[_0xcb0c('0x23')]();};}function saveUpdates(_0x2b6afe,_0x233a93){return function(_0x3e1c1d){if(_0x3e1c1d){return _0x3e1c1d[_0xcb0c('0x24')](_0x2b6afe)[_0xcb0c('0x25')](function(_0x4b2c2a){return _0x4b2c2a;});}return null;};}function removeEntity(_0x761d58,_0x5e8034){return function(_0x534009){if(_0x534009){return _0x534009[_0xcb0c('0x26')]()[_0xcb0c('0x25')](function(){var _0x2ba0bc=_0x534009[_0xcb0c('0x27')]({'plain':!![]});var _0x4f89b9=_0xcb0c('0x28');return db[_0xcb0c('0x29')]['destroy']({'where':{'type':_0x4f89b9,'resourceId':_0x2ba0bc['id']}})[_0xcb0c('0x25')](function(){return _0x534009;});})[_0xcb0c('0x25')](function(){_0x761d58[_0xcb0c('0x1a')](0xcc)[_0xcb0c('0x1b')]();});}};}function handleEntityNotFound(_0x961f2b,_0x38cf81){return function(_0x59c60c){if(!_0x59c60c){_0x961f2b[_0xcb0c('0x19')](0x194);}return _0x59c60c;};}function handleError(_0x4d721f,_0x3586e8){_0x3586e8=_0x3586e8||0x1f4;return function(_0x247411){logger[_0xcb0c('0x2a')](_0x247411[_0xcb0c('0x2b')]);if(_0x247411[_0xcb0c('0x2c')]){delete _0x247411['name'];}_0x4d721f[_0xcb0c('0x1a')](_0x3586e8)[_0xcb0c('0x2d')](_0x247411);};}exports[_0xcb0c('0x2e')]=function(_0x55db6e,_0x190f2f){var _0x31fd86={},_0x37e26a={},_0x31c728={'count':0x0,'rows':[]};var _0x1023d9=_[_0xcb0c('0x2f')](db[_0xcb0c('0x30')]['rawAttributes'],function(_0x58af46){return{'name':_0x58af46[_0xcb0c('0x31')],'type':_0x58af46[_0xcb0c('0x32')][_0xcb0c('0x33')]};});_0x37e26a[_0xcb0c('0x34')]=_['map'](_0x1023d9,_0xcb0c('0x2c'));_0x37e26a['query']=_['keys'](_0x55db6e['query']);_0x37e26a[_0xcb0c('0x35')]=_[_0xcb0c('0x36')](_0x37e26a[_0xcb0c('0x34')],_0x37e26a['query']);_0x31fd86[_0xcb0c('0x37')]=_['intersection'](_0x37e26a[_0xcb0c('0x34')],qs[_0xcb0c('0x38')](_0x55db6e['query'][_0xcb0c('0x38')]));_0x31fd86[_0xcb0c('0x37')]=_0x31fd86[_0xcb0c('0x37')][_0xcb0c('0x39')]?_0x31fd86['attributes']:_0x37e26a[_0xcb0c('0x34')];if(!_0x55db6e['query'][_0xcb0c('0x3a')](_0xcb0c('0x3b'))){_0x31fd86[_0xcb0c('0x1e')]=qs[_0xcb0c('0x1e')](_0x55db6e[_0xcb0c('0x3c')][_0xcb0c('0x1e')]);_0x31fd86[_0xcb0c('0x1c')]=qs[_0xcb0c('0x1c')](_0x55db6e['query'][_0xcb0c('0x1c')]);}_0x31fd86[_0xcb0c('0x3d')]=qs[_0xcb0c('0x3e')](_0x55db6e[_0xcb0c('0x3c')][_0xcb0c('0x3e')]);_0x31fd86['where']=qs[_0xcb0c('0x35')](_[_0xcb0c('0x3f')](_0x55db6e[_0xcb0c('0x3c')],_0x37e26a[_0xcb0c('0x35')]),_0x1023d9);if(_0x55db6e[_0xcb0c('0x3c')][_0xcb0c('0x40')]){_0x31fd86[_0xcb0c('0x41')]=_[_0xcb0c('0x42')](_0x31fd86[_0xcb0c('0x41')],{'$or':_[_0xcb0c('0x2f')](_0x1023d9,function(_0x95543f){if(_0x95543f[_0xcb0c('0x32')]!==_0xcb0c('0x43')){var _0xf08b={};_0xf08b[_0x95543f['name']]={'$like':'%'+_0x55db6e['query'][_0xcb0c('0x40')]+'%'};return _0xf08b;}})});}_0x31fd86=_['merge']({},_0x31fd86,_0x55db6e[_0xcb0c('0x44')]);var _0xe44623={'where':_0x31fd86['where']};return db[_0xcb0c('0x30')]['count'](_0xe44623)[_0xcb0c('0x25')](function(_0x35a748){_0x31c728[_0xcb0c('0x1f')]=_0x35a748;if(_0x55db6e[_0xcb0c('0x3c')]['includeAll']){_0x31fd86[_0xcb0c('0x45')]=[{'all':!![]}];}return db[_0xcb0c('0x30')][_0xcb0c('0x46')](_0x31fd86);})[_0xcb0c('0x25')](function(_0x406e2c){_0x31c728[_0xcb0c('0x47')]=_0x406e2c;return _0x31c728;})[_0xcb0c('0x25')](respondWithFilteredResult(_0x190f2f,_0x31fd86))[_0xcb0c('0x48')](handleError(_0x190f2f,null));};exports[_0xcb0c('0x49')]=function(_0x126dd0,_0xc8abcd){var _0x1f4948={'raw':![],'where':{'id':_0x126dd0[_0xcb0c('0x4a')]['id']}},_0x4191d7={};_0x4191d7['model']=_[_0xcb0c('0x4b')](db[_0xcb0c('0x30')][_0xcb0c('0x4c')]);_0x4191d7[_0xcb0c('0x3c')]=_[_0xcb0c('0x4b')](_0x126dd0[_0xcb0c('0x3c')]);_0x4191d7[_0xcb0c('0x35')]=_['intersection'](_0x4191d7[_0xcb0c('0x34')],_0x4191d7[_0xcb0c('0x3c')]);_0x1f4948[_0xcb0c('0x37')]=_['intersection'](_0x4191d7[_0xcb0c('0x34')],qs[_0xcb0c('0x38')](_0x126dd0[_0xcb0c('0x3c')]['fields']));_0x1f4948['attributes']=_0x1f4948[_0xcb0c('0x37')][_0xcb0c('0x39')]?_0x1f4948[_0xcb0c('0x37')]:_0x4191d7['model'];if(_0x126dd0['query'][_0xcb0c('0x4d')]){_0x1f4948[_0xcb0c('0x45')]=[{'all':!![]}];}_0x1f4948=_[_0xcb0c('0x42')]({},_0x1f4948,_0x126dd0['options']);return db['AnalyticCustomReport'][_0xcb0c('0x4e')](_0x1f4948)[_0xcb0c('0x25')](handleEntityNotFound(_0xc8abcd,null))['then'](respondWithResult(_0xc8abcd,null))[_0xcb0c('0x48')](handleError(_0xc8abcd,null));};exports[_0xcb0c('0x4f')]=function(_0x2db9ce,_0x1ca086){return db['AnalyticCustomReport']['create'](_0x2db9ce[_0xcb0c('0x50')],{})[_0xcb0c('0x25')](function(_0x2b7f52){var _0x71e3b0=_0x2db9ce['user']['get']({'plain':!![]});if(!_0x71e3b0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x71e3b0[_0xcb0c('0x51')]===_0xcb0c('0x52')){var _0x2f4cfb=_0x2b7f52['get']({'plain':!![]});var _0x6f7b12=_0xcb0c('0x53');return db[_0xcb0c('0x54')][_0xcb0c('0x4e')]({'where':{'name':_0x6f7b12,'userProfileId':_0x71e3b0[_0xcb0c('0x55')]},'raw':!![]})[_0xcb0c('0x25')](function(_0x435faf){if(_0x435faf&&_0x435faf[_0xcb0c('0x56')]===0x0){return db[_0xcb0c('0x29')][_0xcb0c('0x4f')]({'name':_0x2f4cfb[_0xcb0c('0x2c')],'resourceId':_0x2f4cfb['id'],'type':_0xcb0c('0x28'),'sectionId':_0x435faf['id']},{})[_0xcb0c('0x25')](function(){return _0x2b7f52;});}else{return _0x2b7f52;}})[_0xcb0c('0x48')](function(_0x309a2f){logger[_0xcb0c('0x2a')](_0xcb0c('0x57'),_0x309a2f);throw _0x309a2f;});}return _0x2b7f52;})['then'](respondWithResult(_0x1ca086,0xc9))[_0xcb0c('0x48')](handleError(_0x1ca086,null));};exports['update']=function(_0x9339de,_0x4ca6ea){if(_0x9339de[_0xcb0c('0x50')]['id']){delete _0x9339de[_0xcb0c('0x50')]['id'];}return db[_0xcb0c('0x30')][_0xcb0c('0x4e')]({'where':{'id':_0x9339de[_0xcb0c('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4ca6ea,null))[_0xcb0c('0x25')](saveUpdates(_0x9339de[_0xcb0c('0x50')],null))['then'](respondWithResult(_0x4ca6ea,null))[_0xcb0c('0x48')](handleError(_0x4ca6ea,null));};exports[_0xcb0c('0x26')]=function(_0x1b4a3e,_0x15e20c){return db[_0xcb0c('0x30')][_0xcb0c('0x4e')]({'where':{'id':_0x1b4a3e[_0xcb0c('0x4a')]['id']}})[_0xcb0c('0x25')](handleEntityNotFound(_0x15e20c,null))[_0xcb0c('0x25')](removeEntity(_0x15e20c,null))[_0xcb0c('0x48')](handleError(_0x15e20c,null));};exports[_0xcb0c('0x58')]=function(_0x408e9f,_0xa1acc){var _0x9aaa70=0xa;var _0x4f3ddb=[_0xcb0c('0x59'),_0xcb0c('0x5a'),_0xcb0c('0x5b'),_0xcb0c('0x5c')];var _0x564c20={'SUM':_0xcb0c('0x5d'),'COUNT':_0xcb0c('0x5e'),'COUNT DISTINCT':_0xcb0c('0x5f'),'MAX':_0xcb0c('0x60'),'MIN':'MIN(%s)','AVG':_0xcb0c('0x61'),'GROUP_CONCAT':_0xcb0c('0x62'),'GROUP_CONCAT ASC':_0xcb0c('0x63'),'GROUP_CONCAT DESC':_0xcb0c('0x64')};var _0x47423a={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xcb0c('0x65'),'HOUR':'HOUR(%s)','ROUND':_0xcb0c('0x66'),'UNIX_TIMESTAMP':_0xcb0c('0x67')};var _0x1d6f05=function(_0x2d1501){return!_[_0xcb0c('0x68')]([_0xcb0c('0x69'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xcb0c('0x6a')],_0x2d1501);};var _0x5e6038=function(_0x472e0d){if(!_0x472e0d||!_0x472e0d[_0xcb0c('0x6b')][_0xcb0c('0x39')]){return'';}for(var _0xad99b='(',_0x1c50f8=0x0;_0x1c50f8<_0x472e0d['rules'][_0xcb0c('0x39')];_0x1c50f8+=0x1){_0x1c50f8>0x0&&(_0xad99b+='\x20'+_0x472e0d[_0xcb0c('0x6c')]+'\x20');_0xad99b+=_0x472e0d['rules'][_0x1c50f8]['group']?_0x5e6038(_0x472e0d[_0xcb0c('0x6b')][_0x1c50f8]['group']):_0x472e0d[_0xcb0c('0x6b')][_0x1c50f8][_0xcb0c('0x6d')]+'\x20'+_0x472e0d[_0xcb0c('0x6b')][_0x1c50f8][_0xcb0c('0x6e')]+(_0x1d6f05(_0x472e0d[_0xcb0c('0x6b')][_0x1c50f8][_0xcb0c('0x6e')])?'\x20'+_0x472e0d['rules'][_0x1c50f8][_0xcb0c('0x6f')]:'');}return _0xad99b+')';};var _0x7c9254={'where':{'id':_0x408e9f[_0xcb0c('0x4a')]['id']}},_0x12251b,_0x1001af,_0x357735,_0x1df9b9,_0x2ae087;_0x7c9254=_[_0xcb0c('0x42')]({},_0x7c9254,_0x408e9f[_0xcb0c('0x44')]);return db[_0xcb0c('0x30')][_0xcb0c('0x4e')](_0x7c9254)[_0xcb0c('0x25')](function(_0x4ab191){if(_0x4ab191){_0x12251b=_0x4ab191;return _0x4ab191['getFields']();}return null;})[_0xcb0c('0x25')](function(_0x395832){if(_0x395832){if(!_0x395832[_0xcb0c('0x39')]){throw new db[(_0xcb0c('0x70'))][(_0xcb0c('0x71'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1001af=_0x395832;return db[_0xcb0c('0x72')]['findAll']({'raw':!![]});}return null;})[_0xcb0c('0x25')](function(_0x175923){if(_0x175923){_0x357735=_[_0xcb0c('0x73')](_0x175923,'id');var _0x50087b;var _0x48beda=squel[_0xcb0c('0x74')]();_0x48beda[_0xcb0c('0x75')](_0x12251b[_0xcb0c('0x76')]);for(var _0x1193f6=0x0;_0x1193f6<_0x1001af[_0xcb0c('0x39')];_0x1193f6+=0x1){_0x50087b=_0x1001af[_0x1193f6][_0xcb0c('0x77')]?_0x357735[_0x1001af[_0x1193f6][_0xcb0c('0x77')]][_0xcb0c('0x78')]:_0x1001af[_0x1193f6][_0xcb0c('0x6d')];_0x50087b=_0x1001af[_0x1193f6]['function']?_[_0xcb0c('0x79')](_0x564c20[_0x1001af[_0x1193f6][_0xcb0c('0x7a')]],'%s',_0x50087b):_0x50087b;_0x50087b=_0x1001af[_0x1193f6][_0xcb0c('0x7b')]?_[_0xcb0c('0x79')](_0x47423a[_0x1001af[_0x1193f6][_0xcb0c('0x7b')]],'%s',_0x50087b):_0x50087b;if(_0x1001af[_0x1193f6][_0xcb0c('0x7c')]){_0x48beda[_0xcb0c('0x7d')](_0x50087b);}_0x1001af[_0x1193f6][_0xcb0c('0x7e')]&&_0x48beda[_0xcb0c('0x3d')](_0x50087b,_0x1001af[_0x1193f6][_0xcb0c('0x7e')]===_0xcb0c('0x7f')?![]:!![]);_0x48beda[_0xcb0c('0x6d')](_0x50087b,_0x1001af[_0x1193f6][_0xcb0c('0x80')]||_0x50087b);}if(_0x12251b[_0xcb0c('0x81')]){_0x12251b[_0xcb0c('0x81')]=JSON[_0xcb0c('0x82')](_0x12251b['joins']);for(var _0x1a2974=0x0;_0x1a2974<_0x12251b['joins'][_0xcb0c('0x39')];_0x1a2974+=0x1){if(_0x12251b[_0xcb0c('0x81')][_0x1a2974]['type']&&_[_0xcb0c('0x68')](_0x4f3ddb,_0x12251b['joins'][_0x1a2974]['type'])&&_0x12251b[_0xcb0c('0x81')][_0x1a2974][_0xcb0c('0x83')]&&_0x12251b[_0xcb0c('0x81')][_0x1a2974][_0xcb0c('0x84')]&&_0x12251b['joins'][_0x1a2974]['foreignKey']){_0x48beda[_0x12251b[_0xcb0c('0x81')][_0x1a2974][_0xcb0c('0x32')]](_0x12251b[_0xcb0c('0x81')][_0x1a2974]['foreignTable'],null,util['format'](_0xcb0c('0x85'),_0x12251b[_0xcb0c('0x76')],_0x12251b['joins'][_0x1a2974][_0xcb0c('0x83')],_0x12251b['joins'][_0x1a2974]['foreignTable'],_0x12251b[_0xcb0c('0x81')][_0x1a2974][_0xcb0c('0x86')]));}}}if(_0x12251b['conditions']){_0x12251b[_0xcb0c('0x87')]=JSON[_0xcb0c('0x82')](_0x12251b['conditions']);_0x48beda[_0xcb0c('0x41')](_0x5e6038(_0x12251b[_0xcb0c('0x87')][_0xcb0c('0x7d')]));}_0x2ae087=_0x48beda[_0xcb0c('0x88')]();_0x48beda[_0xcb0c('0x1e')](_0x9aaa70);_0x48beda[_0xcb0c('0x1c')](0x0);logger[_0xcb0c('0x89')]('Limited\x20Query:',_0x48beda[_0xcb0c('0x8a')]());return dbH[_0xcb0c('0x8b')]['query'](_0x48beda[_0xcb0c('0x8a')](),{'type':dbH['sequelize'][_0xcb0c('0x8c')][_0xcb0c('0x8d')]});}})['then'](respondWithResult(_0xa1acc,null))[_0xcb0c('0x48')](handleError(_0xa1acc,null));};function runReport(_0x30ebc6,_0x1150d2,_0x256111){var _0x242fd2=_0x1150d2[_0xcb0c('0x2c')];var _0x2e062d=0xa;var _0x28a71e=[_0xcb0c('0x59'),'left_join',_0xcb0c('0x5b'),_0xcb0c('0x5c')];var _0x96cd99={'SUM':_0xcb0c('0x5d'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xcb0c('0x5f'),'MAX':_0xcb0c('0x60'),'MIN':_0xcb0c('0x8e'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xcb0c('0x62'),'GROUP_CONCAT ASC':_0xcb0c('0x63'),'GROUP_CONCAT DESC':_0xcb0c('0x64')};var _0x5002e5={'SEC_TO_TIME':_0xcb0c('0x8f'),'DATE':_0xcb0c('0x65'),'HOUR':'HOUR(%s)','ROUND':_0xcb0c('0x66'),'UNIX_TIMESTAMP':_0xcb0c('0x67')};var _0x432605=function(_0x4cc44c){return!_[_0xcb0c('0x68')](['IS\x20NULL',_0xcb0c('0x90'),_0xcb0c('0x91'),'IS\x20NOT\x20EMPTY'],_0x4cc44c);};var _0x3dae1a=function(_0x383f3f){if(!_0x383f3f||!_0x383f3f[_0xcb0c('0x6b')][_0xcb0c('0x39')]){return'';}for(var _0x3bb46e='(',_0x2af40c=0x0;_0x2af40c<_0x383f3f['rules']['length'];_0x2af40c+=0x1){_0x2af40c>0x0&&(_0x3bb46e+='\x20'+_0x383f3f[_0xcb0c('0x6c')]+'\x20');_0x3bb46e+=_0x383f3f['rules'][_0x2af40c][_0xcb0c('0x7d')]?_0x3dae1a(_0x383f3f[_0xcb0c('0x6b')][_0x2af40c][_0xcb0c('0x7d')]):_0x383f3f['rules'][_0x2af40c][_0xcb0c('0x6d')]+'\x20'+_0x383f3f['rules'][_0x2af40c][_0xcb0c('0x6e')]+(_0x432605(_0x383f3f[_0xcb0c('0x6b')][_0x2af40c]['condition'])?'\x20'+_0x383f3f[_0xcb0c('0x6b')][_0x2af40c][_0xcb0c('0x6f')]:'');}return _0x3bb46e+')';};var _0x553859={'where':{'id':_0x30ebc6['id']}},_0x5a65f6,_0x3cd1a4,_0x5c3aeb,_0x1748d7,_0x219053;_0x553859=_['merge']({},_0x553859,_0x256111);return db[_0xcb0c('0x30')]['find'](_0x553859)[_0xcb0c('0x25')](function(_0x43a0f8){if(_0x43a0f8){_0x5a65f6=_0x43a0f8;return _0x43a0f8[_0xcb0c('0x92')]();}return null;})[_0xcb0c('0x25')](function(_0x291f79){if(_0x291f79){if(!_0x291f79['length']){throw new db['Sequelize'][(_0xcb0c('0x71'))](_0xcb0c('0x93'),0x193);}_0x3cd1a4=_0x291f79;return db['AnalyticMetric'][_0xcb0c('0x46')]({'raw':!![]});}return null;})[_0xcb0c('0x25')](function(_0x5eecb5){if(_0x5eecb5){_0x5c3aeb=_['keyBy'](_0x5eecb5,'id');var _0x207699;var _0x50c00c=squel[_0xcb0c('0x74')]();_0x50c00c[_0xcb0c('0x75')](_0x5a65f6[_0xcb0c('0x76')]);for(var _0x202bb1=0x0;_0x202bb1<_0x3cd1a4[_0xcb0c('0x39')];_0x202bb1+=0x1){_0x207699=_0x3cd1a4[_0x202bb1][_0xcb0c('0x77')]?_0x5c3aeb[_0x3cd1a4[_0x202bb1][_0xcb0c('0x77')]][_0xcb0c('0x78')]:_0x3cd1a4[_0x202bb1][_0xcb0c('0x6d')];_0x207699=_0x3cd1a4[_0x202bb1][_0xcb0c('0x7a')]?_['replace'](_0x96cd99[_0x3cd1a4[_0x202bb1]['function']],'%s',_0x207699):_0x207699;_0x207699=_0x3cd1a4[_0x202bb1]['format']?_['replace'](_0x5002e5[_0x3cd1a4[_0x202bb1][_0xcb0c('0x7b')]],'%s',_0x207699):_0x207699;if(_0x3cd1a4[_0x202bb1][_0xcb0c('0x7c')]){_0x50c00c[_0xcb0c('0x7d')](_0x207699);}_0x3cd1a4[_0x202bb1][_0xcb0c('0x7e')]&&_0x50c00c[_0xcb0c('0x3d')](_0x207699,_0x3cd1a4[_0x202bb1][_0xcb0c('0x7e')]===_0xcb0c('0x7f')?![]:!![]);_0x50c00c[_0xcb0c('0x6d')](_0x207699,_0x3cd1a4[_0x202bb1][_0xcb0c('0x80')]||_0x207699);}if(_0x5a65f6[_0xcb0c('0x81')]){_0x5a65f6['joins']=JSON[_0xcb0c('0x82')](_0x5a65f6['joins']);for(var _0x4426ed=0x0;_0x4426ed<_0x5a65f6[_0xcb0c('0x81')]['length'];_0x4426ed+=0x1){if(_0x5a65f6[_0xcb0c('0x81')][_0x4426ed][_0xcb0c('0x32')]&&_[_0xcb0c('0x68')](_0x28a71e,_0x5a65f6[_0xcb0c('0x81')][_0x4426ed][_0xcb0c('0x32')])&&_0x5a65f6[_0xcb0c('0x81')][_0x4426ed][_0xcb0c('0x83')]&&_0x5a65f6[_0xcb0c('0x81')][_0x4426ed]['foreignTable']&&_0x5a65f6[_0xcb0c('0x81')][_0x4426ed][_0xcb0c('0x86')]){_0x50c00c[_0x5a65f6[_0xcb0c('0x81')][_0x4426ed][_0xcb0c('0x32')]](_0x5a65f6[_0xcb0c('0x81')][_0x4426ed][_0xcb0c('0x84')],null,util[_0xcb0c('0x7b')]('%s.%s\x20=\x20%s.%s',_0x5a65f6[_0xcb0c('0x76')],_0x5a65f6[_0xcb0c('0x81')][_0x4426ed][_0xcb0c('0x83')],_0x5a65f6[_0xcb0c('0x81')][_0x4426ed][_0xcb0c('0x84')],_0x5a65f6[_0xcb0c('0x81')][_0x4426ed]['foreignKey']));}}}if(_0x5a65f6[_0xcb0c('0x87')]){_0x5a65f6[_0xcb0c('0x87')]=JSON[_0xcb0c('0x82')](_0x5a65f6[_0xcb0c('0x87')]);_0x50c00c[_0xcb0c('0x41')](_0x3dae1a(_0x5a65f6[_0xcb0c('0x87')]['group']));}_0x219053=_0x50c00c[_0xcb0c('0x88')]();_0x50c00c[_0xcb0c('0x1e')](_0x2e062d);_0x50c00c[_0xcb0c('0x1c')](0x0);return;}})[_0xcb0c('0x25')](function(){if(_0x1150d2[_0xcb0c('0x94')]===_0xcb0c('0x95')){return null;}var _0x347801=_[_0xcb0c('0x42')](_0x1150d2,{'name':_0x1150d2[_0xcb0c('0x96')]||_0x1150d2[_0xcb0c('0x2c')]||_0x5a65f6[_0xcb0c('0x2c')],'basename':_0x242fd2,'savename':util[_0xcb0c('0x7b')](_0xcb0c('0x97'),_0x1150d2[_0xcb0c('0x2c')]||_0x5a65f6[_0xcb0c('0x2c')],require(_0xcb0c('0x98'))[_0xcb0c('0x99')](0x4),_0x1150d2[_0xcb0c('0x94')]||_0xcb0c('0x9a')),'reportId':_0x5a65f6['id'],'reportType':_0xcb0c('0x9b')});return db[_0xcb0c('0x9c')][_0xcb0c('0x4f')](_0x347801,{'raw':!![]});})[_0xcb0c('0x25')](function(_0x5561d){if(_0x5a65f6['table']===_0xcb0c('0x9d')){_0x219053[_0xcb0c('0x41')](_0x5a65f6['table']+_0xcb0c('0x9e'),_0x1150d2['startDate'],_0x1150d2[_0xcb0c('0x9f')]);}else{_0x219053[_0xcb0c('0x41')](_0x5a65f6[_0xcb0c('0x76')]+_0xcb0c('0xa0'),_0x1150d2['startDate'],_0x1150d2[_0xcb0c('0x9f')]);}if(_0x5561d){logger[_0xcb0c('0xa1')]('Run\x20Query:',_0x219053[_0xcb0c('0x8a')]());require('child_process')['fork'](path[_0xcb0c('0x59')](__dirname,'../../components/export/',_0x5561d['output']),[_0x5561d['id'],_0x219053[_0xcb0c('0x8a')](),path[_0xcb0c('0x59')](__dirname,_0xcb0c('0xa2'),_0x5561d[_0xcb0c('0xa3')]),_0x242fd2]);return _0x5561d;}else{var _0x5d13de=squel['select']();_0x5d13de[_0xcb0c('0x75')]('('+_0x219053[_0xcb0c('0x8a')]()+')',_0xcb0c('0xa4'));_0x5d13de['field'](_0xcb0c('0xa5'),_0xcb0c('0x1f'));_0x219053[_0xcb0c('0x1e')](_0x1150d2[_0xcb0c('0x1e')]||_0x2e062d);_0x219053[_0xcb0c('0x1c')](_0x1150d2[_0xcb0c('0x1c')]||0x0);return dbH['sequelize'][_0xcb0c('0x3c')](_0x5d13de[_0xcb0c('0x8a')](),{'type':dbH[_0xcb0c('0x8b')][_0xcb0c('0x8c')]['SELECT']})[_0xcb0c('0x25')](function(_0x2b0e19){if(!_0x2b0e19[_0xcb0c('0x39')]){_0x1748d7=0x0;}else{_0x1748d7=_0x2b0e19[0x0][_0xcb0c('0x1f')]||0x0;}return dbH[_0xcb0c('0x8b')][_0xcb0c('0x3c')](_0x219053['toString'](),{'type':dbH['sequelize'][_0xcb0c('0x8c')][_0xcb0c('0x8d')]});})[_0xcb0c('0x25')](function(_0x158123){return{'rows':_0x158123||[],'count':_0x1748d7};});}});}exports['run']=function(_0x5ab8b0,_0x384d50){return runReport(_0x5ab8b0[_0xcb0c('0x4a')],_0x5ab8b0[_0xcb0c('0x3c')],_0x5ab8b0[_0xcb0c('0x44')])['then'](respondWithResult(_0x384d50,null))[_0xcb0c('0x48')](handleError(_0x384d50,null));};exports[_0xcb0c('0xa6')]=runReport;exports[_0xcb0c('0x3c')]=function(_0x192dc2,_0xeafa3e){var _0xa6f17b=0xa;var _0x4c8f23=[_0xcb0c('0x59'),_0xcb0c('0x5a'),_0xcb0c('0x5b'),'cross_join'];var _0x257319={'SUM':_0xcb0c('0x5d'),'COUNT':_0xcb0c('0x5e'),'COUNT DISTINCT':_0xcb0c('0x5f'),'MAX':_0xcb0c('0x60'),'MIN':'MIN(%s)','AVG':_0xcb0c('0x61'),'GROUP_CONCAT':_0xcb0c('0x62'),'GROUP_CONCAT ASC':_0xcb0c('0x63'),'GROUP_CONCAT DESC':_0xcb0c('0x64')};var _0x3f945e={'SEC_TO_TIME':_0xcb0c('0x8f'),'DATE':'DATE(%s)','HOUR':_0xcb0c('0xa7'),'ROUND':_0xcb0c('0x66'),'UNIX_TIMESTAMP':_0xcb0c('0x67')};var _0x2f2fba=function(_0x5f020e){return!_[_0xcb0c('0x68')]([_0xcb0c('0x69'),_0xcb0c('0x90'),_0xcb0c('0x91'),'IS\x20NOT\x20EMPTY'],_0x5f020e);};var _0x506206=function(_0x19ce57){if(!_0x19ce57||!_0x19ce57['rules']['length']){return'';}for(var _0x420b1b='(',_0x249b05=0x0;_0x249b05<_0x19ce57[_0xcb0c('0x6b')][_0xcb0c('0x39')];_0x249b05+=0x1){_0x249b05>0x0&&(_0x420b1b+='\x20'+_0x19ce57[_0xcb0c('0x6c')]+'\x20');_0x420b1b+=_0x19ce57[_0xcb0c('0x6b')][_0x249b05][_0xcb0c('0x7d')]?_0x506206(_0x19ce57[_0xcb0c('0x6b')][_0x249b05]['group']):_0x19ce57[_0xcb0c('0x6b')][_0x249b05][_0xcb0c('0x6d')]+'\x20'+_0x19ce57[_0xcb0c('0x6b')][_0x249b05][_0xcb0c('0x6e')]+(_0x2f2fba(_0x19ce57['rules'][_0x249b05]['condition'])?'\x20'+_0x19ce57[_0xcb0c('0x6b')][_0x249b05]['value']:'');}return _0x420b1b+')';};var _0x28be92={'where':{'id':_0x192dc2[_0xcb0c('0x4a')]['id']}},_0x133613,_0x2e6a57,_0x4173b7,_0x58fa95,_0x1c1844;_0x28be92=_[_0xcb0c('0x42')]({},_0x28be92,_0x192dc2[_0xcb0c('0x44')]);return db[_0xcb0c('0x30')][_0xcb0c('0x4e')](_0x28be92)[_0xcb0c('0x25')](function(_0x4c2461){if(_0x4c2461){_0x133613=_0x4c2461;return _0x4c2461['getFields']();}return null;})[_0xcb0c('0x25')](function(_0x423f33){if(_0x423f33){if(!_0x423f33[_0xcb0c('0x39')]){throw new db[(_0xcb0c('0x70'))][(_0xcb0c('0x71'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2e6a57=_0x423f33;return db[_0xcb0c('0x72')][_0xcb0c('0x46')]({'raw':!![]});}return null;})[_0xcb0c('0x25')](function(_0x2a4851){if(_0x2a4851){_0x4173b7=_[_0xcb0c('0x73')](_0x2a4851,'id');var _0xf1ab64;var _0x208183=squel[_0xcb0c('0x74')]();_0x208183[_0xcb0c('0x75')](_0x133613['table']);for(var _0x877d98=0x0;_0x877d98<_0x2e6a57[_0xcb0c('0x39')];_0x877d98+=0x1){_0xf1ab64=_0x2e6a57[_0x877d98][_0xcb0c('0x77')]?_0x4173b7[_0x2e6a57[_0x877d98][_0xcb0c('0x77')]][_0xcb0c('0x78')]:_0x2e6a57[_0x877d98][_0xcb0c('0x6d')];_0xf1ab64=_0x2e6a57[_0x877d98][_0xcb0c('0x7a')]?_[_0xcb0c('0x79')](_0x257319[_0x2e6a57[_0x877d98][_0xcb0c('0x7a')]],'%s',_0xf1ab64):_0xf1ab64;_0xf1ab64=_0x2e6a57[_0x877d98]['format']?_[_0xcb0c('0x79')](_0x3f945e[_0x2e6a57[_0x877d98][_0xcb0c('0x7b')]],'%s',_0xf1ab64):_0xf1ab64;if(_0x2e6a57[_0x877d98][_0xcb0c('0x7c')]){_0x208183['group'](_0xf1ab64);}_0x2e6a57[_0x877d98]['orderBy']&&_0x208183['order'](_0xf1ab64,_0x2e6a57[_0x877d98][_0xcb0c('0x7e')]==='DESC'?![]:!![]);_0x208183[_0xcb0c('0x6d')](_0xf1ab64,_0x2e6a57[_0x877d98]['alias']||_0xf1ab64);}if(_0x133613[_0xcb0c('0x81')]){_0x133613[_0xcb0c('0x81')]=JSON[_0xcb0c('0x82')](_0x133613[_0xcb0c('0x81')]);for(var _0x82ee9c=0x0;_0x82ee9c<_0x133613[_0xcb0c('0x81')][_0xcb0c('0x39')];_0x82ee9c+=0x1){if(_0x133613['joins'][_0x82ee9c][_0xcb0c('0x32')]&&_[_0xcb0c('0x68')](_0x4c8f23,_0x133613[_0xcb0c('0x81')][_0x82ee9c][_0xcb0c('0x32')])&&_0x133613['joins'][_0x82ee9c]['parentKey']&&_0x133613[_0xcb0c('0x81')][_0x82ee9c]['foreignTable']&&_0x133613[_0xcb0c('0x81')][_0x82ee9c][_0xcb0c('0x86')]){_0x208183[_0x133613['joins'][_0x82ee9c][_0xcb0c('0x32')]](_0x133613['joins'][_0x82ee9c][_0xcb0c('0x84')],null,util[_0xcb0c('0x7b')](_0xcb0c('0x85'),_0x133613[_0xcb0c('0x76')],_0x133613['joins'][_0x82ee9c][_0xcb0c('0x83')],_0x133613['joins'][_0x82ee9c]['foreignTable'],_0x133613['joins'][_0x82ee9c][_0xcb0c('0x86')]));}}}if(_0x133613[_0xcb0c('0x87')]){_0x133613[_0xcb0c('0x87')]=JSON[_0xcb0c('0x82')](_0x133613['conditions']);_0x208183['where'](_0x506206(_0x133613[_0xcb0c('0x87')]['group']));}_0x1c1844=_0x208183['clone']();_0x208183[_0xcb0c('0x1e')](_0xa6f17b);_0x208183[_0xcb0c('0x1c')](0x0);logger[_0xcb0c('0x89')](_0xcb0c('0xa8'),_0x208183[_0xcb0c('0x8a')]());return dbH['sequelize'][_0xcb0c('0x3c')](_0x208183[_0xcb0c('0x8a')](),{'type':dbH[_0xcb0c('0x8b')][_0xcb0c('0x8c')][_0xcb0c('0x8d')]});}})[_0xcb0c('0x25')](function(){return{'sql':_0x1c1844['toString']()};})['then'](respondWithResult(_0xeafa3e,null))[_0xcb0c('0x48')](handleError(_0xeafa3e,null));};
\ No newline at end of file
+var _0xae3f=['../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','update','then','get','UserProfileResource','destroy','error','stack','index','AnalyticCustomReport','fieldName','type','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','params','rawAttributes','includeAll','catch','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Reports','UserProfileSection','find','userProfileId','autoAssociation','create','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','table','MetricId','metric','field','function','format','replace','orderBy','DESC','joins','parse','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','IS\x20NOT\x20NULL','Sequelize','groupBy','alias','parentKey','web','fullPath','%s-%s.%s','generate','output','csv','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','IS\x20NULL','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x13b593,_0x85a736){var _0x1d2958=function(_0x371387){while(--_0x371387){_0x13b593['push'](_0x13b593['shift']());}};_0x1d2958(++_0x85a736);}(_0xae3f,0x136));var _0xfae3=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0xae3f[_0x307d86];return _0x361745;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfae3('0x0'));var zipdir=require(_0xfae3('0x1'));var jsonpatch=require(_0xfae3('0x2'));var rp=require(_0xfae3('0x3'));var moment=require(_0xfae3('0x4'));var BPromise=require(_0xfae3('0x5'));var Mustache=require(_0xfae3('0x6'));var util=require(_0xfae3('0x7'));var path=require(_0xfae3('0x8'));var sox=require(_0xfae3('0x9'));var csv=require(_0xfae3('0xa'));var ejs=require(_0xfae3('0xb'));var fs=require('fs');var fs_extra=require(_0xfae3('0xc'));var _=require(_0xfae3('0xd'));var squel=require('squel');var crypto=require(_0xfae3('0xe'));var jsforce=require(_0xfae3('0xf'));var deskjs=require(_0xfae3('0x10'));var toCsv=require(_0xfae3('0xa'));var querystring=require(_0xfae3('0x11'));var Papa=require(_0xfae3('0x12'));var Redis=require('ioredis');var authService=require(_0xfae3('0x13'));var qs=require(_0xfae3('0x14'));var as=require(_0xfae3('0x15'));var hardwareService=require(_0xfae3('0x16'));var logger=require(_0xfae3('0x17'))(_0xfae3('0x18'));var utils=require(_0xfae3('0x19'));var config=require(_0xfae3('0x1a'));var licenseUtil=require(_0xfae3('0x1b'));var db=require(_0xfae3('0x1c'))['db'];var dbH=require(_0xfae3('0x1c'))[_0xfae3('0x1d')];function respondWithStatusCode(_0x9ffdf,_0x5d9d21){_0x5d9d21=_0x5d9d21||0xcc;return function(_0x5059bf){if(_0x5059bf){return _0x9ffdf[_0xfae3('0x1e')](_0x5d9d21);}return _0x9ffdf[_0xfae3('0x1f')](_0x5d9d21)[_0xfae3('0x20')]();};}function respondWithResult(_0x394dbd,_0x232e83){_0x232e83=_0x232e83||0xc8;return function(_0x50dcfb){if(_0x50dcfb){return _0x394dbd['status'](_0x232e83)[_0xfae3('0x21')](_0x50dcfb);}};}function respondWithFilteredResult(_0x308fda,_0x285866){return function(_0x50dd0a){if(_0x50dd0a){var _0xaf7bf5=typeof _0x285866[_0xfae3('0x22')]==='undefined'&&typeof _0x285866[_0xfae3('0x23')]===_0xfae3('0x24');var _0x49e223=_0x50dd0a['count'];var _0x51e519=_0xaf7bf5?0x0:_0x285866[_0xfae3('0x22')];var _0x50d0ef=_0xaf7bf5?_0x50dd0a[_0xfae3('0x25')]:_0x285866[_0xfae3('0x22')]+_0x285866['limit'];var _0x2114ca;if(_0x50d0ef>=_0x49e223){_0x50d0ef=_0x49e223;_0x2114ca=0xc8;}else{_0x2114ca=0xce;}_0x308fda[_0xfae3('0x1f')](_0x2114ca);return _0x308fda['set'](_0xfae3('0x26'),_0x51e519+'-'+_0x50d0ef+'/'+_0x49e223)[_0xfae3('0x21')](_0x50dd0a);}return null;};}function patchUpdates(_0x47d937){return function(_0x4b568c){try{jsonpatch[_0xfae3('0x27')](_0x4b568c,_0x47d937,!![]);}catch(_0x53dc40){return BPromise[_0xfae3('0x28')](_0x53dc40);}return _0x4b568c['save']();};}function saveUpdates(_0x1bb0b6,_0x41fe40){return function(_0x196833){if(_0x196833){return _0x196833[_0xfae3('0x29')](_0x1bb0b6)[_0xfae3('0x2a')](function(_0x15419a){return _0x15419a;});}return null;};}function removeEntity(_0x2fa4b8,_0x1f22c4){return function(_0x3eef44){if(_0x3eef44){return _0x3eef44['destroy']()[_0xfae3('0x2a')](function(){var _0x4f0f55=_0x3eef44[_0xfae3('0x2b')]({'plain':!![]});var _0x492926='CustomReports';return db[_0xfae3('0x2c')][_0xfae3('0x2d')]({'where':{'type':_0x492926,'resourceId':_0x4f0f55['id']}})['then'](function(){return _0x3eef44;});})[_0xfae3('0x2a')](function(){_0x2fa4b8['status'](0xcc)[_0xfae3('0x20')]();});}};}function handleEntityNotFound(_0x4c6d78,_0x392930){return function(_0x54a5e2){if(!_0x54a5e2){_0x4c6d78[_0xfae3('0x1e')](0x194);}return _0x54a5e2;};}function handleError(_0x29467f,_0x1d394f){_0x1d394f=_0x1d394f||0x1f4;return function(_0x281250){logger[_0xfae3('0x2e')](_0x281250[_0xfae3('0x2f')]);if(_0x281250['name']){delete _0x281250['name'];}_0x29467f[_0xfae3('0x1f')](_0x1d394f)['send'](_0x281250);};}exports[_0xfae3('0x30')]=function(_0x2207b1,_0x3a051c){var _0x3e179c={},_0x28d1ef={},_0x4a5b1b={'count':0x0,'rows':[]};var _0x15854b=_['map'](db[_0xfae3('0x31')]['rawAttributes'],function(_0x224637){return{'name':_0x224637[_0xfae3('0x32')],'type':_0x224637[_0xfae3('0x33')]['key']};});_0x28d1ef[_0xfae3('0x34')]=_[_0xfae3('0x35')](_0x15854b,_0xfae3('0x36'));_0x28d1ef[_0xfae3('0x37')]=_[_0xfae3('0x38')](_0x2207b1[_0xfae3('0x37')]);_0x28d1ef[_0xfae3('0x39')]=_[_0xfae3('0x3a')](_0x28d1ef[_0xfae3('0x34')],_0x28d1ef['query']);_0x3e179c[_0xfae3('0x3b')]=_[_0xfae3('0x3a')](_0x28d1ef[_0xfae3('0x34')],qs[_0xfae3('0x3c')](_0x2207b1[_0xfae3('0x37')]['fields']));_0x3e179c[_0xfae3('0x3b')]=_0x3e179c[_0xfae3('0x3b')][_0xfae3('0x3d')]?_0x3e179c[_0xfae3('0x3b')]:_0x28d1ef['model'];if(!_0x2207b1[_0xfae3('0x37')][_0xfae3('0x3e')]('nolimit')){_0x3e179c[_0xfae3('0x23')]=qs[_0xfae3('0x23')](_0x2207b1[_0xfae3('0x37')]['limit']);_0x3e179c[_0xfae3('0x22')]=qs[_0xfae3('0x22')](_0x2207b1['query']['offset']);}_0x3e179c[_0xfae3('0x3f')]=qs[_0xfae3('0x40')](_0x2207b1['query'][_0xfae3('0x40')]);_0x3e179c[_0xfae3('0x41')]=qs[_0xfae3('0x39')](_[_0xfae3('0x42')](_0x2207b1['query'],_0x28d1ef[_0xfae3('0x39')]),_0x15854b);if(_0x2207b1['query'][_0xfae3('0x43')]){_0x3e179c[_0xfae3('0x41')]=_[_0xfae3('0x44')](_0x3e179c[_0xfae3('0x41')],{'$or':_[_0xfae3('0x35')](_0x15854b,function(_0x35a5b4){if(_0x35a5b4['type']!==_0xfae3('0x45')){var _0x5ac248={};_0x5ac248[_0x35a5b4[_0xfae3('0x36')]]={'$like':'%'+_0x2207b1[_0xfae3('0x37')][_0xfae3('0x43')]+'%'};return _0x5ac248;}})});}_0x3e179c=_[_0xfae3('0x44')]({},_0x3e179c,_0x2207b1[_0xfae3('0x46')]);var _0x450a55={'where':_0x3e179c[_0xfae3('0x41')]};return db['AnalyticCustomReport'][_0xfae3('0x25')](_0x450a55)[_0xfae3('0x2a')](function(_0x2efc2d){_0x4a5b1b[_0xfae3('0x25')]=_0x2efc2d;if(_0x2207b1[_0xfae3('0x37')]['includeAll']){_0x3e179c[_0xfae3('0x47')]=[{'all':!![]}];}return db[_0xfae3('0x31')]['findAll'](_0x3e179c);})[_0xfae3('0x2a')](function(_0x5d6f20){_0x4a5b1b[_0xfae3('0x48')]=_0x5d6f20;return _0x4a5b1b;})[_0xfae3('0x2a')](respondWithFilteredResult(_0x3a051c,_0x3e179c))['catch'](handleError(_0x3a051c,null));};exports['show']=function(_0x1194b5,_0x3a36d7){var _0x1cb7d3={'raw':![],'where':{'id':_0x1194b5[_0xfae3('0x49')]['id']}},_0x155ff0={};_0x155ff0[_0xfae3('0x34')]=_[_0xfae3('0x38')](db[_0xfae3('0x31')][_0xfae3('0x4a')]);_0x155ff0[_0xfae3('0x37')]=_['keys'](_0x1194b5[_0xfae3('0x37')]);_0x155ff0['filters']=_[_0xfae3('0x3a')](_0x155ff0[_0xfae3('0x34')],_0x155ff0[_0xfae3('0x37')]);_0x1cb7d3[_0xfae3('0x3b')]=_['intersection'](_0x155ff0['model'],qs[_0xfae3('0x3c')](_0x1194b5[_0xfae3('0x37')][_0xfae3('0x3c')]));_0x1cb7d3['attributes']=_0x1cb7d3[_0xfae3('0x3b')][_0xfae3('0x3d')]?_0x1cb7d3['attributes']:_0x155ff0[_0xfae3('0x34')];if(_0x1194b5['query'][_0xfae3('0x4b')]){_0x1cb7d3[_0xfae3('0x47')]=[{'all':!![]}];}_0x1cb7d3=_[_0xfae3('0x44')]({},_0x1cb7d3,_0x1194b5[_0xfae3('0x46')]);return db[_0xfae3('0x31')]['find'](_0x1cb7d3)[_0xfae3('0x2a')](handleEntityNotFound(_0x3a36d7,null))['then'](respondWithResult(_0x3a36d7,null))[_0xfae3('0x4c')](handleError(_0x3a36d7,null));};exports['create']=function(_0x29f08a,_0x3709dc){return db[_0xfae3('0x31')]['create'](_0x29f08a['body'],{})['then'](function(_0x18c03d){var _0x42098e=_0x29f08a['user'][_0xfae3('0x2b')]({'plain':!![]});if(!_0x42098e)throw new Error(_0xfae3('0x4d'));if(_0x42098e['role']===_0xfae3('0x4e')){var _0x267e7d=_0x18c03d['get']({'plain':!![]});var _0x5e44a9=_0xfae3('0x4f');return db[_0xfae3('0x50')][_0xfae3('0x51')]({'where':{'name':_0x5e44a9,'userProfileId':_0x42098e[_0xfae3('0x52')]},'raw':!![]})[_0xfae3('0x2a')](function(_0x5832a6){if(_0x5832a6&&_0x5832a6[_0xfae3('0x53')]===0x0){return db[_0xfae3('0x2c')][_0xfae3('0x54')]({'name':_0x267e7d[_0xfae3('0x36')],'resourceId':_0x267e7d['id'],'type':_0xfae3('0x55'),'sectionId':_0x5832a6['id']},{})[_0xfae3('0x2a')](function(){return _0x18c03d;});}else{return _0x18c03d;}})[_0xfae3('0x4c')](function(_0x2abb10){logger[_0xfae3('0x2e')](_0xfae3('0x56'),_0x2abb10);throw _0x2abb10;});}return _0x18c03d;})['then'](respondWithResult(_0x3709dc,0xc9))[_0xfae3('0x4c')](handleError(_0x3709dc,null));};exports[_0xfae3('0x29')]=function(_0x38a1b6,_0x48d496){if(_0x38a1b6[_0xfae3('0x57')]['id']){delete _0x38a1b6[_0xfae3('0x57')]['id'];}return db[_0xfae3('0x31')][_0xfae3('0x51')]({'where':{'id':_0x38a1b6['params']['id']}})[_0xfae3('0x2a')](handleEntityNotFound(_0x48d496,null))[_0xfae3('0x2a')](saveUpdates(_0x38a1b6['body'],null))['then'](respondWithResult(_0x48d496,null))[_0xfae3('0x4c')](handleError(_0x48d496,null));};exports[_0xfae3('0x2d')]=function(_0x56abbf,_0x48e0de){return db['AnalyticCustomReport']['find']({'where':{'id':_0x56abbf[_0xfae3('0x49')]['id']}})[_0xfae3('0x2a')](handleEntityNotFound(_0x48e0de,null))[_0xfae3('0x2a')](removeEntity(_0x48e0de,null))[_0xfae3('0x4c')](handleError(_0x48e0de,null));};exports[_0xfae3('0x58')]=function(_0x4a8b4f,_0x3f4f60){var _0x4b6b91=0xa;var _0x423479=[_0xfae3('0x59'),_0xfae3('0x5a'),_0xfae3('0x5b'),_0xfae3('0x5c')];var _0x4f7c78={'SUM':_0xfae3('0x5d'),'COUNT':_0xfae3('0x5e'),'COUNT DISTINCT':_0xfae3('0x5f'),'MAX':_0xfae3('0x60'),'MIN':_0xfae3('0x61'),'AVG':_0xfae3('0x62'),'GROUP_CONCAT':_0xfae3('0x63'),'GROUP_CONCAT ASC':_0xfae3('0x64'),'GROUP_CONCAT DESC':_0xfae3('0x65')};var _0x131b35={'SEC_TO_TIME':_0xfae3('0x66'),'DATE':'DATE(%s)','HOUR':_0xfae3('0x67'),'ROUND':_0xfae3('0x68'),'UNIX_TIMESTAMP':_0xfae3('0x69')};var _0x879fe3=function(_0x702267){return!_[_0xfae3('0x6a')](['IS\x20NULL','IS\x20NOT\x20NULL',_0xfae3('0x6b'),_0xfae3('0x6c')],_0x702267);};var _0x3dab79=function(_0x2c8751){if(!_0x2c8751||!_0x2c8751[_0xfae3('0x6d')]['length']){return'';}for(var _0x2f70d9='(',_0x14133c=0x0;_0x14133c<_0x2c8751[_0xfae3('0x6d')][_0xfae3('0x3d')];_0x14133c+=0x1){_0x14133c>0x0&&(_0x2f70d9+='\x20'+_0x2c8751[_0xfae3('0x6e')]+'\x20');_0x2f70d9+=_0x2c8751[_0xfae3('0x6d')][_0x14133c][_0xfae3('0x6f')]?_0x3dab79(_0x2c8751[_0xfae3('0x6d')][_0x14133c][_0xfae3('0x6f')]):_0x2c8751['rules'][_0x14133c]['field']+'\x20'+_0x2c8751['rules'][_0x14133c][_0xfae3('0x70')]+(_0x879fe3(_0x2c8751[_0xfae3('0x6d')][_0x14133c]['condition'])?'\x20'+_0x2c8751[_0xfae3('0x6d')][_0x14133c][_0xfae3('0x71')]:'');}return _0x2f70d9+')';};var _0x39f9fc={'where':{'id':_0x4a8b4f[_0xfae3('0x49')]['id']}},_0x55557f,_0x2f5640,_0x580d49,_0x4fb71e,_0x12255e;_0x39f9fc=_['merge']({},_0x39f9fc,_0x4a8b4f[_0xfae3('0x46')]);return db['AnalyticCustomReport'][_0xfae3('0x51')](_0x39f9fc)[_0xfae3('0x2a')](function(_0x1c5358){if(_0x1c5358){_0x55557f=_0x1c5358;return _0x1c5358[_0xfae3('0x72')]();}return null;})[_0xfae3('0x2a')](function(_0x441c37){if(_0x441c37){if(!_0x441c37[_0xfae3('0x3d')]){throw new db['Sequelize'][(_0xfae3('0x73'))](_0xfae3('0x74'),0x193);}_0x2f5640=_0x441c37;return db[_0xfae3('0x75')][_0xfae3('0x76')]({'raw':!![]});}return null;})[_0xfae3('0x2a')](function(_0x1e08d1){if(_0x1e08d1){_0x580d49=_[_0xfae3('0x77')](_0x1e08d1,'id');var _0x2abf4e;var _0x43c0f0=squel[_0xfae3('0x78')]();_0x43c0f0[_0xfae3('0x79')](_0x55557f[_0xfae3('0x7a')]);for(var _0xd6b5bd=0x0;_0xd6b5bd<_0x2f5640[_0xfae3('0x3d')];_0xd6b5bd+=0x1){_0x2abf4e=_0x2f5640[_0xd6b5bd][_0xfae3('0x7b')]?_0x580d49[_0x2f5640[_0xd6b5bd][_0xfae3('0x7b')]][_0xfae3('0x7c')]:_0x2f5640[_0xd6b5bd][_0xfae3('0x7d')];_0x2abf4e=_0x2f5640[_0xd6b5bd][_0xfae3('0x7e')]?_['replace'](_0x4f7c78[_0x2f5640[_0xd6b5bd][_0xfae3('0x7e')]],'%s',_0x2abf4e):_0x2abf4e;_0x2abf4e=_0x2f5640[_0xd6b5bd][_0xfae3('0x7f')]?_[_0xfae3('0x80')](_0x131b35[_0x2f5640[_0xd6b5bd][_0xfae3('0x7f')]],'%s',_0x2abf4e):_0x2abf4e;if(_0x2f5640[_0xd6b5bd]['groupBy']){_0x43c0f0[_0xfae3('0x6f')](_0x2abf4e);}_0x2f5640[_0xd6b5bd][_0xfae3('0x81')]&&_0x43c0f0[_0xfae3('0x3f')](_0x2abf4e,_0x2f5640[_0xd6b5bd][_0xfae3('0x81')]===_0xfae3('0x82')?![]:!![]);_0x43c0f0[_0xfae3('0x7d')](_0x2abf4e,_0x2f5640[_0xd6b5bd]['alias']||_0x2abf4e);}if(_0x55557f['joins']){_0x55557f[_0xfae3('0x83')]=JSON[_0xfae3('0x84')](_0x55557f[_0xfae3('0x83')]);for(var _0x5c56a6=0x0;_0x5c56a6<_0x55557f[_0xfae3('0x83')]['length'];_0x5c56a6+=0x1){if(_0x55557f[_0xfae3('0x83')][_0x5c56a6][_0xfae3('0x33')]&&_['includes'](_0x423479,_0x55557f['joins'][_0x5c56a6][_0xfae3('0x33')])&&_0x55557f['joins'][_0x5c56a6]['parentKey']&&_0x55557f[_0xfae3('0x83')][_0x5c56a6][_0xfae3('0x85')]&&_0x55557f[_0xfae3('0x83')][_0x5c56a6]['foreignKey']){_0x43c0f0[_0x55557f[_0xfae3('0x83')][_0x5c56a6][_0xfae3('0x33')]](_0x55557f[_0xfae3('0x83')][_0x5c56a6][_0xfae3('0x85')],null,util[_0xfae3('0x7f')](_0xfae3('0x86'),_0x55557f[_0xfae3('0x7a')],_0x55557f[_0xfae3('0x83')][_0x5c56a6]['parentKey'],_0x55557f[_0xfae3('0x83')][_0x5c56a6][_0xfae3('0x85')],_0x55557f[_0xfae3('0x83')][_0x5c56a6][_0xfae3('0x87')]));}}}if(_0x55557f[_0xfae3('0x88')]){_0x55557f[_0xfae3('0x88')]=JSON[_0xfae3('0x84')](_0x55557f[_0xfae3('0x88')]);_0x43c0f0['where'](_0x3dab79(_0x55557f[_0xfae3('0x88')]['group']));}_0x12255e=_0x43c0f0[_0xfae3('0x89')]();_0x43c0f0[_0xfae3('0x23')](_0x4b6b91);_0x43c0f0['offset'](0x0);logger[_0xfae3('0x8a')](_0xfae3('0x8b'),_0x43c0f0[_0xfae3('0x8c')]());return dbH[_0xfae3('0x8d')][_0xfae3('0x37')](_0x43c0f0[_0xfae3('0x8c')](),{'type':dbH['sequelize'][_0xfae3('0x8e')][_0xfae3('0x8f')]});}})['then'](respondWithResult(_0x3f4f60,null))[_0xfae3('0x4c')](handleError(_0x3f4f60,null));};function runReport(_0x1bd229,_0x42d73a,_0x3e446c){var _0x168e45=_0x42d73a['name'];var _0x435cf0=0xa;var _0x4689cf=[_0xfae3('0x59'),_0xfae3('0x5a'),_0xfae3('0x5b'),_0xfae3('0x5c')];var _0x3fa5cc={'SUM':'SUM(%s)','COUNT':_0xfae3('0x5e'),'COUNT DISTINCT':_0xfae3('0x5f'),'MAX':_0xfae3('0x60'),'MIN':_0xfae3('0x61'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xfae3('0x63'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x3670d4={'SEC_TO_TIME':_0xfae3('0x66'),'DATE':'DATE(%s)','HOUR':_0xfae3('0x67'),'ROUND':_0xfae3('0x68'),'UNIX_TIMESTAMP':_0xfae3('0x69')};var _0x514aaa=function(_0x4da23b){return!_[_0xfae3('0x6a')](['IS\x20NULL',_0xfae3('0x90'),_0xfae3('0x6b'),_0xfae3('0x6c')],_0x4da23b);};var _0x50c1e5=function(_0x1e0ced){if(!_0x1e0ced||!_0x1e0ced[_0xfae3('0x6d')]['length']){return'';}for(var _0xfb77b9='(',_0x26f42b=0x0;_0x26f42b<_0x1e0ced[_0xfae3('0x6d')]['length'];_0x26f42b+=0x1){_0x26f42b>0x0&&(_0xfb77b9+='\x20'+_0x1e0ced[_0xfae3('0x6e')]+'\x20');_0xfb77b9+=_0x1e0ced[_0xfae3('0x6d')][_0x26f42b][_0xfae3('0x6f')]?_0x50c1e5(_0x1e0ced[_0xfae3('0x6d')][_0x26f42b][_0xfae3('0x6f')]):_0x1e0ced[_0xfae3('0x6d')][_0x26f42b][_0xfae3('0x7d')]+'\x20'+_0x1e0ced[_0xfae3('0x6d')][_0x26f42b][_0xfae3('0x70')]+(_0x514aaa(_0x1e0ced[_0xfae3('0x6d')][_0x26f42b][_0xfae3('0x70')])?'\x20'+_0x1e0ced[_0xfae3('0x6d')][_0x26f42b][_0xfae3('0x71')]:'');}return _0xfb77b9+')';};var _0x300b96={'where':{'id':_0x1bd229['id']}},_0x1accbd,_0x4a205c,_0x108e88,_0x44113c,_0x1d2688;_0x300b96=_[_0xfae3('0x44')]({},_0x300b96,_0x3e446c);return db['AnalyticCustomReport'][_0xfae3('0x51')](_0x300b96)[_0xfae3('0x2a')](function(_0x7f1bb2){if(_0x7f1bb2){_0x1accbd=_0x7f1bb2;return _0x7f1bb2[_0xfae3('0x72')]();}return null;})[_0xfae3('0x2a')](function(_0x8a611a){if(_0x8a611a){if(!_0x8a611a[_0xfae3('0x3d')]){throw new db[(_0xfae3('0x91'))]['ValidationErrorItem'](_0xfae3('0x74'),0x193);}_0x4a205c=_0x8a611a;return db[_0xfae3('0x75')][_0xfae3('0x76')]({'raw':!![]});}return null;})['then'](function(_0x179777){if(_0x179777){_0x108e88=_[_0xfae3('0x77')](_0x179777,'id');var _0x50a40d;var _0x274957=squel[_0xfae3('0x78')]();_0x274957[_0xfae3('0x79')](_0x1accbd['table']);for(var _0x3851cd=0x0;_0x3851cd<_0x4a205c['length'];_0x3851cd+=0x1){_0x50a40d=_0x4a205c[_0x3851cd][_0xfae3('0x7b')]?_0x108e88[_0x4a205c[_0x3851cd][_0xfae3('0x7b')]]['metric']:_0x4a205c[_0x3851cd][_0xfae3('0x7d')];_0x50a40d=_0x4a205c[_0x3851cd][_0xfae3('0x7e')]?_['replace'](_0x3fa5cc[_0x4a205c[_0x3851cd]['function']],'%s',_0x50a40d):_0x50a40d;_0x50a40d=_0x4a205c[_0x3851cd]['format']?_['replace'](_0x3670d4[_0x4a205c[_0x3851cd][_0xfae3('0x7f')]],'%s',_0x50a40d):_0x50a40d;if(_0x4a205c[_0x3851cd][_0xfae3('0x92')]){_0x274957[_0xfae3('0x6f')](_0x50a40d);}_0x4a205c[_0x3851cd][_0xfae3('0x81')]&&_0x274957[_0xfae3('0x3f')](_0x50a40d,_0x4a205c[_0x3851cd][_0xfae3('0x81')]===_0xfae3('0x82')?![]:!![]);_0x274957['field'](_0x50a40d,_0x4a205c[_0x3851cd][_0xfae3('0x93')]||_0x50a40d);}if(_0x1accbd[_0xfae3('0x83')]){_0x1accbd[_0xfae3('0x83')]=JSON['parse'](_0x1accbd[_0xfae3('0x83')]);for(var _0x33880b=0x0;_0x33880b<_0x1accbd[_0xfae3('0x83')][_0xfae3('0x3d')];_0x33880b+=0x1){if(_0x1accbd[_0xfae3('0x83')][_0x33880b]['type']&&_['includes'](_0x4689cf,_0x1accbd[_0xfae3('0x83')][_0x33880b][_0xfae3('0x33')])&&_0x1accbd[_0xfae3('0x83')][_0x33880b]['parentKey']&&_0x1accbd[_0xfae3('0x83')][_0x33880b][_0xfae3('0x85')]&&_0x1accbd['joins'][_0x33880b][_0xfae3('0x87')]){_0x274957[_0x1accbd['joins'][_0x33880b][_0xfae3('0x33')]](_0x1accbd[_0xfae3('0x83')][_0x33880b][_0xfae3('0x85')],null,util[_0xfae3('0x7f')](_0xfae3('0x86'),_0x1accbd[_0xfae3('0x7a')],_0x1accbd[_0xfae3('0x83')][_0x33880b][_0xfae3('0x94')],_0x1accbd['joins'][_0x33880b][_0xfae3('0x85')],_0x1accbd[_0xfae3('0x83')][_0x33880b][_0xfae3('0x87')]));}}}if(_0x1accbd['conditions']){_0x1accbd['conditions']=JSON[_0xfae3('0x84')](_0x1accbd['conditions']);_0x274957[_0xfae3('0x41')](_0x50c1e5(_0x1accbd[_0xfae3('0x88')][_0xfae3('0x6f')]));}_0x1d2688=_0x274957[_0xfae3('0x89')]();_0x274957[_0xfae3('0x23')](_0x435cf0);_0x274957[_0xfae3('0x22')](0x0);return;}})['then'](function(){if(_0x42d73a['output']===_0xfae3('0x95')){return null;}var _0x5126b0=_[_0xfae3('0x44')](_0x42d73a,{'name':_0x42d73a[_0xfae3('0x96')]||_0x42d73a[_0xfae3('0x36')]||_0x1accbd[_0xfae3('0x36')],'basename':_0x168e45,'savename':util[_0xfae3('0x7f')](_0xfae3('0x97'),_0x42d73a[_0xfae3('0x36')]||_0x1accbd[_0xfae3('0x36')],require('randomstring')[_0xfae3('0x98')](0x4),_0x42d73a[_0xfae3('0x99')]||_0xfae3('0x9a')),'reportId':_0x1accbd['id'],'reportType':'custom'});return db['AnalyticExtractedReport'][_0xfae3('0x54')](_0x5126b0,{'raw':!![]});})[_0xfae3('0x2a')](function(_0x1e8b8c){if(_0x1accbd[_0xfae3('0x7a')]===_0xfae3('0x9b')){_0x1d2688[_0xfae3('0x41')](_0x1accbd[_0xfae3('0x7a')]+_0xfae3('0x9c'),_0x42d73a[_0xfae3('0x9d')],_0x42d73a[_0xfae3('0x9e')]);}else{_0x1d2688['where'](_0x1accbd[_0xfae3('0x7a')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x42d73a[_0xfae3('0x9d')],_0x42d73a['endDate']);}if(_0x1e8b8c){logger[_0xfae3('0x9f')](_0xfae3('0xa0'),_0x1d2688[_0xfae3('0x8c')]());require(_0xfae3('0xa1'))[_0xfae3('0xa2')](path['join'](__dirname,_0xfae3('0xa3'),_0x1e8b8c[_0xfae3('0x99')]),[_0x1e8b8c['id'],_0x1d2688[_0xfae3('0x8c')](),path[_0xfae3('0x59')](__dirname,_0xfae3('0xa4'),_0x1e8b8c[_0xfae3('0xa5')]),_0x168e45]);return _0x1e8b8c;}else{var _0x408f09=squel['select']();_0x408f09[_0xfae3('0x79')]('('+_0x1d2688[_0xfae3('0x8c')]()+')',_0xfae3('0xa6'));_0x408f09[_0xfae3('0x7d')]('COUNT(*)',_0xfae3('0x25'));_0x1d2688[_0xfae3('0x23')](_0x42d73a[_0xfae3('0x23')]||_0x435cf0);_0x1d2688[_0xfae3('0x22')](_0x42d73a[_0xfae3('0x22')]||0x0);return dbH['sequelize'][_0xfae3('0x37')](_0x408f09['toString'](),{'type':dbH[_0xfae3('0x8d')][_0xfae3('0x8e')]['SELECT']})[_0xfae3('0x2a')](function(_0x22a5bc){if(!_0x22a5bc[_0xfae3('0x3d')]){_0x44113c=0x0;}else{_0x44113c=_0x22a5bc[0x0][_0xfae3('0x25')]||0x0;}return dbH[_0xfae3('0x8d')][_0xfae3('0x37')](_0x1d2688[_0xfae3('0x8c')](),{'type':dbH[_0xfae3('0x8d')]['QueryTypes'][_0xfae3('0x8f')]});})[_0xfae3('0x2a')](function(_0x3e9e62){return{'rows':_0x3e9e62||[],'count':_0x44113c};});}});}exports['run']=function(_0x21dbf4,_0x4ba361){return runReport(_0x21dbf4['params'],_0x21dbf4[_0xfae3('0x37')],_0x21dbf4[_0xfae3('0x46')])[_0xfae3('0x2a')](respondWithResult(_0x4ba361,null))['catch'](handleError(_0x4ba361,null));};exports['runReport']=runReport;exports[_0xfae3('0x37')]=function(_0x34196c,_0x5ad14e){var _0x56bff2=0xa;var _0x5a31d4=['join',_0xfae3('0x5a'),_0xfae3('0x5b'),'cross_join'];var _0x48bf45={'SUM':_0xfae3('0x5d'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xfae3('0x61'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xfae3('0x63'),'GROUP_CONCAT ASC':_0xfae3('0x64'),'GROUP_CONCAT DESC':_0xfae3('0x65')};var _0x13b48f={'SEC_TO_TIME':_0xfae3('0x66'),'DATE':'DATE(%s)','HOUR':_0xfae3('0x67'),'ROUND':_0xfae3('0x68'),'UNIX_TIMESTAMP':_0xfae3('0x69')};var _0x2e6cc2=function(_0x4f9d1b){return!_['includes']([_0xfae3('0xa7'),_0xfae3('0x90'),'IS\x20EMPTY',_0xfae3('0x6c')],_0x4f9d1b);};var _0x360cc8=function(_0x1a436d){if(!_0x1a436d||!_0x1a436d[_0xfae3('0x6d')][_0xfae3('0x3d')]){return'';}for(var _0x1418c5='(',_0x4864f8=0x0;_0x4864f8<_0x1a436d[_0xfae3('0x6d')][_0xfae3('0x3d')];_0x4864f8+=0x1){_0x4864f8>0x0&&(_0x1418c5+='\x20'+_0x1a436d[_0xfae3('0x6e')]+'\x20');_0x1418c5+=_0x1a436d[_0xfae3('0x6d')][_0x4864f8][_0xfae3('0x6f')]?_0x360cc8(_0x1a436d[_0xfae3('0x6d')][_0x4864f8]['group']):_0x1a436d['rules'][_0x4864f8][_0xfae3('0x7d')]+'\x20'+_0x1a436d[_0xfae3('0x6d')][_0x4864f8]['condition']+(_0x2e6cc2(_0x1a436d['rules'][_0x4864f8][_0xfae3('0x70')])?'\x20'+_0x1a436d['rules'][_0x4864f8][_0xfae3('0x71')]:'');}return _0x1418c5+')';};var _0x14cb0a={'where':{'id':_0x34196c[_0xfae3('0x49')]['id']}},_0x1e9449,_0x2f608c,_0x5c5f56,_0xd38be6,_0x35d19c;_0x14cb0a=_[_0xfae3('0x44')]({},_0x14cb0a,_0x34196c['options']);return db['AnalyticCustomReport'][_0xfae3('0x51')](_0x14cb0a)[_0xfae3('0x2a')](function(_0x1ef244){if(_0x1ef244){_0x1e9449=_0x1ef244;return _0x1ef244['getFields']();}return null;})[_0xfae3('0x2a')](function(_0x46bf48){if(_0x46bf48){if(!_0x46bf48[_0xfae3('0x3d')]){throw new db['Sequelize'][(_0xfae3('0x73'))](_0xfae3('0x74'),0x193);}_0x2f608c=_0x46bf48;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xfae3('0x2a')](function(_0x5b1a08){if(_0x5b1a08){_0x5c5f56=_[_0xfae3('0x77')](_0x5b1a08,'id');var _0x1405b8;var _0x21db01=squel[_0xfae3('0x78')]();_0x21db01['from'](_0x1e9449[_0xfae3('0x7a')]);for(var _0x4289af=0x0;_0x4289af<_0x2f608c[_0xfae3('0x3d')];_0x4289af+=0x1){_0x1405b8=_0x2f608c[_0x4289af][_0xfae3('0x7b')]?_0x5c5f56[_0x2f608c[_0x4289af][_0xfae3('0x7b')]][_0xfae3('0x7c')]:_0x2f608c[_0x4289af][_0xfae3('0x7d')];_0x1405b8=_0x2f608c[_0x4289af]['function']?_[_0xfae3('0x80')](_0x48bf45[_0x2f608c[_0x4289af][_0xfae3('0x7e')]],'%s',_0x1405b8):_0x1405b8;_0x1405b8=_0x2f608c[_0x4289af][_0xfae3('0x7f')]?_['replace'](_0x13b48f[_0x2f608c[_0x4289af]['format']],'%s',_0x1405b8):_0x1405b8;if(_0x2f608c[_0x4289af][_0xfae3('0x92')]){_0x21db01['group'](_0x1405b8);}_0x2f608c[_0x4289af]['orderBy']&&_0x21db01['order'](_0x1405b8,_0x2f608c[_0x4289af][_0xfae3('0x81')]===_0xfae3('0x82')?![]:!![]);_0x21db01[_0xfae3('0x7d')](_0x1405b8,_0x2f608c[_0x4289af][_0xfae3('0x93')]||_0x1405b8);}if(_0x1e9449[_0xfae3('0x83')]){_0x1e9449['joins']=JSON[_0xfae3('0x84')](_0x1e9449[_0xfae3('0x83')]);for(var _0x49a374=0x0;_0x49a374<_0x1e9449[_0xfae3('0x83')][_0xfae3('0x3d')];_0x49a374+=0x1){if(_0x1e9449[_0xfae3('0x83')][_0x49a374]['type']&&_[_0xfae3('0x6a')](_0x5a31d4,_0x1e9449[_0xfae3('0x83')][_0x49a374]['type'])&&_0x1e9449[_0xfae3('0x83')][_0x49a374][_0xfae3('0x94')]&&_0x1e9449[_0xfae3('0x83')][_0x49a374][_0xfae3('0x85')]&&_0x1e9449[_0xfae3('0x83')][_0x49a374][_0xfae3('0x87')]){_0x21db01[_0x1e9449[_0xfae3('0x83')][_0x49a374][_0xfae3('0x33')]](_0x1e9449['joins'][_0x49a374][_0xfae3('0x85')],null,util[_0xfae3('0x7f')](_0xfae3('0x86'),_0x1e9449[_0xfae3('0x7a')],_0x1e9449[_0xfae3('0x83')][_0x49a374]['parentKey'],_0x1e9449['joins'][_0x49a374][_0xfae3('0x85')],_0x1e9449[_0xfae3('0x83')][_0x49a374][_0xfae3('0x87')]));}}}if(_0x1e9449['conditions']){_0x1e9449[_0xfae3('0x88')]=JSON['parse'](_0x1e9449[_0xfae3('0x88')]);_0x21db01[_0xfae3('0x41')](_0x360cc8(_0x1e9449['conditions'][_0xfae3('0x6f')]));}_0x35d19c=_0x21db01[_0xfae3('0x89')]();_0x21db01[_0xfae3('0x23')](_0x56bff2);_0x21db01[_0xfae3('0x22')](0x0);logger['debug'](_0xfae3('0x8b'),_0x21db01[_0xfae3('0x8c')]());return dbH['sequelize']['query'](_0x21db01[_0xfae3('0x8c')](),{'type':dbH[_0xfae3('0x8d')][_0xfae3('0x8e')]['SELECT']});}})['then'](function(){return{'sql':_0x35d19c[_0xfae3('0x8c')]()};})[_0xfae3('0x2a')](respondWithResult(_0x5ad14e,null))[_0xfae3('0x4c')](handleError(_0x5ad14e,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 8f347df..eb54a7b 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 _0x0979=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./analyticCustomReport.attributes','define','AnalyticCustomReport','analytics_custom_reports'];(function(_0x15443a,_0x3599b8){var _0x194e55=function(_0x355453){while(--_0x355453){_0x15443a['push'](_0x15443a['shift']());}};_0x194e55(++_0x3599b8);}(_0x0979,0xd8));var _0x9097=function(_0x402eff,_0x2525f2){_0x402eff=_0x402eff-0x0;var _0x2eb371=_0x0979[_0x402eff];return _0x2eb371;};'use strict';var _=require(_0x9097('0x0'));var util=require(_0x9097('0x1'));var logger=require(_0x9097('0x2'))(_0x9097('0x3'));var moment=require(_0x9097('0x4'));var BPromise=require(_0x9097('0x5'));var rp=require(_0x9097('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9097('0x7'));var config=require('../../config/environment');var attributes=require(_0x9097('0x8'));module['exports']=function(_0x376d9a,_0x1d4e17){return _0x376d9a[_0x9097('0x9')](_0x9097('0xa'),attributes,{'tableName':_0x9097('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfb9c=['analytics_custom_reports','lodash','util','api','bluebird','request-promise','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport'];(function(_0x2e44cf,_0x16f684){var _0x361268=function(_0x2a59db){while(--_0x2a59db){_0x2e44cf['push'](_0x2e44cf['shift']());}};_0x361268(++_0x16f684);}(_0xfb9c,0x198));var _0xcfb9=function(_0x19a11f,_0x6d8be7){_0x19a11f=_0x19a11f-0x0;var _0x51485f=_0xfb9c[_0x19a11f];return _0x51485f;};'use strict';var _=require(_0xcfb9('0x0'));var util=require(_0xcfb9('0x1'));var logger=require('../../config/logger')(_0xcfb9('0x2'));var moment=require('moment');var BPromise=require(_0xcfb9('0x3'));var rp=require(_0xcfb9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xcfb9('0x5'));var attributes=require(_0xcfb9('0x6'));module[_0xcfb9('0x7')]=function(_0x8a5064,_0x2012a3){return _0x8a5064[_0xcfb9('0x8')](_0xcfb9('0x9'),attributes,{'tableName':_0xcfb9('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 d10957f..81eb063 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 _0x0491=['then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','http','request'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0491,0xf3));var _0x1049=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x0491[_0x433a86];return _0x23000c;};'use strict';var _=require(_0x1049('0x0'));var util=require(_0x1049('0x1'));var moment=require(_0x1049('0x2'));var BPromise=require('bluebird');var rs=require(_0x1049('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1049('0x4'));var logger=require(_0x1049('0x5'))(_0x1049('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x1049('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3ee01a,_0x1640f7,_0x57c01d){return new BPromise(function(_0xf61e06,_0x3878b9){return client[_0x1049('0x8')](_0x3ee01a,_0x57c01d)[_0x1049('0x9')](function(_0x316e56){logger['info'](_0x1049('0xa'),_0x1640f7,_0x1049('0xb'));logger[_0x1049('0xc')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x1640f7,_0x1049('0xb'),JSON[_0x1049('0xd')](_0x316e56));if(_0x316e56[_0x1049('0xe')]){if(_0x316e56[_0x1049('0xe')][_0x1049('0xf')]===0x1f4){logger['error'](_0x1049('0xa'),_0x1640f7,_0x316e56['error'][_0x1049('0x10')]);return _0x3878b9(_0x316e56['error'][_0x1049('0x10')]);}logger[_0x1049('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0x1640f7,_0x316e56[_0x1049('0xe')]['message']);return _0xf61e06(_0x316e56[_0x1049('0xe')][_0x1049('0x10')]);}else{logger[_0x1049('0x11')](_0x1049('0xa'),_0x1640f7,_0x1049('0xb'));_0xf61e06(_0x316e56['result']['message']);}})['catch'](function(_0x382ae5){logger[_0x1049('0xe')](_0x1049('0xa'),_0x1640f7,_0x382ae5);_0x3878b9(_0x382ae5);});});}
\ No newline at end of file
+var _0x93a8=['rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x455197,_0x5471c1){var _0x128d2c=function(_0x31c61){while(--_0x31c61){_0x455197['push'](_0x455197['shift']());}};_0x128d2c(++_0x5471c1);}(_0x93a8,0x19b));var _0x893a=function(_0x47448e,_0x144590){_0x47448e=_0x47448e-0x0;var _0x1131c8=_0x93a8[_0x47448e];return _0x1131c8;};'use strict';var _=require(_0x893a('0x0'));var util=require(_0x893a('0x1'));var moment=require(_0x893a('0x2'));var BPromise=require(_0x893a('0x3'));var rs=require(_0x893a('0x4'));var fs=require('fs');var Redis=require(_0x893a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x893a('0x6'));var logger=require('../../config/logger')(_0x893a('0x7'));var config=require(_0x893a('0x8'));var jayson=require(_0x893a('0x9'));var client=jayson['client'][_0x893a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28e8c0,_0x51c528,_0x53d003){return new BPromise(function(_0x487f8a,_0x5a1124){return client[_0x893a('0xb')](_0x28e8c0,_0x53d003)[_0x893a('0xc')](function(_0x72dc3c){logger[_0x893a('0xd')](_0x893a('0xe'),_0x51c528,_0x893a('0xf'));logger['debug'](_0x893a('0x10'),_0x51c528,'request\x20sent',JSON[_0x893a('0x11')](_0x72dc3c));if(_0x72dc3c[_0x893a('0x12')]){if(_0x72dc3c[_0x893a('0x12')]['code']===0x1f4){logger[_0x893a('0x12')](_0x893a('0xe'),_0x51c528,_0x72dc3c[_0x893a('0x12')][_0x893a('0x13')]);return _0x5a1124(_0x72dc3c[_0x893a('0x12')]['message']);}logger[_0x893a('0x12')](_0x893a('0xe'),_0x51c528,_0x72dc3c[_0x893a('0x12')][_0x893a('0x13')]);return _0x487f8a(_0x72dc3c[_0x893a('0x12')][_0x893a('0x13')]);}else{logger['info'](_0x893a('0xe'),_0x51c528,_0x893a('0xf'));_0x487f8a(_0x72dc3c[_0x893a('0x14')]['message']);}})[_0x893a('0x15')](function(_0xd61107){logger['error'](_0x893a('0xe'),_0x51c528,_0xd61107);_0x5a1124(_0xd61107);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 427ac07..cd96ae6 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 _0x5c2b=['put','update','delete','destroy','exports','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/preview','preview','run','/:id/query','query','create'];(function(_0x466a1a,_0x37933b){var _0x577165=function(_0x4c97b9){while(--_0x4c97b9){_0x466a1a['push'](_0x466a1a['shift']());}};_0x577165(++_0x37933b);}(_0x5c2b,0x73));var _0xb5c2=function(_0x5c0489,_0x2916f9){_0x5c0489=_0x5c0489-0x0;var _0x2b4d00=_0x5c2b[_0x5c0489];return _0x2b4d00;};'use strict';var multer=require('multer');var util=require(_0xb5c2('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb5c2('0x1'));var router=express[_0xb5c2('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xb5c2('0x3'));var interaction=require(_0xb5c2('0x4'));var config=require(_0xb5c2('0x5'));var controller=require('./analyticCustomReport.controller');router[_0xb5c2('0x6')]('/',auth[_0xb5c2('0x7')](),controller[_0xb5c2('0x8')]);router[_0xb5c2('0x6')](_0xb5c2('0x9'),auth[_0xb5c2('0x7')](),controller[_0xb5c2('0xa')]);router[_0xb5c2('0x6')](_0xb5c2('0xb'),auth[_0xb5c2('0x7')](),controller[_0xb5c2('0xc')]);router[_0xb5c2('0x6')]('/:id/run',auth[_0xb5c2('0x7')](),controller[_0xb5c2('0xd')]);router[_0xb5c2('0x6')](_0xb5c2('0xe'),auth[_0xb5c2('0x7')](),controller[_0xb5c2('0xf')]);router['post']('/',auth[_0xb5c2('0x7')](),controller[_0xb5c2('0x10')]);router[_0xb5c2('0x11')](_0xb5c2('0x9'),auth[_0xb5c2('0x7')](),controller[_0xb5c2('0x12')]);router[_0xb5c2('0x13')](_0xb5c2('0x9'),auth[_0xb5c2('0x7')](),controller[_0xb5c2('0x14')]);module[_0xb5c2('0x15')]=router;
\ No newline at end of file
+var _0x94b5=['delete','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id/preview','preview','/:id/query','query','create','put','/:id','update'];(function(_0x443dee,_0x397273){var _0x47d0f6=function(_0x485ee3){while(--_0x485ee3){_0x443dee['push'](_0x443dee['shift']());}};_0x47d0f6(++_0x397273);}(_0x94b5,0x14c));var _0x594b=function(_0x296ef5,_0x2e40f0){_0x296ef5=_0x296ef5-0x0;var _0x32bf68=_0x94b5[_0x296ef5];return _0x32bf68;};'use strict';var multer=require(_0x594b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x594b('0x1'));var express=require(_0x594b('0x2'));var router=express[_0x594b('0x3')]();var fs_extra=require(_0x594b('0x4'));var auth=require(_0x594b('0x5'));var interaction=require(_0x594b('0x6'));var config=require(_0x594b('0x7'));var controller=require(_0x594b('0x8'));router[_0x594b('0x9')]('/',auth[_0x594b('0xa')](),controller[_0x594b('0xb')]);router[_0x594b('0x9')]('/:id',auth[_0x594b('0xa')](),controller['show']);router[_0x594b('0x9')](_0x594b('0xc'),auth[_0x594b('0xa')](),controller[_0x594b('0xd')]);router['get']('/:id/run',auth[_0x594b('0xa')](),controller['run']);router[_0x594b('0x9')](_0x594b('0xe'),auth[_0x594b('0xa')](),controller[_0x594b('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x594b('0x10')]);router[_0x594b('0x11')](_0x594b('0x12'),auth[_0x594b('0xa')](),controller[_0x594b('0x13')]);router[_0x594b('0x14')](_0x594b('0x12'),auth[_0x594b('0xa')](),controller['destroy']);module[_0x594b('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 598d40c..0a98faa 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 _0x71ab=['TEXT','exports','STRING'];(function(_0x12e2d2,_0x52b6c1){var _0x364317=function(_0x1779c1){while(--_0x1779c1){_0x12e2d2['push'](_0x12e2d2['shift']());}};_0x364317(++_0x52b6c1);}(_0x71ab,0x64));var _0xb71a=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x71ab[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require('sequelize');module[_0xb71a('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb71a('0x1')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xb71a('0x1')]},'conditions':{'type':Sequelize[_0xb71a('0x2')]},'joins':{'type':Sequelize[_0xb71a('0x2')]}};
\ No newline at end of file
+var _0xf494=['STRING','TEXT','sequelize','exports'];(function(_0x2bfd90,_0x102539){var _0x33e709=function(_0x198f74){while(--_0x198f74){_0x2bfd90['push'](_0x2bfd90['shift']());}};_0x33e709(++_0x102539);}(_0xf494,0x1c6));var _0x4f49=function(_0xc6517c,_0x20c405){_0xc6517c=_0xc6517c-0x0;var _0x564644=_0xf494[_0xc6517c];return _0x564644;};'use strict';var Sequelize=require(_0x4f49('0x0'));module[_0x4f49('0x1')]={'name':{'type':Sequelize[_0x4f49('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x4f49('0x2')]},'table':{'type':Sequelize[_0x4f49('0x2')]},'conditions':{'type':Sequelize[_0x4f49('0x3')]},'joins':{'type':Sequelize[_0x4f49('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 8fc9ee5..c13cff1 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xabce=['where','findAll','show','includeAll','options','find','catch','create','body','user','role','Reports','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','table','MetricId','field','function','replace','format','groupBy','orderBy','joins','parse','includes','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','SELECT','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','ValidationErrorItem','AnalyticMetric','keyBy','select','metric','DESC','foreignKey','output','web','%s-%s.%s','default','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','from','countTable','COUNT(*)','sequelize','QueryTypes','run','runReport','Sequelize','alias','clone','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','limit','undefined','count','set','json','apply','save','update','then','get','DefaultReports','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','filter','merge'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xabce,0x103));var _0xeabc=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0xabce[_0x5317b5];return _0x3b7ce2;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];var dbH=require(_0xeabc('0x19'))[_0xeabc('0x1a')];function respondWithStatusCode(_0xcfbf06,_0x53df9c){_0x53df9c=_0x53df9c||0xcc;return function(_0x235c2d){if(_0x235c2d){return _0xcfbf06[_0xeabc('0x1b')](_0x53df9c);}return _0xcfbf06[_0xeabc('0x1c')](_0x53df9c)['end']();};}function respondWithResult(_0x5f4ee8,_0x3170ea){_0x3170ea=_0x3170ea||0xc8;return function(_0x3ae954){if(_0x3ae954){return _0x5f4ee8[_0xeabc('0x1c')](_0x3170ea)['json'](_0x3ae954);}};}function respondWithFilteredResult(_0xf913d7,_0x638976){return function(_0x49f2d8){if(_0x49f2d8){var _0x53fe28=typeof _0x638976[_0xeabc('0x1d')]==='undefined'&&typeof _0x638976[_0xeabc('0x1e')]===_0xeabc('0x1f');var _0x58a3c0=_0x49f2d8[_0xeabc('0x20')];var _0x31dd53=_0x53fe28?0x0:_0x638976[_0xeabc('0x1d')];var _0x384be5=_0x53fe28?_0x49f2d8[_0xeabc('0x20')]:_0x638976['offset']+_0x638976[_0xeabc('0x1e')];var _0x4d68ea;if(_0x384be5>=_0x58a3c0){_0x384be5=_0x58a3c0;_0x4d68ea=0xc8;}else{_0x4d68ea=0xce;}_0xf913d7[_0xeabc('0x1c')](_0x4d68ea);return _0xf913d7[_0xeabc('0x21')]('Content-Range',_0x31dd53+'-'+_0x384be5+'/'+_0x58a3c0)[_0xeabc('0x22')](_0x49f2d8);}return null;};}function patchUpdates(_0x41d67a){return function(_0x254590){try{jsonpatch[_0xeabc('0x23')](_0x254590,_0x41d67a,!![]);}catch(_0x3c9611){return BPromise['reject'](_0x3c9611);}return _0x254590[_0xeabc('0x24')]();};}function saveUpdates(_0x10c675,_0x91ab00){return function(_0x5bdd57){if(_0x5bdd57){return _0x5bdd57[_0xeabc('0x25')](_0x10c675)[_0xeabc('0x26')](function(_0x214953){return _0x214953;});}return null;};}function removeEntity(_0x319119,_0x5b8838){return function(_0x109e1d){if(_0x109e1d){return _0x109e1d['destroy']()[_0xeabc('0x26')](function(){var _0x4d4e29=_0x109e1d[_0xeabc('0x27')]({'plain':!![]});var _0x12acbd=_0xeabc('0x28');return db[_0xeabc('0x29')][_0xeabc('0x2a')]({'where':{'type':_0x12acbd,'resourceId':_0x4d4e29['id']}})[_0xeabc('0x26')](function(){return _0x109e1d;});})[_0xeabc('0x26')](function(){_0x319119['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x459c8a,_0x5bf8f2){return function(_0x3c1b5b){if(!_0x3c1b5b){_0x459c8a[_0xeabc('0x1b')](0x194);}return _0x3c1b5b;};}function handleError(_0x48fb52,_0x2163e6){_0x2163e6=_0x2163e6||0x1f4;return function(_0x38572d){logger[_0xeabc('0x2b')](_0x38572d[_0xeabc('0x2c')]);if(_0x38572d[_0xeabc('0x2d')]){delete _0x38572d[_0xeabc('0x2d')];}_0x48fb52[_0xeabc('0x1c')](_0x2163e6)[_0xeabc('0x2e')](_0x38572d);};}exports[_0xeabc('0x2f')]=function(_0x5ebb86,_0x5b34dd){var _0x5bb1f1={},_0x2f03e8={},_0x2d027e={'count':0x0,'rows':[]};var _0x98b445=_[_0xeabc('0x30')](db[_0xeabc('0x31')][_0xeabc('0x32')],function(_0x61c0af){return{'name':_0x61c0af['fieldName'],'type':_0x61c0af[_0xeabc('0x33')][_0xeabc('0x34')]};});_0x2f03e8[_0xeabc('0x35')]=_['map'](_0x98b445,_0xeabc('0x2d'));_0x2f03e8[_0xeabc('0x36')]=_[_0xeabc('0x37')](_0x5ebb86['query']);_0x2f03e8[_0xeabc('0x38')]=_[_0xeabc('0x39')](_0x2f03e8[_0xeabc('0x35')],_0x2f03e8['query']);_0x5bb1f1[_0xeabc('0x3a')]=_[_0xeabc('0x39')](_0x2f03e8['model'],qs['fields'](_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x3b')]));_0x5bb1f1['attributes']=_0x5bb1f1[_0xeabc('0x3a')][_0xeabc('0x3c')]?_0x5bb1f1[_0xeabc('0x3a')]:_0x2f03e8[_0xeabc('0x35')];if(!_0x5ebb86[_0xeabc('0x36')]['hasOwnProperty'](_0xeabc('0x3d'))){_0x5bb1f1['limit']=qs[_0xeabc('0x1e')](_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x1e')]);_0x5bb1f1['offset']=qs['offset'](_0x5ebb86[_0xeabc('0x36')]['offset']);}_0x5bb1f1[_0xeabc('0x3e')]=qs['sort'](_0x5ebb86['query']['sort']);_0x5bb1f1['where']=qs[_0xeabc('0x38')](_['pick'](_0x5ebb86[_0xeabc('0x36')],_0x2f03e8[_0xeabc('0x38')]),_0x98b445);if(_0x5ebb86['query'][_0xeabc('0x3f')]){_0x5bb1f1['where']=_[_0xeabc('0x40')](_0x5bb1f1['where'],{'$or':_[_0xeabc('0x30')](_0x98b445,function(_0xf1b7ef){if(_0xf1b7ef[_0xeabc('0x33')]!=='VIRTUAL'){var _0x5a00d0={};_0x5a00d0[_0xf1b7ef['name']]={'$like':'%'+_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x3f')]+'%'};return _0x5a00d0;}})});}_0x5bb1f1=_[_0xeabc('0x40')]({},_0x5bb1f1,_0x5ebb86['options']);var _0x4f1897={'where':_0x5bb1f1[_0xeabc('0x41')]};return db[_0xeabc('0x31')]['count'](_0x4f1897)[_0xeabc('0x26')](function(_0x5e0b78){_0x2d027e[_0xeabc('0x20')]=_0x5e0b78;if(_0x5ebb86['query']['includeAll']){_0x5bb1f1['include']=[{'all':!![]}];}return db[_0xeabc('0x31')][_0xeabc('0x42')](_0x5bb1f1);})[_0xeabc('0x26')](function(_0x3eeeb5){_0x2d027e['rows']=_0x3eeeb5;return _0x2d027e;})[_0xeabc('0x26')](respondWithFilteredResult(_0x5b34dd,_0x5bb1f1))['catch'](handleError(_0x5b34dd,null));};exports[_0xeabc('0x43')]=function(_0x1a4bbe,_0x3a7807){var _0x17a0df={'raw':!![],'where':{'id':_0x1a4bbe['params']['id']}},_0xc849c9={};_0xc849c9['model']=_[_0xeabc('0x37')](db['AnalyticDefaultReport'][_0xeabc('0x32')]);_0xc849c9[_0xeabc('0x36')]=_['keys'](_0x1a4bbe[_0xeabc('0x36')]);_0xc849c9[_0xeabc('0x38')]=_[_0xeabc('0x39')](_0xc849c9[_0xeabc('0x35')],_0xc849c9[_0xeabc('0x36')]);_0x17a0df[_0xeabc('0x3a')]=_[_0xeabc('0x39')](_0xc849c9['model'],qs[_0xeabc('0x3b')](_0x1a4bbe[_0xeabc('0x36')][_0xeabc('0x3b')]));_0x17a0df[_0xeabc('0x3a')]=_0x17a0df[_0xeabc('0x3a')][_0xeabc('0x3c')]?_0x17a0df[_0xeabc('0x3a')]:_0xc849c9[_0xeabc('0x35')];if(_0x1a4bbe[_0xeabc('0x36')][_0xeabc('0x44')]){_0x17a0df['include']=[{'all':!![]}];}_0x17a0df=_[_0xeabc('0x40')]({},_0x17a0df,_0x1a4bbe[_0xeabc('0x45')]);return db[_0xeabc('0x31')][_0xeabc('0x46')](_0x17a0df)[_0xeabc('0x26')](handleEntityNotFound(_0x3a7807,null))[_0xeabc('0x26')](respondWithResult(_0x3a7807,null))[_0xeabc('0x47')](handleError(_0x3a7807,null));};exports['create']=function(_0x766743,_0x32e09b){return db[_0xeabc('0x31')][_0xeabc('0x48')](_0x766743[_0xeabc('0x49')],{})['then'](function(_0x305946){var _0x2b2b9c=_0x766743[_0xeabc('0x4a')][_0xeabc('0x27')]({'plain':!![]});if(!_0x2b2b9c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b2b9c[_0xeabc('0x4b')]===_0xeabc('0x4a')){var _0x568847=_0x305946[_0xeabc('0x27')]({'plain':!![]});var _0x5a0d4d=_0xeabc('0x4c');return db['UserProfileSection'][_0xeabc('0x46')]({'where':{'name':_0x5a0d4d,'userProfileId':_0x2b2b9c[_0xeabc('0x4d')]},'raw':!![]})[_0xeabc('0x26')](function(_0x1524c3){if(_0x1524c3&&_0x1524c3[_0xeabc('0x4e')]===0x0){return db[_0xeabc('0x29')][_0xeabc('0x48')]({'name':_0x568847[_0xeabc('0x2d')],'resourceId':_0x568847['id'],'type':_0xeabc('0x28'),'sectionId':_0x1524c3['id']},{})[_0xeabc('0x26')](function(){return _0x305946;});}else{return _0x305946;}})['catch'](function(_0x180a14){logger[_0xeabc('0x2b')](_0xeabc('0x4f'),_0x180a14);throw _0x180a14;});}return _0x305946;})[_0xeabc('0x26')](respondWithResult(_0x32e09b,0xc9))['catch'](handleError(_0x32e09b,null));};exports[_0xeabc('0x25')]=function(_0x392913,_0x10d56f){if(_0x392913[_0xeabc('0x49')]['id']){delete _0x392913['body']['id'];}return db[_0xeabc('0x31')][_0xeabc('0x46')]({'where':{'id':_0x392913[_0xeabc('0x50')]['id']}})[_0xeabc('0x26')](handleEntityNotFound(_0x10d56f,null))[_0xeabc('0x26')](saveUpdates(_0x392913[_0xeabc('0x49')],null))[_0xeabc('0x26')](respondWithResult(_0x10d56f,null))[_0xeabc('0x47')](handleError(_0x10d56f,null));};exports[_0xeabc('0x2a')]=function(_0x58ab08,_0x4546c4){return db['AnalyticDefaultReport']['find']({'where':{'id':_0x58ab08['params']['id']}})[_0xeabc('0x26')](handleEntityNotFound(_0x4546c4,null))[_0xeabc('0x26')](removeEntity(_0x4546c4,null))[_0xeabc('0x47')](handleError(_0x4546c4,null));};exports[_0xeabc('0x51')]=function(_0xe89728,_0x2f78f3){var _0x4a2ad6=0xa;var _0x4358d7=[_0xeabc('0x52'),_0xeabc('0x53'),_0xeabc('0x54'),_0xeabc('0x55')];var _0x2c7b4e={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xeabc('0x58'),'AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x536f42={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':_0xeabc('0x5e'),'UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x26c784=function(_0xc2ef0c){return!_['includes']([_0xeabc('0x60'),_0xeabc('0x61'),_0xeabc('0x62'),_0xeabc('0x63')],_0xc2ef0c);};var _0x11cc1f=function(_0x514787){if(!_0x514787||!_0x514787['rules'][_0xeabc('0x3c')]){return'';}for(var _0x7b659f='(',_0x1b6675=0x0;_0x1b6675<_0x514787[_0xeabc('0x64')][_0xeabc('0x3c')];_0x1b6675+=0x1){_0x1b6675>0x0&&(_0x7b659f+='\x20'+_0x514787[_0xeabc('0x65')]+'\x20');_0x7b659f+=_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x66')]?_0x11cc1f(_0x514787[_0xeabc('0x64')][_0x1b6675]['group']):_0x514787[_0xeabc('0x64')][_0x1b6675]['field']+'\x20'+_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x67')]+(_0x26c784(_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x67')])?'\x20'+_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x68')]:'');}return _0x7b659f+')';};var _0xf48062={'where':{'id':_0xe89728[_0xeabc('0x50')]['id']}},_0xb59a2a,_0x5d4bc2,_0x24d0e5,_0x5702cb,_0x3fa31b;_0xf48062=_[_0xeabc('0x40')]({},_0xf48062,_0xe89728[_0xeabc('0x45')]);return db['AnalyticDefaultReport'][_0xeabc('0x46')](_0xf48062)['then'](function(_0x54e7d6){if(_0x54e7d6){_0xb59a2a=_0x54e7d6;return _0x54e7d6[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x23270a){if(_0x23270a){if(!_0x23270a[_0xeabc('0x3c')]){throw new db['Sequelize']['ValidationErrorItem'](_0xeabc('0x6a'),0x193);}_0x5d4bc2=_0x23270a;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xeabc('0x26')](function(_0x4f1a4f){if(_0x4f1a4f){_0x24d0e5=_['keyBy'](_0x4f1a4f,'id');var _0xa44f2d;var _0x1c84b5=squel['select']();_0x1c84b5['from'](_0xb59a2a[_0xeabc('0x6b')]);for(var _0x5d183a=0x0;_0x5d183a<_0x5d4bc2[_0xeabc('0x3c')];_0x5d183a+=0x1){_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x6c')]?_0x24d0e5[_0x5d4bc2[_0x5d183a]['MetricId']]['metric']:_0x5d4bc2[_0x5d183a][_0xeabc('0x6d')];_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x6e')]?_[_0xeabc('0x6f')](_0x2c7b4e[_0x5d4bc2[_0x5d183a][_0xeabc('0x6e')]],'%s',_0xa44f2d):_0xa44f2d;_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x70')]?_['replace'](_0x536f42[_0x5d4bc2[_0x5d183a]['format']],'%s',_0xa44f2d):_0xa44f2d;if(_0x5d4bc2[_0x5d183a][_0xeabc('0x71')]){_0x1c84b5['group'](_0xa44f2d);}_0x5d4bc2[_0x5d183a][_0xeabc('0x72')]&&_0x1c84b5['order'](_0xa44f2d,_0x5d4bc2[_0x5d183a][_0xeabc('0x72')]==='DESC'?![]:!![]);_0x1c84b5[_0xeabc('0x6d')](_0xa44f2d,_0x5d4bc2[_0x5d183a]['alias']||_0xa44f2d);}if(_0xb59a2a[_0xeabc('0x73')]){_0xb59a2a[_0xeabc('0x73')]=JSON[_0xeabc('0x74')](_0xb59a2a[_0xeabc('0x73')]);for(var _0x5e121c=0x0;_0x5e121c<_0xb59a2a[_0xeabc('0x73')]['length'];_0x5e121c+=0x1){if(_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')]&&_[_0xeabc('0x75')](_0x4358d7,_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')])&&_0xb59a2a['joins'][_0x5e121c][_0xeabc('0x76')]&&_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x77')]&&_0xb59a2a[_0xeabc('0x73')][_0x5e121c]['foreignKey']){_0x1c84b5[_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')]](_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x77')],null,util['format'](_0xeabc('0x78'),_0xb59a2a[_0xeabc('0x6b')],_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x76')],_0xb59a2a['joins'][_0x5e121c]['foreignTable'],_0xb59a2a[_0xeabc('0x73')][_0x5e121c]['foreignKey']));}}}if(_0xb59a2a['conditions']){_0xb59a2a[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0xb59a2a[_0xeabc('0x79')]);_0x1c84b5['where'](_0x11cc1f(_0xb59a2a[_0xeabc('0x79')][_0xeabc('0x66')]));}_0x3fa31b=_0x1c84b5['clone']();_0x1c84b5[_0xeabc('0x1e')](_0x4a2ad6);_0x1c84b5[_0xeabc('0x1d')](0x0);logger[_0xeabc('0x7a')](_0xeabc('0x7b'),_0x1c84b5[_0xeabc('0x7c')]());return dbH['sequelize'][_0xeabc('0x36')](_0x1c84b5['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0xeabc('0x7d')]});}})[_0xeabc('0x26')](respondWithResult(_0x2f78f3,null))[_0xeabc('0x47')](handleError(_0x2f78f3,null));};function runReport(_0x4424ce,_0x33fa74,_0x51368f){var _0x39f961=_0x33fa74['name'];var _0x1795fe=0xa;var _0x2f95c7=['join',_0xeabc('0x53'),'right_join','cross_join'];var _0x952dc7={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':_0xeabc('0x7e'),'MAX':_0xeabc('0x7f'),'MIN':'MIN(%s)','AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':_0xeabc('0x80'),'GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x348064={'SEC_TO_TIME':_0xeabc('0x81'),'DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':_0xeabc('0x5e'),'UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x522c6e=function(_0x436f8e){return!_[_0xeabc('0x75')]([_0xeabc('0x60'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xeabc('0x63')],_0x436f8e);};var _0x273ca5=function(_0xe90200){if(!_0xe90200||!_0xe90200[_0xeabc('0x64')][_0xeabc('0x3c')]){return'';}for(var _0x5f5a47='(',_0x289f98=0x0;_0x289f98<_0xe90200['rules']['length'];_0x289f98+=0x1){_0x289f98>0x0&&(_0x5f5a47+='\x20'+_0xe90200[_0xeabc('0x65')]+'\x20');_0x5f5a47+=_0xe90200[_0xeabc('0x64')][_0x289f98]['group']?_0x273ca5(_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x66')]):_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x6d')]+'\x20'+_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x67')]+(_0x522c6e(_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x67')])?'\x20'+_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x68')]:'');}return _0x5f5a47+')';};var _0x1f8197={'where':{'id':_0x4424ce['id']}},_0x485c13,_0xb54c35,_0x5c9d6f,_0x1caaa7,_0x3e764a;_0x1f8197=_[_0xeabc('0x40')]({},_0x1f8197,_0x51368f);return db[_0xeabc('0x31')][_0xeabc('0x46')](_0x1f8197)[_0xeabc('0x26')](function(_0x40f51e){if(_0x40f51e){_0x485c13=_0x40f51e;return _0x40f51e[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x156e20){if(_0x156e20){if(!_0x156e20[_0xeabc('0x3c')]){throw new db['Sequelize'][(_0xeabc('0x82'))](_0xeabc('0x6a'),0x193);}_0xb54c35=_0x156e20;return db[_0xeabc('0x83')][_0xeabc('0x42')]({'raw':!![]});}return null;})['then'](function(_0x26c595){if(_0x26c595){_0x5c9d6f=_[_0xeabc('0x84')](_0x26c595,'id');var _0x580661;var _0x3de927=squel[_0xeabc('0x85')]();_0x3de927['from'](_0x485c13['table']);for(var _0x489b1d=0x0;_0x489b1d<_0xb54c35['length'];_0x489b1d+=0x1){_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x6c')]?_0x5c9d6f[_0xb54c35[_0x489b1d][_0xeabc('0x6c')]][_0xeabc('0x86')]:_0xb54c35[_0x489b1d][_0xeabc('0x6d')];_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x6e')]?_[_0xeabc('0x6f')](_0x952dc7[_0xb54c35[_0x489b1d][_0xeabc('0x6e')]],'%s',_0x580661):_0x580661;_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x70')]?_[_0xeabc('0x6f')](_0x348064[_0xb54c35[_0x489b1d][_0xeabc('0x70')]],'%s',_0x580661):_0x580661;if(_0xb54c35[_0x489b1d]['groupBy']){_0x3de927[_0xeabc('0x66')](_0x580661);}_0xb54c35[_0x489b1d][_0xeabc('0x72')]&&_0x3de927['order'](_0x580661,_0xb54c35[_0x489b1d][_0xeabc('0x72')]===_0xeabc('0x87')?![]:!![]);_0x3de927[_0xeabc('0x6d')](_0x580661,_0xb54c35[_0x489b1d]['alias']||_0x580661);}if(_0x485c13[_0xeabc('0x73')]){_0x485c13['joins']=JSON[_0xeabc('0x74')](_0x485c13[_0xeabc('0x73')]);for(var _0x1841f0=0x0;_0x1841f0<_0x485c13[_0xeabc('0x73')][_0xeabc('0x3c')];_0x1841f0+=0x1){if(_0x485c13['joins'][_0x1841f0]['type']&&_['includes'](_0x2f95c7,_0x485c13['joins'][_0x1841f0][_0xeabc('0x33')])&&_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x76')]&&_0x485c13['joins'][_0x1841f0][_0xeabc('0x77')]&&_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x88')]){_0x3de927[_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x33')]](_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x77')],null,util[_0xeabc('0x70')](_0xeabc('0x78'),_0x485c13[_0xeabc('0x6b')],_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x76')],_0x485c13['joins'][_0x1841f0]['foreignTable'],_0x485c13[_0xeabc('0x73')][_0x1841f0]['foreignKey']));}}}if(_0x485c13[_0xeabc('0x79')]){_0x485c13[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0x485c13['conditions']);_0x3de927[_0xeabc('0x41')](_0x273ca5(_0x485c13[_0xeabc('0x79')][_0xeabc('0x66')]));}_0x3e764a=_0x3de927['clone']();_0x3de927['limit'](_0x1795fe);_0x3de927[_0xeabc('0x1d')](0x0);return;}})[_0xeabc('0x26')](function(){if(_0x33fa74[_0xeabc('0x89')]===_0xeabc('0x8a')){return null;}var _0x2cc9b3=_[_0xeabc('0x40')](_0x33fa74,{'name':_0x33fa74['fullPath']||_0x33fa74['name']||_0x485c13[_0xeabc('0x2d')],'basename':_0x39f961,'savename':util[_0xeabc('0x70')](_0xeabc('0x8b'),_0x33fa74[_0xeabc('0x2d')]||_0x485c13['name'],require('randomstring')['generate'](0x4),_0x33fa74[_0xeabc('0x89')]||'csv'),'reportId':_0x485c13['id'],'reportType':_0xeabc('0x8c')});return db['AnalyticExtractedReport'][_0xeabc('0x48')](_0x2cc9b3,{'raw':!![]});})['then'](function(_0x6e6ab2){if(_0x485c13[_0xeabc('0x6b')]===_0xeabc('0x8d')){_0x3e764a[_0xeabc('0x41')](_0x485c13[_0xeabc('0x6b')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x33fa74[_0xeabc('0x8e')],_0x33fa74[_0xeabc('0x8f')]);}else{_0x3e764a[_0xeabc('0x41')](_0x485c13['table']+_0xeabc('0x90'),_0x33fa74[_0xeabc('0x8e')],_0x33fa74[_0xeabc('0x8f')]);}if(_0x6e6ab2){logger[_0xeabc('0x91')](_0xeabc('0x92'),_0x3e764a['toString']());require(_0xeabc('0x93'))[_0xeabc('0x94')](path['join'](__dirname,_0xeabc('0x95'),_0x6e6ab2[_0xeabc('0x89')]),[_0x6e6ab2['id'],_0x3e764a['toString'](),path[_0xeabc('0x52')](__dirname,_0xeabc('0x96'),_0x6e6ab2[_0xeabc('0x97')]),_0x39f961]);return _0x6e6ab2;}else{var _0x307d26=squel[_0xeabc('0x85')]();_0x307d26[_0xeabc('0x98')]('('+_0x3e764a[_0xeabc('0x7c')]()+')',_0xeabc('0x99'));_0x307d26[_0xeabc('0x6d')](_0xeabc('0x9a'),_0xeabc('0x20'));_0x3e764a[_0xeabc('0x1e')](_0x33fa74[_0xeabc('0x1e')]||_0x1795fe);_0x3e764a['offset'](_0x33fa74['offset']||0x0);return dbH[_0xeabc('0x9b')][_0xeabc('0x36')](_0x307d26[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')]['QueryTypes'][_0xeabc('0x7d')]})['then'](function(_0x49fba2){if(!_0x49fba2['length']){_0x1caaa7=0x0;}else{_0x1caaa7=_0x49fba2[0x0]['count']||0x0;}return dbH['sequelize']['query'](_0x3e764a[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')][_0xeabc('0x9c')][_0xeabc('0x7d')]});})[_0xeabc('0x26')](function(_0xe27492){return{'rows':_0xe27492||[],'count':_0x1caaa7};});}});}exports[_0xeabc('0x9d')]=function(_0x3eaedf,_0x44dc85){return runReport(_0x3eaedf['params'],_0x3eaedf[_0xeabc('0x36')],_0x3eaedf[_0xeabc('0x45')])[_0xeabc('0x26')](respondWithResult(_0x44dc85,null))[_0xeabc('0x47')](handleError(_0x44dc85,null));};exports[_0xeabc('0x9e')]=runReport;exports[_0xeabc('0x36')]=function(_0x2a29d7,_0x5bb5d6){var _0x3513ce=0xa;var _0x58cb5d=[_0xeabc('0x52'),_0xeabc('0x53'),'right_join',_0xeabc('0x55')];var _0x4c8bf3={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':_0xeabc('0x7e'),'MAX':_0xeabc('0x7f'),'MIN':_0xeabc('0x58'),'AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':_0xeabc('0x80'),'GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x484c75={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x580f72=function(_0x37907a){return!_[_0xeabc('0x75')]([_0xeabc('0x60'),_0xeabc('0x61'),_0xeabc('0x62'),_0xeabc('0x63')],_0x37907a);};var _0x57db6d=function(_0x13cc55){if(!_0x13cc55||!_0x13cc55['rules'][_0xeabc('0x3c')]){return'';}for(var _0x43b88e='(',_0x1fa464=0x0;_0x1fa464<_0x13cc55[_0xeabc('0x64')]['length'];_0x1fa464+=0x1){_0x1fa464>0x0&&(_0x43b88e+='\x20'+_0x13cc55[_0xeabc('0x65')]+'\x20');_0x43b88e+=_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x66')]?_0x57db6d(_0x13cc55['rules'][_0x1fa464][_0xeabc('0x66')]):_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x6d')]+'\x20'+_0x13cc55['rules'][_0x1fa464]['condition']+(_0x580f72(_0x13cc55['rules'][_0x1fa464]['condition'])?'\x20'+_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x68')]:'');}return _0x43b88e+')';};var _0x52e84f={'where':{'id':_0x2a29d7[_0xeabc('0x50')]['id']}},_0x12f024,_0x1d35da,_0x2695a4,_0x199251,_0x1899d6;_0x52e84f=_[_0xeabc('0x40')]({},_0x52e84f,_0x2a29d7[_0xeabc('0x45')]);return db[_0xeabc('0x31')]['find'](_0x52e84f)[_0xeabc('0x26')](function(_0x5bb015){if(_0x5bb015){_0x12f024=_0x5bb015;return _0x5bb015[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x438ce3){if(_0x438ce3){if(!_0x438ce3[_0xeabc('0x3c')]){throw new db[(_0xeabc('0x9f'))][(_0xeabc('0x82'))](_0xeabc('0x6a'),0x193);}_0x1d35da=_0x438ce3;return db['AnalyticMetric'][_0xeabc('0x42')]({'raw':!![]});}return null;})['then'](function(_0x475160){if(_0x475160){_0x2695a4=_['keyBy'](_0x475160,'id');var _0x10d66b;var _0x12a042=squel[_0xeabc('0x85')]();_0x12a042[_0xeabc('0x98')](_0x12f024[_0xeabc('0x6b')]);for(var _0x49bf0f=0x0;_0x49bf0f<_0x1d35da[_0xeabc('0x3c')];_0x49bf0f+=0x1){_0x10d66b=_0x1d35da[_0x49bf0f][_0xeabc('0x6c')]?_0x2695a4[_0x1d35da[_0x49bf0f][_0xeabc('0x6c')]][_0xeabc('0x86')]:_0x1d35da[_0x49bf0f][_0xeabc('0x6d')];_0x10d66b=_0x1d35da[_0x49bf0f]['function']?_[_0xeabc('0x6f')](_0x4c8bf3[_0x1d35da[_0x49bf0f][_0xeabc('0x6e')]],'%s',_0x10d66b):_0x10d66b;_0x10d66b=_0x1d35da[_0x49bf0f][_0xeabc('0x70')]?_[_0xeabc('0x6f')](_0x484c75[_0x1d35da[_0x49bf0f][_0xeabc('0x70')]],'%s',_0x10d66b):_0x10d66b;if(_0x1d35da[_0x49bf0f]['groupBy']){_0x12a042[_0xeabc('0x66')](_0x10d66b);}_0x1d35da[_0x49bf0f]['orderBy']&&_0x12a042[_0xeabc('0x3e')](_0x10d66b,_0x1d35da[_0x49bf0f][_0xeabc('0x72')]===_0xeabc('0x87')?![]:!![]);_0x12a042[_0xeabc('0x6d')](_0x10d66b,_0x1d35da[_0x49bf0f][_0xeabc('0xa0')]||_0x10d66b);}if(_0x12f024[_0xeabc('0x73')]){_0x12f024[_0xeabc('0x73')]=JSON[_0xeabc('0x74')](_0x12f024[_0xeabc('0x73')]);for(var _0x223a3=0x0;_0x223a3<_0x12f024['joins'][_0xeabc('0x3c')];_0x223a3+=0x1){if(_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x33')]&&_[_0xeabc('0x75')](_0x58cb5d,_0x12f024['joins'][_0x223a3][_0xeabc('0x33')])&&_0x12f024['joins'][_0x223a3]['parentKey']&&_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x77')]&&_0x12f024[_0xeabc('0x73')][_0x223a3]['foreignKey']){_0x12a042[_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x33')]](_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x77')],null,util[_0xeabc('0x70')]('%s.%s\x20=\x20%s.%s',_0x12f024[_0xeabc('0x6b')],_0x12f024[_0xeabc('0x73')][_0x223a3]['parentKey'],_0x12f024['joins'][_0x223a3][_0xeabc('0x77')],_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x88')]));}}}if(_0x12f024[_0xeabc('0x79')]){_0x12f024[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0x12f024[_0xeabc('0x79')]);_0x12a042[_0xeabc('0x41')](_0x57db6d(_0x12f024[_0xeabc('0x79')]['group']));}_0x1899d6=_0x12a042[_0xeabc('0xa1')]();_0x12a042['limit'](_0x3513ce);_0x12a042[_0xeabc('0x1d')](0x0);logger['debug'](_0xeabc('0x7b'),_0x12a042[_0xeabc('0x7c')]());return dbH[_0xeabc('0x9b')][_0xeabc('0x36')](_0x12a042[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')][_0xeabc('0x9c')][_0xeabc('0x7d')]});}})[_0xeabc('0x26')](function(){return{'sql':_0x1899d6[_0xeabc('0x7c')]()};})['then'](respondWithResult(_0x5bb5d6,null))['catch'](handleError(_0x5bb5d6,null));};
\ No newline at end of file
+var _0x1967=['conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','SUM(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','table','web','%s-%s.%s','randomstring','output','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','runReport','select','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','get','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','DefaultReports','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','foreignKey'];(function(_0xedb737,_0xcc55f4){var _0x5a691d=function(_0x522a77){while(--_0x522a77){_0xedb737['push'](_0xedb737['shift']());}};_0x5a691d(++_0xcc55f4);}(_0x1967,0x173));var _0x7196=function(_0x150429,_0x2b2454){_0x150429=_0x150429-0x0;var _0x48b1f4=_0x1967[_0x150429];return _0x48b1f4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7196('0x0'));var zipdir=require(_0x7196('0x1'));var jsonpatch=require(_0x7196('0x2'));var rp=require(_0x7196('0x3'));var moment=require(_0x7196('0x4'));var BPromise=require(_0x7196('0x5'));var Mustache=require(_0x7196('0x6'));var util=require(_0x7196('0x7'));var path=require(_0x7196('0x8'));var sox=require(_0x7196('0x9'));var csv=require('to-csv');var ejs=require(_0x7196('0xa'));var fs=require('fs');var fs_extra=require(_0x7196('0xb'));var _=require(_0x7196('0xc'));var squel=require(_0x7196('0xd'));var crypto=require(_0x7196('0xe'));var jsforce=require(_0x7196('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7196('0x10'));var querystring=require(_0x7196('0x11'));var Papa=require(_0x7196('0x12'));var Redis=require(_0x7196('0x13'));var authService=require(_0x7196('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7196('0x15'));var logger=require(_0x7196('0x16'))(_0x7196('0x17'));var utils=require(_0x7196('0x18'));var config=require(_0x7196('0x19'));var licenseUtil=require(_0x7196('0x1a'));var db=require(_0x7196('0x1b'))['db'];var dbH=require(_0x7196('0x1b'))[_0x7196('0x1c')];function respondWithStatusCode(_0xba707b,_0x154101){_0x154101=_0x154101||0xcc;return function(_0x4e8c4c){if(_0x4e8c4c){return _0xba707b[_0x7196('0x1d')](_0x154101);}return _0xba707b[_0x7196('0x1e')](_0x154101)[_0x7196('0x1f')]();};}function respondWithResult(_0xf098c1,_0x511aa1){_0x511aa1=_0x511aa1||0xc8;return function(_0x31c778){if(_0x31c778){return _0xf098c1['status'](_0x511aa1)[_0x7196('0x20')](_0x31c778);}};}function respondWithFilteredResult(_0x2590a6,_0xf7e97){return function(_0x3ed1ad){if(_0x3ed1ad){var _0x12dce7=typeof _0xf7e97[_0x7196('0x21')]===_0x7196('0x22')&&typeof _0xf7e97[_0x7196('0x23')]===_0x7196('0x22');var _0x32fe2b=_0x3ed1ad[_0x7196('0x24')];var _0x5b716a=_0x12dce7?0x0:_0xf7e97['offset'];var _0x448f13=_0x12dce7?_0x3ed1ad[_0x7196('0x24')]:_0xf7e97[_0x7196('0x21')]+_0xf7e97['limit'];var _0x39b944;if(_0x448f13>=_0x32fe2b){_0x448f13=_0x32fe2b;_0x39b944=0xc8;}else{_0x39b944=0xce;}_0x2590a6['status'](_0x39b944);return _0x2590a6['set'](_0x7196('0x25'),_0x5b716a+'-'+_0x448f13+'/'+_0x32fe2b)[_0x7196('0x20')](_0x3ed1ad);}return null;};}function patchUpdates(_0x8dee9d){return function(_0x4ddf78){try{jsonpatch['apply'](_0x4ddf78,_0x8dee9d,!![]);}catch(_0x38d291){return BPromise[_0x7196('0x26')](_0x38d291);}return _0x4ddf78['save']();};}function saveUpdates(_0x18649b,_0x27ff84){return function(_0x6e22e5){if(_0x6e22e5){return _0x6e22e5[_0x7196('0x27')](_0x18649b)[_0x7196('0x28')](function(_0x549f34){return _0x549f34;});}return null;};}function removeEntity(_0x3f8178,_0x520d01){return function(_0x3ce9a0){if(_0x3ce9a0){return _0x3ce9a0[_0x7196('0x29')]()[_0x7196('0x28')](function(){var _0xa69810=_0x3ce9a0[_0x7196('0x2a')]({'plain':!![]});var _0x43f6a2='DefaultReports';return db['UserProfileResource'][_0x7196('0x29')]({'where':{'type':_0x43f6a2,'resourceId':_0xa69810['id']}})[_0x7196('0x28')](function(){return _0x3ce9a0;});})[_0x7196('0x28')](function(){_0x3f8178['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x41cfd2,_0x162cfc){return function(_0x675e64){if(!_0x675e64){_0x41cfd2['sendStatus'](0x194);}return _0x675e64;};}function handleError(_0x35eef9,_0x4ecea1){_0x4ecea1=_0x4ecea1||0x1f4;return function(_0x4fd339){logger['error'](_0x4fd339[_0x7196('0x2b')]);if(_0x4fd339[_0x7196('0x2c')]){delete _0x4fd339[_0x7196('0x2c')];}_0x35eef9['status'](_0x4ecea1)[_0x7196('0x2d')](_0x4fd339);};}exports[_0x7196('0x2e')]=function(_0x2f9583,_0xf999e9){var _0x50c386={},_0x39710d={},_0x429160={'count':0x0,'rows':[]};var _0xd07f22=_[_0x7196('0x2f')](db[_0x7196('0x30')][_0x7196('0x31')],function(_0x15c5f0){return{'name':_0x15c5f0[_0x7196('0x32')],'type':_0x15c5f0[_0x7196('0x33')][_0x7196('0x34')]};});_0x39710d[_0x7196('0x35')]=_['map'](_0xd07f22,_0x7196('0x2c'));_0x39710d['query']=_[_0x7196('0x36')](_0x2f9583['query']);_0x39710d[_0x7196('0x37')]=_[_0x7196('0x38')](_0x39710d['model'],_0x39710d[_0x7196('0x39')]);_0x50c386[_0x7196('0x3a')]=_[_0x7196('0x38')](_0x39710d[_0x7196('0x35')],qs[_0x7196('0x3b')](_0x2f9583['query'][_0x7196('0x3b')]));_0x50c386[_0x7196('0x3a')]=_0x50c386[_0x7196('0x3a')][_0x7196('0x3c')]?_0x50c386[_0x7196('0x3a')]:_0x39710d[_0x7196('0x35')];if(!_0x2f9583['query'][_0x7196('0x3d')](_0x7196('0x3e'))){_0x50c386[_0x7196('0x23')]=qs['limit'](_0x2f9583[_0x7196('0x39')][_0x7196('0x23')]);_0x50c386[_0x7196('0x21')]=qs[_0x7196('0x21')](_0x2f9583[_0x7196('0x39')][_0x7196('0x21')]);}_0x50c386[_0x7196('0x3f')]=qs[_0x7196('0x40')](_0x2f9583[_0x7196('0x39')][_0x7196('0x40')]);_0x50c386['where']=qs[_0x7196('0x37')](_[_0x7196('0x41')](_0x2f9583['query'],_0x39710d[_0x7196('0x37')]),_0xd07f22);if(_0x2f9583['query']['filter']){_0x50c386[_0x7196('0x42')]=_[_0x7196('0x43')](_0x50c386['where'],{'$or':_['map'](_0xd07f22,function(_0x1bad95){if(_0x1bad95[_0x7196('0x33')]!==_0x7196('0x44')){var _0x4c2341={};_0x4c2341[_0x1bad95[_0x7196('0x2c')]]={'$like':'%'+_0x2f9583[_0x7196('0x39')][_0x7196('0x45')]+'%'};return _0x4c2341;}})});}_0x50c386=_[_0x7196('0x43')]({},_0x50c386,_0x2f9583[_0x7196('0x46')]);var _0x428d76={'where':_0x50c386[_0x7196('0x42')]};return db[_0x7196('0x30')]['count'](_0x428d76)[_0x7196('0x28')](function(_0xa852e1){_0x429160['count']=_0xa852e1;if(_0x2f9583[_0x7196('0x39')][_0x7196('0x47')]){_0x50c386['include']=[{'all':!![]}];}return db[_0x7196('0x30')][_0x7196('0x48')](_0x50c386);})[_0x7196('0x28')](function(_0x5749e2){_0x429160[_0x7196('0x49')]=_0x5749e2;return _0x429160;})[_0x7196('0x28')](respondWithFilteredResult(_0xf999e9,_0x50c386))['catch'](handleError(_0xf999e9,null));};exports[_0x7196('0x4a')]=function(_0x1a7052,_0x4f0c6c){var _0x335e6f={'raw':!![],'where':{'id':_0x1a7052['params']['id']}},_0x53a5e6={};_0x53a5e6['model']=_['keys'](db['AnalyticDefaultReport'][_0x7196('0x31')]);_0x53a5e6['query']=_[_0x7196('0x36')](_0x1a7052[_0x7196('0x39')]);_0x53a5e6[_0x7196('0x37')]=_[_0x7196('0x38')](_0x53a5e6['model'],_0x53a5e6[_0x7196('0x39')]);_0x335e6f['attributes']=_[_0x7196('0x38')](_0x53a5e6[_0x7196('0x35')],qs[_0x7196('0x3b')](_0x1a7052['query'][_0x7196('0x3b')]));_0x335e6f[_0x7196('0x3a')]=_0x335e6f[_0x7196('0x3a')]['length']?_0x335e6f['attributes']:_0x53a5e6[_0x7196('0x35')];if(_0x1a7052['query'][_0x7196('0x47')]){_0x335e6f['include']=[{'all':!![]}];}_0x335e6f=_['merge']({},_0x335e6f,_0x1a7052[_0x7196('0x46')]);return db['AnalyticDefaultReport']['find'](_0x335e6f)['then'](handleEntityNotFound(_0x4f0c6c,null))[_0x7196('0x28')](respondWithResult(_0x4f0c6c,null))['catch'](handleError(_0x4f0c6c,null));};exports['create']=function(_0x28591e,_0x182c8b){return db[_0x7196('0x30')][_0x7196('0x4b')](_0x28591e['body'],{})[_0x7196('0x28')](function(_0x564688){var _0x36844f=_0x28591e[_0x7196('0x4c')]['get']({'plain':!![]});if(!_0x36844f)throw new Error(_0x7196('0x4d'));if(_0x36844f[_0x7196('0x4e')]===_0x7196('0x4c')){var _0x4fa18f=_0x564688[_0x7196('0x2a')]({'plain':!![]});var _0x5d51aa=_0x7196('0x4f');return db[_0x7196('0x50')][_0x7196('0x51')]({'where':{'name':_0x5d51aa,'userProfileId':_0x36844f[_0x7196('0x52')]},'raw':!![]})[_0x7196('0x28')](function(_0x19733a){if(_0x19733a&&_0x19733a[_0x7196('0x53')]===0x0){return db[_0x7196('0x54')]['create']({'name':_0x4fa18f['name'],'resourceId':_0x4fa18f['id'],'type':_0x7196('0x55'),'sectionId':_0x19733a['id']},{})[_0x7196('0x28')](function(){return _0x564688;});}else{return _0x564688;}})[_0x7196('0x56')](function(_0xe4b032){logger['error'](_0x7196('0x57'),_0xe4b032);throw _0xe4b032;});}return _0x564688;})[_0x7196('0x28')](respondWithResult(_0x182c8b,0xc9))[_0x7196('0x56')](handleError(_0x182c8b,null));};exports[_0x7196('0x27')]=function(_0x9fcfd4,_0x3177c2){if(_0x9fcfd4[_0x7196('0x58')]['id']){delete _0x9fcfd4[_0x7196('0x58')]['id'];}return db[_0x7196('0x30')][_0x7196('0x51')]({'where':{'id':_0x9fcfd4[_0x7196('0x59')]['id']}})['then'](handleEntityNotFound(_0x3177c2,null))[_0x7196('0x28')](saveUpdates(_0x9fcfd4[_0x7196('0x58')],null))[_0x7196('0x28')](respondWithResult(_0x3177c2,null))['catch'](handleError(_0x3177c2,null));};exports[_0x7196('0x29')]=function(_0x5ca1ca,_0x34407d){return db[_0x7196('0x30')][_0x7196('0x51')]({'where':{'id':_0x5ca1ca[_0x7196('0x59')]['id']}})[_0x7196('0x28')](handleEntityNotFound(_0x34407d,null))['then'](removeEntity(_0x34407d,null))[_0x7196('0x56')](handleError(_0x34407d,null));};exports['preview']=function(_0x4be36d,_0x5b9824){var _0x1bc358=0xa;var _0x3be180=[_0x7196('0x5a'),_0x7196('0x5b'),_0x7196('0x5c'),_0x7196('0x5d')];var _0x2d8b3d={'SUM':'SUM(%s)','COUNT':_0x7196('0x5e'),'COUNT DISTINCT':_0x7196('0x5f'),'MAX':_0x7196('0x60'),'MIN':_0x7196('0x61'),'AVG':_0x7196('0x62'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x7196('0x63')};var _0x1c7eb2={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':_0x7196('0x66'),'ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':_0x7196('0x68')};var _0x43ee13=function(_0x13e9d0){return!_[_0x7196('0x69')]([_0x7196('0x6a'),'IS\x20NOT\x20NULL',_0x7196('0x6b'),_0x7196('0x6c')],_0x13e9d0);};var _0x27d5d7=function(_0x33f43b){if(!_0x33f43b||!_0x33f43b['rules'][_0x7196('0x3c')]){return'';}for(var _0x204c3a='(',_0x1f3acc=0x0;_0x1f3acc<_0x33f43b[_0x7196('0x6d')][_0x7196('0x3c')];_0x1f3acc+=0x1){_0x1f3acc>0x0&&(_0x204c3a+='\x20'+_0x33f43b[_0x7196('0x6e')]+'\x20');_0x204c3a+=_0x33f43b[_0x7196('0x6d')][_0x1f3acc]['group']?_0x27d5d7(_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x6f')]):_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x70')]+'\x20'+_0x33f43b['rules'][_0x1f3acc][_0x7196('0x71')]+(_0x43ee13(_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x71')])?'\x20'+_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x72')]:'');}return _0x204c3a+')';};var _0x37c6be={'where':{'id':_0x4be36d['params']['id']}},_0x57065,_0x517dfb,_0x56b2eb,_0x56955e,_0x72f6f1;_0x37c6be=_[_0x7196('0x43')]({},_0x37c6be,_0x4be36d[_0x7196('0x46')]);return db[_0x7196('0x30')][_0x7196('0x51')](_0x37c6be)[_0x7196('0x28')](function(_0x30d44f){if(_0x30d44f){_0x57065=_0x30d44f;return _0x30d44f[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x3881a5){if(_0x3881a5){if(!_0x3881a5['length']){throw new db['Sequelize'][(_0x7196('0x74'))](_0x7196('0x75'),0x193);}_0x517dfb=_0x3881a5;return db[_0x7196('0x76')][_0x7196('0x48')]({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x45e21f){if(_0x45e21f){_0x56b2eb=_[_0x7196('0x77')](_0x45e21f,'id');var _0x2f36f8;var _0x4cc5e3=squel['select']();_0x4cc5e3[_0x7196('0x78')](_0x57065['table']);for(var _0x30d114=0x0;_0x30d114<_0x517dfb['length'];_0x30d114+=0x1){_0x2f36f8=_0x517dfb[_0x30d114][_0x7196('0x79')]?_0x56b2eb[_0x517dfb[_0x30d114][_0x7196('0x79')]][_0x7196('0x7a')]:_0x517dfb[_0x30d114][_0x7196('0x70')];_0x2f36f8=_0x517dfb[_0x30d114]['function']?_['replace'](_0x2d8b3d[_0x517dfb[_0x30d114][_0x7196('0x7b')]],'%s',_0x2f36f8):_0x2f36f8;_0x2f36f8=_0x517dfb[_0x30d114]['format']?_[_0x7196('0x7c')](_0x1c7eb2[_0x517dfb[_0x30d114][_0x7196('0x7d')]],'%s',_0x2f36f8):_0x2f36f8;if(_0x517dfb[_0x30d114][_0x7196('0x7e')]){_0x4cc5e3[_0x7196('0x6f')](_0x2f36f8);}_0x517dfb[_0x30d114][_0x7196('0x7f')]&&_0x4cc5e3[_0x7196('0x3f')](_0x2f36f8,_0x517dfb[_0x30d114]['orderBy']===_0x7196('0x80')?![]:!![]);_0x4cc5e3[_0x7196('0x70')](_0x2f36f8,_0x517dfb[_0x30d114][_0x7196('0x81')]||_0x2f36f8);}if(_0x57065[_0x7196('0x82')]){_0x57065[_0x7196('0x82')]=JSON[_0x7196('0x83')](_0x57065[_0x7196('0x82')]);for(var _0x473c0e=0x0;_0x473c0e<_0x57065[_0x7196('0x82')][_0x7196('0x3c')];_0x473c0e+=0x1){if(_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x33')]&&_['includes'](_0x3be180,_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x33')])&&_0x57065['joins'][_0x473c0e]['parentKey']&&_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')]&&_0x57065[_0x7196('0x82')][_0x473c0e]['foreignKey']){_0x4cc5e3[_0x57065[_0x7196('0x82')][_0x473c0e]['type']](_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')],null,util['format'](_0x7196('0x85'),_0x57065['table'],_0x57065['joins'][_0x473c0e][_0x7196('0x86')],_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')],_0x57065['joins'][_0x473c0e][_0x7196('0x87')]));}}}if(_0x57065['conditions']){_0x57065[_0x7196('0x88')]=JSON[_0x7196('0x83')](_0x57065[_0x7196('0x88')]);_0x4cc5e3[_0x7196('0x42')](_0x27d5d7(_0x57065[_0x7196('0x88')]['group']));}_0x72f6f1=_0x4cc5e3[_0x7196('0x89')]();_0x4cc5e3[_0x7196('0x23')](_0x1bc358);_0x4cc5e3[_0x7196('0x21')](0x0);logger[_0x7196('0x8a')](_0x7196('0x8b'),_0x4cc5e3[_0x7196('0x8c')]());return dbH[_0x7196('0x8d')][_0x7196('0x39')](_0x4cc5e3['toString'](),{'type':dbH[_0x7196('0x8d')][_0x7196('0x8e')][_0x7196('0x8f')]});}})[_0x7196('0x28')](respondWithResult(_0x5b9824,null))['catch'](handleError(_0x5b9824,null));};function runReport(_0x1364f5,_0x2cb53c,_0x4fe2cb){var _0x2e4807=_0x2cb53c['name'];var _0xd6d8cf=0xa;var _0x5318c1=[_0x7196('0x5a'),_0x7196('0x5b'),'right_join',_0x7196('0x5d')];var _0x2b52c0={'SUM':_0x7196('0x90'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x7196('0x60'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x7196('0x91'),'GROUP_CONCAT ASC':_0x7196('0x92'),'GROUP_CONCAT DESC':_0x7196('0x63')};var _0x509c4a={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':_0x7196('0x66'),'ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':_0x7196('0x68')};var _0x26048c=function(_0x1a4d17){return!_[_0x7196('0x69')]([_0x7196('0x6a'),_0x7196('0x93'),_0x7196('0x6b'),'IS\x20NOT\x20EMPTY'],_0x1a4d17);};var _0x5acff1=function(_0x32ab6c){if(!_0x32ab6c||!_0x32ab6c['rules']['length']){return'';}for(var _0x2bfdc4='(',_0x1604fa=0x0;_0x1604fa<_0x32ab6c[_0x7196('0x6d')][_0x7196('0x3c')];_0x1604fa+=0x1){_0x1604fa>0x0&&(_0x2bfdc4+='\x20'+_0x32ab6c['operator']+'\x20');_0x2bfdc4+=_0x32ab6c['rules'][_0x1604fa][_0x7196('0x6f')]?_0x5acff1(_0x32ab6c[_0x7196('0x6d')][_0x1604fa][_0x7196('0x6f')]):_0x32ab6c[_0x7196('0x6d')][_0x1604fa]['field']+'\x20'+_0x32ab6c[_0x7196('0x6d')][_0x1604fa]['condition']+(_0x26048c(_0x32ab6c['rules'][_0x1604fa][_0x7196('0x71')])?'\x20'+_0x32ab6c[_0x7196('0x6d')][_0x1604fa][_0x7196('0x72')]:'');}return _0x2bfdc4+')';};var _0x494418={'where':{'id':_0x1364f5['id']}},_0x400aa5,_0x40d4c3,_0x1824e2,_0x30c54b,_0x10712f;_0x494418=_[_0x7196('0x43')]({},_0x494418,_0x4fe2cb);return db[_0x7196('0x30')][_0x7196('0x51')](_0x494418)['then'](function(_0x9bd2ea){if(_0x9bd2ea){_0x400aa5=_0x9bd2ea;return _0x9bd2ea[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x408760){if(_0x408760){if(!_0x408760[_0x7196('0x3c')]){throw new db['Sequelize'][(_0x7196('0x74'))](_0x7196('0x75'),0x193);}_0x40d4c3=_0x408760;return db[_0x7196('0x76')]['findAll']({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x4b98de){if(_0x4b98de){_0x1824e2=_['keyBy'](_0x4b98de,'id');var _0x1dcf93;var _0x25d323=squel['select']();_0x25d323[_0x7196('0x78')](_0x400aa5[_0x7196('0x94')]);for(var _0x48ceda=0x0;_0x48ceda<_0x40d4c3[_0x7196('0x3c')];_0x48ceda+=0x1){_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x79')]?_0x1824e2[_0x40d4c3[_0x48ceda][_0x7196('0x79')]][_0x7196('0x7a')]:_0x40d4c3[_0x48ceda][_0x7196('0x70')];_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x7b')]?_['replace'](_0x2b52c0[_0x40d4c3[_0x48ceda][_0x7196('0x7b')]],'%s',_0x1dcf93):_0x1dcf93;_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x7d')]?_[_0x7196('0x7c')](_0x509c4a[_0x40d4c3[_0x48ceda]['format']],'%s',_0x1dcf93):_0x1dcf93;if(_0x40d4c3[_0x48ceda]['groupBy']){_0x25d323['group'](_0x1dcf93);}_0x40d4c3[_0x48ceda][_0x7196('0x7f')]&&_0x25d323[_0x7196('0x3f')](_0x1dcf93,_0x40d4c3[_0x48ceda][_0x7196('0x7f')]==='DESC'?![]:!![]);_0x25d323[_0x7196('0x70')](_0x1dcf93,_0x40d4c3[_0x48ceda]['alias']||_0x1dcf93);}if(_0x400aa5[_0x7196('0x82')]){_0x400aa5['joins']=JSON[_0x7196('0x83')](_0x400aa5[_0x7196('0x82')]);for(var _0x33d5bf=0x0;_0x33d5bf<_0x400aa5[_0x7196('0x82')][_0x7196('0x3c')];_0x33d5bf+=0x1){if(_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x33')]&&_['includes'](_0x5318c1,_0x400aa5[_0x7196('0x82')][_0x33d5bf]['type'])&&_0x400aa5['joins'][_0x33d5bf]['parentKey']&&_0x400aa5['joins'][_0x33d5bf]['foreignTable']&&_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x87')]){_0x25d323[_0x400aa5[_0x7196('0x82')][_0x33d5bf]['type']](_0x400aa5[_0x7196('0x82')][_0x33d5bf]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x400aa5[_0x7196('0x94')],_0x400aa5['joins'][_0x33d5bf][_0x7196('0x86')],_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x84')],_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x87')]));}}}if(_0x400aa5[_0x7196('0x88')]){_0x400aa5[_0x7196('0x88')]=JSON[_0x7196('0x83')](_0x400aa5['conditions']);_0x25d323[_0x7196('0x42')](_0x5acff1(_0x400aa5[_0x7196('0x88')][_0x7196('0x6f')]));}_0x10712f=_0x25d323['clone']();_0x25d323[_0x7196('0x23')](_0xd6d8cf);_0x25d323[_0x7196('0x21')](0x0);return;}})[_0x7196('0x28')](function(){if(_0x2cb53c['output']===_0x7196('0x95')){return null;}var _0x46a563=_[_0x7196('0x43')](_0x2cb53c,{'name':_0x2cb53c['fullPath']||_0x2cb53c[_0x7196('0x2c')]||_0x400aa5[_0x7196('0x2c')],'basename':_0x2e4807,'savename':util['format'](_0x7196('0x96'),_0x2cb53c['name']||_0x400aa5[_0x7196('0x2c')],require(_0x7196('0x97'))['generate'](0x4),_0x2cb53c[_0x7196('0x98')]||'csv'),'reportId':_0x400aa5['id'],'reportType':_0x7196('0x99')});return db[_0x7196('0x9a')][_0x7196('0x4b')](_0x46a563,{'raw':!![]});})['then'](function(_0xd9619d){if(_0x400aa5[_0x7196('0x94')]===_0x7196('0x9b')){_0x10712f[_0x7196('0x42')](_0x400aa5['table']+_0x7196('0x9c'),_0x2cb53c[_0x7196('0x9d')],_0x2cb53c[_0x7196('0x9e')]);}else{_0x10712f['where'](_0x400aa5['table']+_0x7196('0x9f'),_0x2cb53c[_0x7196('0x9d')],_0x2cb53c[_0x7196('0x9e')]);}if(_0xd9619d){logger[_0x7196('0xa0')]('Run\x20Query:',_0x10712f[_0x7196('0x8c')]());require('child_process')[_0x7196('0xa1')](path['join'](__dirname,_0x7196('0xa2'),_0xd9619d[_0x7196('0x98')]),[_0xd9619d['id'],_0x10712f[_0x7196('0x8c')](),path[_0x7196('0x5a')](__dirname,_0x7196('0xa3'),_0xd9619d[_0x7196('0xa4')]),_0x2e4807]);return _0xd9619d;}else{var _0x342fb1=squel['select']();_0x342fb1[_0x7196('0x78')]('('+_0x10712f[_0x7196('0x8c')]()+')',_0x7196('0xa5'));_0x342fb1[_0x7196('0x70')](_0x7196('0xa6'),_0x7196('0x24'));_0x10712f[_0x7196('0x23')](_0x2cb53c[_0x7196('0x23')]||_0xd6d8cf);_0x10712f['offset'](_0x2cb53c[_0x7196('0x21')]||0x0);return dbH[_0x7196('0x8d')]['query'](_0x342fb1[_0x7196('0x8c')](),{'type':dbH[_0x7196('0x8d')]['QueryTypes'][_0x7196('0x8f')]})[_0x7196('0x28')](function(_0xdf1ede){if(!_0xdf1ede[_0x7196('0x3c')]){_0x30c54b=0x0;}else{_0x30c54b=_0xdf1ede[0x0]['count']||0x0;}return dbH['sequelize'][_0x7196('0x39')](_0x10712f['toString'](),{'type':dbH[_0x7196('0x8d')][_0x7196('0x8e')][_0x7196('0x8f')]});})[_0x7196('0x28')](function(_0x2df80a){return{'rows':_0x2df80a||[],'count':_0x30c54b};});}});}exports['run']=function(_0x392e74,_0x17ba6d){return runReport(_0x392e74[_0x7196('0x59')],_0x392e74[_0x7196('0x39')],_0x392e74[_0x7196('0x46')])[_0x7196('0x28')](respondWithResult(_0x17ba6d,null))[_0x7196('0x56')](handleError(_0x17ba6d,null));};exports[_0x7196('0xa7')]=runReport;exports[_0x7196('0x39')]=function(_0x5a3c87,_0x58fb86){var _0x51da79=0xa;var _0x144613=[_0x7196('0x5a'),_0x7196('0x5b'),_0x7196('0x5c'),_0x7196('0x5d')];var _0x9055af={'SUM':_0x7196('0x90'),'COUNT':_0x7196('0x5e'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x7196('0x91'),'GROUP_CONCAT ASC':_0x7196('0x92'),'GROUP_CONCAT DESC':_0x7196('0x63')};var _0xab9595={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':'HOUR(%s)','ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5236a0=function(_0x520fe8){return!_['includes'](['IS\x20NULL',_0x7196('0x93'),'IS\x20EMPTY',_0x7196('0x6c')],_0x520fe8);};var _0x425a57=function(_0x302728){if(!_0x302728||!_0x302728[_0x7196('0x6d')][_0x7196('0x3c')]){return'';}for(var _0x14492e='(',_0x58df43=0x0;_0x58df43<_0x302728[_0x7196('0x6d')][_0x7196('0x3c')];_0x58df43+=0x1){_0x58df43>0x0&&(_0x14492e+='\x20'+_0x302728[_0x7196('0x6e')]+'\x20');_0x14492e+=_0x302728['rules'][_0x58df43][_0x7196('0x6f')]?_0x425a57(_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x6f')]):_0x302728['rules'][_0x58df43]['field']+'\x20'+_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x71')]+(_0x5236a0(_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x71')])?'\x20'+_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x72')]:'');}return _0x14492e+')';};var _0x1a8a5a={'where':{'id':_0x5a3c87[_0x7196('0x59')]['id']}},_0x2944e5,_0x3f9385,_0xbd94ef,_0x5d2a56,_0x2fb552;_0x1a8a5a=_['merge']({},_0x1a8a5a,_0x5a3c87[_0x7196('0x46')]);return db[_0x7196('0x30')]['find'](_0x1a8a5a)[_0x7196('0x28')](function(_0x386259){if(_0x386259){_0x2944e5=_0x386259;return _0x386259[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x1e7a64){if(_0x1e7a64){if(!_0x1e7a64[_0x7196('0x3c')]){throw new db['Sequelize']['ValidationErrorItem'](_0x7196('0x75'),0x193);}_0x3f9385=_0x1e7a64;return db['AnalyticMetric'][_0x7196('0x48')]({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x30db09){if(_0x30db09){_0xbd94ef=_['keyBy'](_0x30db09,'id');var _0x4729e1;var _0x66e1e6=squel[_0x7196('0xa8')]();_0x66e1e6[_0x7196('0x78')](_0x2944e5[_0x7196('0x94')]);for(var _0x1e2105=0x0;_0x1e2105<_0x3f9385[_0x7196('0x3c')];_0x1e2105+=0x1){_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x79')]?_0xbd94ef[_0x3f9385[_0x1e2105][_0x7196('0x79')]]['metric']:_0x3f9385[_0x1e2105][_0x7196('0x70')];_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x7b')]?_[_0x7196('0x7c')](_0x9055af[_0x3f9385[_0x1e2105][_0x7196('0x7b')]],'%s',_0x4729e1):_0x4729e1;_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x7d')]?_[_0x7196('0x7c')](_0xab9595[_0x3f9385[_0x1e2105]['format']],'%s',_0x4729e1):_0x4729e1;if(_0x3f9385[_0x1e2105][_0x7196('0x7e')]){_0x66e1e6['group'](_0x4729e1);}_0x3f9385[_0x1e2105][_0x7196('0x7f')]&&_0x66e1e6[_0x7196('0x3f')](_0x4729e1,_0x3f9385[_0x1e2105][_0x7196('0x7f')]==='DESC'?![]:!![]);_0x66e1e6['field'](_0x4729e1,_0x3f9385[_0x1e2105][_0x7196('0x81')]||_0x4729e1);}if(_0x2944e5[_0x7196('0x82')]){_0x2944e5[_0x7196('0x82')]=JSON[_0x7196('0x83')](_0x2944e5[_0x7196('0x82')]);for(var _0x220315=0x0;_0x220315<_0x2944e5[_0x7196('0x82')][_0x7196('0x3c')];_0x220315+=0x1){if(_0x2944e5['joins'][_0x220315][_0x7196('0x33')]&&_[_0x7196('0x69')](_0x144613,_0x2944e5['joins'][_0x220315][_0x7196('0x33')])&&_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x86')]&&_0x2944e5['joins'][_0x220315][_0x7196('0x84')]&&_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x87')]){_0x66e1e6[_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x33')]](_0x2944e5['joins'][_0x220315]['foreignTable'],null,util[_0x7196('0x7d')](_0x7196('0x85'),_0x2944e5[_0x7196('0x94')],_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x86')],_0x2944e5[_0x7196('0x82')][_0x220315]['foreignTable'],_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x87')]));}}}if(_0x2944e5[_0x7196('0x88')]){_0x2944e5[_0x7196('0x88')]=JSON['parse'](_0x2944e5[_0x7196('0x88')]);_0x66e1e6[_0x7196('0x42')](_0x425a57(_0x2944e5[_0x7196('0x88')][_0x7196('0x6f')]));}_0x2fb552=_0x66e1e6[_0x7196('0x89')]();_0x66e1e6[_0x7196('0x23')](_0x51da79);_0x66e1e6[_0x7196('0x21')](0x0);logger[_0x7196('0x8a')](_0x7196('0x8b'),_0x66e1e6[_0x7196('0x8c')]());return dbH[_0x7196('0x8d')][_0x7196('0x39')](_0x66e1e6['toString'](),{'type':dbH[_0x7196('0x8d')]['QueryTypes'][_0x7196('0x8f')]});}})['then'](function(){return{'sql':_0x2fb552[_0x7196('0x8c')]()};})['then'](respondWithResult(_0x58fb86,null))[_0x7196('0x56')](handleError(_0x58fb86,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index a5d7aa5..490636a 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 _0x363b=['path','../../config/environment','./analyticDefaultReport.attributes','exports','AnalyticDefaultReport','lodash','util','api','moment','bluebird','request-promise'];(function(_0x23acb3,_0x1dc2b6){var _0x4f4b20=function(_0x2ce493){while(--_0x2ce493){_0x23acb3['push'](_0x23acb3['shift']());}};_0x4f4b20(++_0x1dc2b6);}(_0x363b,0xf7));var _0xb363=function(_0x3e8112,_0x18ac48){_0x3e8112=_0x3e8112-0x0;var _0x48dde7=_0x363b[_0x3e8112];return _0x48dde7;};'use strict';var _=require(_0xb363('0x0'));var util=require(_0xb363('0x1'));var logger=require('../../config/logger')(_0xb363('0x2'));var moment=require(_0xb363('0x3'));var BPromise=require(_0xb363('0x4'));var rp=require(_0xb363('0x5'));var fs=require('fs');var path=require(_0xb363('0x6'));var rimraf=require('rimraf');var config=require(_0xb363('0x7'));var attributes=require(_0xb363('0x8'));module[_0xb363('0x9')]=function(_0x38f666,_0x46b2ca){return _0x38f666['define'](_0xb363('0xa'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcf34=['../../config/environment','./analyticDefaultReport.attributes','define','AnalyticDefaultReport','analytics_default_reports','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x597b41,_0x7c3cc){var _0x625c53=function(_0x6939c0){while(--_0x6939c0){_0x597b41['push'](_0x597b41['shift']());}};_0x625c53(++_0x7c3cc);}(_0xcf34,0xad));var _0x4cf3=function(_0x392dc2,_0x47c3f3){_0x392dc2=_0x392dc2-0x0;var _0x14150f=_0xcf34[_0x392dc2];return _0x14150f;};'use strict';var _=require('lodash');var util=require(_0x4cf3('0x0'));var logger=require(_0x4cf3('0x1'))(_0x4cf3('0x2'));var moment=require(_0x4cf3('0x3'));var BPromise=require(_0x4cf3('0x4'));var rp=require(_0x4cf3('0x5'));var fs=require('fs');var path=require(_0x4cf3('0x6'));var rimraf=require('rimraf');var config=require(_0x4cf3('0x7'));var attributes=require(_0x4cf3('0x8'));module['exports']=function(_0x20ec54,_0xe8b4cf){return _0x20ec54[_0x4cf3('0x9')](_0x4cf3('0xa'),attributes,{'tableName':_0x4cf3('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 49adbda..dec7ea1 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 _0x184a=['request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','code','message','result','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http'];(function(_0x509bb2,_0x431e36){var _0xf70b8e=function(_0x1e212d){while(--_0x1e212d){_0x509bb2['push'](_0x509bb2['shift']());}};_0xf70b8e(++_0x431e36);}(_0x184a,0x1c3));var _0xa184=function(_0x35d536,_0x2ad226){_0x35d536=_0x35d536-0x0;var _0x459181=_0x184a[_0x35d536];return _0x459181;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa184('0x0'));var BPromise=require(_0xa184('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa184('0x2'));var db=require(_0xa184('0x3'))['db'];var utils=require(_0xa184('0x4'));var logger=require(_0xa184('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa184('0x6'));var client=jayson[_0xa184('0x7')][_0xa184('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5b8135,_0x13157c,_0x584461){return new BPromise(function(_0x1a3613,_0x1d6191){return client[_0xa184('0x9')](_0x5b8135,_0x584461)[_0xa184('0xa')](function(_0x14ed3e){logger[_0xa184('0xb')](_0xa184('0xc'),_0x13157c,_0xa184('0xd'));logger[_0xa184('0xe')](_0xa184('0xf'),_0x13157c,_0xa184('0xd'),JSON['stringify'](_0x14ed3e));if(_0x14ed3e[_0xa184('0x10')]){if(_0x14ed3e[_0xa184('0x10')][_0xa184('0x11')]===0x1f4){logger[_0xa184('0x10')](_0xa184('0xc'),_0x13157c,_0x14ed3e[_0xa184('0x10')][_0xa184('0x12')]);return _0x1d6191(_0x14ed3e['error'][_0xa184('0x12')]);}logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x13157c,_0x14ed3e[_0xa184('0x10')][_0xa184('0x12')]);return _0x1a3613(_0x14ed3e['error']['message']);}else{logger[_0xa184('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x13157c,_0xa184('0xd'));_0x1a3613(_0x14ed3e[_0xa184('0x13')][_0xa184('0x12')]);}})['catch'](function(_0x442922){logger['error'](_0xa184('0xc'),_0x13157c,_0x442922);_0x1d6191(_0x442922);});});}
\ No newline at end of file
+var _0x18e9=['../../mysqldb','../../config/logger','../../config/environment','client','http','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring'];(function(_0x2e4b5a,_0x208a5b){var _0x3429c6=function(_0x1fe4b8){while(--_0x1fe4b8){_0x2e4b5a['push'](_0x2e4b5a['shift']());}};_0x3429c6(++_0x208a5b);}(_0x18e9,0x1f4));var _0x918e=function(_0x25662e,_0x4cec68){_0x25662e=_0x25662e-0x0;var _0x59b7bc=_0x18e9[_0x25662e];return _0x59b7bc;};'use strict';var _=require(_0x918e('0x0'));var util=require(_0x918e('0x1'));var moment=require('moment');var BPromise=require(_0x918e('0x2'));var rs=require(_0x918e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x918e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x918e('0x5'))('rpc');var config=require(_0x918e('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x918e('0x7')][_0x918e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x458027,_0x590d45,_0x59ef00){return new BPromise(function(_0x42da24,_0x2923c0){return client['request'](_0x458027,_0x59ef00)[_0x918e('0x9')](function(_0x550c30){logger['info'](_0x918e('0xa'),_0x590d45,_0x918e('0xb'));logger[_0x918e('0xc')](_0x918e('0xd'),_0x590d45,_0x918e('0xb'),JSON[_0x918e('0xe')](_0x550c30));if(_0x550c30[_0x918e('0xf')]){if(_0x550c30[_0x918e('0xf')][_0x918e('0x10')]===0x1f4){logger[_0x918e('0xf')](_0x918e('0xa'),_0x590d45,_0x550c30[_0x918e('0xf')][_0x918e('0x11')]);return _0x2923c0(_0x550c30[_0x918e('0xf')]['message']);}logger[_0x918e('0xf')](_0x918e('0xa'),_0x590d45,_0x550c30[_0x918e('0xf')][_0x918e('0x11')]);return _0x42da24(_0x550c30[_0x918e('0xf')][_0x918e('0x11')]);}else{logger[_0x918e('0x12')](_0x918e('0xa'),_0x590d45,'request\x20sent');_0x42da24(_0x550c30[_0x918e('0x13')][_0x918e('0x11')]);}})[_0x918e('0x14')](function(_0xcfa883){logger[_0x918e('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x590d45,_0xcfa883);_0x2923c0(_0xcfa883);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index ae9448c..30f59f2 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 _0x9e0c=['/:id/query','query','post','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./analyticDefaultReport.controller','get','isAuthenticated','show','/:id/preview','preview','/:id/run'];(function(_0x22b68a,_0x2bffc3){var _0x1ac67a=function(_0x25f9d5){while(--_0x25f9d5){_0x22b68a['push'](_0x22b68a['shift']());}};_0x1ac67a(++_0x2bffc3);}(_0x9e0c,0x194));var _0xc9e0=function(_0x4f807b,_0x517fc5){_0x4f807b=_0x4f807b-0x0;var _0x2a485d=_0x9e0c[_0x4f807b];return _0x2a485d;};'use strict';var multer=require(_0xc9e0('0x0'));var util=require(_0xc9e0('0x1'));var path=require('path');var timeout=require(_0xc9e0('0x2'));var express=require(_0xc9e0('0x3'));var router=express[_0xc9e0('0x4')]();var fs_extra=require(_0xc9e0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc9e0('0x6'));var config=require('../../config/environment');var controller=require(_0xc9e0('0x7'));router[_0xc9e0('0x8')]('/',auth[_0xc9e0('0x9')](),controller['index']);router[_0xc9e0('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xc9e0('0xa')]);router['get'](_0xc9e0('0xb'),auth[_0xc9e0('0x9')](),controller[_0xc9e0('0xc')]);router['get'](_0xc9e0('0xd'),auth[_0xc9e0('0x9')](),controller['run']);router[_0xc9e0('0x8')](_0xc9e0('0xe'),auth['isAuthenticated'](),controller[_0xc9e0('0xf')]);router[_0xc9e0('0x10')]('/',auth[_0xc9e0('0x9')](),controller['create']);router['put'](_0xc9e0('0x11'),auth[_0xc9e0('0x9')](),controller[_0xc9e0('0x12')]);router[_0xc9e0('0x13')](_0xc9e0('0x11'),auth['isAuthenticated'](),controller[_0xc9e0('0x14')]);module[_0xc9e0('0x15')]=router;
\ No newline at end of file
+var _0xaaaf=['get','isAuthenticated','index','preview','run','/:id/query','query','put','/:id','update','destroy','exports','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller'];(function(_0x36e996,_0x3cb19e){var _0x44b9e4=function(_0x480e57){while(--_0x480e57){_0x36e996['push'](_0x36e996['shift']());}};_0x44b9e4(++_0x3cb19e);}(_0xaaaf,0x108));var _0xfaaa=function(_0x49c700,_0x8a6e95){_0x49c700=_0x49c700-0x0;var _0x4a2533=_0xaaaf[_0x49c700];return _0x4a2533;};'use strict';var multer=require('multer');var util=require(_0xfaaa('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfaaa('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0xfaaa('0x2'));var interaction=require(_0xfaaa('0x3'));var config=require(_0xfaaa('0x4'));var controller=require(_0xfaaa('0x5'));router[_0xfaaa('0x6')]('/',auth[_0xfaaa('0x7')](),controller[_0xfaaa('0x8')]);router[_0xfaaa('0x6')]('/:id',auth[_0xfaaa('0x7')](),controller['show']);router[_0xfaaa('0x6')]('/:id/preview',auth[_0xfaaa('0x7')](),controller[_0xfaaa('0x9')]);router['get']('/:id/run',auth[_0xfaaa('0x7')](),controller[_0xfaaa('0xa')]);router[_0xfaaa('0x6')](_0xfaaa('0xb'),auth[_0xfaaa('0x7')](),controller[_0xfaaa('0xc')]);router['post']('/',auth[_0xfaaa('0x7')](),controller['create']);router[_0xfaaa('0xd')](_0xfaaa('0xe'),auth[_0xfaaa('0x7')](),controller[_0xfaaa('0xf')]);router['delete'](_0xfaaa('0xe'),auth[_0xfaaa('0x7')](),controller[_0xfaaa('0x10')]);module[_0xfaaa('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 4b8504d..5ccfa9f 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 _0xb3c1=['manual','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','csv','pdf','xlsx','DATE'];(function(_0x3d6626,_0x447998){var _0x3f08b3=function(_0x1f5202){while(--_0x1f5202){_0x3d6626['push'](_0x3d6626['shift']());}};_0x3f08b3(++_0x447998);}(_0xb3c1,0x116));var _0x1b3c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb3c1[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x1b3c('0x0'));var moment=require(_0x1b3c('0x1'));module[_0x1b3c('0x2')]={'name':{'type':Sequelize[_0x1b3c('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x1b3c('0x3')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x1b3c('0x4'),_0x1b3c('0x5'),_0x1b3c('0x6')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x1b3c('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x1b3c('0x7')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x1b3c('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM'](_0x1b3c('0x8'),'scheduled'),'allowNull':![],'defaultValue':_0x1b3c('0x8')},'reportId':{'type':Sequelize[_0x1b3c('0x9')](0xb)[_0x1b3c('0xa')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x16bc=['Loading','manual','scheduled','INTEGER','UNSIGNED','sequelize','moment','STRING','ENUM','csv','pdf','xlsx','DATE'];(function(_0xee700d,_0x1388db){var _0x117b27=function(_0x401f16){while(--_0x401f16){_0xee700d['push'](_0xee700d['shift']());}};_0x117b27(++_0x1388db);}(_0x16bc,0xef));var _0xc16b=function(_0x4d65dc,_0x1bc42b){_0x4d65dc=_0x4d65dc-0x0;var _0x3c2057=_0x16bc[_0x4d65dc];return _0x3c2057;};'use strict';var Sequelize=require(_0xc16b('0x0'));var moment=require(_0xc16b('0x1'));module['exports']={'name':{'type':Sequelize[_0xc16b('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0xc16b('0x3')](_0xc16b('0x4'),_0xc16b('0x5'),_0xc16b('0x6')),'allowNull':![],'defaultValue':_0xc16b('0x4')},'savename':{'type':Sequelize[_0xc16b('0x2')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0xc16b('0x7')]},'status':{'type':Sequelize[_0xc16b('0x2')],'defaultValue':_0xc16b('0x8')},'type':{'type':Sequelize[_0xc16b('0x3')](_0xc16b('0x9'),_0xc16b('0xa')),'allowNull':![],'defaultValue':_0xc16b('0x9')},'reportId':{'type':Sequelize[_0xc16b('0xb')](0xb)[_0xc16b('0xc')]},'reportType':{'type':Sequelize[_0xc16b('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 92faedc..dc7a1d9 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 _0xa671=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','update','then','destroy','get','ExtractedReports','UserProfileResource','error','stack','name','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','options','count','includeAll','include','findAll','params','find','catch','create','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','download','basename','savename','output','existsSync','root','server/files/reports','Sequelize','exists','join','format','%s.%s','eml-format','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x2a4110,_0x31454b){var _0x27549c=function(_0x201cc4){while(--_0x201cc4){_0x2a4110['push'](_0x2a4110['shift']());}};_0x27549c(++_0x31454b);}(_0xa671,0xa4));var _0x1a67=function(_0x4a4ba0,_0x463721){_0x4a4ba0=_0x4a4ba0-0x0;var _0x45de2d=_0xa671[_0x4a4ba0];return _0x45de2d;};'use strict';var emlformat=require(_0x1a67('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1a67('0x1'));var moment=require(_0x1a67('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x1a67('0x3'));var sox=require(_0x1a67('0x4'));var csv=require(_0x1a67('0x5'));var ejs=require(_0x1a67('0x6'));var fs=require('fs');var fs_extra=require(_0x1a67('0x7'));var _=require(_0x1a67('0x8'));var squel=require(_0x1a67('0x9'));var crypto=require('crypto');var jsforce=require(_0x1a67('0xa'));var deskjs=require(_0x1a67('0xb'));var toCsv=require('to-csv');var querystring=require(_0x1a67('0xc'));var Papa=require('papaparse');var Redis=require(_0x1a67('0xd'));var authService=require(_0x1a67('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x1a67('0xf'));var hardwareService=require(_0x1a67('0x10'));var logger=require(_0x1a67('0x11'))(_0x1a67('0x12'));var utils=require(_0x1a67('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1a67('0x14'))['db'];function respondWithStatusCode(_0xa1dc75,_0x577f95){_0x577f95=_0x577f95||0xcc;return function(_0x1522da){if(_0x1522da){return _0xa1dc75[_0x1a67('0x15')](_0x577f95);}return _0xa1dc75[_0x1a67('0x16')](_0x577f95)[_0x1a67('0x17')]();};}function respondWithResult(_0x261eb1,_0x494e39){_0x494e39=_0x494e39||0xc8;return function(_0x20111a){if(_0x20111a){return _0x261eb1[_0x1a67('0x16')](_0x494e39)[_0x1a67('0x18')](_0x20111a);}};}function respondWithFilteredResult(_0x3be788,_0x3e0c9b){return function(_0x5d351b){if(_0x5d351b){var _0x3037e5=typeof _0x3e0c9b[_0x1a67('0x19')]===_0x1a67('0x1a')&&typeof _0x3e0c9b['limit']===_0x1a67('0x1a');var _0x38ab78=_0x5d351b['count'];var _0x13cdae=_0x3037e5?0x0:_0x3e0c9b[_0x1a67('0x19')];var _0x3e67e0=_0x3037e5?_0x5d351b['count']:_0x3e0c9b[_0x1a67('0x19')]+_0x3e0c9b[_0x1a67('0x1b')];var _0x30b544;if(_0x3e67e0>=_0x38ab78){_0x3e67e0=_0x38ab78;_0x30b544=0xc8;}else{_0x30b544=0xce;}_0x3be788[_0x1a67('0x16')](_0x30b544);return _0x3be788[_0x1a67('0x1c')](_0x1a67('0x1d'),_0x13cdae+'-'+_0x3e67e0+'/'+_0x38ab78)['json'](_0x5d351b);}return null;};}function patchUpdates(_0x4ea557){return function(_0x49466e){try{jsonpatch[_0x1a67('0x1e')](_0x49466e,_0x4ea557,!![]);}catch(_0x5a57a6){return BPromise['reject'](_0x5a57a6);}return _0x49466e['save']();};}function saveUpdates(_0x19849b,_0x1eb4a4){return function(_0xc674e1){if(_0xc674e1){return _0xc674e1[_0x1a67('0x1f')](_0x19849b)[_0x1a67('0x20')](function(_0x83fe96){return _0x83fe96;});}return null;};}function removeEntity(_0x53bdad,_0xa4de24){return function(_0x3797a9){if(_0x3797a9){return _0x3797a9[_0x1a67('0x21')]()[_0x1a67('0x20')](function(){var _0x2abb47=_0x3797a9[_0x1a67('0x22')]({'plain':!![]});var _0x2eefe2=_0x1a67('0x23');return db[_0x1a67('0x24')][_0x1a67('0x21')]({'where':{'type':_0x2eefe2,'resourceId':_0x2abb47['id']}})['then'](function(){return _0x3797a9;});})['then'](function(){_0x53bdad[_0x1a67('0x16')](0xcc)[_0x1a67('0x17')]();});}};}function handleEntityNotFound(_0x1ddce8,_0x37e542){return function(_0x19dd85){if(!_0x19dd85){_0x1ddce8[_0x1a67('0x15')](0x194);}return _0x19dd85;};}function handleError(_0x3e85f3,_0x473516){_0x473516=_0x473516||0x1f4;return function(_0xa9d15c){logger[_0x1a67('0x25')](_0xa9d15c[_0x1a67('0x26')]);if(_0xa9d15c[_0x1a67('0x27')]){delete _0xa9d15c[_0x1a67('0x27')];}_0x3e85f3[_0x1a67('0x16')](_0x473516)['send'](_0xa9d15c);};}exports[_0x1a67('0x28')]=function(_0x5840f0,_0xd21c19){var _0x4524f0={},_0x33c43b={},_0x530a80={'count':0x0,'rows':[]};var _0x130b7a=_[_0x1a67('0x29')](db[_0x1a67('0x2a')][_0x1a67('0x2b')],function(_0x2c4d47){return{'name':_0x2c4d47[_0x1a67('0x2c')],'type':_0x2c4d47[_0x1a67('0x2d')][_0x1a67('0x2e')]};});_0x33c43b[_0x1a67('0x2f')]=_[_0x1a67('0x29')](_0x130b7a,'name');_0x33c43b[_0x1a67('0x30')]=_[_0x1a67('0x31')](_0x5840f0[_0x1a67('0x30')]);_0x33c43b[_0x1a67('0x32')]=_[_0x1a67('0x33')](_0x33c43b[_0x1a67('0x2f')],_0x33c43b[_0x1a67('0x30')]);_0x4524f0[_0x1a67('0x34')]=_[_0x1a67('0x33')](_0x33c43b[_0x1a67('0x2f')],qs[_0x1a67('0x35')](_0x5840f0[_0x1a67('0x30')][_0x1a67('0x35')]));_0x4524f0[_0x1a67('0x34')]=_0x4524f0[_0x1a67('0x34')][_0x1a67('0x36')]?_0x4524f0[_0x1a67('0x34')]:_0x33c43b['model'];if(!_0x5840f0[_0x1a67('0x30')][_0x1a67('0x37')](_0x1a67('0x38'))){_0x4524f0[_0x1a67('0x1b')]=qs['limit'](_0x5840f0['query'][_0x1a67('0x1b')]);_0x4524f0[_0x1a67('0x19')]=qs['offset'](_0x5840f0['query'][_0x1a67('0x19')]);}_0x4524f0[_0x1a67('0x39')]=qs[_0x1a67('0x3a')](_0x5840f0['query']['sort']);_0x4524f0[_0x1a67('0x3b')]=qs[_0x1a67('0x32')](_[_0x1a67('0x3c')](_0x5840f0[_0x1a67('0x30')],_0x33c43b[_0x1a67('0x32')]),_0x130b7a);if(_0x5840f0[_0x1a67('0x30')]['filter']){_0x4524f0[_0x1a67('0x3b')]=_['merge'](_0x4524f0['where'],{'$or':_[_0x1a67('0x29')](_0x130b7a,function(_0x376b4d){if(_0x376b4d['type']!==_0x1a67('0x3d')){var _0x4ce617={};_0x4ce617[_0x376b4d[_0x1a67('0x27')]]={'$like':'%'+_0x5840f0['query']['filter']+'%'};return _0x4ce617;}})});}_0x4524f0=_['merge']({},_0x4524f0,_0x5840f0[_0x1a67('0x3e')]);var _0x48f884={'where':_0x4524f0['where']};return db[_0x1a67('0x2a')][_0x1a67('0x3f')](_0x48f884)[_0x1a67('0x20')](function(_0x1b0da9){_0x530a80['count']=_0x1b0da9;if(_0x5840f0[_0x1a67('0x30')][_0x1a67('0x40')]){_0x4524f0[_0x1a67('0x41')]=[{'all':!![]}];}return db[_0x1a67('0x2a')][_0x1a67('0x42')](_0x4524f0);})[_0x1a67('0x20')](function(_0x1e1b1f){_0x530a80['rows']=_0x1e1b1f;return _0x530a80;})[_0x1a67('0x20')](respondWithFilteredResult(_0xd21c19,_0x4524f0))['catch'](handleError(_0xd21c19,null));};exports['show']=function(_0x21464e,_0x5ca54f){var _0x1ead6c={'raw':!![],'where':{'id':_0x21464e[_0x1a67('0x43')]['id']}},_0x5a36c3={};_0x5a36c3[_0x1a67('0x2f')]=_['keys'](db[_0x1a67('0x2a')][_0x1a67('0x2b')]);_0x5a36c3[_0x1a67('0x30')]=_[_0x1a67('0x31')](_0x21464e[_0x1a67('0x30')]);_0x5a36c3[_0x1a67('0x32')]=_[_0x1a67('0x33')](_0x5a36c3[_0x1a67('0x2f')],_0x5a36c3['query']);_0x1ead6c[_0x1a67('0x34')]=_[_0x1a67('0x33')](_0x5a36c3[_0x1a67('0x2f')],qs[_0x1a67('0x35')](_0x21464e[_0x1a67('0x30')][_0x1a67('0x35')]));_0x1ead6c[_0x1a67('0x34')]=_0x1ead6c[_0x1a67('0x34')][_0x1a67('0x36')]?_0x1ead6c['attributes']:_0x5a36c3[_0x1a67('0x2f')];if(_0x21464e[_0x1a67('0x30')][_0x1a67('0x40')]){_0x1ead6c['include']=[{'all':!![]}];}_0x1ead6c=_['merge']({},_0x1ead6c,_0x21464e[_0x1a67('0x3e')]);return db[_0x1a67('0x2a')][_0x1a67('0x44')](_0x1ead6c)[_0x1a67('0x20')](handleEntityNotFound(_0x5ca54f,null))[_0x1a67('0x20')](respondWithResult(_0x5ca54f,null))[_0x1a67('0x45')](handleError(_0x5ca54f,null));};exports['create']=function(_0xf3632e,_0x39265e){return db['AnalyticExtractedReport'][_0x1a67('0x46')](_0xf3632e['body'],{})[_0x1a67('0x20')](function(_0xe45aa6){var _0x230a8f=_0xf3632e[_0x1a67('0x47')][_0x1a67('0x22')]({'plain':!![]});if(!_0x230a8f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x230a8f[_0x1a67('0x48')]==='user'){var _0x7ed474=_0xe45aa6[_0x1a67('0x22')]({'plain':!![]});var _0x1c9390='ExtractedReports';return db[_0x1a67('0x49')][_0x1a67('0x44')]({'where':{'name':_0x1c9390,'userProfileId':_0x230a8f[_0x1a67('0x4a')]},'raw':!![]})[_0x1a67('0x20')](function(_0xc8cc3f){if(_0xc8cc3f&&_0xc8cc3f[_0x1a67('0x4b')]===0x0){return db[_0x1a67('0x24')][_0x1a67('0x46')]({'name':_0x7ed474[_0x1a67('0x27')],'resourceId':_0x7ed474['id'],'type':_0xc8cc3f['name'],'sectionId':_0xc8cc3f['id']},{})['then'](function(){return _0xe45aa6;});}else{return _0xe45aa6;}})[_0x1a67('0x45')](function(_0x21f9a4){logger[_0x1a67('0x25')](_0x1a67('0x4c'),_0x21f9a4);throw _0x21f9a4;});}return _0xe45aa6;})[_0x1a67('0x20')](respondWithResult(_0x39265e,0xc9))[_0x1a67('0x45')](handleError(_0x39265e,null));};exports[_0x1a67('0x1f')]=function(_0x356321,_0xdbe607){if(_0x356321[_0x1a67('0x4d')]['id']){delete _0x356321[_0x1a67('0x4d')]['id'];}return db[_0x1a67('0x2a')][_0x1a67('0x44')]({'where':{'id':_0x356321[_0x1a67('0x43')]['id']}})[_0x1a67('0x20')](handleEntityNotFound(_0xdbe607,null))[_0x1a67('0x20')](saveUpdates(_0x356321['body'],null))[_0x1a67('0x20')](respondWithResult(_0xdbe607,null))[_0x1a67('0x45')](handleError(_0xdbe607,null));};exports['destroy']=function(_0x588533,_0x638194){return db[_0x1a67('0x2a')]['find']({'where':{'id':_0x588533[_0x1a67('0x43')]['id']}})[_0x1a67('0x20')](handleEntityNotFound(_0x638194,null))['then'](removeEntity(_0x638194,null))['catch'](handleError(_0x638194,null));};exports[_0x1a67('0x4e')]=function(_0x41f1b1,_0x2561de,_0x277975){return db['AnalyticExtractedReport'][_0x1a67('0x44')]({'where':{'id':_0x41f1b1[_0x1a67('0x43')]['id']},'attributes':[_0x1a67('0x27'),_0x1a67('0x4f'),_0x1a67('0x50'),_0x1a67('0x51')],'raw':!![]})['then'](handleEntityNotFound(_0x2561de,null))['then'](function(_0x32e0e5){if(_0x32e0e5){if(!fs[_0x1a67('0x52')](path['join'](config[_0x1a67('0x53')],_0x1a67('0x54'),_0x32e0e5[_0x1a67('0x50')]))){throw new db[(_0x1a67('0x55'))]['ValidationError']('Report\x20not\x20found\x20or\x20empty');}if(_0x41f1b1[_0x1a67('0x30')][_0x1a67('0x56')]){return _0x2561de[_0x1a67('0x15')](0xc8);}return _0x2561de[_0x1a67('0x4e')](path[_0x1a67('0x57')](config['root'],'server/files/reports',_0x32e0e5[_0x1a67('0x50')]),util[_0x1a67('0x58')](_0x1a67('0x59'),_0x32e0e5['basename']||_0x32e0e5[_0x1a67('0x27')],_0x32e0e5[_0x1a67('0x51')]['toLowerCase']()));}})[_0x1a67('0x45')](handleError(_0x2561de,null));};
\ No newline at end of file
+var _0xef92=['findAll','rows','params','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','error','download','basename','output','existsSync','root','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','sendStatus','savename','toLowerCase','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','ExtractedReports','stack','name','send','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll'];(function(_0x1003eb,_0xc3c682){var _0x3e9558=function(_0x3106f6){while(--_0x3106f6){_0x1003eb['push'](_0x1003eb['shift']());}};_0x3e9558(++_0xc3c682);}(_0xef92,0xd2));var _0x2ef9=function(_0x51e011,_0x5abb6e){_0x51e011=_0x51e011-0x0;var _0x5d9aa3=_0xef92[_0x51e011];return _0x5d9aa3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2ef9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2ef9('0x1'));var rp=require(_0x2ef9('0x2'));var moment=require(_0x2ef9('0x3'));var BPromise=require(_0x2ef9('0x4'));var Mustache=require(_0x2ef9('0x5'));var util=require(_0x2ef9('0x6'));var path=require('path');var sox=require(_0x2ef9('0x7'));var csv=require(_0x2ef9('0x8'));var ejs=require(_0x2ef9('0x9'));var fs=require('fs');var fs_extra=require(_0x2ef9('0xa'));var _=require(_0x2ef9('0xb'));var squel=require('squel');var crypto=require(_0x2ef9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2ef9('0xd'));var toCsv=require(_0x2ef9('0x8'));var querystring=require(_0x2ef9('0xe'));var Papa=require(_0x2ef9('0xf'));var Redis=require(_0x2ef9('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x2ef9('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2ef9('0x12'))('api');var utils=require(_0x2ef9('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x2ef9('0x14'));var db=require(_0x2ef9('0x15'))['db'];function respondWithStatusCode(_0x485345,_0x42a219){_0x42a219=_0x42a219||0xcc;return function(_0x4a92c9){if(_0x4a92c9){return _0x485345['sendStatus'](_0x42a219);}return _0x485345[_0x2ef9('0x16')](_0x42a219)[_0x2ef9('0x17')]();};}function respondWithResult(_0x5a1f13,_0x3749dc){_0x3749dc=_0x3749dc||0xc8;return function(_0x2e11bd){if(_0x2e11bd){return _0x5a1f13[_0x2ef9('0x16')](_0x3749dc)[_0x2ef9('0x18')](_0x2e11bd);}};}function respondWithFilteredResult(_0x209fe8,_0x36a993){return function(_0x178d5c){if(_0x178d5c){var _0x53b75d=typeof _0x36a993[_0x2ef9('0x19')]==='undefined'&&typeof _0x36a993[_0x2ef9('0x1a')]==='undefined';var _0x5dbad0=_0x178d5c[_0x2ef9('0x1b')];var _0x2e9753=_0x53b75d?0x0:_0x36a993[_0x2ef9('0x19')];var _0x46f65f=_0x53b75d?_0x178d5c[_0x2ef9('0x1b')]:_0x36a993[_0x2ef9('0x19')]+_0x36a993['limit'];var _0x3b490e;if(_0x46f65f>=_0x5dbad0){_0x46f65f=_0x5dbad0;_0x3b490e=0xc8;}else{_0x3b490e=0xce;}_0x209fe8[_0x2ef9('0x16')](_0x3b490e);return _0x209fe8[_0x2ef9('0x1c')](_0x2ef9('0x1d'),_0x2e9753+'-'+_0x46f65f+'/'+_0x5dbad0)[_0x2ef9('0x18')](_0x178d5c);}return null;};}function patchUpdates(_0x4b4e98){return function(_0x468681){try{jsonpatch[_0x2ef9('0x1e')](_0x468681,_0x4b4e98,!![]);}catch(_0x282616){return BPromise[_0x2ef9('0x1f')](_0x282616);}return _0x468681[_0x2ef9('0x20')]();};}function saveUpdates(_0x5dc294,_0x30273f){return function(_0x567be4){if(_0x567be4){return _0x567be4[_0x2ef9('0x21')](_0x5dc294)['then'](function(_0x2f3d59){return _0x2f3d59;});}return null;};}function removeEntity(_0x456723,_0xd14f89){return function(_0x1486d3){if(_0x1486d3){return _0x1486d3[_0x2ef9('0x22')]()[_0x2ef9('0x23')](function(){var _0xa1e93c=_0x1486d3['get']({'plain':!![]});var _0x20b3bc=_0x2ef9('0x24');return db['UserProfileResource'][_0x2ef9('0x22')]({'where':{'type':_0x20b3bc,'resourceId':_0xa1e93c['id']}})[_0x2ef9('0x23')](function(){return _0x1486d3;});})['then'](function(){_0x456723['status'](0xcc)[_0x2ef9('0x17')]();});}};}function handleEntityNotFound(_0x401e1b,_0x17381a){return function(_0x3fab4a){if(!_0x3fab4a){_0x401e1b['sendStatus'](0x194);}return _0x3fab4a;};}function handleError(_0x3e45e7,_0x219133){_0x219133=_0x219133||0x1f4;return function(_0x2f3f5f){logger['error'](_0x2f3f5f[_0x2ef9('0x25')]);if(_0x2f3f5f[_0x2ef9('0x26')]){delete _0x2f3f5f[_0x2ef9('0x26')];}_0x3e45e7['status'](_0x219133)[_0x2ef9('0x27')](_0x2f3f5f);};}exports['index']=function(_0x14a90f,_0x12f564){var _0x595c83={},_0x1cd045={},_0x1e5bdc={'count':0x0,'rows':[]};var _0x211231=_[_0x2ef9('0x28')](db[_0x2ef9('0x29')][_0x2ef9('0x2a')],function(_0x16a59b){return{'name':_0x16a59b[_0x2ef9('0x2b')],'type':_0x16a59b[_0x2ef9('0x2c')][_0x2ef9('0x2d')]};});_0x1cd045[_0x2ef9('0x2e')]=_[_0x2ef9('0x28')](_0x211231,_0x2ef9('0x26'));_0x1cd045[_0x2ef9('0x2f')]=_[_0x2ef9('0x30')](_0x14a90f[_0x2ef9('0x2f')]);_0x1cd045[_0x2ef9('0x31')]=_['intersection'](_0x1cd045[_0x2ef9('0x2e')],_0x1cd045[_0x2ef9('0x2f')]);_0x595c83[_0x2ef9('0x32')]=_[_0x2ef9('0x33')](_0x1cd045['model'],qs[_0x2ef9('0x34')](_0x14a90f[_0x2ef9('0x2f')][_0x2ef9('0x34')]));_0x595c83['attributes']=_0x595c83[_0x2ef9('0x32')]['length']?_0x595c83[_0x2ef9('0x32')]:_0x1cd045['model'];if(!_0x14a90f[_0x2ef9('0x2f')][_0x2ef9('0x35')]('nolimit')){_0x595c83['limit']=qs[_0x2ef9('0x1a')](_0x14a90f[_0x2ef9('0x2f')][_0x2ef9('0x1a')]);_0x595c83[_0x2ef9('0x19')]=qs[_0x2ef9('0x19')](_0x14a90f[_0x2ef9('0x2f')]['offset']);}_0x595c83[_0x2ef9('0x36')]=qs[_0x2ef9('0x37')](_0x14a90f['query'][_0x2ef9('0x37')]);_0x595c83['where']=qs[_0x2ef9('0x31')](_[_0x2ef9('0x38')](_0x14a90f[_0x2ef9('0x2f')],_0x1cd045[_0x2ef9('0x31')]),_0x211231);if(_0x14a90f[_0x2ef9('0x2f')][_0x2ef9('0x39')]){_0x595c83[_0x2ef9('0x3a')]=_[_0x2ef9('0x3b')](_0x595c83[_0x2ef9('0x3a')],{'$or':_[_0x2ef9('0x28')](_0x211231,function(_0x2edcc7){if(_0x2edcc7['type']!==_0x2ef9('0x3c')){var _0xf32893={};_0xf32893[_0x2edcc7[_0x2ef9('0x26')]]={'$like':'%'+_0x14a90f['query'][_0x2ef9('0x39')]+'%'};return _0xf32893;}})});}_0x595c83=_[_0x2ef9('0x3b')]({},_0x595c83,_0x14a90f[_0x2ef9('0x3d')]);var _0x5ab483={'where':_0x595c83['where']};return db[_0x2ef9('0x29')]['count'](_0x5ab483)['then'](function(_0x325670){_0x1e5bdc[_0x2ef9('0x1b')]=_0x325670;if(_0x14a90f[_0x2ef9('0x2f')][_0x2ef9('0x3e')]){_0x595c83['include']=[{'all':!![]}];}return db[_0x2ef9('0x29')][_0x2ef9('0x3f')](_0x595c83);})[_0x2ef9('0x23')](function(_0x3038cf){_0x1e5bdc[_0x2ef9('0x40')]=_0x3038cf;return _0x1e5bdc;})[_0x2ef9('0x23')](respondWithFilteredResult(_0x12f564,_0x595c83))['catch'](handleError(_0x12f564,null));};exports['show']=function(_0xd230fb,_0x3619b6){var _0xd0fab4={'raw':!![],'where':{'id':_0xd230fb[_0x2ef9('0x41')]['id']}},_0x2b27ed={};_0x2b27ed[_0x2ef9('0x2e')]=_['keys'](db[_0x2ef9('0x29')][_0x2ef9('0x2a')]);_0x2b27ed[_0x2ef9('0x2f')]=_[_0x2ef9('0x30')](_0xd230fb[_0x2ef9('0x2f')]);_0x2b27ed[_0x2ef9('0x31')]=_[_0x2ef9('0x33')](_0x2b27ed['model'],_0x2b27ed[_0x2ef9('0x2f')]);_0xd0fab4[_0x2ef9('0x32')]=_[_0x2ef9('0x33')](_0x2b27ed[_0x2ef9('0x2e')],qs['fields'](_0xd230fb[_0x2ef9('0x2f')][_0x2ef9('0x34')]));_0xd0fab4['attributes']=_0xd0fab4['attributes']['length']?_0xd0fab4[_0x2ef9('0x32')]:_0x2b27ed[_0x2ef9('0x2e')];if(_0xd230fb[_0x2ef9('0x2f')][_0x2ef9('0x3e')]){_0xd0fab4['include']=[{'all':!![]}];}_0xd0fab4=_['merge']({},_0xd0fab4,_0xd230fb[_0x2ef9('0x3d')]);return db[_0x2ef9('0x29')]['find'](_0xd0fab4)[_0x2ef9('0x23')](handleEntityNotFound(_0x3619b6,null))[_0x2ef9('0x23')](respondWithResult(_0x3619b6,null))[_0x2ef9('0x42')](handleError(_0x3619b6,null));};exports[_0x2ef9('0x43')]=function(_0x4b6e54,_0x1fe876){return db['AnalyticExtractedReport']['create'](_0x4b6e54[_0x2ef9('0x44')],{})[_0x2ef9('0x23')](function(_0x3be167){var _0x2bd6ee=_0x4b6e54[_0x2ef9('0x45')][_0x2ef9('0x46')]({'plain':!![]});if(!_0x2bd6ee)throw new Error(_0x2ef9('0x47'));if(_0x2bd6ee[_0x2ef9('0x48')]===_0x2ef9('0x45')){var _0x3a6abc=_0x3be167[_0x2ef9('0x46')]({'plain':!![]});var _0x1fbc3d=_0x2ef9('0x24');return db[_0x2ef9('0x49')][_0x2ef9('0x4a')]({'where':{'name':_0x1fbc3d,'userProfileId':_0x2bd6ee[_0x2ef9('0x4b')]},'raw':!![]})[_0x2ef9('0x23')](function(_0x33e6ff){if(_0x33e6ff&&_0x33e6ff[_0x2ef9('0x4c')]===0x0){return db[_0x2ef9('0x4d')][_0x2ef9('0x43')]({'name':_0x3a6abc[_0x2ef9('0x26')],'resourceId':_0x3a6abc['id'],'type':_0x33e6ff[_0x2ef9('0x26')],'sectionId':_0x33e6ff['id']},{})[_0x2ef9('0x23')](function(){return _0x3be167;});}else{return _0x3be167;}})[_0x2ef9('0x42')](function(_0x307a5a){logger[_0x2ef9('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x307a5a);throw _0x307a5a;});}return _0x3be167;})[_0x2ef9('0x23')](respondWithResult(_0x1fe876,0xc9))['catch'](handleError(_0x1fe876,null));};exports[_0x2ef9('0x21')]=function(_0x4ccf13,_0x1936df){if(_0x4ccf13[_0x2ef9('0x44')]['id']){delete _0x4ccf13[_0x2ef9('0x44')]['id'];}return db[_0x2ef9('0x29')]['find']({'where':{'id':_0x4ccf13[_0x2ef9('0x41')]['id']}})[_0x2ef9('0x23')](handleEntityNotFound(_0x1936df,null))['then'](saveUpdates(_0x4ccf13[_0x2ef9('0x44')],null))['then'](respondWithResult(_0x1936df,null))['catch'](handleError(_0x1936df,null));};exports[_0x2ef9('0x22')]=function(_0x147057,_0x1c4701){return db[_0x2ef9('0x29')]['find']({'where':{'id':_0x147057[_0x2ef9('0x41')]['id']}})[_0x2ef9('0x23')](handleEntityNotFound(_0x1c4701,null))['then'](removeEntity(_0x1c4701,null))[_0x2ef9('0x42')](handleError(_0x1c4701,null));};exports[_0x2ef9('0x4f')]=function(_0x45a0b0,_0x5eea7b,_0x53a0c9){return db[_0x2ef9('0x29')][_0x2ef9('0x4a')]({'where':{'id':_0x45a0b0['params']['id']},'attributes':[_0x2ef9('0x26'),_0x2ef9('0x50'),'savename',_0x2ef9('0x51')],'raw':!![]})['then'](handleEntityNotFound(_0x5eea7b,null))[_0x2ef9('0x23')](function(_0x5cda6a){if(_0x5cda6a){if(!fs[_0x2ef9('0x52')](path['join'](config[_0x2ef9('0x53')],'server/files/reports',_0x5cda6a['savename']))){throw new db[(_0x2ef9('0x54'))][(_0x2ef9('0x55'))](_0x2ef9('0x56'));}if(_0x45a0b0[_0x2ef9('0x2f')][_0x2ef9('0x57')]){return _0x5eea7b[_0x2ef9('0x58')](0xc8);}return _0x5eea7b[_0x2ef9('0x4f')](path['join'](config['root'],'server/files/reports',_0x5cda6a[_0x2ef9('0x59')]),util['format']('%s.%s',_0x5cda6a[_0x2ef9('0x50')]||_0x5cda6a[_0x2ef9('0x26')],_0x5cda6a[_0x2ef9('0x51')][_0x2ef9('0x5a')]()));}})[_0x2ef9('0x42')](handleError(_0x5eea7b,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 89fb1b5..5a70657 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 _0xac9c=['path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','lodash','../../config/logger','api','bluebird'];(function(_0x4fa92f,_0x7b9d35){var _0x41b510=function(_0x111922){while(--_0x111922){_0x4fa92f['push'](_0x4fa92f['shift']());}};_0x41b510(++_0x7b9d35);}(_0xac9c,0x15c));var _0xcac9=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0xac9c[_0xe73080];return _0x12cbc4;};'use strict';var _=require(_0xcac9('0x0'));var util=require('util');var logger=require(_0xcac9('0x1'))(_0xcac9('0x2'));var moment=require('moment');var BPromise=require(_0xcac9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcac9('0x4'));var rimraf=require(_0xcac9('0x5'));var config=require(_0xcac9('0x6'));var attributes=require(_0xcac9('0x7'));module[_0xcac9('0x8')]=function(_0x121d51,_0x1d78ee){return _0x121d51[_0xcac9('0x9')](_0xcac9('0xa'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcf9c=['../../config/environment','./analyticExtractedReport.attributes','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0xcf9c,0x14a));var _0xccf9=function(_0x356f8d,_0x1b3deb){_0x356f8d=_0x356f8d-0x0;var _0x1be58e=_0xcf9c[_0x356f8d];return _0x1be58e;};'use strict';var _=require(_0xccf9('0x0'));var util=require(_0xccf9('0x1'));var logger=require(_0xccf9('0x2'))(_0xccf9('0x3'));var moment=require(_0xccf9('0x4'));var BPromise=require(_0xccf9('0x5'));var rp=require(_0xccf9('0x6'));var fs=require('fs');var path=require(_0xccf9('0x7'));var rimraf=require('rimraf');var config=require(_0xccf9('0x8'));var attributes=require(_0xccf9('0x9'));module['exports']=function(_0x178f90,_0x38e6a8){return _0x178f90[_0xccf9('0xa')](_0xccf9('0xb'),attributes,{'tableName':_0xccf9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index 9530013..8188edf 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 _0x65d3=['debug','stringify','error','message','result','catch','lodash','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent'];(function(_0x3f8ba2,_0x30a892){var _0x7ce28b=function(_0x28f45d){while(--_0x28f45d){_0x3f8ba2['push'](_0x3f8ba2['shift']());}};_0x7ce28b(++_0x30a892);}(_0x65d3,0x1f4));var _0x365d=function(_0x383602,_0x46fb90){_0x383602=_0x383602-0x0;var _0x5bfe65=_0x65d3[_0x383602];return _0x5bfe65;};'use strict';var _=require(_0x365d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x365d('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x365d('0x2'));var logger=require(_0x365d('0x3'))(_0x365d('0x4'));var config=require(_0x365d('0x5'));var jayson=require(_0x365d('0x6'));var client=jayson[_0x365d('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4fe035,_0x215a68,_0x2ca1ec){return new BPromise(function(_0x4f4189,_0x2d0201){return client[_0x365d('0x8')](_0x4fe035,_0x2ca1ec)[_0x365d('0x9')](function(_0x20519f){logger[_0x365d('0xa')](_0x365d('0xb'),_0x215a68,_0x365d('0xc'));logger[_0x365d('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x215a68,'request\x20sent',JSON[_0x365d('0xe')](_0x20519f));if(_0x20519f[_0x365d('0xf')]){if(_0x20519f['error']['code']===0x1f4){logger[_0x365d('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x215a68,_0x20519f[_0x365d('0xf')][_0x365d('0x10')]);return _0x2d0201(_0x20519f['error'][_0x365d('0x10')]);}logger[_0x365d('0xf')](_0x365d('0xb'),_0x215a68,_0x20519f[_0x365d('0xf')][_0x365d('0x10')]);return _0x4f4189(_0x20519f['error']['message']);}else{logger[_0x365d('0xa')](_0x365d('0xb'),_0x215a68,_0x365d('0xc'));_0x4f4189(_0x20519f[_0x365d('0x11')][_0x365d('0x10')]);}})[_0x365d('0x12')](function(_0x387b73){logger[_0x365d('0xf')](_0x365d('0xb'),_0x215a68,_0x387b73);_0x2d0201(_0x387b73);});});}
\ No newline at end of file
+var _0xb697=['message','result','catch','lodash','util','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x254a7c,_0x56c40d){var _0x4a5a58=function(_0x2dc7ae){while(--_0x2dc7ae){_0x254a7c['push'](_0x254a7c['shift']());}};_0x4a5a58(++_0x56c40d);}(_0xb697,0xcb));var _0x7b69=function(_0xe0a503,_0x144de7){_0xe0a503=_0xe0a503-0x0;var _0x325432=_0xb697[_0xe0a503];return _0x325432;};'use strict';var _=require(_0x7b69('0x0'));var util=require(_0x7b69('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7b69('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7b69('0x3'))(_0x7b69('0x4'));var config=require(_0x7b69('0x5'));var jayson=require(_0x7b69('0x6'));var client=jayson[_0x7b69('0x7')][_0x7b69('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x6364a5,_0x2c530b,_0xd7615b){return new BPromise(function(_0xb17e9f,_0x380e7e){return client[_0x7b69('0x9')](_0x6364a5,_0xd7615b)[_0x7b69('0xa')](function(_0x517f53){logger[_0x7b69('0xb')](_0x7b69('0xc'),_0x2c530b,_0x7b69('0xd'));logger[_0x7b69('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x2c530b,'request\x20sent',JSON[_0x7b69('0xf')](_0x517f53));if(_0x517f53['error']){if(_0x517f53[_0x7b69('0x10')]['code']===0x1f4){logger[_0x7b69('0x10')](_0x7b69('0xc'),_0x2c530b,_0x517f53['error'][_0x7b69('0x11')]);return _0x380e7e(_0x517f53[_0x7b69('0x10')][_0x7b69('0x11')]);}logger[_0x7b69('0x10')](_0x7b69('0xc'),_0x2c530b,_0x517f53[_0x7b69('0x10')][_0x7b69('0x11')]);return _0xb17e9f(_0x517f53[_0x7b69('0x10')]['message']);}else{logger[_0x7b69('0xb')](_0x7b69('0xc'),_0x2c530b,_0x7b69('0xd'));_0xb17e9f(_0x517f53[_0x7b69('0x12')][_0x7b69('0x11')]);}})[_0x7b69('0x13')](function(_0x2f3885){logger['error'](_0x7b69('0xc'),_0x2c530b,_0x2f3885);_0x380e7e(_0x2f3885);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 78055ff..9a95572 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 _0x0277=['create','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated','get','/:id','show','/:id/download','download','post'];(function(_0x3a7ab8,_0x35dbf3){var _0x2734fa=function(_0x14b78e){while(--_0x14b78e){_0x3a7ab8['push'](_0x3a7ab8['shift']());}};_0x2734fa(++_0x35dbf3);}(_0x0277,0x10c));var _0x7027=function(_0x2b1047,_0x2e58fd){_0x2b1047=_0x2b1047-0x0;var _0x23bad3=_0x0277[_0x2b1047];return _0x23bad3;};'use strict';var multer=require(_0x7027('0x0'));var util=require(_0x7027('0x1'));var path=require(_0x7027('0x2'));var timeout=require(_0x7027('0x3'));var express=require(_0x7027('0x4'));var router=express[_0x7027('0x5')]();var fs_extra=require(_0x7027('0x6'));var auth=require(_0x7027('0x7'));var interaction=require(_0x7027('0x8'));var config=require(_0x7027('0x9'));var controller=require(_0x7027('0xa'));router['get']('/',auth[_0x7027('0xb')](),controller['index']);router[_0x7027('0xc')](_0x7027('0xd'),auth[_0x7027('0xb')](),controller[_0x7027('0xe')]);router[_0x7027('0xc')](_0x7027('0xf'),auth[_0x7027('0xb')](),controller[_0x7027('0x10')]);router[_0x7027('0x11')]('/',auth[_0x7027('0xb')](),controller[_0x7027('0x12')]);router[_0x7027('0x13')](_0x7027('0xd'),auth['isAuthenticated'](),controller[_0x7027('0x14')]);router[_0x7027('0x15')]('/:id',auth[_0x7027('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x739e=['/:id/download','download','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x739e,0x77));var _0xe739=function(_0x1b2758,_0x11d50b){_0x1b2758=_0x1b2758-0x0;var _0x10811c=_0x739e[_0x1b2758];return _0x10811c;};'use strict';var multer=require(_0xe739('0x0'));var util=require(_0xe739('0x1'));var path=require(_0xe739('0x2'));var timeout=require(_0xe739('0x3'));var express=require(_0xe739('0x4'));var router=express[_0xe739('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xe739('0x6'));var interaction=require(_0xe739('0x7'));var config=require(_0xe739('0x8'));var controller=require('./analyticExtractedReport.controller');router[_0xe739('0x9')]('/',auth['isAuthenticated'](),controller[_0xe739('0xa')]);router[_0xe739('0x9')]('/:id',auth[_0xe739('0xb')](),controller[_0xe739('0xc')]);router[_0xe739('0x9')](_0xe739('0xd'),auth[_0xe739('0xb')](),controller[_0xe739('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xe739('0xf')]);router[_0xe739('0x10')](_0xe739('0x11'),auth[_0xe739('0xb')](),controller[_0xe739('0x12')]);router[_0xe739('0x13')]('/:id',auth[_0xe739('0xb')](),controller[_0xe739('0x14')]);module[_0xe739('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 673265d..58d0026 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 _0x78c5=['BOOLEAN','sequelize','exports','STRING'];(function(_0x2a6f85,_0x9dce9a){var _0x4912e7=function(_0x4c839d){while(--_0x4c839d){_0x2a6f85['push'](_0x2a6f85['shift']());}};_0x4912e7(++_0x9dce9a);}(_0x78c5,0xf5));var _0x578c=function(_0x810a78,_0x1e3706){_0x810a78=_0x810a78-0x0;var _0x24a295=_0x78c5[_0x810a78];return _0x24a295;};'use strict';var Sequelize=require(_0x578c('0x0'));module[_0x578c('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x578c('0x2')]},'function':{'type':Sequelize[_0x578c('0x2')]},'format':{'type':Sequelize[_0x578c('0x2')]},'groupBy':{'type':Sequelize[_0x578c('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x578c('0x2')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x6066=['BOOLEAN','TEXT','STRING'];(function(_0xbec8e6,_0x2841b5){var _0x4aa6f2=function(_0x583a0a){while(--_0x583a0a){_0xbec8e6['push'](_0xbec8e6['shift']());}};_0x4aa6f2(++_0x2841b5);}(_0x6066,0x151));var _0x6606=function(_0x2fe689,_0x5794e5){_0x2fe689=_0x2fe689-0x0;var _0x35ea44=_0x6066[_0x2fe689];return _0x35ea44;};'use strict';var Sequelize=require('sequelize');module['exports']={'field':{'type':Sequelize[_0x6606('0x0')]},'alias':{'type':Sequelize[_0x6606('0x1')]},'function':{'type':Sequelize[_0x6606('0x1')]},'format':{'type':Sequelize[_0x6606('0x1')]},'groupBy':{'type':Sequelize[_0x6606('0x2')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x6606('0x1')]},'custom':{'type':Sequelize[_0x6606('0x2')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 584381c..93a2506 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 _0xf286=['to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','reject','save','destroy','error','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','findAll','then','rows','show','intersection','include','options','find','catch','create','body','bulkCreate','update','params','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox'];(function(_0x27f5f6,_0x5f2eca){var _0x264718=function(_0xe37f55){while(--_0xe37f55){_0x27f5f6['push'](_0x27f5f6['shift']());}};_0x264718(++_0x5f2eca);}(_0xf286,0xe8));var _0x6f28=function(_0x22868f,_0x450f48){_0x22868f=_0x22868f-0x0;var _0x97bc75=_0xf286[_0x22868f];return _0x97bc75;};'use strict';var emlformat=require(_0x6f28('0x0'));var rimraf=require(_0x6f28('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6f28('0x2'));var rp=require(_0x6f28('0x3'));var moment=require('moment');var BPromise=require(_0x6f28('0x4'));var Mustache=require(_0x6f28('0x5'));var util=require(_0x6f28('0x6'));var path=require('path');var sox=require(_0x6f28('0x7'));var csv=require(_0x6f28('0x8'));var ejs=require(_0x6f28('0x9'));var fs=require('fs');var fs_extra=require(_0x6f28('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6f28('0xb'));var deskjs=require(_0x6f28('0xc'));var toCsv=require(_0x6f28('0x8'));var querystring=require(_0x6f28('0xd'));var Papa=require(_0x6f28('0xe'));var Redis=require(_0x6f28('0xf'));var authService=require(_0x6f28('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6f28('0x11'));var hardwareService=require(_0x6f28('0x12'));var logger=require(_0x6f28('0x13'))('api');var utils=require(_0x6f28('0x14'));var config=require(_0x6f28('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6f28('0x16'))['db'];function respondWithStatusCode(_0x5a93e3,_0x1251c3){_0x1251c3=_0x1251c3||0xcc;return function(_0xdc0802){if(_0xdc0802){return _0x5a93e3[_0x6f28('0x17')](_0x1251c3);}return _0x5a93e3[_0x6f28('0x18')](_0x1251c3)[_0x6f28('0x19')]();};}function respondWithResult(_0x4d06cd,_0x36d42a){_0x36d42a=_0x36d42a||0xc8;return function(_0x2f8522){if(_0x2f8522){return _0x4d06cd[_0x6f28('0x18')](_0x36d42a)[_0x6f28('0x1a')](_0x2f8522);}};}function respondWithFilteredResult(_0x1a3d77,_0xaf214b){return function(_0x2da3ae){if(_0x2da3ae){var _0x549e4c=typeof _0xaf214b[_0x6f28('0x1b')]==='undefined'&&typeof _0xaf214b[_0x6f28('0x1c')]===_0x6f28('0x1d');var _0x411c50=_0x2da3ae[_0x6f28('0x1e')];var _0x441c66=_0x549e4c?0x0:_0xaf214b[_0x6f28('0x1b')];var _0x2ffa61=_0x549e4c?_0x2da3ae['count']:_0xaf214b[_0x6f28('0x1b')]+_0xaf214b[_0x6f28('0x1c')];var _0x17c469;if(_0x2ffa61>=_0x411c50){_0x2ffa61=_0x411c50;_0x17c469=0xc8;}else{_0x17c469=0xce;}_0x1a3d77['status'](_0x17c469);return _0x1a3d77['set']('Content-Range',_0x441c66+'-'+_0x2ffa61+'/'+_0x411c50)['json'](_0x2da3ae);}return null;};}function patchUpdates(_0x24580a){return function(_0x1ed863){try{jsonpatch['apply'](_0x1ed863,_0x24580a,!![]);}catch(_0x3f519c){return BPromise[_0x6f28('0x1f')](_0x3f519c);}return _0x1ed863[_0x6f28('0x20')]();};}function saveUpdates(_0x3754a1,_0xdda7c0){return function(_0x295632){if(_0x295632){return _0x295632['update'](_0x3754a1)['then'](function(_0xe20e02){return _0xe20e02;});}return null;};}function removeEntity(_0x38bd24,_0x2bd216){return function(_0x1f0a76){if(_0x1f0a76){return _0x1f0a76[_0x6f28('0x21')]()['then'](function(){_0x38bd24[_0x6f28('0x18')](0xcc)[_0x6f28('0x19')]();});}};}function handleEntityNotFound(_0x5604dc,_0xbdfd34){return function(_0xe9f423){if(!_0xe9f423){_0x5604dc[_0x6f28('0x17')](0x194);}return _0xe9f423;};}function handleError(_0x461b8b,_0x53d512){_0x53d512=_0x53d512||0x1f4;return function(_0x353a0b){logger[_0x6f28('0x22')](_0x353a0b['stack']);if(_0x353a0b['name']){delete _0x353a0b[_0x6f28('0x23')];}_0x461b8b[_0x6f28('0x18')](_0x53d512)[_0x6f28('0x24')](_0x353a0b);};}exports[_0x6f28('0x25')]=function(_0x2bf488,_0x64ad79){var _0x279969={},_0x4d3111={},_0x1db946={'count':0x0,'rows':[]};var _0x35da57=_[_0x6f28('0x26')](db[_0x6f28('0x27')][_0x6f28('0x28')],function(_0x45402c){return{'name':_0x45402c[_0x6f28('0x29')],'type':_0x45402c[_0x6f28('0x2a')][_0x6f28('0x2b')]};});_0x4d3111[_0x6f28('0x2c')]=_[_0x6f28('0x26')](_0x35da57,_0x6f28('0x23'));_0x4d3111[_0x6f28('0x2d')]=_[_0x6f28('0x2e')](_0x2bf488[_0x6f28('0x2d')]);_0x4d3111[_0x6f28('0x2f')]=_['intersection'](_0x4d3111[_0x6f28('0x2c')],_0x4d3111[_0x6f28('0x2d')]);_0x279969[_0x6f28('0x30')]=_['intersection'](_0x4d3111[_0x6f28('0x2c')],qs[_0x6f28('0x31')](_0x2bf488[_0x6f28('0x2d')][_0x6f28('0x31')]));_0x279969[_0x6f28('0x30')]=_0x279969['attributes'][_0x6f28('0x32')]?_0x279969[_0x6f28('0x30')]:_0x4d3111[_0x6f28('0x2c')];if(!_0x2bf488['query']['hasOwnProperty'](_0x6f28('0x33'))){_0x279969[_0x6f28('0x1c')]=qs[_0x6f28('0x1c')](_0x2bf488[_0x6f28('0x2d')][_0x6f28('0x1c')]);_0x279969[_0x6f28('0x1b')]=qs[_0x6f28('0x1b')](_0x2bf488[_0x6f28('0x2d')][_0x6f28('0x1b')]);}_0x279969[_0x6f28('0x34')]=qs[_0x6f28('0x35')](_0x2bf488[_0x6f28('0x2d')][_0x6f28('0x35')]);_0x279969[_0x6f28('0x36')]=qs[_0x6f28('0x2f')](_['pick'](_0x2bf488['query'],_0x4d3111['filters']),_0x35da57);if(_0x2bf488['query'][_0x6f28('0x37')]){_0x279969[_0x6f28('0x36')]=_[_0x6f28('0x38')](_0x279969[_0x6f28('0x36')],{'$or':_[_0x6f28('0x26')](_0x35da57,function(_0x3070ae){if(_0x3070ae[_0x6f28('0x2a')]!==_0x6f28('0x39')){var _0x4775d7={};_0x4775d7[_0x3070ae[_0x6f28('0x23')]]={'$like':'%'+_0x2bf488[_0x6f28('0x2d')][_0x6f28('0x37')]+'%'};return _0x4775d7;}})});}_0x279969=_[_0x6f28('0x38')]({},_0x279969,_0x2bf488['options']);var _0x5a84f5={'where':_0x279969['where']};return db[_0x6f28('0x27')]['count'](_0x5a84f5)['then'](function(_0xad259d){_0x1db946[_0x6f28('0x1e')]=_0xad259d;if(_0x2bf488[_0x6f28('0x2d')][_0x6f28('0x3a')]){_0x279969['include']=[{'all':!![]}];}return db[_0x6f28('0x27')][_0x6f28('0x3b')](_0x279969);})[_0x6f28('0x3c')](function(_0x4fc547){_0x1db946[_0x6f28('0x3d')]=_0x4fc547;return _0x1db946;})[_0x6f28('0x3c')](respondWithFilteredResult(_0x64ad79,_0x279969))['catch'](handleError(_0x64ad79,null));};exports[_0x6f28('0x3e')]=function(_0x4aa381,_0x4b26fa){var _0x12e614={'raw':![],'where':{'id':_0x4aa381['params']['id']}},_0x1aba46={};_0x1aba46[_0x6f28('0x2c')]=_['keys'](db['AnalyticFieldReport']['rawAttributes']);_0x1aba46[_0x6f28('0x2d')]=_[_0x6f28('0x2e')](_0x4aa381[_0x6f28('0x2d')]);_0x1aba46[_0x6f28('0x2f')]=_[_0x6f28('0x3f')](_0x1aba46[_0x6f28('0x2c')],_0x1aba46['query']);_0x12e614['attributes']=_[_0x6f28('0x3f')](_0x1aba46[_0x6f28('0x2c')],qs[_0x6f28('0x31')](_0x4aa381[_0x6f28('0x2d')][_0x6f28('0x31')]));_0x12e614['attributes']=_0x12e614[_0x6f28('0x30')][_0x6f28('0x32')]?_0x12e614[_0x6f28('0x30')]:_0x1aba46[_0x6f28('0x2c')];if(_0x4aa381['query'][_0x6f28('0x3a')]){_0x12e614[_0x6f28('0x40')]=[{'all':!![]}];}_0x12e614=_[_0x6f28('0x38')]({},_0x12e614,_0x4aa381[_0x6f28('0x41')]);return db[_0x6f28('0x27')][_0x6f28('0x42')](_0x12e614)[_0x6f28('0x3c')](handleEntityNotFound(_0x4b26fa,null))['then'](respondWithResult(_0x4b26fa,null))[_0x6f28('0x43')](handleError(_0x4b26fa,null));};exports[_0x6f28('0x44')]=function(_0x49e54e,_0x3994c1){return db['AnalyticFieldReport'][_0x6f28('0x44')](_0x49e54e[_0x6f28('0x45')],{})[_0x6f28('0x3c')](respondWithResult(_0x3994c1,0xc9))['catch'](handleError(_0x3994c1,null));};exports[_0x6f28('0x46')]=function(_0x59276c,_0x3bffaf){return db[_0x6f28('0x27')][_0x6f28('0x46')](_0x59276c[_0x6f28('0x45')],{'raw':![],'individualHooks':!![]})[_0x6f28('0x3c')](respondWithResult(_0x3bffaf,0xc9))[_0x6f28('0x43')](handleError(_0x3bffaf,null));};exports[_0x6f28('0x47')]=function(_0x42087f,_0x589437){if(_0x42087f[_0x6f28('0x45')]['id']){delete _0x42087f['body']['id'];}return db['AnalyticFieldReport'][_0x6f28('0x42')]({'where':{'id':_0x42087f[_0x6f28('0x48')]['id']}})[_0x6f28('0x3c')](handleEntityNotFound(_0x589437,null))[_0x6f28('0x3c')](saveUpdates(_0x42087f[_0x6f28('0x45')],null))[_0x6f28('0x3c')](respondWithResult(_0x589437,null))[_0x6f28('0x43')](handleError(_0x589437,null));};exports['destroy']=function(_0x400f94,_0x336401){return db[_0x6f28('0x27')][_0x6f28('0x42')]({'where':{'id':_0x400f94[_0x6f28('0x48')]['id']}})[_0x6f28('0x3c')](handleEntityNotFound(_0x336401,null))[_0x6f28('0x3c')](removeEntity(_0x336401,null))[_0x6f28('0x43')](handleError(_0x336401,null));};exports['bulkDestroy']=function(_0x2c0fec,_0xd37015){return db[_0x6f28('0x27')][_0x6f28('0x21')]({'where':{'id':_0x2c0fec[_0x6f28('0x2d')][_0x6f28('0x49')]||[]},'raw':![],'individualHooks':!![]})[_0x6f28('0x3c')](respondWithResult(_0xd37015,0xcc))[_0x6f28('0x43')](handleError(_0xd37015,null));};exports[_0x6f28('0x4a')]=function(_0x572f9e,_0x5c8d14,_0x2b1970){return db[_0x6f28('0x4b')][_0x6f28('0x4c')]({'where':{'id':_0x572f9e[_0x6f28('0x48')]['id']}})[_0x6f28('0x3c')](handleEntityNotFound(_0x5c8d14,null))[_0x6f28('0x3c')](function(_0x3f022f){if(_0x3f022f){return db[_0x6f28('0x4d')][_0x6f28('0x4e')](function(_0x41bbf9){return db[_0x6f28('0x27')][_0x6f28('0x21')]({'where':{'CustomReportId':_0x572f9e[_0x6f28('0x48')]['id']},'transaction':_0x41bbf9})[_0x6f28('0x3c')](function(_0x4be4ed){var _0x599e5e=_[_0x6f28('0x26')](_0x572f9e[_0x6f28('0x45')],function(_0xbf8f2d){delete _0xbf8f2d['id'];_0xbf8f2d[_0x6f28('0x4f')]=_0x572f9e[_0x6f28('0x48')]['id'];return _0xbf8f2d;});return db[_0x6f28('0x27')][_0x6f28('0x46')](_0x599e5e,{'transaction':_0x41bbf9});});})[_0x6f28('0x3c')](function(){return db['AnalyticFieldReport'][_0x6f28('0x3b')]({'where':{'CustomReportId':_0x572f9e[_0x6f28('0x48')]['id']}});});}})['then'](respondWithResult(_0x5c8d14,null))['catch'](handleError(_0x5c8d14,null));};
\ No newline at end of file
+var _0x7de5=['include','findAll','rows','catch','show','find','create','body','bulkCreate','params','bulkDestroy','ids','addFields','findOne','transaction','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','AnalyticFieldReport','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','includeAll'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x7de5,0xad));var _0x57de=function(_0xdc43a4,_0x36fdd0){_0xdc43a4=_0xdc43a4-0x0;var _0x4cc4d3=_0x7de5[_0xdc43a4];return _0x4cc4d3;};'use strict';var emlformat=require(_0x57de('0x0'));var rimraf=require(_0x57de('0x1'));var zipdir=require(_0x57de('0x2'));var jsonpatch=require(_0x57de('0x3'));var rp=require(_0x57de('0x4'));var moment=require(_0x57de('0x5'));var BPromise=require(_0x57de('0x6'));var Mustache=require('mustache');var util=require(_0x57de('0x7'));var path=require(_0x57de('0x8'));var sox=require(_0x57de('0x9'));var csv=require('to-csv');var ejs=require(_0x57de('0xa'));var fs=require('fs');var fs_extra=require(_0x57de('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x57de('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x57de('0xd'));var querystring=require(_0x57de('0xe'));var Papa=require(_0x57de('0xf'));var Redis=require(_0x57de('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x57de('0x11'));var hardwareService=require(_0x57de('0x12'));var logger=require(_0x57de('0x13'))(_0x57de('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x57de('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x118ec2,_0x3741f0){_0x3741f0=_0x3741f0||0xcc;return function(_0x4dca24){if(_0x4dca24){return _0x118ec2[_0x57de('0x16')](_0x3741f0);}return _0x118ec2[_0x57de('0x17')](_0x3741f0)[_0x57de('0x18')]();};}function respondWithResult(_0x171d5c,_0x1f756b){_0x1f756b=_0x1f756b||0xc8;return function(_0x289105){if(_0x289105){return _0x171d5c['status'](_0x1f756b)[_0x57de('0x19')](_0x289105);}};}function respondWithFilteredResult(_0xc0e003,_0x4a69dc){return function(_0x5d5e5a){if(_0x5d5e5a){var _0x794388=typeof _0x4a69dc[_0x57de('0x1a')]===_0x57de('0x1b')&&typeof _0x4a69dc[_0x57de('0x1c')]==='undefined';var _0x2b6f4e=_0x5d5e5a[_0x57de('0x1d')];var _0x4d5917=_0x794388?0x0:_0x4a69dc['offset'];var _0x45f4cf=_0x794388?_0x5d5e5a['count']:_0x4a69dc['offset']+_0x4a69dc['limit'];var _0x2ca9c2;if(_0x45f4cf>=_0x2b6f4e){_0x45f4cf=_0x2b6f4e;_0x2ca9c2=0xc8;}else{_0x2ca9c2=0xce;}_0xc0e003['status'](_0x2ca9c2);return _0xc0e003[_0x57de('0x1e')](_0x57de('0x1f'),_0x4d5917+'-'+_0x45f4cf+'/'+_0x2b6f4e)[_0x57de('0x19')](_0x5d5e5a);}return null;};}function patchUpdates(_0xab7df8){return function(_0x2f786a){try{jsonpatch[_0x57de('0x20')](_0x2f786a,_0xab7df8,!![]);}catch(_0x1d693b){return BPromise['reject'](_0x1d693b);}return _0x2f786a[_0x57de('0x21')]();};}function saveUpdates(_0x2b1333,_0x1a0c30){return function(_0x398588){if(_0x398588){return _0x398588[_0x57de('0x22')](_0x2b1333)[_0x57de('0x23')](function(_0x465ffb){return _0x465ffb;});}return null;};}function removeEntity(_0x264b4d,_0x4fc251){return function(_0x237d2f){if(_0x237d2f){return _0x237d2f[_0x57de('0x24')]()[_0x57de('0x23')](function(){_0x264b4d[_0x57de('0x17')](0xcc)[_0x57de('0x18')]();});}};}function handleEntityNotFound(_0x494e83,_0x26eb4a){return function(_0x121b9e){if(!_0x121b9e){_0x494e83[_0x57de('0x16')](0x194);}return _0x121b9e;};}function handleError(_0x18063f,_0x576025){_0x576025=_0x576025||0x1f4;return function(_0x18abc4){logger[_0x57de('0x25')](_0x18abc4[_0x57de('0x26')]);if(_0x18abc4['name']){delete _0x18abc4[_0x57de('0x27')];}_0x18063f[_0x57de('0x17')](_0x576025)['send'](_0x18abc4);};}exports[_0x57de('0x28')]=function(_0x2e4ff3,_0x2bf870){var _0x3e83ac={},_0x385842={},_0x2489c1={'count':0x0,'rows':[]};var _0x559c7b=_[_0x57de('0x29')](db[_0x57de('0x2a')][_0x57de('0x2b')],function(_0x215e3d){return{'name':_0x215e3d[_0x57de('0x2c')],'type':_0x215e3d['type'][_0x57de('0x2d')]};});_0x385842[_0x57de('0x2e')]=_[_0x57de('0x29')](_0x559c7b,_0x57de('0x27'));_0x385842[_0x57de('0x2f')]=_[_0x57de('0x30')](_0x2e4ff3[_0x57de('0x2f')]);_0x385842['filters']=_[_0x57de('0x31')](_0x385842[_0x57de('0x2e')],_0x385842[_0x57de('0x2f')]);_0x3e83ac[_0x57de('0x32')]=_['intersection'](_0x385842[_0x57de('0x2e')],qs['fields'](_0x2e4ff3[_0x57de('0x2f')][_0x57de('0x33')]));_0x3e83ac[_0x57de('0x32')]=_0x3e83ac[_0x57de('0x32')][_0x57de('0x34')]?_0x3e83ac[_0x57de('0x32')]:_0x385842[_0x57de('0x2e')];if(!_0x2e4ff3[_0x57de('0x2f')][_0x57de('0x35')](_0x57de('0x36'))){_0x3e83ac[_0x57de('0x1c')]=qs[_0x57de('0x1c')](_0x2e4ff3[_0x57de('0x2f')][_0x57de('0x1c')]);_0x3e83ac[_0x57de('0x1a')]=qs[_0x57de('0x1a')](_0x2e4ff3[_0x57de('0x2f')][_0x57de('0x1a')]);}_0x3e83ac[_0x57de('0x37')]=qs[_0x57de('0x38')](_0x2e4ff3[_0x57de('0x2f')][_0x57de('0x38')]);_0x3e83ac[_0x57de('0x39')]=qs[_0x57de('0x3a')](_['pick'](_0x2e4ff3['query'],_0x385842[_0x57de('0x3a')]),_0x559c7b);if(_0x2e4ff3['query']['filter']){_0x3e83ac[_0x57de('0x39')]=_[_0x57de('0x3b')](_0x3e83ac['where'],{'$or':_[_0x57de('0x29')](_0x559c7b,function(_0x4cd370){if(_0x4cd370['type']!==_0x57de('0x3c')){var _0x4ee99e={};_0x4ee99e[_0x4cd370[_0x57de('0x27')]]={'$like':'%'+_0x2e4ff3['query'][_0x57de('0x3d')]+'%'};return _0x4ee99e;}})});}_0x3e83ac=_[_0x57de('0x3b')]({},_0x3e83ac,_0x2e4ff3[_0x57de('0x3e')]);var _0x4178b5={'where':_0x3e83ac[_0x57de('0x39')]};return db[_0x57de('0x2a')][_0x57de('0x1d')](_0x4178b5)['then'](function(_0x389436){_0x2489c1['count']=_0x389436;if(_0x2e4ff3[_0x57de('0x2f')][_0x57de('0x3f')]){_0x3e83ac[_0x57de('0x40')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x57de('0x41')](_0x3e83ac);})[_0x57de('0x23')](function(_0x3e9851){_0x2489c1[_0x57de('0x42')]=_0x3e9851;return _0x2489c1;})[_0x57de('0x23')](respondWithFilteredResult(_0x2bf870,_0x3e83ac))[_0x57de('0x43')](handleError(_0x2bf870,null));};exports[_0x57de('0x44')]=function(_0x406c47,_0x222f17){var _0x1292d0={'raw':![],'where':{'id':_0x406c47['params']['id']}},_0x1c3eb8={};_0x1c3eb8[_0x57de('0x2e')]=_[_0x57de('0x30')](db[_0x57de('0x2a')][_0x57de('0x2b')]);_0x1c3eb8[_0x57de('0x2f')]=_['keys'](_0x406c47[_0x57de('0x2f')]);_0x1c3eb8[_0x57de('0x3a')]=_[_0x57de('0x31')](_0x1c3eb8[_0x57de('0x2e')],_0x1c3eb8[_0x57de('0x2f')]);_0x1292d0[_0x57de('0x32')]=_[_0x57de('0x31')](_0x1c3eb8[_0x57de('0x2e')],qs[_0x57de('0x33')](_0x406c47['query'][_0x57de('0x33')]));_0x1292d0[_0x57de('0x32')]=_0x1292d0[_0x57de('0x32')][_0x57de('0x34')]?_0x1292d0['attributes']:_0x1c3eb8[_0x57de('0x2e')];if(_0x406c47['query']['includeAll']){_0x1292d0[_0x57de('0x40')]=[{'all':!![]}];}_0x1292d0=_[_0x57de('0x3b')]({},_0x1292d0,_0x406c47['options']);return db['AnalyticFieldReport'][_0x57de('0x45')](_0x1292d0)['then'](handleEntityNotFound(_0x222f17,null))['then'](respondWithResult(_0x222f17,null))[_0x57de('0x43')](handleError(_0x222f17,null));};exports[_0x57de('0x46')]=function(_0x10cab6,_0x367242){return db[_0x57de('0x2a')][_0x57de('0x46')](_0x10cab6[_0x57de('0x47')],{})[_0x57de('0x23')](respondWithResult(_0x367242,0xc9))[_0x57de('0x43')](handleError(_0x367242,null));};exports[_0x57de('0x48')]=function(_0x20bf5a,_0x2d5545){return db[_0x57de('0x2a')][_0x57de('0x48')](_0x20bf5a['body'],{'raw':![],'individualHooks':!![]})[_0x57de('0x23')](respondWithResult(_0x2d5545,0xc9))['catch'](handleError(_0x2d5545,null));};exports[_0x57de('0x22')]=function(_0x51c1d7,_0x2df50e){if(_0x51c1d7[_0x57de('0x47')]['id']){delete _0x51c1d7[_0x57de('0x47')]['id'];}return db[_0x57de('0x2a')][_0x57de('0x45')]({'where':{'id':_0x51c1d7[_0x57de('0x49')]['id']}})[_0x57de('0x23')](handleEntityNotFound(_0x2df50e,null))[_0x57de('0x23')](saveUpdates(_0x51c1d7[_0x57de('0x47')],null))['then'](respondWithResult(_0x2df50e,null))['catch'](handleError(_0x2df50e,null));};exports[_0x57de('0x24')]=function(_0x22c516,_0x1b1cab){return db['AnalyticFieldReport']['find']({'where':{'id':_0x22c516['params']['id']}})[_0x57de('0x23')](handleEntityNotFound(_0x1b1cab,null))['then'](removeEntity(_0x1b1cab,null))[_0x57de('0x43')](handleError(_0x1b1cab,null));};exports[_0x57de('0x4a')]=function(_0x27eb88,_0x1ef5ec){return db['AnalyticFieldReport'][_0x57de('0x24')]({'where':{'id':_0x27eb88[_0x57de('0x2f')][_0x57de('0x4b')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x1ef5ec,0xcc))[_0x57de('0x43')](handleError(_0x1ef5ec,null));};exports[_0x57de('0x4c')]=function(_0x2fda8d,_0x51f8ff,_0x48474f){return db['AnalyticCustomReport'][_0x57de('0x4d')]({'where':{'id':_0x2fda8d['params']['id']}})['then'](handleEntityNotFound(_0x51f8ff,null))[_0x57de('0x23')](function(_0x260505){if(_0x260505){return db['sequelize'][_0x57de('0x4e')](function(_0x29590a){return db[_0x57de('0x2a')][_0x57de('0x24')]({'where':{'CustomReportId':_0x2fda8d['params']['id']},'transaction':_0x29590a})[_0x57de('0x23')](function(_0x510da2){var _0x23e8f7=_['map'](_0x2fda8d[_0x57de('0x47')],function(_0x425477){delete _0x425477['id'];_0x425477['CustomReportId']=_0x2fda8d[_0x57de('0x49')]['id'];return _0x425477;});return db[_0x57de('0x2a')][_0x57de('0x48')](_0x23e8f7,{'transaction':_0x29590a});});})['then'](function(){return db['AnalyticFieldReport'][_0x57de('0x41')]({'where':{'CustomReportId':_0x2fda8d[_0x57de('0x49')]['id']}});});}})['then'](respondWithResult(_0x51f8ff,null))[_0x57de('0x43')](handleError(_0x51f8ff,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index fe8f798..23a846d 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 _0x6b56=['./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x2d8d69,_0x8e47ff){var _0x39ae22=function(_0xd7935e){while(--_0xd7935e){_0x2d8d69['push'](_0x2d8d69['shift']());}};_0x39ae22(++_0x8e47ff);}(_0x6b56,0xb9));var _0x66b5=function(_0x319a37,_0x2890a9){_0x319a37=_0x319a37-0x0;var _0x54cffb=_0x6b56[_0x319a37];return _0x54cffb;};'use strict';var _=require('lodash');var util=require(_0x66b5('0x0'));var logger=require(_0x66b5('0x1'))(_0x66b5('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x66b5('0x3'));var fs=require('fs');var path=require(_0x66b5('0x4'));var rimraf=require(_0x66b5('0x5'));var config=require(_0x66b5('0x6'));var attributes=require(_0x66b5('0x7'));module[_0x66b5('0x8')]=function(_0xbd7b3,_0x6d3a1d){return _0xbd7b3[_0x66b5('0x9')](_0x66b5('0xa'),attributes,{'tableName':_0x66b5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6363=['analytics_report_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x2715c2,_0x172121){var _0x4bbedf=function(_0x2a6aea){while(--_0x2a6aea){_0x2715c2['push'](_0x2715c2['shift']());}};_0x4bbedf(++_0x172121);}(_0x6363,0x160));var _0x3636=function(_0xf8c256,_0x3fb31e){_0xf8c256=_0xf8c256-0x0;var _0xd881e0=_0x6363[_0xf8c256];return _0xd881e0;};'use strict';var _=require(_0x3636('0x0'));var util=require(_0x3636('0x1'));var logger=require(_0x3636('0x2'))(_0x3636('0x3'));var moment=require(_0x3636('0x4'));var BPromise=require(_0x3636('0x5'));var rp=require(_0x3636('0x6'));var fs=require('fs');var path=require(_0x3636('0x7'));var rimraf=require(_0x3636('0x8'));var config=require(_0x3636('0x9'));var attributes=require('./analyticFieldReport.attributes');module[_0x3636('0xa')]=function(_0x2b36cb,_0x51565a){return _0x2b36cb[_0x3636('0xb')]('AnalyticFieldReport',attributes,{'tableName':_0x3636('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index 40ba3cd..26599fc 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 _0x6838=['debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','AnalyticFieldReport,\x20%s,\x20%s'];(function(_0x1f5094,_0x4848d5){var _0xc171c3=function(_0x555951){while(--_0x555951){_0x1f5094['push'](_0x1f5094['shift']());}};_0xc171c3(++_0x4848d5);}(_0x6838,0x16d));var _0x8683=function(_0x4d1ce8,_0x1a778e){_0x4d1ce8=_0x4d1ce8-0x0;var _0x129384=_0x6838[_0x4d1ce8];return _0x129384;};'use strict';var _=require(_0x8683('0x0'));var util=require('util');var moment=require(_0x8683('0x1'));var BPromise=require(_0x8683('0x2'));var rs=require(_0x8683('0x3'));var fs=require('fs');var Redis=require(_0x8683('0x4'));var db=require(_0x8683('0x5'))['db'];var utils=require(_0x8683('0x6'));var logger=require('../../config/logger')(_0x8683('0x7'));var config=require('../../config/environment');var jayson=require(_0x8683('0x8'));var client=jayson['client'][_0x8683('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x38b184,_0x1c8daf,_0x1ef201){return new BPromise(function(_0x54187a,_0x399ad9){return client[_0x8683('0xa')](_0x38b184,_0x1ef201)[_0x8683('0xb')](function(_0x567be7){logger['info'](_0x8683('0xc'),_0x1c8daf,'request\x20sent');logger[_0x8683('0xd')](_0x8683('0xe'),_0x1c8daf,_0x8683('0xf'),JSON[_0x8683('0x10')](_0x567be7));if(_0x567be7[_0x8683('0x11')]){if(_0x567be7[_0x8683('0x11')]['code']===0x1f4){logger['error'](_0x8683('0xc'),_0x1c8daf,_0x567be7['error'][_0x8683('0x12')]);return _0x399ad9(_0x567be7[_0x8683('0x11')][_0x8683('0x12')]);}logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x1c8daf,_0x567be7[_0x8683('0x11')][_0x8683('0x12')]);return _0x54187a(_0x567be7[_0x8683('0x11')]['message']);}else{logger['info'](_0x8683('0xc'),_0x1c8daf,_0x8683('0xf'));_0x54187a(_0x567be7[_0x8683('0x13')]['message']);}})[_0x8683('0x14')](function(_0x16cc97){logger[_0x8683('0x11')](_0x8683('0xc'),_0x1c8daf,_0x16cc97);_0x399ad9(_0x16cc97);});});}
\ No newline at end of file
+var _0x1f98=['request','then','info','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticFieldReport,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3bd810,_0x2b21e4){var _0x1bbf13=function(_0x1a0bdc){while(--_0x1a0bdc){_0x3bd810['push'](_0x3bd810['shift']());}};_0x1bbf13(++_0x2b21e4);}(_0x1f98,0x66));var _0x81f9=function(_0x107dfb,_0x53c508){_0x107dfb=_0x107dfb-0x0;var _0x48dde9=_0x1f98[_0x107dfb];return _0x48dde9;};'use strict';var _=require(_0x81f9('0x0'));var util=require(_0x81f9('0x1'));var moment=require(_0x81f9('0x2'));var BPromise=require(_0x81f9('0x3'));var rs=require(_0x81f9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x81f9('0x5'))['db'];var utils=require(_0x81f9('0x6'));var logger=require(_0x81f9('0x7'))(_0x81f9('0x8'));var config=require(_0x81f9('0x9'));var jayson=require(_0x81f9('0xa'));var client=jayson[_0x81f9('0xb')][_0x81f9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5cfb5c,_0x3f89bf,_0x5bf856){return new BPromise(function(_0x141c3f,_0x558cf4){return client[_0x81f9('0xd')](_0x5cfb5c,_0x5bf856)[_0x81f9('0xe')](function(_0x58676e){logger[_0x81f9('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3f89bf,_0x81f9('0x10'));logger['debug'](_0x81f9('0x11'),_0x3f89bf,_0x81f9('0x10'),JSON[_0x81f9('0x12')](_0x58676e));if(_0x58676e[_0x81f9('0x13')]){if(_0x58676e[_0x81f9('0x13')]['code']===0x1f4){logger[_0x81f9('0x13')](_0x81f9('0x14'),_0x3f89bf,_0x58676e[_0x81f9('0x13')][_0x81f9('0x15')]);return _0x558cf4(_0x58676e[_0x81f9('0x13')][_0x81f9('0x15')]);}logger['error'](_0x81f9('0x14'),_0x3f89bf,_0x58676e['error']['message']);return _0x141c3f(_0x58676e[_0x81f9('0x13')][_0x81f9('0x15')]);}else{logger['info'](_0x81f9('0x14'),_0x3f89bf,_0x81f9('0x10'));_0x141c3f(_0x58676e['result'][_0x81f9('0x15')]);}})[_0x81f9('0x16')](function(_0x354148){logger['error'](_0x81f9('0x14'),_0x3f89bf,_0x354148);_0x558cf4(_0x354148);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 15c7df8..584c185 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(_0x5d9ec4,_0x4c9583){var _0x146b11=function(_0x3c94f4){while(--_0x3c94f4){_0x5d9ec4['push'](_0x5d9ec4['shift']());}};_0x146b11(++_0x4c9583);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'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(_0x16c601,_0xe9f35c){var _0x49388f=function(_0x3f67fc){while(--_0x3f67fc){_0x16c601['push'](_0x16c601['shift']());}};_0x49388f(++_0xe9f35c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'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 f542d2a..e0561b2 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 _0x1152=['TEXT','sequelize','exports','STRING','name'];(function(_0x1c7137,_0x4c7c26){var _0xeb4432=function(_0x26d850){while(--_0x26d850){_0x1c7137['push'](_0x1c7137['shift']());}};_0xeb4432(++_0x4c7c26);}(_0x1152,0x182));var _0x2115=function(_0x4772e0,_0x1072a2){_0x4772e0=_0x4772e0-0x0;var _0x8797f0=_0x1152[_0x4772e0];return _0x8797f0;};'use strict';var Sequelize=require(_0x2115('0x0'));module[_0x2115('0x1')]={'name':{'type':Sequelize[_0x2115('0x2')],'allowNull':![],'unique':_0x2115('0x3')},'table':{'type':Sequelize[_0x2115('0x2')]},'metric':{'type':Sequelize[_0x2115('0x4')]},'description':{'type':Sequelize[_0x2115('0x2')]}};
\ No newline at end of file
+var _0xd84c=['STRING','name','TEXT','sequelize','exports'];(function(_0x3454ba,_0x5dd876){var _0x16bf4f=function(_0x42e90c){while(--_0x42e90c){_0x3454ba['push'](_0x3454ba['shift']());}};_0x16bf4f(++_0x5dd876);}(_0xd84c,0x102));var _0xcd84=function(_0x5eeec4,_0x33a6f5){_0x5eeec4=_0x5eeec4-0x0;var _0x531b80=_0xd84c[_0x5eeec4];return _0x531b80;};'use strict';var Sequelize=require(_0xcd84('0x0'));module[_0xcd84('0x1')]={'name':{'type':Sequelize[_0xcd84('0x2')],'allowNull':![],'unique':_0xcd84('0x3')},'table':{'type':Sequelize[_0xcd84('0x2')]},'metric':{'type':Sequelize[_0xcd84('0x4')]},'description':{'type':Sequelize[_0xcd84('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index ed7035c..9363c93 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 _0x4b84=['status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','sendStatus','stack','name','map','AnalyticMetric','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','mustache','util','path','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x5a4a1f,_0x3f90b6){var _0x43db26=function(_0x2824f5){while(--_0x2824f5){_0x5a4a1f['push'](_0x5a4a1f['shift']());}};_0x43db26(++_0x3f90b6);}(_0x4b84,0x1cc));var _0x44b8=function(_0x1a0ef3,_0x535bbf){_0x1a0ef3=_0x1a0ef3-0x0;var _0x2b86da=_0x4b84[_0x1a0ef3];return _0x2b86da;};'use strict';var emlformat=require(_0x44b8('0x0'));var rimraf=require(_0x44b8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x44b8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x44b8('0x3'));var util=require(_0x44b8('0x4'));var path=require(_0x44b8('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x44b8('0x6'));var _=require('lodash');var squel=require(_0x44b8('0x7'));var crypto=require('crypto');var jsforce=require(_0x44b8('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x44b8('0x9'));var Papa=require(_0x44b8('0xa'));var Redis=require(_0x44b8('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x44b8('0xc'));var as=require(_0x44b8('0xd'));var hardwareService=require(_0x44b8('0xe'));var logger=require(_0x44b8('0xf'))(_0x44b8('0x10'));var utils=require(_0x44b8('0x11'));var config=require(_0x44b8('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x44b8('0x13'))['db'];function respondWithStatusCode(_0x4301a6,_0x4bcc43){_0x4bcc43=_0x4bcc43||0xcc;return function(_0x194230){if(_0x194230){return _0x4301a6['sendStatus'](_0x4bcc43);}return _0x4301a6[_0x44b8('0x14')](_0x4bcc43)[_0x44b8('0x15')]();};}function respondWithResult(_0x4df670,_0x63e8f6){_0x63e8f6=_0x63e8f6||0xc8;return function(_0x4be54c){if(_0x4be54c){return _0x4df670['status'](_0x63e8f6)[_0x44b8('0x16')](_0x4be54c);}};}function respondWithFilteredResult(_0x2af0ad,_0x1722da){return function(_0x41ab46){if(_0x41ab46){var _0x5e52f2=typeof _0x1722da['offset']==='undefined'&&typeof _0x1722da[_0x44b8('0x17')]==='undefined';var _0x28ef36=_0x41ab46[_0x44b8('0x18')];var _0x55e258=_0x5e52f2?0x0:_0x1722da[_0x44b8('0x19')];var _0xe3de8f=_0x5e52f2?_0x41ab46['count']:_0x1722da[_0x44b8('0x19')]+_0x1722da[_0x44b8('0x17')];var _0x4b600f;if(_0xe3de8f>=_0x28ef36){_0xe3de8f=_0x28ef36;_0x4b600f=0xc8;}else{_0x4b600f=0xce;}_0x2af0ad[_0x44b8('0x14')](_0x4b600f);return _0x2af0ad[_0x44b8('0x1a')](_0x44b8('0x1b'),_0x55e258+'-'+_0xe3de8f+'/'+_0x28ef36)[_0x44b8('0x16')](_0x41ab46);}return null;};}function patchUpdates(_0x102ef9){return function(_0x369c09){try{jsonpatch[_0x44b8('0x1c')](_0x369c09,_0x102ef9,!![]);}catch(_0x9b0536){return BPromise[_0x44b8('0x1d')](_0x9b0536);}return _0x369c09[_0x44b8('0x1e')]();};}function saveUpdates(_0x1d642b,_0x14996c){return function(_0x48327e){if(_0x48327e){return _0x48327e[_0x44b8('0x1f')](_0x1d642b)[_0x44b8('0x20')](function(_0x416b34){return _0x416b34;});}return null;};}function removeEntity(_0x1418db,_0x305a5c){return function(_0x51a34a){if(_0x51a34a){return _0x51a34a[_0x44b8('0x21')]()['then'](function(){var _0x41a922=_0x51a34a[_0x44b8('0x22')]({'plain':!![]});var _0x25a0c1=_0x44b8('0x23');return db[_0x44b8('0x24')]['destroy']({'where':{'type':_0x25a0c1,'resourceId':_0x41a922['id']}})[_0x44b8('0x20')](function(){return _0x51a34a;});})['then'](function(){_0x1418db[_0x44b8('0x14')](0xcc)[_0x44b8('0x15')]();});}};}function handleEntityNotFound(_0x549a26,_0x17ac44){return function(_0x470f49){if(!_0x470f49){_0x549a26[_0x44b8('0x25')](0x194);}return _0x470f49;};}function handleError(_0x59c1bf,_0xb22107){_0xb22107=_0xb22107||0x1f4;return function(_0x242342){logger['error'](_0x242342[_0x44b8('0x26')]);if(_0x242342['name']){delete _0x242342[_0x44b8('0x27')];}_0x59c1bf['status'](_0xb22107)['send'](_0x242342);};}exports['index']=function(_0x387293,_0x29b18d){var _0x44ce5a={},_0x1bd1be={},_0x38cd17={'count':0x0,'rows':[]};var _0xc3f667=_[_0x44b8('0x28')](db[_0x44b8('0x29')][_0x44b8('0x2a')],function(_0x28f918){return{'name':_0x28f918[_0x44b8('0x2b')],'type':_0x28f918[_0x44b8('0x2c')][_0x44b8('0x2d')]};});_0x1bd1be['model']=_[_0x44b8('0x28')](_0xc3f667,'name');_0x1bd1be[_0x44b8('0x2e')]=_[_0x44b8('0x2f')](_0x387293[_0x44b8('0x2e')]);_0x1bd1be[_0x44b8('0x30')]=_[_0x44b8('0x31')](_0x1bd1be['model'],_0x1bd1be[_0x44b8('0x2e')]);_0x44ce5a[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x1bd1be[_0x44b8('0x33')],qs[_0x44b8('0x34')](_0x387293['query'][_0x44b8('0x34')]));_0x44ce5a[_0x44b8('0x32')]=_0x44ce5a[_0x44b8('0x32')][_0x44b8('0x35')]?_0x44ce5a[_0x44b8('0x32')]:_0x1bd1be[_0x44b8('0x33')];if(!_0x387293[_0x44b8('0x2e')][_0x44b8('0x36')](_0x44b8('0x37'))){_0x44ce5a[_0x44b8('0x17')]=qs[_0x44b8('0x17')](_0x387293[_0x44b8('0x2e')][_0x44b8('0x17')]);_0x44ce5a[_0x44b8('0x19')]=qs[_0x44b8('0x19')](_0x387293[_0x44b8('0x2e')][_0x44b8('0x19')]);}_0x44ce5a[_0x44b8('0x38')]=qs[_0x44b8('0x39')](_0x387293[_0x44b8('0x2e')][_0x44b8('0x39')]);_0x44ce5a[_0x44b8('0x3a')]=qs['filters'](_[_0x44b8('0x3b')](_0x387293[_0x44b8('0x2e')],_0x1bd1be['filters']),_0xc3f667);if(_0x387293[_0x44b8('0x2e')][_0x44b8('0x3c')]){_0x44ce5a[_0x44b8('0x3a')]=_[_0x44b8('0x3d')](_0x44ce5a['where'],{'$or':_[_0x44b8('0x28')](_0xc3f667,function(_0x11e4e3){if(_0x11e4e3[_0x44b8('0x2c')]!==_0x44b8('0x3e')){var _0x9cb2a={};_0x9cb2a[_0x11e4e3[_0x44b8('0x27')]]={'$like':'%'+_0x387293[_0x44b8('0x2e')][_0x44b8('0x3c')]+'%'};return _0x9cb2a;}})});}_0x44ce5a=_[_0x44b8('0x3d')]({},_0x44ce5a,_0x387293[_0x44b8('0x3f')]);var _0x1c9983={'where':_0x44ce5a[_0x44b8('0x3a')]};return db[_0x44b8('0x29')][_0x44b8('0x18')](_0x1c9983)[_0x44b8('0x20')](function(_0x29b43f){_0x38cd17['count']=_0x29b43f;if(_0x387293[_0x44b8('0x2e')][_0x44b8('0x40')]){_0x44ce5a[_0x44b8('0x41')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x44b8('0x42')](_0x44ce5a);})[_0x44b8('0x20')](function(_0x229cc9){_0x38cd17['rows']=_0x229cc9;return _0x38cd17;})[_0x44b8('0x20')](respondWithFilteredResult(_0x29b18d,_0x44ce5a))[_0x44b8('0x43')](handleError(_0x29b18d,null));};exports[_0x44b8('0x44')]=function(_0x334f86,_0xfd590a){var _0x499a3e={'raw':!![],'where':{'id':_0x334f86[_0x44b8('0x45')]['id']}},_0x5ae5f9={};_0x5ae5f9[_0x44b8('0x33')]=_[_0x44b8('0x2f')](db[_0x44b8('0x29')][_0x44b8('0x2a')]);_0x5ae5f9[_0x44b8('0x2e')]=_[_0x44b8('0x2f')](_0x334f86[_0x44b8('0x2e')]);_0x5ae5f9[_0x44b8('0x30')]=_[_0x44b8('0x31')](_0x5ae5f9[_0x44b8('0x33')],_0x5ae5f9[_0x44b8('0x2e')]);_0x499a3e[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x5ae5f9[_0x44b8('0x33')],qs[_0x44b8('0x34')](_0x334f86[_0x44b8('0x2e')][_0x44b8('0x34')]));_0x499a3e[_0x44b8('0x32')]=_0x499a3e['attributes']['length']?_0x499a3e[_0x44b8('0x32')]:_0x5ae5f9[_0x44b8('0x33')];if(_0x334f86[_0x44b8('0x2e')][_0x44b8('0x40')]){_0x499a3e[_0x44b8('0x41')]=[{'all':!![]}];}_0x499a3e=_[_0x44b8('0x3d')]({},_0x499a3e,_0x334f86[_0x44b8('0x3f')]);return db['AnalyticMetric'][_0x44b8('0x46')](_0x499a3e)['then'](handleEntityNotFound(_0xfd590a,null))[_0x44b8('0x20')](respondWithResult(_0xfd590a,null))[_0x44b8('0x43')](handleError(_0xfd590a,null));};exports[_0x44b8('0x47')]=function(_0x9207bf,_0x103d57){return db[_0x44b8('0x29')]['create'](_0x9207bf[_0x44b8('0x48')],{})[_0x44b8('0x20')](function(_0x10602c){var _0x25d266=_0x9207bf['user'][_0x44b8('0x22')]({'plain':!![]});if(!_0x25d266)throw new Error(_0x44b8('0x49'));if(_0x25d266[_0x44b8('0x4a')]===_0x44b8('0x4b')){var _0x44ec23=_0x10602c[_0x44b8('0x22')]({'plain':!![]});var _0x500bad=_0x44b8('0x23');return db[_0x44b8('0x4c')][_0x44b8('0x46')]({'where':{'name':_0x500bad,'userProfileId':_0x25d266[_0x44b8('0x4d')]},'raw':!![]})[_0x44b8('0x20')](function(_0x57d0e2){if(_0x57d0e2&&_0x57d0e2['autoAssociation']===0x0){return db[_0x44b8('0x24')]['create']({'name':_0x44ec23[_0x44b8('0x27')],'resourceId':_0x44ec23['id'],'type':_0x57d0e2['name'],'sectionId':_0x57d0e2['id']},{})[_0x44b8('0x20')](function(){return _0x10602c;});}else{return _0x10602c;}})[_0x44b8('0x43')](function(_0x1a29f6){logger[_0x44b8('0x4e')](_0x44b8('0x4f'),_0x1a29f6);throw _0x1a29f6;});}return _0x10602c;})[_0x44b8('0x20')](respondWithResult(_0x103d57,0xc9))[_0x44b8('0x43')](handleError(_0x103d57,null));};exports['update']=function(_0x3ad278,_0x37b2c2){if(_0x3ad278[_0x44b8('0x48')]['id']){delete _0x3ad278['body']['id'];}return db[_0x44b8('0x29')][_0x44b8('0x46')]({'where':{'id':_0x3ad278[_0x44b8('0x45')]['id']}})[_0x44b8('0x20')](handleEntityNotFound(_0x37b2c2,null))['then'](saveUpdates(_0x3ad278[_0x44b8('0x48')],null))[_0x44b8('0x20')](respondWithResult(_0x37b2c2,null))['catch'](handleError(_0x37b2c2,null));};exports[_0x44b8('0x21')]=function(_0x19f22b,_0x35136e){return db[_0x44b8('0x29')][_0x44b8('0x46')]({'where':{'id':_0x19f22b['params']['id']}})['then'](handleEntityNotFound(_0x35136e,null))[_0x44b8('0x20')](removeEntity(_0x35136e,null))[_0x44b8('0x43')](handleError(_0x35136e,null));};
\ No newline at end of file
+var _0x9c5a=['update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','AnalyticMetric','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','length','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save'];(function(_0x5ac4b6,_0x4d9360){var _0x29ced8=function(_0x4fdcb6){while(--_0x4fdcb6){_0x5ac4b6['push'](_0x5ac4b6['shift']());}};_0x29ced8(++_0x4d9360);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x3dad75,_0x4fa797){_0x3dad75=_0x3dad75-0x0;var _0xc3c109=_0x9c5a[_0x3dad75];return _0xc3c109;};'use strict';var emlformat=require(_0xa9c5('0x0'));var rimraf=require(_0xa9c5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa9c5('0x2'));var rp=require(_0xa9c5('0x3'));var moment=require(_0xa9c5('0x4'));var BPromise=require(_0xa9c5('0x5'));var Mustache=require('mustache');var util=require(_0xa9c5('0x6'));var path=require(_0xa9c5('0x7'));var sox=require('sox');var csv=require(_0xa9c5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa9c5('0x9'));var _=require(_0xa9c5('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa9c5('0xb'));var deskjs=require(_0xa9c5('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa9c5('0xd'));var Papa=require(_0xa9c5('0xe'));var Redis=require('ioredis');var authService=require(_0xa9c5('0xf'));var qs=require(_0xa9c5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa9c5('0x11'))(_0xa9c5('0x12'));var utils=require(_0xa9c5('0x13'));var config=require(_0xa9c5('0x14'));var licenseUtil=require(_0xa9c5('0x15'));var db=require(_0xa9c5('0x16'))['db'];function respondWithStatusCode(_0x51c8d,_0x42d5cf){_0x42d5cf=_0x42d5cf||0xcc;return function(_0x3c5ac7){if(_0x3c5ac7){return _0x51c8d[_0xa9c5('0x17')](_0x42d5cf);}return _0x51c8d['status'](_0x42d5cf)[_0xa9c5('0x18')]();};}function respondWithResult(_0x1276d2,_0x7df76d){_0x7df76d=_0x7df76d||0xc8;return function(_0x3806c4){if(_0x3806c4){return _0x1276d2[_0xa9c5('0x19')](_0x7df76d)[_0xa9c5('0x1a')](_0x3806c4);}};}function respondWithFilteredResult(_0x251099,_0x40b001){return function(_0x19a43e){if(_0x19a43e){var _0xcf13f2=typeof _0x40b001['offset']===_0xa9c5('0x1b')&&typeof _0x40b001[_0xa9c5('0x1c')]===_0xa9c5('0x1b');var _0x55cce5=_0x19a43e[_0xa9c5('0x1d')];var _0x1142d9=_0xcf13f2?0x0:_0x40b001[_0xa9c5('0x1e')];var _0x3b8cf7=_0xcf13f2?_0x19a43e[_0xa9c5('0x1d')]:_0x40b001[_0xa9c5('0x1e')]+_0x40b001[_0xa9c5('0x1c')];var _0x1e5ce6;if(_0x3b8cf7>=_0x55cce5){_0x3b8cf7=_0x55cce5;_0x1e5ce6=0xc8;}else{_0x1e5ce6=0xce;}_0x251099[_0xa9c5('0x19')](_0x1e5ce6);return _0x251099[_0xa9c5('0x1f')](_0xa9c5('0x20'),_0x1142d9+'-'+_0x3b8cf7+'/'+_0x55cce5)[_0xa9c5('0x1a')](_0x19a43e);}return null;};}function patchUpdates(_0x54f8b9){return function(_0x1115ad){try{jsonpatch[_0xa9c5('0x21')](_0x1115ad,_0x54f8b9,!![]);}catch(_0x541c77){return BPromise['reject'](_0x541c77);}return _0x1115ad[_0xa9c5('0x22')]();};}function saveUpdates(_0x366f5c,_0x10b208){return function(_0x3b497a){if(_0x3b497a){return _0x3b497a[_0xa9c5('0x23')](_0x366f5c)[_0xa9c5('0x24')](function(_0x48e2cb){return _0x48e2cb;});}return null;};}function removeEntity(_0x4fa280,_0x3d4e1b){return function(_0x11d395){if(_0x11d395){return _0x11d395['destroy']()[_0xa9c5('0x24')](function(){var _0x424b4c=_0x11d395[_0xa9c5('0x25')]({'plain':!![]});var _0x32fc7d=_0xa9c5('0x26');return db[_0xa9c5('0x27')][_0xa9c5('0x28')]({'where':{'type':_0x32fc7d,'resourceId':_0x424b4c['id']}})['then'](function(){return _0x11d395;});})['then'](function(){_0x4fa280[_0xa9c5('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1762ac,_0x830bad){return function(_0x4caefa){if(!_0x4caefa){_0x1762ac[_0xa9c5('0x17')](0x194);}return _0x4caefa;};}function handleError(_0x320dc0,_0x5f468b){_0x5f468b=_0x5f468b||0x1f4;return function(_0x413edf){logger[_0xa9c5('0x29')](_0x413edf[_0xa9c5('0x2a')]);if(_0x413edf[_0xa9c5('0x2b')]){delete _0x413edf[_0xa9c5('0x2b')];}_0x320dc0['status'](_0x5f468b)[_0xa9c5('0x2c')](_0x413edf);};}exports['index']=function(_0x3c3da7,_0x1ef388){var _0x2eeed1={},_0x541475={},_0xc6d0c1={'count':0x0,'rows':[]};var _0xbe29c5=_['map'](db[_0xa9c5('0x2d')][_0xa9c5('0x2e')],function(_0x431e07){return{'name':_0x431e07[_0xa9c5('0x2f')],'type':_0x431e07[_0xa9c5('0x30')][_0xa9c5('0x31')]};});_0x541475[_0xa9c5('0x32')]=_['map'](_0xbe29c5,_0xa9c5('0x2b'));_0x541475[_0xa9c5('0x33')]=_[_0xa9c5('0x34')](_0x3c3da7[_0xa9c5('0x33')]);_0x541475[_0xa9c5('0x35')]=_[_0xa9c5('0x36')](_0x541475[_0xa9c5('0x32')],_0x541475[_0xa9c5('0x33')]);_0x2eeed1['attributes']=_['intersection'](_0x541475[_0xa9c5('0x32')],qs[_0xa9c5('0x37')](_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x37')]));_0x2eeed1[_0xa9c5('0x38')]=_0x2eeed1[_0xa9c5('0x38')]['length']?_0x2eeed1['attributes']:_0x541475['model'];if(!_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x39')]('nolimit')){_0x2eeed1[_0xa9c5('0x1c')]=qs['limit'](_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x1c')]);_0x2eeed1[_0xa9c5('0x1e')]=qs[_0xa9c5('0x1e')](_0x3c3da7['query'][_0xa9c5('0x1e')]);}_0x2eeed1[_0xa9c5('0x3a')]=qs[_0xa9c5('0x3b')](_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x3b')]);_0x2eeed1[_0xa9c5('0x3c')]=qs[_0xa9c5('0x35')](_[_0xa9c5('0x3d')](_0x3c3da7['query'],_0x541475[_0xa9c5('0x35')]),_0xbe29c5);if(_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x3e')]){_0x2eeed1[_0xa9c5('0x3c')]=_[_0xa9c5('0x3f')](_0x2eeed1[_0xa9c5('0x3c')],{'$or':_['map'](_0xbe29c5,function(_0x307736){if(_0x307736['type']!==_0xa9c5('0x40')){var _0x5c89e7={};_0x5c89e7[_0x307736[_0xa9c5('0x2b')]]={'$like':'%'+_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x3e')]+'%'};return _0x5c89e7;}})});}_0x2eeed1=_['merge']({},_0x2eeed1,_0x3c3da7[_0xa9c5('0x41')]);var _0x1ddd72={'where':_0x2eeed1[_0xa9c5('0x3c')]};return db[_0xa9c5('0x2d')]['count'](_0x1ddd72)[_0xa9c5('0x24')](function(_0x97803f){_0xc6d0c1[_0xa9c5('0x1d')]=_0x97803f;if(_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x42')]){_0x2eeed1['include']=[{'all':!![]}];}return db[_0xa9c5('0x2d')]['findAll'](_0x2eeed1);})[_0xa9c5('0x24')](function(_0x397614){_0xc6d0c1[_0xa9c5('0x43')]=_0x397614;return _0xc6d0c1;})[_0xa9c5('0x24')](respondWithFilteredResult(_0x1ef388,_0x2eeed1))[_0xa9c5('0x44')](handleError(_0x1ef388,null));};exports[_0xa9c5('0x45')]=function(_0xf35cb3,_0x3e8633){var _0x1f895a={'raw':!![],'where':{'id':_0xf35cb3['params']['id']}},_0xc28b1a={};_0xc28b1a[_0xa9c5('0x32')]=_[_0xa9c5('0x34')](db[_0xa9c5('0x2d')][_0xa9c5('0x2e')]);_0xc28b1a[_0xa9c5('0x33')]=_[_0xa9c5('0x34')](_0xf35cb3['query']);_0xc28b1a[_0xa9c5('0x35')]=_[_0xa9c5('0x36')](_0xc28b1a['model'],_0xc28b1a['query']);_0x1f895a['attributes']=_['intersection'](_0xc28b1a['model'],qs[_0xa9c5('0x37')](_0xf35cb3[_0xa9c5('0x33')][_0xa9c5('0x37')]));_0x1f895a[_0xa9c5('0x38')]=_0x1f895a[_0xa9c5('0x38')][_0xa9c5('0x46')]?_0x1f895a[_0xa9c5('0x38')]:_0xc28b1a[_0xa9c5('0x32')];if(_0xf35cb3[_0xa9c5('0x33')][_0xa9c5('0x42')]){_0x1f895a[_0xa9c5('0x47')]=[{'all':!![]}];}_0x1f895a=_[_0xa9c5('0x3f')]({},_0x1f895a,_0xf35cb3[_0xa9c5('0x41')]);return db['AnalyticMetric'][_0xa9c5('0x48')](_0x1f895a)['then'](handleEntityNotFound(_0x3e8633,null))[_0xa9c5('0x24')](respondWithResult(_0x3e8633,null))[_0xa9c5('0x44')](handleError(_0x3e8633,null));};exports['create']=function(_0x5cbd33,_0xf00970){return db[_0xa9c5('0x2d')][_0xa9c5('0x49')](_0x5cbd33['body'],{})['then'](function(_0x2333c4){var _0xd03cec=_0x5cbd33['user'][_0xa9c5('0x25')]({'plain':!![]});if(!_0xd03cec)throw new Error(_0xa9c5('0x4a'));if(_0xd03cec[_0xa9c5('0x4b')]===_0xa9c5('0x4c')){var _0x34020f=_0x2333c4[_0xa9c5('0x25')]({'plain':!![]});var _0x4b6fc9='Metrics';return db['UserProfileSection'][_0xa9c5('0x48')]({'where':{'name':_0x4b6fc9,'userProfileId':_0xd03cec[_0xa9c5('0x4d')]},'raw':!![]})[_0xa9c5('0x24')](function(_0xef4d2){if(_0xef4d2&&_0xef4d2[_0xa9c5('0x4e')]===0x0){return db[_0xa9c5('0x27')]['create']({'name':_0x34020f[_0xa9c5('0x2b')],'resourceId':_0x34020f['id'],'type':_0xef4d2[_0xa9c5('0x2b')],'sectionId':_0xef4d2['id']},{})[_0xa9c5('0x24')](function(){return _0x2333c4;});}else{return _0x2333c4;}})[_0xa9c5('0x44')](function(_0xa0b458){logger[_0xa9c5('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xa0b458);throw _0xa0b458;});}return _0x2333c4;})['then'](respondWithResult(_0xf00970,0xc9))[_0xa9c5('0x44')](handleError(_0xf00970,null));};exports['update']=function(_0x1b158f,_0x5ea9b0){if(_0x1b158f[_0xa9c5('0x4f')]['id']){delete _0x1b158f[_0xa9c5('0x4f')]['id'];}return db[_0xa9c5('0x2d')]['find']({'where':{'id':_0x1b158f[_0xa9c5('0x50')]['id']}})[_0xa9c5('0x24')](handleEntityNotFound(_0x5ea9b0,null))[_0xa9c5('0x24')](saveUpdates(_0x1b158f[_0xa9c5('0x4f')],null))['then'](respondWithResult(_0x5ea9b0,null))['catch'](handleError(_0x5ea9b0,null));};exports[_0xa9c5('0x28')]=function(_0x2b66ee,_0x3205f2){return db['AnalyticMetric'][_0xa9c5('0x48')]({'where':{'id':_0x2b66ee[_0xa9c5('0x50')]['id']}})[_0xa9c5('0x24')](handleEntityNotFound(_0x3205f2,null))[_0xa9c5('0x24')](removeEntity(_0x3205f2,null))[_0xa9c5('0x44')](handleError(_0x3205f2,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 415b565..210af76 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 _0x1c23=['analytics_metrics','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./analyticMetric.attributes','exports','define'];(function(_0x5b39dd,_0x446202){var _0x1f0779=function(_0x569aab){while(--_0x569aab){_0x5b39dd['push'](_0x5b39dd['shift']());}};_0x1f0779(++_0x446202);}(_0x1c23,0x1d5));var _0x31c2=function(_0x45d1a8,_0x5d661f){_0x45d1a8=_0x45d1a8-0x0;var _0xfc869a=_0x1c23[_0x45d1a8];return _0xfc869a;};'use strict';var _=require(_0x31c2('0x0'));var util=require(_0x31c2('0x1'));var logger=require(_0x31c2('0x2'))(_0x31c2('0x3'));var moment=require(_0x31c2('0x4'));var BPromise=require(_0x31c2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x31c2('0x6'));var rimraf=require(_0x31c2('0x7'));var config=require('../../config/environment');var attributes=require(_0x31c2('0x8'));module[_0x31c2('0x9')]=function(_0x12c3d3,_0x21dbdc){return _0x12c3d3[_0x31c2('0xa')]('AnalyticMetric',attributes,{'tableName':_0x31c2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1419=['../../config/logger','api','moment','path','rimraf','exports','define','AnalyticMetric','analytics_metrics','lodash','util'];(function(_0x5bd565,_0x2ab208){var _0x285775=function(_0x56c93e){while(--_0x56c93e){_0x5bd565['push'](_0x5bd565['shift']());}};_0x285775(++_0x2ab208);}(_0x1419,0x127));var _0x9141=function(_0x31b798,_0x42684d){_0x31b798=_0x31b798-0x0;var _0x463008=_0x1419[_0x31b798];return _0x463008;};'use strict';var _=require(_0x9141('0x0'));var util=require(_0x9141('0x1'));var logger=require(_0x9141('0x2'))(_0x9141('0x3'));var moment=require(_0x9141('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9141('0x5'));var rimraf=require(_0x9141('0x6'));var config=require('../../config/environment');var attributes=require('./analyticMetric.attributes');module[_0x9141('0x7')]=function(_0x182cc8,_0x31cfc2){return _0x182cc8[_0x9141('0x8')](_0x9141('0x9'),attributes,{'tableName':_0x9141('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 639fc83..2f03d33 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 _0xed45=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0xf61586,_0x56b0c4){var _0x2b6eb3=function(_0x47e12b){while(--_0x47e12b){_0xf61586['push'](_0xf61586['shift']());}};_0x2b6eb3(++_0x56b0c4);}(_0xed45,0x186));var _0x5ed4=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xed45[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x5ed4('0x0'));var util=require(_0x5ed4('0x1'));var moment=require(_0x5ed4('0x2'));var BPromise=require(_0x5ed4('0x3'));var rs=require(_0x5ed4('0x4'));var fs=require('fs');var Redis=require(_0x5ed4('0x5'));var db=require(_0x5ed4('0x6'))['db'];var utils=require(_0x5ed4('0x7'));var logger=require(_0x5ed4('0x8'))('rpc');var config=require(_0x5ed4('0x9'));var jayson=require(_0x5ed4('0xa'));var client=jayson[_0x5ed4('0xb')][_0x5ed4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2d1fa8,_0x10fefc,_0x446fcc){return new BPromise(function(_0x2b718d,_0x5e6132){return client[_0x5ed4('0xd')](_0x2d1fa8,_0x446fcc)[_0x5ed4('0xe')](function(_0x5ea8b8){logger['info'](_0x5ed4('0xf'),_0x10fefc,_0x5ed4('0x10'));logger[_0x5ed4('0x11')](_0x5ed4('0x12'),_0x10fefc,_0x5ed4('0x10'),JSON[_0x5ed4('0x13')](_0x5ea8b8));if(_0x5ea8b8[_0x5ed4('0x14')]){if(_0x5ea8b8[_0x5ed4('0x14')][_0x5ed4('0x15')]===0x1f4){logger['error'](_0x5ed4('0xf'),_0x10fefc,_0x5ea8b8[_0x5ed4('0x14')][_0x5ed4('0x16')]);return _0x5e6132(_0x5ea8b8['error'][_0x5ed4('0x16')]);}logger[_0x5ed4('0x14')](_0x5ed4('0xf'),_0x10fefc,_0x5ea8b8[_0x5ed4('0x14')]['message']);return _0x2b718d(_0x5ea8b8['error'][_0x5ed4('0x16')]);}else{logger[_0x5ed4('0x17')](_0x5ed4('0xf'),_0x10fefc,'request\x20sent');_0x2b718d(_0x5ea8b8[_0x5ed4('0x18')]['message']);}})[_0x5ed4('0x19')](function(_0x21f65c){logger[_0x5ed4('0x14')](_0x5ed4('0xf'),_0x10fefc,_0x21f65c);_0x5e6132(_0x21f65c);});});}
\ No newline at end of file
+var _0x189a=['request','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x28033b,_0x5eeded){var _0x406878=function(_0x594c28){while(--_0x594c28){_0x28033b['push'](_0x28033b['shift']());}};_0x406878(++_0x5eeded);}(_0x189a,0x17b));var _0xa189=function(_0x17c1f3,_0x10cd0a){_0x17c1f3=_0x17c1f3-0x0;var _0x1d6c8d=_0x189a[_0x17c1f3];return _0x1d6c8d;};'use strict';var _=require(_0xa189('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa189('0x1'));var rs=require(_0xa189('0x2'));var fs=require('fs');var Redis=require(_0xa189('0x3'));var db=require(_0xa189('0x4'))['db'];var utils=require(_0xa189('0x5'));var logger=require(_0xa189('0x6'))(_0xa189('0x7'));var config=require(_0xa189('0x8'));var jayson=require(_0xa189('0x9'));var client=jayson[_0xa189('0xa')][_0xa189('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x29080f,_0x4c254c,_0x2d99ec){return new BPromise(function(_0x55657d,_0x518f8f){return client[_0xa189('0xc')](_0x29080f,_0x2d99ec)['then'](function(_0x5f3ed8){logger[_0xa189('0xd')](_0xa189('0xe'),_0x4c254c,_0xa189('0xf'));logger[_0xa189('0x10')](_0xa189('0x11'),_0x4c254c,_0xa189('0xf'),JSON[_0xa189('0x12')](_0x5f3ed8));if(_0x5f3ed8[_0xa189('0x13')]){if(_0x5f3ed8[_0xa189('0x13')][_0xa189('0x14')]===0x1f4){logger['error'](_0xa189('0xe'),_0x4c254c,_0x5f3ed8['error']['message']);return _0x518f8f(_0x5f3ed8['error'][_0xa189('0x15')]);}logger['error'](_0xa189('0xe'),_0x4c254c,_0x5f3ed8[_0xa189('0x13')]['message']);return _0x55657d(_0x5f3ed8[_0xa189('0x13')][_0xa189('0x15')]);}else{logger[_0xa189('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x4c254c,_0xa189('0xf'));_0x55657d(_0x5f3ed8[_0xa189('0x16')][_0xa189('0x15')]);}})['catch'](function(_0x396146){logger[_0xa189('0x13')](_0xa189('0xe'),_0x4c254c,_0x396146);_0x518f8f(_0x396146);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index b7fa0d4..c82e2ab 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 _0x8ca9=['express','Router','fs-extra','../../config/environment','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x488ce4,_0x2b2839){var _0x4f60c2=function(_0x17211f){while(--_0x17211f){_0x488ce4['push'](_0x488ce4['shift']());}};_0x4f60c2(++_0x2b2839);}(_0x8ca9,0x9c));var _0x98ca=function(_0x47c18a,_0x221dd2){_0x47c18a=_0x47c18a-0x0;var _0x24cb66=_0x8ca9[_0x47c18a];return _0x24cb66;};'use strict';var multer=require(_0x98ca('0x0'));var util=require(_0x98ca('0x1'));var path=require(_0x98ca('0x2'));var timeout=require(_0x98ca('0x3'));var express=require(_0x98ca('0x4'));var router=express[_0x98ca('0x5')]();var fs_extra=require(_0x98ca('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x98ca('0x7'));var controller=require('./analyticMetric.controller');router[_0x98ca('0x8')]('/',auth['isAuthenticated'](),controller[_0x98ca('0x9')]);router[_0x98ca('0x8')](_0x98ca('0xa'),auth[_0x98ca('0xb')](),controller[_0x98ca('0xc')]);router[_0x98ca('0xd')]('/',auth[_0x98ca('0xb')](),controller[_0x98ca('0xe')]);router[_0x98ca('0xf')](_0x98ca('0xa'),auth[_0x98ca('0xb')](),controller[_0x98ca('0x10')]);router[_0x98ca('0x11')](_0x98ca('0xa'),auth[_0x98ca('0xb')](),controller[_0x98ca('0x12')]);module[_0x98ca('0x13')]=router;
\ No newline at end of file
+var _0x0cfe=['fs-extra','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','index','/:id','show','post','create','put','isAuthenticated','update','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0xcf581b,_0x4359dd){var _0x4f454d=function(_0x182d58){while(--_0x182d58){_0xcf581b['push'](_0xcf581b['shift']());}};_0x4f454d(++_0x4359dd);}(_0x0cfe,0x9c));var _0xe0cf=function(_0x49fe0f,_0xec12d7){_0x49fe0f=_0x49fe0f-0x0;var _0x406663=_0x0cfe[_0x49fe0f];return _0x406663;};'use strict';var multer=require(_0xe0cf('0x0'));var util=require('util');var path=require(_0xe0cf('0x1'));var timeout=require(_0xe0cf('0x2'));var express=require(_0xe0cf('0x3'));var router=express['Router']();var fs_extra=require(_0xe0cf('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe0cf('0x5'));var config=require(_0xe0cf('0x6'));var controller=require(_0xe0cf('0x7'));router[_0xe0cf('0x8')]('/',auth['isAuthenticated'](),controller[_0xe0cf('0x9')]);router[_0xe0cf('0x8')](_0xe0cf('0xa'),auth['isAuthenticated'](),controller[_0xe0cf('0xb')]);router[_0xe0cf('0xc')]('/',auth['isAuthenticated'](),controller[_0xe0cf('0xd')]);router[_0xe0cf('0xe')](_0xe0cf('0xa'),auth[_0xe0cf('0xf')](),controller[_0xe0cf('0x10')]);router[_0xe0cf('0x11')]('/:id',auth[_0xe0cf('0xf')](),controller[_0xe0cf('0x12')]);module[_0xe0cf('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index eba89b1..27e3bff 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 _0x1306=['sequelize','exports','TEXT'];(function(_0x4d58b1,_0x2dd89f){var _0x46e955=function(_0x40becc){while(--_0x40becc){_0x4d58b1['push'](_0x4d58b1['shift']());}};_0x46e955(++_0x2dd89f);}(_0x1306,0x17a));var _0x6130=function(_0x1bd3b5,_0x323733){_0x1bd3b5=_0x1bd3b5-0x0;var _0x2b0885=_0x1306[_0x1bd3b5];return _0x2b0885;};'use strict';var Sequelize=require(_0x6130('0x0'));module[_0x6130('0x1')]={'tree':{'type':Sequelize[_0x6130('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x9a53=['TEXT','sequelize','exports'];(function(_0x5683b0,_0x4233ea){var _0x2757e8=function(_0x1ef768){while(--_0x1ef768){_0x5683b0['push'](_0x5683b0['shift']());}};_0x2757e8(++_0x4233ea);}(_0x9a53,0xb5));var _0x39a5=function(_0x398331,_0x457080){_0x398331=_0x398331-0x0;var _0x4a9ec9=_0x9a53[_0x398331];return _0x4a9ec9;};'use strict';var Sequelize=require(_0x39a5('0x0'));module[_0x39a5('0x1')]={'tree':{'type':Sequelize[_0x39a5('0x2')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index e5c277a..eac5dfa 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 _0xd104=['save','update','destroy','error','stack','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','params','length','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','limit','count','offset','set','json','apply','reject'];(function(_0x6ea7a6,_0x1b384a){var _0x46468a=function(_0xbde3cc){while(--_0xbde3cc){_0x6ea7a6['push'](_0x6ea7a6['shift']());}};_0x46468a(++_0x1b384a);}(_0xd104,0x1eb));var _0x4d10=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xd104[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require(_0x4d10('0x0'));var rimraf=require(_0x4d10('0x1'));var zipdir=require(_0x4d10('0x2'));var jsonpatch=require(_0x4d10('0x3'));var rp=require(_0x4d10('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4d10('0x5'));var util=require('util');var path=require(_0x4d10('0x6'));var sox=require(_0x4d10('0x7'));var csv=require(_0x4d10('0x8'));var ejs=require(_0x4d10('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4d10('0xa'));var squel=require(_0x4d10('0xb'));var crypto=require('crypto');var jsforce=require(_0x4d10('0xc'));var deskjs=require(_0x4d10('0xd'));var toCsv=require(_0x4d10('0x8'));var querystring=require(_0x4d10('0xe'));var Papa=require('papaparse');var Redis=require(_0x4d10('0xf'));var authService=require(_0x4d10('0x10'));var qs=require(_0x4d10('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4d10('0x12'))(_0x4d10('0x13'));var utils=require('../../config/utils');var config=require(_0x4d10('0x14'));var licenseUtil=require(_0x4d10('0x15'));var db=require(_0x4d10('0x16'))['db'];function respondWithStatusCode(_0x1b4842,_0xf9a75d){_0xf9a75d=_0xf9a75d||0xcc;return function(_0x22845d){if(_0x22845d){return _0x1b4842[_0x4d10('0x17')](_0xf9a75d);}return _0x1b4842['status'](_0xf9a75d)[_0x4d10('0x18')]();};}function respondWithResult(_0x2497fb,_0x1ef7ef){_0x1ef7ef=_0x1ef7ef||0xc8;return function(_0x33c8bd){if(_0x33c8bd){return _0x2497fb[_0x4d10('0x19')](_0x1ef7ef)['json'](_0x33c8bd);}};}function respondWithFilteredResult(_0x1c3255,_0x4c7b8d){return function(_0x3b026e){if(_0x3b026e){var _0x11bc91=typeof _0x4c7b8d['offset']===_0x4d10('0x1a')&&typeof _0x4c7b8d[_0x4d10('0x1b')]===_0x4d10('0x1a');var _0x39d39d=_0x3b026e[_0x4d10('0x1c')];var _0x4e584d=_0x11bc91?0x0:_0x4c7b8d[_0x4d10('0x1d')];var _0x19a98e=_0x11bc91?_0x3b026e[_0x4d10('0x1c')]:_0x4c7b8d['offset']+_0x4c7b8d[_0x4d10('0x1b')];var _0x3a91c1;if(_0x19a98e>=_0x39d39d){_0x19a98e=_0x39d39d;_0x3a91c1=0xc8;}else{_0x3a91c1=0xce;}_0x1c3255[_0x4d10('0x19')](_0x3a91c1);return _0x1c3255[_0x4d10('0x1e')]('Content-Range',_0x4e584d+'-'+_0x19a98e+'/'+_0x39d39d)[_0x4d10('0x1f')](_0x3b026e);}return null;};}function patchUpdates(_0x399df3){return function(_0x50c6c7){try{jsonpatch[_0x4d10('0x20')](_0x50c6c7,_0x399df3,!![]);}catch(_0x18f2b3){return BPromise[_0x4d10('0x21')](_0x18f2b3);}return _0x50c6c7[_0x4d10('0x22')]();};}function saveUpdates(_0x6ed3a7,_0x770735){return function(_0x2261a6){if(_0x2261a6){return _0x2261a6[_0x4d10('0x23')](_0x6ed3a7)['then'](function(_0x5b26cc){return _0x5b26cc;});}return null;};}function removeEntity(_0x43a95b,_0x4db371){return function(_0xd6285c){if(_0xd6285c){return _0xd6285c[_0x4d10('0x24')]()['then'](function(){_0x43a95b[_0x4d10('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x501e61,_0x197037){return function(_0x4af5b2){if(!_0x4af5b2){_0x501e61[_0x4d10('0x17')](0x194);}return _0x4af5b2;};}function handleError(_0x1fd962,_0xfd29d8){_0xfd29d8=_0xfd29d8||0x1f4;return function(_0x2b47c8){logger[_0x4d10('0x25')](_0x2b47c8[_0x4d10('0x26')]);if(_0x2b47c8['name']){delete _0x2b47c8['name'];}_0x1fd962['status'](_0xfd29d8)[_0x4d10('0x27')](_0x2b47c8);};}exports[_0x4d10('0x28')]=function(_0x2a45a6,_0x3ae65a){var _0x4b3533={},_0x5467cc={},_0x1f82d1={'count':0x0,'rows':[]};var _0x434efd=_[_0x4d10('0x29')](db[_0x4d10('0x2a')][_0x4d10('0x2b')],function(_0xd6ffee){return{'name':_0xd6ffee[_0x4d10('0x2c')],'type':_0xd6ffee[_0x4d10('0x2d')][_0x4d10('0x2e')]};});_0x5467cc[_0x4d10('0x2f')]=_[_0x4d10('0x29')](_0x434efd,_0x4d10('0x30'));_0x5467cc[_0x4d10('0x31')]=_[_0x4d10('0x32')](_0x2a45a6['query']);_0x5467cc[_0x4d10('0x33')]=_[_0x4d10('0x34')](_0x5467cc[_0x4d10('0x2f')],_0x5467cc[_0x4d10('0x31')]);_0x4b3533['attributes']=_[_0x4d10('0x34')](_0x5467cc[_0x4d10('0x2f')],qs['fields'](_0x2a45a6[_0x4d10('0x31')][_0x4d10('0x35')]));_0x4b3533[_0x4d10('0x36')]=_0x4b3533[_0x4d10('0x36')]['length']?_0x4b3533[_0x4d10('0x36')]:_0x5467cc['model'];if(!_0x2a45a6['query'][_0x4d10('0x37')](_0x4d10('0x38'))){_0x4b3533[_0x4d10('0x1b')]=qs[_0x4d10('0x1b')](_0x2a45a6['query'][_0x4d10('0x1b')]);_0x4b3533[_0x4d10('0x1d')]=qs[_0x4d10('0x1d')](_0x2a45a6[_0x4d10('0x31')][_0x4d10('0x1d')]);}_0x4b3533['order']=qs[_0x4d10('0x39')](_0x2a45a6[_0x4d10('0x31')][_0x4d10('0x39')]);_0x4b3533['where']=qs[_0x4d10('0x33')](_['pick'](_0x2a45a6['query'],_0x5467cc[_0x4d10('0x33')]),_0x434efd);if(_0x2a45a6[_0x4d10('0x31')][_0x4d10('0x3a')]){_0x4b3533[_0x4d10('0x3b')]=_[_0x4d10('0x3c')](_0x4b3533['where'],{'$or':_['map'](_0x434efd,function(_0x147cb7){if(_0x147cb7['type']!==_0x4d10('0x3d')){var _0x386755={};_0x386755[_0x147cb7[_0x4d10('0x30')]]={'$like':'%'+_0x2a45a6['query'][_0x4d10('0x3a')]+'%'};return _0x386755;}})});}_0x4b3533=_[_0x4d10('0x3c')]({},_0x4b3533,_0x2a45a6[_0x4d10('0x3e')]);var _0xdb5e14={'where':_0x4b3533[_0x4d10('0x3b')]};return db[_0x4d10('0x2a')][_0x4d10('0x1c')](_0xdb5e14)[_0x4d10('0x3f')](function(_0x3559ee){_0x1f82d1[_0x4d10('0x1c')]=_0x3559ee;if(_0x2a45a6[_0x4d10('0x31')][_0x4d10('0x40')]){_0x4b3533[_0x4d10('0x41')]=[{'all':!![]}];}return db[_0x4d10('0x2a')][_0x4d10('0x42')](_0x4b3533);})[_0x4d10('0x3f')](function(_0x5e9564){_0x1f82d1[_0x4d10('0x43')]=_0x5e9564;return _0x1f82d1;})[_0x4d10('0x3f')](respondWithFilteredResult(_0x3ae65a,_0x4b3533))[_0x4d10('0x44')](handleError(_0x3ae65a,null));};exports[_0x4d10('0x45')]=function(_0x295146,_0x4dcaf9){var _0x2721fc={'raw':!![],'where':{'id':_0x295146[_0x4d10('0x46')]['id']}},_0x2b8258={};_0x2b8258[_0x4d10('0x2f')]=_[_0x4d10('0x32')](db[_0x4d10('0x2a')][_0x4d10('0x2b')]);_0x2b8258[_0x4d10('0x31')]=_[_0x4d10('0x32')](_0x295146[_0x4d10('0x31')]);_0x2b8258[_0x4d10('0x33')]=_[_0x4d10('0x34')](_0x2b8258[_0x4d10('0x2f')],_0x2b8258[_0x4d10('0x31')]);_0x2721fc['attributes']=_['intersection'](_0x2b8258[_0x4d10('0x2f')],qs[_0x4d10('0x35')](_0x295146[_0x4d10('0x31')][_0x4d10('0x35')]));_0x2721fc[_0x4d10('0x36')]=_0x2721fc[_0x4d10('0x36')][_0x4d10('0x47')]?_0x2721fc[_0x4d10('0x36')]:_0x2b8258[_0x4d10('0x2f')];if(_0x295146[_0x4d10('0x31')]['includeAll']){_0x2721fc['include']=[{'all':!![]}];}_0x2721fc=_[_0x4d10('0x3c')]({},_0x2721fc,_0x295146[_0x4d10('0x3e')]);return db[_0x4d10('0x2a')]['find'](_0x2721fc)[_0x4d10('0x3f')](handleEntityNotFound(_0x4dcaf9,null))['then'](respondWithResult(_0x4dcaf9,null))['catch'](handleError(_0x4dcaf9,null));};exports[_0x4d10('0x48')]=function(_0x1d95d2,_0x95451d){return db['AnalyticTreeReport'][_0x4d10('0x48')](_0x1d95d2[_0x4d10('0x49')],{})[_0x4d10('0x3f')](respondWithResult(_0x95451d,0xc9))['catch'](handleError(_0x95451d,null));};exports[_0x4d10('0x23')]=function(_0x8e2a80,_0xa02060){if(_0x8e2a80[_0x4d10('0x49')]['id']){delete _0x8e2a80[_0x4d10('0x49')]['id'];}return db['AnalyticTreeReport'][_0x4d10('0x4a')]({'where':{'id':_0x8e2a80[_0x4d10('0x46')]['id']}})[_0x4d10('0x3f')](handleEntityNotFound(_0xa02060,null))[_0x4d10('0x3f')](saveUpdates(_0x8e2a80['body'],null))[_0x4d10('0x3f')](respondWithResult(_0xa02060,null))[_0x4d10('0x44')](handleError(_0xa02060,null));};exports[_0x4d10('0x24')]=function(_0x4f26a9,_0x5366da){return db[_0x4d10('0x2a')][_0x4d10('0x4a')]({'where':{'id':_0x4f26a9[_0x4d10('0x46')]['id']}})[_0x4d10('0x3f')](handleEntityNotFound(_0x5366da,null))[_0x4d10('0x3f')](removeEntity(_0x5366da,null))[_0x4d10('0x44')](handleError(_0x5366da,null));};
\ No newline at end of file
+var _0x1056=['json','apply','save','update','then','destroy','end','error','stack','name','index','rawAttributes','fieldName','key','map','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filters','filter','merge','type','options','AnalyticTreeReport','includeAll','findAll','rows','catch','params','include','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','set','Content-Range'];(function(_0x4d1091,_0x2fbc86){var _0x1507cd=function(_0x1c886f){while(--_0x1c886f){_0x4d1091['push'](_0x4d1091['shift']());}};_0x1507cd(++_0x2fbc86);}(_0x1056,0x16b));var _0x6105=function(_0x4268fa,_0x1f085f){_0x4268fa=_0x4268fa-0x0;var _0x4ab24f=_0x1056[_0x4268fa];return _0x4ab24f;};'use strict';var emlformat=require(_0x6105('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6105('0x1'));var jsonpatch=require(_0x6105('0x2'));var rp=require(_0x6105('0x3'));var moment=require(_0x6105('0x4'));var BPromise=require(_0x6105('0x5'));var Mustache=require(_0x6105('0x6'));var util=require(_0x6105('0x7'));var path=require(_0x6105('0x8'));var sox=require('sox');var csv=require(_0x6105('0x9'));var ejs=require(_0x6105('0xa'));var fs=require('fs');var fs_extra=require(_0x6105('0xb'));var _=require(_0x6105('0xc'));var squel=require(_0x6105('0xd'));var crypto=require(_0x6105('0xe'));var jsforce=require(_0x6105('0xf'));var deskjs=require(_0x6105('0x10'));var toCsv=require(_0x6105('0x9'));var querystring=require(_0x6105('0x11'));var Papa=require(_0x6105('0x12'));var Redis=require(_0x6105('0x13'));var authService=require(_0x6105('0x14'));var qs=require(_0x6105('0x15'));var as=require(_0x6105('0x16'));var hardwareService=require(_0x6105('0x17'));var logger=require(_0x6105('0x18'))(_0x6105('0x19'));var utils=require(_0x6105('0x1a'));var config=require(_0x6105('0x1b'));var licenseUtil=require(_0x6105('0x1c'));var db=require(_0x6105('0x1d'))['db'];function respondWithStatusCode(_0x1e876b,_0x18b406){_0x18b406=_0x18b406||0xcc;return function(_0x30ad04){if(_0x30ad04){return _0x1e876b[_0x6105('0x1e')](_0x18b406);}return _0x1e876b[_0x6105('0x1f')](_0x18b406)['end']();};}function respondWithResult(_0x3464c5,_0x3b5a39){_0x3b5a39=_0x3b5a39||0xc8;return function(_0x496de1){if(_0x496de1){return _0x3464c5['status'](_0x3b5a39)['json'](_0x496de1);}};}function respondWithFilteredResult(_0x2c8c8b,_0x1fd82a){return function(_0x56d98a){if(_0x56d98a){var _0x31a82d=typeof _0x1fd82a[_0x6105('0x20')]===_0x6105('0x21')&&typeof _0x1fd82a['limit']==='undefined';var _0x1f3a8d=_0x56d98a['count'];var _0xf98c5c=_0x31a82d?0x0:_0x1fd82a[_0x6105('0x20')];var _0x1d9d1e=_0x31a82d?_0x56d98a[_0x6105('0x22')]:_0x1fd82a[_0x6105('0x20')]+_0x1fd82a['limit'];var _0x12a6fb;if(_0x1d9d1e>=_0x1f3a8d){_0x1d9d1e=_0x1f3a8d;_0x12a6fb=0xc8;}else{_0x12a6fb=0xce;}_0x2c8c8b['status'](_0x12a6fb);return _0x2c8c8b[_0x6105('0x23')](_0x6105('0x24'),_0xf98c5c+'-'+_0x1d9d1e+'/'+_0x1f3a8d)[_0x6105('0x25')](_0x56d98a);}return null;};}function patchUpdates(_0x328f2c){return function(_0x40a579){try{jsonpatch[_0x6105('0x26')](_0x40a579,_0x328f2c,!![]);}catch(_0x36bbcf){return BPromise['reject'](_0x36bbcf);}return _0x40a579[_0x6105('0x27')]();};}function saveUpdates(_0x133ab7,_0x546243){return function(_0xa68cc){if(_0xa68cc){return _0xa68cc[_0x6105('0x28')](_0x133ab7)[_0x6105('0x29')](function(_0xddf179){return _0xddf179;});}return null;};}function removeEntity(_0x2b2cec,_0x114a57){return function(_0x14985f){if(_0x14985f){return _0x14985f[_0x6105('0x2a')]()['then'](function(){_0x2b2cec[_0x6105('0x1f')](0xcc)[_0x6105('0x2b')]();});}};}function handleEntityNotFound(_0x581722,_0x3fd1b5){return function(_0x399379){if(!_0x399379){_0x581722[_0x6105('0x1e')](0x194);}return _0x399379;};}function handleError(_0x5cf714,_0x4719b5){_0x4719b5=_0x4719b5||0x1f4;return function(_0x9ebbf4){logger[_0x6105('0x2c')](_0x9ebbf4[_0x6105('0x2d')]);if(_0x9ebbf4[_0x6105('0x2e')]){delete _0x9ebbf4[_0x6105('0x2e')];}_0x5cf714[_0x6105('0x1f')](_0x4719b5)['send'](_0x9ebbf4);};}exports[_0x6105('0x2f')]=function(_0x285114,_0x330900){var _0x250d50={},_0x25db92={},_0x564889={'count':0x0,'rows':[]};var _0x36567d=_['map'](db['AnalyticTreeReport'][_0x6105('0x30')],function(_0x50f3b2){return{'name':_0x50f3b2[_0x6105('0x31')],'type':_0x50f3b2['type'][_0x6105('0x32')]};});_0x25db92['model']=_[_0x6105('0x33')](_0x36567d,_0x6105('0x2e'));_0x25db92[_0x6105('0x34')]=_[_0x6105('0x35')](_0x285114[_0x6105('0x34')]);_0x25db92['filters']=_[_0x6105('0x36')](_0x25db92[_0x6105('0x37')],_0x25db92['query']);_0x250d50[_0x6105('0x38')]=_[_0x6105('0x36')](_0x25db92[_0x6105('0x37')],qs[_0x6105('0x39')](_0x285114[_0x6105('0x34')][_0x6105('0x39')]));_0x250d50[_0x6105('0x38')]=_0x250d50[_0x6105('0x38')]['length']?_0x250d50['attributes']:_0x25db92[_0x6105('0x37')];if(!_0x285114[_0x6105('0x34')][_0x6105('0x3a')](_0x6105('0x3b'))){_0x250d50[_0x6105('0x3c')]=qs['limit'](_0x285114[_0x6105('0x34')][_0x6105('0x3c')]);_0x250d50[_0x6105('0x20')]=qs[_0x6105('0x20')](_0x285114[_0x6105('0x34')][_0x6105('0x20')]);}_0x250d50[_0x6105('0x3d')]=qs[_0x6105('0x3e')](_0x285114[_0x6105('0x34')][_0x6105('0x3e')]);_0x250d50[_0x6105('0x3f')]=qs['filters'](_[_0x6105('0x40')](_0x285114[_0x6105('0x34')],_0x25db92[_0x6105('0x41')]),_0x36567d);if(_0x285114[_0x6105('0x34')][_0x6105('0x42')]){_0x250d50[_0x6105('0x3f')]=_[_0x6105('0x43')](_0x250d50[_0x6105('0x3f')],{'$or':_[_0x6105('0x33')](_0x36567d,function(_0x48677d){if(_0x48677d[_0x6105('0x44')]!=='VIRTUAL'){var _0x12b9f1={};_0x12b9f1[_0x48677d[_0x6105('0x2e')]]={'$like':'%'+_0x285114[_0x6105('0x34')]['filter']+'%'};return _0x12b9f1;}})});}_0x250d50=_['merge']({},_0x250d50,_0x285114[_0x6105('0x45')]);var _0x34e907={'where':_0x250d50['where']};return db[_0x6105('0x46')]['count'](_0x34e907)[_0x6105('0x29')](function(_0x855648){_0x564889[_0x6105('0x22')]=_0x855648;if(_0x285114[_0x6105('0x34')][_0x6105('0x47')]){_0x250d50['include']=[{'all':!![]}];}return db[_0x6105('0x46')][_0x6105('0x48')](_0x250d50);})['then'](function(_0x2cf9ac){_0x564889[_0x6105('0x49')]=_0x2cf9ac;return _0x564889;})['then'](respondWithFilteredResult(_0x330900,_0x250d50))[_0x6105('0x4a')](handleError(_0x330900,null));};exports['show']=function(_0x57f485,_0x4ad9b4){var _0x19cc15={'raw':!![],'where':{'id':_0x57f485[_0x6105('0x4b')]['id']}},_0x4a360b={};_0x4a360b[_0x6105('0x37')]=_['keys'](db[_0x6105('0x46')]['rawAttributes']);_0x4a360b[_0x6105('0x34')]=_[_0x6105('0x35')](_0x57f485[_0x6105('0x34')]);_0x4a360b['filters']=_[_0x6105('0x36')](_0x4a360b[_0x6105('0x37')],_0x4a360b[_0x6105('0x34')]);_0x19cc15[_0x6105('0x38')]=_[_0x6105('0x36')](_0x4a360b['model'],qs[_0x6105('0x39')](_0x57f485['query'][_0x6105('0x39')]));_0x19cc15['attributes']=_0x19cc15[_0x6105('0x38')]['length']?_0x19cc15[_0x6105('0x38')]:_0x4a360b[_0x6105('0x37')];if(_0x57f485[_0x6105('0x34')][_0x6105('0x47')]){_0x19cc15[_0x6105('0x4c')]=[{'all':!![]}];}_0x19cc15=_[_0x6105('0x43')]({},_0x19cc15,_0x57f485[_0x6105('0x45')]);return db[_0x6105('0x46')][_0x6105('0x4d')](_0x19cc15)[_0x6105('0x29')](handleEntityNotFound(_0x4ad9b4,null))[_0x6105('0x29')](respondWithResult(_0x4ad9b4,null))['catch'](handleError(_0x4ad9b4,null));};exports[_0x6105('0x4e')]=function(_0x409563,_0x5462ac){return db[_0x6105('0x46')][_0x6105('0x4e')](_0x409563[_0x6105('0x4f')],{})[_0x6105('0x29')](respondWithResult(_0x5462ac,0xc9))[_0x6105('0x4a')](handleError(_0x5462ac,null));};exports[_0x6105('0x28')]=function(_0x335f77,_0x242ae8){if(_0x335f77['body']['id']){delete _0x335f77[_0x6105('0x4f')]['id'];}return db[_0x6105('0x46')][_0x6105('0x4d')]({'where':{'id':_0x335f77[_0x6105('0x4b')]['id']}})['then'](handleEntityNotFound(_0x242ae8,null))['then'](saveUpdates(_0x335f77[_0x6105('0x4f')],null))[_0x6105('0x29')](respondWithResult(_0x242ae8,null))['catch'](handleError(_0x242ae8,null));};exports[_0x6105('0x2a')]=function(_0x4bc153,_0x51bfa5){return db[_0x6105('0x46')][_0x6105('0x4d')]({'where':{'id':_0x4bc153[_0x6105('0x4b')]['id']}})[_0x6105('0x29')](handleEntityNotFound(_0x51bfa5,null))[_0x6105('0x29')](removeEntity(_0x51bfa5,null))[_0x6105('0x4a')](handleError(_0x51bfa5,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 04ee668..f208b1d 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 _0x3f71=['lodash','util','api','moment','request-promise','../../config/environment','define','AnalyticTreeReport','analytics_report_trees'];(function(_0x2074b3,_0x54589c){var _0x3529e7=function(_0xfbe935){while(--_0xfbe935){_0x2074b3['push'](_0x2074b3['shift']());}};_0x3529e7(++_0x54589c);}(_0x3f71,0x90));var _0x13f7=function(_0x2f3794,_0x3c3bec){_0x2f3794=_0x2f3794-0x0;var _0x1c9fbe=_0x3f71[_0x2f3794];return _0x1c9fbe;};'use strict';var _=require(_0x13f7('0x0'));var util=require(_0x13f7('0x1'));var logger=require('../../config/logger')(_0x13f7('0x2'));var moment=require(_0x13f7('0x3'));var BPromise=require('bluebird');var rp=require(_0x13f7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x13f7('0x5'));var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0x3be8ec,_0x5267f2){return _0x3be8ec[_0x13f7('0x6')](_0x13f7('0x7'),attributes,{'tableName':_0x13f7('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9ffc=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','analytics_report_trees','lodash'];(function(_0x29bdac,_0x454ae8){var _0xbd61f7=function(_0x8d2b26){while(--_0x8d2b26){_0x29bdac['push'](_0x29bdac['shift']());}};_0xbd61f7(++_0x454ae8);}(_0x9ffc,0x128));var _0xc9ff=function(_0x38aeea,_0x57522a){_0x38aeea=_0x38aeea-0x0;var _0x5e8d2c=_0x9ffc[_0x38aeea];return _0x5e8d2c;};'use strict';var _=require(_0xc9ff('0x0'));var util=require(_0xc9ff('0x1'));var logger=require(_0xc9ff('0x2'))(_0xc9ff('0x3'));var moment=require(_0xc9ff('0x4'));var BPromise=require(_0xc9ff('0x5'));var rp=require(_0xc9ff('0x6'));var fs=require('fs');var path=require(_0xc9ff('0x7'));var rimraf=require(_0xc9ff('0x8'));var config=require(_0xc9ff('0x9'));var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0xf33ea5,_0x4fc10d){return _0xf33ea5['define']('AnalyticTreeReport',attributes,{'tableName':_0xc9ff('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index 246bbd8..97944c6 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 _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\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(_0x1cb474,_0x224b1f){var _0x23da3a=function(_0x409414){while(--_0x409414){_0x1cb474['push'](_0x1cb474['shift']());}};_0x23da3a(++_0x224b1f);}(_0x1261,0x144));var _0x1126=function(_0x17e174,_0x4991f8){_0x17e174=_0x17e174-0x0;var _0x3f26f1=_0x1261[_0x17e174];return _0x3f26f1;};'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')]('AnalyticTreeReport,\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
+var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x4c8eab,_0x498091){var _0x3ba7b1=function(_0x5393a0){while(--_0x5393a0){_0x4c8eab['push'](_0x4c8eab['shift']());}};_0x3ba7b1(++_0x498091);}(_0x5f2f,0x73));var _0xf5f2=function(_0x201818,_0x1b367e){_0x201818=_0x201818-0x0;var _0x4712b9=_0x5f2f[_0x201818];return _0x4712b9;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 5a9eaf3..0ec7929 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 _0x124e=['get','isAuthenticated','index','post','put','/:id','delete','exports','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller'];(function(_0x477376,_0x44a02b){var _0x4647a8=function(_0x58357e){while(--_0x58357e){_0x477376['push'](_0x477376['shift']());}};_0x4647a8(++_0x44a02b);}(_0x124e,0xc8));var _0xe124=function(_0x4c6d6f,_0x291557){_0x4c6d6f=_0x4c6d6f-0x0;var _0x2d4478=_0x124e[_0x4c6d6f];return _0x2d4478;};'use strict';var multer=require('multer');var util=require(_0xe124('0x0'));var path=require(_0xe124('0x1'));var timeout=require('connect-timeout');var express=require(_0xe124('0x2'));var router=express[_0xe124('0x3')]();var fs_extra=require(_0xe124('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe124('0x5'));var config=require(_0xe124('0x6'));var controller=require(_0xe124('0x7'));router[_0xe124('0x8')]('/',auth[_0xe124('0x9')](),controller[_0xe124('0xa')]);router[_0xe124('0x8')]('/:id',auth[_0xe124('0x9')](),controller['show']);router[_0xe124('0xb')]('/',auth[_0xe124('0x9')](),controller['create']);router[_0xe124('0xc')](_0xe124('0xd'),auth[_0xe124('0x9')](),controller['update']);router[_0xe124('0xe')](_0xe124('0xd'),auth[_0xe124('0x9')](),controller['destroy']);module[_0xe124('0xf')]=router;
\ No newline at end of file
+var _0xff49=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','update','delete','/:id','destroy','multer','util'];(function(_0x399bb7,_0x1c3d60){var _0x143661=function(_0x20426f){while(--_0x20426f){_0x399bb7['push'](_0x399bb7['shift']());}};_0x143661(++_0x1c3d60);}(_0xff49,0x166));var _0x9ff4=function(_0x23e6bb,_0x5c2d69){_0x23e6bb=_0x23e6bb-0x0;var _0x1e3b4c=_0xff49[_0x23e6bb];return _0x1e3b4c;};'use strict';var multer=require(_0x9ff4('0x0'));var util=require(_0x9ff4('0x1'));var path=require(_0x9ff4('0x2'));var timeout=require(_0x9ff4('0x3'));var express=require(_0x9ff4('0x4'));var router=express[_0x9ff4('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9ff4('0x6'));var config=require(_0x9ff4('0x7'));var controller=require('./analyticTreeReport.controller');router[_0x9ff4('0x8')]('/',auth[_0x9ff4('0x9')](),controller[_0x9ff4('0xa')]);router[_0x9ff4('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x9ff4('0xb')]);router[_0x9ff4('0xc')]('/',auth['isAuthenticated'](),controller[_0x9ff4('0xd')]);router['put']('/:id',auth[_0x9ff4('0x9')](),controller[_0x9ff4('0xe')]);router[_0x9ff4('0xf')](_0x9ff4('0x10'),auth[_0x9ff4('0x9')](),controller[_0x9ff4('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index a2aa8c0..a0b0517 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 _0x2621=['STRING','sequelize','exports'];(function(_0x5b3544,_0x4f679d){var _0x5d9a5a=function(_0x426cba){while(--_0x426cba){_0x5b3544['push'](_0x5b3544['shift']());}};_0x5d9a5a(++_0x4f679d);}(_0x2621,0x1d2));var _0x1262=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2621[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x1262('0x0'));module[_0x1262('0x1')]={'name':{'type':Sequelize[_0x1262('0x2')]},'basename':{'type':Sequelize[_0x1262('0x2')]},'type':{'type':Sequelize[_0x1262('0x2')]}};
\ No newline at end of file
+var _0xe57e=['sequelize','STRING'];(function(_0x439891,_0x23b4bf){var _0x3d4d4f=function(_0x3892a4){while(--_0x3892a4){_0x439891['push'](_0x439891['shift']());}};_0x3d4d4f(++_0x23b4bf);}(_0xe57e,0xf2));var _0xee57=function(_0x4249fe,_0x220376){_0x4249fe=_0x4249fe-0x0;var _0x1963f6=_0xe57e[_0x4249fe];return _0x1963f6;};'use strict';var Sequelize=require(_0xee57('0x0'));module['exports']={'name':{'type':Sequelize[_0xee57('0x1')]},'basename':{'type':Sequelize[_0xee57('0x1')]},'type':{'type':Sequelize[_0xee57('0x1')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index d1333ba..a23753a 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 _0x7c80=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','save','then','destroy','error','name','send','map','Attachment','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','length','find','clone','omit','createdAt','updatedAt','body','create','originalname','basename','file','filename','mimetype','findOne','server/files/attachments/','join','offline-chat/','download','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra'];(function(_0x40bb0c,_0x1ebe98){var _0x58cb62=function(_0x3db876){while(--_0x3db876){_0x40bb0c['push'](_0x40bb0c['shift']());}};_0x58cb62(++_0x1ebe98);}(_0x7c80,0x14e));var _0x07c8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7c80[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x07c8('0x0'));var rimraf=require(_0x07c8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x07c8('0x2'));var rp=require(_0x07c8('0x3'));var moment=require(_0x07c8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x07c8('0x5'));var util=require('util');var path=require(_0x07c8('0x6'));var sox=require('sox');var csv=require(_0x07c8('0x7'));var ejs=require(_0x07c8('0x8'));var fs=require('fs');var fs_extra=require(_0x07c8('0x9'));var _=require('lodash');var squel=require(_0x07c8('0xa'));var crypto=require(_0x07c8('0xb'));var jsforce=require(_0x07c8('0xc'));var deskjs=require(_0x07c8('0xd'));var toCsv=require(_0x07c8('0x7'));var querystring=require(_0x07c8('0xe'));var Papa=require(_0x07c8('0xf'));var Redis=require(_0x07c8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x07c8('0x11'));var as=require(_0x07c8('0x12'));var hardwareService=require(_0x07c8('0x13'));var logger=require(_0x07c8('0x14'))(_0x07c8('0x15'));var utils=require('../../config/utils');var config=require(_0x07c8('0x16'));var licenseUtil=require(_0x07c8('0x17'));var db=require(_0x07c8('0x18'))['db'];function respondWithStatusCode(_0x4ce310,_0x442229){_0x442229=_0x442229||0xcc;return function(_0x80a74d){if(_0x80a74d){return _0x4ce310[_0x07c8('0x19')](_0x442229);}return _0x4ce310[_0x07c8('0x1a')](_0x442229)[_0x07c8('0x1b')]();};}function respondWithResult(_0x533550,_0x2e7541){_0x2e7541=_0x2e7541||0xc8;return function(_0xc0c5d3){if(_0xc0c5d3){return _0x533550[_0x07c8('0x1a')](_0x2e7541)[_0x07c8('0x1c')](_0xc0c5d3);}};}function respondWithFilteredResult(_0x19fcb2,_0x45f25b){return function(_0x159a86){if(_0x159a86){var _0x1c0653=typeof _0x45f25b[_0x07c8('0x1d')]===_0x07c8('0x1e')&&typeof _0x45f25b['limit']===_0x07c8('0x1e');var _0x1065cd=_0x159a86[_0x07c8('0x1f')];var _0x2f08f0=_0x1c0653?0x0:_0x45f25b[_0x07c8('0x1d')];var _0x13385d=_0x1c0653?_0x159a86['count']:_0x45f25b[_0x07c8('0x1d')]+_0x45f25b[_0x07c8('0x20')];var _0x3de4cb;if(_0x13385d>=_0x1065cd){_0x13385d=_0x1065cd;_0x3de4cb=0xc8;}else{_0x3de4cb=0xce;}_0x19fcb2[_0x07c8('0x1a')](_0x3de4cb);return _0x19fcb2[_0x07c8('0x21')](_0x07c8('0x22'),_0x2f08f0+'-'+_0x13385d+'/'+_0x1065cd)[_0x07c8('0x1c')](_0x159a86);}return null;};}function patchUpdates(_0x3d534a){return function(_0x400666){try{jsonpatch['apply'](_0x400666,_0x3d534a,!![]);}catch(_0x3af11c){return BPromise['reject'](_0x3af11c);}return _0x400666[_0x07c8('0x23')]();};}function saveUpdates(_0x351b03,_0x3400bb){return function(_0x30f957){if(_0x30f957){return _0x30f957['update'](_0x351b03)[_0x07c8('0x24')](function(_0x5637ef){return _0x5637ef;});}return null;};}function removeEntity(_0x5980d5,_0x3dd448){return function(_0xef80a2){if(_0xef80a2){return _0xef80a2[_0x07c8('0x25')]()['then'](function(){_0x5980d5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x223801,_0x141619){return function(_0x1a9db0){if(!_0x1a9db0){_0x223801[_0x07c8('0x19')](0x194);}return _0x1a9db0;};}function handleError(_0x44a1bd,_0x3fa970){_0x3fa970=_0x3fa970||0x1f4;return function(_0x1bfc95){logger[_0x07c8('0x26')](_0x1bfc95['stack']);if(_0x1bfc95[_0x07c8('0x27')]){delete _0x1bfc95[_0x07c8('0x27')];}_0x44a1bd[_0x07c8('0x1a')](_0x3fa970)[_0x07c8('0x28')](_0x1bfc95);};}exports['index']=function(_0x3f50e8,_0x3ec698){var _0x5a47dc={},_0x4492e6={},_0xfa9299={'count':0x0,'rows':[]};var _0x5aeefc=_[_0x07c8('0x29')](db[_0x07c8('0x2a')][_0x07c8('0x2b')],function(_0x4ecd7c){return{'name':_0x4ecd7c[_0x07c8('0x2c')],'type':_0x4ecd7c[_0x07c8('0x2d')][_0x07c8('0x2e')]};});_0x4492e6[_0x07c8('0x2f')]=_[_0x07c8('0x29')](_0x5aeefc,'name');_0x4492e6[_0x07c8('0x30')]=_[_0x07c8('0x31')](_0x3f50e8['query']);_0x4492e6[_0x07c8('0x32')]=_[_0x07c8('0x33')](_0x4492e6[_0x07c8('0x2f')],_0x4492e6['query']);_0x5a47dc[_0x07c8('0x34')]=_['intersection'](_0x4492e6[_0x07c8('0x2f')],qs['fields'](_0x3f50e8['query'][_0x07c8('0x35')]));_0x5a47dc[_0x07c8('0x34')]=_0x5a47dc[_0x07c8('0x34')]['length']?_0x5a47dc['attributes']:_0x4492e6[_0x07c8('0x2f')];if(!_0x3f50e8[_0x07c8('0x30')][_0x07c8('0x36')](_0x07c8('0x37'))){_0x5a47dc[_0x07c8('0x20')]=qs[_0x07c8('0x20')](_0x3f50e8['query'][_0x07c8('0x20')]);_0x5a47dc['offset']=qs['offset'](_0x3f50e8[_0x07c8('0x30')][_0x07c8('0x1d')]);}_0x5a47dc[_0x07c8('0x38')]=qs['sort'](_0x3f50e8[_0x07c8('0x30')]['sort']);_0x5a47dc[_0x07c8('0x39')]=qs[_0x07c8('0x32')](_[_0x07c8('0x3a')](_0x3f50e8[_0x07c8('0x30')],_0x4492e6[_0x07c8('0x32')]),_0x5aeefc);if(_0x3f50e8[_0x07c8('0x30')][_0x07c8('0x3b')]){_0x5a47dc[_0x07c8('0x39')]=_[_0x07c8('0x3c')](_0x5a47dc[_0x07c8('0x39')],{'$or':_['map'](_0x5aeefc,function(_0x15c8f5){if(_0x15c8f5[_0x07c8('0x2d')]!=='VIRTUAL'){var _0x20ee95={};_0x20ee95[_0x15c8f5[_0x07c8('0x27')]]={'$like':'%'+_0x3f50e8[_0x07c8('0x30')][_0x07c8('0x3b')]+'%'};return _0x20ee95;}})});}_0x5a47dc=_[_0x07c8('0x3c')]({},_0x5a47dc,_0x3f50e8[_0x07c8('0x3d')]);var _0x186c25={'where':_0x5a47dc['where']};return db['Attachment'][_0x07c8('0x1f')](_0x186c25)[_0x07c8('0x24')](function(_0x13bf3c){_0xfa9299[_0x07c8('0x1f')]=_0x13bf3c;if(_0x3f50e8['query'][_0x07c8('0x3e')]){_0x5a47dc[_0x07c8('0x3f')]=[{'all':!![]}];}return db[_0x07c8('0x2a')][_0x07c8('0x40')](_0x5a47dc);})[_0x07c8('0x24')](function(_0x27c482){_0xfa9299['rows']=_0x27c482;return _0xfa9299;})['then'](respondWithFilteredResult(_0x3ec698,_0x5a47dc))[_0x07c8('0x41')](handleError(_0x3ec698,null));};exports[_0x07c8('0x42')]=function(_0x1acb34,_0xa8736f){var _0x1543ba={'raw':!![],'where':{'id':_0x1acb34[_0x07c8('0x43')]['id']}},_0x432ce2={};_0x432ce2[_0x07c8('0x2f')]=_[_0x07c8('0x31')](db['Attachment']['rawAttributes']);_0x432ce2[_0x07c8('0x30')]=_[_0x07c8('0x31')](_0x1acb34['query']);_0x432ce2['filters']=_[_0x07c8('0x33')](_0x432ce2['model'],_0x432ce2[_0x07c8('0x30')]);_0x1543ba[_0x07c8('0x34')]=_[_0x07c8('0x33')](_0x432ce2['model'],qs[_0x07c8('0x35')](_0x1acb34[_0x07c8('0x30')]['fields']));_0x1543ba[_0x07c8('0x34')]=_0x1543ba[_0x07c8('0x34')][_0x07c8('0x44')]?_0x1543ba[_0x07c8('0x34')]:_0x432ce2['model'];if(_0x1acb34['query'][_0x07c8('0x3e')]){_0x1543ba[_0x07c8('0x3f')]=[{'all':!![]}];}_0x1543ba=_[_0x07c8('0x3c')]({},_0x1543ba,_0x1acb34[_0x07c8('0x3d')]);return db[_0x07c8('0x2a')][_0x07c8('0x45')](_0x1543ba)[_0x07c8('0x24')](handleEntityNotFound(_0xa8736f,null))[_0x07c8('0x24')](respondWithResult(_0xa8736f,null))[_0x07c8('0x41')](handleError(_0xa8736f,null));};exports[_0x07c8('0x46')]=function(_0x1c27cf,_0x357165){var _0x5e9627={'where':{'id':_0x1c27cf['params']['id']}},_0x2dfff5={};_0x2dfff5[_0x07c8('0x2f')]=_[_0x07c8('0x31')](db[_0x07c8('0x2a')]['rawAttributes']);_0x5e9627[_0x07c8('0x34')]=_[_0x07c8('0x33')](_0x2dfff5['model'],qs[_0x07c8('0x35')](_0x1c27cf[_0x07c8('0x30')][_0x07c8('0x35')]));_0x5e9627[_0x07c8('0x34')]=_0x5e9627[_0x07c8('0x34')][_0x07c8('0x44')]?_0x5e9627[_0x07c8('0x34')]:_0x2dfff5[_0x07c8('0x2f')];if(_0x1c27cf[_0x07c8('0x30')]['includeAll']){_0x5e9627[_0x07c8('0x3f')]=[{'all':!![]}];}_0x5e9627=_['merge']({},_0x5e9627,_0x1c27cf[_0x07c8('0x3d')]);return db[_0x07c8('0x2a')][_0x07c8('0x45')](_0x5e9627)[_0x07c8('0x24')](handleEntityNotFound(_0x357165,null))[_0x07c8('0x24')](function(_0x2c0944){if(_0x2c0944){var _0x25cc71=_0x2c0944['get']({'plain':!![]});_0x25cc71=qs[_0x07c8('0x47')](_0x25cc71,['id',_0x07c8('0x48'),_0x07c8('0x49')]);_0x1c27cf[_0x07c8('0x4a')]=_[_0x07c8('0x47')](_0x1c27cf['body'],['id',_0x07c8('0x48'),_0x07c8('0x49')]);return db[_0x07c8('0x2a')][_0x07c8('0x4b')](_[_0x07c8('0x3c')](_0x25cc71,_0x1c27cf['body']),{'include':_0x1c27cf[_0x07c8('0x30')][_0x07c8('0x3e')]?[{'all':!![]}]:undefined});}})[_0x07c8('0x24')](respondWithResult(_0x357165,0xc9))['catch'](handleError(_0x357165,null));};exports['update']=function(_0x1e611a,_0x8b7c23){if(_0x1e611a[_0x07c8('0x4a')]['id']){delete _0x1e611a[_0x07c8('0x4a')]['id'];}return db['Attachment']['find']({'where':{'id':_0x1e611a[_0x07c8('0x43')]['id']}})['then'](handleEntityNotFound(_0x8b7c23,null))[_0x07c8('0x24')](saveUpdates(_0x1e611a['body'],null))[_0x07c8('0x24')](respondWithResult(_0x8b7c23,null))[_0x07c8('0x41')](handleError(_0x8b7c23,null));};exports['destroy']=function(_0x503cde,_0x144ca6){return db[_0x07c8('0x2a')][_0x07c8('0x45')]({'where':{'id':_0x503cde[_0x07c8('0x43')]['id']}})['then'](handleEntityNotFound(_0x144ca6,null))[_0x07c8('0x24')](removeEntity(_0x144ca6,null))[_0x07c8('0x41')](handleError(_0x144ca6,null));};exports[_0x07c8('0x4b')]=function(_0x1960a1,_0x6599ca,_0x460130){_0x1960a1[_0x07c8('0x4a')][_0x07c8('0x27')]=_0x1960a1['file'][_0x07c8('0x4c')];_0x1960a1[_0x07c8('0x4a')][_0x07c8('0x4d')]=_0x1960a1[_0x07c8('0x4e')][_0x07c8('0x4f')];_0x1960a1['body'][_0x07c8('0x2d')]=_0x1960a1[_0x07c8('0x4e')][_0x07c8('0x50')];return db[_0x07c8('0x2a')]['create'](_0x1960a1['body'])['then'](respondWithResult(_0x6599ca,0xc9))[_0x07c8('0x41')](handleError(_0x6599ca,null));};exports['download']=function(_0x2bedf0,_0x5645e5,_0x55e1f7){return db['Attachment'][_0x07c8('0x51')]({'where':{'id':_0x2bedf0['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x5645e5,null))[_0x07c8('0x24')](function(_0x17036a){if(_0x17036a){var _0x37a0d2=_0x17036a['ChatOfflineMessageId']!==null;var _0x5f69c9=path['join'](config['root'],_0x07c8('0x52'));if(_0x37a0d2){_0x5f69c9=path[_0x07c8('0x53')](_0x5f69c9,_0x07c8('0x54'));}var _0x593cd0=path[_0x07c8('0x53')](_0x5f69c9,_0x17036a[_0x07c8('0x4d')]);return _0x5645e5[_0x07c8('0x55')](_0x593cd0);}})[_0x07c8('0x41')](handleError(_0x5645e5,null));};
\ No newline at end of file
+var _0x8a56=['desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','error','name','send','index','map','Attachment','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','params','find','options','get','omit','createdAt','body','updatedAt','create','originalname','file','filename','download','findOne','join','root','server/files/attachments/','basename','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0x8a56,0xa9));var _0x68a5=function(_0x2a276d,_0x482b0c){_0x2a276d=_0x2a276d-0x0;var _0x2914cd=_0x8a56[_0x2a276d];return _0x2914cd;};'use strict';var emlformat=require(_0x68a5('0x0'));var rimraf=require(_0x68a5('0x1'));var zipdir=require(_0x68a5('0x2'));var jsonpatch=require(_0x68a5('0x3'));var rp=require('request-promise');var moment=require(_0x68a5('0x4'));var BPromise=require(_0x68a5('0x5'));var Mustache=require(_0x68a5('0x6'));var util=require(_0x68a5('0x7'));var path=require(_0x68a5('0x8'));var sox=require(_0x68a5('0x9'));var csv=require('to-csv');var ejs=require(_0x68a5('0xa'));var fs=require('fs');var fs_extra=require(_0x68a5('0xb'));var _=require(_0x68a5('0xc'));var squel=require(_0x68a5('0xd'));var crypto=require(_0x68a5('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x68a5('0xf'));var toCsv=require(_0x68a5('0x10'));var querystring=require(_0x68a5('0x11'));var Papa=require(_0x68a5('0x12'));var Redis=require(_0x68a5('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x68a5('0x14'));var as=require(_0x68a5('0x15'));var hardwareService=require(_0x68a5('0x16'));var logger=require(_0x68a5('0x17'))('api');var utils=require(_0x68a5('0x18'));var config=require(_0x68a5('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x68a5('0x1a'))['db'];function respondWithStatusCode(_0x482ddb,_0x1de6a2){_0x1de6a2=_0x1de6a2||0xcc;return function(_0xb8b20d){if(_0xb8b20d){return _0x482ddb[_0x68a5('0x1b')](_0x1de6a2);}return _0x482ddb[_0x68a5('0x1c')](_0x1de6a2)[_0x68a5('0x1d')]();};}function respondWithResult(_0x4b7993,_0x291f90){_0x291f90=_0x291f90||0xc8;return function(_0x29387d){if(_0x29387d){return _0x4b7993['status'](_0x291f90)[_0x68a5('0x1e')](_0x29387d);}};}function respondWithFilteredResult(_0x4a0d60,_0x38279a){return function(_0x2c795b){if(_0x2c795b){var _0x364c02=typeof _0x38279a[_0x68a5('0x1f')]==='undefined'&&typeof _0x38279a[_0x68a5('0x20')]===_0x68a5('0x21');var _0x150245=_0x2c795b[_0x68a5('0x22')];var _0x1cf20d=_0x364c02?0x0:_0x38279a[_0x68a5('0x1f')];var _0x2cfc82=_0x364c02?_0x2c795b[_0x68a5('0x22')]:_0x38279a[_0x68a5('0x1f')]+_0x38279a[_0x68a5('0x20')];var _0x220ff7;if(_0x2cfc82>=_0x150245){_0x2cfc82=_0x150245;_0x220ff7=0xc8;}else{_0x220ff7=0xce;}_0x4a0d60[_0x68a5('0x1c')](_0x220ff7);return _0x4a0d60[_0x68a5('0x23')](_0x68a5('0x24'),_0x1cf20d+'-'+_0x2cfc82+'/'+_0x150245)[_0x68a5('0x1e')](_0x2c795b);}return null;};}function patchUpdates(_0x47adc3){return function(_0xca5ad){try{jsonpatch[_0x68a5('0x25')](_0xca5ad,_0x47adc3,!![]);}catch(_0x2bf534){return BPromise[_0x68a5('0x26')](_0x2bf534);}return _0xca5ad[_0x68a5('0x27')]();};}function saveUpdates(_0xe8065a,_0x4cf8f7){return function(_0x310dfd){if(_0x310dfd){return _0x310dfd[_0x68a5('0x28')](_0xe8065a)['then'](function(_0x3df2ef){return _0x3df2ef;});}return null;};}function removeEntity(_0xee7858,_0x223a1b){return function(_0x4d71d0){if(_0x4d71d0){return _0x4d71d0[_0x68a5('0x29')]()[_0x68a5('0x2a')](function(){_0xee7858['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a0c7f,_0x5fb8ee){return function(_0xffcb4){if(!_0xffcb4){_0x5a0c7f['sendStatus'](0x194);}return _0xffcb4;};}function handleError(_0x1fddae,_0x2049ea){_0x2049ea=_0x2049ea||0x1f4;return function(_0x3c094e){logger[_0x68a5('0x2b')](_0x3c094e['stack']);if(_0x3c094e[_0x68a5('0x2c')]){delete _0x3c094e[_0x68a5('0x2c')];}_0x1fddae[_0x68a5('0x1c')](_0x2049ea)[_0x68a5('0x2d')](_0x3c094e);};}exports[_0x68a5('0x2e')]=function(_0x5078ee,_0x2fc979){var _0x54bdb4={},_0x71f297={},_0xe29988={'count':0x0,'rows':[]};var _0x315a93=_[_0x68a5('0x2f')](db[_0x68a5('0x30')][_0x68a5('0x31')],function(_0x22fdd2){return{'name':_0x22fdd2[_0x68a5('0x32')],'type':_0x22fdd2[_0x68a5('0x33')][_0x68a5('0x34')]};});_0x71f297[_0x68a5('0x35')]=_['map'](_0x315a93,_0x68a5('0x2c'));_0x71f297[_0x68a5('0x36')]=_[_0x68a5('0x37')](_0x5078ee[_0x68a5('0x36')]);_0x71f297[_0x68a5('0x38')]=_['intersection'](_0x71f297['model'],_0x71f297['query']);_0x54bdb4[_0x68a5('0x39')]=_[_0x68a5('0x3a')](_0x71f297['model'],qs[_0x68a5('0x3b')](_0x5078ee[_0x68a5('0x36')]['fields']));_0x54bdb4[_0x68a5('0x39')]=_0x54bdb4[_0x68a5('0x39')][_0x68a5('0x3c')]?_0x54bdb4[_0x68a5('0x39')]:_0x71f297[_0x68a5('0x35')];if(!_0x5078ee['query'][_0x68a5('0x3d')](_0x68a5('0x3e'))){_0x54bdb4[_0x68a5('0x20')]=qs[_0x68a5('0x20')](_0x5078ee['query'][_0x68a5('0x20')]);_0x54bdb4[_0x68a5('0x1f')]=qs[_0x68a5('0x1f')](_0x5078ee['query']['offset']);}_0x54bdb4[_0x68a5('0x3f')]=qs[_0x68a5('0x40')](_0x5078ee[_0x68a5('0x36')][_0x68a5('0x40')]);_0x54bdb4[_0x68a5('0x41')]=qs[_0x68a5('0x38')](_[_0x68a5('0x42')](_0x5078ee[_0x68a5('0x36')],_0x71f297[_0x68a5('0x38')]),_0x315a93);if(_0x5078ee['query'][_0x68a5('0x43')]){_0x54bdb4['where']=_['merge'](_0x54bdb4[_0x68a5('0x41')],{'$or':_['map'](_0x315a93,function(_0xfb6c0d){if(_0xfb6c0d[_0x68a5('0x33')]!=='VIRTUAL'){var _0x345145={};_0x345145[_0xfb6c0d[_0x68a5('0x2c')]]={'$like':'%'+_0x5078ee[_0x68a5('0x36')][_0x68a5('0x43')]+'%'};return _0x345145;}})});}_0x54bdb4=_[_0x68a5('0x44')]({},_0x54bdb4,_0x5078ee['options']);var _0x5eee16={'where':_0x54bdb4[_0x68a5('0x41')]};return db[_0x68a5('0x30')][_0x68a5('0x22')](_0x5eee16)[_0x68a5('0x2a')](function(_0x12fb9f){_0xe29988['count']=_0x12fb9f;if(_0x5078ee[_0x68a5('0x36')][_0x68a5('0x45')]){_0x54bdb4[_0x68a5('0x46')]=[{'all':!![]}];}return db[_0x68a5('0x30')][_0x68a5('0x47')](_0x54bdb4);})['then'](function(_0x5a5b4c){_0xe29988[_0x68a5('0x48')]=_0x5a5b4c;return _0xe29988;})[_0x68a5('0x2a')](respondWithFilteredResult(_0x2fc979,_0x54bdb4))[_0x68a5('0x49')](handleError(_0x2fc979,null));};exports['show']=function(_0x1c0002,_0x3e6c73){var _0x16178f={'raw':!![],'where':{'id':_0x1c0002[_0x68a5('0x4a')]['id']}},_0x4266fe={};_0x4266fe[_0x68a5('0x35')]=_['keys'](db[_0x68a5('0x30')][_0x68a5('0x31')]);_0x4266fe[_0x68a5('0x36')]=_[_0x68a5('0x37')](_0x1c0002['query']);_0x4266fe[_0x68a5('0x38')]=_[_0x68a5('0x3a')](_0x4266fe[_0x68a5('0x35')],_0x4266fe[_0x68a5('0x36')]);_0x16178f[_0x68a5('0x39')]=_[_0x68a5('0x3a')](_0x4266fe[_0x68a5('0x35')],qs[_0x68a5('0x3b')](_0x1c0002[_0x68a5('0x36')][_0x68a5('0x3b')]));_0x16178f[_0x68a5('0x39')]=_0x16178f[_0x68a5('0x39')][_0x68a5('0x3c')]?_0x16178f['attributes']:_0x4266fe[_0x68a5('0x35')];if(_0x1c0002[_0x68a5('0x36')][_0x68a5('0x45')]){_0x16178f[_0x68a5('0x46')]=[{'all':!![]}];}_0x16178f=_[_0x68a5('0x44')]({},_0x16178f,_0x1c0002['options']);return db[_0x68a5('0x30')][_0x68a5('0x4b')](_0x16178f)[_0x68a5('0x2a')](handleEntityNotFound(_0x3e6c73,null))[_0x68a5('0x2a')](respondWithResult(_0x3e6c73,null))[_0x68a5('0x49')](handleError(_0x3e6c73,null));};exports['clone']=function(_0x4f18b4,_0x1ac394){var _0x44b2f5={'where':{'id':_0x4f18b4['params']['id']}},_0x1b6b58={};_0x1b6b58[_0x68a5('0x35')]=_[_0x68a5('0x37')](db[_0x68a5('0x30')][_0x68a5('0x31')]);_0x44b2f5[_0x68a5('0x39')]=_[_0x68a5('0x3a')](_0x1b6b58['model'],qs[_0x68a5('0x3b')](_0x4f18b4['query'][_0x68a5('0x3b')]));_0x44b2f5['attributes']=_0x44b2f5['attributes'][_0x68a5('0x3c')]?_0x44b2f5[_0x68a5('0x39')]:_0x1b6b58[_0x68a5('0x35')];if(_0x4f18b4[_0x68a5('0x36')]['includeAll']){_0x44b2f5['include']=[{'all':!![]}];}_0x44b2f5=_[_0x68a5('0x44')]({},_0x44b2f5,_0x4f18b4[_0x68a5('0x4c')]);return db['Attachment']['find'](_0x44b2f5)[_0x68a5('0x2a')](handleEntityNotFound(_0x1ac394,null))['then'](function(_0x16a555){if(_0x16a555){var _0x4ee585=_0x16a555[_0x68a5('0x4d')]({'plain':!![]});_0x4ee585=qs[_0x68a5('0x4e')](_0x4ee585,['id',_0x68a5('0x4f'),'updatedAt']);_0x4f18b4[_0x68a5('0x50')]=_[_0x68a5('0x4e')](_0x4f18b4[_0x68a5('0x50')],['id','createdAt',_0x68a5('0x51')]);return db[_0x68a5('0x30')][_0x68a5('0x52')](_[_0x68a5('0x44')](_0x4ee585,_0x4f18b4['body']),{'include':_0x4f18b4[_0x68a5('0x36')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x68a5('0x2a')](respondWithResult(_0x1ac394,0xc9))[_0x68a5('0x49')](handleError(_0x1ac394,null));};exports[_0x68a5('0x28')]=function(_0x275b3c,_0x2ed13f){if(_0x275b3c[_0x68a5('0x50')]['id']){delete _0x275b3c['body']['id'];}return db[_0x68a5('0x30')][_0x68a5('0x4b')]({'where':{'id':_0x275b3c[_0x68a5('0x4a')]['id']}})[_0x68a5('0x2a')](handleEntityNotFound(_0x2ed13f,null))['then'](saveUpdates(_0x275b3c[_0x68a5('0x50')],null))[_0x68a5('0x2a')](respondWithResult(_0x2ed13f,null))[_0x68a5('0x49')](handleError(_0x2ed13f,null));};exports[_0x68a5('0x29')]=function(_0xc4fb9d,_0x410eb6){return db['Attachment']['find']({'where':{'id':_0xc4fb9d[_0x68a5('0x4a')]['id']}})['then'](handleEntityNotFound(_0x410eb6,null))[_0x68a5('0x2a')](removeEntity(_0x410eb6,null))[_0x68a5('0x49')](handleError(_0x410eb6,null));};exports[_0x68a5('0x52')]=function(_0x5211da,_0x17c1b1,_0x6ace5c){_0x5211da['body'][_0x68a5('0x2c')]=_0x5211da['file'][_0x68a5('0x53')];_0x5211da[_0x68a5('0x50')]['basename']=_0x5211da[_0x68a5('0x54')][_0x68a5('0x55')];_0x5211da['body'][_0x68a5('0x33')]=_0x5211da['file']['mimetype'];return db[_0x68a5('0x30')][_0x68a5('0x52')](_0x5211da['body'])[_0x68a5('0x2a')](respondWithResult(_0x17c1b1,0xc9))[_0x68a5('0x49')](handleError(_0x17c1b1,null));};exports[_0x68a5('0x56')]=function(_0x10466d,_0xe1ebf6,_0x42dfb4){return db[_0x68a5('0x30')][_0x68a5('0x57')]({'where':{'id':_0x10466d['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0xe1ebf6,null))[_0x68a5('0x2a')](function(_0x11d02c){if(_0x11d02c){var _0x5446db=_0x11d02c['ChatOfflineMessageId']!==null;var _0x3e143c=path[_0x68a5('0x58')](config[_0x68a5('0x59')],_0x68a5('0x5a'));if(_0x5446db){_0x3e143c=path[_0x68a5('0x58')](_0x3e143c,'offline-chat/');}var _0x23b3f8=path[_0x68a5('0x58')](_0x3e143c,_0x11d02c[_0x68a5('0x5b')]);return _0xe1ebf6[_0x68a5('0x56')](_0x23b3f8);}})[_0x68a5('0x49')](handleError(_0xe1ebf6,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 89dae28..651ba71 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 _0x3d09=['bluebird','request-promise','rimraf','./attachment.attributes','exports','define','Attachment','attachments','lodash','util'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x3d09,0x116));var _0x93d0=function(_0x2c942b,_0x12ff28){_0x2c942b=_0x2c942b-0x0;var _0x1a5484=_0x3d09[_0x2c942b];return _0x1a5484;};'use strict';var _=require(_0x93d0('0x0'));var util=require(_0x93d0('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x93d0('0x2'));var rp=require(_0x93d0('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x93d0('0x4'));var config=require('../../config/environment');var attributes=require(_0x93d0('0x5'));module[_0x93d0('0x6')]=function(_0x4af8fe,_0xf0ef4c){return _0x4af8fe[_0x93d0('0x7')](_0x93d0('0x8'),attributes,{'tableName':_0x93d0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0bfb=['bluebird','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash','util','../../config/logger','api','moment'];(function(_0x323d87,_0x4ef3f9){var _0x5e8f74=function(_0x185735){while(--_0x185735){_0x323d87['push'](_0x323d87['shift']());}};_0x5e8f74(++_0x4ef3f9);}(_0x0bfb,0x1c2));var _0xb0bf=function(_0x19aa96,_0x344462){_0x19aa96=_0x19aa96-0x0;var _0x4ae3b5=_0x0bfb[_0x19aa96];return _0x4ae3b5;};'use strict';var _=require(_0xb0bf('0x0'));var util=require(_0xb0bf('0x1'));var logger=require(_0xb0bf('0x2'))(_0xb0bf('0x3'));var moment=require(_0xb0bf('0x4'));var BPromise=require(_0xb0bf('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb0bf('0x6'));var config=require(_0xb0bf('0x7'));var attributes=require(_0xb0bf('0x8'));module[_0xb0bf('0x9')]=function(_0x1f6d1c,_0x446bab){return _0x1f6d1c[_0xb0bf('0xa')](_0xb0bf('0xb'),attributes,{'tableName':_0xb0bf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index a9911c7..3493ceb 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 _0x544a=['lodash','util','moment','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateAttachment','Attachment','create','options','raw','then','stringify','catch'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x544a,0xbd));var _0xa544=function(_0x416283,_0x439386){_0x416283=_0x416283-0x0;var _0x49c256=_0x544a[_0x416283];return _0x49c256;};'use strict';var _=require(_0xa544('0x0'));var util=require(_0xa544('0x1'));var moment=require(_0xa544('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa544('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa544('0x4'));var logger=require(_0xa544('0x5'))('rpc');var config=require(_0xa544('0x6'));var jayson=require(_0xa544('0x7'));var client=jayson[_0xa544('0x8')][_0xa544('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x39caac,_0x543cd1,_0x407443){return new BPromise(function(_0x495819,_0x39bcd7){return client[_0xa544('0xa')](_0x39caac,_0x407443)['then'](function(_0x2e9a6a){logger[_0xa544('0xb')](_0xa544('0xc'),_0x543cd1,_0xa544('0xd'));logger['debug'](_0xa544('0xe'),_0x543cd1,_0xa544('0xd'),JSON['stringify'](_0x2e9a6a));if(_0x2e9a6a[_0xa544('0xf')]){if(_0x2e9a6a['error'][_0xa544('0x10')]===0x1f4){logger[_0xa544('0xf')]('Attachment,\x20%s,\x20%s',_0x543cd1,_0x2e9a6a[_0xa544('0xf')][_0xa544('0x11')]);return _0x39bcd7(_0x2e9a6a[_0xa544('0xf')][_0xa544('0x11')]);}logger[_0xa544('0xf')](_0xa544('0xc'),_0x543cd1,_0x2e9a6a[_0xa544('0xf')][_0xa544('0x11')]);return _0x495819(_0x2e9a6a[_0xa544('0xf')][_0xa544('0x11')]);}else{logger[_0xa544('0xb')](_0xa544('0xc'),_0x543cd1,'request\x20sent');_0x495819(_0x2e9a6a[_0xa544('0x12')][_0xa544('0x11')]);}})['catch'](function(_0x9093bd){logger[_0xa544('0xf')](_0xa544('0xc'),_0x543cd1,_0x9093bd);_0x39bcd7(_0x9093bd);});});}exports[_0xa544('0x13')]=function(_0x2c5ae8){var _0x297298=this;return new Promise(function(_0x1f3fcc,_0x44ccd3){return db[_0xa544('0x14')][_0xa544('0x15')](_0x2c5ae8['body'],{'raw':_0x2c5ae8['options']?_0x2c5ae8[_0xa544('0x16')][_0xa544('0x17')]===undefined?!![]:![]:!![]})[_0xa544('0x18')](function(_0x57a154){logger[_0xa544('0xb')](_0xa544('0x13'),_0x2c5ae8);logger['debug'](_0xa544('0x13'),_0x2c5ae8,JSON[_0xa544('0x19')](_0x57a154));_0x1f3fcc(_0x57a154);})[_0xa544('0x1a')](function(_0xb7df3d){logger[_0xa544('0xf')]('CreateAttachment',_0xb7df3d['message'],_0x2c5ae8);_0x44ccd3(_0x297298[_0xa544('0xf')](0x1f4,_0xb7df3d['message']));});});};
\ No newline at end of file
+var _0xfe57=['error','code','Attachment,\x20%s,\x20%s','message','result','catch','CreateAttachment','Attachment','create','body','options','info','stringify','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug'];(function(_0xb7988b,_0x16b8c3){var _0x497057=function(_0x286bca){while(--_0x286bca){_0xb7988b['push'](_0xb7988b['shift']());}};_0x497057(++_0x16b8c3);}(_0xfe57,0x195));var _0x7fe5=function(_0x44216d,_0x4938a7){_0x44216d=_0x44216d-0x0;var _0xeca523=_0xfe57[_0x44216d];return _0xeca523;};'use strict';var _=require(_0x7fe5('0x0'));var util=require(_0x7fe5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7fe5('0x2'));var fs=require('fs');var Redis=require(_0x7fe5('0x3'));var db=require(_0x7fe5('0x4'))['db'];var utils=require(_0x7fe5('0x5'));var logger=require(_0x7fe5('0x6'))(_0x7fe5('0x7'));var config=require(_0x7fe5('0x8'));var jayson=require(_0x7fe5('0x9'));var client=jayson[_0x7fe5('0xa')][_0x7fe5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xd6146b,_0x2632de,_0x36ff81){return new BPromise(function(_0x4ab081,_0x13b391){return client['request'](_0xd6146b,_0x36ff81)[_0x7fe5('0xc')](function(_0x2ae7f3){logger['info']('Attachment,\x20%s,\x20%s',_0x2632de,_0x7fe5('0xd'));logger[_0x7fe5('0xe')]('Attachment,\x20%s,\x20%s,\x20%s',_0x2632de,_0x7fe5('0xd'),JSON['stringify'](_0x2ae7f3));if(_0x2ae7f3['error']){if(_0x2ae7f3[_0x7fe5('0xf')][_0x7fe5('0x10')]===0x1f4){logger[_0x7fe5('0xf')](_0x7fe5('0x11'),_0x2632de,_0x2ae7f3['error'][_0x7fe5('0x12')]);return _0x13b391(_0x2ae7f3[_0x7fe5('0xf')]['message']);}logger[_0x7fe5('0xf')]('Attachment,\x20%s,\x20%s',_0x2632de,_0x2ae7f3[_0x7fe5('0xf')][_0x7fe5('0x12')]);return _0x4ab081(_0x2ae7f3['error'][_0x7fe5('0x12')]);}else{logger['info'](_0x7fe5('0x11'),_0x2632de,_0x7fe5('0xd'));_0x4ab081(_0x2ae7f3[_0x7fe5('0x13')][_0x7fe5('0x12')]);}})[_0x7fe5('0x14')](function(_0x104bc8){logger['error'](_0x7fe5('0x11'),_0x2632de,_0x104bc8);_0x13b391(_0x104bc8);});});}exports[_0x7fe5('0x15')]=function(_0x340d5e){var _0x1be963=this;return new Promise(function(_0x2533db,_0x9a3022){return db[_0x7fe5('0x16')][_0x7fe5('0x17')](_0x340d5e[_0x7fe5('0x18')],{'raw':_0x340d5e[_0x7fe5('0x19')]?_0x340d5e['options']['raw']===undefined?!![]:![]:!![]})[_0x7fe5('0xc')](function(_0x459c2d){logger[_0x7fe5('0x1a')](_0x7fe5('0x15'),_0x340d5e);logger[_0x7fe5('0xe')](_0x7fe5('0x15'),_0x340d5e,JSON[_0x7fe5('0x1b')](_0x459c2d));_0x2533db(_0x459c2d);})[_0x7fe5('0x14')](function(_0x1b271c){logger[_0x7fe5('0xf')](_0x7fe5('0x15'),_0x1b271c[_0x7fe5('0x12')],_0x340d5e);_0x9a3022(_0x1be963['error'](0x1f4,_0x1b271c[_0x7fe5('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 188a92c..841edfc 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 _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3daa8c,_0x388a87){_0x3daa8c=_0x3daa8c-0x0;var _0x2b1bd7=_0x0b0e[_0x3daa8c];return _0x2b1bd7;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=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(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb28,0x106));var _0x8db2=function(_0x467f93,_0x17f986){_0x467f93=_0x467f93-0x0;var _0x5614d4=_0xdb28[_0x467f93];return _0x5614d4;};'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 9533329..026a680 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 _0x9208=['url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Setting','findOne','blockDuration','then','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','disabled','online','admin','blocked','blockedAt','add','clearBlockUser','getLicense','catch','status','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','use','User','passport','passport-local','moment','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/logger','api','activedirectory','undefined','baseDN'];(function(_0x2fea0b,_0x1427b2){var _0x80f5ec=function(_0x3070c2){while(--_0x3070c2){_0x2fea0b['push'](_0x2fea0b['shift']());}};_0x80f5ec(++_0x1427b2);}(_0x9208,0x108));var _0x8920=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9208[_0x20a584];return _0x4b41a8;};'use strict';var passport=require(_0x8920('0x0'));var LocalStrategy=require(_0x8920('0x1'))['Strategy'];var moment=require(_0x8920('0x2'));var ActiveDirectory=require('activedirectory2');var BPromise=require('bluebird');var util=require(_0x8920('0x3'));var db=require(_0x8920('0x4'))['db'];var authService=require(_0x8920('0x5'));var utils=require(_0x8920('0x6'));var config=require('../../config/environment');var logger=require(_0x8920('0x7'))(_0x8920('0x8'));function isActiveDirectoryConfigured(_0x194026){var _0x54eb58=![];if(typeof _0x194026[_0x8920('0x9')]!==_0x8920('0xa')){_0x54eb58=_0x194026[_0x8920('0x9')][_0x8920('0xb')]&&_0x194026[_0x8920('0x9')][_0x8920('0xc')]&&_0x194026[_0x8920('0x9')][_0x8920('0xd')];}return _0x54eb58;}function adAuthenticate(_0x5055aa,_0x2de879,_0xf815e){return new BPromise(function(_0x2fb0cb,_0x5dc0e2){try{var _0x4a5d3f=new ActiveDirectory(_0x5055aa);_0x4a5d3f[_0x8920('0xe')](_0x2de879,_0xf815e,function(_0x32dce0,_0x4ed3d2){if(_0x32dce0){logger[_0x8920('0xf')](_0x8920('0x10'),_0x2de879,util['inspect'](_0x32dce0,{'showHidden':![],'depth':null}));_0x5dc0e2(_0x8920('0x11'));}else if(!_0x4ed3d2){logger['error'](_0x8920('0x12'),_0x2de879);_0x5dc0e2(_0x8920('0x11'));}else{_0x2fb0cb(_0x4ed3d2);}});}catch(_0x459d5b){_0x5dc0e2(_0x459d5b);}});}function ActiveDirectoryAuthenticate(_0x38c2ba,_0xbf51ed,_0x2a8816,_0x315434){var _0x131f9a,_0x2c7ab7;if(!isActiveDirectoryConfigured(config)){logger[_0x8920('0xf')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0xbf51ed);return _0x315434(null,![],{'message':_0x8920('0x11')});}return db[_0x8920('0x13')][_0x8920('0x14')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x8920('0x15')],'raw':!![]})[_0x8920('0x16')](function(_0x5cb40b){_0x131f9a=_0x5cb40b;if(!_0x131f9a[_0x8920('0x17')]){logger[_0x8920('0xf')](_0x8920('0x18'),_0xbf51ed);throw new Error(_0x8920('0x11'));}return _0x38c2ba[_0x8920('0x14')]({'attributes':['id',_0x8920('0x19'),_0x8920('0x1a'),_0x8920('0x1b'),_0x8920('0x1c'),_0x8920('0x1d'),'blocked','blockedAt',_0x8920('0x1e')],'where':{'name':_0xbf51ed,'role':{'$or':[_0x8920('0x1f'),'user','agent']},'adSsoEnabled':!![]}});})['then'](function(_0x11395e){if(!_0x11395e||_0x11395e&&_0x11395e[_0x8920('0x19')]!==_0xbf51ed){throw new Error(_0x8920('0x11'));}_0x2c7ab7=_0x11395e;var _0x307f52=_0x2c7ab7['name']+'@'+config[_0x8920('0x9')][_0x8920('0xd')];return adAuthenticate(config[_0x8920('0x9')],_0x307f52,_0x2a8816);})['then'](function(_0xfb4634){if(_0x2c7ab7[_0x8920('0x1d')]){throw new Error(_0x8920('0x11'));}if(_0x131f9a[_0x8920('0x15')]>0x0){if(_0x2c7ab7[_0x8920('0x20')]){if(moment(_0x2c7ab7[_0x8920('0x21')])[_0x8920('0x22')](_0x131f9a[_0x8920('0x15')],'minutes')>moment()){throw new Error(_0x8920('0x11'));}return utils[_0x8920('0x23')](_0x2c7ab7,0x0,![],null)['then'](function(){return utils['getLicense'](_0x2c7ab7);})[_0x8920('0x16')](function(){return _0x315434(null,_0x2c7ab7);});}else{return utils[_0x8920('0x24')](_0x2c7ab7)[_0x8920('0x16')](function(){return _0x315434(null,_0x2c7ab7);});}}else{return utils[_0x8920('0x24')](_0x2c7ab7)[_0x8920('0x16')](function(){return _0x315434(null,_0x2c7ab7);});}})[_0x8920('0x25')](function(_0x47407e){return _0x315434(null,![],_0x47407e);});}function handleError(_0x3e4e23,_0x2485d6,_0xc898b9){return _0x3e4e23[_0x8920('0x26')](_0x2485d6||0x1f4)['send']({'message':_0xc898b9?_0xc898b9[_0x8920('0x27')]||_0xc898b9:''});}exports[_0x8920('0x28')]=function(_0x4a294e,_0x53bf09,_0x5304b0){passport['authenticate'](_0x8920('0x29'),function(_0x5116fd,_0x3a5eea,_0x17b87e){var _0x409418=_0x5116fd||_0x17b87e;if(_0x409418){return handleError(_0x53bf09,0x191,_0x409418);}if(!_0x3a5eea){return handleError(_0x53bf09,0x194,{'message':_0x8920('0x2a')});}else{var _0x31506b={'payload':{'id':_0x3a5eea['id'],'role':_0x3a5eea[_0x8920('0x1c')]},'options':{'expiresIn':0x15180}};return authService[_0x8920('0x2b')](_0x31506b)[_0x8920('0x16')](function(_0x50ceca){_0x53bf09['json']({'id':_0x3a5eea['id'],'token':_0x50ceca,'statusCall':'','isAlreadyLogged':_0x3a5eea[_0x8920('0x1e')]});});}})(_0x4a294e,_0x53bf09,_0x5304b0);};passport[_0x8920('0x2c')](_0x8920('0x29'),new LocalStrategy({'usernameField':_0x8920('0x19'),'passwordField':_0x8920('0x1a')},function(_0x193aec,_0x4ec767,_0x1a7380){return ActiveDirectoryAuthenticate(db[_0x8920('0x2d')],_0x193aec,_0x4ec767,_0x1a7380);}));
\ No newline at end of file
+var _0x961e=['../../config/environment','../../config/logger','api','activedirectory','baseDN','url','domain','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','error','Setting','adSsoEnabled','blockDuration','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','name','password','role','blocked','blockedAt','admin','user','then','disabled','minutes','getLicense','catch','status','send','login','authenticate','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','ad-login','User','Strategy','moment','activedirectory2','bluebird','../../components/auth/service','../../config/utils'];(function(_0x53c901,_0x49a8fc){var _0x4d0abd=function(_0x1716a9){while(--_0x1716a9){_0x53c901['push'](_0x53c901['shift']());}};_0x4d0abd(++_0x49a8fc);}(_0x961e,0x1a8));var _0xe961=function(_0x5994a0,_0x5ea37c){_0x5994a0=_0x5994a0-0x0;var _0x310e32=_0x961e[_0x5994a0];return _0x310e32;};'use strict';var passport=require('passport');var LocalStrategy=require('passport-local')[_0xe961('0x0')];var moment=require(_0xe961('0x1'));var ActiveDirectory=require(_0xe961('0x2'));var BPromise=require(_0xe961('0x3'));var util=require('util');var db=require('../../mysqldb')['db'];var authService=require(_0xe961('0x4'));var utils=require(_0xe961('0x5'));var config=require(_0xe961('0x6'));var logger=require(_0xe961('0x7'))(_0xe961('0x8'));function isActiveDirectoryConfigured(_0x53b6f5){var _0x32c931=![];if(typeof _0x53b6f5[_0xe961('0x9')]!=='undefined'){_0x32c931=_0x53b6f5[_0xe961('0x9')][_0xe961('0xa')]&&_0x53b6f5[_0xe961('0x9')][_0xe961('0xb')]&&_0x53b6f5['activedirectory'][_0xe961('0xc')];}return _0x32c931;}function adAuthenticate(_0x27f893,_0x545d9b,_0xb706ff){return new BPromise(function(_0xe78f10,_0x5d408f){try{var _0x37a210=new ActiveDirectory(_0x27f893);_0x37a210['authenticate'](_0x545d9b,_0xb706ff,function(_0x288e9a,_0x217074){if(_0x288e9a){logger['error'](_0xe961('0xd'),_0x545d9b,util['inspect'](_0x288e9a,{'showHidden':![],'depth':null}));_0x5d408f(_0xe961('0xe'));}else if(!_0x217074){logger[_0xe961('0xf')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x545d9b);_0x5d408f('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0xe78f10(_0x217074);}});}catch(_0x446bde){_0x5d408f(_0x446bde);}});}function ActiveDirectoryAuthenticate(_0x367570,_0x45ed82,_0x39572e,_0x5a0c07){var _0x4d00f5,_0x59e1d6;if(!isActiveDirectoryConfigured(config)){logger['error']('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x45ed82);return _0x5a0c07(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0xe961('0x10')]['findOne']({'where':{'id':0x1},'attributes':[_0xe961('0x11'),_0xe961('0x12')],'raw':!![]})['then'](function(_0x55193a){_0x4d00f5=_0x55193a;if(!_0x4d00f5[_0xe961('0x11')]){logger[_0xe961('0xf')](_0xe961('0x13'),_0x45ed82);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x367570[_0xe961('0x14')]({'attributes':['id',_0xe961('0x15'),_0xe961('0x16'),'salt',_0xe961('0x17'),'disabled',_0xe961('0x18'),_0xe961('0x19'),'online'],'where':{'name':_0x45ed82,'role':{'$or':[_0xe961('0x1a'),_0xe961('0x1b'),'agent']},'adSsoEnabled':!![]}});})[_0xe961('0x1c')](function(_0x183e1b){if(!_0x183e1b||_0x183e1b&&_0x183e1b[_0xe961('0x15')]!==_0x45ed82){throw new Error(_0xe961('0xe'));}_0x59e1d6=_0x183e1b;var _0x11a177=_0x59e1d6[_0xe961('0x15')]+'@'+config[_0xe961('0x9')][_0xe961('0xc')];return adAuthenticate(config[_0xe961('0x9')],_0x11a177,_0x39572e);})[_0xe961('0x1c')](function(_0x1a321f){if(_0x59e1d6[_0xe961('0x1d')]){throw new Error(_0xe961('0xe'));}if(_0x4d00f5[_0xe961('0x12')]>0x0){if(_0x59e1d6['blocked']){if(moment(_0x59e1d6[_0xe961('0x19')])['add'](_0x4d00f5[_0xe961('0x12')],_0xe961('0x1e'))>moment()){throw new Error(_0xe961('0xe'));}return utils['clearBlockUser'](_0x59e1d6,0x0,![],null)[_0xe961('0x1c')](function(){return utils[_0xe961('0x1f')](_0x59e1d6);})[_0xe961('0x1c')](function(){return _0x5a0c07(null,_0x59e1d6);});}else{return utils[_0xe961('0x1f')](_0x59e1d6)[_0xe961('0x1c')](function(){return _0x5a0c07(null,_0x59e1d6);});}}else{return utils['getLicense'](_0x59e1d6)[_0xe961('0x1c')](function(){return _0x5a0c07(null,_0x59e1d6);});}})[_0xe961('0x20')](function(_0x4e290a){return _0x5a0c07(null,![],_0x4e290a);});}function handleError(_0x3566fe,_0x2a628b,_0x369bc0){return _0x3566fe[_0xe961('0x21')](_0x2a628b||0x1f4)[_0xe961('0x22')]({'message':_0x369bc0?_0x369bc0['message']||_0x369bc0:''});}exports[_0xe961('0x23')]=function(_0x361373,_0x5716f7,_0x191660){passport[_0xe961('0x24')]('ad-login',function(_0x33f720,_0x346e73,_0x494602){var _0x5c3c7b=_0x33f720||_0x494602;if(_0x5c3c7b){return handleError(_0x5716f7,0x191,_0x5c3c7b);}if(!_0x346e73){return handleError(_0x5716f7,0x194,{'message':_0xe961('0x25')});}else{var _0x15e691={'payload':{'id':_0x346e73['id'],'role':_0x346e73[_0xe961('0x17')]},'options':{'expiresIn':0x15180}};return authService[_0xe961('0x26')](_0x15e691)['then'](function(_0x4eb53d){_0x5716f7[_0xe961('0x27')]({'id':_0x346e73['id'],'token':_0x4eb53d,'statusCall':'','isAlreadyLogged':_0x346e73['online']});});}})(_0x361373,_0x5716f7,_0x191660);};passport[_0xe961('0x28')](_0xe961('0x29'),new LocalStrategy({'usernameField':'name','passwordField':_0xe961('0x16')},function(_0x4c7201,_0x2c8f38,_0x31f319){return ActiveDirectoryAuthenticate(db[_0xe961('0x2a')],_0x4c7201,_0x2c8f38,_0x31f319);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index f57e0f8..e73dac9 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 _0x3d8e=['post','login','exports','Router'];(function(_0x135f3d,_0x1f427d){var _0x4418cf=function(_0x5a751a){while(--_0x5a751a){_0x135f3d['push'](_0x135f3d['shift']());}};_0x4418cf(++_0x1f427d);}(_0x3d8e,0x13b));var _0xe3d8=function(_0x264f48,_0x2c82d8){_0x264f48=_0x264f48-0x0;var _0xb99167=_0x3d8e[_0x264f48];return _0xb99167;};'use strict';var express=require('express');var router=express[_0xe3d8('0x0')]();var controller=require('./authActiveDirectory.controller');router[_0xe3d8('0x1')]('/',controller[_0xe3d8('0x2')]);module[_0xe3d8('0x3')]=router;
\ No newline at end of file
+var _0x52e2=['Router','login','exports'];(function(_0x416525,_0x347f23){var _0x346357=function(_0x16cbd9){while(--_0x16cbd9){_0x416525['push'](_0x416525['shift']());}};_0x346357(++_0x347f23);}(_0x52e2,0x165));var _0x252e=function(_0x5676df,_0x14d122){_0x5676df=_0x5676df-0x0;var _0x1fb878=_0x52e2[_0x5676df];return _0x1fb878;};'use strict';var express=require('express');var router=express[_0x252e('0x0')]();var controller=require('./authActiveDirectory.controller');router['post']('/',controller[_0x252e('0x1')]);module[_0x252e('0x2')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 814b2e0..e5f02c0 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 _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(_0x34bcf6,_0x2cc521){var _0x54adc9=function(_0x2a8f15){while(--_0x2a8f15){_0x34bcf6['push'](_0x34bcf6['shift']());}};_0x54adc9(++_0x2cc521);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'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
+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(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x7a54,0x106));var _0x47a5=function(_0x49fef8,_0x5e35e1){_0x49fef8=_0x49fef8-0x0;var _0x5a19c1=_0x7a54[_0x49fef8];return _0x5a19c1;};'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
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index e2da826..1120b2f 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 _0xce0d=['isMiddleware','login','setTokenCookie','exports','express','passport','./authGoogle.controller','../../components/auth/service','get','/callback','callback'];(function(_0x2fa661,_0x5a69e9){var _0x113676=function(_0x95597e){while(--_0x95597e){_0x2fa661['push'](_0x2fa661['shift']());}};_0x113676(++_0x5a69e9);}(_0xce0d,0x9e));var _0xdce0=function(_0x2dd6b1,_0x4485d7){_0x2dd6b1=_0x2dd6b1-0x0;var _0x494306=_0xce0d[_0x2dd6b1];return _0x494306;};'use strict';var express=require(_0xdce0('0x0'));var passport=require(_0xdce0('0x1'));var router=express['Router']();var controller=require(_0xdce0('0x2'));var userController=require('../user/user.controller.js');var authService=require(_0xdce0('0x3'));router[_0xdce0('0x4')]('/',controller['login']);router[_0xdce0('0x4')](_0xdce0('0x5'),controller[_0xdce0('0x6')],authService[_0xdce0('0x7')],userController[_0xdce0('0x8')],authService[_0xdce0('0x9')]);module[_0xdce0('0xa')]=router;
\ No newline at end of file
+var _0xf967=['../../components/auth/service','login','/callback','isMiddleware','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js'];(function(_0x10b991,_0x3dce8d){var _0x55937d=function(_0x1e6315){while(--_0x1e6315){_0x10b991['push'](_0x10b991['shift']());}};_0x55937d(++_0x3dce8d);}(_0xf967,0x12f));var _0x7f96=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xf967[_0x3b380d];return _0x54502b;};'use strict';var express=require(_0x7f96('0x0'));var passport=require(_0x7f96('0x1'));var router=express[_0x7f96('0x2')]();var controller=require(_0x7f96('0x3'));var userController=require(_0x7f96('0x4'));var authService=require(_0x7f96('0x5'));router['get']('/',controller[_0x7f96('0x6')]);router['get'](_0x7f96('0x7'),controller['callback'],authService[_0x7f96('0x8')],userController[_0x7f96('0x6')],authService[_0x7f96('0x9')]);module[_0x7f96('0xa')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 7176df8..272389b 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 _0x24c4=['previousPasswords','validatePasswordHistory','resetPasswordExpires','send','Password\x20reset!','use','local-login','util','passport-local','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','then','password','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','clearBlockUser','blockDuration','minutes','getLicense','MailAccount','find','email','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','\x22%s\x22\x20<%s>','request','SendMail','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','Email\x20parameter\x20is\x20missing','body','trim','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','headers','Reset\x20Email\x20sent!','catch','reset','enforcePasswordHistory','securePassword','validatePasswordPattern'];(function(_0x2d3be8,_0x29449c){var _0x11cd94=function(_0x4b38da){while(--_0x4b38da){_0x2d3be8['push'](_0x2d3be8['shift']());}};_0x11cd94(++_0x29449c);}(_0x24c4,0x1cf));var _0x424c=function(_0x190844,_0x556c10){_0x190844=_0x190844-0x0;var _0x10b2db=_0x24c4[_0x190844];return _0x10b2db;};'use strict';var util=require(_0x424c('0x0'));var passport=require('passport');var LocalStrategy=require(_0x424c('0x1'))['Strategy'];var jayson=require(_0x424c('0x2'));var _=require(_0x424c('0x3'));var rs=require(_0x424c('0x4'));var moment=require(_0x424c('0x5'));var db=require(_0x424c('0x6'))['db'];var authService=require(_0x424c('0x7'));var utils=require(_0x424c('0x8'));var client=jayson[_0x424c('0x9')][_0x424c('0xa')]({'port':0x232b});function localAuthenticate(_0x52a6fb,_0x40f5b9,_0x36f563,_0x428cf1){var _0xe84ed2,_0x4ab6a9;return db[_0x424c('0xb')][_0x424c('0xc')]({'where':{'id':0x1},'attributes':[_0x424c('0xd'),'blockDuration'],'raw':!![]})[_0x424c('0xe')](function(_0xb60a38){_0xe84ed2=_0xb60a38;return _0x52a6fb[_0x424c('0xc')]({'attributes':['id','name',_0x424c('0xf'),_0x424c('0x10'),_0x424c('0x11'),_0x424c('0x12'),_0x424c('0x13'),_0x424c('0x14'),_0x424c('0x15')],'where':{'name':_0x40f5b9,'role':{'$or':[_0x424c('0x16'),'user',_0x424c('0x17')]}}});})[_0x424c('0xe')](function(_0x2ecf7c){if(!_0x2ecf7c||_0x2ecf7c&&_0x2ecf7c[_0x424c('0x18')]!==_0x40f5b9){throw new Error(_0x424c('0x19'));}else{_0x4ab6a9=_0x2ecf7c;return _0x4ab6a9;}})['then'](function(){_0x4ab6a9[_0x424c('0x1a')](_0x36f563,function(_0x140c0d,_0x5c2f27){var _0x11b6bd=_0x4ab6a9[_0x424c('0x15')]+0x1;if(_0x140c0d){return _0x428cf1(_0x140c0d);}else if(!_0x5c2f27){if(_0x4ab6a9[_0x424c('0x12')]){return _0x428cf1(null,![],{'message':_0x424c('0x19')});}else if(_0xe84ed2[_0x424c('0xd')]>0x0){if(_0x4ab6a9[_0x424c('0x13')]){if(_0xe84ed2['blockDuration']>0x0){if(moment(_0x4ab6a9[_0x424c('0x14')])[_0x424c('0x1b')](_0xe84ed2['blockDuration'],'minutes')>moment()){return _0x428cf1(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x4ab6a9,_0x11b6bd,![],null)[_0x424c('0xe')](function(){return _0x428cf1(null,![],{'message':_0x424c('0x19')});});}}else{return _0x428cf1(null,![],{'message':_0x424c('0x19')});}}else{if(_0x11b6bd>=_0xe84ed2['allowedLoginAttempts']){return utils[_0x424c('0x1c')](_0x4ab6a9,0x0,!![],moment())['then'](function(){return _0x428cf1(null,![],{'message':_0x424c('0x19')});});}else{return utils[_0x424c('0x1c')](_0x4ab6a9,_0x11b6bd,![],null)[_0x424c('0xe')](function(){return _0x428cf1(null,![],{'message':_0x424c('0x19')});});}}}else{return _0x428cf1(null,![],{'message':_0x424c('0x19')});}}else{if(_0x4ab6a9[_0x424c('0x12')]){return _0x428cf1(null,![],{'message':_0x424c('0x19')});}else if(_0xe84ed2[_0x424c('0xd')]>0x0){if(_0x4ab6a9['blocked']){if(_0xe84ed2[_0x424c('0x1d')]>0x0){if(moment(_0x4ab6a9[_0x424c('0x14')])[_0x424c('0x1b')](_0xe84ed2[_0x424c('0x1d')],_0x424c('0x1e'))>moment()){return _0x428cf1(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x424c('0x1c')](_0x4ab6a9,0x0,![],null)[_0x424c('0xe')](function(){return utils[_0x424c('0x1f')](_0x4ab6a9);})[_0x424c('0xe')](function(){return _0x428cf1(null,_0x4ab6a9);});}}else{return _0x428cf1(null,![],{'message':_0x424c('0x19')});}}else{return utils[_0x424c('0x1c')](_0x4ab6a9,0x0,![],null)['then'](function(){return utils[_0x424c('0x1f')](_0x4ab6a9);})[_0x424c('0xe')](function(){return _0x428cf1(null,_0x4ab6a9);})['catch'](function(_0x34f0af){return _0x428cf1(null,![],_0x34f0af);});}}else{if(_0x4ab6a9[_0x424c('0x13')]){return _0x428cf1(null,![],{'message':_0x424c('0x19')});}else{return utils['getLicense'](_0x4ab6a9)[_0x424c('0xe')](function(){return _0x428cf1(null,_0x4ab6a9);});}}}});})['catch'](function(_0x1667d5){return _0x428cf1(null,![],_0x1667d5);});}function sendServiceMail(_0x56e6e2){return db[_0x424c('0x20')][_0x424c('0x21')]({'where':{'service':!![]},'attributes':['id',_0x424c('0x18'),_0x424c('0x22')],'include':[{'model':db['MailServerOut'],'as':_0x424c('0x23'),'include':[{'model':db[_0x424c('0x24')],'as':_0x424c('0x24')}]}]})[_0x424c('0xe')](function(_0x1f800e){if(!_0x1f800e){throw new Error(_0x424c('0x25'));}var _0x436d86=_0x1f800e[_0x424c('0x26')]();var _0x24bdfa={'account':_0x436d86,'message':_[_0x424c('0x27')]({'from':util['format'](_0x424c('0x28'),_0x1f800e[_0x424c('0x18')],_0x1f800e[_0x424c('0x22')]||_0x1f800e[_0x424c('0x23')]['user'])},_0x56e6e2)};return client[_0x424c('0x29')](_0x424c('0x2a'),_0x24bdfa);})['then'](function(_0xa97a4){if(_0xa97a4[_0x424c('0x2b')]){throw new Error(util[_0x424c('0x2c')](_0x424c('0x2d'),_0xa97a4[_0x424c('0x2b')][_0x424c('0x2e')]||JSON[_0x424c('0x2f')](_0xa97a4['error'])));}return!![];});}function handleError(_0x583b97,_0x2bfe73,_0x1493f0){return _0x583b97[_0x424c('0x30')](_0x2bfe73||0x1f4)['send']({'message':_0x1493f0?_0x1493f0['message']||_0x1493f0:''});}exports[_0x424c('0x31')]=function(_0x5d150a,_0x27ce26,_0x344931){passport[_0x424c('0x1a')]('local-login',function(_0xa60752,_0x5a2946,_0x2d3ade){var _0x4fd557=_0xa60752||_0x2d3ade;if(_0x4fd557){return handleError(_0x27ce26,0x191,_0x4fd557);}if(!_0x5a2946){return handleError(_0x27ce26,0x194,{'message':_0x424c('0x32')});}else{var _0x21adfa={'payload':{'id':_0x5a2946['id'],'role':_0x5a2946['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x21adfa)[_0x424c('0xe')](function(_0x429d20){_0x27ce26[_0x424c('0x33')]({'id':_0x5a2946['id'],'token':_0x429d20,'statusCall':'','isAlreadyLogged':_0x5a2946['online']});});}})(_0x5d150a,_0x27ce26,_0x344931);};exports['forgot']=function(_0x2de596,_0x3c8dad){if(!_0x2de596['body'][_0x424c('0x22')]){return handleError(_0x3c8dad,0x1f4,{'message':_0x424c('0x34')});}var _0x5d4957=rs['generate']();_0x2de596['body']['email']=_0x2de596[_0x424c('0x35')]['email'][_0x424c('0x36')]()['toLowerCase']();var _0x40470b;return db[_0x424c('0xb')][_0x424c('0xc')]({'where':{'id':0x1},'attributes':[_0x424c('0xd'),_0x424c('0x1d')],'raw':!![]})[_0x424c('0xe')](function(_0x54d683){_0x40470b=_0x54d683;return db['User'][_0x424c('0x21')]({'where':{'email':_0x2de596[_0x424c('0x35')]['email']}});})['then'](function(_0x323cf2){if(!_0x323cf2){throw new Error(_0x424c('0x37'));}if(_0x323cf2[_0x424c('0x12')]){throw new Error(_0x424c('0x38'));}if(_0x323cf2['blocked']){if(moment(_0x323cf2['blockedAt'])[_0x424c('0x1b')](_0x40470b[_0x424c('0x1d')],_0x424c('0x1e'))>moment()){throw new Error(_0x424c('0x39'));}else{_0x323cf2[_0x424c('0x13')]=![];_0x323cf2[_0x424c('0x14')]=null;}}_0x323cf2[_0x424c('0x3a')]=_0x5d4957;_0x323cf2['resetPasswordExpires']=Date[_0x424c('0x3b')]()+0x36ee80;return _0x323cf2[_0x424c('0x3c')]();})[_0x424c('0xe')](function(){return sendServiceMail({'to':_0x2de596[_0x424c('0x35')][_0x424c('0x22')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x424c('0x3d')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+'https://'+_0x2de596[_0x424c('0x3e')]['host']+'/reset/'+_0x5d4957+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x424c('0xe')](function(){_0x3c8dad['status'](0xc8)['send']({'message':_0x424c('0x3f')});})[_0x424c('0x40')](function(_0x1eff08){return handleError(_0x3c8dad,0x1f4,_0x1eff08);});};exports[_0x424c('0x41')]=function(_0x232d3e,_0x422407){return db['User'][_0x424c('0x21')]({'where':{'resetPasswordToken':_0x232d3e['params']['token'],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x424c('0xe')](function(_0x211352){if(!_0x211352){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x424c('0xb')][_0x424c('0xc')]({'attributes':['id','securePassword',_0x424c('0x42'),'passwordHistoryLimit']})[_0x424c('0xe')](function(_0x5355b5){if(_0x5355b5[_0x424c('0x43')])authService[_0x424c('0x44')](_0x232d3e[_0x424c('0x35')][_0x424c('0xf')]);if(!_0x5355b5['enforcePasswordHistory']||!_0x211352[_0x424c('0x45')])return _0x211352;authService[_0x424c('0x46')](_0x232d3e['body'][_0x424c('0xf')],_0x211352['previousPasswords'],_0x5355b5['passwordHistoryLimit']);return _0x211352;})[_0x424c('0xe')](function(){_0x211352[_0x424c('0xf')]=_0x232d3e['body'][_0x424c('0xf')];_0x211352[_0x424c('0x3a')]=null;_0x211352[_0x424c('0x47')]=null;return _0x211352[_0x424c('0x3c')]();});})[_0x424c('0xe')](function(){_0x422407[_0x424c('0x30')](0xc8)[_0x424c('0x48')]({'message':_0x424c('0x49')});})[_0x424c('0x40')](function(_0x5abfb2){return handleError(_0x422407,0x1f4,_0x5abfb2);});};passport[_0x424c('0x4a')](_0x424c('0x4b'),new LocalStrategy({'usernameField':_0x424c('0x18'),'passwordField':_0x424c('0xf')},function(_0x39ca1c,_0x3227af,_0x285101){return localAuthenticate(db['User'],_0x39ca1c,_0x3227af,_0x285101);}));
\ No newline at end of file
+var _0x8d9e=['host','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','previousPasswords','resetPasswordToken','Password\x20reset!','use','util','passport','passport-local','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','http','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','blocked','loginAttempts','admin','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockedAt','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','send','message','login','signToken','json','online','forgot','generate','body','email','toLowerCase','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','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','https://','headers'];(function(_0x45084f,_0x21ce0b){var _0x324c40=function(_0x5bd611){while(--_0x5bd611){_0x45084f['push'](_0x45084f['shift']());}};_0x324c40(++_0x21ce0b);}(_0x8d9e,0x150));var _0xe8d9=function(_0x562ed2,_0x5a261f){_0x562ed2=_0x562ed2-0x0;var _0x1a1f47=_0x8d9e[_0x562ed2];return _0x1a1f47;};'use strict';var util=require(_0xe8d9('0x0'));var passport=require(_0xe8d9('0x1'));var LocalStrategy=require(_0xe8d9('0x2'))['Strategy'];var jayson=require(_0xe8d9('0x3'));var _=require(_0xe8d9('0x4'));var rs=require(_0xe8d9('0x5'));var moment=require(_0xe8d9('0x6'));var db=require(_0xe8d9('0x7'))['db'];var authService=require(_0xe8d9('0x8'));var utils=require(_0xe8d9('0x9'));var client=jayson['client'][_0xe8d9('0xa')]({'port':0x232b});function localAuthenticate(_0x5175ac,_0x5576b9,_0x128c15,_0x18950a){var _0x17d39f,_0x57ee77;return db['Setting'][_0xe8d9('0xb')]({'where':{'id':0x1},'attributes':[_0xe8d9('0xc'),_0xe8d9('0xd')],'raw':!![]})[_0xe8d9('0xe')](function(_0x498418){_0x17d39f=_0x498418;return _0x5175ac[_0xe8d9('0xb')]({'attributes':['id',_0xe8d9('0xf'),_0xe8d9('0x10'),_0xe8d9('0x11'),_0xe8d9('0x12'),_0xe8d9('0x13'),_0xe8d9('0x14'),'blockedAt',_0xe8d9('0x15')],'where':{'name':_0x5576b9,'role':{'$or':[_0xe8d9('0x16'),'user',_0xe8d9('0x17')]}}});})[_0xe8d9('0xe')](function(_0x21a91e){if(!_0x21a91e||_0x21a91e&&_0x21a91e[_0xe8d9('0xf')]!==_0x5576b9){throw new Error(_0xe8d9('0x18'));}else{_0x57ee77=_0x21a91e;return _0x57ee77;}})[_0xe8d9('0xe')](function(){_0x57ee77[_0xe8d9('0x19')](_0x128c15,function(_0x1c5922,_0x25809b){var _0x12461e=_0x57ee77[_0xe8d9('0x15')]+0x1;if(_0x1c5922){return _0x18950a(_0x1c5922);}else if(!_0x25809b){if(_0x57ee77[_0xe8d9('0x13')]){return _0x18950a(null,![],{'message':_0xe8d9('0x18')});}else if(_0x17d39f[_0xe8d9('0xc')]>0x0){if(_0x57ee77[_0xe8d9('0x14')]){if(_0x17d39f[_0xe8d9('0xd')]>0x0){if(moment(_0x57ee77[_0xe8d9('0x1a')])[_0xe8d9('0x1b')](_0x17d39f['blockDuration'],_0xe8d9('0x1c'))>moment()){return _0x18950a(null,![],{'message':_0xe8d9('0x18')});}else{return utils[_0xe8d9('0x1d')](_0x57ee77,_0x12461e,![],null)[_0xe8d9('0xe')](function(){return _0x18950a(null,![],{'message':_0xe8d9('0x18')});});}}else{return _0x18950a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x12461e>=_0x17d39f['allowedLoginAttempts']){return utils[_0xe8d9('0x1d')](_0x57ee77,0x0,!![],moment())[_0xe8d9('0xe')](function(){return _0x18950a(null,![],{'message':_0xe8d9('0x18')});});}else{return utils[_0xe8d9('0x1d')](_0x57ee77,_0x12461e,![],null)[_0xe8d9('0xe')](function(){return _0x18950a(null,![],{'message':_0xe8d9('0x18')});});}}}else{return _0x18950a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x57ee77['disabled']){return _0x18950a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x17d39f[_0xe8d9('0xc')]>0x0){if(_0x57ee77['blocked']){if(_0x17d39f[_0xe8d9('0xd')]>0x0){if(moment(_0x57ee77['blockedAt'])['add'](_0x17d39f[_0xe8d9('0xd')],_0xe8d9('0x1c'))>moment()){return _0x18950a(null,![],{'message':_0xe8d9('0x18')});}else{return utils['clearBlockUser'](_0x57ee77,0x0,![],null)[_0xe8d9('0xe')](function(){return utils[_0xe8d9('0x1e')](_0x57ee77);})[_0xe8d9('0xe')](function(){return _0x18950a(null,_0x57ee77);});}}else{return _0x18950a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0xe8d9('0x1d')](_0x57ee77,0x0,![],null)[_0xe8d9('0xe')](function(){return utils['getLicense'](_0x57ee77);})['then'](function(){return _0x18950a(null,_0x57ee77);})[_0xe8d9('0x1f')](function(_0x419a63){return _0x18950a(null,![],_0x419a63);});}}else{if(_0x57ee77['blocked']){return _0x18950a(null,![],{'message':_0xe8d9('0x18')});}else{return utils['getLicense'](_0x57ee77)[_0xe8d9('0xe')](function(){return _0x18950a(null,_0x57ee77);});}}}});})['catch'](function(_0x2c3d82){return _0x18950a(null,![],_0x2c3d82);});}function sendServiceMail(_0x113929){return db[_0xe8d9('0x20')][_0xe8d9('0x21')]({'where':{'service':!![]},'attributes':['id',_0xe8d9('0xf'),'email'],'include':[{'model':db['MailServerOut'],'as':_0xe8d9('0x22'),'include':[{'model':db[_0xe8d9('0x23')],'as':'CloudProvider'}]}]})[_0xe8d9('0xe')](function(_0x549faa){if(!_0x549faa){throw new Error(_0xe8d9('0x24'));}var _0x35ac6f=_0x549faa[_0xe8d9('0x25')]();var _0x55ba1d={'account':_0x35ac6f,'message':_[_0xe8d9('0x26')]({'from':util[_0xe8d9('0x27')]('\x22%s\x22\x20<%s>',_0x549faa[_0xe8d9('0xf')],_0x549faa['email']||_0x549faa[_0xe8d9('0x22')]['user'])},_0x113929)};return client[_0xe8d9('0x28')](_0xe8d9('0x29'),_0x55ba1d);})[_0xe8d9('0xe')](function(_0x24d471){if(_0x24d471[_0xe8d9('0x2a')]){throw new Error(util[_0xe8d9('0x27')](_0xe8d9('0x2b'),_0x24d471[_0xe8d9('0x2a')]['message']||JSON[_0xe8d9('0x2c')](_0x24d471[_0xe8d9('0x2a')])));}return!![];});}function handleError(_0x3f96a4,_0x5ebe7b,_0xcc58f){return _0x3f96a4['status'](_0x5ebe7b||0x1f4)[_0xe8d9('0x2d')]({'message':_0xcc58f?_0xcc58f[_0xe8d9('0x2e')]||_0xcc58f:''});}exports[_0xe8d9('0x2f')]=function(_0x3f8cd6,_0x1dd25b,_0x1ac6cd){passport['authenticate']('local-login',function(_0x235505,_0x5b344e,_0x572a01){var _0x245662=_0x235505||_0x572a01;if(_0x245662){return handleError(_0x1dd25b,0x191,_0x245662);}if(!_0x5b344e){return handleError(_0x1dd25b,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x380561={'payload':{'id':_0x5b344e['id'],'role':_0x5b344e['role']},'options':{'expiresIn':0x15180}};return authService[_0xe8d9('0x30')](_0x380561)[_0xe8d9('0xe')](function(_0x218cfd){_0x1dd25b[_0xe8d9('0x31')]({'id':_0x5b344e['id'],'token':_0x218cfd,'statusCall':'','isAlreadyLogged':_0x5b344e[_0xe8d9('0x32')]});});}})(_0x3f8cd6,_0x1dd25b,_0x1ac6cd);};exports[_0xe8d9('0x33')]=function(_0x532527,_0x17b09a){if(!_0x532527['body']['email']){return handleError(_0x17b09a,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x14e28a=rs[_0xe8d9('0x34')]();_0x532527[_0xe8d9('0x35')][_0xe8d9('0x36')]=_0x532527['body'][_0xe8d9('0x36')]['trim']()[_0xe8d9('0x37')]();var _0x54627d;return db[_0xe8d9('0x38')][_0xe8d9('0xb')]({'where':{'id':0x1},'attributes':[_0xe8d9('0xc'),_0xe8d9('0xd')],'raw':!![]})[_0xe8d9('0xe')](function(_0xcbe4a7){_0x54627d=_0xcbe4a7;return db[_0xe8d9('0x39')]['find']({'where':{'email':_0x532527[_0xe8d9('0x35')][_0xe8d9('0x36')]}});})['then'](function(_0x4f56fb){if(!_0x4f56fb){throw new Error(_0xe8d9('0x3a'));}if(_0x4f56fb[_0xe8d9('0x13')]){throw new Error(_0xe8d9('0x3b'));}if(_0x4f56fb[_0xe8d9('0x14')]){if(moment(_0x4f56fb[_0xe8d9('0x1a')])[_0xe8d9('0x1b')](_0x54627d[_0xe8d9('0xd')],'minutes')>moment()){throw new Error(_0xe8d9('0x3c'));}else{_0x4f56fb[_0xe8d9('0x14')]=![];_0x4f56fb[_0xe8d9('0x1a')]=null;}}_0x4f56fb['resetPasswordToken']=_0x14e28a;_0x4f56fb[_0xe8d9('0x3d')]=Date[_0xe8d9('0x3e')]()+0x36ee80;return _0x4f56fb[_0xe8d9('0x3f')]();})[_0xe8d9('0xe')](function(){return sendServiceMail({'to':_0x532527[_0xe8d9('0x35')]['email'],'subject':_0xe8d9('0x40'),'text':_0xe8d9('0x41')+_0xe8d9('0x42')+_0xe8d9('0x43')+_0x532527[_0xe8d9('0x44')][_0xe8d9('0x45')]+'/reset/'+_0x14e28a+'\x0a\x0a'+_0xe8d9('0x46')});})[_0xe8d9('0xe')](function(){_0x17b09a[_0xe8d9('0x47')](0xc8)[_0xe8d9('0x2d')]({'message':_0xe8d9('0x48')});})[_0xe8d9('0x1f')](function(_0x39af45){return handleError(_0x17b09a,0x1f4,_0x39af45);});};exports['reset']=function(_0x16c9d9,_0x35e33c){return db['User']['find']({'where':{'resetPasswordToken':_0x16c9d9['params']['token'],'resetPasswordExpires':{'$gt':Date[_0xe8d9('0x3e')]()}}})[_0xe8d9('0xe')](function(_0x3d6cfc){if(!_0x3d6cfc){throw new Error(_0xe8d9('0x49'));}return db[_0xe8d9('0x38')][_0xe8d9('0xb')]({'attributes':['id','securePassword',_0xe8d9('0x4a'),_0xe8d9('0x4b')]})[_0xe8d9('0xe')](function(_0xf85d89){if(_0xf85d89[_0xe8d9('0x4c')])authService['validatePasswordPattern'](_0x16c9d9[_0xe8d9('0x35')]['password']);if(!_0xf85d89[_0xe8d9('0x4a')]||!_0x3d6cfc['previousPasswords'])return _0x3d6cfc;authService['validatePasswordHistory'](_0x16c9d9['body'][_0xe8d9('0x10')],_0x3d6cfc[_0xe8d9('0x4d')],_0xf85d89[_0xe8d9('0x4b')]);return _0x3d6cfc;})[_0xe8d9('0xe')](function(){_0x3d6cfc[_0xe8d9('0x10')]=_0x16c9d9['body']['password'];_0x3d6cfc[_0xe8d9('0x4e')]=null;_0x3d6cfc[_0xe8d9('0x3d')]=null;return _0x3d6cfc[_0xe8d9('0x3f')]();});})[_0xe8d9('0xe')](function(){_0x35e33c['status'](0xc8)[_0xe8d9('0x2d')]({'message':_0xe8d9('0x4f')});})[_0xe8d9('0x1f')](function(_0x92c068){return handleError(_0x35e33c,0x1f4,_0x92c068);});};passport[_0xe8d9('0x50')]('local-login',new LocalStrategy({'usernameField':'name','passwordField':_0xe8d9('0x10')},function(_0x37f663,_0x1f2cae,_0x85bd6){return localAuthenticate(db['User'],_0x37f663,_0x1f2cae,_0x85bd6);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 4dbcc43..133a827 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 _0x6d40=['reset','express','./authLocal.controller','post','login','/forgot','forgot'];(function(_0x22b68a,_0x2bffc3){var _0x1ac67a=function(_0x25f9d5){while(--_0x25f9d5){_0x22b68a['push'](_0x22b68a['shift']());}};_0x1ac67a(++_0x2bffc3);}(_0x6d40,0x197));var _0x06d4=function(_0x1c8196,_0x2ddbed){_0x1c8196=_0x1c8196-0x0;var _0x296224=_0x6d40[_0x1c8196];return _0x296224;};'use strict';var express=require(_0x06d4('0x0'));var router=express['Router']();var controller=require(_0x06d4('0x1'));router[_0x06d4('0x2')]('/',controller[_0x06d4('0x3')]);router[_0x06d4('0x2')](_0x06d4('0x4'),controller[_0x06d4('0x5')]);router['post']('/reset/:token',controller[_0x06d4('0x6')]);module['exports']=router;
\ No newline at end of file
+var _0x389b=['/reset/:token','reset','exports','express','Router','login','post'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x389b,0x130));var _0xb389=function(_0xba6447,_0x458f89){_0xba6447=_0xba6447-0x0;var _0x11e3ba=_0x389b[_0xba6447];return _0x11e3ba;};'use strict';var express=require(_0xb389('0x0'));var router=express[_0xb389('0x1')]();var controller=require('./authLocal.controller');router['post']('/',controller[_0xb389('0x2')]);router[_0xb389('0x3')]('/forgot',controller['forgot']);router['post'](_0xb389('0x4'),controller[_0xb389('0x5')]);module[_0xb389('0x6')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 0b5fd76..bc0f5f6 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 _0x52d8=['BOOLEAN','INTEGER','exports','STRING'];(function(_0x2f9cf0,_0x1b5aa1){var _0x5f07cb=function(_0x2b35a3){while(--_0x2b35a3){_0x2f9cf0['push'](_0x2f9cf0['shift']());}};_0x5f07cb(++_0x1b5aa1);}(_0x52d8,0xbe));var _0x852d=function(_0x57014b,_0x360c0f){_0x57014b=_0x57014b-0x0;var _0x2b258a=_0x52d8[_0x57014b];return _0x2b258a;};'use strict';var Sequelize=require('sequelize');module[_0x852d('0x0')]={'name':{'type':Sequelize[_0x852d('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x852d('0x1')]},'description':{'type':Sequelize[_0x852d('0x1')]},'status':{'type':Sequelize[_0x852d('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x852d('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x3988=['BOOLEAN','INTEGER','sequelize','exports','STRING'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0x3988,0x188));var _0x8398=function(_0x2f7e43,_0x2d97c0){_0x2f7e43=_0x2f7e43-0x0;var _0x2758b0=_0x3988[_0x2f7e43];return _0x2758b0;};'use strict';var Sequelize=require(_0x8398('0x0'));module[_0x8398('0x1')]={'name':{'type':Sequelize[_0x8398('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x8398('0x2')]},'description':{'type':Sequelize[_0x8398('0x2')]},'status':{'type':Sequelize[_0x8398('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x8398('0x4')],'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 83f7abb..a3f32a1 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 _0xa917=['eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','Automation','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','include','findAll','rows','catch','params','length','includeAll','find','create','body','ids','omit','getConditions','findOne','addActions','Action','getActions'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0xa917,0xac));var _0x7a91=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xa917[_0x502c7d];return _0x30b7ed;};'use strict';var emlformat=require(_0x7a91('0x0'));var rimraf=require(_0x7a91('0x1'));var zipdir=require(_0x7a91('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7a91('0x3'));var BPromise=require(_0x7a91('0x4'));var Mustache=require(_0x7a91('0x5'));var util=require(_0x7a91('0x6'));var path=require(_0x7a91('0x7'));var sox=require(_0x7a91('0x8'));var csv=require('to-csv');var ejs=require(_0x7a91('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7a91('0xa'));var squel=require(_0x7a91('0xb'));var crypto=require('crypto');var jsforce=require(_0x7a91('0xc'));var deskjs=require(_0x7a91('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7a91('0xe'));var Papa=require(_0x7a91('0xf'));var Redis=require('ioredis');var authService=require(_0x7a91('0x10'));var qs=require(_0x7a91('0x11'));var as=require(_0x7a91('0x12'));var hardwareService=require(_0x7a91('0x13'));var logger=require(_0x7a91('0x14'))(_0x7a91('0x15'));var utils=require('../../config/utils');var config=require(_0x7a91('0x16'));var licenseUtil=require(_0x7a91('0x17'));var db=require(_0x7a91('0x18'))['db'];function respondWithStatusCode(_0x25ae81,_0x2e72a7){_0x2e72a7=_0x2e72a7||0xcc;return function(_0x125c16){if(_0x125c16){return _0x25ae81['sendStatus'](_0x2e72a7);}return _0x25ae81[_0x7a91('0x19')](_0x2e72a7)[_0x7a91('0x1a')]();};}function respondWithResult(_0x497de7,_0x209c9d){_0x209c9d=_0x209c9d||0xc8;return function(_0x4a16a5){if(_0x4a16a5){return _0x497de7[_0x7a91('0x19')](_0x209c9d)['json'](_0x4a16a5);}};}function respondWithFilteredResult(_0x1334ae,_0x3306d4){return function(_0x146809){if(_0x146809){var _0x4612b3=typeof _0x3306d4['offset']===_0x7a91('0x1b')&&typeof _0x3306d4[_0x7a91('0x1c')]===_0x7a91('0x1b');var _0x31497c=_0x146809[_0x7a91('0x1d')];var _0x53b781=_0x4612b3?0x0:_0x3306d4[_0x7a91('0x1e')];var _0x5a8023=_0x4612b3?_0x146809['count']:_0x3306d4[_0x7a91('0x1e')]+_0x3306d4['limit'];var _0x343894;if(_0x5a8023>=_0x31497c){_0x5a8023=_0x31497c;_0x343894=0xc8;}else{_0x343894=0xce;}_0x1334ae[_0x7a91('0x19')](_0x343894);return _0x1334ae[_0x7a91('0x1f')](_0x7a91('0x20'),_0x53b781+'-'+_0x5a8023+'/'+_0x31497c)[_0x7a91('0x21')](_0x146809);}return null;};}function patchUpdates(_0x45136e){return function(_0x4b9cf5){try{jsonpatch[_0x7a91('0x22')](_0x4b9cf5,_0x45136e,!![]);}catch(_0x45c859){return BPromise[_0x7a91('0x23')](_0x45c859);}return _0x4b9cf5[_0x7a91('0x24')]();};}function saveUpdates(_0x34198f,_0x48c1cc){return function(_0x493906){if(_0x493906){return _0x493906[_0x7a91('0x25')](_0x34198f)['then'](function(_0xd1ffb3){return _0xd1ffb3;});}return null;};}function removeEntity(_0x48915f,_0x647bcb){return function(_0x470d8a){if(_0x470d8a){return _0x470d8a[_0x7a91('0x26')]()[_0x7a91('0x27')](function(){_0x48915f[_0x7a91('0x19')](0xcc)[_0x7a91('0x1a')]();});}};}function handleEntityNotFound(_0x149740,_0x13a842){return function(_0x502b8f){if(!_0x502b8f){_0x149740[_0x7a91('0x28')](0x194);}return _0x502b8f;};}function handleError(_0x3b7a40,_0x3013ad){_0x3013ad=_0x3013ad||0x1f4;return function(_0x356af8){logger[_0x7a91('0x29')](_0x356af8[_0x7a91('0x2a')]);if(_0x356af8[_0x7a91('0x2b')]){delete _0x356af8[_0x7a91('0x2b')];}_0x3b7a40['status'](_0x3013ad)[_0x7a91('0x2c')](_0x356af8);};}exports[_0x7a91('0x2d')]=function(_0x238bdc,_0x427c0e){var _0x4e72a7={},_0x5130d6={},_0x2e3edd={'count':0x0,'rows':[]};var _0x8aba2b=_['map'](db[_0x7a91('0x2e')][_0x7a91('0x2f')],function(_0x3016b8){return{'name':_0x3016b8[_0x7a91('0x30')],'type':_0x3016b8['type'][_0x7a91('0x31')]};});_0x5130d6[_0x7a91('0x32')]=_[_0x7a91('0x33')](_0x8aba2b,_0x7a91('0x2b'));_0x5130d6[_0x7a91('0x34')]=_[_0x7a91('0x35')](_0x238bdc[_0x7a91('0x34')]);_0x5130d6[_0x7a91('0x36')]=_[_0x7a91('0x37')](_0x5130d6[_0x7a91('0x32')],_0x5130d6['query']);_0x4e72a7[_0x7a91('0x38')]=_[_0x7a91('0x37')](_0x5130d6[_0x7a91('0x32')],qs[_0x7a91('0x39')](_0x238bdc[_0x7a91('0x34')][_0x7a91('0x39')]));_0x4e72a7[_0x7a91('0x38')]=_0x4e72a7[_0x7a91('0x38')]['length']?_0x4e72a7[_0x7a91('0x38')]:_0x5130d6[_0x7a91('0x32')];if(!_0x238bdc['query'][_0x7a91('0x3a')](_0x7a91('0x3b'))){_0x4e72a7['limit']=qs[_0x7a91('0x1c')](_0x238bdc[_0x7a91('0x34')][_0x7a91('0x1c')]);_0x4e72a7[_0x7a91('0x1e')]=qs[_0x7a91('0x1e')](_0x238bdc[_0x7a91('0x34')][_0x7a91('0x1e')]);}_0x4e72a7[_0x7a91('0x3c')]=qs['sort'](_0x238bdc[_0x7a91('0x34')][_0x7a91('0x3d')]);_0x4e72a7[_0x7a91('0x3e')]=qs[_0x7a91('0x36')](_[_0x7a91('0x3f')](_0x238bdc[_0x7a91('0x34')],_0x5130d6['filters']),_0x8aba2b);if(_0x238bdc[_0x7a91('0x34')]['filter']){_0x4e72a7[_0x7a91('0x3e')]=_[_0x7a91('0x40')](_0x4e72a7[_0x7a91('0x3e')],{'$or':_[_0x7a91('0x33')](_0x8aba2b,function(_0x21ae7b){if(_0x21ae7b[_0x7a91('0x41')]!==_0x7a91('0x42')){var _0x649d5a={};_0x649d5a[_0x21ae7b[_0x7a91('0x2b')]]={'$like':'%'+_0x238bdc['query'][_0x7a91('0x43')]+'%'};return _0x649d5a;}})});}_0x4e72a7=_['merge']({},_0x4e72a7,_0x238bdc[_0x7a91('0x44')]);var _0x4a7284={'where':_0x4e72a7['where']};return db[_0x7a91('0x2e')]['count'](_0x4a7284)[_0x7a91('0x27')](function(_0xdda9bb){_0x2e3edd[_0x7a91('0x1d')]=_0xdda9bb;if(_0x238bdc[_0x7a91('0x34')]['includeAll']){_0x4e72a7[_0x7a91('0x45')]=[{'all':!![]}];}return db[_0x7a91('0x2e')][_0x7a91('0x46')](_0x4e72a7);})[_0x7a91('0x27')](function(_0x2f5624){_0x2e3edd[_0x7a91('0x47')]=_0x2f5624;return _0x2e3edd;})[_0x7a91('0x27')](respondWithFilteredResult(_0x427c0e,_0x4e72a7))[_0x7a91('0x48')](handleError(_0x427c0e,null));};exports['show']=function(_0x354c59,_0x430e26){var _0x126279={'raw':![],'where':{'id':_0x354c59[_0x7a91('0x49')]['id']}},_0x1d7f09={};_0x1d7f09[_0x7a91('0x32')]=_['keys'](db[_0x7a91('0x2e')][_0x7a91('0x2f')]);_0x1d7f09[_0x7a91('0x34')]=_[_0x7a91('0x35')](_0x354c59['query']);_0x1d7f09[_0x7a91('0x36')]=_['intersection'](_0x1d7f09[_0x7a91('0x32')],_0x1d7f09[_0x7a91('0x34')]);_0x126279[_0x7a91('0x38')]=_[_0x7a91('0x37')](_0x1d7f09[_0x7a91('0x32')],qs[_0x7a91('0x39')](_0x354c59[_0x7a91('0x34')][_0x7a91('0x39')]));_0x126279[_0x7a91('0x38')]=_0x126279[_0x7a91('0x38')][_0x7a91('0x4a')]?_0x126279[_0x7a91('0x38')]:_0x1d7f09[_0x7a91('0x32')];if(_0x354c59[_0x7a91('0x34')][_0x7a91('0x4b')]){_0x126279[_0x7a91('0x45')]=[{'all':!![]}];}_0x126279=_['merge']({},_0x126279,_0x354c59['options']);return db[_0x7a91('0x2e')][_0x7a91('0x4c')](_0x126279)[_0x7a91('0x27')](handleEntityNotFound(_0x430e26,null))[_0x7a91('0x27')](respondWithResult(_0x430e26,null))[_0x7a91('0x48')](handleError(_0x430e26,null));};exports[_0x7a91('0x4d')]=function(_0x2d0e4f,_0x32dfae){return db[_0x7a91('0x2e')][_0x7a91('0x4d')](_0x2d0e4f['body'],{})['then'](respondWithResult(_0x32dfae,0xc9))['catch'](handleError(_0x32dfae,null));};exports['update']=function(_0x528e5b,_0x5b4422){if(_0x528e5b[_0x7a91('0x4e')]['id']){delete _0x528e5b[_0x7a91('0x4e')]['id'];}return db[_0x7a91('0x2e')][_0x7a91('0x4c')]({'where':{'id':_0x528e5b[_0x7a91('0x49')]['id']}})[_0x7a91('0x27')](handleEntityNotFound(_0x5b4422,null))[_0x7a91('0x27')](saveUpdates(_0x528e5b[_0x7a91('0x4e')],null))['then'](respondWithResult(_0x5b4422,null))[_0x7a91('0x48')](handleError(_0x5b4422,null));};exports[_0x7a91('0x26')]=function(_0x2f7c01,_0x3d5544){return db[_0x7a91('0x2e')][_0x7a91('0x4c')]({'where':{'id':_0x2f7c01[_0x7a91('0x49')]['id']}})[_0x7a91('0x27')](handleEntityNotFound(_0x3d5544,null))[_0x7a91('0x27')](removeEntity(_0x3d5544,null))[_0x7a91('0x48')](handleError(_0x3d5544,null));};exports['addConditions']=function(_0x3ce978,_0x447da5,_0x16f4da){return db['Condition'][_0x7a91('0x4c')]({'where':{'id':_0x3ce978[_0x7a91('0x49')]['id']}})[_0x7a91('0x27')](handleEntityNotFound(_0x447da5,null))[_0x7a91('0x27')](function(_0x17ac8e){if(_0x17ac8e){return _0x17ac8e['addConditions'](_0x3ce978['body'][_0x7a91('0x4f')],_[_0x7a91('0x50')](_0x3ce978[_0x7a91('0x4e')],['ids','id'])||{});}})[_0x7a91('0x27')](respondWithResult(_0x447da5,null))[_0x7a91('0x48')](handleError(_0x447da5,null));};exports[_0x7a91('0x51')]=function(_0x41c632,_0xacd711,_0x43ea4a){var _0x51469d={};var _0x33ba57={};var _0x7f8221;var _0x119648;return db[_0x7a91('0x2e')][_0x7a91('0x52')]({'where':{'id':_0x41c632[_0x7a91('0x49')]['id']}})[_0x7a91('0x27')](handleEntityNotFound(_0xacd711,null))['then'](function(_0x281d25){if(_0x281d25){_0x7f8221=_0x281d25;_0x33ba57['model']=_[_0x7a91('0x35')](db['Condition']['rawAttributes']);_0x33ba57[_0x7a91('0x34')]=_[_0x7a91('0x35')](_0x41c632[_0x7a91('0x34')]);_0x33ba57[_0x7a91('0x36')]=_[_0x7a91('0x37')](_0x33ba57[_0x7a91('0x32')],_0x33ba57['query']);_0x51469d[_0x7a91('0x38')]=_[_0x7a91('0x37')](_0x33ba57[_0x7a91('0x32')],qs['fields'](_0x41c632[_0x7a91('0x34')][_0x7a91('0x39')]));_0x51469d['attributes']=_0x51469d[_0x7a91('0x38')][_0x7a91('0x4a')]?_0x51469d['attributes']:_0x33ba57[_0x7a91('0x32')];_0x51469d[_0x7a91('0x3c')]=qs['sort'](_0x41c632[_0x7a91('0x34')][_0x7a91('0x3d')]);_0x51469d['where']=qs[_0x7a91('0x36')](_[_0x7a91('0x3f')](_0x41c632[_0x7a91('0x34')],_0x33ba57[_0x7a91('0x36')]));if(_0x41c632[_0x7a91('0x34')][_0x7a91('0x43')]){_0x51469d['where']=_[_0x7a91('0x40')](_0x51469d[_0x7a91('0x3e')],{'$or':_[_0x7a91('0x33')](_0x51469d[_0x7a91('0x38')],function(_0x1491b2){var _0x5c7fc3={};_0x5c7fc3[_0x1491b2]={'$like':'%'+_0x41c632[_0x7a91('0x34')][_0x7a91('0x43')]+'%'};return _0x5c7fc3;})});}_0x51469d=_[_0x7a91('0x40')]({},_0x51469d,_0x41c632[_0x7a91('0x44')]);return _0x7f8221[_0x7a91('0x51')](_0x51469d);}})[_0x7a91('0x27')](function(_0xdc5ce9){if(_0xdc5ce9){_0x119648=_0xdc5ce9[_0x7a91('0x4a')];if(!_0x41c632[_0x7a91('0x34')][_0x7a91('0x3a')]('nolimit')){_0x51469d[_0x7a91('0x1c')]=qs[_0x7a91('0x1c')](_0x41c632['query'][_0x7a91('0x1c')]);_0x51469d[_0x7a91('0x1e')]=qs['offset'](_0x41c632[_0x7a91('0x34')][_0x7a91('0x1e')]);}return _0x7f8221[_0x7a91('0x51')](_0x51469d);}})[_0x7a91('0x27')](function(_0x15fda5){if(_0x15fda5){return _0x15fda5?{'count':_0x119648,'rows':_0x15fda5}:null;}})[_0x7a91('0x27')](respondWithResult(_0xacd711,null))['catch'](handleError(_0xacd711,null));};exports[_0x7a91('0x53')]=function(_0x500298,_0x5d4ab8,_0x1ddf22){return db[_0x7a91('0x54')][_0x7a91('0x4c')]({'where':{'id':_0x500298['params']['id']}})['then'](handleEntityNotFound(_0x5d4ab8,null))[_0x7a91('0x27')](function(_0x45845c){if(_0x45845c){return _0x45845c[_0x7a91('0x53')](_0x500298[_0x7a91('0x4e')][_0x7a91('0x4f')],_[_0x7a91('0x50')](_0x500298['body'],['ids','id'])||{});}})[_0x7a91('0x27')](respondWithResult(_0x5d4ab8,null))[_0x7a91('0x48')](handleError(_0x5d4ab8,null));};exports['getActions']=function(_0x3bc705,_0x59d865,_0x5a4cc3){var _0x38fb2a={};var _0x34b43d={};var _0x284fbe;var _0x19058d;return db[_0x7a91('0x2e')][_0x7a91('0x52')]({'where':{'id':_0x3bc705[_0x7a91('0x49')]['id']}})[_0x7a91('0x27')](handleEntityNotFound(_0x59d865,null))[_0x7a91('0x27')](function(_0x5a12a3){if(_0x5a12a3){_0x284fbe=_0x5a12a3;_0x34b43d[_0x7a91('0x32')]=_[_0x7a91('0x35')](db[_0x7a91('0x54')][_0x7a91('0x2f')]);_0x34b43d[_0x7a91('0x34')]=_[_0x7a91('0x35')](_0x3bc705[_0x7a91('0x34')]);_0x34b43d[_0x7a91('0x36')]=_[_0x7a91('0x37')](_0x34b43d[_0x7a91('0x32')],_0x34b43d[_0x7a91('0x34')]);_0x38fb2a[_0x7a91('0x38')]=_['intersection'](_0x34b43d[_0x7a91('0x32')],qs[_0x7a91('0x39')](_0x3bc705['query'][_0x7a91('0x39')]));_0x38fb2a['attributes']=_0x38fb2a[_0x7a91('0x38')][_0x7a91('0x4a')]?_0x38fb2a[_0x7a91('0x38')]:_0x34b43d[_0x7a91('0x32')];_0x38fb2a[_0x7a91('0x3c')]=qs[_0x7a91('0x3d')](_0x3bc705[_0x7a91('0x34')][_0x7a91('0x3d')]);_0x38fb2a[_0x7a91('0x3e')]=qs[_0x7a91('0x36')](_[_0x7a91('0x3f')](_0x3bc705[_0x7a91('0x34')],_0x34b43d[_0x7a91('0x36')]));if(_0x3bc705[_0x7a91('0x34')][_0x7a91('0x43')]){_0x38fb2a[_0x7a91('0x3e')]=_[_0x7a91('0x40')](_0x38fb2a['where'],{'$or':_[_0x7a91('0x33')](_0x38fb2a[_0x7a91('0x38')],function(_0x2b6787){var _0x548d46={};_0x548d46[_0x2b6787]={'$like':'%'+_0x3bc705[_0x7a91('0x34')][_0x7a91('0x43')]+'%'};return _0x548d46;})});}_0x38fb2a=_['merge']({},_0x38fb2a,_0x3bc705['options']);return _0x284fbe['getActions'](_0x38fb2a);}})['then'](function(_0x4789de){if(_0x4789de){_0x19058d=_0x4789de[_0x7a91('0x4a')];if(!_0x3bc705['query'][_0x7a91('0x3a')](_0x7a91('0x3b'))){_0x38fb2a[_0x7a91('0x1c')]=qs[_0x7a91('0x1c')](_0x3bc705[_0x7a91('0x34')][_0x7a91('0x1c')]);_0x38fb2a[_0x7a91('0x1e')]=qs[_0x7a91('0x1e')](_0x3bc705[_0x7a91('0x34')][_0x7a91('0x1e')]);}return _0x284fbe[_0x7a91('0x55')](_0x38fb2a);}})[_0x7a91('0x27')](function(_0x2102da){if(_0x2102da){return _0x2102da?{'count':_0x19058d,'rows':_0x2102da}:null;}})[_0x7a91('0x27')](respondWithResult(_0x59d865,null))[_0x7a91('0x48')](handleError(_0x59d865,null));};
\ No newline at end of file
+var _0xe8be=['mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','destroy','name','send','index','map','Automation','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','then','rows','catch','show','params','include','create','body','find','addConditions','Condition','ids','omit','getConditions','addActions','Action','getActions','findOne','rimraf','zip-dir','fast-json-patch','moment'];(function(_0x2b511c,_0x318dcb){var _0x309268=function(_0x3a8e7d){while(--_0x3a8e7d){_0x2b511c['push'](_0x2b511c['shift']());}};_0x309268(++_0x318dcb);}(_0xe8be,0x19b));var _0xee8b=function(_0x4cd690,_0x4797cc){_0x4cd690=_0x4cd690-0x0;var _0x4a74a9=_0xe8be[_0x4cd690];return _0x4a74a9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xee8b('0x0'));var zipdir=require(_0xee8b('0x1'));var jsonpatch=require(_0xee8b('0x2'));var rp=require('request-promise');var moment=require(_0xee8b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xee8b('0x4'));var util=require('util');var path=require(_0xee8b('0x5'));var sox=require(_0xee8b('0x6'));var csv=require(_0xee8b('0x7'));var ejs=require(_0xee8b('0x8'));var fs=require('fs');var fs_extra=require(_0xee8b('0x9'));var _=require(_0xee8b('0xa'));var squel=require(_0xee8b('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xee8b('0xc'));var toCsv=require(_0xee8b('0x7'));var querystring=require(_0xee8b('0xd'));var Papa=require(_0xee8b('0xe'));var Redis=require(_0xee8b('0xf'));var authService=require(_0xee8b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xee8b('0x11'));var hardwareService=require(_0xee8b('0x12'));var logger=require('../../config/logger')(_0xee8b('0x13'));var utils=require(_0xee8b('0x14'));var config=require(_0xee8b('0x15'));var licenseUtil=require(_0xee8b('0x16'));var db=require(_0xee8b('0x17'))['db'];function respondWithStatusCode(_0x41022f,_0x44836c){_0x44836c=_0x44836c||0xcc;return function(_0x55bff8){if(_0x55bff8){return _0x41022f[_0xee8b('0x18')](_0x44836c);}return _0x41022f['status'](_0x44836c)['end']();};}function respondWithResult(_0x53e72f,_0x592e19){_0x592e19=_0x592e19||0xc8;return function(_0x4e3e21){if(_0x4e3e21){return _0x53e72f[_0xee8b('0x19')](_0x592e19)['json'](_0x4e3e21);}};}function respondWithFilteredResult(_0x3530f5,_0x3cffc0){return function(_0x1106d3){if(_0x1106d3){var _0x5eb48a=typeof _0x3cffc0[_0xee8b('0x1a')]===_0xee8b('0x1b')&&typeof _0x3cffc0[_0xee8b('0x1c')]==='undefined';var _0x56192d=_0x1106d3[_0xee8b('0x1d')];var _0x44829d=_0x5eb48a?0x0:_0x3cffc0[_0xee8b('0x1a')];var _0x41714d=_0x5eb48a?_0x1106d3[_0xee8b('0x1d')]:_0x3cffc0[_0xee8b('0x1a')]+_0x3cffc0[_0xee8b('0x1c')];var _0x810edb;if(_0x41714d>=_0x56192d){_0x41714d=_0x56192d;_0x810edb=0xc8;}else{_0x810edb=0xce;}_0x3530f5[_0xee8b('0x19')](_0x810edb);return _0x3530f5[_0xee8b('0x1e')](_0xee8b('0x1f'),_0x44829d+'-'+_0x41714d+'/'+_0x56192d)[_0xee8b('0x20')](_0x1106d3);}return null;};}function patchUpdates(_0x457922){return function(_0x261be0){try{jsonpatch[_0xee8b('0x21')](_0x261be0,_0x457922,!![]);}catch(_0x1fa9a4){return BPromise['reject'](_0x1fa9a4);}return _0x261be0[_0xee8b('0x22')]();};}function saveUpdates(_0x92a999,_0x1726b1){return function(_0x32e3ea){if(_0x32e3ea){return _0x32e3ea[_0xee8b('0x23')](_0x92a999)['then'](function(_0x4b421f){return _0x4b421f;});}return null;};}function removeEntity(_0xf6eb4b,_0x217bb7){return function(_0xbfcf77){if(_0xbfcf77){return _0xbfcf77[_0xee8b('0x24')]()['then'](function(){_0xf6eb4b[_0xee8b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3686d9,_0x183c07){return function(_0x5f5d03){if(!_0x5f5d03){_0x3686d9['sendStatus'](0x194);}return _0x5f5d03;};}function handleError(_0x5391db,_0x14734a){_0x14734a=_0x14734a||0x1f4;return function(_0x387b21){logger['error'](_0x387b21['stack']);if(_0x387b21[_0xee8b('0x25')]){delete _0x387b21[_0xee8b('0x25')];}_0x5391db[_0xee8b('0x19')](_0x14734a)[_0xee8b('0x26')](_0x387b21);};}exports[_0xee8b('0x27')]=function(_0x378926,_0x41484e){var _0x42f0d9={},_0x85dc78={},_0x2286b4={'count':0x0,'rows':[]};var _0x14ac32=_[_0xee8b('0x28')](db[_0xee8b('0x29')][_0xee8b('0x2a')],function(_0x3e19c2){return{'name':_0x3e19c2['fieldName'],'type':_0x3e19c2[_0xee8b('0x2b')][_0xee8b('0x2c')]};});_0x85dc78[_0xee8b('0x2d')]=_['map'](_0x14ac32,_0xee8b('0x25'));_0x85dc78[_0xee8b('0x2e')]=_[_0xee8b('0x2f')](_0x378926[_0xee8b('0x2e')]);_0x85dc78[_0xee8b('0x30')]=_[_0xee8b('0x31')](_0x85dc78[_0xee8b('0x2d')],_0x85dc78[_0xee8b('0x2e')]);_0x42f0d9[_0xee8b('0x32')]=_['intersection'](_0x85dc78[_0xee8b('0x2d')],qs['fields'](_0x378926[_0xee8b('0x2e')][_0xee8b('0x33')]));_0x42f0d9[_0xee8b('0x32')]=_0x42f0d9['attributes'][_0xee8b('0x34')]?_0x42f0d9[_0xee8b('0x32')]:_0x85dc78[_0xee8b('0x2d')];if(!_0x378926[_0xee8b('0x2e')][_0xee8b('0x35')](_0xee8b('0x36'))){_0x42f0d9[_0xee8b('0x1c')]=qs[_0xee8b('0x1c')](_0x378926[_0xee8b('0x2e')][_0xee8b('0x1c')]);_0x42f0d9['offset']=qs[_0xee8b('0x1a')](_0x378926[_0xee8b('0x2e')]['offset']);}_0x42f0d9[_0xee8b('0x37')]=qs[_0xee8b('0x38')](_0x378926[_0xee8b('0x2e')][_0xee8b('0x38')]);_0x42f0d9[_0xee8b('0x39')]=qs['filters'](_[_0xee8b('0x3a')](_0x378926[_0xee8b('0x2e')],_0x85dc78[_0xee8b('0x30')]),_0x14ac32);if(_0x378926[_0xee8b('0x2e')][_0xee8b('0x3b')]){_0x42f0d9['where']=_[_0xee8b('0x3c')](_0x42f0d9[_0xee8b('0x39')],{'$or':_[_0xee8b('0x28')](_0x14ac32,function(_0xe16e70){if(_0xe16e70[_0xee8b('0x2b')]!==_0xee8b('0x3d')){var _0x748e9d={};_0x748e9d[_0xe16e70[_0xee8b('0x25')]]={'$like':'%'+_0x378926[_0xee8b('0x2e')]['filter']+'%'};return _0x748e9d;}})});}_0x42f0d9=_[_0xee8b('0x3c')]({},_0x42f0d9,_0x378926[_0xee8b('0x3e')]);var _0x22c372={'where':_0x42f0d9[_0xee8b('0x39')]};return db[_0xee8b('0x29')][_0xee8b('0x1d')](_0x22c372)['then'](function(_0xcba757){_0x2286b4[_0xee8b('0x1d')]=_0xcba757;if(_0x378926[_0xee8b('0x2e')][_0xee8b('0x3f')]){_0x42f0d9['include']=[{'all':!![]}];}return db[_0xee8b('0x29')][_0xee8b('0x40')](_0x42f0d9);})[_0xee8b('0x41')](function(_0x282c7b){_0x2286b4[_0xee8b('0x42')]=_0x282c7b;return _0x2286b4;})[_0xee8b('0x41')](respondWithFilteredResult(_0x41484e,_0x42f0d9))[_0xee8b('0x43')](handleError(_0x41484e,null));};exports[_0xee8b('0x44')]=function(_0xf1ee8d,_0x40a966){var _0x185eae={'raw':![],'where':{'id':_0xf1ee8d[_0xee8b('0x45')]['id']}},_0x383a17={};_0x383a17[_0xee8b('0x2d')]=_[_0xee8b('0x2f')](db[_0xee8b('0x29')][_0xee8b('0x2a')]);_0x383a17[_0xee8b('0x2e')]=_[_0xee8b('0x2f')](_0xf1ee8d[_0xee8b('0x2e')]);_0x383a17['filters']=_[_0xee8b('0x31')](_0x383a17[_0xee8b('0x2d')],_0x383a17[_0xee8b('0x2e')]);_0x185eae[_0xee8b('0x32')]=_['intersection'](_0x383a17['model'],qs['fields'](_0xf1ee8d[_0xee8b('0x2e')][_0xee8b('0x33')]));_0x185eae[_0xee8b('0x32')]=_0x185eae[_0xee8b('0x32')][_0xee8b('0x34')]?_0x185eae[_0xee8b('0x32')]:_0x383a17[_0xee8b('0x2d')];if(_0xf1ee8d[_0xee8b('0x2e')][_0xee8b('0x3f')]){_0x185eae[_0xee8b('0x46')]=[{'all':!![]}];}_0x185eae=_['merge']({},_0x185eae,_0xf1ee8d['options']);return db[_0xee8b('0x29')]['find'](_0x185eae)[_0xee8b('0x41')](handleEntityNotFound(_0x40a966,null))[_0xee8b('0x41')](respondWithResult(_0x40a966,null))[_0xee8b('0x43')](handleError(_0x40a966,null));};exports[_0xee8b('0x47')]=function(_0x322cf1,_0x4bd5c8){return db['Automation'][_0xee8b('0x47')](_0x322cf1[_0xee8b('0x48')],{})[_0xee8b('0x41')](respondWithResult(_0x4bd5c8,0xc9))[_0xee8b('0x43')](handleError(_0x4bd5c8,null));};exports[_0xee8b('0x23')]=function(_0x28c8db,_0x29654d){if(_0x28c8db[_0xee8b('0x48')]['id']){delete _0x28c8db['body']['id'];}return db['Automation'][_0xee8b('0x49')]({'where':{'id':_0x28c8db[_0xee8b('0x45')]['id']}})[_0xee8b('0x41')](handleEntityNotFound(_0x29654d,null))[_0xee8b('0x41')](saveUpdates(_0x28c8db[_0xee8b('0x48')],null))[_0xee8b('0x41')](respondWithResult(_0x29654d,null))[_0xee8b('0x43')](handleError(_0x29654d,null));};exports[_0xee8b('0x24')]=function(_0x1b9385,_0x343060){return db[_0xee8b('0x29')][_0xee8b('0x49')]({'where':{'id':_0x1b9385['params']['id']}})[_0xee8b('0x41')](handleEntityNotFound(_0x343060,null))['then'](removeEntity(_0x343060,null))[_0xee8b('0x43')](handleError(_0x343060,null));};exports[_0xee8b('0x4a')]=function(_0x10e23e,_0x2b99a3,_0x282f44){return db[_0xee8b('0x4b')]['find']({'where':{'id':_0x10e23e['params']['id']}})[_0xee8b('0x41')](handleEntityNotFound(_0x2b99a3,null))['then'](function(_0xcb9531){if(_0xcb9531){return _0xcb9531[_0xee8b('0x4a')](_0x10e23e[_0xee8b('0x48')][_0xee8b('0x4c')],_[_0xee8b('0x4d')](_0x10e23e[_0xee8b('0x48')],[_0xee8b('0x4c'),'id'])||{});}})[_0xee8b('0x41')](respondWithResult(_0x2b99a3,null))[_0xee8b('0x43')](handleError(_0x2b99a3,null));};exports[_0xee8b('0x4e')]=function(_0x40a0b5,_0x14f78d,_0x122614){var _0x30b200={};var _0x4247a9={};var _0x25a318;var _0x33a769;return db[_0xee8b('0x29')]['findOne']({'where':{'id':_0x40a0b5[_0xee8b('0x45')]['id']}})['then'](handleEntityNotFound(_0x14f78d,null))[_0xee8b('0x41')](function(_0x388752){if(_0x388752){_0x25a318=_0x388752;_0x4247a9[_0xee8b('0x2d')]=_['keys'](db[_0xee8b('0x4b')][_0xee8b('0x2a')]);_0x4247a9[_0xee8b('0x2e')]=_['keys'](_0x40a0b5['query']);_0x4247a9[_0xee8b('0x30')]=_[_0xee8b('0x31')](_0x4247a9[_0xee8b('0x2d')],_0x4247a9['query']);_0x30b200[_0xee8b('0x32')]=_['intersection'](_0x4247a9['model'],qs[_0xee8b('0x33')](_0x40a0b5[_0xee8b('0x2e')][_0xee8b('0x33')]));_0x30b200[_0xee8b('0x32')]=_0x30b200[_0xee8b('0x32')][_0xee8b('0x34')]?_0x30b200[_0xee8b('0x32')]:_0x4247a9['model'];_0x30b200[_0xee8b('0x37')]=qs['sort'](_0x40a0b5['query']['sort']);_0x30b200[_0xee8b('0x39')]=qs['filters'](_['pick'](_0x40a0b5[_0xee8b('0x2e')],_0x4247a9[_0xee8b('0x30')]));if(_0x40a0b5['query']['filter']){_0x30b200[_0xee8b('0x39')]=_['merge'](_0x30b200[_0xee8b('0x39')],{'$or':_[_0xee8b('0x28')](_0x30b200[_0xee8b('0x32')],function(_0x57e18f){var _0x31bc1={};_0x31bc1[_0x57e18f]={'$like':'%'+_0x40a0b5['query'][_0xee8b('0x3b')]+'%'};return _0x31bc1;})});}_0x30b200=_[_0xee8b('0x3c')]({},_0x30b200,_0x40a0b5[_0xee8b('0x3e')]);return _0x25a318['getConditions'](_0x30b200);}})[_0xee8b('0x41')](function(_0x1ebe4c){if(_0x1ebe4c){_0x33a769=_0x1ebe4c[_0xee8b('0x34')];if(!_0x40a0b5[_0xee8b('0x2e')][_0xee8b('0x35')]('nolimit')){_0x30b200[_0xee8b('0x1c')]=qs[_0xee8b('0x1c')](_0x40a0b5[_0xee8b('0x2e')][_0xee8b('0x1c')]);_0x30b200[_0xee8b('0x1a')]=qs['offset'](_0x40a0b5[_0xee8b('0x2e')]['offset']);}return _0x25a318[_0xee8b('0x4e')](_0x30b200);}})[_0xee8b('0x41')](function(_0x3f26eb){if(_0x3f26eb){return _0x3f26eb?{'count':_0x33a769,'rows':_0x3f26eb}:null;}})[_0xee8b('0x41')](respondWithResult(_0x14f78d,null))[_0xee8b('0x43')](handleError(_0x14f78d,null));};exports[_0xee8b('0x4f')]=function(_0x37081d,_0xe9d712,_0x19ec56){return db[_0xee8b('0x50')]['find']({'where':{'id':_0x37081d[_0xee8b('0x45')]['id']}})[_0xee8b('0x41')](handleEntityNotFound(_0xe9d712,null))[_0xee8b('0x41')](function(_0x1189ea){if(_0x1189ea){return _0x1189ea[_0xee8b('0x4f')](_0x37081d[_0xee8b('0x48')]['ids'],_[_0xee8b('0x4d')](_0x37081d['body'],['ids','id'])||{});}})[_0xee8b('0x41')](respondWithResult(_0xe9d712,null))[_0xee8b('0x43')](handleError(_0xe9d712,null));};exports[_0xee8b('0x51')]=function(_0x462886,_0x56aadc,_0x5e83e9){var _0x38b418={};var _0x29fb50={};var _0x3d3b3e;var _0x5f362f;return db['Automation'][_0xee8b('0x52')]({'where':{'id':_0x462886[_0xee8b('0x45')]['id']}})['then'](handleEntityNotFound(_0x56aadc,null))['then'](function(_0x1572f0){if(_0x1572f0){_0x3d3b3e=_0x1572f0;_0x29fb50[_0xee8b('0x2d')]=_[_0xee8b('0x2f')](db[_0xee8b('0x50')][_0xee8b('0x2a')]);_0x29fb50[_0xee8b('0x2e')]=_['keys'](_0x462886[_0xee8b('0x2e')]);_0x29fb50[_0xee8b('0x30')]=_[_0xee8b('0x31')](_0x29fb50[_0xee8b('0x2d')],_0x29fb50[_0xee8b('0x2e')]);_0x38b418['attributes']=_['intersection'](_0x29fb50[_0xee8b('0x2d')],qs[_0xee8b('0x33')](_0x462886['query'][_0xee8b('0x33')]));_0x38b418[_0xee8b('0x32')]=_0x38b418[_0xee8b('0x32')][_0xee8b('0x34')]?_0x38b418[_0xee8b('0x32')]:_0x29fb50['model'];_0x38b418[_0xee8b('0x37')]=qs[_0xee8b('0x38')](_0x462886['query'][_0xee8b('0x38')]);_0x38b418[_0xee8b('0x39')]=qs[_0xee8b('0x30')](_[_0xee8b('0x3a')](_0x462886['query'],_0x29fb50['filters']));if(_0x462886[_0xee8b('0x2e')][_0xee8b('0x3b')]){_0x38b418[_0xee8b('0x39')]=_[_0xee8b('0x3c')](_0x38b418[_0xee8b('0x39')],{'$or':_[_0xee8b('0x28')](_0x38b418['attributes'],function(_0xe00493){var _0x1e9f30={};_0x1e9f30[_0xe00493]={'$like':'%'+_0x462886[_0xee8b('0x2e')][_0xee8b('0x3b')]+'%'};return _0x1e9f30;})});}_0x38b418=_['merge']({},_0x38b418,_0x462886['options']);return _0x3d3b3e[_0xee8b('0x51')](_0x38b418);}})[_0xee8b('0x41')](function(_0x4881b8){if(_0x4881b8){_0x5f362f=_0x4881b8[_0xee8b('0x34')];if(!_0x462886['query'][_0xee8b('0x35')](_0xee8b('0x36'))){_0x38b418[_0xee8b('0x1c')]=qs['limit'](_0x462886[_0xee8b('0x2e')][_0xee8b('0x1c')]);_0x38b418[_0xee8b('0x1a')]=qs[_0xee8b('0x1a')](_0x462886[_0xee8b('0x2e')]['offset']);}return _0x3d3b3e['getActions'](_0x38b418);}})[_0xee8b('0x41')](function(_0x21e677){if(_0x21e677){return _0x21e677?{'count':_0x5f362f,'rows':_0x21e677}:null;}})['then'](respondWithResult(_0x56aadc,null))['catch'](handleError(_0x56aadc,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index dfacca2..3886b3a 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 _0x2fd2=['util','moment','bluebird','path','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations'];(function(_0x5d07f3,_0x5654b2){var _0x51eae0=function(_0x2d3735){while(--_0x2d3735){_0x5d07f3['push'](_0x5d07f3['shift']());}};_0x51eae0(++_0x5654b2);}(_0x2fd2,0x96));var _0x22fd=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x2fd2[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require(_0x22fd('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x22fd('0x1'));var BPromise=require(_0x22fd('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x22fd('0x3'));var rimraf=require('rimraf');var config=require(_0x22fd('0x4'));var attributes=require(_0x22fd('0x5'));module[_0x22fd('0x6')]=function(_0x4d7a9e,_0x1eb773){return _0x4d7a9e[_0x22fd('0x7')](_0x22fd('0x8'),attributes,{'tableName':_0x22fd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc916=['Automation','tools_automations','lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./automation.attributes','exports','define'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc916,0x16a));var _0x6c91=function(_0x3d34da,_0x3abcc1){_0x3d34da=_0x3d34da-0x0;var _0xcf6af8=_0xc916[_0x3d34da];return _0xcf6af8;};'use strict';var _=require(_0x6c91('0x0'));var util=require(_0x6c91('0x1'));var logger=require(_0x6c91('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6c91('0x3'));var rp=require(_0x6c91('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6c91('0x5'));var config=require(_0x6c91('0x6'));var attributes=require(_0x6c91('0x7'));module[_0x6c91('0x8')]=function(_0x341c0,_0xc07b40){return _0x341c0[_0x6c91('0x9')](_0x6c91('0xa'),attributes,{'tableName':_0x6c91('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index aab2a4c..878898c 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 _0x87bc=['http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/logger','client'];(function(_0x4b7b69,_0x3ab075){var _0x173b4c=function(_0x234d5f){while(--_0x234d5f){_0x4b7b69['push'](_0x4b7b69['shift']());}};_0x173b4c(++_0x3ab075);}(_0x87bc,0x189));var _0xc87b=function(_0x16f3bc,_0x46567a){_0x16f3bc=_0x16f3bc-0x0;var _0x3228d1=_0x87bc[_0x16f3bc];return _0x3228d1;};'use strict';var _=require(_0xc87b('0x0'));var util=require(_0xc87b('0x1'));var moment=require('moment');var BPromise=require(_0xc87b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc87b('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xc87b('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc87b('0x5')][_0xc87b('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x402aac,_0x5d1813,_0x50b19b){return new BPromise(function(_0x4ed0c5,_0x1999f8){return client[_0xc87b('0x7')](_0x402aac,_0x50b19b)[_0xc87b('0x8')](function(_0x19b571){logger[_0xc87b('0x9')](_0xc87b('0xa'),_0x5d1813,_0xc87b('0xb'));logger[_0xc87b('0xc')](_0xc87b('0xd'),_0x5d1813,'request\x20sent',JSON['stringify'](_0x19b571));if(_0x19b571[_0xc87b('0xe')]){if(_0x19b571['error'][_0xc87b('0xf')]===0x1f4){logger[_0xc87b('0xe')](_0xc87b('0xa'),_0x5d1813,_0x19b571[_0xc87b('0xe')]['message']);return _0x1999f8(_0x19b571[_0xc87b('0xe')]['message']);}logger[_0xc87b('0xe')](_0xc87b('0xa'),_0x5d1813,_0x19b571['error'][_0xc87b('0x10')]);return _0x4ed0c5(_0x19b571[_0xc87b('0xe')]['message']);}else{logger[_0xc87b('0x9')](_0xc87b('0xa'),_0x5d1813,_0xc87b('0xb'));_0x4ed0c5(_0x19b571[_0xc87b('0x11')][_0xc87b('0x10')]);}})[_0xc87b('0x12')](function(_0x4009ef){logger[_0xc87b('0xe')]('Automation,\x20%s,\x20%s',_0x5d1813,_0x4009ef);_0x1999f8(_0x4009ef);});});}
\ No newline at end of file
+var _0x6b19=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','then','info','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','moment','bluebird'];(function(_0x42c698,_0x35f692){var _0x242000=function(_0x55444f){while(--_0x55444f){_0x42c698['push'](_0x42c698['shift']());}};_0x242000(++_0x35f692);}(_0x6b19,0xf4));var _0x96b1=function(_0x43349f,_0xf0d647){_0x43349f=_0x43349f-0x0;var _0x1e5618=_0x6b19[_0x43349f];return _0x1e5618;};'use strict';var _=require(_0x96b1('0x0'));var util=require('util');var moment=require(_0x96b1('0x1'));var BPromise=require(_0x96b1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x96b1('0x3'));var db=require(_0x96b1('0x4'))['db'];var utils=require(_0x96b1('0x5'));var logger=require(_0x96b1('0x6'))('rpc');var config=require(_0x96b1('0x7'));var jayson=require(_0x96b1('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x288d77,_0x2347c5,_0x519fbe){return new BPromise(function(_0x280b00,_0x2300ad){return client['request'](_0x288d77,_0x519fbe)[_0x96b1('0x9')](function(_0x6323a6){logger[_0x96b1('0xa')](_0x96b1('0xb'),_0x2347c5,_0x96b1('0xc'));logger['debug'](_0x96b1('0xd'),_0x2347c5,'request\x20sent',JSON['stringify'](_0x6323a6));if(_0x6323a6['error']){if(_0x6323a6['error'][_0x96b1('0xe')]===0x1f4){logger[_0x96b1('0xf')](_0x96b1('0xb'),_0x2347c5,_0x6323a6[_0x96b1('0xf')][_0x96b1('0x10')]);return _0x2300ad(_0x6323a6['error'][_0x96b1('0x10')]);}logger[_0x96b1('0xf')](_0x96b1('0xb'),_0x2347c5,_0x6323a6[_0x96b1('0xf')][_0x96b1('0x10')]);return _0x280b00(_0x6323a6[_0x96b1('0xf')][_0x96b1('0x10')]);}else{logger[_0x96b1('0xa')](_0x96b1('0xb'),_0x2347c5,'request\x20sent');_0x280b00(_0x6323a6[_0x96b1('0x11')][_0x96b1('0x10')]);}})[_0x96b1('0x12')](function(_0x350b2c){logger[_0x96b1('0xf')](_0x96b1('0xb'),_0x2347c5,_0x350b2c);_0x2300ad(_0x350b2c);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 55bdd4b..3463dae 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 _0xe28f=['post','addConditions','addActions','put','/:id','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','/:id/conditions','getConditions','/:id/actions','getActions'];(function(_0x3d6593,_0x207831){var _0x436a32=function(_0x83a2ab){while(--_0x83a2ab){_0x3d6593['push'](_0x3d6593['shift']());}};_0x436a32(++_0x207831);}(_0xe28f,0x1e9));var _0xfe28=function(_0x447f1b,_0x2e5b12){_0x447f1b=_0x447f1b-0x0;var _0x1b0770=_0xe28f[_0x447f1b];return _0x1b0770;};'use strict';var multer=require(_0xfe28('0x0'));var util=require(_0xfe28('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfe28('0x2'));var router=express[_0xfe28('0x3')]();var fs_extra=require(_0xfe28('0x4'));var auth=require(_0xfe28('0x5'));var interaction=require(_0xfe28('0x6'));var config=require(_0xfe28('0x7'));var controller=require('./automation.controller');router[_0xfe28('0x8')]('/',auth[_0xfe28('0x9')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0xfe28('0xa')]);router[_0xfe28('0x8')](_0xfe28('0xb'),auth[_0xfe28('0x9')](),controller[_0xfe28('0xc')]);router[_0xfe28('0x8')](_0xfe28('0xd'),auth['isAuthenticated'](),controller[_0xfe28('0xe')]);router[_0xfe28('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xfe28('0xf')](_0xfe28('0xb'),auth[_0xfe28('0x9')](),controller[_0xfe28('0x10')]);router['post'](_0xfe28('0xd'),auth['isAuthenticated'](),controller[_0xfe28('0x11')]);router[_0xfe28('0x12')](_0xfe28('0x13'),auth[_0xfe28('0x9')](),controller[_0xfe28('0x14')]);router[_0xfe28('0x15')](_0xfe28('0x13'),auth[_0xfe28('0x9')](),controller[_0xfe28('0x16')]);module[_0xfe28('0x17')]=router;
\ No newline at end of file
+var _0x4c6d=['express','fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','get','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','isAuthenticated','create','addActions','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x26e727,_0x3e65be){var _0x563800=function(_0xbcf999){while(--_0xbcf999){_0x26e727['push'](_0x26e727['shift']());}};_0x563800(++_0x3e65be);}(_0x4c6d,0x1d0));var _0xd4c6=function(_0x5c1239,_0x47bceb){_0x5c1239=_0x5c1239-0x0;var _0x5235fd=_0x4c6d[_0x5c1239];return _0x5235fd;};'use strict';var multer=require(_0xd4c6('0x0'));var util=require(_0xd4c6('0x1'));var path=require(_0xd4c6('0x2'));var timeout=require(_0xd4c6('0x3'));var express=require(_0xd4c6('0x4'));var router=express['Router']();var fs_extra=require(_0xd4c6('0x5'));var auth=require(_0xd4c6('0x6'));var interaction=require(_0xd4c6('0x7'));var config=require('../../config/environment');var controller=require(_0xd4c6('0x8'));router[_0xd4c6('0x9')]('/',auth['isAuthenticated'](),controller[_0xd4c6('0xa')]);router[_0xd4c6('0x9')](_0xd4c6('0xb'),auth['isAuthenticated'](),controller[_0xd4c6('0xc')]);router[_0xd4c6('0x9')](_0xd4c6('0xd'),auth['isAuthenticated'](),controller[_0xd4c6('0xe')]);router[_0xd4c6('0x9')](_0xd4c6('0xf'),auth['isAuthenticated'](),controller[_0xd4c6('0x10')]);router[_0xd4c6('0x11')]('/',auth[_0xd4c6('0x12')](),controller[_0xd4c6('0x13')]);router[_0xd4c6('0x11')](_0xd4c6('0xd'),auth['isAuthenticated'](),controller['addConditions']);router[_0xd4c6('0x11')]('/:id/actions',auth[_0xd4c6('0x12')](),controller[_0xd4c6('0x14')]);router[_0xd4c6('0x15')](_0xd4c6('0xb'),auth[_0xd4c6('0x12')](),controller[_0xd4c6('0x16')]);router[_0xd4c6('0x17')]('/:id',auth['isAuthenticated'](),controller[_0xd4c6('0x18')]);module[_0xd4c6('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index dab0822..41064c0 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 _0xd4e1=['ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name'];(function(_0x29a56b,_0x58dbb7){var _0x33717f=function(_0x3c648a){while(--_0x3c648a){_0x29a56b['push'](_0x29a56b['shift']());}};_0x33717f(++_0x58dbb7);}(_0xd4e1,0x140));var _0x1d4e=function(_0x4b6346,_0x504489){_0x4b6346=_0x4b6346-0x0;var _0x56c1d1=_0xd4e1[_0x4b6346];return _0x56c1d1;};'use strict';var Sequelize=require(_0x1d4e('0x0'));module[_0x1d4e('0x1')]={'name':{'type':Sequelize[_0x1d4e('0x2')],'unique':_0x1d4e('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x1d4e('0x4')](_0x1d4e('0x5')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x1d4e('0x2')]},'active':{'type':Sequelize[_0x1d4e('0x6')],'defaultValue':0x0,'comment':_0x1d4e('0x7')},'limitCalls':{'type':Sequelize[_0x1d4e('0x8')](0x4)[_0x1d4e('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x1d4e('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x1d4e('0x8')](0x3)[_0x1d4e('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1d4e('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1d4e('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x1d4e('0x8')](0x5)[_0x1d4e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1d4e('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x1d4e('0x8')](0x3)[_0x1d4e('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x1d4e('0x8')](0x5)[_0x1d4e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x1d4e('0x8')](0x3)[_0x1d4e('0x9')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1d4e('0x8')](0x5)[_0x1d4e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x1d4e('0x8')](0x3)[_0x1d4e('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1d4e('0xc')},'dialTimezone':{'type':Sequelize[_0x1d4e('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x1d4e('0xd')},'dialCheckDuplicateType':{'type':Sequelize[_0x1d4e('0x4')](_0x1d4e('0xe'),'never',_0x1d4e('0xf')),'defaultValue':_0x1d4e('0xe')},'dialAMDActive':{'type':Sequelize[_0x1d4e('0x6')],'defaultValue':0x0,'comment':_0x1d4e('0x10')},'dialAMDInitialSilence':{'type':Sequelize[_0x1d4e('0x8')](0x9)[_0x1d4e('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x1d4e('0x11')},'dialAMDGreeting':{'type':Sequelize[_0x1d4e('0x8')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x1d4e('0x12')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1d4e('0x8')](0x9)[_0x1d4e('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x1d4e('0x13')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x1d4e('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1d4e('0x14')},'dialAMDMinWordLength':{'type':Sequelize[_0x1d4e('0x8')](0x9)[_0x1d4e('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1d4e('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1d4e('0x8')](0x9)[_0x1d4e('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x1d4e('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x1d4e('0x8')](0x9)[_0x1d4e('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x1d4e('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x1d4e('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x1d4e('0x8')](0x9)[_0x1d4e('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x1d4e('0x4')](_0x1d4e('0x18'),_0x1d4e('0x19')),'defaultValue':_0x1d4e('0x18')},'dialPrefix':{'type':Sequelize[_0x1d4e('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1d4e('0x1a')},'dialCutDigit':{'type':Sequelize[_0x1d4e('0x8')](0x3)[_0x1d4e('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1d4e('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x1d4e('0x8')](0x3)[_0x1d4e('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1d4e('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x1d4e('0x8')](0x5)[_0x1d4e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x1d4e('0x8')](0x3)[_0x1d4e('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1d4e('0x1d')},'dialDropRetryFrequency':{'type':Sequelize[_0x1d4e('0x8')](0x5)[_0x1d4e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1d4e('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x1d4e('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1d4e('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x1d4e('0x8')](0x5)[_0x1d4e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x1d4e('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1d4e('0x20')},'dialMachineRetryFrequency':{'type':Sequelize[_0x1d4e('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1d4e('0x21')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1d4e('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1d4e('0x22')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x1d4e('0x8')](0x5)[_0x1d4e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1d4e('0x23')}};
\ No newline at end of file
+var _0x9727=['Active/Disactive\x20Campaign','Max\x20200\x20calls.','INTEGER','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)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','name','ENUM','BOOLEAN'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9727,0xcd));var _0x7972=function(_0x34bc94,_0x74f0fd){_0x34bc94=_0x34bc94-0x0;var _0xee41e7=_0x9727[_0x34bc94];return _0xee41e7;};'use strict';var Sequelize=require('sequelize');module[_0x7972('0x0')]={'name':{'type':Sequelize[_0x7972('0x1')],'unique':_0x7972('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x7972('0x3')]('ivr'),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x7972('0x1')]},'active':{'type':Sequelize[_0x7972('0x4')],'defaultValue':0x0,'comment':_0x7972('0x5')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x7972('0x6')},'dialOriginateCallerIdName':{'type':Sequelize[_0x7972('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x7972('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x7972('0x7')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7972('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0x7972('0x7')](0x3)[_0x7972('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7972('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x7972('0x7')](0x5)[_0x7972('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7972('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x7972('0x7')](0x3)[_0x7972('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7972('0xc')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7972('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7972('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7972('0x9')],'defaultValue':0x3,'comment':_0x7972('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7972('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7972('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0x7972('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x7972('0x10')},'dialTimezone':{'type':Sequelize[_0x7972('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x7972('0x1')],'defaultValue':_0x7972('0x11')},'dialCheckDuplicateType':{'type':Sequelize[_0x7972('0x3')]('always',_0x7972('0x12'),_0x7972('0x13')),'defaultValue':_0x7972('0x14')},'dialAMDActive':{'type':Sequelize[_0x7972('0x4')],'defaultValue':0x0,'comment':_0x7972('0x15')},'dialAMDInitialSilence':{'type':Sequelize[_0x7972('0x7')](0x9)[_0x7972('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x7972('0x16')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x7972('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x7972('0x17')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x7972('0x7')](0x9)[_0x7972('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x7972('0x18')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x7972('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7972('0x19')},'dialAMDMinWordLength':{'type':Sequelize[_0x7972('0x7')](0x9)[_0x7972('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x7972('0x7')](0x9)[_0x7972('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x7972('0x1a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x7972('0x7')](0x9)[_0x7972('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x7972('0x1b')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x7972('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x7972('0x1c')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x7972('0x7')](0x9)[_0x7972('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7972('0x1d')},'dialOrderByScheduledAt':{'type':Sequelize[_0x7972('0x3')]('DESC',_0x7972('0x1e')),'defaultValue':_0x7972('0x1f')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x7972('0x7')](0x3)[_0x7972('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7972('0x20')},'dialCutDigit':{'type':Sequelize[_0x7972('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7972('0x21')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x7972('0x7')](0x3)[_0x7972('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7972('0x22')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x7972('0x7')](0x5)[_0x7972('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7972('0x23')},'dialDropMaxRetry':{'type':Sequelize[_0x7972('0x7')](0x3)[_0x7972('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x7972('0x7')](0x5)[_0x7972('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7972('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7972('0x24')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7972('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7972('0x25')},'dialMachineMaxRetry':{'type':Sequelize[_0x7972('0x7')](0x3)[_0x7972('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7972('0x26')},'dialMachineRetryFrequency':{'type':Sequelize[_0x7972('0x7')](0x5)[_0x7972('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7972('0x27')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7972('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7972('0x28')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x7972('0x7')](0x5)[_0x7972('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7972('0x29')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index d22162c..e613d0f 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 _0xa521=['order','sort','pick','filter','where','merge','VIRTUAL','options','include','rows','catch','show','params','keys','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','includeAll','createdAt','updatedAt','body','omit','getHoppers','findOne','hasOwnProperty','nolimit','CampaignId','CmHopper','findAll','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','insert','into','fromQuery','phone','scheduledAt','ContactId','ListId','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','h.ContactId\x20=\x20ci.CmContactId','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','format','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','update','then','destroy','IvrCampaigns','UserProfileResource','stack','send','index','map','Campaign','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','attributes','fields','length'];(function(_0x17f773,_0x3e3f55){var _0x16576d=function(_0x220150){while(--_0x220150){_0x17f773['push'](_0x17f773['shift']());}};_0x16576d(++_0x3e3f55);}(_0xa521,0xeb));var _0x1a52=function(_0x562d8a,_0x2b1ef7){_0x562d8a=_0x562d8a-0x0;var _0x3b8442=_0xa521[_0x562d8a];return _0x3b8442;};'use strict';var emlformat=require(_0x1a52('0x0'));var rimraf=require(_0x1a52('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1a52('0x2'));var moment=require(_0x1a52('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1a52('0x4'));var util=require(_0x1a52('0x5'));var path=require(_0x1a52('0x6'));var sox=require(_0x1a52('0x7'));var csv=require(_0x1a52('0x8'));var ejs=require(_0x1a52('0x9'));var fs=require('fs');var fs_extra=require(_0x1a52('0xa'));var _=require(_0x1a52('0xb'));var squel=require(_0x1a52('0xc'));var crypto=require(_0x1a52('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1a52('0xe'));var Redis=require('ioredis');var authService=require(_0x1a52('0xf'));var qs=require(_0x1a52('0x10'));var as=require(_0x1a52('0x11'));var hardwareService=require(_0x1a52('0x12'));var logger=require('../../config/logger')(_0x1a52('0x13'));var utils=require('../../config/utils');var config=require(_0x1a52('0x14'));var licenseUtil=require(_0x1a52('0x15'));var db=require(_0x1a52('0x16'))['db'];function respondWithStatusCode(_0xbc8a53,_0x51d510){_0x51d510=_0x51d510||0xcc;return function(_0x179372){if(_0x179372){return _0xbc8a53[_0x1a52('0x17')](_0x51d510);}return _0xbc8a53[_0x1a52('0x18')](_0x51d510)[_0x1a52('0x19')]();};}function respondWithResult(_0x20e56e,_0x4fb67f){_0x4fb67f=_0x4fb67f||0xc8;return function(_0x50c17a){if(_0x50c17a){return _0x20e56e['status'](_0x4fb67f)['json'](_0x50c17a);}};}function respondWithFilteredResult(_0x1f7fca,_0x438ac5){return function(_0x428a94){if(_0x428a94){var _0x280bb2=typeof _0x438ac5['offset']===_0x1a52('0x1a')&&typeof _0x438ac5[_0x1a52('0x1b')]===_0x1a52('0x1a');var _0x1ac9bc=_0x428a94[_0x1a52('0x1c')];var _0x3194aa=_0x280bb2?0x0:_0x438ac5[_0x1a52('0x1d')];var _0x1236e9=_0x280bb2?_0x428a94[_0x1a52('0x1c')]:_0x438ac5[_0x1a52('0x1d')]+_0x438ac5[_0x1a52('0x1b')];var _0x5cd356;if(_0x1236e9>=_0x1ac9bc){_0x1236e9=_0x1ac9bc;_0x5cd356=0xc8;}else{_0x5cd356=0xce;}_0x1f7fca['status'](_0x5cd356);return _0x1f7fca[_0x1a52('0x1e')](_0x1a52('0x1f'),_0x3194aa+'-'+_0x1236e9+'/'+_0x1ac9bc)[_0x1a52('0x20')](_0x428a94);}return null;};}function patchUpdates(_0x59db0a){return function(_0x5b771e){try{jsonpatch[_0x1a52('0x21')](_0x5b771e,_0x59db0a,!![]);}catch(_0x30ee55){return BPromise[_0x1a52('0x22')](_0x30ee55);}return _0x5b771e['save']();};}function saveUpdates(_0x5835f8,_0x224b8d){return function(_0x4e117f){if(_0x4e117f){return _0x4e117f[_0x1a52('0x23')](_0x5835f8)[_0x1a52('0x24')](function(_0x111d97){return _0x111d97;});}return null;};}function removeEntity(_0x20d574,_0xdffd26){return function(_0x250f43){if(_0x250f43){return _0x250f43[_0x1a52('0x25')]()['then'](function(){var _0x308866=_0x250f43['get']({'plain':!![]});var _0x27ce04=_0x1a52('0x26');return db[_0x1a52('0x27')][_0x1a52('0x25')]({'where':{'type':_0x27ce04,'resourceId':_0x308866['id']}})[_0x1a52('0x24')](function(){return _0x250f43;});})[_0x1a52('0x24')](function(){_0x20d574['status'](0xcc)[_0x1a52('0x19')]();});}};}function handleEntityNotFound(_0x1fd2b5,_0x46baf3){return function(_0xdf1ef5){if(!_0xdf1ef5){_0x1fd2b5['sendStatus'](0x194);}return _0xdf1ef5;};}function handleError(_0x374175,_0x35e8a5){_0x35e8a5=_0x35e8a5||0x1f4;return function(_0x2ea2ff){logger['error'](_0x2ea2ff[_0x1a52('0x28')]);if(_0x2ea2ff['name']){delete _0x2ea2ff['name'];}_0x374175['status'](_0x35e8a5)[_0x1a52('0x29')](_0x2ea2ff);};}exports[_0x1a52('0x2a')]=function(_0x5a927b,_0x49f116){var _0x26ee5b={},_0x4f5f9f={},_0x2a0a89={'count':0x0,'rows':[]};var _0x30d9d3=_[_0x1a52('0x2b')](db[_0x1a52('0x2c')][_0x1a52('0x2d')],function(_0x584ef5){return{'name':_0x584ef5[_0x1a52('0x2e')],'type':_0x584ef5[_0x1a52('0x2f')][_0x1a52('0x30')]};});_0x4f5f9f[_0x1a52('0x31')]=_['map'](_0x30d9d3,_0x1a52('0x32'));_0x4f5f9f[_0x1a52('0x33')]=_['keys'](_0x5a927b['query']);_0x4f5f9f[_0x1a52('0x34')]=_[_0x1a52('0x35')](_0x4f5f9f[_0x1a52('0x31')],_0x4f5f9f[_0x1a52('0x33')]);_0x26ee5b[_0x1a52('0x36')]=_[_0x1a52('0x35')](_0x4f5f9f[_0x1a52('0x31')],qs[_0x1a52('0x37')](_0x5a927b[_0x1a52('0x33')][_0x1a52('0x37')]));_0x26ee5b['attributes']=_0x26ee5b[_0x1a52('0x36')][_0x1a52('0x38')]?_0x26ee5b['attributes']:_0x4f5f9f[_0x1a52('0x31')];if(!_0x5a927b[_0x1a52('0x33')]['hasOwnProperty']('nolimit')){_0x26ee5b['limit']=qs[_0x1a52('0x1b')](_0x5a927b[_0x1a52('0x33')]['limit']);_0x26ee5b[_0x1a52('0x1d')]=qs[_0x1a52('0x1d')](_0x5a927b[_0x1a52('0x33')][_0x1a52('0x1d')]);}_0x26ee5b[_0x1a52('0x39')]=qs['sort'](_0x5a927b[_0x1a52('0x33')][_0x1a52('0x3a')]);_0x26ee5b['where']=qs[_0x1a52('0x34')](_[_0x1a52('0x3b')](_0x5a927b[_0x1a52('0x33')],_0x4f5f9f[_0x1a52('0x34')]),_0x30d9d3);if(_0x5a927b['query'][_0x1a52('0x3c')]){_0x26ee5b[_0x1a52('0x3d')]=_[_0x1a52('0x3e')](_0x26ee5b[_0x1a52('0x3d')],{'$or':_[_0x1a52('0x2b')](_0x30d9d3,function(_0x4b95c1){if(_0x4b95c1[_0x1a52('0x2f')]!==_0x1a52('0x3f')){var _0x26b331={};_0x26b331[_0x4b95c1[_0x1a52('0x32')]]={'$like':'%'+_0x5a927b['query'][_0x1a52('0x3c')]+'%'};return _0x26b331;}})});}_0x26ee5b=_[_0x1a52('0x3e')]({},_0x26ee5b,_0x5a927b[_0x1a52('0x40')]);var _0x2549c1={'where':_0x26ee5b['where']};return db[_0x1a52('0x2c')]['count'](_0x2549c1)['then'](function(_0xd4fd80){_0x2a0a89[_0x1a52('0x1c')]=_0xd4fd80;if(_0x5a927b['query']['includeAll']){_0x26ee5b[_0x1a52('0x41')]=[{'all':!![]}];}return db[_0x1a52('0x2c')]['findAll'](_0x26ee5b);})[_0x1a52('0x24')](function(_0x5a4acb){_0x2a0a89[_0x1a52('0x42')]=_0x5a4acb;return _0x2a0a89;})[_0x1a52('0x24')](respondWithFilteredResult(_0x49f116,_0x26ee5b))[_0x1a52('0x43')](handleError(_0x49f116,null));};exports[_0x1a52('0x44')]=function(_0x503915,_0x5e648c){var _0x2ca9fb={'raw':![],'where':{'id':_0x503915[_0x1a52('0x45')]['id']}},_0x38f714={};_0x38f714['model']=_['keys'](db[_0x1a52('0x2c')][_0x1a52('0x2d')]);_0x38f714[_0x1a52('0x33')]=_[_0x1a52('0x46')](_0x503915[_0x1a52('0x33')]);_0x38f714[_0x1a52('0x34')]=_[_0x1a52('0x35')](_0x38f714[_0x1a52('0x31')],_0x38f714[_0x1a52('0x33')]);_0x2ca9fb[_0x1a52('0x36')]=_[_0x1a52('0x35')](_0x38f714[_0x1a52('0x31')],qs[_0x1a52('0x37')](_0x503915['query'][_0x1a52('0x37')]));_0x2ca9fb[_0x1a52('0x36')]=_0x2ca9fb[_0x1a52('0x36')][_0x1a52('0x38')]?_0x2ca9fb['attributes']:_0x38f714['model'];if(_0x503915[_0x1a52('0x33')]['includeAll']){_0x2ca9fb[_0x1a52('0x41')]=[{'all':!![]}];}_0x2ca9fb=_[_0x1a52('0x3e')]({},_0x2ca9fb,_0x503915[_0x1a52('0x40')]);return db[_0x1a52('0x2c')][_0x1a52('0x47')](_0x2ca9fb)['then'](handleEntityNotFound(_0x5e648c,null))[_0x1a52('0x24')](respondWithResult(_0x5e648c,null))[_0x1a52('0x43')](handleError(_0x5e648c,null));};exports[_0x1a52('0x48')]=function(_0x509f39,_0x51c6ae){return db['Campaign'][_0x1a52('0x48')](_0x509f39['body'],{})['then'](function(_0x3d3c26){var _0x53e9ee=_0x509f39[_0x1a52('0x49')][_0x1a52('0x4a')]({'plain':!![]});if(!_0x53e9ee)throw new Error(_0x1a52('0x4b'));if(_0x53e9ee[_0x1a52('0x4c')]===_0x1a52('0x49')){var _0x14419c=_0x3d3c26[_0x1a52('0x4a')]({'plain':!![]});var _0x4ac7fd=_0x1a52('0x26');return db[_0x1a52('0x4d')][_0x1a52('0x47')]({'where':{'name':_0x4ac7fd,'userProfileId':_0x53e9ee[_0x1a52('0x4e')]},'raw':!![]})[_0x1a52('0x24')](function(_0x297257){if(_0x297257&&_0x297257[_0x1a52('0x4f')]===0x0){return db['UserProfileResource'][_0x1a52('0x48')]({'name':_0x14419c[_0x1a52('0x32')],'resourceId':_0x14419c['id'],'type':_0x297257[_0x1a52('0x32')],'sectionId':_0x297257['id']},{})[_0x1a52('0x24')](function(){return _0x3d3c26;});}else{return _0x3d3c26;}})['catch'](function(_0x10496d){logger[_0x1a52('0x50')](_0x1a52('0x51'),_0x10496d);throw _0x10496d;});}return _0x3d3c26;})[_0x1a52('0x24')](respondWithResult(_0x51c6ae,0xc9))[_0x1a52('0x43')](handleError(_0x51c6ae,null));};exports['clone']=function(_0x1f19ff,_0x377cc6){var _0x336525={'where':{'id':_0x1f19ff[_0x1a52('0x45')]['id']}},_0x32123a={};_0x32123a['model']=_[_0x1a52('0x46')](db[_0x1a52('0x2c')][_0x1a52('0x2d')]);_0x336525[_0x1a52('0x36')]=_[_0x1a52('0x35')](_0x32123a[_0x1a52('0x31')],qs[_0x1a52('0x37')](_0x1f19ff[_0x1a52('0x33')][_0x1a52('0x37')]));_0x336525[_0x1a52('0x36')]=_0x336525['attributes']['length']?_0x336525[_0x1a52('0x36')]:_0x32123a[_0x1a52('0x31')];if(_0x1f19ff[_0x1a52('0x33')][_0x1a52('0x52')]){_0x336525[_0x1a52('0x41')]=[{'all':!![]}];}_0x336525=_[_0x1a52('0x3e')]({},_0x336525,_0x1f19ff[_0x1a52('0x40')]);return db['Campaign'][_0x1a52('0x47')](_0x336525)[_0x1a52('0x24')](handleEntityNotFound(_0x377cc6,null))['then'](function(_0x162174){if(_0x162174){var _0x2e9604=_0x162174[_0x1a52('0x4a')]({'plain':!![]});_0x2e9604=qs['omit'](_0x2e9604,['id',_0x1a52('0x53'),_0x1a52('0x54')]);_0x1f19ff[_0x1a52('0x55')]=_[_0x1a52('0x56')](_0x1f19ff[_0x1a52('0x55')],['id',_0x1a52('0x53'),_0x1a52('0x54')]);return db['Campaign']['create'](_[_0x1a52('0x3e')](_0x2e9604,_0x1f19ff[_0x1a52('0x55')]),{'include':_0x1f19ff[_0x1a52('0x33')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x4a622b){var _0x195e62=_0x1f19ff[_0x1a52('0x49')][_0x1a52('0x4a')]({'plain':!![]});if(!_0x195e62)throw new Error(_0x1a52('0x4b'));if(_0x195e62['role']===_0x1a52('0x49')){var _0x5e9da3=_0x4a622b[_0x1a52('0x4a')]({'plain':!![]});var _0x3cf5b2=_0x1a52('0x26');return db[_0x1a52('0x4d')][_0x1a52('0x47')]({'where':{'name':_0x3cf5b2,'userProfileId':_0x195e62[_0x1a52('0x4e')]},'raw':!![]})[_0x1a52('0x24')](function(_0x373e63){if(_0x373e63&&_0x373e63['autoAssociation']===0x0){return db[_0x1a52('0x27')]['create']({'name':_0x5e9da3[_0x1a52('0x32')],'resourceId':_0x5e9da3['id'],'type':_0x373e63[_0x1a52('0x32')],'sectionId':_0x373e63['id']},{})[_0x1a52('0x24')](function(){return _0x4a622b;});}else{return _0x4a622b;}})[_0x1a52('0x43')](function(_0xc188dc){logger[_0x1a52('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xc188dc);throw _0xc188dc;});}return _0x4a622b;});}})[_0x1a52('0x24')](respondWithResult(_0x377cc6,0xc9))['catch'](handleError(_0x377cc6,null));};exports[_0x1a52('0x23')]=function(_0x4219cc,_0xb0adf0){if(_0x4219cc['body']['id']){delete _0x4219cc[_0x1a52('0x55')]['id'];}return db['Campaign']['find']({'where':{'id':_0x4219cc['params']['id']}})[_0x1a52('0x24')](handleEntityNotFound(_0xb0adf0,null))['then'](saveUpdates(_0x4219cc[_0x1a52('0x55')],null))['then'](respondWithResult(_0xb0adf0,null))[_0x1a52('0x43')](handleError(_0xb0adf0,null));};exports['destroy']=function(_0x914439,_0x2b272e){return db[_0x1a52('0x2c')][_0x1a52('0x47')]({'where':{'id':_0x914439[_0x1a52('0x45')]['id']}})['then'](handleEntityNotFound(_0x2b272e,null))['then'](removeEntity(_0x2b272e,null))[_0x1a52('0x43')](handleError(_0x2b272e,null));};exports[_0x1a52('0x57')]=function(_0x416a2a,_0x1fcb47,_0x41ae58){var _0x62cedf={'raw':!![],'where':{}};var _0x246454={};var _0x39f9bb={'count':0x0,'rows':[]};return db[_0x1a52('0x2c')][_0x1a52('0x58')]({'where':{'id':_0x416a2a[_0x1a52('0x45')]['id']}})[_0x1a52('0x24')](handleEntityNotFound(_0x1fcb47,null))[_0x1a52('0x24')](function(_0x53e575){if(_0x53e575){_0x246454['model']=_[_0x1a52('0x46')](db['CmHopper'][_0x1a52('0x2d')]);_0x246454[_0x1a52('0x33')]=_[_0x1a52('0x46')](_0x416a2a[_0x1a52('0x33')]);_0x246454[_0x1a52('0x34')]=_[_0x1a52('0x35')](_0x246454[_0x1a52('0x31')],_0x246454[_0x1a52('0x33')]);_0x62cedf[_0x1a52('0x36')]=_['intersection'](_0x246454[_0x1a52('0x31')],qs[_0x1a52('0x37')](_0x416a2a[_0x1a52('0x33')][_0x1a52('0x37')]));_0x62cedf[_0x1a52('0x36')]=_0x62cedf[_0x1a52('0x36')][_0x1a52('0x38')]?_0x62cedf[_0x1a52('0x36')]:_0x246454[_0x1a52('0x31')];if(!_0x416a2a[_0x1a52('0x33')][_0x1a52('0x59')](_0x1a52('0x5a'))){_0x62cedf[_0x1a52('0x1b')]=qs[_0x1a52('0x1b')](_0x416a2a[_0x1a52('0x33')][_0x1a52('0x1b')]);_0x62cedf[_0x1a52('0x1d')]=qs[_0x1a52('0x1d')](_0x416a2a[_0x1a52('0x33')][_0x1a52('0x1d')]);}_0x62cedf['order']=qs[_0x1a52('0x3a')](_0x416a2a[_0x1a52('0x33')]['sort']);_0x62cedf[_0x1a52('0x3d')]=qs[_0x1a52('0x34')](_[_0x1a52('0x3b')](_0x416a2a[_0x1a52('0x33')],_0x246454[_0x1a52('0x34')]));_0x62cedf[_0x1a52('0x3d')][_0x1a52('0x5b')]=_0x53e575['id'];if(_0x416a2a['query'][_0x1a52('0x3c')]){_0x62cedf[_0x1a52('0x3d')]=_[_0x1a52('0x3e')](_0x62cedf[_0x1a52('0x3d')],{'$or':_[_0x1a52('0x2b')](_0x62cedf[_0x1a52('0x36')],function(_0x3b7c80){var _0x58b877={};_0x58b877[_0x3b7c80]={'$like':'%'+_0x416a2a[_0x1a52('0x33')][_0x1a52('0x3c')]+'%'};return _0x58b877;})});}_0x62cedf=_[_0x1a52('0x3e')]({},_0x62cedf,_0x416a2a['options']);return db[_0x1a52('0x5c')][_0x1a52('0x1c')]({'where':_0x62cedf[_0x1a52('0x3d')]})[_0x1a52('0x24')](function(_0x1cb11a){_0x39f9bb['count']=_0x1cb11a;if(_0x416a2a[_0x1a52('0x33')][_0x1a52('0x52')]){_0x62cedf[_0x1a52('0x41')]=[{'all':!![]}];}return db['CmHopper'][_0x1a52('0x5d')](_0x62cedf);})[_0x1a52('0x24')](function(_0x23a3cd){_0x39f9bb[_0x1a52('0x42')]=_0x23a3cd;return _0x39f9bb;});}})[_0x1a52('0x24')](respondWithFilteredResult(_0x1fcb47,_0x62cedf))[_0x1a52('0x43')](handleError(_0x1fcb47,null));};exports[_0x1a52('0x5e')]=function(_0x460eeb,_0x36889d,_0x316640){var _0x2841d3={'raw':!![],'where':{}};var _0x48cfd0={};var _0x2f7ce8={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x460eeb[_0x1a52('0x45')]['id']}})['then'](handleEntityNotFound(_0x36889d,null))[_0x1a52('0x24')](function(_0x1ca716){if(_0x1ca716){_0x48cfd0[_0x1a52('0x31')]=_['keys'](db[_0x1a52('0x5f')][_0x1a52('0x2d')]);_0x48cfd0['query']=_['keys'](_0x460eeb[_0x1a52('0x33')]);_0x48cfd0[_0x1a52('0x34')]=_[_0x1a52('0x35')](_0x48cfd0[_0x1a52('0x31')],_0x48cfd0[_0x1a52('0x33')]);_0x2841d3[_0x1a52('0x36')]=_[_0x1a52('0x35')](_0x48cfd0[_0x1a52('0x31')],qs[_0x1a52('0x37')](_0x460eeb[_0x1a52('0x33')][_0x1a52('0x37')]));_0x2841d3[_0x1a52('0x36')]=_0x2841d3[_0x1a52('0x36')]['length']?_0x2841d3[_0x1a52('0x36')]:_0x48cfd0[_0x1a52('0x31')];if(!_0x460eeb['query'][_0x1a52('0x59')](_0x1a52('0x5a'))){_0x2841d3[_0x1a52('0x1b')]=qs[_0x1a52('0x1b')](_0x460eeb[_0x1a52('0x33')][_0x1a52('0x1b')]);_0x2841d3[_0x1a52('0x1d')]=qs[_0x1a52('0x1d')](_0x460eeb['query'][_0x1a52('0x1d')]);}_0x2841d3[_0x1a52('0x39')]=qs[_0x1a52('0x3a')](_0x460eeb[_0x1a52('0x33')][_0x1a52('0x3a')]);_0x2841d3[_0x1a52('0x3d')]=qs[_0x1a52('0x34')](_[_0x1a52('0x3b')](_0x460eeb[_0x1a52('0x33')],_0x48cfd0[_0x1a52('0x34')]));_0x2841d3[_0x1a52('0x3d')]['CampaignId']=_0x1ca716['id'];if(_0x460eeb[_0x1a52('0x33')][_0x1a52('0x3c')]){_0x2841d3[_0x1a52('0x3d')]=_[_0x1a52('0x3e')](_0x2841d3['where'],{'$or':_['map'](_0x2841d3[_0x1a52('0x36')],function(_0x73c215){var _0x3cf825={};_0x3cf825[_0x73c215]={'$like':'%'+_0x460eeb[_0x1a52('0x33')][_0x1a52('0x3c')]+'%'};return _0x3cf825;})});}_0x2841d3=_['merge']({},_0x2841d3,_0x460eeb['options']);return db[_0x1a52('0x5f')][_0x1a52('0x1c')]({'where':_0x2841d3[_0x1a52('0x3d')]})[_0x1a52('0x24')](function(_0x417e5e){_0x2f7ce8[_0x1a52('0x1c')]=_0x417e5e;if(_0x460eeb['query'][_0x1a52('0x52')]){_0x2841d3[_0x1a52('0x41')]=[{'all':!![]}];}return db[_0x1a52('0x5f')][_0x1a52('0x5d')](_0x2841d3);})[_0x1a52('0x24')](function(_0x3e0cfd){_0x2f7ce8[_0x1a52('0x42')]=_0x3e0cfd;return _0x2f7ce8;});}})[_0x1a52('0x24')](respondWithFilteredResult(_0x36889d,_0x2841d3))['catch'](handleError(_0x36889d,null));};exports['getHopperFinals']=function(_0x440ed1,_0x2ece2d,_0x49cf3f){var _0x3f1f55={'raw':!![],'where':{}};var _0x9252d9={};var _0x125706={'count':0x0,'rows':[]};return db[_0x1a52('0x2c')][_0x1a52('0x58')]({'where':{'id':_0x440ed1[_0x1a52('0x45')]['id']}})[_0x1a52('0x24')](handleEntityNotFound(_0x2ece2d,null))['then'](function(_0x49dd35){if(_0x49dd35){_0x9252d9[_0x1a52('0x31')]=_['keys'](db[_0x1a52('0x60')][_0x1a52('0x2d')]);_0x9252d9[_0x1a52('0x33')]=_['keys'](_0x440ed1[_0x1a52('0x33')]);_0x9252d9[_0x1a52('0x34')]=_[_0x1a52('0x35')](_0x9252d9['model'],_0x9252d9['query']);_0x3f1f55[_0x1a52('0x36')]=_[_0x1a52('0x35')](_0x9252d9[_0x1a52('0x31')],qs[_0x1a52('0x37')](_0x440ed1[_0x1a52('0x33')][_0x1a52('0x37')]));_0x3f1f55[_0x1a52('0x36')]=_0x3f1f55['attributes'][_0x1a52('0x38')]?_0x3f1f55[_0x1a52('0x36')]:_0x9252d9[_0x1a52('0x31')];if(!_0x440ed1[_0x1a52('0x33')]['hasOwnProperty'](_0x1a52('0x5a'))){_0x3f1f55[_0x1a52('0x1b')]=qs[_0x1a52('0x1b')](_0x440ed1[_0x1a52('0x33')][_0x1a52('0x1b')]);_0x3f1f55[_0x1a52('0x1d')]=qs[_0x1a52('0x1d')](_0x440ed1[_0x1a52('0x33')][_0x1a52('0x1d')]);}_0x3f1f55[_0x1a52('0x39')]=qs['sort'](_0x440ed1[_0x1a52('0x33')][_0x1a52('0x3a')]);_0x3f1f55['where']=qs['filters'](_[_0x1a52('0x3b')](_0x440ed1[_0x1a52('0x33')],_0x9252d9['filters']));_0x3f1f55[_0x1a52('0x3d')][_0x1a52('0x5b')]=_0x49dd35['id'];if(_0x440ed1['query']['filter']){_0x3f1f55[_0x1a52('0x3d')]=_['merge'](_0x3f1f55[_0x1a52('0x3d')],{'$or':_[_0x1a52('0x2b')](_0x3f1f55['attributes'],function(_0x5a897f){var _0x4a6b71={};_0x4a6b71[_0x5a897f]={'$like':'%'+_0x440ed1[_0x1a52('0x33')][_0x1a52('0x3c')]+'%'};return _0x4a6b71;})});}_0x3f1f55=_[_0x1a52('0x3e')]({},_0x3f1f55,_0x440ed1[_0x1a52('0x40')]);return db['CmHopperFinal'][_0x1a52('0x1c')]({'where':_0x3f1f55[_0x1a52('0x3d')]})[_0x1a52('0x24')](function(_0x1ad5d8){_0x125706[_0x1a52('0x1c')]=_0x1ad5d8;if(_0x440ed1['query'][_0x1a52('0x52')]){_0x3f1f55['include']=[{'all':!![]}];}return db[_0x1a52('0x60')][_0x1a52('0x5d')](_0x3f1f55);})[_0x1a52('0x24')](function(_0x7a6fed){_0x125706['rows']=_0x7a6fed;return _0x125706;});}})[_0x1a52('0x24')](respondWithFilteredResult(_0x2ece2d,_0x3f1f55))['catch'](handleError(_0x2ece2d,null));};exports[_0x1a52('0x61')]=function(_0x298d64,_0x1dbecb,_0x4261af){var _0x290aab={'raw':!![],'where':{}};var _0x5740d0={};var _0x108c56={'count':0x0,'rows':[]};return db[_0x1a52('0x2c')][_0x1a52('0x58')]({'where':{'id':_0x298d64[_0x1a52('0x45')]['id']}})['then'](handleEntityNotFound(_0x1dbecb,null))[_0x1a52('0x24')](function(_0x3f9ee4){if(_0x3f9ee4){_0x5740d0[_0x1a52('0x31')]=_['keys'](db[_0x1a52('0x62')][_0x1a52('0x2d')]);_0x5740d0[_0x1a52('0x33')]=_['keys'](_0x298d64[_0x1a52('0x33')]);_0x5740d0['filters']=_['intersection'](_0x5740d0[_0x1a52('0x31')],_0x5740d0['query']);_0x290aab[_0x1a52('0x36')]=_[_0x1a52('0x35')](_0x5740d0[_0x1a52('0x31')],qs[_0x1a52('0x37')](_0x298d64[_0x1a52('0x33')][_0x1a52('0x37')]));_0x290aab[_0x1a52('0x36')]=_0x290aab[_0x1a52('0x36')][_0x1a52('0x38')]?_0x290aab[_0x1a52('0x36')]:_0x5740d0[_0x1a52('0x31')];if(!_0x298d64[_0x1a52('0x33')]['hasOwnProperty'](_0x1a52('0x5a'))){_0x290aab['limit']=qs[_0x1a52('0x1b')](_0x298d64[_0x1a52('0x33')][_0x1a52('0x1b')]);_0x290aab['offset']=qs['offset'](_0x298d64[_0x1a52('0x33')][_0x1a52('0x1d')]);}_0x290aab[_0x1a52('0x39')]=qs[_0x1a52('0x3a')](_0x298d64[_0x1a52('0x33')]['sort']);_0x290aab[_0x1a52('0x3d')]=qs['filters'](_[_0x1a52('0x3b')](_0x298d64[_0x1a52('0x33')],_0x5740d0[_0x1a52('0x34')]));_0x290aab[_0x1a52('0x3d')][_0x1a52('0x5b')]=_0x3f9ee4['id'];if(_0x298d64['query'][_0x1a52('0x3c')]){_0x290aab[_0x1a52('0x3d')]=_[_0x1a52('0x3e')](_0x290aab[_0x1a52('0x3d')],{'$or':_[_0x1a52('0x2b')](_0x290aab[_0x1a52('0x36')],function(_0x418db3){var _0x484539={};_0x484539[_0x418db3]={'$like':'%'+_0x298d64[_0x1a52('0x33')][_0x1a52('0x3c')]+'%'};return _0x484539;})});}_0x290aab=_[_0x1a52('0x3e')]({},_0x290aab,_0x298d64[_0x1a52('0x40')]);return db[_0x1a52('0x62')]['count']({'where':_0x290aab['where']})['then'](function(_0x163eb1){_0x108c56[_0x1a52('0x1c')]=_0x163eb1;if(_0x298d64[_0x1a52('0x33')]['includeAll']){_0x290aab[_0x1a52('0x41')]=[{'all':!![]}];}return db[_0x1a52('0x62')][_0x1a52('0x5d')](_0x290aab);})[_0x1a52('0x24')](function(_0x532f3b){_0x108c56[_0x1a52('0x42')]=_0x532f3b;return _0x108c56;});}})['then'](respondWithFilteredResult(_0x1dbecb,_0x290aab))[_0x1a52('0x43')](handleError(_0x1dbecb,null));};exports[_0x1a52('0x63')]=function(_0x232600,_0x2f8183,_0x4569ec){var _0x3e4999={};var _0x3b8320={};var _0x2f8ca5;var _0x2f7711;return db[_0x1a52('0x2c')][_0x1a52('0x58')]({'where':{'id':_0x232600[_0x1a52('0x45')]['id']}})[_0x1a52('0x24')](handleEntityNotFound(_0x2f8183,null))['then'](function(_0x3ad0ce){if(_0x3ad0ce){_0x2f8ca5=_0x3ad0ce;_0x3b8320[_0x1a52('0x31')]=_[_0x1a52('0x46')](db[_0x1a52('0x64')][_0x1a52('0x2d')]);_0x3b8320[_0x1a52('0x33')]=_[_0x1a52('0x46')](_0x232600[_0x1a52('0x33')]);_0x3b8320[_0x1a52('0x34')]=_[_0x1a52('0x35')](_0x3b8320[_0x1a52('0x31')],_0x3b8320[_0x1a52('0x33')]);_0x3e4999[_0x1a52('0x36')]=_[_0x1a52('0x35')](_0x3b8320[_0x1a52('0x31')],qs[_0x1a52('0x37')](_0x232600[_0x1a52('0x33')][_0x1a52('0x37')]));_0x3e4999[_0x1a52('0x36')]=_0x3e4999[_0x1a52('0x36')][_0x1a52('0x38')]?_0x3e4999['attributes']:_0x3b8320[_0x1a52('0x31')];_0x3e4999['order']=qs[_0x1a52('0x3a')](_0x232600['query']['sort']);_0x3e4999['where']=qs['filters'](_['pick'](_0x232600['query'],_0x3b8320[_0x1a52('0x34')]));if(_0x232600[_0x1a52('0x33')][_0x1a52('0x3c')]){_0x3e4999[_0x1a52('0x3d')]=_[_0x1a52('0x3e')](_0x3e4999[_0x1a52('0x3d')],{'$or':_['map'](_0x3e4999[_0x1a52('0x36')],function(_0x1ec35e){var _0xc5c141={};_0xc5c141[_0x1ec35e]={'$like':'%'+_0x232600['query'][_0x1a52('0x3c')]+'%'};return _0xc5c141;})});}_0x3e4999=_[_0x1a52('0x3e')]({},_0x3e4999,_0x232600[_0x1a52('0x40')]);return _0x2f8ca5['getLists'](_0x3e4999);}})['then'](function(_0x4518ad){if(_0x4518ad){_0x2f7711=_0x4518ad[_0x1a52('0x38')];if(!_0x232600[_0x1a52('0x33')][_0x1a52('0x59')](_0x1a52('0x5a'))){_0x3e4999[_0x1a52('0x1b')]=qs[_0x1a52('0x1b')](_0x232600[_0x1a52('0x33')][_0x1a52('0x1b')]);_0x3e4999[_0x1a52('0x1d')]=qs[_0x1a52('0x1d')](_0x232600[_0x1a52('0x33')]['offset']);}return _0x2f8ca5[_0x1a52('0x63')](_0x3e4999);}})['then'](function(_0x87d3ad){if(_0x87d3ad){return _0x87d3ad?{'count':_0x2f7711,'rows':_0x87d3ad}:null;}})[_0x1a52('0x24')](respondWithResult(_0x2f8183,null))[_0x1a52('0x43')](handleError(_0x2f8183,null));};exports[_0x1a52('0x65')]=function(_0x26fe81,_0x2ff4a9,_0x329bb4){var _0x27fefd,_0x4312d0;var _0x37be1e=[];var _0x40ae6e=moment()['format'](_0x1a52('0x66'));return db[_0x1a52('0x2c')]['find']({'where':{'id':_0x26fe81[_0x1a52('0x45')]['id']}})[_0x1a52('0x24')](handleEntityNotFound(_0x2ff4a9,null))[_0x1a52('0x24')](function(_0x16c8e0){if(_0x16c8e0){_0x4312d0=_0x16c8e0;return _0x16c8e0[_0x1a52('0x65')](_0x26fe81['body'][_0x1a52('0x67')],_[_0x1a52('0x56')](_0x26fe81[_0x1a52('0x55')],[_0x1a52('0x67'),'id'])||{});}return null;})[_0x1a52('0x68')](function(_0x4ee44c){var _0x1a868e;var _0x554a98;_0x27fefd=_0x4ee44c||[];var _0x1d54c8=[];if(_0x4ee44c){for(var _0x1e0d32=0x0;_0x1e0d32<_0x4ee44c['length'];_0x1e0d32+=0x1){var _0x3e1bfe=_0x4ee44c[_0x1e0d32]['get']({'plain':!![]});_0x4312d0['dialCheckDuplicateType']=_0x26fe81[_0x1a52('0x55')][_0x1a52('0x69')]?_0x26fe81[_0x1a52('0x55')][_0x1a52('0x69')]:_0x4312d0[_0x1a52('0x69')];switch(_0x4312d0[_0x1a52('0x69')]){case'always':_0x1a868e=squel[_0x1a52('0x6a')]()[_0x1a52('0x6b')]('cm_hopper')[_0x1a52('0x6c')]([_0x1a52('0x6d'),_0x1a52('0x6e'),_0x1a52('0x6f'),_0x1a52('0x70'),_0x1a52('0x5b'),_0x1a52('0x53'),'updatedAt'],squel['select']()[_0x1a52('0x71')](_0x1a52('0x6d'),_0x1a52('0x6d'))[_0x1a52('0x71')](_0x1a52('0x72'),_0x1a52('0x6e'))[_0x1a52('0x71')]('id',_0x1a52('0x6f'))[_0x1a52('0x71')](_0x3e1bfe[_0x1a52('0x73')][_0x1a52('0x74')](),_0x1a52('0x70'))[_0x1a52('0x71')](_0x26fe81[_0x1a52('0x45')]['id'][_0x1a52('0x74')](),'CampaignId')[_0x1a52('0x71')]('\x27'+_0x40ae6e+'\x27',_0x1a52('0x53'))['field']('\x27'+_0x40ae6e+'\x27','updatedAt')[_0x1a52('0x75')](_0x1a52('0x76'))['where'](_0x1a52('0x77'))['where'](_0x1a52('0x78'),_0x3e1bfe[_0x1a52('0x73')][_0x1a52('0x74')]())[_0x1a52('0x3d')](_0x1a52('0x79'))[_0x1a52('0x3d')](_0x1a52('0x7a'),squel[_0x1a52('0x7b')]()[_0x1a52('0x71')]('COALESCE(calleridnum,\x27\x27)')[_0x1a52('0x75')](_0x1a52('0x7c'))[_0x1a52('0x3d')](_0x1a52('0x7d'),_0x26fe81[_0x1a52('0x45')]['id'][_0x1a52('0x74')]()))['where'](_0x1a52('0x7a'),squel[_0x1a52('0x7b')]()[_0x1a52('0x71')](_0x1a52('0x7e'))[_0x1a52('0x75')](_0x1a52('0x7f'))['where'](_0x1a52('0x7d'),_0x26fe81[_0x1a52('0x45')]['id'][_0x1a52('0x74')]())))['toString']();break;case _0x1a52('0x80'):_0x1a868e=squel['insert']()[_0x1a52('0x6b')](_0x1a52('0x7f'))['fromQuery']([_0x1a52('0x6d'),_0x1a52('0x6e'),'ContactId','ListId',_0x1a52('0x5b'),_0x1a52('0x53'),_0x1a52('0x54')],squel[_0x1a52('0x7b')]()['field'](_0x1a52('0x6d'),'phone')['field'](_0x1a52('0x72'),_0x1a52('0x6e'))[_0x1a52('0x71')]('id','ContactId')[_0x1a52('0x71')](_0x3e1bfe[_0x1a52('0x73')][_0x1a52('0x74')](),_0x1a52('0x70'))[_0x1a52('0x71')](_0x26fe81[_0x1a52('0x45')]['id'][_0x1a52('0x74')](),_0x1a52('0x5b'))[_0x1a52('0x71')]('\x27'+_0x40ae6e+'\x27',_0x1a52('0x53'))[_0x1a52('0x71')]('\x27'+_0x40ae6e+'\x27',_0x1a52('0x54'))[_0x1a52('0x75')](_0x1a52('0x76'))[_0x1a52('0x3d')](_0x1a52('0x77'))[_0x1a52('0x3d')](_0x1a52('0x78'),_0x3e1bfe[_0x1a52('0x73')][_0x1a52('0x74')]())[_0x1a52('0x3d')]('phone\x20IS\x20NOT\x20NULL')[_0x1a52('0x3d')](_0x1a52('0x7a'),squel[_0x1a52('0x7b')]()[_0x1a52('0x71')]('COALESCE(phone,\x27\x27)')['from'](_0x1a52('0x7f'))[_0x1a52('0x3d')](_0x1a52('0x7d'),_0x26fe81[_0x1a52('0x45')]['id'][_0x1a52('0x74')]())))[_0x1a52('0x74')]();break;default:_0x1a868e=squel[_0x1a52('0x6a')]()[_0x1a52('0x6b')](_0x1a52('0x7f'))[_0x1a52('0x6c')]([_0x1a52('0x6d'),_0x1a52('0x6e'),'ContactId',_0x1a52('0x70'),'CampaignId',_0x1a52('0x53'),_0x1a52('0x54')],squel[_0x1a52('0x7b')]()[_0x1a52('0x71')](_0x1a52('0x6d'),'phone')[_0x1a52('0x71')](_0x1a52('0x72'),_0x1a52('0x6e'))['field']('id',_0x1a52('0x6f'))[_0x1a52('0x71')](_0x3e1bfe[_0x1a52('0x73')][_0x1a52('0x74')](),_0x1a52('0x70'))[_0x1a52('0x71')](_0x26fe81['params']['id']['toString'](),_0x1a52('0x5b'))['field']('\x27'+_0x40ae6e+'\x27',_0x1a52('0x53'))[_0x1a52('0x71')]('\x27'+_0x40ae6e+'\x27',_0x1a52('0x54'))[_0x1a52('0x75')](_0x1a52('0x76'))[_0x1a52('0x3d')]('deletedAt\x20IS\x20NULL')[_0x1a52('0x3d')](_0x1a52('0x78'),_0x3e1bfe['CmListId'][_0x1a52('0x74')]())[_0x1a52('0x3d')]('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x554a98=squel[_0x1a52('0x6a')]()[_0x1a52('0x6b')]('cm_hopper_additional_phones')[_0x1a52('0x6c')]([_0x1a52('0x81'),_0x1a52('0x6e'),_0x1a52('0x6d'),_0x1a52('0x82'),'createdAt','updatedAt'],squel[_0x1a52('0x7b')]()['field'](_0x1a52('0x83'),'id')[_0x1a52('0x71')](_0x1a52('0x72'),_0x1a52('0x6e'))['field'](_0x1a52('0x84'),_0x1a52('0x6d'))[_0x1a52('0x71')](_0x1a52('0x85'),_0x1a52('0x82'))['field']('\x27'+_0x40ae6e+'\x27',_0x1a52('0x53'))[_0x1a52('0x71')]('\x27'+_0x40ae6e+'\x27','updatedAt')[_0x1a52('0x75')]('cm_contact_has_items','ci')['join'](_0x1a52('0x7f'),'h',_0x1a52('0x86'))[_0x1a52('0x3d')]('h.ListId\x20=\x20?',_0x3e1bfe[_0x1a52('0x73')][_0x1a52('0x74')]())[_0x1a52('0x3d')](_0x1a52('0x87'),_0x26fe81['params']['id'][_0x1a52('0x74')]())[_0x1a52('0x3d')](_0x1a52('0x88'),_0x40ae6e))[_0x1a52('0x74')]();_0x1d54c8[_0x1a52('0x89')](db[_0x1a52('0x8a')][_0x1a52('0x33')](_0x1a868e));_0x37be1e[_0x1a52('0x89')](db[_0x1a52('0x8a')]['query'](_0x554a98));}return BPromise[_0x1a52('0x8b')](_0x1d54c8);}})[_0x1a52('0x24')](function(){return BPromise['all'](_0x37be1e);})[_0x1a52('0x24')](function(){return _0x27fefd;})[_0x1a52('0x24')](respondWithResult(_0x2ff4a9,null))[_0x1a52('0x43')](handleError(_0x2ff4a9,null));};exports['removeLists']=function(_0x16ec3a,_0x6cbb4c,_0x49d601){return db[_0x1a52('0x2c')][_0x1a52('0x47')]({'where':{'id':_0x16ec3a[_0x1a52('0x45')]['id']}})[_0x1a52('0x24')](handleEntityNotFound(_0x6cbb4c,null))[_0x1a52('0x24')](function(_0x55f82b){if(_0x55f82b){return _0x55f82b[_0x1a52('0x8c')](_0x16ec3a[_0x1a52('0x33')][_0x1a52('0x67')]);}})[_0x1a52('0x24')](function(_0x37fd4e){if(_0x37fd4e){return db[_0x1a52('0x5c')]['destroy']({'where':{'ListId':_0x16ec3a[_0x1a52('0x33')]['ids'],'CampaignId':_0x16ec3a['params']['id']}})[_0x1a52('0x24')](function(){return _0x37fd4e;});}})[_0x1a52('0x24')](respondWithStatusCode(_0x6cbb4c,null))[_0x1a52('0x43')](handleError(_0x6cbb4c,null));};exports['getBlackLists']=function(_0x570e2d,_0x15c2ac,_0x31e944){var _0x5bfcc3={};var _0x9ae5a1={};var _0x5b393c;var _0x1d48dc;return db[_0x1a52('0x2c')]['findOne']({'where':{'id':_0x570e2d[_0x1a52('0x45')]['id']}})[_0x1a52('0x24')](handleEntityNotFound(_0x15c2ac,null))[_0x1a52('0x24')](function(_0xa93d7d){if(_0xa93d7d){_0x5b393c=_0xa93d7d;_0x9ae5a1['model']=_[_0x1a52('0x46')](db[_0x1a52('0x64')][_0x1a52('0x2d')]);_0x9ae5a1[_0x1a52('0x33')]=_[_0x1a52('0x46')](_0x570e2d['query']);_0x9ae5a1['filters']=_['intersection'](_0x9ae5a1[_0x1a52('0x31')],_0x9ae5a1[_0x1a52('0x33')]);_0x5bfcc3[_0x1a52('0x36')]=_['intersection'](_0x9ae5a1[_0x1a52('0x31')],qs[_0x1a52('0x37')](_0x570e2d[_0x1a52('0x33')][_0x1a52('0x37')]));_0x5bfcc3['attributes']=_0x5bfcc3[_0x1a52('0x36')][_0x1a52('0x38')]?_0x5bfcc3['attributes']:_0x9ae5a1[_0x1a52('0x31')];_0x5bfcc3['order']=qs[_0x1a52('0x3a')](_0x570e2d[_0x1a52('0x33')]['sort']);_0x5bfcc3[_0x1a52('0x3d')]=qs[_0x1a52('0x34')](_[_0x1a52('0x3b')](_0x570e2d['query'],_0x9ae5a1[_0x1a52('0x34')]));if(_0x570e2d[_0x1a52('0x33')]['filter']){_0x5bfcc3['where']=_[_0x1a52('0x3e')](_0x5bfcc3[_0x1a52('0x3d')],{'$or':_[_0x1a52('0x2b')](_0x5bfcc3[_0x1a52('0x36')],function(_0x57808d){var _0x5e7b7b={};_0x5e7b7b[_0x57808d]={'$like':'%'+_0x570e2d['query']['filter']+'%'};return _0x5e7b7b;})});}_0x5bfcc3=_[_0x1a52('0x3e')]({},_0x5bfcc3,_0x570e2d['options']);return _0x5b393c[_0x1a52('0x8d')](_0x5bfcc3);}})[_0x1a52('0x24')](function(_0x4ca38a){if(_0x4ca38a){_0x1d48dc=_0x4ca38a[_0x1a52('0x38')];if(!_0x570e2d[_0x1a52('0x33')][_0x1a52('0x59')]('nolimit')){_0x5bfcc3[_0x1a52('0x1b')]=qs[_0x1a52('0x1b')](_0x570e2d['query'][_0x1a52('0x1b')]);_0x5bfcc3[_0x1a52('0x1d')]=qs[_0x1a52('0x1d')](_0x570e2d['query'][_0x1a52('0x1d')]);}return _0x5b393c[_0x1a52('0x8d')](_0x5bfcc3);}})[_0x1a52('0x24')](function(_0x2be223){if(_0x2be223){return _0x2be223?{'count':_0x1d48dc,'rows':_0x2be223}:null;}})['then'](respondWithResult(_0x15c2ac,null))[_0x1a52('0x43')](handleError(_0x15c2ac,null));};exports['addBlackLists']=function(_0x323c8b,_0x427021,_0x2ca128){var _0x35d89a,_0xa501d3;var _0x513868=[];var _0x28e59e=moment()[_0x1a52('0x8e')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x1a52('0x2c')]['find']({'where':{'id':_0x323c8b[_0x1a52('0x45')]['id']}})[_0x1a52('0x24')](handleEntityNotFound(_0x427021,null))[_0x1a52('0x24')](function(_0x20577b){if(_0x20577b){_0xa501d3=_0x20577b;return _0x20577b[_0x1a52('0x8f')](_0x323c8b[_0x1a52('0x55')][_0x1a52('0x67')],_[_0x1a52('0x56')](_0x323c8b['body'],[_0x1a52('0x67'),'id'])||{});}return null;})[_0x1a52('0x68')](function(_0x570c09){var _0x1a45b4;var _0x3f11c6;_0x35d89a=_0x570c09||[];var _0x4917a5=[];if(_0x570c09){for(var _0x145639=0x0;_0x145639<_0x570c09[_0x1a52('0x38')];_0x145639+=0x1){var _0x4d7b9c=_0x570c09[_0x145639][_0x1a52('0x4a')]({'plain':!![]});_0x1a45b4=squel[_0x1a52('0x6a')]()['into'](_0x1a52('0x90'))['fromQuery']([_0x1a52('0x6d'),_0x1a52('0x6f'),_0x1a52('0x70'),_0x1a52('0x5b'),_0x1a52('0x53'),'updatedAt'],squel[_0x1a52('0x7b')]()[_0x1a52('0x71')](_0x1a52('0x6d'),_0x1a52('0x6d'))['field']('id',_0x1a52('0x6f'))[_0x1a52('0x71')](_0x4d7b9c[_0x1a52('0x73')][_0x1a52('0x74')](),_0x1a52('0x70'))[_0x1a52('0x71')](_0x323c8b[_0x1a52('0x45')]['id'][_0x1a52('0x74')](),_0x1a52('0x5b'))[_0x1a52('0x71')]('NOW()',_0x1a52('0x53'))['field'](_0x1a52('0x72'),_0x1a52('0x54'))['from'](_0x1a52('0x76'))['where'](_0x1a52('0x77'))[_0x1a52('0x3d')]('ListId\x20=\x20?',_0x4d7b9c[_0x1a52('0x73')][_0x1a52('0x74')]())['where'](_0x1a52('0x79')))[_0x1a52('0x74')]();_0x4917a5[_0x1a52('0x89')](db[_0x1a52('0x8a')][_0x1a52('0x33')](_0x1a45b4));}return BPromise[_0x1a52('0x8b')](_0x4917a5);}})[_0x1a52('0x24')](function(){return _0x35d89a;})[_0x1a52('0x24')](respondWithResult(_0x427021,null))[_0x1a52('0x43')](handleError(_0x427021,null));};exports['removeBlackLists']=function(_0x569305,_0xdef048,_0x325b2d){return db[_0x1a52('0x2c')][_0x1a52('0x47')]({'where':{'id':_0x569305[_0x1a52('0x45')]['id']}})[_0x1a52('0x24')](handleEntityNotFound(_0xdef048,null))[_0x1a52('0x24')](function(_0x1f1410){if(_0x1f1410){return _0x1f1410[_0x1a52('0x91')](_0x569305[_0x1a52('0x33')][_0x1a52('0x67')]);}})[_0x1a52('0x24')](function(_0x4da621){if(_0x4da621){return db[_0x1a52('0x62')][_0x1a52('0x25')]({'where':{'ListId':_0x569305[_0x1a52('0x33')]['ids'],'CampaignId':_0x569305[_0x1a52('0x45')]['id']}})[_0x1a52('0x24')](function(){return _0x4da621;});}})[_0x1a52('0x24')](respondWithStatusCode(_0xdef048,null))[_0x1a52('0x43')](handleError(_0xdef048,null));};
\ No newline at end of file
+var _0x10a5=['rows','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','select','field','NOW()','ContactId','CmListId','toString','from','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','ListId','deletedAt\x20IS\x20NULL','cm_contacts','ListId\x20=\x20?','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','h.ContactId\x20=\x20ci.CmContactId','h.CampaignId=?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','format','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','limit','undefined','count','status','set','Content-Range','apply','reject','save','update','then','get','IvrCampaigns','UserProfileResource','destroy','error','stack','name','index','map','Campaign','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','catch','show','params','fields','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','getHoppers','CmHopper','CampaignId'];(function(_0x2d5e99,_0x56257b){var _0x3a3594=function(_0x5ca9b1){while(--_0x5ca9b1){_0x2d5e99['push'](_0x2d5e99['shift']());}};_0x3a3594(++_0x56257b);}(_0x10a5,0x163));var _0x510a=function(_0xbeb808,_0x881ddf){_0xbeb808=_0xbeb808-0x0;var _0x5d6909=_0x10a5[_0xbeb808];return _0x5d6909;};'use strict';var emlformat=require(_0x510a('0x0'));var rimraf=require(_0x510a('0x1'));var zipdir=require(_0x510a('0x2'));var jsonpatch=require(_0x510a('0x3'));var rp=require(_0x510a('0x4'));var moment=require(_0x510a('0x5'));var BPromise=require(_0x510a('0x6'));var Mustache=require(_0x510a('0x7'));var util=require(_0x510a('0x8'));var path=require(_0x510a('0x9'));var sox=require(_0x510a('0xa'));var csv=require(_0x510a('0xb'));var ejs=require(_0x510a('0xc'));var fs=require('fs');var fs_extra=require(_0x510a('0xd'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x510a('0xe'));var jsforce=require(_0x510a('0xf'));var deskjs=require(_0x510a('0x10'));var toCsv=require(_0x510a('0xb'));var querystring=require(_0x510a('0x11'));var Papa=require(_0x510a('0x12'));var Redis=require(_0x510a('0x13'));var authService=require(_0x510a('0x14'));var qs=require(_0x510a('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x510a('0x16'));var logger=require(_0x510a('0x17'))('api');var utils=require(_0x510a('0x18'));var config=require(_0x510a('0x19'));var licenseUtil=require(_0x510a('0x1a'));var db=require(_0x510a('0x1b'))['db'];function respondWithStatusCode(_0x3d34db,_0x34a844){_0x34a844=_0x34a844||0xcc;return function(_0x25facc){if(_0x25facc){return _0x3d34db[_0x510a('0x1c')](_0x34a844);}return _0x3d34db['status'](_0x34a844)[_0x510a('0x1d')]();};}function respondWithResult(_0x35e9f1,_0x502a54){_0x502a54=_0x502a54||0xc8;return function(_0x494b03){if(_0x494b03){return _0x35e9f1['status'](_0x502a54)[_0x510a('0x1e')](_0x494b03);}};}function respondWithFilteredResult(_0x6acae2,_0x4398fb){return function(_0x117e1b){if(_0x117e1b){var _0x15fd06=typeof _0x4398fb[_0x510a('0x1f')]==='undefined'&&typeof _0x4398fb[_0x510a('0x20')]===_0x510a('0x21');var _0x4be66d=_0x117e1b[_0x510a('0x22')];var _0x36767a=_0x15fd06?0x0:_0x4398fb[_0x510a('0x1f')];var _0x4f9ded=_0x15fd06?_0x117e1b[_0x510a('0x22')]:_0x4398fb['offset']+_0x4398fb[_0x510a('0x20')];var _0x1d78c1;if(_0x4f9ded>=_0x4be66d){_0x4f9ded=_0x4be66d;_0x1d78c1=0xc8;}else{_0x1d78c1=0xce;}_0x6acae2[_0x510a('0x23')](_0x1d78c1);return _0x6acae2[_0x510a('0x24')](_0x510a('0x25'),_0x36767a+'-'+_0x4f9ded+'/'+_0x4be66d)['json'](_0x117e1b);}return null;};}function patchUpdates(_0x8238db){return function(_0x339f84){try{jsonpatch[_0x510a('0x26')](_0x339f84,_0x8238db,!![]);}catch(_0x278480){return BPromise[_0x510a('0x27')](_0x278480);}return _0x339f84[_0x510a('0x28')]();};}function saveUpdates(_0x5b24fb,_0x40ab4b){return function(_0x4ee01f){if(_0x4ee01f){return _0x4ee01f[_0x510a('0x29')](_0x5b24fb)[_0x510a('0x2a')](function(_0x1bd848){return _0x1bd848;});}return null;};}function removeEntity(_0x5d883a,_0x171cfb){return function(_0x215775){if(_0x215775){return _0x215775['destroy']()[_0x510a('0x2a')](function(){var _0x54cc9c=_0x215775[_0x510a('0x2b')]({'plain':!![]});var _0x26bcf1=_0x510a('0x2c');return db[_0x510a('0x2d')][_0x510a('0x2e')]({'where':{'type':_0x26bcf1,'resourceId':_0x54cc9c['id']}})[_0x510a('0x2a')](function(){return _0x215775;});})[_0x510a('0x2a')](function(){_0x5d883a[_0x510a('0x23')](0xcc)[_0x510a('0x1d')]();});}};}function handleEntityNotFound(_0x26b4f8,_0x24fc29){return function(_0xc5f5e4){if(!_0xc5f5e4){_0x26b4f8[_0x510a('0x1c')](0x194);}return _0xc5f5e4;};}function handleError(_0x181506,_0x3960f0){_0x3960f0=_0x3960f0||0x1f4;return function(_0x1b7e4b){logger[_0x510a('0x2f')](_0x1b7e4b[_0x510a('0x30')]);if(_0x1b7e4b[_0x510a('0x31')]){delete _0x1b7e4b[_0x510a('0x31')];}_0x181506[_0x510a('0x23')](_0x3960f0)['send'](_0x1b7e4b);};}exports[_0x510a('0x32')]=function(_0x2a4bd2,_0x48f9eb){var _0x13bee8={},_0x11c27c={},_0x48f79d={'count':0x0,'rows':[]};var _0x2709a0=_[_0x510a('0x33')](db[_0x510a('0x34')][_0x510a('0x35')],function(_0x2f49a8){return{'name':_0x2f49a8[_0x510a('0x36')],'type':_0x2f49a8[_0x510a('0x37')][_0x510a('0x38')]};});_0x11c27c[_0x510a('0x39')]=_[_0x510a('0x33')](_0x2709a0,_0x510a('0x31'));_0x11c27c[_0x510a('0x3a')]=_[_0x510a('0x3b')](_0x2a4bd2[_0x510a('0x3a')]);_0x11c27c[_0x510a('0x3c')]=_[_0x510a('0x3d')](_0x11c27c[_0x510a('0x39')],_0x11c27c[_0x510a('0x3a')]);_0x13bee8['attributes']=_[_0x510a('0x3d')](_0x11c27c[_0x510a('0x39')],qs['fields'](_0x2a4bd2['query']['fields']));_0x13bee8['attributes']=_0x13bee8[_0x510a('0x3e')][_0x510a('0x3f')]?_0x13bee8[_0x510a('0x3e')]:_0x11c27c[_0x510a('0x39')];if(!_0x2a4bd2['query'][_0x510a('0x40')](_0x510a('0x41'))){_0x13bee8[_0x510a('0x20')]=qs[_0x510a('0x20')](_0x2a4bd2['query'][_0x510a('0x20')]);_0x13bee8[_0x510a('0x1f')]=qs[_0x510a('0x1f')](_0x2a4bd2[_0x510a('0x3a')][_0x510a('0x1f')]);}_0x13bee8[_0x510a('0x42')]=qs[_0x510a('0x43')](_0x2a4bd2[_0x510a('0x3a')][_0x510a('0x43')]);_0x13bee8[_0x510a('0x44')]=qs[_0x510a('0x3c')](_[_0x510a('0x45')](_0x2a4bd2[_0x510a('0x3a')],_0x11c27c[_0x510a('0x3c')]),_0x2709a0);if(_0x2a4bd2[_0x510a('0x3a')][_0x510a('0x46')]){_0x13bee8[_0x510a('0x44')]=_['merge'](_0x13bee8['where'],{'$or':_[_0x510a('0x33')](_0x2709a0,function(_0x470685){if(_0x470685[_0x510a('0x37')]!==_0x510a('0x47')){var _0x3cda3b={};_0x3cda3b[_0x470685[_0x510a('0x31')]]={'$like':'%'+_0x2a4bd2[_0x510a('0x3a')]['filter']+'%'};return _0x3cda3b;}})});}_0x13bee8=_[_0x510a('0x48')]({},_0x13bee8,_0x2a4bd2[_0x510a('0x49')]);var _0x1f4dbc={'where':_0x13bee8[_0x510a('0x44')]};return db[_0x510a('0x34')]['count'](_0x1f4dbc)[_0x510a('0x2a')](function(_0x1ab9f7){_0x48f79d['count']=_0x1ab9f7;if(_0x2a4bd2[_0x510a('0x3a')][_0x510a('0x4a')]){_0x13bee8['include']=[{'all':!![]}];}return db[_0x510a('0x34')][_0x510a('0x4b')](_0x13bee8);})[_0x510a('0x2a')](function(_0x4baca0){_0x48f79d['rows']=_0x4baca0;return _0x48f79d;})['then'](respondWithFilteredResult(_0x48f9eb,_0x13bee8))[_0x510a('0x4c')](handleError(_0x48f9eb,null));};exports[_0x510a('0x4d')]=function(_0x79a8f5,_0x3e1c42){var _0x1c5b91={'raw':![],'where':{'id':_0x79a8f5[_0x510a('0x4e')]['id']}},_0x4d328e={};_0x4d328e[_0x510a('0x39')]=_['keys'](db[_0x510a('0x34')][_0x510a('0x35')]);_0x4d328e[_0x510a('0x3a')]=_[_0x510a('0x3b')](_0x79a8f5[_0x510a('0x3a')]);_0x4d328e[_0x510a('0x3c')]=_['intersection'](_0x4d328e[_0x510a('0x39')],_0x4d328e['query']);_0x1c5b91[_0x510a('0x3e')]=_[_0x510a('0x3d')](_0x4d328e[_0x510a('0x39')],qs[_0x510a('0x4f')](_0x79a8f5['query'][_0x510a('0x4f')]));_0x1c5b91['attributes']=_0x1c5b91[_0x510a('0x3e')][_0x510a('0x3f')]?_0x1c5b91['attributes']:_0x4d328e[_0x510a('0x39')];if(_0x79a8f5[_0x510a('0x3a')][_0x510a('0x4a')]){_0x1c5b91[_0x510a('0x50')]=[{'all':!![]}];}_0x1c5b91=_[_0x510a('0x48')]({},_0x1c5b91,_0x79a8f5['options']);return db[_0x510a('0x34')][_0x510a('0x51')](_0x1c5b91)[_0x510a('0x2a')](handleEntityNotFound(_0x3e1c42,null))[_0x510a('0x2a')](respondWithResult(_0x3e1c42,null))[_0x510a('0x4c')](handleError(_0x3e1c42,null));};exports[_0x510a('0x52')]=function(_0x2927e2,_0x423490){return db[_0x510a('0x34')]['create'](_0x2927e2[_0x510a('0x53')],{})[_0x510a('0x2a')](function(_0x5b00f5){var _0x3d8f7f=_0x2927e2['user']['get']({'plain':!![]});if(!_0x3d8f7f)throw new Error(_0x510a('0x54'));if(_0x3d8f7f['role']===_0x510a('0x55')){var _0x4ba36d=_0x5b00f5[_0x510a('0x2b')]({'plain':!![]});var _0x85100a=_0x510a('0x2c');return db['UserProfileSection'][_0x510a('0x51')]({'where':{'name':_0x85100a,'userProfileId':_0x3d8f7f[_0x510a('0x56')]},'raw':!![]})[_0x510a('0x2a')](function(_0x4c8053){if(_0x4c8053&&_0x4c8053['autoAssociation']===0x0){return db[_0x510a('0x2d')][_0x510a('0x52')]({'name':_0x4ba36d[_0x510a('0x31')],'resourceId':_0x4ba36d['id'],'type':_0x4c8053[_0x510a('0x31')],'sectionId':_0x4c8053['id']},{})[_0x510a('0x2a')](function(){return _0x5b00f5;});}else{return _0x5b00f5;}})['catch'](function(_0x4923db){logger['error'](_0x510a('0x57'),_0x4923db);throw _0x4923db;});}return _0x5b00f5;})[_0x510a('0x2a')](respondWithResult(_0x423490,0xc9))[_0x510a('0x4c')](handleError(_0x423490,null));};exports[_0x510a('0x58')]=function(_0x22d6ae,_0x5638d9){var _0x1cc34a={'where':{'id':_0x22d6ae[_0x510a('0x4e')]['id']}},_0x18cfd6={};_0x18cfd6[_0x510a('0x39')]=_[_0x510a('0x3b')](db[_0x510a('0x34')][_0x510a('0x35')]);_0x1cc34a[_0x510a('0x3e')]=_[_0x510a('0x3d')](_0x18cfd6[_0x510a('0x39')],qs[_0x510a('0x4f')](_0x22d6ae[_0x510a('0x3a')][_0x510a('0x4f')]));_0x1cc34a[_0x510a('0x3e')]=_0x1cc34a[_0x510a('0x3e')]['length']?_0x1cc34a[_0x510a('0x3e')]:_0x18cfd6['model'];if(_0x22d6ae[_0x510a('0x3a')][_0x510a('0x4a')]){_0x1cc34a[_0x510a('0x50')]=[{'all':!![]}];}_0x1cc34a=_[_0x510a('0x48')]({},_0x1cc34a,_0x22d6ae[_0x510a('0x49')]);return db[_0x510a('0x34')][_0x510a('0x51')](_0x1cc34a)['then'](handleEntityNotFound(_0x5638d9,null))[_0x510a('0x2a')](function(_0x256c59){if(_0x256c59){var _0x257426=_0x256c59[_0x510a('0x2b')]({'plain':!![]});_0x257426=qs[_0x510a('0x59')](_0x257426,['id',_0x510a('0x5a'),_0x510a('0x5b')]);_0x22d6ae[_0x510a('0x53')]=_['omit'](_0x22d6ae['body'],['id','createdAt',_0x510a('0x5b')]);return db['Campaign'][_0x510a('0x52')](_[_0x510a('0x48')](_0x257426,_0x22d6ae['body']),{'include':_0x22d6ae[_0x510a('0x3a')]['includeAll']?[{'all':!![]}]:undefined})[_0x510a('0x2a')](function(_0x28231e){var _0xab3623=_0x22d6ae[_0x510a('0x55')][_0x510a('0x2b')]({'plain':!![]});if(!_0xab3623)throw new Error(_0x510a('0x54'));if(_0xab3623['role']===_0x510a('0x55')){var _0x1f3b94=_0x28231e[_0x510a('0x2b')]({'plain':!![]});var _0x735e75=_0x510a('0x2c');return db['UserProfileSection'][_0x510a('0x51')]({'where':{'name':_0x735e75,'userProfileId':_0xab3623[_0x510a('0x56')]},'raw':!![]})[_0x510a('0x2a')](function(_0x4fbd15){if(_0x4fbd15&&_0x4fbd15['autoAssociation']===0x0){return db[_0x510a('0x2d')][_0x510a('0x52')]({'name':_0x1f3b94['name'],'resourceId':_0x1f3b94['id'],'type':_0x4fbd15[_0x510a('0x31')],'sectionId':_0x4fbd15['id']},{})[_0x510a('0x2a')](function(){return _0x28231e;});}else{return _0x28231e;}})['catch'](function(_0x51505c){logger[_0x510a('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x51505c);throw _0x51505c;});}return _0x28231e;});}})[_0x510a('0x2a')](respondWithResult(_0x5638d9,0xc9))[_0x510a('0x4c')](handleError(_0x5638d9,null));};exports[_0x510a('0x29')]=function(_0x41de27,_0x4bb06d){if(_0x41de27[_0x510a('0x53')]['id']){delete _0x41de27[_0x510a('0x53')]['id'];}return db[_0x510a('0x34')][_0x510a('0x51')]({'where':{'id':_0x41de27[_0x510a('0x4e')]['id']}})[_0x510a('0x2a')](handleEntityNotFound(_0x4bb06d,null))['then'](saveUpdates(_0x41de27['body'],null))[_0x510a('0x2a')](respondWithResult(_0x4bb06d,null))['catch'](handleError(_0x4bb06d,null));};exports[_0x510a('0x2e')]=function(_0x46aac6,_0x7c402){return db[_0x510a('0x34')][_0x510a('0x51')]({'where':{'id':_0x46aac6[_0x510a('0x4e')]['id']}})[_0x510a('0x2a')](handleEntityNotFound(_0x7c402,null))['then'](removeEntity(_0x7c402,null))['catch'](handleError(_0x7c402,null));};exports[_0x510a('0x5c')]=function(_0x1aeb32,_0x409bf9,_0x32d4b1){var _0x2823e8={'raw':!![],'where':{}};var _0x1d1fa8={};var _0x36a5d5={'count':0x0,'rows':[]};return db[_0x510a('0x34')]['findOne']({'where':{'id':_0x1aeb32[_0x510a('0x4e')]['id']}})['then'](handleEntityNotFound(_0x409bf9,null))['then'](function(_0x5db955){if(_0x5db955){_0x1d1fa8[_0x510a('0x39')]=_[_0x510a('0x3b')](db[_0x510a('0x5d')][_0x510a('0x35')]);_0x1d1fa8[_0x510a('0x3a')]=_[_0x510a('0x3b')](_0x1aeb32['query']);_0x1d1fa8['filters']=_[_0x510a('0x3d')](_0x1d1fa8[_0x510a('0x39')],_0x1d1fa8[_0x510a('0x3a')]);_0x2823e8[_0x510a('0x3e')]=_[_0x510a('0x3d')](_0x1d1fa8[_0x510a('0x39')],qs[_0x510a('0x4f')](_0x1aeb32['query']['fields']));_0x2823e8[_0x510a('0x3e')]=_0x2823e8[_0x510a('0x3e')]['length']?_0x2823e8[_0x510a('0x3e')]:_0x1d1fa8[_0x510a('0x39')];if(!_0x1aeb32['query'][_0x510a('0x40')]('nolimit')){_0x2823e8['limit']=qs['limit'](_0x1aeb32[_0x510a('0x3a')]['limit']);_0x2823e8['offset']=qs[_0x510a('0x1f')](_0x1aeb32[_0x510a('0x3a')][_0x510a('0x1f')]);}_0x2823e8['order']=qs[_0x510a('0x43')](_0x1aeb32[_0x510a('0x3a')][_0x510a('0x43')]);_0x2823e8[_0x510a('0x44')]=qs[_0x510a('0x3c')](_[_0x510a('0x45')](_0x1aeb32['query'],_0x1d1fa8[_0x510a('0x3c')]));_0x2823e8[_0x510a('0x44')][_0x510a('0x5e')]=_0x5db955['id'];if(_0x1aeb32[_0x510a('0x3a')][_0x510a('0x46')]){_0x2823e8[_0x510a('0x44')]=_[_0x510a('0x48')](_0x2823e8['where'],{'$or':_[_0x510a('0x33')](_0x2823e8['attributes'],function(_0x5d9747){var _0x208570={};_0x208570[_0x5d9747]={'$like':'%'+_0x1aeb32[_0x510a('0x3a')][_0x510a('0x46')]+'%'};return _0x208570;})});}_0x2823e8=_[_0x510a('0x48')]({},_0x2823e8,_0x1aeb32[_0x510a('0x49')]);return db[_0x510a('0x5d')][_0x510a('0x22')]({'where':_0x2823e8['where']})['then'](function(_0x4baa69){_0x36a5d5['count']=_0x4baa69;if(_0x1aeb32[_0x510a('0x3a')][_0x510a('0x4a')]){_0x2823e8[_0x510a('0x50')]=[{'all':!![]}];}return db[_0x510a('0x5d')][_0x510a('0x4b')](_0x2823e8);})[_0x510a('0x2a')](function(_0xc9c49){_0x36a5d5[_0x510a('0x5f')]=_0xc9c49;return _0x36a5d5;});}})['then'](respondWithFilteredResult(_0x409bf9,_0x2823e8))['catch'](handleError(_0x409bf9,null));};exports[_0x510a('0x60')]=function(_0x1eb86f,_0x4966cc,_0x1ce4e3){var _0x3c5d3b={'raw':!![],'where':{}};var _0x9d8a19={};var _0x43aa77={'count':0x0,'rows':[]};return db[_0x510a('0x34')][_0x510a('0x61')]({'where':{'id':_0x1eb86f['params']['id']}})[_0x510a('0x2a')](handleEntityNotFound(_0x4966cc,null))[_0x510a('0x2a')](function(_0x386cfe){if(_0x386cfe){_0x9d8a19[_0x510a('0x39')]=_[_0x510a('0x3b')](db['CmHopperHistory'][_0x510a('0x35')]);_0x9d8a19['query']=_[_0x510a('0x3b')](_0x1eb86f['query']);_0x9d8a19[_0x510a('0x3c')]=_[_0x510a('0x3d')](_0x9d8a19[_0x510a('0x39')],_0x9d8a19['query']);_0x3c5d3b[_0x510a('0x3e')]=_[_0x510a('0x3d')](_0x9d8a19[_0x510a('0x39')],qs[_0x510a('0x4f')](_0x1eb86f['query'][_0x510a('0x4f')]));_0x3c5d3b['attributes']=_0x3c5d3b[_0x510a('0x3e')][_0x510a('0x3f')]?_0x3c5d3b[_0x510a('0x3e')]:_0x9d8a19[_0x510a('0x39')];if(!_0x1eb86f[_0x510a('0x3a')][_0x510a('0x40')]('nolimit')){_0x3c5d3b['limit']=qs[_0x510a('0x20')](_0x1eb86f['query'][_0x510a('0x20')]);_0x3c5d3b[_0x510a('0x1f')]=qs['offset'](_0x1eb86f[_0x510a('0x3a')][_0x510a('0x1f')]);}_0x3c5d3b['order']=qs[_0x510a('0x43')](_0x1eb86f[_0x510a('0x3a')][_0x510a('0x43')]);_0x3c5d3b[_0x510a('0x44')]=qs[_0x510a('0x3c')](_['pick'](_0x1eb86f[_0x510a('0x3a')],_0x9d8a19['filters']));_0x3c5d3b[_0x510a('0x44')][_0x510a('0x5e')]=_0x386cfe['id'];if(_0x1eb86f['query'][_0x510a('0x46')]){_0x3c5d3b[_0x510a('0x44')]=_[_0x510a('0x48')](_0x3c5d3b[_0x510a('0x44')],{'$or':_[_0x510a('0x33')](_0x3c5d3b[_0x510a('0x3e')],function(_0x17b48c){var _0x5fe2f1={};_0x5fe2f1[_0x17b48c]={'$like':'%'+_0x1eb86f[_0x510a('0x3a')]['filter']+'%'};return _0x5fe2f1;})});}_0x3c5d3b=_['merge']({},_0x3c5d3b,_0x1eb86f['options']);return db[_0x510a('0x62')][_0x510a('0x22')]({'where':_0x3c5d3b[_0x510a('0x44')]})[_0x510a('0x2a')](function(_0x597007){_0x43aa77[_0x510a('0x22')]=_0x597007;if(_0x1eb86f[_0x510a('0x3a')][_0x510a('0x4a')]){_0x3c5d3b[_0x510a('0x50')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x510a('0x4b')](_0x3c5d3b);})['then'](function(_0x79d012){_0x43aa77[_0x510a('0x5f')]=_0x79d012;return _0x43aa77;});}})['then'](respondWithFilteredResult(_0x4966cc,_0x3c5d3b))[_0x510a('0x4c')](handleError(_0x4966cc,null));};exports[_0x510a('0x63')]=function(_0x361fa5,_0x56a9c0,_0x28dfd3){var _0xed6fd6={'raw':!![],'where':{}};var _0xabb5d4={};var _0x4646e3={'count':0x0,'rows':[]};return db[_0x510a('0x34')]['findOne']({'where':{'id':_0x361fa5[_0x510a('0x4e')]['id']}})[_0x510a('0x2a')](handleEntityNotFound(_0x56a9c0,null))[_0x510a('0x2a')](function(_0x990663){if(_0x990663){_0xabb5d4[_0x510a('0x39')]=_['keys'](db[_0x510a('0x64')][_0x510a('0x35')]);_0xabb5d4['query']=_[_0x510a('0x3b')](_0x361fa5[_0x510a('0x3a')]);_0xabb5d4[_0x510a('0x3c')]=_[_0x510a('0x3d')](_0xabb5d4[_0x510a('0x39')],_0xabb5d4[_0x510a('0x3a')]);_0xed6fd6[_0x510a('0x3e')]=_[_0x510a('0x3d')](_0xabb5d4['model'],qs[_0x510a('0x4f')](_0x361fa5[_0x510a('0x3a')][_0x510a('0x4f')]));_0xed6fd6['attributes']=_0xed6fd6[_0x510a('0x3e')][_0x510a('0x3f')]?_0xed6fd6[_0x510a('0x3e')]:_0xabb5d4[_0x510a('0x39')];if(!_0x361fa5[_0x510a('0x3a')][_0x510a('0x40')]('nolimit')){_0xed6fd6[_0x510a('0x20')]=qs['limit'](_0x361fa5[_0x510a('0x3a')][_0x510a('0x20')]);_0xed6fd6[_0x510a('0x1f')]=qs[_0x510a('0x1f')](_0x361fa5['query'][_0x510a('0x1f')]);}_0xed6fd6[_0x510a('0x42')]=qs[_0x510a('0x43')](_0x361fa5['query'][_0x510a('0x43')]);_0xed6fd6[_0x510a('0x44')]=qs[_0x510a('0x3c')](_[_0x510a('0x45')](_0x361fa5['query'],_0xabb5d4[_0x510a('0x3c')]));_0xed6fd6[_0x510a('0x44')]['CampaignId']=_0x990663['id'];if(_0x361fa5[_0x510a('0x3a')]['filter']){_0xed6fd6[_0x510a('0x44')]=_[_0x510a('0x48')](_0xed6fd6[_0x510a('0x44')],{'$or':_['map'](_0xed6fd6[_0x510a('0x3e')],function(_0x317e60){var _0x366ee0={};_0x366ee0[_0x317e60]={'$like':'%'+_0x361fa5[_0x510a('0x3a')][_0x510a('0x46')]+'%'};return _0x366ee0;})});}_0xed6fd6=_[_0x510a('0x48')]({},_0xed6fd6,_0x361fa5['options']);return db[_0x510a('0x64')][_0x510a('0x22')]({'where':_0xed6fd6[_0x510a('0x44')]})[_0x510a('0x2a')](function(_0x5f21e8){_0x4646e3[_0x510a('0x22')]=_0x5f21e8;if(_0x361fa5[_0x510a('0x3a')][_0x510a('0x4a')]){_0xed6fd6[_0x510a('0x50')]=[{'all':!![]}];}return db[_0x510a('0x64')][_0x510a('0x4b')](_0xed6fd6);})[_0x510a('0x2a')](function(_0x9d4f67){_0x4646e3[_0x510a('0x5f')]=_0x9d4f67;return _0x4646e3;});}})[_0x510a('0x2a')](respondWithFilteredResult(_0x56a9c0,_0xed6fd6))[_0x510a('0x4c')](handleError(_0x56a9c0,null));};exports[_0x510a('0x65')]=function(_0x1c9322,_0x59448d,_0x5448c4){var _0x13ab9d={'raw':!![],'where':{}};var _0x1179ea={};var _0x1f104a={'count':0x0,'rows':[]};return db[_0x510a('0x34')][_0x510a('0x61')]({'where':{'id':_0x1c9322[_0x510a('0x4e')]['id']}})[_0x510a('0x2a')](handleEntityNotFound(_0x59448d,null))[_0x510a('0x2a')](function(_0x2c0c05){if(_0x2c0c05){_0x1179ea['model']=_['keys'](db['CmHopperBlack'][_0x510a('0x35')]);_0x1179ea['query']=_[_0x510a('0x3b')](_0x1c9322[_0x510a('0x3a')]);_0x1179ea['filters']=_['intersection'](_0x1179ea[_0x510a('0x39')],_0x1179ea[_0x510a('0x3a')]);_0x13ab9d[_0x510a('0x3e')]=_[_0x510a('0x3d')](_0x1179ea[_0x510a('0x39')],qs[_0x510a('0x4f')](_0x1c9322[_0x510a('0x3a')][_0x510a('0x4f')]));_0x13ab9d['attributes']=_0x13ab9d[_0x510a('0x3e')][_0x510a('0x3f')]?_0x13ab9d[_0x510a('0x3e')]:_0x1179ea['model'];if(!_0x1c9322[_0x510a('0x3a')]['hasOwnProperty'](_0x510a('0x41'))){_0x13ab9d[_0x510a('0x20')]=qs[_0x510a('0x20')](_0x1c9322['query'][_0x510a('0x20')]);_0x13ab9d[_0x510a('0x1f')]=qs[_0x510a('0x1f')](_0x1c9322[_0x510a('0x3a')][_0x510a('0x1f')]);}_0x13ab9d[_0x510a('0x42')]=qs[_0x510a('0x43')](_0x1c9322['query']['sort']);_0x13ab9d[_0x510a('0x44')]=qs['filters'](_[_0x510a('0x45')](_0x1c9322['query'],_0x1179ea['filters']));_0x13ab9d[_0x510a('0x44')]['CampaignId']=_0x2c0c05['id'];if(_0x1c9322[_0x510a('0x3a')][_0x510a('0x46')]){_0x13ab9d[_0x510a('0x44')]=_['merge'](_0x13ab9d[_0x510a('0x44')],{'$or':_[_0x510a('0x33')](_0x13ab9d['attributes'],function(_0x55be46){var _0x3d4463={};_0x3d4463[_0x55be46]={'$like':'%'+_0x1c9322[_0x510a('0x3a')][_0x510a('0x46')]+'%'};return _0x3d4463;})});}_0x13ab9d=_[_0x510a('0x48')]({},_0x13ab9d,_0x1c9322[_0x510a('0x49')]);return db['CmHopperBlack']['count']({'where':_0x13ab9d[_0x510a('0x44')]})['then'](function(_0x23c39d){_0x1f104a['count']=_0x23c39d;if(_0x1c9322[_0x510a('0x3a')][_0x510a('0x4a')]){_0x13ab9d[_0x510a('0x50')]=[{'all':!![]}];}return db[_0x510a('0x66')][_0x510a('0x4b')](_0x13ab9d);})[_0x510a('0x2a')](function(_0x6d674a){_0x1f104a[_0x510a('0x5f')]=_0x6d674a;return _0x1f104a;});}})['then'](respondWithFilteredResult(_0x59448d,_0x13ab9d))[_0x510a('0x4c')](handleError(_0x59448d,null));};exports[_0x510a('0x67')]=function(_0x486bab,_0x41d2a6,_0x265acc){var _0x35035b={};var _0x6acdf7={};var _0x408154;var _0x33520b;return db[_0x510a('0x34')][_0x510a('0x61')]({'where':{'id':_0x486bab[_0x510a('0x4e')]['id']}})[_0x510a('0x2a')](handleEntityNotFound(_0x41d2a6,null))[_0x510a('0x2a')](function(_0x3f1da4){if(_0x3f1da4){_0x408154=_0x3f1da4;_0x6acdf7[_0x510a('0x39')]=_[_0x510a('0x3b')](db[_0x510a('0x68')][_0x510a('0x35')]);_0x6acdf7[_0x510a('0x3a')]=_[_0x510a('0x3b')](_0x486bab[_0x510a('0x3a')]);_0x6acdf7[_0x510a('0x3c')]=_[_0x510a('0x3d')](_0x6acdf7['model'],_0x6acdf7[_0x510a('0x3a')]);_0x35035b[_0x510a('0x3e')]=_[_0x510a('0x3d')](_0x6acdf7[_0x510a('0x39')],qs['fields'](_0x486bab[_0x510a('0x3a')][_0x510a('0x4f')]));_0x35035b['attributes']=_0x35035b[_0x510a('0x3e')][_0x510a('0x3f')]?_0x35035b[_0x510a('0x3e')]:_0x6acdf7['model'];_0x35035b[_0x510a('0x42')]=qs[_0x510a('0x43')](_0x486bab[_0x510a('0x3a')][_0x510a('0x43')]);_0x35035b['where']=qs['filters'](_[_0x510a('0x45')](_0x486bab[_0x510a('0x3a')],_0x6acdf7['filters']));if(_0x486bab['query'][_0x510a('0x46')]){_0x35035b[_0x510a('0x44')]=_['merge'](_0x35035b[_0x510a('0x44')],{'$or':_[_0x510a('0x33')](_0x35035b[_0x510a('0x3e')],function(_0x4334f3){var _0x1b01c3={};_0x1b01c3[_0x4334f3]={'$like':'%'+_0x486bab[_0x510a('0x3a')][_0x510a('0x46')]+'%'};return _0x1b01c3;})});}_0x35035b=_['merge']({},_0x35035b,_0x486bab[_0x510a('0x49')]);return _0x408154[_0x510a('0x67')](_0x35035b);}})[_0x510a('0x2a')](function(_0x148fb2){if(_0x148fb2){_0x33520b=_0x148fb2[_0x510a('0x3f')];if(!_0x486bab[_0x510a('0x3a')][_0x510a('0x40')](_0x510a('0x41'))){_0x35035b[_0x510a('0x20')]=qs['limit'](_0x486bab[_0x510a('0x3a')]['limit']);_0x35035b[_0x510a('0x1f')]=qs[_0x510a('0x1f')](_0x486bab[_0x510a('0x3a')][_0x510a('0x1f')]);}return _0x408154[_0x510a('0x67')](_0x35035b);}})[_0x510a('0x2a')](function(_0x3abe8d){if(_0x3abe8d){return _0x3abe8d?{'count':_0x33520b,'rows':_0x3abe8d}:null;}})['then'](respondWithResult(_0x41d2a6,null))[_0x510a('0x4c')](handleError(_0x41d2a6,null));};exports[_0x510a('0x69')]=function(_0x36fcf8,_0x5b1a20,_0x211447){var _0x5c057a,_0x2bd54a;var _0x129f0c=[];var _0x45fd38=moment()['format'](_0x510a('0x6a'));return db[_0x510a('0x34')][_0x510a('0x51')]({'where':{'id':_0x36fcf8['params']['id']}})['then'](handleEntityNotFound(_0x5b1a20,null))[_0x510a('0x2a')](function(_0x3f4959){if(_0x3f4959){_0x2bd54a=_0x3f4959;return _0x3f4959[_0x510a('0x69')](_0x36fcf8[_0x510a('0x53')][_0x510a('0x6b')],_[_0x510a('0x59')](_0x36fcf8[_0x510a('0x53')],[_0x510a('0x6b'),'id'])||{});}return null;})[_0x510a('0x6c')](function(_0x3ac2dd){var _0x89aa44;var _0x460a49;_0x5c057a=_0x3ac2dd||[];var _0x165672=[];if(_0x3ac2dd){for(var _0x5787b2=0x0;_0x5787b2<_0x3ac2dd[_0x510a('0x3f')];_0x5787b2+=0x1){var _0x53cf5e=_0x3ac2dd[_0x5787b2][_0x510a('0x2b')]({'plain':!![]});_0x2bd54a[_0x510a('0x6d')]=_0x36fcf8[_0x510a('0x53')][_0x510a('0x6d')]?_0x36fcf8[_0x510a('0x53')][_0x510a('0x6d')]:_0x2bd54a[_0x510a('0x6d')];switch(_0x2bd54a[_0x510a('0x6d')]){case _0x510a('0x6e'):_0x89aa44=squel[_0x510a('0x6f')]()[_0x510a('0x70')](_0x510a('0x71'))[_0x510a('0x72')]([_0x510a('0x73'),_0x510a('0x74'),'ContactId','ListId',_0x510a('0x5e'),_0x510a('0x5a'),'updatedAt'],squel[_0x510a('0x75')]()[_0x510a('0x76')](_0x510a('0x73'),_0x510a('0x73'))['field'](_0x510a('0x77'),'scheduledAt')[_0x510a('0x76')]('id',_0x510a('0x78'))['field'](_0x53cf5e[_0x510a('0x79')]['toString'](),'ListId')[_0x510a('0x76')](_0x36fcf8[_0x510a('0x4e')]['id'][_0x510a('0x7a')](),_0x510a('0x5e'))[_0x510a('0x76')]('\x27'+_0x45fd38+'\x27','createdAt')[_0x510a('0x76')]('\x27'+_0x45fd38+'\x27',_0x510a('0x5b'))[_0x510a('0x7b')]('cm_contacts')[_0x510a('0x44')]('deletedAt\x20IS\x20NULL')[_0x510a('0x44')]('ListId\x20=\x20?',_0x53cf5e['CmListId'][_0x510a('0x7a')]())['where'](_0x510a('0x7c'))[_0x510a('0x44')](_0x510a('0x7d'),squel[_0x510a('0x75')]()['field'](_0x510a('0x7e'))[_0x510a('0x7b')](_0x510a('0x7f'))[_0x510a('0x44')](_0x510a('0x80'),_0x36fcf8['params']['id']['toString']()))['where'](_0x510a('0x7d'),squel[_0x510a('0x75')]()[_0x510a('0x76')](_0x510a('0x81'))[_0x510a('0x7b')](_0x510a('0x71'))[_0x510a('0x44')](_0x510a('0x80'),_0x36fcf8[_0x510a('0x4e')]['id'][_0x510a('0x7a')]())))[_0x510a('0x7a')]();break;case'onlyIfOpen':_0x89aa44=squel[_0x510a('0x6f')]()['into']('cm_hopper')[_0x510a('0x72')]([_0x510a('0x73'),'scheduledAt',_0x510a('0x78'),_0x510a('0x82'),'CampaignId',_0x510a('0x5a'),'updatedAt'],squel[_0x510a('0x75')]()[_0x510a('0x76')](_0x510a('0x73'),_0x510a('0x73'))[_0x510a('0x76')](_0x510a('0x77'),_0x510a('0x74'))[_0x510a('0x76')]('id','ContactId')[_0x510a('0x76')](_0x53cf5e[_0x510a('0x79')][_0x510a('0x7a')](),_0x510a('0x82'))[_0x510a('0x76')](_0x36fcf8['params']['id'][_0x510a('0x7a')](),_0x510a('0x5e'))[_0x510a('0x76')]('\x27'+_0x45fd38+'\x27',_0x510a('0x5a'))[_0x510a('0x76')]('\x27'+_0x45fd38+'\x27','updatedAt')[_0x510a('0x7b')]('cm_contacts')[_0x510a('0x44')](_0x510a('0x83'))[_0x510a('0x44')]('ListId\x20=\x20?',_0x53cf5e['CmListId'][_0x510a('0x7a')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0x510a('0x44')]('phone\x20NOT\x20IN\x20(?)',squel[_0x510a('0x75')]()[_0x510a('0x76')](_0x510a('0x81'))[_0x510a('0x7b')](_0x510a('0x71'))[_0x510a('0x44')](_0x510a('0x80'),_0x36fcf8['params']['id'][_0x510a('0x7a')]())))[_0x510a('0x7a')]();break;default:_0x89aa44=squel[_0x510a('0x6f')]()[_0x510a('0x70')]('cm_hopper')[_0x510a('0x72')](['phone',_0x510a('0x74'),_0x510a('0x78'),_0x510a('0x82'),_0x510a('0x5e'),'createdAt','updatedAt'],squel[_0x510a('0x75')]()[_0x510a('0x76')](_0x510a('0x73'),_0x510a('0x73'))[_0x510a('0x76')](_0x510a('0x77'),_0x510a('0x74'))[_0x510a('0x76')]('id',_0x510a('0x78'))[_0x510a('0x76')](_0x53cf5e[_0x510a('0x79')][_0x510a('0x7a')](),_0x510a('0x82'))[_0x510a('0x76')](_0x36fcf8[_0x510a('0x4e')]['id'][_0x510a('0x7a')](),_0x510a('0x5e'))['field']('\x27'+_0x45fd38+'\x27',_0x510a('0x5a'))['field']('\x27'+_0x45fd38+'\x27',_0x510a('0x5b'))['from'](_0x510a('0x84'))[_0x510a('0x44')]('deletedAt\x20IS\x20NULL')[_0x510a('0x44')](_0x510a('0x85'),_0x53cf5e[_0x510a('0x79')][_0x510a('0x7a')]())[_0x510a('0x44')](_0x510a('0x7c')))[_0x510a('0x7a')]();}_0x460a49=squel[_0x510a('0x6f')]()['into'](_0x510a('0x86'))[_0x510a('0x72')]([_0x510a('0x87'),'scheduledAt','phone',_0x510a('0x88'),_0x510a('0x5a'),'updatedAt'],squel[_0x510a('0x75')]()['field'](_0x510a('0x89'),'id')[_0x510a('0x76')](_0x510a('0x77'),_0x510a('0x74'))[_0x510a('0x76')](_0x510a('0x8a'),_0x510a('0x73'))['field'](_0x510a('0x8b'),_0x510a('0x88'))[_0x510a('0x76')]('\x27'+_0x45fd38+'\x27',_0x510a('0x5a'))[_0x510a('0x76')]('\x27'+_0x45fd38+'\x27',_0x510a('0x5b'))[_0x510a('0x7b')]('cm_contact_has_items','ci')['join'](_0x510a('0x71'),'h',_0x510a('0x8c'))[_0x510a('0x44')]('h.ListId\x20=\x20?',_0x53cf5e[_0x510a('0x79')][_0x510a('0x7a')]())['where'](_0x510a('0x8d'),_0x36fcf8[_0x510a('0x4e')]['id']['toString']())[_0x510a('0x44')]('h.createdAt\x20=\x20?',_0x45fd38))[_0x510a('0x7a')]();_0x165672[_0x510a('0x8e')](db['sequelize'][_0x510a('0x3a')](_0x89aa44));_0x129f0c[_0x510a('0x8e')](db[_0x510a('0x8f')]['query'](_0x460a49));}return BPromise[_0x510a('0x90')](_0x165672);}})['then'](function(){return BPromise[_0x510a('0x90')](_0x129f0c);})['then'](function(){return _0x5c057a;})[_0x510a('0x2a')](respondWithResult(_0x5b1a20,null))[_0x510a('0x4c')](handleError(_0x5b1a20,null));};exports[_0x510a('0x91')]=function(_0x52ca93,_0x249650,_0x10958f){return db[_0x510a('0x34')][_0x510a('0x51')]({'where':{'id':_0x52ca93[_0x510a('0x4e')]['id']}})[_0x510a('0x2a')](handleEntityNotFound(_0x249650,null))[_0x510a('0x2a')](function(_0xb7a5ce){if(_0xb7a5ce){return _0xb7a5ce[_0x510a('0x91')](_0x52ca93[_0x510a('0x3a')][_0x510a('0x6b')]);}})[_0x510a('0x2a')](function(_0x12f195){if(_0x12f195){return db['CmHopper'][_0x510a('0x2e')]({'where':{'ListId':_0x52ca93['query'][_0x510a('0x6b')],'CampaignId':_0x52ca93['params']['id']}})[_0x510a('0x2a')](function(){return _0x12f195;});}})[_0x510a('0x2a')](respondWithStatusCode(_0x249650,null))['catch'](handleError(_0x249650,null));};exports[_0x510a('0x92')]=function(_0x5a0420,_0x378931,_0x238d91){var _0x4d3372={};var _0x4a55b7={};var _0x3dacf2;var _0x5dc60f;return db['Campaign'][_0x510a('0x61')]({'where':{'id':_0x5a0420[_0x510a('0x4e')]['id']}})[_0x510a('0x2a')](handleEntityNotFound(_0x378931,null))[_0x510a('0x2a')](function(_0x3ae8c8){if(_0x3ae8c8){_0x3dacf2=_0x3ae8c8;_0x4a55b7[_0x510a('0x39')]=_[_0x510a('0x3b')](db[_0x510a('0x68')][_0x510a('0x35')]);_0x4a55b7[_0x510a('0x3a')]=_['keys'](_0x5a0420['query']);_0x4a55b7[_0x510a('0x3c')]=_[_0x510a('0x3d')](_0x4a55b7[_0x510a('0x39')],_0x4a55b7['query']);_0x4d3372['attributes']=_['intersection'](_0x4a55b7[_0x510a('0x39')],qs[_0x510a('0x4f')](_0x5a0420['query'][_0x510a('0x4f')]));_0x4d3372[_0x510a('0x3e')]=_0x4d3372[_0x510a('0x3e')]['length']?_0x4d3372[_0x510a('0x3e')]:_0x4a55b7[_0x510a('0x39')];_0x4d3372[_0x510a('0x42')]=qs['sort'](_0x5a0420[_0x510a('0x3a')][_0x510a('0x43')]);_0x4d3372[_0x510a('0x44')]=qs[_0x510a('0x3c')](_[_0x510a('0x45')](_0x5a0420[_0x510a('0x3a')],_0x4a55b7['filters']));if(_0x5a0420[_0x510a('0x3a')]['filter']){_0x4d3372[_0x510a('0x44')]=_[_0x510a('0x48')](_0x4d3372[_0x510a('0x44')],{'$or':_[_0x510a('0x33')](_0x4d3372[_0x510a('0x3e')],function(_0x587a97){var _0x4ac3e3={};_0x4ac3e3[_0x587a97]={'$like':'%'+_0x5a0420[_0x510a('0x3a')][_0x510a('0x46')]+'%'};return _0x4ac3e3;})});}_0x4d3372=_[_0x510a('0x48')]({},_0x4d3372,_0x5a0420[_0x510a('0x49')]);return _0x3dacf2[_0x510a('0x92')](_0x4d3372);}})[_0x510a('0x2a')](function(_0x45074c){if(_0x45074c){_0x5dc60f=_0x45074c[_0x510a('0x3f')];if(!_0x5a0420['query'][_0x510a('0x40')](_0x510a('0x41'))){_0x4d3372[_0x510a('0x20')]=qs[_0x510a('0x20')](_0x5a0420[_0x510a('0x3a')][_0x510a('0x20')]);_0x4d3372[_0x510a('0x1f')]=qs[_0x510a('0x1f')](_0x5a0420[_0x510a('0x3a')][_0x510a('0x1f')]);}return _0x3dacf2[_0x510a('0x92')](_0x4d3372);}})[_0x510a('0x2a')](function(_0x411714){if(_0x411714){return _0x411714?{'count':_0x5dc60f,'rows':_0x411714}:null;}})[_0x510a('0x2a')](respondWithResult(_0x378931,null))['catch'](handleError(_0x378931,null));};exports[_0x510a('0x93')]=function(_0x12e4f6,_0x321f19,_0x9896c4){var _0x2547c2,_0x551e6b;var _0x1e5c68=[];var _0x4a4f96=moment()[_0x510a('0x94')](_0x510a('0x6a'));return db[_0x510a('0x34')][_0x510a('0x51')]({'where':{'id':_0x12e4f6['params']['id']}})[_0x510a('0x2a')](handleEntityNotFound(_0x321f19,null))[_0x510a('0x2a')](function(_0x15ed0d){if(_0x15ed0d){_0x551e6b=_0x15ed0d;return _0x15ed0d[_0x510a('0x93')](_0x12e4f6[_0x510a('0x53')][_0x510a('0x6b')],_['omit'](_0x12e4f6['body'],[_0x510a('0x6b'),'id'])||{});}return null;})[_0x510a('0x6c')](function(_0x56736b){var _0x52d477;var _0x2eb607;_0x2547c2=_0x56736b||[];var _0xf46c8=[];if(_0x56736b){for(var _0x341e2e=0x0;_0x341e2e<_0x56736b[_0x510a('0x3f')];_0x341e2e+=0x1){var _0xdc4ac4=_0x56736b[_0x341e2e][_0x510a('0x2b')]({'plain':!![]});_0x52d477=squel['insert']()['into']('cm_hopper_black')['fromQuery']([_0x510a('0x73'),_0x510a('0x78'),_0x510a('0x82'),_0x510a('0x5e'),_0x510a('0x5a'),_0x510a('0x5b')],squel[_0x510a('0x75')]()[_0x510a('0x76')](_0x510a('0x73'),'phone')[_0x510a('0x76')]('id',_0x510a('0x78'))[_0x510a('0x76')](_0xdc4ac4[_0x510a('0x79')]['toString'](),_0x510a('0x82'))['field'](_0x12e4f6[_0x510a('0x4e')]['id'][_0x510a('0x7a')](),_0x510a('0x5e'))[_0x510a('0x76')](_0x510a('0x77'),_0x510a('0x5a'))[_0x510a('0x76')](_0x510a('0x77'),_0x510a('0x5b'))['from'](_0x510a('0x84'))['where'](_0x510a('0x83'))[_0x510a('0x44')](_0x510a('0x85'),_0xdc4ac4['CmListId'][_0x510a('0x7a')]())[_0x510a('0x44')](_0x510a('0x7c')))[_0x510a('0x7a')]();_0xf46c8[_0x510a('0x8e')](db[_0x510a('0x8f')][_0x510a('0x3a')](_0x52d477));}return BPromise['all'](_0xf46c8);}})[_0x510a('0x2a')](function(){return _0x2547c2;})[_0x510a('0x2a')](respondWithResult(_0x321f19,null))[_0x510a('0x4c')](handleError(_0x321f19,null));};exports[_0x510a('0x95')]=function(_0x4ccc8e,_0x32799d,_0x5830f5){return db[_0x510a('0x34')][_0x510a('0x51')]({'where':{'id':_0x4ccc8e[_0x510a('0x4e')]['id']}})['then'](handleEntityNotFound(_0x32799d,null))[_0x510a('0x2a')](function(_0x123985){if(_0x123985){return _0x123985[_0x510a('0x95')](_0x4ccc8e[_0x510a('0x3a')][_0x510a('0x6b')]);}})['then'](function(_0x10c68d){if(_0x10c68d){return db[_0x510a('0x66')][_0x510a('0x2e')]({'where':{'ListId':_0x4ccc8e[_0x510a('0x3a')][_0x510a('0x6b')],'CampaignId':_0x4ccc8e[_0x510a('0x4e')]['id']}})[_0x510a('0x2a')](function(){return _0x10c68d;});}})['then'](respondWithStatusCode(_0x32799d,null))[_0x510a('0x4c')](handleError(_0x32799d,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index f245e21..3cbefa7 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(_0xa9dd3e,_0x218069){var _0x4f03a1=function(_0x3427d7){while(--_0x3427d7){_0xa9dd3e['push'](_0xa9dd3e['shift']());}};_0x4f03a1(++_0x218069);}(_0x7a54,0x106));var _0x47a5=function(_0x5023e0,_0x51834){_0x5023e0=_0x5023e0-0x0;var _0x535ec1=_0x7a54[_0x5023e0];return _0x535ec1;};'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(_0xcc06cd,_0x3d2cff){var _0x25f721=function(_0x53f537){while(--_0x53f537){_0xcc06cd['push'](_0xcc06cd['shift']());}};_0x25f721(++_0x3d2cff);}(_0x7a54,0x106));var _0x47a5=function(_0x3efe0c,_0x286b07){_0x3efe0c=_0x3efe0c-0x0;var _0x367740=_0x7a54[_0x3efe0c];return _0x367740;};'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 6425334..dd7776f 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 _0xde50=['catch','GetCampaign','Campaign','findAll','options','where','limit','include','model','map','attributes','then','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','http','info','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result'];(function(_0x3f09a9,_0x2a1758){var _0x854a6d=function(_0x3eff89){while(--_0x3eff89){_0x3f09a9['push'](_0x3f09a9['shift']());}};_0x854a6d(++_0x2a1758);}(_0xde50,0x140));var _0x0de5=function(_0x134ff6,_0x1e6356){_0x134ff6=_0x134ff6-0x0;var _0x50c1bb=_0xde50[_0x134ff6];return _0x50c1bb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0de5('0x0'));var BPromise=require(_0x0de5('0x1'));var rs=require(_0x0de5('0x2'));var fs=require('fs');var Redis=require(_0x0de5('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0de5('0x4'));var logger=require('../../config/logger')(_0x0de5('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x0de5('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2714e3,_0x2a5d94,_0x57410e){return new BPromise(function(_0xe3ac44,_0x4d5f0e){return client['request'](_0x2714e3,_0x57410e)['then'](function(_0x396293){logger[_0x0de5('0x7')](_0x0de5('0x8'),_0x2a5d94,'request\x20sent');logger[_0x0de5('0x9')](_0x0de5('0xa'),_0x2a5d94,'request\x20sent',JSON[_0x0de5('0xb')](_0x396293));if(_0x396293[_0x0de5('0xc')]){if(_0x396293[_0x0de5('0xc')]['code']===0x1f4){logger['error'](_0x0de5('0x8'),_0x2a5d94,_0x396293[_0x0de5('0xc')][_0x0de5('0xd')]);return _0x4d5f0e(_0x396293[_0x0de5('0xc')][_0x0de5('0xd')]);}logger['error'](_0x0de5('0x8'),_0x2a5d94,_0x396293['error']['message']);return _0xe3ac44(_0x396293[_0x0de5('0xc')][_0x0de5('0xd')]);}else{logger[_0x0de5('0x7')](_0x0de5('0x8'),_0x2a5d94,_0x0de5('0xe'));_0xe3ac44(_0x396293[_0x0de5('0xf')]['message']);}})[_0x0de5('0x10')](function(_0xeb58e1){logger[_0x0de5('0xc')](_0x0de5('0x8'),_0x2a5d94,_0xeb58e1);_0x4d5f0e(_0xeb58e1);});});}exports[_0x0de5('0x11')]=function(_0x2860e8){var _0x58ce66=this;return new Promise(function(_0x21e4b6,_0x48ba4e){return db[_0x0de5('0x12')][_0x0de5('0x13')]({'raw':_0x2860e8[_0x0de5('0x14')]?_0x2860e8[_0x0de5('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x2860e8[_0x0de5('0x14')]?_0x2860e8['options'][_0x0de5('0x15')]||null:null,'attributes':_0x2860e8[_0x0de5('0x14')]?_0x2860e8[_0x0de5('0x14')]['attributes']||null:null,'limit':_0x2860e8[_0x0de5('0x14')]?_0x2860e8[_0x0de5('0x14')][_0x0de5('0x16')]||null:null,'include':_0x2860e8[_0x0de5('0x14')]?_0x2860e8['options'][_0x0de5('0x17')]?_['map'](_0x2860e8[_0x0de5('0x14')][_0x0de5('0x17')],function(_0x3bf543){return{'model':db[_0x3bf543[_0x0de5('0x18')]],'as':_0x3bf543['as'],'attributes':_0x3bf543['attributes'],'include':_0x3bf543['include']?_[_0x0de5('0x19')](_0x3bf543['include'],function(_0x378089){return{'model':db[_0x378089['model']],'as':_0x378089['as'],'attributes':_0x378089[_0x0de5('0x1a')],'include':_0x378089[_0x0de5('0x17')]?_[_0x0de5('0x19')](_0x378089[_0x0de5('0x17')],function(_0x3b8981){return{'model':db[_0x3b8981['model']],'as':_0x3b8981['as'],'attributes':_0x3b8981[_0x0de5('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0de5('0x1b')](function(_0x3880e8){logger[_0x0de5('0x7')](_0x0de5('0x11'),_0x2860e8);logger[_0x0de5('0x9')]('GetCampaign',_0x2860e8,JSON[_0x0de5('0xb')](_0x3880e8));_0x21e4b6(_0x3880e8);})['catch'](function(_0x521026){logger[_0x0de5('0xc')]('GetCampaign',_0x521026['message'],_0x2860e8);_0x48ba4e(_0x58ce66[_0x0de5('0xc')](0x1f4,_0x521026[_0x0de5('0xd')]));});});};
\ No newline at end of file
+var _0xe706=['request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCampaign','findAll','options','raw','where','attributes','limit','include','map','model','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s'];(function(_0xc68d77,_0x210295){var _0x4d247a=function(_0x4f906b){while(--_0x4f906b){_0xc68d77['push'](_0xc68d77['shift']());}};_0x4d247a(++_0x210295);}(_0xe706,0xa3));var _0x6e70=function(_0x584789,_0x1f4b10){_0x584789=_0x584789-0x0;var _0x57c028=_0xe706[_0x584789];return _0x57c028;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('Campaign,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('Campaign,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});}exports[_0x6e70('0x19')]=function(_0x5ea7a5){var _0x28a21f=this;return new Promise(function(_0x173afe,_0x53acdc){return db['Campaign'][_0x6e70('0x1a')]({'raw':_0x5ea7a5[_0x6e70('0x1b')]?_0x5ea7a5[_0x6e70('0x1b')][_0x6e70('0x1c')]===undefined?!![]:![]:!![],'where':_0x5ea7a5[_0x6e70('0x1b')]?_0x5ea7a5[_0x6e70('0x1b')][_0x6e70('0x1d')]||null:null,'attributes':_0x5ea7a5[_0x6e70('0x1b')]?_0x5ea7a5[_0x6e70('0x1b')][_0x6e70('0x1e')]||null:null,'limit':_0x5ea7a5['options']?_0x5ea7a5[_0x6e70('0x1b')][_0x6e70('0x1f')]||null:null,'include':_0x5ea7a5[_0x6e70('0x1b')]?_0x5ea7a5['options'][_0x6e70('0x20')]?_[_0x6e70('0x21')](_0x5ea7a5[_0x6e70('0x1b')]['include'],function(_0x10fc91){return{'model':db[_0x10fc91['model']],'as':_0x10fc91['as'],'attributes':_0x10fc91['attributes'],'include':_0x10fc91['include']?_[_0x6e70('0x21')](_0x10fc91[_0x6e70('0x20')],function(_0x51d292){return{'model':db[_0x51d292[_0x6e70('0x22')]],'as':_0x51d292['as'],'attributes':_0x51d292[_0x6e70('0x1e')],'include':_0x51d292['include']?_[_0x6e70('0x21')](_0x51d292[_0x6e70('0x20')],function(_0x2bb231){return{'model':db[_0x2bb231['model']],'as':_0x2bb231['as'],'attributes':_0x2bb231['attributes']};}):[]};}):[]};}):[]:[]})[_0x6e70('0xe')](function(_0x3af17f){logger[_0x6e70('0xf')](_0x6e70('0x19'),_0x5ea7a5);logger[_0x6e70('0x12')]('GetCampaign',_0x5ea7a5,JSON[_0x6e70('0x23')](_0x3af17f));_0x173afe(_0x3af17f);})[_0x6e70('0x18')](function(_0xecf336){logger[_0x6e70('0x14')](_0x6e70('0x19'),_0xecf336[_0x6e70('0x16')],_0x5ea7a5);_0x53acdc(_0x28a21f[_0x6e70('0x14')](0x1f4,_0xecf336[_0x6e70('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 747eb14..31eec48 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 _0xc87e=['/:id/hopper_black','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','clone','addLists','addBlackLists','update','destroy','delete','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','get','isAuthenticated','/:id','show','/:id/hoppers','/:id/hopper_finals','getHopperFinals'];(function(_0x588258,_0x5b26a8){var _0x4efce8=function(_0x2eec95){while(--_0x2eec95){_0x588258['push'](_0x588258['shift']());}};_0x4efce8(++_0x5b26a8);}(_0xc87e,0x17b));var _0xec87=function(_0x14482c,_0x2672cf){_0x14482c=_0x14482c-0x0;var _0x88ccdc=_0xc87e[_0x14482c];return _0x88ccdc;};'use strict';var multer=require(_0xec87('0x0'));var util=require(_0xec87('0x1'));var path=require(_0xec87('0x2'));var timeout=require(_0xec87('0x3'));var express=require(_0xec87('0x4'));var router=express[_0xec87('0x5')]();var fs_extra=require(_0xec87('0x6'));var auth=require(_0xec87('0x7'));var interaction=require(_0xec87('0x8'));var config=require('../../config/environment');var controller=require(_0xec87('0x9'));router[_0xec87('0xa')]('/',auth[_0xec87('0xb')](),controller['index']);router['get'](_0xec87('0xc'),auth[_0xec87('0xb')](),controller[_0xec87('0xd')]);router[_0xec87('0xa')](_0xec87('0xe'),auth[_0xec87('0xb')](),controller['getHoppers']);router[_0xec87('0xa')]('/:id/hopper_histories',auth[_0xec87('0xb')](),controller['getHopperHistories']);router[_0xec87('0xa')](_0xec87('0xf'),auth[_0xec87('0xb')](),controller[_0xec87('0x10')]);router[_0xec87('0xa')](_0xec87('0x11'),auth[_0xec87('0xb')](),controller['getHopperBlacks']);router[_0xec87('0xa')](_0xec87('0x12'),auth['isAuthenticated'](),controller[_0xec87('0x13')]);router[_0xec87('0xa')](_0xec87('0x14'),auth[_0xec87('0xb')](),controller[_0xec87('0x15')]);router[_0xec87('0x16')]('/',auth[_0xec87('0xb')](),controller[_0xec87('0x17')]);router[_0xec87('0x16')]('/:id/clone',auth['isAuthenticated'](),controller[_0xec87('0x18')]);router['post']('/:id/lists',auth['isAuthenticated'](),controller[_0xec87('0x19')]);router['post'](_0xec87('0x14'),auth[_0xec87('0xb')](),controller[_0xec87('0x1a')]);router['put'](_0xec87('0xc'),auth['isAuthenticated'](),controller[_0xec87('0x1b')]);router['delete'](_0xec87('0xc'),auth['isAuthenticated'](),controller[_0xec87('0x1c')]);router[_0xec87('0x1d')](_0xec87('0x12'),auth[_0xec87('0xb')](),controller[_0xec87('0x1e')]);router[_0xec87('0x1d')]('/:id/blacklists',auth[_0xec87('0xb')](),controller[_0xec87('0x1f')]);module[_0xec87('0x20')]=router;
\ No newline at end of file
+var _0xf43c=['./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/lists','getLists','getBlackLists','post','create','/:id/clone','clone','/:id/blacklists','addBlackLists','put','update','destroy','delete','removeLists','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x6ba855,_0x4e6b79){var _0x4ebe40=function(_0x54cef7){while(--_0x54cef7){_0x6ba855['push'](_0x6ba855['shift']());}};_0x4ebe40(++_0x4e6b79);}(_0xf43c,0x160));var _0xcf43=function(_0x31287a,_0x2a1f35){_0x31287a=_0x31287a-0x0;var _0x5f4159=_0xf43c[_0x31287a];return _0x5f4159;};'use strict';var multer=require(_0xcf43('0x0'));var util=require(_0xcf43('0x1'));var path=require(_0xcf43('0x2'));var timeout=require(_0xcf43('0x3'));var express=require('express');var router=express[_0xcf43('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xcf43('0x5'));var interaction=require(_0xcf43('0x6'));var config=require(_0xcf43('0x7'));var controller=require(_0xcf43('0x8'));router[_0xcf43('0x9')]('/',auth[_0xcf43('0xa')](),controller[_0xcf43('0xb')]);router[_0xcf43('0x9')](_0xcf43('0xc'),auth[_0xcf43('0xa')](),controller[_0xcf43('0xd')]);router[_0xcf43('0x9')](_0xcf43('0xe'),auth['isAuthenticated'](),controller[_0xcf43('0xf')]);router['get'](_0xcf43('0x10'),auth['isAuthenticated'](),controller[_0xcf43('0x11')]);router[_0xcf43('0x9')](_0xcf43('0x12'),auth[_0xcf43('0xa')](),controller[_0xcf43('0x13')]);router[_0xcf43('0x9')]('/:id/hopper_black',auth[_0xcf43('0xa')](),controller[_0xcf43('0x14')]);router[_0xcf43('0x9')](_0xcf43('0x15'),auth['isAuthenticated'](),controller[_0xcf43('0x16')]);router[_0xcf43('0x9')]('/:id/blacklists',auth[_0xcf43('0xa')](),controller[_0xcf43('0x17')]);router[_0xcf43('0x18')]('/',auth[_0xcf43('0xa')](),controller[_0xcf43('0x19')]);router[_0xcf43('0x18')](_0xcf43('0x1a'),auth[_0xcf43('0xa')](),controller[_0xcf43('0x1b')]);router[_0xcf43('0x18')](_0xcf43('0x15'),auth[_0xcf43('0xa')](),controller['addLists']);router[_0xcf43('0x18')](_0xcf43('0x1c'),auth['isAuthenticated'](),controller[_0xcf43('0x1d')]);router[_0xcf43('0x1e')](_0xcf43('0xc'),auth[_0xcf43('0xa')](),controller[_0xcf43('0x1f')]);router['delete'](_0xcf43('0xc'),auth['isAuthenticated'](),controller[_0xcf43('0x20')]);router[_0xcf43('0x21')](_0xcf43('0x15'),auth['isAuthenticated'](),controller[_0xcf43('0x22')]);router[_0xcf43('0x21')]('/:id/blacklists',auth[_0xcf43('0xa')](),controller['removeBlackLists']);module[_0xcf43('0x23')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 926ae6b..06b8793 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 _0xb6a0=['exports','STRING','TEXT','getDataValue','key','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb6a0,0x1af));var _0x0b6a=function(_0x5cc114,_0x32368e){_0x5cc114=_0x5cc114-0x0;var _0x57743a=_0xb6a0[_0x5cc114];return _0x57743a;};'use strict';var Sequelize=require(_0x0b6a('0x0'));module[_0x0b6a('0x1')]={'key':{'type':Sequelize[_0x0b6a('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x0b6a('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x0b6a('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0b6a('0x4')](_0x0b6a('0x5'));}}};
\ No newline at end of file
+var _0x8546=['getDataValue','key','sequelize','exports','STRING','TEXT','VIRTUAL'];(function(_0x3d4876,_0x366386){var _0x58ca9d=function(_0x5bd045){while(--_0x5bd045){_0x3d4876['push'](_0x3d4876['shift']());}};_0x58ca9d(++_0x366386);}(_0x8546,0x1b4));var _0x6854=function(_0x3bdfe2,_0x22ff84){_0x3bdfe2=_0x3bdfe2-0x0;var _0x162343=_0x8546[_0x3bdfe2];return _0x162343;};'use strict';var Sequelize=require(_0x6854('0x0'));module[_0x6854('0x1')]={'key':{'type':Sequelize[_0x6854('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x6854('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x6854('0x2')]},'name':{'type':Sequelize[_0x6854('0x4')],'get':function(){return this[_0x6854('0x5')](_0x6854('0x6'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index b92ea80..a30c6a4 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 _0x8bdc=['moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','end','error','stack','name','send','index','map','CannedAnswer','rawAttributes','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','keys','intersection','find','body','params','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CannedAnswers','autoAssociation','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x505096,_0x59cf51){var _0x5840bd=function(_0x16ebdf){while(--_0x16ebdf){_0x505096['push'](_0x505096['shift']());}};_0x5840bd(++_0x59cf51);}(_0x8bdc,0xac));var _0xc8bd=function(_0xe12b08,_0x417721){_0xe12b08=_0xe12b08-0x0;var _0x56ebab=_0x8bdc[_0xe12b08];return _0x56ebab;};'use strict';var emlformat=require(_0xc8bd('0x0'));var rimraf=require(_0xc8bd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc8bd('0x2'));var rp=require(_0xc8bd('0x3'));var moment=require(_0xc8bd('0x4'));var BPromise=require(_0xc8bd('0x5'));var Mustache=require('mustache');var util=require(_0xc8bd('0x6'));var path=require(_0xc8bd('0x7'));var sox=require(_0xc8bd('0x8'));var csv=require(_0xc8bd('0x9'));var ejs=require(_0xc8bd('0xa'));var fs=require('fs');var fs_extra=require(_0xc8bd('0xb'));var _=require(_0xc8bd('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc8bd('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc8bd('0xe'));var Redis=require(_0xc8bd('0xf'));var authService=require(_0xc8bd('0x10'));var qs=require(_0xc8bd('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc8bd('0x12'));var logger=require(_0xc8bd('0x13'))(_0xc8bd('0x14'));var utils=require('../../config/utils');var config=require(_0xc8bd('0x15'));var licenseUtil=require(_0xc8bd('0x16'));var db=require(_0xc8bd('0x17'))['db'];function respondWithStatusCode(_0x3a4180,_0x4de394){_0x4de394=_0x4de394||0xcc;return function(_0x56f2fc){if(_0x56f2fc){return _0x3a4180[_0xc8bd('0x18')](_0x4de394);}return _0x3a4180[_0xc8bd('0x19')](_0x4de394)['end']();};}function respondWithResult(_0x286cd4,_0x215860){_0x215860=_0x215860||0xc8;return function(_0x1dbad9){if(_0x1dbad9){return _0x286cd4[_0xc8bd('0x19')](_0x215860)[_0xc8bd('0x1a')](_0x1dbad9);}};}function respondWithFilteredResult(_0x2a3e94,_0x17aa6d){return function(_0x2394dc){if(_0x2394dc){var _0x5393ea=typeof _0x17aa6d[_0xc8bd('0x1b')]===_0xc8bd('0x1c')&&typeof _0x17aa6d[_0xc8bd('0x1d')]==='undefined';var _0x5e5d3e=_0x2394dc[_0xc8bd('0x1e')];var _0x4f9031=_0x5393ea?0x0:_0x17aa6d[_0xc8bd('0x1b')];var _0x30099f=_0x5393ea?_0x2394dc[_0xc8bd('0x1e')]:_0x17aa6d[_0xc8bd('0x1b')]+_0x17aa6d['limit'];var _0xfeeef;if(_0x30099f>=_0x5e5d3e){_0x30099f=_0x5e5d3e;_0xfeeef=0xc8;}else{_0xfeeef=0xce;}_0x2a3e94['status'](_0xfeeef);return _0x2a3e94[_0xc8bd('0x1f')](_0xc8bd('0x20'),_0x4f9031+'-'+_0x30099f+'/'+_0x5e5d3e)['json'](_0x2394dc);}return null;};}function patchUpdates(_0x37981c){return function(_0x55c90a){try{jsonpatch[_0xc8bd('0x21')](_0x55c90a,_0x37981c,!![]);}catch(_0x397b1f){return BPromise[_0xc8bd('0x22')](_0x397b1f);}return _0x55c90a[_0xc8bd('0x23')]();};}function saveUpdates(_0x4dc6cf,_0x82381e){return function(_0x57b114){if(_0x57b114){return _0x57b114[_0xc8bd('0x24')](_0x4dc6cf)[_0xc8bd('0x25')](function(_0x39d35b){return _0x39d35b;});}return null;};}function removeEntity(_0x431805,_0x47930b){return function(_0x57c51a){if(_0x57c51a){return _0x57c51a[_0xc8bd('0x26')]()[_0xc8bd('0x25')](function(){var _0x31b62d=_0x57c51a[_0xc8bd('0x27')]({'plain':!![]});var _0x1686a2='CannedAnswers';return db[_0xc8bd('0x28')][_0xc8bd('0x26')]({'where':{'type':_0x1686a2,'resourceId':_0x31b62d['id']}})[_0xc8bd('0x25')](function(){return _0x57c51a;});})['then'](function(){_0x431805[_0xc8bd('0x19')](0xcc)[_0xc8bd('0x29')]();});}};}function handleEntityNotFound(_0x111bb6,_0x55f060){return function(_0x1b4a63){if(!_0x1b4a63){_0x111bb6[_0xc8bd('0x18')](0x194);}return _0x1b4a63;};}function handleError(_0x402be2,_0x5b19ac){_0x5b19ac=_0x5b19ac||0x1f4;return function(_0x254da1){logger[_0xc8bd('0x2a')](_0x254da1[_0xc8bd('0x2b')]);if(_0x254da1[_0xc8bd('0x2c')]){delete _0x254da1[_0xc8bd('0x2c')];}_0x402be2[_0xc8bd('0x19')](_0x5b19ac)[_0xc8bd('0x2d')](_0x254da1);};}exports[_0xc8bd('0x2e')]=function(_0x2bdb1e,_0x2ef83b){var _0x3f70e7={},_0x5a0ada={},_0x362cc8={'count':0x0,'rows':[]};var _0x2740c4=_[_0xc8bd('0x2f')](db[_0xc8bd('0x30')][_0xc8bd('0x31')],function(_0x5ee796){return{'name':_0x5ee796['fieldName'],'type':_0x5ee796[_0xc8bd('0x32')][_0xc8bd('0x33')]};});_0x5a0ada[_0xc8bd('0x34')]=_[_0xc8bd('0x2f')](_0x2740c4,_0xc8bd('0x2c'));_0x5a0ada[_0xc8bd('0x35')]=_['keys'](_0x2bdb1e[_0xc8bd('0x35')]);_0x5a0ada[_0xc8bd('0x36')]=_['intersection'](_0x5a0ada[_0xc8bd('0x34')],_0x5a0ada[_0xc8bd('0x35')]);_0x3f70e7[_0xc8bd('0x37')]=_['intersection'](_0x5a0ada['model'],qs[_0xc8bd('0x38')](_0x2bdb1e[_0xc8bd('0x35')][_0xc8bd('0x38')]));_0x3f70e7['attributes']=_0x3f70e7[_0xc8bd('0x37')][_0xc8bd('0x39')]?_0x3f70e7[_0xc8bd('0x37')]:_0x5a0ada[_0xc8bd('0x34')];if(!_0x2bdb1e[_0xc8bd('0x35')][_0xc8bd('0x3a')]('nolimit')){_0x3f70e7[_0xc8bd('0x1d')]=qs[_0xc8bd('0x1d')](_0x2bdb1e[_0xc8bd('0x35')]['limit']);_0x3f70e7[_0xc8bd('0x1b')]=qs['offset'](_0x2bdb1e[_0xc8bd('0x35')][_0xc8bd('0x1b')]);}_0x3f70e7['order']=qs[_0xc8bd('0x3b')](_0x2bdb1e[_0xc8bd('0x35')][_0xc8bd('0x3b')]);_0x3f70e7[_0xc8bd('0x3c')]=qs[_0xc8bd('0x36')](_[_0xc8bd('0x3d')](_0x2bdb1e[_0xc8bd('0x35')],_0x5a0ada[_0xc8bd('0x36')]),_0x2740c4);if(_0x2bdb1e['query'][_0xc8bd('0x3e')]){_0x3f70e7[_0xc8bd('0x3c')]=_[_0xc8bd('0x3f')](_0x3f70e7[_0xc8bd('0x3c')],{'$or':[{'key':{'$like':'%'+_0x2bdb1e[_0xc8bd('0x35')]['filter']+'%'}},{'value':{'$like':'%'+_0x2bdb1e['query'][_0xc8bd('0x3e')]+'%'}}]});}_0x3f70e7=_['merge']({},_0x3f70e7,_0x2bdb1e[_0xc8bd('0x40')]);var _0x184be5={'where':_0x3f70e7[_0xc8bd('0x3c')]};return db[_0xc8bd('0x30')]['count'](_0x184be5)[_0xc8bd('0x25')](function(_0x3c26f){_0x362cc8[_0xc8bd('0x1e')]=_0x3c26f;if(_0x2bdb1e[_0xc8bd('0x35')][_0xc8bd('0x41')]){_0x3f70e7[_0xc8bd('0x42')]=[{'all':!![]}];}return db[_0xc8bd('0x30')][_0xc8bd('0x43')](_0x3f70e7);})[_0xc8bd('0x25')](function(_0x358af5){_0x362cc8[_0xc8bd('0x44')]=_0x358af5;return _0x362cc8;})['then'](respondWithFilteredResult(_0x2ef83b,_0x3f70e7))[_0xc8bd('0x45')](handleError(_0x2ef83b,null));};exports[_0xc8bd('0x46')]=function(_0xb14d77,_0x48e29c){var _0x492276={'raw':!![],'where':{'id':_0xb14d77['params']['id']}},_0x544042={};_0x544042['model']=_[_0xc8bd('0x47')](db['CannedAnswer'][_0xc8bd('0x31')]);_0x544042['query']=_[_0xc8bd('0x47')](_0xb14d77['query']);_0x544042['filters']=_['intersection'](_0x544042['model'],_0x544042[_0xc8bd('0x35')]);_0x492276[_0xc8bd('0x37')]=_[_0xc8bd('0x48')](_0x544042[_0xc8bd('0x34')],qs['fields'](_0xb14d77['query']['fields']));_0x492276[_0xc8bd('0x37')]=_0x492276[_0xc8bd('0x37')][_0xc8bd('0x39')]?_0x492276[_0xc8bd('0x37')]:_0x544042[_0xc8bd('0x34')];if(_0xb14d77[_0xc8bd('0x35')]['includeAll']){_0x492276[_0xc8bd('0x42')]=[{'all':!![]}];}_0x492276=_[_0xc8bd('0x3f')]({},_0x492276,_0xb14d77[_0xc8bd('0x40')]);return db[_0xc8bd('0x30')][_0xc8bd('0x49')](_0x492276)[_0xc8bd('0x25')](handleEntityNotFound(_0x48e29c,null))[_0xc8bd('0x25')](respondWithResult(_0x48e29c,null))[_0xc8bd('0x45')](handleError(_0x48e29c,null));};exports[_0xc8bd('0x24')]=function(_0x53b6aa,_0x5147f6){if(_0x53b6aa[_0xc8bd('0x4a')]['id']){delete _0x53b6aa[_0xc8bd('0x4a')]['id'];}return db[_0xc8bd('0x30')]['find']({'where':{'id':_0x53b6aa[_0xc8bd('0x4b')]['id']}})[_0xc8bd('0x25')](handleEntityNotFound(_0x5147f6,null))['then'](saveUpdates(_0x53b6aa[_0xc8bd('0x4a')],null))[_0xc8bd('0x25')](respondWithResult(_0x5147f6,null))[_0xc8bd('0x45')](handleError(_0x5147f6,null));};exports[_0xc8bd('0x26')]=function(_0x1efb3f,_0x18f55b){return db[_0xc8bd('0x30')]['find']({'where':{'id':_0x1efb3f[_0xc8bd('0x4b')]['id']}})[_0xc8bd('0x25')](handleEntityNotFound(_0x18f55b,null))[_0xc8bd('0x25')](removeEntity(_0x18f55b,null))[_0xc8bd('0x45')](handleError(_0x18f55b,null));};exports['create']=function(_0x50171d,_0x23106d){var _0x41bd01={'key':_0x50171d[_0xc8bd('0x4a')][_0xc8bd('0x33')]};if(_0x50171d[_0xc8bd('0x4a')][_0xc8bd('0x4c')]){_0x41bd01[_0xc8bd('0x4c')]=_0x50171d['body']['MailAccountId'];}else if(_0x50171d[_0xc8bd('0x4a')]['SmsAccountId']){_0x41bd01['SmsAccountId']=_0x50171d['body'][_0xc8bd('0x4d')];}else if(_0x50171d[_0xc8bd('0x4a')][_0xc8bd('0x4e')]){_0x41bd01['OpenchannelAccountId']=_0x50171d[_0xc8bd('0x4a')][_0xc8bd('0x4e')];}else if(_0x50171d[_0xc8bd('0x4a')][_0xc8bd('0x4f')]){_0x41bd01[_0xc8bd('0x4f')]=_0x50171d[_0xc8bd('0x4a')][_0xc8bd('0x4f')];}return db[_0xc8bd('0x30')]['find']({'where':_0x41bd01})[_0xc8bd('0x25')](function(_0x68c733){if(_0x68c733){throw new db[(_0xc8bd('0x50'))]['ValidationError'](_0xc8bd('0x51'));}return db['CannedAnswer'][_0xc8bd('0x52')](_0x50171d['body']);})['then'](function(_0x40c818){var _0x2e661b=_0x50171d[_0xc8bd('0x53')][_0xc8bd('0x27')]({'plain':!![]});if(!_0x2e661b)throw new Error(_0xc8bd('0x54'));if(_0x2e661b[_0xc8bd('0x55')]===_0xc8bd('0x53')){var _0x51032b=_0x40c818[_0xc8bd('0x27')]({'plain':!![]});return db['UserProfileSection'][_0xc8bd('0x49')]({'where':{'name':_0xc8bd('0x56'),'userProfileId':_0x2e661b['userProfileId']},'raw':!![]})['then'](function(_0xd8f111){if(_0xd8f111&&_0xd8f111[_0xc8bd('0x57')]===0x0){return db[_0xc8bd('0x28')][_0xc8bd('0x52')]({'name':_0x51032b[_0xc8bd('0x2c')],'resourceId':_0x51032b['id'],'type':_0xd8f111['name'],'sectionId':_0xd8f111['id']},{})[_0xc8bd('0x25')](function(){return _0x40c818;});}else{return _0x40c818;}})[_0xc8bd('0x45')](function(_0x23a8de){logger[_0xc8bd('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x23a8de);throw _0x23a8de;});}return _0x40c818;})['then'](respondWithResult(_0x23106d,0xc9))[_0xc8bd('0x45')](handleError(_0x23106d,null));};
\ No newline at end of file
+var _0x6ef6=['api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','then','get','CannedAnswers','UserProfileResource','destroy','error','stack','name','send','CannedAnswer','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','merge','filter','options','includeAll','include','rows','catch','show','params','find','body','MailAccountId','OpenchannelAccountId','ChatWebsiteId','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6ef6,0x18f));var _0x66ef=function(_0x2330c5,_0x5ddb84){_0x2330c5=_0x2330c5-0x0;var _0x48133d=_0x6ef6[_0x2330c5];return _0x48133d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x66ef('0x0'));var zipdir=require(_0x66ef('0x1'));var jsonpatch=require(_0x66ef('0x2'));var rp=require('request-promise');var moment=require(_0x66ef('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x66ef('0x4'));var util=require('util');var path=require(_0x66ef('0x5'));var sox=require('sox');var csv=require(_0x66ef('0x6'));var ejs=require(_0x66ef('0x7'));var fs=require('fs');var fs_extra=require(_0x66ef('0x8'));var _=require(_0x66ef('0x9'));var squel=require(_0x66ef('0xa'));var crypto=require(_0x66ef('0xb'));var jsforce=require(_0x66ef('0xc'));var deskjs=require(_0x66ef('0xd'));var toCsv=require(_0x66ef('0x6'));var querystring=require(_0x66ef('0xe'));var Papa=require(_0x66ef('0xf'));var Redis=require(_0x66ef('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x66ef('0x11'));var as=require(_0x66ef('0x12'));var hardwareService=require(_0x66ef('0x13'));var logger=require(_0x66ef('0x14'))(_0x66ef('0x15'));var utils=require('../../config/utils');var config=require(_0x66ef('0x16'));var licenseUtil=require(_0x66ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x48cf54,_0x2e4ccd){_0x2e4ccd=_0x2e4ccd||0xcc;return function(_0x1c74d9){if(_0x1c74d9){return _0x48cf54[_0x66ef('0x18')](_0x2e4ccd);}return _0x48cf54[_0x66ef('0x19')](_0x2e4ccd)[_0x66ef('0x1a')]();};}function respondWithResult(_0x42d205,_0x32bcab){_0x32bcab=_0x32bcab||0xc8;return function(_0x1a8c2b){if(_0x1a8c2b){return _0x42d205[_0x66ef('0x19')](_0x32bcab)['json'](_0x1a8c2b);}};}function respondWithFilteredResult(_0x3eab1e,_0x299d92){return function(_0x57294b){if(_0x57294b){var _0x653232=typeof _0x299d92[_0x66ef('0x1b')]==='undefined'&&typeof _0x299d92[_0x66ef('0x1c')]===_0x66ef('0x1d');var _0x417437=_0x57294b['count'];var _0x3481b8=_0x653232?0x0:_0x299d92[_0x66ef('0x1b')];var _0x39f22f=_0x653232?_0x57294b[_0x66ef('0x1e')]:_0x299d92[_0x66ef('0x1b')]+_0x299d92[_0x66ef('0x1c')];var _0x594fe7;if(_0x39f22f>=_0x417437){_0x39f22f=_0x417437;_0x594fe7=0xc8;}else{_0x594fe7=0xce;}_0x3eab1e['status'](_0x594fe7);return _0x3eab1e[_0x66ef('0x1f')](_0x66ef('0x20'),_0x3481b8+'-'+_0x39f22f+'/'+_0x417437)[_0x66ef('0x21')](_0x57294b);}return null;};}function patchUpdates(_0x5998da){return function(_0x2247c8){try{jsonpatch[_0x66ef('0x22')](_0x2247c8,_0x5998da,!![]);}catch(_0x3a1255){return BPromise[_0x66ef('0x23')](_0x3a1255);}return _0x2247c8['save']();};}function saveUpdates(_0x51d290,_0x13cc0c){return function(_0x262a39){if(_0x262a39){return _0x262a39[_0x66ef('0x24')](_0x51d290)[_0x66ef('0x25')](function(_0x486662){return _0x486662;});}return null;};}function removeEntity(_0x493451,_0x4dac14){return function(_0x3b3cd6){if(_0x3b3cd6){return _0x3b3cd6['destroy']()['then'](function(){var _0x13b605=_0x3b3cd6[_0x66ef('0x26')]({'plain':!![]});var _0x4d49cc=_0x66ef('0x27');return db[_0x66ef('0x28')][_0x66ef('0x29')]({'where':{'type':_0x4d49cc,'resourceId':_0x13b605['id']}})['then'](function(){return _0x3b3cd6;});})[_0x66ef('0x25')](function(){_0x493451[_0x66ef('0x19')](0xcc)[_0x66ef('0x1a')]();});}};}function handleEntityNotFound(_0x173f82,_0x34d71f){return function(_0x54126b){if(!_0x54126b){_0x173f82[_0x66ef('0x18')](0x194);}return _0x54126b;};}function handleError(_0x28badb,_0x5c4651){_0x5c4651=_0x5c4651||0x1f4;return function(_0x20effa){logger[_0x66ef('0x2a')](_0x20effa[_0x66ef('0x2b')]);if(_0x20effa[_0x66ef('0x2c')]){delete _0x20effa[_0x66ef('0x2c')];}_0x28badb[_0x66ef('0x19')](_0x5c4651)[_0x66ef('0x2d')](_0x20effa);};}exports['index']=function(_0x36833d,_0x20bfbf){var _0x1e0a54={},_0x3109d2={},_0x9952d5={'count':0x0,'rows':[]};var _0x2ba55c=_['map'](db[_0x66ef('0x2e')][_0x66ef('0x2f')],function(_0x1e1c29){return{'name':_0x1e1c29[_0x66ef('0x30')],'type':_0x1e1c29[_0x66ef('0x31')][_0x66ef('0x32')]};});_0x3109d2[_0x66ef('0x33')]=_['map'](_0x2ba55c,_0x66ef('0x2c'));_0x3109d2[_0x66ef('0x34')]=_[_0x66ef('0x35')](_0x36833d[_0x66ef('0x34')]);_0x3109d2[_0x66ef('0x36')]=_[_0x66ef('0x37')](_0x3109d2['model'],_0x3109d2[_0x66ef('0x34')]);_0x1e0a54['attributes']=_[_0x66ef('0x37')](_0x3109d2['model'],qs['fields'](_0x36833d[_0x66ef('0x34')][_0x66ef('0x38')]));_0x1e0a54[_0x66ef('0x39')]=_0x1e0a54[_0x66ef('0x39')][_0x66ef('0x3a')]?_0x1e0a54[_0x66ef('0x39')]:_0x3109d2[_0x66ef('0x33')];if(!_0x36833d[_0x66ef('0x34')][_0x66ef('0x3b')]('nolimit')){_0x1e0a54[_0x66ef('0x1c')]=qs['limit'](_0x36833d[_0x66ef('0x34')]['limit']);_0x1e0a54[_0x66ef('0x1b')]=qs['offset'](_0x36833d['query'][_0x66ef('0x1b')]);}_0x1e0a54['order']=qs[_0x66ef('0x3c')](_0x36833d[_0x66ef('0x34')]['sort']);_0x1e0a54[_0x66ef('0x3d')]=qs[_0x66ef('0x36')](_[_0x66ef('0x3e')](_0x36833d[_0x66ef('0x34')],_0x3109d2[_0x66ef('0x36')]),_0x2ba55c);if(_0x36833d[_0x66ef('0x34')]['filter']){_0x1e0a54[_0x66ef('0x3d')]=_[_0x66ef('0x3f')](_0x1e0a54[_0x66ef('0x3d')],{'$or':[{'key':{'$like':'%'+_0x36833d['query']['filter']+'%'}},{'value':{'$like':'%'+_0x36833d[_0x66ef('0x34')][_0x66ef('0x40')]+'%'}}]});}_0x1e0a54=_[_0x66ef('0x3f')]({},_0x1e0a54,_0x36833d[_0x66ef('0x41')]);var _0x26bf0={'where':_0x1e0a54[_0x66ef('0x3d')]};return db[_0x66ef('0x2e')][_0x66ef('0x1e')](_0x26bf0)[_0x66ef('0x25')](function(_0x260c3a){_0x9952d5[_0x66ef('0x1e')]=_0x260c3a;if(_0x36833d[_0x66ef('0x34')][_0x66ef('0x42')]){_0x1e0a54[_0x66ef('0x43')]=[{'all':!![]}];}return db[_0x66ef('0x2e')]['findAll'](_0x1e0a54);})[_0x66ef('0x25')](function(_0xed23f0){_0x9952d5[_0x66ef('0x44')]=_0xed23f0;return _0x9952d5;})['then'](respondWithFilteredResult(_0x20bfbf,_0x1e0a54))[_0x66ef('0x45')](handleError(_0x20bfbf,null));};exports[_0x66ef('0x46')]=function(_0xb247a7,_0x20d7e8){var _0x49fee5={'raw':!![],'where':{'id':_0xb247a7[_0x66ef('0x47')]['id']}},_0x162715={};_0x162715[_0x66ef('0x33')]=_['keys'](db[_0x66ef('0x2e')][_0x66ef('0x2f')]);_0x162715[_0x66ef('0x34')]=_['keys'](_0xb247a7['query']);_0x162715[_0x66ef('0x36')]=_[_0x66ef('0x37')](_0x162715[_0x66ef('0x33')],_0x162715['query']);_0x49fee5[_0x66ef('0x39')]=_['intersection'](_0x162715[_0x66ef('0x33')],qs[_0x66ef('0x38')](_0xb247a7[_0x66ef('0x34')][_0x66ef('0x38')]));_0x49fee5[_0x66ef('0x39')]=_0x49fee5[_0x66ef('0x39')][_0x66ef('0x3a')]?_0x49fee5[_0x66ef('0x39')]:_0x162715[_0x66ef('0x33')];if(_0xb247a7[_0x66ef('0x34')][_0x66ef('0x42')]){_0x49fee5[_0x66ef('0x43')]=[{'all':!![]}];}_0x49fee5=_[_0x66ef('0x3f')]({},_0x49fee5,_0xb247a7[_0x66ef('0x41')]);return db['CannedAnswer'][_0x66ef('0x48')](_0x49fee5)[_0x66ef('0x25')](handleEntityNotFound(_0x20d7e8,null))[_0x66ef('0x25')](respondWithResult(_0x20d7e8,null))['catch'](handleError(_0x20d7e8,null));};exports[_0x66ef('0x24')]=function(_0x1e7b52,_0x28faf4){if(_0x1e7b52[_0x66ef('0x49')]['id']){delete _0x1e7b52[_0x66ef('0x49')]['id'];}return db[_0x66ef('0x2e')][_0x66ef('0x48')]({'where':{'id':_0x1e7b52[_0x66ef('0x47')]['id']}})[_0x66ef('0x25')](handleEntityNotFound(_0x28faf4,null))[_0x66ef('0x25')](saveUpdates(_0x1e7b52[_0x66ef('0x49')],null))['then'](respondWithResult(_0x28faf4,null))[_0x66ef('0x45')](handleError(_0x28faf4,null));};exports['destroy']=function(_0x138ba4,_0x751ab1){return db[_0x66ef('0x2e')][_0x66ef('0x48')]({'where':{'id':_0x138ba4['params']['id']}})[_0x66ef('0x25')](handleEntityNotFound(_0x751ab1,null))[_0x66ef('0x25')](removeEntity(_0x751ab1,null))[_0x66ef('0x45')](handleError(_0x751ab1,null));};exports['create']=function(_0x1bf760,_0x426483){var _0x215a07={'key':_0x1bf760[_0x66ef('0x49')]['key']};if(_0x1bf760[_0x66ef('0x49')][_0x66ef('0x4a')]){_0x215a07['MailAccountId']=_0x1bf760[_0x66ef('0x49')][_0x66ef('0x4a')];}else if(_0x1bf760[_0x66ef('0x49')]['SmsAccountId']){_0x215a07['SmsAccountId']=_0x1bf760['body']['SmsAccountId'];}else if(_0x1bf760[_0x66ef('0x49')][_0x66ef('0x4b')]){_0x215a07['OpenchannelAccountId']=_0x1bf760[_0x66ef('0x49')][_0x66ef('0x4b')];}else if(_0x1bf760[_0x66ef('0x49')][_0x66ef('0x4c')]){_0x215a07[_0x66ef('0x4c')]=_0x1bf760[_0x66ef('0x49')][_0x66ef('0x4c')];}return db[_0x66ef('0x2e')][_0x66ef('0x48')]({'where':_0x215a07})[_0x66ef('0x25')](function(_0x58089b){if(_0x58089b){throw new db['Sequelize']['ValidationError'](_0x66ef('0x4d'));}return db[_0x66ef('0x2e')][_0x66ef('0x4e')](_0x1bf760[_0x66ef('0x49')]);})[_0x66ef('0x25')](function(_0x1768c7){var _0x37b5f5=_0x1bf760[_0x66ef('0x4f')]['get']({'plain':!![]});if(!_0x37b5f5)throw new Error(_0x66ef('0x50'));if(_0x37b5f5['role']===_0x66ef('0x4f')){var _0x493dc0=_0x1768c7[_0x66ef('0x26')]({'plain':!![]});return db[_0x66ef('0x51')][_0x66ef('0x48')]({'where':{'name':_0x66ef('0x27'),'userProfileId':_0x37b5f5[_0x66ef('0x52')]},'raw':!![]})[_0x66ef('0x25')](function(_0x2a2c96){if(_0x2a2c96&&_0x2a2c96['autoAssociation']===0x0){return db[_0x66ef('0x28')]['create']({'name':_0x493dc0[_0x66ef('0x2c')],'resourceId':_0x493dc0['id'],'type':_0x2a2c96['name'],'sectionId':_0x2a2c96['id']},{})[_0x66ef('0x25')](function(){return _0x1768c7;});}else{return _0x1768c7;}})[_0x66ef('0x45')](function(_0x20caf9){logger[_0x66ef('0x2a')](_0x66ef('0x53'),_0x20caf9);throw _0x20caf9;});}return _0x1768c7;})[_0x66ef('0x25')](respondWithResult(_0x426483,0xc9))[_0x66ef('0x45')](handleError(_0x426483,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 9b9ac9f..9b66b71 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 _0xaf5c=['../../config/logger','api','bluebird','path','../../config/environment','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','util'];(function(_0x1e491e,_0x2f7656){var _0x30521d=function(_0x36bac5){while(--_0x36bac5){_0x1e491e['push'](_0x1e491e['shift']());}};_0x30521d(++_0x2f7656);}(_0xaf5c,0x197));var _0xcaf5=function(_0x1152bc,_0x16c394){_0x1152bc=_0x1152bc-0x0;var _0x4c6b0d=_0xaf5c[_0x1152bc];return _0x4c6b0d;};'use strict';var _=require('lodash');var util=require(_0xcaf5('0x0'));var logger=require(_0xcaf5('0x1'))(_0xcaf5('0x2'));var moment=require('moment');var BPromise=require(_0xcaf5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcaf5('0x4'));var rimraf=require('rimraf');var config=require(_0xcaf5('0x5'));var attributes=require('./cannedAnswer.attributes');module[_0xcaf5('0x6')]=function(_0x46720c,_0x1d1f3e){return _0x46720c[_0xcaf5('0x7')](_0xcaf5('0x8'),attributes,{'tableName':_0xcaf5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcaf5('0xa'),'collate':_0xcaf5('0xb')});};
\ No newline at end of file
+var _0x242e=['path','./cannedAnswer.attributes','exports','define','utf8mb4','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x163090,_0x45e5b5){var _0x29c788=function(_0x5c8945){while(--_0x5c8945){_0x163090['push'](_0x163090['shift']());}};_0x29c788(++_0x45e5b5);}(_0x242e,0x1e5));var _0xe242=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x242e[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xe242('0x0'));var util=require('util');var logger=require(_0xe242('0x1'))(_0xe242('0x2'));var moment=require('moment');var BPromise=require(_0xe242('0x3'));var rp=require(_0xe242('0x4'));var fs=require('fs');var path=require(_0xe242('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe242('0x6'));module[_0xe242('0x7')]=function(_0x1e8f99,_0x99f5e9){return _0x1e8f99[_0xe242('0x8')]('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe242('0x9'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 14653d8..3b59ce0 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(_0x34e279,_0x5ebf34){var _0x1bb664=function(_0x5d7661){while(--_0x5d7661){_0x34e279['push'](_0x34e279['shift']());}};_0x1bb664(++_0x5ebf34);}(_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);});});}
\ 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(_0x25f9ee,_0x5ec35c){var _0x5b7e9e=function(_0x1525e8){while(--_0x1525e8){_0x25f9ee['push'](_0x25f9ee['shift']());}};_0x5b7e9e(++_0x5ec35c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'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 00ca8e3..1248901 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 _0x6fda=['show','create','/:id','destroy','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index'];(function(_0x1782d2,_0x40ab01){var _0x40dfe3=function(_0x4bd33d){while(--_0x4bd33d){_0x1782d2['push'](_0x1782d2['shift']());}};_0x40dfe3(++_0x40ab01);}(_0x6fda,0x1a9));var _0xa6fd=function(_0x2358e7,_0x3fed78){_0x2358e7=_0x2358e7-0x0;var _0x50ff36=_0x6fda[_0x2358e7];return _0x50ff36;};'use strict';var multer=require('multer');var util=require(_0xa6fd('0x0'));var path=require('path');var timeout=require(_0xa6fd('0x1'));var express=require(_0xa6fd('0x2'));var router=express['Router']();var fs_extra=require(_0xa6fd('0x3'));var auth=require(_0xa6fd('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa6fd('0x5'));var controller=require(_0xa6fd('0x6'));router[_0xa6fd('0x7')]('/',auth[_0xa6fd('0x8')](),controller[_0xa6fd('0x9')]);router[_0xa6fd('0x7')]('/:id',auth[_0xa6fd('0x8')](),controller[_0xa6fd('0xa')]);router['post']('/',auth[_0xa6fd('0x8')](),controller[_0xa6fd('0xb')]);router['put'](_0xa6fd('0xc'),auth[_0xa6fd('0x8')](),controller['update']);router['delete'](_0xa6fd('0xc'),auth[_0xa6fd('0x8')](),controller[_0xa6fd('0xd')]);module[_0xa6fd('0xe')]=router;
\ No newline at end of file
+var _0xed6f=['destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','/:id','post','create','update','delete'];(function(_0xb6afda,_0x55854e){var _0x8c25e3=function(_0x550be5){while(--_0x550be5){_0xb6afda['push'](_0xb6afda['shift']());}};_0x8c25e3(++_0x55854e);}(_0xed6f,0x1ab));var _0xfed6=function(_0x337438,_0x157dec){_0x337438=_0x337438-0x0;var _0xfcffc2=_0xed6f[_0x337438];return _0xfcffc2;};'use strict';var multer=require(_0xfed6('0x0'));var util=require(_0xfed6('0x1'));var path=require(_0xfed6('0x2'));var timeout=require('connect-timeout');var express=require(_0xfed6('0x3'));var router=express[_0xfed6('0x4')]();var fs_extra=require(_0xfed6('0x5'));var auth=require(_0xfed6('0x6'));var interaction=require(_0xfed6('0x7'));var config=require(_0xfed6('0x8'));var controller=require('./cannedAnswer.controller');router['get']('/',auth[_0xfed6('0x9')](),controller['index']);router['get'](_0xfed6('0xa'),auth[_0xfed6('0x9')](),controller['show']);router[_0xfed6('0xb')]('/',auth['isAuthenticated'](),controller[_0xfed6('0xc')]);router['put'](_0xfed6('0xa'),auth[_0xfed6('0x9')](),controller[_0xfed6('0xd')]);router[_0xfed6('0xe')](_0xfed6('0xa'),auth[_0xfed6('0x9')](),controller[_0xfed6('0xf')]);module[_0xfed6('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index fc97ced..be971c3 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 _0x2116=['1970-01-01\x2000:00:01','STRING','INTEGER','exports'];(function(_0x257f74,_0x5f8631){var _0x4addb4=function(_0x34834f){while(--_0x34834f){_0x257f74['push'](_0x257f74['shift']());}};_0x4addb4(++_0x5f8631);}(_0x2116,0x67));var _0x6211=function(_0x9979f9,_0x22dba0){_0x9979f9=_0x9979f9-0x0;var _0x53b7fe=_0x2116[_0x9979f9];return _0x53b7fe;};'use strict';var Sequelize=require('sequelize');module[_0x6211('0x0')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x6211('0x1')},'clid':{'type':Sequelize[_0x6211('0x2')]},'src':{'type':Sequelize[_0x6211('0x2')]},'dst':{'type':Sequelize[_0x6211('0x2')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x6211('0x2')]},'dstchannel':{'type':Sequelize[_0x6211('0x2')]},'lastapp':{'type':Sequelize[_0x6211('0x2')]},'lastdata':{'type':Sequelize[_0x6211('0x2')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x6211('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x6211('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x6211('0x2')]},'userfield':{'type':Sequelize[_0x6211('0x2')]},'uniqueid':{'type':Sequelize[_0x6211('0x2')]},'linkedid':{'type':Sequelize[_0x6211('0x2')]},'sequence':{'type':Sequelize[_0x6211('0x2')]},'peeraccount':{'type':Sequelize[_0x6211('0x2')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x6211('0x2')]}};
\ No newline at end of file
+var _0xbca8=['sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x45e6b6,_0x569cd1){var _0x3c7475=function(_0x139181){while(--_0x139181){_0x45e6b6['push'](_0x45e6b6['shift']());}};_0x3c7475(++_0x569cd1);}(_0xbca8,0xcc));var _0x8bca=function(_0x337527,_0x54e115){_0x337527=_0x337527-0x0;var _0x1638e3=_0xbca8[_0x337527];return _0x1638e3;};'use strict';var Sequelize=require(_0x8bca('0x0'));module[_0x8bca('0x1')]={'calldate':{'type':Sequelize[_0x8bca('0x2')],'allowNull':![],'defaultValue':_0x8bca('0x3')},'clid':{'type':Sequelize[_0x8bca('0x4')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x8bca('0x4')]},'dcontext':{'type':Sequelize[_0x8bca('0x4')]},'channel':{'type':Sequelize[_0x8bca('0x4')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x8bca('0x4')]},'duration':{'type':Sequelize[_0x8bca('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x8bca('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x8bca('0x4')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x8bca('0x4')]},'userfield':{'type':Sequelize[_0x8bca('0x4')]},'uniqueid':{'type':Sequelize[_0x8bca('0x4')]},'linkedid':{'type':Sequelize[_0x8bca('0x4')]},'sequence':{'type':Sequelize[_0x8bca('0x4')]},'peeraccount':{'type':Sequelize[_0x8bca('0x4')]},'type':{'type':Sequelize[_0x8bca('0x4')]},'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 68315a0..e3890a4 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 _0xdb94=['keys','find','create','body','destroy','params','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','stack','name','send','index','Cdr','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','sort','pick','where','VIRTUAL','filter','includeAll','include','findAll','rows','catch'];(function(_0x270fee,_0x2b8b15){var _0x184922=function(_0x5c7d31){while(--_0x5c7d31){_0x270fee['push'](_0x270fee['shift']());}};_0x184922(++_0x2b8b15);}(_0xdb94,0xe5));var _0x4db9=function(_0x1edec6,_0x19cc86){_0x1edec6=_0x1edec6-0x0;var _0x1a58bd=_0xdb94[_0x1edec6];return _0x1a58bd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4db9('0x0'));var zipdir=require(_0x4db9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4db9('0x2'));var moment=require(_0x4db9('0x3'));var BPromise=require(_0x4db9('0x4'));var Mustache=require(_0x4db9('0x5'));var util=require(_0x4db9('0x6'));var path=require('path');var sox=require(_0x4db9('0x7'));var csv=require('to-csv');var ejs=require(_0x4db9('0x8'));var fs=require('fs');var fs_extra=require(_0x4db9('0x9'));var _=require(_0x4db9('0xa'));var squel=require(_0x4db9('0xb'));var crypto=require(_0x4db9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4db9('0xd'));var toCsv=require(_0x4db9('0xe'));var querystring=require(_0x4db9('0xf'));var Papa=require(_0x4db9('0x10'));var Redis=require(_0x4db9('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4db9('0x12'));var as=require(_0x4db9('0x13'));var hardwareService=require(_0x4db9('0x14'));var logger=require(_0x4db9('0x15'))(_0x4db9('0x16'));var utils=require(_0x4db9('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4db9('0x18'));var db=require(_0x4db9('0x19'))['db'];function respondWithStatusCode(_0x59f01c,_0x549c92){_0x549c92=_0x549c92||0xcc;return function(_0x19f2d3){if(_0x19f2d3){return _0x59f01c[_0x4db9('0x1a')](_0x549c92);}return _0x59f01c[_0x4db9('0x1b')](_0x549c92)['end']();};}function respondWithResult(_0x1a93be,_0x3dde55){_0x3dde55=_0x3dde55||0xc8;return function(_0x2018d2){if(_0x2018d2){return _0x1a93be[_0x4db9('0x1b')](_0x3dde55)[_0x4db9('0x1c')](_0x2018d2);}};}function respondWithFilteredResult(_0x585230,_0x1b1062){return function(_0x1a5a9c){if(_0x1a5a9c){var _0x5d4d70=typeof _0x1b1062[_0x4db9('0x1d')]===_0x4db9('0x1e')&&typeof _0x1b1062[_0x4db9('0x1f')]==='undefined';var _0xedc513=_0x1a5a9c[_0x4db9('0x20')];var _0x4c5f4f=_0x5d4d70?0x0:_0x1b1062['offset'];var _0x493923=_0x5d4d70?_0x1a5a9c[_0x4db9('0x20')]:_0x1b1062[_0x4db9('0x1d')]+_0x1b1062['limit'];var _0x375515;if(_0x493923>=_0xedc513){_0x493923=_0xedc513;_0x375515=0xc8;}else{_0x375515=0xce;}_0x585230[_0x4db9('0x1b')](_0x375515);return _0x585230[_0x4db9('0x21')](_0x4db9('0x22'),_0x4c5f4f+'-'+_0x493923+'/'+_0xedc513)[_0x4db9('0x1c')](_0x1a5a9c);}return null;};}function patchUpdates(_0x28b7f6){return function(_0x34a6ed){try{jsonpatch[_0x4db9('0x23')](_0x34a6ed,_0x28b7f6,!![]);}catch(_0x3256f4){return BPromise[_0x4db9('0x24')](_0x3256f4);}return _0x34a6ed[_0x4db9('0x25')]();};}function saveUpdates(_0x102402,_0x4d56a1){return function(_0x42cc40){if(_0x42cc40){return _0x42cc40[_0x4db9('0x26')](_0x102402)['then'](function(_0x37c81f){return _0x37c81f;});}return null;};}function removeEntity(_0x3f4931,_0x4419af){return function(_0x402898){if(_0x402898){return _0x402898['destroy']()[_0x4db9('0x27')](function(){_0x3f4931['status'](0xcc)[_0x4db9('0x28')]();});}};}function handleEntityNotFound(_0x1c82b6,_0x135aa7){return function(_0x47e89c){if(!_0x47e89c){_0x1c82b6[_0x4db9('0x1a')](0x194);}return _0x47e89c;};}function handleError(_0x622db6,_0x47464d){_0x47464d=_0x47464d||0x1f4;return function(_0x5e7d29){logger['error'](_0x5e7d29[_0x4db9('0x29')]);if(_0x5e7d29['name']){delete _0x5e7d29[_0x4db9('0x2a')];}_0x622db6[_0x4db9('0x1b')](_0x47464d)[_0x4db9('0x2b')](_0x5e7d29);};}exports[_0x4db9('0x2c')]=function(_0x384df5,_0x3c3fcf){var _0x1d0dc2={},_0x373a7d={},_0x4c4a47={'count':0x0,'rows':[]};var _0x35f757=_['map'](db[_0x4db9('0x2d')][_0x4db9('0x2e')],function(_0x1e7840){return{'name':_0x1e7840[_0x4db9('0x2f')],'type':_0x1e7840[_0x4db9('0x30')]['key']};});_0x373a7d[_0x4db9('0x31')]=_[_0x4db9('0x32')](_0x35f757,_0x4db9('0x2a'));_0x373a7d[_0x4db9('0x33')]=_['keys'](_0x384df5['query']);_0x373a7d[_0x4db9('0x34')]=_[_0x4db9('0x35')](_0x373a7d['model'],_0x373a7d['query']);_0x1d0dc2[_0x4db9('0x36')]=_['intersection'](_0x373a7d['model'],qs[_0x4db9('0x37')](_0x384df5[_0x4db9('0x33')]['fields']));_0x1d0dc2[_0x4db9('0x36')]=_0x1d0dc2[_0x4db9('0x36')][_0x4db9('0x38')]?_0x1d0dc2[_0x4db9('0x36')]:_0x373a7d['model'];if(!_0x384df5[_0x4db9('0x33')]['hasOwnProperty']('nolimit')){_0x1d0dc2['limit']=qs[_0x4db9('0x1f')](_0x384df5[_0x4db9('0x33')]['limit']);_0x1d0dc2[_0x4db9('0x1d')]=qs[_0x4db9('0x1d')](_0x384df5['query']['offset']);}_0x1d0dc2['order']=qs[_0x4db9('0x39')](_0x384df5['query'][_0x4db9('0x39')]);_0x1d0dc2['where']=qs[_0x4db9('0x34')](_[_0x4db9('0x3a')](_0x384df5[_0x4db9('0x33')],_0x373a7d[_0x4db9('0x34')]),_0x35f757);if(_0x384df5[_0x4db9('0x33')]['filter']){_0x1d0dc2[_0x4db9('0x3b')]=_['merge'](_0x1d0dc2[_0x4db9('0x3b')],{'$or':_[_0x4db9('0x32')](_0x35f757,function(_0x15929e){if(_0x15929e[_0x4db9('0x30')]!==_0x4db9('0x3c')){var _0x4159d2={};_0x4159d2[_0x15929e['name']]={'$like':'%'+_0x384df5[_0x4db9('0x33')][_0x4db9('0x3d')]+'%'};return _0x4159d2;}})});}_0x1d0dc2=_['merge']({},_0x1d0dc2,_0x384df5['options']);var _0x404af3={'where':_0x1d0dc2[_0x4db9('0x3b')]};return db[_0x4db9('0x2d')][_0x4db9('0x20')](_0x404af3)[_0x4db9('0x27')](function(_0x36a648){_0x4c4a47[_0x4db9('0x20')]=_0x36a648;if(_0x384df5[_0x4db9('0x33')][_0x4db9('0x3e')]){_0x1d0dc2[_0x4db9('0x3f')]=[{'all':!![]}];}return db[_0x4db9('0x2d')][_0x4db9('0x40')](_0x1d0dc2);})['then'](function(_0x2716d6){_0x4c4a47[_0x4db9('0x41')]=_0x2716d6;return _0x4c4a47;})[_0x4db9('0x27')](respondWithFilteredResult(_0x3c3fcf,_0x1d0dc2))[_0x4db9('0x42')](handleError(_0x3c3fcf,null));};exports['show']=function(_0x57d32d,_0x248891){var _0x2b18a2={'raw':!![],'where':{'id':_0x57d32d['params']['id']}},_0x2fc233={};_0x2fc233[_0x4db9('0x31')]=_['keys'](db[_0x4db9('0x2d')][_0x4db9('0x2e')]);_0x2fc233[_0x4db9('0x33')]=_[_0x4db9('0x43')](_0x57d32d[_0x4db9('0x33')]);_0x2fc233['filters']=_[_0x4db9('0x35')](_0x2fc233[_0x4db9('0x31')],_0x2fc233[_0x4db9('0x33')]);_0x2b18a2[_0x4db9('0x36')]=_[_0x4db9('0x35')](_0x2fc233['model'],qs[_0x4db9('0x37')](_0x57d32d[_0x4db9('0x33')][_0x4db9('0x37')]));_0x2b18a2[_0x4db9('0x36')]=_0x2b18a2[_0x4db9('0x36')][_0x4db9('0x38')]?_0x2b18a2[_0x4db9('0x36')]:_0x2fc233[_0x4db9('0x31')];if(_0x57d32d[_0x4db9('0x33')]['includeAll']){_0x2b18a2[_0x4db9('0x3f')]=[{'all':!![]}];}_0x2b18a2=_['merge']({},_0x2b18a2,_0x57d32d['options']);return db[_0x4db9('0x2d')][_0x4db9('0x44')](_0x2b18a2)['then'](handleEntityNotFound(_0x248891,null))['then'](respondWithResult(_0x248891,null))[_0x4db9('0x42')](handleError(_0x248891,null));};exports[_0x4db9('0x45')]=function(_0x3fc788,_0x7f0aac){return db[_0x4db9('0x2d')][_0x4db9('0x45')](_0x3fc788[_0x4db9('0x46')],{})[_0x4db9('0x27')](respondWithResult(_0x7f0aac,0xc9))[_0x4db9('0x42')](handleError(_0x7f0aac,null));};exports[_0x4db9('0x26')]=function(_0x43312c,_0x5495de){if(_0x43312c[_0x4db9('0x46')]['id']){delete _0x43312c[_0x4db9('0x46')]['id'];}return db['Cdr'][_0x4db9('0x44')]({'where':{'id':_0x43312c['params']['id']}})[_0x4db9('0x27')](handleEntityNotFound(_0x5495de,null))[_0x4db9('0x27')](saveUpdates(_0x43312c[_0x4db9('0x46')],null))[_0x4db9('0x27')](respondWithResult(_0x5495de,null))[_0x4db9('0x42')](handleError(_0x5495de,null));};exports[_0x4db9('0x47')]=function(_0x3f1aac,_0x3b8d8c){return db[_0x4db9('0x2d')][_0x4db9('0x44')]({'where':{'id':_0x3f1aac[_0x4db9('0x48')]['id']}})[_0x4db9('0x27')](handleEntityNotFound(_0x3b8d8c,null))[_0x4db9('0x27')](removeEntity(_0x3b8d8c,null))['catch'](handleError(_0x3b8d8c,null));};exports['describe']=function(_0x5ececc,_0x161e2e){return db['Cdr'][_0x4db9('0x49')]()['then'](respondWithResult(_0x161e2e,null))[_0x4db9('0x42')](handleError(_0x161e2e,null));};
\ No newline at end of file
+var _0xcb81=['save','then','destroy','error','stack','name','send','index','Cdr','rawAttributes','type','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','create','body','update','params','describe','eml-format','rimraf','fast-json-patch','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject'];(function(_0x5306ff,_0x2e80d7){var _0x536f01=function(_0x3185b5){while(--_0x3185b5){_0x5306ff['push'](_0x5306ff['shift']());}};_0x536f01(++_0x2e80d7);}(_0xcb81,0x154));var _0x1cb8=function(_0x2df507,_0x553862){_0x2df507=_0x2df507-0x0;var _0x1f7167=_0xcb81[_0x2df507];return _0x1f7167;};'use strict';var emlformat=require(_0x1cb8('0x0'));var rimraf=require(_0x1cb8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1cb8('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1cb8('0x3'));var util=require(_0x1cb8('0x4'));var path=require(_0x1cb8('0x5'));var sox=require(_0x1cb8('0x6'));var csv=require(_0x1cb8('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1cb8('0x8'));var _=require(_0x1cb8('0x9'));var squel=require('squel');var crypto=require(_0x1cb8('0xa'));var jsforce=require(_0x1cb8('0xb'));var deskjs=require(_0x1cb8('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1cb8('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1cb8('0xe'));var qs=require(_0x1cb8('0xf'));var as=require(_0x1cb8('0x10'));var hardwareService=require(_0x1cb8('0x11'));var logger=require(_0x1cb8('0x12'))(_0x1cb8('0x13'));var utils=require(_0x1cb8('0x14'));var config=require(_0x1cb8('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x1cb8('0x16'))['db'];function respondWithStatusCode(_0x1ffe94,_0x1938ee){_0x1938ee=_0x1938ee||0xcc;return function(_0x299eea){if(_0x299eea){return _0x1ffe94[_0x1cb8('0x17')](_0x1938ee);}return _0x1ffe94['status'](_0x1938ee)[_0x1cb8('0x18')]();};}function respondWithResult(_0x2c600,_0xcb6ad1){_0xcb6ad1=_0xcb6ad1||0xc8;return function(_0x14d84d){if(_0x14d84d){return _0x2c600[_0x1cb8('0x19')](_0xcb6ad1)[_0x1cb8('0x1a')](_0x14d84d);}};}function respondWithFilteredResult(_0x339ad0,_0x243930){return function(_0x5af4a3){if(_0x5af4a3){var _0x17a95d=typeof _0x243930['offset']===_0x1cb8('0x1b')&&typeof _0x243930[_0x1cb8('0x1c')]===_0x1cb8('0x1b');var _0x46abd0=_0x5af4a3[_0x1cb8('0x1d')];var _0x308088=_0x17a95d?0x0:_0x243930[_0x1cb8('0x1e')];var _0x9f0adb=_0x17a95d?_0x5af4a3[_0x1cb8('0x1d')]:_0x243930[_0x1cb8('0x1e')]+_0x243930[_0x1cb8('0x1c')];var _0x3cda27;if(_0x9f0adb>=_0x46abd0){_0x9f0adb=_0x46abd0;_0x3cda27=0xc8;}else{_0x3cda27=0xce;}_0x339ad0['status'](_0x3cda27);return _0x339ad0[_0x1cb8('0x1f')](_0x1cb8('0x20'),_0x308088+'-'+_0x9f0adb+'/'+_0x46abd0)[_0x1cb8('0x1a')](_0x5af4a3);}return null;};}function patchUpdates(_0x3d1682){return function(_0x4abf3a){try{jsonpatch[_0x1cb8('0x21')](_0x4abf3a,_0x3d1682,!![]);}catch(_0x4f9220){return BPromise[_0x1cb8('0x22')](_0x4f9220);}return _0x4abf3a[_0x1cb8('0x23')]();};}function saveUpdates(_0x40b914,_0x38ff3a){return function(_0x559916){if(_0x559916){return _0x559916['update'](_0x40b914)[_0x1cb8('0x24')](function(_0x4040be){return _0x4040be;});}return null;};}function removeEntity(_0x22dafe,_0x44a00d){return function(_0x2473b8){if(_0x2473b8){return _0x2473b8[_0x1cb8('0x25')]()[_0x1cb8('0x24')](function(){_0x22dafe['status'](0xcc)[_0x1cb8('0x18')]();});}};}function handleEntityNotFound(_0x4554d5,_0x35c890){return function(_0xeeb21d){if(!_0xeeb21d){_0x4554d5[_0x1cb8('0x17')](0x194);}return _0xeeb21d;};}function handleError(_0x41ab56,_0x4ca3be){_0x4ca3be=_0x4ca3be||0x1f4;return function(_0x1ec995){logger[_0x1cb8('0x26')](_0x1ec995[_0x1cb8('0x27')]);if(_0x1ec995[_0x1cb8('0x28')]){delete _0x1ec995[_0x1cb8('0x28')];}_0x41ab56['status'](_0x4ca3be)[_0x1cb8('0x29')](_0x1ec995);};}exports[_0x1cb8('0x2a')]=function(_0x3a8b53,_0x21c17a){var _0x4fda96={},_0x2a79e0={},_0x2ba8c8={'count':0x0,'rows':[]};var _0x3a6a67=_['map'](db[_0x1cb8('0x2b')][_0x1cb8('0x2c')],function(_0x17abe1){return{'name':_0x17abe1['fieldName'],'type':_0x17abe1[_0x1cb8('0x2d')][_0x1cb8('0x2e')]};});_0x2a79e0[_0x1cb8('0x2f')]=_[_0x1cb8('0x30')](_0x3a6a67,_0x1cb8('0x28'));_0x2a79e0['query']=_[_0x1cb8('0x31')](_0x3a8b53[_0x1cb8('0x32')]);_0x2a79e0[_0x1cb8('0x33')]=_[_0x1cb8('0x34')](_0x2a79e0[_0x1cb8('0x2f')],_0x2a79e0[_0x1cb8('0x32')]);_0x4fda96[_0x1cb8('0x35')]=_[_0x1cb8('0x34')](_0x2a79e0[_0x1cb8('0x2f')],qs['fields'](_0x3a8b53['query'][_0x1cb8('0x36')]));_0x4fda96[_0x1cb8('0x35')]=_0x4fda96[_0x1cb8('0x35')]['length']?_0x4fda96['attributes']:_0x2a79e0[_0x1cb8('0x2f')];if(!_0x3a8b53[_0x1cb8('0x32')][_0x1cb8('0x37')](_0x1cb8('0x38'))){_0x4fda96[_0x1cb8('0x1c')]=qs[_0x1cb8('0x1c')](_0x3a8b53[_0x1cb8('0x32')][_0x1cb8('0x1c')]);_0x4fda96['offset']=qs[_0x1cb8('0x1e')](_0x3a8b53[_0x1cb8('0x32')][_0x1cb8('0x1e')]);}_0x4fda96[_0x1cb8('0x39')]=qs[_0x1cb8('0x3a')](_0x3a8b53[_0x1cb8('0x32')][_0x1cb8('0x3a')]);_0x4fda96[_0x1cb8('0x3b')]=qs[_0x1cb8('0x33')](_['pick'](_0x3a8b53[_0x1cb8('0x32')],_0x2a79e0[_0x1cb8('0x33')]),_0x3a6a67);if(_0x3a8b53['query'][_0x1cb8('0x3c')]){_0x4fda96[_0x1cb8('0x3b')]=_[_0x1cb8('0x3d')](_0x4fda96[_0x1cb8('0x3b')],{'$or':_[_0x1cb8('0x30')](_0x3a6a67,function(_0x5dc4c0){if(_0x5dc4c0[_0x1cb8('0x2d')]!==_0x1cb8('0x3e')){var _0x2989c6={};_0x2989c6[_0x5dc4c0['name']]={'$like':'%'+_0x3a8b53['query']['filter']+'%'};return _0x2989c6;}})});}_0x4fda96=_[_0x1cb8('0x3d')]({},_0x4fda96,_0x3a8b53[_0x1cb8('0x3f')]);var _0x328f7e={'where':_0x4fda96[_0x1cb8('0x3b')]};return db['Cdr']['count'](_0x328f7e)[_0x1cb8('0x24')](function(_0x25f0a3){_0x2ba8c8[_0x1cb8('0x1d')]=_0x25f0a3;if(_0x3a8b53[_0x1cb8('0x32')][_0x1cb8('0x40')]){_0x4fda96[_0x1cb8('0x41')]=[{'all':!![]}];}return db[_0x1cb8('0x2b')][_0x1cb8('0x42')](_0x4fda96);})['then'](function(_0x2044d1){_0x2ba8c8[_0x1cb8('0x43')]=_0x2044d1;return _0x2ba8c8;})[_0x1cb8('0x24')](respondWithFilteredResult(_0x21c17a,_0x4fda96))[_0x1cb8('0x44')](handleError(_0x21c17a,null));};exports['show']=function(_0x156298,_0x47c18a){var _0x2060a6={'raw':!![],'where':{'id':_0x156298['params']['id']}},_0x37230e={};_0x37230e[_0x1cb8('0x2f')]=_[_0x1cb8('0x31')](db[_0x1cb8('0x2b')]['rawAttributes']);_0x37230e['query']=_[_0x1cb8('0x31')](_0x156298['query']);_0x37230e[_0x1cb8('0x33')]=_[_0x1cb8('0x34')](_0x37230e[_0x1cb8('0x2f')],_0x37230e[_0x1cb8('0x32')]);_0x2060a6[_0x1cb8('0x35')]=_[_0x1cb8('0x34')](_0x37230e[_0x1cb8('0x2f')],qs['fields'](_0x156298[_0x1cb8('0x32')][_0x1cb8('0x36')]));_0x2060a6[_0x1cb8('0x35')]=_0x2060a6[_0x1cb8('0x35')]['length']?_0x2060a6[_0x1cb8('0x35')]:_0x37230e[_0x1cb8('0x2f')];if(_0x156298[_0x1cb8('0x32')][_0x1cb8('0x40')]){_0x2060a6[_0x1cb8('0x41')]=[{'all':!![]}];}_0x2060a6=_['merge']({},_0x2060a6,_0x156298[_0x1cb8('0x3f')]);return db[_0x1cb8('0x2b')][_0x1cb8('0x45')](_0x2060a6)[_0x1cb8('0x24')](handleEntityNotFound(_0x47c18a,null))[_0x1cb8('0x24')](respondWithResult(_0x47c18a,null))['catch'](handleError(_0x47c18a,null));};exports[_0x1cb8('0x46')]=function(_0x3a4ec4,_0x5598b1){return db[_0x1cb8('0x2b')][_0x1cb8('0x46')](_0x3a4ec4[_0x1cb8('0x47')],{})[_0x1cb8('0x24')](respondWithResult(_0x5598b1,0xc9))[_0x1cb8('0x44')](handleError(_0x5598b1,null));};exports[_0x1cb8('0x48')]=function(_0x3b063c,_0x219541){if(_0x3b063c[_0x1cb8('0x47')]['id']){delete _0x3b063c[_0x1cb8('0x47')]['id'];}return db[_0x1cb8('0x2b')][_0x1cb8('0x45')]({'where':{'id':_0x3b063c[_0x1cb8('0x49')]['id']}})[_0x1cb8('0x24')](handleEntityNotFound(_0x219541,null))['then'](saveUpdates(_0x3b063c[_0x1cb8('0x47')],null))[_0x1cb8('0x24')](respondWithResult(_0x219541,null))[_0x1cb8('0x44')](handleError(_0x219541,null));};exports[_0x1cb8('0x25')]=function(_0x21aba7,_0x15f0ba){return db[_0x1cb8('0x2b')]['find']({'where':{'id':_0x21aba7[_0x1cb8('0x49')]['id']}})[_0x1cb8('0x24')](handleEntityNotFound(_0x15f0ba,null))[_0x1cb8('0x24')](removeEntity(_0x15f0ba,null))['catch'](handleError(_0x15f0ba,null));};exports['describe']=function(_0x1c12aa,_0x42cc81){return db[_0x1cb8('0x2b')][_0x1cb8('0x4a')]()[_0x1cb8('0x24')](respondWithResult(_0x42cc81,null))['catch'](handleError(_0x42cc81,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index afcfb8a..1c66bd4 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(_0x470a45,_0x15ea90){var _0x5dd896=function(_0x28ac6f){while(--_0x28ac6f){_0x470a45['push'](_0x470a45['shift']());}};_0x5dd896(++_0x15ea90);}(_0x7a54,0x106));var _0x47a5=function(_0x42e747,_0x1d16ba){_0x42e747=_0x42e747-0x0;var _0x4dba01=_0x7a54[_0x42e747];return _0x4dba01;};'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(_0xbd01e6,_0x334323){var _0x5bb6cf=function(_0x3cb53a){while(--_0x3cb53a){_0xbd01e6['push'](_0xbd01e6['shift']());}};_0x5bb6cf(++_0x334323);}(_0x7a54,0x106));var _0x47a5=function(_0x1109db,_0x4949f3){_0x1109db=_0x1109db-0x0;var _0x41c5d1=_0x7a54[_0x1109db];return _0x41c5d1;};'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 89b9d80..df9cb38 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 _0xcb01=['client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0xcac2c2,_0x8a1161){var _0x5b801b=function(_0x1be5a8){while(--_0x1be5a8){_0xcac2c2['push'](_0xcac2c2['shift']());}};_0x5b801b(++_0x8a1161);}(_0xcb01,0x10a));var _0x1cb0=function(_0x54b3b6,_0x3549ac){_0x54b3b6=_0x54b3b6-0x0;var _0xb12829=_0xcb01[_0x54b3b6];return _0xb12829;};'use strict';var _=require('lodash');var util=require(_0x1cb0('0x0'));var moment=require(_0x1cb0('0x1'));var BPromise=require(_0x1cb0('0x2'));var rs=require(_0x1cb0('0x3'));var fs=require('fs');var Redis=require(_0x1cb0('0x4'));var db=require(_0x1cb0('0x5'))['db'];var utils=require(_0x1cb0('0x6'));var logger=require(_0x1cb0('0x7'))(_0x1cb0('0x8'));var config=require('../../config/environment');var jayson=require(_0x1cb0('0x9'));var client=jayson[_0x1cb0('0xa')][_0x1cb0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x280a1b,_0x52a2b3,_0x11b608){return new BPromise(function(_0x1b0fa8,_0x1165cc){return client[_0x1cb0('0xc')](_0x280a1b,_0x11b608)[_0x1cb0('0xd')](function(_0x2064f){logger[_0x1cb0('0xe')](_0x1cb0('0xf'),_0x52a2b3,_0x1cb0('0x10'));logger[_0x1cb0('0x11')](_0x1cb0('0x12'),_0x52a2b3,_0x1cb0('0x10'),JSON['stringify'](_0x2064f));if(_0x2064f[_0x1cb0('0x13')]){if(_0x2064f[_0x1cb0('0x13')][_0x1cb0('0x14')]===0x1f4){logger[_0x1cb0('0x13')](_0x1cb0('0xf'),_0x52a2b3,_0x2064f['error']['message']);return _0x1165cc(_0x2064f[_0x1cb0('0x13')][_0x1cb0('0x15')]);}logger[_0x1cb0('0x13')](_0x1cb0('0xf'),_0x52a2b3,_0x2064f['error'][_0x1cb0('0x15')]);return _0x1b0fa8(_0x2064f[_0x1cb0('0x13')]['message']);}else{logger['info']('Cdr,\x20%s,\x20%s',_0x52a2b3,_0x1cb0('0x10'));_0x1b0fa8(_0x2064f[_0x1cb0('0x16')][_0x1cb0('0x15')]);}})['catch'](function(_0x2aa741){logger['error']('Cdr,\x20%s,\x20%s',_0x52a2b3,_0x2aa741);_0x1165cc(_0x2aa741);});});}
\ No newline at end of file
+var _0x0c29=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x0c29,0x86));var _0x90c2=function(_0x421cf8,_0x23152c){_0x421cf8=_0x421cf8-0x0;var _0x145c48=_0x0c29[_0x421cf8];return _0x145c48;};'use strict';var _=require(_0x90c2('0x0'));var util=require(_0x90c2('0x1'));var moment=require(_0x90c2('0x2'));var BPromise=require(_0x90c2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x90c2('0x4'))['db'];var utils=require(_0x90c2('0x5'));var logger=require(_0x90c2('0x6'))(_0x90c2('0x7'));var config=require(_0x90c2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x90c2('0x9')][_0x90c2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3bcdd1,_0x4cd1c3,_0x3af68b){return new BPromise(function(_0x3ab97b,_0x4ac0f4){return client[_0x90c2('0xb')](_0x3bcdd1,_0x3af68b)[_0x90c2('0xc')](function(_0xc74db0){logger[_0x90c2('0xd')](_0x90c2('0xe'),_0x4cd1c3,_0x90c2('0xf'));logger[_0x90c2('0x10')](_0x90c2('0x11'),_0x4cd1c3,_0x90c2('0xf'),JSON[_0x90c2('0x12')](_0xc74db0));if(_0xc74db0['error']){if(_0xc74db0[_0x90c2('0x13')][_0x90c2('0x14')]===0x1f4){logger[_0x90c2('0x13')](_0x90c2('0xe'),_0x4cd1c3,_0xc74db0['error'][_0x90c2('0x15')]);return _0x4ac0f4(_0xc74db0[_0x90c2('0x13')]['message']);}logger[_0x90c2('0x13')](_0x90c2('0xe'),_0x4cd1c3,_0xc74db0[_0x90c2('0x13')][_0x90c2('0x15')]);return _0x3ab97b(_0xc74db0[_0x90c2('0x13')][_0x90c2('0x15')]);}else{logger[_0x90c2('0xd')](_0x90c2('0xe'),_0x4cd1c3,_0x90c2('0xf'));_0x3ab97b(_0xc74db0[_0x90c2('0x16')][_0x90c2('0x15')]);}})['catch'](function(_0x18e684){logger[_0x90c2('0x13')](_0x90c2('0xe'),_0x4cd1c3,_0x18e684);_0x4ac0f4(_0x18e684);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 23958d7..53e8b8b 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(_0x562ec2,_0x33932b){var _0xd3a205=function(_0x21aac4){while(--_0x21aac4){_0x562ec2['push'](_0x562ec2['shift']());}};_0xd3a205(++_0x33932b);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'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(_0x14bf66,_0x3e1066){var _0xaf4bf7=function(_0x3d9c3f){while(--_0x3d9c3f){_0x14bf66['push'](_0x14bf66['shift']());}};_0xaf4bf7(++_0x3e1066);}(_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 6f1b47f..3cc939d 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 _0x53a9=['STRING','noop','TEXT','*,*,*,*','exports','INTEGER'];(function(_0x1ed4cb,_0x1b010a){var _0x8e4fe8=function(_0x4229c4){while(--_0x4229c4){_0x1ed4cb['push'](_0x1ed4cb['shift']());}};_0x8e4fe8(++_0x1b010a);}(_0x53a9,0x154));var _0x953a=function(_0x44974f,_0xe2fa83){_0x44974f=_0x44974f-0x0;var _0x1b74ff=_0x53a9[_0x44974f];return _0x1b74ff;};'use strict';var Sequelize=require('sequelize');module[_0x953a('0x0')]={'priority':{'type':Sequelize[_0x953a('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x953a('0x2')],'allowNull':![],'defaultValue':_0x953a('0x3')},'appdata':{'type':Sequelize[_0x953a('0x4')]()},'description':{'type':Sequelize[_0x953a('0x2')]},'interval':{'type':Sequelize[_0x953a('0x2')],'defaultValue':_0x953a('0x5')}};
\ No newline at end of file
+var _0x6b53=['*,*,*,*','exports','INTEGER','STRING','noop','TEXT'];(function(_0x306f7d,_0x142389){var _0x5a91b5=function(_0x340a91){while(--_0x340a91){_0x306f7d['push'](_0x306f7d['shift']());}};_0x5a91b5(++_0x142389);}(_0x6b53,0x79));var _0x36b5=function(_0x1a664e,_0x3e34d3){_0x1a664e=_0x1a664e-0x0;var _0xe91c3a=_0x6b53[_0x1a664e];return _0xe91c3a;};'use strict';var Sequelize=require('sequelize');module[_0x36b5('0x0')]={'priority':{'type':Sequelize[_0x36b5('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x36b5('0x2')],'allowNull':![],'defaultValue':_0x36b5('0x3')},'appdata':{'type':Sequelize[_0x36b5('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x36b5('0x5')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index c2d663f..eb6160e 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 _0xbd20=['path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','show','model','ChatApplication','rawAttributes','keys','intersection','query','fields','attributes','length','includeAll','merge','find','catch','body','params','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x353afc,_0x2ca65d){var _0x42c461=function(_0x461e3a){while(--_0x461e3a){_0x353afc['push'](_0x353afc['shift']());}};_0x42c461(++_0x2ca65d);}(_0xbd20,0x14a));var _0x0bd2=function(_0x38b0a1,_0x29da11){_0x38b0a1=_0x38b0a1-0x0;var _0x27d217=_0xbd20[_0x38b0a1];return _0x27d217;};'use strict';var emlformat=require(_0x0bd2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0bd2('0x1'));var rp=require(_0x0bd2('0x2'));var moment=require(_0x0bd2('0x3'));var BPromise=require(_0x0bd2('0x4'));var Mustache=require(_0x0bd2('0x5'));var util=require('util');var path=require(_0x0bd2('0x6'));var sox=require(_0x0bd2('0x7'));var csv=require(_0x0bd2('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0bd2('0x9'));var _=require(_0x0bd2('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0bd2('0xb'));var deskjs=require(_0x0bd2('0xc'));var toCsv=require(_0x0bd2('0x8'));var querystring=require(_0x0bd2('0xd'));var Papa=require(_0x0bd2('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0bd2('0xf'));var as=require(_0x0bd2('0x10'));var hardwareService=require(_0x0bd2('0x11'));var logger=require(_0x0bd2('0x12'))(_0x0bd2('0x13'));var utils=require('../../config/utils');var config=require(_0x0bd2('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x0bd2('0x15'))['db'];function respondWithStatusCode(_0x20571b,_0x4c6b99){_0x4c6b99=_0x4c6b99||0xcc;return function(_0x5f0205){if(_0x5f0205){return _0x20571b[_0x0bd2('0x16')](_0x4c6b99);}return _0x20571b[_0x0bd2('0x17')](_0x4c6b99)[_0x0bd2('0x18')]();};}function respondWithResult(_0x2cf837,_0x2abcc8){_0x2abcc8=_0x2abcc8||0xc8;return function(_0x561b0f){if(_0x561b0f){return _0x2cf837['status'](_0x2abcc8)[_0x0bd2('0x19')](_0x561b0f);}};}function respondWithFilteredResult(_0x36d899,_0x5255ec){return function(_0x283f31){if(_0x283f31){var _0xd988bb=typeof _0x5255ec[_0x0bd2('0x1a')]===_0x0bd2('0x1b')&&typeof _0x5255ec[_0x0bd2('0x1c')]===_0x0bd2('0x1b');var _0x36001b=_0x283f31['count'];var _0x56902d=_0xd988bb?0x0:_0x5255ec[_0x0bd2('0x1a')];var _0x5d6cef=_0xd988bb?_0x283f31[_0x0bd2('0x1d')]:_0x5255ec['offset']+_0x5255ec[_0x0bd2('0x1c')];var _0x48e632;if(_0x5d6cef>=_0x36001b){_0x5d6cef=_0x36001b;_0x48e632=0xc8;}else{_0x48e632=0xce;}_0x36d899[_0x0bd2('0x17')](_0x48e632);return _0x36d899['set'](_0x0bd2('0x1e'),_0x56902d+'-'+_0x5d6cef+'/'+_0x36001b)[_0x0bd2('0x19')](_0x283f31);}return null;};}function patchUpdates(_0x3b3c87){return function(_0x4b1a3e){try{jsonpatch[_0x0bd2('0x1f')](_0x4b1a3e,_0x3b3c87,!![]);}catch(_0x21bb2c){return BPromise[_0x0bd2('0x20')](_0x21bb2c);}return _0x4b1a3e[_0x0bd2('0x21')]();};}function saveUpdates(_0xff78ae,_0x5cdac7){return function(_0x36b3c4){if(_0x36b3c4){return _0x36b3c4[_0x0bd2('0x22')](_0xff78ae)[_0x0bd2('0x23')](function(_0x6d2f5e){return _0x6d2f5e;});}return null;};}function removeEntity(_0x277ae9,_0x343a99){return function(_0xe47fb){if(_0xe47fb){return _0xe47fb[_0x0bd2('0x24')]()[_0x0bd2('0x23')](function(){_0x277ae9[_0x0bd2('0x17')](0xcc)[_0x0bd2('0x18')]();});}};}function handleEntityNotFound(_0x2028af,_0x3760a4){return function(_0x3a3eff){if(!_0x3a3eff){_0x2028af[_0x0bd2('0x16')](0x194);}return _0x3a3eff;};}function handleError(_0x1627e4,_0x3d63f2){_0x3d63f2=_0x3d63f2||0x1f4;return function(_0x5f0514){logger['error'](_0x5f0514[_0x0bd2('0x25')]);if(_0x5f0514[_0x0bd2('0x26')]){delete _0x5f0514[_0x0bd2('0x26')];}_0x1627e4[_0x0bd2('0x17')](_0x3d63f2)[_0x0bd2('0x27')](_0x5f0514);};}exports[_0x0bd2('0x28')]=function(_0x4d7ba1,_0x459bd6){var _0x507a1e={'raw':!![],'where':{'id':_0x4d7ba1['params']['id']}},_0x37e5a4={};_0x37e5a4[_0x0bd2('0x29')]=_['keys'](db[_0x0bd2('0x2a')][_0x0bd2('0x2b')]);_0x37e5a4['query']=_[_0x0bd2('0x2c')](_0x4d7ba1['query']);_0x37e5a4['filters']=_[_0x0bd2('0x2d')](_0x37e5a4[_0x0bd2('0x29')],_0x37e5a4[_0x0bd2('0x2e')]);_0x507a1e['attributes']=_[_0x0bd2('0x2d')](_0x37e5a4[_0x0bd2('0x29')],qs['fields'](_0x4d7ba1[_0x0bd2('0x2e')][_0x0bd2('0x2f')]));_0x507a1e[_0x0bd2('0x30')]=_0x507a1e['attributes'][_0x0bd2('0x31')]?_0x507a1e[_0x0bd2('0x30')]:_0x37e5a4[_0x0bd2('0x29')];if(_0x4d7ba1[_0x0bd2('0x2e')][_0x0bd2('0x32')]){_0x507a1e['include']=[{'all':!![]}];}_0x507a1e=_[_0x0bd2('0x33')]({},_0x507a1e,_0x4d7ba1['options']);return db[_0x0bd2('0x2a')][_0x0bd2('0x34')](_0x507a1e)[_0x0bd2('0x23')](handleEntityNotFound(_0x459bd6,null))[_0x0bd2('0x23')](respondWithResult(_0x459bd6,null))[_0x0bd2('0x35')](handleError(_0x459bd6,null));};exports[_0x0bd2('0x22')]=function(_0x55bf9d,_0x3e0e0e){if(_0x55bf9d[_0x0bd2('0x36')]['id']){delete _0x55bf9d[_0x0bd2('0x36')]['id'];}return db['ChatApplication']['find']({'where':{'id':_0x55bf9d[_0x0bd2('0x37')]['id']}})[_0x0bd2('0x23')](handleEntityNotFound(_0x3e0e0e,null))[_0x0bd2('0x23')](saveUpdates(_0x55bf9d[_0x0bd2('0x36')],null))['then'](respondWithResult(_0x3e0e0e,null))['catch'](handleError(_0x3e0e0e,null));};exports[_0x0bd2('0x24')]=function(_0x1c8d83,_0x499d9e){return db[_0x0bd2('0x2a')][_0x0bd2('0x34')]({'where':{'id':_0x1c8d83[_0x0bd2('0x37')]['id']}})[_0x0bd2('0x23')](handleEntityNotFound(_0x499d9e,null))[_0x0bd2('0x23')](removeEntity(_0x499d9e,null))[_0x0bd2('0x35')](handleError(_0x499d9e,null));};
\ No newline at end of file
+var _0xc423=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','undefined','offset','count','limit','set','apply','reject','update','then','destroy','end','sendStatus','error','stack','name','send','show','params','model','keys','query','filters','attributes','intersection','fields','includeAll','include','ChatApplication','find','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox'];(function(_0x36907d,_0x49af29){var _0x54de39=function(_0x2f5c99){while(--_0x2f5c99){_0x36907d['push'](_0x36907d['shift']());}};_0x54de39(++_0x49af29);}(_0xc423,0x159));var _0x3c42=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xc423[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require(_0x3c42('0x0'));var rimraf=require(_0x3c42('0x1'));var zipdir=require(_0x3c42('0x2'));var jsonpatch=require(_0x3c42('0x3'));var rp=require(_0x3c42('0x4'));var moment=require('moment');var BPromise=require(_0x3c42('0x5'));var Mustache=require(_0x3c42('0x6'));var util=require(_0x3c42('0x7'));var path=require('path');var sox=require(_0x3c42('0x8'));var csv=require(_0x3c42('0x9'));var ejs=require(_0x3c42('0xa'));var fs=require('fs');var fs_extra=require(_0x3c42('0xb'));var _=require(_0x3c42('0xc'));var squel=require(_0x3c42('0xd'));var crypto=require(_0x3c42('0xe'));var jsforce=require(_0x3c42('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x3c42('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3c42('0x10'));var authService=require(_0x3c42('0x11'));var qs=require(_0x3c42('0x12'));var as=require(_0x3c42('0x13'));var hardwareService=require(_0x3c42('0x14'));var logger=require(_0x3c42('0x15'))(_0x3c42('0x16'));var utils=require(_0x3c42('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x3c42('0x18'));var db=require(_0x3c42('0x19'))['db'];function respondWithStatusCode(_0xa2570b,_0x18d617){_0x18d617=_0x18d617||0xcc;return function(_0x1f802b){if(_0x1f802b){return _0xa2570b['sendStatus'](_0x18d617);}return _0xa2570b[_0x3c42('0x1a')](_0x18d617)['end']();};}function respondWithResult(_0x385f99,_0x25d565){_0x25d565=_0x25d565||0xc8;return function(_0x475d11){if(_0x475d11){return _0x385f99['status'](_0x25d565)[_0x3c42('0x1b')](_0x475d11);}};}function respondWithFilteredResult(_0x2500ee,_0x57857b){return function(_0x5880b7){if(_0x5880b7){var _0x34ef38=typeof _0x57857b['offset']===_0x3c42('0x1c')&&typeof _0x57857b['limit']===_0x3c42('0x1c');var _0x469af7=_0x5880b7['count'];var _0x88b878=_0x34ef38?0x0:_0x57857b[_0x3c42('0x1d')];var _0xf59593=_0x34ef38?_0x5880b7[_0x3c42('0x1e')]:_0x57857b[_0x3c42('0x1d')]+_0x57857b[_0x3c42('0x1f')];var _0x194f2e;if(_0xf59593>=_0x469af7){_0xf59593=_0x469af7;_0x194f2e=0xc8;}else{_0x194f2e=0xce;}_0x2500ee[_0x3c42('0x1a')](_0x194f2e);return _0x2500ee[_0x3c42('0x20')]('Content-Range',_0x88b878+'-'+_0xf59593+'/'+_0x469af7)[_0x3c42('0x1b')](_0x5880b7);}return null;};}function patchUpdates(_0x34c476){return function(_0x2375cf){try{jsonpatch[_0x3c42('0x21')](_0x2375cf,_0x34c476,!![]);}catch(_0x4953e3){return BPromise[_0x3c42('0x22')](_0x4953e3);}return _0x2375cf['save']();};}function saveUpdates(_0x4a1a5d,_0x204fee){return function(_0xb91b37){if(_0xb91b37){return _0xb91b37[_0x3c42('0x23')](_0x4a1a5d)[_0x3c42('0x24')](function(_0x2b7fdd){return _0x2b7fdd;});}return null;};}function removeEntity(_0x272bb2,_0x3b17d7){return function(_0x1902d8){if(_0x1902d8){return _0x1902d8[_0x3c42('0x25')]()[_0x3c42('0x24')](function(){_0x272bb2[_0x3c42('0x1a')](0xcc)[_0x3c42('0x26')]();});}};}function handleEntityNotFound(_0x2d1f81,_0x5cca72){return function(_0x1a5cdf){if(!_0x1a5cdf){_0x2d1f81[_0x3c42('0x27')](0x194);}return _0x1a5cdf;};}function handleError(_0x19b4d0,_0x5482d4){_0x5482d4=_0x5482d4||0x1f4;return function(_0x46d96c){logger[_0x3c42('0x28')](_0x46d96c[_0x3c42('0x29')]);if(_0x46d96c[_0x3c42('0x2a')]){delete _0x46d96c['name'];}_0x19b4d0[_0x3c42('0x1a')](_0x5482d4)[_0x3c42('0x2b')](_0x46d96c);};}exports[_0x3c42('0x2c')]=function(_0x3d96a1,_0x21fc9b){var _0xf53177={'raw':!![],'where':{'id':_0x3d96a1[_0x3c42('0x2d')]['id']}},_0x54ff0d={};_0x54ff0d[_0x3c42('0x2e')]=_[_0x3c42('0x2f')](db['ChatApplication']['rawAttributes']);_0x54ff0d[_0x3c42('0x30')]=_[_0x3c42('0x2f')](_0x3d96a1[_0x3c42('0x30')]);_0x54ff0d[_0x3c42('0x31')]=_['intersection'](_0x54ff0d[_0x3c42('0x2e')],_0x54ff0d['query']);_0xf53177[_0x3c42('0x32')]=_[_0x3c42('0x33')](_0x54ff0d[_0x3c42('0x2e')],qs[_0x3c42('0x34')](_0x3d96a1[_0x3c42('0x30')][_0x3c42('0x34')]));_0xf53177[_0x3c42('0x32')]=_0xf53177[_0x3c42('0x32')]['length']?_0xf53177[_0x3c42('0x32')]:_0x54ff0d[_0x3c42('0x2e')];if(_0x3d96a1[_0x3c42('0x30')][_0x3c42('0x35')]){_0xf53177[_0x3c42('0x36')]=[{'all':!![]}];}_0xf53177=_['merge']({},_0xf53177,_0x3d96a1['options']);return db[_0x3c42('0x37')][_0x3c42('0x38')](_0xf53177)[_0x3c42('0x24')](handleEntityNotFound(_0x21fc9b,null))[_0x3c42('0x24')](respondWithResult(_0x21fc9b,null))['catch'](handleError(_0x21fc9b,null));};exports[_0x3c42('0x23')]=function(_0x1d8e8b,_0x5edcfb){if(_0x1d8e8b[_0x3c42('0x39')]['id']){delete _0x1d8e8b['body']['id'];}return db['ChatApplication'][_0x3c42('0x38')]({'where':{'id':_0x1d8e8b['params']['id']}})[_0x3c42('0x24')](handleEntityNotFound(_0x5edcfb,null))[_0x3c42('0x24')](saveUpdates(_0x1d8e8b['body'],null))[_0x3c42('0x24')](respondWithResult(_0x5edcfb,null))[_0x3c42('0x3a')](handleError(_0x5edcfb,null));};exports[_0x3c42('0x25')]=function(_0x4f0c87,_0x367f7a){return db['ChatApplication']['find']({'where':{'id':_0x4f0c87[_0x3c42('0x2d')]['id']}})[_0x3c42('0x24')](handleEntityNotFound(_0x367f7a,null))[_0x3c42('0x24')](removeEntity(_0x367f7a,null))['catch'](handleError(_0x367f7a,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 9436063..ba69861 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 _0xe148=['utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','ChatApplication','chat_applications'];(function(_0x7b330b,_0x5e3e0e){var _0x45cdde=function(_0x2b3a32){while(--_0x2b3a32){_0x7b330b['push'](_0x7b330b['shift']());}};_0x45cdde(++_0x5e3e0e);}(_0xe148,0x9e));var _0x8e14=function(_0xac56ce,_0xb73e4){_0xac56ce=_0xac56ce-0x0;var _0x5105e1=_0xe148[_0xac56ce];return _0x5105e1;};'use strict';var _=require(_0x8e14('0x0'));var util=require(_0x8e14('0x1'));var logger=require('../../config/logger')(_0x8e14('0x2'));var moment=require(_0x8e14('0x3'));var BPromise=require('bluebird');var rp=require(_0x8e14('0x4'));var fs=require('fs');var path=require(_0x8e14('0x5'));var rimraf=require(_0x8e14('0x6'));var config=require(_0x8e14('0x7'));var attributes=require('./chatApplication.attributes');module['exports']=function(_0x33307e,_0x1f5039){return _0x33307e['define'](_0x8e14('0x8'),attributes,{'tableName':_0x8e14('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8e14('0xa'),'collate':_0x8e14('0xb')});};
\ No newline at end of file
+var _0x2123=['bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','utf8mb4','lodash','util','../../config/logger','api','moment'];(function(_0x2e229f,_0x4d58cd){var _0x4ab853=function(_0x1e22d9){while(--_0x1e22d9){_0x2e229f['push'](_0x2e229f['shift']());}};_0x4ab853(++_0x4d58cd);}(_0x2123,0x190));var _0x3212=function(_0x585576,_0x35b2cc){_0x585576=_0x585576-0x0;var _0x90fe7d=_0x2123[_0x585576];return _0x90fe7d;};'use strict';var _=require(_0x3212('0x0'));var util=require(_0x3212('0x1'));var logger=require(_0x3212('0x2'))(_0x3212('0x3'));var moment=require(_0x3212('0x4'));var BPromise=require(_0x3212('0x5'));var rp=require(_0x3212('0x6'));var fs=require('fs');var path=require(_0x3212('0x7'));var rimraf=require(_0x3212('0x8'));var config=require(_0x3212('0x9'));var attributes=require(_0x3212('0xa'));module[_0x3212('0xb')]=function(_0x5d9d36,_0x3859e4){return _0x5d9d36[_0x3212('0xc')](_0x3212('0xd'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3212('0xe'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 9acf1c1..7e4ce45 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 _0xe5c2=['debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','ChatApplication,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','then','info','request\x20sent'];(function(_0x2ed467,_0x425395){var _0x183939=function(_0x32abe0){while(--_0x32abe0){_0x2ed467['push'](_0x2ed467['shift']());}};_0x183939(++_0x425395);}(_0xe5c2,0x104));var _0x2e5c=function(_0x1eb094,_0x15fd4c){_0x1eb094=_0x1eb094-0x0;var _0x4bc38a=_0xe5c2[_0x1eb094];return _0x4bc38a;};'use strict';var _=require('lodash');var util=require(_0x2e5c('0x0'));var moment=require(_0x2e5c('0x1'));var BPromise=require(_0x2e5c('0x2'));var rs=require(_0x2e5c('0x3'));var fs=require('fs');var Redis=require(_0x2e5c('0x4'));var db=require(_0x2e5c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2e5c('0x6'))('rpc');var config=require(_0x2e5c('0x7'));var jayson=require(_0x2e5c('0x8'));var client=jayson['client'][_0x2e5c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x20e531,_0x189699,_0x4d9212){return new BPromise(function(_0x4d73f1,_0x216508){return client['request'](_0x20e531,_0x4d9212)[_0x2e5c('0xa')](function(_0x8fa4a0){logger[_0x2e5c('0xb')]('ChatApplication,\x20%s,\x20%s',_0x189699,_0x2e5c('0xc'));logger[_0x2e5c('0xd')](_0x2e5c('0xe'),_0x189699,_0x2e5c('0xc'),JSON[_0x2e5c('0xf')](_0x8fa4a0));if(_0x8fa4a0[_0x2e5c('0x10')]){if(_0x8fa4a0[_0x2e5c('0x10')]['code']===0x1f4){logger[_0x2e5c('0x10')](_0x2e5c('0x11'),_0x189699,_0x8fa4a0[_0x2e5c('0x10')]['message']);return _0x216508(_0x8fa4a0['error'][_0x2e5c('0x12')]);}logger['error'](_0x2e5c('0x11'),_0x189699,_0x8fa4a0[_0x2e5c('0x10')][_0x2e5c('0x12')]);return _0x4d73f1(_0x8fa4a0['error']['message']);}else{logger[_0x2e5c('0xb')](_0x2e5c('0x11'),_0x189699,'request\x20sent');_0x4d73f1(_0x8fa4a0[_0x2e5c('0x13')][_0x2e5c('0x12')]);}})[_0x2e5c('0x14')](function(_0x1daedf){logger[_0x2e5c('0x10')](_0x2e5c('0x11'),_0x189699,_0x1daedf);_0x216508(_0x1daedf);});});}
\ No newline at end of file
+var _0x3dc2=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','ChatApplication,\x20%s,\x20%s','message','result'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x3dc2,0xb1));var _0x23dc=function(_0x50f737,_0x2a90fa){_0x50f737=_0x50f737-0x0;var _0x141dd8=_0x3dc2[_0x50f737];return _0x141dd8;};'use strict';var _=require(_0x23dc('0x0'));var util=require(_0x23dc('0x1'));var moment=require(_0x23dc('0x2'));var BPromise=require(_0x23dc('0x3'));var rs=require(_0x23dc('0x4'));var fs=require('fs');var Redis=require(_0x23dc('0x5'));var db=require(_0x23dc('0x6'))['db'];var utils=require(_0x23dc('0x7'));var logger=require(_0x23dc('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x23dc('0x9'));var client=jayson['client'][_0x23dc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x17cd00,_0x42c6eb,_0x85f7a){return new BPromise(function(_0x17a49d,_0x25ef9b){return client[_0x23dc('0xb')](_0x17cd00,_0x85f7a)['then'](function(_0x424f4f){logger[_0x23dc('0xc')]('ChatApplication,\x20%s,\x20%s',_0x42c6eb,_0x23dc('0xd'));logger[_0x23dc('0xe')](_0x23dc('0xf'),_0x42c6eb,_0x23dc('0xd'),JSON['stringify'](_0x424f4f));if(_0x424f4f[_0x23dc('0x10')]){if(_0x424f4f[_0x23dc('0x10')][_0x23dc('0x11')]===0x1f4){logger[_0x23dc('0x10')](_0x23dc('0x12'),_0x42c6eb,_0x424f4f[_0x23dc('0x10')]['message']);return _0x25ef9b(_0x424f4f['error'][_0x23dc('0x13')]);}logger[_0x23dc('0x10')](_0x23dc('0x12'),_0x42c6eb,_0x424f4f['error'][_0x23dc('0x13')]);return _0x17a49d(_0x424f4f[_0x23dc('0x10')][_0x23dc('0x13')]);}else{logger[_0x23dc('0xc')](_0x23dc('0x12'),_0x42c6eb,'request\x20sent');_0x17a49d(_0x424f4f[_0x23dc('0x14')][_0x23dc('0x13')]);}})[_0x23dc('0x15')](function(_0x55b5bc){logger[_0x23dc('0x10')](_0x23dc('0x12'),_0x42c6eb,_0x55b5bc);_0x25ef9b(_0x55b5bc);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 87d5ce3..66ac5fa 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 _0x8693=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','isAuthenticated','show','put','update','delete','/:id','exports','multer','util','path','connect-timeout'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x8693,0x68));var _0x3869=function(_0x2bcc88,_0x5d788c){_0x2bcc88=_0x2bcc88-0x0;var _0x3a4136=_0x8693[_0x2bcc88];return _0x3a4136;};'use strict';var multer=require(_0x3869('0x0'));var util=require(_0x3869('0x1'));var path=require(_0x3869('0x2'));var timeout=require(_0x3869('0x3'));var express=require(_0x3869('0x4'));var router=express[_0x3869('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3869('0x6'));var interaction=require(_0x3869('0x7'));var config=require(_0x3869('0x8'));var controller=require(_0x3869('0x9'));router[_0x3869('0xa')]('/:id',auth[_0x3869('0xb')](),controller[_0x3869('0xc')]);router[_0x3869('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x3869('0xe')]);router[_0x3869('0xf')](_0x3869('0x10'),auth[_0x3869('0xb')](),controller['destroy']);module[_0x3869('0x11')]=router;
\ No newline at end of file
+var _0xd192=['get','/:id','isAuthenticated','show','put','update','destroy','exports','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2a31ed,_0x507130){var _0x58e43e=function(_0x604732){while(--_0x604732){_0x2a31ed['push'](_0x2a31ed['shift']());}};_0x58e43e(++_0x507130);}(_0xd192,0x120));var _0x2d19=function(_0x179c8d,_0x5bb0a3){_0x179c8d=_0x179c8d-0x0;var _0x4377e8=_0xd192[_0x179c8d];return _0x4377e8;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2d19('0x0'));var router=express[_0x2d19('0x1')]();var fs_extra=require(_0x2d19('0x2'));var auth=require(_0x2d19('0x3'));var interaction=require(_0x2d19('0x4'));var config=require(_0x2d19('0x5'));var controller=require('./chatApplication.controller');router[_0x2d19('0x6')](_0x2d19('0x7'),auth[_0x2d19('0x8')](),controller[_0x2d19('0x9')]);router[_0x2d19('0xa')](_0x2d19('0x7'),auth[_0x2d19('0x8')](),controller[_0x2d19('0xb')]);router['delete'](_0x2d19('0x7'),auth['isAuthenticated'](),controller[_0x2d19('0xc')]);module[_0x2d19('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 496cc71..53ae2a3 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 _0x4d87=['exports','STRING'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0x4d87,0xf0));var _0x74d8=function(_0x11eb28,_0x13100e){_0x11eb28=_0x11eb28-0x0;var _0x3ae8a7=_0x4d87[_0x11eb28];return _0x3ae8a7;};'use strict';var Sequelize=require('sequelize');module[_0x74d8('0x0')]={'name':{'type':Sequelize[_0x74d8('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x74d8('0x1')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0x151b=['STRING','BOOLEAN','sequelize','exports'];(function(_0x54b9c5,_0x28c1bd){var _0x31c599=function(_0x100311){while(--_0x100311){_0x54b9c5['push'](_0x54b9c5['shift']());}};_0x31c599(++_0x28c1bd);}(_0x151b,0x152));var _0xb151=function(_0x37317b,_0x5d98a7){_0x37317b=_0x37317b-0x0;var _0x4507d3=_0x151b[_0x37317b];return _0x4507d3;};'use strict';var Sequelize=require(_0xb151('0x0'));module[_0xb151('0x1')]={'name':{'type':Sequelize[_0xb151('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb151('0x2')]},'write':{'type':Sequelize[_0xb151('0x3')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 5e8018e..aaf5b58 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 _0x228e=['getMembers','removeMembers','addMessage','ChatGroupId','getMessages','order','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','status','offset','limit','set','Content-Range','json','reject','update','end','stack','name','send','index','map','ChatGroup','rawAttributes','type','key','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','count','then','includeAll','findAll','rows','catch','show','params','keys','include','options','find','create','body','getUnread','ChatInternalMessage','user','addMembers','ids','omit','findOne','User','pick'];(function(_0x211b6c,_0x5214b4){var _0x1a8546=function(_0x2474a5){while(--_0x2474a5){_0x211b6c['push'](_0x211b6c['shift']());}};_0x1a8546(++_0x5214b4);}(_0x228e,0x121));var _0xe228=function(_0x1772ec,_0x16052e){_0x1772ec=_0x1772ec-0x0;var _0x4387c4=_0x228e[_0x1772ec];return _0x4387c4;};'use strict';var emlformat=require(_0xe228('0x0'));var rimraf=require(_0xe228('0x1'));var zipdir=require(_0xe228('0x2'));var jsonpatch=require(_0xe228('0x3'));var rp=require(_0xe228('0x4'));var moment=require(_0xe228('0x5'));var BPromise=require(_0xe228('0x6'));var Mustache=require('mustache');var util=require(_0xe228('0x7'));var path=require('path');var sox=require(_0xe228('0x8'));var csv=require(_0xe228('0x9'));var ejs=require(_0xe228('0xa'));var fs=require('fs');var fs_extra=require(_0xe228('0xb'));var _=require(_0xe228('0xc'));var squel=require(_0xe228('0xd'));var crypto=require('crypto');var jsforce=require(_0xe228('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe228('0x9'));var querystring=require(_0xe228('0xf'));var Papa=require(_0xe228('0x10'));var Redis=require(_0xe228('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xe228('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe228('0x13'))(_0xe228('0x14'));var utils=require(_0xe228('0x15'));var config=require(_0xe228('0x16'));var licenseUtil=require(_0xe228('0x17'));var db=require(_0xe228('0x18'))['db'];config[_0xe228('0x19')]=_[_0xe228('0x1a')](config[_0xe228('0x19')],{'host':_0xe228('0x1b'),'port':0x18eb});var socket=require(_0xe228('0x1c'))(new Redis(config[_0xe228('0x19')]));require('./chatGroup.socket')['register'](socket);function respondWithStatusCode(_0x34c416,_0x35ba52){_0x35ba52=_0x35ba52||0xcc;return function(_0x1fb1e3){if(_0x1fb1e3){return _0x34c416['sendStatus'](_0x35ba52);}return _0x34c416[_0xe228('0x1d')](_0x35ba52)['end']();};}function respondWithResult(_0x344acd,_0x369307){_0x369307=_0x369307||0xc8;return function(_0x1b0602){if(_0x1b0602){return _0x344acd['status'](_0x369307)['json'](_0x1b0602);}};}function respondWithFilteredResult(_0x4cd429,_0x4c1ab1){return function(_0x3eeb2c){if(_0x3eeb2c){var _0x5d55a1=typeof _0x4c1ab1[_0xe228('0x1e')]==='undefined'&&typeof _0x4c1ab1[_0xe228('0x1f')]==='undefined';var _0x2b8601=_0x3eeb2c['count'];var _0x2d8ac7=_0x5d55a1?0x0:_0x4c1ab1[_0xe228('0x1e')];var _0x316317=_0x5d55a1?_0x3eeb2c['count']:_0x4c1ab1[_0xe228('0x1e')]+_0x4c1ab1[_0xe228('0x1f')];var _0x279510;if(_0x316317>=_0x2b8601){_0x316317=_0x2b8601;_0x279510=0xc8;}else{_0x279510=0xce;}_0x4cd429[_0xe228('0x1d')](_0x279510);return _0x4cd429[_0xe228('0x20')](_0xe228('0x21'),_0x2d8ac7+'-'+_0x316317+'/'+_0x2b8601)[_0xe228('0x22')](_0x3eeb2c);}return null;};}function patchUpdates(_0x5ebe85){return function(_0x3ec14d){try{jsonpatch['apply'](_0x3ec14d,_0x5ebe85,!![]);}catch(_0x48e220){return BPromise[_0xe228('0x23')](_0x48e220);}return _0x3ec14d['save']();};}function saveUpdates(_0x3bf34e,_0x59f2fc){return function(_0x4a43c7){if(_0x4a43c7){return _0x4a43c7[_0xe228('0x24')](_0x3bf34e)['then'](function(_0x3ec139){return _0x3ec139;});}return null;};}function removeEntity(_0x5d1e78,_0x1b0465){return function(_0x2ae51a){if(_0x2ae51a){return _0x2ae51a['destroy']()['then'](function(){_0x5d1e78[_0xe228('0x1d')](0xcc)[_0xe228('0x25')]();});}};}function handleEntityNotFound(_0x168f00,_0x4b1359){return function(_0x520328){if(!_0x520328){_0x168f00['sendStatus'](0x194);}return _0x520328;};}function handleError(_0x1f0f71,_0x5691ab){_0x5691ab=_0x5691ab||0x1f4;return function(_0x405e6f){logger['error'](_0x405e6f[_0xe228('0x26')]);if(_0x405e6f[_0xe228('0x27')]){delete _0x405e6f['name'];}_0x1f0f71['status'](_0x5691ab)[_0xe228('0x28')](_0x405e6f);};}exports[_0xe228('0x29')]=function(_0x5a08b9,_0x236c3a){var _0x5ae98b={},_0x2bad7c={},_0x2fa12e={'count':0x0,'rows':[]};var _0x4e7d34=_[_0xe228('0x2a')](db[_0xe228('0x2b')][_0xe228('0x2c')],function(_0x2249c8){return{'name':_0x2249c8['fieldName'],'type':_0x2249c8[_0xe228('0x2d')][_0xe228('0x2e')]};});_0x2bad7c['model']=_[_0xe228('0x2a')](_0x4e7d34,_0xe228('0x27'));_0x2bad7c[_0xe228('0x2f')]=_['keys'](_0x5a08b9[_0xe228('0x2f')]);_0x2bad7c['filters']=_[_0xe228('0x30')](_0x2bad7c['model'],_0x2bad7c[_0xe228('0x2f')]);_0x5ae98b[_0xe228('0x31')]=_[_0xe228('0x30')](_0x2bad7c[_0xe228('0x32')],qs[_0xe228('0x33')](_0x5a08b9[_0xe228('0x2f')][_0xe228('0x33')]));_0x5ae98b[_0xe228('0x31')]=_0x5ae98b[_0xe228('0x31')][_0xe228('0x34')]?_0x5ae98b[_0xe228('0x31')]:_0x2bad7c[_0xe228('0x32')];if(!_0x5a08b9[_0xe228('0x2f')][_0xe228('0x35')](_0xe228('0x36'))){_0x5ae98b[_0xe228('0x1f')]=qs[_0xe228('0x1f')](_0x5a08b9[_0xe228('0x2f')][_0xe228('0x1f')]);_0x5ae98b[_0xe228('0x1e')]=qs[_0xe228('0x1e')](_0x5a08b9['query'][_0xe228('0x1e')]);}_0x5ae98b['order']=qs[_0xe228('0x37')](_0x5a08b9[_0xe228('0x2f')][_0xe228('0x37')]);_0x5ae98b[_0xe228('0x38')]=qs[_0xe228('0x39')](_['pick'](_0x5a08b9[_0xe228('0x2f')],_0x2bad7c[_0xe228('0x39')]),_0x4e7d34);if(_0x5a08b9[_0xe228('0x2f')][_0xe228('0x3a')]){_0x5ae98b[_0xe228('0x38')]=_[_0xe228('0x3b')](_0x5ae98b[_0xe228('0x38')],{'$or':_['map'](_0x4e7d34,function(_0x3d14c9){if(_0x3d14c9[_0xe228('0x2d')]!=='VIRTUAL'){var _0x9e838c={};_0x9e838c[_0x3d14c9[_0xe228('0x27')]]={'$like':'%'+_0x5a08b9['query'][_0xe228('0x3a')]+'%'};return _0x9e838c;}})});}_0x5ae98b=_[_0xe228('0x3b')]({},_0x5ae98b,_0x5a08b9['options']);var _0x5dd4a0={'where':_0x5ae98b[_0xe228('0x38')]};return db[_0xe228('0x2b')][_0xe228('0x3c')](_0x5dd4a0)[_0xe228('0x3d')](function(_0x29e6ac){_0x2fa12e[_0xe228('0x3c')]=_0x29e6ac;if(_0x5a08b9[_0xe228('0x2f')][_0xe228('0x3e')]){_0x5ae98b['include']=[{'all':!![]}];}return db[_0xe228('0x2b')][_0xe228('0x3f')](_0x5ae98b);})['then'](function(_0x1791a7){_0x2fa12e[_0xe228('0x40')]=_0x1791a7;return _0x2fa12e;})[_0xe228('0x3d')](respondWithFilteredResult(_0x236c3a,_0x5ae98b))[_0xe228('0x41')](handleError(_0x236c3a,null));};exports[_0xe228('0x42')]=function(_0x529cc9,_0x599a5c){var _0x198199={'raw':!![],'where':{'id':_0x529cc9[_0xe228('0x43')]['id']}},_0x3e5cd0={};_0x3e5cd0['model']=_[_0xe228('0x44')](db[_0xe228('0x2b')][_0xe228('0x2c')]);_0x3e5cd0[_0xe228('0x2f')]=_[_0xe228('0x44')](_0x529cc9[_0xe228('0x2f')]);_0x3e5cd0[_0xe228('0x39')]=_[_0xe228('0x30')](_0x3e5cd0[_0xe228('0x32')],_0x3e5cd0[_0xe228('0x2f')]);_0x198199[_0xe228('0x31')]=_[_0xe228('0x30')](_0x3e5cd0[_0xe228('0x32')],qs[_0xe228('0x33')](_0x529cc9['query'][_0xe228('0x33')]));_0x198199[_0xe228('0x31')]=_0x198199[_0xe228('0x31')][_0xe228('0x34')]?_0x198199[_0xe228('0x31')]:_0x3e5cd0[_0xe228('0x32')];if(_0x529cc9[_0xe228('0x2f')][_0xe228('0x3e')]){_0x198199[_0xe228('0x45')]=[{'all':!![]}];}_0x198199=_[_0xe228('0x3b')]({},_0x198199,_0x529cc9[_0xe228('0x46')]);return db['ChatGroup'][_0xe228('0x47')](_0x198199)[_0xe228('0x3d')](handleEntityNotFound(_0x599a5c,null))[_0xe228('0x3d')](respondWithResult(_0x599a5c,null))[_0xe228('0x41')](handleError(_0x599a5c,null));};exports[_0xe228('0x48')]=function(_0x287d66,_0x3e059d){return db[_0xe228('0x2b')][_0xe228('0x48')](_0x287d66[_0xe228('0x49')],{})[_0xe228('0x3d')](respondWithResult(_0x3e059d,0xc9))[_0xe228('0x41')](handleError(_0x3e059d,null));};exports[_0xe228('0x24')]=function(_0x2098dd,_0x68fe86){if(_0x2098dd[_0xe228('0x49')]['id']){delete _0x2098dd['body']['id'];}return db[_0xe228('0x2b')][_0xe228('0x47')]({'where':{'id':_0x2098dd[_0xe228('0x43')]['id']}})[_0xe228('0x3d')](handleEntityNotFound(_0x68fe86,null))[_0xe228('0x3d')](saveUpdates(_0x2098dd['body'],null))[_0xe228('0x3d')](respondWithResult(_0x68fe86,null))[_0xe228('0x41')](handleError(_0x68fe86,null));};exports['destroy']=function(_0x75fa7e,_0x2d00e4){return db[_0xe228('0x2b')]['find']({'where':{'id':_0x75fa7e['params']['id']}})['then'](handleEntityNotFound(_0x2d00e4,null))['then'](removeEntity(_0x2d00e4,null))[_0xe228('0x41')](handleError(_0x2d00e4,null));};exports['describe']=function(_0x41c50c,_0x3f3c7e){return db['ChatGroup']['describe']()[_0xe228('0x3d')](respondWithResult(_0x3f3c7e,null))[_0xe228('0x41')](handleError(_0x3f3c7e,null));};exports[_0xe228('0x4a')]=function(_0x538e8f,_0x507081,_0x1957f5){return db[_0xe228('0x4b')][_0xe228('0x3c')]({'where':{'ChatGroupId':_0x538e8f[_0xe228('0x43')]['id'],'ToId':_0x538e8f[_0xe228('0x4c')]['id'],'read':![]}})[_0xe228('0x3d')](function(_0x32a3cf){return{'id':_['toInteger'](_0x538e8f[_0xe228('0x43')]['id']),'count':_0x32a3cf};})['then'](respondWithResult(_0x507081,null))['catch'](handleError(_0x507081,null));};exports[_0xe228('0x4d')]=function(_0x482360,_0x4a3c14,_0x298b00){return db[_0xe228('0x2b')][_0xe228('0x47')]({'where':{'id':_0x482360[_0xe228('0x43')]['id']}})[_0xe228('0x3d')](handleEntityNotFound(_0x4a3c14,null))[_0xe228('0x3d')](function(_0x2af37d){if(_0x2af37d){return _0x2af37d[_0xe228('0x4d')](_0x482360[_0xe228('0x49')][_0xe228('0x4e')],_[_0xe228('0x4f')](_0x482360[_0xe228('0x49')],['ids','id'])||{});}})[_0xe228('0x3d')](respondWithResult(_0x4a3c14,null))['catch'](handleError(_0x4a3c14,null));};exports['getMembers']=function(_0x44c506,_0x3003fb,_0x58827c){var _0x3db44c={};var _0x3f3d79={};var _0x153a11;var _0x37a10b;return db[_0xe228('0x2b')][_0xe228('0x50')]({'where':{'id':_0x44c506[_0xe228('0x43')]['id']}})[_0xe228('0x3d')](handleEntityNotFound(_0x3003fb,null))[_0xe228('0x3d')](function(_0x2be49c){if(_0x2be49c){_0x153a11=_0x2be49c;_0x3f3d79[_0xe228('0x32')]=_['keys'](db[_0xe228('0x51')]['rawAttributes']);_0x3f3d79[_0xe228('0x2f')]=_[_0xe228('0x44')](_0x44c506[_0xe228('0x2f')]);_0x3f3d79['filters']=_['intersection'](_0x3f3d79['model'],_0x3f3d79[_0xe228('0x2f')]);_0x3db44c[_0xe228('0x31')]=_[_0xe228('0x30')](_0x3f3d79[_0xe228('0x32')],qs[_0xe228('0x33')](_0x44c506[_0xe228('0x2f')][_0xe228('0x33')]));_0x3db44c[_0xe228('0x31')]=_0x3db44c[_0xe228('0x31')][_0xe228('0x34')]?_0x3db44c['attributes']:_0x3f3d79[_0xe228('0x32')];_0x3db44c['order']=qs[_0xe228('0x37')](_0x44c506['query'][_0xe228('0x37')]);_0x3db44c['where']=qs[_0xe228('0x39')](_[_0xe228('0x52')](_0x44c506[_0xe228('0x2f')],_0x3f3d79[_0xe228('0x39')]));if(_0x44c506[_0xe228('0x2f')][_0xe228('0x3a')]){_0x3db44c[_0xe228('0x38')]=_[_0xe228('0x3b')](_0x3db44c[_0xe228('0x38')],{'$or':_[_0xe228('0x2a')](_0x3db44c[_0xe228('0x31')],function(_0x4b4744){var _0x1c8db1={};_0x1c8db1[_0x4b4744]={'$like':'%'+_0x44c506['query'][_0xe228('0x3a')]+'%'};return _0x1c8db1;})});}_0x3db44c=_[_0xe228('0x3b')]({},_0x3db44c,_0x44c506[_0xe228('0x46')]);return _0x153a11[_0xe228('0x53')](_0x3db44c);}})['then'](function(_0x6a971b){if(_0x6a971b){_0x37a10b=_0x6a971b[_0xe228('0x34')];if(!_0x44c506[_0xe228('0x2f')][_0xe228('0x35')](_0xe228('0x36'))){_0x3db44c[_0xe228('0x1f')]=qs[_0xe228('0x1f')](_0x44c506['query'][_0xe228('0x1f')]);_0x3db44c[_0xe228('0x1e')]=qs[_0xe228('0x1e')](_0x44c506[_0xe228('0x2f')]['offset']);}return _0x153a11[_0xe228('0x53')](_0x3db44c);}})[_0xe228('0x3d')](function(_0x47cf9b){if(_0x47cf9b){return _0x47cf9b?{'count':_0x37a10b,'rows':_0x47cf9b}:null;}})[_0xe228('0x3d')](respondWithResult(_0x3003fb,null))[_0xe228('0x41')](handleError(_0x3003fb,null));};exports[_0xe228('0x54')]=function(_0x98eb1e,_0x303f8a,_0x1a86bd){return db['ChatGroup'][_0xe228('0x47')]({'where':{'id':_0x98eb1e[_0xe228('0x43')]['id']}})[_0xe228('0x3d')](handleEntityNotFound(_0x303f8a,null))['then'](function(_0x218ac5){if(_0x218ac5){return _0x218ac5[_0xe228('0x54')](_0x98eb1e['query'][_0xe228('0x4e')]);}})[_0xe228('0x3d')](respondWithStatusCode(_0x303f8a,null))[_0xe228('0x41')](handleError(_0x303f8a,null));};exports[_0xe228('0x55')]=function(_0x37f8c5,_0x138c24,_0x165097){if(_0x37f8c5[_0xe228('0x49')]['id']){delete _0x37f8c5[_0xe228('0x49')]['id'];}return db[_0xe228('0x2b')][_0xe228('0x47')]({'where':{'id':_0x37f8c5[_0xe228('0x43')]['id']}})['then'](handleEntityNotFound(_0x138c24,null))[_0xe228('0x3d')](function(_0xde597){if(_0xde597){_0x37f8c5[_0xe228('0x49')][_0xe228('0x56')]=_0xde597['id'];return db['ChatInternalMessage'][_0xe228('0x48')](_0x37f8c5[_0xe228('0x49')]);}})[_0xe228('0x3d')](respondWithResult(_0x138c24,null))[_0xe228('0x41')](handleError(_0x138c24,null));};exports[_0xe228('0x57')]=function(_0x49bb41,_0xdf2140,_0x228c56){var _0xfa715e={};var _0xd9d6c5={};var _0x395b53;var _0x84f6a8;return db['ChatGroup'][_0xe228('0x50')]({'where':{'id':_0x49bb41[_0xe228('0x43')]['id']}})[_0xe228('0x3d')](handleEntityNotFound(_0xdf2140,null))[_0xe228('0x3d')](function(_0x201c1f){if(_0x201c1f){_0x395b53=_0x201c1f;_0xd9d6c5[_0xe228('0x32')]=_[_0xe228('0x44')](db[_0xe228('0x4b')][_0xe228('0x2c')]);_0xd9d6c5['query']=_[_0xe228('0x44')](_0x49bb41['query']);_0xd9d6c5['filters']=_[_0xe228('0x30')](_0xd9d6c5['model'],_0xd9d6c5[_0xe228('0x2f')]);_0xfa715e['attributes']=_[_0xe228('0x30')](_0xd9d6c5['model'],qs[_0xe228('0x33')](_0x49bb41[_0xe228('0x2f')][_0xe228('0x33')]));_0xfa715e[_0xe228('0x31')]=_0xfa715e[_0xe228('0x31')][_0xe228('0x34')]?_0xfa715e[_0xe228('0x31')]:_0xd9d6c5['model'];_0xfa715e[_0xe228('0x58')]=qs['sort'](_0x49bb41['query']['sort']);_0xfa715e[_0xe228('0x38')]=qs[_0xe228('0x39')](_['pick'](_0x49bb41[_0xe228('0x2f')],_0xd9d6c5[_0xe228('0x39')]));if(_0x49bb41[_0xe228('0x2f')][_0xe228('0x3a')]){_0xfa715e[_0xe228('0x38')]=_[_0xe228('0x3b')](_0xfa715e['where'],{'$or':_[_0xe228('0x2a')](_0xfa715e[_0xe228('0x31')],function(_0x4e63ae){var _0x3ada76={};_0x3ada76[_0x4e63ae]={'$like':'%'+_0x49bb41[_0xe228('0x2f')][_0xe228('0x3a')]+'%'};return _0x3ada76;})});}if(_0x49bb41[_0xe228('0x2f')][_0xe228('0x59')]){var _0x1be664=_0x49bb41[_0xe228('0x2f')][_0xe228('0x59')][_0xe228('0x5a')](',');var _0x4bfb08={};_0x4bfb08[_0x1be664[0x0]]={'$gte':moment(_0x1be664[0x1])[_0xe228('0x5b')](_0xe228('0x5c'))};_0xfa715e[_0xe228('0x38')]=_[_0xe228('0x3b')](_0xfa715e[_0xe228('0x38')],_0x4bfb08);}_0xfa715e=_[_0xe228('0x3b')]({},_0xfa715e,_0x49bb41[_0xe228('0x46')]);return _0x395b53['getMessages'](_0xfa715e);}})['then'](function(_0x40f73e){if(_0x40f73e){_0x84f6a8=_0x40f73e[_0xe228('0x34')];if(!_0x49bb41['query'][_0xe228('0x35')]('nolimit')){_0xfa715e[_0xe228('0x1f')]=qs[_0xe228('0x1f')](_0x49bb41[_0xe228('0x2f')]['limit']);_0xfa715e[_0xe228('0x1e')]=qs[_0xe228('0x1e')](_0x49bb41[_0xe228('0x2f')][_0xe228('0x1e')]);}return _0x395b53['getMessages'](_0xfa715e);}})[_0xe228('0x3d')](function(_0x33335f){if(_0x33335f){return _0x33335f?{'count':_0x84f6a8,'rows':_0x33335f}:null;}})['then'](respondWithResult(_0xdf2140,null))['catch'](handleError(_0xdf2140,null));};
\ No newline at end of file
+var _0x0fd2=['fieldName','type','key','query','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','intersection','find','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','omit','ids','getMembers','findOne','User','order','removeMembers','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','eml-format','rimraf','fast-json-patch','moment','util','path','sox','fs-extra','squel','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','name','send','map','ChatGroup','rawAttributes'];(function(_0x3ad33a,_0x123932){var _0x4799b6=function(_0x284163){while(--_0x284163){_0x3ad33a['push'](_0x3ad33a['shift']());}};_0x4799b6(++_0x123932);}(_0x0fd2,0x144));var _0x20fd=function(_0x3a5053,_0x548f4d){_0x3a5053=_0x3a5053-0x0;var _0x282050=_0x0fd2[_0x3a5053];return _0x282050;};'use strict';var emlformat=require(_0x20fd('0x0'));var rimraf=require(_0x20fd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x20fd('0x2'));var rp=require('request-promise');var moment=require(_0x20fd('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x20fd('0x4'));var path=require(_0x20fd('0x5'));var sox=require(_0x20fd('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x20fd('0x7'));var _=require('lodash');var squel=require(_0x20fd('0x8'));var crypto=require('crypto');var jsforce=require(_0x20fd('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x20fd('0xa'));var Papa=require(_0x20fd('0xb'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x20fd('0xc'));var as=require(_0x20fd('0xd'));var hardwareService=require(_0x20fd('0xe'));var logger=require(_0x20fd('0xf'))(_0x20fd('0x10'));var utils=require(_0x20fd('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x20fd('0x12')]=_[_0x20fd('0x13')](config['redis'],{'host':_0x20fd('0x14'),'port':0x18eb});var socket=require(_0x20fd('0x15'))(new Redis(config['redis']));require(_0x20fd('0x16'))[_0x20fd('0x17')](socket);function respondWithStatusCode(_0x72ef21,_0x467b64){_0x467b64=_0x467b64||0xcc;return function(_0x186644){if(_0x186644){return _0x72ef21[_0x20fd('0x18')](_0x467b64);}return _0x72ef21[_0x20fd('0x19')](_0x467b64)[_0x20fd('0x1a')]();};}function respondWithResult(_0x7d7049,_0x21b7ff){_0x21b7ff=_0x21b7ff||0xc8;return function(_0x1bd2cc){if(_0x1bd2cc){return _0x7d7049[_0x20fd('0x19')](_0x21b7ff)['json'](_0x1bd2cc);}};}function respondWithFilteredResult(_0xd69fe6,_0x5b7edc){return function(_0x25143f){if(_0x25143f){var _0x2306de=typeof _0x5b7edc[_0x20fd('0x1b')]===_0x20fd('0x1c')&&typeof _0x5b7edc[_0x20fd('0x1d')]===_0x20fd('0x1c');var _0x2c764f=_0x25143f[_0x20fd('0x1e')];var _0x50f2ee=_0x2306de?0x0:_0x5b7edc[_0x20fd('0x1b')];var _0x18bcec=_0x2306de?_0x25143f['count']:_0x5b7edc[_0x20fd('0x1b')]+_0x5b7edc[_0x20fd('0x1d')];var _0x42cf31;if(_0x18bcec>=_0x2c764f){_0x18bcec=_0x2c764f;_0x42cf31=0xc8;}else{_0x42cf31=0xce;}_0xd69fe6[_0x20fd('0x19')](_0x42cf31);return _0xd69fe6[_0x20fd('0x1f')](_0x20fd('0x20'),_0x50f2ee+'-'+_0x18bcec+'/'+_0x2c764f)[_0x20fd('0x21')](_0x25143f);}return null;};}function patchUpdates(_0x3fb989){return function(_0x2abb64){try{jsonpatch[_0x20fd('0x22')](_0x2abb64,_0x3fb989,!![]);}catch(_0x4cd0ca){return BPromise[_0x20fd('0x23')](_0x4cd0ca);}return _0x2abb64['save']();};}function saveUpdates(_0x14c7cc,_0x21cb46){return function(_0x32fe3b){if(_0x32fe3b){return _0x32fe3b[_0x20fd('0x24')](_0x14c7cc)[_0x20fd('0x25')](function(_0x5cdca9){return _0x5cdca9;});}return null;};}function removeEntity(_0x52170f,_0x44e26e){return function(_0x5e8081){if(_0x5e8081){return _0x5e8081[_0x20fd('0x26')]()[_0x20fd('0x25')](function(){_0x52170f[_0x20fd('0x19')](0xcc)[_0x20fd('0x1a')]();});}};}function handleEntityNotFound(_0x5f677d,_0x517d9d){return function(_0x156faa){if(!_0x156faa){_0x5f677d[_0x20fd('0x18')](0x194);}return _0x156faa;};}function handleError(_0xdca00b,_0x3283de){_0x3283de=_0x3283de||0x1f4;return function(_0x3de51b){logger['error'](_0x3de51b['stack']);if(_0x3de51b[_0x20fd('0x27')]){delete _0x3de51b[_0x20fd('0x27')];}_0xdca00b['status'](_0x3283de)[_0x20fd('0x28')](_0x3de51b);};}exports['index']=function(_0x3d8cbe,_0x430a95){var _0x1efe83={},_0x125561={},_0x55c3e2={'count':0x0,'rows':[]};var _0x594aa6=_[_0x20fd('0x29')](db[_0x20fd('0x2a')][_0x20fd('0x2b')],function(_0x5894e0){return{'name':_0x5894e0[_0x20fd('0x2c')],'type':_0x5894e0[_0x20fd('0x2d')][_0x20fd('0x2e')]};});_0x125561['model']=_[_0x20fd('0x29')](_0x594aa6,'name');_0x125561[_0x20fd('0x2f')]=_['keys'](_0x3d8cbe[_0x20fd('0x2f')]);_0x125561['filters']=_['intersection'](_0x125561['model'],_0x125561['query']);_0x1efe83['attributes']=_['intersection'](_0x125561[_0x20fd('0x30')],qs[_0x20fd('0x31')](_0x3d8cbe[_0x20fd('0x2f')]['fields']));_0x1efe83[_0x20fd('0x32')]=_0x1efe83[_0x20fd('0x32')][_0x20fd('0x33')]?_0x1efe83[_0x20fd('0x32')]:_0x125561[_0x20fd('0x30')];if(!_0x3d8cbe[_0x20fd('0x2f')][_0x20fd('0x34')](_0x20fd('0x35'))){_0x1efe83[_0x20fd('0x1d')]=qs[_0x20fd('0x1d')](_0x3d8cbe[_0x20fd('0x2f')]['limit']);_0x1efe83[_0x20fd('0x1b')]=qs[_0x20fd('0x1b')](_0x3d8cbe[_0x20fd('0x2f')]['offset']);}_0x1efe83['order']=qs[_0x20fd('0x36')](_0x3d8cbe[_0x20fd('0x2f')][_0x20fd('0x36')]);_0x1efe83[_0x20fd('0x37')]=qs[_0x20fd('0x38')](_[_0x20fd('0x39')](_0x3d8cbe[_0x20fd('0x2f')],_0x125561[_0x20fd('0x38')]),_0x594aa6);if(_0x3d8cbe[_0x20fd('0x2f')][_0x20fd('0x3a')]){_0x1efe83[_0x20fd('0x37')]=_[_0x20fd('0x3b')](_0x1efe83[_0x20fd('0x37')],{'$or':_[_0x20fd('0x29')](_0x594aa6,function(_0x131c03){if(_0x131c03[_0x20fd('0x2d')]!==_0x20fd('0x3c')){var _0x3464d0={};_0x3464d0[_0x131c03['name']]={'$like':'%'+_0x3d8cbe[_0x20fd('0x2f')][_0x20fd('0x3a')]+'%'};return _0x3464d0;}})});}_0x1efe83=_[_0x20fd('0x3b')]({},_0x1efe83,_0x3d8cbe['options']);var _0x10b6c4={'where':_0x1efe83[_0x20fd('0x37')]};return db[_0x20fd('0x2a')][_0x20fd('0x1e')](_0x10b6c4)[_0x20fd('0x25')](function(_0x393c89){_0x55c3e2[_0x20fd('0x1e')]=_0x393c89;if(_0x3d8cbe[_0x20fd('0x2f')][_0x20fd('0x3d')]){_0x1efe83[_0x20fd('0x3e')]=[{'all':!![]}];}return db[_0x20fd('0x2a')][_0x20fd('0x3f')](_0x1efe83);})[_0x20fd('0x25')](function(_0x3be0cf){_0x55c3e2[_0x20fd('0x40')]=_0x3be0cf;return _0x55c3e2;})[_0x20fd('0x25')](respondWithFilteredResult(_0x430a95,_0x1efe83))[_0x20fd('0x41')](handleError(_0x430a95,null));};exports[_0x20fd('0x42')]=function(_0x3aaed1,_0xc4b1c8){var _0x20a05e={'raw':!![],'where':{'id':_0x3aaed1[_0x20fd('0x43')]['id']}},_0x4f31a3={};_0x4f31a3[_0x20fd('0x30')]=_[_0x20fd('0x44')](db[_0x20fd('0x2a')][_0x20fd('0x2b')]);_0x4f31a3[_0x20fd('0x2f')]=_['keys'](_0x3aaed1[_0x20fd('0x2f')]);_0x4f31a3['filters']=_[_0x20fd('0x45')](_0x4f31a3['model'],_0x4f31a3[_0x20fd('0x2f')]);_0x20a05e[_0x20fd('0x32')]=_[_0x20fd('0x45')](_0x4f31a3[_0x20fd('0x30')],qs['fields'](_0x3aaed1[_0x20fd('0x2f')]['fields']));_0x20a05e[_0x20fd('0x32')]=_0x20a05e[_0x20fd('0x32')][_0x20fd('0x33')]?_0x20a05e[_0x20fd('0x32')]:_0x4f31a3[_0x20fd('0x30')];if(_0x3aaed1[_0x20fd('0x2f')][_0x20fd('0x3d')]){_0x20a05e[_0x20fd('0x3e')]=[{'all':!![]}];}_0x20a05e=_['merge']({},_0x20a05e,_0x3aaed1['options']);return db[_0x20fd('0x2a')][_0x20fd('0x46')](_0x20a05e)[_0x20fd('0x25')](handleEntityNotFound(_0xc4b1c8,null))[_0x20fd('0x25')](respondWithResult(_0xc4b1c8,null))['catch'](handleError(_0xc4b1c8,null));};exports['create']=function(_0x38bb4f,_0x46264b){return db['ChatGroup']['create'](_0x38bb4f['body'],{})[_0x20fd('0x25')](respondWithResult(_0x46264b,0xc9))['catch'](handleError(_0x46264b,null));};exports[_0x20fd('0x24')]=function(_0x500f4b,_0x50e917){if(_0x500f4b[_0x20fd('0x47')]['id']){delete _0x500f4b[_0x20fd('0x47')]['id'];}return db[_0x20fd('0x2a')]['find']({'where':{'id':_0x500f4b[_0x20fd('0x43')]['id']}})[_0x20fd('0x25')](handleEntityNotFound(_0x50e917,null))['then'](saveUpdates(_0x500f4b[_0x20fd('0x47')],null))[_0x20fd('0x25')](respondWithResult(_0x50e917,null))[_0x20fd('0x41')](handleError(_0x50e917,null));};exports[_0x20fd('0x26')]=function(_0x4d6521,_0x3b4b96){return db[_0x20fd('0x2a')]['find']({'where':{'id':_0x4d6521['params']['id']}})['then'](handleEntityNotFound(_0x3b4b96,null))[_0x20fd('0x25')](removeEntity(_0x3b4b96,null))[_0x20fd('0x41')](handleError(_0x3b4b96,null));};exports[_0x20fd('0x48')]=function(_0x108ad0,_0x51797a){return db[_0x20fd('0x2a')][_0x20fd('0x48')]()[_0x20fd('0x25')](respondWithResult(_0x51797a,null))[_0x20fd('0x41')](handleError(_0x51797a,null));};exports[_0x20fd('0x49')]=function(_0x49ef4d,_0x15000b,_0x343bba){return db[_0x20fd('0x4a')][_0x20fd('0x1e')]({'where':{'ChatGroupId':_0x49ef4d[_0x20fd('0x43')]['id'],'ToId':_0x49ef4d[_0x20fd('0x4b')]['id'],'read':![]}})[_0x20fd('0x25')](function(_0x2d5e46){return{'id':_[_0x20fd('0x4c')](_0x49ef4d[_0x20fd('0x43')]['id']),'count':_0x2d5e46};})[_0x20fd('0x25')](respondWithResult(_0x15000b,null))[_0x20fd('0x41')](handleError(_0x15000b,null));};exports['addMembers']=function(_0x5bcc5b,_0x16f93f,_0x226767){return db[_0x20fd('0x2a')]['find']({'where':{'id':_0x5bcc5b[_0x20fd('0x43')]['id']}})[_0x20fd('0x25')](handleEntityNotFound(_0x16f93f,null))[_0x20fd('0x25')](function(_0x2230b4){if(_0x2230b4){return _0x2230b4[_0x20fd('0x4d')](_0x5bcc5b[_0x20fd('0x47')]['ids'],_[_0x20fd('0x4e')](_0x5bcc5b[_0x20fd('0x47')],[_0x20fd('0x4f'),'id'])||{});}})[_0x20fd('0x25')](respondWithResult(_0x16f93f,null))[_0x20fd('0x41')](handleError(_0x16f93f,null));};exports[_0x20fd('0x50')]=function(_0x3b8c6e,_0x5ece60,_0x222e19){var _0x3b75a1={};var _0x24d8d2={};var _0x125c35;var _0x4430f7;return db[_0x20fd('0x2a')][_0x20fd('0x51')]({'where':{'id':_0x3b8c6e['params']['id']}})[_0x20fd('0x25')](handleEntityNotFound(_0x5ece60,null))[_0x20fd('0x25')](function(_0x37e211){if(_0x37e211){_0x125c35=_0x37e211;_0x24d8d2[_0x20fd('0x30')]=_[_0x20fd('0x44')](db[_0x20fd('0x52')][_0x20fd('0x2b')]);_0x24d8d2[_0x20fd('0x2f')]=_['keys'](_0x3b8c6e[_0x20fd('0x2f')]);_0x24d8d2[_0x20fd('0x38')]=_['intersection'](_0x24d8d2[_0x20fd('0x30')],_0x24d8d2[_0x20fd('0x2f')]);_0x3b75a1[_0x20fd('0x32')]=_['intersection'](_0x24d8d2[_0x20fd('0x30')],qs[_0x20fd('0x31')](_0x3b8c6e[_0x20fd('0x2f')][_0x20fd('0x31')]));_0x3b75a1[_0x20fd('0x32')]=_0x3b75a1[_0x20fd('0x32')][_0x20fd('0x33')]?_0x3b75a1[_0x20fd('0x32')]:_0x24d8d2[_0x20fd('0x30')];_0x3b75a1[_0x20fd('0x53')]=qs[_0x20fd('0x36')](_0x3b8c6e[_0x20fd('0x2f')]['sort']);_0x3b75a1[_0x20fd('0x37')]=qs[_0x20fd('0x38')](_[_0x20fd('0x39')](_0x3b8c6e[_0x20fd('0x2f')],_0x24d8d2[_0x20fd('0x38')]));if(_0x3b8c6e[_0x20fd('0x2f')]['filter']){_0x3b75a1[_0x20fd('0x37')]=_['merge'](_0x3b75a1[_0x20fd('0x37')],{'$or':_[_0x20fd('0x29')](_0x3b75a1[_0x20fd('0x32')],function(_0x37417d){var _0x58c556={};_0x58c556[_0x37417d]={'$like':'%'+_0x3b8c6e['query'][_0x20fd('0x3a')]+'%'};return _0x58c556;})});}_0x3b75a1=_['merge']({},_0x3b75a1,_0x3b8c6e['options']);return _0x125c35[_0x20fd('0x50')](_0x3b75a1);}})[_0x20fd('0x25')](function(_0x5498bb){if(_0x5498bb){_0x4430f7=_0x5498bb[_0x20fd('0x33')];if(!_0x3b8c6e[_0x20fd('0x2f')][_0x20fd('0x34')]('nolimit')){_0x3b75a1['limit']=qs[_0x20fd('0x1d')](_0x3b8c6e[_0x20fd('0x2f')][_0x20fd('0x1d')]);_0x3b75a1[_0x20fd('0x1b')]=qs[_0x20fd('0x1b')](_0x3b8c6e[_0x20fd('0x2f')]['offset']);}return _0x125c35[_0x20fd('0x50')](_0x3b75a1);}})[_0x20fd('0x25')](function(_0x4f8418){if(_0x4f8418){return _0x4f8418?{'count':_0x4430f7,'rows':_0x4f8418}:null;}})[_0x20fd('0x25')](respondWithResult(_0x5ece60,null))[_0x20fd('0x41')](handleError(_0x5ece60,null));};exports[_0x20fd('0x54')]=function(_0x33203c,_0x363a72,_0x2db3fe){return db[_0x20fd('0x2a')][_0x20fd('0x46')]({'where':{'id':_0x33203c['params']['id']}})['then'](handleEntityNotFound(_0x363a72,null))[_0x20fd('0x25')](function(_0x21da41){if(_0x21da41){return _0x21da41['removeMembers'](_0x33203c[_0x20fd('0x2f')][_0x20fd('0x4f')]);}})[_0x20fd('0x25')](respondWithStatusCode(_0x363a72,null))[_0x20fd('0x41')](handleError(_0x363a72,null));};exports['addMessage']=function(_0x1f1b0d,_0x295d99,_0x5ea843){if(_0x1f1b0d[_0x20fd('0x47')]['id']){delete _0x1f1b0d[_0x20fd('0x47')]['id'];}return db['ChatGroup'][_0x20fd('0x46')]({'where':{'id':_0x1f1b0d['params']['id']}})[_0x20fd('0x25')](handleEntityNotFound(_0x295d99,null))[_0x20fd('0x25')](function(_0x46a88a){if(_0x46a88a){_0x1f1b0d[_0x20fd('0x47')][_0x20fd('0x55')]=_0x46a88a['id'];return db[_0x20fd('0x4a')]['create'](_0x1f1b0d[_0x20fd('0x47')]);}})[_0x20fd('0x25')](respondWithResult(_0x295d99,null))['catch'](handleError(_0x295d99,null));};exports[_0x20fd('0x56')]=function(_0x3a620d,_0x1a74b5,_0x3845c5){var _0x3be654={};var _0x310bfa={};var _0x36bd4c;var _0x1336f1;return db['ChatGroup'][_0x20fd('0x51')]({'where':{'id':_0x3a620d[_0x20fd('0x43')]['id']}})[_0x20fd('0x25')](handleEntityNotFound(_0x1a74b5,null))[_0x20fd('0x25')](function(_0x25a358){if(_0x25a358){_0x36bd4c=_0x25a358;_0x310bfa[_0x20fd('0x30')]=_[_0x20fd('0x44')](db[_0x20fd('0x4a')][_0x20fd('0x2b')]);_0x310bfa[_0x20fd('0x2f')]=_[_0x20fd('0x44')](_0x3a620d[_0x20fd('0x2f')]);_0x310bfa[_0x20fd('0x38')]=_['intersection'](_0x310bfa[_0x20fd('0x30')],_0x310bfa[_0x20fd('0x2f')]);_0x3be654['attributes']=_[_0x20fd('0x45')](_0x310bfa[_0x20fd('0x30')],qs[_0x20fd('0x31')](_0x3a620d[_0x20fd('0x2f')][_0x20fd('0x31')]));_0x3be654[_0x20fd('0x32')]=_0x3be654['attributes'][_0x20fd('0x33')]?_0x3be654[_0x20fd('0x32')]:_0x310bfa[_0x20fd('0x30')];_0x3be654[_0x20fd('0x53')]=qs[_0x20fd('0x36')](_0x3a620d[_0x20fd('0x2f')]['sort']);_0x3be654['where']=qs[_0x20fd('0x38')](_[_0x20fd('0x39')](_0x3a620d[_0x20fd('0x2f')],_0x310bfa[_0x20fd('0x38')]));if(_0x3a620d[_0x20fd('0x2f')][_0x20fd('0x3a')]){_0x3be654['where']=_['merge'](_0x3be654[_0x20fd('0x37')],{'$or':_['map'](_0x3be654[_0x20fd('0x32')],function(_0x23f28d){var _0x8048af={};_0x8048af[_0x23f28d]={'$like':'%'+_0x3a620d[_0x20fd('0x2f')][_0x20fd('0x3a')]+'%'};return _0x8048af;})});}if(_0x3a620d['query']['$gte']){var _0x1468c3=_0x3a620d[_0x20fd('0x2f')][_0x20fd('0x57')][_0x20fd('0x58')](',');var _0x148ea0={};_0x148ea0[_0x1468c3[0x0]]={'$gte':moment(_0x1468c3[0x1])[_0x20fd('0x59')](_0x20fd('0x5a'))};_0x3be654[_0x20fd('0x37')]=_['merge'](_0x3be654['where'],_0x148ea0);}_0x3be654=_['merge']({},_0x3be654,_0x3a620d[_0x20fd('0x5b')]);return _0x36bd4c[_0x20fd('0x56')](_0x3be654);}})[_0x20fd('0x25')](function(_0xfd2f87){if(_0xfd2f87){_0x1336f1=_0xfd2f87[_0x20fd('0x33')];if(!_0x3a620d[_0x20fd('0x2f')][_0x20fd('0x34')](_0x20fd('0x35'))){_0x3be654['limit']=qs[_0x20fd('0x1d')](_0x3a620d[_0x20fd('0x2f')][_0x20fd('0x1d')]);_0x3be654[_0x20fd('0x1b')]=qs[_0x20fd('0x1b')](_0x3a620d[_0x20fd('0x2f')][_0x20fd('0x1b')]);}return _0x36bd4c[_0x20fd('0x56')](_0x3be654);}})['then'](function(_0x5f496d){if(_0x5f496d){return _0x5f496d?{'count':_0x1336f1,'rows':_0x5f496d}:null;}})['then'](respondWithResult(_0x1a74b5,null))[_0x20fd('0x41')](handleError(_0x1a74b5,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index cf5bbb2..77e5f50 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 _0x736c=['hasOwnProperty','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x54f3e8,_0x3ed493){var _0x267b37=function(_0x58247e){while(--_0x58247e){_0x54f3e8['push'](_0x54f3e8['shift']());}};_0x267b37(++_0x3ed493);}(_0x736c,0x190));var _0xc736=function(_0x11a7c9,_0x2de6e8){_0x11a7c9=_0x11a7c9-0x0;var _0x2bf3d8=_0x736c[_0x11a7c9];return _0x2bf3d8;};'use strict';var EventEmitter=require(_0xc736('0x0'));var ChatGroup=require(_0xc736('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xc736('0x2')](0x0);var events={'afterCreate':_0xc736('0x3'),'afterUpdate':_0xc736('0x4'),'afterDestroy':_0xc736('0x5')};function emitEvent(_0x23f8c1){return function(_0x1a96b8,_0xb57164,_0x3f00f0){ChatGroupEvents['emit'](_0x23f8c1+':'+_0x1a96b8['id'],_0x1a96b8);ChatGroupEvents['emit'](_0x23f8c1,_0x1a96b8);_0x3f00f0(null);};}for(var e in events){if(events[_0xc736('0x6')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
+var _0x13c8=['ChatGroup','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x2303ff,_0x3c4b05){var _0x3983c8=function(_0x57085c){while(--_0x57085c){_0x2303ff['push'](_0x2303ff['shift']());}};_0x3983c8(++_0x3c4b05);}(_0x13c8,0xa0));var _0x813c=function(_0x50e40b,_0x338d17){_0x50e40b=_0x50e40b-0x0;var _0x2608b7=_0x13c8[_0x50e40b];return _0x2608b7;};'use strict';var EventEmitter=require(_0x813c('0x0'));var ChatGroup=require(_0x813c('0x1'))['db'][_0x813c('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x813c('0x3'),'afterDestroy':_0x813c('0x4')};function emitEvent(_0x193021){return function(_0x267c0b,_0x542451,_0x52f03f){ChatGroupEvents[_0x813c('0x5')](_0x193021+':'+_0x267c0b['id'],_0x267c0b);ChatGroupEvents[_0x813c('0x5')](_0x193021,_0x267c0b);_0x52f03f(null);};}for(var e in events){if(events[_0x813c('0x6')](e)){var event=events[e];ChatGroup[_0x813c('0x7')](e,emitEvent(event));}}module[_0x813c('0x8')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 849552d..15eaa36 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 _0xf3f4=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash'];(function(_0x4dfc30,_0x2f8ea3){var _0x4cabbe=function(_0xe9957c){while(--_0xe9957c){_0x4dfc30['push'](_0x4dfc30['shift']());}};_0x4cabbe(++_0x2f8ea3);}(_0xf3f4,0xed));var _0x4f3f=function(_0x24a782,_0x540835){_0x24a782=_0x24a782-0x0;var _0x5a1ac2=_0xf3f4[_0x24a782];return _0x5a1ac2;};'use strict';var _=require(_0x4f3f('0x0'));var util=require(_0x4f3f('0x1'));var logger=require(_0x4f3f('0x2'))(_0x4f3f('0x3'));var moment=require(_0x4f3f('0x4'));var BPromise=require(_0x4f3f('0x5'));var rp=require(_0x4f3f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4f3f('0x7'));var config=require(_0x4f3f('0x8'));var attributes=require(_0x4f3f('0x9'));module[_0x4f3f('0xa')]=function(_0x339da9,_0x178cae){return _0x339da9[_0x4f3f('0xb')](_0x4f3f('0xc'),attributes,{'tableName':_0x4f3f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x429a=['api','moment','path','rimraf','../../config/environment','./chatGroup.attributes','define','ChatGroup','chat_groups','util','../../config/logger'];(function(_0x1b1355,_0x2db1ed){var _0x1f98e5=function(_0x46915c){while(--_0x46915c){_0x1b1355['push'](_0x1b1355['shift']());}};_0x1f98e5(++_0x2db1ed);}(_0x429a,0x11c));var _0xa429=function(_0x99ff94,_0x47a1b1){_0x99ff94=_0x99ff94-0x0;var _0x1b5bc0=_0x429a[_0x99ff94];return _0x1b5bc0;};'use strict';var _=require('lodash');var util=require(_0xa429('0x0'));var logger=require(_0xa429('0x1'))(_0xa429('0x2'));var moment=require(_0xa429('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa429('0x4'));var rimraf=require(_0xa429('0x5'));var config=require(_0xa429('0x6'));var attributes=require(_0xa429('0x7'));module['exports']=function(_0x349284,_0x5b0bca){return _0x349284[_0xa429('0x8')](_0xa429('0x9'),attributes,{'tableName':_0xa429('0xa'),'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 c1e0a56..97dfa53 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 _0x691a=['message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','localhost','socket.io-emitter','register','request','ChatGroup,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x1a86a0,_0x642b14){var _0x3bb799=function(_0x4e331d){while(--_0x4e331d){_0x1a86a0['push'](_0x1a86a0['shift']());}};_0x3bb799(++_0x642b14);}(_0x691a,0x1df));var _0xa691=function(_0x32ae21,_0x1f6cc6){_0x32ae21=_0x32ae21-0x0;var _0x3ce1f7=_0x691a[_0x32ae21];return _0x3ce1f7;};'use strict';var _=require(_0xa691('0x0'));var util=require(_0xa691('0x1'));var moment=require(_0xa691('0x2'));var BPromise=require(_0xa691('0x3'));var rs=require(_0xa691('0x4'));var fs=require('fs');var Redis=require(_0xa691('0x5'));var db=require(_0xa691('0x6'))['db'];var utils=require(_0xa691('0x7'));var logger=require(_0xa691('0x8'))(_0xa691('0x9'));var config=require('../../config/environment');var jayson=require(_0xa691('0xa'));var client=jayson[_0xa691('0xb')]['http']({'port':0x232a});config[_0xa691('0xc')]=_['defaults'](config[_0xa691('0xc')],{'host':_0xa691('0xd'),'port':0x18eb});var socket=require(_0xa691('0xe'))(new Redis(config[_0xa691('0xc')]));require('./chatGroup.socket')[_0xa691('0xf')](socket);function respondWithRpcPromise(_0x3152dd,_0x843e99,_0x5058d2){return new BPromise(function(_0x457d80,_0x45556d){return client[_0xa691('0x10')](_0x3152dd,_0x5058d2)['then'](function(_0x17c404){logger['info'](_0xa691('0x11'),_0x843e99,'request\x20sent');logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x843e99,_0xa691('0x12'),JSON[_0xa691('0x13')](_0x17c404));if(_0x17c404[_0xa691('0x14')]){if(_0x17c404[_0xa691('0x14')]['code']===0x1f4){logger[_0xa691('0x14')](_0xa691('0x11'),_0x843e99,_0x17c404[_0xa691('0x14')][_0xa691('0x15')]);return _0x45556d(_0x17c404['error'][_0xa691('0x15')]);}logger[_0xa691('0x14')]('ChatGroup,\x20%s,\x20%s',_0x843e99,_0x17c404[_0xa691('0x14')][_0xa691('0x15')]);return _0x457d80(_0x17c404[_0xa691('0x14')][_0xa691('0x15')]);}else{logger[_0xa691('0x16')](_0xa691('0x11'),_0x843e99,_0xa691('0x12'));_0x457d80(_0x17c404[_0xa691('0x17')][_0xa691('0x15')]);}})[_0xa691('0x18')](function(_0x1ab037){logger['error']('ChatGroup,\x20%s,\x20%s',_0x843e99,_0x1ab037);_0x45556d(_0x1ab037);});});}
\ No newline at end of file
+var _0x9c5b=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./chatGroup.socket','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','lodash'];(function(_0x2b5717,_0x4e06b9){var _0x5db8a3=function(_0x480509){while(--_0x480509){_0x2b5717['push'](_0x2b5717['shift']());}};_0x5db8a3(++_0x4e06b9);}(_0x9c5b,0x1cb));var _0xb9c5=function(_0x58a703,_0xef259b){_0x58a703=_0x58a703-0x0;var _0x597714=_0x9c5b[_0x58a703];return _0x597714;};'use strict';var _=require(_0xb9c5('0x0'));var util=require('util');var moment=require(_0xb9c5('0x1'));var BPromise=require('bluebird');var rs=require(_0xb9c5('0x2'));var fs=require('fs');var Redis=require(_0xb9c5('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb9c5('0x4'));var logger=require(_0xb9c5('0x5'))(_0xb9c5('0x6'));var config=require(_0xb9c5('0x7'));var jayson=require(_0xb9c5('0x8'));var client=jayson['client'][_0xb9c5('0x9')]({'port':0x232a});config[_0xb9c5('0xa')]=_['defaults'](config[_0xb9c5('0xa')],{'host':_0xb9c5('0xb'),'port':0x18eb});var socket=require(_0xb9c5('0xc'))(new Redis(config['redis']));require(_0xb9c5('0xd'))['register'](socket);function respondWithRpcPromise(_0x543987,_0x25f973,_0x5107cf){return new BPromise(function(_0x4118df,_0x354f57){return client[_0xb9c5('0xe')](_0x543987,_0x5107cf)['then'](function(_0x380357){logger[_0xb9c5('0xf')](_0xb9c5('0x10'),_0x25f973,_0xb9c5('0x11'));logger[_0xb9c5('0x12')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x25f973,_0xb9c5('0x11'),JSON['stringify'](_0x380357));if(_0x380357[_0xb9c5('0x13')]){if(_0x380357[_0xb9c5('0x13')][_0xb9c5('0x14')]===0x1f4){logger[_0xb9c5('0x13')](_0xb9c5('0x10'),_0x25f973,_0x380357[_0xb9c5('0x13')]['message']);return _0x354f57(_0x380357[_0xb9c5('0x13')][_0xb9c5('0x15')]);}logger[_0xb9c5('0x13')](_0xb9c5('0x10'),_0x25f973,_0x380357[_0xb9c5('0x13')][_0xb9c5('0x15')]);return _0x4118df(_0x380357[_0xb9c5('0x13')]['message']);}else{logger[_0xb9c5('0xf')](_0xb9c5('0x10'),_0x25f973,_0xb9c5('0x11'));_0x4118df(_0x380357['result'][_0xb9c5('0x15')]);}})[_0xb9c5('0x16')](function(_0x3d8adf){logger[_0xb9c5('0x13')]('ChatGroup,\x20%s,\x20%s',_0x25f973,_0x3d8adf);_0x354f57(_0x3d8adf);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 4e966fe..8f7ef77 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 _0xfff2=['register','length','chatGroup:','save','remove','update','emit','removeListener'];(function(_0x16fef7,_0x2a39a8){var _0x415dea=function(_0x309a90){while(--_0x309a90){_0x16fef7['push'](_0x16fef7['shift']());}};_0x415dea(++_0x2a39a8);}(_0xfff2,0x9b));var _0x2fff=function(_0x268e8a,_0xab4b44){_0x268e8a=_0x268e8a-0x0;var _0x18e617=_0xfff2[_0x268e8a];return _0x18e617;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x2fff('0x0'),_0x2fff('0x1'),_0x2fff('0x2')];function createListener(_0x53d3da,_0x46b60b){return function(_0x3a6e08){_0x46b60b[_0x2fff('0x3')](_0x53d3da,_0x3a6e08);};}function removeListener(_0x327a2a,_0x485e43){return function(){ChatGroupEvents[_0x2fff('0x4')](_0x327a2a,_0x485e43);};}exports[_0x2fff('0x5')]=function(_0x237542){for(var _0x3bfa1f=0x0,_0x46f95e=events[_0x2fff('0x6')];_0x3bfa1f<_0x46f95e;_0x3bfa1f++){var _0x5264b6=events[_0x3bfa1f];var _0x354a3d=createListener(_0x2fff('0x7')+_0x5264b6,_0x237542);ChatGroupEvents['on'](_0x5264b6,_0x354a3d);}};
\ No newline at end of file
+var _0x6dfb=['remove','emit','removeListener','register','length','./chatGroup.events','save'];(function(_0x4b9464,_0xc0b9cc){var _0x29dfdf=function(_0x705cce){while(--_0x705cce){_0x4b9464['push'](_0x4b9464['shift']());}};_0x29dfdf(++_0xc0b9cc);}(_0x6dfb,0xa6));var _0xb6df=function(_0x2ef1b8,_0x509ef3){_0x2ef1b8=_0x2ef1b8-0x0;var _0x59e2b6=_0x6dfb[_0x2ef1b8];return _0x59e2b6;};'use strict';var ChatGroupEvents=require(_0xb6df('0x0'));var events=[_0xb6df('0x1'),_0xb6df('0x2'),'update'];function createListener(_0x5eb4e1,_0x43e192){return function(_0x2e03af){_0x43e192[_0xb6df('0x3')](_0x5eb4e1,_0x2e03af);};}function removeListener(_0x1584c5,_0x14f45a){return function(){ChatGroupEvents[_0xb6df('0x4')](_0x1584c5,_0x14f45a);};}exports[_0xb6df('0x5')]=function(_0x2fd75a){for(var _0x64c134=0x0,_0x444d02=events[_0xb6df('0x6')];_0x64c134<_0x444d02;_0x64c134++){var _0x427221=events[_0x64c134];var _0x385ad8=createListener('chatGroup:'+_0x427221,_0x2fd75a);ChatGroupEvents['on'](_0x427221,_0x385ad8);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index a6f4873..992ecea 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 _0x525f=['path','connect-timeout','express','Router','../../components/interaction/service','./chatGroup.controller','get','isAuthenticated','describe','/:id','show','/:id/unread','getUnread','/:id/messages','post','create','/:id/members','addMembers','put','delete','removeMembers','exports','multer'];(function(_0x73fc3e,_0x29d104){var _0x37f65a=function(_0x24fc0d){while(--_0x24fc0d){_0x73fc3e['push'](_0x73fc3e['shift']());}};_0x37f65a(++_0x29d104);}(_0x525f,0x19d));var _0xf525=function(_0x2de03a,_0x2038f7){_0x2de03a=_0x2de03a-0x0;var _0x31f74d=_0x525f[_0x2de03a];return _0x31f74d;};'use strict';var multer=require(_0xf525('0x0'));var util=require('util');var path=require(_0xf525('0x1'));var timeout=require(_0xf525('0x2'));var express=require(_0xf525('0x3'));var router=express[_0xf525('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf525('0x5'));var config=require('../../config/environment');var controller=require(_0xf525('0x6'));router[_0xf525('0x7')]('/',auth[_0xf525('0x8')](),controller['index']);router[_0xf525('0x7')]('/describe',auth[_0xf525('0x8')](),controller[_0xf525('0x9')]);router[_0xf525('0x7')](_0xf525('0xa'),auth['isAuthenticated'](),controller[_0xf525('0xb')]);router[_0xf525('0x7')](_0xf525('0xc'),auth[_0xf525('0x8')](),controller[_0xf525('0xd')]);router[_0xf525('0x7')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xf525('0x7')](_0xf525('0xe'),auth[_0xf525('0x8')](),controller['getMessages']);router[_0xf525('0xf')]('/',auth['isAuthenticated'](),controller[_0xf525('0x10')]);router[_0xf525('0xf')](_0xf525('0x11'),auth[_0xf525('0x8')](),controller[_0xf525('0x12')]);router[_0xf525('0xf')](_0xf525('0xe'),auth[_0xf525('0x8')](),controller['addMessage']);router[_0xf525('0x13')](_0xf525('0xa'),auth[_0xf525('0x8')](),controller['update']);router[_0xf525('0x14')](_0xf525('0xa'),auth['isAuthenticated'](),controller['destroy']);router[_0xf525('0x14')](_0xf525('0x11'),auth[_0xf525('0x8')](),controller[_0xf525('0x15')]);module[_0xf525('0x16')]=router;
\ No newline at end of file
+var _0x881f=['../../components/interaction/service','../../config/environment','./chatGroup.controller','get','/describe','isAuthenticated','/:id','show','/:id/unread','getUnread','/:id/members','/:id/messages','getMessages','post','addMembers','addMessage','put','update','delete','removeMembers','exports','multer','Router','fs-extra','../../components/auth/service'];(function(_0x11f5ff,_0xa0ef18){var _0x46eefb=function(_0x51872a){while(--_0x51872a){_0x11f5ff['push'](_0x11f5ff['shift']());}};_0x46eefb(++_0xa0ef18);}(_0x881f,0x15a));var _0xf881=function(_0x3dec16,_0x1eb623){_0x3dec16=_0x3dec16-0x0;var _0xec31c3=_0x881f[_0x3dec16];return _0xec31c3;};'use strict';var multer=require(_0xf881('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf881('0x1')]();var fs_extra=require(_0xf881('0x2'));var auth=require(_0xf881('0x3'));var interaction=require(_0xf881('0x4'));var config=require(_0xf881('0x5'));var controller=require(_0xf881('0x6'));router[_0xf881('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf881('0x7')](_0xf881('0x8'),auth[_0xf881('0x9')](),controller['describe']);router[_0xf881('0x7')](_0xf881('0xa'),auth[_0xf881('0x9')](),controller[_0xf881('0xb')]);router[_0xf881('0x7')](_0xf881('0xc'),auth[_0xf881('0x9')](),controller[_0xf881('0xd')]);router['get'](_0xf881('0xe'),auth['isAuthenticated'](),controller['getMembers']);router[_0xf881('0x7')](_0xf881('0xf'),auth[_0xf881('0x9')](),controller[_0xf881('0x10')]);router[_0xf881('0x11')]('/',auth[_0xf881('0x9')](),controller['create']);router[_0xf881('0x11')](_0xf881('0xe'),auth[_0xf881('0x9')](),controller[_0xf881('0x12')]);router['post']('/:id/messages',auth['isAuthenticated'](),controller[_0xf881('0x13')]);router[_0xf881('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xf881('0x15')]);router[_0xf881('0x16')](_0xf881('0xa'),auth[_0xf881('0x9')](),controller['destroy']);router[_0xf881('0x16')]('/:id/members',auth[_0xf881('0x9')](),controller[_0xf881('0x17')]);module[_0xf881('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 566868b..f4bbd6c 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 _0xc2da=['long','out','sequelize','BOOLEAN','ENUM','thumb','star','TEXT','STRING','DATE'];(function(_0x5c9c9,_0x38e3fe){var _0x1381b9=function(_0x63adf7){while(--_0x63adf7){_0x5c9c9['push'](_0x5c9c9['shift']());}};_0x1381b9(++_0x38e3fe);}(_0xc2da,0x124));var _0xac2d=function(_0x4fd791,_0x180648){_0x4fd791=_0x4fd791-0x0;var _0x30c89e=_0xc2da[_0x4fd791];return _0x30c89e;};'use strict';var Sequelize=require(_0xac2d('0x0'));module['exports']={'closed':{'type':Sequelize[_0xac2d('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xac2d('0x2')]('star',_0xac2d('0x3')),'defaultValue':_0xac2d('0x4')},'ratingMessage':{'type':Sequelize[_0xac2d('0x5')]},'pathTranscript':{'type':Sequelize[_0xac2d('0x5')]},'mailTranscript':{'type':Sequelize[_0xac2d('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xac2d('0x7')]},'disposition':{'type':Sequelize[_0xac2d('0x6')]},'secondDisposition':{'type':Sequelize[_0xac2d('0x6')]},'thirdDisposition':{'type':Sequelize[_0xac2d('0x6')]},'note':{'type':Sequelize[_0xac2d('0x6')]},'browserName':{'type':Sequelize[_0xac2d('0x6')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0xac2d('0x6')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0xac2d('0x6')]},'deviceType':{'type':Sequelize[_0xac2d('0x6')]},'referer':{'type':Sequelize[_0xac2d('0x5')]},'customerIp':{'type':Sequelize[_0xac2d('0x6')]},'formData':{'type':Sequelize[_0xac2d('0x5')](_0xac2d('0x8'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xac2d('0x2')]('in',_0xac2d('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xac2d('0x6')]},'customerPort':{'type':Sequelize[_0xac2d('0x6')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0xac2d('0x1')],'defaultValue':![]}};
\ No newline at end of file
+var _0x2e21=['thumb','star','TEXT','STRING','DATE','out','sequelize','exports','BOOLEAN','ENUM'];(function(_0x2d8476,_0x38f0a2){var _0x346611=function(_0x4d61e5){while(--_0x4d61e5){_0x2d8476['push'](_0x2d8476['shift']());}};_0x346611(++_0x38f0a2);}(_0x2e21,0xba));var _0x12e2=function(_0x212237,_0x2365e1){_0x212237=_0x212237-0x0;var _0x2ae88f=_0x2e21[_0x212237];return _0x2ae88f;};'use strict';var Sequelize=require(_0x12e2('0x0'));module[_0x12e2('0x1')]={'closed':{'type':Sequelize[_0x12e2('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x12e2('0x3')]('star',_0x12e2('0x4')),'defaultValue':_0x12e2('0x5')},'ratingMessage':{'type':Sequelize[_0x12e2('0x6')]},'pathTranscript':{'type':Sequelize[_0x12e2('0x6')]},'mailTranscript':{'type':Sequelize[_0x12e2('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x12e2('0x8')]},'disposition':{'type':Sequelize[_0x12e2('0x7')]},'secondDisposition':{'type':Sequelize[_0x12e2('0x7')]},'thirdDisposition':{'type':Sequelize[_0x12e2('0x7')]},'note':{'type':Sequelize[_0x12e2('0x7')]},'browserName':{'type':Sequelize[_0x12e2('0x7')]},'browserVersion':{'type':Sequelize[_0x12e2('0x7')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x12e2('0x7')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x12e2('0x7')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x12e2('0x6')]},'customerIp':{'type':Sequelize[_0x12e2('0x7')]},'formData':{'type':Sequelize[_0x12e2('0x6')]('long')},'read1stAt':{'type':Sequelize[_0x12e2('0x8')]},'lastMsgAt':{'type':Sequelize[_0x12e2('0x8')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x12e2('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x12e2('0x7')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x12e2('0x2')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 2a64853..1b0bfc3 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 _0xd797=['abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','basename','filename','attachmentDownload','Unauthorized','Attachment','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','server/files/chat/upload/','format','transcript-%s.txt','now','ChatMessage','Messages','User','agentAlias','System','customer','%s%d','ContactId','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','CloudProvider','SendMail','Smtp','mailTranscript','Mail\x20Transcript','ids','omit','hasOwnProperty','nolimit','order','sort','pick','ChatInteractionId','where','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','rows','includeAgent','push','addTags','setTags','emit','removeTags','unix','toString','server','files','attachments','transcript-%d-%s.zip','firstName','read','Account','Owner','get','mkdirSync','Chat','N.A.','closedAt','referer','customerIp','customerPort','tail','existsSync','createReadStream','out','lastName','downloadInteraction.ejs','createPdfFromHTML','err','request-promise','moment','bluebird','mustache','util','path','ejs','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','client','http','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','update','then','destroy','stack','name','send','merge','contact','interaction','account','index','map','ChatInteraction','rawAttributes','fieldName','type','key','getOptions','query','params','model','keys','filters','intersection','attributes','fields','length','include','options','find','create','body','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','user','fullname','email','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Sequelize','customUpdate','CmContact','Contact'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0xd797,0x11d));var _0x7d79=function(_0x2e7934,_0x4077f6){_0x2e7934=_0x2e7934-0x0;var _0x1878d0=_0xd797[_0x2e7934];return _0x1878d0;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var rp=require(_0x7d79('0x0'));var moment=require(_0x7d79('0x1'));var BPromise=require(_0x7d79('0x2'));var Mustache=require(_0x7d79('0x3'));var util=require(_0x7d79('0x4'));var path=require(_0x7d79('0x5'));var ejs=require(_0x7d79('0x6'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var pdf=require('../../components/export/pdf');var logger=require(_0x7d79('0x7'))(_0x7d79('0x8'));var config=require(_0x7d79('0x9'));var db=require('../../mysqldb')['db'];config[_0x7d79('0xa')]=_[_0x7d79('0xb')](config['redis'],{'host':_0x7d79('0xc'),'port':0x18eb});var socket=require(_0x7d79('0xd'))(new Redis(config[_0x7d79('0xa')]));require('./chatInteraction.socket')[_0x7d79('0xe')](socket);var jayson=require('jayson/promise');var client=jayson[_0x7d79('0xf')][_0x7d79('0x10')]({'port':0x232b});var client9004=jayson[_0x7d79('0xf')][_0x7d79('0x10')]({'port':0x232c});function respondWithRpcPromise(_0x18ad62,_0x55c114,_0x4ff437,_0x5481ec){return new BPromise(function(_0x5f13ab,_0x3e46a6){var _0x3ce71d=_0x5481ec||client;return _0x3ce71d['request'](_0x18ad62,_0x4ff437)['then'](function(_0x15b791){logger[_0x7d79('0x11')](_0x7d79('0x12'),_0x55c114,_0x7d79('0x13'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x55c114,_0x7d79('0x13'),JSON['stringify'](_0x15b791));if(_0x15b791[_0x7d79('0x14')]){if(_0x15b791[_0x7d79('0x14')][_0x7d79('0x15')]===0x1f4){logger[_0x7d79('0x14')](_0x7d79('0x12'),_0x55c114,_0x15b791[_0x7d79('0x14')][_0x7d79('0x16')]);return _0x3e46a6(_0x15b791[_0x7d79('0x14')][_0x7d79('0x16')]);}logger[_0x7d79('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x55c114,_0x15b791['error'][_0x7d79('0x16')]);return _0x5f13ab(_0x15b791['error'][_0x7d79('0x16')]);}else{logger[_0x7d79('0x11')](_0x7d79('0x12'),_0x55c114,_0x7d79('0x13'));_0x5f13ab(_0x15b791['result'][_0x7d79('0x16')]);}})[_0x7d79('0x17')](function(_0x520a14){logger['error'](_0x7d79('0x12'),_0x55c114,_0x520a14);_0x3e46a6(_0x520a14);});});}function respondWithStatusCode(_0x46fafa,_0x42439e){_0x42439e=_0x42439e||0xcc;return function(_0x7a8e2b){if(_0x7a8e2b){return _0x46fafa[_0x7d79('0x18')](_0x42439e);}return _0x46fafa[_0x7d79('0x19')](_0x42439e)[_0x7d79('0x1a')]();};}function respondWithResult(_0x252cb2,_0x1cc934){_0x1cc934=_0x1cc934||0xc8;return function(_0x118bdf){if(_0x118bdf){return _0x252cb2[_0x7d79('0x19')](_0x1cc934)[_0x7d79('0x1b')](_0x118bdf);}};}function respondWithFilteredResult(_0x1ffc8c,_0x10c28c){return function(_0x55a8ac){if(_0x55a8ac){var _0x1741b4=typeof _0x10c28c[_0x7d79('0x1c')]===_0x7d79('0x1d')&&typeof _0x10c28c[_0x7d79('0x1e')]==='undefined';var _0x74df63=_0x55a8ac[_0x7d79('0x1f')];var _0x1cb5e2=_0x1741b4?0x0:_0x10c28c[_0x7d79('0x1c')];var _0x1f81a4=_0x1741b4?_0x55a8ac['count']:_0x10c28c[_0x7d79('0x1c')]+_0x10c28c[_0x7d79('0x1e')];var _0x1288bf;if(_0x1f81a4>=_0x74df63){_0x1f81a4=_0x74df63;_0x1288bf=0xc8;}else{_0x1288bf=0xce;}_0x1ffc8c['status'](_0x1288bf);return _0x1ffc8c[_0x7d79('0x20')]('Content-Range',_0x1cb5e2+'-'+_0x1f81a4+'/'+_0x74df63)[_0x7d79('0x1b')](_0x55a8ac);}return null;};}function saveUpdates(_0x522b3b){return function(_0x37e4b7){if(_0x37e4b7){return _0x37e4b7[_0x7d79('0x21')](_0x522b3b)[_0x7d79('0x22')](function(_0x3f2958){return _0x3f2958;});}return null;};}function removeEntity(_0x4c83e7){return function(_0x1de873){if(_0x1de873){return _0x1de873[_0x7d79('0x23')]()['then'](function(){_0x4c83e7[_0x7d79('0x19')](0xcc)[_0x7d79('0x1a')]();});}};}function handleEntityNotFound(_0x1a317c){return function(_0x37d7ba){if(!_0x37d7ba){_0x1a317c[_0x7d79('0x18')](0x194);}return _0x37d7ba;};}function handleError(_0x42ae4f,_0x320d92){_0x320d92=_0x320d92||0x1f4;return function(_0x2282dd){logger[_0x7d79('0x14')](_0x2282dd[_0x7d79('0x24')]);if(_0x2282dd[_0x7d79('0x25')]){delete _0x2282dd[_0x7d79('0x25')];}_0x42ae4f[_0x7d79('0x19')](_0x320d92)[_0x7d79('0x26')](_0x2282dd);};}function getMustacheRender(_0x573b7d,_0x2b027b){return Mustache['render'](_0x573b7d,_[_0x7d79('0x27')](_0x2b027b['body'],{'contact':_0x2b027b[_0x7d79('0x28')],'message':_0x2b027b[_0x7d79('0x16')],'agent':_0x2b027b['agent'],'interaction':_0x2b027b[_0x7d79('0x29')],'account':_0x2b027b[_0x7d79('0x2a')]}))||'';}exports[_0x7d79('0x2b')]=function(_0x2b2937,_0x568368){var _0x55b74c={};var _0xaf946c=_[_0x7d79('0x2c')](db[_0x7d79('0x2d')][_0x7d79('0x2e')],function(_0x26515f){return{'name':_0x26515f[_0x7d79('0x2f')],'type':_0x26515f[_0x7d79('0x30')][_0x7d79('0x31')]};});_0x55b74c=qs[_0x7d79('0x32')](_0xaf946c,_0x2b2937);return interaction['findAll']('chat',_0x2b2937[_0x7d79('0x33')],_0x2b2937['user'],_0x55b74c,_0xaf946c)[_0x7d79('0x22')](respondWithFilteredResult(_0x568368,_0x55b74c))[_0x7d79('0x17')](handleError(_0x568368,null));};exports['show']=function(_0x6b26d2,_0x5b2546){var _0x4b5928={'raw':![],'where':{'id':_0x6b26d2[_0x7d79('0x34')]['id']}},_0x4ad10d={};_0x4ad10d[_0x7d79('0x35')]=_[_0x7d79('0x36')](db['ChatInteraction'][_0x7d79('0x2e')]);_0x4ad10d[_0x7d79('0x33')]=_[_0x7d79('0x36')](_0x6b26d2[_0x7d79('0x33')]);_0x4ad10d[_0x7d79('0x37')]=_[_0x7d79('0x38')](_0x4ad10d[_0x7d79('0x35')],_0x4ad10d['query']);_0x4b5928[_0x7d79('0x39')]=_[_0x7d79('0x38')](_0x4ad10d[_0x7d79('0x35')],qs[_0x7d79('0x3a')](_0x6b26d2[_0x7d79('0x33')][_0x7d79('0x3a')]));_0x4b5928[_0x7d79('0x39')]=_0x4b5928['attributes'][_0x7d79('0x3b')]?_0x4b5928[_0x7d79('0x39')]:_0x4ad10d['model'];if(_0x6b26d2[_0x7d79('0x33')]['includeAll']){_0x4b5928[_0x7d79('0x3c')]=[{'all':!![]}];}_0x4b5928=_[_0x7d79('0x27')]({},_0x4b5928,_0x6b26d2[_0x7d79('0x3d')]);return db['ChatInteraction'][_0x7d79('0x3e')](_0x4b5928)[_0x7d79('0x22')](handleEntityNotFound(_0x5b2546,null))[_0x7d79('0x22')](respondWithResult(_0x5b2546,null))[_0x7d79('0x17')](handleError(_0x5b2546,null));};exports['create']=function(_0x22b3ce,_0xa1f3b5){return db[_0x7d79('0x2d')][_0x7d79('0x3f')](_0x22b3ce[_0x7d79('0x40')],{})[_0x7d79('0x22')](respondWithResult(_0xa1f3b5,0xc9))[_0x7d79('0x17')](handleError(_0xa1f3b5,null));};exports[_0x7d79('0x21')]=function(_0x9e784f,_0x4a4a2a){if(_0x9e784f[_0x7d79('0x40')]['id']){delete _0x9e784f[_0x7d79('0x40')]['id'];}return db[_0x7d79('0x2d')]['find']({'where':{'id':_0x9e784f['params']['id']}})[_0x7d79('0x22')](handleEntityNotFound(_0x4a4a2a,null))[_0x7d79('0x22')](saveUpdates(_0x9e784f[_0x7d79('0x40')],null))['then'](respondWithResult(_0x4a4a2a,null))[_0x7d79('0x17')](handleError(_0x4a4a2a,null));};exports[_0x7d79('0x23')]=function(_0x2b42a8,_0x279a5f){return db[_0x7d79('0x2d')][_0x7d79('0x3e')]({'where':{'id':_0x2b42a8[_0x7d79('0x34')]['id']}})[_0x7d79('0x22')](handleEntityNotFound(_0x279a5f,null))[_0x7d79('0x22')](removeEntity(_0x279a5f,null))[_0x7d79('0x17')](handleError(_0x279a5f,null));};exports[_0x7d79('0x41')]=function(_0x5b28ab,_0xee3d5e){return db[_0x7d79('0x2d')][_0x7d79('0x41')]()[_0x7d79('0x22')](respondWithResult(_0xee3d5e,null))['catch'](handleError(_0xee3d5e,null));};exports[_0x7d79('0x42')]=function(_0x2a4f9d,_0x2f2d9f){var _0x254e77=_0x2a4f9d['params']['id'];var _0xf513e2;var _0x5d72a9;var _0x4dd741;return db['ChatInteraction'][_0x7d79('0x43')]({'where':{'id':_0x254e77}})[_0x7d79('0x22')](function(_0x187e36){_0xf513e2=_0x187e36;return db[_0x7d79('0x44')][_0x7d79('0x43')]({'where':{'id':_0x187e36[_0x7d79('0x45')]},'attributes':['id',_0x7d79('0x46'),_0x7d79('0x47'),_0x7d79('0x48'),_0x7d79('0x49'),_0x7d79('0x4a')],'raw':!![]});})[_0x7d79('0x22')](function(_0x1fcdd3){if(_0x1fcdd3&&_0x1fcdd3[_0x7d79('0x46')]&&_0x1fcdd3[_0x7d79('0x47')]){_0x5d72a9=_0x1fcdd3;var _0x252378={'interaction':{'id':_0x254e77},'agent':{'id':_0x2a4f9d[_0x7d79('0x4b')]['id'],'name':_0x2a4f9d['user']['name'],'fullname':_0x2a4f9d[_0x7d79('0x4b')][_0x7d79('0x4c')],'email':_0x2a4f9d['user'][_0x7d79('0x4d')]},'contact':_0x2a4f9d['body'][_0x7d79('0x28')],'account':_0x2a4f9d[_0x7d79('0x40')]['account']};var _0x580cc3={'rejectUnauthorized':![],'method':'POST','url':_0x7d79('0x4e'),'headers':{'X-APIKEY':_0x1fcdd3[_0x7d79('0x46')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x2a4f9d[_0x7d79('0x4b')][_0x7d79('0x4d')]],'buttons':null,'topic':_0x5d72a9[_0x7d79('0x48')],'note':_[_0x7d79('0x4f')](_0x5d72a9[_0x7d79('0x49')])?null:getMustacheRender(_0x5d72a9[_0x7d79('0x49')],_0x252378),'metadata':null},'redirect':_0x7d79('0x50'),'json':!![]};try{if(!_['isNull'](_0x5d72a9[_0x7d79('0x4a')])){var _0x58edae=getMustacheRender(_0x5d72a9[_0x7d79('0x4a')],_0x252378);var _0x4e1126=JSON[_0x7d79('0x51')](_0x58edae);_0x580cc3[_0x7d79('0x40')][_0x7d79('0x52')]=_0x4e1126;}}catch(_0x38f31b){throw new db['Sequelize'][(_0x7d79('0x53'))](_0x7d79('0x54'));}return rp(_0x580cc3);}else{throw new db[(_0x7d79('0x55'))][(_0x7d79('0x53'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x7d79('0x22')](function(_0x2c344a){_0x4dd741=_0x2c344a;if(_0x4dd741['id']){var _0x1598c1={'body':_0x4dd741['join_url'],'ChatWebsiteId':_0x5d72a9['id'],'ChatInteractionId':_0xf513e2['id'],'direction':'out','UserId':_0x2a4f9d[_0x7d79('0x4b')]['id']};return db['ChatMessage'][_0x7d79('0x3f')](_0x1598c1,{});}else{throw new db[(_0x7d79('0x55'))][(_0x7d79('0x53'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x7d79('0x22')](function(){return _0xf513e2['updateAttributes']({'vidaooSessionId':_0x4dd741['id']});})[_0x7d79('0x22')](respondWithResult(_0x2f2d9f,null))[_0x7d79('0x17')](handleError(_0x2f2d9f,null));};exports[_0x7d79('0x56')]=function(_0x732bd6,_0x2f1fd9){if(_0x732bd6[_0x7d79('0x40')]['id']){delete _0x732bd6['body']['id'];}return db[_0x7d79('0x2d')]['find']({'where':{'id':_0x732bd6['params']['id']},'include':[{'model':db[_0x7d79('0x57')],'as':_0x7d79('0x58')}]})[_0x7d79('0x22')](handleEntityNotFound(_0x2f1fd9,null))[_0x7d79('0x22')](saveUpdates(_0x732bd6[_0x7d79('0x40')],null))['then'](respondWithResult(_0x2f1fd9,null))[_0x7d79('0x17')](handleError(_0x2f1fd9,null));};exports[_0x7d79('0x59')]=function(_0x17c7c9,_0x577343){if(_0x17c7c9[_0x7d79('0x40')]['id']){delete _0x17c7c9[_0x7d79('0x40')]['id'];}return db[_0x7d79('0x2d')][_0x7d79('0x3e')]({'where':{'id':_0x17c7c9['params']['id']}})[_0x7d79('0x22')](function(_0x51acac){if(!_0x51acac){logger[_0x7d79('0x14')](_0x7d79('0x5a'),_0x7d79('0x59'),0x194,_0x7d79('0x5b'));_0x577343[_0x7d79('0x18')](0x194);}else{if(_0x51acac[_0x7d79('0x5c')]){throw new db[(_0x7d79('0x55'))][(_0x7d79('0x53'))](_0x7d79('0x5d'));}}return _0x51acac;})[_0x7d79('0x22')](function(_0x2f9fb4){if(_0x2f9fb4){return _0x2f9fb4[_0x7d79('0x21')]({'closed':_0x17c7c9[_0x7d79('0x40')][_0x7d79('0x5e')],'disposition':_0x17c7c9[_0x7d79('0x40')][_0x7d79('0x5f')]})[_0x7d79('0x22')](function(_0x583608){return _0x583608;});}})[_0x7d79('0x22')](function(){return respondWithRpcPromise(_0x7d79('0x60'),_0x7d79('0x59'),_0x17c7c9[_0x7d79('0x40')],client9004);})[_0x7d79('0x22')](respondWithResult(_0x577343,null))[_0x7d79('0x17')](handleError(_0x577343,null));};exports[_0x7d79('0x61')]=function(_0x3d12d9,_0x168228){_0x3d12d9['body'][_0x7d79('0x25')]=_0x3d12d9[_0x7d79('0x62')]['originalname'];_0x3d12d9['body'][_0x7d79('0x63')]=_0x3d12d9[_0x7d79('0x62')][_0x7d79('0x64')];_0x3d12d9[_0x7d79('0x40')][_0x7d79('0x30')]=_0x3d12d9['file']['mimetype'];return db['Attachment'][_0x7d79('0x3f')](_0x3d12d9[_0x7d79('0x40')])[_0x7d79('0x22')](respondWithResult(_0x168228,0xc9))[_0x7d79('0x17')](handleError(_0x168228,null));};exports[_0x7d79('0x65')]=function(_0x5455da,_0x21c975){return db[_0x7d79('0x2d')][_0x7d79('0x43')]({'where':{'id':_0x5455da[_0x7d79('0x34')]['id']},'raw':!![]})[_0x7d79('0x22')](handleEntityNotFound(_0x21c975,null))[_0x7d79('0x22')](function(_0x41a863){if(_0x41a863){if(_0x41a863[_0x7d79('0x5e')]){return _0x21c975['status'](0x193)[_0x7d79('0x1b')]({'status':0x193,'message':_0x7d79('0x66')});}return db[_0x7d79('0x67')]['findOne']({'where':{'id':_0x5455da['query']['attachId']},'raw':!![]})['then'](handleEntityNotFound(_0x21c975,null));}})[_0x7d79('0x22')](function(_0x542b8f){if(_0x542b8f){var _0x46b330=_0x542b8f[_0x7d79('0x68')]!==null;var _0x430fa5=path[_0x7d79('0x69')](config[_0x7d79('0x6a')],_0x7d79('0x6b'));if(_0x46b330){_0x430fa5=path[_0x7d79('0x69')](_0x430fa5,_0x7d79('0x6c'));}var _0x598ddb=path[_0x7d79('0x69')](_0x430fa5,_0x542b8f['basename']);return _0x21c975[_0x7d79('0x6d')](_0x598ddb);}})[_0x7d79('0x17')](handleError(_0x21c975,null));};exports['close']=function(_0x4695ae,_0x33939c){var _0x307a49=null;var _0x461838=null;var _0x11116f=null;if(_0x4695ae['body']['id']){delete _0x4695ae[_0x7d79('0x40')]['id'];}if(_0x4695ae[_0x7d79('0x40')]['mailTranscript']){_0x11116f=path[_0x7d79('0x69')](config['root'],_0x7d79('0x6e'),util[_0x7d79('0x6f')](_0x7d79('0x70'),Date[_0x7d79('0x71')]()));_0x4695ae['body']['pathTranscript']=_0x11116f;}return db['ChatInteraction'][_0x7d79('0x3e')]({'where':{'id':_0x4695ae[_0x7d79('0x34')]['id']},'include':[{'model':db[_0x7d79('0x72')],'as':_0x7d79('0x73'),'include':[{'model':db[_0x7d79('0x74')],'as':_0x7d79('0x74')}]}]})[_0x7d79('0x22')](handleEntityNotFound(_0x33939c,null))['then'](saveUpdates(_0x4695ae['body'],null))['then'](function(_0x1f27a8){if(_0x1f27a8){_0x307a49=_0x1f27a8;return db[_0x7d79('0x44')][_0x7d79('0x3e')]({'where':{'id':_0x307a49[_0x7d79('0x45')]}});}})[_0x7d79('0x22')](function(_0x3015e0){if(_0x3015e0){_0x461838=_0x3015e0;return db[_0x7d79('0x57')][_0x7d79('0x3e')]({'where':{'id':_0x307a49['ContactId']}});}})['then'](function(_0x3a6845){if(_0x3a6845){if(_0x11116f){var _0x490d51=null;for(var _0x4f3b0b=0x1;_0x4f3b0b<_0x307a49[_0x7d79('0x73')][_0x7d79('0x3b')];++_0x4f3b0b){_0x490d51=_0x307a49[_0x7d79('0x73')][_0x4f3b0b];var _0xd55d37=_0x490d51[_0x7d79('0x5c')]?util['format']('%s%d',_0x461838[_0x7d79('0x75')],_0x490d51[_0x7d79('0x5c')]):_0x7d79('0x76');var _0x2052fd=_0x4695ae[_0x7d79('0x40')][_0x7d79('0x77')]||util[_0x7d79('0x6f')](_0x7d79('0x78'),'Visitor',_0x490d51[_0x7d79('0x79')]);switch(_0x461838['agentIdentifier']){case _0x7d79('0x7a'):_0xd55d37=_0x490d51['UserId']?util[_0x7d79('0x6f')](_0x7d79('0x78'),_0x461838[_0x7d79('0x75')],_0x490d51['UserId']):_0x7d79('0x76');break;case _0x7d79('0x7b'):_0xd55d37=_0x490d51['UserId']?_0x490d51['User'][_0x7d79('0x7c')]||_0x490d51[_0x7d79('0x74')]['fullname']:_0x7d79('0x76');break;case _0x7d79('0x7d'):_0xd55d37=_0x490d51[_0x7d79('0x5c')]?_0x490d51[_0x7d79('0x74')][_0x7d79('0x4c')]:'System';break;default:_0xd55d37=_0x490d51[_0x7d79('0x5c')]?util['format'](_0x7d79('0x78'),_0x461838['agentAlias'],_0x490d51[_0x7d79('0x5c')]):_0x7d79('0x76');}var _0x5f1865=util[_0x7d79('0x6f')](_0x7d79('0x7e'),moment(_0x490d51[_0x7d79('0x7f')])['format'](_0x7d79('0x80')),_0x490d51[_0x7d79('0x81')]==='in'?_0x2052fd:_0xd55d37,_0x490d51[_0x7d79('0x40')]);if(!_0x490d51[_0x7d79('0x82')]){fs[_0x7d79('0x83')](_0x11116f,_0x5f1865);}}return db[_0x7d79('0x84')][_0x7d79('0x43')]({'where':{'service':!![]},'include':[{'model':db[_0x7d79('0x85')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x7d79('0x86')],'as':_0x7d79('0x86'),'raw':!![]}]}]});}}})['then'](function(_0x1b46ff){if(!_0x1b46ff||!_0x1b46ff['Smtp']||!_0x4695ae['body'])return _0x307a49;var _0x69ea31=_0x1b46ff['getSmtpOptions']();return respondWithRpcPromise(_0x7d79('0x87'),'sendMail',{'account':_0x69ea31,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x1b46ff[_0x7d79('0x25')],_0x1b46ff['email']||_0x1b46ff[_0x7d79('0x88')][_0x7d79('0x4b')]),'to':_0x4695ae['body'][_0x7d79('0x89')],'subject':_0x7d79('0x8a'),'text':util[_0x7d79('0x6f')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x4695ae[_0x7d79('0x40')][_0x7d79('0x89')]),'attachments':[{'path':_0x11116f}]}})['then'](function(){return _0x307a49;})[_0x7d79('0x17')](function(_0x87e0ee){logger['error'](_0x87e0ee);});})[_0x7d79('0x22')](respondWithStatusCode(_0x33939c,0xc8))[_0x7d79('0x17')](handleError(_0x33939c,null));};exports['addMessage']=function(_0x3b69f5,_0x1fc8cb){return db[_0x7d79('0x72')][_0x7d79('0x3e')]({'where':{'id':_0x3b69f5[_0x7d79('0x34')]['id']}})[_0x7d79('0x22')](handleEntityNotFound(_0x1fc8cb,null))[_0x7d79('0x22')](function(_0x539709){if(_0x539709){return _0x539709['addMessage'](_0x3b69f5[_0x7d79('0x40')][_0x7d79('0x8b')],_[_0x7d79('0x8c')](_0x3b69f5[_0x7d79('0x40')],['ids','id'])||{});}})['then'](respondWithResult(_0x1fc8cb,null))[_0x7d79('0x17')](handleError(_0x1fc8cb,null));};exports['getMessages']=function(_0x1fc36b,_0x1db9d7){var _0x20d109={'raw':![],'where':{}};var _0x499846={};var _0x5b4b3f={'count':0x0,'rows':[]};return db[_0x7d79('0x2d')]['findOne']({'where':{'id':_0x1fc36b['params']['id']}})[_0x7d79('0x22')](handleEntityNotFound(_0x1db9d7,null))[_0x7d79('0x22')](function(_0x1504b0){if(_0x1504b0){_0x499846[_0x7d79('0x35')]=_['keys'](db[_0x7d79('0x72')]['rawAttributes']);_0x499846[_0x7d79('0x33')]=_[_0x7d79('0x36')](_0x1fc36b[_0x7d79('0x33')]);_0x499846[_0x7d79('0x37')]=_[_0x7d79('0x38')](_0x499846[_0x7d79('0x35')],_0x499846[_0x7d79('0x33')]);_0x20d109[_0x7d79('0x39')]=_[_0x7d79('0x38')](_0x499846[_0x7d79('0x35')],qs['fields'](_0x1fc36b[_0x7d79('0x33')][_0x7d79('0x3a')]));_0x20d109[_0x7d79('0x39')]=_0x20d109[_0x7d79('0x39')][_0x7d79('0x3b')]?_0x20d109[_0x7d79('0x39')]:_0x499846['model'];if(!_0x1fc36b[_0x7d79('0x33')][_0x7d79('0x8d')](_0x7d79('0x8e'))){_0x20d109['limit']=qs['limit'](_0x1fc36b[_0x7d79('0x33')][_0x7d79('0x1e')]);_0x20d109[_0x7d79('0x1c')]=qs[_0x7d79('0x1c')](_0x1fc36b[_0x7d79('0x33')][_0x7d79('0x1c')]);}_0x20d109[_0x7d79('0x8f')]=qs[_0x7d79('0x90')](_0x1fc36b[_0x7d79('0x33')][_0x7d79('0x90')]);_0x20d109['where']=qs[_0x7d79('0x37')](_[_0x7d79('0x91')](_0x1fc36b['query'],_0x499846[_0x7d79('0x37')]));_0x20d109['where'][_0x7d79('0x92')]=_0x1504b0['id'];if(_0x1fc36b[_0x7d79('0x33')]['filter']){_0x20d109[_0x7d79('0x93')]=_[_0x7d79('0x27')](_0x20d109[_0x7d79('0x93')],{'$or':_[_0x7d79('0x2c')](_0x20d109['attributes'],function(_0x4b3b65){var _0xb04d38={};_0xb04d38[_0x4b3b65]={'$like':'%'+_0x1fc36b['query'][_0x7d79('0x94')]+'%'};return _0xb04d38;})});}if(_0x1fc36b[_0x7d79('0x33')][_0x7d79('0x95')]){var _0x245823=_0x1fc36b[_0x7d79('0x33')][_0x7d79('0x95')][_0x7d79('0x96')](',');var _0x9648e9={};_0x9648e9[_0x245823[0x0]]={'$gte':moment(_0x245823[0x1])[_0x7d79('0x6f')](_0x7d79('0x97'))};_0x20d109[_0x7d79('0x93')]=_['merge'](_0x20d109[_0x7d79('0x93')],_0x9648e9);}_0x20d109=_[_0x7d79('0x27')]({},_0x20d109,_0x1fc36b[_0x7d79('0x3d')]);return db[_0x7d79('0x72')][_0x7d79('0x1f')]({'where':_0x20d109[_0x7d79('0x93')]})[_0x7d79('0x22')](function(_0x2e153e){_0x5b4b3f['count']=_0x2e153e;if(_0x1fc36b[_0x7d79('0x33')][_0x7d79('0x98')]){_0x20d109[_0x7d79('0x3c')]=[{'all':!![]}];}return db[_0x7d79('0x72')][_0x7d79('0x99')](_0x20d109);})[_0x7d79('0x22')](function(_0x3f40f0){_0x5b4b3f[_0x7d79('0x9a')]=_0x3f40f0;return _0x5b4b3f;});}})[_0x7d79('0x22')](respondWithFilteredResult(_0x1db9d7,_0x20d109))['catch'](handleError(_0x1db9d7,null));};exports['getMyMessages']=function(_0x2593c2,_0x26ab11){var _0x1daa8f={'where':{}},_0x592cf3={},_0x31fa3c={'count':0x0,'rows':[]};return db[_0x7d79('0x2d')][_0x7d79('0x43')]({'where':{'id':_0x2593c2[_0x7d79('0x34')]['id']}})[_0x7d79('0x22')](handleEntityNotFound(_0x26ab11,null))[_0x7d79('0x22')](function(_0x12d1fc){if(_0x12d1fc){_0x592cf3[_0x7d79('0x35')]=_['keys'](db[_0x7d79('0x72')][_0x7d79('0x2e')]);_0x592cf3[_0x7d79('0x33')]=_[_0x7d79('0x36')](_0x2593c2[_0x7d79('0x33')]);_0x592cf3[_0x7d79('0x37')]=_[_0x7d79('0x38')](_0x592cf3[_0x7d79('0x35')],_0x592cf3[_0x7d79('0x33')]);_0x1daa8f['attributes']=_[_0x7d79('0x38')](_0x592cf3[_0x7d79('0x35')],qs[_0x7d79('0x3a')](_0x2593c2['query'][_0x7d79('0x3a')]));_0x1daa8f['attributes']=_0x1daa8f[_0x7d79('0x39')][_0x7d79('0x3b')]?_0x1daa8f[_0x7d79('0x39')]:_0x592cf3['model'];if(!_0x2593c2[_0x7d79('0x33')][_0x7d79('0x8d')]('nolimit')){_0x1daa8f[_0x7d79('0x1e')]=qs[_0x7d79('0x1e')](_0x2593c2['query'][_0x7d79('0x1e')]);_0x1daa8f[_0x7d79('0x1c')]=qs['offset'](_0x2593c2['query'][_0x7d79('0x1c')]);}_0x1daa8f[_0x7d79('0x8f')]=qs[_0x7d79('0x90')](_0x2593c2['query'][_0x7d79('0x90')]);_0x1daa8f[_0x7d79('0x93')]=qs[_0x7d79('0x37')](_[_0x7d79('0x91')](_0x2593c2[_0x7d79('0x33')],_0x592cf3[_0x7d79('0x37')]));_0x1daa8f['where'][_0x7d79('0x92')]=_0x12d1fc['id'];if(_0x2593c2[_0x7d79('0x33')]['filter']){_0x1daa8f[_0x7d79('0x93')]=_[_0x7d79('0x27')](_0x1daa8f[_0x7d79('0x93')],{'$or':_[_0x7d79('0x2c')](_0x1daa8f[_0x7d79('0x39')],function(_0x2da5a1){var _0x49e2e1={};_0x49e2e1[_0x2da5a1]={'$like':'%'+_0x2593c2[_0x7d79('0x33')]['filter']+'%'};return _0x49e2e1;})});}_0x1daa8f[_0x7d79('0x93')][_0x7d79('0x82')]=![];if(_0x2593c2['query']['id']){_0x1daa8f[_0x7d79('0x93')]['id']={'$gt':_0x2593c2[_0x7d79('0x33')]['id']};}_0x1daa8f=_['merge']({},_0x1daa8f,_0x2593c2['options']);return db['ChatMessage'][_0x7d79('0x1f')]({'where':_0x1daa8f['where']})[_0x7d79('0x22')](function(_0x48b7b3){_0x31fa3c[_0x7d79('0x1f')]=_0x48b7b3;_0x1daa8f[_0x7d79('0x3c')]=[];if(_0x2593c2[_0x7d79('0x33')][_0x7d79('0x9b')]){_0x1daa8f['include'][_0x7d79('0x9c')]({'model':db['User'],'as':_0x7d79('0x74'),'attributes':['id',_0x7d79('0x4c'),'alias']});}if(_0x2593c2['query'][_0x7d79('0x98')]){_0x1daa8f[_0x7d79('0x3c')]=[{'all':!![]}];}return db[_0x7d79('0x72')][_0x7d79('0x99')](_0x1daa8f);})[_0x7d79('0x22')](function(_0x982dc2){_0x31fa3c['rows']=_0x982dc2;return _0x31fa3c;});}})[_0x7d79('0x22')](respondWithFilteredResult(_0x26ab11,_0x1daa8f))[_0x7d79('0x17')](handleError(_0x26ab11,null));};exports[_0x7d79('0x9d')]=function(_0x3c8c5d,_0x377061){return db[_0x7d79('0x2d')]['find']({'where':{'id':_0x3c8c5d[_0x7d79('0x34')]['id']}})[_0x7d79('0x22')](handleEntityNotFound(_0x377061,null))[_0x7d79('0x22')](function(_0x4062dd){if(_0x4062dd){return _0x4062dd[_0x7d79('0x9e')](_0x3c8c5d[_0x7d79('0x40')]['ids'],_[_0x7d79('0x8c')](_0x3c8c5d['body'],[_0x7d79('0x8b'),'id'])||{})['spread'](function(){return db['Tag'][_0x7d79('0x99')]({'attributes':['id',_0x7d79('0x25'),'color'],'where':{'id':_0x3c8c5d[_0x7d79('0x40')][_0x7d79('0x8b')]}});})[_0x7d79('0x22')](function(_0x261a12){socket[_0x7d79('0x9f')]('chatInteractionTags:save',{'id':Number(_0x3c8c5d[_0x7d79('0x34')]['id']),'tags':_0x261a12||[]});return{'id':Number(_0x3c8c5d['params']['id']),'tags':_0x261a12||[]};});}})[_0x7d79('0x22')](respondWithResult(_0x377061,null))['catch'](handleError(_0x377061,null));};exports['removeTags']=function(_0x3a3660,_0x15b165){return db['ChatInteraction'][_0x7d79('0x3e')]({'where':{'id':_0x3a3660[_0x7d79('0x34')]['id']}})[_0x7d79('0x22')](handleEntityNotFound(_0x15b165,null))[_0x7d79('0x22')](function(_0xf40df3){if(_0xf40df3){return _0xf40df3[_0x7d79('0xa0')](_0x3a3660[_0x7d79('0x33')][_0x7d79('0x8b')]);}})[_0x7d79('0x22')](respondWithStatusCode(_0x15b165,null))['catch'](handleError(_0x15b165,null));};exports['download']=function(_0x6950a9,_0x950808){var _0x5b4d3a=moment()[_0x7d79('0xa1')]()[_0x7d79('0xa2')]();var _0x33e957=path[_0x7d79('0x69')](config['root'],_0x7d79('0xa3'),_0x7d79('0xa4'),'tmp');var _0x10a125=path[_0x7d79('0x69')](config[_0x7d79('0x6a')],'server',_0x7d79('0xa4'),_0x7d79('0xa5'));var _0x2969ac=path['join'](_0x33e957,_0x5b4d3a);var _0x122aba=util[_0x7d79('0x6f')](_0x7d79('0xa6'),_0x6950a9[_0x7d79('0x34')]['id'],_0x5b4d3a);var _0x286b4=path['join'](_0x33e957,_0x122aba);var _0x29b433=[];_0x29b433[_0x7d79('0x9c')]({'model':db['User'],'as':_0x7d79('0x74'),'attributes':['id','fullname'],'raw':!![]});_0x29b433[_0x7d79('0x9c')]({'model':db['CmContact'],'as':'Contact','attributes':['id',_0x7d79('0xa7'),'lastName'],'raw':!![]});if(_0x6950a9['query'][_0x7d79('0xa5')]){_0x29b433[_0x7d79('0x9c')]({'model':db[_0x7d79('0x67')],'as':'Attachment','raw':!![]});}var _0x319df9=[{'model':db[_0x7d79('0x72')],'as':'Messages','attributes':['id',_0x7d79('0x40'),_0x7d79('0x7f'),_0x7d79('0x81'),_0x7d79('0x82'),_0x7d79('0xa8')],'include':_0x29b433}];_0x319df9['push']({'model':db[_0x7d79('0x44')],'as':_0x7d79('0xa9'),'attributes':['id','name']});_0x319df9['push']({'model':db['User'],'as':_0x7d79('0xaa'),'attributes':['id',_0x7d79('0x4c')]});return db[_0x7d79('0x2d')][_0x7d79('0x3e')]({'where':{'id':_0x6950a9[_0x7d79('0x34')]['id']},'include':_0x319df9})[_0x7d79('0x22')](handleEntityNotFound(_0x950808,null))[_0x7d79('0x22')](function(_0x31fda9){if(_0x31fda9){var _0x560c85=_0x31fda9[_0x7d79('0xab')]({'plain':!![]});fs[_0x7d79('0xac')](_0x2969ac);var _0x51073c={'channel':_0x7d79('0xad'),'account':_0x560c85[_0x7d79('0xa9')][_0x7d79('0x25')],'agent':_0x560c85['Owner']?_0x560c85[_0x7d79('0xaa')][_0x7d79('0x4c')]:_0x7d79('0xae'),'createdAt':moment(_0x560c85['createdAt'])[_0x7d79('0x6f')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x560c85[_0x7d79('0x5e')]?moment(_0x560c85[_0x7d79('0xaf')])[_0x7d79('0x6f')](_0x7d79('0x97'))[_0x7d79('0xa2')]():'','disposition':_0x560c85[_0x7d79('0x5f')],'chatInfo':{'browser':_0x560c85['browserName'],'os':_0x560c85['osName'],'referer':_0x560c85[_0x7d79('0xb0')],'customerIp':_0x560c85[_0x7d79('0xb1')],'customerPort':_0x560c85[_0x7d79('0xb2')]?_0x560c85['customerPort']:_0x7d79('0xae')},'messages':_(_0x560c85['Messages'])[_0x7d79('0xb3')]()[_0x7d79('0x94')]({'secret':![]})[_0x7d79('0x2c')](function(_0x453566){if(_0x453566['Attachment']){var _0x2ff0ca=path['join'](_0x10a125,_0x453566[_0x7d79('0x67')][_0x7d79('0x63')]);if(fs[_0x7d79('0xb4')](_0x2ff0ca)){fs[_0x7d79('0xb5')](_0x2ff0ca)['pipe'](fs['createWriteStream'](path[_0x7d79('0x69')](_0x2969ac,_0x453566['Attachment'][_0x7d79('0x63')])));}}return{'date':moment(_0x453566['createdAt'])[_0x7d79('0x6f')](_0x7d79('0x97'))[_0x7d79('0xa2')](),'sender':_0x453566[_0x7d79('0x81')]===_0x7d79('0xb6')?_0x453566[_0x7d79('0x74')]?_0x453566[_0x7d79('0x74')][_0x7d79('0x4c')]:'System':_0x453566[_0x7d79('0x58')][_0x7d79('0xa7')]+(_0x453566[_0x7d79('0x58')][_0x7d79('0xb7')]?'\x20'+_0x453566[_0x7d79('0x58')]['lastName']:''),'body':_0x453566[_0x7d79('0x67')]?_0x453566[_0x7d79('0x67')][_0x7d79('0x63')]:_0x453566[_0x7d79('0x40')],'direction':_0x453566['direction']===_0x7d79('0xb6')?'A':'C','secret':_0x453566[_0x7d79('0x82')],'read':_0x453566[_0x7d79('0xa8')],'attachment':_0x453566['Attachment']};})['value']()};return ejs['renderFile'](path[_0x7d79('0x69')](config['root'],_0x7d79('0xa3'),'views',_0x7d79('0xb8')),{'interaction':_0x51073c})[_0x7d79('0x22')](function(_0x21b07d){var _0x2776df=path['join'](_0x2969ac,'transcript-'+_0x560c85['id']+'-'+_0x5b4d3a+'.pdf');var _0x1ed83f={'path':_0x2776df,'channel':'Chat','interactionId':_0x560c85['id']};return pdf[_0x7d79('0xb9')](_0x21b07d,_0x1ed83f);})[_0x7d79('0x22')](function(){return new Promise(function(_0x3ebe84,_0x6e6da8){zipdir(_0x2969ac,{'saveTo':_0x286b4},function(_0x3b5082,_0x586a3e){if(_0x3b5082)return _0x6e6da8(_0x3b5082);return _0x3ebe84(_0x586a3e);});})[_0x7d79('0x22')](function(){return new BPromise(function(_0x47c9bc,_0x56f629){rimraf(_0x2969ac,function(_0x56b700){if(_0x56b700)_0x56f629(_0x56b700);return _0x47c9bc();});});})['then'](function(){return _0x950808[_0x7d79('0x6d')](_0x286b4,_0x122aba,function(_0xb97f11){if(_0xb97f11){logger[_0x7d79('0x14')](_0x7d79('0xba'),_0xb97f11);}else{fs['unlinkSync'](_0x286b4);}});});});}else{return _0x950808[_0x7d79('0x18')](0xc8);}})[_0x7d79('0x17')](handleError(_0x950808,null));};
\ No newline at end of file
+var _0xc2b3=['tmp','attachments','transcript-%d-%s.zip','lastName','push','read','Account','Owner','get','mkdirSync','Chat','closedAt','browserName','customerPort','N.A.','tail','existsSync','createReadStream','pipe','createWriteStream','firstName','value','renderFile','views','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','request-promise','moment','mustache','util','path','ejs','lodash','../../components/parsers/qs','../../components/export/pdf','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','end','offset','undefined','count','limit','Content-Range','json','destroy','sendStatus','stack','name','send','render','merge','agent','interaction','account','index','map','rawAttributes','fieldName','key','getOptions','chat','query','user','show','params','ChatInteraction','keys','intersection','model','attributes','fields','length','includeAll','include','options','find','create','body','update','describe','createVidaooSession','ChatWebsite','findOne','ChatWebsiteId','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','vidaooApiKey','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','isNull','follow','parse','metadata','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','CmContact','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','disposition','AbandonInteraction','attachmentUpload','originalname','basename','file','filename','type','mimetype','Attachment','closed','attachId','root','server/files/attachments/','join','offline-chat/','download','close','mailTranscript','format','transcript-%s.txt','now','pathTranscript','Messages','User','agentAlias','customer','%s%d','Visitor','ContactId','agentIdentifier','website_alias','System','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','direction','secret','MailServerOut','Smtp','CloudProvider','getSmtpOptions','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','filters','hasOwnProperty','order','where','pick','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','sort','ChatInteractionId','fullname','findAll','addTags','setTags','omit','spread','Tag','color','emit','chatInteractionTags:save','removeTags','unix','toString','server','files'];(function(_0x28b671,_0x430c58){var _0x3c9adf=function(_0x2ab94d){while(--_0x2ab94d){_0x28b671['push'](_0x28b671['shift']());}};_0x3c9adf(++_0x430c58);}(_0xc2b3,0xf5));var _0x3c2b=function(_0x21f0cb,_0x2110d7){_0x21f0cb=_0x21f0cb-0x0;var _0x5750db=_0xc2b3[_0x21f0cb];return _0x5750db;};'use strict';var rimraf=require(_0x3c2b('0x0'));var zipdir=require(_0x3c2b('0x1'));var rp=require(_0x3c2b('0x2'));var moment=require(_0x3c2b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3c2b('0x4'));var util=require(_0x3c2b('0x5'));var path=require(_0x3c2b('0x6'));var ejs=require(_0x3c2b('0x7'));var fs=require('fs');var _=require(_0x3c2b('0x8'));var Redis=require('ioredis');var interaction=require('../../components/interaction/service');var qs=require(_0x3c2b('0x9'));var pdf=require(_0x3c2b('0xa'));var logger=require('../../config/logger')(_0x3c2b('0xb'));var config=require(_0x3c2b('0xc'));var db=require(_0x3c2b('0xd'))['db'];config[_0x3c2b('0xe')]=_[_0x3c2b('0xf')](config['redis'],{'host':_0x3c2b('0x10'),'port':0x18eb});var socket=require(_0x3c2b('0x11'))(new Redis(config[_0x3c2b('0xe')]));require(_0x3c2b('0x12'))[_0x3c2b('0x13')](socket);var jayson=require(_0x3c2b('0x14'));var client=jayson[_0x3c2b('0x15')][_0x3c2b('0x16')]({'port':0x232b});var client9004=jayson[_0x3c2b('0x15')]['http']({'port':0x232c});function respondWithRpcPromise(_0x3a97b9,_0x4f9b0b,_0x25c933,_0x16ea24){return new BPromise(function(_0xac534c,_0xf72ffc){var _0x589bae=_0x16ea24||client;return _0x589bae[_0x3c2b('0x17')](_0x3a97b9,_0x25c933)[_0x3c2b('0x18')](function(_0x2ba12f){logger[_0x3c2b('0x19')](_0x3c2b('0x1a'),_0x4f9b0b,_0x3c2b('0x1b'));logger['debug'](_0x3c2b('0x1c'),_0x4f9b0b,_0x3c2b('0x1b'),JSON[_0x3c2b('0x1d')](_0x2ba12f));if(_0x2ba12f[_0x3c2b('0x1e')]){if(_0x2ba12f[_0x3c2b('0x1e')][_0x3c2b('0x1f')]===0x1f4){logger[_0x3c2b('0x1e')](_0x3c2b('0x1a'),_0x4f9b0b,_0x2ba12f[_0x3c2b('0x1e')][_0x3c2b('0x20')]);return _0xf72ffc(_0x2ba12f[_0x3c2b('0x1e')][_0x3c2b('0x20')]);}logger[_0x3c2b('0x1e')](_0x3c2b('0x1a'),_0x4f9b0b,_0x2ba12f[_0x3c2b('0x1e')]['message']);return _0xac534c(_0x2ba12f[_0x3c2b('0x1e')][_0x3c2b('0x20')]);}else{logger[_0x3c2b('0x19')](_0x3c2b('0x1a'),_0x4f9b0b,_0x3c2b('0x1b'));_0xac534c(_0x2ba12f['result'][_0x3c2b('0x20')]);}})[_0x3c2b('0x21')](function(_0xa054cd){logger[_0x3c2b('0x1e')](_0x3c2b('0x1a'),_0x4f9b0b,_0xa054cd);_0xf72ffc(_0xa054cd);});});}function respondWithStatusCode(_0x4915c4,_0xfe061d){_0xfe061d=_0xfe061d||0xcc;return function(_0x51e97c){if(_0x51e97c){return _0x4915c4['sendStatus'](_0xfe061d);}return _0x4915c4[_0x3c2b('0x22')](_0xfe061d)[_0x3c2b('0x23')]();};}function respondWithResult(_0x440608,_0x3a775b){_0x3a775b=_0x3a775b||0xc8;return function(_0x217e62){if(_0x217e62){return _0x440608['status'](_0x3a775b)['json'](_0x217e62);}};}function respondWithFilteredResult(_0x111152,_0x1efb19){return function(_0x2fbebb){if(_0x2fbebb){var _0x194d37=typeof _0x1efb19[_0x3c2b('0x24')]===_0x3c2b('0x25')&&typeof _0x1efb19['limit']===_0x3c2b('0x25');var _0x2b69fe=_0x2fbebb[_0x3c2b('0x26')];var _0x50aa11=_0x194d37?0x0:_0x1efb19['offset'];var _0x236f84=_0x194d37?_0x2fbebb[_0x3c2b('0x26')]:_0x1efb19[_0x3c2b('0x24')]+_0x1efb19[_0x3c2b('0x27')];var _0x49e60b;if(_0x236f84>=_0x2b69fe){_0x236f84=_0x2b69fe;_0x49e60b=0xc8;}else{_0x49e60b=0xce;}_0x111152[_0x3c2b('0x22')](_0x49e60b);return _0x111152['set'](_0x3c2b('0x28'),_0x50aa11+'-'+_0x236f84+'/'+_0x2b69fe)[_0x3c2b('0x29')](_0x2fbebb);}return null;};}function saveUpdates(_0x400b1c){return function(_0x3c627d){if(_0x3c627d){return _0x3c627d['update'](_0x400b1c)['then'](function(_0x3023b6){return _0x3023b6;});}return null;};}function removeEntity(_0x10b17d){return function(_0x37db9d){if(_0x37db9d){return _0x37db9d[_0x3c2b('0x2a')]()[_0x3c2b('0x18')](function(){_0x10b17d['status'](0xcc)[_0x3c2b('0x23')]();});}};}function handleEntityNotFound(_0x25488a){return function(_0x50c7d2){if(!_0x50c7d2){_0x25488a[_0x3c2b('0x2b')](0x194);}return _0x50c7d2;};}function handleError(_0x1225df,_0x4a5b46){_0x4a5b46=_0x4a5b46||0x1f4;return function(_0x151d76){logger[_0x3c2b('0x1e')](_0x151d76[_0x3c2b('0x2c')]);if(_0x151d76[_0x3c2b('0x2d')]){delete _0x151d76[_0x3c2b('0x2d')];}_0x1225df[_0x3c2b('0x22')](_0x4a5b46)[_0x3c2b('0x2e')](_0x151d76);};}function getMustacheRender(_0x49ebf6,_0x6dc87){return Mustache[_0x3c2b('0x2f')](_0x49ebf6,_[_0x3c2b('0x30')](_0x6dc87['body'],{'contact':_0x6dc87['contact'],'message':_0x6dc87['message'],'agent':_0x6dc87[_0x3c2b('0x31')],'interaction':_0x6dc87[_0x3c2b('0x32')],'account':_0x6dc87[_0x3c2b('0x33')]}))||'';}exports[_0x3c2b('0x34')]=function(_0x29aeeb,_0x3a8f40){var _0x424830={};var _0x11ad2f=_[_0x3c2b('0x35')](db['ChatInteraction'][_0x3c2b('0x36')],function(_0x43b012){return{'name':_0x43b012[_0x3c2b('0x37')],'type':_0x43b012['type'][_0x3c2b('0x38')]};});_0x424830=qs[_0x3c2b('0x39')](_0x11ad2f,_0x29aeeb);return interaction['findAll'](_0x3c2b('0x3a'),_0x29aeeb[_0x3c2b('0x3b')],_0x29aeeb[_0x3c2b('0x3c')],_0x424830,_0x11ad2f)['then'](respondWithFilteredResult(_0x3a8f40,_0x424830))[_0x3c2b('0x21')](handleError(_0x3a8f40,null));};exports[_0x3c2b('0x3d')]=function(_0x35cf7b,_0x5d6c46){var _0x1cb081={'raw':![],'where':{'id':_0x35cf7b[_0x3c2b('0x3e')]['id']}},_0x579547={};_0x579547['model']=_['keys'](db[_0x3c2b('0x3f')][_0x3c2b('0x36')]);_0x579547[_0x3c2b('0x3b')]=_[_0x3c2b('0x40')](_0x35cf7b[_0x3c2b('0x3b')]);_0x579547['filters']=_[_0x3c2b('0x41')](_0x579547[_0x3c2b('0x42')],_0x579547['query']);_0x1cb081[_0x3c2b('0x43')]=_[_0x3c2b('0x41')](_0x579547['model'],qs[_0x3c2b('0x44')](_0x35cf7b[_0x3c2b('0x3b')][_0x3c2b('0x44')]));_0x1cb081[_0x3c2b('0x43')]=_0x1cb081[_0x3c2b('0x43')][_0x3c2b('0x45')]?_0x1cb081[_0x3c2b('0x43')]:_0x579547['model'];if(_0x35cf7b[_0x3c2b('0x3b')][_0x3c2b('0x46')]){_0x1cb081[_0x3c2b('0x47')]=[{'all':!![]}];}_0x1cb081=_[_0x3c2b('0x30')]({},_0x1cb081,_0x35cf7b[_0x3c2b('0x48')]);return db['ChatInteraction'][_0x3c2b('0x49')](_0x1cb081)[_0x3c2b('0x18')](handleEntityNotFound(_0x5d6c46,null))[_0x3c2b('0x18')](respondWithResult(_0x5d6c46,null))['catch'](handleError(_0x5d6c46,null));};exports[_0x3c2b('0x4a')]=function(_0xa3d454,_0x5c0ca1){return db[_0x3c2b('0x3f')]['create'](_0xa3d454[_0x3c2b('0x4b')],{})[_0x3c2b('0x18')](respondWithResult(_0x5c0ca1,0xc9))[_0x3c2b('0x21')](handleError(_0x5c0ca1,null));};exports[_0x3c2b('0x4c')]=function(_0xebd2e5,_0x5a2dfc){if(_0xebd2e5[_0x3c2b('0x4b')]['id']){delete _0xebd2e5[_0x3c2b('0x4b')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0xebd2e5['params']['id']}})[_0x3c2b('0x18')](handleEntityNotFound(_0x5a2dfc,null))[_0x3c2b('0x18')](saveUpdates(_0xebd2e5[_0x3c2b('0x4b')],null))[_0x3c2b('0x18')](respondWithResult(_0x5a2dfc,null))[_0x3c2b('0x21')](handleError(_0x5a2dfc,null));};exports[_0x3c2b('0x2a')]=function(_0x5b9772,_0x58043a){return db[_0x3c2b('0x3f')]['find']({'where':{'id':_0x5b9772[_0x3c2b('0x3e')]['id']}})[_0x3c2b('0x18')](handleEntityNotFound(_0x58043a,null))[_0x3c2b('0x18')](removeEntity(_0x58043a,null))['catch'](handleError(_0x58043a,null));};exports[_0x3c2b('0x4d')]=function(_0x133840,_0x18ee26){return db[_0x3c2b('0x3f')][_0x3c2b('0x4d')]()[_0x3c2b('0x18')](respondWithResult(_0x18ee26,null))['catch'](handleError(_0x18ee26,null));};exports[_0x3c2b('0x4e')]=function(_0x4a1119,_0x457fa2){var _0x5f5bc3=_0x4a1119[_0x3c2b('0x3e')]['id'];var _0x28766e;var _0x38a8c7;var _0x2d1db;return db[_0x3c2b('0x3f')]['findOne']({'where':{'id':_0x5f5bc3}})[_0x3c2b('0x18')](function(_0x6c33eb){_0x28766e=_0x6c33eb;return db[_0x3c2b('0x4f')][_0x3c2b('0x50')]({'where':{'id':_0x6c33eb[_0x3c2b('0x51')]},'attributes':['id','vidaooApiKey',_0x3c2b('0x52'),_0x3c2b('0x53'),_0x3c2b('0x54'),_0x3c2b('0x55')],'raw':!![]});})[_0x3c2b('0x18')](function(_0x3a9999){if(_0x3a9999&&_0x3a9999[_0x3c2b('0x56')]&&_0x3a9999[_0x3c2b('0x52')]){_0x38a8c7=_0x3a9999;var _0x1a7961={'interaction':{'id':_0x5f5bc3},'agent':{'id':_0x4a1119['user']['id'],'name':_0x4a1119['user'][_0x3c2b('0x2d')],'fullname':_0x4a1119[_0x3c2b('0x3c')]['fullname'],'email':_0x4a1119[_0x3c2b('0x3c')]['email']},'contact':_0x4a1119[_0x3c2b('0x4b')][_0x3c2b('0x57')],'account':_0x4a1119[_0x3c2b('0x4b')][_0x3c2b('0x33')]};var _0x5c72ee={'rejectUnauthorized':![],'method':_0x3c2b('0x58'),'url':_0x3c2b('0x59'),'headers':{'X-APIKEY':_0x3a9999[_0x3c2b('0x56')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4a1119[_0x3c2b('0x3c')][_0x3c2b('0x5a')]],'buttons':null,'topic':_0x38a8c7[_0x3c2b('0x53')],'note':_[_0x3c2b('0x5b')](_0x38a8c7[_0x3c2b('0x54')])?null:getMustacheRender(_0x38a8c7[_0x3c2b('0x54')],_0x1a7961),'metadata':null},'redirect':_0x3c2b('0x5c'),'json':!![]};try{if(!_['isNull'](_0x38a8c7['vidaooMetadata'])){var _0x12227a=getMustacheRender(_0x38a8c7[_0x3c2b('0x55')],_0x1a7961);var _0x42e2e9=JSON[_0x3c2b('0x5d')](_0x12227a);_0x5c72ee[_0x3c2b('0x4b')][_0x3c2b('0x5e')]=_0x42e2e9;}}catch(_0x3c0240){throw new db[(_0x3c2b('0x5f'))][(_0x3c2b('0x60'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x5c72ee);}else{throw new db[(_0x3c2b('0x5f'))]['ValidationError'](_0x3c2b('0x61'));}})['then'](function(_0x59cbe0){_0x2d1db=_0x59cbe0;if(_0x2d1db['id']){var _0x5a3d74={'body':_0x2d1db[_0x3c2b('0x62')],'ChatWebsiteId':_0x38a8c7['id'],'ChatInteractionId':_0x28766e['id'],'direction':_0x3c2b('0x63'),'UserId':_0x4a1119[_0x3c2b('0x3c')]['id']};return db[_0x3c2b('0x64')][_0x3c2b('0x4a')](_0x5a3d74,{});}else{throw new db['Sequelize'][(_0x3c2b('0x60'))](_0x3c2b('0x65'));}})[_0x3c2b('0x18')](function(){return _0x28766e['updateAttributes']({'vidaooSessionId':_0x2d1db['id']});})[_0x3c2b('0x18')](respondWithResult(_0x457fa2,null))[_0x3c2b('0x21')](handleError(_0x457fa2,null));};exports[_0x3c2b('0x66')]=function(_0x39efc5,_0x59e5b2){if(_0x39efc5['body']['id']){delete _0x39efc5[_0x3c2b('0x4b')]['id'];}return db[_0x3c2b('0x3f')]['find']({'where':{'id':_0x39efc5['params']['id']},'include':[{'model':db[_0x3c2b('0x67')],'as':_0x3c2b('0x68')}]})['then'](handleEntityNotFound(_0x59e5b2,null))[_0x3c2b('0x18')](saveUpdates(_0x39efc5[_0x3c2b('0x4b')],null))[_0x3c2b('0x18')](respondWithResult(_0x59e5b2,null))[_0x3c2b('0x21')](handleError(_0x59e5b2,null));};exports['abandon']=function(_0x38bb95,_0x362e27){if(_0x38bb95[_0x3c2b('0x4b')]['id']){delete _0x38bb95[_0x3c2b('0x4b')]['id'];}return db[_0x3c2b('0x3f')]['find']({'where':{'id':_0x38bb95[_0x3c2b('0x3e')]['id']}})[_0x3c2b('0x18')](function(_0x10e59b){if(!_0x10e59b){logger[_0x3c2b('0x1e')](_0x3c2b('0x69'),_0x3c2b('0x6a'),0x194,_0x3c2b('0x6b'));_0x362e27['sendStatus'](0x194);}else{if(_0x10e59b[_0x3c2b('0x6c')]){throw new db[(_0x3c2b('0x5f'))][(_0x3c2b('0x60'))](_0x3c2b('0x6d'));}}return _0x10e59b;})[_0x3c2b('0x18')](function(_0x3ce6a4){if(_0x3ce6a4){return _0x3ce6a4[_0x3c2b('0x4c')]({'closed':_0x38bb95[_0x3c2b('0x4b')]['closed'],'disposition':_0x38bb95[_0x3c2b('0x4b')][_0x3c2b('0x6e')]})[_0x3c2b('0x18')](function(_0x34baff){return _0x34baff;});}})[_0x3c2b('0x18')](function(){return respondWithRpcPromise(_0x3c2b('0x6f'),_0x3c2b('0x6a'),_0x38bb95[_0x3c2b('0x4b')],client9004);})[_0x3c2b('0x18')](respondWithResult(_0x362e27,null))[_0x3c2b('0x21')](handleError(_0x362e27,null));};exports[_0x3c2b('0x70')]=function(_0x20b03f,_0x45629f){_0x20b03f['body']['name']=_0x20b03f['file'][_0x3c2b('0x71')];_0x20b03f[_0x3c2b('0x4b')][_0x3c2b('0x72')]=_0x20b03f[_0x3c2b('0x73')][_0x3c2b('0x74')];_0x20b03f[_0x3c2b('0x4b')][_0x3c2b('0x75')]=_0x20b03f[_0x3c2b('0x73')][_0x3c2b('0x76')];return db[_0x3c2b('0x77')][_0x3c2b('0x4a')](_0x20b03f[_0x3c2b('0x4b')])[_0x3c2b('0x18')](respondWithResult(_0x45629f,0xc9))[_0x3c2b('0x21')](handleError(_0x45629f,null));};exports['attachmentDownload']=function(_0x51e383,_0xea0802){return db['ChatInteraction']['findOne']({'where':{'id':_0x51e383[_0x3c2b('0x3e')]['id']},'raw':!![]})[_0x3c2b('0x18')](handleEntityNotFound(_0xea0802,null))[_0x3c2b('0x18')](function(_0x113adf){if(_0x113adf){if(_0x113adf[_0x3c2b('0x78')]){return _0xea0802[_0x3c2b('0x22')](0x193)[_0x3c2b('0x29')]({'status':0x193,'message':'Unauthorized'});}return db[_0x3c2b('0x77')]['findOne']({'where':{'id':_0x51e383[_0x3c2b('0x3b')][_0x3c2b('0x79')]},'raw':!![]})[_0x3c2b('0x18')](handleEntityNotFound(_0xea0802,null));}})['then'](function(_0x422f33){if(_0x422f33){var _0x5062e5=_0x422f33['ChatOfflineMessageId']!==null;var _0x13b75d=path['join'](config[_0x3c2b('0x7a')],_0x3c2b('0x7b'));if(_0x5062e5){_0x13b75d=path[_0x3c2b('0x7c')](_0x13b75d,_0x3c2b('0x7d'));}var _0x1b9c08=path['join'](_0x13b75d,_0x422f33[_0x3c2b('0x72')]);return _0xea0802[_0x3c2b('0x7e')](_0x1b9c08);}})[_0x3c2b('0x21')](handleError(_0xea0802,null));};exports[_0x3c2b('0x7f')]=function(_0x3d8c78,_0x390540){var _0x220e98=null;var _0x1284b7=null;var _0x887c8c=null;if(_0x3d8c78[_0x3c2b('0x4b')]['id']){delete _0x3d8c78[_0x3c2b('0x4b')]['id'];}if(_0x3d8c78[_0x3c2b('0x4b')][_0x3c2b('0x80')]){_0x887c8c=path[_0x3c2b('0x7c')](config['root'],'server/files/chat/upload/',util[_0x3c2b('0x81')](_0x3c2b('0x82'),Date[_0x3c2b('0x83')]()));_0x3d8c78[_0x3c2b('0x4b')][_0x3c2b('0x84')]=_0x887c8c;}return db[_0x3c2b('0x3f')][_0x3c2b('0x49')]({'where':{'id':_0x3d8c78['params']['id']},'include':[{'model':db[_0x3c2b('0x64')],'as':_0x3c2b('0x85'),'include':[{'model':db[_0x3c2b('0x86')],'as':_0x3c2b('0x86')}]}]})[_0x3c2b('0x18')](handleEntityNotFound(_0x390540,null))[_0x3c2b('0x18')](saveUpdates(_0x3d8c78[_0x3c2b('0x4b')],null))['then'](function(_0x5b3530){if(_0x5b3530){_0x220e98=_0x5b3530;return db[_0x3c2b('0x4f')][_0x3c2b('0x49')]({'where':{'id':_0x220e98[_0x3c2b('0x51')]}});}})[_0x3c2b('0x18')](function(_0x573e2c){if(_0x573e2c){_0x1284b7=_0x573e2c;return db[_0x3c2b('0x67')][_0x3c2b('0x49')]({'where':{'id':_0x220e98['ContactId']}});}})['then'](function(_0x21c7a7){if(_0x21c7a7){if(_0x887c8c){var _0x104faf=null;for(var _0x27e0ab=0x1;_0x27e0ab<_0x220e98[_0x3c2b('0x85')]['length'];++_0x27e0ab){_0x104faf=_0x220e98[_0x3c2b('0x85')][_0x27e0ab];var _0x23963a=_0x104faf[_0x3c2b('0x6c')]?util[_0x3c2b('0x81')]('%s%d',_0x1284b7[_0x3c2b('0x87')],_0x104faf[_0x3c2b('0x6c')]):'System';var _0x52c86a=_0x3d8c78['body'][_0x3c2b('0x88')]||util['format'](_0x3c2b('0x89'),_0x3c2b('0x8a'),_0x104faf[_0x3c2b('0x8b')]);switch(_0x1284b7[_0x3c2b('0x8c')]){case _0x3c2b('0x8d'):_0x23963a=_0x104faf[_0x3c2b('0x6c')]?util[_0x3c2b('0x81')](_0x3c2b('0x89'),_0x1284b7[_0x3c2b('0x87')],_0x104faf[_0x3c2b('0x6c')]):_0x3c2b('0x8e');break;case'agent_alias':_0x23963a=_0x104faf[_0x3c2b('0x6c')]?_0x104faf[_0x3c2b('0x86')][_0x3c2b('0x8f')]||_0x104faf['User']['fullname']:'System';break;case _0x3c2b('0x90'):_0x23963a=_0x104faf['UserId']?_0x104faf[_0x3c2b('0x86')]['fullname']:'System';break;default:_0x23963a=_0x104faf['UserId']?util[_0x3c2b('0x81')]('%s%d',_0x1284b7[_0x3c2b('0x87')],_0x104faf[_0x3c2b('0x6c')]):_0x3c2b('0x8e');}var _0x1f8373=util[_0x3c2b('0x81')](_0x3c2b('0x91'),moment(_0x104faf[_0x3c2b('0x92')])[_0x3c2b('0x81')]('MM/DD/YYYY\x20HH:mm:ss'),_0x104faf[_0x3c2b('0x93')]==='in'?_0x52c86a:_0x23963a,_0x104faf['body']);if(!_0x104faf[_0x3c2b('0x94')]){fs['appendFileSync'](_0x887c8c,_0x1f8373);}}return db['MailAccount'][_0x3c2b('0x50')]({'where':{'service':!![]},'include':[{'model':db[_0x3c2b('0x95')],'as':_0x3c2b('0x96'),'raw':!![],'include':[{'model':db[_0x3c2b('0x97')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x3c2b('0x18')](function(_0x350dbf){if(!_0x350dbf||!_0x350dbf[_0x3c2b('0x96')]||!_0x3d8c78['body'])return _0x220e98;var _0x2e6e4b=_0x350dbf[_0x3c2b('0x98')]();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x2e6e4b,'message':{'from':util[_0x3c2b('0x81')](_0x3c2b('0x99'),_0x350dbf[_0x3c2b('0x2d')],_0x350dbf[_0x3c2b('0x5a')]||_0x350dbf['Smtp'][_0x3c2b('0x3c')]),'to':_0x3d8c78[_0x3c2b('0x4b')][_0x3c2b('0x80')],'subject':_0x3c2b('0x9a'),'text':util[_0x3c2b('0x81')](_0x3c2b('0x9b'),_0x3d8c78['body'][_0x3c2b('0x80')]),'attachments':[{'path':_0x887c8c}]}})[_0x3c2b('0x18')](function(){return _0x220e98;})['catch'](function(_0x5233ac){logger[_0x3c2b('0x1e')](_0x5233ac);});})[_0x3c2b('0x18')](respondWithStatusCode(_0x390540,0xc8))[_0x3c2b('0x21')](handleError(_0x390540,null));};exports[_0x3c2b('0x9c')]=function(_0x3e7214,_0x4e62f1){return db[_0x3c2b('0x64')][_0x3c2b('0x49')]({'where':{'id':_0x3e7214[_0x3c2b('0x3e')]['id']}})[_0x3c2b('0x18')](handleEntityNotFound(_0x4e62f1,null))[_0x3c2b('0x18')](function(_0x21a162){if(_0x21a162){return _0x21a162['addMessage'](_0x3e7214[_0x3c2b('0x4b')][_0x3c2b('0x9d')],_['omit'](_0x3e7214[_0x3c2b('0x4b')],[_0x3c2b('0x9d'),'id'])||{});}})[_0x3c2b('0x18')](respondWithResult(_0x4e62f1,null))[_0x3c2b('0x21')](handleError(_0x4e62f1,null));};exports[_0x3c2b('0x9e')]=function(_0x23fa73,_0x5ab401){var _0x56d545={'raw':![],'where':{}};var _0x463d96={};var _0x2b49ff={'count':0x0,'rows':[]};return db[_0x3c2b('0x3f')][_0x3c2b('0x50')]({'where':{'id':_0x23fa73[_0x3c2b('0x3e')]['id']}})[_0x3c2b('0x18')](handleEntityNotFound(_0x5ab401,null))['then'](function(_0x4feab8){if(_0x4feab8){_0x463d96[_0x3c2b('0x42')]=_[_0x3c2b('0x40')](db[_0x3c2b('0x64')][_0x3c2b('0x36')]);_0x463d96[_0x3c2b('0x3b')]=_[_0x3c2b('0x40')](_0x23fa73[_0x3c2b('0x3b')]);_0x463d96[_0x3c2b('0x9f')]=_[_0x3c2b('0x41')](_0x463d96[_0x3c2b('0x42')],_0x463d96[_0x3c2b('0x3b')]);_0x56d545['attributes']=_['intersection'](_0x463d96[_0x3c2b('0x42')],qs[_0x3c2b('0x44')](_0x23fa73['query'][_0x3c2b('0x44')]));_0x56d545[_0x3c2b('0x43')]=_0x56d545[_0x3c2b('0x43')][_0x3c2b('0x45')]?_0x56d545[_0x3c2b('0x43')]:_0x463d96['model'];if(!_0x23fa73['query'][_0x3c2b('0xa0')]('nolimit')){_0x56d545[_0x3c2b('0x27')]=qs[_0x3c2b('0x27')](_0x23fa73[_0x3c2b('0x3b')][_0x3c2b('0x27')]);_0x56d545[_0x3c2b('0x24')]=qs['offset'](_0x23fa73[_0x3c2b('0x3b')]['offset']);}_0x56d545[_0x3c2b('0xa1')]=qs['sort'](_0x23fa73[_0x3c2b('0x3b')]['sort']);_0x56d545[_0x3c2b('0xa2')]=qs[_0x3c2b('0x9f')](_[_0x3c2b('0xa3')](_0x23fa73[_0x3c2b('0x3b')],_0x463d96[_0x3c2b('0x9f')]));_0x56d545[_0x3c2b('0xa2')]['ChatInteractionId']=_0x4feab8['id'];if(_0x23fa73[_0x3c2b('0x3b')]['filter']){_0x56d545[_0x3c2b('0xa2')]=_[_0x3c2b('0x30')](_0x56d545[_0x3c2b('0xa2')],{'$or':_[_0x3c2b('0x35')](_0x56d545[_0x3c2b('0x43')],function(_0x2b3dba){var _0x51d4cf={};_0x51d4cf[_0x2b3dba]={'$like':'%'+_0x23fa73[_0x3c2b('0x3b')][_0x3c2b('0xa4')]+'%'};return _0x51d4cf;})});}if(_0x23fa73['query']['$gte']){var _0x25dfbe=_0x23fa73[_0x3c2b('0x3b')][_0x3c2b('0xa5')][_0x3c2b('0xa6')](',');var _0x23539b={};_0x23539b[_0x25dfbe[0x0]]={'$gte':moment(_0x25dfbe[0x1])[_0x3c2b('0x81')](_0x3c2b('0xa7'))};_0x56d545[_0x3c2b('0xa2')]=_[_0x3c2b('0x30')](_0x56d545[_0x3c2b('0xa2')],_0x23539b);}_0x56d545=_[_0x3c2b('0x30')]({},_0x56d545,_0x23fa73[_0x3c2b('0x48')]);return db[_0x3c2b('0x64')][_0x3c2b('0x26')]({'where':_0x56d545[_0x3c2b('0xa2')]})[_0x3c2b('0x18')](function(_0x248e24){_0x2b49ff[_0x3c2b('0x26')]=_0x248e24;if(_0x23fa73[_0x3c2b('0x3b')]['includeAll']){_0x56d545[_0x3c2b('0x47')]=[{'all':!![]}];}return db[_0x3c2b('0x64')]['findAll'](_0x56d545);})['then'](function(_0x111d1e){_0x2b49ff[_0x3c2b('0xa8')]=_0x111d1e;return _0x2b49ff;});}})[_0x3c2b('0x18')](respondWithFilteredResult(_0x5ab401,_0x56d545))[_0x3c2b('0x21')](handleError(_0x5ab401,null));};exports[_0x3c2b('0xa9')]=function(_0x31013c,_0x124a3e){var _0x44ab4a={'where':{}},_0x5e1b5a={},_0x4dc69f={'count':0x0,'rows':[]};return db[_0x3c2b('0x3f')][_0x3c2b('0x50')]({'where':{'id':_0x31013c['params']['id']}})[_0x3c2b('0x18')](handleEntityNotFound(_0x124a3e,null))[_0x3c2b('0x18')](function(_0x4fdac5){if(_0x4fdac5){_0x5e1b5a[_0x3c2b('0x42')]=_[_0x3c2b('0x40')](db[_0x3c2b('0x64')][_0x3c2b('0x36')]);_0x5e1b5a[_0x3c2b('0x3b')]=_[_0x3c2b('0x40')](_0x31013c[_0x3c2b('0x3b')]);_0x5e1b5a[_0x3c2b('0x9f')]=_['intersection'](_0x5e1b5a['model'],_0x5e1b5a[_0x3c2b('0x3b')]);_0x44ab4a[_0x3c2b('0x43')]=_[_0x3c2b('0x41')](_0x5e1b5a[_0x3c2b('0x42')],qs[_0x3c2b('0x44')](_0x31013c[_0x3c2b('0x3b')][_0x3c2b('0x44')]));_0x44ab4a[_0x3c2b('0x43')]=_0x44ab4a[_0x3c2b('0x43')][_0x3c2b('0x45')]?_0x44ab4a[_0x3c2b('0x43')]:_0x5e1b5a[_0x3c2b('0x42')];if(!_0x31013c[_0x3c2b('0x3b')][_0x3c2b('0xa0')]('nolimit')){_0x44ab4a[_0x3c2b('0x27')]=qs['limit'](_0x31013c[_0x3c2b('0x3b')][_0x3c2b('0x27')]);_0x44ab4a[_0x3c2b('0x24')]=qs[_0x3c2b('0x24')](_0x31013c['query']['offset']);}_0x44ab4a[_0x3c2b('0xa1')]=qs['sort'](_0x31013c[_0x3c2b('0x3b')][_0x3c2b('0xaa')]);_0x44ab4a['where']=qs['filters'](_[_0x3c2b('0xa3')](_0x31013c[_0x3c2b('0x3b')],_0x5e1b5a[_0x3c2b('0x9f')]));_0x44ab4a[_0x3c2b('0xa2')][_0x3c2b('0xab')]=_0x4fdac5['id'];if(_0x31013c[_0x3c2b('0x3b')][_0x3c2b('0xa4')]){_0x44ab4a[_0x3c2b('0xa2')]=_[_0x3c2b('0x30')](_0x44ab4a[_0x3c2b('0xa2')],{'$or':_[_0x3c2b('0x35')](_0x44ab4a['attributes'],function(_0x1694be){var _0x526b49={};_0x526b49[_0x1694be]={'$like':'%'+_0x31013c[_0x3c2b('0x3b')][_0x3c2b('0xa4')]+'%'};return _0x526b49;})});}_0x44ab4a[_0x3c2b('0xa2')][_0x3c2b('0x94')]=![];if(_0x31013c[_0x3c2b('0x3b')]['id']){_0x44ab4a[_0x3c2b('0xa2')]['id']={'$gt':_0x31013c[_0x3c2b('0x3b')]['id']};}_0x44ab4a=_[_0x3c2b('0x30')]({},_0x44ab4a,_0x31013c[_0x3c2b('0x48')]);return db[_0x3c2b('0x64')][_0x3c2b('0x26')]({'where':_0x44ab4a[_0x3c2b('0xa2')]})[_0x3c2b('0x18')](function(_0x451052){_0x4dc69f[_0x3c2b('0x26')]=_0x451052;_0x44ab4a[_0x3c2b('0x47')]=[];if(_0x31013c[_0x3c2b('0x3b')]['includeAgent']){_0x44ab4a['include']['push']({'model':db['User'],'as':_0x3c2b('0x86'),'attributes':['id',_0x3c2b('0xac'),_0x3c2b('0x8f')]});}if(_0x31013c[_0x3c2b('0x3b')][_0x3c2b('0x46')]){_0x44ab4a['include']=[{'all':!![]}];}return db[_0x3c2b('0x64')][_0x3c2b('0xad')](_0x44ab4a);})['then'](function(_0x1e2cb9){_0x4dc69f[_0x3c2b('0xa8')]=_0x1e2cb9;return _0x4dc69f;});}})[_0x3c2b('0x18')](respondWithFilteredResult(_0x124a3e,_0x44ab4a))[_0x3c2b('0x21')](handleError(_0x124a3e,null));};exports[_0x3c2b('0xae')]=function(_0x10f29c,_0x3f2a01){return db[_0x3c2b('0x3f')]['find']({'where':{'id':_0x10f29c['params']['id']}})[_0x3c2b('0x18')](handleEntityNotFound(_0x3f2a01,null))[_0x3c2b('0x18')](function(_0x6ca5ac){if(_0x6ca5ac){return _0x6ca5ac[_0x3c2b('0xaf')](_0x10f29c[_0x3c2b('0x4b')][_0x3c2b('0x9d')],_[_0x3c2b('0xb0')](_0x10f29c[_0x3c2b('0x4b')],[_0x3c2b('0x9d'),'id'])||{})[_0x3c2b('0xb1')](function(){return db[_0x3c2b('0xb2')]['findAll']({'attributes':['id',_0x3c2b('0x2d'),_0x3c2b('0xb3')],'where':{'id':_0x10f29c[_0x3c2b('0x4b')][_0x3c2b('0x9d')]}});})['then'](function(_0x3e7726){socket[_0x3c2b('0xb4')](_0x3c2b('0xb5'),{'id':Number(_0x10f29c['params']['id']),'tags':_0x3e7726||[]});return{'id':Number(_0x10f29c[_0x3c2b('0x3e')]['id']),'tags':_0x3e7726||[]};});}})[_0x3c2b('0x18')](respondWithResult(_0x3f2a01,null))[_0x3c2b('0x21')](handleError(_0x3f2a01,null));};exports['removeTags']=function(_0x3f5d97,_0x3910d4){return db[_0x3c2b('0x3f')][_0x3c2b('0x49')]({'where':{'id':_0x3f5d97[_0x3c2b('0x3e')]['id']}})[_0x3c2b('0x18')](handleEntityNotFound(_0x3910d4,null))[_0x3c2b('0x18')](function(_0x1ad232){if(_0x1ad232){return _0x1ad232[_0x3c2b('0xb6')](_0x3f5d97[_0x3c2b('0x3b')][_0x3c2b('0x9d')]);}})['then'](respondWithStatusCode(_0x3910d4,null))[_0x3c2b('0x21')](handleError(_0x3910d4,null));};exports[_0x3c2b('0x7e')]=function(_0x2ecf61,_0x4403f3){var _0x567854=moment()[_0x3c2b('0xb7')]()[_0x3c2b('0xb8')]();var _0x176045=path['join'](config[_0x3c2b('0x7a')],_0x3c2b('0xb9'),_0x3c2b('0xba'),_0x3c2b('0xbb'));var _0xa91d8c=path[_0x3c2b('0x7c')](config[_0x3c2b('0x7a')],_0x3c2b('0xb9'),_0x3c2b('0xba'),_0x3c2b('0xbc'));var _0x531fad=path['join'](_0x176045,_0x567854);var _0x5dae7b=util[_0x3c2b('0x81')](_0x3c2b('0xbd'),_0x2ecf61['params']['id'],_0x567854);var _0x32bebf=path[_0x3c2b('0x7c')](_0x176045,_0x5dae7b);var _0x301980=[];_0x301980['push']({'model':db[_0x3c2b('0x86')],'as':_0x3c2b('0x86'),'attributes':['id',_0x3c2b('0xac')],'raw':!![]});_0x301980['push']({'model':db[_0x3c2b('0x67')],'as':_0x3c2b('0x68'),'attributes':['id','firstName',_0x3c2b('0xbe')],'raw':!![]});if(_0x2ecf61[_0x3c2b('0x3b')][_0x3c2b('0xbc')]){_0x301980[_0x3c2b('0xbf')]({'model':db[_0x3c2b('0x77')],'as':_0x3c2b('0x77'),'raw':!![]});}var _0x2ae830=[{'model':db[_0x3c2b('0x64')],'as':_0x3c2b('0x85'),'attributes':['id',_0x3c2b('0x4b'),_0x3c2b('0x92'),_0x3c2b('0x93'),_0x3c2b('0x94'),_0x3c2b('0xc0')],'include':_0x301980}];_0x2ae830['push']({'model':db[_0x3c2b('0x4f')],'as':_0x3c2b('0xc1'),'attributes':['id',_0x3c2b('0x2d')]});_0x2ae830[_0x3c2b('0xbf')]({'model':db[_0x3c2b('0x86')],'as':_0x3c2b('0xc2'),'attributes':['id','fullname']});return db[_0x3c2b('0x3f')]['find']({'where':{'id':_0x2ecf61[_0x3c2b('0x3e')]['id']},'include':_0x2ae830})['then'](handleEntityNotFound(_0x4403f3,null))[_0x3c2b('0x18')](function(_0x4fe5f9){if(_0x4fe5f9){var _0x445296=_0x4fe5f9[_0x3c2b('0xc3')]({'plain':!![]});fs[_0x3c2b('0xc4')](_0x531fad);var _0x530dca={'channel':_0x3c2b('0xc5'),'account':_0x445296[_0x3c2b('0xc1')][_0x3c2b('0x2d')],'agent':_0x445296['Owner']?_0x445296[_0x3c2b('0xc2')][_0x3c2b('0xac')]:'N.A.','createdAt':moment(_0x445296[_0x3c2b('0x92')])[_0x3c2b('0x81')](_0x3c2b('0xa7'))[_0x3c2b('0xb8')](),'closedAt':_0x445296[_0x3c2b('0x78')]?moment(_0x445296[_0x3c2b('0xc6')])[_0x3c2b('0x81')]('YYYY-MM-DD\x20HH:mm:ss')[_0x3c2b('0xb8')]():'','disposition':_0x445296['disposition'],'chatInfo':{'browser':_0x445296[_0x3c2b('0xc7')],'os':_0x445296['osName'],'referer':_0x445296['referer'],'customerIp':_0x445296['customerIp'],'customerPort':_0x445296[_0x3c2b('0xc8')]?_0x445296[_0x3c2b('0xc8')]:_0x3c2b('0xc9')},'messages':_(_0x445296['Messages'])[_0x3c2b('0xca')]()['filter']({'secret':![]})[_0x3c2b('0x35')](function(_0x45c2a5){if(_0x45c2a5['Attachment']){var _0x75bc7b=path[_0x3c2b('0x7c')](_0xa91d8c,_0x45c2a5[_0x3c2b('0x77')][_0x3c2b('0x72')]);if(fs[_0x3c2b('0xcb')](_0x75bc7b)){fs[_0x3c2b('0xcc')](_0x75bc7b)[_0x3c2b('0xcd')](fs[_0x3c2b('0xce')](path[_0x3c2b('0x7c')](_0x531fad,_0x45c2a5[_0x3c2b('0x77')][_0x3c2b('0x72')])));}}return{'date':moment(_0x45c2a5[_0x3c2b('0x92')])[_0x3c2b('0x81')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x45c2a5['direction']==='out'?_0x45c2a5[_0x3c2b('0x86')]?_0x45c2a5[_0x3c2b('0x86')]['fullname']:'System':_0x45c2a5[_0x3c2b('0x68')][_0x3c2b('0xcf')]+(_0x45c2a5[_0x3c2b('0x68')][_0x3c2b('0xbe')]?'\x20'+_0x45c2a5[_0x3c2b('0x68')]['lastName']:''),'body':_0x45c2a5[_0x3c2b('0x77')]?_0x45c2a5[_0x3c2b('0x77')][_0x3c2b('0x72')]:_0x45c2a5[_0x3c2b('0x4b')],'direction':_0x45c2a5[_0x3c2b('0x93')]===_0x3c2b('0x63')?'A':'C','secret':_0x45c2a5[_0x3c2b('0x94')],'read':_0x45c2a5['read'],'attachment':_0x45c2a5[_0x3c2b('0x77')]};})[_0x3c2b('0xd0')]()};return ejs[_0x3c2b('0xd1')](path[_0x3c2b('0x7c')](config[_0x3c2b('0x7a')],'server',_0x3c2b('0xd2'),'downloadInteraction.ejs'),{'interaction':_0x530dca})[_0x3c2b('0x18')](function(_0x13f8d5){var _0x4bc725=path['join'](_0x531fad,_0x3c2b('0xd3')+_0x445296['id']+'-'+_0x567854+_0x3c2b('0xd4'));var _0x35b1c5={'path':_0x4bc725,'channel':_0x3c2b('0xc5'),'interactionId':_0x445296['id']};return pdf[_0x3c2b('0xd5')](_0x13f8d5,_0x35b1c5);})[_0x3c2b('0x18')](function(){return new Promise(function(_0x511872,_0x28dd83){zipdir(_0x531fad,{'saveTo':_0x32bebf},function(_0x457477,_0x26a5c4){if(_0x457477)return _0x28dd83(_0x457477);return _0x511872(_0x26a5c4);});})['then'](function(){return new BPromise(function(_0x1e69a2,_0x5cc14f){rimraf(_0x531fad,function(_0x2429f4){if(_0x2429f4)_0x5cc14f(_0x2429f4);return _0x1e69a2();});});})['then'](function(){return _0x4403f3[_0x3c2b('0x7e')](_0x32bebf,_0x5dae7b,function(_0x5337ab){if(_0x5337ab){logger[_0x3c2b('0x1e')](_0x3c2b('0xd6'),_0x5337ab);}else{fs[_0x3c2b('0xd7')](_0x32bebf);}});});});}else{return _0x4403f3[_0x3c2b('0x2b')](0xc8);}})['catch'](handleError(_0x4403f3,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 54e8b37..e7dcad4 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 _0xffa6=['hook','events','../../mysqldb','ChatInteraction','ChatMessage','save','update','remove','getUsers','then','setDataValue','Users','findAll','unreadMessages','length','emit','catch','hasOwnProperty'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0xffa6,0x19f));var _0x6ffa=function(_0x48ee8d,_0x1555fd){_0x48ee8d=_0x48ee8d-0x0;var _0x2ddbc1=_0xffa6[_0x48ee8d];return _0x2ddbc1;};'use strict';var EventEmitter=require(_0x6ffa('0x0'));var ChatInteraction=require(_0x6ffa('0x1'))['db'][_0x6ffa('0x2')];var ChatMessage=require(_0x6ffa('0x1'))['db'][_0x6ffa('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6ffa('0x4'),'afterUpdate':_0x6ffa('0x5'),'afterDestroy':_0x6ffa('0x6')};function emitEvent(_0x177d60){return function(_0x2c134a,_0x27c2ae,_0x5798b4){_0x2c134a[_0x6ffa('0x7')]({'attributes':['id'],'raw':!![]})[_0x6ffa('0x8')](function(_0x3cae9a){_0x2c134a[_0x6ffa('0x9')](_0x6ffa('0xa'),_0x3cae9a['map'](function(_0x43875a){return{'id':_0x43875a['id']};}));return ChatMessage[_0x6ffa('0xb')]({'where':{'ChatInteractionId':_0x2c134a['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x5b0a0c){_0x2c134a[_0x6ffa('0x9')](_0x6ffa('0xc'),_0x5b0a0c[_0x6ffa('0xd')]);ChatInteractionEvents[_0x6ffa('0xe')](_0x177d60+':'+_0x2c134a['id'],_0x2c134a);ChatInteractionEvents[_0x6ffa('0xe')](_0x177d60,_0x2c134a);_0x5798b4(null);})[_0x6ffa('0xf')](_0x5798b4(null));};}for(var e in events){if(events[_0x6ffa('0x10')](e)){var event=events[e];ChatInteraction[_0x6ffa('0x11')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
+var _0x0153=['length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','remove','getUsers','then','setDataValue','map','findAll'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x0153,0xe3));var _0x3015=function(_0x2df4fe,_0x8fd414){_0x2df4fe=_0x2df4fe-0x0;var _0x4154ce=_0x0153[_0x2df4fe];return _0x4154ce;};'use strict';var EventEmitter=require(_0x3015('0x0'));var ChatInteraction=require(_0x3015('0x1'))['db'][_0x3015('0x2')];var ChatMessage=require(_0x3015('0x1'))['db'][_0x3015('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x3015('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x3015('0x5')};function emitEvent(_0x296002){return function(_0x3c2c32,_0x4f238f,_0x41c678){_0x3c2c32[_0x3015('0x6')]({'attributes':['id'],'raw':!![]})[_0x3015('0x7')](function(_0x4960de){_0x3c2c32[_0x3015('0x8')]('Users',_0x4960de[_0x3015('0x9')](function(_0x40e82b){return{'id':_0x40e82b['id']};}));return ChatMessage[_0x3015('0xa')]({'where':{'ChatInteractionId':_0x3c2c32['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x24a8a5){_0x3c2c32['setDataValue']('unreadMessages',_0x24a8a5[_0x3015('0xb')]);ChatInteractionEvents[_0x3015('0xc')](_0x296002+':'+_0x3c2c32['id'],_0x3c2c32);ChatInteractionEvents[_0x3015('0xc')](_0x296002,_0x3c2c32);_0x41c678(null);})[_0x3015('0xd')](_0x41c678(null));};}for(var e in events){if(events[_0x3015('0xe')](e)){var event=events[e];ChatInteraction[_0x3015('0xf')](e,emitEvent(event));}}module[_0x3015('0x10')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 1943dd9..8b790df 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 _0x6937=['ChatInteraction','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define'];(function(_0x20883f,_0x6a3698){var _0x365b1e=function(_0xae6c80){while(--_0xae6c80){_0x20883f['push'](_0x20883f['shift']());}};_0x365b1e(++_0x6a3698);}(_0x6937,0x122));var _0x7693=function(_0x3f578f,_0x51f172){_0x3f578f=_0x3f578f-0x0;var _0x32c754=_0x6937[_0x3f578f];return _0x32c754;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7693('0x0'))(_0x7693('0x1'));var moment=require(_0x7693('0x2'));var BPromise=require(_0x7693('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7693('0x4'));var rimraf=require(_0x7693('0x5'));var config=require(_0x7693('0x6'));var attributes=require(_0x7693('0x7'));module[_0x7693('0x8')]=function(_0x59e99d,_0x4dba8e){return _0x59e99d[_0x7693('0x9')](_0x7693('0xa'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1b680e,_0x3e787e,_0xb75292){if(_0x1b680e['changed'](_0x7693('0xb'))){_0x1b680e['closedAt']=moment()[_0x7693('0xc')](_0x7693('0xd'));}_0xb75292(null,_0x1b680e);}},'charset':'utf8mb4','collate':_0x7693('0xe')});};
\ No newline at end of file
+var _0xb139=['closed','closedAt','utf8mb4','lodash','util','moment','bluebird','request-promise','path','rimraf','./chatInteraction.attributes','exports','define','chat_interactions'];(function(_0x117f2c,_0x2030d6){var _0x18bea8=function(_0x1ce11c){while(--_0x1ce11c){_0x117f2c['push'](_0x117f2c['shift']());}};_0x18bea8(++_0x2030d6);}(_0xb139,0x81));var _0x9b13=function(_0x21f3bf,_0xa9389e){_0x21f3bf=_0x21f3bf-0x0;var _0x60151e=_0xb139[_0x21f3bf];return _0x60151e;};'use strict';var _=require(_0x9b13('0x0'));var util=require(_0x9b13('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9b13('0x2'));var BPromise=require(_0x9b13('0x3'));var rp=require(_0x9b13('0x4'));var fs=require('fs');var path=require(_0x9b13('0x5'));var rimraf=require(_0x9b13('0x6'));var config=require('../../config/environment');var attributes=require(_0x9b13('0x7'));module[_0x9b13('0x8')]=function(_0x4aa469,_0x5d9b82){return _0x4aa469[_0x9b13('0x9')]('ChatInteraction',attributes,{'tableName':_0x9b13('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3f0fa6,_0x3b08fe,_0x591f99){if(_0x3f0fa6['changed'](_0x9b13('0xb'))){_0x3f0fa6[_0x9b13('0xc')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x591f99(null,_0x3f0fa6);}},'charset':_0x9b13('0xd'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 889c6c5..e351877 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 _0x8855=['ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','attributes','limit','then','debug','AddTagsToChatInteraction','find','where','addTags','ids','spread','AddTags','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','request'];(function(_0x7a55bc,_0x3082dc){var _0x35ab91=function(_0x45c82b){while(--_0x45c82b){_0x7a55bc['push'](_0x7a55bc['shift']());}};_0x35ab91(++_0x3082dc);}(_0x8855,0x1f4));var _0x5885=function(_0x50351f,_0x44db59){_0x50351f=_0x50351f-0x0;var _0x4861ef=_0x8855[_0x50351f];return _0x4861ef;};'use strict';var _=require('lodash');var util=require(_0x5885('0x0'));var moment=require(_0x5885('0x1'));var BPromise=require('bluebird');var rs=require(_0x5885('0x2'));var fs=require('fs');var Redis=require(_0x5885('0x3'));var db=require(_0x5885('0x4'))['db'];var utils=require(_0x5885('0x5'));var logger=require(_0x5885('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5885('0x7'));var client=jayson[_0x5885('0x8')][_0x5885('0x9')]({'port':0x232a});config[_0x5885('0xa')]=_[_0x5885('0xb')](config[_0x5885('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x5885('0xc'))(new Redis(config['redis']));require(_0x5885('0xd'))[_0x5885('0xe')](socket);function respondWithRpcPromise(_0x537fe8,_0x3ee0ec,_0x156706){return new BPromise(function(_0x209e10,_0x514efa){return client[_0x5885('0xf')](_0x537fe8,_0x156706)['then'](function(_0x570ade){logger['info'](_0x5885('0x10'),_0x3ee0ec,_0x5885('0x11'));logger['debug'](_0x5885('0x12'),_0x3ee0ec,'request\x20sent',JSON[_0x5885('0x13')](_0x570ade));if(_0x570ade['error']){if(_0x570ade['error'][_0x5885('0x14')]===0x1f4){logger[_0x5885('0x15')](_0x5885('0x10'),_0x3ee0ec,_0x570ade[_0x5885('0x15')][_0x5885('0x16')]);return _0x514efa(_0x570ade['error'][_0x5885('0x16')]);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x3ee0ec,_0x570ade[_0x5885('0x15')][_0x5885('0x16')]);return _0x209e10(_0x570ade[_0x5885('0x15')][_0x5885('0x16')]);}else{logger[_0x5885('0x17')](_0x5885('0x10'),_0x3ee0ec,_0x5885('0x11'));_0x209e10(_0x570ade[_0x5885('0x18')][_0x5885('0x16')]);}})[_0x5885('0x19')](function(_0x300036){logger[_0x5885('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x3ee0ec,_0x300036);_0x514efa(_0x300036);});});}exports[_0x5885('0x1a')]=function(_0x3b2c97){var _0x1057c8=this;return new Promise(function(_0xbaecbe,_0x12c30c){return db[_0x5885('0x1b')][_0x5885('0x1c')](_0x3b2c97[_0x5885('0x1d')],{'raw':_0x3b2c97['options']?_0x3b2c97[_0x5885('0x1e')][_0x5885('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b2c97[_0x5885('0x1e')]?_0x3b2c97['options']['where']||null:null,'attributes':_0x3b2c97[_0x5885('0x1e')]?_0x3b2c97[_0x5885('0x1e')][_0x5885('0x20')]||null:null,'limit':_0x3b2c97[_0x5885('0x1e')]?_0x3b2c97[_0x5885('0x1e')][_0x5885('0x21')]||null:null})[_0x5885('0x22')](function(_0x31f95a){logger['info'](_0x5885('0x1a'),_0x3b2c97);logger[_0x5885('0x23')](_0x5885('0x1a'),_0x3b2c97,JSON[_0x5885('0x13')](_0x31f95a));_0xbaecbe(_0x31f95a);})[_0x5885('0x19')](function(_0x166e8b){logger[_0x5885('0x15')](_0x5885('0x1a'),_0x166e8b[_0x5885('0x16')],_0x3b2c97);_0x12c30c(_0x1057c8[_0x5885('0x15')](0x1f4,_0x166e8b[_0x5885('0x16')]));});});};exports[_0x5885('0x24')]=function(_0x3599dd){return new Promise(function(_0x1d3cf1,_0x374d7a){return db['ChatInteraction'][_0x5885('0x25')]({'where':_0x3599dd[_0x5885('0x1e')]?_0x3599dd[_0x5885('0x1e')][_0x5885('0x26')]||null:null})['then'](function(_0x1f3de5){if(_0x1f3de5){return _0x1f3de5[_0x5885('0x27')](_0x3599dd[_0x5885('0x1d')][_0x5885('0x28')],_['omit'](_0x3599dd[_0x5885('0x1d')],[_0x5885('0x28'),'id'])||{});}})[_0x5885('0x29')](function(_0x263099){logger[_0x5885('0x17')](_0x5885('0x2a'),_0x3599dd);logger['debug'](_0x5885('0x2a'),_0x3599dd,JSON[_0x5885('0x13')](_0x263099));_0x1d3cf1(_0x263099);})[_0x5885('0x19')](function(_0x84b885){logger[_0x5885('0x15')]('AddTags',_0x84b885[_0x5885('0x16')],_0x3599dd);_0x374d7a(_this[_0x5885('0x15')](0x1f4,_0x84b885[_0x5885('0x16')]));});});};
\ No newline at end of file
+var _0x20a4=['localhost','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateChatInteraction','ChatInteraction','update','body','options','where','attributes','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','util','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x5db942,_0x9ce96){var _0x31d0a4=function(_0x31983c){while(--_0x31983c){_0x5db942['push'](_0x5db942['shift']());}};_0x31d0a4(++_0x9ce96);}(_0x20a4,0x155));var _0x420a=function(_0x5cd925,_0x20a89f){_0x5cd925=_0x5cd925-0x0;var _0x34a72c=_0x20a4[_0x5cd925];return _0x34a72c;};'use strict';var _=require('lodash');var util=require(_0x420a('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x420a('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x420a('0x2'));var logger=require(_0x420a('0x3'))(_0x420a('0x4'));var config=require(_0x420a('0x5'));var jayson=require(_0x420a('0x6'));var client=jayson[_0x420a('0x7')][_0x420a('0x8')]({'port':0x232a});config[_0x420a('0x9')]=_['defaults'](config[_0x420a('0x9')],{'host':_0x420a('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x420a('0xb'))[_0x420a('0xc')](socket);function respondWithRpcPromise(_0x27e52a,_0x4ad16a,_0x1397b1){return new BPromise(function(_0x10331b,_0x21bc66){return client[_0x420a('0xd')](_0x27e52a,_0x1397b1)[_0x420a('0xe')](function(_0x212b34){logger[_0x420a('0xf')](_0x420a('0x10'),_0x4ad16a,_0x420a('0x11'));logger[_0x420a('0x12')](_0x420a('0x13'),_0x4ad16a,_0x420a('0x11'),JSON[_0x420a('0x14')](_0x212b34));if(_0x212b34[_0x420a('0x15')]){if(_0x212b34[_0x420a('0x15')][_0x420a('0x16')]===0x1f4){logger[_0x420a('0x15')](_0x420a('0x10'),_0x4ad16a,_0x212b34['error'][_0x420a('0x17')]);return _0x21bc66(_0x212b34[_0x420a('0x15')][_0x420a('0x17')]);}logger[_0x420a('0x15')](_0x420a('0x10'),_0x4ad16a,_0x212b34[_0x420a('0x15')][_0x420a('0x17')]);return _0x10331b(_0x212b34['error'][_0x420a('0x17')]);}else{logger[_0x420a('0xf')](_0x420a('0x10'),_0x4ad16a,_0x420a('0x11'));_0x10331b(_0x212b34['result'][_0x420a('0x17')]);}})[_0x420a('0x18')](function(_0x5f5220){logger[_0x420a('0x15')](_0x420a('0x10'),_0x4ad16a,_0x5f5220);_0x21bc66(_0x5f5220);});});}exports[_0x420a('0x19')]=function(_0x50add9){var _0x2ed096=this;return new Promise(function(_0x292a7f,_0x187ad1){return db[_0x420a('0x1a')][_0x420a('0x1b')](_0x50add9[_0x420a('0x1c')],{'raw':_0x50add9['options']?_0x50add9['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50add9[_0x420a('0x1d')]?_0x50add9['options'][_0x420a('0x1e')]||null:null,'attributes':_0x50add9[_0x420a('0x1d')]?_0x50add9[_0x420a('0x1d')][_0x420a('0x1f')]||null:null,'limit':_0x50add9['options']?_0x50add9['options']['limit']||null:null})[_0x420a('0xe')](function(_0x4f2bed){logger[_0x420a('0xf')]('UpdateChatInteraction',_0x50add9);logger[_0x420a('0x12')](_0x420a('0x19'),_0x50add9,JSON[_0x420a('0x14')](_0x4f2bed));_0x292a7f(_0x4f2bed);})[_0x420a('0x18')](function(_0x46c9a1){logger['error']('UpdateChatInteraction',_0x46c9a1[_0x420a('0x17')],_0x50add9);_0x187ad1(_0x2ed096[_0x420a('0x15')](0x1f4,_0x46c9a1[_0x420a('0x17')]));});});};exports[_0x420a('0x20')]=function(_0x5d1f37){return new Promise(function(_0x20809,_0x199cfa){return db[_0x420a('0x1a')][_0x420a('0x21')]({'where':_0x5d1f37[_0x420a('0x1d')]?_0x5d1f37[_0x420a('0x1d')][_0x420a('0x1e')]||null:null})['then'](function(_0xdab7a9){if(_0xdab7a9){return _0xdab7a9[_0x420a('0x22')](_0x5d1f37[_0x420a('0x1c')][_0x420a('0x23')],_[_0x420a('0x24')](_0x5d1f37[_0x420a('0x1c')],[_0x420a('0x23'),'id'])||{});}})[_0x420a('0x25')](function(_0xa3f2d4){logger[_0x420a('0xf')](_0x420a('0x26'),_0x5d1f37);logger[_0x420a('0x12')]('AddTags',_0x5d1f37,JSON[_0x420a('0x14')](_0xa3f2d4));_0x20809(_0xa3f2d4);})[_0x420a('0x18')](function(_0x47c2f7){logger[_0x420a('0x15')](_0x420a('0x26'),_0x47c2f7[_0x420a('0x17')],_0x5d1f37);_0x199cfa(_this['error'](0x1f4,_0x47c2f7[_0x420a('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index a3acff6..d128d14 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 _0x4920=['save','update','emit','removeListener','register','chatInteraction:','./chatInteraction.events'];(function(_0x37d67d,_0x6ad517){var _0x5eaf3e=function(_0x454555){while(--_0x454555){_0x37d67d['push'](_0x37d67d['shift']());}};_0x5eaf3e(++_0x6ad517);}(_0x4920,0x14f));var _0x0492=function(_0x10eb54,_0x32c017){_0x10eb54=_0x10eb54-0x0;var _0x8622f1=_0x4920[_0x10eb54];return _0x8622f1;};'use strict';var ChatInteractionEvents=require(_0x0492('0x0'));var events=[_0x0492('0x1'),'remove',_0x0492('0x2')];function createListener(_0xc7efe8,_0x578058){return function(_0x494edc){_0x578058[_0x0492('0x3')](_0xc7efe8,_0x494edc);};}function removeListener(_0x3ec644,_0x19eba8){return function(){ChatInteractionEvents[_0x0492('0x4')](_0x3ec644,_0x19eba8);};}exports[_0x0492('0x5')]=function(_0xe42d95){for(var _0x100910=0x0,_0x390988=events['length'];_0x100910<_0x390988;_0x100910++){var _0x2d40a3=events[_0x100910];var _0x347f3c=createListener(_0x0492('0x6')+_0x2d40a3,_0xe42d95);ChatInteractionEvents['on'](_0x2d40a3,_0x347f3c);}};
\ No newline at end of file
+var _0x9028=['./chatInteraction.events','save','update','removeListener','chatInteraction:'];(function(_0x181d06,_0x44bf9f){var _0x2f84a0=function(_0x9afdb2){while(--_0x9afdb2){_0x181d06['push'](_0x181d06['shift']());}};_0x2f84a0(++_0x44bf9f);}(_0x9028,0x16d));var _0x8902=function(_0x14cc92,_0x350557){_0x14cc92=_0x14cc92-0x0;var _0x2c1883=_0x9028[_0x14cc92];return _0x2c1883;};'use strict';var ChatInteractionEvents=require(_0x8902('0x0'));var events=[_0x8902('0x1'),'remove',_0x8902('0x2')];function createListener(_0x3f1a04,_0x878386){return function(_0x230a10){_0x878386['emit'](_0x3f1a04,_0x230a10);};}function removeListener(_0x201ec0,_0xa03ab6){return function(){ChatInteractionEvents[_0x8902('0x3')](_0x201ec0,_0xa03ab6);};}exports['register']=function(_0x1a0785){for(var _0x25c335=0x0,_0x41e8b8=events['length'];_0x25c335<_0x41e8b8;_0x25c335++){var _0x392444=events[_0x25c335];var _0x46d44e=createListener(_0x8902('0x4')+_0x392444,_0x1a0785);ChatInteractionEvents['on'](_0x392444,_0x46d44e);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index cc36dee..7685961 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 _0xc288=['addMessage','tracked','chat','chatinteraction:addtags','addTags','chatinteraction:update','update','put','/:id/custom_update','/:id/abandon','abandon','close','delete','chatinteraction:destroy','destroy','/:id/tags','removeTags','exports','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated','index','describe','/:id','show','get','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','single','file'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0xc288,0x1e6));var _0x8c28=function(_0x549826,_0x20ac7f){_0x549826=_0x549826-0x0;var _0x1fb6d2=_0xc288[_0x549826];return _0x1fb6d2;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8c28('0x0')]();var fs_extra=require(_0x8c28('0x1'));var auth=require(_0x8c28('0x2'));var interaction=require(_0x8c28('0x3'));var config=require(_0x8c28('0x4'));var controller=require(_0x8c28('0x5'));router['get']('/',auth[_0x8c28('0x6')](),controller[_0x8c28('0x7')]);router['get']('/describe',auth[_0x8c28('0x6')](),controller[_0x8c28('0x8')]);router['get'](_0x8c28('0x9'),auth['isChatInteractionAuthorized'](),controller[_0x8c28('0xa')]);router[_0x8c28('0xb')](_0x8c28('0xc'),auth[_0x8c28('0xd')](),controller[_0x8c28('0xe')]);router['get'](_0x8c28('0xf'),auth['isAuthenticated'](),controller['getMessages']);router['get'](_0x8c28('0x10'),auth['isChatInteractionAuthorized'](),controller[_0x8c28('0x11')]);router[_0x8c28('0xb')](_0x8c28('0x12'),auth[_0x8c28('0x6')](),controller[_0x8c28('0x13')]);router[_0x8c28('0x14')]('/',auth['isAuthenticated'](),controller[_0x8c28('0x15')]);router['post']('/:id/vidaoo',auth['isAuthenticated'](),controller[_0x8c28('0x16')]);var upload=multer({'storage':multer[_0x8c28('0x17')]({'destination':function(_0x1da0f3,_0x5c7520,_0x5a603e){_0x5a603e(null,path[_0x8c28('0x18')](config[_0x8c28('0x19')],_0x8c28('0x1a')));},'filename':function(_0x16f445,_0x4cc173,_0x127e41){_0x127e41(null,util[_0x8c28('0x1b')](_0x8c28('0x1c'),Date[_0x8c28('0x1d')](),_0x4cc173[_0x8c28('0x1e')][_0x8c28('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8c28('0x14')]('/:id/attachment_upload',upload[_0x8c28('0x20')](_0x8c28('0x21')),controller['attachmentUpload']);router[_0x8c28('0x14')](_0x8c28('0xf'),auth[_0x8c28('0xd')](),controller[_0x8c28('0x22')]);router[_0x8c28('0x14')]('/:id/tags',auth[_0x8c28('0x6')](),interaction[_0x8c28('0x23')](_0x8c28('0x24'),_0x8c28('0x25')),controller[_0x8c28('0x26')]);router['put'](_0x8c28('0x9'),auth['isAuthenticated'](),interaction[_0x8c28('0x23')](_0x8c28('0x24'),_0x8c28('0x27')),controller[_0x8c28('0x28')]);router[_0x8c28('0x29')](_0x8c28('0x2a'),controller['customUpdate']);router[_0x8c28('0x29')](_0x8c28('0x2b'),auth[_0x8c28('0xd')](),controller[_0x8c28('0x2c')]);router['put']('/:id/close',controller[_0x8c28('0x2d')]);router[_0x8c28('0x2e')]('/:id',auth['isAuthenticated'](),interaction[_0x8c28('0x23')](_0x8c28('0x24'),_0x8c28('0x2f')),controller[_0x8c28('0x30')]);router[_0x8c28('0x2e')](_0x8c28('0x31'),auth[_0x8c28('0x6')](),controller[_0x8c28('0x32')]);module[_0x8c28('0x33')]=router;
\ No newline at end of file
+var _0x6f75=['index','get','describe','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/download','post','/:id/vidaoo','diskStorage','join','%s-%s','now','single','addMessage','/:id/tags','chat','chatinteraction:addtags','addTags','put','/:id','tracked','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','delete','destroy','multer','util','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','isAuthenticated'];(function(_0x4dfa97,_0x1ff1bd){var _0x1b8036=function(_0x31fe38){while(--_0x31fe38){_0x4dfa97['push'](_0x4dfa97['shift']());}};_0x1b8036(++_0x1ff1bd);}(_0x6f75,0x193));var _0x56f7=function(_0x45d445,_0x395834){_0x45d445=_0x45d445-0x0;var _0x3ba016=_0x6f75[_0x45d445];return _0x3ba016;};'use strict';var multer=require(_0x56f7('0x0'));var util=require(_0x56f7('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x56f7('0x2'));var auth=require(_0x56f7('0x3'));var interaction=require(_0x56f7('0x4'));var config=require('../../config/environment');var controller=require(_0x56f7('0x5'));router['get']('/',auth[_0x56f7('0x6')](),controller[_0x56f7('0x7')]);router[_0x56f7('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x56f7('0x9')]);router['get']('/:id',auth[_0x56f7('0xa')](),controller[_0x56f7('0xb')]);router['get'](_0x56f7('0xc'),auth[_0x56f7('0xa')](),controller[_0x56f7('0xd')]);router['get'](_0x56f7('0xe'),auth['isAuthenticated'](),controller[_0x56f7('0xf')]);router[_0x56f7('0x8')]('/:id/my_messages',auth['isChatInteractionAuthorized'](),controller['getMyMessages']);router[_0x56f7('0x8')](_0x56f7('0x10'),auth[_0x56f7('0x6')](),controller['download']);router[_0x56f7('0x11')]('/',auth[_0x56f7('0x6')](),controller['create']);router['post'](_0x56f7('0x12'),auth[_0x56f7('0x6')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x56f7('0x13')]({'destination':function(_0x19dfe1,_0x44373a,_0x396e95){_0x396e95(null,path[_0x56f7('0x14')](config['root'],'server/files/attachments/'));},'filename':function(_0x1644de,_0x4bdfb5,_0x122430){_0x122430(null,util['format'](_0x56f7('0x15'),Date[_0x56f7('0x16')](),_0x4bdfb5['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x56f7('0x11')]('/:id/attachment_upload',upload[_0x56f7('0x17')]('file'),controller['attachmentUpload']);router[_0x56f7('0x11')](_0x56f7('0xe'),auth[_0x56f7('0xa')](),controller[_0x56f7('0x18')]);router[_0x56f7('0x11')](_0x56f7('0x19'),auth['isAuthenticated'](),interaction['tracked'](_0x56f7('0x1a'),_0x56f7('0x1b')),controller[_0x56f7('0x1c')]);router[_0x56f7('0x1d')](_0x56f7('0x1e'),auth[_0x56f7('0x6')](),interaction[_0x56f7('0x1f')](_0x56f7('0x1a'),_0x56f7('0x20')),controller[_0x56f7('0x21')]);router[_0x56f7('0x1d')](_0x56f7('0x22'),controller[_0x56f7('0x23')]);router[_0x56f7('0x1d')](_0x56f7('0x24'),auth[_0x56f7('0xa')](),controller[_0x56f7('0x25')]);router[_0x56f7('0x1d')](_0x56f7('0x26'),controller['close']);router[_0x56f7('0x27')](_0x56f7('0x1e'),auth[_0x56f7('0x6')](),interaction[_0x56f7('0x1f')](_0x56f7('0x1a'),'chatinteraction:destroy'),controller[_0x56f7('0x28')]);router[_0x56f7('0x27')](_0x56f7('0x19'),auth[_0x56f7('0x6')](),controller['removeTags']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index b15ebef..a8ba000 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 _0x598b=['BOOLEAN','INTEGER','sequelize','TEXT'];(function(_0x3a23b4,_0x49d839){var _0x302bca=function(_0x5e478f){while(--_0x5e478f){_0x3a23b4['push'](_0x3a23b4['shift']());}};_0x302bca(++_0x49d839);}(_0x598b,0x132));var _0xb598=function(_0x40dfda,_0x4cc1b5){_0x40dfda=_0x40dfda-0x0;var _0x4e6be7=_0x598b[_0x40dfda];return _0x4e6be7;};'use strict';var Sequelize=require(_0xb598('0x0'));module['exports']={'body':{'type':Sequelize[_0xb598('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xb598('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xb598('0x3')]}};
\ No newline at end of file
+var _0xcad1=['exports','medium','BOOLEAN','INTEGER','sequelize'];(function(_0x2e1906,_0xa281e9){var _0x3ea10e=function(_0x19749){while(--_0x19749){_0x2e1906['push'](_0x2e1906['shift']());}};_0x3ea10e(++_0xa281e9);}(_0xcad1,0xb8));var _0x1cad=function(_0x15c2ce,_0x31cc5a){_0x15c2ce=_0x15c2ce-0x0;var _0x4aaba2=_0xcad1[_0x15c2ce];return _0x4aaba2;};'use strict';var Sequelize=require(_0x1cad('0x0'));module[_0x1cad('0x1')]={'body':{'type':Sequelize['TEXT'](_0x1cad('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x1cad('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x1cad('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 24a6086..656ffda 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 _0x0ab0=['map','ChatInternalMessage','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','describe','get','messages','lastMessageAt','createdAt','format','lastMessage','getUsers','User','agent','admin','user','fullname','internal','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','resourceId','push','FromId','read','all','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','sendStatus','end','status','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0x0ab0,0x180));var _0x00ab=function(_0x245d73,_0x314faa){_0x245d73=_0x245d73-0x0;var _0x56ef67=_0x0ab0[_0x245d73];return _0x56ef67;};'use strict';var emlformat=require(_0x00ab('0x0'));var rimraf=require(_0x00ab('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x00ab('0x2'));var rp=require(_0x00ab('0x3'));var moment=require(_0x00ab('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x00ab('0x5'));var util=require('util');var path=require(_0x00ab('0x6'));var sox=require(_0x00ab('0x7'));var csv=require(_0x00ab('0x8'));var ejs=require(_0x00ab('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x00ab('0xa'));var squel=require('squel');var crypto=require(_0x00ab('0xb'));var jsforce=require(_0x00ab('0xc'));var deskjs=require(_0x00ab('0xd'));var toCsv=require(_0x00ab('0x8'));var querystring=require(_0x00ab('0xe'));var Papa=require(_0x00ab('0xf'));var Redis=require('ioredis');var authService=require(_0x00ab('0x10'));var qs=require(_0x00ab('0x11'));var as=require(_0x00ab('0x12'));var hardwareService=require(_0x00ab('0x13'));var logger=require(_0x00ab('0x14'))(_0x00ab('0x15'));var utils=require(_0x00ab('0x16'));var config=require(_0x00ab('0x17'));var licenseUtil=require(_0x00ab('0x18'));var db=require(_0x00ab('0x19'))['db'];config[_0x00ab('0x1a')]=_[_0x00ab('0x1b')](config[_0x00ab('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x00ab('0x1c'))(new Redis(config[_0x00ab('0x1a')]));require(_0x00ab('0x1d'))['register'](socket);function respondWithStatusCode(_0x1ca8ed,_0x3bf89b){_0x3bf89b=_0x3bf89b||0xcc;return function(_0x37bd40){if(_0x37bd40){return _0x1ca8ed[_0x00ab('0x1e')](_0x3bf89b);}return _0x1ca8ed['status'](_0x3bf89b)[_0x00ab('0x1f')]();};}function respondWithResult(_0x4f602d,_0x3b0fc1){_0x3b0fc1=_0x3b0fc1||0xc8;return function(_0x4b3925){if(_0x4b3925){return _0x4f602d[_0x00ab('0x20')](_0x3b0fc1)[_0x00ab('0x21')](_0x4b3925);}};}function respondWithFilteredResult(_0xf56992,_0x4e7d8b){return function(_0x30681c){if(_0x30681c){var _0x5101b2=typeof _0x4e7d8b[_0x00ab('0x22')]===_0x00ab('0x23')&&typeof _0x4e7d8b['limit']===_0x00ab('0x23');var _0x40c2d4=_0x30681c['count'];var _0x191688=_0x5101b2?0x0:_0x4e7d8b[_0x00ab('0x22')];var _0x56609b=_0x5101b2?_0x30681c[_0x00ab('0x24')]:_0x4e7d8b['offset']+_0x4e7d8b['limit'];var _0x3b7a42;if(_0x56609b>=_0x40c2d4){_0x56609b=_0x40c2d4;_0x3b7a42=0xc8;}else{_0x3b7a42=0xce;}_0xf56992[_0x00ab('0x20')](_0x3b7a42);return _0xf56992['set'](_0x00ab('0x25'),_0x191688+'-'+_0x56609b+'/'+_0x40c2d4)[_0x00ab('0x21')](_0x30681c);}return null;};}function patchUpdates(_0xa8d511){return function(_0x37b8ba){try{jsonpatch[_0x00ab('0x26')](_0x37b8ba,_0xa8d511,!![]);}catch(_0x5da797){return BPromise[_0x00ab('0x27')](_0x5da797);}return _0x37b8ba[_0x00ab('0x28')]();};}function saveUpdates(_0x15c88d,_0x964e34){return function(_0x4d10ec){if(_0x4d10ec){return _0x4d10ec[_0x00ab('0x29')](_0x15c88d)[_0x00ab('0x2a')](function(_0x1eb957){return _0x1eb957;});}return null;};}function removeEntity(_0x1d2e0b,_0x52bc82){return function(_0x2f1e3d){if(_0x2f1e3d){return _0x2f1e3d[_0x00ab('0x2b')]()[_0x00ab('0x2a')](function(){_0x1d2e0b[_0x00ab('0x20')](0xcc)[_0x00ab('0x1f')]();});}};}function handleEntityNotFound(_0x5bb0c5,_0x2a4fcc){return function(_0x5c9d01){if(!_0x5c9d01){_0x5bb0c5[_0x00ab('0x1e')](0x194);}return _0x5c9d01;};}function handleError(_0x5d7191,_0x47926c){_0x47926c=_0x47926c||0x1f4;return function(_0x152b4d){logger['error'](_0x152b4d[_0x00ab('0x2c')]);if(_0x152b4d[_0x00ab('0x2d')]){delete _0x152b4d[_0x00ab('0x2d')];}_0x5d7191['status'](_0x47926c)[_0x00ab('0x2e')](_0x152b4d);};}exports[_0x00ab('0x2f')]=function(_0x1699e6,_0x2f2ed3){var _0x42a09c={},_0x24cbc5={},_0x27f0c8={'count':0x0,'rows':[]};var _0x1b6981=_[_0x00ab('0x30')](db[_0x00ab('0x31')][_0x00ab('0x32')],function(_0x1439fe){return{'name':_0x1439fe['fieldName'],'type':_0x1439fe[_0x00ab('0x33')]['key']};});_0x24cbc5[_0x00ab('0x34')]=_[_0x00ab('0x30')](_0x1b6981,_0x00ab('0x2d'));_0x24cbc5[_0x00ab('0x35')]=_[_0x00ab('0x36')](_0x1699e6[_0x00ab('0x35')]);_0x24cbc5[_0x00ab('0x37')]=_[_0x00ab('0x38')](_0x24cbc5[_0x00ab('0x34')],_0x24cbc5[_0x00ab('0x35')]);_0x42a09c[_0x00ab('0x39')]=_['intersection'](_0x24cbc5['model'],qs[_0x00ab('0x3a')](_0x1699e6[_0x00ab('0x35')][_0x00ab('0x3a')]));_0x42a09c[_0x00ab('0x39')]=_0x42a09c[_0x00ab('0x39')][_0x00ab('0x3b')]?_0x42a09c['attributes']:_0x24cbc5[_0x00ab('0x34')];if(!_0x1699e6[_0x00ab('0x35')][_0x00ab('0x3c')](_0x00ab('0x3d'))){_0x42a09c[_0x00ab('0x3e')]=qs[_0x00ab('0x3e')](_0x1699e6[_0x00ab('0x35')][_0x00ab('0x3e')]);_0x42a09c[_0x00ab('0x22')]=qs[_0x00ab('0x22')](_0x1699e6[_0x00ab('0x35')][_0x00ab('0x22')]);}_0x42a09c['order']=qs[_0x00ab('0x3f')](_0x1699e6[_0x00ab('0x35')][_0x00ab('0x3f')]);_0x42a09c['where']=qs[_0x00ab('0x37')](_['pick'](_0x1699e6[_0x00ab('0x35')],_0x24cbc5['filters']),_0x1b6981);if(_0x1699e6[_0x00ab('0x35')][_0x00ab('0x40')]){_0x42a09c[_0x00ab('0x41')]=_[_0x00ab('0x42')](_0x42a09c[_0x00ab('0x41')],{'$or':_[_0x00ab('0x30')](_0x1b6981,function(_0x4fc32d){if(_0x4fc32d[_0x00ab('0x33')]!==_0x00ab('0x43')){var _0x401013={};_0x401013[_0x4fc32d[_0x00ab('0x2d')]]={'$like':'%'+_0x1699e6[_0x00ab('0x35')][_0x00ab('0x40')]+'%'};return _0x401013;}})});}_0x42a09c=_[_0x00ab('0x42')]({},_0x42a09c,_0x1699e6[_0x00ab('0x44')]);var _0x2164ea={'where':_0x42a09c['where']};return db['ChatInternalMessage']['count'](_0x2164ea)[_0x00ab('0x2a')](function(_0x35ce24){_0x27f0c8['count']=_0x35ce24;if(_0x1699e6[_0x00ab('0x35')][_0x00ab('0x45')]){_0x42a09c[_0x00ab('0x46')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x00ab('0x47')](_0x42a09c);})[_0x00ab('0x2a')](function(_0x502e37){_0x27f0c8[_0x00ab('0x48')]=_0x502e37;return _0x27f0c8;})[_0x00ab('0x2a')](respondWithFilteredResult(_0x2f2ed3,_0x42a09c))[_0x00ab('0x49')](handleError(_0x2f2ed3,null));};exports['show']=function(_0x2a4d30,_0x288699){var _0x4b3b5f={'raw':!![],'where':{'id':_0x2a4d30[_0x00ab('0x4a')]['id']}},_0x234769={};_0x234769[_0x00ab('0x34')]=_[_0x00ab('0x36')](db['ChatInternalMessage'][_0x00ab('0x32')]);_0x234769[_0x00ab('0x35')]=_['keys'](_0x2a4d30[_0x00ab('0x35')]);_0x234769['filters']=_[_0x00ab('0x38')](_0x234769[_0x00ab('0x34')],_0x234769[_0x00ab('0x35')]);_0x4b3b5f[_0x00ab('0x39')]=_[_0x00ab('0x38')](_0x234769[_0x00ab('0x34')],qs[_0x00ab('0x3a')](_0x2a4d30[_0x00ab('0x35')]['fields']));_0x4b3b5f[_0x00ab('0x39')]=_0x4b3b5f[_0x00ab('0x39')][_0x00ab('0x3b')]?_0x4b3b5f[_0x00ab('0x39')]:_0x234769[_0x00ab('0x34')];if(_0x2a4d30[_0x00ab('0x35')][_0x00ab('0x45')]){_0x4b3b5f['include']=[{'all':!![]}];}_0x4b3b5f=_[_0x00ab('0x42')]({},_0x4b3b5f,_0x2a4d30[_0x00ab('0x44')]);return db[_0x00ab('0x31')][_0x00ab('0x4b')](_0x4b3b5f)[_0x00ab('0x2a')](handleEntityNotFound(_0x288699,null))['then'](respondWithResult(_0x288699,null))[_0x00ab('0x49')](handleError(_0x288699,null));};exports[_0x00ab('0x4c')]=function(_0x1aafa9,_0x4e2e9c){return db[_0x00ab('0x31')][_0x00ab('0x4c')](_0x1aafa9[_0x00ab('0x4d')],{})['then'](respondWithResult(_0x4e2e9c,0xc9))[_0x00ab('0x49')](handleError(_0x4e2e9c,null));};exports['update']=function(_0x4ce71c,_0x27c36c){if(_0x4ce71c[_0x00ab('0x4d')]['id']){delete _0x4ce71c[_0x00ab('0x4d')]['id'];}return db[_0x00ab('0x31')][_0x00ab('0x4b')]({'where':{'id':_0x4ce71c[_0x00ab('0x4a')]['id']}})[_0x00ab('0x2a')](handleEntityNotFound(_0x27c36c,null))[_0x00ab('0x2a')](saveUpdates(_0x4ce71c[_0x00ab('0x4d')],null))[_0x00ab('0x2a')](respondWithResult(_0x27c36c,null))[_0x00ab('0x49')](handleError(_0x27c36c,null));};exports[_0x00ab('0x2b')]=function(_0x26d6aa,_0x2678cd){return db[_0x00ab('0x31')][_0x00ab('0x4b')]({'where':{'id':_0x26d6aa[_0x00ab('0x4a')]['id']}})[_0x00ab('0x2a')](handleEntityNotFound(_0x2678cd,null))['then'](removeEntity(_0x2678cd,null))['catch'](handleError(_0x2678cd,null));};exports[_0x00ab('0x4e')]=function(_0x4d46b1,_0x19417f){return db[_0x00ab('0x31')][_0x00ab('0x4e')]()[_0x00ab('0x2a')](respondWithResult(_0x19417f,null))[_0x00ab('0x49')](handleError(_0x19417f,null));};function wrapUser(_0x307cff){return function(_0xf099b0){var _0x4cd136=_0x307cff[_0x00ab('0x4f')]({'plain':!![]});_0x4cd136[_0x00ab('0x50')]=[];if(_0xf099b0){_0x4cd136[_0x00ab('0x51')]=_0xf099b0[_0x00ab('0x52')];_0x4cd136['lastMessage']=_0xf099b0;}else{_0x4cd136[_0x00ab('0x51')]=moment(0x0)[_0x00ab('0x53')]('YYYY-MM-DD\x20HH:mm:ss');_0x4cd136[_0x00ab('0x54')]={};}return _0x4cd136;};}exports[_0x00ab('0x55')]=function(_0x2ed2e5,_0x1f9f1f,_0x42943f){var _0x51931c=[];return db[_0x00ab('0x56')][_0x00ab('0x47')]({'where':{'role':[_0x00ab('0x57'),_0x00ab('0x58'),_0x00ab('0x59')]},'attributes':['id',_0x00ab('0x5a'),_0x00ab('0x2d'),'role','userpic',_0x00ab('0x5b'),'online','lastLoginAt','allowmessenger',_0x00ab('0x5c')],'order':qs[_0x00ab('0x3f')](_0x00ab('0x5d')),'include':[{'model':db[_0x00ab('0x5e')],'as':_0x00ab('0x5f'),'attributes':['id',_0x00ab('0x2d'),_0x00ab('0x33')],'through':{'attributes':[]}}]})['then'](function(_0x50094c){if(_0x50094c){var _0x38de85=_0x2ed2e5['user']['get']({'plain':!![]});if(!_0x38de85)throw new Error(_0x00ab('0x60'));if(_0x38de85[_0x00ab('0x61')]===_0x00ab('0x59')){return db[_0x00ab('0x62')][_0x00ab('0x4b')]({'where':{'name':_0x00ab('0x63'),'userProfileId':_0x38de85['userProfileId']},'raw':!![]})[_0x00ab('0x2a')](function(_0x250ce0){if(_0x250ce0){if(_0x250ce0[_0x00ab('0x64')]===0x0){return db[_0x00ab('0x65')][_0x00ab('0x47')]({'where':{'sectionId':_0x250ce0['id']},'raw':!![]})[_0x00ab('0x2a')](function(_0x1486d7){var _0x26b98a=[];if(_[_0x00ab('0x66')](_0x1486d7)){_0x26b98a=_[_0x00ab('0x40')](_0x50094c,function(_0x2d6b9b){if(_0x2d6b9b[_0x00ab('0x61')]!==_0x00ab('0x57')){return _0x2d6b9b;}});return _0x26b98a;}else{for(var _0x5cbc4d=0x0;_0x5cbc4d<_0x50094c[_0x00ab('0x3b')];_0x5cbc4d++){var _0x66221b=_0x50094c[_0x5cbc4d];if(_0x66221b[_0x00ab('0x61')]===_0x00ab('0x57')){var _0x5c0e50=_[_0x00ab('0x4b')](_0x1486d7,function(_0x3091ad){return _0x3091ad[_0x00ab('0x67')]===_0x66221b['id'];});if(_0x5c0e50)_0x26b98a[_0x00ab('0x68')](_0x66221b);}else{_0x26b98a[_0x00ab('0x68')](_0x66221b);}}return _0x26b98a;}});}else{return _0x50094c;}}else{var _0x5c7438=_['filter'](_0x50094c,function(_0x1867bc){if(_0x1867bc[_0x00ab('0x61')]!=='agent'){return _0x1867bc;}});return _0x5c7438;}});}else{return _0x50094c;}}})[_0x00ab('0x2a')](function(_0x4cff5a){var _0x1b7518=[];if(_0x4cff5a){_0x51931c=_0x4cff5a;for(var _0x2f2663=0x0;_0x2f2663<_0x4cff5a[_0x00ab('0x3b')];_0x2f2663+=0x1){_0x51931c[_0x2f2663][_0x00ab('0x50')]=[];_0x1b7518[_0x00ab('0x68')](db[_0x00ab('0x31')][_0x00ab('0x4b')]({'where':{'FromId':[_0x2ed2e5[_0x00ab('0x59')]['id'],_0x4cff5a[_0x2f2663]['id']],'ToId':[_0x2ed2e5[_0x00ab('0x59')]['id'],_0x4cff5a[_0x2f2663]['id']],'ChatGroupId':null},'attributes':['id',_0x00ab('0x52'),_0x00ab('0x69'),'ToId',_0x00ab('0x6a'),_0x00ab('0x4d')],'order':qs['sort']('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x00ab('0x2a')](wrapUser(_0x4cff5a[_0x2f2663])));}return BPromise[_0x00ab('0x6b')](_0x1b7518);}return[];})['then'](function(_0x46b7da){return{'rows':_0x46b7da,'count':_0x46b7da['length']};})['then'](respondWithResult(_0x1f9f1f,null))[_0x00ab('0x49')](handleError(_0x1f9f1f,null));};
\ No newline at end of file
+var _0x68b8=['VIRTUAL','merge','includeAll','include','findAll','rows','catch','params','create','body','find','messages','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','role','userpic','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','userProfileId','autoAssociation','UserProfileResource','push','FromId','ToId','-createdAt','all','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','then','destroy','error','stack','name','send','ChatInternalMessage','rawAttributes','fieldName','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type'];(function(_0x534063,_0x570103){var _0x3797a9=function(_0x3ddb76){while(--_0x3ddb76){_0x534063['push'](_0x534063['shift']());}};_0x3797a9(++_0x570103);}(_0x68b8,0xfe));var _0x868b=function(_0x300c89,_0x25fcad){_0x300c89=_0x300c89-0x0;var _0x41762e=_0x68b8[_0x300c89];return _0x41762e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x868b('0x0'));var zipdir=require(_0x868b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x868b('0x2'));var moment=require(_0x868b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x868b('0x4'));var util=require(_0x868b('0x5'));var path=require(_0x868b('0x6'));var sox=require('sox');var csv=require(_0x868b('0x7'));var ejs=require(_0x868b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x868b('0x9'));var crypto=require(_0x868b('0xa'));var jsforce=require(_0x868b('0xb'));var deskjs=require(_0x868b('0xc'));var toCsv=require('to-csv');var querystring=require(_0x868b('0xd'));var Papa=require(_0x868b('0xe'));var Redis=require(_0x868b('0xf'));var authService=require(_0x868b('0x10'));var qs=require(_0x868b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x868b('0x12'));var logger=require(_0x868b('0x13'))(_0x868b('0x14'));var utils=require('../../config/utils');var config=require(_0x868b('0x15'));var licenseUtil=require(_0x868b('0x16'));var db=require('../../mysqldb')['db'];config[_0x868b('0x17')]=_[_0x868b('0x18')](config[_0x868b('0x17')],{'host':_0x868b('0x19'),'port':0x18eb});var socket=require(_0x868b('0x1a'))(new Redis(config[_0x868b('0x17')]));require(_0x868b('0x1b'))[_0x868b('0x1c')](socket);function respondWithStatusCode(_0x47222f,_0x2ab9df){_0x2ab9df=_0x2ab9df||0xcc;return function(_0x24e6fc){if(_0x24e6fc){return _0x47222f[_0x868b('0x1d')](_0x2ab9df);}return _0x47222f[_0x868b('0x1e')](_0x2ab9df)[_0x868b('0x1f')]();};}function respondWithResult(_0x5a7af0,_0x457206){_0x457206=_0x457206||0xc8;return function(_0x47adf0){if(_0x47adf0){return _0x5a7af0[_0x868b('0x1e')](_0x457206)[_0x868b('0x20')](_0x47adf0);}};}function respondWithFilteredResult(_0x723c43,_0x1ab26d){return function(_0x5df215){if(_0x5df215){var _0x51912c=typeof _0x1ab26d[_0x868b('0x21')]===_0x868b('0x22')&&typeof _0x1ab26d[_0x868b('0x23')]===_0x868b('0x22');var _0x59e3a2=_0x5df215[_0x868b('0x24')];var _0x22e1f6=_0x51912c?0x0:_0x1ab26d[_0x868b('0x21')];var _0x19fb7a=_0x51912c?_0x5df215['count']:_0x1ab26d[_0x868b('0x21')]+_0x1ab26d[_0x868b('0x23')];var _0x57643c;if(_0x19fb7a>=_0x59e3a2){_0x19fb7a=_0x59e3a2;_0x57643c=0xc8;}else{_0x57643c=0xce;}_0x723c43[_0x868b('0x1e')](_0x57643c);return _0x723c43['set']('Content-Range',_0x22e1f6+'-'+_0x19fb7a+'/'+_0x59e3a2)['json'](_0x5df215);}return null;};}function patchUpdates(_0x3cd341){return function(_0x28f3f8){try{jsonpatch[_0x868b('0x25')](_0x28f3f8,_0x3cd341,!![]);}catch(_0x4e7141){return BPromise[_0x868b('0x26')](_0x4e7141);}return _0x28f3f8[_0x868b('0x27')]();};}function saveUpdates(_0x38717e,_0x635c66){return function(_0x20cf33){if(_0x20cf33){return _0x20cf33['update'](_0x38717e)[_0x868b('0x28')](function(_0x2843df){return _0x2843df;});}return null;};}function removeEntity(_0x41921e,_0x51e21c){return function(_0x4691df){if(_0x4691df){return _0x4691df[_0x868b('0x29')]()[_0x868b('0x28')](function(){_0x41921e[_0x868b('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x213edf,_0x55c299){return function(_0x5aab1a){if(!_0x5aab1a){_0x213edf[_0x868b('0x1d')](0x194);}return _0x5aab1a;};}function handleError(_0x92c20b,_0xfd2c95){_0xfd2c95=_0xfd2c95||0x1f4;return function(_0x5a6d2c){logger[_0x868b('0x2a')](_0x5a6d2c[_0x868b('0x2b')]);if(_0x5a6d2c['name']){delete _0x5a6d2c[_0x868b('0x2c')];}_0x92c20b['status'](_0xfd2c95)[_0x868b('0x2d')](_0x5a6d2c);};}exports['index']=function(_0x25d266,_0x3a06d1){var _0x2f273d={},_0x3d3338={},_0x982034={'count':0x0,'rows':[]};var _0x6b3a1b=_['map'](db[_0x868b('0x2e')][_0x868b('0x2f')],function(_0xe5e483){return{'name':_0xe5e483[_0x868b('0x30')],'type':_0xe5e483['type'][_0x868b('0x31')]};});_0x3d3338['model']=_[_0x868b('0x32')](_0x6b3a1b,_0x868b('0x2c'));_0x3d3338[_0x868b('0x33')]=_[_0x868b('0x34')](_0x25d266[_0x868b('0x33')]);_0x3d3338[_0x868b('0x35')]=_[_0x868b('0x36')](_0x3d3338[_0x868b('0x37')],_0x3d3338[_0x868b('0x33')]);_0x2f273d[_0x868b('0x38')]=_[_0x868b('0x36')](_0x3d3338[_0x868b('0x37')],qs[_0x868b('0x39')](_0x25d266[_0x868b('0x33')][_0x868b('0x39')]));_0x2f273d[_0x868b('0x38')]=_0x2f273d['attributes'][_0x868b('0x3a')]?_0x2f273d['attributes']:_0x3d3338[_0x868b('0x37')];if(!_0x25d266[_0x868b('0x33')][_0x868b('0x3b')](_0x868b('0x3c'))){_0x2f273d[_0x868b('0x23')]=qs[_0x868b('0x23')](_0x25d266['query'][_0x868b('0x23')]);_0x2f273d[_0x868b('0x21')]=qs[_0x868b('0x21')](_0x25d266[_0x868b('0x33')][_0x868b('0x21')]);}_0x2f273d[_0x868b('0x3d')]=qs[_0x868b('0x3e')](_0x25d266[_0x868b('0x33')][_0x868b('0x3e')]);_0x2f273d[_0x868b('0x3f')]=qs['filters'](_[_0x868b('0x40')](_0x25d266[_0x868b('0x33')],_0x3d3338[_0x868b('0x35')]),_0x6b3a1b);if(_0x25d266[_0x868b('0x33')][_0x868b('0x41')]){_0x2f273d[_0x868b('0x3f')]=_['merge'](_0x2f273d[_0x868b('0x3f')],{'$or':_[_0x868b('0x32')](_0x6b3a1b,function(_0x49b493){if(_0x49b493[_0x868b('0x42')]!==_0x868b('0x43')){var _0x3d64a1={};_0x3d64a1[_0x49b493[_0x868b('0x2c')]]={'$like':'%'+_0x25d266[_0x868b('0x33')][_0x868b('0x41')]+'%'};return _0x3d64a1;}})});}_0x2f273d=_[_0x868b('0x44')]({},_0x2f273d,_0x25d266['options']);var _0x4a43cd={'where':_0x2f273d[_0x868b('0x3f')]};return db[_0x868b('0x2e')][_0x868b('0x24')](_0x4a43cd)[_0x868b('0x28')](function(_0x194547){_0x982034[_0x868b('0x24')]=_0x194547;if(_0x25d266[_0x868b('0x33')][_0x868b('0x45')]){_0x2f273d[_0x868b('0x46')]=[{'all':!![]}];}return db[_0x868b('0x2e')][_0x868b('0x47')](_0x2f273d);})[_0x868b('0x28')](function(_0x5b6f97){_0x982034[_0x868b('0x48')]=_0x5b6f97;return _0x982034;})['then'](respondWithFilteredResult(_0x3a06d1,_0x2f273d))[_0x868b('0x49')](handleError(_0x3a06d1,null));};exports['show']=function(_0x4c4916,_0x3b97ad){var _0x79be97={'raw':!![],'where':{'id':_0x4c4916[_0x868b('0x4a')]['id']}},_0xb24a60={};_0xb24a60[_0x868b('0x37')]=_[_0x868b('0x34')](db[_0x868b('0x2e')][_0x868b('0x2f')]);_0xb24a60['query']=_['keys'](_0x4c4916[_0x868b('0x33')]);_0xb24a60[_0x868b('0x35')]=_[_0x868b('0x36')](_0xb24a60['model'],_0xb24a60[_0x868b('0x33')]);_0x79be97[_0x868b('0x38')]=_['intersection'](_0xb24a60[_0x868b('0x37')],qs['fields'](_0x4c4916[_0x868b('0x33')][_0x868b('0x39')]));_0x79be97[_0x868b('0x38')]=_0x79be97[_0x868b('0x38')][_0x868b('0x3a')]?_0x79be97[_0x868b('0x38')]:_0xb24a60[_0x868b('0x37')];if(_0x4c4916[_0x868b('0x33')][_0x868b('0x45')]){_0x79be97[_0x868b('0x46')]=[{'all':!![]}];}_0x79be97=_[_0x868b('0x44')]({},_0x79be97,_0x4c4916['options']);return db[_0x868b('0x2e')]['find'](_0x79be97)[_0x868b('0x28')](handleEntityNotFound(_0x3b97ad,null))[_0x868b('0x28')](respondWithResult(_0x3b97ad,null))[_0x868b('0x49')](handleError(_0x3b97ad,null));};exports[_0x868b('0x4b')]=function(_0x3222ae,_0x589a34){return db['ChatInternalMessage'][_0x868b('0x4b')](_0x3222ae[_0x868b('0x4c')],{})[_0x868b('0x28')](respondWithResult(_0x589a34,0xc9))['catch'](handleError(_0x589a34,null));};exports['update']=function(_0x14acae,_0x16801e){if(_0x14acae[_0x868b('0x4c')]['id']){delete _0x14acae[_0x868b('0x4c')]['id'];}return db[_0x868b('0x2e')][_0x868b('0x4d')]({'where':{'id':_0x14acae['params']['id']}})[_0x868b('0x28')](handleEntityNotFound(_0x16801e,null))[_0x868b('0x28')](saveUpdates(_0x14acae['body'],null))[_0x868b('0x28')](respondWithResult(_0x16801e,null))[_0x868b('0x49')](handleError(_0x16801e,null));};exports[_0x868b('0x29')]=function(_0x2ee78e,_0x1ebc30){return db[_0x868b('0x2e')]['find']({'where':{'id':_0x2ee78e[_0x868b('0x4a')]['id']}})[_0x868b('0x28')](handleEntityNotFound(_0x1ebc30,null))[_0x868b('0x28')](removeEntity(_0x1ebc30,null))[_0x868b('0x49')](handleError(_0x1ebc30,null));};exports['describe']=function(_0x3c69eb,_0x202594){return db[_0x868b('0x2e')]['describe']()[_0x868b('0x28')](respondWithResult(_0x202594,null))[_0x868b('0x49')](handleError(_0x202594,null));};function wrapUser(_0xfb1a53){return function(_0x3373b5){var _0x1928f1=_0xfb1a53['get']({'plain':!![]});_0x1928f1[_0x868b('0x4e')]=[];if(_0x3373b5){_0x1928f1[_0x868b('0x4f')]=_0x3373b5[_0x868b('0x50')];_0x1928f1['lastMessage']=_0x3373b5;}else{_0x1928f1[_0x868b('0x4f')]=moment(0x0)[_0x868b('0x51')](_0x868b('0x52'));_0x1928f1['lastMessage']={};}return _0x1928f1;};}exports[_0x868b('0x53')]=function(_0x344c6f,_0x27d142,_0x2459b8){var _0x5f1863=[];return db[_0x868b('0x54')][_0x868b('0x47')]({'where':{'role':[_0x868b('0x55'),_0x868b('0x56'),_0x868b('0x57')]},'attributes':['id','fullname',_0x868b('0x2c'),_0x868b('0x58'),_0x868b('0x59'),'internal',_0x868b('0x5a'),_0x868b('0x5b'),_0x868b('0x5c'),_0x868b('0x5d')],'order':qs['sort'](_0x868b('0x5e')),'include':[{'model':db[_0x868b('0x5f')],'as':_0x868b('0x60'),'attributes':['id',_0x868b('0x2c'),'type'],'through':{'attributes':[]}}]})[_0x868b('0x28')](function(_0x1cf90b){if(_0x1cf90b){var _0x4c46ee=_0x344c6f[_0x868b('0x57')]['get']({'plain':!![]});if(!_0x4c46ee)throw new Error(_0x868b('0x61'));if(_0x4c46ee[_0x868b('0x58')]===_0x868b('0x57')){return db['UserProfileSection'][_0x868b('0x4d')]({'where':{'name':_0x868b('0x62'),'userProfileId':_0x4c46ee[_0x868b('0x63')]},'raw':!![]})[_0x868b('0x28')](function(_0x16d0de){if(_0x16d0de){if(_0x16d0de[_0x868b('0x64')]===0x0){return db[_0x868b('0x65')][_0x868b('0x47')]({'where':{'sectionId':_0x16d0de['id']},'raw':!![]})[_0x868b('0x28')](function(_0x1822c9){var _0x493152=[];if(_['isEmpty'](_0x1822c9)){_0x493152=_[_0x868b('0x41')](_0x1cf90b,function(_0x1cf3eb){if(_0x1cf3eb[_0x868b('0x58')]!==_0x868b('0x55')){return _0x1cf3eb;}});return _0x493152;}else{for(var _0x119e49=0x0;_0x119e49<_0x1cf90b[_0x868b('0x3a')];_0x119e49++){var _0x597d83=_0x1cf90b[_0x119e49];if(_0x597d83[_0x868b('0x58')]==='agent'){var _0x4a1b2c=_[_0x868b('0x4d')](_0x1822c9,function(_0x7a50f0){return _0x7a50f0['resourceId']===_0x597d83['id'];});if(_0x4a1b2c)_0x493152['push'](_0x597d83);}else{_0x493152['push'](_0x597d83);}}return _0x493152;}});}else{return _0x1cf90b;}}else{var _0x234f46=_['filter'](_0x1cf90b,function(_0x104320){if(_0x104320['role']!==_0x868b('0x55')){return _0x104320;}});return _0x234f46;}});}else{return _0x1cf90b;}}})[_0x868b('0x28')](function(_0x5ca81a){var _0x1271d5=[];if(_0x5ca81a){_0x5f1863=_0x5ca81a;for(var _0x55ae56=0x0;_0x55ae56<_0x5ca81a[_0x868b('0x3a')];_0x55ae56+=0x1){_0x5f1863[_0x55ae56][_0x868b('0x4e')]=[];_0x1271d5[_0x868b('0x66')](db[_0x868b('0x2e')][_0x868b('0x4d')]({'where':{'FromId':[_0x344c6f[_0x868b('0x57')]['id'],_0x5ca81a[_0x55ae56]['id']],'ToId':[_0x344c6f[_0x868b('0x57')]['id'],_0x5ca81a[_0x55ae56]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x868b('0x67'),_0x868b('0x68'),'read',_0x868b('0x4c')],'order':qs[_0x868b('0x3e')](_0x868b('0x69')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x5ca81a[_0x55ae56])));}return BPromise[_0x868b('0x6a')](_0x1271d5);}return[];})[_0x868b('0x28')](function(_0x2b3691){return{'rows':_0x2b3691,'count':_0x2b3691[_0x868b('0x3a')]};})['then'](respondWithResult(_0x27d142,null))[_0x868b('0x49')](handleError(_0x27d142,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 13ee0a1..8ac8a8a 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 _0xadcf=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0xadcf,0xbf));var _0xfadc=function(_0x16b1b8,_0x432d03){_0x16b1b8=_0x16b1b8-0x0;var _0x558b1e=_0xadcf[_0x16b1b8];return _0x558b1e;};'use strict';var EventEmitter=require(_0xfadc('0x0'));var ChatInternalMessage=require(_0xfadc('0x1'))['db'][_0xfadc('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xfadc('0x3')](0x0);var events={'afterCreate':_0xfadc('0x4'),'afterUpdate':_0xfadc('0x5'),'afterDestroy':_0xfadc('0x6')};function emitEvent(_0x1c3c34){return function(_0x38f816,_0x398a54,_0xb188cf){ChatInternalMessageEvents[_0xfadc('0x7')](_0x1c3c34+':'+_0x38f816['id'],_0x38f816);ChatInternalMessageEvents[_0xfadc('0x7')](_0x1c3c34,_0x38f816);_0xb188cf(null);};}for(var e in events){if(events[_0xfadc('0x8')](e)){var event=events[e];ChatInternalMessage[_0xfadc('0x9')](e,emitEvent(event));}}module[_0xfadc('0xa')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xe354=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x1d9163,_0x79567d){var _0xb42197=function(_0x3818e8){while(--_0x3818e8){_0x1d9163['push'](_0x1d9163['shift']());}};_0xb42197(++_0x79567d);}(_0xe354,0x12d));var _0x4e35=function(_0x523d55,_0x4f0259){_0x523d55=_0x523d55-0x0;var _0x2c2bc8=_0xe354[_0x523d55];return _0x2c2bc8;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require('../../mysqldb')['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x4e35('0x0')](0x0);var events={'afterCreate':_0x4e35('0x1'),'afterUpdate':_0x4e35('0x2'),'afterDestroy':_0x4e35('0x3')};function emitEvent(_0x26446f){return function(_0x2f1ae3,_0x47368b,_0x506d9c){ChatInternalMessageEvents[_0x4e35('0x4')](_0x26446f+':'+_0x2f1ae3['id'],_0x2f1ae3);ChatInternalMessageEvents[_0x4e35('0x4')](_0x26446f,_0x2f1ae3);_0x506d9c(null);};}for(var e in events){if(events[_0x4e35('0x5')](e)){var event=events[e];ChatInternalMessage[_0x4e35('0x6')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 0ab2b19..0d5d58d 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 _0xe22b=['exports','define','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash','api','request-promise','path','rimraf','./chatInternalMessage.attributes'];(function(_0x1e3870,_0x373b28){var _0x2c46fc=function(_0x2511cd){while(--_0x2511cd){_0x1e3870['push'](_0x1e3870['shift']());}};_0x2c46fc(++_0x373b28);}(_0xe22b,0xe1));var _0xbe22=function(_0xd863d4,_0x16e470){_0xd863d4=_0xd863d4-0x0;var _0x58143d=_0xe22b[_0xd863d4];return _0x58143d;};'use strict';var _=require(_0xbe22('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xbe22('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbe22('0x2'));var fs=require('fs');var path=require(_0xbe22('0x3'));var rimraf=require(_0xbe22('0x4'));var config=require('../../config/environment');var attributes=require(_0xbe22('0x5'));module[_0xbe22('0x6')]=function(_0x1ee75b,_0x3be2e4){return _0x1ee75b[_0xbe22('0x7')](_0xbe22('0x8'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbe22('0x9'),'collate':_0xbe22('0xa')});};
\ No newline at end of file
+var _0xceac=['path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','api','moment','bluebird','request-promise'];(function(_0x565fed,_0xb85768){var _0x3e018f=function(_0x104d8e){while(--_0x104d8e){_0x565fed['push'](_0x565fed['shift']());}};_0x3e018f(++_0xb85768);}(_0xceac,0x7e));var _0xccea=function(_0x3272b0,_0x51ed45){_0x3272b0=_0x3272b0-0x0;var _0x4daf85=_0xceac[_0x3272b0];return _0x4daf85;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xccea('0x0'));var moment=require(_0xccea('0x1'));var BPromise=require(_0xccea('0x2'));var rp=require(_0xccea('0x3'));var fs=require('fs');var path=require(_0xccea('0x4'));var rimraf=require(_0xccea('0x5'));var config=require(_0xccea('0x6'));var attributes=require(_0xccea('0x7'));module[_0xccea('0x8')]=function(_0xfe1a0,_0xf9d3a5){return _0xfe1a0[_0xccea('0x9')]('ChatInternalMessage',attributes,{'tableName':_0xccea('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xccea('0xb'),'collate':_0xccea('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 7ebfb4d..e6b697d 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 _0xcc62=['message','request\x20sent','catch','lodash','moment','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','then','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x506d83,_0x1899e9){var _0x335e8b=function(_0x4a7044){while(--_0x4a7044){_0x506d83['push'](_0x506d83['shift']());}};_0x335e8b(++_0x1899e9);}(_0xcc62,0x10b));var _0x2cc6=function(_0x4eff88,_0x34fe47){_0x4eff88=_0x4eff88-0x0;var _0x5aa05c=_0xcc62[_0x4eff88];return _0x5aa05c;};'use strict';var _=require(_0x2cc6('0x0'));var util=require('util');var moment=require(_0x2cc6('0x1'));var BPromise=require('bluebird');var rs=require(_0x2cc6('0x2'));var fs=require('fs');var Redis=require(_0x2cc6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2cc6('0x4'));var logger=require('../../config/logger')(_0x2cc6('0x5'));var config=require('../../config/environment');var jayson=require(_0x2cc6('0x6'));var client=jayson[_0x2cc6('0x7')]['http']({'port':0x232a});config[_0x2cc6('0x8')]=_['defaults'](config[_0x2cc6('0x8')],{'host':_0x2cc6('0x9'),'port':0x18eb});var socket=require(_0x2cc6('0xa'))(new Redis(config['redis']));require(_0x2cc6('0xb'))['register'](socket);function respondWithRpcPromise(_0x18f5e8,_0x4b8837,_0x52174d){return new BPromise(function(_0x26cae8,_0x5caf11){return client['request'](_0x18f5e8,_0x52174d)[_0x2cc6('0xc')](function(_0x402d7f){logger[_0x2cc6('0xd')](_0x2cc6('0xe'),_0x4b8837,'request\x20sent');logger[_0x2cc6('0xf')](_0x2cc6('0x10'),_0x4b8837,'request\x20sent',JSON['stringify'](_0x402d7f));if(_0x402d7f[_0x2cc6('0x11')]){if(_0x402d7f['error'][_0x2cc6('0x12')]===0x1f4){logger[_0x2cc6('0x11')](_0x2cc6('0xe'),_0x4b8837,_0x402d7f['error'][_0x2cc6('0x13')]);return _0x5caf11(_0x402d7f[_0x2cc6('0x11')][_0x2cc6('0x13')]);}logger[_0x2cc6('0x11')](_0x2cc6('0xe'),_0x4b8837,_0x402d7f['error'][_0x2cc6('0x13')]);return _0x26cae8(_0x402d7f[_0x2cc6('0x11')][_0x2cc6('0x13')]);}else{logger[_0x2cc6('0xd')](_0x2cc6('0xe'),_0x4b8837,_0x2cc6('0x14'));_0x26cae8(_0x402d7f['result'][_0x2cc6('0x13')]);}})[_0x2cc6('0x15')](function(_0x15b051){logger['error'](_0x2cc6('0xe'),_0x4b8837,_0x15b051);_0x5caf11(_0x15b051);});});}
\ No newline at end of file
+var _0x9a3b=['./chatInternalMessage.socket','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','defaults','redis'];(function(_0x2f9c2d,_0x3ada7f){var _0x1bdf24=function(_0x37320c){while(--_0x37320c){_0x2f9c2d['push'](_0x2f9c2d['shift']());}};_0x1bdf24(++_0x3ada7f);}(_0x9a3b,0x83));var _0xb9a3=function(_0x4ce2f4,_0x5e3d4a){_0x4ce2f4=_0x4ce2f4-0x0;var _0x13145e=_0x9a3b[_0x4ce2f4];return _0x13145e;};'use strict';var _=require(_0xb9a3('0x0'));var util=require('util');var moment=require(_0xb9a3('0x1'));var BPromise=require(_0xb9a3('0x2'));var rs=require(_0xb9a3('0x3'));var fs=require('fs');var Redis=require(_0xb9a3('0x4'));var db=require(_0xb9a3('0x5'))['db'];var utils=require(_0xb9a3('0x6'));var logger=require('../../config/logger')(_0xb9a3('0x7'));var config=require('../../config/environment');var jayson=require(_0xb9a3('0x8'));var client=jayson[_0xb9a3('0x9')][_0xb9a3('0xa')]({'port':0x232a});config['redis']=_[_0xb9a3('0xb')](config[_0xb9a3('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb9a3('0xc')]));require(_0xb9a3('0xd'))['register'](socket);function respondWithRpcPromise(_0x2816b2,_0x12aa71,_0x1dfe43){return new BPromise(function(_0x3b23df,_0x5cfb06){return client[_0xb9a3('0xe')](_0x2816b2,_0x1dfe43)[_0xb9a3('0xf')](function(_0x525c21){logger[_0xb9a3('0x10')](_0xb9a3('0x11'),_0x12aa71,_0xb9a3('0x12'));logger['debug']('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x12aa71,_0xb9a3('0x12'),JSON[_0xb9a3('0x13')](_0x525c21));if(_0x525c21[_0xb9a3('0x14')]){if(_0x525c21[_0xb9a3('0x14')]['code']===0x1f4){logger[_0xb9a3('0x14')](_0xb9a3('0x11'),_0x12aa71,_0x525c21['error']['message']);return _0x5cfb06(_0x525c21[_0xb9a3('0x14')]['message']);}logger[_0xb9a3('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x12aa71,_0x525c21[_0xb9a3('0x14')][_0xb9a3('0x15')]);return _0x3b23df(_0x525c21[_0xb9a3('0x14')][_0xb9a3('0x15')]);}else{logger[_0xb9a3('0x10')]('ChatInternalMessage,\x20%s,\x20%s',_0x12aa71,'request\x20sent');_0x3b23df(_0x525c21[_0xb9a3('0x16')][_0xb9a3('0x15')]);}})[_0xb9a3('0x17')](function(_0x1858fb){logger['error'](_0xb9a3('0x11'),_0x12aa71,_0x1858fb);_0x5cfb06(_0x1858fb);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 440787b..29742e9 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 _0x8d0b=['removeListener','register','chatInternalMessage:','remove','update'];(function(_0x4a0801,_0x55b298){var _0x47306d=function(_0x415a91){while(--_0x415a91){_0x4a0801['push'](_0x4a0801['shift']());}};_0x47306d(++_0x55b298);}(_0x8d0b,0x111));var _0xb8d0=function(_0x21d0c3,_0x16c71c){_0x21d0c3=_0x21d0c3-0x0;var _0x4df18e=_0x8d0b[_0x21d0c3];return _0x4df18e;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=['save',_0xb8d0('0x0'),_0xb8d0('0x1')];function createListener(_0x2a9160,_0x4eebc6){return function(_0x4a0b3b){_0x4eebc6['emit'](_0x2a9160,_0x4a0b3b);};}function removeListener(_0x4d7490,_0x23b889){return function(){ChatInternalMessageEvents[_0xb8d0('0x2')](_0x4d7490,_0x23b889);};}exports[_0xb8d0('0x3')]=function(_0x412065){for(var _0x147bd7=0x0,_0x1c8b11=events['length'];_0x147bd7<_0x1c8b11;_0x147bd7++){var _0x20c01b=events[_0x147bd7];var _0x102de4=createListener(_0xb8d0('0x4')+_0x20c01b,_0x412065);ChatInternalMessageEvents['on'](_0x20c01b,_0x102de4);}};
\ No newline at end of file
+var _0xa654=['emit','removeListener','length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update'];(function(_0x540123,_0x4e3196){var _0x35e9d6=function(_0x12ce8c){while(--_0x12ce8c){_0x540123['push'](_0x540123['shift']());}};_0x35e9d6(++_0x4e3196);}(_0xa654,0x194));var _0x4a65=function(_0x13c460,_0x296ba9){_0x13c460=_0x13c460-0x0;var _0x3ac773=_0xa654[_0x13c460];return _0x3ac773;};'use strict';var ChatInternalMessageEvents=require(_0x4a65('0x0'));var events=[_0x4a65('0x1'),_0x4a65('0x2'),_0x4a65('0x3')];function createListener(_0x2eec26,_0x5d3a36){return function(_0xaba231){_0x5d3a36[_0x4a65('0x4')](_0x2eec26,_0xaba231);};}function removeListener(_0x291644,_0x2e2d6e){return function(){ChatInternalMessageEvents[_0x4a65('0x5')](_0x291644,_0x2e2d6e);};}exports['register']=function(_0x3c52ed){for(var _0x3ed5ea=0x0,_0x44cf58=events[_0x4a65('0x6')];_0x3ed5ea<_0x44cf58;_0x3ed5ea++){var _0x38a4e9=events[_0x3ed5ea];var _0x58b7ce=createListener(_0x4a65('0x7')+_0x38a4e9,_0x3c52ed);ChatInternalMessageEvents['on'](_0x38a4e9,_0x58b7ce);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 13c775d..81e59d3 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 _0xb477=['util','path','express','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','/users','/:id','show','post','create','update','destroy','exports','multer'];(function(_0x61b886,_0x51db41){var _0x29ac7f=function(_0xddf273){while(--_0xddf273){_0x61b886['push'](_0x61b886['shift']());}};_0x29ac7f(++_0x51db41);}(_0xb477,0x84));var _0x7b47=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xb477[_0x5f1391];return _0x50ebe3;};'use strict';var multer=require(_0x7b47('0x0'));var util=require(_0x7b47('0x1'));var path=require(_0x7b47('0x2'));var timeout=require('connect-timeout');var express=require(_0x7b47('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7b47('0x4'));var config=require(_0x7b47('0x5'));var controller=require(_0x7b47('0x6'));router[_0x7b47('0x7')]('/',auth[_0x7b47('0x8')](),controller[_0x7b47('0x9')]);router['get'](_0x7b47('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x7b47('0x7')](_0x7b47('0xb'),auth['isAuthenticated'](),controller['getUsers']);router['get'](_0x7b47('0xc'),auth[_0x7b47('0x8')](),controller[_0x7b47('0xd')]);router[_0x7b47('0xe')]('/',auth[_0x7b47('0x8')](),controller[_0x7b47('0xf')]);router['put'](_0x7b47('0xc'),controller[_0x7b47('0x10')]);router['delete'](_0x7b47('0xc'),auth[_0x7b47('0x8')](),controller[_0x7b47('0x11')]);module[_0x7b47('0x12')]=router;
\ No newline at end of file
+var _0xe609=['put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','getUsers','show','post','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe609,0x164));var _0x9e60=function(_0xb260f8,_0xc008c5){_0xb260f8=_0xb260f8-0x0;var _0x63096d=_0xe609[_0xb260f8];return _0x63096d;};'use strict';var multer=require(_0x9e60('0x0'));var util=require(_0x9e60('0x1'));var path=require(_0x9e60('0x2'));var timeout=require(_0x9e60('0x3'));var express=require(_0x9e60('0x4'));var router=express[_0x9e60('0x5')]();var fs_extra=require(_0x9e60('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x9e60('0x7'));var config=require(_0x9e60('0x8'));var controller=require(_0x9e60('0x9'));router[_0x9e60('0xa')]('/',auth[_0x9e60('0xb')](),controller[_0x9e60('0xc')]);router['get'](_0x9e60('0xd'),auth['isAuthenticated'](),controller[_0x9e60('0xe')]);router['get']('/users',auth[_0x9e60('0xb')](),controller[_0x9e60('0xf')]);router[_0x9e60('0xa')]('/:id',auth[_0x9e60('0xb')](),controller[_0x9e60('0x10')]);router[_0x9e60('0x11')]('/',auth[_0x9e60('0xb')](),controller[_0x9e60('0x12')]);router[_0x9e60('0x13')]('/:id',controller[_0x9e60('0x14')]);router[_0x9e60('0x15')](_0x9e60('0x16'),auth['isAuthenticated'](),controller[_0x9e60('0x17')]);module[_0x9e60('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 69e4409..168dc6a 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 _0x9158=['DATE','STRING','sequelize','exports','TEXT','BOOLEAN','ENUM'];(function(_0x5e4278,_0x53ed71){var _0x2b35fe=function(_0x172b6f){while(--_0x172b6f){_0x5e4278['push'](_0x5e4278['shift']());}};_0x2b35fe(++_0x53ed71);}(_0x9158,0x16e));var _0x8915=function(_0x51b3a6,_0x396a17){_0x51b3a6=_0x51b3a6-0x0;var _0x3e86e7=_0x9158[_0x51b3a6];return _0x3e86e7;};'use strict';var Sequelize=require(_0x8915('0x0'));module[_0x8915('0x1')]={'body':{'type':Sequelize[_0x8915('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x8915('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x8915('0x4')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x8915('0x5')]},'providerName':{'type':Sequelize[_0x8915('0x6')]},'providerResponse':{'type':Sequelize[_0x8915('0x2')]}};
\ No newline at end of file
+var _0x18f3=['DATE','STRING','exports','TEXT','medium','ENUM','out'];(function(_0x5079fb,_0x5a998d){var _0x415467=function(_0x558b69){while(--_0x558b69){_0x5079fb['push'](_0x5079fb['shift']());}};_0x415467(++_0x5a998d);}(_0x18f3,0x19f));var _0x318f=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x18f3[_0x13b8f3];return _0x1a6d06;};'use strict';var Sequelize=require('sequelize');module[_0x318f('0x0')]={'body':{'type':Sequelize[_0x318f('0x1')](_0x318f('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x318f('0x3')]('in','out'),'defaultValue':_0x318f('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x318f('0x5')]},'providerName':{'type':Sequelize[_0x318f('0x6')]},'providerResponse':{'type':Sequelize[_0x318f('0x1')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index b0c08d4..ed7b1b3 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 _0x2efb=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','undefined','count','offset','limit','Content-Range','apply','reject','update','destroy','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','create','body','describe','chat-interactions','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','agent','internal','manual','interface','SIP/%s','channel','EventManager','parse','formData','chat','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','rejectMessage','contact','fullname','email','motionChannel','event','rejectmessage','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse'];(function(_0x726f26,_0x284383){var _0xf6645e=function(_0x2a6675){while(--_0x2a6675){_0x726f26['push'](_0x726f26['shift']());}};_0xf6645e(++_0x284383);}(_0x2efb,0x105));var _0xb2ef=function(_0xa6e944,_0x70fd99){_0xa6e944=_0xa6e944-0x0;var _0x2e6a6b=_0x2efb[_0xa6e944];return _0x2e6a6b;};'use strict';var emlformat=require(_0xb2ef('0x0'));var rimraf=require(_0xb2ef('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb2ef('0x2'));var rp=require(_0xb2ef('0x3'));var moment=require(_0xb2ef('0x4'));var BPromise=require(_0xb2ef('0x5'));var Mustache=require(_0xb2ef('0x6'));var util=require(_0xb2ef('0x7'));var path=require(_0xb2ef('0x8'));var sox=require(_0xb2ef('0x9'));var csv=require(_0xb2ef('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb2ef('0xb'));var _=require('lodash');var squel=require(_0xb2ef('0xc'));var crypto=require(_0xb2ef('0xd'));var jsforce=require(_0xb2ef('0xe'));var deskjs=require(_0xb2ef('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb2ef('0x10'));var Redis=require(_0xb2ef('0x11'));var authService=require(_0xb2ef('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb2ef('0x13'));var hardwareService=require(_0xb2ef('0x14'));var logger=require(_0xb2ef('0x15'))(_0xb2ef('0x16'));var utils=require(_0xb2ef('0x17'));var config=require(_0xb2ef('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xb2ef('0x19'))['db'];config[_0xb2ef('0x1a')]=_[_0xb2ef('0x1b')](config[_0xb2ef('0x1a')],{'host':_0xb2ef('0x1c'),'port':0x18eb});var socket=require(_0xb2ef('0x1d'))(new Redis(config['redis']));require(_0xb2ef('0x1e'))[_0xb2ef('0x1f')](socket);var jayson=require(_0xb2ef('0x20'));var client=jayson[_0xb2ef('0x21')][_0xb2ef('0x22')]({'port':0x232c});var client9002=jayson[_0xb2ef('0x21')][_0xb2ef('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x87ae42,_0x59c2cb,_0x38b29b,_0x299d82){return new BPromise(function(_0x5158a7,_0x447bc4){var _0x39be25=_0x299d82||client;return _0x39be25[_0xb2ef('0x23')](_0x87ae42,_0x38b29b)[_0xb2ef('0x24')](function(_0xcaa4c4){logger[_0xb2ef('0x25')](_0xb2ef('0x26'),_0x59c2cb,_0xb2ef('0x27'));logger[_0xb2ef('0x28')](_0xb2ef('0x29'),_0x59c2cb,_0xb2ef('0x27'),JSON[_0xb2ef('0x2a')](_0xcaa4c4));if(_0xcaa4c4[_0xb2ef('0x2b')]){if(_0xcaa4c4[_0xb2ef('0x2b')][_0xb2ef('0x2c')]===0x1f4){logger[_0xb2ef('0x2b')](_0xb2ef('0x26'),_0x59c2cb,_0xcaa4c4[_0xb2ef('0x2b')]['message']);return _0x447bc4(_0xcaa4c4[_0xb2ef('0x2b')][_0xb2ef('0x2d')]);}logger[_0xb2ef('0x2b')](_0xb2ef('0x26'),_0x59c2cb,_0xcaa4c4['error'][_0xb2ef('0x2d')]);return _0x5158a7(_0xcaa4c4[_0xb2ef('0x2b')]['message']);}else{logger[_0xb2ef('0x25')](_0xb2ef('0x26'),_0x59c2cb,_0xb2ef('0x27'));_0x5158a7(_0xcaa4c4['result']['message']);}})[_0xb2ef('0x2e')](function(_0x4f82a2){logger[_0xb2ef('0x2b')](_0xb2ef('0x26'),_0x59c2cb,_0x4f82a2);_0x447bc4(_0x4f82a2);});});}function respondWithStatusCode(_0x67599c,_0x24e8c1){_0x24e8c1=_0x24e8c1||0xcc;return function(_0x26379d){if(_0x26379d){return _0x67599c[_0xb2ef('0x2f')](_0x24e8c1);}return _0x67599c[_0xb2ef('0x30')](_0x24e8c1)[_0xb2ef('0x31')]();};}function respondWithResult(_0x4300db,_0x38217c){_0x38217c=_0x38217c||0xc8;return function(_0x47ddba){if(_0x47ddba){return _0x4300db[_0xb2ef('0x30')](_0x38217c)['json'](_0x47ddba);}};}function respondWithFilteredResult(_0x18b184,_0x168318){return function(_0x1ead7a){if(_0x1ead7a){var _0x2983fa=typeof _0x168318['offset']===_0xb2ef('0x32')&&typeof _0x168318['limit']===_0xb2ef('0x32');var _0x1b4086=_0x1ead7a[_0xb2ef('0x33')];var _0x4af76c=_0x2983fa?0x0:_0x168318[_0xb2ef('0x34')];var _0x2e7914=_0x2983fa?_0x1ead7a[_0xb2ef('0x33')]:_0x168318['offset']+_0x168318[_0xb2ef('0x35')];var _0xefdf2a;if(_0x2e7914>=_0x1b4086){_0x2e7914=_0x1b4086;_0xefdf2a=0xc8;}else{_0xefdf2a=0xce;}_0x18b184['status'](_0xefdf2a);return _0x18b184['set'](_0xb2ef('0x36'),_0x4af76c+'-'+_0x2e7914+'/'+_0x1b4086)['json'](_0x1ead7a);}return null;};}function patchUpdates(_0xcf330e){return function(_0x12f291){try{jsonpatch[_0xb2ef('0x37')](_0x12f291,_0xcf330e,!![]);}catch(_0x32a4c5){return BPromise[_0xb2ef('0x38')](_0x32a4c5);}return _0x12f291['save']();};}function saveUpdates(_0x4f33a6,_0x286dba){return function(_0x181131){if(_0x181131){return _0x181131[_0xb2ef('0x39')](_0x4f33a6)[_0xb2ef('0x24')](function(_0x315afa){return _0x315afa;});}return null;};}function removeEntity(_0x3d3a8e,_0x1f0cdc){return function(_0x624136){if(_0x624136){return _0x624136[_0xb2ef('0x3a')]()[_0xb2ef('0x24')](function(){_0x3d3a8e[_0xb2ef('0x30')](0xcc)[_0xb2ef('0x31')]();});}};}function handleEntityNotFound(_0x547109,_0x2e2c6c){return function(_0x487e5c){if(!_0x487e5c){_0x547109[_0xb2ef('0x2f')](0x194);}return _0x487e5c;};}function handleError(_0x1e7777,_0x2468d8){_0x2468d8=_0x2468d8||0x1f4;return function(_0x2768d3){logger[_0xb2ef('0x2b')](_0x2768d3[_0xb2ef('0x3b')]);if(_0x2768d3[_0xb2ef('0x3c')]){delete _0x2768d3[_0xb2ef('0x3c')];}_0x1e7777[_0xb2ef('0x30')](_0x2468d8)[_0xb2ef('0x3d')](_0x2768d3);};}exports[_0xb2ef('0x3e')]=function(_0x1d66bd,_0x34b1f7){var _0x8b4829={},_0x211836={},_0x45eaf7={'count':0x0,'rows':[]};var _0x16034c=_[_0xb2ef('0x3f')](db[_0xb2ef('0x40')][_0xb2ef('0x41')],function(_0x357130){return{'name':_0x357130[_0xb2ef('0x42')],'type':_0x357130[_0xb2ef('0x43')][_0xb2ef('0x44')]};});_0x211836[_0xb2ef('0x45')]=_[_0xb2ef('0x3f')](_0x16034c,_0xb2ef('0x3c'));_0x211836['query']=_['keys'](_0x1d66bd[_0xb2ef('0x46')]);_0x211836['filters']=_['intersection'](_0x211836[_0xb2ef('0x45')],_0x211836[_0xb2ef('0x46')]);_0x8b4829[_0xb2ef('0x47')]=_[_0xb2ef('0x48')](_0x211836[_0xb2ef('0x45')],qs[_0xb2ef('0x49')](_0x1d66bd[_0xb2ef('0x46')][_0xb2ef('0x49')]));_0x8b4829[_0xb2ef('0x47')]=_0x8b4829[_0xb2ef('0x47')][_0xb2ef('0x4a')]?_0x8b4829[_0xb2ef('0x47')]:_0x211836['model'];if(!_0x1d66bd['query']['hasOwnProperty'](_0xb2ef('0x4b'))){_0x8b4829[_0xb2ef('0x35')]=qs[_0xb2ef('0x35')](_0x1d66bd[_0xb2ef('0x46')][_0xb2ef('0x35')]);_0x8b4829[_0xb2ef('0x34')]=qs[_0xb2ef('0x34')](_0x1d66bd[_0xb2ef('0x46')][_0xb2ef('0x34')]);}_0x8b4829[_0xb2ef('0x4c')]=qs[_0xb2ef('0x4d')](_0x1d66bd[_0xb2ef('0x46')][_0xb2ef('0x4d')]);_0x8b4829[_0xb2ef('0x4e')]=qs[_0xb2ef('0x4f')](_[_0xb2ef('0x50')](_0x1d66bd[_0xb2ef('0x46')],_0x211836['filters']),_0x16034c);if(_0x1d66bd[_0xb2ef('0x46')][_0xb2ef('0x51')]){_0x8b4829[_0xb2ef('0x4e')]=_[_0xb2ef('0x52')](_0x8b4829[_0xb2ef('0x4e')],{'$or':_[_0xb2ef('0x3f')](_0x16034c,function(_0x293152){if(_0x293152[_0xb2ef('0x43')]!==_0xb2ef('0x53')){var _0x2217a8={};_0x2217a8[_0x293152[_0xb2ef('0x3c')]]={'$like':'%'+_0x1d66bd['query'][_0xb2ef('0x51')]+'%'};return _0x2217a8;}})});}_0x8b4829=_['merge']({},_0x8b4829,_0x1d66bd[_0xb2ef('0x54')]);var _0xd3f1f0={'where':_0x8b4829[_0xb2ef('0x4e')]};return db[_0xb2ef('0x40')][_0xb2ef('0x33')](_0xd3f1f0)[_0xb2ef('0x24')](function(_0x3bd72a){_0x45eaf7[_0xb2ef('0x33')]=_0x3bd72a;if(_0x1d66bd[_0xb2ef('0x46')][_0xb2ef('0x55')]){_0x8b4829[_0xb2ef('0x56')]=[{'all':!![]}];}return db['ChatMessage'][_0xb2ef('0x57')](_0x8b4829);})[_0xb2ef('0x24')](function(_0xf61e85){_0x45eaf7[_0xb2ef('0x58')]=_0xf61e85;return _0x45eaf7;})[_0xb2ef('0x24')](respondWithFilteredResult(_0x34b1f7,_0x8b4829))[_0xb2ef('0x2e')](handleError(_0x34b1f7,null));};exports[_0xb2ef('0x59')]=function(_0x2f20c6,_0x20b13c){var _0x38168a={'raw':!![],'where':{'id':_0x2f20c6[_0xb2ef('0x5a')]['id']}},_0x53981c={};_0x53981c[_0xb2ef('0x45')]=_[_0xb2ef('0x5b')](db[_0xb2ef('0x40')][_0xb2ef('0x41')]);_0x53981c[_0xb2ef('0x46')]=_[_0xb2ef('0x5b')](_0x2f20c6[_0xb2ef('0x46')]);_0x53981c[_0xb2ef('0x4f')]=_[_0xb2ef('0x48')](_0x53981c[_0xb2ef('0x45')],_0x53981c['query']);_0x38168a['attributes']=_[_0xb2ef('0x48')](_0x53981c['model'],qs['fields'](_0x2f20c6['query'][_0xb2ef('0x49')]));_0x38168a[_0xb2ef('0x47')]=_0x38168a['attributes'][_0xb2ef('0x4a')]?_0x38168a[_0xb2ef('0x47')]:_0x53981c[_0xb2ef('0x45')];if(_0x2f20c6[_0xb2ef('0x46')]['includeAll']){_0x38168a[_0xb2ef('0x56')]=[{'all':!![]}];}_0x38168a=_['merge']({},_0x38168a,_0x2f20c6[_0xb2ef('0x54')]);return db[_0xb2ef('0x40')][_0xb2ef('0x5c')](_0x38168a)[_0xb2ef('0x24')](handleEntityNotFound(_0x20b13c,null))['then'](respondWithResult(_0x20b13c,null))['catch'](handleError(_0x20b13c,null));};exports[_0xb2ef('0x5d')]=function(_0x23f38c,_0x14ee72){return db[_0xb2ef('0x40')][_0xb2ef('0x5d')](_0x23f38c[_0xb2ef('0x5e')],{})[_0xb2ef('0x24')](respondWithResult(_0x14ee72,0xc9))[_0xb2ef('0x2e')](handleError(_0x14ee72,null));};exports[_0xb2ef('0x39')]=function(_0x11fb10,_0x232e4a){if(_0x11fb10[_0xb2ef('0x5e')]['id']){delete _0x11fb10['body']['id'];}return db[_0xb2ef('0x40')][_0xb2ef('0x5c')]({'where':{'id':_0x11fb10[_0xb2ef('0x5a')]['id']}})[_0xb2ef('0x24')](handleEntityNotFound(_0x232e4a,null))['then'](saveUpdates(_0x11fb10['body'],null))['then'](respondWithResult(_0x232e4a,null))[_0xb2ef('0x2e')](handleError(_0x232e4a,null));};exports[_0xb2ef('0x3a')]=function(_0x266d1f,_0x549ff3){return db[_0xb2ef('0x40')][_0xb2ef('0x5c')]({'where':{'id':_0x266d1f[_0xb2ef('0x5a')]['id']}})[_0xb2ef('0x24')](handleEntityNotFound(_0x549ff3,null))[_0xb2ef('0x24')](removeEntity(_0x549ff3,null))[_0xb2ef('0x2e')](handleError(_0x549ff3,null));};exports[_0xb2ef('0x5f')]=function(_0x1de7e1,_0x209dd2){return db[_0xb2ef('0x40')][_0xb2ef('0x5f')]()[_0xb2ef('0x24')](respondWithResult(_0x209dd2,null))['catch'](handleError(_0x209dd2,null));};var interaction_log=require(_0xb2ef('0x15'))(_0xb2ef('0x60'));exports[_0xb2ef('0x61')]=function(_0x46e9a4,_0x12dfd4,_0x20721f){var _0x3a8921={'agent':{},'channel':'chat'};if(_0x46e9a4[_0xb2ef('0x5e')]['id']){delete _0x46e9a4[_0xb2ef('0x5e')]['id'];}_0x46e9a4['body']['read']=!![];_0x46e9a4[_0xb2ef('0x5e')][_0xb2ef('0x62')]=moment()[_0xb2ef('0x63')](_0xb2ef('0x64'));_0x46e9a4[_0xb2ef('0x5e')][_0xb2ef('0x65')]=_0x46e9a4[_0xb2ef('0x5e')][_0xb2ef('0x65')]||_0x46e9a4[_0xb2ef('0x66')]['id'];_0x3a8921['agent']['id']=_0x46e9a4[_0xb2ef('0x5e')][_0xb2ef('0x65')];return db[_0xb2ef('0x40')][_0xb2ef('0x5c')]({'where':{'id':_0x46e9a4['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x12dfd4,null))['then'](saveUpdates(_0x46e9a4[_0xb2ef('0x5e')],null))[_0xb2ef('0x24')](function(_0x11c59d){if(_0x11c59d){_0x3a8921[_0xb2ef('0x2d')]=_0x11c59d['get']({'plain':!![]});return db[_0xb2ef('0x67')][_0xb2ef('0x5c')]({'where':{'id':_0x11c59d[_0xb2ef('0x68')]}});}return null;})['then'](handleEntityNotFound(_0x12dfd4,null))[_0xb2ef('0x24')](function(_0x5670c5){if(_0x5670c5){return _0x5670c5[_0xb2ef('0x39')]({'UserId':_0x46e9a4['body'][_0xb2ef('0x65')],'read1stAt':_[_0xb2ef('0x69')](_0x5670c5[_0xb2ef('0x6a')])?moment()[_0xb2ef('0x63')](_0xb2ef('0x64')):undefined});}return null;})[_0xb2ef('0x24')](function(_0x594aa4){if(_0x594aa4){_0x3a8921[_0xb2ef('0x6b')]=_0x594aa4[_0xb2ef('0x6c')]({'plain':!![]});interaction_log['info'](_0xb2ef('0x6d'),_0x46e9a4[_0xb2ef('0x66')]['id'],_0x46e9a4[_0xb2ef('0x66')][_0xb2ef('0x3c')],_0x46e9a4[_0xb2ef('0x66')]['role'],_0x3a8921['interaction']['id'],_0x46e9a4[_0xb2ef('0x5e')]?JSON[_0xb2ef('0x2a')](_0x46e9a4[_0xb2ef('0x5e')]):_0xb2ef('0x6e'));return respondWithRpcPromise(_0xb2ef('0x6f'),_0xb2ef('0x70'),_0x3a8921);}return null;})[_0xb2ef('0x24')](function(_0x38f872){var _0x2e3291=_0xb2ef('0x71')+_0x38f872['message'][_0xb2ef('0x72')];return db[_0xb2ef('0x73')][_0xb2ef('0x46')](_0x2e3291,{'type':db[_0xb2ef('0x74')][_0xb2ef('0x75')][_0xb2ef('0x76')],'raw':!![]})[_0xb2ef('0x24')](function(_0x349922){return _0x349922;});})['then'](function(_0x166274){if(_0x166274){_0x3a8921[_0xb2ef('0x2d')]['contact']=_0x166274[0x0];if(!_0x46e9a4[_0xb2ef('0x5e')][_0xb2ef('0x65')])return;return db[_0xb2ef('0x77')][_0xb2ef('0x5c')]({'where':{'id':_0x46e9a4['body'][_0xb2ef('0x65')],'role':_0xb2ef('0x78')},'attributes':['id','name','fullname','email',_0xb2ef('0x79')],'raw':!![]});}return null;})[_0xb2ef('0x24')](function(_0x5c104a){if(!_0x5c104a)return null;_0x3a8921['message'][_0xb2ef('0x78')]=_0x5c104a;return _0x3a8921;})[_0xb2ef('0x24')](function(_0x5a5ee0){if(_0x5a5ee0){if(_0x46e9a4[_0xb2ef('0x5e')][_0xb2ef('0x7a')]){_0x3a8921[_0xb2ef('0x2d')][_0xb2ef('0x7b')]=util[_0xb2ef('0x63')](_0xb2ef('0x7c'),_0x46e9a4[_0xb2ef('0x66')][_0xb2ef('0x3c')]);_0x3a8921[_0xb2ef('0x2d')][_0xb2ef('0x7d')]=_0x3a8921[_0xb2ef('0x7d')];_0x3a8921[_0xb2ef('0x2d')]['motionChannel']=_0x3a8921['channel'];_0x3a8921[_0xb2ef('0x2d')]['event']='accept';return respondWithRpcPromise(_0xb2ef('0x7e'),_0xb2ef('0x7e'),{'event':'acceptmessage','message':_[_0xb2ef('0x52')](_0x3a8921['message'],JSON[_0xb2ef('0x7f')](_0x3a8921[_0xb2ef('0x6b')][_0xb2ef('0x80')]))},client9002)['then'](function(){return _0x3a8921;});}return _0x3a8921;}return null;})['then'](respondWithResult(_0x12dfd4,null))[_0xb2ef('0x2e')](handleError(_0x12dfd4,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports['reject']=function(_0x3b6a63,_0x4c6d8e,_0x1be800){var _0x133a50={'agent':{},'channel':_0xb2ef('0x81')};if(_0x3b6a63['body']['id']){delete _0x3b6a63[_0xb2ef('0x5e')]['id'];}_0x3b6a63[_0xb2ef('0x5e')]['UserId']=_0x3b6a63[_0xb2ef('0x5e')][_0xb2ef('0x65')]||_0x3b6a63['user']['id'];_0x133a50[_0xb2ef('0x78')]['id']=_0x3b6a63['body'][_0xb2ef('0x65')];return db['ChatMessage'][_0xb2ef('0x5c')]({'where':{'id':_0x3b6a63['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4c6d8e,null))[_0xb2ef('0x24')](function(_0x1c7e66){if(_0x1c7e66){_0x133a50['message']=_0x1c7e66[_0xb2ef('0x6c')]({'plain':!![]});return db[_0xb2ef('0x67')][_0xb2ef('0x5c')]({'where':{'id':_0x1c7e66['ChatInteractionId']}});}return null;})[_0xb2ef('0x24')](handleEntityNotFound(_0x4c6d8e,null))[_0xb2ef('0x24')](function(_0x559703){if(_0x559703){_0x133a50[_0xb2ef('0x6b')]=_0x559703[_0xb2ef('0x6c')]({'plain':!![]});interaction_log[_0xb2ef('0x25')](_0xb2ef('0x82'),_0x3b6a63[_0xb2ef('0x66')]['id'],_0x3b6a63[_0xb2ef('0x66')][_0xb2ef('0x3c')],_0x3b6a63['user'][_0xb2ef('0x83')],_0x133a50[_0xb2ef('0x6b')]['id'],_0x3b6a63['body']?JSON[_0xb2ef('0x2a')](_0x3b6a63['body']):_0xb2ef('0x6e'));return respondWithRpcPromise('RejectMessage',_0xb2ef('0x84'),_0x133a50);}return null;})['then'](function(_0x35f83a){var _0x2e9dcd=_0xb2ef('0x71')+_0x35f83a['message']['ContactId'];return db[_0xb2ef('0x73')][_0xb2ef('0x46')](_0x2e9dcd,{'type':db[_0xb2ef('0x74')][_0xb2ef('0x75')]['SELECT'],'raw':!![]})[_0xb2ef('0x24')](function(_0x2f72c2){return _0x2f72c2;});})[_0xb2ef('0x24')](function(_0x2063fc){if(_0x2063fc){_0x133a50['message'][_0xb2ef('0x85')]=_0x2063fc[0x0];if(!_0x3b6a63[_0xb2ef('0x5e')][_0xb2ef('0x65')])return;return db[_0xb2ef('0x77')]['find']({'where':{'id':_0x3b6a63[_0xb2ef('0x5e')]['UserId'],'role':_0xb2ef('0x78')},'attributes':['id','name',_0xb2ef('0x86'),_0xb2ef('0x87'),_0xb2ef('0x79')],'raw':!![]});}return null;})[_0xb2ef('0x24')](function(_0x7dadd1){if(!_0x7dadd1)return null;_0x133a50[_0xb2ef('0x2d')][_0xb2ef('0x78')]=_0x7dadd1;return _0x133a50;})[_0xb2ef('0x24')](function(_0x429557){if(_0x429557){_0x429557[_0xb2ef('0x2d')][_0xb2ef('0x7b')]=util[_0xb2ef('0x63')](_0xb2ef('0x7c'),_0x3b6a63[_0xb2ef('0x66')][_0xb2ef('0x3c')]);_0x429557[_0xb2ef('0x2d')][_0xb2ef('0x7d')]=_0x133a50[_0xb2ef('0x7d')];_0x429557[_0xb2ef('0x2d')][_0xb2ef('0x88')]=_0x133a50[_0xb2ef('0x7d')];_0x429557[_0xb2ef('0x2d')][_0xb2ef('0x89')]=_0xb2ef('0x38');respondWithRpcPromise('EventManager',_0xb2ef('0x7e'),{'event':_0xb2ef('0x8a'),'message':_[_0xb2ef('0x52')](_0x133a50['message'],JSON[_0xb2ef('0x7f')](_0x133a50[_0xb2ef('0x6b')][_0xb2ef('0x80')]))},client9002);return _0x133a50;}return null;})[_0xb2ef('0x24')](respondWithResult(_0x4c6d8e,null))[_0xb2ef('0x2e')](handleError(_0x4c6d8e,null));};
\ No newline at end of file
+var _0x8801=['http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','end','status','json','offset','limit','undefined','set','apply','reject','save','update','stack','name','map','ChatMessage','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','options','count','includeAll','include','rows','catch','show','rawAttributes','length','find','create','body','params','destroy','describe','chat','read','readAt','format','user','agent','UserId','ChatInteraction','ChatInteractionId','isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','fullname','email','internal','manual','interface','SIP/%s','motionChannel','channel','event','accept','EventManager','acceptmessage','merge','chat-interactions','contact','formData','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','jayson/promise','client'];(function(_0x1d4629,_0x4947e3){var _0x257c2f=function(_0x127b12){while(--_0x127b12){_0x1d4629['push'](_0x1d4629['shift']());}};_0x257c2f(++_0x4947e3);}(_0x8801,0x66));var _0x1880=function(_0x300b47,_0x291657){_0x300b47=_0x300b47-0x0;var _0x9e8566=_0x8801[_0x300b47];return _0x9e8566;};'use strict';var emlformat=require(_0x1880('0x0'));var rimraf=require(_0x1880('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1880('0x2'));var rp=require(_0x1880('0x3'));var moment=require(_0x1880('0x4'));var BPromise=require(_0x1880('0x5'));var Mustache=require(_0x1880('0x6'));var util=require(_0x1880('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x1880('0x8'));var ejs=require(_0x1880('0x9'));var fs=require('fs');var fs_extra=require(_0x1880('0xa'));var _=require('lodash');var squel=require(_0x1880('0xb'));var crypto=require(_0x1880('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1880('0xd'));var toCsv=require(_0x1880('0x8'));var querystring=require(_0x1880('0xe'));var Papa=require(_0x1880('0xf'));var Redis=require(_0x1880('0x10'));var authService=require(_0x1880('0x11'));var qs=require(_0x1880('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1880('0x13'));var logger=require(_0x1880('0x14'))(_0x1880('0x15'));var utils=require(_0x1880('0x16'));var config=require(_0x1880('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x1880('0x18'))['db'];config['redis']=_[_0x1880('0x19')](config[_0x1880('0x1a')],{'host':_0x1880('0x1b'),'port':0x18eb});var socket=require(_0x1880('0x1c'))(new Redis(config[_0x1880('0x1a')]));require(_0x1880('0x1d'))['register'](socket);var jayson=require(_0x1880('0x1e'));var client=jayson[_0x1880('0x1f')][_0x1880('0x20')]({'port':0x232c});var client9002=jayson[_0x1880('0x1f')][_0x1880('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x20d3a5,_0x6dc18a,_0x15bc53,_0x4ec086){return new BPromise(function(_0x5e6ce7,_0x5b934){var _0x2d32b3=_0x4ec086||client;return _0x2d32b3[_0x1880('0x21')](_0x20d3a5,_0x15bc53)[_0x1880('0x22')](function(_0x424165){logger[_0x1880('0x23')](_0x1880('0x24'),_0x6dc18a,_0x1880('0x25'));logger[_0x1880('0x26')](_0x1880('0x27'),_0x6dc18a,_0x1880('0x25'),JSON[_0x1880('0x28')](_0x424165));if(_0x424165[_0x1880('0x29')]){if(_0x424165[_0x1880('0x29')][_0x1880('0x2a')]===0x1f4){logger[_0x1880('0x29')](_0x1880('0x24'),_0x6dc18a,_0x424165[_0x1880('0x29')][_0x1880('0x2b')]);return _0x5b934(_0x424165[_0x1880('0x29')][_0x1880('0x2b')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x6dc18a,_0x424165[_0x1880('0x29')]['message']);return _0x5e6ce7(_0x424165[_0x1880('0x29')][_0x1880('0x2b')]);}else{logger[_0x1880('0x23')]('ChatMessage,\x20%s,\x20%s',_0x6dc18a,_0x1880('0x25'));_0x5e6ce7(_0x424165[_0x1880('0x2c')][_0x1880('0x2b')]);}})['catch'](function(_0x3aaaad){logger[_0x1880('0x29')](_0x1880('0x24'),_0x6dc18a,_0x3aaaad);_0x5b934(_0x3aaaad);});});}function respondWithStatusCode(_0x311e06,_0x2d47e8){_0x2d47e8=_0x2d47e8||0xcc;return function(_0x5b9fe4){if(_0x5b9fe4){return _0x311e06[_0x1880('0x2d')](_0x2d47e8);}return _0x311e06['status'](_0x2d47e8)[_0x1880('0x2e')]();};}function respondWithResult(_0x5df3f8,_0x9eb922){_0x9eb922=_0x9eb922||0xc8;return function(_0x4b8338){if(_0x4b8338){return _0x5df3f8[_0x1880('0x2f')](_0x9eb922)[_0x1880('0x30')](_0x4b8338);}};}function respondWithFilteredResult(_0x1ae82e,_0x4d6110){return function(_0x2a354a){if(_0x2a354a){var _0x5a1189=typeof _0x4d6110[_0x1880('0x31')]==='undefined'&&typeof _0x4d6110[_0x1880('0x32')]===_0x1880('0x33');var _0x2b6f9b=_0x2a354a['count'];var _0x5e2185=_0x5a1189?0x0:_0x4d6110[_0x1880('0x31')];var _0x516dc2=_0x5a1189?_0x2a354a['count']:_0x4d6110[_0x1880('0x31')]+_0x4d6110['limit'];var _0x4a186c;if(_0x516dc2>=_0x2b6f9b){_0x516dc2=_0x2b6f9b;_0x4a186c=0xc8;}else{_0x4a186c=0xce;}_0x1ae82e[_0x1880('0x2f')](_0x4a186c);return _0x1ae82e[_0x1880('0x34')]('Content-Range',_0x5e2185+'-'+_0x516dc2+'/'+_0x2b6f9b)[_0x1880('0x30')](_0x2a354a);}return null;};}function patchUpdates(_0x13d984){return function(_0x39358e){try{jsonpatch[_0x1880('0x35')](_0x39358e,_0x13d984,!![]);}catch(_0x163b45){return BPromise[_0x1880('0x36')](_0x163b45);}return _0x39358e[_0x1880('0x37')]();};}function saveUpdates(_0x317737,_0x20ebfa){return function(_0x5dbd73){if(_0x5dbd73){return _0x5dbd73[_0x1880('0x38')](_0x317737)[_0x1880('0x22')](function(_0x422794){return _0x422794;});}return null;};}function removeEntity(_0x561b24,_0x12a484){return function(_0x41bd0d){if(_0x41bd0d){return _0x41bd0d['destroy']()[_0x1880('0x22')](function(){_0x561b24['status'](0xcc)[_0x1880('0x2e')]();});}};}function handleEntityNotFound(_0x58e4bb,_0x44c874){return function(_0x4fd36d){if(!_0x4fd36d){_0x58e4bb[_0x1880('0x2d')](0x194);}return _0x4fd36d;};}function handleError(_0x32e0f1,_0x4ef814){_0x4ef814=_0x4ef814||0x1f4;return function(_0xb42d90){logger['error'](_0xb42d90[_0x1880('0x39')]);if(_0xb42d90[_0x1880('0x3a')]){delete _0xb42d90['name'];}_0x32e0f1[_0x1880('0x2f')](_0x4ef814)['send'](_0xb42d90);};}exports['index']=function(_0x540c48,_0xa25c59){var _0x2c7d8c={},_0x15779f={},_0x25327a={'count':0x0,'rows':[]};var _0x16d3cf=_[_0x1880('0x3b')](db[_0x1880('0x3c')]['rawAttributes'],function(_0x343353){return{'name':_0x343353[_0x1880('0x3d')],'type':_0x343353[_0x1880('0x3e')][_0x1880('0x3f')]};});_0x15779f[_0x1880('0x40')]=_['map'](_0x16d3cf,_0x1880('0x3a'));_0x15779f[_0x1880('0x41')]=_[_0x1880('0x42')](_0x540c48[_0x1880('0x41')]);_0x15779f['filters']=_[_0x1880('0x43')](_0x15779f['model'],_0x15779f[_0x1880('0x41')]);_0x2c7d8c[_0x1880('0x44')]=_[_0x1880('0x43')](_0x15779f[_0x1880('0x40')],qs['fields'](_0x540c48['query'][_0x1880('0x45')]));_0x2c7d8c[_0x1880('0x44')]=_0x2c7d8c[_0x1880('0x44')]['length']?_0x2c7d8c[_0x1880('0x44')]:_0x15779f['model'];if(!_0x540c48[_0x1880('0x41')][_0x1880('0x46')](_0x1880('0x47'))){_0x2c7d8c[_0x1880('0x32')]=qs[_0x1880('0x32')](_0x540c48[_0x1880('0x41')][_0x1880('0x32')]);_0x2c7d8c[_0x1880('0x31')]=qs['offset'](_0x540c48[_0x1880('0x41')][_0x1880('0x31')]);}_0x2c7d8c[_0x1880('0x48')]=qs[_0x1880('0x49')](_0x540c48['query'][_0x1880('0x49')]);_0x2c7d8c[_0x1880('0x4a')]=qs[_0x1880('0x4b')](_[_0x1880('0x4c')](_0x540c48[_0x1880('0x41')],_0x15779f[_0x1880('0x4b')]),_0x16d3cf);if(_0x540c48[_0x1880('0x41')]['filter']){_0x2c7d8c['where']=_['merge'](_0x2c7d8c[_0x1880('0x4a')],{'$or':_[_0x1880('0x3b')](_0x16d3cf,function(_0x3cc5d4){if(_0x3cc5d4[_0x1880('0x3e')]!==_0x1880('0x4d')){var _0xa83d2e={};_0xa83d2e[_0x3cc5d4[_0x1880('0x3a')]]={'$like':'%'+_0x540c48[_0x1880('0x41')]['filter']+'%'};return _0xa83d2e;}})});}_0x2c7d8c=_['merge']({},_0x2c7d8c,_0x540c48[_0x1880('0x4e')]);var _0x7701a3={'where':_0x2c7d8c[_0x1880('0x4a')]};return db[_0x1880('0x3c')][_0x1880('0x4f')](_0x7701a3)['then'](function(_0x1f2e56){_0x25327a['count']=_0x1f2e56;if(_0x540c48['query'][_0x1880('0x50')]){_0x2c7d8c[_0x1880('0x51')]=[{'all':!![]}];}return db[_0x1880('0x3c')]['findAll'](_0x2c7d8c);})[_0x1880('0x22')](function(_0x5a5ba6){_0x25327a[_0x1880('0x52')]=_0x5a5ba6;return _0x25327a;})[_0x1880('0x22')](respondWithFilteredResult(_0xa25c59,_0x2c7d8c))[_0x1880('0x53')](handleError(_0xa25c59,null));};exports[_0x1880('0x54')]=function(_0x59ff70,_0x23bcb0){var _0x274ecd={'raw':!![],'where':{'id':_0x59ff70['params']['id']}},_0xe28d86={};_0xe28d86[_0x1880('0x40')]=_['keys'](db[_0x1880('0x3c')][_0x1880('0x55')]);_0xe28d86[_0x1880('0x41')]=_[_0x1880('0x42')](_0x59ff70['query']);_0xe28d86[_0x1880('0x4b')]=_[_0x1880('0x43')](_0xe28d86[_0x1880('0x40')],_0xe28d86['query']);_0x274ecd[_0x1880('0x44')]=_['intersection'](_0xe28d86[_0x1880('0x40')],qs['fields'](_0x59ff70[_0x1880('0x41')][_0x1880('0x45')]));_0x274ecd[_0x1880('0x44')]=_0x274ecd['attributes'][_0x1880('0x56')]?_0x274ecd[_0x1880('0x44')]:_0xe28d86[_0x1880('0x40')];if(_0x59ff70['query']['includeAll']){_0x274ecd[_0x1880('0x51')]=[{'all':!![]}];}_0x274ecd=_['merge']({},_0x274ecd,_0x59ff70[_0x1880('0x4e')]);return db[_0x1880('0x3c')][_0x1880('0x57')](_0x274ecd)[_0x1880('0x22')](handleEntityNotFound(_0x23bcb0,null))['then'](respondWithResult(_0x23bcb0,null))[_0x1880('0x53')](handleError(_0x23bcb0,null));};exports[_0x1880('0x58')]=function(_0x2ca4fb,_0x442fdc){return db['ChatMessage'][_0x1880('0x58')](_0x2ca4fb[_0x1880('0x59')],{})[_0x1880('0x22')](respondWithResult(_0x442fdc,0xc9))[_0x1880('0x53')](handleError(_0x442fdc,null));};exports[_0x1880('0x38')]=function(_0x3f85aa,_0x3a24ba){if(_0x3f85aa['body']['id']){delete _0x3f85aa[_0x1880('0x59')]['id'];}return db[_0x1880('0x3c')][_0x1880('0x57')]({'where':{'id':_0x3f85aa[_0x1880('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3a24ba,null))['then'](saveUpdates(_0x3f85aa['body'],null))[_0x1880('0x22')](respondWithResult(_0x3a24ba,null))['catch'](handleError(_0x3a24ba,null));};exports[_0x1880('0x5b')]=function(_0x5477d0,_0x1227ed){return db[_0x1880('0x3c')]['find']({'where':{'id':_0x5477d0['params']['id']}})[_0x1880('0x22')](handleEntityNotFound(_0x1227ed,null))[_0x1880('0x22')](removeEntity(_0x1227ed,null))[_0x1880('0x53')](handleError(_0x1227ed,null));};exports['describe']=function(_0x4a1395,_0x7f802b){return db['ChatMessage'][_0x1880('0x5c')]()[_0x1880('0x22')](respondWithResult(_0x7f802b,null))[_0x1880('0x53')](handleError(_0x7f802b,null));};var interaction_log=require(_0x1880('0x14'))('chat-interactions');exports['accept']=function(_0x33f323,_0x15d128,_0x820366){var _0x308a7d={'agent':{},'channel':_0x1880('0x5d')};if(_0x33f323[_0x1880('0x59')]['id']){delete _0x33f323[_0x1880('0x59')]['id'];}_0x33f323[_0x1880('0x59')][_0x1880('0x5e')]=!![];_0x33f323[_0x1880('0x59')][_0x1880('0x5f')]=moment()[_0x1880('0x60')]('YYYY-MM-DD\x20HH:mm:ss');_0x33f323[_0x1880('0x59')]['UserId']=_0x33f323[_0x1880('0x59')]['UserId']||_0x33f323[_0x1880('0x61')]['id'];_0x308a7d[_0x1880('0x62')]['id']=_0x33f323[_0x1880('0x59')][_0x1880('0x63')];return db['ChatMessage'][_0x1880('0x57')]({'where':{'id':_0x33f323[_0x1880('0x5a')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x15d128,null))[_0x1880('0x22')](saveUpdates(_0x33f323[_0x1880('0x59')],null))[_0x1880('0x22')](function(_0x56d566){if(_0x56d566){_0x308a7d[_0x1880('0x2b')]=_0x56d566['get']({'plain':!![]});return db[_0x1880('0x64')][_0x1880('0x57')]({'where':{'id':_0x56d566[_0x1880('0x65')]}});}return null;})[_0x1880('0x22')](handleEntityNotFound(_0x15d128,null))['then'](function(_0x215711){if(_0x215711){return _0x215711[_0x1880('0x38')]({'UserId':_0x33f323['body'][_0x1880('0x63')],'read1stAt':_[_0x1880('0x66')](_0x215711['read1stAt'])?moment()[_0x1880('0x60')](_0x1880('0x67')):undefined});}return null;})['then'](function(_0x3fc40b){if(_0x3fc40b){_0x308a7d[_0x1880('0x68')]=_0x3fc40b[_0x1880('0x69')]({'plain':!![]});interaction_log['info'](_0x1880('0x6a'),_0x33f323[_0x1880('0x61')]['id'],_0x33f323['user'][_0x1880('0x3a')],_0x33f323[_0x1880('0x61')][_0x1880('0x6b')],_0x308a7d[_0x1880('0x68')]['id'],_0x33f323[_0x1880('0x59')]?JSON[_0x1880('0x28')](_0x33f323['body']):_0x1880('0x6c'));return respondWithRpcPromise(_0x1880('0x6d'),_0x1880('0x6e'),_0x308a7d);}return null;})[_0x1880('0x22')](function(_0xef07c1){var _0x58adae=_0x1880('0x6f')+_0xef07c1[_0x1880('0x2b')][_0x1880('0x70')];return db[_0x1880('0x71')][_0x1880('0x41')](_0x58adae,{'type':db[_0x1880('0x72')][_0x1880('0x73')][_0x1880('0x74')],'raw':!![]})[_0x1880('0x22')](function(_0x24a1ca){return _0x24a1ca;});})['then'](function(_0x30d7b1){if(_0x30d7b1){_0x308a7d[_0x1880('0x2b')]['contact']=_0x30d7b1[0x0];if(!_0x33f323[_0x1880('0x59')][_0x1880('0x63')])return;return db[_0x1880('0x75')][_0x1880('0x57')]({'where':{'id':_0x33f323[_0x1880('0x59')][_0x1880('0x63')],'role':_0x1880('0x62')},'attributes':['id',_0x1880('0x3a'),_0x1880('0x76'),_0x1880('0x77'),_0x1880('0x78')],'raw':!![]});}return null;})[_0x1880('0x22')](function(_0x3aa82f){if(!_0x3aa82f)return null;_0x308a7d[_0x1880('0x2b')]['agent']=_0x3aa82f;return _0x308a7d;})[_0x1880('0x22')](function(_0x3bcc05){if(_0x3bcc05){if(_0x33f323[_0x1880('0x59')][_0x1880('0x79')]){_0x308a7d[_0x1880('0x2b')][_0x1880('0x7a')]=util[_0x1880('0x60')](_0x1880('0x7b'),_0x33f323['user']['name']);_0x308a7d['message']['channel']=_0x308a7d['channel'];_0x308a7d[_0x1880('0x2b')][_0x1880('0x7c')]=_0x308a7d[_0x1880('0x7d')];_0x308a7d['message'][_0x1880('0x7e')]=_0x1880('0x7f');return respondWithRpcPromise(_0x1880('0x80'),_0x1880('0x80'),{'event':_0x1880('0x81'),'message':_[_0x1880('0x82')](_0x308a7d[_0x1880('0x2b')],JSON['parse'](_0x308a7d[_0x1880('0x68')]['formData']))},client9002)['then'](function(){return _0x308a7d;});}return _0x308a7d;}return null;})['then'](respondWithResult(_0x15d128,null))[_0x1880('0x53')](handleError(_0x15d128,null));};var interaction_log=require(_0x1880('0x14'))(_0x1880('0x83'));exports['reject']=function(_0x1027d8,_0xd80fde,_0x3c8d3c){var _0x5549e6={'agent':{},'channel':_0x1880('0x5d')};if(_0x1027d8[_0x1880('0x59')]['id']){delete _0x1027d8[_0x1880('0x59')]['id'];}_0x1027d8[_0x1880('0x59')][_0x1880('0x63')]=_0x1027d8[_0x1880('0x59')][_0x1880('0x63')]||_0x1027d8[_0x1880('0x61')]['id'];_0x5549e6[_0x1880('0x62')]['id']=_0x1027d8[_0x1880('0x59')]['UserId'];return db[_0x1880('0x3c')]['find']({'where':{'id':_0x1027d8[_0x1880('0x5a')]['id'],'UserId':null}})[_0x1880('0x22')](handleEntityNotFound(_0xd80fde,null))['then'](function(_0x4f8f54){if(_0x4f8f54){_0x5549e6[_0x1880('0x2b')]=_0x4f8f54[_0x1880('0x69')]({'plain':!![]});return db[_0x1880('0x64')][_0x1880('0x57')]({'where':{'id':_0x4f8f54[_0x1880('0x65')]}});}return null;})['then'](handleEntityNotFound(_0xd80fde,null))[_0x1880('0x22')](function(_0x3b44aa){if(_0x3b44aa){_0x5549e6['interaction']=_0x3b44aa[_0x1880('0x69')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1027d8['user']['id'],_0x1027d8[_0x1880('0x61')][_0x1880('0x3a')],_0x1027d8[_0x1880('0x61')]['role'],_0x5549e6[_0x1880('0x68')]['id'],_0x1027d8[_0x1880('0x59')]?JSON[_0x1880('0x28')](_0x1027d8['body']):_0x1880('0x6c'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x5549e6);}return null;})[_0x1880('0x22')](function(_0x68f005){var _0x5b8cfe='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x68f005[_0x1880('0x2b')]['ContactId'];return db[_0x1880('0x71')]['query'](_0x5b8cfe,{'type':db[_0x1880('0x72')][_0x1880('0x73')][_0x1880('0x74')],'raw':!![]})[_0x1880('0x22')](function(_0x2d107c){return _0x2d107c;});})[_0x1880('0x22')](function(_0x54410f){if(_0x54410f){_0x5549e6[_0x1880('0x2b')][_0x1880('0x84')]=_0x54410f[0x0];if(!_0x1027d8['body'][_0x1880('0x63')])return;return db[_0x1880('0x75')][_0x1880('0x57')]({'where':{'id':_0x1027d8['body'][_0x1880('0x63')],'role':_0x1880('0x62')},'attributes':['id',_0x1880('0x3a'),_0x1880('0x76'),_0x1880('0x77'),'internal'],'raw':!![]});}return null;})[_0x1880('0x22')](function(_0x566a91){if(!_0x566a91)return null;_0x5549e6['message']['agent']=_0x566a91;return _0x5549e6;})[_0x1880('0x22')](function(_0x413877){if(_0x413877){_0x413877['message'][_0x1880('0x7a')]=util[_0x1880('0x60')]('SIP/%s',_0x1027d8[_0x1880('0x61')][_0x1880('0x3a')]);_0x413877['message'][_0x1880('0x7d')]=_0x5549e6['channel'];_0x413877['message'][_0x1880('0x7c')]=_0x5549e6[_0x1880('0x7d')];_0x413877[_0x1880('0x2b')][_0x1880('0x7e')]=_0x1880('0x36');respondWithRpcPromise(_0x1880('0x80'),_0x1880('0x80'),{'event':'rejectmessage','message':_['merge'](_0x5549e6[_0x1880('0x2b')],JSON['parse'](_0x5549e6[_0x1880('0x68')][_0x1880('0x85')]))},client9002);return _0x5549e6;}return null;})[_0x1880('0x22')](respondWithResult(_0xd80fde,null))[_0x1880('0x53')](handleError(_0xd80fde,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index e3c653a..c370b61 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 _0x3953=['events','../../mysqldb','ChatMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x16c01c,_0x36885a){var _0x4a0a17=function(_0x2868d9){while(--_0x2868d9){_0x16c01c['push'](_0x16c01c['shift']());}};_0x4a0a17(++_0x36885a);}(_0x3953,0xa2));var _0x3395=function(_0x54e11d,_0x2c7e51){_0x54e11d=_0x54e11d-0x0;var _0x54d7ee=_0x3953[_0x54e11d];return _0x54d7ee;};'use strict';var EventEmitter=require(_0x3395('0x0'));var ChatMessage=require(_0x3395('0x1'))['db'][_0x3395('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x3395('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3395('0x4'),'afterDestroy':_0x3395('0x5')};function emitEvent(_0x940eb6){return function(_0x4bb202,_0x23a058,_0x4a7804){ChatMessageEvents[_0x3395('0x6')](_0x940eb6+':'+_0x4bb202['id'],_0x4bb202);ChatMessageEvents[_0x3395('0x6')](_0x940eb6,_0x4bb202);_0x4a7804(null);};}for(var e in events){if(events[_0x3395('0x7')](e)){var event=events[e];ChatMessage[_0x3395('0x8')](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
+var _0x6921=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage'];(function(_0x377a6e,_0x59b99d){var _0x37f751=function(_0x2ed25c){while(--_0x2ed25c){_0x377a6e['push'](_0x377a6e['shift']());}};_0x37f751(++_0x59b99d);}(_0x6921,0x173));var _0x1692=function(_0x1a93c2,_0x3560e4){_0x1a93c2=_0x1a93c2-0x0;var _0x7b27d3=_0x6921[_0x1a93c2];return _0x7b27d3;};'use strict';var EventEmitter=require(_0x1692('0x0'));var ChatMessage=require(_0x1692('0x1'))['db'][_0x1692('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x1692('0x3')](0x0);var events={'afterCreate':_0x1692('0x4'),'afterUpdate':_0x1692('0x5'),'afterDestroy':_0x1692('0x6')};function emitEvent(_0x5976c5){return function(_0x861491,_0x29883e,_0x21746e){ChatMessageEvents[_0x1692('0x7')](_0x5976c5+':'+_0x861491['id'],_0x861491);ChatMessageEvents['emit'](_0x5976c5,_0x861491);_0x21746e(null);};}for(var e in events){if(events[_0x1692('0x8')](e)){var event=events[e];ChatMessage[_0x1692('0x9')](e,emitEvent(event));}}module[_0x1692('0xa')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 5f634da..6c2c2b2 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 _0x0360=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne','then','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci'];(function(_0x551f8b,_0x15fac5){var _0x28a22c=function(_0x40eec1){while(--_0x40eec1){_0x551f8b['push'](_0x551f8b['shift']());}};_0x28a22c(++_0x15fac5);}(_0x0360,0xae));var _0x0036=function(_0x6b2d05,_0x3c3d14){_0x6b2d05=_0x6b2d05-0x0;var _0x19dcc8=_0x0360[_0x6b2d05];return _0x19dcc8;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x0036('0x0'));var moment=require(_0x0036('0x1'));var BPromise=require(_0x0036('0x2'));var rp=require(_0x0036('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0036('0x4'));var config=require(_0x0036('0x5'));var attributes=require(_0x0036('0x6'));module[_0x0036('0x7')]=function(_0x57b3f7,_0x128865){return _0x57b3f7[_0x0036('0x8')](_0x0036('0x9'),attributes,{'tableName':_0x0036('0xa'),'paranoid':![],'indexes':[{'name':_0x0036('0xb'),'fields':[_0x0036('0xc')],'type':_0x0036('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xaf961f,_0x4cdbeb,_0x487bb2){var _0x2f9b2d=_0x57b3f7[_0x0036('0xe')];var _0x361a81=_0xaf961f['get']({'plain':!![]});if(_0x361a81[_0x0036('0xf')]['toLowerCase']()==='in'||_0x361a81[_0x0036('0xf')][_0x0036('0x10')]()===_0x0036('0x11')&&!_0x361a81[_0x0036('0x12')]&&!_[_0x0036('0x13')](_0x361a81[_0x0036('0x14')])){_0x2f9b2d[_0x0036('0x15')][_0x0036('0x16')]({'where':{'id':_0x361a81['ChatInteractionId']}})[_0x0036('0x17')](function(_0x1ddd1e){if(_0x1ddd1e){_0x1ddd1e[_0x0036('0x18')]({'lastMsgAt':_0x361a81[_0x0036('0x19')],'lastMsgDirection':_0x361a81[_0x0036('0xf')][_0x0036('0x10')]()});}})['catch'](function(_0x4e4eba){console[_0x0036('0x1a')](_0x4e4eba);});}_0x487bb2();}},'charset':_0x0036('0x1b'),'collate':_0x0036('0x1c')});};
\ No newline at end of file
+var _0x27e6=['../../config/environment','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','get','direction','toLowerCase','out','secret','UserId','ChatInteraction','findOne','then','update','catch','utf8mb4','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x5dd440,_0x379ea0){var _0x4fc360=function(_0x219c65){while(--_0x219c65){_0x5dd440['push'](_0x5dd440['shift']());}};_0x4fc360(++_0x379ea0);}(_0x27e6,0x121));var _0x627e=function(_0x58ebd2,_0xefcf97){_0x58ebd2=_0x58ebd2-0x0;var _0x3b074e=_0x27e6[_0x58ebd2];return _0x3b074e;};'use strict';var _=require(_0x627e('0x0'));var util=require(_0x627e('0x1'));var logger=require(_0x627e('0x2'))(_0x627e('0x3'));var moment=require(_0x627e('0x4'));var BPromise=require('bluebird');var rp=require(_0x627e('0x5'));var fs=require('fs');var path=require(_0x627e('0x6'));var rimraf=require(_0x627e('0x7'));var config=require(_0x627e('0x8'));var attributes=require('./chatMessage.attributes');module[_0x627e('0x9')]=function(_0x480c11,_0x516027){return _0x480c11[_0x627e('0xa')](_0x627e('0xb'),attributes,{'tableName':_0x627e('0xc'),'paranoid':![],'indexes':[{'name':_0x627e('0xd'),'fields':[_0x627e('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1c7b2e,_0x4440a7,_0x2ebbcf){var _0x2f1e6b=_0x480c11['models'];var _0x36b7b2=_0x1c7b2e[_0x627e('0xf')]({'plain':!![]});if(_0x36b7b2[_0x627e('0x10')][_0x627e('0x11')]()==='in'||_0x36b7b2[_0x627e('0x10')][_0x627e('0x11')]()===_0x627e('0x12')&&!_0x36b7b2[_0x627e('0x13')]&&!_['isNil'](_0x36b7b2[_0x627e('0x14')])){_0x2f1e6b[_0x627e('0x15')][_0x627e('0x16')]({'where':{'id':_0x36b7b2['ChatInteractionId']}})[_0x627e('0x17')](function(_0xc18de4){if(_0xc18de4){_0xc18de4[_0x627e('0x18')]({'lastMsgAt':_0x36b7b2['createdAt'],'lastMsgDirection':_0x36b7b2[_0x627e('0x10')]['toLowerCase']()});}})[_0x627e('0x19')](function(_0x82d324){console['error'](_0x82d324);});}_0x2ebbcf();}},'charset':_0x627e('0x1a'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index ffecda5..25aa358 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 _0xe6c0=['debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateChatMessage','ChatMessage','create','options','raw','stringify','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./chatMessage.socket','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xe6c0,0x88));var _0x0e6c=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xe6c0[_0x126558];return _0x1f6d14;};'use strict';var _=require('lodash');var util=require(_0x0e6c('0x0'));var moment=require(_0x0e6c('0x1'));var BPromise=require(_0x0e6c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0e6c('0x3'));var db=require(_0x0e6c('0x4'))['db'];var utils=require(_0x0e6c('0x5'));var logger=require(_0x0e6c('0x6'))(_0x0e6c('0x7'));var config=require(_0x0e6c('0x8'));var jayson=require(_0x0e6c('0x9'));var client=jayson[_0x0e6c('0xa')][_0x0e6c('0xb')]({'port':0x232a});config[_0x0e6c('0xc')]=_['defaults'](config[_0x0e6c('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x0e6c('0xd'))(new Redis(config[_0x0e6c('0xc')]));require(_0x0e6c('0xe'))['register'](socket);function respondWithRpcPromise(_0x1ab680,_0x4a847f,_0x5055a2){return new BPromise(function(_0x4fafb8,_0xef9308){return client[_0x0e6c('0xf')](_0x1ab680,_0x5055a2)['then'](function(_0x48951f){logger[_0x0e6c('0x10')](_0x0e6c('0x11'),_0x4a847f,_0x0e6c('0x12'));logger[_0x0e6c('0x13')](_0x0e6c('0x14'),_0x4a847f,_0x0e6c('0x12'),JSON['stringify'](_0x48951f));if(_0x48951f[_0x0e6c('0x15')]){if(_0x48951f[_0x0e6c('0x15')]['code']===0x1f4){logger[_0x0e6c('0x15')](_0x0e6c('0x11'),_0x4a847f,_0x48951f[_0x0e6c('0x15')][_0x0e6c('0x16')]);return _0xef9308(_0x48951f['error'][_0x0e6c('0x16')]);}logger[_0x0e6c('0x15')](_0x0e6c('0x11'),_0x4a847f,_0x48951f[_0x0e6c('0x15')][_0x0e6c('0x16')]);return _0x4fafb8(_0x48951f[_0x0e6c('0x15')][_0x0e6c('0x16')]);}else{logger['info'](_0x0e6c('0x11'),_0x4a847f,_0x0e6c('0x12'));_0x4fafb8(_0x48951f[_0x0e6c('0x17')][_0x0e6c('0x16')]);}})[_0x0e6c('0x18')](function(_0x436ad6){logger[_0x0e6c('0x15')]('ChatMessage,\x20%s,\x20%s',_0x4a847f,_0x436ad6);_0xef9308(_0x436ad6);});});}exports[_0x0e6c('0x19')]=function(_0x15878){var _0x3cf4fd=this;return new Promise(function(_0x477a30,_0x3e73bf){return db[_0x0e6c('0x1a')][_0x0e6c('0x1b')](_0x15878['body'],{'raw':_0x15878[_0x0e6c('0x1c')]?_0x15878[_0x0e6c('0x1c')][_0x0e6c('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x2ed28c){logger['info'](_0x0e6c('0x19'),_0x15878);logger[_0x0e6c('0x13')](_0x0e6c('0x19'),_0x15878,JSON[_0x0e6c('0x1e')](_0x2ed28c));_0x477a30(_0x2ed28c);})[_0x0e6c('0x18')](function(_0x55028e){logger['error'](_0x0e6c('0x19'),_0x55028e[_0x0e6c('0x16')],_0x15878);_0x3e73bf(_0x3cf4fd[_0x0e6c('0x15')](0x1f4,_0x55028e[_0x0e6c('0x16')]));});});};
\ No newline at end of file
+var _0x70e2=['body','options','raw','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateChatMessage','ChatMessage','create'];(function(_0x395568,_0x3035b5){var _0x2c2485=function(_0x28588c){while(--_0x28588c){_0x395568['push'](_0x395568['shift']());}};_0x2c2485(++_0x3035b5);}(_0x70e2,0x107));var _0x270e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x70e2[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x270e('0x0'));var util=require(_0x270e('0x1'));var moment=require(_0x270e('0x2'));var BPromise=require(_0x270e('0x3'));var rs=require(_0x270e('0x4'));var fs=require('fs');var Redis=require(_0x270e('0x5'));var db=require(_0x270e('0x6'))['db'];var utils=require(_0x270e('0x7'));var logger=require(_0x270e('0x8'))(_0x270e('0x9'));var config=require('../../config/environment');var jayson=require(_0x270e('0xa'));var client=jayson['client'][_0x270e('0xb')]({'port':0x232a});config[_0x270e('0xc')]=_[_0x270e('0xd')](config[_0x270e('0xc')],{'host':_0x270e('0xe'),'port':0x18eb});var socket=require(_0x270e('0xf'))(new Redis(config['redis']));require(_0x270e('0x10'))[_0x270e('0x11')](socket);function respondWithRpcPromise(_0x5bdebb,_0x5c956c,_0x2e0e47){return new BPromise(function(_0x306840,_0x2b6e72){return client[_0x270e('0x12')](_0x5bdebb,_0x2e0e47)[_0x270e('0x13')](function(_0x5719b0){logger['info'](_0x270e('0x14'),_0x5c956c,'request\x20sent');logger[_0x270e('0x15')](_0x270e('0x16'),_0x5c956c,_0x270e('0x17'),JSON[_0x270e('0x18')](_0x5719b0));if(_0x5719b0[_0x270e('0x19')]){if(_0x5719b0[_0x270e('0x19')][_0x270e('0x1a')]===0x1f4){logger[_0x270e('0x19')](_0x270e('0x14'),_0x5c956c,_0x5719b0['error']['message']);return _0x2b6e72(_0x5719b0[_0x270e('0x19')][_0x270e('0x1b')]);}logger[_0x270e('0x19')](_0x270e('0x14'),_0x5c956c,_0x5719b0['error'][_0x270e('0x1b')]);return _0x306840(_0x5719b0['error'][_0x270e('0x1b')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x5c956c,'request\x20sent');_0x306840(_0x5719b0[_0x270e('0x1c')][_0x270e('0x1b')]);}})[_0x270e('0x1d')](function(_0x391685){logger[_0x270e('0x19')](_0x270e('0x14'),_0x5c956c,_0x391685);_0x2b6e72(_0x391685);});});}exports[_0x270e('0x1e')]=function(_0x2abbab){var _0x45f0f0=this;return new Promise(function(_0x350fca,_0x77216d){return db[_0x270e('0x1f')][_0x270e('0x20')](_0x2abbab[_0x270e('0x21')],{'raw':_0x2abbab[_0x270e('0x22')]?_0x2abbab[_0x270e('0x22')][_0x270e('0x23')]===undefined?!![]:![]:!![]})[_0x270e('0x13')](function(_0x2dbcce){logger[_0x270e('0x24')](_0x270e('0x1e'),_0x2abbab);logger[_0x270e('0x15')](_0x270e('0x1e'),_0x2abbab,JSON['stringify'](_0x2dbcce));_0x350fca(_0x2dbcce);})[_0x270e('0x1d')](function(_0x503dd0){logger[_0x270e('0x19')]('CreateChatMessage',_0x503dd0['message'],_0x2abbab);_0x77216d(_0x45f0f0['error'](0x1f4,_0x503dd0[_0x270e('0x1b')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 8e8df58..6cc1eb5 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 _0x25fa=['remove','update','emit','removeListener','length','chatMessage:','./chatMessage.events'];(function(_0x1ee611,_0x377a3a){var _0x3bce0a=function(_0x5357c6){while(--_0x5357c6){_0x1ee611['push'](_0x1ee611['shift']());}};_0x3bce0a(++_0x377a3a);}(_0x25fa,0x109));var _0xa25f=function(_0x24568f,_0x361551){_0x24568f=_0x24568f-0x0;var _0x220479=_0x25fa[_0x24568f];return _0x220479;};'use strict';var ChatMessageEvents=require(_0xa25f('0x0'));var events=['save',_0xa25f('0x1'),_0xa25f('0x2')];function createListener(_0x57e272,_0x408155){return function(_0xb88bd8){_0x408155[_0xa25f('0x3')](_0x57e272,_0xb88bd8);};}function removeListener(_0x4d0b34,_0x4e444d){return function(){ChatMessageEvents[_0xa25f('0x4')](_0x4d0b34,_0x4e444d);};}exports['register']=function(_0x2ea9ea){for(var _0x3ab530=0x0,_0x29666d=events[_0xa25f('0x5')];_0x3ab530<_0x29666d;_0x3ab530++){var _0x22982b=events[_0x3ab530];var _0x168907=createListener(_0xa25f('0x6')+_0x22982b,_0x2ea9ea);ChatMessageEvents['on'](_0x22982b,_0x168907);}};
\ No newline at end of file
+var _0x6d19=['./chatMessage.events','save','remove','update','removeListener','register','length','chatMessage:'];(function(_0x1bbc08,_0x444008){var _0x5d825b=function(_0x522920){while(--_0x522920){_0x1bbc08['push'](_0x1bbc08['shift']());}};_0x5d825b(++_0x444008);}(_0x6d19,0x160));var _0x96d1=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x6d19[_0x4792c8];return _0x35edb1;};'use strict';var ChatMessageEvents=require(_0x96d1('0x0'));var events=[_0x96d1('0x1'),_0x96d1('0x2'),_0x96d1('0x3')];function createListener(_0x874fcb,_0x31518c){return function(_0x36405d){_0x31518c['emit'](_0x874fcb,_0x36405d);};}function removeListener(_0x186315,_0x394a34){return function(){ChatMessageEvents[_0x96d1('0x4')](_0x186315,_0x394a34);};}exports[_0x96d1('0x5')]=function(_0x58854b){for(var _0x32b7d9=0x0,_0x230638=events[_0x96d1('0x6')];_0x32b7d9<_0x230638;_0x32b7d9++){var _0x58ade3=events[_0x32b7d9];var _0xba2d03=createListener(_0x96d1('0x7')+_0x58ade3,_0x58854b);ChatMessageEvents['on'](_0x58ade3,_0xba2d03);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 812fa26..d27ebc6 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 _0x2e32=['fs-extra','../../components/interaction/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','get','describe','/:id','post','tracked','chatmessage:create','create','update','put','/:id/accept','/:id/reject','reject','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x474148,_0x1343ad){var _0x531750=function(_0x1914ab){while(--_0x1914ab){_0x474148['push'](_0x474148['shift']());}};_0x531750(++_0x1343ad);}(_0x2e32,0x128));var _0x22e3=function(_0x26f702,_0x3919bf){_0x26f702=_0x26f702-0x0;var _0x11417d=_0x2e32[_0x26f702];return _0x11417d;};'use strict';var multer=require('multer');var util=require(_0x22e3('0x0'));var path=require('path');var timeout=require(_0x22e3('0x1'));var express=require(_0x22e3('0x2'));var router=express[_0x22e3('0x3')]();var fs_extra=require(_0x22e3('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x22e3('0x5'));var config=require(_0x22e3('0x6'));var controller=require(_0x22e3('0x7'));router['get']('/',auth[_0x22e3('0x8')](),controller[_0x22e3('0x9')]);router[_0x22e3('0xa')]('/describe',auth[_0x22e3('0x8')](),controller[_0x22e3('0xb')]);router['get'](_0x22e3('0xc'),auth[_0x22e3('0x8')](),controller['show']);router[_0x22e3('0xd')]('/',auth[_0x22e3('0x8')](),interaction[_0x22e3('0xe')]('chat',_0x22e3('0xf')),controller[_0x22e3('0x10')]);router['put'](_0x22e3('0xc'),controller[_0x22e3('0x11')]);router[_0x22e3('0x12')](_0x22e3('0x13'),auth[_0x22e3('0x8')](),controller['accept']);router[_0x22e3('0x12')](_0x22e3('0x14'),auth['isAuthenticated'](),controller[_0x22e3('0x15')]);router[_0x22e3('0x16')]('/:id',auth[_0x22e3('0x8')](),controller[_0x22e3('0x17')]);module[_0x22e3('0x18')]=router;
\ No newline at end of file
+var _0xef60=['chatmessage:create','create','put','/:id/accept','accept','/:id/reject','reject','delete','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','post','tracked'];(function(_0xd0a847,_0x72562b){var _0x2536ec=function(_0x20e4db){while(--_0x20e4db){_0xd0a847['push'](_0xd0a847['shift']());}};_0x2536ec(++_0x72562b);}(_0xef60,0x189));var _0x0ef6=function(_0x2c9989,_0x538f37){_0x2c9989=_0x2c9989-0x0;var _0x33663e=_0xef60[_0x2c9989];return _0x33663e;};'use strict';var multer=require('multer');var util=require(_0x0ef6('0x0'));var path=require(_0x0ef6('0x1'));var timeout=require(_0x0ef6('0x2'));var express=require('express');var router=express[_0x0ef6('0x3')]();var fs_extra=require(_0x0ef6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0ef6('0x5'));var config=require('../../config/environment');var controller=require(_0x0ef6('0x6'));router[_0x0ef6('0x7')]('/',auth[_0x0ef6('0x8')](),controller['index']);router[_0x0ef6('0x7')](_0x0ef6('0x9'),auth['isAuthenticated'](),controller[_0x0ef6('0xa')]);router[_0x0ef6('0x7')](_0x0ef6('0xb'),auth[_0x0ef6('0x8')](),controller[_0x0ef6('0xc')]);router[_0x0ef6('0xd')]('/',auth[_0x0ef6('0x8')](),interaction[_0x0ef6('0xe')]('chat',_0x0ef6('0xf')),controller[_0x0ef6('0x10')]);router['put'](_0x0ef6('0xb'),controller['update']);router[_0x0ef6('0x11')](_0x0ef6('0x12'),auth[_0x0ef6('0x8')](),controller[_0x0ef6('0x13')]);router[_0x0ef6('0x11')](_0x0ef6('0x14'),auth[_0x0ef6('0x8')](),controller[_0x0ef6('0x15')]);router[_0x0ef6('0x16')]('/:id',auth[_0x0ef6('0x8')](),controller['destroy']);module[_0x0ef6('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 45a5c33..b07c4a8 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0b0e=['medium','sequelize','TEXT'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x0b0e,0x187));var _0xe0b0=function(_0x55af86,_0x5c8ff6){_0x55af86=_0x55af86-0x0;var _0x58df3b=_0x0b0e[_0x55af86];return _0x58df3b;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('0x2')),'allowNull':![]}};
\ No newline at end of file
+var _0x5f2f=['exports','TEXT','medium','sequelize'];(function(_0x5aa847,_0x34149b){var _0x18c377=function(_0x417a3b){while(--_0x417a3b){_0x5aa847['push'](_0x5aa847['shift']());}};_0x18c377(++_0x34149b);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5a17ab,_0x58c7f4){_0x5a17ab=_0x5a17ab-0x0;var _0x44bc4c=_0x5f2f[_0x5a17ab];return _0x44bc4c;};'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
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 5e79dcc..cfc7b99 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(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x7a54,0x106));var _0x47a5=function(_0x3bac36,_0x31036c){_0x3bac36=_0x3bac36-0x0;var _0x1a2be6=_0x7a54[_0x3bac36];return _0x1a2be6;};'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(_0x112676,_0x46a05b){var _0x45ee73=function(_0xf34549){while(--_0xf34549){_0x112676['push'](_0x112676['shift']());}};_0x45ee73(++_0x46a05b);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'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 db0b7a0..65419c7 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 _0xad5f=['exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x3e6793,_0x48ec08){var _0x5277f0=function(_0x590cc7){while(--_0x590cc7){_0x3e6793['push'](_0x3e6793['shift']());}};_0x5277f0(++_0x48ec08);}(_0xad5f,0x1a8));var _0xfad5=function(_0x913b85,_0x213182){_0x913b85=_0x913b85-0x0;var _0x1ce434=_0xad5f[_0x913b85];return _0x1ce434;};'use strict';var EventEmitter=require(_0xfad5('0x0'));var ChatOfflineMessage=require(_0xfad5('0x1'))['db'][_0xfad5('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xfad5('0x3')](0x0);var events={'afterCreate':_0xfad5('0x4'),'afterUpdate':_0xfad5('0x5'),'afterDestroy':'remove'};function emitEvent(_0xcc61b1){return function(_0x316561,_0x1ae06d,_0x2da73e){ChatOfflineMessageEvents[_0xfad5('0x6')](_0xcc61b1+':'+_0x316561['id'],_0x316561);ChatOfflineMessageEvents[_0xfad5('0x6')](_0xcc61b1,_0x316561);_0x2da73e(null);};}for(var e in events){if(events[_0xfad5('0x7')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0xfad5('0x8')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x81a5=['emit','exports','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','remove'];(function(_0x705b98,_0x1c345b){var _0x47b72f=function(_0x44f02a){while(--_0x44f02a){_0x705b98['push'](_0x705b98['shift']());}};_0x47b72f(++_0x1c345b);}(_0x81a5,0x17c));var _0x581a=function(_0x31992b,_0x31ddd7){_0x31992b=_0x31992b-0x0;var _0xebda77=_0x81a5[_0x31992b];return _0xebda77;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x581a('0x0'))['db'][_0x581a('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x581a('0x2')](0x0);var events={'afterCreate':_0x581a('0x3'),'afterUpdate':'update','afterDestroy':_0x581a('0x4')};function emitEvent(_0x107c57){return function(_0x55940d,_0x3d31cd,_0x4b28eb){ChatOfflineMessageEvents[_0x581a('0x5')](_0x107c57+':'+_0x55940d['id'],_0x55940d);ChatOfflineMessageEvents[_0x581a('0x5')](_0x107c57,_0x55940d);_0x4b28eb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0x581a('0x6')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index c043910..6aaa808 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 _0x9bfb=['utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage'];(function(_0x313911,_0x4e7da1){var _0x369790=function(_0x2aeb31){while(--_0x2aeb31){_0x313911['push'](_0x313911['shift']());}};_0x369790(++_0x4e7da1);}(_0x9bfb,0x16a));var _0xb9bf=function(_0x195fbb,_0x3e7933){_0x195fbb=_0x195fbb-0x0;var _0x6c5304=_0x9bfb[_0x195fbb];return _0x6c5304;};'use strict';var attributes=require(_0xb9bf('0x0'));module[_0xb9bf('0x1')]=function(_0x5f4620){return _0x5f4620[_0xb9bf('0x2')](_0xb9bf('0x3'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb9bf('0x4'),'collate':_0xb9bf('0x5')});};
\ No newline at end of file
+var _0xa53c=['utf8mb4_unicode_ci','ChatOfflineMessage','utf8mb4'];(function(_0x4664db,_0x1de672){var _0x5615b4=function(_0x54fb5a){while(--_0x54fb5a){_0x4664db['push'](_0x4664db['shift']());}};_0x5615b4(++_0x1de672);}(_0xa53c,0x8e));var _0xca53=function(_0x47cc3f,_0x2dcc5d){_0x47cc3f=_0x47cc3f-0x0;var _0x272464=_0xa53c[_0x47cc3f];return _0x272464;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module['exports']=function(_0x4792ab){return _0x4792ab['define'](_0xca53('0x0'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xca53('0x1'),'collate':_0xca53('0x2')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index c2cf29d..7293974 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 _0x3d17=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','lodash','util','moment'];(function(_0x46cc70,_0x46ee26){var _0xa54f3c=function(_0x30d94b){while(--_0x30d94b){_0x46cc70['push'](_0x46cc70['shift']());}};_0xa54f3c(++_0x46ee26);}(_0x3d17,0x1cb));var _0x73d1=function(_0x5e3701,_0x596265){_0x5e3701=_0x5e3701-0x0;var _0x345dcf=_0x3d17[_0x5e3701];return _0x345dcf;};'use strict';var _=require(_0x73d1('0x0'));var util=require(_0x73d1('0x1'));var moment=require(_0x73d1('0x2'));var BPromise=require(_0x73d1('0x3'));var rs=require(_0x73d1('0x4'));var fs=require('fs');var Redis=require(_0x73d1('0x5'));var db=require(_0x73d1('0x6'))['db'];var utils=require(_0x73d1('0x7'));var logger=require('../../config/logger')(_0x73d1('0x8'));var config=require(_0x73d1('0x9'));var jayson=require(_0x73d1('0xa'));var client=jayson[_0x73d1('0xb')][_0x73d1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x48a4d3,_0x1e6ee1,_0x1d018b){return new BPromise(function(_0x5261b5,_0x6319a6){return client[_0x73d1('0xd')](_0x48a4d3,_0x1d018b)[_0x73d1('0xe')](function(_0xf34cac){logger[_0x73d1('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x1e6ee1,_0x73d1('0x10'));logger[_0x73d1('0x11')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x1e6ee1,'request\x20sent',JSON['stringify'](_0xf34cac));if(_0xf34cac[_0x73d1('0x12')]){if(_0xf34cac[_0x73d1('0x12')][_0x73d1('0x13')]===0x1f4){logger[_0x73d1('0x12')](_0x73d1('0x14'),_0x1e6ee1,_0xf34cac[_0x73d1('0x12')][_0x73d1('0x15')]);return _0x6319a6(_0xf34cac['error'][_0x73d1('0x15')]);}logger[_0x73d1('0x12')](_0x73d1('0x14'),_0x1e6ee1,_0xf34cac['error'][_0x73d1('0x15')]);return _0x5261b5(_0xf34cac['error'][_0x73d1('0x15')]);}else{logger[_0x73d1('0xf')](_0x73d1('0x14'),_0x1e6ee1,_0x73d1('0x10'));_0x5261b5(_0xf34cac['result']['message']);}})['catch'](function(_0x179ae1){logger[_0x73d1('0x12')](_0x73d1('0x14'),_0x1e6ee1,_0x179ae1);_0x6319a6(_0x179ae1);});});}
\ No newline at end of file
+var _0x9208=['error','ChatOfflineMessage,\x20%s,\x20%s','message','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x9208,0x108));var _0x8920=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9208[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x8920('0x0'));var util=require(_0x8920('0x1'));var moment=require('moment');var BPromise=require(_0x8920('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8920('0x3'))['db'];var utils=require(_0x8920('0x4'));var logger=require(_0x8920('0x5'))(_0x8920('0x6'));var config=require('../../config/environment');var jayson=require(_0x8920('0x7'));var client=jayson[_0x8920('0x8')][_0x8920('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x54eb58,_0x3db362,_0x185860){return new BPromise(function(_0x24f425,_0x2dd9b1){return client[_0x8920('0xa')](_0x54eb58,_0x185860)[_0x8920('0xb')](function(_0x3a7211){logger[_0x8920('0xc')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3db362,_0x8920('0xd'));logger[_0x8920('0xe')](_0x8920('0xf'),_0x3db362,_0x8920('0xd'),JSON['stringify'](_0x3a7211));if(_0x3a7211[_0x8920('0x10')]){if(_0x3a7211[_0x8920('0x10')]['code']===0x1f4){logger[_0x8920('0x10')](_0x8920('0x11'),_0x3db362,_0x3a7211['error'][_0x8920('0x12')]);return _0x2dd9b1(_0x3a7211['error'][_0x8920('0x12')]);}logger[_0x8920('0x10')](_0x8920('0x11'),_0x3db362,_0x3a7211[_0x8920('0x10')][_0x8920('0x12')]);return _0x24f425(_0x3a7211[_0x8920('0x10')][_0x8920('0x12')]);}else{logger[_0x8920('0xc')](_0x8920('0x11'),_0x3db362,_0x8920('0xd'));_0x24f425(_0x3a7211['result'][_0x8920('0x12')]);}})[_0x8920('0x13')](function(_0x6924c8){logger['error'](_0x8920('0x11'),_0x3db362,_0x6924c8);_0x2dd9b1(_0x6924c8);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 373468c..fcd8a27 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 _0xdac8=['./chatOfflineMessage.controller','get','/describe','describe','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x553559,_0x1a3e3f){var _0x51819=function(_0xcfe7d9){while(--_0xcfe7d9){_0x553559['push'](_0x553559['shift']());}};_0x51819(++_0x1a3e3f);}(_0xdac8,0x11f));var _0x8dac=function(_0x4a8ecb,_0x3d7e49){_0x4a8ecb=_0x4a8ecb-0x0;var _0x3301f0=_0xdac8[_0x4a8ecb];return _0x3301f0;};'use strict';var multer=require(_0x8dac('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8dac('0x1'));var express=require(_0x8dac('0x2'));var router=express[_0x8dac('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8dac('0x4'));var interaction=require(_0x8dac('0x5'));var config=require(_0x8dac('0x6'));var controller=require(_0x8dac('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x8dac('0x8')](_0x8dac('0x9'),auth['isAuthenticated'](),controller[_0x8dac('0xa')]);router[_0x8dac('0x8')](_0x8dac('0xb'),auth[_0x8dac('0xc')](),controller[_0x8dac('0xd')]);router[_0x8dac('0xe')]('/',auth[_0x8dac('0xc')](),controller[_0x8dac('0xf')]);router[_0x8dac('0x10')]('/:id',auth[_0x8dac('0xc')](),controller[_0x8dac('0x11')]);router[_0x8dac('0x12')](_0x8dac('0xb'),auth['isAuthenticated'](),controller[_0x8dac('0x13')]);module[_0x8dac('0x14')]=router;
\ No newline at end of file
+var _0x1c78=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','describe','/:id','show','post','create','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x36d203,_0x3653f3){var _0x2f9e62=function(_0x461a77){while(--_0x461a77){_0x36d203['push'](_0x36d203['shift']());}};_0x2f9e62(++_0x3653f3);}(_0x1c78,0x1b2));var _0x81c7=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x1c78[_0x432682];return _0x463d05;};'use strict';var multer=require(_0x81c7('0x0'));var util=require(_0x81c7('0x1'));var path=require('path');var timeout=require(_0x81c7('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x81c7('0x3'));var auth=require(_0x81c7('0x4'));var interaction=require(_0x81c7('0x5'));var config=require(_0x81c7('0x6'));var controller=require(_0x81c7('0x7'));router[_0x81c7('0x8')]('/',auth[_0x81c7('0x9')](),controller['index']);router[_0x81c7('0x8')]('/describe',auth[_0x81c7('0x9')](),controller[_0x81c7('0xa')]);router[_0x81c7('0x8')](_0x81c7('0xb'),auth['isAuthenticated'](),controller[_0x81c7('0xc')]);router[_0x81c7('0xd')]('/',auth['isAuthenticated'](),controller[_0x81c7('0xe')]);router['put'](_0x81c7('0xb'),auth['isAuthenticated'](),controller[_0x81c7('0xf')]);router[_0x81c7('0x10')]('/:id',auth[_0x81c7('0x9')](),controller[_0x81c7('0x11')]);module[_0x81c7('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 537bc1f..55856f0 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 _0x7c2d=['exports','mouseOver','INTEGER'];(function(_0x2424de,_0x4f093e){var _0x56add1=function(_0xf05dee){while(--_0xf05dee){_0x2424de['push'](_0x2424de['shift']());}};_0x56add1(++_0x4f093e);}(_0x7c2d,0x11d));var _0xd7c2=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x7c2d[_0x263a74];return _0x2aa86c;};'use strict';var Sequelize=require('sequelize');module[_0xd7c2('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xd7c2('0x1'),'timeout'),'defaultValue':'mouseOver'},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xd7c2('0x2')]}};
\ No newline at end of file
+var _0x2fc3=['INTEGER','sequelize','exports','STRING','ENUM','mouseOver','timeout'];(function(_0x12e1b8,_0x423530){var _0x5d4243=function(_0x367d3f){while(--_0x367d3f){_0x12e1b8['push'](_0x12e1b8['shift']());}};_0x5d4243(++_0x423530);}(_0x2fc3,0x104));var _0x32fc=function(_0x788559,_0x1f69fa){_0x788559=_0x788559-0x0;var _0xe3a758=_0x2fc3[_0x788559];return _0xe3a758;};'use strict';var Sequelize=require(_0x32fc('0x0'));module[_0x32fc('0x1')]={'name':{'type':Sequelize[_0x32fc('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x32fc('0x3')](_0x32fc('0x4'),_0x32fc('0x5')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x32fc('0x2')]},'timeout':{'type':Sequelize[_0x32fc('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 4b1aa61..ed019a3 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 _0x503a=['path','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','show','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','options','ChatProactiveAction','find','catch','create','body','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x3c6181,_0x36229f){var _0x3ddd5f=function(_0x4b096e){while(--_0x4b096e){_0x3c6181['push'](_0x3c6181['shift']());}};_0x3ddd5f(++_0x36229f);}(_0x503a,0x19d));var _0xa503=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0x503a[_0x397cfb];return _0x15fed9;};'use strict';var emlformat=require(_0xa503('0x0'));var rimraf=require(_0xa503('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa503('0x2'));var rp=require('request-promise');var moment=require(_0xa503('0x3'));var BPromise=require(_0xa503('0x4'));var Mustache=require(_0xa503('0x5'));var util=require(_0xa503('0x6'));var path=require(_0xa503('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa503('0x8'));var _=require(_0xa503('0x9'));var squel=require('squel');var crypto=require(_0xa503('0xa'));var jsforce=require(_0xa503('0xb'));var deskjs=require(_0xa503('0xc'));var toCsv=require(_0xa503('0xd'));var querystring=require(_0xa503('0xe'));var Papa=require(_0xa503('0xf'));var Redis=require(_0xa503('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa503('0x11'));var as=require(_0xa503('0x12'));var hardwareService=require(_0xa503('0x13'));var logger=require('../../config/logger')(_0xa503('0x14'));var utils=require('../../config/utils');var config=require(_0xa503('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xa503('0x16'))['db'];function respondWithStatusCode(_0x29df40,_0x4a47a2){_0x4a47a2=_0x4a47a2||0xcc;return function(_0x524b6c){if(_0x524b6c){return _0x29df40[_0xa503('0x17')](_0x4a47a2);}return _0x29df40[_0xa503('0x18')](_0x4a47a2)[_0xa503('0x19')]();};}function respondWithResult(_0x1db19b,_0x32174a){_0x32174a=_0x32174a||0xc8;return function(_0x1c1971){if(_0x1c1971){return _0x1db19b[_0xa503('0x18')](_0x32174a)[_0xa503('0x1a')](_0x1c1971);}};}function respondWithFilteredResult(_0x3ae1b0,_0x3e81b7){return function(_0x3cbfb6){if(_0x3cbfb6){var _0x36f98d=typeof _0x3e81b7[_0xa503('0x1b')]===_0xa503('0x1c')&&typeof _0x3e81b7['limit']===_0xa503('0x1c');var _0x2a9557=_0x3cbfb6[_0xa503('0x1d')];var _0x11e4a5=_0x36f98d?0x0:_0x3e81b7[_0xa503('0x1b')];var _0x5aae98=_0x36f98d?_0x3cbfb6[_0xa503('0x1d')]:_0x3e81b7['offset']+_0x3e81b7[_0xa503('0x1e')];var _0x4157f5;if(_0x5aae98>=_0x2a9557){_0x5aae98=_0x2a9557;_0x4157f5=0xc8;}else{_0x4157f5=0xce;}_0x3ae1b0[_0xa503('0x18')](_0x4157f5);return _0x3ae1b0[_0xa503('0x1f')](_0xa503('0x20'),_0x11e4a5+'-'+_0x5aae98+'/'+_0x2a9557)[_0xa503('0x1a')](_0x3cbfb6);}return null;};}function patchUpdates(_0x207bfb){return function(_0x10486f){try{jsonpatch[_0xa503('0x21')](_0x10486f,_0x207bfb,!![]);}catch(_0x22f758){return BPromise[_0xa503('0x22')](_0x22f758);}return _0x10486f[_0xa503('0x23')]();};}function saveUpdates(_0x57a26e,_0x5d56e8){return function(_0x420de8){if(_0x420de8){return _0x420de8[_0xa503('0x24')](_0x57a26e)[_0xa503('0x25')](function(_0x469ad6){return _0x469ad6;});}return null;};}function removeEntity(_0x1b125c,_0x5e0402){return function(_0x19f679){if(_0x19f679){return _0x19f679[_0xa503('0x26')]()[_0xa503('0x25')](function(){_0x1b125c['status'](0xcc)[_0xa503('0x19')]();});}};}function handleEntityNotFound(_0x22c7ec,_0x49df0e){return function(_0x686750){if(!_0x686750){_0x22c7ec['sendStatus'](0x194);}return _0x686750;};}function handleError(_0x26b787,_0x2b059d){_0x2b059d=_0x2b059d||0x1f4;return function(_0x3289d4){logger[_0xa503('0x27')](_0x3289d4['stack']);if(_0x3289d4['name']){delete _0x3289d4[_0xa503('0x28')];}_0x26b787[_0xa503('0x18')](_0x2b059d)[_0xa503('0x29')](_0x3289d4);};}exports[_0xa503('0x2a')]=function(_0x37dee2,_0x404733){var _0x57f92b={'raw':!![],'where':{'id':_0x37dee2[_0xa503('0x2b')]['id']}},_0x156f08={};_0x156f08[_0xa503('0x2c')]=_[_0xa503('0x2d')](db['ChatProactiveAction'][_0xa503('0x2e')]);_0x156f08['query']=_[_0xa503('0x2d')](_0x37dee2[_0xa503('0x2f')]);_0x156f08[_0xa503('0x30')]=_[_0xa503('0x31')](_0x156f08[_0xa503('0x2c')],_0x156f08[_0xa503('0x2f')]);_0x57f92b[_0xa503('0x32')]=_['intersection'](_0x156f08[_0xa503('0x2c')],qs[_0xa503('0x33')](_0x37dee2[_0xa503('0x2f')][_0xa503('0x33')]));_0x57f92b[_0xa503('0x32')]=_0x57f92b[_0xa503('0x32')][_0xa503('0x34')]?_0x57f92b[_0xa503('0x32')]:_0x156f08[_0xa503('0x2c')];if(_0x37dee2['query'][_0xa503('0x35')]){_0x57f92b['include']=[{'all':!![]}];}_0x57f92b=_['merge']({},_0x57f92b,_0x37dee2[_0xa503('0x36')]);return db[_0xa503('0x37')][_0xa503('0x38')](_0x57f92b)[_0xa503('0x25')](handleEntityNotFound(_0x404733,null))[_0xa503('0x25')](respondWithResult(_0x404733,null))[_0xa503('0x39')](handleError(_0x404733,null));};exports[_0xa503('0x3a')]=function(_0x5477b9,_0x5952ec){return db[_0xa503('0x37')][_0xa503('0x3a')](_0x5477b9[_0xa503('0x3b')],{})[_0xa503('0x25')](respondWithResult(_0x5952ec,0xc9))[_0xa503('0x39')](handleError(_0x5952ec,null));};exports[_0xa503('0x24')]=function(_0x9d39c2,_0x22bcd5){if(_0x9d39c2['body']['id']){delete _0x9d39c2[_0xa503('0x3b')]['id'];}return db[_0xa503('0x37')][_0xa503('0x38')]({'where':{'id':_0x9d39c2[_0xa503('0x2b')]['id']}})['then'](handleEntityNotFound(_0x22bcd5,null))[_0xa503('0x25')](saveUpdates(_0x9d39c2[_0xa503('0x3b')],null))['then'](respondWithResult(_0x22bcd5,null))[_0xa503('0x39')](handleError(_0x22bcd5,null));};exports['destroy']=function(_0xcc6711,_0x21e6b8){return db['ChatProactiveAction'][_0xa503('0x38')]({'where':{'id':_0xcc6711[_0xa503('0x2b')]['id']}})['then'](handleEntityNotFound(_0x21e6b8,null))[_0xa503('0x25')](removeEntity(_0x21e6b8,null))[_0xa503('0x39')](handleError(_0x21e6b8,null));};
\ No newline at end of file
+var _0x864a=['set','Content-Range','reject','update','then','destroy','stack','name','send','model','ChatProactiveAction','rawAttributes','keys','query','filters','attributes','intersection','fields','length','includeAll','options','find','create','body','catch','params','eml-format','rimraf','zip-dir','fast-json-patch','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x864a,0x8a));var _0xa864=function(_0x311a2f,_0xa832c1){_0x311a2f=_0x311a2f-0x0;var _0x33b564=_0x864a[_0x311a2f];return _0x33b564;};'use strict';var emlformat=require(_0xa864('0x0'));var rimraf=require(_0xa864('0x1'));var zipdir=require(_0xa864('0x2'));var jsonpatch=require(_0xa864('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa864('0x4'));var util=require('util');var path=require('path');var sox=require(_0xa864('0x5'));var csv=require(_0xa864('0x6'));var ejs=require(_0xa864('0x7'));var fs=require('fs');var fs_extra=require(_0xa864('0x8'));var _=require(_0xa864('0x9'));var squel=require('squel');var crypto=require(_0xa864('0xa'));var jsforce=require(_0xa864('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xa864('0x6'));var querystring=require(_0xa864('0xc'));var Papa=require(_0xa864('0xd'));var Redis=require(_0xa864('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa864('0xf'));var hardwareService=require(_0xa864('0x10'));var logger=require(_0xa864('0x11'))(_0xa864('0x12'));var utils=require(_0xa864('0x13'));var config=require(_0xa864('0x14'));var licenseUtil=require(_0xa864('0x15'));var db=require(_0xa864('0x16'))['db'];function respondWithStatusCode(_0x44a6b7,_0x1c4242){_0x1c4242=_0x1c4242||0xcc;return function(_0x5f3cc2){if(_0x5f3cc2){return _0x44a6b7[_0xa864('0x17')](_0x1c4242);}return _0x44a6b7[_0xa864('0x18')](_0x1c4242)['end']();};}function respondWithResult(_0x9e3d5a,_0x6e0430){_0x6e0430=_0x6e0430||0xc8;return function(_0x2d82d1){if(_0x2d82d1){return _0x9e3d5a[_0xa864('0x18')](_0x6e0430)[_0xa864('0x19')](_0x2d82d1);}};}function respondWithFilteredResult(_0x2aeed5,_0x4a3055){return function(_0x43a1f7){if(_0x43a1f7){var _0x212513=typeof _0x4a3055[_0xa864('0x1a')]===_0xa864('0x1b')&&typeof _0x4a3055[_0xa864('0x1c')]===_0xa864('0x1b');var _0x2e8336=_0x43a1f7[_0xa864('0x1d')];var _0x5e7d59=_0x212513?0x0:_0x4a3055[_0xa864('0x1a')];var _0x40cc6a=_0x212513?_0x43a1f7['count']:_0x4a3055[_0xa864('0x1a')]+_0x4a3055[_0xa864('0x1c')];var _0x1b3941;if(_0x40cc6a>=_0x2e8336){_0x40cc6a=_0x2e8336;_0x1b3941=0xc8;}else{_0x1b3941=0xce;}_0x2aeed5[_0xa864('0x18')](_0x1b3941);return _0x2aeed5[_0xa864('0x1e')](_0xa864('0x1f'),_0x5e7d59+'-'+_0x40cc6a+'/'+_0x2e8336)[_0xa864('0x19')](_0x43a1f7);}return null;};}function patchUpdates(_0x91b2dc){return function(_0x7e9cab){try{jsonpatch['apply'](_0x7e9cab,_0x91b2dc,!![]);}catch(_0xc4c6ce){return BPromise[_0xa864('0x20')](_0xc4c6ce);}return _0x7e9cab['save']();};}function saveUpdates(_0x14873a,_0x37dc42){return function(_0x31d019){if(_0x31d019){return _0x31d019[_0xa864('0x21')](_0x14873a)[_0xa864('0x22')](function(_0x3b6bd5){return _0x3b6bd5;});}return null;};}function removeEntity(_0x452be5,_0x544415){return function(_0x282b12){if(_0x282b12){return _0x282b12[_0xa864('0x23')]()['then'](function(){_0x452be5[_0xa864('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f2068,_0x7beb66){return function(_0x2e7123){if(!_0x2e7123){_0x3f2068['sendStatus'](0x194);}return _0x2e7123;};}function handleError(_0x4ec4e4,_0xa77740){_0xa77740=_0xa77740||0x1f4;return function(_0x474872){logger['error'](_0x474872[_0xa864('0x24')]);if(_0x474872[_0xa864('0x25')]){delete _0x474872[_0xa864('0x25')];}_0x4ec4e4[_0xa864('0x18')](_0xa77740)[_0xa864('0x26')](_0x474872);};}exports['show']=function(_0x4235e8,_0x1b3e9f){var _0x4e519b={'raw':!![],'where':{'id':_0x4235e8['params']['id']}},_0x18da54={};_0x18da54[_0xa864('0x27')]=_['keys'](db[_0xa864('0x28')][_0xa864('0x29')]);_0x18da54['query']=_[_0xa864('0x2a')](_0x4235e8[_0xa864('0x2b')]);_0x18da54[_0xa864('0x2c')]=_['intersection'](_0x18da54[_0xa864('0x27')],_0x18da54['query']);_0x4e519b[_0xa864('0x2d')]=_[_0xa864('0x2e')](_0x18da54[_0xa864('0x27')],qs['fields'](_0x4235e8[_0xa864('0x2b')][_0xa864('0x2f')]));_0x4e519b['attributes']=_0x4e519b['attributes'][_0xa864('0x30')]?_0x4e519b[_0xa864('0x2d')]:_0x18da54['model'];if(_0x4235e8[_0xa864('0x2b')][_0xa864('0x31')]){_0x4e519b['include']=[{'all':!![]}];}_0x4e519b=_['merge']({},_0x4e519b,_0x4235e8[_0xa864('0x32')]);return db[_0xa864('0x28')][_0xa864('0x33')](_0x4e519b)[_0xa864('0x22')](handleEntityNotFound(_0x1b3e9f,null))[_0xa864('0x22')](respondWithResult(_0x1b3e9f,null))['catch'](handleError(_0x1b3e9f,null));};exports[_0xa864('0x34')]=function(_0x23b518,_0x59b186){return db['ChatProactiveAction']['create'](_0x23b518[_0xa864('0x35')],{})[_0xa864('0x22')](respondWithResult(_0x59b186,0xc9))[_0xa864('0x36')](handleError(_0x59b186,null));};exports['update']=function(_0x319842,_0x2bfcdc){if(_0x319842['body']['id']){delete _0x319842['body']['id'];}return db[_0xa864('0x28')][_0xa864('0x33')]({'where':{'id':_0x319842[_0xa864('0x37')]['id']}})[_0xa864('0x22')](handleEntityNotFound(_0x2bfcdc,null))[_0xa864('0x22')](saveUpdates(_0x319842[_0xa864('0x35')],null))[_0xa864('0x22')](respondWithResult(_0x2bfcdc,null))[_0xa864('0x36')](handleError(_0x2bfcdc,null));};exports[_0xa864('0x23')]=function(_0x136185,_0x9cba3b){return db[_0xa864('0x28')][_0xa864('0x33')]({'where':{'id':_0x136185[_0xa864('0x37')]['id']}})[_0xa864('0x22')](handleEntityNotFound(_0x9cba3b,null))['then'](removeEntity(_0x9cba3b,null))['catch'](handleError(_0x9cba3b,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 6f07fd7..c368f1f 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 _0x2240=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','lodash','util'];(function(_0x5e8160,_0x4ce8dd){var _0x27bd5e=function(_0x20429f){while(--_0x20429f){_0x5e8160['push'](_0x5e8160['shift']());}};_0x27bd5e(++_0x4ce8dd);}(_0x2240,0xa7));var _0x0224=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x2240[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x0224('0x0'));var util=require(_0x0224('0x1'));var logger=require(_0x0224('0x2'))(_0x0224('0x3'));var moment=require(_0x0224('0x4'));var BPromise=require(_0x0224('0x5'));var rp=require(_0x0224('0x6'));var fs=require('fs');var path=require(_0x0224('0x7'));var rimraf=require(_0x0224('0x8'));var config=require('../../config/environment');var attributes=require(_0x0224('0x9'));module[_0x0224('0xa')]=function(_0x339055,_0x2f13ed){return _0x339055[_0x0224('0xb')](_0x0224('0xc'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdf85=['./chatProactiveAction.attributes','exports','define','chat_proactive_actions','lodash','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x38612f,_0x5c7a75){var _0x28bfff=function(_0x37318c){while(--_0x37318c){_0x38612f['push'](_0x38612f['shift']());}};_0x28bfff(++_0x5c7a75);}(_0xdf85,0x1c6));var _0x5df8=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xdf85[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x5df8('0x0'));var util=require('util');var logger=require(_0x5df8('0x1'))(_0x5df8('0x2'));var moment=require(_0x5df8('0x3'));var BPromise=require(_0x5df8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5df8('0x5'));var config=require('../../config/environment');var attributes=require(_0x5df8('0x6'));module[_0x5df8('0x7')]=function(_0x58b590,_0x5c9508){return _0x58b590[_0x5df8('0x8')]('ChatProactiveAction',attributes,{'tableName':_0x5df8('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 94bddfc..4e19ce4 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 _0x9e49=['code','message','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x5ac417,_0x18ec00){var _0x26d2da=function(_0x430ff4){while(--_0x430ff4){_0x5ac417['push'](_0x5ac417['shift']());}};_0x26d2da(++_0x18ec00);}(_0x9e49,0x17f));var _0x99e4=function(_0x833d9b,_0x19a5d6){_0x833d9b=_0x833d9b-0x0;var _0x2cc2a4=_0x9e49[_0x833d9b];return _0x2cc2a4;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x99e4('0x0'));var rs=require(_0x99e4('0x1'));var fs=require('fs');var Redis=require(_0x99e4('0x2'));var db=require(_0x99e4('0x3'))['db'];var utils=require(_0x99e4('0x4'));var logger=require(_0x99e4('0x5'))(_0x99e4('0x6'));var config=require('../../config/environment');var jayson=require(_0x99e4('0x7'));var client=jayson[_0x99e4('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5216a8,_0x19f12d,_0x3b3872){return new BPromise(function(_0x3a5043,_0x361875){return client[_0x99e4('0x9')](_0x5216a8,_0x3b3872)[_0x99e4('0xa')](function(_0x238fbd){logger[_0x99e4('0xb')](_0x99e4('0xc'),_0x19f12d,_0x99e4('0xd'));logger[_0x99e4('0xe')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x19f12d,_0x99e4('0xd'),JSON['stringify'](_0x238fbd));if(_0x238fbd['error']){if(_0x238fbd[_0x99e4('0xf')][_0x99e4('0x10')]===0x1f4){logger[_0x99e4('0xf')](_0x99e4('0xc'),_0x19f12d,_0x238fbd['error'][_0x99e4('0x11')]);return _0x361875(_0x238fbd[_0x99e4('0xf')][_0x99e4('0x11')]);}logger[_0x99e4('0xf')](_0x99e4('0xc'),_0x19f12d,_0x238fbd[_0x99e4('0xf')]['message']);return _0x3a5043(_0x238fbd[_0x99e4('0xf')]['message']);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x19f12d,_0x99e4('0xd'));_0x3a5043(_0x238fbd['result'][_0x99e4('0x11')]);}})[_0x99e4('0x12')](function(_0x116426){logger['error'](_0x99e4('0xc'),_0x19f12d,_0x116426);_0x361875(_0x116426);});});}
\ No newline at end of file
+var _0x0a9e=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch'];(function(_0x5742b1,_0x347a7d){var _0x1672a4=function(_0x32d22d){while(--_0x32d22d){_0x5742b1['push'](_0x5742b1['shift']());}};_0x1672a4(++_0x347a7d);}(_0x0a9e,0x180));var _0xe0a9=function(_0x4c1a13,_0x3a12b1){_0x4c1a13=_0x4c1a13-0x0;var _0x784143=_0x0a9e[_0x4c1a13];return _0x784143;};'use strict';var _=require(_0xe0a9('0x0'));var util=require(_0xe0a9('0x1'));var moment=require(_0xe0a9('0x2'));var BPromise=require(_0xe0a9('0x3'));var rs=require(_0xe0a9('0x4'));var fs=require('fs');var Redis=require(_0xe0a9('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe0a9('0x6'));var logger=require(_0xe0a9('0x7'))(_0xe0a9('0x8'));var config=require('../../config/environment');var jayson=require(_0xe0a9('0x9'));var client=jayson[_0xe0a9('0xa')][_0xe0a9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xa0de0,_0x2f2b9f,_0x532e89){return new BPromise(function(_0x326bde,_0x1261f2){return client[_0xe0a9('0xc')](_0xa0de0,_0x532e89)[_0xe0a9('0xd')](function(_0x2c1b37){logger[_0xe0a9('0xe')](_0xe0a9('0xf'),_0x2f2b9f,'request\x20sent');logger[_0xe0a9('0x10')](_0xe0a9('0x11'),_0x2f2b9f,_0xe0a9('0x12'),JSON[_0xe0a9('0x13')](_0x2c1b37));if(_0x2c1b37[_0xe0a9('0x14')]){if(_0x2c1b37[_0xe0a9('0x14')]['code']===0x1f4){logger[_0xe0a9('0x14')](_0xe0a9('0xf'),_0x2f2b9f,_0x2c1b37[_0xe0a9('0x14')]['message']);return _0x1261f2(_0x2c1b37[_0xe0a9('0x14')][_0xe0a9('0x15')]);}logger[_0xe0a9('0x14')](_0xe0a9('0xf'),_0x2f2b9f,_0x2c1b37[_0xe0a9('0x14')][_0xe0a9('0x15')]);return _0x326bde(_0x2c1b37[_0xe0a9('0x14')]['message']);}else{logger[_0xe0a9('0xe')](_0xe0a9('0xf'),_0x2f2b9f,_0xe0a9('0x12'));_0x326bde(_0x2c1b37[_0xe0a9('0x16')][_0xe0a9('0x15')]);}})[_0xe0a9('0x17')](function(_0x116619){logger[_0xe0a9('0x14')](_0xe0a9('0xf'),_0x2f2b9f,_0x116619);_0x1261f2(_0x116619);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index dbdc0e5..15f72a8 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 _0x33c5=['fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','util','path','express','Router'];(function(_0x196e05,_0x5cf779){var _0x21396a=function(_0x106333){while(--_0x106333){_0x196e05['push'](_0x196e05['shift']());}};_0x21396a(++_0x5cf779);}(_0x33c5,0xe6));var _0x533c=function(_0x1a8bbc,_0x17a086){_0x1a8bbc=_0x1a8bbc-0x0;var _0x212fc2=_0x33c5[_0x1a8bbc];return _0x212fc2;};'use strict';var multer=require('multer');var util=require(_0x533c('0x0'));var path=require(_0x533c('0x1'));var timeout=require('connect-timeout');var express=require(_0x533c('0x2'));var router=express[_0x533c('0x3')]();var fs_extra=require(_0x533c('0x4'));var auth=require(_0x533c('0x5'));var interaction=require(_0x533c('0x6'));var config=require('../../config/environment');var controller=require(_0x533c('0x7'));router[_0x533c('0x8')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0xb')]);router[_0x533c('0xc')]('/',auth[_0x533c('0xa')](),controller[_0x533c('0xd')]);router[_0x533c('0xe')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0xf')]);router[_0x533c('0x10')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x2eb2=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','/:id','isAuthenticated','show','post','create','put','update','delete','util'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x2eb2,0x19f));var _0x22eb=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0x2eb2[_0x3de8a4];return _0x4635cf;};'use strict';var multer=require('multer');var util=require(_0x22eb('0x0'));var path=require(_0x22eb('0x1'));var timeout=require(_0x22eb('0x2'));var express=require(_0x22eb('0x3'));var router=express[_0x22eb('0x4')]();var fs_extra=require(_0x22eb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x22eb('0x6'));var config=require('../../config/environment');var controller=require('./chatProactiveAction.controller');router[_0x22eb('0x7')](_0x22eb('0x8'),auth[_0x22eb('0x9')](),controller[_0x22eb('0xa')]);router[_0x22eb('0xb')]('/',auth[_0x22eb('0x9')](),controller[_0x22eb('0xc')]);router[_0x22eb('0xd')](_0x22eb('0x8'),auth[_0x22eb('0x9')](),controller[_0x22eb('0xe')]);router[_0x22eb('0xf')]('/:id',auth[_0x22eb('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 2e7fbfc..e34ca6f 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 _0xadb6=['name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','STRING'];(function(_0x1d3af2,_0x3e1edf){var _0x533053=function(_0x16e9d6){while(--_0x16e9d6){_0x1d3af2['push'](_0x1d3af2['shift']());}};_0x533053(++_0x3e1edf);}(_0xadb6,0x1ee));var _0x6adb=function(_0x41c768,_0x213f31){_0x41c768=_0x41c768-0x0;var _0x93edd=_0xadb6[_0x41c768];return _0x93edd;};'use strict';var Sequelize=require(_0x6adb('0x0'));module['exports']={'name':{'type':Sequelize[_0x6adb('0x1')],'unique':_0x6adb('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6adb('0x1')]},'timeout':{'type':Sequelize[_0x6adb('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6adb('0x4')](_0x6adb('0x5'),_0x6adb('0x6'),_0x6adb('0x7'))}};
\ No newline at end of file
+var _0xe55b=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','INTEGER','ENUM'];(function(_0x504a3d,_0x419142){var _0x503027=function(_0x14225b){while(--_0x14225b){_0x504a3d['push'](_0x504a3d['shift']());}};_0x503027(++_0x419142);}(_0xe55b,0x183));var _0xbe55=function(_0x3d2438,_0x2e7922){_0x3d2438=_0x3d2438-0x0;var _0xd18de5=_0xe55b[_0x3d2438];return _0xd18de5;};'use strict';var Sequelize=require(_0xbe55('0x0'));module[_0xbe55('0x1')]={'name':{'type':Sequelize[_0xbe55('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xbe55('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xbe55('0x4')](_0xbe55('0x5'),_0xbe55('0x6'),_0xbe55('0x7'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index c934138..bd96e1e 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 _0x66ee=['getTeams','Team','Agents','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','ids','field','tq.TeamId','from','team_has_chat_queues','join','ut.UserId\x20=\x20?','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','order','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatQueue.socket','register','jayson/promise','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','offset','undefined','limit','count','set','json','apply','reject','save','update','get','ChatQueues','UserProfileResource','destroy','end','sendStatus','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','rows','show','params','include','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','body','describe','getMembers','findOne','UserChatQueue','ChatQueueId','findAll','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','%s/%s','SIP'];(function(_0x2f9da1,_0x5edd19){var _0x2955db=function(_0x50b349){while(--_0x50b349){_0x2f9da1['push'](_0x2f9da1['shift']());}};_0x2955db(++_0x5edd19);}(_0x66ee,0xc2));var _0xe66e=function(_0x35116d,_0x30c8c7){_0x35116d=_0x35116d-0x0;var _0x16b2ab=_0x66ee[_0x35116d];return _0x16b2ab;};'use strict';var emlformat=require(_0xe66e('0x0'));var rimraf=require(_0xe66e('0x1'));var zipdir=require(_0xe66e('0x2'));var jsonpatch=require(_0xe66e('0x3'));var rp=require(_0xe66e('0x4'));var moment=require(_0xe66e('0x5'));var BPromise=require(_0xe66e('0x6'));var Mustache=require(_0xe66e('0x7'));var util=require(_0xe66e('0x8'));var path=require('path');var sox=require(_0xe66e('0x9'));var csv=require(_0xe66e('0xa'));var ejs=require(_0xe66e('0xb'));var fs=require('fs');var fs_extra=require(_0xe66e('0xc'));var _=require(_0xe66e('0xd'));var squel=require(_0xe66e('0xe'));var crypto=require(_0xe66e('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xe66e('0x10'));var toCsv=require(_0xe66e('0xa'));var querystring=require('querystring');var Papa=require(_0xe66e('0x11'));var Redis=require(_0xe66e('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xe66e('0x13'));var as=require(_0xe66e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe66e('0x15'))(_0xe66e('0x16'));var utils=require('../../config/utils');var config=require(_0xe66e('0x17'));var licenseUtil=require(_0xe66e('0x18'));var db=require(_0xe66e('0x19'))['db'];config[_0xe66e('0x1a')]=_[_0xe66e('0x1b')](config[_0xe66e('0x1a')],{'host':_0xe66e('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe66e('0x1d'))[_0xe66e('0x1e')](socket);var jayson=require(_0xe66e('0x1f'));var client=jayson[_0xe66e('0x20')][_0xe66e('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x4bc0e7,_0x44b6c7,_0x137628,_0x4673ce){return new BPromise(function(_0x31aa0a,_0x43905d){var _0x2cad5b=_0x4673ce||client;return _0x2cad5b[_0xe66e('0x22')](_0x4bc0e7,_0x137628)[_0xe66e('0x23')](function(_0x3b28ff){logger[_0xe66e('0x24')](_0xe66e('0x25'),_0x44b6c7,_0xe66e('0x26'));logger[_0xe66e('0x27')](_0xe66e('0x28'),_0x44b6c7,_0xe66e('0x26'),JSON[_0xe66e('0x29')](_0x3b28ff));if(_0x3b28ff[_0xe66e('0x2a')]){if(_0x3b28ff[_0xe66e('0x2a')]['code']===0x1f4){logger[_0xe66e('0x2a')](_0xe66e('0x25'),_0x44b6c7,_0x3b28ff[_0xe66e('0x2a')][_0xe66e('0x2b')]);return _0x43905d(_0x3b28ff['error'][_0xe66e('0x2b')]);}logger[_0xe66e('0x2a')](_0xe66e('0x25'),_0x44b6c7,_0x3b28ff['error'][_0xe66e('0x2b')]);return _0x31aa0a(_0x3b28ff[_0xe66e('0x2a')]['message']);}else{logger[_0xe66e('0x24')](_0xe66e('0x25'),_0x44b6c7,_0xe66e('0x26'));_0x31aa0a(_0x3b28ff[_0xe66e('0x2c')][_0xe66e('0x2b')]);}})[_0xe66e('0x2d')](function(_0x2fb8d5){logger[_0xe66e('0x2a')](_0xe66e('0x25'),_0x44b6c7,_0x2fb8d5);_0x43905d(_0x2fb8d5);});});}function respondWithStatusCode(_0xcf6a82,_0x4db0d4){_0x4db0d4=_0x4db0d4||0xcc;return function(_0x287050){if(_0x287050){return _0xcf6a82['sendStatus'](_0x4db0d4);}return _0xcf6a82['status'](_0x4db0d4)['end']();};}function respondWithResult(_0x11718e,_0x1221af){_0x1221af=_0x1221af||0xc8;return function(_0x3ccf77){if(_0x3ccf77){return _0x11718e[_0xe66e('0x2e')](_0x1221af)['json'](_0x3ccf77);}};}function respondWithFilteredResult(_0xafd651,_0x25eaa7){return function(_0x12a61f){if(_0x12a61f){var _0x3b9905=typeof _0x25eaa7[_0xe66e('0x2f')]===_0xe66e('0x30')&&typeof _0x25eaa7[_0xe66e('0x31')]===_0xe66e('0x30');var _0x515e72=_0x12a61f['count'];var _0x2efcce=_0x3b9905?0x0:_0x25eaa7['offset'];var _0x5d954d=_0x3b9905?_0x12a61f[_0xe66e('0x32')]:_0x25eaa7[_0xe66e('0x2f')]+_0x25eaa7[_0xe66e('0x31')];var _0x5246d5;if(_0x5d954d>=_0x515e72){_0x5d954d=_0x515e72;_0x5246d5=0xc8;}else{_0x5246d5=0xce;}_0xafd651[_0xe66e('0x2e')](_0x5246d5);return _0xafd651[_0xe66e('0x33')]('Content-Range',_0x2efcce+'-'+_0x5d954d+'/'+_0x515e72)[_0xe66e('0x34')](_0x12a61f);}return null;};}function patchUpdates(_0x40622b){return function(_0x2076d6){try{jsonpatch[_0xe66e('0x35')](_0x2076d6,_0x40622b,!![]);}catch(_0x47016c){return BPromise[_0xe66e('0x36')](_0x47016c);}return _0x2076d6[_0xe66e('0x37')]();};}function saveUpdates(_0xfdc22,_0x1f532e){return function(_0x4d65b8){if(_0x4d65b8){return _0x4d65b8[_0xe66e('0x38')](_0xfdc22)['then'](function(_0x3f81e1){return _0x3f81e1;});}return null;};}function removeEntity(_0x3acb7d,_0x173b84){return function(_0x3e0e14){if(_0x3e0e14){return _0x3e0e14['destroy']()['then'](function(){var _0x19265c=_0x3e0e14[_0xe66e('0x39')]({'plain':!![]});var _0x508199=_0xe66e('0x3a');return db[_0xe66e('0x3b')][_0xe66e('0x3c')]({'where':{'type':_0x508199,'resourceId':_0x19265c['id']}})[_0xe66e('0x23')](function(){return _0x3e0e14;});})[_0xe66e('0x23')](function(){_0x3acb7d[_0xe66e('0x2e')](0xcc)[_0xe66e('0x3d')]();});}};}function handleEntityNotFound(_0x3920a3,_0x429a94){return function(_0x400e33){if(!_0x400e33){_0x3920a3[_0xe66e('0x3e')](0x194);}return _0x400e33;};}function handleError(_0x819f14,_0xd33254){_0xd33254=_0xd33254||0x1f4;return function(_0x25eb2b){logger['error'](_0x25eb2b['stack']);if(_0x25eb2b[_0xe66e('0x3f')]){delete _0x25eb2b['name'];}_0x819f14['status'](_0xd33254)[_0xe66e('0x40')](_0x25eb2b);};}exports[_0xe66e('0x41')]=function(_0x25d993,_0x2df3a1){var _0x53529d={},_0x49432a={},_0x29263c={'count':0x0,'rows':[]};var _0xae65ff=_[_0xe66e('0x42')](db[_0xe66e('0x43')][_0xe66e('0x44')],function(_0x446df4){return{'name':_0x446df4[_0xe66e('0x45')],'type':_0x446df4[_0xe66e('0x46')][_0xe66e('0x47')]};});_0x49432a[_0xe66e('0x48')]=_[_0xe66e('0x42')](_0xae65ff,'name');_0x49432a[_0xe66e('0x49')]=_[_0xe66e('0x4a')](_0x25d993[_0xe66e('0x49')]);_0x49432a[_0xe66e('0x4b')]=_[_0xe66e('0x4c')](_0x49432a[_0xe66e('0x48')],_0x49432a[_0xe66e('0x49')]);_0x53529d[_0xe66e('0x4d')]=_[_0xe66e('0x4c')](_0x49432a[_0xe66e('0x48')],qs[_0xe66e('0x4e')](_0x25d993[_0xe66e('0x49')][_0xe66e('0x4e')]));_0x53529d[_0xe66e('0x4d')]=_0x53529d['attributes'][_0xe66e('0x4f')]?_0x53529d[_0xe66e('0x4d')]:_0x49432a[_0xe66e('0x48')];if(!_0x25d993[_0xe66e('0x49')][_0xe66e('0x50')](_0xe66e('0x51'))){_0x53529d[_0xe66e('0x31')]=qs[_0xe66e('0x31')](_0x25d993[_0xe66e('0x49')]['limit']);_0x53529d[_0xe66e('0x2f')]=qs['offset'](_0x25d993['query'][_0xe66e('0x2f')]);}_0x53529d['order']=qs[_0xe66e('0x52')](_0x25d993[_0xe66e('0x49')][_0xe66e('0x52')]);_0x53529d[_0xe66e('0x53')]=qs[_0xe66e('0x4b')](_[_0xe66e('0x54')](_0x25d993[_0xe66e('0x49')],_0x49432a[_0xe66e('0x4b')]),_0xae65ff);if(_0x25d993[_0xe66e('0x49')][_0xe66e('0x55')]){_0x53529d[_0xe66e('0x53')]=_[_0xe66e('0x56')](_0x53529d[_0xe66e('0x53')],{'$or':_[_0xe66e('0x42')](_0xae65ff,function(_0x3b6488){if(_0x3b6488[_0xe66e('0x46')]!==_0xe66e('0x57')){var _0x4a36eb={};_0x4a36eb[_0x3b6488[_0xe66e('0x3f')]]={'$like':'%'+_0x25d993[_0xe66e('0x49')][_0xe66e('0x55')]+'%'};return _0x4a36eb;}})});}_0x53529d=_[_0xe66e('0x56')]({},_0x53529d,_0x25d993['options']);var _0x3e5b45={'where':_0x53529d[_0xe66e('0x53')]};return db[_0xe66e('0x43')][_0xe66e('0x32')](_0x3e5b45)['then'](function(_0x35ca11){_0x29263c[_0xe66e('0x32')]=_0x35ca11;if(_0x25d993[_0xe66e('0x49')][_0xe66e('0x58')]){_0x53529d['include']=[{'all':!![]}];}return db[_0xe66e('0x43')]['findAll'](_0x53529d);})[_0xe66e('0x23')](function(_0x7bfdcd){_0x29263c[_0xe66e('0x59')]=_0x7bfdcd;return _0x29263c;})[_0xe66e('0x23')](respondWithFilteredResult(_0x2df3a1,_0x53529d))[_0xe66e('0x2d')](handleError(_0x2df3a1,null));};exports[_0xe66e('0x5a')]=function(_0xd87b8c,_0x200fba){var _0x2d2b75={'raw':!![],'where':{'id':_0xd87b8c[_0xe66e('0x5b')]['id']}},_0x58705c={};_0x58705c['model']=_['keys'](db[_0xe66e('0x43')][_0xe66e('0x44')]);_0x58705c[_0xe66e('0x49')]=_[_0xe66e('0x4a')](_0xd87b8c['query']);_0x58705c['filters']=_['intersection'](_0x58705c['model'],_0x58705c[_0xe66e('0x49')]);_0x2d2b75[_0xe66e('0x4d')]=_[_0xe66e('0x4c')](_0x58705c[_0xe66e('0x48')],qs[_0xe66e('0x4e')](_0xd87b8c['query'][_0xe66e('0x4e')]));_0x2d2b75[_0xe66e('0x4d')]=_0x2d2b75[_0xe66e('0x4d')]['length']?_0x2d2b75[_0xe66e('0x4d')]:_0x58705c[_0xe66e('0x48')];if(_0xd87b8c[_0xe66e('0x49')][_0xe66e('0x58')]){_0x2d2b75[_0xe66e('0x5c')]=[{'all':!![]}];}_0x2d2b75=_['merge']({},_0x2d2b75,_0xd87b8c[_0xe66e('0x5d')]);return db[_0xe66e('0x43')][_0xe66e('0x5e')](_0x2d2b75)[_0xe66e('0x23')](handleEntityNotFound(_0x200fba,null))[_0xe66e('0x23')](respondWithResult(_0x200fba,null))[_0xe66e('0x2d')](handleError(_0x200fba,null));};exports[_0xe66e('0x5f')]=function(_0x2f8bf4,_0x31b7fd){return db[_0xe66e('0x43')][_0xe66e('0x5f')](_0x2f8bf4['body'],{})[_0xe66e('0x23')](function(_0x570da7){var _0x1e665a=_0x2f8bf4[_0xe66e('0x60')][_0xe66e('0x39')]({'plain':!![]});if(!_0x1e665a)throw new Error(_0xe66e('0x61'));if(_0x1e665a['role']===_0xe66e('0x60')){var _0x125ad5=_0x570da7[_0xe66e('0x39')]({'plain':!![]});var _0x423f96=_0xe66e('0x3a');return db[_0xe66e('0x62')]['find']({'where':{'name':_0x423f96,'userProfileId':_0x1e665a['userProfileId']},'raw':!![]})[_0xe66e('0x23')](function(_0x561540){if(_0x561540&&_0x561540[_0xe66e('0x63')]===0x0){return db[_0xe66e('0x3b')][_0xe66e('0x5f')]({'name':_0x125ad5[_0xe66e('0x3f')],'resourceId':_0x125ad5['id'],'type':_0x561540[_0xe66e('0x3f')],'sectionId':_0x561540['id']},{})[_0xe66e('0x23')](function(){return _0x570da7;});}else{return _0x570da7;}})[_0xe66e('0x2d')](function(_0x3ef12f){logger[_0xe66e('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3ef12f);throw _0x3ef12f;});}return _0x570da7;})[_0xe66e('0x23')](respondWithResult(_0x31b7fd,0xc9))[_0xe66e('0x2d')](handleError(_0x31b7fd,null));};exports[_0xe66e('0x38')]=function(_0xecb837,_0x22d956){if(_0xecb837['body']['id']){delete _0xecb837[_0xe66e('0x64')]['id'];}return db[_0xe66e('0x43')][_0xe66e('0x5e')]({'where':{'id':_0xecb837[_0xe66e('0x5b')]['id']}})[_0xe66e('0x23')](handleEntityNotFound(_0x22d956,null))['then'](saveUpdates(_0xecb837[_0xe66e('0x64')],null))['then'](respondWithResult(_0x22d956,null))[_0xe66e('0x2d')](handleError(_0x22d956,null));};exports[_0xe66e('0x3c')]=function(_0x2ebe42,_0x52f319){return db[_0xe66e('0x43')]['find']({'where':{'id':_0x2ebe42[_0xe66e('0x5b')]['id']}})['then'](handleEntityNotFound(_0x52f319,null))[_0xe66e('0x23')](removeEntity(_0x52f319,null))[_0xe66e('0x2d')](handleError(_0x52f319,null));};exports[_0xe66e('0x65')]=function(_0x152ae5,_0x11ec7b){return db[_0xe66e('0x43')]['describe']()[_0xe66e('0x23')](respondWithResult(_0x11ec7b,null))[_0xe66e('0x2d')](handleError(_0x11ec7b,null));};exports[_0xe66e('0x66')]=function(_0x2f7770,_0x5b2864,_0x3980b1){var _0x50f053={'raw':!![],'where':{}},_0x3c0423={},_0x31ef96;return db[_0xe66e('0x43')][_0xe66e('0x67')]({'where':{'id':_0x2f7770['params']['id']}})['then'](handleEntityNotFound(_0x5b2864,null))[_0xe66e('0x23')](function(_0x5cf711){if(_0x5cf711){_0x31ef96=_0x5cf711['get']({'plain':!![]});_0x3c0423['model']=_['keys'](db[_0xe66e('0x68')]['rawAttributes']);_0x3c0423[_0xe66e('0x49')]=_[_0xe66e('0x4a')](_0x2f7770[_0xe66e('0x49')]);_0x3c0423['filters']=_['intersection'](_0x3c0423[_0xe66e('0x48')],_0x3c0423['query']);_0x50f053[_0xe66e('0x4d')]=_[_0xe66e('0x4c')](_0x3c0423[_0xe66e('0x48')],qs[_0xe66e('0x4e')](_0x2f7770[_0xe66e('0x49')]['fields']));_0x50f053[_0xe66e('0x4d')]=_0x50f053[_0xe66e('0x4d')][_0xe66e('0x4f')]?_0x50f053[_0xe66e('0x4d')]:_0x3c0423['model'];if(!_0x2f7770[_0xe66e('0x49')][_0xe66e('0x50')](_0xe66e('0x51'))){_0x50f053[_0xe66e('0x31')]=qs['limit'](_0x2f7770['query'][_0xe66e('0x31')]);_0x50f053[_0xe66e('0x2f')]=qs[_0xe66e('0x2f')](_0x2f7770[_0xe66e('0x49')]['offset']);}_0x50f053['order']=qs[_0xe66e('0x52')](_0x2f7770['query']['sort']);_0x50f053[_0xe66e('0x53')]=qs[_0xe66e('0x4b')](_[_0xe66e('0x54')](_0x2f7770[_0xe66e('0x49')],_0x3c0423[_0xe66e('0x4b')]));_0x50f053['where'][_0xe66e('0x69')]=_0x5cf711['id'];if(_0x2f7770[_0xe66e('0x49')][_0xe66e('0x55')]){_0x50f053[_0xe66e('0x53')]=_[_0xe66e('0x56')](_0x50f053['where'],{'$or':_['map'](_0x50f053[_0xe66e('0x4d')],function(_0x5ea8db){var _0x59aec9={};_0x59aec9[_0x5ea8db]={'$like':'%'+_0x2f7770[_0xe66e('0x49')][_0xe66e('0x55')]+'%'};return _0x59aec9;})});}_0x50f053=_['merge']({},_0x50f053,_0x2f7770['options']);return db['UserChatQueue'][_0xe66e('0x6a')](_0x50f053);}})[_0xe66e('0x23')](function(_0x56fd8f){if(_0x56fd8f){return db[_0xe66e('0x6b')][_0xe66e('0x6c')]({'where':{'id':_[_0xe66e('0x42')](_0x56fd8f,_0xe66e('0x6d')),'role':_0xe66e('0x6e')},'attributes':['id','name',_0xe66e('0x6f'),_0xe66e('0x70'),_0xe66e('0x71')]});}})[_0xe66e('0x23')](function(_0x440f26){if(_0x440f26){return{'count':_0x440f26[_0xe66e('0x32')],'rows':_[_0xe66e('0x42')](_0x440f26[_0xe66e('0x59')],function(_0x2f05df){return{'membername':_0x2f05df['name'],'UserId':_0x2f05df['id'],'queue_name':_0x31ef96[_0xe66e('0x3f')],'ChatQueueId':_0x31ef96['id'],'interface':util['format'](_0xe66e('0x72'),_0xe66e('0x73'),_0x2f05df[_0xe66e('0x3f')]),'penalty':0x0,'paused':_0x2f05df[_0xe66e('0x6f')],'createdAt':_0x2f05df[_0xe66e('0x71')],'updatedAt':_0x2f05df['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xe66e('0x23')](respondWithFilteredResult(_0x5b2864,_0x50f053))[_0xe66e('0x2d')](handleError(_0x5b2864,null));};exports[_0xe66e('0x74')]=function(_0x4d3934,_0x4c0f7,_0x1a8e4c){var _0x499475={};var _0x9f7a39={};var _0x4e95e4;var _0x5e4052;return db[_0xe66e('0x43')][_0xe66e('0x67')]({'where':{'id':_0x4d3934[_0xe66e('0x5b')]['id']}})[_0xe66e('0x23')](handleEntityNotFound(_0x4c0f7,null))[_0xe66e('0x23')](function(_0x365376){if(_0x365376){_0x4e95e4=_0x365376;_0x9f7a39[_0xe66e('0x48')]=_['keys'](db['Team']['rawAttributes']);_0x9f7a39[_0xe66e('0x49')]=_[_0xe66e('0x4a')](_0x4d3934[_0xe66e('0x49')]);_0x9f7a39['filters']=_[_0xe66e('0x4c')](_0x9f7a39['model'],_0x9f7a39['query']);_0x499475[_0xe66e('0x4d')]=_[_0xe66e('0x4c')](_0x9f7a39[_0xe66e('0x48')],qs['fields'](_0x4d3934[_0xe66e('0x49')]['fields']));_0x499475[_0xe66e('0x4d')]=_0x499475[_0xe66e('0x4d')][_0xe66e('0x4f')]?_0x499475[_0xe66e('0x4d')]:_0x9f7a39[_0xe66e('0x48')];_0x499475['order']=qs[_0xe66e('0x52')](_0x4d3934[_0xe66e('0x49')][_0xe66e('0x52')]);_0x499475[_0xe66e('0x53')]=qs[_0xe66e('0x4b')](_[_0xe66e('0x54')](_0x4d3934[_0xe66e('0x49')],_0x9f7a39[_0xe66e('0x4b')]));if(_0x4d3934[_0xe66e('0x49')][_0xe66e('0x55')]){_0x499475[_0xe66e('0x53')]=_[_0xe66e('0x56')](_0x499475[_0xe66e('0x53')],{'$or':_[_0xe66e('0x42')](_0x499475['attributes'],function(_0x50deab){var _0x35cc26={};_0x35cc26[_0x50deab]={'$like':'%'+_0x4d3934[_0xe66e('0x49')]['filter']+'%'};return _0x35cc26;})});}_0x499475=_[_0xe66e('0x56')]({},_0x499475,_0x4d3934[_0xe66e('0x5d')]);return _0x4e95e4['getTeams'](_0x499475);}})[_0xe66e('0x23')](function(_0x2df2bc){if(_0x2df2bc){_0x5e4052=_0x2df2bc[_0xe66e('0x4f')];if(!_0x4d3934['query'][_0xe66e('0x50')](_0xe66e('0x51'))){_0x499475[_0xe66e('0x31')]=qs[_0xe66e('0x31')](_0x4d3934[_0xe66e('0x49')]['limit']);_0x499475[_0xe66e('0x2f')]=qs[_0xe66e('0x2f')](_0x4d3934['query']['offset']);}return _0x4e95e4[_0xe66e('0x74')](_0x499475);}})['then'](function(_0x52a051){if(_0x52a051){return _0x52a051?{'count':_0x5e4052,'rows':_0x52a051}:null;}})[_0xe66e('0x23')](respondWithResult(_0x4c0f7,null))[_0xe66e('0x2d')](handleError(_0x4c0f7,null));};exports['addTeams']=function(_0x5e43c8,_0x22c01e,_0x45e12d){var _0x426db9=_0x5e43c8[_0xe66e('0x64')]['ids'];return db[_0xe66e('0x75')][_0xe66e('0x6a')]({'where':{'id':_0x426db9},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe66e('0x76'),'attributes':['id',_0xe66e('0x3f'),'online',_0xe66e('0x77'),_0xe66e('0x78')],'raw':!![]}]})['then'](function(_0x233dd3){if(_0x233dd3){var _0x252703=_[_0xe66e('0x79')](_0x233dd3,function(_0xbf5f55){var _0x41f29a=_0xbf5f55[_0xe66e('0x39')]({'plain':!![]});return _0x41f29a['Agents'];});return db[_0xe66e('0x43')][_0xe66e('0x5e')]({'where':{'id':_0x5e43c8[_0xe66e('0x5b')]['id']}})[_0xe66e('0x23')](function(_0x49a055){return db[_0xe66e('0x7a')][_0xe66e('0x7b')](function(_0x2b67db){return _0x49a055[_0xe66e('0x7c')](_0x426db9,{'transaction':_0x2b67db})[_0xe66e('0x23')](function(){return BPromise[_0xe66e('0x7d')](_0x252703,function(_0x408507){return db['UserChatQueue'][_0xe66e('0x7e')]({'where':{'UserId':_0x408507['id'],'ChatQueueId':_0x5e43c8[_0xe66e('0x5b')]['id']},'transaction':_0x2b67db});});})[_0xe66e('0x23')](function(){_0x252703[_0xe66e('0x7f')](function(_0x59ad21){socket[_0xe66e('0x80')](_0xe66e('0x81'),{'UserId':_0x59ad21['id'],'ChatQueueId':_0x49a055['id']});});});});});}})[_0xe66e('0x23')](respondWithStatusCode(_0x22c01e,null))['catch'](handleError(_0x22c01e,null));};exports[_0xe66e('0x82')]=function(_0x507d38,_0x20ba61,_0x533f74){return db[_0xe66e('0x75')][_0xe66e('0x6a')]({'where':{'id':_0x507d38[_0xe66e('0x49')][_0xe66e('0x83')]},'attributes':['id'],'include':[{'model':db[_0xe66e('0x6b')],'as':_0xe66e('0x76'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x20ba61,null))['then'](function(_0x3889ae){var _0x5f212d=_[_0xe66e('0x42')](_0x3889ae,'id');var _0x401db4=[];var _0x3218b5=[];var _0x51ba42=squel['select']();_0x51ba42[_0xe66e('0x84')](_0xe66e('0x85'))[_0xe66e('0x86')](_0xe66e('0x87'),'tq')[_0xe66e('0x88')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xe66e('0x53')]('ChatQueueId\x20=\x20?',_0x507d38[_0xe66e('0x5b')]['id']);for(var _0x554772=0x0;_0x554772<_0x3889ae['length'];_0x554772+=0x1){let _0x2576c7=_0x3889ae[_0x554772];for(var _0x40779f=0x0;_0x40779f<_0x2576c7[_0xe66e('0x76')][_0xe66e('0x4f')];_0x40779f+=0x1){let _0x54f80c=_0x2576c7['Agents'][_0x40779f];var _0x1e9ffd=_0x51ba42['clone']();_0x1e9ffd['where'](_0xe66e('0x89'),_0x54f80c['id']);_0x3218b5['push'](db[_0xe66e('0x7a')][_0xe66e('0x49')](_0x1e9ffd['toString'](),{'type':db[_0xe66e('0x7a')][_0xe66e('0x8a')][_0xe66e('0x8b')]})[_0xe66e('0x23')](function(_0x24396e){if(_0x24396e[_0xe66e('0x4f')]===0x1){return _0x54f80c['id'];}else{var _0x56b568=_[_0xe66e('0x8c')](_[_0xe66e('0x42')](_0x24396e,_0xe66e('0x8d')),function(_0x42526a){return _[_0xe66e('0x8e')](_0x5f212d,_0x42526a);});if(_0x56b568){return _0x54f80c['id'];}}}));}}return BPromise[_0xe66e('0x8f')](_0x3218b5)['then'](function(_0x5cc3a6){_0x401db4=_(_0x401db4)['union'](_0x5cc3a6)[_0xe66e('0x90')]()[_0xe66e('0x91')]();return db['ChatQueue'][_0xe66e('0x5e')]({'where':{'id':_0x507d38['params']['id']}})[_0xe66e('0x23')](function(_0x4f7ac0){return db[_0xe66e('0x7a')]['transaction'](function(_0xb4ee5d){return _0x4f7ac0[_0xe66e('0x82')](_0x507d38['query'][_0xe66e('0x83')],{'transaction':_0xb4ee5d})[_0xe66e('0x23')](function(){if(!_[_0xe66e('0x92')](_0x401db4)){return _0x4f7ac0[_0xe66e('0x93')](_0x401db4,{'transaction':_0xb4ee5d});}})[_0xe66e('0x23')](function(){_0x401db4[_0xe66e('0x7f')](function(_0x47df19){socket['emit'](_0xe66e('0x94'),{'UserId':_0x47df19,'ChatQueueId':_0x4f7ac0['id']});});});});});});})[_0xe66e('0x23')](respondWithStatusCode(_0x20ba61,null))[_0xe66e('0x2d')](handleError(_0x20ba61,null));};exports[_0xe66e('0x95')]=function(_0x28bb7f,_0xc8c939,_0x201ba9){return db[_0xe66e('0x43')][_0xe66e('0x5e')]({'where':{'id':_0x28bb7f[_0xe66e('0x5b')]['id']}})[_0xe66e('0x23')](handleEntityNotFound(_0xc8c939,null))[_0xe66e('0x23')](function(_0x29edbc){if(_0x29edbc){return _0x29edbc[_0xe66e('0x95')](_0x28bb7f[_0xe66e('0x64')]['ids'],_[_0xe66e('0x96')](_0x28bb7f[_0xe66e('0x64')],[_0xe66e('0x83'),'id'])||{})[_0xe66e('0x97')](function(_0x24d5ba){for(var _0x2e393b=0x0;_0x2e393b<_0x28bb7f[_0xe66e('0x64')][_0xe66e('0x83')][_0xe66e('0x4f')];_0x2e393b+=0x1){socket[_0xe66e('0x80')]('userChatQueue:save',{'UserId':Number(_0x28bb7f['body'][_0xe66e('0x83')][_0x2e393b]),'ChatQueueId':Number(_0x28bb7f[_0xe66e('0x5b')]['id'])});}return _0x24d5ba;});}})['then'](respondWithResult(_0xc8c939,null))[_0xe66e('0x2d')](handleError(_0xc8c939,null));};exports[_0xe66e('0x93')]=function(_0x4b04ef,_0xe28823,_0x19e7cf){return db[_0xe66e('0x43')][_0xe66e('0x5e')]({'where':{'id':_0x4b04ef[_0xe66e('0x5b')]['id']}})[_0xe66e('0x23')](handleEntityNotFound(_0xe28823,null))[_0xe66e('0x23')](function(_0x156f4a){if(_0x156f4a){return _0x156f4a['removeAgents'](_0x4b04ef[_0xe66e('0x49')][_0xe66e('0x83')])['then'](function(){if(_[_0xe66e('0x98')](_0x4b04ef['query'][_0xe66e('0x83')])){for(var _0x757d9b=0x0;_0x757d9b<_0x4b04ef[_0xe66e('0x49')][_0xe66e('0x83')]['length'];_0x757d9b+=0x1){socket['emit'](_0xe66e('0x94'),{'UserId':Number(_0x4b04ef[_0xe66e('0x49')][_0xe66e('0x83')][_0x757d9b]),'ChatQueueId':Number(_0x4b04ef[_0xe66e('0x5b')]['id'])});}}else{socket[_0xe66e('0x80')](_0xe66e('0x94'),{'UserId':Number(_0x4b04ef['query']['ids']),'ChatQueueId':Number(_0x4b04ef[_0xe66e('0x5b')]['id'])});}});}})[_0xe66e('0x23')](respondWithStatusCode(_0xe28823,null))[_0xe66e('0x2d')](handleError(_0xe28823,null));};exports[_0xe66e('0x99')]=function(_0x4d710a,_0xf4399b,_0x346b29){var _0x53a4e2={};var _0x439650={};var _0x18af32;var _0x554911;return db['ChatQueue'][_0xe66e('0x67')]({'where':{'id':_0x4d710a[_0xe66e('0x5b')]['id']}})[_0xe66e('0x23')](handleEntityNotFound(_0xf4399b,null))[_0xe66e('0x23')](function(_0x27216f){if(_0x27216f){_0x18af32=_0x27216f;_0x439650['model']=_['keys'](db['User']['rawAttributes']);_0x439650[_0xe66e('0x49')]=_[_0xe66e('0x4a')](_0x4d710a[_0xe66e('0x49')]);_0x439650[_0xe66e('0x4b')]=_[_0xe66e('0x4c')](_0x439650['model'],_0x439650[_0xe66e('0x49')]);_0x53a4e2[_0xe66e('0x4d')]=_[_0xe66e('0x4c')](_0x439650[_0xe66e('0x48')],qs[_0xe66e('0x4e')](_0x4d710a[_0xe66e('0x49')]['fields']));_0x53a4e2[_0xe66e('0x4d')]=_0x53a4e2['attributes'][_0xe66e('0x4f')]?_0x53a4e2[_0xe66e('0x4d')]:_0x439650[_0xe66e('0x48')];_0x53a4e2[_0xe66e('0x9a')]=qs[_0xe66e('0x52')](_0x4d710a[_0xe66e('0x49')][_0xe66e('0x52')]);_0x53a4e2[_0xe66e('0x53')]=qs['filters'](_[_0xe66e('0x54')](_0x4d710a[_0xe66e('0x49')],_0x439650[_0xe66e('0x4b')]));if(_0x4d710a[_0xe66e('0x49')]['filter']){_0x53a4e2[_0xe66e('0x53')]=_[_0xe66e('0x56')](_0x53a4e2[_0xe66e('0x53')],{'$or':_[_0xe66e('0x42')](_0x53a4e2[_0xe66e('0x4d')],function(_0x30ae9b){var _0x212902={};_0x212902[_0x30ae9b]={'$like':'%'+_0x4d710a[_0xe66e('0x49')][_0xe66e('0x55')]+'%'};return _0x212902;})});}_0x53a4e2=_[_0xe66e('0x56')]({},_0x53a4e2,_0x4d710a[_0xe66e('0x5d')]);return _0x18af32[_0xe66e('0x99')](_0x53a4e2);}})[_0xe66e('0x23')](function(_0x5d661e){if(_0x5d661e){_0x554911=_0x5d661e[_0xe66e('0x4f')];if(!_0x4d710a[_0xe66e('0x49')][_0xe66e('0x50')](_0xe66e('0x51'))){_0x53a4e2['limit']=qs[_0xe66e('0x31')](_0x4d710a['query'][_0xe66e('0x31')]);_0x53a4e2['offset']=qs[_0xe66e('0x2f')](_0x4d710a[_0xe66e('0x49')][_0xe66e('0x2f')]);}return _0x18af32[_0xe66e('0x99')](_0x53a4e2);}})[_0xe66e('0x23')](function(_0x43d78f){if(_0x43d78f){return _0x43d78f?{'count':_0x554911,'rows':_0x43d78f}:null;}})[_0xe66e('0x23')](respondWithResult(_0xf4399b,null))[_0xe66e('0x2d')](handleError(_0xf4399b,null));};
\ No newline at end of file
+var _0x4228=['chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','emit','userChatQueue:save','removeTeams','findAll','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','SELECT','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','forEach','isArray','userChatQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','update','get','ChatQueues','UserProfileResource','stack','name','send','index','ChatQueue','rawAttributes','key','model','map','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','rows','catch','show','includeAll','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','body','destroy','params','describe','getMembers','UserChatQueue','hasOwnProperty','nolimit','ChatQueueId','User','findAndCountAll'];(function(_0x2f6259,_0x2113f4){var _0x6a75c1=function(_0x582336){while(--_0x582336){_0x2f6259['push'](_0x2f6259['shift']());}};_0x6a75c1(++_0x2113f4);}(_0x4228,0xc8));var _0x8422=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4228[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x8422('0x0'));var rimraf=require(_0x8422('0x1'));var zipdir=require(_0x8422('0x2'));var jsonpatch=require(_0x8422('0x3'));var rp=require('request-promise');var moment=require(_0x8422('0x4'));var BPromise=require(_0x8422('0x5'));var Mustache=require(_0x8422('0x6'));var util=require(_0x8422('0x7'));var path=require(_0x8422('0x8'));var sox=require(_0x8422('0x9'));var csv=require(_0x8422('0xa'));var ejs=require(_0x8422('0xb'));var fs=require('fs');var fs_extra=require(_0x8422('0xc'));var _=require(_0x8422('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8422('0xe'));var deskjs=require(_0x8422('0xf'));var toCsv=require(_0x8422('0xa'));var querystring=require(_0x8422('0x10'));var Papa=require(_0x8422('0x11'));var Redis=require(_0x8422('0x12'));var authService=require(_0x8422('0x13'));var qs=require(_0x8422('0x14'));var as=require(_0x8422('0x15'));var hardwareService=require(_0x8422('0x16'));var logger=require(_0x8422('0x17'))('api');var utils=require(_0x8422('0x18'));var config=require(_0x8422('0x19'));var licenseUtil=require(_0x8422('0x1a'));var db=require(_0x8422('0x1b'))['db'];config[_0x8422('0x1c')]=_[_0x8422('0x1d')](config[_0x8422('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x8422('0x1e'))(new Redis(config[_0x8422('0x1c')]));require(_0x8422('0x1f'))[_0x8422('0x20')](socket);var jayson=require(_0x8422('0x21'));var client=jayson[_0x8422('0x22')][_0x8422('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x58c4ac,_0x17e161,_0x3c1d35,_0x1909e7){return new BPromise(function(_0x2cb8a4,_0xb29d4f){var _0x334b2e=_0x1909e7||client;return _0x334b2e[_0x8422('0x24')](_0x58c4ac,_0x3c1d35)[_0x8422('0x25')](function(_0x1911fd){logger[_0x8422('0x26')](_0x8422('0x27'),_0x17e161,'request\x20sent');logger['debug'](_0x8422('0x28'),_0x17e161,'request\x20sent',JSON[_0x8422('0x29')](_0x1911fd));if(_0x1911fd['error']){if(_0x1911fd[_0x8422('0x2a')][_0x8422('0x2b')]===0x1f4){logger[_0x8422('0x2a')](_0x8422('0x27'),_0x17e161,_0x1911fd[_0x8422('0x2a')][_0x8422('0x2c')]);return _0xb29d4f(_0x1911fd['error'][_0x8422('0x2c')]);}logger[_0x8422('0x2a')](_0x8422('0x27'),_0x17e161,_0x1911fd[_0x8422('0x2a')][_0x8422('0x2c')]);return _0x2cb8a4(_0x1911fd[_0x8422('0x2a')]['message']);}else{logger['info'](_0x8422('0x27'),_0x17e161,_0x8422('0x2d'));_0x2cb8a4(_0x1911fd[_0x8422('0x2e')][_0x8422('0x2c')]);}})['catch'](function(_0x43d82f){logger['error'](_0x8422('0x27'),_0x17e161,_0x43d82f);_0xb29d4f(_0x43d82f);});});}function respondWithStatusCode(_0x2bb2d2,_0x5b9aa9){_0x5b9aa9=_0x5b9aa9||0xcc;return function(_0x593425){if(_0x593425){return _0x2bb2d2[_0x8422('0x2f')](_0x5b9aa9);}return _0x2bb2d2[_0x8422('0x30')](_0x5b9aa9)[_0x8422('0x31')]();};}function respondWithResult(_0x437110,_0x4fe47c){_0x4fe47c=_0x4fe47c||0xc8;return function(_0x226691){if(_0x226691){return _0x437110['status'](_0x4fe47c)[_0x8422('0x32')](_0x226691);}};}function respondWithFilteredResult(_0x1ae89b,_0x3a2637){return function(_0x5de5dd){if(_0x5de5dd){var _0x481bb1=typeof _0x3a2637[_0x8422('0x33')]===_0x8422('0x34')&&typeof _0x3a2637['limit']===_0x8422('0x34');var _0x1954eb=_0x5de5dd[_0x8422('0x35')];var _0x2b8975=_0x481bb1?0x0:_0x3a2637[_0x8422('0x33')];var _0x1dbe84=_0x481bb1?_0x5de5dd['count']:_0x3a2637[_0x8422('0x33')]+_0x3a2637[_0x8422('0x36')];var _0x356675;if(_0x1dbe84>=_0x1954eb){_0x1dbe84=_0x1954eb;_0x356675=0xc8;}else{_0x356675=0xce;}_0x1ae89b[_0x8422('0x30')](_0x356675);return _0x1ae89b['set'](_0x8422('0x37'),_0x2b8975+'-'+_0x1dbe84+'/'+_0x1954eb)[_0x8422('0x32')](_0x5de5dd);}return null;};}function patchUpdates(_0x47c804){return function(_0xdff644){try{jsonpatch[_0x8422('0x38')](_0xdff644,_0x47c804,!![]);}catch(_0x3eeceb){return BPromise['reject'](_0x3eeceb);}return _0xdff644['save']();};}function saveUpdates(_0x2d212e,_0x3e18b2){return function(_0x133e42){if(_0x133e42){return _0x133e42[_0x8422('0x39')](_0x2d212e)[_0x8422('0x25')](function(_0x1e1041){return _0x1e1041;});}return null;};}function removeEntity(_0x4db904,_0x5364b4){return function(_0x23fe37){if(_0x23fe37){return _0x23fe37['destroy']()[_0x8422('0x25')](function(){var _0x41009a=_0x23fe37[_0x8422('0x3a')]({'plain':!![]});var _0x1020c4=_0x8422('0x3b');return db[_0x8422('0x3c')]['destroy']({'where':{'type':_0x1020c4,'resourceId':_0x41009a['id']}})[_0x8422('0x25')](function(){return _0x23fe37;});})['then'](function(){_0x4db904[_0x8422('0x30')](0xcc)[_0x8422('0x31')]();});}};}function handleEntityNotFound(_0x369b5f,_0x52dc15){return function(_0xe2af4e){if(!_0xe2af4e){_0x369b5f[_0x8422('0x2f')](0x194);}return _0xe2af4e;};}function handleError(_0x57fca2,_0x4f1979){_0x4f1979=_0x4f1979||0x1f4;return function(_0x4e10a3){logger[_0x8422('0x2a')](_0x4e10a3[_0x8422('0x3d')]);if(_0x4e10a3[_0x8422('0x3e')]){delete _0x4e10a3[_0x8422('0x3e')];}_0x57fca2[_0x8422('0x30')](_0x4f1979)[_0x8422('0x3f')](_0x4e10a3);};}exports[_0x8422('0x40')]=function(_0x39d1f6,_0x303cab){var _0x51e51f={},_0x5663f7={},_0xd4f31d={'count':0x0,'rows':[]};var _0x38125d=_['map'](db[_0x8422('0x41')][_0x8422('0x42')],function(_0xa757d9){return{'name':_0xa757d9['fieldName'],'type':_0xa757d9['type'][_0x8422('0x43')]};});_0x5663f7[_0x8422('0x44')]=_[_0x8422('0x45')](_0x38125d,_0x8422('0x3e'));_0x5663f7[_0x8422('0x46')]=_[_0x8422('0x47')](_0x39d1f6[_0x8422('0x46')]);_0x5663f7[_0x8422('0x48')]=_[_0x8422('0x49')](_0x5663f7[_0x8422('0x44')],_0x5663f7[_0x8422('0x46')]);_0x51e51f[_0x8422('0x4a')]=_['intersection'](_0x5663f7[_0x8422('0x44')],qs[_0x8422('0x4b')](_0x39d1f6[_0x8422('0x46')][_0x8422('0x4b')]));_0x51e51f['attributes']=_0x51e51f[_0x8422('0x4a')][_0x8422('0x4c')]?_0x51e51f[_0x8422('0x4a')]:_0x5663f7[_0x8422('0x44')];if(!_0x39d1f6[_0x8422('0x46')]['hasOwnProperty']('nolimit')){_0x51e51f[_0x8422('0x36')]=qs['limit'](_0x39d1f6[_0x8422('0x46')][_0x8422('0x36')]);_0x51e51f[_0x8422('0x33')]=qs[_0x8422('0x33')](_0x39d1f6[_0x8422('0x46')][_0x8422('0x33')]);}_0x51e51f[_0x8422('0x4d')]=qs[_0x8422('0x4e')](_0x39d1f6[_0x8422('0x46')][_0x8422('0x4e')]);_0x51e51f[_0x8422('0x4f')]=qs[_0x8422('0x48')](_[_0x8422('0x50')](_0x39d1f6[_0x8422('0x46')],_0x5663f7[_0x8422('0x48')]),_0x38125d);if(_0x39d1f6['query'][_0x8422('0x51')]){_0x51e51f[_0x8422('0x4f')]=_[_0x8422('0x52')](_0x51e51f['where'],{'$or':_[_0x8422('0x45')](_0x38125d,function(_0x522b48){if(_0x522b48[_0x8422('0x53')]!==_0x8422('0x54')){var _0x1fa0be={};_0x1fa0be[_0x522b48[_0x8422('0x3e')]]={'$like':'%'+_0x39d1f6['query']['filter']+'%'};return _0x1fa0be;}})});}_0x51e51f=_[_0x8422('0x52')]({},_0x51e51f,_0x39d1f6[_0x8422('0x55')]);var _0x395dbb={'where':_0x51e51f[_0x8422('0x4f')]};return db['ChatQueue'][_0x8422('0x35')](_0x395dbb)[_0x8422('0x25')](function(_0x591c22){_0xd4f31d[_0x8422('0x35')]=_0x591c22;if(_0x39d1f6[_0x8422('0x46')]['includeAll']){_0x51e51f[_0x8422('0x56')]=[{'all':!![]}];}return db['ChatQueue']['findAll'](_0x51e51f);})['then'](function(_0x55b1ff){_0xd4f31d[_0x8422('0x57')]=_0x55b1ff;return _0xd4f31d;})[_0x8422('0x25')](respondWithFilteredResult(_0x303cab,_0x51e51f))[_0x8422('0x58')](handleError(_0x303cab,null));};exports[_0x8422('0x59')]=function(_0xcfb863,_0x13f4a0){var _0xe79e2d={'raw':!![],'where':{'id':_0xcfb863['params']['id']}},_0x28f09e={};_0x28f09e[_0x8422('0x44')]=_[_0x8422('0x47')](db[_0x8422('0x41')][_0x8422('0x42')]);_0x28f09e[_0x8422('0x46')]=_[_0x8422('0x47')](_0xcfb863[_0x8422('0x46')]);_0x28f09e['filters']=_[_0x8422('0x49')](_0x28f09e['model'],_0x28f09e[_0x8422('0x46')]);_0xe79e2d[_0x8422('0x4a')]=_[_0x8422('0x49')](_0x28f09e[_0x8422('0x44')],qs[_0x8422('0x4b')](_0xcfb863['query'][_0x8422('0x4b')]));_0xe79e2d[_0x8422('0x4a')]=_0xe79e2d[_0x8422('0x4a')][_0x8422('0x4c')]?_0xe79e2d['attributes']:_0x28f09e['model'];if(_0xcfb863[_0x8422('0x46')][_0x8422('0x5a')]){_0xe79e2d[_0x8422('0x56')]=[{'all':!![]}];}_0xe79e2d=_[_0x8422('0x52')]({},_0xe79e2d,_0xcfb863[_0x8422('0x55')]);return db['ChatQueue'][_0x8422('0x5b')](_0xe79e2d)[_0x8422('0x25')](handleEntityNotFound(_0x13f4a0,null))[_0x8422('0x25')](respondWithResult(_0x13f4a0,null))['catch'](handleError(_0x13f4a0,null));};exports[_0x8422('0x5c')]=function(_0x4e5f0d,_0x2d1583){return db[_0x8422('0x41')][_0x8422('0x5c')](_0x4e5f0d['body'],{})[_0x8422('0x25')](function(_0xd53c2b){var _0x4b82ef=_0x4e5f0d['user']['get']({'plain':!![]});if(!_0x4b82ef)throw new Error(_0x8422('0x5d'));if(_0x4b82ef[_0x8422('0x5e')]===_0x8422('0x5f')){var _0x301f59=_0xd53c2b[_0x8422('0x3a')]({'plain':!![]});var _0x223bcf='ChatQueues';return db[_0x8422('0x60')][_0x8422('0x5b')]({'where':{'name':_0x223bcf,'userProfileId':_0x4b82ef[_0x8422('0x61')]},'raw':!![]})[_0x8422('0x25')](function(_0x55330e){if(_0x55330e&&_0x55330e[_0x8422('0x62')]===0x0){return db[_0x8422('0x3c')][_0x8422('0x5c')]({'name':_0x301f59['name'],'resourceId':_0x301f59['id'],'type':_0x55330e[_0x8422('0x3e')],'sectionId':_0x55330e['id']},{})['then'](function(){return _0xd53c2b;});}else{return _0xd53c2b;}})[_0x8422('0x58')](function(_0x59ea6b){logger[_0x8422('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x59ea6b);throw _0x59ea6b;});}return _0xd53c2b;})[_0x8422('0x25')](respondWithResult(_0x2d1583,0xc9))[_0x8422('0x58')](handleError(_0x2d1583,null));};exports['update']=function(_0x2f5201,_0x2bce3c){if(_0x2f5201[_0x8422('0x63')]['id']){delete _0x2f5201[_0x8422('0x63')]['id'];}return db[_0x8422('0x41')]['find']({'where':{'id':_0x2f5201['params']['id']}})[_0x8422('0x25')](handleEntityNotFound(_0x2bce3c,null))['then'](saveUpdates(_0x2f5201[_0x8422('0x63')],null))[_0x8422('0x25')](respondWithResult(_0x2bce3c,null))[_0x8422('0x58')](handleError(_0x2bce3c,null));};exports[_0x8422('0x64')]=function(_0x26cc92,_0x1dbd3a){return db[_0x8422('0x41')][_0x8422('0x5b')]({'where':{'id':_0x26cc92[_0x8422('0x65')]['id']}})[_0x8422('0x25')](handleEntityNotFound(_0x1dbd3a,null))['then'](removeEntity(_0x1dbd3a,null))[_0x8422('0x58')](handleError(_0x1dbd3a,null));};exports[_0x8422('0x66')]=function(_0x50d814,_0x7c8f12){return db['ChatQueue'][_0x8422('0x66')]()['then'](respondWithResult(_0x7c8f12,null))[_0x8422('0x58')](handleError(_0x7c8f12,null));};exports[_0x8422('0x67')]=function(_0x67c0d5,_0x25b31f,_0x128861){var _0xe83d3a={'raw':!![],'where':{}},_0x561e9a={},_0x33aaad;return db[_0x8422('0x41')]['findOne']({'where':{'id':_0x67c0d5[_0x8422('0x65')]['id']}})[_0x8422('0x25')](handleEntityNotFound(_0x25b31f,null))['then'](function(_0x55f878){if(_0x55f878){_0x33aaad=_0x55f878[_0x8422('0x3a')]({'plain':!![]});_0x561e9a[_0x8422('0x44')]=_['keys'](db[_0x8422('0x68')][_0x8422('0x42')]);_0x561e9a[_0x8422('0x46')]=_[_0x8422('0x47')](_0x67c0d5['query']);_0x561e9a['filters']=_[_0x8422('0x49')](_0x561e9a[_0x8422('0x44')],_0x561e9a[_0x8422('0x46')]);_0xe83d3a['attributes']=_[_0x8422('0x49')](_0x561e9a[_0x8422('0x44')],qs[_0x8422('0x4b')](_0x67c0d5[_0x8422('0x46')][_0x8422('0x4b')]));_0xe83d3a[_0x8422('0x4a')]=_0xe83d3a[_0x8422('0x4a')][_0x8422('0x4c')]?_0xe83d3a[_0x8422('0x4a')]:_0x561e9a['model'];if(!_0x67c0d5['query'][_0x8422('0x69')](_0x8422('0x6a'))){_0xe83d3a['limit']=qs[_0x8422('0x36')](_0x67c0d5['query'][_0x8422('0x36')]);_0xe83d3a[_0x8422('0x33')]=qs['offset'](_0x67c0d5[_0x8422('0x46')][_0x8422('0x33')]);}_0xe83d3a[_0x8422('0x4d')]=qs['sort'](_0x67c0d5[_0x8422('0x46')]['sort']);_0xe83d3a[_0x8422('0x4f')]=qs[_0x8422('0x48')](_[_0x8422('0x50')](_0x67c0d5['query'],_0x561e9a[_0x8422('0x48')]));_0xe83d3a[_0x8422('0x4f')][_0x8422('0x6b')]=_0x55f878['id'];if(_0x67c0d5[_0x8422('0x46')][_0x8422('0x51')]){_0xe83d3a['where']=_['merge'](_0xe83d3a['where'],{'$or':_[_0x8422('0x45')](_0xe83d3a[_0x8422('0x4a')],function(_0x23fa70){var _0x3fe84b={};_0x3fe84b[_0x23fa70]={'$like':'%'+_0x67c0d5[_0x8422('0x46')][_0x8422('0x51')]+'%'};return _0x3fe84b;})});}_0xe83d3a=_[_0x8422('0x52')]({},_0xe83d3a,_0x67c0d5[_0x8422('0x55')]);return db[_0x8422('0x68')]['findAll'](_0xe83d3a);}})[_0x8422('0x25')](function(_0x3d1917){if(_0x3d1917){return db[_0x8422('0x6c')][_0x8422('0x6d')]({'where':{'id':_[_0x8422('0x45')](_0x3d1917,'UserId'),'role':'agent'},'attributes':['id','name',_0x8422('0x6e'),_0x8422('0x6f'),_0x8422('0x70')]});}})[_0x8422('0x25')](function(_0x46179f){if(_0x46179f){return{'count':_0x46179f[_0x8422('0x35')],'rows':_[_0x8422('0x45')](_0x46179f[_0x8422('0x57')],function(_0x4c47b5){return{'membername':_0x4c47b5[_0x8422('0x3e')],'UserId':_0x4c47b5['id'],'queue_name':_0x33aaad['name'],'ChatQueueId':_0x33aaad['id'],'interface':util[_0x8422('0x71')](_0x8422('0x72'),_0x8422('0x73'),_0x4c47b5[_0x8422('0x3e')]),'penalty':0x0,'paused':_0x4c47b5['chatPause'],'createdAt':_0x4c47b5['createdAt'],'updatedAt':_0x4c47b5[_0x8422('0x6f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8422('0x25')](respondWithFilteredResult(_0x25b31f,_0xe83d3a))[_0x8422('0x58')](handleError(_0x25b31f,null));};exports[_0x8422('0x74')]=function(_0xa44b5,_0x93ae56,_0x4b4853){var _0x36ce5e={};var _0x38da5f={};var _0x2edc5e;var _0xade523;return db[_0x8422('0x41')][_0x8422('0x75')]({'where':{'id':_0xa44b5['params']['id']}})['then'](handleEntityNotFound(_0x93ae56,null))[_0x8422('0x25')](function(_0x4a92ce){if(_0x4a92ce){_0x2edc5e=_0x4a92ce;_0x38da5f[_0x8422('0x44')]=_[_0x8422('0x47')](db[_0x8422('0x76')][_0x8422('0x42')]);_0x38da5f[_0x8422('0x46')]=_[_0x8422('0x47')](_0xa44b5['query']);_0x38da5f[_0x8422('0x48')]=_[_0x8422('0x49')](_0x38da5f['model'],_0x38da5f[_0x8422('0x46')]);_0x36ce5e[_0x8422('0x4a')]=_['intersection'](_0x38da5f[_0x8422('0x44')],qs[_0x8422('0x4b')](_0xa44b5[_0x8422('0x46')][_0x8422('0x4b')]));_0x36ce5e['attributes']=_0x36ce5e[_0x8422('0x4a')][_0x8422('0x4c')]?_0x36ce5e[_0x8422('0x4a')]:_0x38da5f[_0x8422('0x44')];_0x36ce5e[_0x8422('0x4d')]=qs[_0x8422('0x4e')](_0xa44b5['query'][_0x8422('0x4e')]);_0x36ce5e[_0x8422('0x4f')]=qs[_0x8422('0x48')](_[_0x8422('0x50')](_0xa44b5[_0x8422('0x46')],_0x38da5f[_0x8422('0x48')]));if(_0xa44b5[_0x8422('0x46')]['filter']){_0x36ce5e[_0x8422('0x4f')]=_[_0x8422('0x52')](_0x36ce5e[_0x8422('0x4f')],{'$or':_[_0x8422('0x45')](_0x36ce5e[_0x8422('0x4a')],function(_0x229d6f){var _0x5923be={};_0x5923be[_0x229d6f]={'$like':'%'+_0xa44b5[_0x8422('0x46')]['filter']+'%'};return _0x5923be;})});}_0x36ce5e=_[_0x8422('0x52')]({},_0x36ce5e,_0xa44b5[_0x8422('0x55')]);return _0x2edc5e[_0x8422('0x74')](_0x36ce5e);}})[_0x8422('0x25')](function(_0x1600a5){if(_0x1600a5){_0xade523=_0x1600a5['length'];if(!_0xa44b5[_0x8422('0x46')][_0x8422('0x69')]('nolimit')){_0x36ce5e[_0x8422('0x36')]=qs[_0x8422('0x36')](_0xa44b5[_0x8422('0x46')]['limit']);_0x36ce5e[_0x8422('0x33')]=qs[_0x8422('0x33')](_0xa44b5[_0x8422('0x46')][_0x8422('0x33')]);}return _0x2edc5e[_0x8422('0x74')](_0x36ce5e);}})['then'](function(_0x3df109){if(_0x3df109){return _0x3df109?{'count':_0xade523,'rows':_0x3df109}:null;}})[_0x8422('0x25')](respondWithResult(_0x93ae56,null))['catch'](handleError(_0x93ae56,null));};exports[_0x8422('0x77')]=function(_0x4812ae,_0xd0910e,_0x50ad66){var _0x18fd68=_0x4812ae[_0x8422('0x63')][_0x8422('0x78')];return db['Team']['findAll']({'where':{'id':_0x18fd68},'attributes':['id'],'include':[{'model':db[_0x8422('0x6c')],'as':_0x8422('0x79'),'attributes':['id','name',_0x8422('0x7a'),_0x8422('0x7b'),_0x8422('0x7c')],'raw':!![]}]})['then'](function(_0x13f11a){if(_0x13f11a){var _0xe3c514=_[_0x8422('0x7d')](_0x13f11a,function(_0x226388){var _0x207f99=_0x226388['get']({'plain':!![]});return _0x207f99[_0x8422('0x79')];});return db[_0x8422('0x41')]['find']({'where':{'id':_0x4812ae[_0x8422('0x65')]['id']}})[_0x8422('0x25')](function(_0x5a7981){return db[_0x8422('0x7e')][_0x8422('0x7f')](function(_0x14fa9a){return _0x5a7981[_0x8422('0x77')](_0x18fd68,{'transaction':_0x14fa9a})[_0x8422('0x25')](function(){return BPromise[_0x8422('0x80')](_0xe3c514,function(_0x59cc28){return db[_0x8422('0x68')][_0x8422('0x81')]({'where':{'UserId':_0x59cc28['id'],'ChatQueueId':_0x4812ae[_0x8422('0x65')]['id']},'transaction':_0x14fa9a});});})[_0x8422('0x25')](function(){_0xe3c514['forEach'](function(_0x3fc1dd){socket[_0x8422('0x82')](_0x8422('0x83'),{'UserId':_0x3fc1dd['id'],'ChatQueueId':_0x5a7981['id']});});});});});}})[_0x8422('0x25')](respondWithStatusCode(_0xd0910e,null))[_0x8422('0x58')](handleError(_0xd0910e,null));};exports[_0x8422('0x84')]=function(_0x14e113,_0x4c41b8,_0x136897){return db[_0x8422('0x76')][_0x8422('0x85')]({'where':{'id':_0x14e113['query'][_0x8422('0x78')]},'attributes':['id'],'include':[{'model':db[_0x8422('0x6c')],'as':_0x8422('0x79'),'attributes':['id'],'raw':!![]}]})[_0x8422('0x25')](handleEntityNotFound(_0x4c41b8,null))[_0x8422('0x25')](function(_0x2c08c4){var _0x4fd9ab=_[_0x8422('0x45')](_0x2c08c4,'id');var _0x11e55d=[];var _0x50b2be=[];var _0xcfe54a=squel['select']();_0xcfe54a[_0x8422('0x86')](_0x8422('0x87'))[_0x8422('0x88')](_0x8422('0x89'),'tq')[_0x8422('0x8a')](_0x8422('0x8b'),'ut',_0x8422('0x8c'))[_0x8422('0x4f')]('ChatQueueId\x20=\x20?',_0x14e113[_0x8422('0x65')]['id']);for(var _0x54fe5e=0x0;_0x54fe5e<_0x2c08c4['length'];_0x54fe5e+=0x1){let _0x5c7e45=_0x2c08c4[_0x54fe5e];for(var _0x11a76c=0x0;_0x11a76c<_0x5c7e45[_0x8422('0x79')][_0x8422('0x4c')];_0x11a76c+=0x1){let _0x5c9bae=_0x5c7e45[_0x8422('0x79')][_0x11a76c];var _0x1d4522=_0xcfe54a[_0x8422('0x8d')]();_0x1d4522[_0x8422('0x4f')]('ut.UserId\x20=\x20?',_0x5c9bae['id']);_0x50b2be['push'](db[_0x8422('0x7e')][_0x8422('0x46')](_0x1d4522['toString'](),{'type':db['sequelize']['QueryTypes'][_0x8422('0x8e')]})[_0x8422('0x25')](function(_0xae568b){if(_0xae568b[_0x8422('0x4c')]===0x1){return _0x5c9bae['id'];}else{var _0x4b62df=_[_0x8422('0x8f')](_['map'](_0xae568b,_0x8422('0x90')),function(_0x2ea0b0){return _[_0x8422('0x91')](_0x4fd9ab,_0x2ea0b0);});if(_0x4b62df){return _0x5c9bae['id'];}}}));}}return BPromise[_0x8422('0x92')](_0x50b2be)['then'](function(_0x3d3c40){_0x11e55d=_(_0x11e55d)['union'](_0x3d3c40)[_0x8422('0x93')]()[_0x8422('0x94')]();return db['ChatQueue']['find']({'where':{'id':_0x14e113[_0x8422('0x65')]['id']}})[_0x8422('0x25')](function(_0x305619){return db[_0x8422('0x7e')]['transaction'](function(_0x161209){return _0x305619[_0x8422('0x84')](_0x14e113['query'][_0x8422('0x78')],{'transaction':_0x161209})[_0x8422('0x25')](function(){if(!_[_0x8422('0x95')](_0x11e55d)){return _0x305619[_0x8422('0x96')](_0x11e55d,{'transaction':_0x161209});}})['then'](function(){_0x11e55d[_0x8422('0x97')](function(_0x568a87){socket[_0x8422('0x82')]('userChatQueue:remove',{'UserId':_0x568a87,'ChatQueueId':_0x305619['id']});});});});});});})[_0x8422('0x25')](respondWithStatusCode(_0x4c41b8,null))['catch'](handleError(_0x4c41b8,null));};exports['addAgents']=function(_0x55ae60,_0x32b2b5,_0x9dccd8){return db['ChatQueue'][_0x8422('0x5b')]({'where':{'id':_0x55ae60['params']['id']}})[_0x8422('0x25')](handleEntityNotFound(_0x32b2b5,null))['then'](function(_0x104129){if(_0x104129){return _0x104129['addAgents'](_0x55ae60['body']['ids'],_['omit'](_0x55ae60[_0x8422('0x63')],[_0x8422('0x78'),'id'])||{})['spread'](function(_0x23f351){for(var _0x418dfc=0x0;_0x418dfc<_0x55ae60[_0x8422('0x63')][_0x8422('0x78')]['length'];_0x418dfc+=0x1){socket[_0x8422('0x82')]('userChatQueue:save',{'UserId':Number(_0x55ae60[_0x8422('0x63')][_0x8422('0x78')][_0x418dfc]),'ChatQueueId':Number(_0x55ae60[_0x8422('0x65')]['id'])});}return _0x23f351;});}})[_0x8422('0x25')](respondWithResult(_0x32b2b5,null))[_0x8422('0x58')](handleError(_0x32b2b5,null));};exports[_0x8422('0x96')]=function(_0x5e3b1f,_0x4f0f60,_0x440696){return db['ChatQueue'][_0x8422('0x5b')]({'where':{'id':_0x5e3b1f['params']['id']}})['then'](handleEntityNotFound(_0x4f0f60,null))['then'](function(_0xfde3ab){if(_0xfde3ab){return _0xfde3ab[_0x8422('0x96')](_0x5e3b1f['query']['ids'])[_0x8422('0x25')](function(){if(_[_0x8422('0x98')](_0x5e3b1f[_0x8422('0x46')][_0x8422('0x78')])){for(var _0x47c77d=0x0;_0x47c77d<_0x5e3b1f['query']['ids'][_0x8422('0x4c')];_0x47c77d+=0x1){socket['emit'](_0x8422('0x99'),{'UserId':Number(_0x5e3b1f['query'][_0x8422('0x78')][_0x47c77d]),'ChatQueueId':Number(_0x5e3b1f[_0x8422('0x65')]['id'])});}}else{socket[_0x8422('0x82')]('userChatQueue:remove',{'UserId':Number(_0x5e3b1f[_0x8422('0x46')]['ids']),'ChatQueueId':Number(_0x5e3b1f[_0x8422('0x65')]['id'])});}});}})['then'](respondWithStatusCode(_0x4f0f60,null))[_0x8422('0x58')](handleError(_0x4f0f60,null));};exports[_0x8422('0x9a')]=function(_0x436491,_0x13fd89,_0x30e678){var _0x356e80={};var _0x215ba4={};var _0x3c4ab9;var _0x3ce79f;return db[_0x8422('0x41')]['findOne']({'where':{'id':_0x436491[_0x8422('0x65')]['id']}})[_0x8422('0x25')](handleEntityNotFound(_0x13fd89,null))[_0x8422('0x25')](function(_0x1bdc16){if(_0x1bdc16){_0x3c4ab9=_0x1bdc16;_0x215ba4[_0x8422('0x44')]=_[_0x8422('0x47')](db[_0x8422('0x6c')][_0x8422('0x42')]);_0x215ba4['query']=_['keys'](_0x436491[_0x8422('0x46')]);_0x215ba4[_0x8422('0x48')]=_['intersection'](_0x215ba4[_0x8422('0x44')],_0x215ba4[_0x8422('0x46')]);_0x356e80[_0x8422('0x4a')]=_['intersection'](_0x215ba4[_0x8422('0x44')],qs[_0x8422('0x4b')](_0x436491['query']['fields']));_0x356e80[_0x8422('0x4a')]=_0x356e80['attributes']['length']?_0x356e80['attributes']:_0x215ba4[_0x8422('0x44')];_0x356e80[_0x8422('0x4d')]=qs['sort'](_0x436491[_0x8422('0x46')]['sort']);_0x356e80[_0x8422('0x4f')]=qs[_0x8422('0x48')](_[_0x8422('0x50')](_0x436491[_0x8422('0x46')],_0x215ba4[_0x8422('0x48')]));if(_0x436491[_0x8422('0x46')]['filter']){_0x356e80[_0x8422('0x4f')]=_[_0x8422('0x52')](_0x356e80[_0x8422('0x4f')],{'$or':_['map'](_0x356e80[_0x8422('0x4a')],function(_0x55ff7b){var _0x2d3f18={};_0x2d3f18[_0x55ff7b]={'$like':'%'+_0x436491[_0x8422('0x46')][_0x8422('0x51')]+'%'};return _0x2d3f18;})});}_0x356e80=_[_0x8422('0x52')]({},_0x356e80,_0x436491[_0x8422('0x55')]);return _0x3c4ab9[_0x8422('0x9a')](_0x356e80);}})['then'](function(_0x25487d){if(_0x25487d){_0x3ce79f=_0x25487d[_0x8422('0x4c')];if(!_0x436491[_0x8422('0x46')][_0x8422('0x69')]('nolimit')){_0x356e80[_0x8422('0x36')]=qs[_0x8422('0x36')](_0x436491['query'][_0x8422('0x36')]);_0x356e80[_0x8422('0x33')]=qs[_0x8422('0x33')](_0x436491[_0x8422('0x46')][_0x8422('0x33')]);}return _0x3c4ab9['getAgents'](_0x356e80);}})[_0x8422('0x25')](function(_0x5730f1){if(_0x5730f1){return _0x5730f1?{'count':_0x3ce79f,'rows':_0x5730f1}:null;}})[_0x8422('0x25')](respondWithResult(_0x13fd89,null))['catch'](handleError(_0x13fd89,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 121f352..4c0e64c 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 _0xf26a=['events','../../mysqldb','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x26bb37,_0x169d5a){var _0x26e7ab=function(_0x4daf30){while(--_0x4daf30){_0x26bb37['push'](_0x26bb37['shift']());}};_0x26e7ab(++_0x169d5a);}(_0xf26a,0x158));var _0xaf26=function(_0x3ac2ca,_0x101b94){_0x3ac2ca=_0x3ac2ca-0x0;var _0x4667aa=_0xf26a[_0x3ac2ca];return _0x4667aa;};'use strict';var EventEmitter=require(_0xaf26('0x0'));var ChatQueue=require(_0xaf26('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xaf26('0x2'),'afterUpdate':'update','afterDestroy':_0xaf26('0x3')};function emitEvent(_0x1b935b){return function(_0x3471b2,_0x5d3bc,_0x1cb812){ChatQueueEvents[_0xaf26('0x4')](_0x1b935b+':'+_0x3471b2['id'],_0x3471b2);ChatQueueEvents[_0xaf26('0x4')](_0x1b935b,_0x3471b2);_0x1cb812(null);};}for(var e in events){if(events[_0xaf26('0x5')](e)){var event=events[e];ChatQueue[_0xaf26('0x6')](e,emitEvent(event));}}module[_0xaf26('0x7')]=ChatQueueEvents;
\ No newline at end of file
+var _0xfa58=['ChatQueue','save','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x172eb5,_0x2a5111){var _0x1ea8b2=function(_0x272943){while(--_0x272943){_0x172eb5['push'](_0x172eb5['shift']());}};_0x1ea8b2(++_0x2a5111);}(_0xfa58,0x157));var _0x8fa5=function(_0x572637,_0x216d95){_0x572637=_0x572637-0x0;var _0xb6748=_0xfa58[_0x572637];return _0xb6748;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x8fa5('0x0'))['db'][_0x8fa5('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8fa5('0x2'),'afterUpdate':'update','afterDestroy':_0x8fa5('0x3')};function emitEvent(_0x1a31d7){return function(_0xfaf04d,_0x16d98e,_0x5ac0d1){ChatQueueEvents[_0x8fa5('0x4')](_0x1a31d7+':'+_0xfaf04d['id'],_0xfaf04d);ChatQueueEvents[_0x8fa5('0x4')](_0x1a31d7,_0xfaf04d);_0x5ac0d1(null);};}for(var e in events){if(events[_0x8fa5('0x5')](e)){var event=events[e];ChatQueue[_0x8fa5('0x6')](e,emitEvent(event));}}module[_0x8fa5('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 34d23c5..1d7845d 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 _0xd224=['lodash','util','api','moment','bluebird','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues'];(function(_0x5e8a62,_0x248c5b){var _0x251625=function(_0x4c1bb8){while(--_0x4c1bb8){_0x5e8a62['push'](_0x5e8a62['shift']());}};_0x251625(++_0x248c5b);}(_0xd224,0x12c));var _0x4d22=function(_0x363a32,_0x48e24f){_0x363a32=_0x363a32-0x0;var _0x3786b2=_0xd224[_0x363a32];return _0x3786b2;};'use strict';var _=require(_0x4d22('0x0'));var util=require(_0x4d22('0x1'));var logger=require('../../config/logger')(_0x4d22('0x2'));var moment=require(_0x4d22('0x3'));var BPromise=require(_0x4d22('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4d22('0x5'));var config=require(_0x4d22('0x6'));var attributes=require(_0x4d22('0x7'));module[_0x4d22('0x8')]=function(_0x4f6a06,_0xafb374){return _0x4f6a06[_0x4d22('0x9')](_0x4d22('0xa'),attributes,{'tableName':_0x4d22('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0673=['lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','define','ChatQueue'];(function(_0x1b1448,_0x4189e1){var _0x3d32f2=function(_0x7928d){while(--_0x7928d){_0x1b1448['push'](_0x1b1448['shift']());}};_0x3d32f2(++_0x4189e1);}(_0x0673,0xa5));var _0x3067=function(_0x3782be,_0x4464bb){_0x3782be=_0x3782be-0x0;var _0x3dffa0=_0x0673[_0x3782be];return _0x3dffa0;};'use strict';var _=require(_0x3067('0x0'));var util=require(_0x3067('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3067('0x2'));var BPromise=require(_0x3067('0x3'));var rp=require(_0x3067('0x4'));var fs=require('fs');var path=require(_0x3067('0x5'));var rimraf=require(_0x3067('0x6'));var config=require(_0x3067('0x7'));var attributes=require(_0x3067('0x8'));module['exports']=function(_0x4fac90,_0x21eec1){return _0x4fac90[_0x3067('0x9')](_0x3067('0xa'),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 5b18502..4df03e2 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 _0x4ad3=['then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','options','where','attributes','include','model','map','ShowChatQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./chatQueue.socket','register','request'];(function(_0x74892f,_0x1e981b){var _0x10ee61=function(_0x3c480a){while(--_0x3c480a){_0x74892f['push'](_0x74892f['shift']());}};_0x10ee61(++_0x1e981b);}(_0x4ad3,0x1b1));var _0x34ad=function(_0x3f9ec3,_0x3dfd37){_0x3f9ec3=_0x3f9ec3-0x0;var _0xe85b13=_0x4ad3[_0x3f9ec3];return _0xe85b13;};'use strict';var _=require(_0x34ad('0x0'));var util=require(_0x34ad('0x1'));var moment=require(_0x34ad('0x2'));var BPromise=require(_0x34ad('0x3'));var rs=require(_0x34ad('0x4'));var fs=require('fs');var Redis=require(_0x34ad('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x34ad('0x6'));var logger=require(_0x34ad('0x7'))(_0x34ad('0x8'));var config=require(_0x34ad('0x9'));var jayson=require(_0x34ad('0xa'));var client=jayson[_0x34ad('0xb')][_0x34ad('0xc')]({'port':0x232a});config[_0x34ad('0xd')]=_[_0x34ad('0xe')](config[_0x34ad('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x34ad('0xd')]));require(_0x34ad('0xf'))[_0x34ad('0x10')](socket);function respondWithRpcPromise(_0x1e1d8c,_0x56a16c,_0x43e756){return new BPromise(function(_0x126fe0,_0x3ba937){return client[_0x34ad('0x11')](_0x1e1d8c,_0x43e756)[_0x34ad('0x12')](function(_0x2c1d64){logger[_0x34ad('0x13')](_0x34ad('0x14'),_0x56a16c,_0x34ad('0x15'));logger[_0x34ad('0x16')](_0x34ad('0x17'),_0x56a16c,_0x34ad('0x15'),JSON[_0x34ad('0x18')](_0x2c1d64));if(_0x2c1d64[_0x34ad('0x19')]){if(_0x2c1d64[_0x34ad('0x19')][_0x34ad('0x1a')]===0x1f4){logger['error'](_0x34ad('0x14'),_0x56a16c,_0x2c1d64[_0x34ad('0x19')][_0x34ad('0x1b')]);return _0x3ba937(_0x2c1d64['error'][_0x34ad('0x1b')]);}logger[_0x34ad('0x19')](_0x34ad('0x14'),_0x56a16c,_0x2c1d64[_0x34ad('0x19')][_0x34ad('0x1b')]);return _0x126fe0(_0x2c1d64['error'][_0x34ad('0x1b')]);}else{logger['info'](_0x34ad('0x14'),_0x56a16c,_0x34ad('0x15'));_0x126fe0(_0x2c1d64[_0x34ad('0x1c')][_0x34ad('0x1b')]);}})[_0x34ad('0x1d')](function(_0x4b7f3e){logger[_0x34ad('0x19')](_0x34ad('0x14'),_0x56a16c,_0x4b7f3e);_0x3ba937(_0x4b7f3e);});});}exports[_0x34ad('0x1e')]=function(_0x15bf30){var _0x36b82f=this;return new Promise(function(_0xffdd2e,_0x3c178a){return db[_0x34ad('0x1f')][_0x34ad('0x20')]({'raw':_0x15bf30['options']?_0x15bf30[_0x34ad('0x21')]['raw']===undefined?!![]:![]:!![],'where':_0x15bf30[_0x34ad('0x21')]?_0x15bf30['options'][_0x34ad('0x22')]||null:null,'attributes':_0x15bf30[_0x34ad('0x21')]?_0x15bf30[_0x34ad('0x21')][_0x34ad('0x23')]||null:null,'limit':_0x15bf30[_0x34ad('0x21')]?_0x15bf30[_0x34ad('0x21')]['limit']||null:null,'include':_0x15bf30[_0x34ad('0x21')]?_0x15bf30['options'][_0x34ad('0x24')]?_['map'](_0x15bf30['options'][_0x34ad('0x24')],function(_0x3df4ca){return{'model':db[_0x3df4ca[_0x34ad('0x25')]],'as':_0x3df4ca['as'],'attributes':_0x3df4ca[_0x34ad('0x23')],'include':_0x3df4ca[_0x34ad('0x24')]?_[_0x34ad('0x26')](_0x3df4ca[_0x34ad('0x24')],function(_0x3b7ac5){return{'model':db[_0x3b7ac5[_0x34ad('0x25')]],'as':_0x3b7ac5['as'],'attributes':_0x3b7ac5[_0x34ad('0x23')],'include':_0x3b7ac5['include']?_[_0x34ad('0x26')](_0x3b7ac5[_0x34ad('0x24')],function(_0x23bb04){return{'model':db[_0x23bb04[_0x34ad('0x25')]],'as':_0x23bb04['as'],'attributes':_0x23bb04[_0x34ad('0x23')]};}):[]};}):[]};}):[]:[]})[_0x34ad('0x12')](function(_0x2daf92){logger[_0x34ad('0x13')](_0x34ad('0x1e'),_0x15bf30);logger[_0x34ad('0x16')](_0x34ad('0x1e'),_0x15bf30,JSON[_0x34ad('0x18')](_0x2daf92));_0xffdd2e(_0x2daf92);})[_0x34ad('0x1d')](function(_0xf0f8b7){logger[_0x34ad('0x19')](_0x34ad('0x1e'),_0xf0f8b7['message'],_0x15bf30);_0x3c178a(_0x36b82f[_0x34ad('0x19')](0x1f4,_0xf0f8b7['message']));});});};exports[_0x34ad('0x27')]=function(_0xedd677){var _0x41c1da=this;return new Promise(function(_0x3750a8,_0x5f2c31){return db[_0x34ad('0x1f')][_0x34ad('0x28')]({'raw':_0xedd677[_0x34ad('0x21')]?_0xedd677[_0x34ad('0x21')]['raw']===undefined?!![]:![]:!![],'where':_0xedd677['options']?_0xedd677['options'][_0x34ad('0x22')]||null:null,'attributes':_0xedd677[_0x34ad('0x21')]?_0xedd677[_0x34ad('0x21')][_0x34ad('0x23')]||null:null,'include':_0xedd677[_0x34ad('0x21')]?_0xedd677['options'][_0x34ad('0x24')]?_[_0x34ad('0x26')](_0xedd677[_0x34ad('0x21')][_0x34ad('0x24')],function(_0x1b79b3){return{'model':db[_0x1b79b3[_0x34ad('0x25')]],'as':_0x1b79b3['as'],'attributes':_0x1b79b3[_0x34ad('0x23')],'include':_0x1b79b3[_0x34ad('0x24')]?_[_0x34ad('0x26')](_0x1b79b3[_0x34ad('0x24')],function(_0x437930){return{'model':db[_0x437930[_0x34ad('0x25')]],'as':_0x437930['as'],'attributes':_0x437930[_0x34ad('0x23')],'include':_0x437930[_0x34ad('0x24')]?_[_0x34ad('0x26')](_0x437930[_0x34ad('0x24')],function(_0x41a5a2){return{'model':db[_0x41a5a2[_0x34ad('0x25')]],'as':_0x41a5a2['as'],'attributes':_0x41a5a2[_0x34ad('0x23')]};}):[]};}):[]};}):[]:[]})[_0x34ad('0x12')](function(_0x47d6d4){logger['info'](_0x34ad('0x27'),_0xedd677);logger[_0x34ad('0x16')](_0x34ad('0x27'),_0xedd677,JSON[_0x34ad('0x18')](_0x47d6d4));_0x3750a8(_0x47d6d4);})[_0x34ad('0x1d')](function(_0x157c8b){logger[_0x34ad('0x19')](_0x34ad('0x27'),_0x157c8b[_0x34ad('0x1b')],_0xedd677);_0x5f2c31(_0x41c1da[_0x34ad('0x19')](0x1f4,_0x157c8b['message']));});});};
\ No newline at end of file
+var _0xed03=['ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetChatQueue','ChatQueue','findAll','options','where','limit','include','map','attributes','model','info','stringify','ShowChatQueue','find','raw','lodash','util','bluebird','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x52f568,_0xdc7ca0){var _0x909310=function(_0x20d9ac){while(--_0x20d9ac){_0x52f568['push'](_0x52f568['shift']());}};_0x909310(++_0xdc7ca0);}(_0xed03,0xdc));var _0x3ed0=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0xed03[_0x6cf19c];return _0xce14f3;};'use strict';var _=require(_0x3ed0('0x0'));var util=require(_0x3ed0('0x1'));var moment=require('moment');var BPromise=require(_0x3ed0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3ed0('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3ed0('0x4'))('rpc');var config=require(_0x3ed0('0x5'));var jayson=require(_0x3ed0('0x6'));var client=jayson[_0x3ed0('0x7')][_0x3ed0('0x8')]({'port':0x232a});config[_0x3ed0('0x9')]=_[_0x3ed0('0xa')](config[_0x3ed0('0x9')],{'host':_0x3ed0('0xb'),'port':0x18eb});var socket=require(_0x3ed0('0xc'))(new Redis(config[_0x3ed0('0x9')]));require(_0x3ed0('0xd'))[_0x3ed0('0xe')](socket);function respondWithRpcPromise(_0x14c005,_0x1aa928,_0x5b6150){return new BPromise(function(_0x2febdc,_0x4af4de){return client[_0x3ed0('0xf')](_0x14c005,_0x5b6150)[_0x3ed0('0x10')](function(_0x774658){logger['info'](_0x3ed0('0x11'),_0x1aa928,_0x3ed0('0x12'));logger[_0x3ed0('0x13')](_0x3ed0('0x14'),_0x1aa928,_0x3ed0('0x12'),JSON['stringify'](_0x774658));if(_0x774658[_0x3ed0('0x15')]){if(_0x774658[_0x3ed0('0x15')][_0x3ed0('0x16')]===0x1f4){logger[_0x3ed0('0x15')](_0x3ed0('0x11'),_0x1aa928,_0x774658['error'][_0x3ed0('0x17')]);return _0x4af4de(_0x774658[_0x3ed0('0x15')]['message']);}logger[_0x3ed0('0x15')](_0x3ed0('0x11'),_0x1aa928,_0x774658[_0x3ed0('0x15')][_0x3ed0('0x17')]);return _0x2febdc(_0x774658[_0x3ed0('0x15')][_0x3ed0('0x17')]);}else{logger['info'](_0x3ed0('0x11'),_0x1aa928,_0x3ed0('0x12'));_0x2febdc(_0x774658['result'][_0x3ed0('0x17')]);}})[_0x3ed0('0x18')](function(_0x387f03){logger[_0x3ed0('0x15')](_0x3ed0('0x11'),_0x1aa928,_0x387f03);_0x4af4de(_0x387f03);});});}exports[_0x3ed0('0x19')]=function(_0x564ada){var _0x3e0f2e=this;return new Promise(function(_0x47867f,_0x2ea67a){return db[_0x3ed0('0x1a')][_0x3ed0('0x1b')]({'raw':_0x564ada[_0x3ed0('0x1c')]?_0x564ada[_0x3ed0('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x564ada[_0x3ed0('0x1c')]?_0x564ada[_0x3ed0('0x1c')][_0x3ed0('0x1d')]||null:null,'attributes':_0x564ada[_0x3ed0('0x1c')]?_0x564ada[_0x3ed0('0x1c')]['attributes']||null:null,'limit':_0x564ada[_0x3ed0('0x1c')]?_0x564ada[_0x3ed0('0x1c')][_0x3ed0('0x1e')]||null:null,'include':_0x564ada[_0x3ed0('0x1c')]?_0x564ada[_0x3ed0('0x1c')][_0x3ed0('0x1f')]?_[_0x3ed0('0x20')](_0x564ada[_0x3ed0('0x1c')][_0x3ed0('0x1f')],function(_0x4d08ce){return{'model':db[_0x4d08ce['model']],'as':_0x4d08ce['as'],'attributes':_0x4d08ce[_0x3ed0('0x21')],'include':_0x4d08ce[_0x3ed0('0x1f')]?_[_0x3ed0('0x20')](_0x4d08ce[_0x3ed0('0x1f')],function(_0x440109){return{'model':db[_0x440109[_0x3ed0('0x22')]],'as':_0x440109['as'],'attributes':_0x440109['attributes'],'include':_0x440109['include']?_[_0x3ed0('0x20')](_0x440109[_0x3ed0('0x1f')],function(_0x2a5e86){return{'model':db[_0x2a5e86[_0x3ed0('0x22')]],'as':_0x2a5e86['as'],'attributes':_0x2a5e86[_0x3ed0('0x21')]};}):[]};}):[]};}):[]:[]})[_0x3ed0('0x10')](function(_0x307f9f){logger[_0x3ed0('0x23')](_0x3ed0('0x19'),_0x564ada);logger[_0x3ed0('0x13')]('GetChatQueue',_0x564ada,JSON[_0x3ed0('0x24')](_0x307f9f));_0x47867f(_0x307f9f);})['catch'](function(_0x3b08ea){logger[_0x3ed0('0x15')](_0x3ed0('0x19'),_0x3b08ea[_0x3ed0('0x17')],_0x564ada);_0x2ea67a(_0x3e0f2e[_0x3ed0('0x15')](0x1f4,_0x3b08ea[_0x3ed0('0x17')]));});});};exports[_0x3ed0('0x25')]=function(_0x2e5b7a){var _0xc9c4d8=this;return new Promise(function(_0x4c0d28,_0xedad6){return db[_0x3ed0('0x1a')][_0x3ed0('0x26')]({'raw':_0x2e5b7a[_0x3ed0('0x1c')]?_0x2e5b7a[_0x3ed0('0x1c')][_0x3ed0('0x27')]===undefined?!![]:![]:!![],'where':_0x2e5b7a['options']?_0x2e5b7a[_0x3ed0('0x1c')][_0x3ed0('0x1d')]||null:null,'attributes':_0x2e5b7a['options']?_0x2e5b7a[_0x3ed0('0x1c')][_0x3ed0('0x21')]||null:null,'include':_0x2e5b7a[_0x3ed0('0x1c')]?_0x2e5b7a[_0x3ed0('0x1c')]['include']?_[_0x3ed0('0x20')](_0x2e5b7a[_0x3ed0('0x1c')][_0x3ed0('0x1f')],function(_0x590801){return{'model':db[_0x590801[_0x3ed0('0x22')]],'as':_0x590801['as'],'attributes':_0x590801['attributes'],'include':_0x590801[_0x3ed0('0x1f')]?_[_0x3ed0('0x20')](_0x590801[_0x3ed0('0x1f')],function(_0x49da90){return{'model':db[_0x49da90['model']],'as':_0x49da90['as'],'attributes':_0x49da90[_0x3ed0('0x21')],'include':_0x49da90['include']?_['map'](_0x49da90[_0x3ed0('0x1f')],function(_0x2b1ca9){return{'model':db[_0x2b1ca9[_0x3ed0('0x22')]],'as':_0x2b1ca9['as'],'attributes':_0x2b1ca9[_0x3ed0('0x21')]};}):[]};}):[]};}):[]:[]})[_0x3ed0('0x10')](function(_0x18bc64){logger[_0x3ed0('0x23')]('ShowChatQueue',_0x2e5b7a);logger['debug'](_0x3ed0('0x25'),_0x2e5b7a,JSON[_0x3ed0('0x24')](_0x18bc64));_0x4c0d28(_0x18bc64);})[_0x3ed0('0x18')](function(_0x23f871){logger[_0x3ed0('0x15')](_0x3ed0('0x25'),_0x23f871['message'],_0x2e5b7a);_0xedad6(_0xc9c4d8[_0x3ed0('0x15')](0x1f4,_0x23f871['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 5c805a6..4e803b0 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(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x72b1,0x16e));var _0x172b=function(_0x3c043c,_0x5d384a){_0x3c043c=_0x3c043c-0x0;var _0x2e7e79=_0x72b1[_0x3c043c];return _0x2e7e79;};'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 _0x84ab=['update','emit','removeListener','register','length','chatQueue:','./chatQueue.events','save','remove'];(function(_0x29bca0,_0x22ebf4){var _0x28be22=function(_0x46fe58){while(--_0x46fe58){_0x29bca0['push'](_0x29bca0['shift']());}};_0x28be22(++_0x22ebf4);}(_0x84ab,0x12f));var _0xb84a=function(_0x4bf96c,_0x4d24fd){_0x4bf96c=_0x4bf96c-0x0;var _0x281d09=_0x84ab[_0x4bf96c];return _0x281d09;};'use strict';var ChatQueueEvents=require(_0xb84a('0x0'));var events=[_0xb84a('0x1'),_0xb84a('0x2'),_0xb84a('0x3')];function createListener(_0x473c3,_0x512f13){return function(_0xc83587){_0x512f13[_0xb84a('0x4')](_0x473c3,_0xc83587);};}function removeListener(_0x47b8e3,_0x9d3a00){return function(){ChatQueueEvents[_0xb84a('0x5')](_0x47b8e3,_0x9d3a00);};}exports[_0xb84a('0x6')]=function(_0x5b9def){for(var _0x521a64=0x0,_0x4dc496=events[_0xb84a('0x7')];_0x521a64<_0x4dc496;_0x521a64++){var _0x4fac4d=events[_0x521a64];var _0x3e9086=createListener(_0xb84a('0x8')+_0x4fac4d,_0x5b9def);ChatQueueEvents['on'](_0x4fac4d,_0x3e9086);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 8ae2df8..c20323b 100644
--- a/server/api/chatQueue/index.js
+++ b/server/api/chatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x2aae30,_0x4d834d){var _0x1ea85b=function(_0x6df1f8){while(--_0x6df1f8){_0x2aae30['push'](_0x2aae30['shift']());}};_0x1ea85b(++_0x4d834d);}(_0x55ca,0x126));var _0xa55c=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0x55ca[_0x47fd36];return _0x21a0fc;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router;
\ No newline at end of file
+var _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x3e0d44,_0xc4f9ff){var _0x297f42=function(_0xb5a246){while(--_0xb5a246){_0x3e0d44['push'](_0x3e0d44['shift']());}};_0x297f42(++_0xc4f9ff);}(_0x55ca,0x126));var _0xa55c=function(_0x45f575,_0x3ae51c){_0x45f575=_0x45f575-0x0;var _0xd8e1a1=_0x55ca[_0x45f575];return _0xd8e1a1;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 1a5699c..c785313 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 _0x3e06=['sequelize','exports','STRING','DATE','moment'];(function(_0x3cbb40,_0x3b3f92){var _0x59c30=function(_0x5e165b){while(--_0x5e165b){_0x3cbb40['push'](_0x3cbb40['shift']());}};_0x59c30(++_0x3b3f92);}(_0x3e06,0x153));var _0x63e0=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x3e06[_0x19950b];return _0x3c6b41;};'use strict';var moment=require(_0x63e0('0x0'));var Sequelize=require(_0x63e0('0x1'));module[_0x63e0('0x2')]={'uniqueid':{'type':Sequelize[_0x63e0('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x63e0('0x3')]},'joinAt':{'type':Sequelize[_0x63e0('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x63e0('0x4')]},'exitAt':{'type':Sequelize[_0x63e0('0x4')]},'reason':{'type':Sequelize[_0x63e0('0x3')]}};
\ No newline at end of file
+var _0xb99f=['sequelize','exports','STRING','DATE'];(function(_0x3307ba,_0x234b22){var _0x41d6c3=function(_0x6cded3){while(--_0x6cded3){_0x3307ba['push'](_0x3307ba['shift']());}};_0x41d6c3(++_0x234b22);}(_0xb99f,0x1e8));var _0xfb99=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xb99f[_0x53ccf2];return _0x5a2964;};'use strict';var moment=require('moment');var Sequelize=require(_0xfb99('0x0'));module[_0xfb99('0x1')]={'uniqueid':{'type':Sequelize[_0xfb99('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xfb99('0x2')]},'joinAt':{'type':Sequelize[_0xfb99('0x3')]},'leaveAt':{'type':Sequelize[_0xfb99('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xfb99('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 c3ef942..43f4161 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 _0x0650=['query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','ChatQueueReport','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','name','rawAttributes','fieldName','key','model'];(function(_0x4fdcba,_0x2bebdc){var _0x1eea3e=function(_0x49e225){while(--_0x49e225){_0x4fdcba['push'](_0x4fdcba['shift']());}};_0x1eea3e(++_0x2bebdc);}(_0x0650,0xed));var _0x0065=function(_0x12ec3e,_0x396b4a){_0x12ec3e=_0x12ec3e-0x0;var _0x12cbbe=_0x0650[_0x12ec3e];return _0x12cbbe;};'use strict';var emlformat=require(_0x0065('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0065('0x1'));var jsonpatch=require(_0x0065('0x2'));var rp=require('request-promise');var moment=require(_0x0065('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0065('0x4'));var util=require(_0x0065('0x5'));var path=require(_0x0065('0x6'));var sox=require('sox');var csv=require(_0x0065('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0065('0x8'));var crypto=require(_0x0065('0x9'));var jsforce=require(_0x0065('0xa'));var deskjs=require(_0x0065('0xb'));var toCsv=require(_0x0065('0x7'));var querystring=require(_0x0065('0xc'));var Papa=require(_0x0065('0xd'));var Redis=require(_0x0065('0xe'));var authService=require(_0x0065('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x0065('0x10'));var hardwareService=require(_0x0065('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x0065('0x12'));var licenseUtil=require(_0x0065('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x45c7d1,_0x4255f6){_0x4255f6=_0x4255f6||0xcc;return function(_0x4c6296){if(_0x4c6296){return _0x45c7d1[_0x0065('0x14')](_0x4255f6);}return _0x45c7d1[_0x0065('0x15')](_0x4255f6)['end']();};}function respondWithResult(_0x5ae653,_0x1b9b1e){_0x1b9b1e=_0x1b9b1e||0xc8;return function(_0x5c0b74){if(_0x5c0b74){return _0x5ae653['status'](_0x1b9b1e)[_0x0065('0x16')](_0x5c0b74);}};}function respondWithFilteredResult(_0x5773d6,_0x38a870){return function(_0x48d817){if(_0x48d817){var _0x391fc1=typeof _0x38a870[_0x0065('0x17')]===_0x0065('0x18')&&typeof _0x38a870[_0x0065('0x19')]===_0x0065('0x18');var _0x34b0e2=_0x48d817[_0x0065('0x1a')];var _0x393d6e=_0x391fc1?0x0:_0x38a870['offset'];var _0x18bfa1=_0x391fc1?_0x48d817[_0x0065('0x1a')]:_0x38a870['offset']+_0x38a870[_0x0065('0x19')];var _0x3a0517;if(_0x18bfa1>=_0x34b0e2){_0x18bfa1=_0x34b0e2;_0x3a0517=0xc8;}else{_0x3a0517=0xce;}_0x5773d6[_0x0065('0x15')](_0x3a0517);return _0x5773d6[_0x0065('0x1b')](_0x0065('0x1c'),_0x393d6e+'-'+_0x18bfa1+'/'+_0x34b0e2)[_0x0065('0x16')](_0x48d817);}return null;};}function patchUpdates(_0x319e7a){return function(_0x529e30){try{jsonpatch['apply'](_0x529e30,_0x319e7a,!![]);}catch(_0x4b1213){return BPromise[_0x0065('0x1d')](_0x4b1213);}return _0x529e30[_0x0065('0x1e')]();};}function saveUpdates(_0x5b60c3,_0x2de3ae){return function(_0x5f1733){if(_0x5f1733){return _0x5f1733[_0x0065('0x1f')](_0x5b60c3)[_0x0065('0x20')](function(_0x3ec265){return _0x3ec265;});}return null;};}function removeEntity(_0x376452,_0x161b4c){return function(_0x1efa70){if(_0x1efa70){return _0x1efa70[_0x0065('0x21')]()['then'](function(){_0x376452[_0x0065('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b4a4e,_0x3c715a){return function(_0x5924b3){if(!_0x5924b3){_0x4b4a4e[_0x0065('0x14')](0x194);}return _0x5924b3;};}function handleError(_0x6bf13b,_0x5db92c){_0x5db92c=_0x5db92c||0x1f4;return function(_0x123604){logger['error'](_0x123604['stack']);if(_0x123604[_0x0065('0x22')]){delete _0x123604[_0x0065('0x22')];}_0x6bf13b['status'](_0x5db92c)['send'](_0x123604);};}exports['index']=function(_0x51e091,_0x2e554f){var _0x1a977a={},_0x1f8813={},_0x369d08={'count':0x0,'rows':[]};var _0x4f15f5=_['map'](db['ChatQueueReport'][_0x0065('0x23')],function(_0x3a5286){return{'name':_0x3a5286[_0x0065('0x24')],'type':_0x3a5286['type'][_0x0065('0x25')]};});_0x1f8813[_0x0065('0x26')]=_['map'](_0x4f15f5,_0x0065('0x22'));_0x1f8813[_0x0065('0x27')]=_[_0x0065('0x28')](_0x51e091[_0x0065('0x27')]);_0x1f8813[_0x0065('0x29')]=_[_0x0065('0x2a')](_0x1f8813[_0x0065('0x26')],_0x1f8813[_0x0065('0x27')]);_0x1a977a['attributes']=_['intersection'](_0x1f8813['model'],qs[_0x0065('0x2b')](_0x51e091[_0x0065('0x27')][_0x0065('0x2b')]));_0x1a977a[_0x0065('0x2c')]=_0x1a977a[_0x0065('0x2c')][_0x0065('0x2d')]?_0x1a977a[_0x0065('0x2c')]:_0x1f8813['model'];if(!_0x51e091[_0x0065('0x27')][_0x0065('0x2e')](_0x0065('0x2f'))){_0x1a977a[_0x0065('0x19')]=qs[_0x0065('0x19')](_0x51e091['query'][_0x0065('0x19')]);_0x1a977a[_0x0065('0x17')]=qs[_0x0065('0x17')](_0x51e091[_0x0065('0x27')][_0x0065('0x17')]);}_0x1a977a[_0x0065('0x30')]=qs[_0x0065('0x31')](_0x51e091[_0x0065('0x27')][_0x0065('0x31')]);_0x1a977a[_0x0065('0x32')]=qs['filters'](_[_0x0065('0x33')](_0x51e091[_0x0065('0x27')],_0x1f8813[_0x0065('0x29')]),_0x4f15f5);if(_0x51e091['query'][_0x0065('0x34')]){_0x1a977a[_0x0065('0x32')]=_[_0x0065('0x35')](_0x1a977a[_0x0065('0x32')],{'$or':_[_0x0065('0x36')](_0x4f15f5,function(_0x231986){if(_0x231986['type']!==_0x0065('0x37')){var _0x2d1ba9={};_0x2d1ba9[_0x231986[_0x0065('0x22')]]={'$like':'%'+_0x51e091['query'][_0x0065('0x34')]+'%'};return _0x2d1ba9;}})});}_0x1a977a=_['merge']({},_0x1a977a,_0x51e091[_0x0065('0x38')]);var _0x37a434={'where':_0x1a977a['where']};return db[_0x0065('0x39')][_0x0065('0x1a')](_0x37a434)[_0x0065('0x20')](function(_0x3c1d6b){_0x369d08[_0x0065('0x1a')]=_0x3c1d6b;if(_0x51e091[_0x0065('0x27')]['includeAll']){_0x1a977a[_0x0065('0x3a')]=[{'all':!![]}];}return db[_0x0065('0x39')][_0x0065('0x3b')](_0x1a977a);})[_0x0065('0x20')](function(_0x1d251d){_0x369d08[_0x0065('0x3c')]=_0x1d251d;return _0x369d08;})[_0x0065('0x20')](respondWithFilteredResult(_0x2e554f,_0x1a977a))[_0x0065('0x3d')](handleError(_0x2e554f,null));};exports[_0x0065('0x3e')]=function(_0x41d6f7,_0x26cef9){var _0x32ab66={'raw':!![],'where':{'id':_0x41d6f7[_0x0065('0x3f')]['id']}},_0x35722d={};_0x35722d[_0x0065('0x26')]=_[_0x0065('0x28')](db[_0x0065('0x39')][_0x0065('0x23')]);_0x35722d[_0x0065('0x27')]=_[_0x0065('0x28')](_0x41d6f7[_0x0065('0x27')]);_0x35722d[_0x0065('0x29')]=_[_0x0065('0x2a')](_0x35722d['model'],_0x35722d[_0x0065('0x27')]);_0x32ab66['attributes']=_[_0x0065('0x2a')](_0x35722d['model'],qs[_0x0065('0x2b')](_0x41d6f7['query'][_0x0065('0x2b')]));_0x32ab66[_0x0065('0x2c')]=_0x32ab66[_0x0065('0x2c')]['length']?_0x32ab66['attributes']:_0x35722d[_0x0065('0x26')];if(_0x41d6f7[_0x0065('0x27')][_0x0065('0x40')]){_0x32ab66[_0x0065('0x3a')]=[{'all':!![]}];}_0x32ab66=_['merge']({},_0x32ab66,_0x41d6f7[_0x0065('0x38')]);return db[_0x0065('0x39')][_0x0065('0x41')](_0x32ab66)[_0x0065('0x20')](handleEntityNotFound(_0x26cef9,null))[_0x0065('0x20')](respondWithResult(_0x26cef9,null))['catch'](handleError(_0x26cef9,null));};exports[_0x0065('0x42')]=function(_0x5ef382,_0x339730){return db[_0x0065('0x39')][_0x0065('0x42')](_0x5ef382[_0x0065('0x43')],{})['then'](respondWithResult(_0x339730,0xc9))[_0x0065('0x3d')](handleError(_0x339730,null));};exports['update']=function(_0x86fa3d,_0x20b727){if(_0x86fa3d[_0x0065('0x43')]['id']){delete _0x86fa3d[_0x0065('0x43')]['id'];}return db[_0x0065('0x39')][_0x0065('0x41')]({'where':{'id':_0x86fa3d[_0x0065('0x3f')]['id']}})[_0x0065('0x20')](handleEntityNotFound(_0x20b727,null))[_0x0065('0x20')](saveUpdates(_0x86fa3d[_0x0065('0x43')],null))[_0x0065('0x20')](respondWithResult(_0x20b727,null))['catch'](handleError(_0x20b727,null));};exports[_0x0065('0x21')]=function(_0xcd7d13,_0x277b74){return db[_0x0065('0x39')][_0x0065('0x41')]({'where':{'id':_0xcd7d13[_0x0065('0x3f')]['id']}})[_0x0065('0x20')](handleEntityNotFound(_0x277b74,null))['then'](removeEntity(_0x277b74,null))['catch'](handleError(_0x277b74,null));};exports[_0x0065('0x44')]=function(_0x2da487,_0xf7e228){return db[_0x0065('0x39')][_0x0065('0x44')]()[_0x0065('0x20')](respondWithResult(_0xf7e228,null))[_0x0065('0x3d')](handleError(_0xf7e228,null));};
\ No newline at end of file
+var _0x8a87=['name','send','index','map','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','includeAll','include','findAll','show','params','ChatQueueReport','rawAttributes','options','find','catch','create','body','describe','eml-format','fast-json-patch','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','error','stack'];(function(_0x10ae6b,_0x3bf4a1){var _0x3838bb=function(_0x395dc5){while(--_0x395dc5){_0x10ae6b['push'](_0x10ae6b['shift']());}};_0x3838bb(++_0x3bf4a1);}(_0x8a87,0x6b));var _0x78a8=function(_0x4521e3,_0x10a8a4){_0x4521e3=_0x4521e3-0x0;var _0x46a272=_0x8a87[_0x4521e3];return _0x46a272;};'use strict';var emlformat=require(_0x78a8('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x78a8('0x1'));var rp=require('request-promise');var moment=require(_0x78a8('0x2'));var BPromise=require(_0x78a8('0x3'));var Mustache=require(_0x78a8('0x4'));var util=require('util');var path=require(_0x78a8('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x78a8('0x6'));var fs=require('fs');var fs_extra=require(_0x78a8('0x7'));var _=require(_0x78a8('0x8'));var squel=require(_0x78a8('0x9'));var crypto=require(_0x78a8('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x78a8('0xb'));var toCsv=require('to-csv');var querystring=require(_0x78a8('0xc'));var Papa=require('papaparse');var Redis=require(_0x78a8('0xd'));var authService=require(_0x78a8('0xe'));var qs=require(_0x78a8('0xf'));var as=require(_0x78a8('0x10'));var hardwareService=require(_0x78a8('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x78a8('0x12'));var config=require(_0x78a8('0x13'));var licenseUtil=require(_0x78a8('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27d979,_0x40a9c9){_0x40a9c9=_0x40a9c9||0xcc;return function(_0x1276d4){if(_0x1276d4){return _0x27d979[_0x78a8('0x15')](_0x40a9c9);}return _0x27d979['status'](_0x40a9c9)[_0x78a8('0x16')]();};}function respondWithResult(_0x35b5ca,_0x30f579){_0x30f579=_0x30f579||0xc8;return function(_0x29dd7f){if(_0x29dd7f){return _0x35b5ca[_0x78a8('0x17')](_0x30f579)[_0x78a8('0x18')](_0x29dd7f);}};}function respondWithFilteredResult(_0x59c75e,_0x58a68b){return function(_0x556177){if(_0x556177){var _0x27d055=typeof _0x58a68b[_0x78a8('0x19')]===_0x78a8('0x1a')&&typeof _0x58a68b[_0x78a8('0x1b')]===_0x78a8('0x1a');var _0x5129bb=_0x556177['count'];var _0x958370=_0x27d055?0x0:_0x58a68b[_0x78a8('0x19')];var _0x4d6980=_0x27d055?_0x556177[_0x78a8('0x1c')]:_0x58a68b[_0x78a8('0x19')]+_0x58a68b['limit'];var _0x29cfbc;if(_0x4d6980>=_0x5129bb){_0x4d6980=_0x5129bb;_0x29cfbc=0xc8;}else{_0x29cfbc=0xce;}_0x59c75e['status'](_0x29cfbc);return _0x59c75e['set'](_0x78a8('0x1d'),_0x958370+'-'+_0x4d6980+'/'+_0x5129bb)[_0x78a8('0x18')](_0x556177);}return null;};}function patchUpdates(_0x14b31f){return function(_0x5e1d26){try{jsonpatch[_0x78a8('0x1e')](_0x5e1d26,_0x14b31f,!![]);}catch(_0x4be376){return BPromise['reject'](_0x4be376);}return _0x5e1d26[_0x78a8('0x1f')]();};}function saveUpdates(_0x429c9,_0x295c8f){return function(_0x257d3a){if(_0x257d3a){return _0x257d3a[_0x78a8('0x20')](_0x429c9)[_0x78a8('0x21')](function(_0x149adc){return _0x149adc;});}return null;};}function removeEntity(_0x4bcf27,_0x1834aa){return function(_0x5e5e22){if(_0x5e5e22){return _0x5e5e22[_0x78a8('0x22')]()[_0x78a8('0x21')](function(){_0x4bcf27[_0x78a8('0x17')](0xcc)[_0x78a8('0x16')]();});}};}function handleEntityNotFound(_0x2f12b0,_0x262dd6){return function(_0x2e8fa3){if(!_0x2e8fa3){_0x2f12b0[_0x78a8('0x15')](0x194);}return _0x2e8fa3;};}function handleError(_0x116253,_0x5bd96c){_0x5bd96c=_0x5bd96c||0x1f4;return function(_0x2c07a2){logger[_0x78a8('0x23')](_0x2c07a2[_0x78a8('0x24')]);if(_0x2c07a2[_0x78a8('0x25')]){delete _0x2c07a2['name'];}_0x116253[_0x78a8('0x17')](_0x5bd96c)[_0x78a8('0x26')](_0x2c07a2);};}exports[_0x78a8('0x27')]=function(_0x29f24b,_0x391530){var _0x5454aa={},_0x565d9c={},_0x118b8f={'count':0x0,'rows':[]};var _0x5a536e=_[_0x78a8('0x28')](db['ChatQueueReport']['rawAttributes'],function(_0x4e7aab){return{'name':_0x4e7aab['fieldName'],'type':_0x4e7aab[_0x78a8('0x29')][_0x78a8('0x2a')]};});_0x565d9c[_0x78a8('0x2b')]=_[_0x78a8('0x28')](_0x5a536e,_0x78a8('0x25'));_0x565d9c['query']=_[_0x78a8('0x2c')](_0x29f24b[_0x78a8('0x2d')]);_0x565d9c[_0x78a8('0x2e')]=_[_0x78a8('0x2f')](_0x565d9c[_0x78a8('0x2b')],_0x565d9c[_0x78a8('0x2d')]);_0x5454aa[_0x78a8('0x30')]=_[_0x78a8('0x2f')](_0x565d9c['model'],qs[_0x78a8('0x31')](_0x29f24b['query']['fields']));_0x5454aa[_0x78a8('0x30')]=_0x5454aa['attributes'][_0x78a8('0x32')]?_0x5454aa['attributes']:_0x565d9c[_0x78a8('0x2b')];if(!_0x29f24b[_0x78a8('0x2d')][_0x78a8('0x33')](_0x78a8('0x34'))){_0x5454aa[_0x78a8('0x1b')]=qs[_0x78a8('0x1b')](_0x29f24b[_0x78a8('0x2d')][_0x78a8('0x1b')]);_0x5454aa[_0x78a8('0x19')]=qs['offset'](_0x29f24b[_0x78a8('0x2d')][_0x78a8('0x19')]);}_0x5454aa[_0x78a8('0x35')]=qs[_0x78a8('0x36')](_0x29f24b[_0x78a8('0x2d')]['sort']);_0x5454aa['where']=qs[_0x78a8('0x2e')](_['pick'](_0x29f24b[_0x78a8('0x2d')],_0x565d9c[_0x78a8('0x2e')]),_0x5a536e);if(_0x29f24b[_0x78a8('0x2d')][_0x78a8('0x37')]){_0x5454aa[_0x78a8('0x38')]=_[_0x78a8('0x39')](_0x5454aa['where'],{'$or':_[_0x78a8('0x28')](_0x5a536e,function(_0x21b4a5){if(_0x21b4a5['type']!==_0x78a8('0x3a')){var _0xfe0029={};_0xfe0029[_0x21b4a5['name']]={'$like':'%'+_0x29f24b['query'][_0x78a8('0x37')]+'%'};return _0xfe0029;}})});}_0x5454aa=_[_0x78a8('0x39')]({},_0x5454aa,_0x29f24b['options']);var _0x1819d0={'where':_0x5454aa[_0x78a8('0x38')]};return db['ChatQueueReport']['count'](_0x1819d0)[_0x78a8('0x21')](function(_0x26395f){_0x118b8f[_0x78a8('0x1c')]=_0x26395f;if(_0x29f24b['query'][_0x78a8('0x3b')]){_0x5454aa[_0x78a8('0x3c')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x78a8('0x3d')](_0x5454aa);})[_0x78a8('0x21')](function(_0x2d0fe0){_0x118b8f['rows']=_0x2d0fe0;return _0x118b8f;})[_0x78a8('0x21')](respondWithFilteredResult(_0x391530,_0x5454aa))['catch'](handleError(_0x391530,null));};exports[_0x78a8('0x3e')]=function(_0x235624,_0x282e74){var _0x3e8c3d={'raw':!![],'where':{'id':_0x235624[_0x78a8('0x3f')]['id']}},_0x371d19={};_0x371d19[_0x78a8('0x2b')]=_[_0x78a8('0x2c')](db[_0x78a8('0x40')][_0x78a8('0x41')]);_0x371d19['query']=_[_0x78a8('0x2c')](_0x235624[_0x78a8('0x2d')]);_0x371d19[_0x78a8('0x2e')]=_['intersection'](_0x371d19['model'],_0x371d19[_0x78a8('0x2d')]);_0x3e8c3d[_0x78a8('0x30')]=_['intersection'](_0x371d19[_0x78a8('0x2b')],qs[_0x78a8('0x31')](_0x235624['query'][_0x78a8('0x31')]));_0x3e8c3d[_0x78a8('0x30')]=_0x3e8c3d['attributes']['length']?_0x3e8c3d[_0x78a8('0x30')]:_0x371d19[_0x78a8('0x2b')];if(_0x235624['query'][_0x78a8('0x3b')]){_0x3e8c3d['include']=[{'all':!![]}];}_0x3e8c3d=_[_0x78a8('0x39')]({},_0x3e8c3d,_0x235624[_0x78a8('0x42')]);return db[_0x78a8('0x40')][_0x78a8('0x43')](_0x3e8c3d)[_0x78a8('0x21')](handleEntityNotFound(_0x282e74,null))['then'](respondWithResult(_0x282e74,null))[_0x78a8('0x44')](handleError(_0x282e74,null));};exports[_0x78a8('0x45')]=function(_0x38f812,_0x53a3aa){return db[_0x78a8('0x40')][_0x78a8('0x45')](_0x38f812[_0x78a8('0x46')],{})[_0x78a8('0x21')](respondWithResult(_0x53a3aa,0xc9))[_0x78a8('0x44')](handleError(_0x53a3aa,null));};exports[_0x78a8('0x20')]=function(_0xd22dd3,_0x3b6cb7){if(_0xd22dd3['body']['id']){delete _0xd22dd3[_0x78a8('0x46')]['id'];}return db[_0x78a8('0x40')]['find']({'where':{'id':_0xd22dd3['params']['id']}})['then'](handleEntityNotFound(_0x3b6cb7,null))['then'](saveUpdates(_0xd22dd3[_0x78a8('0x46')],null))[_0x78a8('0x21')](respondWithResult(_0x3b6cb7,null))[_0x78a8('0x44')](handleError(_0x3b6cb7,null));};exports['destroy']=function(_0x9cfc96,_0x190d68){return db[_0x78a8('0x40')]['find']({'where':{'id':_0x9cfc96[_0x78a8('0x3f')]['id']}})['then'](handleEntityNotFound(_0x190d68,null))[_0x78a8('0x21')](removeEntity(_0x190d68,null))['catch'](handleError(_0x190d68,null));};exports[_0x78a8('0x47')]=function(_0x563f76,_0x1de362){return db[_0x78a8('0x40')][_0x78a8('0x47')]()[_0x78a8('0x21')](respondWithResult(_0x1de362,null))[_0x78a8('0x44')](handleError(_0x1de362,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 44840d8..0de6c86 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 _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x3fed95,_0x43ae94){var _0xdc4a03=function(_0x36183c){while(--_0x36183c){_0x3fed95['push'](_0x3fed95['shift']());}};_0xdc4a03(++_0x43ae94);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0xb7e7[_0x1b7368];return _0x25d54c;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x500c0,_0xdb6a03){var _0xdd146f=function(_0x2e8090){while(--_0x2e8090){_0x500c0['push'](_0x500c0['shift']());}};_0xdd146f(++_0xdb6a03);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index c376699..888205f 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 _0x86ea=['catch','update','where','attributes','limit','UpdateChatQueueReport','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','code','error','message','ChatQueueReport,\x20%s,\x20%s','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','stringify'];(function(_0x531c31,_0x30804e){var _0x234a39=function(_0x38f39f){while(--_0x38f39f){_0x531c31['push'](_0x531c31['shift']());}};_0x234a39(++_0x30804e);}(_0x86ea,0x187));var _0xa86e=function(_0xa9eb56,_0x4a86b1){_0xa9eb56=_0xa9eb56-0x0;var _0x3f53c9=_0x86ea[_0xa9eb56];return _0x3f53c9;};'use strict';var _=require(_0xa86e('0x0'));var util=require(_0xa86e('0x1'));var moment=require('moment');var BPromise=require(_0xa86e('0x2'));var rs=require(_0xa86e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa86e('0x4'))['db'];var utils=require(_0xa86e('0x5'));var logger=require(_0xa86e('0x6'))(_0xa86e('0x7'));var config=require(_0xa86e('0x8'));var jayson=require(_0xa86e('0x9'));var client=jayson[_0xa86e('0xa')][_0xa86e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1306c3,_0x2d2d0b,_0x508227){return new BPromise(function(_0x59b1a8,_0x1e87d7){return client[_0xa86e('0xc')](_0x1306c3,_0x508227)[_0xa86e('0xd')](function(_0xd716ad){logger[_0xa86e('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x2d2d0b,_0xa86e('0xf'));logger[_0xa86e('0x10')](_0xa86e('0x11'),_0x2d2d0b,_0xa86e('0xf'),JSON['stringify'](_0xd716ad));if(_0xd716ad['error']){if(_0xd716ad['error'][_0xa86e('0x12')]===0x1f4){logger[_0xa86e('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0x2d2d0b,_0xd716ad[_0xa86e('0x13')][_0xa86e('0x14')]);return _0x1e87d7(_0xd716ad[_0xa86e('0x13')][_0xa86e('0x14')]);}logger[_0xa86e('0x13')](_0xa86e('0x15'),_0x2d2d0b,_0xd716ad['error'][_0xa86e('0x14')]);return _0x59b1a8(_0xd716ad[_0xa86e('0x13')]['message']);}else{logger[_0xa86e('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x2d2d0b,'request\x20sent');_0x59b1a8(_0xd716ad['result']['message']);}})['catch'](function(_0x2eeb83){logger[_0xa86e('0x13')](_0xa86e('0x15'),_0x2d2d0b,_0x2eeb83);_0x1e87d7(_0x2eeb83);});});}exports[_0xa86e('0x16')]=function(_0x133bf8){var _0x2f9ac6=this;return new Promise(function(_0x4321fe,_0xc30386){return db[_0xa86e('0x17')][_0xa86e('0x18')](_0x133bf8[_0xa86e('0x19')],{'raw':_0x133bf8[_0xa86e('0x1a')]?_0x133bf8[_0xa86e('0x1a')][_0xa86e('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x1001e5){logger[_0xa86e('0xe')](_0xa86e('0x16'),_0x133bf8);logger[_0xa86e('0x10')](_0xa86e('0x16'),_0x133bf8,JSON[_0xa86e('0x1c')](_0x1001e5));_0x4321fe(_0x1001e5);})[_0xa86e('0x1d')](function(_0x7bf7cf){logger['error']('CreateChatQueueReport',_0x7bf7cf['message'],_0x133bf8);_0xc30386(_0x2f9ac6[_0xa86e('0x13')](0x1f4,_0x7bf7cf[_0xa86e('0x14')]));});});};exports['UpdateChatQueueReport']=function(_0x5597b1){var _0x4cc784=this;return new Promise(function(_0x5f34dd,_0xf8d0d0){return db['ChatQueueReport'][_0xa86e('0x1e')](_0x5597b1[_0xa86e('0x19')],{'raw':_0x5597b1['options']?_0x5597b1['options'][_0xa86e('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5597b1[_0xa86e('0x1a')]?_0x5597b1[_0xa86e('0x1a')][_0xa86e('0x1f')]||null:null,'attributes':_0x5597b1[_0xa86e('0x1a')]?_0x5597b1[_0xa86e('0x1a')][_0xa86e('0x20')]||null:null,'limit':_0x5597b1[_0xa86e('0x1a')]?_0x5597b1['options'][_0xa86e('0x21')]||null:null})[_0xa86e('0xd')](function(_0x5abf2e){logger[_0xa86e('0xe')](_0xa86e('0x22'),_0x5597b1);logger[_0xa86e('0x10')](_0xa86e('0x22'),_0x5597b1,JSON['stringify'](_0x5abf2e));_0x5f34dd(_0x5abf2e);})[_0xa86e('0x1d')](function(_0x24b712){logger[_0xa86e('0x13')](_0xa86e('0x22'),_0x24b712['message'],_0x5597b1);_0xf8d0d0(_0x4cc784['error'](0x1f4,_0x24b712['message']));});});};
\ No newline at end of file
+var _0xb6a0=['http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','UpdateChatQueueReport','update','limit','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client'];(function(_0x3c487b,_0x44c5e2){var _0x1d65f6=function(_0x135e6d){while(--_0x135e6d){_0x3c487b['push'](_0x3c487b['shift']());}};_0x1d65f6(++_0x44c5e2);}(_0xb6a0,0xf0));var _0x0b6a=function(_0x196fb2,_0xe6ed5f){_0x196fb2=_0x196fb2-0x0;var _0x142a70=_0xb6a0[_0x196fb2];return _0x142a70;};'use strict';var _=require('lodash');var util=require(_0x0b6a('0x0'));var moment=require('moment');var BPromise=require(_0x0b6a('0x1'));var rs=require(_0x0b6a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0b6a('0x3'))['db'];var utils=require(_0x0b6a('0x4'));var logger=require(_0x0b6a('0x5'))('rpc');var config=require(_0x0b6a('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x0b6a('0x7')][_0x0b6a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x558f55,_0x5a4c9f,_0x18bc48){return new BPromise(function(_0x404669,_0x2a1210){return client[_0x0b6a('0x9')](_0x558f55,_0x18bc48)[_0x0b6a('0xa')](function(_0xd30f96){logger[_0x0b6a('0xb')](_0x0b6a('0xc'),_0x5a4c9f,_0x0b6a('0xd'));logger[_0x0b6a('0xe')](_0x0b6a('0xf'),_0x5a4c9f,_0x0b6a('0xd'),JSON[_0x0b6a('0x10')](_0xd30f96));if(_0xd30f96[_0x0b6a('0x11')]){if(_0xd30f96['error'][_0x0b6a('0x12')]===0x1f4){logger['error'](_0x0b6a('0xc'),_0x5a4c9f,_0xd30f96[_0x0b6a('0x11')][_0x0b6a('0x13')]);return _0x2a1210(_0xd30f96[_0x0b6a('0x11')]['message']);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x5a4c9f,_0xd30f96['error'][_0x0b6a('0x13')]);return _0x404669(_0xd30f96[_0x0b6a('0x11')][_0x0b6a('0x13')]);}else{logger[_0x0b6a('0xb')](_0x0b6a('0xc'),_0x5a4c9f,_0x0b6a('0xd'));_0x404669(_0xd30f96[_0x0b6a('0x14')][_0x0b6a('0x13')]);}})[_0x0b6a('0x15')](function(_0x4765da){logger[_0x0b6a('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x5a4c9f,_0x4765da);_0x2a1210(_0x4765da);});});}exports[_0x0b6a('0x16')]=function(_0x14001b){var _0x470b0b=this;return new Promise(function(_0x3a9d69,_0x7345cb){return db[_0x0b6a('0x17')][_0x0b6a('0x18')](_0x14001b[_0x0b6a('0x19')],{'raw':_0x14001b[_0x0b6a('0x1a')]?_0x14001b[_0x0b6a('0x1a')][_0x0b6a('0x1b')]===undefined?!![]:![]:!![]})[_0x0b6a('0xa')](function(_0x51efca){logger['info'](_0x0b6a('0x16'),_0x14001b);logger[_0x0b6a('0xe')](_0x0b6a('0x16'),_0x14001b,JSON[_0x0b6a('0x10')](_0x51efca));_0x3a9d69(_0x51efca);})['catch'](function(_0x83a5dc){logger[_0x0b6a('0x11')](_0x0b6a('0x16'),_0x83a5dc['message'],_0x14001b);_0x7345cb(_0x470b0b[_0x0b6a('0x11')](0x1f4,_0x83a5dc[_0x0b6a('0x13')]));});});};exports[_0x0b6a('0x1c')]=function(_0x5795d3){var _0x32717e=this;return new Promise(function(_0xdf9490,_0x385e3e){return db['ChatQueueReport'][_0x0b6a('0x1d')](_0x5795d3[_0x0b6a('0x19')],{'raw':_0x5795d3['options']?_0x5795d3['options'][_0x0b6a('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5795d3[_0x0b6a('0x1a')]?_0x5795d3['options']['where']||null:null,'attributes':_0x5795d3['options']?_0x5795d3[_0x0b6a('0x1a')]['attributes']||null:null,'limit':_0x5795d3[_0x0b6a('0x1a')]?_0x5795d3[_0x0b6a('0x1a')][_0x0b6a('0x1e')]||null:null})[_0x0b6a('0xa')](function(_0x4748f8){logger[_0x0b6a('0xb')](_0x0b6a('0x1c'),_0x5795d3);logger[_0x0b6a('0xe')]('UpdateChatQueueReport',_0x5795d3,JSON[_0x0b6a('0x10')](_0x4748f8));_0xdf9490(_0x4748f8);})[_0x0b6a('0x15')](function(_0x1ed33e){logger[_0x0b6a('0x11')](_0x0b6a('0x1c'),_0x1ed33e[_0x0b6a('0x13')],_0x5795d3);_0x385e3e(_0x32717e['error'](0x1f4,_0x1ed33e[_0x0b6a('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index f1d9389..f1746cc 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 _0x3c5e=['create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id'];(function(_0x4f6d08,_0x1b3dd0){var _0x53a9c6=function(_0x2e0e0f){while(--_0x2e0e0f){_0x4f6d08['push'](_0x4f6d08['shift']());}};_0x53a9c6(++_0x1b3dd0);}(_0x3c5e,0x182));var _0xe3c5=function(_0x2c6a99,_0x48ac51){_0x2c6a99=_0x2c6a99-0x0;var _0x26b56f=_0x3c5e[_0x2c6a99];return _0x26b56f;};'use strict';var multer=require(_0xe3c5('0x0'));var util=require('util');var path=require(_0xe3c5('0x1'));var timeout=require(_0xe3c5('0x2'));var express=require(_0xe3c5('0x3'));var router=express[_0xe3c5('0x4')]();var fs_extra=require(_0xe3c5('0x5'));var auth=require(_0xe3c5('0x6'));var interaction=require(_0xe3c5('0x7'));var config=require(_0xe3c5('0x8'));var controller=require('./chatQueueReport.controller');router[_0xe3c5('0x9')]('/',auth[_0xe3c5('0xa')](),controller['index']);router['get'](_0xe3c5('0xb'),auth[_0xe3c5('0xa')](),controller[_0xe3c5('0xc')]);router[_0xe3c5('0x9')](_0xe3c5('0xd'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xe3c5('0xe')]);router[_0xe3c5('0xf')](_0xe3c5('0xd'),auth[_0xe3c5('0xa')](),controller[_0xe3c5('0x10')]);router[_0xe3c5('0x11')](_0xe3c5('0xd'),auth[_0xe3c5('0xa')](),controller[_0xe3c5('0x12')]);module[_0xe3c5('0x13')]=router;
\ No newline at end of file
+var _0xfb22=['index','/describe','describe','/:id','show','put','update','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated'];(function(_0x13972c,_0x16ddf9){var _0x5d5d7e=function(_0x1f7073){while(--_0x1f7073){_0x13972c['push'](_0x13972c['shift']());}};_0x5d5d7e(++_0x16ddf9);}(_0xfb22,0x15e));var _0x2fb2=function(_0x352b44,_0x4a91a1){_0x352b44=_0x352b44-0x0;var _0x3e8baa=_0xfb22[_0x352b44];return _0x3e8baa;};'use strict';var multer=require(_0x2fb2('0x0'));var util=require(_0x2fb2('0x1'));var path=require(_0x2fb2('0x2'));var timeout=require('connect-timeout');var express=require(_0x2fb2('0x3'));var router=express[_0x2fb2('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2fb2('0x5'));var interaction=require(_0x2fb2('0x6'));var config=require(_0x2fb2('0x7'));var controller=require(_0x2fb2('0x8'));router[_0x2fb2('0x9')]('/',auth[_0x2fb2('0xa')](),controller[_0x2fb2('0xb')]);router[_0x2fb2('0x9')](_0x2fb2('0xc'),auth[_0x2fb2('0xa')](),controller[_0x2fb2('0xd')]);router[_0x2fb2('0x9')](_0x2fb2('0xe'),auth['isAuthenticated'](),controller[_0x2fb2('0xf')]);router['post']('/',auth[_0x2fb2('0xa')](),controller['create']);router[_0x2fb2('0x10')](_0x2fb2('0xe'),auth[_0x2fb2('0xa')](),controller[_0x2fb2('0x11')]);router['delete'](_0x2fb2('0xe'),auth[_0x2fb2('0xa')](),controller[_0x2fb2('0x12')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 4ea4091..23c7aab 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 _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x236c89,_0xd76ba9){var _0x3b2a15=function(_0x89e4f9){while(--_0x89e4f9){_0x236c89['push'](_0x236c89['shift']());}};_0x3b2a15(++_0xd76ba9);}(_0x9bde,0xe1));var _0xe9bd=function(_0x2c1a6d,_0x47829c){_0x2c1a6d=_0x2c1a6d-0x0;var _0x22e8fd=_0x9bde[_0x2c1a6d];return _0x22e8fd;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}};
\ No newline at end of file
+var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x2d99e9,_0x5b5af0){var _0x4b9d95=function(_0x3fdfc9){while(--_0x3fdfc9){_0x2d99e9['push'](_0x2d99e9['shift']());}};_0x4b9d95(++_0x5b5af0);}(_0xaa88,0x137));var _0x8aa8=function(_0x170772,_0x1f1ee7){_0x170772=_0x170772-0x0;var _0x3ef69c=_0xaa88[_0x170772];return _0x3ef69c;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index fb9d422..c5e69e5 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 _0x33f2=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','map','type','VIRTUAL','options','ChatTransferReport','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','describe','eml-format','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs'];(function(_0x17a773,_0x12f6da){var _0x58ba4f=function(_0x5c7bea){while(--_0x5c7bea){_0x17a773['push'](_0x17a773['shift']());}};_0x58ba4f(++_0x12f6da);}(_0x33f2,0x8a));var _0x233f=function(_0x210d7f,_0x2abe4f){_0x210d7f=_0x210d7f-0x0;var _0x42d687=_0x33f2[_0x210d7f];return _0x42d687;};'use strict';var emlformat=require(_0x233f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x233f('0x1'));var rp=require(_0x233f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x233f('0x3'));var util=require(_0x233f('0x4'));var path=require(_0x233f('0x5'));var sox=require(_0x233f('0x6'));var csv=require(_0x233f('0x7'));var ejs=require(_0x233f('0x8'));var fs=require('fs');var fs_extra=require(_0x233f('0x9'));var _=require(_0x233f('0xa'));var squel=require('squel');var crypto=require(_0x233f('0xb'));var jsforce=require(_0x233f('0xc'));var deskjs=require(_0x233f('0xd'));var toCsv=require(_0x233f('0x7'));var querystring=require(_0x233f('0xe'));var Papa=require(_0x233f('0xf'));var Redis=require(_0x233f('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x233f('0x11'));var as=require(_0x233f('0x12'));var hardwareService=require(_0x233f('0x13'));var logger=require(_0x233f('0x14'))(_0x233f('0x15'));var utils=require(_0x233f('0x16'));var config=require(_0x233f('0x17'));var licenseUtil=require(_0x233f('0x18'));var db=require(_0x233f('0x19'))['db'];function respondWithStatusCode(_0x1234d2,_0x280d76){_0x280d76=_0x280d76||0xcc;return function(_0x28e22a){if(_0x28e22a){return _0x1234d2['sendStatus'](_0x280d76);}return _0x1234d2[_0x233f('0x1a')](_0x280d76)[_0x233f('0x1b')]();};}function respondWithResult(_0x14b947,_0x5acde7){_0x5acde7=_0x5acde7||0xc8;return function(_0x4caf1b){if(_0x4caf1b){return _0x14b947[_0x233f('0x1a')](_0x5acde7)[_0x233f('0x1c')](_0x4caf1b);}};}function respondWithFilteredResult(_0x4558d9,_0x1e17dd){return function(_0x2ef214){if(_0x2ef214){var _0x581f80=typeof _0x1e17dd[_0x233f('0x1d')]===_0x233f('0x1e')&&typeof _0x1e17dd[_0x233f('0x1f')]===_0x233f('0x1e');var _0x3130bd=_0x2ef214[_0x233f('0x20')];var _0x31782d=_0x581f80?0x0:_0x1e17dd['offset'];var _0x2bca78=_0x581f80?_0x2ef214[_0x233f('0x20')]:_0x1e17dd[_0x233f('0x1d')]+_0x1e17dd[_0x233f('0x1f')];var _0x233dfd;if(_0x2bca78>=_0x3130bd){_0x2bca78=_0x3130bd;_0x233dfd=0xc8;}else{_0x233dfd=0xce;}_0x4558d9[_0x233f('0x1a')](_0x233dfd);return _0x4558d9[_0x233f('0x21')](_0x233f('0x22'),_0x31782d+'-'+_0x2bca78+'/'+_0x3130bd)[_0x233f('0x1c')](_0x2ef214);}return null;};}function patchUpdates(_0x1bf278){return function(_0x3b2add){try{jsonpatch[_0x233f('0x23')](_0x3b2add,_0x1bf278,!![]);}catch(_0x18dbc4){return BPromise[_0x233f('0x24')](_0x18dbc4);}return _0x3b2add[_0x233f('0x25')]();};}function saveUpdates(_0xb48225,_0x3c8ccf){return function(_0x2fcbea){if(_0x2fcbea){return _0x2fcbea[_0x233f('0x26')](_0xb48225)[_0x233f('0x27')](function(_0x565f74){return _0x565f74;});}return null;};}function removeEntity(_0x42baf7,_0x23181b){return function(_0x59c4b5){if(_0x59c4b5){return _0x59c4b5[_0x233f('0x28')]()[_0x233f('0x27')](function(){_0x42baf7[_0x233f('0x1a')](0xcc)[_0x233f('0x1b')]();});}};}function handleEntityNotFound(_0x552f66,_0x416639){return function(_0xc35bcc){if(!_0xc35bcc){_0x552f66[_0x233f('0x29')](0x194);}return _0xc35bcc;};}function handleError(_0x22e56b,_0x40f2e1){_0x40f2e1=_0x40f2e1||0x1f4;return function(_0xe8333e){logger['error'](_0xe8333e[_0x233f('0x2a')]);if(_0xe8333e['name']){delete _0xe8333e[_0x233f('0x2b')];}_0x22e56b[_0x233f('0x1a')](_0x40f2e1)[_0x233f('0x2c')](_0xe8333e);};}exports['index']=function(_0x1d118b,_0x3724c4){var _0x529717={},_0x290ff3={},_0x5e71b1={'count':0x0,'rows':[]};var _0x1fe785=_['map'](db['ChatTransferReport']['rawAttributes'],function(_0x23c78f){return{'name':_0x23c78f[_0x233f('0x2d')],'type':_0x23c78f['type'][_0x233f('0x2e')]};});_0x290ff3[_0x233f('0x2f')]=_['map'](_0x1fe785,_0x233f('0x2b'));_0x290ff3[_0x233f('0x30')]=_[_0x233f('0x31')](_0x1d118b['query']);_0x290ff3[_0x233f('0x32')]=_[_0x233f('0x33')](_0x290ff3[_0x233f('0x2f')],_0x290ff3[_0x233f('0x30')]);_0x529717[_0x233f('0x34')]=_[_0x233f('0x33')](_0x290ff3[_0x233f('0x2f')],qs[_0x233f('0x35')](_0x1d118b[_0x233f('0x30')][_0x233f('0x35')]));_0x529717[_0x233f('0x34')]=_0x529717[_0x233f('0x34')][_0x233f('0x36')]?_0x529717[_0x233f('0x34')]:_0x290ff3['model'];if(!_0x1d118b[_0x233f('0x30')][_0x233f('0x37')](_0x233f('0x38'))){_0x529717['limit']=qs[_0x233f('0x1f')](_0x1d118b['query'][_0x233f('0x1f')]);_0x529717['offset']=qs['offset'](_0x1d118b[_0x233f('0x30')][_0x233f('0x1d')]);}_0x529717['order']=qs[_0x233f('0x39')](_0x1d118b[_0x233f('0x30')][_0x233f('0x39')]);_0x529717[_0x233f('0x3a')]=qs[_0x233f('0x32')](_['pick'](_0x1d118b['query'],_0x290ff3[_0x233f('0x32')]),_0x1fe785);if(_0x1d118b[_0x233f('0x30')][_0x233f('0x3b')]){_0x529717[_0x233f('0x3a')]=_[_0x233f('0x3c')](_0x529717[_0x233f('0x3a')],{'$or':_[_0x233f('0x3d')](_0x1fe785,function(_0x3b521e){if(_0x3b521e[_0x233f('0x3e')]!==_0x233f('0x3f')){var _0x5a328a={};_0x5a328a[_0x3b521e['name']]={'$like':'%'+_0x1d118b[_0x233f('0x30')]['filter']+'%'};return _0x5a328a;}})});}_0x529717=_[_0x233f('0x3c')]({},_0x529717,_0x1d118b[_0x233f('0x40')]);var _0x7fcbe0={'where':_0x529717[_0x233f('0x3a')]};return db[_0x233f('0x41')]['count'](_0x7fcbe0)[_0x233f('0x27')](function(_0x3bd8a7){_0x5e71b1[_0x233f('0x20')]=_0x3bd8a7;if(_0x1d118b[_0x233f('0x30')][_0x233f('0x42')]){_0x529717[_0x233f('0x43')]=[{'all':!![]}];}return db[_0x233f('0x41')][_0x233f('0x44')](_0x529717);})[_0x233f('0x27')](function(_0x4f9f4b){_0x5e71b1[_0x233f('0x45')]=_0x4f9f4b;return _0x5e71b1;})[_0x233f('0x27')](respondWithFilteredResult(_0x3724c4,_0x529717))['catch'](handleError(_0x3724c4,null));};exports[_0x233f('0x46')]=function(_0x1b699e,_0xa6906b){var _0x1c5389={'raw':!![],'where':{'id':_0x1b699e[_0x233f('0x47')]['id']}},_0x1b5586={};_0x1b5586[_0x233f('0x2f')]=_[_0x233f('0x31')](db['ChatTransferReport'][_0x233f('0x48')]);_0x1b5586['query']=_[_0x233f('0x31')](_0x1b699e[_0x233f('0x30')]);_0x1b5586[_0x233f('0x32')]=_[_0x233f('0x33')](_0x1b5586[_0x233f('0x2f')],_0x1b5586['query']);_0x1c5389[_0x233f('0x34')]=_[_0x233f('0x33')](_0x1b5586[_0x233f('0x2f')],qs[_0x233f('0x35')](_0x1b699e['query'][_0x233f('0x35')]));_0x1c5389[_0x233f('0x34')]=_0x1c5389['attributes'][_0x233f('0x36')]?_0x1c5389[_0x233f('0x34')]:_0x1b5586['model'];if(_0x1b699e[_0x233f('0x30')][_0x233f('0x42')]){_0x1c5389[_0x233f('0x43')]=[{'all':!![]}];}_0x1c5389=_[_0x233f('0x3c')]({},_0x1c5389,_0x1b699e['options']);return db[_0x233f('0x41')][_0x233f('0x49')](_0x1c5389)['then'](handleEntityNotFound(_0xa6906b,null))[_0x233f('0x27')](respondWithResult(_0xa6906b,null))[_0x233f('0x4a')](handleError(_0xa6906b,null));};exports[_0x233f('0x4b')]=function(_0x4283da,_0x1d30d2){return db[_0x233f('0x41')][_0x233f('0x4b')](_0x4283da[_0x233f('0x4c')],{})[_0x233f('0x27')](respondWithResult(_0x1d30d2,0xc9))[_0x233f('0x4a')](handleError(_0x1d30d2,null));};exports[_0x233f('0x26')]=function(_0x4412ef,_0x18d12a){if(_0x4412ef['body']['id']){delete _0x4412ef['body']['id'];}return db['ChatTransferReport'][_0x233f('0x49')]({'where':{'id':_0x4412ef[_0x233f('0x47')]['id']}})[_0x233f('0x27')](handleEntityNotFound(_0x18d12a,null))[_0x233f('0x27')](saveUpdates(_0x4412ef[_0x233f('0x4c')],null))[_0x233f('0x27')](respondWithResult(_0x18d12a,null))[_0x233f('0x4a')](handleError(_0x18d12a,null));};exports[_0x233f('0x28')]=function(_0x34aaf0,_0x32eec8){return db[_0x233f('0x41')]['find']({'where':{'id':_0x34aaf0[_0x233f('0x47')]['id']}})[_0x233f('0x27')](handleEntityNotFound(_0x32eec8,null))[_0x233f('0x27')](removeEntity(_0x32eec8,null))[_0x233f('0x4a')](handleError(_0x32eec8,null));};exports[_0x233f('0x4d')]=function(_0x2d6231,_0x11c8c9){return db['ChatTransferReport'][_0x233f('0x4d')]()['then'](respondWithResult(_0x11c8c9,null))[_0x233f('0x4a')](handleError(_0x11c8c9,null));};
\ No newline at end of file
+var _0x70a5=['undefined','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','name','send','index','map','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','ChatTransferReport','findAll','rows','catch','params','create','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end'];(function(_0x5c20fd,_0x26463b){var _0x45cf09=function(_0x5294e9){while(--_0x5294e9){_0x5c20fd['push'](_0x5c20fd['shift']());}};_0x45cf09(++_0x26463b);}(_0x70a5,0x7b));var _0x570a=function(_0x1a6a02,_0x360521){_0x1a6a02=_0x1a6a02-0x0;var _0x34b1dc=_0x70a5[_0x1a6a02];return _0x34b1dc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x570a('0x0'));var zipdir=require(_0x570a('0x1'));var jsonpatch=require(_0x570a('0x2'));var rp=require(_0x570a('0x3'));var moment=require('moment');var BPromise=require(_0x570a('0x4'));var Mustache=require(_0x570a('0x5'));var util=require(_0x570a('0x6'));var path=require(_0x570a('0x7'));var sox=require(_0x570a('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x570a('0x9'));var _=require(_0x570a('0xa'));var squel=require('squel');var crypto=require(_0x570a('0xb'));var jsforce=require(_0x570a('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x570a('0xd'));var querystring=require(_0x570a('0xe'));var Papa=require(_0x570a('0xf'));var Redis=require(_0x570a('0x10'));var authService=require(_0x570a('0x11'));var qs=require(_0x570a('0x12'));var as=require(_0x570a('0x13'));var hardwareService=require(_0x570a('0x14'));var logger=require('../../config/logger')(_0x570a('0x15'));var utils=require(_0x570a('0x16'));var config=require(_0x570a('0x17'));var licenseUtil=require(_0x570a('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xcafb61,_0x1403d8){_0x1403d8=_0x1403d8||0xcc;return function(_0x1d02e8){if(_0x1d02e8){return _0xcafb61['sendStatus'](_0x1403d8);}return _0xcafb61[_0x570a('0x19')](_0x1403d8)[_0x570a('0x1a')]();};}function respondWithResult(_0x1ce01b,_0x164d2e){_0x164d2e=_0x164d2e||0xc8;return function(_0x34e875){if(_0x34e875){return _0x1ce01b[_0x570a('0x19')](_0x164d2e)['json'](_0x34e875);}};}function respondWithFilteredResult(_0x773978,_0xcc7610){return function(_0x2eaa1f){if(_0x2eaa1f){var _0x2dd5cd=typeof _0xcc7610['offset']===_0x570a('0x1b')&&typeof _0xcc7610['limit']===_0x570a('0x1b');var _0x1a3bc6=_0x2eaa1f[_0x570a('0x1c')];var _0x1d3d98=_0x2dd5cd?0x0:_0xcc7610[_0x570a('0x1d')];var _0x1a89f8=_0x2dd5cd?_0x2eaa1f[_0x570a('0x1c')]:_0xcc7610[_0x570a('0x1d')]+_0xcc7610['limit'];var _0x46a9ce;if(_0x1a89f8>=_0x1a3bc6){_0x1a89f8=_0x1a3bc6;_0x46a9ce=0xc8;}else{_0x46a9ce=0xce;}_0x773978[_0x570a('0x19')](_0x46a9ce);return _0x773978['set'](_0x570a('0x1e'),_0x1d3d98+'-'+_0x1a89f8+'/'+_0x1a3bc6)[_0x570a('0x1f')](_0x2eaa1f);}return null;};}function patchUpdates(_0x3761eb){return function(_0x3673ce){try{jsonpatch[_0x570a('0x20')](_0x3673ce,_0x3761eb,!![]);}catch(_0x2c5aa1){return BPromise[_0x570a('0x21')](_0x2c5aa1);}return _0x3673ce[_0x570a('0x22')]();};}function saveUpdates(_0x293544,_0x40e75b){return function(_0x7cb61e){if(_0x7cb61e){return _0x7cb61e[_0x570a('0x23')](_0x293544)[_0x570a('0x24')](function(_0x55a3d4){return _0x55a3d4;});}return null;};}function removeEntity(_0x525799,_0x594a25){return function(_0x5c90cf){if(_0x5c90cf){return _0x5c90cf[_0x570a('0x25')]()[_0x570a('0x24')](function(){_0x525799[_0x570a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x79aef3,_0x1e7750){return function(_0x11c1e5){if(!_0x11c1e5){_0x79aef3[_0x570a('0x26')](0x194);}return _0x11c1e5;};}function handleError(_0xf83502,_0xe66f2c){_0xe66f2c=_0xe66f2c||0x1f4;return function(_0x4e5f1a){logger['error'](_0x4e5f1a['stack']);if(_0x4e5f1a['name']){delete _0x4e5f1a[_0x570a('0x27')];}_0xf83502[_0x570a('0x19')](_0xe66f2c)[_0x570a('0x28')](_0x4e5f1a);};}exports[_0x570a('0x29')]=function(_0x49d087,_0x1248e0){var _0x32334a={},_0x340c80={},_0x42a866={'count':0x0,'rows':[]};var _0x925a2a=_[_0x570a('0x2a')](db['ChatTransferReport'][_0x570a('0x2b')],function(_0x1f0a76){return{'name':_0x1f0a76[_0x570a('0x2c')],'type':_0x1f0a76['type']['key']};});_0x340c80[_0x570a('0x2d')]=_[_0x570a('0x2a')](_0x925a2a,_0x570a('0x27'));_0x340c80['query']=_[_0x570a('0x2e')](_0x49d087[_0x570a('0x2f')]);_0x340c80[_0x570a('0x30')]=_[_0x570a('0x31')](_0x340c80['model'],_0x340c80[_0x570a('0x2f')]);_0x32334a[_0x570a('0x32')]=_[_0x570a('0x31')](_0x340c80[_0x570a('0x2d')],qs[_0x570a('0x33')](_0x49d087[_0x570a('0x2f')][_0x570a('0x33')]));_0x32334a[_0x570a('0x32')]=_0x32334a[_0x570a('0x32')][_0x570a('0x34')]?_0x32334a[_0x570a('0x32')]:_0x340c80[_0x570a('0x2d')];if(!_0x49d087[_0x570a('0x2f')]['hasOwnProperty'](_0x570a('0x35'))){_0x32334a[_0x570a('0x36')]=qs['limit'](_0x49d087[_0x570a('0x2f')][_0x570a('0x36')]);_0x32334a[_0x570a('0x1d')]=qs['offset'](_0x49d087[_0x570a('0x2f')][_0x570a('0x1d')]);}_0x32334a[_0x570a('0x37')]=qs[_0x570a('0x38')](_0x49d087[_0x570a('0x2f')]['sort']);_0x32334a[_0x570a('0x39')]=qs[_0x570a('0x30')](_[_0x570a('0x3a')](_0x49d087[_0x570a('0x2f')],_0x340c80[_0x570a('0x30')]),_0x925a2a);if(_0x49d087[_0x570a('0x2f')][_0x570a('0x3b')]){_0x32334a[_0x570a('0x39')]=_[_0x570a('0x3c')](_0x32334a['where'],{'$or':_['map'](_0x925a2a,function(_0x1da7c9){if(_0x1da7c9[_0x570a('0x3d')]!==_0x570a('0x3e')){var _0x459b30={};_0x459b30[_0x1da7c9[_0x570a('0x27')]]={'$like':'%'+_0x49d087[_0x570a('0x2f')][_0x570a('0x3b')]+'%'};return _0x459b30;}})});}_0x32334a=_[_0x570a('0x3c')]({},_0x32334a,_0x49d087[_0x570a('0x3f')]);var _0x15f05d={'where':_0x32334a['where']};return db['ChatTransferReport'][_0x570a('0x1c')](_0x15f05d)[_0x570a('0x24')](function(_0x1c45a8){_0x42a866[_0x570a('0x1c')]=_0x1c45a8;if(_0x49d087[_0x570a('0x2f')][_0x570a('0x40')]){_0x32334a[_0x570a('0x41')]=[{'all':!![]}];}return db[_0x570a('0x42')][_0x570a('0x43')](_0x32334a);})[_0x570a('0x24')](function(_0xc532e1){_0x42a866[_0x570a('0x44')]=_0xc532e1;return _0x42a866;})[_0x570a('0x24')](respondWithFilteredResult(_0x1248e0,_0x32334a))[_0x570a('0x45')](handleError(_0x1248e0,null));};exports['show']=function(_0x3605c2,_0x4de68f){var _0x1a5a22={'raw':!![],'where':{'id':_0x3605c2[_0x570a('0x46')]['id']}},_0x2c4717={};_0x2c4717[_0x570a('0x2d')]=_[_0x570a('0x2e')](db[_0x570a('0x42')][_0x570a('0x2b')]);_0x2c4717[_0x570a('0x2f')]=_['keys'](_0x3605c2['query']);_0x2c4717['filters']=_[_0x570a('0x31')](_0x2c4717[_0x570a('0x2d')],_0x2c4717[_0x570a('0x2f')]);_0x1a5a22[_0x570a('0x32')]=_['intersection'](_0x2c4717[_0x570a('0x2d')],qs[_0x570a('0x33')](_0x3605c2['query'][_0x570a('0x33')]));_0x1a5a22[_0x570a('0x32')]=_0x1a5a22[_0x570a('0x32')][_0x570a('0x34')]?_0x1a5a22[_0x570a('0x32')]:_0x2c4717[_0x570a('0x2d')];if(_0x3605c2[_0x570a('0x2f')][_0x570a('0x40')]){_0x1a5a22[_0x570a('0x41')]=[{'all':!![]}];}_0x1a5a22=_[_0x570a('0x3c')]({},_0x1a5a22,_0x3605c2[_0x570a('0x3f')]);return db['ChatTransferReport']['find'](_0x1a5a22)[_0x570a('0x24')](handleEntityNotFound(_0x4de68f,null))['then'](respondWithResult(_0x4de68f,null))[_0x570a('0x45')](handleError(_0x4de68f,null));};exports[_0x570a('0x47')]=function(_0x310210,_0x3f6e40){return db[_0x570a('0x42')][_0x570a('0x47')](_0x310210['body'],{})[_0x570a('0x24')](respondWithResult(_0x3f6e40,0xc9))[_0x570a('0x45')](handleError(_0x3f6e40,null));};exports[_0x570a('0x23')]=function(_0x132b4d,_0x4598df){if(_0x132b4d[_0x570a('0x48')]['id']){delete _0x132b4d['body']['id'];}return db['ChatTransferReport'][_0x570a('0x49')]({'where':{'id':_0x132b4d[_0x570a('0x46')]['id']}})[_0x570a('0x24')](handleEntityNotFound(_0x4598df,null))[_0x570a('0x24')](saveUpdates(_0x132b4d[_0x570a('0x48')],null))[_0x570a('0x24')](respondWithResult(_0x4598df,null))[_0x570a('0x45')](handleError(_0x4598df,null));};exports[_0x570a('0x25')]=function(_0x35749,_0x392711){return db[_0x570a('0x42')][_0x570a('0x49')]({'where':{'id':_0x35749[_0x570a('0x46')]['id']}})[_0x570a('0x24')](handleEntityNotFound(_0x392711,null))[_0x570a('0x24')](removeEntity(_0x392711,null))[_0x570a('0x45')](handleError(_0x392711,null));};exports['describe']=function(_0x3865fc,_0x115682){return db[_0x570a('0x42')][_0x570a('0x4a')]()[_0x570a('0x24')](respondWithResult(_0x115682,null))['catch'](handleError(_0x115682,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 4d01206..798bd02 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 _0x24c0=['ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','./chatTransferReport.attributes','exports'];(function(_0x104b8e,_0x5729ba){var _0x4e9575=function(_0x394d0c){while(--_0x394d0c){_0x104b8e['push'](_0x104b8e['shift']());}};_0x4e9575(++_0x5729ba);}(_0x24c0,0x7b));var _0x024c=function(_0x30fc1f,_0x56890f){_0x30fc1f=_0x30fc1f-0x0;var _0x5b25ff=_0x24c0[_0x30fc1f];return _0x5b25ff;};'use strict';var _=require(_0x024c('0x0'));var util=require(_0x024c('0x1'));var logger=require(_0x024c('0x2'))(_0x024c('0x3'));var moment=require(_0x024c('0x4'));var BPromise=require(_0x024c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x024c('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x024c('0x7'));module[_0x024c('0x8')]=function(_0x3395a3,_0x15617){return _0x3395a3['define'](_0x024c('0x9'),attributes,{'tableName':_0x024c('0xa'),'paranoid':![],'indexes':[{'name':_0x024c('0xb'),'fields':[_0x024c('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xa0f9=['path','rimraf','../../config/environment','./chatTransferReport.attributes','define','uniqueid','lodash','util','../../config/logger','api','bluebird'];(function(_0x3899d1,_0x4aa04c){var _0xeb4a7d=function(_0x3ea5ee){while(--_0x3ea5ee){_0x3899d1['push'](_0x3899d1['shift']());}};_0xeb4a7d(++_0x4aa04c);}(_0xa0f9,0x12f));var _0x9a0f=function(_0x3aadde,_0x50f23f){_0x3aadde=_0x3aadde-0x0;var _0x21df4e=_0xa0f9[_0x3aadde];return _0x21df4e;};'use strict';var _=require(_0x9a0f('0x0'));var util=require(_0x9a0f('0x1'));var logger=require(_0x9a0f('0x2'))(_0x9a0f('0x3'));var moment=require('moment');var BPromise=require(_0x9a0f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9a0f('0x5'));var rimraf=require(_0x9a0f('0x6'));var config=require(_0x9a0f('0x7'));var attributes=require(_0x9a0f('0x8'));module['exports']=function(_0x1690b8,_0x4e70bf){return _0x1690b8[_0x9a0f('0x9')]('ChatTransferReport',attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x9a0f('0xa'),'fields':[_0x9a0f('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index b893644..73b93a8 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 _0x32a6=['client','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x23a0db,_0x67ef5a){var _0x1b3e1f=function(_0xc15843){while(--_0xc15843){_0x23a0db['push'](_0x23a0db['shift']());}};_0x1b3e1f(++_0x67ef5a);}(_0x32a6,0x113));var _0x632a=function(_0x402231,_0x46a48b){_0x402231=_0x402231-0x0;var _0x208268=_0x32a6[_0x402231];return _0x208268;};'use strict';var _=require(_0x632a('0x0'));var util=require(_0x632a('0x1'));var moment=require('moment');var BPromise=require(_0x632a('0x2'));var rs=require(_0x632a('0x3'));var fs=require('fs');var Redis=require(_0x632a('0x4'));var db=require(_0x632a('0x5'))['db'];var utils=require(_0x632a('0x6'));var logger=require(_0x632a('0x7'))(_0x632a('0x8'));var config=require(_0x632a('0x9'));var jayson=require(_0x632a('0xa'));var client=jayson[_0x632a('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x34fb2a,_0x3ae652,_0x1cd592){return new BPromise(function(_0x3a3193,_0xc55839){return client[_0x632a('0xc')](_0x34fb2a,_0x1cd592)[_0x632a('0xd')](function(_0x3ef1f5){logger[_0x632a('0xe')](_0x632a('0xf'),_0x3ae652,_0x632a('0x10'));logger[_0x632a('0x11')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x3ae652,_0x632a('0x10'),JSON[_0x632a('0x12')](_0x3ef1f5));if(_0x3ef1f5[_0x632a('0x13')]){if(_0x3ef1f5[_0x632a('0x13')][_0x632a('0x14')]===0x1f4){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x3ae652,_0x3ef1f5[_0x632a('0x13')]['message']);return _0xc55839(_0x3ef1f5['error']['message']);}logger[_0x632a('0x13')](_0x632a('0xf'),_0x3ae652,_0x3ef1f5[_0x632a('0x13')][_0x632a('0x15')]);return _0x3a3193(_0x3ef1f5[_0x632a('0x13')][_0x632a('0x15')]);}else{logger[_0x632a('0xe')](_0x632a('0xf'),_0x3ae652,_0x632a('0x10'));_0x3a3193(_0x3ef1f5['result'][_0x632a('0x15')]);}})['catch'](function(_0x21321e){logger[_0x632a('0x13')]('ChatTransferReport,\x20%s,\x20%s',_0x3ae652,_0x21321e);_0xc55839(_0x21321e);});});}
\ No newline at end of file
+var _0x374b=['request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','ChatTransferReport,\x20%s,\x20%s'];(function(_0x77bffe,_0x5d9e28){var _0x220405=function(_0x450b9a){while(--_0x450b9a){_0x77bffe['push'](_0x77bffe['shift']());}};_0x220405(++_0x5d9e28);}(_0x374b,0xe6));var _0xb374=function(_0x51ae60,_0x6dd534){_0x51ae60=_0x51ae60-0x0;var _0x3154e4=_0x374b[_0x51ae60];return _0x3154e4;};'use strict';var _=require(_0xb374('0x0'));var util=require(_0xb374('0x1'));var moment=require('moment');var BPromise=require(_0xb374('0x2'));var rs=require(_0xb374('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb374('0x4'))['db'];var utils=require(_0xb374('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xb374('0x6'));var jayson=require(_0xb374('0x7'));var client=jayson[_0xb374('0x8')][_0xb374('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f900b,_0x6104c2,_0xea72ad){return new BPromise(function(_0x4c3c6a,_0x19f135){return client['request'](_0x2f900b,_0xea72ad)[_0xb374('0xa')](function(_0x5889ba){logger['info'](_0xb374('0xb'),_0x6104c2,_0xb374('0xc'));logger[_0xb374('0xd')](_0xb374('0xe'),_0x6104c2,'request\x20sent',JSON[_0xb374('0xf')](_0x5889ba));if(_0x5889ba[_0xb374('0x10')]){if(_0x5889ba[_0xb374('0x10')][_0xb374('0x11')]===0x1f4){logger[_0xb374('0x10')](_0xb374('0xb'),_0x6104c2,_0x5889ba['error']['message']);return _0x19f135(_0x5889ba[_0xb374('0x10')][_0xb374('0x12')]);}logger['error'](_0xb374('0xb'),_0x6104c2,_0x5889ba[_0xb374('0x10')][_0xb374('0x12')]);return _0x4c3c6a(_0x5889ba[_0xb374('0x10')]['message']);}else{logger[_0xb374('0x13')](_0xb374('0xb'),_0x6104c2,_0xb374('0xc'));_0x4c3c6a(_0x5889ba[_0xb374('0x14')][_0xb374('0x12')]);}})[_0xb374('0x15')](function(_0x211e0a){logger[_0xb374('0x10')](_0xb374('0xb'),_0x6104c2,_0x211e0a);_0x19f135(_0x211e0a);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index a0e8110..d43eac1 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 _0x7fe3=['create','put','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','describe','/:id','post'];(function(_0xa522f,_0x5debbc){var _0x2083b0=function(_0x288f01){while(--_0x288f01){_0xa522f['push'](_0xa522f['shift']());}};_0x2083b0(++_0x5debbc);}(_0x7fe3,0x1bd));var _0x37fe=function(_0x2f197f,_0x521749){_0x2f197f=_0x2f197f-0x0;var _0x540fce=_0x7fe3[_0x2f197f];return _0x540fce;};'use strict';var multer=require(_0x37fe('0x0'));var util=require(_0x37fe('0x1'));var path=require(_0x37fe('0x2'));var timeout=require('connect-timeout');var express=require(_0x37fe('0x3'));var router=express[_0x37fe('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x37fe('0x5'));var interaction=require(_0x37fe('0x6'));var config=require(_0x37fe('0x7'));var controller=require(_0x37fe('0x8'));router[_0x37fe('0x9')]('/',auth[_0x37fe('0xa')](),controller[_0x37fe('0xb')]);router[_0x37fe('0x9')]('/describe',auth[_0x37fe('0xa')](),controller[_0x37fe('0xc')]);router['get'](_0x37fe('0xd'),auth[_0x37fe('0xa')](),controller['show']);router[_0x37fe('0xe')]('/',auth[_0x37fe('0xa')](),controller[_0x37fe('0xf')]);router[_0x37fe('0x10')](_0x37fe('0xd'),auth[_0x37fe('0xa')](),controller['update']);router[_0x37fe('0x11')](_0x37fe('0xd'),auth['isAuthenticated'](),controller[_0x37fe('0x12')]);module[_0x37fe('0x13')]=router;
\ No newline at end of file
+var _0xd66c=['/describe','show','post','create','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatTransferReport.controller','isAuthenticated','index','get'];(function(_0x1f318d,_0x597fff){var _0x58a8f1=function(_0x262878){while(--_0x262878){_0x1f318d['push'](_0x1f318d['shift']());}};_0x58a8f1(++_0x597fff);}(_0xd66c,0x1d7));var _0xcd66=function(_0x45025f,_0x503c8f){_0x45025f=_0x45025f-0x0;var _0x422107=_0xd66c[_0x45025f];return _0x422107;};'use strict';var multer=require(_0xcd66('0x0'));var util=require(_0xcd66('0x1'));var path=require(_0xcd66('0x2'));var timeout=require(_0xcd66('0x3'));var express=require(_0xcd66('0x4'));var router=express[_0xcd66('0x5')]();var fs_extra=require(_0xcd66('0x6'));var auth=require(_0xcd66('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xcd66('0x8'));var controller=require(_0xcd66('0x9'));router['get']('/',auth[_0xcd66('0xa')](),controller[_0xcd66('0xb')]);router[_0xcd66('0xc')](_0xcd66('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0xcd66('0xc')]('/:id',auth[_0xcd66('0xa')](),controller[_0xcd66('0xe')]);router[_0xcd66('0xf')]('/',auth[_0xcd66('0xa')](),controller[_0xcd66('0x10')]);router['put'](_0xcd66('0x11'),auth['isAuthenticated'](),controller[_0xcd66('0x12')]);router[_0xcd66('0x13')](_0xcd66('0x11'),auth[_0xcd66('0xa')](),controller[_0xcd66('0x14')]);module[_0xcd66('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 fda23df..59e73b6 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 _0xb58b=['alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','STRING','address','email','#011F6A','#ffffff','INTEGER','ENUM','squared','rounded','We\x20are\x20here!','Chat','Contact\x20us','BOOLEAN','TEXT','Form\x20properly\x20submitted','Type\x20a\x20message','Skip','star','thumb','stringify','input','name','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','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:','Send','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT'];(function(_0x46c5db,_0xb68a07){var _0x3b6b37=function(_0x286424){while(--_0x286424){_0x46c5db['push'](_0x46c5db['shift']());}};_0x3b6b37(++_0xb68a07);}(_0xb58b,0x1f1));var _0xbb58=function(_0x409b7b,_0x1d5585){_0x409b7b=_0x409b7b-0x0;var _0x57eb7c=_0xb58b[_0x409b7b];return _0x57eb7c;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xbb58('0x0'));module[_0xbb58('0x1')]={'name':{'type':Sequelize[_0xbb58('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xbb58('0x3')},'description':{'type':Sequelize[_0xbb58('0x2')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xbb58('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0xbb58('0x4')},'key':{'type':Sequelize[_0xbb58('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xbb58('0x2')],'allowNull':![],'defaultValue':_0xbb58('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xbb58('0x2')],'allowNull':![],'defaultValue':_0xbb58('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xbb58('0x2')],'allowNull':![],'defaultValue':_0xbb58('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xbb58('0x2')],'allowNull':![],'defaultValue':_0xbb58('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xbb58('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xbb58('0x2')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xbb58('0x8')]('rounded',_0xbb58('0x9')),'defaultValue':_0xbb58('0xa')},'header_online':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':_0xbb58('0xb')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xbb58('0xc')},'offline_chat_button':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':_0xbb58('0xd')},'download_transcript':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xbb58('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xbb58('0xf')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':_0xbb58('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0xbb58('0x11')},'closingMessage':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':_0xbb58('0x12')},'conditionAgreement':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0xbb58('0x8')](_0xbb58('0x13'),_0xbb58('0x14')),'defaultValue':_0xbb58('0x13')},'ratingStarsNumber':{'type':Sequelize[_0xbb58('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xbb58('0xf')],'defaultValue':function(){return JSON[_0xbb58('0x15')]({'items':[{'type':_0xbb58('0x16'),'variable':null,'config':{'placeholder':_0xbb58('0x17'),'type':'text','required':!![]},'props':{'title':_0xbb58('0x17'),'helpText':''}},{'type':'input','props':{'title':_0xbb58('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xbb58('0x4'),'type':_0xbb58('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xbb58('0x18')](_0xbb58('0x19'))?JSON[_0xbb58('0x1a')](this[_0xbb58('0x18')](_0xbb58('0x19'))):{};},'set':function(_0x4e0303){return this[_0xbb58('0x1b')](_0xbb58('0x19'),JSON[_0xbb58('0x15')](_0x4e0303));}},'offlineForm':{'type':Sequelize[_0xbb58('0xf')],'defaultValue':function(){return JSON[_0xbb58('0x15')]({'items':[{'type':_0xbb58('0x16'),'props':{'title':_0xbb58('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xbb58('0x4'),'type':_0xbb58('0x4')},'variable':null},{'type':_0xbb58('0x1c'),'config':{'placeholder':_0xbb58('0x1d')},'props':{'title':_0xbb58('0x1d'),'helpText':_0xbb58('0x1e')}}],'fromKey':0x0});},'get':function(){return this[_0xbb58('0x18')](_0xbb58('0x1f'))?JSON['parse'](this[_0xbb58('0x18')](_0xbb58('0x1f'))):{};},'set':function(_0x12b3eb){return this[_0xbb58('0x1b')](_0xbb58('0x1f'),JSON[_0xbb58('0x15')](_0x12b3eb));}},'token':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':function(){return rs[_0xbb58('0x20')]();}},'autoclose':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xbb58('0x2')]},'forwardOffline':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xbb58('0x2')]},'waitingTitle':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':_0xbb58('0x21')},'waitingMessage':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':_0xbb58('0x22')},'offlineMessageSubject':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':_0xbb58('0x23')},'offlineMessageBody':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':_0xbb58('0x24')},'enableUnmanagedNote':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xbb58('0x12')},'sendUnmanaged':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':_0xbb58('0x25')},'enableCustomerAttachment':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xbb58('0xf')]},'showAgentAvatar':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xbb58('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xbb58('0x26');}},'notificationSound':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0xbb58('0x27')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':_0xbb58('0x28')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':_0xbb58('0x29')},'messagesAlignment':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':_0xbb58('0x2a')},'defaultTitle':{'type':Sequelize[_0xbb58('0x2')]},'customerAvatar':{'type':Sequelize[_0xbb58('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xbb58('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbb58('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xbb58('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0xbb58('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbb58('0x7')],'comment':_0xbb58('0x2c')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0xc29171){if(!_0xc29171)this[_0xbb58('0x1b')](_0xbb58('0x2d'),null);this[_0xbb58('0x1b')](_0xbb58('0x2e'),_0xc29171);}},'vidaooEscalation':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0xbb58('0x2')],'allowNull':![],'defaultValue':_0xbb58('0x2f')},'vidaooNote':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':function(){return _0xbb58('0x30');}},'vidaooMetadata':{'type':Sequelize[_0xbb58('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x9bde=['setDataValue','stringify','textarea','Comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','Send','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','alternate','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}}','randomstring','STRING','address','email','Agent','#011F6A','#ffffff','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Feedback','star','thumb','INTEGER','input','text','name','getDataValue','onlineForm','parse'];(function(_0x520085,_0x5d83ef){var _0x5da934=function(_0x242468){while(--_0x242468){_0x520085['push'](_0x520085['shift']());}};_0x5da934(++_0x5d83ef);}(_0x9bde,0xe1));var _0xe9bd=function(_0x2510e8,_0x49b9e1){_0x2510e8=_0x2510e8-0x0;var _0x56f17e=_0x9bde[_0x2510e8];return _0x56f17e;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xe9bd('0x0'));module['exports']={'name':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xe9bd('0x2')},'description':{'type':Sequelize[_0xe9bd('0x1')]},'mapKey':{'type':Sequelize[_0xe9bd('0x1')],'defaultValue':_0xe9bd('0x3')},'mapKeyOffline':{'type':Sequelize[_0xe9bd('0x1')],'defaultValue':_0xe9bd('0x3')},'key':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xe9bd('0x4')},'customerAlias':{'type':Sequelize[_0xe9bd('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![],'defaultValue':_0xe9bd('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![],'defaultValue':_0xe9bd('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![],'defaultValue':_0xe9bd('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![],'defaultValue':_0xe9bd('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xe9bd('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xe9bd('0x8')](_0xe9bd('0x9'),'squared'),'defaultValue':_0xe9bd('0x9')},'header_online':{'type':Sequelize[_0xe9bd('0x1')],'defaultValue':_0xe9bd('0xa')},'start_chat_button':{'type':Sequelize[_0xe9bd('0x1')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0xe9bd('0x1')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0xe9bd('0x1')],'defaultValue':_0xe9bd('0xb')},'download_transcript':{'type':Sequelize[_0xe9bd('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0xe9bd('0xc')},'defaultWhiteLabel':{'type':Sequelize[_0xe9bd('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xe9bd('0xd')]},'closingQuestion':{'type':Sequelize[_0xe9bd('0x1')],'defaultValue':_0xe9bd('0xe')},'formSubmitSuccessMessage':{'type':Sequelize[_0xe9bd('0x1')],'defaultValue':_0xe9bd('0xf')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0xe9bd('0x10')},'noteTitle':{'type':Sequelize[_0xe9bd('0x1')],'defaultValue':_0xe9bd('0x11')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0xe9bd('0x12')},'closingMessage':{'type':Sequelize[_0xe9bd('0x1')],'defaultValue':_0xe9bd('0x13')},'closingMessageButton':{'type':Sequelize[_0xe9bd('0x1')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0xe9bd('0x1')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0xe9bd('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xe9bd('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xe9bd('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xe9bd('0x1')],'defaultValue':_0xe9bd('0x14')},'ratingType':{'type':Sequelize[_0xe9bd('0x8')](_0xe9bd('0x15'),_0xe9bd('0x16')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xe9bd('0x17')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xe9bd('0xd')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xe9bd('0x18'),'variable':null,'config':{'placeholder':'name','type':_0xe9bd('0x19'),'required':!![]},'props':{'title':_0xe9bd('0x1a'),'helpText':''}},{'type':_0xe9bd('0x18'),'props':{'title':_0xe9bd('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xe9bd('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xe9bd('0x1b')](_0xe9bd('0x1c'))?JSON[_0xe9bd('0x1d')](this[_0xe9bd('0x1b')](_0xe9bd('0x1c'))):{};},'set':function(_0x399f3c){return this[_0xe9bd('0x1e')](_0xe9bd('0x1c'),JSON['stringify'](_0x399f3c));}},'offlineForm':{'type':Sequelize[_0xe9bd('0xd')],'defaultValue':function(){return JSON[_0xe9bd('0x1f')]({'items':[{'type':'input','props':{'title':_0xe9bd('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xe9bd('0x3'),'type':_0xe9bd('0x3')},'variable':null},{'type':_0xe9bd('0x20'),'config':{'placeholder':_0xe9bd('0x21')},'props':{'title':_0xe9bd('0x21'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0xe9bd('0x22'))?JSON['parse'](this[_0xe9bd('0x1b')](_0xe9bd('0x22'))):{};},'set':function(_0x27f80c){return this[_0xe9bd('0x1e')](_0xe9bd('0x22'),JSON['stringify'](_0x27f80c));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xe9bd('0x23')]();}},'autoclose':{'type':Sequelize[_0xe9bd('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xe9bd('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xe9bd('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xe9bd('0x1')]},'forwardOffline':{'type':Sequelize[_0xe9bd('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xe9bd('0x1')]},'waitingTitle':{'type':Sequelize[_0xe9bd('0x1')],'defaultValue':_0xe9bd('0x24')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xe9bd('0x25')},'offlineMessageSubject':{'type':Sequelize[_0xe9bd('0x1')],'defaultValue':_0xe9bd('0x26')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xe9bd('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xe9bd('0x1')],'defaultValue':_0xe9bd('0x27')},'skipUnmanaged':{'type':Sequelize[_0xe9bd('0x1')],'defaultValue':_0xe9bd('0x28')},'sendUnmanaged':{'type':Sequelize[_0xe9bd('0x1')],'defaultValue':_0xe9bd('0x29')},'enableCustomerAttachment':{'type':Sequelize[_0xe9bd('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xe9bd('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xe9bd('0xd')]},'showAgentAvatar':{'type':Sequelize[_0xe9bd('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xe9bd('0x1')]},'notificationTemplate':{'type':Sequelize[_0xe9bd('0xd')],'defaultValue':function(){return _0xe9bd('0x2a');}},'notificationSound':{'type':Sequelize[_0xe9bd('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xe9bd('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xe9bd('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xe9bd('0x1')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xe9bd('0x17')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xe9bd('0x1')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0xe9bd('0x17')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xe9bd('0x1')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xe9bd('0x2b')},'defaultTitle':{'type':Sequelize[_0xe9bd('0x1')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0xe9bd('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xe9bd('0x17')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xe9bd('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe9bd('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe9bd('0x17')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xe9bd('0x1')],'defaultValue':_0xe9bd('0x2c')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe9bd('0x17')],'comment':_0xe9bd('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0xe9bd('0x7')],'defaultValue':![],'comment':_0xe9bd('0x2e'),'set':function(_0x253359){if(!_0x253359)this[_0xe9bd('0x1e')](_0xe9bd('0x2f'),null);this[_0xe9bd('0x1e')](_0xe9bd('0x30'),_0x253359);}},'vidaooEscalation':{'type':Sequelize[_0xe9bd('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xe9bd('0x31')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xe9bd('0x32');}},'vidaooMetadata':{'type':Sequelize[_0xe9bd('0xd')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xe9bd('0x7')],'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 aa968f2..3273bd1 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 _0xa530=['increment','all','some','URL','origin','3.1.0','x-real-ip','connection','remoteAddress','replace','alignment','verticalAlignment','textColor','color_button','hideWhenOffline','IntervalId','READ_COMMITTED','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getProactiveActions','getFields','online','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachment','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','mustache','util','path','ejs','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','url','../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','html-to-text','jayson/promise','client','http','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','update','destroy','get','stack','name','send','index','Pause','map','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','ChatWebsite','includeAll','include','findAll','rows','show','params','mandatoryDispositionPause','rawAttributes','find','create','body','user','ChatWebsites','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','describe','addDisposition','Disposition','getDispositions','findOne','ChatWebsiteId','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','sitepic','agentAvatar','addCustomerAvatar','filename','addSystemAvatar','systemAvatar','file','getLogo','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','join','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','headers','user-agent','getResult','chat','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','CompanyId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','Contacts','updatedAt','DESC','ChatApplication','Applications','List','account','applications','list','priority','asc','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','format','%s\x20%s','version','unknown','device','vendor','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','push','unmanaged','ChatMessage','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','offline','ListId','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','ChatOfflineMessage','fromString','originalname','server','files','attachments','offline-chat','basename','sequelize','transaction','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','mimetype','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','../../config/license/util','virtual','License'];(function(_0x2171c4,_0x3e59c8){var _0x9bed4e=function(_0x568206){while(--_0x568206){_0x2171c4['push'](_0x2171c4['shift']());}};_0x9bed4e(++_0x3e59c8);}(_0xa530,0x150));var _0x0a53=function(_0x3640e2,_0x562103){_0x3640e2=_0x3640e2-0x0;var _0x277415=_0xa530[_0x3640e2];return _0x277415;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0x0a53('0x0'));var util=require(_0x0a53('0x1'));var path=require(_0x0a53('0x2'));var ejs=require(_0x0a53('0x3'));var fs=require('fs');var fs_extra=require(_0x0a53('0x4'));var _=require(_0x0a53('0x5'));var querystring=require(_0x0a53('0x6'));var Redis=require(_0x0a53('0x7'));var qs=require(_0x0a53('0x8'));var logger=require(_0x0a53('0x9'))('api');var config=require('../../config/environment');var url=require(_0x0a53('0xa'));var db=require(_0x0a53('0xb'))['db'];config[_0x0a53('0xc')]=_[_0x0a53('0xd')](config[_0x0a53('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x0a53('0xe'))(new Redis(config[_0x0a53('0xc')]));require(_0x0a53('0xf'))['register'](socket);var htmlToText=require(_0x0a53('0x10'));var jayson=require(_0x0a53('0x11'));var client=jayson[_0x0a53('0x12')][_0x0a53('0x13')]({'port':0x232c});var client9002=jayson[_0x0a53('0x12')][_0x0a53('0x13')]({'port':0x232a});var client9003=jayson['client'][_0x0a53('0x13')]({'port':0x232b});var client9001=jayson['client'][_0x0a53('0x13')]({'port':0x2329});function respondWithRpcPromise(_0x2f2878,_0x3dd1f2,_0x320b63,_0x2d6c2c){return new BPromise(function(_0x1597d1,_0x12cd83){var _0x42acca=_0x2d6c2c||client;return _0x42acca['request'](_0x2f2878,_0x320b63)[_0x0a53('0x14')](function(_0x6a5c04){logger['info'](_0x0a53('0x15'),_0x3dd1f2,_0x0a53('0x16'));logger['debug'](_0x0a53('0x17'),_0x3dd1f2,'request\x20sent',JSON['stringify'](_0x6a5c04));if(_0x6a5c04[_0x0a53('0x18')]){if(_0x6a5c04[_0x0a53('0x18')][_0x0a53('0x19')]===0x1f4){logger[_0x0a53('0x18')](_0x0a53('0x15'),_0x3dd1f2,_0x6a5c04[_0x0a53('0x18')][_0x0a53('0x1a')]);return _0x12cd83(_0x6a5c04[_0x0a53('0x18')][_0x0a53('0x1a')]);}logger[_0x0a53('0x18')](_0x0a53('0x15'),_0x3dd1f2,_0x6a5c04['error'][_0x0a53('0x1a')]);return _0x1597d1(_0x6a5c04[_0x0a53('0x18')][_0x0a53('0x1a')]);}else{logger[_0x0a53('0x1b')](_0x0a53('0x15'),_0x3dd1f2,_0x0a53('0x16'));_0x1597d1(_0x6a5c04[_0x0a53('0x1c')][_0x0a53('0x1a')]);}})[_0x0a53('0x1d')](function(_0x4b5172){logger[_0x0a53('0x18')](_0x0a53('0x15'),_0x3dd1f2,_0x4b5172);_0x12cd83(_0x4b5172);});});}function respondWithStatusCode(_0x2d46de,_0x233b33){_0x233b33=_0x233b33||0xcc;return function(_0x440ba8){if(_0x440ba8){return _0x2d46de[_0x0a53('0x1e')](_0x233b33);}return _0x2d46de[_0x0a53('0x1f')](_0x233b33)[_0x0a53('0x20')]();};}function respondWithResult(_0x1b88bd,_0xc2917d){_0xc2917d=_0xc2917d||0xc8;return function(_0x3ffc52){if(_0x3ffc52){return _0x1b88bd[_0x0a53('0x1f')](_0xc2917d)[_0x0a53('0x21')](_0x3ffc52);}};}function respondWithFilteredResult(_0x1aacaf,_0x29fa2a){return function(_0x250713){if(_0x250713){var _0x5854f8=typeof _0x29fa2a['offset']==='undefined'&&typeof _0x29fa2a[_0x0a53('0x22')]===_0x0a53('0x23');var _0x38dfa2=_0x250713['count'];var _0x57c1f8=_0x5854f8?0x0:_0x29fa2a['offset'];var _0x4d99a6=_0x5854f8?_0x250713[_0x0a53('0x24')]:_0x29fa2a[_0x0a53('0x25')]+_0x29fa2a[_0x0a53('0x22')];var _0x465417;if(_0x4d99a6>=_0x38dfa2){_0x4d99a6=_0x38dfa2;_0x465417=0xc8;}else{_0x465417=0xce;}_0x1aacaf[_0x0a53('0x1f')](_0x465417);return _0x1aacaf[_0x0a53('0x26')](_0x0a53('0x27'),_0x57c1f8+'-'+_0x4d99a6+'/'+_0x38dfa2)[_0x0a53('0x21')](_0x250713);}return null;};}function saveUpdates(_0x4396a2){return function(_0x500a91){if(_0x500a91){return _0x500a91[_0x0a53('0x28')](_0x4396a2)['then'](function(_0x422b0f){return _0x422b0f;});}return null;};}function removeEntity(_0x271bd8){return function(_0x5b456a){if(_0x5b456a){return _0x5b456a[_0x0a53('0x29')]()[_0x0a53('0x14')](function(){var _0x111058=_0x5b456a[_0x0a53('0x2a')]({'plain':!![]});var _0x4f5135='ChatWebsites';return db['UserProfileResource'][_0x0a53('0x29')]({'where':{'type':_0x4f5135,'resourceId':_0x111058['id']}})['then'](function(){return _0x5b456a;});})[_0x0a53('0x14')](function(){_0x271bd8['status'](0xcc)[_0x0a53('0x20')]();});}};}function handleEntityNotFound(_0x5aff73){return function(_0x4010a6){if(!_0x4010a6){_0x5aff73['sendStatus'](0x194);}return _0x4010a6;};}function handleError(_0x1e33c3,_0x2c6d25){_0x2c6d25=_0x2c6d25||0x1f4;return function(_0x3c98f5){logger['error'](_0x3c98f5[_0x0a53('0x2b')]);if(_0x3c98f5[_0x0a53('0x2c')]){delete _0x3c98f5['name'];}_0x1e33c3[_0x0a53('0x1f')](_0x2c6d25)[_0x0a53('0x2d')](_0x3c98f5);};}exports[_0x0a53('0x2e')]=function(_0x14c600,_0x20f7c1){var _0xc1a6b6={'include':[{'model':db[_0x0a53('0x2f')],'as':'mandatoryDispositionPause'}]},_0xc5cb20={},_0x5745ae={'count':0x0,'rows':[]};var _0x46193b=_[_0x0a53('0x30')](db['ChatWebsite']['rawAttributes'],function(_0x2cf6d5){return{'name':_0x2cf6d5[_0x0a53('0x31')],'type':_0x2cf6d5[_0x0a53('0x32')]['key']};});_0xc5cb20[_0x0a53('0x33')]=_['map'](_0x46193b,_0x0a53('0x2c'));_0xc5cb20[_0x0a53('0x34')]=_[_0x0a53('0x35')](_0x14c600['query']);_0xc5cb20[_0x0a53('0x36')]=_['intersection'](_0xc5cb20[_0x0a53('0x33')],_0xc5cb20[_0x0a53('0x34')]);_0xc1a6b6[_0x0a53('0x37')]=_[_0x0a53('0x38')](_0xc5cb20[_0x0a53('0x33')],qs['fields'](_0x14c600['query'][_0x0a53('0x39')]));_0xc1a6b6[_0x0a53('0x37')]=_0xc1a6b6[_0x0a53('0x37')][_0x0a53('0x3a')]?_0xc1a6b6[_0x0a53('0x37')]:_0xc5cb20['model'];if(!_0x14c600[_0x0a53('0x34')][_0x0a53('0x3b')](_0x0a53('0x3c'))){_0xc1a6b6[_0x0a53('0x22')]=qs[_0x0a53('0x22')](_0x14c600[_0x0a53('0x34')][_0x0a53('0x22')]);_0xc1a6b6[_0x0a53('0x25')]=qs[_0x0a53('0x25')](_0x14c600[_0x0a53('0x34')]['offset']);}_0xc1a6b6[_0x0a53('0x3d')]=qs['sort'](_0x14c600[_0x0a53('0x34')][_0x0a53('0x3e')]);_0xc1a6b6[_0x0a53('0x3f')]=qs[_0x0a53('0x36')](_[_0x0a53('0x40')](_0x14c600[_0x0a53('0x34')],_0xc5cb20[_0x0a53('0x36')]),_0x46193b);if(_0x14c600[_0x0a53('0x34')][_0x0a53('0x41')]){_0xc1a6b6[_0x0a53('0x3f')]=_[_0x0a53('0x42')](_0xc1a6b6[_0x0a53('0x3f')],{'$or':_[_0x0a53('0x30')](_0x46193b,function(_0x467da6){if(_0x467da6[_0x0a53('0x32')]!=='VIRTUAL'){var _0x2013fa={};_0x2013fa[_0x467da6['name']]={'$like':'%'+_0x14c600[_0x0a53('0x34')][_0x0a53('0x41')]+'%'};return _0x2013fa;}})});}_0xc1a6b6=_[_0x0a53('0x42')]({},_0xc1a6b6,_0x14c600[_0x0a53('0x43')]);var _0x36b851={'where':_0xc1a6b6[_0x0a53('0x3f')]};return db[_0x0a53('0x44')]['count'](_0x36b851)[_0x0a53('0x14')](function(_0xf38e94){_0x5745ae[_0x0a53('0x24')]=_0xf38e94;if(_0x14c600['query'][_0x0a53('0x45')]){_0xc1a6b6[_0x0a53('0x46')]=[{'all':!![]}];}return db['ChatWebsite'][_0x0a53('0x47')](_0xc1a6b6);})[_0x0a53('0x14')](function(_0x33323e){_0x5745ae[_0x0a53('0x48')]=_0x33323e;return _0x5745ae;})[_0x0a53('0x14')](respondWithFilteredResult(_0x20f7c1,_0xc1a6b6))[_0x0a53('0x1d')](handleError(_0x20f7c1,null));};exports[_0x0a53('0x49')]=function(_0xfcd6a5,_0x205b98){var _0x4136c6={'raw':![],'where':{'id':_0xfcd6a5[_0x0a53('0x4a')]['id']},'include':[{'model':db[_0x0a53('0x2f')],'as':_0x0a53('0x4b')}]},_0x293904={};_0x293904[_0x0a53('0x33')]=_[_0x0a53('0x35')](db['ChatWebsite'][_0x0a53('0x4c')]);_0x293904[_0x0a53('0x34')]=_[_0x0a53('0x35')](_0xfcd6a5['query']);_0x293904['filters']=_['intersection'](_0x293904[_0x0a53('0x33')],_0x293904[_0x0a53('0x34')]);_0x4136c6[_0x0a53('0x37')]=_[_0x0a53('0x38')](_0x293904[_0x0a53('0x33')],qs['fields'](_0xfcd6a5[_0x0a53('0x34')][_0x0a53('0x39')]));_0x4136c6['attributes']=_0x4136c6[_0x0a53('0x37')]['length']?_0x4136c6['attributes']:_0x293904[_0x0a53('0x33')];if(_0xfcd6a5['query'][_0x0a53('0x45')]){_0x4136c6[_0x0a53('0x46')]=[{'all':!![]}];}_0x4136c6=_[_0x0a53('0x42')]({},_0x4136c6,_0xfcd6a5[_0x0a53('0x43')]);return db[_0x0a53('0x44')][_0x0a53('0x4d')](_0x4136c6)[_0x0a53('0x14')](handleEntityNotFound(_0x205b98,null))[_0x0a53('0x14')](respondWithResult(_0x205b98,null))[_0x0a53('0x1d')](handleError(_0x205b98,null));};exports[_0x0a53('0x4e')]=function(_0x3a7c08,_0x184eef){return db[_0x0a53('0x44')][_0x0a53('0x4e')](_0x3a7c08[_0x0a53('0x4f')],{})[_0x0a53('0x14')](function(_0x4e9ebb){var _0x14054c=_0x3a7c08['user']['get']({'plain':!![]});if(!_0x14054c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x14054c['role']===_0x0a53('0x50')){var _0x45837f=_0x4e9ebb[_0x0a53('0x2a')]({'plain':!![]});var _0xbfd80a=_0x0a53('0x51');return db[_0x0a53('0x52')]['find']({'where':{'name':_0xbfd80a,'userProfileId':_0x14054c[_0x0a53('0x53')]},'raw':!![]})[_0x0a53('0x14')](function(_0x4a3607){if(_0x4a3607&&_0x4a3607[_0x0a53('0x54')]===0x0){return db[_0x0a53('0x55')]['create']({'name':_0x45837f[_0x0a53('0x2c')],'resourceId':_0x45837f['id'],'type':_0x4a3607[_0x0a53('0x2c')],'sectionId':_0x4a3607['id']},{})['then'](function(){return _0x4e9ebb;});}else{return _0x4e9ebb;}})[_0x0a53('0x1d')](function(_0x3b4e62){logger[_0x0a53('0x18')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3b4e62);throw _0x3b4e62;});}return _0x4e9ebb;})[_0x0a53('0x14')](respondWithResult(_0x184eef,0xc9))['catch'](handleError(_0x184eef,null));};exports[_0x0a53('0x28')]=function(_0x53b0ac,_0x44c4b2){if(_0x53b0ac[_0x0a53('0x4f')]['id']){delete _0x53b0ac['body']['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x53b0ac[_0x0a53('0x4a')]['id']},'include':[{'model':db[_0x0a53('0x2f')],'as':_0x0a53('0x4b')}]})[_0x0a53('0x14')](handleEntityNotFound(_0x44c4b2,null))[_0x0a53('0x14')](saveUpdates(_0x53b0ac[_0x0a53('0x4f')],null))[_0x0a53('0x14')](respondWithResult(_0x44c4b2,null))['catch'](handleError(_0x44c4b2,null));};exports[_0x0a53('0x29')]=function(_0x1762e9,_0x2e2f0e){return db[_0x0a53('0x44')]['find']({'where':{'id':_0x1762e9[_0x0a53('0x4a')]['id']}})[_0x0a53('0x14')](handleEntityNotFound(_0x2e2f0e,null))[_0x0a53('0x14')](removeEntity(_0x2e2f0e,null))[_0x0a53('0x1d')](handleError(_0x2e2f0e,null));};exports[_0x0a53('0x56')]=function(_0x43cfe3,_0xc045b0){return db['ChatWebsite']['describe']()[_0x0a53('0x14')](respondWithResult(_0xc045b0,null))[_0x0a53('0x1d')](handleError(_0xc045b0,null));};exports[_0x0a53('0x57')]=function(_0x1f1b59,_0xc2e7dd){if(_0x1f1b59['body']['id']){delete _0x1f1b59[_0x0a53('0x4f')]['id'];}return db[_0x0a53('0x44')][_0x0a53('0x4d')]({'where':{'id':_0x1f1b59[_0x0a53('0x4a')]['id']}})[_0x0a53('0x14')](handleEntityNotFound(_0xc2e7dd,null))['then'](function(_0x3c98f3){if(_0x3c98f3){_0x1f1b59[_0x0a53('0x4f')]['ChatWebsiteId']=_0x3c98f3['id'];return db[_0x0a53('0x58')][_0x0a53('0x4e')](_0x1f1b59[_0x0a53('0x4f')]);}})[_0x0a53('0x14')](respondWithResult(_0xc2e7dd,null))['catch'](handleError(_0xc2e7dd,null));};exports[_0x0a53('0x59')]=function(_0x8e02a7,_0xb121ff){var _0x53f502={'raw':![],'where':{}};var _0x23f5e0={};var _0x55b9a3={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x0a53('0x5a')]({'where':{'id':_0x8e02a7[_0x0a53('0x4a')]['id']}})['then'](handleEntityNotFound(_0xb121ff,null))[_0x0a53('0x14')](function(_0x356ac0){if(_0x356ac0){_0x23f5e0['model']=_[_0x0a53('0x35')](db[_0x0a53('0x58')][_0x0a53('0x4c')]);_0x23f5e0[_0x0a53('0x34')]=_[_0x0a53('0x35')](_0x8e02a7[_0x0a53('0x34')]);_0x23f5e0[_0x0a53('0x36')]=_['intersection'](_0x23f5e0[_0x0a53('0x33')],_0x23f5e0[_0x0a53('0x34')]);_0x53f502['attributes']=_[_0x0a53('0x38')](_0x23f5e0[_0x0a53('0x33')],qs[_0x0a53('0x39')](_0x8e02a7[_0x0a53('0x34')][_0x0a53('0x39')]));_0x53f502[_0x0a53('0x37')]=_0x53f502['attributes'][_0x0a53('0x3a')]?_0x53f502[_0x0a53('0x37')]:_0x23f5e0[_0x0a53('0x33')];if(!_0x8e02a7[_0x0a53('0x34')][_0x0a53('0x3b')]('nolimit')){_0x53f502['limit']=qs['limit'](_0x8e02a7[_0x0a53('0x34')]['limit']);_0x53f502[_0x0a53('0x25')]=qs[_0x0a53('0x25')](_0x8e02a7['query'][_0x0a53('0x25')]);}_0x53f502['order']=qs[_0x0a53('0x3e')](_0x8e02a7[_0x0a53('0x34')][_0x0a53('0x3e')]);_0x53f502['where']=qs[_0x0a53('0x36')](_[_0x0a53('0x40')](_0x8e02a7[_0x0a53('0x34')],_0x23f5e0['filters']));_0x53f502[_0x0a53('0x3f')][_0x0a53('0x5b')]=_0x356ac0['id'];if(_0x8e02a7[_0x0a53('0x34')]['filter']){_0x53f502[_0x0a53('0x3f')]=_['merge'](_0x53f502['where'],{'$or':_['map'](_0x53f502[_0x0a53('0x37')],function(_0x27aeb3){var _0x2c970b={};_0x2c970b[_0x27aeb3]={'$like':'%'+_0x8e02a7['query'][_0x0a53('0x41')]+'%'};return _0x2c970b;})});}_0x53f502=_[_0x0a53('0x42')]({},_0x53f502,_0x8e02a7[_0x0a53('0x43')]);return db[_0x0a53('0x58')][_0x0a53('0x24')]({'where':_0x53f502[_0x0a53('0x3f')]})[_0x0a53('0x14')](function(_0x2faa9d){_0x55b9a3['count']=_0x2faa9d;if(_0x8e02a7[_0x0a53('0x34')][_0x0a53('0x45')]){_0x53f502[_0x0a53('0x46')]=[{'all':!![]}];}return db[_0x0a53('0x58')]['findAll'](_0x53f502);})[_0x0a53('0x14')](function(_0x1b50c2){_0x55b9a3[_0x0a53('0x48')]=_0x1b50c2;return _0x55b9a3;});}})['then'](respondWithFilteredResult(_0xb121ff,_0x53f502))[_0x0a53('0x1d')](handleError(_0xb121ff,null));};exports[_0x0a53('0x5c')]=function(_0x3f1376,_0x2b91a5){return db['ChatWebsite']['find']({'where':{'id':_0x3f1376[_0x0a53('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2b91a5,null))[_0x0a53('0x14')](function(_0x24759e){if(_0x24759e){return _0x24759e[_0x0a53('0x5c')](_0x3f1376['query'][_0x0a53('0x5d')]);}})['then'](respondWithStatusCode(_0x2b91a5,null))['catch'](handleError(_0x2b91a5,null));};exports[_0x0a53('0x5e')]=function(_0x4fc3b2,_0x585e2a){if(_0x4fc3b2[_0x0a53('0x4f')]['id']){delete _0x4fc3b2['body']['id'];}return db[_0x0a53('0x44')][_0x0a53('0x4d')]({'where':{'id':_0x4fc3b2[_0x0a53('0x4a')]['id']}})[_0x0a53('0x14')](handleEntityNotFound(_0x585e2a,null))[_0x0a53('0x14')](function(_0x2f06c7){if(_0x2f06c7){_0x4fc3b2[_0x0a53('0x4f')][_0x0a53('0x5b')]=_0x2f06c7['id'];return db[_0x0a53('0x5f')][_0x0a53('0x4e')](_0x4fc3b2[_0x0a53('0x4f')]);}})[_0x0a53('0x14')](respondWithResult(_0x585e2a,null))[_0x0a53('0x1d')](handleError(_0x585e2a,null));};exports['getAnswers']=function(_0x8855b9,_0x4f3eba){var _0x197034={'raw':![],'where':{}};var _0x302f50={};var _0x15533a={'count':0x0,'rows':[]};return db[_0x0a53('0x44')][_0x0a53('0x5a')]({'where':{'id':_0x8855b9['params']['id']}})[_0x0a53('0x14')](handleEntityNotFound(_0x4f3eba,null))[_0x0a53('0x14')](function(_0x56e714){if(_0x56e714){_0x302f50[_0x0a53('0x33')]=_[_0x0a53('0x35')](db[_0x0a53('0x5f')][_0x0a53('0x4c')]);_0x302f50['query']=_['keys'](_0x8855b9[_0x0a53('0x34')]);_0x302f50[_0x0a53('0x36')]=_[_0x0a53('0x38')](_0x302f50[_0x0a53('0x33')],_0x302f50[_0x0a53('0x34')]);_0x197034[_0x0a53('0x37')]=_[_0x0a53('0x38')](_0x302f50['model'],qs[_0x0a53('0x39')](_0x8855b9[_0x0a53('0x34')][_0x0a53('0x39')]));_0x197034[_0x0a53('0x37')]=_0x197034[_0x0a53('0x37')][_0x0a53('0x3a')]?_0x197034[_0x0a53('0x37')]:_0x302f50[_0x0a53('0x33')];if(!_0x8855b9[_0x0a53('0x34')]['hasOwnProperty'](_0x0a53('0x3c'))){_0x197034[_0x0a53('0x22')]=qs[_0x0a53('0x22')](_0x8855b9[_0x0a53('0x34')][_0x0a53('0x22')]);_0x197034[_0x0a53('0x25')]=qs[_0x0a53('0x25')](_0x8855b9[_0x0a53('0x34')][_0x0a53('0x25')]);}_0x197034[_0x0a53('0x3d')]=qs[_0x0a53('0x3e')](_0x8855b9[_0x0a53('0x34')][_0x0a53('0x3e')]);_0x197034[_0x0a53('0x3f')]=qs['filters'](_[_0x0a53('0x40')](_0x8855b9['query'],_0x302f50['filters']));_0x197034[_0x0a53('0x3f')][_0x0a53('0x5b')]=_0x56e714['id'];if(_0x8855b9[_0x0a53('0x34')][_0x0a53('0x41')]){_0x197034['where']=_[_0x0a53('0x42')](_0x197034[_0x0a53('0x3f')],{'$or':_[_0x0a53('0x30')](_0x197034[_0x0a53('0x37')],function(_0x52db68){var _0x448178={};_0x448178[_0x52db68]={'$like':'%'+_0x8855b9[_0x0a53('0x34')][_0x0a53('0x41')]+'%'};return _0x448178;})});}_0x197034=_['merge']({},_0x197034,_0x8855b9['options']);return db[_0x0a53('0x5f')][_0x0a53('0x24')]({'where':_0x197034['where']})[_0x0a53('0x14')](function(_0x40798f){_0x15533a['count']=_0x40798f;if(_0x8855b9[_0x0a53('0x34')]['includeAll']){_0x197034['include']=[{'all':!![]}];}return db[_0x0a53('0x5f')][_0x0a53('0x47')](_0x197034);})['then'](function(_0x4c75a9){_0x15533a[_0x0a53('0x48')]=_0x4c75a9;return _0x15533a;});}})[_0x0a53('0x14')](respondWithFilteredResult(_0x4f3eba,_0x197034))[_0x0a53('0x1d')](handleError(_0x4f3eba,null));};exports[_0x0a53('0x60')]=function(_0x20004d,_0x7d9de1){return db['ChatWebsite'][_0x0a53('0x4d')]({'where':{'id':_0x20004d[_0x0a53('0x4a')]['id']}})[_0x0a53('0x14')](handleEntityNotFound(_0x7d9de1,null))['then'](function(_0x580b57){if(_0x580b57){return _0x580b57[_0x0a53('0x60')](_0x20004d['query'][_0x0a53('0x5d')]);}})[_0x0a53('0x14')](respondWithStatusCode(_0x7d9de1,null))['catch'](handleError(_0x7d9de1,null));};exports['addLogo']=function(_0x1d550d,_0xef531f){_0x1d550d[_0x0a53('0x4f')][_0x0a53('0x61')]=_0x1d550d['file']['filename'];return db[_0x0a53('0x44')][_0x0a53('0x4d')]({'where':{'id':_0x1d550d[_0x0a53('0x4a')]['id']}})[_0x0a53('0x14')](handleEntityNotFound(_0xef531f,null))[_0x0a53('0x14')](saveUpdates(_0x1d550d[_0x0a53('0x4f')],null))[_0x0a53('0x14')](respondWithResult(_0xef531f,null))[_0x0a53('0x1d')](handleError(_0xef531f,null));};exports['addAvatar']=function(_0x178fa2,_0x27f65d){_0x178fa2['body'][_0x0a53('0x62')]=_0x178fa2['file']['filename'];return db['ChatWebsite'][_0x0a53('0x4d')]({'where':{'id':_0x178fa2['params']['id']}})[_0x0a53('0x14')](handleEntityNotFound(_0x27f65d,null))['then'](saveUpdates(_0x178fa2[_0x0a53('0x4f')],null))[_0x0a53('0x14')](respondWithResult(_0x27f65d,null))[_0x0a53('0x1d')](handleError(_0x27f65d,null));};exports[_0x0a53('0x63')]=function(_0x2d2434,_0x47c121){_0x2d2434[_0x0a53('0x4f')]['customerAvatar']=_0x2d2434['file'][_0x0a53('0x64')];return db[_0x0a53('0x44')][_0x0a53('0x4d')]({'where':{'id':_0x2d2434['params']['id']}})[_0x0a53('0x14')](handleEntityNotFound(_0x47c121,null))[_0x0a53('0x14')](saveUpdates(_0x2d2434[_0x0a53('0x4f')],null))[_0x0a53('0x14')](respondWithResult(_0x47c121,null))[_0x0a53('0x1d')](handleError(_0x47c121,null));};exports[_0x0a53('0x65')]=function(_0x538609,_0x55287f){_0x538609[_0x0a53('0x4f')][_0x0a53('0x66')]=_0x538609[_0x0a53('0x67')]['filename'];return db[_0x0a53('0x44')][_0x0a53('0x4d')]({'where':{'id':_0x538609[_0x0a53('0x4a')]['id']}})[_0x0a53('0x14')](handleEntityNotFound(_0x55287f,null))[_0x0a53('0x14')](saveUpdates(_0x538609['body'],null))[_0x0a53('0x14')](respondWithResult(_0x55287f,null))[_0x0a53('0x1d')](handleError(_0x55287f,null));};exports[_0x0a53('0x68')]=function(_0x1bed5d,_0x24169e){var _0x599f37=path['join'](config['root'],_0x0a53('0x69'));var _0x150329={'where':{'id':_0x1bed5d[_0x0a53('0x4a')]['id']},'attributes':['id',_0x0a53('0x61')],'raw':!![]};var _0x52ae57=![];return require('../../config/license/util')[_0x0a53('0x6a')]()[_0x0a53('0x14')](function(_0x19f3ce){if(_0x19f3ce){_0x52ae57=_0x19f3ce[_0x0a53('0x6b')];}})[_0x0a53('0x14')](function(){return db['ChatWebsite']['find'](_0x150329);})[_0x0a53('0x14')](handleEntityNotFound(_0x24169e,null))[_0x0a53('0x14')](function(_0x255fb3){if(_0x255fb3){if(!_[_0x0a53('0x6c')](_0x255fb3[_0x0a53('0x61')])){if(fs['existsSync'](path[_0x0a53('0x6d')](config[_0x0a53('0x6e')],_0x0a53('0x6f'),_0x255fb3[_0x0a53('0x61')]))&&_0x52ae57){_0x599f37=path[_0x0a53('0x6d')](config['root'],_0x0a53('0x6f'),_0x255fb3[_0x0a53('0x61')]);}}return _0x24169e[_0x0a53('0x70')](_0x599f37);}})[_0x0a53('0x1d')](handleError(_0x24169e,null));};exports[_0x0a53('0x71')]=function(_0xbdd5c1,_0x394100){var _0x4da7bb=path[_0x0a53('0x6d')](config['root'],_0x0a53('0x72'));var _0x46a36a={'where':{'id':_0xbdd5c1[_0x0a53('0x4a')]['id']},'attributes':['id',_0x0a53('0x62')],'raw':!![]};return db[_0x0a53('0x44')][_0x0a53('0x4d')](_0x46a36a)[_0x0a53('0x14')](handleEntityNotFound(_0x394100,null))['then'](function(_0x2c077b){if(_0x2c077b){if(!_[_0x0a53('0x6c')](_0x2c077b[_0x0a53('0x62')])){if(fs[_0x0a53('0x73')](path[_0x0a53('0x6d')](config[_0x0a53('0x6e')],'server/files/images/avatars/',_0x2c077b[_0x0a53('0x62')]))){_0x4da7bb=path[_0x0a53('0x6d')](config[_0x0a53('0x6e')],_0x0a53('0x74'),_0x2c077b[_0x0a53('0x62')]);}}return _0x394100['download'](_0x4da7bb);}})[_0x0a53('0x1d')](handleError(_0x394100,null));};exports[_0x0a53('0x75')]=function(_0x1c2668,_0x3073c5){var _0x181b00=path[_0x0a53('0x6d')](config[_0x0a53('0x6e')],_0x0a53('0x76'));var _0x35f80e={'where':{'id':_0x1c2668[_0x0a53('0x4a')]['id']},'attributes':['id',_0x0a53('0x77'),_0x0a53('0x78')],'raw':!![]};return db[_0x0a53('0x44')][_0x0a53('0x4d')](_0x35f80e)['then'](handleEntityNotFound(_0x3073c5,null))[_0x0a53('0x14')](function(_0x53bd02){if(_0x53bd02){if(!_['isNil'](_0x53bd02[_0x0a53('0x77')])){if(fs[_0x0a53('0x73')](path[_0x0a53('0x6d')](config[_0x0a53('0x6e')],_0x0a53('0x74'),_0x53bd02[_0x0a53('0x77')]))&&_0x53bd02['showCustomerAvatar']){_0x181b00=path[_0x0a53('0x6d')](config[_0x0a53('0x6e')],_0x0a53('0x74'),_0x53bd02[_0x0a53('0x77')]);}}return _0x3073c5[_0x0a53('0x70')](_0x181b00);}})[_0x0a53('0x1d')](handleError(_0x3073c5,null));};exports[_0x0a53('0x79')]=function(_0x2b5d3a,_0x1e8444){var _0x95d180=path[_0x0a53('0x6d')](config['root'],_0x0a53('0x7a'));var _0x1c995f={'where':{'id':_0x2b5d3a[_0x0a53('0x4a')]['id']},'attributes':['id',_0x0a53('0x66')],'raw':!![]};return db['ChatWebsite'][_0x0a53('0x4d')](_0x1c995f)[_0x0a53('0x14')](handleEntityNotFound(_0x1e8444,null))[_0x0a53('0x14')](function(_0x45ff33){if(_0x45ff33){if(!_[_0x0a53('0x6c')](_0x45ff33[_0x0a53('0x66')])){if(fs[_0x0a53('0x73')](path[_0x0a53('0x6d')](config[_0x0a53('0x6e')],_0x0a53('0x74'),_0x45ff33[_0x0a53('0x66')]))){_0x95d180=path[_0x0a53('0x6d')](config[_0x0a53('0x6e')],_0x0a53('0x74'),_0x45ff33[_0x0a53('0x66')]);}}return _0x1e8444[_0x0a53('0x70')](_0x95d180);}})[_0x0a53('0x1d')](handleError(_0x1e8444,null));};exports[_0x0a53('0x7b')]=function(_0x4bf266,_0x51d969){var _0x3c263d=require(_0x0a53('0x7c'));var _0x3d4451=new _0x3c263d();var _0x302dcf=_0x3d4451['setUA'](_0x4bf266[_0x0a53('0x7d')][_0x0a53('0x7e')])[_0x0a53('0x7f')]();var _0x2d75b0={'body':_0x4bf266['body'],'channel':_0x0a53('0x80')};var _0x516f21=[];var _0x8f79de=[];var _0x4b76f4={};var _0x2dc6b9=![];return db['CmContact'][_0x0a53('0x56')]()[_0x0a53('0x14')](function(_0x1730ec){if(!_0x1730ec){throw new db[(_0x0a53('0x81'))][(_0x0a53('0x82'))](_0x0a53('0x83'));}_0x516f21=_[_0x0a53('0x84')](_[_0x0a53('0x35')](_0x1730ec),[_0x0a53('0x85'),'updatedAt']);_0x8f79de=_[_0x0a53('0x84')](_[_0x0a53('0x35')](_0x1730ec),[_0x0a53('0x85'),'updatedAt',_0x0a53('0x86'),'ListId']);if(_0x4bf266[_0x0a53('0x4f')]['id']){delete _0x4bf266[_0x0a53('0x4f')]['id'];}if(_[_0x0a53('0x6c')](_0x4bf266[_0x0a53('0x4f')][_0x0a53('0x87')])){throw new db[(_0x0a53('0x81'))]['ValidationError'](_0x0a53('0x88'));}if(_[_0x0a53('0x6c')](_0x4bf266[_0x0a53('0x4f')][_0x0a53('0x4f')])||_0x4bf266[_0x0a53('0x4f')][_0x0a53('0x4f')]===''){throw new db['Sequelize'][(_0x0a53('0x82'))](_0x0a53('0x89'));}if(_[_0x0a53('0x6c')](_0x4bf266['body']['mapKey'])){throw new db['Sequelize']['ValidationError'](_0x0a53('0x8a')+_0x8f79de);}if(!_[_0x0a53('0x8b')](_0x8f79de,_0x4bf266[_0x0a53('0x4f')][_0x0a53('0x8c')])){throw new db[(_0x0a53('0x81'))][(_0x0a53('0x82'))](_0x0a53('0x8d')+_0x8f79de);}_0x4b76f4[_0x4bf266['body'][_0x0a53('0x8c')]]=_0x4bf266['body'][_0x0a53('0x87')];})['then'](function(){return db[_0x0a53('0x44')][_0x0a53('0x4d')]({'where':{'id':_0x4bf266[_0x0a53('0x4a')]['id']},'include':[{'model':db[_0x0a53('0x8e')],'as':'List','include':[{'model':db[_0x0a53('0x8f')],'as':_0x0a53('0x90'),'where':_0x4b76f4,'limit':0x1,'order':[[_0x0a53('0x91'),_0x0a53('0x92')]]}]},{'model':db[_0x0a53('0x93')],'as':_0x0a53('0x94')}]});})[_0x0a53('0x14')](handleEntityNotFound(_0x51d969,null))[_0x0a53('0x14')](function(_0x5d6b94){if(_0x5d6b94&&_0x5d6b94[_0x0a53('0x95')]){_0x2d75b0[_0x0a53('0x96')]=_0x5d6b94;_0x2d75b0[_0x0a53('0x97')]=_0x5d6b94[_0x0a53('0x94')];_0x2d75b0[_0x0a53('0x98')]=_0x5d6b94[_0x0a53('0x95')];_0x2d75b0['applications']=_['orderBy'](_0x2d75b0[_0x0a53('0x97')],[_0x0a53('0x99')],[_0x0a53('0x9a')]);if(_0x2d75b0[_0x0a53('0x96')][_0x0a53('0x94')]){delete _0x2d75b0[_0x0a53('0x96')][_0x0a53('0x94')];}if(_0x2d75b0[_0x0a53('0x96')][_0x0a53('0x95')]&&_0x2d75b0[_0x0a53('0x96')][_0x0a53('0x95')]['Contacts']['length']){return _0x2d75b0[_0x0a53('0x96')][_0x0a53('0x95')][_0x0a53('0x90')][0x0];}var _0xdfd54c=_[_0x0a53('0xd')](_0x4bf266[_0x0a53('0x4f')],{'firstName':_0x4bf266[_0x0a53('0x4f')][_0x0a53('0x87')],'ListId':_0x5d6b94['ListId']});_0xdfd54c[_0x4bf266[_0x0a53('0x4f')][_0x0a53('0x8c')]]=_0x4bf266[_0x0a53('0x4f')][_0x0a53('0x87')];return db[_0x0a53('0x8f')][_0x0a53('0x4e')](_0xdfd54c,{'fields':_0x516f21,'raw':!![]});}})['then'](handleEntityNotFound(_0x51d969,null))[_0x0a53('0x14')](function(_0xbe7593){_0x2d75b0[_0x0a53('0x9b')]=_0xbe7593;var _0x46a419=_0x4bf266['body'][_0x0a53('0x9c')];if(_0x4bf266[_0x0a53('0x7d')][_0x0a53('0x9d')]){_0x46a419=_0x4bf266[_0x0a53('0x7d')][_0x0a53('0x9d')];}else if(_0x4bf266[_0x0a53('0x7d')][_0x0a53('0x9e')]){_0x46a419=_[_0x0a53('0x9f')](_0x4bf266[_0x0a53('0x7d')][_0x0a53('0x9e')][_0x0a53('0xa0')](','));}if(_0xbe7593){var _0x555d4b={'ContactId':_0xbe7593['id'],'ChatWebsiteId':_0x4bf266[_0x0a53('0x4a')]['id'],'from':(_0xbe7593[_0x0a53('0xa1')]||'')+'\x20'+(_0xbe7593[_0x0a53('0xa2')]||''),'customerIp':_0x46a419,'customerPort':_0x4bf266[_0x0a53('0x7d')][_0x0a53('0xa3')]?_0x4bf266['headers']['x-real-port']:null,'referer':_0x4bf266['body'][_0x0a53('0xa4')],'browserName':_0x302dcf[_0x0a53('0xa5')][_0x0a53('0x2c')]&&_0x302dcf['browser']['version']?util[_0x0a53('0xa6')](_0x0a53('0xa7'),_0x302dcf[_0x0a53('0xa5')][_0x0a53('0x2c')],_0x302dcf[_0x0a53('0xa5')][_0x0a53('0xa8')]):'unknown','browserVersion':_0x302dcf[_0x0a53('0xa5')][_0x0a53('0xa8')]||_0x0a53('0xa9'),'osName':util[_0x0a53('0xa6')](_0x0a53('0xa7'),_0x302dcf['os'][_0x0a53('0x2c')],_0x302dcf['os'][_0x0a53('0xa8')]),'osVersion':_0x302dcf['os']['version'],'deviceModel':_0x302dcf['device'][_0x0a53('0x33')]&&_0x302dcf[_0x0a53('0xaa')][_0x0a53('0xab')]?util[_0x0a53('0xa6')]('%s\x20%s\x20%s',_0x302dcf[_0x0a53('0xaa')][_0x0a53('0x33')],_0x302dcf['device'][_0x0a53('0xab')],_0x302dcf['device'][_0x0a53('0x32')]):null,'deviceVendor':_0x302dcf[_0x0a53('0xaa')]['vendor'],'deviceType':_0x302dcf[_0x0a53('0xaa')]['type'],'formData':JSON[_0x0a53('0xac')](_0x4bf266['body'])};var _0x313ece={'ChatWebsiteId':_0x4bf266[_0x0a53('0x4a')]['id'],'closed':![]};if(_0x4bf266[_0x0a53('0x4f')][_0x0a53('0xad')]){_0x313ece[_0x0a53('0xad')]=_0x4bf266['body']['threadId'];return db[_0x0a53('0xae')][_0x0a53('0x4d')]({'where':_0x313ece})['then'](function(_0x509a98){if(_0x509a98){return[_0x509a98,![]];}_0x555d4b[_0x0a53('0xad')]=_0x4bf266[_0x0a53('0x4f')][_0x0a53('0xad')];_0x555d4b['externalUrl']=_0x4bf266['body'][_0x0a53('0xaf')];return db[_0x0a53('0xae')][_0x0a53('0x4e')](_0x555d4b)[_0x0a53('0x14')](function(_0x573dd2){return[_0x573dd2,!![]];});});}_0x313ece[_0x0a53('0xb0')]=_0xbe7593['id'];if(_0x4bf266[_0x0a53('0x4f')]['interaction']&&_0x4bf266[_0x0a53('0x4f')][_0x0a53('0xb1')]['id']){_0x313ece['id']=_0x4bf266[_0x0a53('0x4f')]['interaction']['id'];return db[_0x0a53('0xae')]['find']({'where':_0x313ece})[_0x0a53('0x14')](function(_0x4aa573){if(_0x4aa573){return[_0x4aa573,![]];}return db[_0x0a53('0xae')][_0x0a53('0x4e')](_0x555d4b)[_0x0a53('0x14')](function(_0x1402fe){return[_0x1402fe,!![]];});});}return db[_0x0a53('0xae')][_0x0a53('0x4e')](_0x555d4b)[_0x0a53('0x14')](function(_0x38581c){return[_0x38581c,!![]];});}})[_0x0a53('0xb2')](function(_0x50d23e,_0x3ab018){if(_0x50d23e){_0x2dc6b9=_0x3ab018;if(!_0x3ab018){var _0x35ba3a={'from':(_0x2d75b0[_0x0a53('0x9b')][_0x0a53('0xa1')]||'')+'\x20'+(_0x2d75b0['contact'][_0x0a53('0xa2')]||'')};if(_0x4bf266['body'][_0x0a53('0xad')]&&_0x4bf266[_0x0a53('0x4f')][_0x0a53('0xb3')]&&_0x4bf266['body'][_0x0a53('0xad')]!=_0x4bf266[_0x0a53('0x4f')]['messageId']){_0x35ba3a[_0x0a53('0xad')]=_0x4bf266[_0x0a53('0x4f')][_0x0a53('0xb3')];}return _0x50d23e['update'](_0x35ba3a);}else{return _0x50d23e;}}})[_0x0a53('0x14')](function(_0x54eea7){_0x2d75b0[_0x0a53('0xb1')]=_0x54eea7[_0x0a53('0x2a')]({'plain':!![]});_0x2d75b0[_0x0a53('0xb1')][_0x0a53('0xb4')]=_0x2dc6b9;if(_0x2d75b0[_0x0a53('0xb1')][_0x0a53('0xb4')]){if(_0x2d75b0[_0x0a53('0x96')][_0x0a53('0xb5')]){_0x2d75b0[_0x0a53('0x97')][_0x0a53('0xb6')]({'id':0x0,'priority':_0x2d75b0['applications']['length']+0x1,'app':'close','appdata':_0x0a53('0xb7'),'interval':'*,*,*,*'});}}return db[_0x0a53('0xb8')][_0x0a53('0x4e')]({'body':_0x4bf266[_0x0a53('0x4f')]['body'],'ChatWebsiteId':_0x4bf266['params']['id'],'ChatInteractionId':_0x54eea7['id'],'direction':'in','ContactId':_0x2d75b0['contact']['id'],'AttachmentId':_0x4bf266[_0x0a53('0x4f')][_0x0a53('0xb9')]});})[_0x0a53('0x14')](function(_0x3b60c7){_0x2d75b0['message']=_0x3b60c7;if(_0x2d75b0[_0x0a53('0xb1')]['UserId']){return db[_0x0a53('0xba')]['find']({'attributes':['id',_0x0a53('0x2c')],'where':{'id':_0x2d75b0['interaction'][_0x0a53('0xbb')]}})[_0x0a53('0x14')](function(_0x250061){if(_0x250061){_0x2d75b0[_0x0a53('0x97')][_0x0a53('0xbc')]({'id':0x0,'priority':0x0,'app':_0x0a53('0xbd'),'appdata':_0x250061[_0x0a53('0x2c')]+','+(_0x2d75b0['account'][_0x0a53('0xbe')]||0xa),'interval':_0x0a53('0xbf')});_0x2d75b0[_0x0a53('0xc0')]=!![];}return respondWithRpcPromise(_0x0a53('0xc1'),'startRouting',_0x2d75b0);});}return respondWithRpcPromise(_0x0a53('0xc1'),_0x0a53('0xc2'),_0x2d75b0);})[_0x0a53('0x14')](function(_0xb4794e){respondWithRpcPromise('EventManager',_0x0a53('0xc3'),{'event':_0x0a53('0x7b'),'message':_0xb4794e},client9002);return _0xb4794e;})[_0x0a53('0x14')](respondWithResult(_0x51d969,null))[_0x0a53('0x1d')](handleError(_0x51d969,null));};exports[_0x0a53('0xc4')]=function(_0x2c02f1,_0x1aa136){var _0x5d5f31,_0x4213dd,_0x30599e;var _0x42dc30=[];var _0x856b48={};var _0x1e3a86=_0x2c02f1['files']||[];var _0x3c3875=[];var _0x5b9edd;return db[_0x0a53('0x8f')][_0x0a53('0x56')]()['then'](function(_0x4897a2){if(!_0x4897a2){throw new db[(_0x0a53('0x81'))]['ValidationError'](_0x0a53('0x83'));}_0x42dc30=_[_0x0a53('0x84')](_[_0x0a53('0x35')](_0x4897a2),['createdAt',_0x0a53('0x91'),_0x0a53('0x86'),_0x0a53('0xc5')]);if(_0x2c02f1[_0x0a53('0x4f')]['id']){delete _0x2c02f1[_0x0a53('0x4f')]['id'];}if(_[_0x0a53('0x6c')](_0x2c02f1[_0x0a53('0x4f')][_0x0a53('0x87')])){throw _0x1aa136[_0x0a53('0x1f')](0x1f4)[_0x0a53('0x2d')](new db[(_0x0a53('0x81'))][(_0x0a53('0x82'))]('from\x20is\x20mandatory'));}if(_[_0x0a53('0x6c')](_0x2c02f1[_0x0a53('0x4f')][_0x0a53('0x4f')])||_0x2c02f1['body']['body']===''){throw _0x1aa136[_0x0a53('0x1f')](0x1f4)['send'](new db['Sequelize'][(_0x0a53('0x82'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x0a53('0x6c')](_0x2c02f1['body'][_0x0a53('0xc6')])){throw _0x1aa136[_0x0a53('0x1f')](0x1f4)[_0x0a53('0x2d')](new db[(_0x0a53('0x81'))][(_0x0a53('0x82'))](_0x0a53('0xc7')+_0x42dc30));}if(!_[_0x0a53('0x8b')](_0x42dc30,_0x2c02f1['body'][_0x0a53('0xc6')])){throw _0x1aa136[_0x0a53('0x1f')](0x1f4)['send'](new db[(_0x0a53('0x81'))][(_0x0a53('0x82'))](_0x0a53('0xc8')+_0x42dc30));}_0x856b48[_0x2c02f1[_0x0a53('0x4f')][_0x0a53('0xc6')]]=_0x2c02f1[_0x0a53('0x4f')][_0x0a53('0x87')];})['then'](function(){return db['ChatWebsite']['find']({'where':{'id':_0x2c02f1[_0x0a53('0x4a')]['id']},'include':[{'model':db[_0x0a53('0x8e')],'as':'List'},{'model':db[_0x0a53('0xc9')],'as':_0x0a53('0xc9')}]});})[_0x0a53('0x14')](handleEntityNotFound(_0x1aa136,null))[_0x0a53('0x14')](function(_0x248d20){if(_0x248d20&&_0x248d20[_0x0a53('0x95')]){_0x4213dd=_0x248d20;var _0x6f90e9=_[_0x0a53('0xd')](_0x2c02f1[_0x0a53('0x4f')],{'firstName':_0x2c02f1[_0x0a53('0x4f')]['from'],'phone':_0x2c02f1[_0x0a53('0x4f')]['from'],'ListId':_0x248d20[_0x0a53('0xc5')]});_0x6f90e9[_0x2c02f1['body']['mapKeyOffline']]=_0x2c02f1[_0x0a53('0x4f')][_0x0a53('0x87')];return db[_0x0a53('0x8f')][_0x0a53('0xca')]({'where':_0x856b48,'defaults':_0x6f90e9});}})[_0x0a53('0xb2')](function(_0x4bca75){if(_0x4bca75){_0x30599e=_0x4bca75;var _0x80a88c=fs[_0x0a53('0xcb')](path[_0x0a53('0x6d')](config[_0x0a53('0x6e')],_0x0a53('0xcc')),_0x0a53('0xcd'));var _0x41096c=ejs[_0x0a53('0xce')](_0x80a88c,{'body':_[_0x0a53('0xcf')](_0x2c02f1[_0x0a53('0x4f')][_0x0a53('0x4f')]),'bodyTitle':_0x4213dd['offlineMessageBody']});return db[_0x0a53('0xd0')]['create']({'body':_0x41096c,'plainBody':htmlToText[_0x0a53('0xd1')](_0x41096c),'ContactId':_0x4bca75['id'],'ChatWebsiteId':_0x4213dd['id']});}})[_0x0a53('0x14')](function(_0x3e8758){_0x5b9edd=_0x3e8758;if(_0x1e3a86[_0x0a53('0x3a')]){var _0x36583c=_0x1e3a86[_0x0a53('0x30')](function(_0x93fe89){return{'name':_0x93fe89[_0x0a53('0xd2')],'basename':_0x93fe89[_0x0a53('0x64')],'type':_0x93fe89['mimetype'],'ChatOfflineMessageId':_0x3e8758['id']};});_0x3c3875=_0x36583c['map'](_0x3214b0=>{var _0xf23ad={'filename':_0x3214b0[_0x0a53('0x2c')],'path':path['join'](config['root'],_0x0a53('0xd3'),_0x0a53('0xd4'),_0x0a53('0xd5'),_0x0a53('0xd6'),_0x3214b0[_0x0a53('0xd7')])};return _0xf23ad;});if(!_0x4213dd['openNewInteraction']){return db[_0x0a53('0xd8')][_0x0a53('0xd9')](function(_0x4e0251){return db['Attachment'][_0x0a53('0xda')](_0x36583c,{'transaction':_0x4e0251});});}}})[_0x0a53('0x14')](function(){if(_0x5b9edd){_0x5d5f31=_0x5b9edd;return db[_0x0a53('0xc9')][_0x0a53('0x5a')]({'where':{'service':!![]},'include':[{'model':db[_0x0a53('0xdb')],'as':_0x0a53('0xdc'),'raw':!![],'include':[{'model':db[_0x0a53('0xdd')],'as':_0x0a53('0xdd'),'raw':!![]}]}]});}})[_0x0a53('0x14')](function(_0x29b29b){if(_0x29b29b&&_0x29b29b[_0x0a53('0xdc')]&&_0x4213dd[_0x0a53('0xde')]&&_0x4213dd[_0x0a53('0xdf')]){var _0x45e625=_0x29b29b['getSmtpOptions']();return respondWithRpcPromise('SendMail',_0x0a53('0xe0'),{'account':_0x45e625,'message':{'from':util[_0x0a53('0xa6')](_0x0a53('0xe1'),_0x29b29b[_0x0a53('0x2c')],_0x29b29b[_0x0a53('0xe2')]||_0x29b29b[_0x0a53('0xdc')][_0x0a53('0x50')]),'to':_0x4213dd[_0x0a53('0xdf')],'subject':_0x4213dd[_0x0a53('0xe3')],'html':_0x5d5f31[_0x0a53('0x4f')],'attachments':_0x3c3875}},client9003)['then'](function(){return _0x5d5f31;})['catch'](function(_0x52c1fc){logger[_0x0a53('0x18')](_0x52c1fc);});}})[_0x0a53('0x14')](function(){if(_0x4213dd&&_0x4213dd['openNewInteraction']&&_0x4213dd[_0x0a53('0xe4')]){var _0x5f497f=[];if(_0x1e3a86[_0x0a53('0x3a')]){_0x5f497f=_0x1e3a86['map'](function(_0x3c57bd){return{'name':_0x3c57bd[_0x0a53('0xd2')],'basename':_0x3c57bd['filename'],'type':_0x3c57bd[_0x0a53('0xe5')],'ChatOfflineMessageId':_0x5b9edd['id']};});}var _0x35785e;if(!_[_0x0a53('0x6c')](_0x4213dd[_0x0a53('0xe6')])){var _0x438f85=_[_0x0a53('0x30')](_0x2c02f1['body'],function(_0x34d8a1){return _0x34d8a1;});var _0x30ea5e=_[_0x0a53('0xe7')](_0x438f85)[0x0];var _0x505f5e=_[_0x0a53('0xe8')](_0x30ea5e,function(_0x5da380){return _0x5da380;});_0x35785e=_0x505f5e[0x1][_0x4213dd[_0x0a53('0xe6')]];}var _0x4bd8f9={'from':_0x30599e[_0x0a53('0xe2')],'firstName':_0x30599e[_0x0a53('0xa1')],'lastName':_0x30599e[_0x0a53('0xa2')],'mapKey':_0x0a53('0xe2'),'message':{'from':_0x30599e[_0x0a53('0xe2')],'to':_0x4213dd[_0x0a53('0xc9')]['email'],'cc':'','subject':_[_0x0a53('0x6c')](_0x35785e)?_0x4213dd[_0x0a53('0xe3')]:_0x35785e,'messageId':'','sentAt':new Date(),'attach':_0x5f497f[_0x0a53('0x3a')],'attachments':_0x5f497f,'originChannel':_0x0a53('0xe9'),'ChatWebsiteId':_0x4213dd['id'],'ChatOfflineMessageId':_0x5d5f31['id'],'originTo':_0x4213dd['MailAccount'][_0x0a53('0xe2')]},'body':_0x5d5f31[_0x0a53('0x4f')]};var _0x326684={'account':{'id':_0x4213dd[_0x0a53('0xe4')]},'body':_0x4bd8f9,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0x0a53('0xea'),_0x0a53('0xeb'),_0x326684,client9001)[_0x0a53('0x14')](function(){return _0x5d5f31;})[_0x0a53('0x1d')](function(_0x3dcb2f){logger['error'](_0x3dcb2f);});}return;})[_0x0a53('0x14')](function(){if(_0x5d5f31){return _0x5d5f31;}})[_0x0a53('0x14')](respondWithResult(_0x1aa136,null))[_0x0a53('0x1d')](function(_0x497757){logger['error'](_0x0a53('0x1d'),_0x497757);for(var _0x1b13f2 of _0x1e3a86){var _0x43c4af=path[_0x0a53('0x6d')](config[_0x0a53('0x6e')],_0x0a53('0xd3'),_0x0a53('0xd4'),_0x0a53('0xd5'),_0x0a53('0xd6'),_0x1b13f2[_0x0a53('0x64')]);fs_extra[_0x0a53('0xec')](_0x43c4af)['catch'](function(_0x5cbaa6){logger[_0x0a53('0x18')](_0x0a53('0xed'),_0x43c4af,_0x5cbaa6);});}});};exports[_0x0a53('0xee')]=function(_0x557c2a,_0x11b002){return db[_0x0a53('0xae')][_0x0a53('0x4d')]({'where':{'id':_0x557c2a[_0x0a53('0x4a')]['id']}})[_0x0a53('0x14')](handleEntityNotFound(_0x11b002,null))[_0x0a53('0x14')](function(_0x2c776a){if(_0x2c776a){return _0x2c776a[_0x0a53('0xee')](_0x557c2a[_0x0a53('0x4f')][_0x0a53('0x5d')],_[_0x0a53('0xef')](_0x557c2a[_0x0a53('0x4f')],['ids','id'])||{});}})[_0x0a53('0x14')](respondWithResult(_0x11b002,null))[_0x0a53('0x1d')](handleError(_0x11b002,null));};exports[_0x0a53('0xf0')]=function(_0x29035f,_0x260214){var _0x595d76={'raw':![],'where':{}};var _0x2d679b={};var _0x2b2cdd={'count':0x0,'rows':[]};return db[_0x0a53('0x44')][_0x0a53('0x5a')]({'where':{'id':_0x29035f[_0x0a53('0x4a')]['id']}})[_0x0a53('0x14')](handleEntityNotFound(_0x260214,null))['then'](function(_0x5145c5){if(_0x5145c5){_0x2d679b[_0x0a53('0x33')]=_[_0x0a53('0x35')](db[_0x0a53('0xae')]['rawAttributes']);_0x2d679b['query']=_[_0x0a53('0x35')](_0x29035f['query']);_0x2d679b['filters']=_[_0x0a53('0x38')](_0x2d679b[_0x0a53('0x33')],_0x2d679b[_0x0a53('0x34')]);_0x595d76[_0x0a53('0x37')]=_[_0x0a53('0x38')](_0x2d679b[_0x0a53('0x33')],qs[_0x0a53('0x39')](_0x29035f[_0x0a53('0x34')][_0x0a53('0x39')]));_0x595d76['attributes']=_0x595d76['attributes'][_0x0a53('0x3a')]?_0x595d76[_0x0a53('0x37')]:_0x2d679b['model'];if(!_0x29035f[_0x0a53('0x34')][_0x0a53('0x3b')](_0x0a53('0x3c'))){_0x595d76[_0x0a53('0x22')]=qs[_0x0a53('0x22')](_0x29035f[_0x0a53('0x34')][_0x0a53('0x22')]);_0x595d76[_0x0a53('0x25')]=qs[_0x0a53('0x25')](_0x29035f[_0x0a53('0x34')][_0x0a53('0x25')]);}_0x595d76['order']=qs[_0x0a53('0x3e')](_0x29035f[_0x0a53('0x34')]['sort']);_0x595d76['where']=qs[_0x0a53('0x36')](_[_0x0a53('0x40')](_0x29035f[_0x0a53('0x34')],_0x2d679b[_0x0a53('0x36')]));_0x595d76[_0x0a53('0x3f')]['ChatWebsiteId']=_0x5145c5['id'];if(_0x29035f[_0x0a53('0x34')]['filter']){_0x595d76[_0x0a53('0x3f')]=_[_0x0a53('0x42')](_0x595d76[_0x0a53('0x3f')],{'$or':_[_0x0a53('0x30')](_0x595d76[_0x0a53('0x37')],function(_0x489023){var _0x3e4111={};_0x3e4111[_0x489023]={'$like':'%'+_0x29035f[_0x0a53('0x34')][_0x0a53('0x41')]+'%'};return _0x3e4111;})});}_0x595d76=_[_0x0a53('0x42')]({},_0x595d76,_0x29035f['options']);return db[_0x0a53('0xae')][_0x0a53('0x24')]({'where':_0x595d76['where']})[_0x0a53('0x14')](function(_0x5d55a5){_0x2b2cdd[_0x0a53('0x24')]=_0x5d55a5;if(_0x29035f[_0x0a53('0x34')][_0x0a53('0x45')]){_0x595d76[_0x0a53('0x46')]=[{'model':db[_0x0a53('0x8f')],'as':_0x0a53('0xf1'),'required':![]},{'model':db[_0x0a53('0xba')],'as':_0x0a53('0xf2'),'attributes':[_0x0a53('0x2c'),_0x0a53('0xf3'),'internal'],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x0a53('0x2c'),_0x0a53('0xf4')],'where':_0x29035f['query'][_0x0a53('0xf5')]?{'id':_0x29035f[_0x0a53('0x34')][_0x0a53('0xf5')]}:undefined,'required':_0x29035f['query'][_0x0a53('0xf5')]?!![]:![]}];}return db['ChatInteraction'][_0x0a53('0x47')](_0x595d76);})[_0x0a53('0x14')](function(_0x2b00b3){_0x2b2cdd['rows']=_0x2b00b3;return _0x2b2cdd;});}})[_0x0a53('0x14')](respondWithFilteredResult(_0x260214,_0x595d76))[_0x0a53('0x1d')](handleError(_0x260214,null));};function iftimePromise(_0x2b9b8f,_0x21bdf3){return respondWithRpcPromise(_0x0a53('0xf6'),_0x0a53('0xf7'),{'command':_0x21bdf3[_0x0a53('0xf8')]?util['format'](_0x0a53('0xf9'),_0x2b9b8f[_0x0a53('0xfa')],_0x21bdf3[_0x0a53('0xf8')]):util[_0x0a53('0xa6')](_0x0a53('0xfb'),_0x2b9b8f[_0x0a53('0xfa')])},client9002)[_0x0a53('0x14')](function(_0x5952b5){var _0x34ccd0=_0x5952b5&&_0x5952b5['indexOf']('true')>=0x0?!![]:![];logger[_0x0a53('0x1b')](_0x0a53('0xfc'),_0x21bdf3['id'],_0x2b9b8f['id'],_0x2b9b8f[_0x0a53('0xfa')],_0x34ccd0?_0x0a53('0xfd'):_0x0a53('0xfe'),_0x21bdf3[_0x0a53('0xf8')]?_0x21bdf3[_0x0a53('0xf8')]:_0x0a53('0xff'));return _0x34ccd0;})[_0x0a53('0x1d')](function(_0x107e2){logger['error'](_0x0a53('0xfc'),_0x21bdf3['id'],_0x2b9b8f['id'],_0x2b9b8f[_0x0a53('0xfa')],util[_0x0a53('0x100')](_0x107e2,{'showHidden':![],'depth':null}),_0x21bdf3[_0x0a53('0xf8')]?_0x21bdf3[_0x0a53('0xf8')]:_0x0a53('0xff'));return![];});}exports['getSnippet']=function(_0x51b468,_0x2243c0){var _0x165ae0=0x0;var _0x2076c9=0x0;var _0x14f642=![];var _0x45866b;var _0xce7606;return db[_0x0a53('0x44')]['find']({'where':{'id':_0x51b468[_0x0a53('0x4a')]['id']},'include':[{'model':db[_0x0a53('0x101')],'as':_0x0a53('0x101'),'include':[{'model':db[_0x0a53('0x101')],'as':_0x0a53('0x102'),'attributes':['id',_0x0a53('0xfa')],'raw':!![]}]}]})[_0x0a53('0x14')](handleEntityNotFound(_0x2243c0,null))[_0x0a53('0x14')](function(_0xbbc016){if(_0xbbc016){_0x45866b=_0xbbc016;return _0xbbc016['getProactiveActions']({'raw':!![]});}})[_0x0a53('0x14')](function(_0x24ef2a){if(_0x45866b){if(_0x24ef2a){_0xce7606=_0x24ef2a;}}return require(_0x0a53('0x103'))['getLicense']();})[_0x0a53('0x14')](function(_0x56f799){if(_0x56f799){_0x2076c9=_0x56f799[_0x0a53('0x104')];_0x14f642=_0x56f799['custom'];}})[_0x0a53('0x14')](function(){return db[_0x0a53('0xae')][_0x0a53('0x24')]({'where':{'closed':![]}});})[_0x0a53('0x14')](function(_0x2c51c0){_0x165ae0=_0x2c51c0;if(_0x2076c9&&_0x2c51c0>_0x2076c9){return db[_0x0a53('0x105')][_0x0a53('0x5a')]({'where':{'id':0x1}})[_0x0a53('0x14')](function(_0x30bcfc){if(_0x30bcfc){_0x30bcfc[_0x0a53('0x106')]('chatLicenseExceeded');}});}})[_0x0a53('0x14')](function(){if(_0x45866b[_0x0a53('0x101')]&&_0x45866b[_0x0a53('0x101')][_0x0a53('0x102')]){var _0x4969db=[];for(var _0x5336c5=0x0;_0x5336c5<_0x45866b[_0x0a53('0x101')][_0x0a53('0x102')]['length'];_0x5336c5++){var _0x58b49f=_0x45866b[_0x0a53('0x101')][_0x0a53('0x102')][_0x5336c5][_0x0a53('0x2a')]({'plain':!![]});_0x4969db[_0x0a53('0xb6')](iftimePromise(_0x58b49f,_0x45866b));}return BPromise[_0x0a53('0x107')](_0x4969db)[_0x0a53('0x14')](function(_0x560e2a){return _[_0x0a53('0x108')](_0x560e2a);});}else{return!![];}})[_0x0a53('0x14')](function(_0x29e88d){var _0x2e52c7=fs[_0x0a53('0xcb')](path[_0x0a53('0x6d')](config[_0x0a53('0x6e')],'server/files/chat/iframe.ejs'),'utf8');var _0x4253bd=new url[(_0x0a53('0x109'))](_0x45866b['address'])[_0x0a53('0x10a')];var _0x72e02b=_0x0a53('0x10b');var _0x99a0b4=![];var _0x415888={'chatVersion':_0x72e02b,'chatWebsiteAddressOrigin':_0x4253bd,'remote':_0x45866b['remote'],'query':querystring[_0x0a53('0xac')](_[_0x0a53('0x42')](_0x45866b[_0x0a53('0x2a')]({'plain':!![]}),{'customerIp':_0x51b468[_0x0a53('0x7d')][_0x0a53('0x9e')]||_0x51b468[_0x0a53('0x7d')][_0x0a53('0x10c')]||_0x51b468[_0x0a53('0x10d')][_0x0a53('0x10e')]||_0x51b468['ip'],'referer':_0x51b468['headers'][_0x0a53('0xa4')],'openedInteractions':_0x165ae0,'maxInteractions':_0x2076c9,'virtual':_0x14f642[_0x0a53('0x104')],'online':_0x29e88d,'custom':_0x14f642}))[_0x0a53('0x10f')](/'/g,'\x5c\x27')};_0x2243c0['send'](ejs[_0x0a53('0xce')](Mustache[_0x0a53('0xce')](_0x2e52c7,_0x415888),{'proactiveActions':_0xce7606,'alignment':_0x45866b[_0x0a53('0x110')],'verticalAlignment':_0x45866b[_0x0a53('0x111')],'div_color':_0x45866b[_0x0a53('0xf4')],'labelText':_0x45866b['labelText'],'text_color':_0x45866b[_0x0a53('0x112')],'text_button_color':_0x45866b['textButtonColor'],'button_color':_0x45866b[_0x0a53('0x113')],'background_color':_0x45866b['backgroundColor'],'hideWhenOffline':_0x45866b[_0x0a53('0x114')],'intervalId':_0x45866b[_0x0a53('0x115')],'isDevelopment':_0x99a0b4,'chatVersion':_0x72e02b}));})['catch'](handleError(_0x2243c0,null));};exports['addApplications']=function(_0x35ced6,_0x35af6e){var _0x3a8cce=_0x35ced6[_0x0a53('0x4a')]['id'];var _0x1b023e=_0x35ced6['body'];var _0x119adc=0xc8;var _0x4866ec=null;return db[_0x0a53('0xd8')]['transaction']({'isolationLevel':db[_0x0a53('0xd8')]['Transaction']['ISOLATION_LEVELS'][_0x0a53('0x116')]},function(_0x3ad718){return db[_0x0a53('0x44')][_0x0a53('0x5a')]({'where':{'id':_0x3a8cce},'transaction':_0x3ad718})[_0x0a53('0x14')](function(_0x1c5cfd){if(_0x1c5cfd){return db['ChatApplication'][_0x0a53('0x29')]({'where':{'ChatWebsiteId':_0x3a8cce},'transaction':_0x3ad718})['then'](function(){var _0x29a76a=_[_0x0a53('0x30')](_0x1b023e,function(_0xc08c7b){_0xc08c7b['ChatWebsiteId']=_0x3a8cce;return _0xc08c7b;});return db[_0x0a53('0x93')]['bulkCreate'](_0x29a76a,{'transaction':_0x3ad718});});}else{_0x119adc=0x194;_0x4866ec=[];}});})['then'](function(){if(_0x119adc!==0x194){return db[_0x0a53('0x93')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x3a8cce},'order':_0x0a53('0x99')})[_0x0a53('0x14')](function(_0x48c3c8){_0x4866ec=_0x48c3c8;});}})[_0x0a53('0x1d')](function(_0x2b68f5){_0x119adc=0x1f4;logger[_0x0a53('0x18')](_0x2b68f5[_0x0a53('0x2b')]);if(_0x2b68f5[_0x0a53('0x2c')]){delete _0x2b68f5['name'];}_0x4866ec=_0x2b68f5;})['finally'](function(){if(_0x4866ec===null){_0x35af6e['sendStatus'](_0x119adc);}else{if(_0x119adc===0x1f4){_0x35af6e[_0x0a53('0x1f')](_0x119adc)[_0x0a53('0x2d')](_0x4866ec);}else{_0x35af6e[_0x0a53('0x1f')](_0x119adc)[_0x0a53('0x21')](_0x4866ec);}}});};exports[_0x0a53('0x117')]=function(_0x37c9ff,_0x2c2a4f){var _0x200b2e={};var _0x11b2ce={};var _0x525568;var _0x5eac13;return db[_0x0a53('0x44')]['findOne']({'where':{'id':_0x37c9ff[_0x0a53('0x4a')]['id']}})[_0x0a53('0x14')](handleEntityNotFound(_0x2c2a4f,null))[_0x0a53('0x14')](function(_0x139b29){if(_0x139b29){_0x525568=_0x139b29;_0x11b2ce[_0x0a53('0x33')]=_[_0x0a53('0x35')](db[_0x0a53('0x93')][_0x0a53('0x4c')]);_0x11b2ce[_0x0a53('0x34')]=_[_0x0a53('0x35')](_0x37c9ff[_0x0a53('0x34')]);_0x11b2ce[_0x0a53('0x36')]=_['intersection'](_0x11b2ce[_0x0a53('0x33')],_0x11b2ce[_0x0a53('0x34')]);_0x200b2e[_0x0a53('0x37')]=_['intersection'](_0x11b2ce['model'],qs[_0x0a53('0x39')](_0x37c9ff[_0x0a53('0x34')][_0x0a53('0x39')]));_0x200b2e[_0x0a53('0x37')]=_0x200b2e[_0x0a53('0x37')]['length']?_0x200b2e[_0x0a53('0x37')]:_0x11b2ce['model'];_0x200b2e[_0x0a53('0x3d')]=qs[_0x0a53('0x3e')](_0x37c9ff[_0x0a53('0x34')][_0x0a53('0x3e')]);_0x200b2e[_0x0a53('0x3f')]=qs[_0x0a53('0x36')](_[_0x0a53('0x40')](_0x37c9ff['query'],_0x11b2ce['filters']));if(_0x37c9ff[_0x0a53('0x34')][_0x0a53('0x41')]){_0x200b2e['where']=_[_0x0a53('0x42')](_0x200b2e[_0x0a53('0x3f')],{'$or':_[_0x0a53('0x30')](_0x200b2e[_0x0a53('0x37')],function(_0x2b9a83){var _0xa962ef={};_0xa962ef[_0x2b9a83]={'$like':'%'+_0x37c9ff[_0x0a53('0x34')]['filter']+'%'};return _0xa962ef;})});}_0x200b2e=_[_0x0a53('0x42')]({},_0x200b2e,_0x37c9ff['options']);return _0x525568['getApplications'](_0x200b2e);}})['then'](function(_0x3331a6){if(_0x3331a6){_0x5eac13=_0x3331a6['length'];if(!_0x37c9ff[_0x0a53('0x34')][_0x0a53('0x3b')]('nolimit')){_0x200b2e[_0x0a53('0x22')]=qs['limit'](_0x37c9ff['query']['limit']);_0x200b2e[_0x0a53('0x25')]=qs['offset'](_0x37c9ff[_0x0a53('0x34')][_0x0a53('0x25')]);}return _0x525568['getApplications'](_0x200b2e);}})[_0x0a53('0x14')](function(_0x52bb65){if(_0x52bb65){return _0x52bb65?{'count':_0x5eac13,'rows':_0x52bb65}:null;}})['then'](respondWithResult(_0x2c2a4f,null))[_0x0a53('0x1d')](handleError(_0x2c2a4f,null));};exports[_0x0a53('0x118')]=function(_0x3e6372,_0x38058e){return db[_0x0a53('0x119')][_0x0a53('0x4d')]({'where':{'id':_0x3e6372[_0x0a53('0x4a')]['id']}})[_0x0a53('0x14')](handleEntityNotFound(_0x38058e,null))[_0x0a53('0x14')](function(_0xdcc659){if(_0xdcc659){return _0xdcc659[_0x0a53('0x118')](_0x3e6372[_0x0a53('0x4f')][_0x0a53('0x5d')],_[_0x0a53('0xef')](_0x3e6372[_0x0a53('0x4f')],[_0x0a53('0x5d'),'id'])||{});}})[_0x0a53('0x14')](respondWithResult(_0x38058e,null))[_0x0a53('0x1d')](handleError(_0x38058e,null));};exports['getProactiveActions']=function(_0x101d03,_0x3affca){var _0x37fa6f={};var _0x2d686f={};var _0x222457;var _0x2e9cf1;return db[_0x0a53('0x44')][_0x0a53('0x5a')]({'where':{'id':_0x101d03[_0x0a53('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3affca,null))[_0x0a53('0x14')](function(_0x87e5fe){if(_0x87e5fe){_0x222457=_0x87e5fe;_0x2d686f['model']=_[_0x0a53('0x35')](db[_0x0a53('0x11a')][_0x0a53('0x4c')]);_0x2d686f['query']=_[_0x0a53('0x35')](_0x101d03[_0x0a53('0x34')]);_0x2d686f[_0x0a53('0x36')]=_[_0x0a53('0x38')](_0x2d686f['model'],_0x2d686f[_0x0a53('0x34')]);_0x37fa6f[_0x0a53('0x37')]=_[_0x0a53('0x38')](_0x2d686f[_0x0a53('0x33')],qs[_0x0a53('0x39')](_0x101d03[_0x0a53('0x34')][_0x0a53('0x39')]));_0x37fa6f['attributes']=_0x37fa6f['attributes'][_0x0a53('0x3a')]?_0x37fa6f[_0x0a53('0x37')]:_0x2d686f[_0x0a53('0x33')];_0x37fa6f[_0x0a53('0x3d')]=qs[_0x0a53('0x3e')](_0x101d03['query'][_0x0a53('0x3e')]);_0x37fa6f['where']=qs[_0x0a53('0x36')](_[_0x0a53('0x40')](_0x101d03[_0x0a53('0x34')],_0x2d686f['filters']));if(_0x101d03[_0x0a53('0x34')][_0x0a53('0x41')]){_0x37fa6f[_0x0a53('0x3f')]=_[_0x0a53('0x42')](_0x37fa6f[_0x0a53('0x3f')],{'$or':_[_0x0a53('0x30')](_0x37fa6f[_0x0a53('0x37')],function(_0x1d111c){var _0x231f36={};_0x231f36[_0x1d111c]={'$like':'%'+_0x101d03[_0x0a53('0x34')]['filter']+'%'};return _0x231f36;})});}_0x37fa6f=_[_0x0a53('0x42')]({},_0x37fa6f,_0x101d03[_0x0a53('0x43')]);return _0x222457[_0x0a53('0x11b')](_0x37fa6f);}})[_0x0a53('0x14')](function(_0x5b2144){if(_0x5b2144){_0x2e9cf1=_0x5b2144['length'];if(!_0x101d03[_0x0a53('0x34')]['hasOwnProperty'](_0x0a53('0x3c'))){_0x37fa6f[_0x0a53('0x22')]=qs[_0x0a53('0x22')](_0x101d03[_0x0a53('0x34')][_0x0a53('0x22')]);_0x37fa6f[_0x0a53('0x25')]=qs['offset'](_0x101d03[_0x0a53('0x34')][_0x0a53('0x25')]);}return _0x222457[_0x0a53('0x11b')](_0x37fa6f);}})[_0x0a53('0x14')](function(_0x3e20f4){if(_0x3e20f4){return _0x3e20f4?{'count':_0x2e9cf1,'rows':_0x3e20f4}:null;}})[_0x0a53('0x14')](respondWithResult(_0x3affca,null))['catch'](handleError(_0x3affca,null));};exports[_0x0a53('0x11c')]=function(_0x5d199a,_0x433b81){var _0x3a4cb3=_0x5d199a[_0x0a53('0x34')][_0x0a53('0x11d')]==='false'?_0x0a53('0x11e'):_0x0a53('0x11f');return db[_0x0a53('0x44')][_0x0a53('0x4d')]({'attributes':['id',_0x3a4cb3],'where':{'id':_0x5d199a[_0x0a53('0x4a')]['id']}})['then'](handleEntityNotFound(_0x433b81,null))['then'](function(_0x123cd9){if(_0x123cd9){var _0x5d6228=_0x123cd9[_0x3a4cb3];var _0x3e95bd=_0x5d6228&&_0x5d6228[_0x0a53('0x120')]?_0x5d6228[_0x0a53('0x120')]:[];_0x433b81['send']({'fromKey':_[_0x0a53('0x6c')](_0x5d6228['fromKey'])?undefined:_0x5d6228[_0x0a53('0x121')],'count':_0x3e95bd[_0x0a53('0x3a')],'rows':_0x3e95bd});}})['catch'](handleError(_0x433b81,null));};exports[_0x0a53('0x122')]=function(_0x41b776,_0x2a2039){var _0x503aac={'raw':![],'where':{}};var _0x34c1c5={};var _0x353ce4={'count':0x0,'rows':[]};return db[_0x0a53('0x44')][_0x0a53('0x5a')]({'where':{'id':_0x41b776[_0x0a53('0x4a')]['id']}})[_0x0a53('0x14')](handleEntityNotFound(_0x2a2039,null))[_0x0a53('0x14')](function(_0x2d9e5c){if(_0x2d9e5c){_0x34c1c5[_0x0a53('0x33')]=_[_0x0a53('0x35')](db[_0x0a53('0xd0')][_0x0a53('0x4c')]);_0x34c1c5[_0x0a53('0x34')]=_['keys'](_0x41b776['query']);_0x34c1c5['filters']=_[_0x0a53('0x38')](_0x34c1c5[_0x0a53('0x33')],_0x34c1c5[_0x0a53('0x34')]);_0x503aac[_0x0a53('0x37')]=_[_0x0a53('0x38')](_0x34c1c5['model'],qs[_0x0a53('0x39')](_0x41b776['query'][_0x0a53('0x39')]));_0x503aac[_0x0a53('0x37')]=_0x503aac[_0x0a53('0x37')][_0x0a53('0x3a')]?_0x503aac['attributes']:_0x34c1c5[_0x0a53('0x33')];if(!_0x41b776[_0x0a53('0x34')][_0x0a53('0x3b')](_0x0a53('0x3c'))){_0x503aac[_0x0a53('0x22')]=qs[_0x0a53('0x22')](_0x41b776['query'][_0x0a53('0x22')]);_0x503aac[_0x0a53('0x25')]=qs[_0x0a53('0x25')](_0x41b776[_0x0a53('0x34')]['offset']);}_0x503aac[_0x0a53('0x3d')]=qs[_0x0a53('0x3e')](_0x41b776[_0x0a53('0x34')][_0x0a53('0x3e')]);_0x503aac[_0x0a53('0x3f')]=qs[_0x0a53('0x36')](_['pick'](_0x41b776[_0x0a53('0x34')],_0x34c1c5[_0x0a53('0x36')]));_0x503aac[_0x0a53('0x3f')][_0x0a53('0x5b')]=_0x2d9e5c['id'];if(_0x41b776[_0x0a53('0x34')]['filter']){_0x503aac['where']=_[_0x0a53('0x42')](_0x503aac['where'],{'$or':_[_0x0a53('0x30')](_0x503aac['attributes'],function(_0x5962ee){var _0x27d8a4={};_0x27d8a4[_0x5962ee]={'$like':'%'+_0x41b776[_0x0a53('0x34')]['filter']+'%'};return _0x27d8a4;})});}_0x503aac=_[_0x0a53('0x42')]({},_0x503aac,_0x41b776[_0x0a53('0x43')]);return db['ChatOfflineMessage'][_0x0a53('0x24')]({'where':_0x503aac[_0x0a53('0x3f')]})[_0x0a53('0x14')](function(_0xa51ffe){_0x353ce4['count']=_0xa51ffe;if(_0x41b776[_0x0a53('0x34')][_0x0a53('0x45')]){_0x503aac[_0x0a53('0x46')]=[{'all':!![]}];}else{_0x503aac['include']=[{'model':db[_0x0a53('0x8f')],'as':_0x0a53('0xf1'),'required':![]},{'model':db[_0x0a53('0x123')],'as':_0x0a53('0x124'),'required':![]}];}return db[_0x0a53('0xd0')][_0x0a53('0x47')](_0x503aac);})[_0x0a53('0x14')](function(_0x4223ab){_0x353ce4[_0x0a53('0x48')]=_0x4223ab;return _0x353ce4;});}})['then'](respondWithFilteredResult(_0x2a2039,_0x503aac))[_0x0a53('0x1d')](handleError(_0x2a2039,null));};exports['addAgents']=function(_0x6db847,_0x31c942){return db[_0x0a53('0x44')][_0x0a53('0x4d')]({'where':{'id':_0x6db847[_0x0a53('0x4a')]['id']}})['then'](handleEntityNotFound(_0x31c942,null))[_0x0a53('0x14')](function(_0x133bd8){if(_0x133bd8){return _0x133bd8[_0x0a53('0x125')](_0x6db847[_0x0a53('0x4f')][_0x0a53('0x5d')],_[_0x0a53('0xef')](_0x6db847[_0x0a53('0x4f')],[_0x0a53('0x5d'),'id'])||{})[_0x0a53('0xb2')](function(_0x490011){for(var _0x4d8dd4=0x0;_0x4d8dd4<_0x6db847['body'][_0x0a53('0x5d')][_0x0a53('0x3a')];_0x4d8dd4+=0x1){socket[_0x0a53('0x126')](_0x0a53('0x127'),{'UserId':Number(_0x6db847[_0x0a53('0x4f')][_0x0a53('0x5d')][_0x4d8dd4]),'ChatWebsiteId':Number(_0x6db847[_0x0a53('0x4a')]['id'])});}return _0x490011;});}})[_0x0a53('0x14')](respondWithResult(_0x31c942,null))[_0x0a53('0x1d')](handleError(_0x31c942,null));};exports[_0x0a53('0x128')]=function(_0x5d5e62,_0x175eca){return db[_0x0a53('0x44')][_0x0a53('0x4d')]({'where':{'id':_0x5d5e62[_0x0a53('0x4a')]['id']}})[_0x0a53('0x14')](handleEntityNotFound(_0x175eca,null))[_0x0a53('0x14')](function(_0x46b113){if(_0x46b113){return _0x46b113[_0x0a53('0x128')](_0x5d5e62['query'][_0x0a53('0x5d')])[_0x0a53('0x14')](function(){if(_['isArray'](_0x5d5e62[_0x0a53('0x34')][_0x0a53('0x5d')])){for(var _0x3402c1=0x0;_0x3402c1<_0x5d5e62[_0x0a53('0x34')][_0x0a53('0x5d')]['length'];_0x3402c1+=0x1){socket[_0x0a53('0x126')](_0x0a53('0x129'),{'UserId':Number(_0x5d5e62[_0x0a53('0x34')][_0x0a53('0x5d')][_0x3402c1]),'ChatWebsiteId':Number(_0x5d5e62[_0x0a53('0x4a')]['id'])});}}else{socket[_0x0a53('0x126')](_0x0a53('0x129'),{'UserId':Number(_0x5d5e62[_0x0a53('0x34')][_0x0a53('0x5d')]),'ChatWebsiteId':Number(_0x5d5e62[_0x0a53('0x4a')]['id'])});}});}})[_0x0a53('0x14')](respondWithStatusCode(_0x175eca,null))[_0x0a53('0x1d')](handleError(_0x175eca,null));};exports[_0x0a53('0x12a')]=function(_0x5f11f3,_0x486eab){var _0x5929c7={};var _0x3865b5={};var _0xc87833;var _0x14fa32;return db[_0x0a53('0x44')][_0x0a53('0x5a')]({'where':{'id':_0x5f11f3[_0x0a53('0x4a')]['id']}})['then'](handleEntityNotFound(_0x486eab,null))[_0x0a53('0x14')](function(_0x12ab73){if(_0x12ab73){_0xc87833=_0x12ab73;_0x3865b5['model']=_['keys'](db[_0x0a53('0xba')]['rawAttributes']);_0x3865b5[_0x0a53('0x34')]=_[_0x0a53('0x35')](_0x5f11f3[_0x0a53('0x34')]);_0x3865b5[_0x0a53('0x36')]=_['intersection'](_0x3865b5[_0x0a53('0x33')],_0x3865b5[_0x0a53('0x34')]);_0x5929c7[_0x0a53('0x37')]=_[_0x0a53('0x38')](_0x3865b5['model'],qs[_0x0a53('0x39')](_0x5f11f3[_0x0a53('0x34')][_0x0a53('0x39')]));_0x5929c7[_0x0a53('0x37')]=_0x5929c7[_0x0a53('0x37')][_0x0a53('0x3a')]?_0x5929c7[_0x0a53('0x37')]:_0x3865b5[_0x0a53('0x33')];_0x5929c7[_0x0a53('0x3d')]=qs[_0x0a53('0x3e')](_0x5f11f3[_0x0a53('0x34')][_0x0a53('0x3e')]);_0x5929c7[_0x0a53('0x3f')]=qs['filters'](_[_0x0a53('0x40')](_0x5f11f3['query'],_0x3865b5['filters']));if(_0x5f11f3[_0x0a53('0x34')][_0x0a53('0x41')]){_0x5929c7['where']=_['merge'](_0x5929c7[_0x0a53('0x3f')],{'$or':_[_0x0a53('0x30')](_0x5929c7[_0x0a53('0x37')],function(_0x42d870){var _0x18f64b={};_0x18f64b[_0x42d870]={'$like':'%'+_0x5f11f3[_0x0a53('0x34')]['filter']+'%'};return _0x18f64b;})});}_0x5929c7=_[_0x0a53('0x42')]({},_0x5929c7,_0x5f11f3[_0x0a53('0x43')]);return _0xc87833[_0x0a53('0x12a')](_0x5929c7);}})[_0x0a53('0x14')](function(_0x1fd100){if(_0x1fd100){_0x14fa32=_0x1fd100[_0x0a53('0x3a')];if(!_0x5f11f3[_0x0a53('0x34')]['hasOwnProperty']('nolimit')){_0x5929c7['limit']=qs[_0x0a53('0x22')](_0x5f11f3[_0x0a53('0x34')][_0x0a53('0x22')]);_0x5929c7[_0x0a53('0x25')]=qs[_0x0a53('0x25')](_0x5f11f3[_0x0a53('0x34')][_0x0a53('0x25')]);}return _0xc87833[_0x0a53('0x12a')](_0x5929c7);}})[_0x0a53('0x14')](function(_0x2cf21b){if(_0x2cf21b){return _0x2cf21b?{'count':_0x14fa32,'rows':_0x2cf21b}:null;}})[_0x0a53('0x14')](respondWithResult(_0x486eab,null))['catch'](handleError(_0x486eab,null));};
\ No newline at end of file
+var _0x049d=['describe','addDisposition','ChatWebsiteId','getDispositions','findOne','Disposition','merge','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','../../config/license/util','getLicense','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','isNil','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','existsSync','setUA','user-agent','getResult','chat','Sequelize','difference','createdAt','updatedAt','ListId','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','ChatApplication','Applications','account','list','applications','orderBy','priority','asc','CmContact','customerIp','headers','cf-connecting-ip','x-forwarded-for','split','firstName','lastName','x-real-port','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','contact','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','User','UserId','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','files','no\x20available\x20attributes','CompanyId','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','mapKeyOffline','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','offlineMessageBody','fromString','originalname','mimetype','offline-chat','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','email','user','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','Chat','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Owner','fullname','internal','Tags','tag','timezone','iftime\x20%s','interval','true','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','getSnippet','Interval','Intervals','getProactiveActions','virtual','custom','License','chatLicenseExceeded','all','some','utf8','URL','origin','remote','x-real-ip','connection','remoteAddress','replace','render','alignment','verticalAlignment','color','labelText','textColor','textButtonColor','color_button','hideWhenOffline','addApplications','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','getApplications','chatProactiveAction','addProactiveActions','omit','ChatProactiveAction','getFields','false','onlineForm','items','getOfflineMessages','ChatOfflineMessage','Contact','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','bluebird','mustache','ejs','fs-extra','lodash','querystring','ioredis','api','../../mysqldb','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','http','client','request','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','offset','undefined','limit','count','set','json','update','destroy','get','UserProfileResource','stack','name','send','index','Pause','rawAttributes','fieldName','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','type','VIRTUAL','filter','options','ChatWebsite','includeAll','include','findAll','rows','show','mandatoryDispositionPause','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','params'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x049d,0xcf));var _0xd049=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x049d[_0x321bb2];return _0x9c12ed;};'use strict';var BPromise=require(_0xd049('0x0'));var Mustache=require(_0xd049('0x1'));var util=require('util');var path=require('path');var ejs=require(_0xd049('0x2'));var fs=require('fs');var fs_extra=require(_0xd049('0x3'));var _=require(_0xd049('0x4'));var querystring=require(_0xd049('0x5'));var Redis=require(_0xd049('0x6'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xd049('0x7'));var config=require('../../config/environment');var url=require('url');var db=require(_0xd049('0x8'))['db'];config['redis']=_['defaults'](config[_0xd049('0x9')],{'host':_0xd049('0xa'),'port':0x18eb});var socket=require(_0xd049('0xb'))(new Redis(config[_0xd049('0x9')]));require(_0xd049('0xc'))[_0xd049('0xd')](socket);var htmlToText=require(_0xd049('0xe'));var jayson=require(_0xd049('0xf'));var client=jayson['client'][_0xd049('0x10')]({'port':0x232c});var client9002=jayson[_0xd049('0x11')][_0xd049('0x10')]({'port':0x232a});var client9003=jayson[_0xd049('0x11')]['http']({'port':0x232b});var client9001=jayson[_0xd049('0x11')][_0xd049('0x10')]({'port':0x2329});function respondWithRpcPromise(_0x25179a,_0x1fcee3,_0x1e503a,_0x5bb4cf){return new BPromise(function(_0x52f591,_0x42ef63){var _0x157555=_0x5bb4cf||client;return _0x157555[_0xd049('0x12')](_0x25179a,_0x1e503a)[_0xd049('0x13')](function(_0x2117e7){logger[_0xd049('0x14')](_0xd049('0x15'),_0x1fcee3,'request\x20sent');logger[_0xd049('0x16')](_0xd049('0x17'),_0x1fcee3,_0xd049('0x18'),JSON[_0xd049('0x19')](_0x2117e7));if(_0x2117e7[_0xd049('0x1a')]){if(_0x2117e7[_0xd049('0x1a')][_0xd049('0x1b')]===0x1f4){logger[_0xd049('0x1a')](_0xd049('0x15'),_0x1fcee3,_0x2117e7['error'][_0xd049('0x1c')]);return _0x42ef63(_0x2117e7[_0xd049('0x1a')][_0xd049('0x1c')]);}logger[_0xd049('0x1a')](_0xd049('0x15'),_0x1fcee3,_0x2117e7[_0xd049('0x1a')][_0xd049('0x1c')]);return _0x52f591(_0x2117e7[_0xd049('0x1a')][_0xd049('0x1c')]);}else{logger['info'](_0xd049('0x15'),_0x1fcee3,_0xd049('0x18'));_0x52f591(_0x2117e7['result'][_0xd049('0x1c')]);}})[_0xd049('0x1d')](function(_0x26e80d){logger[_0xd049('0x1a')](_0xd049('0x15'),_0x1fcee3,_0x26e80d);_0x42ef63(_0x26e80d);});});}function respondWithStatusCode(_0x5f4b3c,_0x5db176){_0x5db176=_0x5db176||0xcc;return function(_0x1e6976){if(_0x1e6976){return _0x5f4b3c[_0xd049('0x1e')](_0x5db176);}return _0x5f4b3c[_0xd049('0x1f')](_0x5db176)[_0xd049('0x20')]();};}function respondWithResult(_0x33255c,_0x4b0ed4){_0x4b0ed4=_0x4b0ed4||0xc8;return function(_0x1e3293){if(_0x1e3293){return _0x33255c['status'](_0x4b0ed4)['json'](_0x1e3293);}};}function respondWithFilteredResult(_0xfeeaf9,_0x241cc3){return function(_0x1ea484){if(_0x1ea484){var _0x53a110=typeof _0x241cc3[_0xd049('0x21')]===_0xd049('0x22')&&typeof _0x241cc3[_0xd049('0x23')]===_0xd049('0x22');var _0x4ac63b=_0x1ea484[_0xd049('0x24')];var _0x571068=_0x53a110?0x0:_0x241cc3[_0xd049('0x21')];var _0x440c39=_0x53a110?_0x1ea484['count']:_0x241cc3[_0xd049('0x21')]+_0x241cc3[_0xd049('0x23')];var _0x30c3d8;if(_0x440c39>=_0x4ac63b){_0x440c39=_0x4ac63b;_0x30c3d8=0xc8;}else{_0x30c3d8=0xce;}_0xfeeaf9[_0xd049('0x1f')](_0x30c3d8);return _0xfeeaf9[_0xd049('0x25')]('Content-Range',_0x571068+'-'+_0x440c39+'/'+_0x4ac63b)[_0xd049('0x26')](_0x1ea484);}return null;};}function saveUpdates(_0x5e61d3){return function(_0x263e7d){if(_0x263e7d){return _0x263e7d[_0xd049('0x27')](_0x5e61d3)[_0xd049('0x13')](function(_0xd40933){return _0xd40933;});}return null;};}function removeEntity(_0x382080){return function(_0x1fe16d){if(_0x1fe16d){return _0x1fe16d[_0xd049('0x28')]()[_0xd049('0x13')](function(){var _0x1c8007=_0x1fe16d[_0xd049('0x29')]({'plain':!![]});var _0x35097e='ChatWebsites';return db[_0xd049('0x2a')]['destroy']({'where':{'type':_0x35097e,'resourceId':_0x1c8007['id']}})['then'](function(){return _0x1fe16d;});})[_0xd049('0x13')](function(){_0x382080[_0xd049('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a7470){return function(_0x4da09a){if(!_0x4da09a){_0x5a7470[_0xd049('0x1e')](0x194);}return _0x4da09a;};}function handleError(_0x69199d,_0x1b05a3){_0x1b05a3=_0x1b05a3||0x1f4;return function(_0x9b53f6){logger[_0xd049('0x1a')](_0x9b53f6[_0xd049('0x2b')]);if(_0x9b53f6['name']){delete _0x9b53f6[_0xd049('0x2c')];}_0x69199d[_0xd049('0x1f')](_0x1b05a3)[_0xd049('0x2d')](_0x9b53f6);};}exports[_0xd049('0x2e')]=function(_0x71e6fc,_0x170a1e){var _0x4418bb={'include':[{'model':db[_0xd049('0x2f')],'as':'mandatoryDispositionPause'}]},_0x5b56f8={},_0x2bb61d={'count':0x0,'rows':[]};var _0x27742b=_['map'](db['ChatWebsite'][_0xd049('0x30')],function(_0x2a2be9){return{'name':_0x2a2be9[_0xd049('0x31')],'type':_0x2a2be9['type']['key']};});_0x5b56f8[_0xd049('0x32')]=_[_0xd049('0x33')](_0x27742b,_0xd049('0x2c'));_0x5b56f8[_0xd049('0x34')]=_[_0xd049('0x35')](_0x71e6fc[_0xd049('0x34')]);_0x5b56f8[_0xd049('0x36')]=_[_0xd049('0x37')](_0x5b56f8[_0xd049('0x32')],_0x5b56f8[_0xd049('0x34')]);_0x4418bb[_0xd049('0x38')]=_[_0xd049('0x37')](_0x5b56f8['model'],qs['fields'](_0x71e6fc[_0xd049('0x34')][_0xd049('0x39')]));_0x4418bb[_0xd049('0x38')]=_0x4418bb[_0xd049('0x38')][_0xd049('0x3a')]?_0x4418bb['attributes']:_0x5b56f8[_0xd049('0x32')];if(!_0x71e6fc[_0xd049('0x34')][_0xd049('0x3b')](_0xd049('0x3c'))){_0x4418bb['limit']=qs[_0xd049('0x23')](_0x71e6fc[_0xd049('0x34')]['limit']);_0x4418bb[_0xd049('0x21')]=qs[_0xd049('0x21')](_0x71e6fc[_0xd049('0x34')][_0xd049('0x21')]);}_0x4418bb[_0xd049('0x3d')]=qs[_0xd049('0x3e')](_0x71e6fc['query'][_0xd049('0x3e')]);_0x4418bb['where']=qs[_0xd049('0x36')](_[_0xd049('0x3f')](_0x71e6fc[_0xd049('0x34')],_0x5b56f8[_0xd049('0x36')]),_0x27742b);if(_0x71e6fc['query']['filter']){_0x4418bb[_0xd049('0x40')]=_['merge'](_0x4418bb['where'],{'$or':_[_0xd049('0x33')](_0x27742b,function(_0x509207){if(_0x509207[_0xd049('0x41')]!==_0xd049('0x42')){var _0x257cfa={};_0x257cfa[_0x509207['name']]={'$like':'%'+_0x71e6fc[_0xd049('0x34')][_0xd049('0x43')]+'%'};return _0x257cfa;}})});}_0x4418bb=_['merge']({},_0x4418bb,_0x71e6fc[_0xd049('0x44')]);var _0x6cf10={'where':_0x4418bb[_0xd049('0x40')]};return db[_0xd049('0x45')]['count'](_0x6cf10)['then'](function(_0x4ce495){_0x2bb61d[_0xd049('0x24')]=_0x4ce495;if(_0x71e6fc['query'][_0xd049('0x46')]){_0x4418bb[_0xd049('0x47')]=[{'all':!![]}];}return db[_0xd049('0x45')][_0xd049('0x48')](_0x4418bb);})[_0xd049('0x13')](function(_0x59643d){_0x2bb61d[_0xd049('0x49')]=_0x59643d;return _0x2bb61d;})[_0xd049('0x13')](respondWithFilteredResult(_0x170a1e,_0x4418bb))[_0xd049('0x1d')](handleError(_0x170a1e,null));};exports[_0xd049('0x4a')]=function(_0xdad9de,_0x1a135f){var _0x43c540={'raw':![],'where':{'id':_0xdad9de['params']['id']},'include':[{'model':db['Pause'],'as':_0xd049('0x4b')}]},_0x3c5553={};_0x3c5553[_0xd049('0x32')]=_[_0xd049('0x35')](db[_0xd049('0x45')]['rawAttributes']);_0x3c5553[_0xd049('0x34')]=_['keys'](_0xdad9de[_0xd049('0x34')]);_0x3c5553[_0xd049('0x36')]=_[_0xd049('0x37')](_0x3c5553[_0xd049('0x32')],_0x3c5553[_0xd049('0x34')]);_0x43c540[_0xd049('0x38')]=_[_0xd049('0x37')](_0x3c5553['model'],qs[_0xd049('0x39')](_0xdad9de[_0xd049('0x34')][_0xd049('0x39')]));_0x43c540[_0xd049('0x38')]=_0x43c540[_0xd049('0x38')]['length']?_0x43c540[_0xd049('0x38')]:_0x3c5553[_0xd049('0x32')];if(_0xdad9de['query'][_0xd049('0x46')]){_0x43c540[_0xd049('0x47')]=[{'all':!![]}];}_0x43c540=_['merge']({},_0x43c540,_0xdad9de[_0xd049('0x44')]);return db[_0xd049('0x45')]['find'](_0x43c540)[_0xd049('0x13')](handleEntityNotFound(_0x1a135f,null))['then'](respondWithResult(_0x1a135f,null))['catch'](handleError(_0x1a135f,null));};exports[_0xd049('0x4c')]=function(_0x22e4bc,_0x305a52){return db['ChatWebsite'][_0xd049('0x4c')](_0x22e4bc[_0xd049('0x4d')],{})[_0xd049('0x13')](function(_0x1f8dd2){var _0x301625=_0x22e4bc['user'][_0xd049('0x29')]({'plain':!![]});if(!_0x301625)throw new Error(_0xd049('0x4e'));if(_0x301625[_0xd049('0x4f')]==='user'){var _0x2d9b6d=_0x1f8dd2[_0xd049('0x29')]({'plain':!![]});var _0x1b4159='ChatWebsites';return db[_0xd049('0x50')]['find']({'where':{'name':_0x1b4159,'userProfileId':_0x301625['userProfileId']},'raw':!![]})['then'](function(_0x3f10ca){if(_0x3f10ca&&_0x3f10ca['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x2d9b6d[_0xd049('0x2c')],'resourceId':_0x2d9b6d['id'],'type':_0x3f10ca[_0xd049('0x2c')],'sectionId':_0x3f10ca['id']},{})[_0xd049('0x13')](function(){return _0x1f8dd2;});}else{return _0x1f8dd2;}})['catch'](function(_0x5dce70){logger[_0xd049('0x1a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5dce70);throw _0x5dce70;});}return _0x1f8dd2;})[_0xd049('0x13')](respondWithResult(_0x305a52,0xc9))[_0xd049('0x1d')](handleError(_0x305a52,null));};exports[_0xd049('0x27')]=function(_0x23f7ba,_0x2eefa6){if(_0x23f7ba['body']['id']){delete _0x23f7ba['body']['id'];}return db['ChatWebsite'][_0xd049('0x51')]({'where':{'id':_0x23f7ba[_0xd049('0x52')]['id']},'include':[{'model':db[_0xd049('0x2f')],'as':_0xd049('0x4b')}]})[_0xd049('0x13')](handleEntityNotFound(_0x2eefa6,null))['then'](saveUpdates(_0x23f7ba['body'],null))[_0xd049('0x13')](respondWithResult(_0x2eefa6,null))[_0xd049('0x1d')](handleError(_0x2eefa6,null));};exports[_0xd049('0x28')]=function(_0x45ebb3,_0x295d49){return db['ChatWebsite'][_0xd049('0x51')]({'where':{'id':_0x45ebb3['params']['id']}})[_0xd049('0x13')](handleEntityNotFound(_0x295d49,null))[_0xd049('0x13')](removeEntity(_0x295d49,null))[_0xd049('0x1d')](handleError(_0x295d49,null));};exports[_0xd049('0x53')]=function(_0x40fac7,_0x487c55){return db['ChatWebsite'][_0xd049('0x53')]()['then'](respondWithResult(_0x487c55,null))['catch'](handleError(_0x487c55,null));};exports[_0xd049('0x54')]=function(_0x22b839,_0x13cddc){if(_0x22b839[_0xd049('0x4d')]['id']){delete _0x22b839[_0xd049('0x4d')]['id'];}return db[_0xd049('0x45')]['find']({'where':{'id':_0x22b839['params']['id']}})[_0xd049('0x13')](handleEntityNotFound(_0x13cddc,null))['then'](function(_0x3798c5){if(_0x3798c5){_0x22b839[_0xd049('0x4d')][_0xd049('0x55')]=_0x3798c5['id'];return db['Disposition'][_0xd049('0x4c')](_0x22b839[_0xd049('0x4d')]);}})['then'](respondWithResult(_0x13cddc,null))[_0xd049('0x1d')](handleError(_0x13cddc,null));};exports[_0xd049('0x56')]=function(_0x3aa0db,_0x528b6e){var _0x4b176f={'raw':![],'where':{}};var _0x103df6={};var _0x33dfa4={'count':0x0,'rows':[]};return db[_0xd049('0x45')][_0xd049('0x57')]({'where':{'id':_0x3aa0db[_0xd049('0x52')]['id']}})['then'](handleEntityNotFound(_0x528b6e,null))[_0xd049('0x13')](function(_0x21dd5f){if(_0x21dd5f){_0x103df6[_0xd049('0x32')]=_['keys'](db[_0xd049('0x58')]['rawAttributes']);_0x103df6[_0xd049('0x34')]=_[_0xd049('0x35')](_0x3aa0db[_0xd049('0x34')]);_0x103df6['filters']=_[_0xd049('0x37')](_0x103df6[_0xd049('0x32')],_0x103df6[_0xd049('0x34')]);_0x4b176f[_0xd049('0x38')]=_[_0xd049('0x37')](_0x103df6[_0xd049('0x32')],qs[_0xd049('0x39')](_0x3aa0db[_0xd049('0x34')]['fields']));_0x4b176f['attributes']=_0x4b176f[_0xd049('0x38')][_0xd049('0x3a')]?_0x4b176f['attributes']:_0x103df6[_0xd049('0x32')];if(!_0x3aa0db['query']['hasOwnProperty'](_0xd049('0x3c'))){_0x4b176f[_0xd049('0x23')]=qs[_0xd049('0x23')](_0x3aa0db[_0xd049('0x34')][_0xd049('0x23')]);_0x4b176f[_0xd049('0x21')]=qs[_0xd049('0x21')](_0x3aa0db[_0xd049('0x34')][_0xd049('0x21')]);}_0x4b176f[_0xd049('0x3d')]=qs[_0xd049('0x3e')](_0x3aa0db[_0xd049('0x34')][_0xd049('0x3e')]);_0x4b176f[_0xd049('0x40')]=qs['filters'](_['pick'](_0x3aa0db[_0xd049('0x34')],_0x103df6[_0xd049('0x36')]));_0x4b176f[_0xd049('0x40')]['ChatWebsiteId']=_0x21dd5f['id'];if(_0x3aa0db['query'][_0xd049('0x43')]){_0x4b176f[_0xd049('0x40')]=_[_0xd049('0x59')](_0x4b176f[_0xd049('0x40')],{'$or':_[_0xd049('0x33')](_0x4b176f[_0xd049('0x38')],function(_0x5886f2){var _0x57f547={};_0x57f547[_0x5886f2]={'$like':'%'+_0x3aa0db[_0xd049('0x34')][_0xd049('0x43')]+'%'};return _0x57f547;})});}_0x4b176f=_[_0xd049('0x59')]({},_0x4b176f,_0x3aa0db['options']);return db[_0xd049('0x58')]['count']({'where':_0x4b176f[_0xd049('0x40')]})[_0xd049('0x13')](function(_0xa641e9){_0x33dfa4[_0xd049('0x24')]=_0xa641e9;if(_0x3aa0db[_0xd049('0x34')][_0xd049('0x46')]){_0x4b176f[_0xd049('0x47')]=[{'all':!![]}];}return db[_0xd049('0x58')]['findAll'](_0x4b176f);})['then'](function(_0xdd46cf){_0x33dfa4['rows']=_0xdd46cf;return _0x33dfa4;});}})[_0xd049('0x13')](respondWithFilteredResult(_0x528b6e,_0x4b176f))[_0xd049('0x1d')](handleError(_0x528b6e,null));};exports['removeDispositions']=function(_0x459f7c,_0x20cc9c){return db['ChatWebsite'][_0xd049('0x51')]({'where':{'id':_0x459f7c[_0xd049('0x52')]['id']}})[_0xd049('0x13')](handleEntityNotFound(_0x20cc9c,null))[_0xd049('0x13')](function(_0x5760e0){if(_0x5760e0){return _0x5760e0[_0xd049('0x5a')](_0x459f7c['query'][_0xd049('0x5b')]);}})[_0xd049('0x13')](respondWithStatusCode(_0x20cc9c,null))['catch'](handleError(_0x20cc9c,null));};exports[_0xd049('0x5c')]=function(_0x329843,_0x24ea1f){if(_0x329843[_0xd049('0x4d')]['id']){delete _0x329843[_0xd049('0x4d')]['id'];}return db[_0xd049('0x45')][_0xd049('0x51')]({'where':{'id':_0x329843[_0xd049('0x52')]['id']}})[_0xd049('0x13')](handleEntityNotFound(_0x24ea1f,null))['then'](function(_0x4a0762){if(_0x4a0762){_0x329843[_0xd049('0x4d')][_0xd049('0x55')]=_0x4a0762['id'];return db[_0xd049('0x5d')][_0xd049('0x4c')](_0x329843[_0xd049('0x4d')]);}})['then'](respondWithResult(_0x24ea1f,null))['catch'](handleError(_0x24ea1f,null));};exports[_0xd049('0x5e')]=function(_0x38856e,_0x5c1100){var _0x721048={'raw':![],'where':{}};var _0x25c8c7={};var _0x6a7d19={'count':0x0,'rows':[]};return db[_0xd049('0x45')][_0xd049('0x57')]({'where':{'id':_0x38856e['params']['id']}})[_0xd049('0x13')](handleEntityNotFound(_0x5c1100,null))[_0xd049('0x13')](function(_0x16c02d){if(_0x16c02d){_0x25c8c7['model']=_[_0xd049('0x35')](db[_0xd049('0x5d')]['rawAttributes']);_0x25c8c7[_0xd049('0x34')]=_['keys'](_0x38856e['query']);_0x25c8c7[_0xd049('0x36')]=_[_0xd049('0x37')](_0x25c8c7['model'],_0x25c8c7['query']);_0x721048[_0xd049('0x38')]=_[_0xd049('0x37')](_0x25c8c7[_0xd049('0x32')],qs[_0xd049('0x39')](_0x38856e[_0xd049('0x34')][_0xd049('0x39')]));_0x721048['attributes']=_0x721048['attributes'][_0xd049('0x3a')]?_0x721048[_0xd049('0x38')]:_0x25c8c7[_0xd049('0x32')];if(!_0x38856e[_0xd049('0x34')][_0xd049('0x3b')]('nolimit')){_0x721048['limit']=qs[_0xd049('0x23')](_0x38856e[_0xd049('0x34')][_0xd049('0x23')]);_0x721048[_0xd049('0x21')]=qs[_0xd049('0x21')](_0x38856e[_0xd049('0x34')][_0xd049('0x21')]);}_0x721048[_0xd049('0x3d')]=qs[_0xd049('0x3e')](_0x38856e[_0xd049('0x34')][_0xd049('0x3e')]);_0x721048[_0xd049('0x40')]=qs[_0xd049('0x36')](_[_0xd049('0x3f')](_0x38856e['query'],_0x25c8c7['filters']));_0x721048[_0xd049('0x40')][_0xd049('0x55')]=_0x16c02d['id'];if(_0x38856e['query']['filter']){_0x721048[_0xd049('0x40')]=_[_0xd049('0x59')](_0x721048[_0xd049('0x40')],{'$or':_[_0xd049('0x33')](_0x721048[_0xd049('0x38')],function(_0x368fba){var _0x4bd406={};_0x4bd406[_0x368fba]={'$like':'%'+_0x38856e[_0xd049('0x34')]['filter']+'%'};return _0x4bd406;})});}_0x721048=_[_0xd049('0x59')]({},_0x721048,_0x38856e[_0xd049('0x44')]);return db[_0xd049('0x5d')]['count']({'where':_0x721048['where']})[_0xd049('0x13')](function(_0x46ae59){_0x6a7d19[_0xd049('0x24')]=_0x46ae59;if(_0x38856e[_0xd049('0x34')][_0xd049('0x46')]){_0x721048[_0xd049('0x47')]=[{'all':!![]}];}return db[_0xd049('0x5d')][_0xd049('0x48')](_0x721048);})[_0xd049('0x13')](function(_0x5de90a){_0x6a7d19[_0xd049('0x49')]=_0x5de90a;return _0x6a7d19;});}})['then'](respondWithFilteredResult(_0x5c1100,_0x721048))['catch'](handleError(_0x5c1100,null));};exports[_0xd049('0x5f')]=function(_0x358266,_0xcb2a42){return db['ChatWebsite'][_0xd049('0x51')]({'where':{'id':_0x358266[_0xd049('0x52')]['id']}})['then'](handleEntityNotFound(_0xcb2a42,null))[_0xd049('0x13')](function(_0x343176){if(_0x343176){return _0x343176['removeAnswers'](_0x358266[_0xd049('0x34')][_0xd049('0x5b')]);}})[_0xd049('0x13')](respondWithStatusCode(_0xcb2a42,null))[_0xd049('0x1d')](handleError(_0xcb2a42,null));};exports['addLogo']=function(_0x1cd9a8,_0x3576ec){_0x1cd9a8[_0xd049('0x4d')][_0xd049('0x60')]=_0x1cd9a8[_0xd049('0x61')][_0xd049('0x62')];return db['ChatWebsite']['find']({'where':{'id':_0x1cd9a8[_0xd049('0x52')]['id']}})[_0xd049('0x13')](handleEntityNotFound(_0x3576ec,null))[_0xd049('0x13')](saveUpdates(_0x1cd9a8[_0xd049('0x4d')],null))[_0xd049('0x13')](respondWithResult(_0x3576ec,null))[_0xd049('0x1d')](handleError(_0x3576ec,null));};exports[_0xd049('0x63')]=function(_0x3847a0,_0x3e1b71){_0x3847a0['body'][_0xd049('0x64')]=_0x3847a0[_0xd049('0x61')][_0xd049('0x62')];return db[_0xd049('0x45')][_0xd049('0x51')]({'where':{'id':_0x3847a0[_0xd049('0x52')]['id']}})[_0xd049('0x13')](handleEntityNotFound(_0x3e1b71,null))[_0xd049('0x13')](saveUpdates(_0x3847a0[_0xd049('0x4d')],null))[_0xd049('0x13')](respondWithResult(_0x3e1b71,null))[_0xd049('0x1d')](handleError(_0x3e1b71,null));};exports[_0xd049('0x65')]=function(_0x1161ad,_0x4478f5){_0x1161ad[_0xd049('0x4d')][_0xd049('0x66')]=_0x1161ad[_0xd049('0x61')][_0xd049('0x62')];return db[_0xd049('0x45')][_0xd049('0x51')]({'where':{'id':_0x1161ad['params']['id']}})['then'](handleEntityNotFound(_0x4478f5,null))[_0xd049('0x13')](saveUpdates(_0x1161ad['body'],null))[_0xd049('0x13')](respondWithResult(_0x4478f5,null))[_0xd049('0x1d')](handleError(_0x4478f5,null));};exports[_0xd049('0x67')]=function(_0x128577,_0x51bbd7){_0x128577[_0xd049('0x4d')][_0xd049('0x68')]=_0x128577[_0xd049('0x61')]['filename'];return db[_0xd049('0x45')][_0xd049('0x51')]({'where':{'id':_0x128577[_0xd049('0x52')]['id']}})[_0xd049('0x13')](handleEntityNotFound(_0x51bbd7,null))['then'](saveUpdates(_0x128577['body'],null))[_0xd049('0x13')](respondWithResult(_0x51bbd7,null))[_0xd049('0x1d')](handleError(_0x51bbd7,null));};exports[_0xd049('0x69')]=function(_0xb1b24b,_0x5b9863){var _0x1eb738=path[_0xd049('0x6a')](config[_0xd049('0x6b')],'server/files/images/logos/default_logo.svg');var _0x43c35f={'where':{'id':_0xb1b24b[_0xd049('0x52')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x2530fb=![];return require(_0xd049('0x6c'))[_0xd049('0x6d')]()[_0xd049('0x13')](function(_0x2a5459){if(_0x2a5459){_0x2530fb=_0x2a5459['custom'];}})[_0xd049('0x13')](function(){return db['ChatWebsite'][_0xd049('0x51')](_0x43c35f);})[_0xd049('0x13')](handleEntityNotFound(_0x5b9863,null))[_0xd049('0x13')](function(_0xbdd754){if(_0xbdd754){if(!_['isNil'](_0xbdd754['sitepic'])){if(fs['existsSync'](path['join'](config[_0xd049('0x6b')],_0xd049('0x6e'),_0xbdd754[_0xd049('0x60')]))&&_0x2530fb){_0x1eb738=path[_0xd049('0x6a')](config[_0xd049('0x6b')],_0xd049('0x6e'),_0xbdd754[_0xd049('0x60')]);}}return _0x5b9863[_0xd049('0x6f')](_0x1eb738);}})[_0xd049('0x1d')](handleError(_0x5b9863,null));};exports[_0xd049('0x70')]=function(_0x20962a,_0x529339){var _0x599226=path['join'](config[_0xd049('0x6b')],_0xd049('0x71'));var _0x3a649a={'where':{'id':_0x20962a[_0xd049('0x52')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db['ChatWebsite'][_0xd049('0x51')](_0x3a649a)[_0xd049('0x13')](handleEntityNotFound(_0x529339,null))[_0xd049('0x13')](function(_0x2439c9){if(_0x2439c9){if(!_[_0xd049('0x72')](_0x2439c9[_0xd049('0x64')])){if(fs['existsSync'](path[_0xd049('0x6a')](config[_0xd049('0x6b')],'server/files/images/avatars/',_0x2439c9[_0xd049('0x64')]))){_0x599226=path[_0xd049('0x6a')](config[_0xd049('0x6b')],_0xd049('0x73'),_0x2439c9[_0xd049('0x64')]);}}return _0x529339['download'](_0x599226);}})[_0xd049('0x1d')](handleError(_0x529339,null));};exports['getCustomerAvatar']=function(_0x4f0925,_0x43bca1){var _0x23fdcf=path[_0xd049('0x6a')](config['root'],_0xd049('0x74'));var _0x287dbb={'where':{'id':_0x4f0925[_0xd049('0x52')]['id']},'attributes':['id','customerAvatar',_0xd049('0x75')],'raw':!![]};return db[_0xd049('0x45')][_0xd049('0x51')](_0x287dbb)['then'](handleEntityNotFound(_0x43bca1,null))[_0xd049('0x13')](function(_0xa8df35){if(_0xa8df35){if(!_['isNil'](_0xa8df35['customerAvatar'])){if(fs['existsSync'](path[_0xd049('0x6a')](config['root'],_0xd049('0x73'),_0xa8df35[_0xd049('0x66')]))&&_0xa8df35['showCustomerAvatar']){_0x23fdcf=path[_0xd049('0x6a')](config[_0xd049('0x6b')],_0xd049('0x73'),_0xa8df35[_0xd049('0x66')]);}}return _0x43bca1[_0xd049('0x6f')](_0x23fdcf);}})['catch'](handleError(_0x43bca1,null));};exports['getSystemAvatar']=function(_0x51fdfc,_0x56f1ac){var _0x53bb2b=path[_0xd049('0x6a')](config['root'],_0xd049('0x76'));var _0x26a3f5={'where':{'id':_0x51fdfc[_0xd049('0x52')]['id']},'attributes':['id',_0xd049('0x68')],'raw':!![]};return db[_0xd049('0x45')]['find'](_0x26a3f5)[_0xd049('0x13')](handleEntityNotFound(_0x56f1ac,null))[_0xd049('0x13')](function(_0x5d0170){if(_0x5d0170){if(!_['isNil'](_0x5d0170[_0xd049('0x68')])){if(fs[_0xd049('0x77')](path[_0xd049('0x6a')](config[_0xd049('0x6b')],_0xd049('0x73'),_0x5d0170[_0xd049('0x68')]))){_0x53bb2b=path[_0xd049('0x6a')](config['root'],_0xd049('0x73'),_0x5d0170[_0xd049('0x68')]);}}return _0x56f1ac[_0xd049('0x6f')](_0x53bb2b);}})[_0xd049('0x1d')](handleError(_0x56f1ac,null));};exports['notify']=function(_0x2843d4,_0x185b25){var _0x5d353e=require('user-agent-parser');var _0x3b5a42=new _0x5d353e();var _0x51a214=_0x3b5a42[_0xd049('0x78')](_0x2843d4['headers'][_0xd049('0x79')])[_0xd049('0x7a')]();var _0x26db11={'body':_0x2843d4[_0xd049('0x4d')],'channel':_0xd049('0x7b')};var _0x18ef16=[];var _0x429d7b=[];var _0x1083da={};var _0x51862b=![];return db['CmContact']['describe']()['then'](function(_0x70dd99){if(!_0x70dd99){throw new db[(_0xd049('0x7c'))]['ValidationError']('no\x20available\x20attributes');}_0x18ef16=_[_0xd049('0x7d')](_[_0xd049('0x35')](_0x70dd99),[_0xd049('0x7e'),_0xd049('0x7f')]);_0x429d7b=_[_0xd049('0x7d')](_[_0xd049('0x35')](_0x70dd99),['createdAt','updatedAt','CompanyId',_0xd049('0x80')]);if(_0x2843d4[_0xd049('0x4d')]['id']){delete _0x2843d4[_0xd049('0x4d')]['id'];}if(_[_0xd049('0x72')](_0x2843d4[_0xd049('0x4d')][_0xd049('0x81')])){throw new db[(_0xd049('0x7c'))][(_0xd049('0x82'))](_0xd049('0x83'));}if(_[_0xd049('0x72')](_0x2843d4[_0xd049('0x4d')][_0xd049('0x4d')])||_0x2843d4[_0xd049('0x4d')]['body']===''){throw new db['Sequelize'][(_0xd049('0x82'))](_0xd049('0x84'));}if(_[_0xd049('0x72')](_0x2843d4[_0xd049('0x4d')][_0xd049('0x85')])){throw new db[(_0xd049('0x7c'))][(_0xd049('0x82'))](_0xd049('0x86')+_0x429d7b);}if(!_[_0xd049('0x87')](_0x429d7b,_0x2843d4[_0xd049('0x4d')][_0xd049('0x85')])){throw new db[(_0xd049('0x7c'))]['ValidationError'](_0xd049('0x88')+_0x429d7b);}_0x1083da[_0x2843d4['body'][_0xd049('0x85')]]=_0x2843d4[_0xd049('0x4d')][_0xd049('0x81')];})[_0xd049('0x13')](function(){return db[_0xd049('0x45')][_0xd049('0x51')]({'where':{'id':_0x2843d4[_0xd049('0x52')]['id']},'include':[{'model':db[_0xd049('0x89')],'as':_0xd049('0x8a'),'include':[{'model':db['CmContact'],'as':_0xd049('0x8b'),'where':_0x1083da,'limit':0x1,'order':[[_0xd049('0x7f'),'DESC']]}]},{'model':db[_0xd049('0x8c')],'as':_0xd049('0x8d')}]});})[_0xd049('0x13')](handleEntityNotFound(_0x185b25,null))[_0xd049('0x13')](function(_0x153cc0){if(_0x153cc0&&_0x153cc0['List']){_0x26db11[_0xd049('0x8e')]=_0x153cc0;_0x26db11['applications']=_0x153cc0[_0xd049('0x8d')];_0x26db11[_0xd049('0x8f')]=_0x153cc0[_0xd049('0x8a')];_0x26db11[_0xd049('0x90')]=_[_0xd049('0x91')](_0x26db11[_0xd049('0x90')],[_0xd049('0x92')],[_0xd049('0x93')]);if(_0x26db11[_0xd049('0x8e')][_0xd049('0x8d')]){delete _0x26db11[_0xd049('0x8e')][_0xd049('0x8d')];}if(_0x26db11[_0xd049('0x8e')][_0xd049('0x8a')]&&_0x26db11[_0xd049('0x8e')]['List'][_0xd049('0x8b')][_0xd049('0x3a')]){return _0x26db11['account'][_0xd049('0x8a')][_0xd049('0x8b')][0x0];}var _0x5d46fd=_['defaults'](_0x2843d4[_0xd049('0x4d')],{'firstName':_0x2843d4['body']['from'],'ListId':_0x153cc0[_0xd049('0x80')]});_0x5d46fd[_0x2843d4[_0xd049('0x4d')]['mapKey']]=_0x2843d4[_0xd049('0x4d')]['from'];return db[_0xd049('0x94')][_0xd049('0x4c')](_0x5d46fd,{'fields':_0x18ef16,'raw':!![]});}})['then'](handleEntityNotFound(_0x185b25,null))[_0xd049('0x13')](function(_0x4ac8cb){_0x26db11['contact']=_0x4ac8cb;var _0x5e058d=_0x2843d4['body'][_0xd049('0x95')];if(_0x2843d4[_0xd049('0x96')][_0xd049('0x97')]){_0x5e058d=_0x2843d4[_0xd049('0x96')][_0xd049('0x97')];}else if(_0x2843d4[_0xd049('0x96')]['x-forwarded-for']){_0x5e058d=_['first'](_0x2843d4['headers'][_0xd049('0x98')][_0xd049('0x99')](','));}if(_0x4ac8cb){var _0x4c7b86={'ContactId':_0x4ac8cb['id'],'ChatWebsiteId':_0x2843d4['params']['id'],'from':(_0x4ac8cb[_0xd049('0x9a')]||'')+'\x20'+(_0x4ac8cb[_0xd049('0x9b')]||''),'customerIp':_0x5e058d,'customerPort':_0x2843d4[_0xd049('0x96')][_0xd049('0x9c')]?_0x2843d4[_0xd049('0x96')]['x-real-port']:null,'referer':_0x2843d4[_0xd049('0x4d')]['referer'],'browserName':_0x51a214[_0xd049('0x9d')]['name']&&_0x51a214[_0xd049('0x9d')][_0xd049('0x9e')]?util[_0xd049('0x9f')](_0xd049('0xa0'),_0x51a214[_0xd049('0x9d')]['name'],_0x51a214[_0xd049('0x9d')][_0xd049('0x9e')]):_0xd049('0xa1'),'browserVersion':_0x51a214[_0xd049('0x9d')][_0xd049('0x9e')]||_0xd049('0xa1'),'osName':util[_0xd049('0x9f')]('%s\x20%s',_0x51a214['os']['name'],_0x51a214['os'][_0xd049('0x9e')]),'osVersion':_0x51a214['os'][_0xd049('0x9e')],'deviceModel':_0x51a214['device']['model']&&_0x51a214[_0xd049('0xa2')][_0xd049('0xa3')]?util[_0xd049('0x9f')](_0xd049('0xa4'),_0x51a214[_0xd049('0xa2')]['model'],_0x51a214[_0xd049('0xa2')][_0xd049('0xa3')],_0x51a214[_0xd049('0xa2')]['type']):null,'deviceVendor':_0x51a214['device'][_0xd049('0xa3')],'deviceType':_0x51a214[_0xd049('0xa2')][_0xd049('0x41')],'formData':JSON[_0xd049('0x19')](_0x2843d4[_0xd049('0x4d')])};var _0xf7a070={'ChatWebsiteId':_0x2843d4[_0xd049('0x52')]['id'],'closed':![]};if(_0x2843d4[_0xd049('0x4d')][_0xd049('0xa5')]){_0xf7a070[_0xd049('0xa5')]=_0x2843d4[_0xd049('0x4d')][_0xd049('0xa5')];return db[_0xd049('0xa6')][_0xd049('0x51')]({'where':_0xf7a070})[_0xd049('0x13')](function(_0x49284f){if(_0x49284f){return[_0x49284f,![]];}_0x4c7b86['threadId']=_0x2843d4['body'][_0xd049('0xa5')];_0x4c7b86[_0xd049('0xa7')]=_0x2843d4[_0xd049('0x4d')][_0xd049('0xa7')];return db[_0xd049('0xa6')][_0xd049('0x4c')](_0x4c7b86)[_0xd049('0x13')](function(_0x406a9c){return[_0x406a9c,!![]];});});}_0xf7a070[_0xd049('0xa8')]=_0x4ac8cb['id'];if(_0x2843d4[_0xd049('0x4d')][_0xd049('0xa9')]&&_0x2843d4['body'][_0xd049('0xa9')]['id']){_0xf7a070['id']=_0x2843d4[_0xd049('0x4d')]['interaction']['id'];return db[_0xd049('0xa6')][_0xd049('0x51')]({'where':_0xf7a070})[_0xd049('0x13')](function(_0x4df19c){if(_0x4df19c){return[_0x4df19c,![]];}return db[_0xd049('0xa6')][_0xd049('0x4c')](_0x4c7b86)[_0xd049('0x13')](function(_0x435e46){return[_0x435e46,!![]];});});}return db[_0xd049('0xa6')][_0xd049('0x4c')](_0x4c7b86)[_0xd049('0x13')](function(_0x2dbadf){return[_0x2dbadf,!![]];});}})[_0xd049('0xaa')](function(_0x36c15f,_0x32ba44){if(_0x36c15f){_0x51862b=_0x32ba44;if(!_0x32ba44){var _0x1cb7bd={'from':(_0x26db11[_0xd049('0xab')]['firstName']||'')+'\x20'+(_0x26db11[_0xd049('0xab')][_0xd049('0x9b')]||'')};if(_0x2843d4[_0xd049('0x4d')][_0xd049('0xa5')]&&_0x2843d4[_0xd049('0x4d')][_0xd049('0xac')]&&_0x2843d4['body'][_0xd049('0xa5')]!=_0x2843d4[_0xd049('0x4d')][_0xd049('0xac')]){_0x1cb7bd[_0xd049('0xa5')]=_0x2843d4['body']['messageId'];}return _0x36c15f[_0xd049('0x27')](_0x1cb7bd);}else{return _0x36c15f;}}})[_0xd049('0x13')](function(_0x292869){_0x26db11['interaction']=_0x292869[_0xd049('0x29')]({'plain':!![]});_0x26db11[_0xd049('0xa9')][_0xd049('0xad')]=_0x51862b;if(_0x26db11['interaction'][_0xd049('0xad')]){if(_0x26db11[_0xd049('0x8e')][_0xd049('0xae')]){_0x26db11['applications'][_0xd049('0xaf')]({'id':0x0,'priority':_0x26db11['applications'][_0xd049('0x3a')]+0x1,'app':_0xd049('0xb0'),'appdata':_0xd049('0xb1'),'interval':_0xd049('0xb2')});}}return db[_0xd049('0xb3')][_0xd049('0x4c')]({'body':_0x2843d4[_0xd049('0x4d')][_0xd049('0x4d')],'ChatWebsiteId':_0x2843d4[_0xd049('0x52')]['id'],'ChatInteractionId':_0x292869['id'],'direction':'in','ContactId':_0x26db11[_0xd049('0xab')]['id'],'AttachmentId':_0x2843d4[_0xd049('0x4d')]['AttachmentId']});})['then'](function(_0x5bf7c7){_0x26db11[_0xd049('0x1c')]=_0x5bf7c7;if(_0x26db11[_0xd049('0xa9')]['UserId']){return db[_0xd049('0xb4')][_0xd049('0x51')]({'attributes':['id','name'],'where':{'id':_0x26db11[_0xd049('0xa9')][_0xd049('0xb5')]}})[_0xd049('0x13')](function(_0xa42f4a){if(_0xa42f4a){_0x26db11[_0xd049('0x90')]['unshift']({'id':0x0,'priority':0x0,'app':_0xd049('0xb6'),'appdata':_0xa42f4a[_0xd049('0x2c')]+','+(_0x26db11[_0xd049('0x8e')][_0xd049('0xb7')]||0xa),'interval':_0xd049('0xb2')});_0x26db11[_0xd049('0xb8')]=!![];}return respondWithRpcPromise(_0xd049('0xb9'),_0xd049('0xba'),_0x26db11);});}return respondWithRpcPromise(_0xd049('0xb9'),_0xd049('0xba'),_0x26db11);})[_0xd049('0x13')](function(_0x5bd8f6){respondWithRpcPromise(_0xd049('0xbb'),'EventManager',{'event':_0xd049('0xbc'),'message':_0x5bd8f6},client9002);return _0x5bd8f6;})[_0xd049('0x13')](respondWithResult(_0x185b25,null))['catch'](handleError(_0x185b25,null));};exports['offline']=function(_0x1d3a3b,_0x5a6758){var _0x233a44,_0x526e71,_0x1d1c35;var _0x91285=[];var _0x2c40da={};var _0x50684a=_0x1d3a3b[_0xd049('0xbd')]||[];var _0x5018a7=[];var _0x1f311e;return db[_0xd049('0x94')][_0xd049('0x53')]()[_0xd049('0x13')](function(_0x5dc335){if(!_0x5dc335){throw new db[(_0xd049('0x7c'))][(_0xd049('0x82'))](_0xd049('0xbe'));}_0x91285=_[_0xd049('0x7d')](_[_0xd049('0x35')](_0x5dc335),['createdAt',_0xd049('0x7f'),_0xd049('0xbf'),_0xd049('0x80')]);if(_0x1d3a3b[_0xd049('0x4d')]['id']){delete _0x1d3a3b[_0xd049('0x4d')]['id'];}if(_[_0xd049('0x72')](_0x1d3a3b[_0xd049('0x4d')]['from'])){throw _0x5a6758[_0xd049('0x1f')](0x1f4)['send'](new db[(_0xd049('0x7c'))]['ValidationError'](_0xd049('0x83')));}if(_['isNil'](_0x1d3a3b[_0xd049('0x4d')][_0xd049('0x4d')])||_0x1d3a3b[_0xd049('0x4d')][_0xd049('0x4d')]===''){throw _0x5a6758[_0xd049('0x1f')](0x1f4)[_0xd049('0x2d')](new db[(_0xd049('0x7c'))]['ValidationError'](_0xd049('0x84')));}if(_[_0xd049('0x72')](_0x1d3a3b[_0xd049('0x4d')]['mapKeyOffline'])){throw _0x5a6758[_0xd049('0x1f')](0x1f4)[_0xd049('0x2d')](new db[(_0xd049('0x7c'))]['ValidationError'](_0xd049('0xc0')+_0x91285));}if(!_[_0xd049('0x87')](_0x91285,_0x1d3a3b['body']['mapKeyOffline'])){throw _0x5a6758[_0xd049('0x1f')](0x1f4)[_0xd049('0x2d')](new db['Sequelize'][(_0xd049('0x82'))](_0xd049('0xc1')+_0x91285));}_0x2c40da[_0x1d3a3b[_0xd049('0x4d')]['mapKeyOffline']]=_0x1d3a3b[_0xd049('0x4d')]['from'];})[_0xd049('0x13')](function(){return db[_0xd049('0x45')][_0xd049('0x51')]({'where':{'id':_0x1d3a3b[_0xd049('0x52')]['id']},'include':[{'model':db[_0xd049('0x89')],'as':_0xd049('0x8a')},{'model':db[_0xd049('0xc2')],'as':_0xd049('0xc2')}]});})['then'](handleEntityNotFound(_0x5a6758,null))['then'](function(_0x5db175){if(_0x5db175&&_0x5db175[_0xd049('0x8a')]){_0x526e71=_0x5db175;var _0x7cc6bf=_['defaults'](_0x1d3a3b[_0xd049('0x4d')],{'firstName':_0x1d3a3b[_0xd049('0x4d')][_0xd049('0x81')],'phone':_0x1d3a3b[_0xd049('0x4d')]['from'],'ListId':_0x5db175[_0xd049('0x80')]});_0x7cc6bf[_0x1d3a3b[_0xd049('0x4d')][_0xd049('0xc3')]]=_0x1d3a3b[_0xd049('0x4d')]['from'];return db[_0xd049('0x94')][_0xd049('0xc4')]({'where':_0x2c40da,'defaults':_0x7cc6bf});}})[_0xd049('0xaa')](function(_0x16ca52){if(_0x16ca52){_0x1d1c35=_0x16ca52;var _0x209884=fs[_0xd049('0xc5')](path[_0xd049('0x6a')](config[_0xd049('0x6b')],_0xd049('0xc6')),'utf8');var _0x349121=ejs['render'](_0x209884,{'body':_['toPairs'](_0x1d3a3b[_0xd049('0x4d')][_0xd049('0x4d')]),'bodyTitle':_0x526e71[_0xd049('0xc7')]});return db['ChatOfflineMessage']['create']({'body':_0x349121,'plainBody':htmlToText[_0xd049('0xc8')](_0x349121),'ContactId':_0x16ca52['id'],'ChatWebsiteId':_0x526e71['id']});}})['then'](function(_0x3abbed){_0x1f311e=_0x3abbed;if(_0x50684a[_0xd049('0x3a')]){var _0x52a610=_0x50684a[_0xd049('0x33')](function(_0x5810c6){return{'name':_0x5810c6[_0xd049('0xc9')],'basename':_0x5810c6[_0xd049('0x62')],'type':_0x5810c6[_0xd049('0xca')],'ChatOfflineMessageId':_0x3abbed['id']};});_0x5018a7=_0x52a610[_0xd049('0x33')](_0x478865=>{var _0x52ed5a={'filename':_0x478865['name'],'path':path[_0xd049('0x6a')](config[_0xd049('0x6b')],'server',_0xd049('0xbd'),'attachments',_0xd049('0xcb'),_0x478865['basename'])};return _0x52ed5a;});if(!_0x526e71[_0xd049('0xcc')]){return db[_0xd049('0xcd')][_0xd049('0xce')](function(_0x4fe6c6){return db[_0xd049('0xcf')][_0xd049('0xd0')](_0x52a610,{'transaction':_0x4fe6c6});});}}})[_0xd049('0x13')](function(){if(_0x1f311e){_0x233a44=_0x1f311e;return db[_0xd049('0xc2')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xd049('0xd1')],'as':_0xd049('0xd2'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]});}})[_0xd049('0x13')](function(_0x1b938e){if(_0x1b938e&&_0x1b938e['Smtp']&&_0x526e71[_0xd049('0xd3')]&&_0x526e71[_0xd049('0xd4')]){var _0x4ba468=_0x1b938e[_0xd049('0xd5')]();return respondWithRpcPromise(_0xd049('0xd6'),_0xd049('0xd7'),{'account':_0x4ba468,'message':{'from':util[_0xd049('0x9f')]('\x22%s\x22\x20<%s>',_0x1b938e['name'],_0x1b938e[_0xd049('0xd8')]||_0x1b938e[_0xd049('0xd2')][_0xd049('0xd9')]),'to':_0x526e71[_0xd049('0xd4')],'subject':_0x526e71[_0xd049('0xda')],'html':_0x233a44['body'],'attachments':_0x5018a7}},client9003)[_0xd049('0x13')](function(){return _0x233a44;})[_0xd049('0x1d')](function(_0x30c96a){logger['error'](_0x30c96a);});}})[_0xd049('0x13')](function(){if(_0x526e71&&_0x526e71[_0xd049('0xcc')]&&_0x526e71[_0xd049('0xdb')]){var _0x36ad28=[];if(_0x50684a[_0xd049('0x3a')]){_0x36ad28=_0x50684a['map'](function(_0x3610dd){return{'name':_0x3610dd[_0xd049('0xc9')],'basename':_0x3610dd[_0xd049('0x62')],'type':_0x3610dd[_0xd049('0xca')],'ChatOfflineMessageId':_0x1f311e['id']};});}var _0x17c2fa;if(!_[_0xd049('0x72')](_0x526e71[_0xd049('0xdc')])){var _0x5e6dd4=_['map'](_0x1d3a3b[_0xd049('0x4d')],function(_0x1a136c){return _0x1a136c;});var _0x4a917d=_[_0xd049('0xdd')](_0x5e6dd4)[0x0];var _0xc3a697=_[_0xd049('0xde')](_0x4a917d,function(_0x345d0c){return _0x345d0c;});_0x17c2fa=_0xc3a697[0x1][_0x526e71[_0xd049('0xdc')]];}var _0x278635={'from':_0x1d1c35['email'],'firstName':_0x1d1c35['firstName'],'lastName':_0x1d1c35['lastName'],'mapKey':_0xd049('0xd8'),'message':{'from':_0x1d1c35[_0xd049('0xd8')],'to':_0x526e71[_0xd049('0xc2')]['email'],'cc':'','subject':_[_0xd049('0x72')](_0x17c2fa)?_0x526e71[_0xd049('0xda')]:_0x17c2fa,'messageId':'','sentAt':new Date(),'attach':_0x36ad28[_0xd049('0x3a')],'attachments':_0x36ad28,'originChannel':_0xd049('0xdf'),'ChatWebsiteId':_0x526e71['id'],'ChatOfflineMessageId':_0x233a44['id'],'originTo':_0x526e71[_0xd049('0xc2')][_0xd049('0xd8')]},'body':_0x233a44['body']};var _0x240197={'account':{'id':_0x526e71[_0xd049('0xdb')]},'body':_0x278635,'log':'NotifyMailAccount'};return respondWithRpcPromise('NotifyMailAccount',_0xd049('0xe0'),_0x240197,client9001)[_0xd049('0x13')](function(){return _0x233a44;})['catch'](function(_0x42264b){logger['error'](_0x42264b);});}return;})[_0xd049('0x13')](function(){if(_0x233a44){return _0x233a44;}})[_0xd049('0x13')](respondWithResult(_0x5a6758,null))[_0xd049('0x1d')](function(_0x52ed4c){logger[_0xd049('0x1a')](_0xd049('0x1d'),_0x52ed4c);for(var _0x32336f of _0x50684a){var _0x2e18ac=path[_0xd049('0x6a')](config[_0xd049('0x6b')],'server',_0xd049('0xbd'),'attachments',_0xd049('0xcb'),_0x32336f['filename']);fs_extra[_0xd049('0xe1')](_0x2e18ac)[_0xd049('0x1d')](function(_0x422fac){logger['error'](_0xd049('0xe2'),_0x2e18ac,_0x422fac);});}});};exports[_0xd049('0xe3')]=function(_0x42fc7a,_0x9ef843){return db[_0xd049('0xa6')][_0xd049('0x51')]({'where':{'id':_0x42fc7a[_0xd049('0x52')]['id']}})[_0xd049('0x13')](handleEntityNotFound(_0x9ef843,null))['then'](function(_0x4b8fb3){if(_0x4b8fb3){return _0x4b8fb3[_0xd049('0xe3')](_0x42fc7a[_0xd049('0x4d')][_0xd049('0x5b')],_['omit'](_0x42fc7a[_0xd049('0x4d')],['ids','id'])||{});}})[_0xd049('0x13')](respondWithResult(_0x9ef843,null))[_0xd049('0x1d')](handleError(_0x9ef843,null));};exports[_0xd049('0xe4')]=function(_0x4b3b34,_0x3de619){var _0x3590db={'raw':![],'where':{}};var _0xde4db0={};var _0xec821d={'count':0x0,'rows':[]};return db[_0xd049('0x45')][_0xd049('0x57')]({'where':{'id':_0x4b3b34['params']['id']}})['then'](handleEntityNotFound(_0x3de619,null))['then'](function(_0x3dc1d4){if(_0x3dc1d4){_0xde4db0[_0xd049('0x32')]=_['keys'](db[_0xd049('0xa6')]['rawAttributes']);_0xde4db0[_0xd049('0x34')]=_['keys'](_0x4b3b34[_0xd049('0x34')]);_0xde4db0[_0xd049('0x36')]=_[_0xd049('0x37')](_0xde4db0[_0xd049('0x32')],_0xde4db0[_0xd049('0x34')]);_0x3590db[_0xd049('0x38')]=_[_0xd049('0x37')](_0xde4db0[_0xd049('0x32')],qs['fields'](_0x4b3b34[_0xd049('0x34')][_0xd049('0x39')]));_0x3590db[_0xd049('0x38')]=_0x3590db[_0xd049('0x38')][_0xd049('0x3a')]?_0x3590db[_0xd049('0x38')]:_0xde4db0[_0xd049('0x32')];if(!_0x4b3b34[_0xd049('0x34')][_0xd049('0x3b')](_0xd049('0x3c'))){_0x3590db['limit']=qs[_0xd049('0x23')](_0x4b3b34[_0xd049('0x34')][_0xd049('0x23')]);_0x3590db[_0xd049('0x21')]=qs[_0xd049('0x21')](_0x4b3b34[_0xd049('0x34')][_0xd049('0x21')]);}_0x3590db[_0xd049('0x3d')]=qs[_0xd049('0x3e')](_0x4b3b34['query'][_0xd049('0x3e')]);_0x3590db['where']=qs[_0xd049('0x36')](_[_0xd049('0x3f')](_0x4b3b34['query'],_0xde4db0[_0xd049('0x36')]));_0x3590db['where'][_0xd049('0x55')]=_0x3dc1d4['id'];if(_0x4b3b34[_0xd049('0x34')][_0xd049('0x43')]){_0x3590db['where']=_[_0xd049('0x59')](_0x3590db['where'],{'$or':_[_0xd049('0x33')](_0x3590db[_0xd049('0x38')],function(_0xd4a76b){var _0x5aaf72={};_0x5aaf72[_0xd4a76b]={'$like':'%'+_0x4b3b34['query'][_0xd049('0x43')]+'%'};return _0x5aaf72;})});}_0x3590db=_['merge']({},_0x3590db,_0x4b3b34[_0xd049('0x44')]);return db[_0xd049('0xa6')][_0xd049('0x24')]({'where':_0x3590db['where']})[_0xd049('0x13')](function(_0x18c833){_0xec821d[_0xd049('0x24')]=_0x18c833;if(_0x4b3b34['query']['includeAll']){_0x3590db['include']=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0xd049('0xb4')],'as':_0xd049('0xe5'),'attributes':[_0xd049('0x2c'),_0xd049('0xe6'),_0xd049('0xe7')],'required':![]},{'model':db['Tag'],'as':_0xd049('0xe8'),'attributes':['id',_0xd049('0x2c'),'color'],'where':_0x4b3b34[_0xd049('0x34')][_0xd049('0xe9')]?{'id':_0x4b3b34[_0xd049('0x34')]['tag']}:undefined,'required':_0x4b3b34[_0xd049('0x34')][_0xd049('0xe9')]?!![]:![]}];}return db['ChatInteraction'][_0xd049('0x48')](_0x3590db);})[_0xd049('0x13')](function(_0x3b061e){_0xec821d[_0xd049('0x49')]=_0x3b061e;return _0xec821d;});}})[_0xd049('0x13')](respondWithFilteredResult(_0x3de619,_0x3590db))[_0xd049('0x1d')](handleError(_0x3de619,null));};function iftimePromise(_0x4abaf8,_0x44141a){return respondWithRpcPromise('Command','getSnippet',{'command':_0x44141a[_0xd049('0xea')]?util[_0xd049('0x9f')]('iftime\x20%s,%s',_0x4abaf8['interval'],_0x44141a[_0xd049('0xea')]):util[_0xd049('0x9f')](_0xd049('0xeb'),_0x4abaf8[_0xd049('0xec')])},client9002)[_0xd049('0x13')](function(_0x22663c){var _0x2a5736=_0x22663c&&_0x22663c['indexOf'](_0xd049('0xed'))>=0x0?!![]:![];logger['info']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x44141a['id'],_0x4abaf8['id'],_0x4abaf8[_0xd049('0xec')],_0x2a5736?'ONLINE':'OFFLINE',_0x44141a[_0xd049('0xea')]?_0x44141a[_0xd049('0xea')]:_0xd049('0xee'));return _0x2a5736;})[_0xd049('0x1d')](function(_0x50c5d9){logger[_0xd049('0x1a')](_0xd049('0xef'),_0x44141a['id'],_0x4abaf8['id'],_0x4abaf8['interval'],util['inspect'](_0x50c5d9,{'showHidden':![],'depth':null}),_0x44141a['timezone']?_0x44141a['timezone']:_0xd049('0xee'));return![];});}exports[_0xd049('0xf0')]=function(_0xea3238,_0x18f6a1){var _0x21fabb=0x0;var _0x3a7aad=0x0;var _0x278b05=![];var _0x138714;var _0x252065;return db[_0xd049('0x45')][_0xd049('0x51')]({'where':{'id':_0xea3238[_0xd049('0x52')]['id']},'include':[{'model':db[_0xd049('0xf1')],'as':_0xd049('0xf1'),'include':[{'model':db[_0xd049('0xf1')],'as':_0xd049('0xf2'),'attributes':['id',_0xd049('0xec')],'raw':!![]}]}]})[_0xd049('0x13')](handleEntityNotFound(_0x18f6a1,null))[_0xd049('0x13')](function(_0x33916d){if(_0x33916d){_0x138714=_0x33916d;return _0x33916d[_0xd049('0xf3')]({'raw':!![]});}})[_0xd049('0x13')](function(_0x4e749c){if(_0x138714){if(_0x4e749c){_0x252065=_0x4e749c;}}return require('../../config/license/util')[_0xd049('0x6d')]();})[_0xd049('0x13')](function(_0x366420){if(_0x366420){_0x3a7aad=_0x366420[_0xd049('0xf4')];_0x278b05=_0x366420[_0xd049('0xf5')];}})[_0xd049('0x13')](function(){return db['ChatInteraction'][_0xd049('0x24')]({'where':{'closed':![]}});})[_0xd049('0x13')](function(_0x242f16){_0x21fabb=_0x242f16;if(_0x3a7aad&&_0x242f16>_0x3a7aad){return db[_0xd049('0xf6')]['findOne']({'where':{'id':0x1}})[_0xd049('0x13')](function(_0x275ac6){if(_0x275ac6){_0x275ac6['increment'](_0xd049('0xf7'));}});}})['then'](function(){if(_0x138714[_0xd049('0xf1')]&&_0x138714[_0xd049('0xf1')][_0xd049('0xf2')]){var _0x1089ea=[];for(var _0x59f77f=0x0;_0x59f77f<_0x138714['Interval']['Intervals'][_0xd049('0x3a')];_0x59f77f++){var _0x19b9e5=_0x138714[_0xd049('0xf1')][_0xd049('0xf2')][_0x59f77f][_0xd049('0x29')]({'plain':!![]});_0x1089ea[_0xd049('0xaf')](iftimePromise(_0x19b9e5,_0x138714));}return BPromise[_0xd049('0xf8')](_0x1089ea)[_0xd049('0x13')](function(_0x1653c2){return _[_0xd049('0xf9')](_0x1653c2);});}else{return!![];}})[_0xd049('0x13')](function(_0x3c2dab){var _0x531ce8=fs['readFileSync'](path[_0xd049('0x6a')](config['root'],'server/files/chat/iframe.ejs'),_0xd049('0xfa'));var _0xa2a58c=new url[(_0xd049('0xfb'))](_0x138714['address'])[_0xd049('0xfc')];var _0x43c8ce='3.1.0';var _0x141518=![];var _0x1f44f6={'chatVersion':_0x43c8ce,'chatWebsiteAddressOrigin':_0xa2a58c,'remote':_0x138714[_0xd049('0xfd')],'query':querystring[_0xd049('0x19')](_[_0xd049('0x59')](_0x138714[_0xd049('0x29')]({'plain':!![]}),{'customerIp':_0xea3238[_0xd049('0x96')][_0xd049('0x98')]||_0xea3238['headers'][_0xd049('0xfe')]||_0xea3238[_0xd049('0xff')][_0xd049('0x100')]||_0xea3238['ip'],'referer':_0xea3238[_0xd049('0x96')]['referer'],'openedInteractions':_0x21fabb,'maxInteractions':_0x3a7aad,'virtual':_0x278b05[_0xd049('0xf4')],'online':_0x3c2dab,'custom':_0x278b05}))[_0xd049('0x101')](/'/g,'\x5c\x27')};_0x18f6a1[_0xd049('0x2d')](ejs[_0xd049('0x102')](Mustache[_0xd049('0x102')](_0x531ce8,_0x1f44f6),{'proactiveActions':_0x252065,'alignment':_0x138714[_0xd049('0x103')],'verticalAlignment':_0x138714[_0xd049('0x104')],'div_color':_0x138714[_0xd049('0x105')],'labelText':_0x138714[_0xd049('0x106')],'text_color':_0x138714[_0xd049('0x107')],'text_button_color':_0x138714[_0xd049('0x108')],'button_color':_0x138714[_0xd049('0x109')],'background_color':_0x138714['backgroundColor'],'hideWhenOffline':_0x138714[_0xd049('0x10a')],'intervalId':_0x138714['IntervalId'],'isDevelopment':_0x141518,'chatVersion':_0x43c8ce}));})[_0xd049('0x1d')](handleError(_0x18f6a1,null));};exports[_0xd049('0x10b')]=function(_0x10393c,_0x2c1a0e){var _0x427478=_0x10393c[_0xd049('0x52')]['id'];var _0x2ffecd=_0x10393c[_0xd049('0x4d')];var _0xecadb8=0xc8;var _0x167f8e=null;return db['sequelize'][_0xd049('0xce')]({'isolationLevel':db['sequelize']['Transaction'][_0xd049('0x10c')][_0xd049('0x10d')]},function(_0x1b220d){return db[_0xd049('0x45')]['findOne']({'where':{'id':_0x427478},'transaction':_0x1b220d})[_0xd049('0x13')](function(_0x3163d9){if(_0x3163d9){return db[_0xd049('0x8c')][_0xd049('0x28')]({'where':{'ChatWebsiteId':_0x427478},'transaction':_0x1b220d})[_0xd049('0x13')](function(){var _0x3a685f=_['map'](_0x2ffecd,function(_0x4315a2){_0x4315a2[_0xd049('0x55')]=_0x427478;return _0x4315a2;});return db[_0xd049('0x8c')][_0xd049('0xd0')](_0x3a685f,{'transaction':_0x1b220d});});}else{_0xecadb8=0x194;_0x167f8e=[];}});})[_0xd049('0x13')](function(){if(_0xecadb8!==0x194){return db[_0xd049('0x8c')][_0xd049('0x10e')]({'where':{'ChatWebsiteId':_0x427478},'order':_0xd049('0x92')})['then'](function(_0xcbf0aa){_0x167f8e=_0xcbf0aa;});}})['catch'](function(_0x2f043a){_0xecadb8=0x1f4;logger[_0xd049('0x1a')](_0x2f043a[_0xd049('0x2b')]);if(_0x2f043a[_0xd049('0x2c')]){delete _0x2f043a[_0xd049('0x2c')];}_0x167f8e=_0x2f043a;})[_0xd049('0x10f')](function(){if(_0x167f8e===null){_0x2c1a0e[_0xd049('0x1e')](_0xecadb8);}else{if(_0xecadb8===0x1f4){_0x2c1a0e['status'](_0xecadb8)['send'](_0x167f8e);}else{_0x2c1a0e[_0xd049('0x1f')](_0xecadb8)[_0xd049('0x26')](_0x167f8e);}}});};exports[_0xd049('0x110')]=function(_0x76d631,_0x2adf38){var _0x52c846={};var _0x46ddf0={};var _0x3c1250;var _0x444353;return db[_0xd049('0x45')]['findOne']({'where':{'id':_0x76d631[_0xd049('0x52')]['id']}})[_0xd049('0x13')](handleEntityNotFound(_0x2adf38,null))[_0xd049('0x13')](function(_0x4fa5af){if(_0x4fa5af){_0x3c1250=_0x4fa5af;_0x46ddf0[_0xd049('0x32')]=_[_0xd049('0x35')](db['ChatApplication'][_0xd049('0x30')]);_0x46ddf0[_0xd049('0x34')]=_[_0xd049('0x35')](_0x76d631[_0xd049('0x34')]);_0x46ddf0[_0xd049('0x36')]=_[_0xd049('0x37')](_0x46ddf0[_0xd049('0x32')],_0x46ddf0[_0xd049('0x34')]);_0x52c846[_0xd049('0x38')]=_['intersection'](_0x46ddf0[_0xd049('0x32')],qs['fields'](_0x76d631[_0xd049('0x34')]['fields']));_0x52c846[_0xd049('0x38')]=_0x52c846[_0xd049('0x38')]['length']?_0x52c846[_0xd049('0x38')]:_0x46ddf0['model'];_0x52c846[_0xd049('0x3d')]=qs[_0xd049('0x3e')](_0x76d631[_0xd049('0x34')][_0xd049('0x3e')]);_0x52c846[_0xd049('0x40')]=qs[_0xd049('0x36')](_['pick'](_0x76d631[_0xd049('0x34')],_0x46ddf0[_0xd049('0x36')]));if(_0x76d631[_0xd049('0x34')][_0xd049('0x43')]){_0x52c846[_0xd049('0x40')]=_[_0xd049('0x59')](_0x52c846['where'],{'$or':_[_0xd049('0x33')](_0x52c846['attributes'],function(_0x5cdf20){var _0x2f3531={};_0x2f3531[_0x5cdf20]={'$like':'%'+_0x76d631[_0xd049('0x34')]['filter']+'%'};return _0x2f3531;})});}_0x52c846=_[_0xd049('0x59')]({},_0x52c846,_0x76d631['options']);return _0x3c1250['getApplications'](_0x52c846);}})[_0xd049('0x13')](function(_0x551024){if(_0x551024){_0x444353=_0x551024[_0xd049('0x3a')];if(!_0x76d631['query'][_0xd049('0x3b')](_0xd049('0x3c'))){_0x52c846[_0xd049('0x23')]=qs[_0xd049('0x23')](_0x76d631['query'][_0xd049('0x23')]);_0x52c846[_0xd049('0x21')]=qs[_0xd049('0x21')](_0x76d631[_0xd049('0x34')]['offset']);}return _0x3c1250[_0xd049('0x110')](_0x52c846);}})[_0xd049('0x13')](function(_0x37756a){if(_0x37756a){return _0x37756a?{'count':_0x444353,'rows':_0x37756a}:null;}})['then'](respondWithResult(_0x2adf38,null))['catch'](handleError(_0x2adf38,null));};exports['addProactiveActions']=function(_0x4b278e,_0x556fc3){return db[_0xd049('0x111')]['find']({'where':{'id':_0x4b278e['params']['id']}})[_0xd049('0x13')](handleEntityNotFound(_0x556fc3,null))[_0xd049('0x13')](function(_0xc4670d){if(_0xc4670d){return _0xc4670d[_0xd049('0x112')](_0x4b278e[_0xd049('0x4d')]['ids'],_[_0xd049('0x113')](_0x4b278e[_0xd049('0x4d')],[_0xd049('0x5b'),'id'])||{});}})['then'](respondWithResult(_0x556fc3,null))[_0xd049('0x1d')](handleError(_0x556fc3,null));};exports[_0xd049('0xf3')]=function(_0x191dcb,_0x3acc28){var _0x5379b0={};var _0x233cb3={};var _0x382672;var _0x3ea625;return db[_0xd049('0x45')][_0xd049('0x57')]({'where':{'id':_0x191dcb[_0xd049('0x52')]['id']}})[_0xd049('0x13')](handleEntityNotFound(_0x3acc28,null))[_0xd049('0x13')](function(_0x80d2d4){if(_0x80d2d4){_0x382672=_0x80d2d4;_0x233cb3[_0xd049('0x32')]=_[_0xd049('0x35')](db[_0xd049('0x114')][_0xd049('0x30')]);_0x233cb3[_0xd049('0x34')]=_[_0xd049('0x35')](_0x191dcb['query']);_0x233cb3[_0xd049('0x36')]=_['intersection'](_0x233cb3[_0xd049('0x32')],_0x233cb3[_0xd049('0x34')]);_0x5379b0['attributes']=_[_0xd049('0x37')](_0x233cb3[_0xd049('0x32')],qs[_0xd049('0x39')](_0x191dcb['query'][_0xd049('0x39')]));_0x5379b0[_0xd049('0x38')]=_0x5379b0[_0xd049('0x38')][_0xd049('0x3a')]?_0x5379b0['attributes']:_0x233cb3[_0xd049('0x32')];_0x5379b0[_0xd049('0x3d')]=qs[_0xd049('0x3e')](_0x191dcb['query'][_0xd049('0x3e')]);_0x5379b0[_0xd049('0x40')]=qs[_0xd049('0x36')](_['pick'](_0x191dcb[_0xd049('0x34')],_0x233cb3[_0xd049('0x36')]));if(_0x191dcb[_0xd049('0x34')]['filter']){_0x5379b0[_0xd049('0x40')]=_['merge'](_0x5379b0[_0xd049('0x40')],{'$or':_[_0xd049('0x33')](_0x5379b0[_0xd049('0x38')],function(_0x27cc55){var _0x399b57={};_0x399b57[_0x27cc55]={'$like':'%'+_0x191dcb['query']['filter']+'%'};return _0x399b57;})});}_0x5379b0=_[_0xd049('0x59')]({},_0x5379b0,_0x191dcb['options']);return _0x382672[_0xd049('0xf3')](_0x5379b0);}})[_0xd049('0x13')](function(_0x48fda0){if(_0x48fda0){_0x3ea625=_0x48fda0['length'];if(!_0x191dcb[_0xd049('0x34')][_0xd049('0x3b')](_0xd049('0x3c'))){_0x5379b0[_0xd049('0x23')]=qs[_0xd049('0x23')](_0x191dcb['query'][_0xd049('0x23')]);_0x5379b0[_0xd049('0x21')]=qs[_0xd049('0x21')](_0x191dcb[_0xd049('0x34')][_0xd049('0x21')]);}return _0x382672['getProactiveActions'](_0x5379b0);}})[_0xd049('0x13')](function(_0x4bf930){if(_0x4bf930){return _0x4bf930?{'count':_0x3ea625,'rows':_0x4bf930}:null;}})[_0xd049('0x13')](respondWithResult(_0x3acc28,null))[_0xd049('0x1d')](handleError(_0x3acc28,null));};exports[_0xd049('0x115')]=function(_0x38d3a5,_0x13457a){var _0x155bcd=_0x38d3a5['query']['online']===_0xd049('0x116')?'offlineForm':_0xd049('0x117');return db[_0xd049('0x45')]['find']({'attributes':['id',_0x155bcd],'where':{'id':_0x38d3a5['params']['id']}})[_0xd049('0x13')](handleEntityNotFound(_0x13457a,null))[_0xd049('0x13')](function(_0x2f6028){if(_0x2f6028){var _0x1ce765=_0x2f6028[_0x155bcd];var _0x32e2da=_0x1ce765&&_0x1ce765[_0xd049('0x118')]?_0x1ce765['items']:[];_0x13457a[_0xd049('0x2d')]({'fromKey':_[_0xd049('0x72')](_0x1ce765['fromKey'])?undefined:_0x1ce765['fromKey'],'count':_0x32e2da['length'],'rows':_0x32e2da});}})[_0xd049('0x1d')](handleError(_0x13457a,null));};exports[_0xd049('0x119')]=function(_0x1fab03,_0x36bd5f){var _0x5dbaec={'raw':![],'where':{}};var _0x5a727d={};var _0x9fbba3={'count':0x0,'rows':[]};return db[_0xd049('0x45')]['findOne']({'where':{'id':_0x1fab03[_0xd049('0x52')]['id']}})[_0xd049('0x13')](handleEntityNotFound(_0x36bd5f,null))[_0xd049('0x13')](function(_0x3a5d92){if(_0x3a5d92){_0x5a727d[_0xd049('0x32')]=_[_0xd049('0x35')](db[_0xd049('0x11a')][_0xd049('0x30')]);_0x5a727d[_0xd049('0x34')]=_['keys'](_0x1fab03['query']);_0x5a727d['filters']=_[_0xd049('0x37')](_0x5a727d['model'],_0x5a727d[_0xd049('0x34')]);_0x5dbaec['attributes']=_[_0xd049('0x37')](_0x5a727d[_0xd049('0x32')],qs[_0xd049('0x39')](_0x1fab03[_0xd049('0x34')][_0xd049('0x39')]));_0x5dbaec[_0xd049('0x38')]=_0x5dbaec[_0xd049('0x38')][_0xd049('0x3a')]?_0x5dbaec[_0xd049('0x38')]:_0x5a727d[_0xd049('0x32')];if(!_0x1fab03[_0xd049('0x34')][_0xd049('0x3b')]('nolimit')){_0x5dbaec[_0xd049('0x23')]=qs[_0xd049('0x23')](_0x1fab03['query'][_0xd049('0x23')]);_0x5dbaec[_0xd049('0x21')]=qs[_0xd049('0x21')](_0x1fab03[_0xd049('0x34')]['offset']);}_0x5dbaec[_0xd049('0x3d')]=qs[_0xd049('0x3e')](_0x1fab03[_0xd049('0x34')][_0xd049('0x3e')]);_0x5dbaec[_0xd049('0x40')]=qs[_0xd049('0x36')](_[_0xd049('0x3f')](_0x1fab03['query'],_0x5a727d[_0xd049('0x36')]));_0x5dbaec[_0xd049('0x40')]['ChatWebsiteId']=_0x3a5d92['id'];if(_0x1fab03[_0xd049('0x34')][_0xd049('0x43')]){_0x5dbaec[_0xd049('0x40')]=_[_0xd049('0x59')](_0x5dbaec['where'],{'$or':_[_0xd049('0x33')](_0x5dbaec['attributes'],function(_0x29b4d5){var _0x415f38={};_0x415f38[_0x29b4d5]={'$like':'%'+_0x1fab03['query'][_0xd049('0x43')]+'%'};return _0x415f38;})});}_0x5dbaec=_[_0xd049('0x59')]({},_0x5dbaec,_0x1fab03[_0xd049('0x44')]);return db['ChatOfflineMessage']['count']({'where':_0x5dbaec[_0xd049('0x40')]})['then'](function(_0x35e5ad){_0x9fbba3[_0xd049('0x24')]=_0x35e5ad;if(_0x1fab03['query'][_0xd049('0x46')]){_0x5dbaec[_0xd049('0x47')]=[{'all':!![]}];}else{_0x5dbaec['include']=[{'model':db[_0xd049('0x94')],'as':_0xd049('0x11b'),'required':![]},{'model':db[_0xd049('0xcf')],'as':'Attachments','required':![]}];}return db['ChatOfflineMessage']['findAll'](_0x5dbaec);})[_0xd049('0x13')](function(_0x1ce8c1){_0x9fbba3[_0xd049('0x49')]=_0x1ce8c1;return _0x9fbba3;});}})[_0xd049('0x13')](respondWithFilteredResult(_0x36bd5f,_0x5dbaec))['catch'](handleError(_0x36bd5f,null));};exports[_0xd049('0x11c')]=function(_0x46b08a,_0x21b86c){return db[_0xd049('0x45')][_0xd049('0x51')]({'where':{'id':_0x46b08a['params']['id']}})[_0xd049('0x13')](handleEntityNotFound(_0x21b86c,null))[_0xd049('0x13')](function(_0xd1940b){if(_0xd1940b){return _0xd1940b['addAgents'](_0x46b08a[_0xd049('0x4d')][_0xd049('0x5b')],_[_0xd049('0x113')](_0x46b08a['body'],[_0xd049('0x5b'),'id'])||{})[_0xd049('0xaa')](function(_0x4c58b7){for(var _0x5c7f23=0x0;_0x5c7f23<_0x46b08a[_0xd049('0x4d')]['ids'][_0xd049('0x3a')];_0x5c7f23+=0x1){socket[_0xd049('0x11d')](_0xd049('0x11e'),{'UserId':Number(_0x46b08a['body'][_0xd049('0x5b')][_0x5c7f23]),'ChatWebsiteId':Number(_0x46b08a['params']['id'])});}return _0x4c58b7;});}})['then'](respondWithResult(_0x21b86c,null))['catch'](handleError(_0x21b86c,null));};exports[_0xd049('0x11f')]=function(_0x1b68a5,_0x4ab4d3){return db[_0xd049('0x45')][_0xd049('0x51')]({'where':{'id':_0x1b68a5['params']['id']}})[_0xd049('0x13')](handleEntityNotFound(_0x4ab4d3,null))['then'](function(_0x3d6c7c){if(_0x3d6c7c){return _0x3d6c7c[_0xd049('0x11f')](_0x1b68a5[_0xd049('0x34')][_0xd049('0x5b')])[_0xd049('0x13')](function(){if(_['isArray'](_0x1b68a5[_0xd049('0x34')][_0xd049('0x5b')])){for(var _0x4c072a=0x0;_0x4c072a<_0x1b68a5[_0xd049('0x34')]['ids'][_0xd049('0x3a')];_0x4c072a+=0x1){socket[_0xd049('0x11d')](_0xd049('0x120'),{'UserId':Number(_0x1b68a5[_0xd049('0x34')][_0xd049('0x5b')][_0x4c072a]),'ChatWebsiteId':Number(_0x1b68a5[_0xd049('0x52')]['id'])});}}else{socket['emit'](_0xd049('0x120'),{'UserId':Number(_0x1b68a5[_0xd049('0x34')][_0xd049('0x5b')]),'ChatWebsiteId':Number(_0x1b68a5[_0xd049('0x52')]['id'])});}});}})[_0xd049('0x13')](respondWithStatusCode(_0x4ab4d3,null))[_0xd049('0x1d')](handleError(_0x4ab4d3,null));};exports['getAgents']=function(_0x557ae2,_0x3312ce){var _0x2e7abf={};var _0x4d9953={};var _0x55d0ea;var _0x92430a;return db[_0xd049('0x45')][_0xd049('0x57')]({'where':{'id':_0x557ae2[_0xd049('0x52')]['id']}})['then'](handleEntityNotFound(_0x3312ce,null))[_0xd049('0x13')](function(_0x2b02f5){if(_0x2b02f5){_0x55d0ea=_0x2b02f5;_0x4d9953['model']=_[_0xd049('0x35')](db[_0xd049('0xb4')][_0xd049('0x30')]);_0x4d9953[_0xd049('0x34')]=_[_0xd049('0x35')](_0x557ae2[_0xd049('0x34')]);_0x4d9953[_0xd049('0x36')]=_[_0xd049('0x37')](_0x4d9953[_0xd049('0x32')],_0x4d9953[_0xd049('0x34')]);_0x2e7abf[_0xd049('0x38')]=_['intersection'](_0x4d9953[_0xd049('0x32')],qs[_0xd049('0x39')](_0x557ae2['query'][_0xd049('0x39')]));_0x2e7abf[_0xd049('0x38')]=_0x2e7abf[_0xd049('0x38')]['length']?_0x2e7abf[_0xd049('0x38')]:_0x4d9953['model'];_0x2e7abf[_0xd049('0x3d')]=qs[_0xd049('0x3e')](_0x557ae2[_0xd049('0x34')][_0xd049('0x3e')]);_0x2e7abf[_0xd049('0x40')]=qs[_0xd049('0x36')](_[_0xd049('0x3f')](_0x557ae2[_0xd049('0x34')],_0x4d9953[_0xd049('0x36')]));if(_0x557ae2[_0xd049('0x34')]['filter']){_0x2e7abf[_0xd049('0x40')]=_[_0xd049('0x59')](_0x2e7abf[_0xd049('0x40')],{'$or':_[_0xd049('0x33')](_0x2e7abf[_0xd049('0x38')],function(_0x2c931c){var _0x32fefc={};_0x32fefc[_0x2c931c]={'$like':'%'+_0x557ae2['query'][_0xd049('0x43')]+'%'};return _0x32fefc;})});}_0x2e7abf=_[_0xd049('0x59')]({},_0x2e7abf,_0x557ae2[_0xd049('0x44')]);return _0x55d0ea[_0xd049('0x121')](_0x2e7abf);}})[_0xd049('0x13')](function(_0x5ec923){if(_0x5ec923){_0x92430a=_0x5ec923[_0xd049('0x3a')];if(!_0x557ae2[_0xd049('0x34')][_0xd049('0x3b')](_0xd049('0x3c'))){_0x2e7abf[_0xd049('0x23')]=qs[_0xd049('0x23')](_0x557ae2['query'][_0xd049('0x23')]);_0x2e7abf[_0xd049('0x21')]=qs[_0xd049('0x21')](_0x557ae2[_0xd049('0x34')][_0xd049('0x21')]);}return _0x55d0ea[_0xd049('0x121')](_0x2e7abf);}})[_0xd049('0x13')](function(_0x391792){if(_0x391792){return _0x391792?{'count':_0x92430a,'rows':_0x391792}:null;}})['then'](respondWithResult(_0x3312ce,null))['catch'](handleError(_0x3312ce,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 0787a89..26fd755 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 _0x56e6=['../../mysqldb','ChatWebsite','setMaxListeners','save','update','emit','hasOwnProperty','exports','events'];(function(_0x146242,_0x4f52b2){var _0x45c774=function(_0xe625d2){while(--_0xe625d2){_0x146242['push'](_0x146242['shift']());}};_0x45c774(++_0x4f52b2);}(_0x56e6,0x6b));var _0x656e=function(_0x452ea6,_0x5dedd8){_0x452ea6=_0x452ea6-0x0;var _0x456381=_0x56e6[_0x452ea6];return _0x456381;};'use strict';var EventEmitter=require(_0x656e('0x0'));var ChatWebsite=require(_0x656e('0x1'))['db'][_0x656e('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x656e('0x3')](0x0);var events={'afterCreate':_0x656e('0x4'),'afterUpdate':_0x656e('0x5'),'afterDestroy':'remove'};function emitEvent(_0x40a874){return function(_0x23c947,_0xe7d540,_0x162ffe){ChatWebsiteEvents[_0x656e('0x6')](_0x40a874+':'+_0x23c947['id'],_0x23c947);ChatWebsiteEvents[_0x656e('0x6')](_0x40a874,_0x23c947);_0x162ffe(null);};}for(var e in events){if(events[_0x656e('0x7')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x656e('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0xf25a=['../../mysqldb','ChatWebsite','save','update','remove','hasOwnProperty','events'];(function(_0x15ddc9,_0x209223){var _0x2fc9e8=function(_0x2d5e5f){while(--_0x2d5e5f){_0x15ddc9['push'](_0x15ddc9['shift']());}};_0x2fc9e8(++_0x209223);}(_0xf25a,0x195));var _0xaf25=function(_0x43f582,_0x1ba83d){_0x43f582=_0x43f582-0x0;var _0x2b3082=_0xf25a[_0x43f582];return _0x2b3082;};'use strict';var EventEmitter=require(_0xaf25('0x0'));var ChatWebsite=require(_0xaf25('0x1'))['db'][_0xaf25('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xaf25('0x3'),'afterUpdate':_0xaf25('0x4'),'afterDestroy':_0xaf25('0x5')};function emitEvent(_0x4d4252){return function(_0x1ef749,_0x49e3b2,_0x1142c7){ChatWebsiteEvents['emit'](_0x4d4252+':'+_0x1ef749['id'],_0x1ef749);ChatWebsiteEvents['emit'](_0x4d4252,_0x1ef749);_0x1142c7(null);};}for(var e in events){if(events[_0xaf25('0x6')](e)){var event=events[e];ChatWebsite['hook'](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 f961207..d2aec9d 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 _0x33da=['exports','define','ChatWebsite','chat_websites','lodash','bluebird','request-promise','path'];(function(_0x93e6a1,_0x11e83d){var _0x37a194=function(_0x40144b){while(--_0x40144b){_0x93e6a1['push'](_0x93e6a1['shift']());}};_0x37a194(++_0x11e83d);}(_0x33da,0x1d4));var _0xa33d=function(_0x3a16d4,_0x23ecda){_0x3a16d4=_0x3a16d4-0x0;var _0x31ea9c=_0x33da[_0x3a16d4];return _0x31ea9c;};'use strict';var _=require(_0xa33d('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa33d('0x1'));var rp=require(_0xa33d('0x2'));var fs=require('fs');var path=require(_0xa33d('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatWebsite.attributes');module[_0xa33d('0x4')]=function(_0x314725,_0x1c62a1){return _0x314725[_0xa33d('0x5')](_0xa33d('0x6'),attributes,{'tableName':_0xa33d('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd2cb=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatWebsite'];(function(_0x1358a6,_0x23372a){var _0x336ecc=function(_0x1fcedb){while(--_0x1fcedb){_0x1358a6['push'](_0x1358a6['shift']());}};_0x336ecc(++_0x23372a);}(_0xd2cb,0x1b0));var _0xbd2c=function(_0x1c4fa8,_0x10c2cd){_0x1c4fa8=_0x1c4fa8-0x0;var _0x5502cc=_0xd2cb[_0x1c4fa8];return _0x5502cc;};'use strict';var _=require(_0xbd2c('0x0'));var util=require(_0xbd2c('0x1'));var logger=require(_0xbd2c('0x2'))(_0xbd2c('0x3'));var moment=require('moment');var BPromise=require(_0xbd2c('0x4'));var rp=require(_0xbd2c('0x5'));var fs=require('fs');var path=require(_0xbd2c('0x6'));var rimraf=require(_0xbd2c('0x7'));var config=require(_0xbd2c('0x8'));var attributes=require('./chatWebsite.attributes');module[_0xbd2c('0x9')]=function(_0x41d9b1,_0x4e1285){return _0x41d9b1[_0xbd2c('0xa')](_0xbd2c('0xb'),attributes,{'tableName':'chat_websites','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 983e5b5..61b7c0d 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 _0x3ac2=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','ChatWebsite,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','result','catch','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x990dc5,_0x29cef5){var _0x3699ac=function(_0xaf13){while(--_0xaf13){_0x990dc5['push'](_0x990dc5['shift']());}};_0x3699ac(++_0x29cef5);}(_0x3ac2,0xb8));var _0x23ac=function(_0x521bb6,_0x2b02b8){_0x521bb6=_0x521bb6-0x0;var _0x43d45f=_0x3ac2[_0x521bb6];return _0x43d45f;};'use strict';var _=require('lodash');var util=require(_0x23ac('0x0'));var moment=require(_0x23ac('0x1'));var BPromise=require('bluebird');var rs=require(_0x23ac('0x2'));var fs=require('fs');var Redis=require(_0x23ac('0x3'));var db=require(_0x23ac('0x4'))['db'];var utils=require(_0x23ac('0x5'));var logger=require('../../config/logger')(_0x23ac('0x6'));var config=require(_0x23ac('0x7'));var jayson=require(_0x23ac('0x8'));var client=jayson[_0x23ac('0x9')][_0x23ac('0xa')]({'port':0x232a});config[_0x23ac('0xb')]=_['defaults'](config[_0x23ac('0xb')],{'host':_0x23ac('0xc'),'port':0x18eb});var socket=require(_0x23ac('0xd'))(new Redis(config[_0x23ac('0xb')]));require(_0x23ac('0xe'))[_0x23ac('0xf')](socket);function respondWithRpcPromise(_0x460163,_0x46fdb4,_0x1a0c1b){return new BPromise(function(_0x7bed82,_0x2d43f2){return client[_0x23ac('0x10')](_0x460163,_0x1a0c1b)[_0x23ac('0x11')](function(_0xb909a){logger['info'](_0x23ac('0x12'),_0x46fdb4,'request\x20sent');logger[_0x23ac('0x13')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x46fdb4,_0x23ac('0x14'),JSON['stringify'](_0xb909a));if(_0xb909a[_0x23ac('0x15')]){if(_0xb909a[_0x23ac('0x15')][_0x23ac('0x16')]===0x1f4){logger[_0x23ac('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x46fdb4,_0xb909a[_0x23ac('0x15')][_0x23ac('0x17')]);return _0x2d43f2(_0xb909a[_0x23ac('0x15')][_0x23ac('0x17')]);}logger[_0x23ac('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x46fdb4,_0xb909a[_0x23ac('0x15')][_0x23ac('0x17')]);return _0x7bed82(_0xb909a['error'][_0x23ac('0x17')]);}else{logger[_0x23ac('0x18')](_0x23ac('0x12'),_0x46fdb4,_0x23ac('0x14'));_0x7bed82(_0xb909a[_0x23ac('0x19')][_0x23ac('0x17')]);}})[_0x23ac('0x1a')](function(_0x5b9ab3){logger[_0x23ac('0x15')](_0x23ac('0x12'),_0x46fdb4,_0x5b9ab3);_0x2d43f2(_0x5b9ab3);});});}
\ No newline at end of file
+var _0x8a34=['defaults','localhost','socket.io-emitter','register','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis'];(function(_0x3e8587,_0x2f4fc7){var _0x27b557=function(_0x5ae806){while(--_0x5ae806){_0x3e8587['push'](_0x3e8587['shift']());}};_0x27b557(++_0x2f4fc7);}(_0x8a34,0x77));var _0x48a3=function(_0x32aac9,_0x5eb63d){_0x32aac9=_0x32aac9-0x0;var _0x51bafd=_0x8a34[_0x32aac9];return _0x51bafd;};'use strict';var _=require('lodash');var util=require(_0x48a3('0x0'));var moment=require('moment');var BPromise=require(_0x48a3('0x1'));var rs=require(_0x48a3('0x2'));var fs=require('fs');var Redis=require(_0x48a3('0x3'));var db=require(_0x48a3('0x4'))['db'];var utils=require(_0x48a3('0x5'));var logger=require('../../config/logger')(_0x48a3('0x6'));var config=require(_0x48a3('0x7'));var jayson=require(_0x48a3('0x8'));var client=jayson[_0x48a3('0x9')]['http']({'port':0x232a});config[_0x48a3('0xa')]=_[_0x48a3('0xb')](config[_0x48a3('0xa')],{'host':_0x48a3('0xc'),'port':0x18eb});var socket=require(_0x48a3('0xd'))(new Redis(config[_0x48a3('0xa')]));require('./chatWebsite.socket')[_0x48a3('0xe')](socket);function respondWithRpcPromise(_0x5b30fc,_0x204d3e,_0x1d9ada){return new BPromise(function(_0x196a66,_0x5b6dd2){return client[_0x48a3('0xf')](_0x5b30fc,_0x1d9ada)[_0x48a3('0x10')](function(_0x3ad578){logger['info'](_0x48a3('0x11'),_0x204d3e,_0x48a3('0x12'));logger[_0x48a3('0x13')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x204d3e,_0x48a3('0x12'),JSON[_0x48a3('0x14')](_0x3ad578));if(_0x3ad578[_0x48a3('0x15')]){if(_0x3ad578[_0x48a3('0x15')][_0x48a3('0x16')]===0x1f4){logger[_0x48a3('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x204d3e,_0x3ad578[_0x48a3('0x15')]['message']);return _0x5b6dd2(_0x3ad578[_0x48a3('0x15')][_0x48a3('0x17')]);}logger[_0x48a3('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x204d3e,_0x3ad578['error'][_0x48a3('0x17')]);return _0x196a66(_0x3ad578[_0x48a3('0x15')][_0x48a3('0x17')]);}else{logger[_0x48a3('0x18')](_0x48a3('0x11'),_0x204d3e,_0x48a3('0x12'));_0x196a66(_0x3ad578['result'][_0x48a3('0x17')]);}})[_0x48a3('0x19')](function(_0x6563c4){logger['error'](_0x48a3('0x11'),_0x204d3e,_0x6563c4);_0x5b6dd2(_0x6563c4);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 6efa12f..c498a15 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 _0xb3b3=['chatWebsite:','./chatWebsite.events','save','remove','emit','removeListener','length'];(function(_0x321e39,_0x2f99c8){var _0x2e5be2=function(_0x14fa6a){while(--_0x14fa6a){_0x321e39['push'](_0x321e39['shift']());}};_0x2e5be2(++_0x2f99c8);}(_0xb3b3,0xc5));var _0x3b3b=function(_0x2985d6,_0x1dd3f1){_0x2985d6=_0x2985d6-0x0;var _0x5ad2bb=_0xb3b3[_0x2985d6];return _0x5ad2bb;};'use strict';var ChatWebsiteEvents=require(_0x3b3b('0x0'));var events=[_0x3b3b('0x1'),_0x3b3b('0x2'),'update'];function createListener(_0x5a6deb,_0x3d8932){return function(_0x53dec7){_0x3d8932[_0x3b3b('0x3')](_0x5a6deb,_0x53dec7);};}function removeListener(_0x20a21d,_0x574747){return function(){ChatWebsiteEvents[_0x3b3b('0x4')](_0x20a21d,_0x574747);};}exports['register']=function(_0x386f32){for(var _0xe2d9a2=0x0,_0x132234=events[_0x3b3b('0x5')];_0xe2d9a2<_0x132234;_0xe2d9a2++){var _0x1ca1f1=events[_0xe2d9a2];var _0x187b23=createListener(_0x3b3b('0x6')+_0x1ca1f1,_0x386f32);ChatWebsiteEvents['on'](_0x1ca1f1,_0x187b23);}};
\ No newline at end of file
+var _0xbd8a=['update','emit','removeListener','register','length','chatWebsite:','save'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0xbd8a,0x133));var _0xabd8=function(_0x48d6a3,_0x37c848){_0x48d6a3=_0x48d6a3-0x0;var _0x38bfa0=_0xbd8a[_0x48d6a3];return _0x38bfa0;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0xabd8('0x0'),'remove',_0xabd8('0x1')];function createListener(_0x47f8cf,_0x1f7efa){return function(_0x5bae34){_0x1f7efa[_0xabd8('0x2')](_0x47f8cf,_0x5bae34);};}function removeListener(_0x22b467,_0x45b759){return function(){ChatWebsiteEvents[_0xabd8('0x3')](_0x22b467,_0x45b759);};}exports[_0xabd8('0x4')]=function(_0x11fb27){for(var _0x3986f2=0x0,_0x3908d3=events[_0xabd8('0x5')];_0x3986f2<_0x3908d3;_0x3986f2++){var _0x2103f0=events[_0x3986f2];var _0x42aac4=createListener(_0xabd8('0x6')+_0x2103f0,_0x11fb27);ChatWebsiteEvents['on'](_0x2103f0,_0x42aac4);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 6389cdd..522ffcf 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 _0xe644=['removeAnswers','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','/:id','show','getDispositions','/:id/canned_answers','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','create','/:id/dispositions','addDisposition','addAnswer','join','root','format','%s-%s','now','originalname','post','single','file','addLogo','diskStorage','addAvatar','server/files/images/avatars/','/:id/notify','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addAgents','update','destroy','delete','removeDispositions'];(function(_0x5a5585,_0xf2eccd){var _0x167909=function(_0x17020d){while(--_0x17020d){_0x5a5585['push'](_0x5a5585['shift']());}};_0x167909(++_0xf2eccd);}(_0xe644,0x1eb));var _0x4e64=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe644[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x4e64('0x0'));var util=require(_0x4e64('0x1'));var path=require('path');var timeout=require(_0x4e64('0x2'));var express=require('express');var router=express[_0x4e64('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4e64('0x4'));var interaction=require(_0x4e64('0x5'));var config=require(_0x4e64('0x6'));var controller=require(_0x4e64('0x7'));router['get']('/',auth[_0x4e64('0x8')](),controller[_0x4e64('0x9')]);router[_0x4e64('0xa')]('/describe',auth[_0x4e64('0x8')](),controller['describe']);router['get'](_0x4e64('0xb'),auth[_0x4e64('0x8')](),controller[_0x4e64('0xc')]);router[_0x4e64('0xa')]('/:id/dispositions',auth[_0x4e64('0x8')](),controller[_0x4e64('0xd')]);router[_0x4e64('0xa')](_0x4e64('0xe'),auth[_0x4e64('0x8')](),controller['getAnswers']);router[_0x4e64('0xa')](_0x4e64('0xf'),controller[_0x4e64('0x10')]);router[_0x4e64('0xa')]('/:id/avatar',controller[_0x4e64('0x11')]);router['get'](_0x4e64('0x12'),controller[_0x4e64('0x13')]);router['get'](_0x4e64('0x14'),controller[_0x4e64('0x15')]);router[_0x4e64('0xa')](_0x4e64('0x16'),auth['isAuthenticated'](),controller[_0x4e64('0x17')]);router[_0x4e64('0xa')](_0x4e64('0x18'),controller[_0x4e64('0x19')]);router[_0x4e64('0xa')](_0x4e64('0x1a'),auth[_0x4e64('0x8')](),controller[_0x4e64('0x1b')]);router[_0x4e64('0xa')](_0x4e64('0x1c'),auth[_0x4e64('0x8')](),controller[_0x4e64('0x1d')]);router[_0x4e64('0xa')](_0x4e64('0x1e'),controller[_0x4e64('0x1f')]);router['get'](_0x4e64('0x20'),auth[_0x4e64('0x8')](),controller[_0x4e64('0x21')]);router[_0x4e64('0xa')](_0x4e64('0x22'),auth[_0x4e64('0x8')](),controller[_0x4e64('0x23')]);router['post']('/',auth[_0x4e64('0x8')](),controller[_0x4e64('0x24')]);router['post'](_0x4e64('0x25'),auth[_0x4e64('0x8')](),controller[_0x4e64('0x26')]);router['post']('/:id/canned_answers',auth[_0x4e64('0x8')](),controller[_0x4e64('0x27')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1673cc,_0x8fd4,_0x117e09){_0x117e09(null,path[_0x4e64('0x28')](config[_0x4e64('0x29')],'server/files/images/logos/'));},'filename':function(_0x1d68c6,_0x2178aa,_0x310496){_0x310496(null,util[_0x4e64('0x2a')](_0x4e64('0x2b'),Date[_0x4e64('0x2c')](),_0x2178aa[_0x4e64('0x2d')]));}})});router[_0x4e64('0x2e')](_0x4e64('0xf'),upload[_0x4e64('0x2f')](_0x4e64('0x30')),controller[_0x4e64('0x31')]);var upload=multer({'storage':multer[_0x4e64('0x32')]({'destination':function(_0x3e412d,_0x5ab9f3,_0x144f3e){_0x144f3e(null,path[_0x4e64('0x28')](config[_0x4e64('0x29')],'server/files/images/avatars/'));},'filename':function(_0x1ce79d,_0x5c2a2f,_0x39d6b7){_0x39d6b7(null,util['format']('%s-%s',Date['now'](),_0x5c2a2f[_0x4e64('0x2d')]));}})});router[_0x4e64('0x2e')]('/:id/avatar',upload['single'](_0x4e64('0x30')),controller[_0x4e64('0x33')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53945b,_0x3e4e05,_0x5efdbe){_0x5efdbe(null,path[_0x4e64('0x28')](config[_0x4e64('0x29')],'server/files/images/avatars/'));},'filename':function(_0x1cdab9,_0x56b94c,_0xded7c3){_0xded7c3(null,util[_0x4e64('0x2a')]('%s-%s',Date[_0x4e64('0x2c')](),_0x56b94c[_0x4e64('0x2d')]));}})});router[_0x4e64('0x2e')](_0x4e64('0x12'),upload[_0x4e64('0x2f')]('file'),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1818ce,_0x3e3fc4,_0x295611){_0x295611(null,path[_0x4e64('0x28')](config['root'],_0x4e64('0x34')));},'filename':function(_0x34ae4c,_0x14c3ce,_0x3b7950){_0x3b7950(null,util[_0x4e64('0x2a')](_0x4e64('0x2b'),Date[_0x4e64('0x2c')](),_0x14c3ce[_0x4e64('0x2d')]));}})});router['post'](_0x4e64('0x14'),upload[_0x4e64('0x2f')]('file'),controller['addSystemAvatar']);router['post'](_0x4e64('0x35'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x4e64('0x32')]({'destination':function(_0x21796,_0x1b0f4e,_0x1f7314){const _0x2bcb8c=path['join'](config[_0x4e64('0x29')],'server/files',_0x4e64('0x36'),_0x4e64('0x37'));fs_extra[_0x4e64('0x38')](_0x2bcb8c,function(){_0x1f7314(null,_0x2bcb8c);});},'filename':function(_0x2b1816,_0x1a3f0b,_0x448348){const _0x94f611=_0x1a3f0b[_0x4e64('0x2d')][_0x4e64('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x36df6d=path[_0x4e64('0x3a')](_0x94f611);const _0x5bad6d=Date[_0x4e64('0x2c')]()+'-'+_0x94f611[_0x4e64('0x39')](_0x36df6d,'')+_0x36df6d;_0x448348(null,_0x5bad6d);}})});router[_0x4e64('0x2e')](_0x4e64('0x3b'),offlineUploadMulter[_0x4e64('0x3c')](),controller[_0x4e64('0x3d')]);router[_0x4e64('0x2e')](_0x4e64('0x16'),auth[_0x4e64('0x8')](),controller[_0x4e64('0x3e')]);router[_0x4e64('0x2e')](_0x4e64('0x1a'),auth[_0x4e64('0x8')](),controller[_0x4e64('0x3f')]);router[_0x4e64('0x2e')](_0x4e64('0x1c'),auth[_0x4e64('0x8')](),controller['addProactiveActions']);router['post']('/:id/users',auth[_0x4e64('0x8')](),controller[_0x4e64('0x40')]);router['put']('/:id',auth[_0x4e64('0x8')](),controller[_0x4e64('0x41')]);router['delete'](_0x4e64('0xb'),auth[_0x4e64('0x8')](),controller[_0x4e64('0x42')]);router[_0x4e64('0x43')]('/:id/dispositions',auth[_0x4e64('0x8')](),controller[_0x4e64('0x44')]);router[_0x4e64('0x43')](_0x4e64('0xe'),auth[_0x4e64('0x8')](),controller[_0x4e64('0x45')]);router[_0x4e64('0x43')](_0x4e64('0x22'),auth[_0x4e64('0x8')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0x3f4c=['describe','/:id','getDispositions','/:id/canned_answers','getAnswers','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','getSnippet','getApplications','/:id/proactive_actions','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','/:id/dispositions','addAnswer','diskStorage','join','root','%s-%s','now','originalname','/:id/logo','single','file','addLogo','/:id/avatar','addAvatar','server/files/images/avatars/','format','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','ensureDir','replace','extname','any','addInteraction','addApplications','addProactiveActions','addAgents','put','delete','removeAnswers','removeAgents','multer','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','/describe'];(function(_0x39104f,_0x13890f){var _0x3aa11b=function(_0x349847){while(--_0x349847){_0x39104f['push'](_0x39104f['shift']());}};_0x3aa11b(++_0x13890f);}(_0x3f4c,0x1ef));var _0xc3f4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3f4c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xc3f4('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc3f4('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc3f4('0x2'));var interaction=require(_0xc3f4('0x3'));var config=require(_0xc3f4('0x4'));var controller=require(_0xc3f4('0x5'));router[_0xc3f4('0x6')]('/',auth[_0xc3f4('0x7')](),controller['index']);router[_0xc3f4('0x6')](_0xc3f4('0x8'),auth[_0xc3f4('0x7')](),controller[_0xc3f4('0x9')]);router['get'](_0xc3f4('0xa'),auth[_0xc3f4('0x7')](),controller['show']);router[_0xc3f4('0x6')]('/:id/dispositions',auth[_0xc3f4('0x7')](),controller[_0xc3f4('0xb')]);router[_0xc3f4('0x6')](_0xc3f4('0xc'),auth[_0xc3f4('0x7')](),controller[_0xc3f4('0xd')]);router[_0xc3f4('0x6')]('/:id/logo',controller['getLogo']);router[_0xc3f4('0x6')]('/:id/avatar',controller['getAvatar']);router[_0xc3f4('0x6')](_0xc3f4('0xe'),controller[_0xc3f4('0xf')]);router[_0xc3f4('0x6')](_0xc3f4('0x10'),controller[_0xc3f4('0x11')]);router[_0xc3f4('0x6')](_0xc3f4('0x12'),auth[_0xc3f4('0x7')](),controller['getInteractions']);router[_0xc3f4('0x6')](_0xc3f4('0x13'),controller[_0xc3f4('0x14')]);router[_0xc3f4('0x6')]('/:id/applications',auth[_0xc3f4('0x7')](),controller[_0xc3f4('0x15')]);router['get'](_0xc3f4('0x16'),auth[_0xc3f4('0x7')](),controller['getProactiveActions']);router[_0xc3f4('0x6')]('/:id/fields',controller[_0xc3f4('0x17')]);router['get'](_0xc3f4('0x18'),auth['isAuthenticated'](),controller[_0xc3f4('0x19')]);router[_0xc3f4('0x6')](_0xc3f4('0x1a'),auth[_0xc3f4('0x7')](),controller[_0xc3f4('0x1b')]);router[_0xc3f4('0x1c')]('/',auth['isAuthenticated'](),controller[_0xc3f4('0x1d')]);router[_0xc3f4('0x1c')](_0xc3f4('0x1e'),auth[_0xc3f4('0x7')](),controller['addDisposition']);router[_0xc3f4('0x1c')](_0xc3f4('0xc'),auth[_0xc3f4('0x7')](),controller[_0xc3f4('0x1f')]);var upload=multer({'storage':multer[_0xc3f4('0x20')]({'destination':function(_0x43c539,_0x168040,_0x5d2eb7){_0x5d2eb7(null,path[_0xc3f4('0x21')](config[_0xc3f4('0x22')],'server/files/images/logos/'));},'filename':function(_0x2e907f,_0xf7c2dc,_0xe49b7e){_0xe49b7e(null,util['format'](_0xc3f4('0x23'),Date[_0xc3f4('0x24')](),_0xf7c2dc[_0xc3f4('0x25')]));}})});router[_0xc3f4('0x1c')](_0xc3f4('0x26'),upload[_0xc3f4('0x27')](_0xc3f4('0x28')),controller[_0xc3f4('0x29')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x58b424,_0x103e6a,_0x73221e){_0x73221e(null,path[_0xc3f4('0x21')](config[_0xc3f4('0x22')],'server/files/images/avatars/'));},'filename':function(_0x907b82,_0x3c718d,_0x58d0ac){_0x58d0ac(null,util['format'](_0xc3f4('0x23'),Date['now'](),_0x3c718d[_0xc3f4('0x25')]));}})});router[_0xc3f4('0x1c')](_0xc3f4('0x2a'),upload[_0xc3f4('0x27')](_0xc3f4('0x28')),controller[_0xc3f4('0x2b')]);var upload=multer({'storage':multer[_0xc3f4('0x20')]({'destination':function(_0x177888,_0xfcf561,_0x2bf013){_0x2bf013(null,path[_0xc3f4('0x21')](config[_0xc3f4('0x22')],_0xc3f4('0x2c')));},'filename':function(_0x55b19b,_0x244d3f,_0x3403d9){_0x3403d9(null,util[_0xc3f4('0x2d')](_0xc3f4('0x23'),Date[_0xc3f4('0x24')](),_0x244d3f['originalname']));}})});router['post'](_0xc3f4('0xe'),upload[_0xc3f4('0x27')](_0xc3f4('0x28')),controller[_0xc3f4('0x2e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2b1979,_0x10589e,_0x1c2e45){_0x1c2e45(null,path[_0xc3f4('0x21')](config[_0xc3f4('0x22')],_0xc3f4('0x2c')));},'filename':function(_0xdb23f0,_0x2ef58c,_0x517392){_0x517392(null,util[_0xc3f4('0x2d')](_0xc3f4('0x23'),Date[_0xc3f4('0x24')](),_0x2ef58c['originalname']));}})});router[_0xc3f4('0x1c')]('/:id/system_avatar',upload['single'](_0xc3f4('0x28')),controller[_0xc3f4('0x2f')]);router[_0xc3f4('0x1c')](_0xc3f4('0x30'),controller[_0xc3f4('0x31')]);const offlineUploadMulter=multer({'storage':multer[_0xc3f4('0x20')]({'destination':function(_0x175b87,_0x218b10,_0x52dd0a){const _0x235bde=path[_0xc3f4('0x21')](config[_0xc3f4('0x22')],_0xc3f4('0x32'),'attachments','offline-chat');fs_extra[_0xc3f4('0x33')](_0x235bde,function(){_0x52dd0a(null,_0x235bde);});},'filename':function(_0x21b63b,_0x59277f,_0x38f9ca){const _0x1b5c9e=_0x59277f['originalname'][_0xc3f4('0x34')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x977be3=path[_0xc3f4('0x35')](_0x1b5c9e);const _0x3412d1=Date['now']()+'-'+_0x1b5c9e[_0xc3f4('0x34')](_0x977be3,'')+_0x977be3;_0x38f9ca(null,_0x3412d1);}})});router['post']('/:id/offline',offlineUploadMulter[_0xc3f4('0x36')](),controller['offline']);router['post']('/:id/interactions',auth['isAuthenticated'](),controller[_0xc3f4('0x37')]);router[_0xc3f4('0x1c')]('/:id/applications',auth[_0xc3f4('0x7')](),controller[_0xc3f4('0x38')]);router['post'](_0xc3f4('0x16'),auth[_0xc3f4('0x7')](),controller[_0xc3f4('0x39')]);router['post'](_0xc3f4('0x1a'),auth[_0xc3f4('0x7')](),controller[_0xc3f4('0x3a')]);router[_0xc3f4('0x3b')](_0xc3f4('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xc3f4('0xa'),auth['isAuthenticated'](),controller['destroy']);router[_0xc3f4('0x3c')](_0xc3f4('0x1e'),auth[_0xc3f4('0x7')](),controller['removeDispositions']);router[_0xc3f4('0x3c')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xc3f4('0x3d')]);router[_0xc3f4('0x3c')](_0xc3f4('0x1a'),auth[_0xc3f4('0x7')](),controller[_0xc3f4('0x3e')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index eee9ec9..8fb11d6 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 _0xca0e=['exports','express','../components/auth/service','../config/environment','Router','env','production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','use','isAuthenticated'];(function(_0x3ca3e2,_0x159af3){var _0x905966=function(_0x144b6c){while(--_0x144b6c){_0x3ca3e2['push'](_0x3ca3e2['shift']());}};_0x905966(++_0x159af3);}(_0xca0e,0x1d5));var _0xeca0=function(_0x162ac4,_0x5dd373){_0x162ac4=_0x162ac4-0x0;var _0x41250f=_0xca0e[_0x162ac4];return _0x41250f;};var beaverLogger=require('beaver-logger/server');var express=require(_0xeca0('0x0'));var auth=require(_0xeca0('0x1'));var config=require(_0xeca0('0x2'));var router=express[_0xeca0('0x3')]();var isProduction=config[_0xeca0('0x4')]===_0xeca0('0x5')||![];function clientSideLogs(_0x560018,_0x54a1c1,_0x1e0bb5){var _0x1c15ee=_0x560018[_0xeca0('0x6')][_0xeca0('0x7')](_0xeca0('0x8'));if(!_0x1c15ee){throw new Error(_0xeca0('0x9'));}return beaverLogger['expressEndpoint']({'uri':'/client-logs','logger':_0x1c15ee,'enableCors':!isProduction})(_0x560018,_0x54a1c1,_0x1e0bb5);}router[_0xeca0('0xa')](auth[_0xeca0('0xb')](),clientSideLogs);module[_0xeca0('0xc')]=router;
\ No newline at end of file
+var _0x28fd=['exports','beaver-logger/server','express','../components/auth/service','../config/environment','env','production','app','get','client-side-logger','expressEndpoint','/client-logs','use','isAuthenticated'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0x28fd,0x135));var _0xd28f=function(_0x34325b,_0x5e5afe){_0x34325b=_0x34325b-0x0;var _0x3da348=_0x28fd[_0x34325b];return _0x3da348;};var beaverLogger=require(_0xd28f('0x0'));var express=require(_0xd28f('0x1'));var auth=require(_0xd28f('0x2'));var config=require(_0xd28f('0x3'));var router=express['Router']();var isProduction=config[_0xd28f('0x4')]===_0xd28f('0x5')||![];function clientSideLogs(_0x39163b,_0x7aca7,_0x27f215){var _0x1bfc0c=_0x39163b[_0xd28f('0x6')][_0xd28f('0x7')](_0xd28f('0x8'));if(!_0x1bfc0c){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0xd28f('0x9')]({'uri':_0xd28f('0xa'),'logger':_0x1bfc0c,'enableCors':!isProduction})(_0x39163b,_0x7aca7,_0x27f215);}router[_0xd28f('0xb')](auth[_0xd28f('0xc')](),clientSideLogs);module[_0xd28f('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 5e85437..1828701 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 _0xbdbd=['Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','STRING','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','ENUM','AmazonAWS','MicrosoftAzure'];(function(_0x3bd530,_0x6007c0){var _0xe3e781=function(_0x2757c3){while(--_0x2757c3){_0x3bd530['push'](_0x3bd530['shift']());}};_0xe3e781(++_0x6007c0);}(_0xbdbd,0xeb));var _0xdbdb=function(_0x3e82be,_0x4bb290){_0x3e82be=_0x3e82be-0x0;var _0x5c9d92=_0xbdbd[_0x3e82be];return _0x5c9d92;};'use strict';var Sequelize=require(_0xdbdb('0x0'));module[_0xdbdb('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xdbdb('0x2')](_0xdbdb('0x3'),'Google',_0xdbdb('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xdbdb('0x5'),_0xdbdb('0x6'))},'data1':{'type':Sequelize['STRING'],'comment':_0xdbdb('0x7')},'data2':{'type':Sequelize['STRING'],'comment':_0xdbdb('0x8')},'data3':{'type':Sequelize[_0xdbdb('0x9')],'comment':_0xdbdb('0xa')},'data4':{'type':Sequelize[_0xdbdb('0x9')],'comment':_0xdbdb('0xb')},'data5':{'type':Sequelize['TEXT'],'comment':_0xdbdb('0xc')},'data6':{'type':Sequelize[_0xdbdb('0xd')],'comment':_0xdbdb('0xe')},'data7':{'type':Sequelize[_0xdbdb('0xd')],'comment':_0xdbdb('0xf')}};
\ No newline at end of file
+var _0xeeb0=['MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','AmazonAWS','MicrosoftAzure','Outlook365'];(function(_0xea9a5d,_0x4fbf4a){var _0x344633=function(_0x11de98){while(--_0x11de98){_0xea9a5d['push'](_0xea9a5d['shift']());}};_0x344633(++_0x4fbf4a);}(_0xeeb0,0xb5));var _0x0eeb=function(_0x387dc1,_0x3ba649){_0x387dc1=_0x387dc1-0x0;var _0x17567c=_0xeeb0[_0x387dc1];return _0x17567c;};'use strict';var Sequelize=require(_0x0eeb('0x0'));module[_0x0eeb('0x1')]={'name':{'type':Sequelize[_0x0eeb('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x0eeb('0x3'),'Google',_0x0eeb('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x0eeb('0x5'),'Dynamics365')},'data1':{'type':Sequelize[_0x0eeb('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0x0eeb('0x2')],'comment':_0x0eeb('0x6')},'data3':{'type':Sequelize[_0x0eeb('0x2')],'comment':_0x0eeb('0x7')},'data4':{'type':Sequelize['STRING'],'comment':_0x0eeb('0x8')},'data5':{'type':Sequelize[_0x0eeb('0x9')],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0x0eeb('0x9')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0x0eeb('0x9')],'comment':_0x0eeb('0xa')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 8770cb0..bb55bb1 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 _0x36d7=['set','Content-Range','update','destroy','then','end','error','stack','name','send','slice','index','map','CloudProvider','rawAttributes','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','service','MicrosoftAzure','data3','catch','show','params','fields','create','Name\x20parameter\x20not\x20specified','body','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','find','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','state','from','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','del','getOauth2MicrosoftAccessToken','data5','access_token','data6','refresh_token','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/logger','../../mysqldb','defaults','redis','localhost','socket.io-emitter','sendStatus','json','offset','undefined','limit','count','status'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x36d7,0x10d));var _0x736d=function(_0x203f90,_0x1f112d){_0x203f90=_0x203f90-0x0;var _0x3f8714=_0x36d7[_0x203f90];return _0x3f8714;};'use strict';var _=require('lodash');var Redis=require(_0x736d('0x0'));var qs=require(_0x736d('0x1'));var encryptor=require(_0x736d('0x2'));var config=require('../../config/environment');var logger=require(_0x736d('0x3'))('api');var db=require(_0x736d('0x4'))['db'];var oauth=require('./cloudProvider.oauth');config['redis']=_[_0x736d('0x5')](config[_0x736d('0x6')],{'host':_0x736d('0x7'),'port':0x18eb});var socket=require(_0x736d('0x8'))(new Redis(config[_0x736d('0x6')]));var redis=new Redis(config[_0x736d('0x6')]);function respondWithStatusCode(_0xdb924b,_0x40b786){_0x40b786=_0x40b786||0xcc;return function(_0x504e74){if(_0x504e74){return _0xdb924b[_0x736d('0x9')](_0x40b786);}return _0xdb924b['status'](_0x40b786)['end']();};}function respondWithResult(_0x2c59a5,_0x2899ca){_0x2899ca=_0x2899ca||0xc8;return function(_0x13e160){if(_0x13e160){return _0x2c59a5['status'](_0x2899ca)[_0x736d('0xa')](_0x13e160);}};}function respondWithFilteredResult(_0xfcd7cd,_0x5de6a7){return function(_0x3b4b3c){if(_0x3b4b3c){var _0x5720ae=typeof _0x5de6a7[_0x736d('0xb')]===_0x736d('0xc')&&typeof _0x5de6a7[_0x736d('0xd')]==='undefined';var _0x1232af=_0x3b4b3c[_0x736d('0xe')];var _0x49982b=_0x5720ae?0x0:_0x5de6a7[_0x736d('0xb')];var _0x4a57d0=_0x5720ae?_0x3b4b3c[_0x736d('0xe')]:_0x5de6a7[_0x736d('0xb')]+_0x5de6a7['limit'];var _0x130793;if(_0x4a57d0>=_0x1232af){_0x4a57d0=_0x1232af;_0x130793=0xc8;}else{_0x130793=0xce;}_0xfcd7cd[_0x736d('0xf')](_0x130793);return _0xfcd7cd[_0x736d('0x10')](_0x736d('0x11'),_0x49982b+'-'+_0x4a57d0+'/'+_0x1232af)['json'](_0x3b4b3c);}return null;};}function saveUpdates(_0x1f7fb2){return function(_0x308322){if(_0x308322){return _0x308322[_0x736d('0x12')](_0x1f7fb2)['then'](function(_0x336312){return _0x336312;});}return null;};}function removeEntity(_0x44ec98){return function(_0xf105fe){if(_0xf105fe){return _0xf105fe[_0x736d('0x13')]()[_0x736d('0x14')](function(){_0x44ec98[_0x736d('0xf')](0xcc)[_0x736d('0x15')]();});}};}function handleEntityNotFound(_0x430642){return function(_0x30566f){if(!_0x30566f){_0x430642[_0x736d('0x9')](0x194);}return _0x30566f;};}function handleError(_0x2a1da9,_0x38c322){_0x38c322=_0x38c322||0x1f4;return function(_0x215bae){logger[_0x736d('0x16')](_0x215bae[_0x736d('0x17')]);if(_0x215bae[_0x736d('0x18')]){delete _0x215bae['name'];}_0x2a1da9[_0x736d('0xf')](_0x38c322)[_0x736d('0x19')](_0x215bae);};}function maskClientSecret(_0x555856){return _['padEnd'](_0x555856[_0x736d('0x1a')](0x0,0x3),0x14,'*');}exports[_0x736d('0x1b')]=function(_0x938e6d,_0x3a40ab){var _0x4b272a={},_0x527e60={},_0x45fad0={'count':0x0,'rows':[]};var _0x83c125=_[_0x736d('0x1c')](db[_0x736d('0x1d')][_0x736d('0x1e')],function(_0x836365){return{'name':_0x836365['fieldName'],'type':_0x836365['type'][_0x736d('0x1f')]};});_0x527e60['model']=_[_0x736d('0x1c')](_0x83c125,_0x736d('0x18'));_0x527e60[_0x736d('0x20')]=_[_0x736d('0x21')](_0x938e6d[_0x736d('0x20')]);_0x527e60[_0x736d('0x22')]=_[_0x736d('0x23')](_0x527e60[_0x736d('0x24')],_0x527e60[_0x736d('0x20')]);_0x4b272a[_0x736d('0x25')]=_[_0x736d('0x23')](_0x527e60[_0x736d('0x24')],qs['fields'](_0x938e6d[_0x736d('0x20')]['fields']));_0x4b272a[_0x736d('0x25')]=_0x4b272a[_0x736d('0x25')][_0x736d('0x26')]?_0x4b272a[_0x736d('0x25')]:_0x527e60[_0x736d('0x24')];if(!_0x938e6d[_0x736d('0x20')][_0x736d('0x27')](_0x736d('0x28'))){_0x4b272a[_0x736d('0xd')]=qs[_0x736d('0xd')](_0x938e6d[_0x736d('0x20')][_0x736d('0xd')]);_0x4b272a[_0x736d('0xb')]=qs[_0x736d('0xb')](_0x938e6d[_0x736d('0x20')][_0x736d('0xb')]);}_0x4b272a[_0x736d('0x29')]=qs[_0x736d('0x2a')](_0x938e6d[_0x736d('0x20')][_0x736d('0x2a')]);_0x4b272a['where']=qs[_0x736d('0x22')](_['pick'](_0x938e6d[_0x736d('0x20')],_0x527e60[_0x736d('0x22')]),_0x83c125);if(_0x938e6d[_0x736d('0x20')]['filter']){_0x4b272a[_0x736d('0x2b')]=_['merge'](_0x4b272a[_0x736d('0x2b')],{'$or':_[_0x736d('0x1c')](_0x83c125,function(_0x26f582){if(_0x26f582[_0x736d('0x2c')]!==_0x736d('0x2d')){var _0x2e7eb0={};_0x2e7eb0[_0x26f582['name']]={'$like':'%'+_0x938e6d[_0x736d('0x20')][_0x736d('0x2e')]+'%'};return _0x2e7eb0;}})});}_0x4b272a=_[_0x736d('0x2f')]({},_0x4b272a,_0x938e6d[_0x736d('0x30')]);var _0x19163a={'where':_0x4b272a['where']};return db['CloudProvider'][_0x736d('0xe')](_0x19163a)[_0x736d('0x14')](function(_0x244f35){_0x45fad0[_0x736d('0xe')]=_0x244f35;if(_0x938e6d['query'][_0x736d('0x31')]){_0x4b272a[_0x736d('0x32')]=[{'all':!![]}];}return db[_0x736d('0x1d')][_0x736d('0x33')](_0x4b272a);})[_0x736d('0x14')](function(_0x2deb4c){_0x45fad0[_0x736d('0x34')]=_['map'](_0x2deb4c,function(_0x5c3ad8){if(_0x5c3ad8[_0x736d('0x35')]===_0x736d('0x36')){var _0x25d58f=encryptor['decryptString'](_0x5c3ad8[_0x736d('0x37')]);_0x5c3ad8[_0x736d('0x37')]=maskClientSecret(_0x25d58f);}return _0x5c3ad8;});return _0x45fad0;})[_0x736d('0x14')](respondWithFilteredResult(_0x3a40ab,_0x4b272a))[_0x736d('0x38')](handleError(_0x3a40ab,null));};exports[_0x736d('0x39')]=function(_0x3fae37,_0x46a65f){var _0x28cb89={'raw':!![],'where':{'id':_0x3fae37[_0x736d('0x3a')]['id']}},_0x331764={};_0x331764['model']=_[_0x736d('0x21')](db['CloudProvider'][_0x736d('0x1e')]);_0x331764[_0x736d('0x20')]=_[_0x736d('0x21')](_0x3fae37['query']);_0x331764[_0x736d('0x22')]=_[_0x736d('0x23')](_0x331764[_0x736d('0x24')],_0x331764[_0x736d('0x20')]);_0x28cb89['attributes']=_[_0x736d('0x23')](_0x331764[_0x736d('0x24')],qs[_0x736d('0x3b')](_0x3fae37[_0x736d('0x20')][_0x736d('0x3b')]));_0x28cb89['attributes']=_0x28cb89[_0x736d('0x25')][_0x736d('0x26')]?_0x28cb89[_0x736d('0x25')]:_0x331764['model'];if(_0x3fae37['query'][_0x736d('0x31')]){_0x28cb89[_0x736d('0x32')]=[{'all':!![]}];}_0x28cb89=_[_0x736d('0x2f')]({},_0x28cb89,_0x3fae37[_0x736d('0x30')]);return db[_0x736d('0x1d')]['find'](_0x28cb89)[_0x736d('0x14')](handleEntityNotFound(_0x46a65f,null))['then'](function(_0x4a4ba5){if(_0x4a4ba5['service']==='MicrosoftAzure'){var _0x39d48e=encryptor['decryptString'](_0x4a4ba5[_0x736d('0x37')]);_0x4a4ba5[_0x736d('0x37')]=maskClientSecret(_0x39d48e);}return _0x4a4ba5;})[_0x736d('0x14')](respondWithResult(_0x46a65f,null))[_0x736d('0x38')](handleError(_0x46a65f,null));};exports[_0x736d('0x3c')]=function(_0xf4392,_0x298034){if(!_0xf4392['body'][_0x736d('0x18')])throw new Error(_0x736d('0x3d'));if(!_0xf4392[_0x736d('0x3e')]['service'])throw new Error('Service\x20parameter\x20not\x20specified');var _0x116db0=db[_0x736d('0x1d')][_0x736d('0x1e')]['service'][_0x736d('0x3f')];if(!_0x116db0[_0x736d('0x40')](_0xf4392['body'][_0x736d('0x35')]))throw new Error(_0x736d('0x41')+_0x116db0[_0x736d('0x42')](',\x20'));if(_0xf4392[_0x736d('0x3e')][_0x736d('0x35')]==='MicrosoftAzure'&&_0xf4392[_0x736d('0x3e')][_0x736d('0x37')]){_0xf4392['body'][_0x736d('0x37')]=encryptor[_0x736d('0x43')](_0xf4392[_0x736d('0x3e')][_0x736d('0x37')]);}return db['CloudProvider'][_0x736d('0x3c')](_0xf4392[_0x736d('0x3e')],{})[_0x736d('0x14')](respondWithResult(_0x298034,0xc9))['catch'](handleError(_0x298034,null));};exports[_0x736d('0x12')]=function(_0x17fa73,_0x27f360){if(_0x17fa73[_0x736d('0x3e')]['id']){delete _0x17fa73[_0x736d('0x3e')]['id'];}return db[_0x736d('0x1d')][_0x736d('0x44')]({'where':{'id':_0x17fa73[_0x736d('0x3a')]['id']}})[_0x736d('0x14')](handleEntityNotFound(_0x27f360,null))[_0x736d('0x14')](function(_0x52b2d9){if(_0x52b2d9[_0x736d('0x35')]===_0x736d('0x36')&&_0x17fa73[_0x736d('0x3e')][_0x736d('0x37')]){_0x17fa73[_0x736d('0x3e')][_0x736d('0x37')]=encryptor[_0x736d('0x43')](_0x17fa73[_0x736d('0x3e')][_0x736d('0x37')]);}return _0x52b2d9;})[_0x736d('0x14')](saveUpdates(_0x17fa73[_0x736d('0x3e')],null))['then'](respondWithResult(_0x27f360,null))[_0x736d('0x38')](handleError(_0x27f360,null));};exports[_0x736d('0x13')]=function(_0x3b6c35,_0x263b31){return db[_0x736d('0x1d')]['find']({'where':{'id':_0x3b6c35[_0x736d('0x3a')]['id']}})[_0x736d('0x14')](handleEntityNotFound(_0x263b31,null))['then'](removeEntity(_0x263b31,null))[_0x736d('0x38')](handleError(_0x263b31,null));};exports[_0x736d('0x45')]=function(_0x2dc79d,_0x158509){return db[_0x736d('0x1d')][_0x736d('0x46')]({'where':{'id':_0x2dc79d[_0x736d('0x3a')]['id']},'raw':!![]})[_0x736d('0x14')](function(_0x1adde5){if(!_0x1adde5)return _0x158509[_0x736d('0x9')](0x194);return{'url':oauth[_0x736d('0x47')](_0x1adde5,_0x2dc79d[_0x736d('0x48')]['id'])};})[_0x736d('0x14')](respondWithResult(_0x158509,null))[_0x736d('0x38')](handleError(_0x158509,null));};exports[_0x736d('0x49')]=function(_0x312f2c,_0x34bc98){var _0xc00079=_0x312f2c[_0x736d('0x3e')];var _0x212a3d;var _0x1f7994;if(_0xc00079['error'])throw _0xc00079;redis['get'](_0xc00079[_0x736d('0x4a')])['then'](function(_0x4ba58f){if(!_0x4ba58f)throw new Error('Invalid\x20state\x20parameter');_0x212a3d=JSON['parse'](_0x4ba58f);var _0x2a14f8=Buffer[_0x736d('0x4b')](_0xc00079['state'],_0x736d('0x4c'))[_0x736d('0x4d')](_0x736d('0x4e'));_0x1f7994=JSON['parse'](_0x2a14f8);if(!oauth[_0x736d('0x4f')](_0xc00079[_0x736d('0x50')],_0x212a3d[_0x736d('0x51')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0x736d('0x52')](_0xc00079[_0x736d('0x4a')]);return oauth[_0x736d('0x53')](_0xc00079['code'],_0x212a3d);})[_0x736d('0x14')](function(_0x3f0822){_0x212a3d[_0x736d('0x54')]=_0x3f0822[_0x736d('0x55')];_0x212a3d[_0x736d('0x56')]=_0x3f0822[_0x736d('0x57')];return db['CloudProvider'][_0x736d('0x12')]({'data5':_0x212a3d['data5'],'data6':_0x212a3d['data6']},{'where':{'id':_0x212a3d['id']}});})[_0x736d('0x14')](function(){oauth['startRefreshInterval'](_0x212a3d);socket[_0x736d('0x58')](_0x736d('0x59'),{'id':_0x1f7994['id']});return;})[_0x736d('0x14')](respondWithStatusCode(_0x34bc98,null))[_0x736d('0x38')](function(_0x21d95a){if(_0x1f7994){socket[_0x736d('0x58')](_0x736d('0x5a'),{'id':_0x1f7994['id']});}if(!_0x212a3d){logger[_0x736d('0x16')](_0x736d('0x5b'),_0x21d95a);return _0x34bc98[_0x736d('0xf')](0x1f4)[_0x736d('0x19')](_0x21d95a[_0x736d('0x5c')]);}logger[_0x736d('0x16')](_0x736d('0x5d'),_0x212a3d['id'],JSON[_0x736d('0x5e')](_0x21d95a));});};
\ No newline at end of file
+var _0x09e8=['CloudProvider','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','show','keys','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','encryptString','find','params','oauth2MicrosoftAuthorize','findOne','user','parse','from','toString','ascii','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','state','getOauth2MicrosoftAccessToken','access_token','data5','data6','startRefreshInterval','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','stringify','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','redis','defaults','localhost','socket.io-emitter','status','offset','undefined','limit','count','set','Content-Range','then','destroy','sendStatus','error','stack','name','send','padEnd','slice','index','map'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x09e8,0x95));var _0x809e=function(_0x11ca5c,_0x270dd6){_0x11ca5c=_0x11ca5c-0x0;var _0x196716=_0x09e8[_0x11ca5c];return _0x196716;};'use strict';var _=require('lodash');var Redis=require(_0x809e('0x0'));var qs=require(_0x809e('0x1'));var encryptor=require(_0x809e('0x2'));var config=require(_0x809e('0x3'));var logger=require(_0x809e('0x4'))('api');var db=require('../../mysqldb')['db'];var oauth=require('./cloudProvider.oauth');config[_0x809e('0x5')]=_[_0x809e('0x6')](config[_0x809e('0x5')],{'host':_0x809e('0x7'),'port':0x18eb});var socket=require(_0x809e('0x8'))(new Redis(config[_0x809e('0x5')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x52b164,_0x5046d8){_0x5046d8=_0x5046d8||0xcc;return function(_0x55a7a9){if(_0x55a7a9){return _0x52b164['sendStatus'](_0x5046d8);}return _0x52b164[_0x809e('0x9')](_0x5046d8)['end']();};}function respondWithResult(_0x261e53,_0x4b8bb3){_0x4b8bb3=_0x4b8bb3||0xc8;return function(_0x3b6b0f){if(_0x3b6b0f){return _0x261e53['status'](_0x4b8bb3)['json'](_0x3b6b0f);}};}function respondWithFilteredResult(_0x2598cd,_0x511a8c){return function(_0x4fdbd1){if(_0x4fdbd1){var _0x4334fc=typeof _0x511a8c[_0x809e('0xa')]===_0x809e('0xb')&&typeof _0x511a8c[_0x809e('0xc')]==='undefined';var _0x5e70a6=_0x4fdbd1[_0x809e('0xd')];var _0x54a528=_0x4334fc?0x0:_0x511a8c[_0x809e('0xa')];var _0x4bf11d=_0x4334fc?_0x4fdbd1[_0x809e('0xd')]:_0x511a8c[_0x809e('0xa')]+_0x511a8c[_0x809e('0xc')];var _0x3d8863;if(_0x4bf11d>=_0x5e70a6){_0x4bf11d=_0x5e70a6;_0x3d8863=0xc8;}else{_0x3d8863=0xce;}_0x2598cd[_0x809e('0x9')](_0x3d8863);return _0x2598cd[_0x809e('0xe')](_0x809e('0xf'),_0x54a528+'-'+_0x4bf11d+'/'+_0x5e70a6)['json'](_0x4fdbd1);}return null;};}function saveUpdates(_0x7a3fdd){return function(_0x4da1c2){if(_0x4da1c2){return _0x4da1c2['update'](_0x7a3fdd)[_0x809e('0x10')](function(_0x19c2c2){return _0x19c2c2;});}return null;};}function removeEntity(_0x44cbc9){return function(_0x28b65a){if(_0x28b65a){return _0x28b65a[_0x809e('0x11')]()[_0x809e('0x10')](function(){_0x44cbc9[_0x809e('0x9')](0xcc)['end']();});}};}function handleEntityNotFound(_0x531b03){return function(_0xd9e546){if(!_0xd9e546){_0x531b03[_0x809e('0x12')](0x194);}return _0xd9e546;};}function handleError(_0x4d8f90,_0x4b6106){_0x4b6106=_0x4b6106||0x1f4;return function(_0x22c7fd){logger[_0x809e('0x13')](_0x22c7fd[_0x809e('0x14')]);if(_0x22c7fd[_0x809e('0x15')]){delete _0x22c7fd[_0x809e('0x15')];}_0x4d8f90[_0x809e('0x9')](_0x4b6106)[_0x809e('0x16')](_0x22c7fd);};}function maskClientSecret(_0x28934d){return _[_0x809e('0x17')](_0x28934d[_0x809e('0x18')](0x0,0x3),0x14,'*');}exports[_0x809e('0x19')]=function(_0x139e0c,_0x455c42){var _0x5e205e={},_0x290435={},_0x359364={'count':0x0,'rows':[]};var _0x1992ec=_[_0x809e('0x1a')](db[_0x809e('0x1b')][_0x809e('0x1c')],function(_0x25281d){return{'name':_0x25281d[_0x809e('0x1d')],'type':_0x25281d[_0x809e('0x1e')]['key']};});_0x290435[_0x809e('0x1f')]=_[_0x809e('0x1a')](_0x1992ec,_0x809e('0x15'));_0x290435[_0x809e('0x20')]=_['keys'](_0x139e0c[_0x809e('0x20')]);_0x290435[_0x809e('0x21')]=_['intersection'](_0x290435['model'],_0x290435['query']);_0x5e205e['attributes']=_[_0x809e('0x22')](_0x290435[_0x809e('0x1f')],qs[_0x809e('0x23')](_0x139e0c[_0x809e('0x20')][_0x809e('0x23')]));_0x5e205e[_0x809e('0x24')]=_0x5e205e['attributes']['length']?_0x5e205e[_0x809e('0x24')]:_0x290435['model'];if(!_0x139e0c['query'][_0x809e('0x25')](_0x809e('0x26'))){_0x5e205e[_0x809e('0xc')]=qs[_0x809e('0xc')](_0x139e0c[_0x809e('0x20')][_0x809e('0xc')]);_0x5e205e[_0x809e('0xa')]=qs[_0x809e('0xa')](_0x139e0c[_0x809e('0x20')][_0x809e('0xa')]);}_0x5e205e['order']=qs['sort'](_0x139e0c[_0x809e('0x20')][_0x809e('0x27')]);_0x5e205e[_0x809e('0x28')]=qs[_0x809e('0x21')](_[_0x809e('0x29')](_0x139e0c['query'],_0x290435[_0x809e('0x21')]),_0x1992ec);if(_0x139e0c[_0x809e('0x20')][_0x809e('0x2a')]){_0x5e205e[_0x809e('0x28')]=_['merge'](_0x5e205e[_0x809e('0x28')],{'$or':_[_0x809e('0x1a')](_0x1992ec,function(_0x44e5c7){if(_0x44e5c7[_0x809e('0x1e')]!==_0x809e('0x2b')){var _0x28dc4c={};_0x28dc4c[_0x44e5c7['name']]={'$like':'%'+_0x139e0c[_0x809e('0x20')]['filter']+'%'};return _0x28dc4c;}})});}_0x5e205e=_[_0x809e('0x2c')]({},_0x5e205e,_0x139e0c[_0x809e('0x2d')]);var _0x178f91={'where':_0x5e205e[_0x809e('0x28')]};return db[_0x809e('0x1b')]['count'](_0x178f91)['then'](function(_0x3c9380){_0x359364['count']=_0x3c9380;if(_0x139e0c[_0x809e('0x20')][_0x809e('0x2e')]){_0x5e205e[_0x809e('0x2f')]=[{'all':!![]}];}return db['CloudProvider'][_0x809e('0x30')](_0x5e205e);})[_0x809e('0x10')](function(_0x28f13a){_0x359364[_0x809e('0x31')]=_[_0x809e('0x1a')](_0x28f13a,function(_0x5a9aa3){if(_0x5a9aa3[_0x809e('0x32')]===_0x809e('0x33')){var _0x38fdc4=encryptor[_0x809e('0x34')](_0x5a9aa3[_0x809e('0x35')]);_0x5a9aa3[_0x809e('0x35')]=maskClientSecret(_0x38fdc4);}return _0x5a9aa3;});return _0x359364;})['then'](respondWithFilteredResult(_0x455c42,_0x5e205e))[_0x809e('0x36')](handleError(_0x455c42,null));};exports[_0x809e('0x37')]=function(_0x5ac292,_0x1452ba){var _0x4c944f={'raw':!![],'where':{'id':_0x5ac292['params']['id']}},_0x10e653={};_0x10e653[_0x809e('0x1f')]=_[_0x809e('0x38')](db['CloudProvider']['rawAttributes']);_0x10e653[_0x809e('0x20')]=_[_0x809e('0x38')](_0x5ac292[_0x809e('0x20')]);_0x10e653[_0x809e('0x21')]=_[_0x809e('0x22')](_0x10e653[_0x809e('0x1f')],_0x10e653[_0x809e('0x20')]);_0x4c944f[_0x809e('0x24')]=_['intersection'](_0x10e653[_0x809e('0x1f')],qs['fields'](_0x5ac292['query']['fields']));_0x4c944f[_0x809e('0x24')]=_0x4c944f[_0x809e('0x24')]['length']?_0x4c944f[_0x809e('0x24')]:_0x10e653[_0x809e('0x1f')];if(_0x5ac292[_0x809e('0x20')]['includeAll']){_0x4c944f[_0x809e('0x2f')]=[{'all':!![]}];}_0x4c944f=_[_0x809e('0x2c')]({},_0x4c944f,_0x5ac292[_0x809e('0x2d')]);return db[_0x809e('0x1b')]['find'](_0x4c944f)['then'](handleEntityNotFound(_0x1452ba,null))[_0x809e('0x10')](function(_0x50e3f6){if(_0x50e3f6['service']===_0x809e('0x33')){var _0xd42b24=encryptor['decryptString'](_0x50e3f6[_0x809e('0x35')]);_0x50e3f6[_0x809e('0x35')]=maskClientSecret(_0xd42b24);}return _0x50e3f6;})[_0x809e('0x10')](respondWithResult(_0x1452ba,null))[_0x809e('0x36')](handleError(_0x1452ba,null));};exports[_0x809e('0x39')]=function(_0x518956,_0x4f1ea2){if(!_0x518956[_0x809e('0x3a')][_0x809e('0x15')])throw new Error(_0x809e('0x3b'));if(!_0x518956['body'][_0x809e('0x32')])throw new Error(_0x809e('0x3c'));var _0x522d9d=db[_0x809e('0x1b')][_0x809e('0x1c')][_0x809e('0x32')][_0x809e('0x3d')];if(!_0x522d9d[_0x809e('0x3e')](_0x518956[_0x809e('0x3a')][_0x809e('0x32')]))throw new Error(_0x809e('0x3f')+_0x522d9d['join'](',\x20'));if(_0x518956[_0x809e('0x3a')][_0x809e('0x32')]===_0x809e('0x33')&&_0x518956[_0x809e('0x3a')][_0x809e('0x35')]){_0x518956[_0x809e('0x3a')][_0x809e('0x35')]=encryptor[_0x809e('0x40')](_0x518956['body'][_0x809e('0x35')]);}return db[_0x809e('0x1b')][_0x809e('0x39')](_0x518956[_0x809e('0x3a')],{})['then'](respondWithResult(_0x4f1ea2,0xc9))[_0x809e('0x36')](handleError(_0x4f1ea2,null));};exports['update']=function(_0x3dff64,_0x529b71){if(_0x3dff64[_0x809e('0x3a')]['id']){delete _0x3dff64[_0x809e('0x3a')]['id'];}return db[_0x809e('0x1b')][_0x809e('0x41')]({'where':{'id':_0x3dff64[_0x809e('0x42')]['id']}})['then'](handleEntityNotFound(_0x529b71,null))['then'](function(_0x415bf5){if(_0x415bf5['service']===_0x809e('0x33')&&_0x3dff64[_0x809e('0x3a')][_0x809e('0x35')]){_0x3dff64['body'][_0x809e('0x35')]=encryptor[_0x809e('0x40')](_0x3dff64[_0x809e('0x3a')][_0x809e('0x35')]);}return _0x415bf5;})[_0x809e('0x10')](saveUpdates(_0x3dff64['body'],null))[_0x809e('0x10')](respondWithResult(_0x529b71,null))[_0x809e('0x36')](handleError(_0x529b71,null));};exports[_0x809e('0x11')]=function(_0x3b2fb7,_0x192da4){return db[_0x809e('0x1b')][_0x809e('0x41')]({'where':{'id':_0x3b2fb7[_0x809e('0x42')]['id']}})[_0x809e('0x10')](handleEntityNotFound(_0x192da4,null))['then'](removeEntity(_0x192da4,null))[_0x809e('0x36')](handleError(_0x192da4,null));};exports[_0x809e('0x43')]=function(_0xce3bd0,_0x947447){return db[_0x809e('0x1b')][_0x809e('0x44')]({'where':{'id':_0xce3bd0[_0x809e('0x42')]['id']},'raw':!![]})[_0x809e('0x10')](function(_0x27efa8){if(!_0x27efa8)return _0x947447[_0x809e('0x12')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x27efa8,_0xce3bd0[_0x809e('0x45')]['id'])};})[_0x809e('0x10')](respondWithResult(_0x947447,null))['catch'](handleError(_0x947447,null));};exports['oauth2MicrosoftCallback']=function(_0x66cac1,_0x15329f){var _0x2da938=_0x66cac1[_0x809e('0x3a')];var _0x229d69;var _0xf063a;if(_0x2da938['error'])throw _0x2da938;redis['get'](_0x2da938['state'])['then'](function(_0x230e53){if(!_0x230e53)throw new Error('Invalid\x20state\x20parameter');_0x229d69=JSON[_0x809e('0x46')](_0x230e53);var _0xa6478b=Buffer[_0x809e('0x47')](_0x2da938['state'],'base64')[_0x809e('0x48')](_0x809e('0x49'));_0xf063a=JSON[_0x809e('0x46')](_0xa6478b);if(!oauth['isValidIdToken'](_0x2da938[_0x809e('0x4a')],_0x229d69[_0x809e('0x4b')]))throw new Error(_0x809e('0x4c'));redis['del'](_0x2da938[_0x809e('0x4d')]);return oauth[_0x809e('0x4e')](_0x2da938['code'],_0x229d69);})['then'](function(_0x5d8667){_0x229d69['data5']=_0x5d8667[_0x809e('0x4f')];_0x229d69['data6']=_0x5d8667['refresh_token'];return db[_0x809e('0x1b')]['update']({'data5':_0x229d69[_0x809e('0x50')],'data6':_0x229d69[_0x809e('0x51')]},{'where':{'id':_0x229d69['id']}});})[_0x809e('0x10')](function(){oauth[_0x809e('0x52')](_0x229d69);socket[_0x809e('0x53')]('microsoftAuthorization:success',{'id':_0xf063a['id']});return;})['then'](respondWithStatusCode(_0x15329f,null))[_0x809e('0x36')](function(_0x51700b){if(_0xf063a){socket[_0x809e('0x53')](_0x809e('0x54'),{'id':_0xf063a['id']});}if(!_0x229d69){logger[_0x809e('0x13')](_0x809e('0x55'),_0x51700b);return _0x15329f[_0x809e('0x9')](0x1f4)[_0x809e('0x16')](_0x51700b[_0x809e('0x56')]);}logger['error']('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x229d69['id'],JSON[_0x809e('0x57')](_0x51700b));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 2d7d40d..52dbbf0 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 _0xbf08=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','define','CloudProvider','cloud_providers','lodash'];(function(_0x50cd41,_0x4874a7){var _0x399475=function(_0x1946da){while(--_0x1946da){_0x50cd41['push'](_0x50cd41['shift']());}};_0x399475(++_0x4874a7);}(_0xbf08,0xe6));var _0x8bf0=function(_0x267224,_0x2fcf36){_0x267224=_0x267224-0x0;var _0x4655c8=_0xbf08[_0x267224];return _0x4655c8;};'use strict';var _=require(_0x8bf0('0x0'));var util=require('util');var logger=require(_0x8bf0('0x1'))('api');var moment=require(_0x8bf0('0x2'));var BPromise=require('bluebird');var rp=require(_0x8bf0('0x3'));var fs=require('fs');var path=require(_0x8bf0('0x4'));var rimraf=require(_0x8bf0('0x5'));var config=require(_0x8bf0('0x6'));var attributes=require('./cloudProvider.attributes');module[_0x8bf0('0x7')]=function(_0x2ad77d,_0x32c8e2){return _0x2ad77d[_0x8bf0('0x8')](_0x8bf0('0x9'),attributes,{'tableName':_0x8bf0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5d1e=['define','CloudProvider','cloud_providers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports'];(function(_0x166dd8,_0x12e7d0){var _0x148103=function(_0x34bf7d){while(--_0x34bf7d){_0x166dd8['push'](_0x166dd8['shift']());}};_0x148103(++_0x12e7d0);}(_0x5d1e,0x198));var _0xe5d1=function(_0x51ba4e,_0x74fea1){_0x51ba4e=_0x51ba4e-0x0;var _0xcbc87c=_0x5d1e[_0x51ba4e];return _0xcbc87c;};'use strict';var _=require(_0xe5d1('0x0'));var util=require(_0xe5d1('0x1'));var logger=require(_0xe5d1('0x2'))(_0xe5d1('0x3'));var moment=require(_0xe5d1('0x4'));var BPromise=require(_0xe5d1('0x5'));var rp=require(_0xe5d1('0x6'));var fs=require('fs');var path=require(_0xe5d1('0x7'));var rimraf=require(_0xe5d1('0x8'));var config=require(_0xe5d1('0x9'));var attributes=require(_0xe5d1('0xa'));module[_0xe5d1('0xb')]=function(_0x1b2a07,_0x26ef3a){return _0x1b2a07[_0xe5d1('0xc')](_0xe5d1('0xd'),attributes,{'tableName':_0xe5d1('0xe'),'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 2a5b968..ff0105d 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 _0x9295=['update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','POST','bind','intervals','all','inspect','exports','lodash','crypto','jsonwebtoken','moment','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','localhost','profile','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','openid','/authorize','map','type','data7','/.default','join','Outlook365','Dynamics365','replace','data2','code','id_token','from','stringify','toString','hex','client_id','data1','response_type','redirect_uri','data4','form_post','scope','state','nonce','prompt','login','key','value','oauth2Claims','oauth2/','decode','payload','issuer','aud','isAfter','unix','exp','then','data3','refresh_token','data6','{TENANT_ID}','data5','access_token','CloudProvider'];(function(_0x1d446b,_0x18ca6a){var _0x3d4f55=function(_0x2ae2f5){while(--_0x2ae2f5){_0x1d446b['push'](_0x1d446b['shift']());}};_0x3d4f55(++_0x18ca6a);}(_0x9295,0xa1));var _0x5929=function(_0x896cea,_0x460e8c){_0x896cea=_0x896cea-0x0;var _0x20af48=_0x9295[_0x896cea];return _0x20af48;};'use strict';var _=require(_0x5929('0x0'));var crypto=require(_0x5929('0x1'));var jwt=require(_0x5929('0x2'));var moment=require(_0x5929('0x3'));var Redis=require('ioredis');var rp=require(_0x5929('0x4'));var util=require(_0x5929('0x5'));var encryptor=require(_0x5929('0x6'));var config=require(_0x5929('0x7'));var logger=require(_0x5929('0x8'))(_0x5929('0x9'));var schedule=require(_0x5929('0xa'));var db=require(_0x5929('0xb'))['db'];config[_0x5929('0xc')]=_['defaults'](config[_0x5929('0xc')],{'host':_0x5929('0xd'),'port':0x18eb});var redis=new Redis(config[_0x5929('0xc')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0x5929('0xe'),'email','offline_access',_0x5929('0xf'),_0x5929('0x10'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0x5929('0x11'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0x5929('0x12');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x25b764){var _0x50bf64=_[_0x5929('0x13')](AZURE_AUTH_SCOPES[_0x25b764[_0x5929('0x14')]]);if(_0x25b764[_0x5929('0x14')]==='Dynamics365')_0x50bf64['push'](_0x25b764[_0x5929('0x15')]+_0x5929('0x16'));return _0x50bf64[_0x5929('0x17')]('\x20');}function getAccessTokenScope(_0x14f9a8){if(_0x14f9a8['type']===_0x5929('0x18'))return _0x5929('0xf');if(_0x14f9a8['type']===_0x5929('0x19'))return _0x14f9a8['data7']+'/.default';}function generateMicrosoftAuthorizationUrl(_0x26114d,_0x237255){var _0x421e88=MICROSOFT_AUTH_URL[_0x5929('0x1a')]('{TENANT_ID}',_0x26114d[_0x5929('0x1b')]);var _0x4a5487=[_0x5929('0x1c'),_0x5929('0x1d')];var _0x2bfa52=Buffer[_0x5929('0x1e')](JSON[_0x5929('0x1f')]({'id':_0x237255}))[_0x5929('0x20')]('base64');var _0x3e6854=crypto['randomBytes'](0x10)['toString'](_0x5929('0x21'));var _0x9f36cc=getAuthorizationScopes(_0x26114d);var _0x99ff15=[{'key':_0x5929('0x22'),'value':_0x26114d[_0x5929('0x23')]},{'key':_0x5929('0x24'),'value':encodeURIComponent(_0x4a5487[_0x5929('0x17')]('\x20'))},{'key':_0x5929('0x25'),'value':_0x26114d[_0x5929('0x26')]},{'key':'response_mode','value':_0x5929('0x27')},{'key':_0x5929('0x28'),'value':encodeURIComponent(_0x9f36cc)},{'key':_0x5929('0x29'),'value':_0x2bfa52},{'key':_0x5929('0x2a'),'value':_0x3e6854},{'key':_0x5929('0x2b'),'value':_0x5929('0x2c')}];var _0x43f88f=_0x421e88+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x99ff15,function(_0x4a46f5){return _0x4a46f5[_0x5929('0x2d')]+'='+_0x4a46f5[_0x5929('0x2e')];})['join']('&');_0x26114d[_0x5929('0x2f')]={'issuer':_0x421e88['replace'](_0x5929('0x30'),''),'audience':_0x26114d[_0x5929('0x23')],'state':_0x2bfa52,'nonce':_0x3e6854};redis['set'](_0x2bfa52,JSON[_0x5929('0x1f')](_0x26114d));return _0x43f88f;}function isValidIdToken(_0x105de6,_0x1c85d7){try{var _0x4c6bb2=jwt[_0x5929('0x31')](_0x105de6,{'complete':!![]});var _0x34ebe6=_0x4c6bb2[_0x5929('0x32')];if(_0x34ebe6['iss']!==_0x1c85d7[_0x5929('0x33')])return![];if(_0x34ebe6[_0x5929('0x34')]!==_0x1c85d7['audience'])return![];if(_0x34ebe6[_0x5929('0x2a')]!==_0x1c85d7[_0x5929('0x2a')])return![];if(moment()[_0x5929('0x35')](moment[_0x5929('0x36')](_0x34ebe6[_0x5929('0x37')])))return![];return!![];}catch(_0x13bffb){throw _0x13bffb;}}function refreshOauth2MicrosoftAccessToken(_0x7d524){return Promise['resolve']()[_0x5929('0x38')](function(){if(_0x7d524[_0x5929('0x39')])return _0x7d524;return db['CloudProvider']['findOne']({'where':{'id':_0x7d524['id']},'raw':!![]});})['then'](function(_0x13f473){var _0x51f03b={'grant_type':_0x5929('0x3a'),'refresh_token':_0x13f473[_0x5929('0x3b')],'scope':getAccessTokenScope(_0x13f473),'redirect_uri':_0x13f473[_0x5929('0x26')],'client_id':_0x13f473['data1'],'client_secret':encryptor['decryptString'](_0x13f473[_0x5929('0x39')])};var _0x5a47d9={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x5929('0x1a')](_0x5929('0x3c'),_0x13f473[_0x5929('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x51f03b,'json':!![]};return rp(_0x5a47d9);})[_0x5929('0x38')](function(_0x80997e){_0x7d524[_0x5929('0x3d')]=_0x80997e[_0x5929('0x3e')];_0x7d524[_0x5929('0x3b')]=_0x80997e['refresh_token'];return db[_0x5929('0x3f')][_0x5929('0x40')]({'data5':_0x7d524[_0x5929('0x3d')],'data6':_0x7d524[_0x5929('0x3b')]},{'where':{'id':_0x7d524['id']}});})[_0x5929('0x38')](function(){return _0x7d524;})[_0x5929('0x41')](function(_0x28f9b9){logger[_0x5929('0x42')](_0x5929('0x43'),_0x7d524['id'],_0x28f9b9);});}function getOauth2MicrosoftAccessToken(_0x3294a8,_0x38669e){var _0x39ad34={'grant_type':_0x5929('0x44'),'code':_0x3294a8,'scope':getAccessTokenScope(_0x38669e),'redirect_uri':_0x38669e['data4'],'client_id':_0x38669e[_0x5929('0x23')],'client_secret':encryptor['decryptString'](_0x38669e[_0x5929('0x39')])};var _0x400280={'method':_0x5929('0x45'),'uri':MICROSOFT_AUTH_URL['replace'](_0x5929('0x3c'),_0x38669e[_0x5929('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x39ad34,'json':!![]};return rp(_0x400280);}function startRefreshInterval(_0x537ed7){var _0x212b63=schedule['intervals'];if(_0x212b63[_0x537ed7['id']])clearInterval(_0x212b63[_0x537ed7['id']]);_0x212b63[_0x537ed7['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x5929('0x46')](this,{'id':_0x537ed7['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x5929('0x47')]=_0x212b63;}function startAllRefreshIntervals(){return db[_0x5929('0x3f')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x5929('0x38')](function(_0x42b6ca){var _0x10aace=_0x42b6ca[_0x5929('0x13')](function(_0x3d6fe2){return refreshOauth2MicrosoftAccessToken(_0x3d6fe2)[_0x5929('0x38')](function(_0x27bd70){startRefreshInterval(_0x27bd70);});});return Promise[_0x5929('0x48')](_0x10aace);})[_0x5929('0x41')](function(_0x535e5f){var _0x1eb88=_0x535e5f?util[_0x5929('0x49')](_0x535e5f,{'showHidden':![],'depth':null}):'';logger[_0x5929('0x42')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x1eb88);});}module[_0x5929('0x4a')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x8507=['prompt','login','value','join','oauth2Claims','oauth2/','set','payload','iss','aud','audience','unix','then','CloudProvider','findOne','refresh_token','data3','POST','replace','data2','data5','access_token','update','data6','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','decryptString','intervals','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','jsonwebtoken','moment','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','email','offline_access','https://outlook.office.com/SMTP.Send','openid','/token','map','type','Dynamics365','push','Outlook365','data7','/.default','{TENANT_ID}','from','stringify','toString','base64','hex','client_id','data1','data4','response_mode','form_post','scope','nonce'];(function(_0x51e452,_0x434838){var _0xdc8be=function(_0x522097){while(--_0x522097){_0x51e452['push'](_0x51e452['shift']());}};_0xdc8be(++_0x434838);}(_0x8507,0x1df));var _0x7850=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8507[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x7850('0x0'));var crypto=require('crypto');var jwt=require(_0x7850('0x1'));var moment=require(_0x7850('0x2'));var Redis=require('ioredis');var rp=require(_0x7850('0x3'));var util=require(_0x7850('0x4'));var encryptor=require(_0x7850('0x5'));var config=require(_0x7850('0x6'));var logger=require(_0x7850('0x7'))(_0x7850('0x8'));var schedule=require(_0x7850('0x9'));var db=require(_0x7850('0xa'))['db'];config['redis']=_['defaults'](config[_0x7850('0xb')],{'host':_0x7850('0xc'),'port':0x18eb});var redis=new Redis(config[_0x7850('0xb')]);var MICROSOFT_AUTH_URL=_0x7850('0xd');var AZURE_AUTH_SCOPES={'Outlook365':['openid','profile',_0x7850('0xe'),_0x7850('0xf'),'https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All',_0x7850('0x10')],'Dynamics365':[_0x7850('0x11'),_0x7850('0xf')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0x7850('0x12');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0xa16545){var _0x2f9d2f=_[_0x7850('0x13')](AZURE_AUTH_SCOPES[_0xa16545[_0x7850('0x14')]]);if(_0xa16545['type']===_0x7850('0x15'))_0x2f9d2f[_0x7850('0x16')](_0xa16545['data7']+'/.default');return _0x2f9d2f['join']('\x20');}function getAccessTokenScope(_0x12ebc9){if(_0x12ebc9[_0x7850('0x14')]===_0x7850('0x17'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x12ebc9[_0x7850('0x14')]===_0x7850('0x15'))return _0x12ebc9[_0x7850('0x18')]+_0x7850('0x19');}function generateMicrosoftAuthorizationUrl(_0x20fea6,_0xe880c4){var _0x993cba=MICROSOFT_AUTH_URL['replace'](_0x7850('0x1a'),_0x20fea6['data2']);var _0x3be883=['code','id_token'];var _0x11d5c0=Buffer[_0x7850('0x1b')](JSON[_0x7850('0x1c')]({'id':_0xe880c4}))[_0x7850('0x1d')](_0x7850('0x1e'));var _0x163e41=crypto['randomBytes'](0x10)[_0x7850('0x1d')](_0x7850('0x1f'));var _0x1c821f=getAuthorizationScopes(_0x20fea6);var _0x2ac204=[{'key':_0x7850('0x20'),'value':_0x20fea6[_0x7850('0x21')]},{'key':'response_type','value':encodeURIComponent(_0x3be883['join']('\x20'))},{'key':'redirect_uri','value':_0x20fea6[_0x7850('0x22')]},{'key':_0x7850('0x23'),'value':_0x7850('0x24')},{'key':_0x7850('0x25'),'value':encodeURIComponent(_0x1c821f)},{'key':'state','value':_0x11d5c0},{'key':_0x7850('0x26'),'value':_0x163e41},{'key':_0x7850('0x27'),'value':_0x7850('0x28')}];var _0x32e0a9=_0x993cba+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x7850('0x13')](_0x2ac204,function(_0x3a0f07){return _0x3a0f07['key']+'='+_0x3a0f07[_0x7850('0x29')];})[_0x7850('0x2a')]('&');_0x20fea6[_0x7850('0x2b')]={'issuer':_0x993cba['replace'](_0x7850('0x2c'),''),'audience':_0x20fea6['data1'],'state':_0x11d5c0,'nonce':_0x163e41};redis[_0x7850('0x2d')](_0x11d5c0,JSON[_0x7850('0x1c')](_0x20fea6));return _0x32e0a9;}function isValidIdToken(_0x3036ce,_0x88eba3){try{var _0x34de8f=jwt['decode'](_0x3036ce,{'complete':!![]});var _0x15c263=_0x34de8f[_0x7850('0x2e')];if(_0x15c263[_0x7850('0x2f')]!==_0x88eba3['issuer'])return![];if(_0x15c263[_0x7850('0x30')]!==_0x88eba3[_0x7850('0x31')])return![];if(_0x15c263[_0x7850('0x26')]!==_0x88eba3[_0x7850('0x26')])return![];if(moment()['isAfter'](moment[_0x7850('0x32')](_0x15c263['exp'])))return![];return!![];}catch(_0xb8f992){throw _0xb8f992;}}function refreshOauth2MicrosoftAccessToken(_0x1a481e){return Promise['resolve']()[_0x7850('0x33')](function(){if(_0x1a481e['data3'])return _0x1a481e;return db[_0x7850('0x34')][_0x7850('0x35')]({'where':{'id':_0x1a481e['id']},'raw':!![]});})[_0x7850('0x33')](function(_0x310e27){var _0x1eb646={'grant_type':_0x7850('0x36'),'refresh_token':_0x310e27['data6'],'scope':getAccessTokenScope(_0x310e27),'redirect_uri':_0x310e27[_0x7850('0x22')],'client_id':_0x310e27[_0x7850('0x21')],'client_secret':encryptor['decryptString'](_0x310e27[_0x7850('0x37')])};var _0x3a35db={'method':_0x7850('0x38'),'uri':MICROSOFT_AUTH_URL[_0x7850('0x39')]('{TENANT_ID}',_0x310e27[_0x7850('0x3a')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1eb646,'json':!![]};return rp(_0x3a35db);})['then'](function(_0x5a1b0e){_0x1a481e[_0x7850('0x3b')]=_0x5a1b0e[_0x7850('0x3c')];_0x1a481e['data6']=_0x5a1b0e[_0x7850('0x36')];return db[_0x7850('0x34')][_0x7850('0x3d')]({'data5':_0x1a481e[_0x7850('0x3b')],'data6':_0x1a481e[_0x7850('0x3e')]},{'where':{'id':_0x1a481e['id']}});})[_0x7850('0x33')](function(){return _0x1a481e;})[_0x7850('0x3f')](function(_0xe86b7f){logger[_0x7850('0x40')](_0x7850('0x41'),_0x1a481e['id'],_0xe86b7f);});}function getOauth2MicrosoftAccessToken(_0x1f8557,_0x5d4081){var _0x45f048={'grant_type':_0x7850('0x42'),'code':_0x1f8557,'scope':getAccessTokenScope(_0x5d4081),'redirect_uri':_0x5d4081[_0x7850('0x22')],'client_id':_0x5d4081['data1'],'client_secret':encryptor[_0x7850('0x43')](_0x5d4081[_0x7850('0x37')])};var _0x3b74fc={'method':_0x7850('0x38'),'uri':MICROSOFT_AUTH_URL[_0x7850('0x39')](_0x7850('0x1a'),_0x5d4081[_0x7850('0x3a')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x45f048,'json':!![]};return rp(_0x3b74fc);}function startRefreshInterval(_0x2fc0c3){var _0x3e1d62=schedule[_0x7850('0x44')];if(_0x3e1d62[_0x2fc0c3['id']])clearInterval(_0x3e1d62[_0x2fc0c3['id']]);_0x3e1d62[_0x2fc0c3['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x2fc0c3['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x7850('0x44')]=_0x3e1d62;}function startAllRefreshIntervals(){return db['CloudProvider'][_0x7850('0x45')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x4b2f71){var _0x5e106e=_0x4b2f71[_0x7850('0x13')](function(_0x36dd90){return refreshOauth2MicrosoftAccessToken(_0x36dd90)[_0x7850('0x33')](function(_0x5c8718){startRefreshInterval(_0x5c8718);});});return Promise[_0x7850('0x46')](_0x5e106e);})[_0x7850('0x3f')](function(_0x2029f7){var _0x556cb1=_0x2029f7?util[_0x7850('0x47')](_0x2029f7,{'showHidden':![],'depth':null}):'';logger[_0x7850('0x40')](_0x7850('0x48'),_0x556cb1);});}module[_0x7850('0x49')]={'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 d1297be..c949cf6 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 _0x7d37=['jayson/promise','http','request','then','info','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','CloudProvider,\x20%s,\x20%s','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x130d82,_0x25f49b){var _0x112070=function(_0x5795ee){while(--_0x5795ee){_0x130d82['push'](_0x130d82['shift']());}};_0x112070(++_0x25f49b);}(_0x7d37,0x1db));var _0x77d3=function(_0x1723ab,_0x78e59b){_0x1723ab=_0x1723ab-0x0;var _0xde596b=_0x7d37[_0x1723ab];return _0xde596b;};'use strict';var _=require(_0x77d3('0x0'));var util=require(_0x77d3('0x1'));var moment=require(_0x77d3('0x2'));var BPromise=require('bluebird');var rs=require(_0x77d3('0x3'));var fs=require('fs');var Redis=require(_0x77d3('0x4'));var db=require(_0x77d3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x77d3('0x6'))(_0x77d3('0x7'));var config=require('../../config/environment');var jayson=require(_0x77d3('0x8'));var client=jayson['client'][_0x77d3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x519c6e,_0x40235d,_0x373da8){return new BPromise(function(_0x5c0108,_0x555390){return client[_0x77d3('0xa')](_0x519c6e,_0x373da8)[_0x77d3('0xb')](function(_0x506caa){logger[_0x77d3('0xc')]('CloudProvider,\x20%s,\x20%s',_0x40235d,_0x77d3('0xd'));logger['debug'](_0x77d3('0xe'),_0x40235d,'request\x20sent',JSON[_0x77d3('0xf')](_0x506caa));if(_0x506caa[_0x77d3('0x10')]){if(_0x506caa[_0x77d3('0x10')][_0x77d3('0x11')]===0x1f4){logger[_0x77d3('0x10')](_0x77d3('0x12'),_0x40235d,_0x506caa[_0x77d3('0x10')][_0x77d3('0x13')]);return _0x555390(_0x506caa[_0x77d3('0x10')]['message']);}logger[_0x77d3('0x10')]('CloudProvider,\x20%s,\x20%s',_0x40235d,_0x506caa['error']['message']);return _0x5c0108(_0x506caa[_0x77d3('0x10')][_0x77d3('0x13')]);}else{logger[_0x77d3('0xc')](_0x77d3('0x12'),_0x40235d,_0x77d3('0xd'));_0x5c0108(_0x506caa['result'][_0x77d3('0x13')]);}})[_0x77d3('0x14')](function(_0x5e92d8){logger['error'](_0x77d3('0x12'),_0x40235d,_0x5e92d8);_0x555390(_0x5e92d8);});});}
\ No newline at end of file
+var _0x5458=['rpc','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x336376,_0xe4b28d){var _0x1d2a8e=function(_0x3afe68){while(--_0x3afe68){_0x336376['push'](_0x336376['shift']());}};_0x1d2a8e(++_0xe4b28d);}(_0x5458,0x1c7));var _0x8545=function(_0x32cbf0,_0x47b073){_0x32cbf0=_0x32cbf0-0x0;var _0x332b2e=_0x5458[_0x32cbf0];return _0x332b2e;};'use strict';var _=require(_0x8545('0x0'));var util=require(_0x8545('0x1'));var moment=require(_0x8545('0x2'));var BPromise=require('bluebird');var rs=require(_0x8545('0x3'));var fs=require('fs');var Redis=require(_0x8545('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8545('0x5'));var logger=require(_0x8545('0x6'))(_0x8545('0x7'));var config=require('../../config/environment');var jayson=require(_0x8545('0x8'));var client=jayson[_0x8545('0x9')][_0x8545('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x359d01,_0x5062c7,_0x291bc9){return new BPromise(function(_0x507ed8,_0x2cc4f4){return client[_0x8545('0xb')](_0x359d01,_0x291bc9)[_0x8545('0xc')](function(_0x10931d){logger[_0x8545('0xd')](_0x8545('0xe'),_0x5062c7,_0x8545('0xf'));logger[_0x8545('0x10')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x5062c7,_0x8545('0xf'),JSON[_0x8545('0x11')](_0x10931d));if(_0x10931d[_0x8545('0x12')]){if(_0x10931d['error'][_0x8545('0x13')]===0x1f4){logger[_0x8545('0x12')](_0x8545('0xe'),_0x5062c7,_0x10931d[_0x8545('0x12')][_0x8545('0x14')]);return _0x2cc4f4(_0x10931d[_0x8545('0x12')][_0x8545('0x14')]);}logger[_0x8545('0x12')](_0x8545('0xe'),_0x5062c7,_0x10931d['error'][_0x8545('0x14')]);return _0x507ed8(_0x10931d[_0x8545('0x12')]['message']);}else{logger[_0x8545('0xd')](_0x8545('0xe'),_0x5062c7,_0x8545('0xf'));_0x507ed8(_0x10931d['result'][_0x8545('0x14')]);}})[_0x8545('0x15')](function(_0x3374f7){logger['error']('CloudProvider,\x20%s,\x20%s',_0x5062c7,_0x3374f7);_0x2cc4f4(_0x3374f7);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 943d1e6..cd75a64 100644
--- a/server/api/cloudProvider/index.js
+++ b/server/api/cloudProvider/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc4aa=['put','/:id','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','show','post','create'];(function(_0x1d102c,_0x1bbef1){var _0x45b606=function(_0x571877){while(--_0x571877){_0x1d102c['push'](_0x1d102c['shift']());}};_0x45b606(++_0x1bbef1);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xc4aa[_0x82129b];return _0x2ae5dc;};'use strict';var express=require(_0xac4a('0x0'));var router=express[_0xac4a('0x1')]();var auth=require(_0xac4a('0x2'));var controller=require(_0xac4a('0x3'));router[_0xac4a('0x4')]('/',auth[_0xac4a('0x5')](),controller['index']);router['get']('/:id',auth[_0xac4a('0x5')](),controller[_0xac4a('0x6')]);router[_0xac4a('0x7')]('/',auth[_0xac4a('0x5')](),controller[_0xac4a('0x8')]);router[_0xac4a('0x9')](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller['update']);router['delete'](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xb')]);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xd')]);router['post'](_0xac4a('0xe'),controller['oauth2MicrosoftCallback']);module[_0xac4a('0xf')]=router;
\ No newline at end of file
+var _0xadb5=['put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','Router','./cloudProvider.controller','get','isAuthenticated','/:id','post','create'];(function(_0x43d750,_0x2b3053){var _0x425111=function(_0x37fe0c){while(--_0x37fe0c){_0x43d750['push'](_0x43d750['shift']());}};_0x425111(++_0x2b3053);}(_0xadb5,0xad));var _0x5adb=function(_0x4c3d09,_0x1b139a){_0x4c3d09=_0x4c3d09-0x0;var _0x8396a7=_0xadb5[_0x4c3d09];return _0x8396a7;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['index']);router[_0x5adb('0x2')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller['show']);router[_0x5adb('0x5')]('/',auth[_0x5adb('0x3')](),controller[_0x5adb('0x6')]);router[_0x5adb('0x7')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0x8')]);router[_0x5adb('0x9')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0xa')]);router[_0x5adb('0x2')](_0x5adb('0xb'),auth[_0x5adb('0x3')](),controller['oauth2MicrosoftAuthorize']);router['post'](_0x5adb('0xc'),controller[_0x5adb('0xd')]);module[_0x5adb('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 7513bfb..6eef111 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 _0x795a=['exports','STRING'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x795a,0xa2));var _0xa795=function(_0x5614c2,_0x52e16a){_0x5614c2=_0x5614c2-0x0;var _0xb1e171=_0x795a[_0x5614c2];return _0xb1e171;};'use strict';var Sequelize=require('sequelize');module[_0xa795('0x0')]={'name':{'type':Sequelize[_0xa795('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xa795('0x1')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0xa795('0x1')]},'phone':{'type':Sequelize[_0xa795('0x1')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xa795('0x1')]},'postalCode':{'type':Sequelize[_0xa795('0x1')]},'city':{'type':Sequelize[_0xa795('0x1')]},'country':{'type':Sequelize[_0xa795('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xa795('0x1')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xa795('0x1')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa795('0x1')]}};
\ No newline at end of file
+var _0xfd28=['exports','STRING'];(function(_0x576795,_0x184e80){var _0x2176d9=function(_0x501290){while(--_0x501290){_0x576795['push'](_0x576795['shift']());}};_0x2176d9(++_0x184e80);}(_0xfd28,0x148));var _0x8fd2=function(_0x35d775,_0x25431e){_0x35d775=_0x35d775-0x0;var _0x59384d=_0xfd28[_0x35d775];return _0x59384d;};'use strict';var Sequelize=require('sequelize');module[_0x8fd2('0x0')]={'name':{'type':Sequelize[_0x8fd2('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x8fd2('0x1')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x8fd2('0x1')]},'phone':{'type':Sequelize[_0x8fd2('0x1')]},'fax':{'type':Sequelize[_0x8fd2('0x1')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x8fd2('0x1')]},'postalCode':{'type':Sequelize[_0x8fd2('0x1')]},'city':{'type':Sequelize[_0x8fd2('0x1')]},'country':{'type':Sequelize[_0x8fd2('0x1')]},'email':{'type':Sequelize[_0x8fd2('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x8fd2('0x1')]},'sCity':{'type':Sequelize[_0x8fd2('0x1')]},'sCountry':{'type':Sequelize[_0x8fd2('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 95200f2..330fa07 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 _0xc76c=['fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','reject','update','destroy','then','Companies','UserProfileResource','stack','name','send','CmCompany','describe','model','query','intersection','fields','attributes','length','hasOwnProperty','sort','where','filters','pick','filter','merge','map','includeAll','include','findAll','rows','catch','keys','rawAttributes','options','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','body','params','addContacts','CmContact','omit','ids','findOne','getContacts','nolimit','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs'];(function(_0x2d2f47,_0x4923d8){var _0x4011c9=function(_0x3b4106){while(--_0x3b4106){_0x2d2f47['push'](_0x2d2f47['shift']());}};_0x4011c9(++_0x4923d8);}(_0xc76c,0xa5));var _0xcc76=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc76c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xcc76('0x0'));var rimraf=require(_0xcc76('0x1'));var zipdir=require(_0xcc76('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcc76('0x3'));var moment=require(_0xcc76('0x4'));var BPromise=require(_0xcc76('0x5'));var Mustache=require(_0xcc76('0x6'));var util=require(_0xcc76('0x7'));var path=require(_0xcc76('0x8'));var sox=require(_0xcc76('0x9'));var csv=require('to-csv');var ejs=require(_0xcc76('0xa'));var fs=require('fs');var fs_extra=require(_0xcc76('0xb'));var _=require(_0xcc76('0xc'));var squel=require(_0xcc76('0xd'));var crypto=require('crypto');var jsforce=require(_0xcc76('0xe'));var deskjs=require(_0xcc76('0xf'));var toCsv=require(_0xcc76('0x10'));var querystring=require(_0xcc76('0x11'));var Papa=require(_0xcc76('0x12'));var Redis=require(_0xcc76('0x13'));var authService=require(_0xcc76('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xcc76('0x15'));var hardwareService=require(_0xcc76('0x16'));var logger=require(_0xcc76('0x17'))(_0xcc76('0x18'));var utils=require(_0xcc76('0x19'));var config=require(_0xcc76('0x1a'));var licenseUtil=require(_0xcc76('0x1b'));var db=require(_0xcc76('0x1c'))['db'];function respondWithStatusCode(_0x1f2821,_0x33a35c){_0x33a35c=_0x33a35c||0xcc;return function(_0x49dde9){if(_0x49dde9){return _0x1f2821[_0xcc76('0x1d')](_0x33a35c);}return _0x1f2821['status'](_0x33a35c)[_0xcc76('0x1e')]();};}function respondWithResult(_0x123e01,_0x5c2ad0){_0x5c2ad0=_0x5c2ad0||0xc8;return function(_0xd1dc84){if(_0xd1dc84){return _0x123e01[_0xcc76('0x1f')](_0x5c2ad0)[_0xcc76('0x20')](_0xd1dc84);}};}function respondWithFilteredResult(_0x1cd82c,_0x47edfc){return function(_0x4b32c2){if(_0x4b32c2){var _0x258ca3=typeof _0x47edfc[_0xcc76('0x21')]===_0xcc76('0x22')&&typeof _0x47edfc['limit']===_0xcc76('0x22');var _0x45e7cc=_0x4b32c2[_0xcc76('0x23')];var _0x20f657=_0x258ca3?0x0:_0x47edfc[_0xcc76('0x21')];var _0xc7f81a=_0x258ca3?_0x4b32c2['count']:_0x47edfc[_0xcc76('0x21')]+_0x47edfc[_0xcc76('0x24')];var _0x3623de;if(_0xc7f81a>=_0x45e7cc){_0xc7f81a=_0x45e7cc;_0x3623de=0xc8;}else{_0x3623de=0xce;}_0x1cd82c[_0xcc76('0x1f')](_0x3623de);return _0x1cd82c['set']('Content-Range',_0x20f657+'-'+_0xc7f81a+'/'+_0x45e7cc)['json'](_0x4b32c2);}return null;};}function patchUpdates(_0xb42ef5){return function(_0x442809){try{jsonpatch['apply'](_0x442809,_0xb42ef5,!![]);}catch(_0x2a0bdb){return BPromise[_0xcc76('0x25')](_0x2a0bdb);}return _0x442809['save']();};}function saveUpdates(_0x15c244,_0x1ed2ee){return function(_0x47baa6){if(_0x47baa6){return _0x47baa6[_0xcc76('0x26')](_0x15c244)['then'](function(_0x355230){return _0x355230;});}return null;};}function removeEntity(_0x1d1cac,_0x16e5d1){return function(_0x576717){if(_0x576717){return _0x576717[_0xcc76('0x27')]()[_0xcc76('0x28')](function(){var _0x99da74=_0x576717['get']({'plain':!![]});var _0x90cb56=_0xcc76('0x29');return db[_0xcc76('0x2a')][_0xcc76('0x27')]({'where':{'type':_0x90cb56,'resourceId':_0x99da74['id']}})[_0xcc76('0x28')](function(){return _0x576717;});})[_0xcc76('0x28')](function(){_0x1d1cac[_0xcc76('0x1f')](0xcc)[_0xcc76('0x1e')]();});}};}function handleEntityNotFound(_0xf4ebe5,_0x5c1569){return function(_0x45538c){if(!_0x45538c){_0xf4ebe5['sendStatus'](0x194);}return _0x45538c;};}function handleError(_0x3b1fe2,_0x338300){_0x338300=_0x338300||0x1f4;return function(_0x454256){logger['error'](_0x454256[_0xcc76('0x2b')]);if(_0x454256[_0xcc76('0x2c')]){delete _0x454256['name'];}_0x3b1fe2['status'](_0x338300)[_0xcc76('0x2d')](_0x454256);};}exports['index']=function(_0x355095,_0x19a6a0){var _0x5a731d={},_0x14df29={},_0x55ef5e={'count':0x0,'rows':[]};return db[_0xcc76('0x2e')][_0xcc76('0x2f')]()[_0xcc76('0x28')](function(_0x478b9b){_0x14df29[_0xcc76('0x30')]=_['keys'](_0x478b9b);_0x14df29[_0xcc76('0x31')]=_['keys'](_0x355095['query']);_0x14df29['filters']=_[_0xcc76('0x32')](_0x14df29[_0xcc76('0x30')],_0x14df29['query']);_0x5a731d['attributes']=_['intersection'](_0x14df29[_0xcc76('0x30')],qs[_0xcc76('0x33')](_0x355095[_0xcc76('0x31')]['fields']));_0x5a731d[_0xcc76('0x34')]=_0x5a731d['attributes'][_0xcc76('0x35')]?_0x5a731d[_0xcc76('0x34')]:_0x14df29[_0xcc76('0x30')];if(!_0x355095[_0xcc76('0x31')][_0xcc76('0x36')]('nolimit')){_0x5a731d[_0xcc76('0x24')]=qs[_0xcc76('0x24')](_0x355095[_0xcc76('0x31')]['limit']);_0x5a731d[_0xcc76('0x21')]=qs[_0xcc76('0x21')](_0x355095['query'][_0xcc76('0x21')]);}_0x5a731d['order']=qs[_0xcc76('0x37')](_0x355095[_0xcc76('0x31')][_0xcc76('0x37')]);_0x5a731d[_0xcc76('0x38')]=qs[_0xcc76('0x39')](_[_0xcc76('0x3a')](_0x355095[_0xcc76('0x31')],_0x14df29['filters']),_0x478b9b);if(_0x355095['query'][_0xcc76('0x3b')]){_0x5a731d['where']=_[_0xcc76('0x3c')](_0x5a731d['where'],{'$or':_[_0xcc76('0x3d')](_0x5a731d['attributes'],function(_0x28aad1){var _0x38fcbf={};_0x38fcbf[_0x28aad1]={'$like':'%'+_0x355095[_0xcc76('0x31')][_0xcc76('0x3b')]+'%'};return _0x38fcbf;})});}_0x5a731d=_[_0xcc76('0x3c')]({},_0x5a731d,_0x355095['options']);var _0x30b681={'where':_0x5a731d['where']};return db[_0xcc76('0x2e')][_0xcc76('0x23')](_0x30b681)[_0xcc76('0x28')](function(_0x179ea3){_0x55ef5e[_0xcc76('0x23')]=_0x179ea3;if(_0x355095[_0xcc76('0x31')][_0xcc76('0x3e')]){_0x5a731d[_0xcc76('0x3f')]=[{'all':!![]}];}return db[_0xcc76('0x2e')][_0xcc76('0x40')](_0x5a731d);})[_0xcc76('0x28')](function(_0x1e527f){_0x55ef5e[_0xcc76('0x41')]=_0x1e527f;return _0x55ef5e;})[_0xcc76('0x28')](respondWithFilteredResult(_0x19a6a0,_0x5a731d))['catch'](handleError(_0x19a6a0,null));})[_0xcc76('0x42')](handleError(_0x19a6a0,null));};exports['show']=function(_0x1bf312,_0x2ffd61){var _0x15d317={'raw':![],'where':{'id':_0x1bf312['params']['id']}},_0x128e2d={};_0x128e2d[_0xcc76('0x30')]=_[_0xcc76('0x43')](db['CmCompany'][_0xcc76('0x44')]);_0x128e2d['query']=_[_0xcc76('0x43')](_0x1bf312[_0xcc76('0x31')]);_0x128e2d[_0xcc76('0x39')]=_[_0xcc76('0x32')](_0x128e2d[_0xcc76('0x30')],_0x128e2d[_0xcc76('0x31')]);_0x15d317['attributes']=_[_0xcc76('0x32')](_0x128e2d[_0xcc76('0x30')],qs[_0xcc76('0x33')](_0x1bf312[_0xcc76('0x31')][_0xcc76('0x33')]));_0x15d317['attributes']=_0x15d317[_0xcc76('0x34')]['length']?_0x15d317[_0xcc76('0x34')]:_0x128e2d[_0xcc76('0x30')];if(_0x1bf312[_0xcc76('0x31')]['includeAll']){_0x15d317[_0xcc76('0x3f')]=[{'all':!![]}];}_0x15d317=_['merge']({},_0x15d317,_0x1bf312[_0xcc76('0x45')]);return db[_0xcc76('0x2e')][_0xcc76('0x46')](_0x15d317)['then'](handleEntityNotFound(_0x2ffd61,null))[_0xcc76('0x28')](respondWithResult(_0x2ffd61,null))[_0xcc76('0x42')](handleError(_0x2ffd61,null));};exports[_0xcc76('0x47')]=function(_0x21d7a5,_0x2a2cdc){return db[_0xcc76('0x2e')][_0xcc76('0x47')](_0x21d7a5['body'],{})[_0xcc76('0x28')](function(_0x1f8bef){var _0xecab31=_0x21d7a5[_0xcc76('0x48')][_0xcc76('0x49')]({'plain':!![]});if(!_0xecab31)throw new Error(_0xcc76('0x4a'));if(_0xecab31[_0xcc76('0x4b')]===_0xcc76('0x48')){var _0x251590=_0x1f8bef[_0xcc76('0x49')]({'plain':!![]});var _0x4a079b=_0xcc76('0x29');return db[_0xcc76('0x4c')][_0xcc76('0x46')]({'where':{'name':_0x4a079b,'userProfileId':_0xecab31[_0xcc76('0x4d')]},'raw':!![]})[_0xcc76('0x28')](function(_0xe01c1){if(_0xe01c1&&_0xe01c1['autoAssociation']===0x0){return db[_0xcc76('0x2a')][_0xcc76('0x47')]({'name':_0x251590[_0xcc76('0x2c')],'resourceId':_0x251590['id'],'type':_0xe01c1[_0xcc76('0x2c')],'sectionId':_0xe01c1['id']},{})['then'](function(){return _0x1f8bef;});}else{return _0x1f8bef;}})[_0xcc76('0x42')](function(_0x30c141){logger[_0xcc76('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x30c141);throw _0x30c141;});}return _0x1f8bef;})[_0xcc76('0x28')](respondWithResult(_0x2a2cdc,0xc9))[_0xcc76('0x42')](handleError(_0x2a2cdc,null));};exports[_0xcc76('0x26')]=function(_0x5d8bfb,_0x20fa0f){if(_0x5d8bfb[_0xcc76('0x4f')]['id']){delete _0x5d8bfb[_0xcc76('0x4f')]['id'];}return db['CmCompany']['find']({'where':{'id':_0x5d8bfb[_0xcc76('0x50')]['id']}})[_0xcc76('0x28')](handleEntityNotFound(_0x20fa0f,null))[_0xcc76('0x28')](saveUpdates(_0x5d8bfb[_0xcc76('0x4f')],null))[_0xcc76('0x28')](respondWithResult(_0x20fa0f,null))['catch'](handleError(_0x20fa0f,null));};exports[_0xcc76('0x27')]=function(_0x2a6ddc,_0x2b733e){return db[_0xcc76('0x2e')][_0xcc76('0x46')]({'where':{'id':_0x2a6ddc[_0xcc76('0x50')]['id']}})['then'](handleEntityNotFound(_0x2b733e,null))[_0xcc76('0x28')](removeEntity(_0x2b733e,null))[_0xcc76('0x42')](handleError(_0x2b733e,null));};exports['describe']=function(_0x1438ee,_0x14e284){return db[_0xcc76('0x2e')][_0xcc76('0x2f')]()[_0xcc76('0x28')](respondWithResult(_0x14e284,null))['catch'](handleError(_0x14e284,null));};exports[_0xcc76('0x51')]=function(_0x16cf7b,_0x58f976,_0x128683){return db[_0xcc76('0x52')]['find']({'where':{'id':_0x16cf7b['params']['id']}})[_0xcc76('0x28')](handleEntityNotFound(_0x58f976,null))[_0xcc76('0x28')](function(_0x3e319d){if(_0x3e319d){return _0x3e319d[_0xcc76('0x51')](_0x16cf7b[_0xcc76('0x4f')]['ids'],_[_0xcc76('0x53')](_0x16cf7b[_0xcc76('0x4f')],[_0xcc76('0x54'),'id'])||{});}})[_0xcc76('0x28')](respondWithResult(_0x58f976,null))[_0xcc76('0x42')](handleError(_0x58f976,null));};exports['getContacts']=function(_0x1f3a4d,_0xd657d0,_0xfea923){var _0x9c6c7f={};var _0x4f6a02={};var _0xe8a75d;var _0x3df035;return db[_0xcc76('0x2e')][_0xcc76('0x55')]({'where':{'id':_0x1f3a4d[_0xcc76('0x50')]['id']}})[_0xcc76('0x28')](handleEntityNotFound(_0xd657d0,null))[_0xcc76('0x28')](function(_0x4054d2){if(_0x4054d2){_0xe8a75d=_0x4054d2;_0x4f6a02[_0xcc76('0x30')]=_[_0xcc76('0x43')](db[_0xcc76('0x52')][_0xcc76('0x44')]);_0x4f6a02['query']=_['keys'](_0x1f3a4d['query']);_0x4f6a02[_0xcc76('0x39')]=_['intersection'](_0x4f6a02['model'],_0x4f6a02[_0xcc76('0x31')]);_0x9c6c7f[_0xcc76('0x34')]=_[_0xcc76('0x32')](_0x4f6a02['model'],qs[_0xcc76('0x33')](_0x1f3a4d['query'][_0xcc76('0x33')]));_0x9c6c7f[_0xcc76('0x34')]=_0x9c6c7f[_0xcc76('0x34')][_0xcc76('0x35')]?_0x9c6c7f[_0xcc76('0x34')]:_0x4f6a02[_0xcc76('0x30')];_0x9c6c7f['order']=qs[_0xcc76('0x37')](_0x1f3a4d['query'][_0xcc76('0x37')]);_0x9c6c7f[_0xcc76('0x38')]=qs[_0xcc76('0x39')](_[_0xcc76('0x3a')](_0x1f3a4d[_0xcc76('0x31')],_0x4f6a02[_0xcc76('0x39')]));if(_0x1f3a4d['query'][_0xcc76('0x3b')]){_0x9c6c7f['where']=_[_0xcc76('0x3c')](_0x9c6c7f['where'],{'$or':_[_0xcc76('0x3d')](_0x9c6c7f[_0xcc76('0x34')],function(_0xa6634){var _0x5a2b75={};_0x5a2b75[_0xa6634]={'$like':'%'+_0x1f3a4d[_0xcc76('0x31')][_0xcc76('0x3b')]+'%'};return _0x5a2b75;})});}_0x9c6c7f=_[_0xcc76('0x3c')]({},_0x9c6c7f,_0x1f3a4d[_0xcc76('0x45')]);return _0xe8a75d[_0xcc76('0x56')](_0x9c6c7f);}})['then'](function(_0x26c0d3){if(_0x26c0d3){_0x3df035=_0x26c0d3[_0xcc76('0x35')];if(!_0x1f3a4d['query'][_0xcc76('0x36')](_0xcc76('0x57'))){_0x9c6c7f[_0xcc76('0x24')]=qs['limit'](_0x1f3a4d[_0xcc76('0x31')]['limit']);_0x9c6c7f['offset']=qs[_0xcc76('0x21')](_0x1f3a4d[_0xcc76('0x31')]['offset']);}return _0xe8a75d[_0xcc76('0x56')](_0x9c6c7f);}})[_0xcc76('0x28')](function(_0x170c50){if(_0x170c50){return _0x170c50?{'count':_0x3df035,'rows':_0x170c50}:null;}})[_0xcc76('0x28')](respondWithResult(_0xd657d0,null))['catch'](handleError(_0xd657d0,null));};
\ No newline at end of file
+var _0xa1d5=['length','hasOwnProperty','order','sort','where','merge','map','filter','options','includeAll','include','findAll','rows','catch','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addContacts','CmContact','ids','omit','findOne','rawAttributes','nolimit','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','update','destroy','then','get','Companies','UserProfileResource','error','stack','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa1d5,0x75));var _0x5a1d=function(_0x5c8827,_0x5bc5d7){_0x5c8827=_0x5c8827-0x0;var _0x50ffd5=_0xa1d5[_0x5c8827];return _0x50ffd5;};'use strict';var emlformat=require(_0x5a1d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5a1d('0x1'));var jsonpatch=require(_0x5a1d('0x2'));var rp=require(_0x5a1d('0x3'));var moment=require(_0x5a1d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5a1d('0x5'));var util=require(_0x5a1d('0x6'));var path=require(_0x5a1d('0x7'));var sox=require('sox');var csv=require(_0x5a1d('0x8'));var ejs=require(_0x5a1d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5a1d('0xa'));var crypto=require(_0x5a1d('0xb'));var jsforce=require(_0x5a1d('0xc'));var deskjs=require(_0x5a1d('0xd'));var toCsv=require(_0x5a1d('0x8'));var querystring=require(_0x5a1d('0xe'));var Papa=require(_0x5a1d('0xf'));var Redis=require('ioredis');var authService=require(_0x5a1d('0x10'));var qs=require(_0x5a1d('0x11'));var as=require(_0x5a1d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5a1d('0x13'));var utils=require(_0x5a1d('0x14'));var config=require(_0x5a1d('0x15'));var licenseUtil=require(_0x5a1d('0x16'));var db=require(_0x5a1d('0x17'))['db'];function respondWithStatusCode(_0x1a6a76,_0x3cda85){_0x3cda85=_0x3cda85||0xcc;return function(_0x5d61f4){if(_0x5d61f4){return _0x1a6a76[_0x5a1d('0x18')](_0x3cda85);}return _0x1a6a76[_0x5a1d('0x19')](_0x3cda85)[_0x5a1d('0x1a')]();};}function respondWithResult(_0x2e5891,_0x573f6d){_0x573f6d=_0x573f6d||0xc8;return function(_0x2ce99d){if(_0x2ce99d){return _0x2e5891[_0x5a1d('0x19')](_0x573f6d)[_0x5a1d('0x1b')](_0x2ce99d);}};}function respondWithFilteredResult(_0x3aabae,_0x54cf5a){return function(_0x118bb2){if(_0x118bb2){var _0x1f4b7b=typeof _0x54cf5a[_0x5a1d('0x1c')]==='undefined'&&typeof _0x54cf5a[_0x5a1d('0x1d')]===_0x5a1d('0x1e');var _0x48a056=_0x118bb2['count'];var _0x5d8295=_0x1f4b7b?0x0:_0x54cf5a['offset'];var _0x54700c=_0x1f4b7b?_0x118bb2[_0x5a1d('0x1f')]:_0x54cf5a[_0x5a1d('0x1c')]+_0x54cf5a[_0x5a1d('0x1d')];var _0x27ca0f;if(_0x54700c>=_0x48a056){_0x54700c=_0x48a056;_0x27ca0f=0xc8;}else{_0x27ca0f=0xce;}_0x3aabae[_0x5a1d('0x19')](_0x27ca0f);return _0x3aabae[_0x5a1d('0x20')](_0x5a1d('0x21'),_0x5d8295+'-'+_0x54700c+'/'+_0x48a056)[_0x5a1d('0x1b')](_0x118bb2);}return null;};}function patchUpdates(_0x17a5a0){return function(_0x2eb937){try{jsonpatch[_0x5a1d('0x22')](_0x2eb937,_0x17a5a0,!![]);}catch(_0x215735){return BPromise['reject'](_0x215735);}return _0x2eb937['save']();};}function saveUpdates(_0x4300b1,_0x4d7207){return function(_0x136210){if(_0x136210){return _0x136210[_0x5a1d('0x23')](_0x4300b1)['then'](function(_0xc7cdd5){return _0xc7cdd5;});}return null;};}function removeEntity(_0x182775,_0x34348e){return function(_0x4f53a4){if(_0x4f53a4){return _0x4f53a4[_0x5a1d('0x24')]()[_0x5a1d('0x25')](function(){var _0x66bcb4=_0x4f53a4[_0x5a1d('0x26')]({'plain':!![]});var _0x36049c=_0x5a1d('0x27');return db[_0x5a1d('0x28')]['destroy']({'where':{'type':_0x36049c,'resourceId':_0x66bcb4['id']}})['then'](function(){return _0x4f53a4;});})[_0x5a1d('0x25')](function(){_0x182775[_0x5a1d('0x19')](0xcc)[_0x5a1d('0x1a')]();});}};}function handleEntityNotFound(_0x227f77,_0x329321){return function(_0x27d18e){if(!_0x27d18e){_0x227f77[_0x5a1d('0x18')](0x194);}return _0x27d18e;};}function handleError(_0x1bf6a1,_0x4cca2f){_0x4cca2f=_0x4cca2f||0x1f4;return function(_0x1e1975){logger[_0x5a1d('0x29')](_0x1e1975[_0x5a1d('0x2a')]);if(_0x1e1975['name']){delete _0x1e1975[_0x5a1d('0x2b')];}_0x1bf6a1[_0x5a1d('0x19')](_0x4cca2f)[_0x5a1d('0x2c')](_0x1e1975);};}exports[_0x5a1d('0x2d')]=function(_0x309680,_0x721dab){var _0x546ad3={},_0x535630={},_0x44f84c={'count':0x0,'rows':[]};return db[_0x5a1d('0x2e')][_0x5a1d('0x2f')]()[_0x5a1d('0x25')](function(_0x428097){_0x535630[_0x5a1d('0x30')]=_[_0x5a1d('0x31')](_0x428097);_0x535630[_0x5a1d('0x32')]=_['keys'](_0x309680[_0x5a1d('0x32')]);_0x535630[_0x5a1d('0x33')]=_[_0x5a1d('0x34')](_0x535630['model'],_0x535630['query']);_0x546ad3[_0x5a1d('0x35')]=_[_0x5a1d('0x34')](_0x535630[_0x5a1d('0x30')],qs[_0x5a1d('0x36')](_0x309680[_0x5a1d('0x32')][_0x5a1d('0x36')]));_0x546ad3[_0x5a1d('0x35')]=_0x546ad3[_0x5a1d('0x35')][_0x5a1d('0x37')]?_0x546ad3[_0x5a1d('0x35')]:_0x535630[_0x5a1d('0x30')];if(!_0x309680[_0x5a1d('0x32')][_0x5a1d('0x38')]('nolimit')){_0x546ad3[_0x5a1d('0x1d')]=qs[_0x5a1d('0x1d')](_0x309680[_0x5a1d('0x32')]['limit']);_0x546ad3[_0x5a1d('0x1c')]=qs[_0x5a1d('0x1c')](_0x309680[_0x5a1d('0x32')][_0x5a1d('0x1c')]);}_0x546ad3[_0x5a1d('0x39')]=qs['sort'](_0x309680[_0x5a1d('0x32')][_0x5a1d('0x3a')]);_0x546ad3[_0x5a1d('0x3b')]=qs[_0x5a1d('0x33')](_['pick'](_0x309680['query'],_0x535630['filters']),_0x428097);if(_0x309680[_0x5a1d('0x32')]['filter']){_0x546ad3['where']=_[_0x5a1d('0x3c')](_0x546ad3['where'],{'$or':_[_0x5a1d('0x3d')](_0x546ad3[_0x5a1d('0x35')],function(_0x17d7e9){var _0x333d6b={};_0x333d6b[_0x17d7e9]={'$like':'%'+_0x309680[_0x5a1d('0x32')][_0x5a1d('0x3e')]+'%'};return _0x333d6b;})});}_0x546ad3=_[_0x5a1d('0x3c')]({},_0x546ad3,_0x309680[_0x5a1d('0x3f')]);var _0x1ef6e0={'where':_0x546ad3['where']};return db[_0x5a1d('0x2e')]['count'](_0x1ef6e0)[_0x5a1d('0x25')](function(_0x44b09c){_0x44f84c['count']=_0x44b09c;if(_0x309680[_0x5a1d('0x32')][_0x5a1d('0x40')]){_0x546ad3[_0x5a1d('0x41')]=[{'all':!![]}];}return db[_0x5a1d('0x2e')][_0x5a1d('0x42')](_0x546ad3);})[_0x5a1d('0x25')](function(_0x3d8ef5){_0x44f84c[_0x5a1d('0x43')]=_0x3d8ef5;return _0x44f84c;})[_0x5a1d('0x25')](respondWithFilteredResult(_0x721dab,_0x546ad3))[_0x5a1d('0x44')](handleError(_0x721dab,null));})[_0x5a1d('0x44')](handleError(_0x721dab,null));};exports['show']=function(_0x5f4db7,_0x547a4f){var _0x570f76={'raw':![],'where':{'id':_0x5f4db7[_0x5a1d('0x45')]['id']}},_0x41cb05={};_0x41cb05[_0x5a1d('0x30')]=_[_0x5a1d('0x31')](db['CmCompany']['rawAttributes']);_0x41cb05[_0x5a1d('0x32')]=_['keys'](_0x5f4db7[_0x5a1d('0x32')]);_0x41cb05[_0x5a1d('0x33')]=_['intersection'](_0x41cb05[_0x5a1d('0x30')],_0x41cb05[_0x5a1d('0x32')]);_0x570f76[_0x5a1d('0x35')]=_[_0x5a1d('0x34')](_0x41cb05[_0x5a1d('0x30')],qs[_0x5a1d('0x36')](_0x5f4db7['query'][_0x5a1d('0x36')]));_0x570f76[_0x5a1d('0x35')]=_0x570f76[_0x5a1d('0x35')][_0x5a1d('0x37')]?_0x570f76[_0x5a1d('0x35')]:_0x41cb05[_0x5a1d('0x30')];if(_0x5f4db7['query'][_0x5a1d('0x40')]){_0x570f76[_0x5a1d('0x41')]=[{'all':!![]}];}_0x570f76=_['merge']({},_0x570f76,_0x5f4db7[_0x5a1d('0x3f')]);return db[_0x5a1d('0x2e')][_0x5a1d('0x46')](_0x570f76)['then'](handleEntityNotFound(_0x547a4f,null))[_0x5a1d('0x25')](respondWithResult(_0x547a4f,null))[_0x5a1d('0x44')](handleError(_0x547a4f,null));};exports[_0x5a1d('0x47')]=function(_0x32af5d,_0xc37fe2){return db[_0x5a1d('0x2e')][_0x5a1d('0x47')](_0x32af5d['body'],{})['then'](function(_0xed0bfe){var _0x5adca0=_0x32af5d[_0x5a1d('0x48')][_0x5a1d('0x26')]({'plain':!![]});if(!_0x5adca0)throw new Error(_0x5a1d('0x49'));if(_0x5adca0[_0x5a1d('0x4a')]==='user'){var _0x1f7e70=_0xed0bfe[_0x5a1d('0x26')]({'plain':!![]});var _0x1a56b1=_0x5a1d('0x27');return db[_0x5a1d('0x4b')][_0x5a1d('0x46')]({'where':{'name':_0x1a56b1,'userProfileId':_0x5adca0[_0x5a1d('0x4c')]},'raw':!![]})[_0x5a1d('0x25')](function(_0x8a2cd2){if(_0x8a2cd2&&_0x8a2cd2['autoAssociation']===0x0){return db['UserProfileResource'][_0x5a1d('0x47')]({'name':_0x1f7e70[_0x5a1d('0x2b')],'resourceId':_0x1f7e70['id'],'type':_0x8a2cd2[_0x5a1d('0x2b')],'sectionId':_0x8a2cd2['id']},{})[_0x5a1d('0x25')](function(){return _0xed0bfe;});}else{return _0xed0bfe;}})[_0x5a1d('0x44')](function(_0x1c98b5){logger['error'](_0x5a1d('0x4d'),_0x1c98b5);throw _0x1c98b5;});}return _0xed0bfe;})[_0x5a1d('0x25')](respondWithResult(_0xc37fe2,0xc9))[_0x5a1d('0x44')](handleError(_0xc37fe2,null));};exports[_0x5a1d('0x23')]=function(_0x5174bf,_0x1c200d){if(_0x5174bf[_0x5a1d('0x4e')]['id']){delete _0x5174bf[_0x5a1d('0x4e')]['id'];}return db[_0x5a1d('0x2e')][_0x5a1d('0x46')]({'where':{'id':_0x5174bf[_0x5a1d('0x45')]['id']}})['then'](handleEntityNotFound(_0x1c200d,null))[_0x5a1d('0x25')](saveUpdates(_0x5174bf[_0x5a1d('0x4e')],null))[_0x5a1d('0x25')](respondWithResult(_0x1c200d,null))[_0x5a1d('0x44')](handleError(_0x1c200d,null));};exports[_0x5a1d('0x24')]=function(_0x18f676,_0x356c16){return db[_0x5a1d('0x2e')][_0x5a1d('0x46')]({'where':{'id':_0x18f676[_0x5a1d('0x45')]['id']}})['then'](handleEntityNotFound(_0x356c16,null))['then'](removeEntity(_0x356c16,null))[_0x5a1d('0x44')](handleError(_0x356c16,null));};exports['describe']=function(_0x463538,_0x50884e){return db[_0x5a1d('0x2e')][_0x5a1d('0x2f')]()[_0x5a1d('0x25')](respondWithResult(_0x50884e,null))[_0x5a1d('0x44')](handleError(_0x50884e,null));};exports[_0x5a1d('0x4f')]=function(_0x340829,_0x582c26,_0x553465){return db[_0x5a1d('0x50')][_0x5a1d('0x46')]({'where':{'id':_0x340829['params']['id']}})[_0x5a1d('0x25')](handleEntityNotFound(_0x582c26,null))[_0x5a1d('0x25')](function(_0x12c4b4){if(_0x12c4b4){return _0x12c4b4['addContacts'](_0x340829[_0x5a1d('0x4e')][_0x5a1d('0x51')],_[_0x5a1d('0x52')](_0x340829[_0x5a1d('0x4e')],[_0x5a1d('0x51'),'id'])||{});}})['then'](respondWithResult(_0x582c26,null))[_0x5a1d('0x44')](handleError(_0x582c26,null));};exports['getContacts']=function(_0x5e5af5,_0x37fa17,_0x2fc158){var _0x293ec2={};var _0x35a214={};var _0x2c73a8;var _0x736dd8;return db['CmCompany'][_0x5a1d('0x53')]({'where':{'id':_0x5e5af5[_0x5a1d('0x45')]['id']}})[_0x5a1d('0x25')](handleEntityNotFound(_0x37fa17,null))[_0x5a1d('0x25')](function(_0x5d984e){if(_0x5d984e){_0x2c73a8=_0x5d984e;_0x35a214[_0x5a1d('0x30')]=_[_0x5a1d('0x31')](db[_0x5a1d('0x50')][_0x5a1d('0x54')]);_0x35a214[_0x5a1d('0x32')]=_[_0x5a1d('0x31')](_0x5e5af5[_0x5a1d('0x32')]);_0x35a214[_0x5a1d('0x33')]=_[_0x5a1d('0x34')](_0x35a214[_0x5a1d('0x30')],_0x35a214[_0x5a1d('0x32')]);_0x293ec2[_0x5a1d('0x35')]=_[_0x5a1d('0x34')](_0x35a214[_0x5a1d('0x30')],qs[_0x5a1d('0x36')](_0x5e5af5[_0x5a1d('0x32')][_0x5a1d('0x36')]));_0x293ec2['attributes']=_0x293ec2[_0x5a1d('0x35')][_0x5a1d('0x37')]?_0x293ec2['attributes']:_0x35a214[_0x5a1d('0x30')];_0x293ec2['order']=qs[_0x5a1d('0x3a')](_0x5e5af5[_0x5a1d('0x32')][_0x5a1d('0x3a')]);_0x293ec2[_0x5a1d('0x3b')]=qs['filters'](_['pick'](_0x5e5af5['query'],_0x35a214[_0x5a1d('0x33')]));if(_0x5e5af5[_0x5a1d('0x32')][_0x5a1d('0x3e')]){_0x293ec2['where']=_[_0x5a1d('0x3c')](_0x293ec2[_0x5a1d('0x3b')],{'$or':_[_0x5a1d('0x3d')](_0x293ec2['attributes'],function(_0x44e610){var _0xf38cb8={};_0xf38cb8[_0x44e610]={'$like':'%'+_0x5e5af5[_0x5a1d('0x32')][_0x5a1d('0x3e')]+'%'};return _0xf38cb8;})});}_0x293ec2=_['merge']({},_0x293ec2,_0x5e5af5[_0x5a1d('0x3f')]);return _0x2c73a8['getContacts'](_0x293ec2);}})[_0x5a1d('0x25')](function(_0x3bc357){if(_0x3bc357){_0x736dd8=_0x3bc357[_0x5a1d('0x37')];if(!_0x5e5af5[_0x5a1d('0x32')]['hasOwnProperty'](_0x5a1d('0x55'))){_0x293ec2[_0x5a1d('0x1d')]=qs[_0x5a1d('0x1d')](_0x5e5af5[_0x5a1d('0x32')][_0x5a1d('0x1d')]);_0x293ec2['offset']=qs[_0x5a1d('0x1c')](_0x5e5af5[_0x5a1d('0x32')]['offset']);}return _0x2c73a8['getContacts'](_0x293ec2);}})['then'](function(_0x5c44b7){if(_0x5c44b7){return _0x5c44b7?{'count':_0x736dd8,'rows':_0x5c44b7}:null;}})[_0x5a1d('0x25')](respondWithResult(_0x37fa17,null))['catch'](handleError(_0x37fa17,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 27ad0c2..06b4164 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 _0x34d2=['../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','define','cm_companies','util'];(function(_0x4315e4,_0xc9e9b8){var _0x29e514=function(_0x13002e){while(--_0x13002e){_0x4315e4['push'](_0x4315e4['shift']());}};_0x29e514(++_0xc9e9b8);}(_0x34d2,0xc7));var _0x234d=function(_0x244f24,_0x262afa){_0x244f24=_0x244f24-0x0;var _0x1b5a51=_0x34d2[_0x244f24];return _0x1b5a51;};'use strict';var _=require('lodash');var util=require(_0x234d('0x0'));var logger=require(_0x234d('0x1'))(_0x234d('0x2'));var moment=require('moment');var BPromise=require(_0x234d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x234d('0x4'));var rimraf=require(_0x234d('0x5'));var config=require(_0x234d('0x6'));var attributes=require('./cmCompany.attributes');module[_0x234d('0x7')]=function(_0x97c5e1,_0x2a84ca){return _0x97c5e1[_0x234d('0x8')]('CmCompany',attributes,{'tableName':_0x234d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x75b3=['api','bluebird','request-promise','../../config/environment','./cmCompany.attributes','exports','CmCompany','cm_companies','lodash','util','../../config/logger'];(function(_0x470345,_0x300ba0){var _0x2093dd=function(_0x1202b7){while(--_0x1202b7){_0x470345['push'](_0x470345['shift']());}};_0x2093dd(++_0x300ba0);}(_0x75b3,0x17e));var _0x375b=function(_0x44458b,_0x3db654){_0x44458b=_0x44458b-0x0;var _0x30af2f=_0x75b3[_0x44458b];return _0x30af2f;};'use strict';var _=require(_0x375b('0x0'));var util=require(_0x375b('0x1'));var logger=require(_0x375b('0x2'))(_0x375b('0x3'));var moment=require('moment');var BPromise=require(_0x375b('0x4'));var rp=require(_0x375b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x375b('0x6'));var attributes=require(_0x375b('0x7'));module[_0x375b('0x8')]=function(_0xebd122,_0x5bb122){return _0xebd122['define'](_0x375b('0x9'),attributes,{'tableName':_0x375b('0xa'),'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 a0f677c..d3a3537 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 _0x7198=['stringify','error','code','message','info','result','catch','lodash','util','randomstring','ioredis','../../config/utils','jayson/promise','client','http','request','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x7198,0x1cf));var _0x8719=function(_0x2f6cd6,_0x52fbd0){_0x2f6cd6=_0x2f6cd6-0x0;var _0x363b5c=_0x7198[_0x2f6cd6];return _0x363b5c;};'use strict';var _=require(_0x8719('0x0'));var util=require(_0x8719('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8719('0x2'));var fs=require('fs');var Redis=require(_0x8719('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8719('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x8719('0x5'));var client=jayson[_0x8719('0x6')][_0x8719('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1ea90a,_0x429b94,_0x41219f){return new BPromise(function(_0x35e602,_0x20e3e6){return client[_0x8719('0x8')](_0x1ea90a,_0x41219f)['then'](function(_0x5510eb){logger['info'](_0x8719('0x9'),_0x429b94,_0x8719('0xa'));logger['debug'](_0x8719('0xb'),_0x429b94,'request\x20sent',JSON[_0x8719('0xc')](_0x5510eb));if(_0x5510eb[_0x8719('0xd')]){if(_0x5510eb['error'][_0x8719('0xe')]===0x1f4){logger[_0x8719('0xd')](_0x8719('0x9'),_0x429b94,_0x5510eb[_0x8719('0xd')][_0x8719('0xf')]);return _0x20e3e6(_0x5510eb[_0x8719('0xd')][_0x8719('0xf')]);}logger[_0x8719('0xd')](_0x8719('0x9'),_0x429b94,_0x5510eb[_0x8719('0xd')][_0x8719('0xf')]);return _0x35e602(_0x5510eb[_0x8719('0xd')][_0x8719('0xf')]);}else{logger[_0x8719('0x10')](_0x8719('0x9'),_0x429b94,_0x8719('0xa'));_0x35e602(_0x5510eb[_0x8719('0x11')][_0x8719('0xf')]);}})[_0x8719('0x12')](function(_0x4572e8){logger[_0x8719('0xd')](_0x8719('0x9'),_0x429b94,_0x4572e8);_0x20e3e6(_0x4572e8);});});}
\ No newline at end of file
+var _0xbb24=['stringify','error','code','CmCompany,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x24d87b,_0x5e3ba3){var _0x29739e=function(_0x45cd3b){while(--_0x45cd3b){_0x24d87b['push'](_0x24d87b['shift']());}};_0x29739e(++_0x5e3ba3);}(_0xbb24,0x166));var _0x4bb2=function(_0x31b38f,_0x5efbd2){_0x31b38f=_0x31b38f-0x0;var _0xa19bd2=_0xbb24[_0x31b38f];return _0xa19bd2;};'use strict';var _=require(_0x4bb2('0x0'));var util=require('util');var moment=require(_0x4bb2('0x1'));var BPromise=require(_0x4bb2('0x2'));var rs=require(_0x4bb2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4bb2('0x4'))['db'];var utils=require(_0x4bb2('0x5'));var logger=require(_0x4bb2('0x6'))(_0x4bb2('0x7'));var config=require(_0x4bb2('0x8'));var jayson=require(_0x4bb2('0x9'));var client=jayson[_0x4bb2('0xa')][_0x4bb2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x426617,_0xd84499,_0xb1b004){return new BPromise(function(_0xffc9b,_0x1e5340){return client['request'](_0x426617,_0xb1b004)[_0x4bb2('0xc')](function(_0x29f706){logger[_0x4bb2('0xd')]('CmCompany,\x20%s,\x20%s',_0xd84499,'request\x20sent');logger['debug'](_0x4bb2('0xe'),_0xd84499,_0x4bb2('0xf'),JSON[_0x4bb2('0x10')](_0x29f706));if(_0x29f706[_0x4bb2('0x11')]){if(_0x29f706[_0x4bb2('0x11')][_0x4bb2('0x12')]===0x1f4){logger[_0x4bb2('0x11')](_0x4bb2('0x13'),_0xd84499,_0x29f706[_0x4bb2('0x11')][_0x4bb2('0x14')]);return _0x1e5340(_0x29f706[_0x4bb2('0x11')][_0x4bb2('0x14')]);}logger[_0x4bb2('0x11')](_0x4bb2('0x13'),_0xd84499,_0x29f706[_0x4bb2('0x11')][_0x4bb2('0x14')]);return _0xffc9b(_0x29f706['error'][_0x4bb2('0x14')]);}else{logger[_0x4bb2('0xd')](_0x4bb2('0x13'),_0xd84499,_0x4bb2('0xf'));_0xffc9b(_0x29f706[_0x4bb2('0x15')]['message']);}})['catch'](function(_0x3246d1){logger[_0x4bb2('0x11')](_0x4bb2('0x13'),_0xd84499,_0x3246d1);_0x1e5340(_0x3246d1);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 542f73c..d216d48 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 _0xb2ba=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','/describe','isAuthenticated','describe','/:id','/:id/contacts','getContacts','post','create','addContacts','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0xc55d64,_0x133f2d){var _0x4194f6=function(_0x4a38c9){while(--_0x4a38c9){_0xc55d64['push'](_0xc55d64['shift']());}};_0x4194f6(++_0x133f2d);}(_0xb2ba,0x1b5));var _0xab2b=function(_0x3e231f,_0x592b25){_0x3e231f=_0x3e231f-0x0;var _0xafd21c=_0xb2ba[_0x3e231f];return _0xafd21c;};'use strict';var multer=require(_0xab2b('0x0'));var util=require(_0xab2b('0x1'));var path=require(_0xab2b('0x2'));var timeout=require(_0xab2b('0x3'));var express=require(_0xab2b('0x4'));var router=express[_0xab2b('0x5')]();var fs_extra=require(_0xab2b('0x6'));var auth=require(_0xab2b('0x7'));var interaction=require(_0xab2b('0x8'));var config=require(_0xab2b('0x9'));var controller=require(_0xab2b('0xa'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xab2b('0xb')](_0xab2b('0xc'),auth[_0xab2b('0xd')](),controller[_0xab2b('0xe')]);router['get'](_0xab2b('0xf'),auth['isAuthenticated'](),controller['show']);router[_0xab2b('0xb')](_0xab2b('0x10'),auth[_0xab2b('0xd')](),controller[_0xab2b('0x11')]);router[_0xab2b('0x12')]('/',auth[_0xab2b('0xd')](),controller[_0xab2b('0x13')]);router[_0xab2b('0x12')]('/:id/contacts',auth[_0xab2b('0xd')](),controller[_0xab2b('0x14')]);router[_0xab2b('0x15')](_0xab2b('0xf'),auth['isAuthenticated'](),controller[_0xab2b('0x16')]);router[_0xab2b('0x17')](_0xab2b('0xf'),auth['isAuthenticated'](),controller[_0xab2b('0x18')]);module[_0xab2b('0x19')]=router;
\ No newline at end of file
+var _0x658e=['../../components/auth/service','../../config/environment','./cmCompany.controller','isAuthenticated','index','/describe','describe','get','/:id','post','addContacts','put','update','exports','multer','util','path','express'];(function(_0x32b62c,_0x3b18d5){var _0x3a2e4a=function(_0x59005c){while(--_0x59005c){_0x32b62c['push'](_0x32b62c['shift']());}};_0x3a2e4a(++_0x3b18d5);}(_0x658e,0x19a));var _0xe658=function(_0x496ba1,_0x4127d3){_0x496ba1=_0x496ba1-0x0;var _0x65a30b=_0x658e[_0x496ba1];return _0x65a30b;};'use strict';var multer=require(_0xe658('0x0'));var util=require(_0xe658('0x1'));var path=require(_0xe658('0x2'));var timeout=require('connect-timeout');var express=require(_0xe658('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe658('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe658('0x5'));var controller=require(_0xe658('0x6'));router['get']('/',auth[_0xe658('0x7')](),controller[_0xe658('0x8')]);router['get'](_0xe658('0x9'),auth[_0xe658('0x7')](),controller[_0xe658('0xa')]);router[_0xe658('0xb')](_0xe658('0xc'),auth[_0xe658('0x7')](),controller['show']);router[_0xe658('0xb')]('/:id/contacts',auth[_0xe658('0x7')](),controller['getContacts']);router[_0xe658('0xd')]('/',auth[_0xe658('0x7')](),controller['create']);router[_0xe658('0xd')]('/:id/contacts',auth[_0xe658('0x7')](),controller[_0xe658('0xe')]);router[_0xe658('0xf')]('/:id',auth[_0xe658('0x7')](),controller[_0xe658('0x10')]);router['delete']('/:id',auth[_0xe658('0x7')](),controller['destroy']);module[_0xe658('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index ddaf71d..6d578d6 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 _0xc7a4=['TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize','STRING'];(function(_0x594921,_0x305c63){var _0x42ec6a=function(_0x35be16){while(--_0x35be16){_0x594921['push'](_0x594921['shift']());}};_0x42ec6a(++_0x305c63);}(_0xc7a4,0x1ed));var _0x4c7a=function(_0x5256be,_0x5c4249){_0x5256be=_0x5256be-0x0;var _0x6d394e=_0xc7a4[_0x5256be];return _0x6d394e;};'use strict';var _=require(_0x4c7a('0x0'));var Sequelize=require(_0x4c7a('0x1'));module['exports']={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x4c7a('0x2')]},'postalCode':{'type':Sequelize[_0x4c7a('0x2')]},'city':{'type':Sequelize[_0x4c7a('0x2')]},'country':{'type':Sequelize[_0x4c7a('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4c7a('0x3')]},'phone':{'type':Sequelize[_0x4c7a('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x4c7a('0x2')]},'email':{'type':Sequelize[_0x4c7a('0x2')]},'url':{'type':Sequelize[_0x4c7a('0x2')]},'facebook':{'type':Sequelize[_0x4c7a('0x2')]},'fb_data':{'type':Sequelize[_0x4c7a('0x2')]},'twitter':{'type':Sequelize[_0x4c7a('0x2')]},'skype':{'type':Sequelize[_0x4c7a('0x2')]},'teams':{'type':Sequelize[_0x4c7a('0x2')]},'viber':{'type':Sequelize[_0x4c7a('0x2')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x4c7a('0x2')]},'telegram':{'type':Sequelize[_0x4c7a('0x2')]},'UserId':{'type':Sequelize[_0x4c7a('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x4c7a('0x2')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x4c7a('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x4c7a('0x6')],'defaultValue':Sequelize[_0x4c7a('0x7')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x4c7a('0x4')]}};
\ No newline at end of file
+var _0x4ae1=['DATE','NOW','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0x46ce14,_0x4f7796){var _0x1f15f0=function(_0x314f19){while(--_0x314f19){_0x46ce14['push'](_0x46ce14['shift']());}};_0x1f15f0(++_0x4f7796);}(_0x4ae1,0x1aa));var _0x14ae=function(_0x2deac4,_0xc27a2b){_0x2deac4=_0x2deac4-0x0;var _0x1c0bda=_0x4ae1[_0x2deac4];return _0x1c0bda;};'use strict';var _=require('lodash');var Sequelize=require(_0x14ae('0x0'));module[_0x14ae('0x1')]={'firstName':{'type':Sequelize[_0x14ae('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x14ae('0x2')]},'street':{'type':Sequelize[_0x14ae('0x2')]},'postalCode':{'type':Sequelize[_0x14ae('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x14ae('0x2')]},'dateOfBirth':{'type':Sequelize[_0x14ae('0x2')]},'description':{'type':Sequelize[_0x14ae('0x3')]},'phone':{'type':Sequelize[_0x14ae('0x2')]},'mobile':{'type':Sequelize[_0x14ae('0x2')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x14ae('0x2')]},'url':{'type':Sequelize[_0x14ae('0x2')]},'facebook':{'type':Sequelize[_0x14ae('0x2')]},'fb_data':{'type':Sequelize[_0x14ae('0x2')]},'twitter':{'type':Sequelize[_0x14ae('0x2')]},'skype':{'type':Sequelize[_0x14ae('0x2')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x14ae('0x2')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x14ae('0x2')]},'UserId':{'type':Sequelize[_0x14ae('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x14ae('0x2')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x14ae('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x14ae('0x6')],'defaultValue':Sequelize[_0x14ae('0x7')]},'dialTimezone':{'type':Sequelize[_0x14ae('0x2')]},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 2404fd0..2785c6e 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 _0x1c21=['rescheduleAdditionalPhones','hopperId','getHoppers','ContactId','includeAll','include','rows','getHopperFinals','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','join','server/files/tmp','file','filename','0777','child_process','fork','../../components/import/cm/csv','CompanyId','pid','upload','parse','meta','User','agent','binding','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','importUpdates','getJourney','mail','chat','sms','openchannel','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','starttime','endtime','duration','note','createdAt','UserId','fullname','DESC','findAndCountAll','alias','Website','closed','closedAt','disposition','thirdDisposition','Account','Owner','Tags','browserName','deviceModel','osName','ratingMessage','ratingType','referer','subject','externalUrl','threadId','Interaction','sortBy','reverse','value','moment','util','path','lodash','squel','papaparse','ioredis','../../components/contacts','../../config/logger','api','../../config/environment','../../config/environment/shared','../../mysqldb','redis','defaults','localhost','./cmContact.socket','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','sendStatus','name','send','index','describe','findAll','query','user','catch','CmContact','find','params','keys','length','startsWith','cf_','columnName','displayName','analytics','custom','type','values','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','merge','body','get','mergeWith','isArray','tags','[CmContact][merge]\x20to\x20%s\x20from\x20%s','from','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxMessage','OpenchannelInteraction','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','SmsQueueReport','WhatsappMessage','WhatsappQueueReport','isNil','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','where','$or','ListId','push','show','color','tag','Phones','ItemType','literal','Phones.OrderBy','$and','CmCustomField','omit','format','pickBy','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','sequelize','text','phone','CmHopper','getTags','findOne','model','Tag','rawAttributes','attributes','intersection','fields','order','sort','pick','filters','filter','map','options','hasOwnProperty','nolimit','setTags','setAdditionalPhones','all','ContactItemType','OrderBy','item_types','ItemTypeId','items','description','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','fromContactId','CmContactId','toContactId'];(function(_0x5cb165,_0x45376a){var _0x336aaa=function(_0x3c4777){while(--_0x3c4777){_0x5cb165['push'](_0x5cb165['shift']());}};_0x336aaa(++_0x45376a);}(_0x1c21,0x15d));var _0x11c2=function(_0x36f07b,_0x58a755){_0x36f07b=_0x36f07b-0x0;var _0x4e5329=_0x1c21[_0x36f07b];return _0x4e5329;};'use strict';var moment=require(_0x11c2('0x0'));var BPromise=require('bluebird');var util=require(_0x11c2('0x1'));var path=require(_0x11c2('0x2'));var fs=require('fs');var _=require(_0x11c2('0x3'));var squel=require(_0x11c2('0x4'));var Papa=require(_0x11c2('0x5'));var Redis=require(_0x11c2('0x6'));var contacts=require(_0x11c2('0x7'));var qs=require('../../components/parsers/qs');var logger=require(_0x11c2('0x8'))(_0x11c2('0x9'));var config=require(_0x11c2('0xa'));var shared=require(_0x11c2('0xb'));var db=require(_0x11c2('0xc'))['db'];config[_0x11c2('0xd')]=_[_0x11c2('0xe')](config[_0x11c2('0xd')],{'host':_0x11c2('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x11c2('0x10'))['register'](socket);function respondWithResult(_0x3fe15a,_0x58823c){_0x58823c=_0x58823c||0xc8;return function(_0x598d13){if(_0x598d13){return _0x3fe15a[_0x11c2('0x11')](_0x58823c)[_0x11c2('0x12')](_0x598d13);}};}function respondWithFilteredResult(_0x36129c,_0x14a92e){return function(_0x59a6b5){if(_0x59a6b5){var _0x1ded52=typeof _0x14a92e[_0x11c2('0x13')]===_0x11c2('0x14')&&typeof _0x14a92e[_0x11c2('0x15')]===_0x11c2('0x14');var _0x228f26=_0x59a6b5[_0x11c2('0x16')];var _0x2327e4=_0x1ded52?0x0:_0x14a92e[_0x11c2('0x13')];var _0x4f7134=_0x1ded52?_0x59a6b5[_0x11c2('0x16')]:_0x14a92e[_0x11c2('0x13')]+_0x14a92e['limit'];var _0x135a24;if(_0x4f7134>=_0x228f26){_0x4f7134=_0x228f26;_0x135a24=0xc8;}else{_0x135a24=0xce;}_0x36129c['status'](_0x135a24);return _0x36129c[_0x11c2('0x17')](_0x11c2('0x18'),_0x2327e4+'-'+_0x4f7134+'/'+_0x228f26)[_0x11c2('0x12')](_0x59a6b5);}return null;};}function saveUpdates(_0x3ea195){return function(_0xd1ec63){if(_0xd1ec63){return _0xd1ec63[_0x11c2('0x19')](_0x3ea195)[_0x11c2('0x1a')](function(_0x5bd700){return _0x5bd700;});}return null;};}function removeEntity(_0x2a7e2c){return function(_0x18daa0){if(_0x18daa0){return _0x18daa0[_0x11c2('0x1b')]()[_0x11c2('0x1a')](function(){_0x2a7e2c['status'](0xcc)[_0x11c2('0x1c')]();});}};}function handleEntityNotFound(_0x47747c){return function(_0x34b6ec){if(!_0x34b6ec){_0x47747c[_0x11c2('0x1d')](0x194);}return _0x34b6ec;};}function handleError(_0xc005b1,_0xa84988){_0xa84988=_0xa84988||0x1f4;return function(_0x573c7a){logger['error'](_0x573c7a['stack']);if(_0x573c7a[_0x11c2('0x1e')]){delete _0x573c7a[_0x11c2('0x1e')];}_0xc005b1['status'](_0xa84988)[_0x11c2('0x1f')](_0x573c7a);};}exports[_0x11c2('0x20')]=function(_0x237113,_0x2ea376){var _0x255c87={};return contacts[_0x11c2('0x21')]()['then'](function(_0x39f92c){_0x255c87=qs['getOptions'](_0x39f92c,_0x237113);return contacts[_0x11c2('0x22')](_0x237113[_0x11c2('0x23')],_0x237113[_0x11c2('0x24')],_0x255c87,_0x39f92c);})['then'](respondWithFilteredResult(_0x2ea376,_0x255c87))[_0x11c2('0x25')](handleError(_0x2ea376,null));};exports[_0x11c2('0x1b')]=function(_0x2ff257,_0xcf852){return db[_0x11c2('0x26')][_0x11c2('0x27')]({'where':{'id':_0x2ff257[_0x11c2('0x28')]['id']}})[_0x11c2('0x1a')](handleEntityNotFound(_0xcf852,null))[_0x11c2('0x1a')](removeEntity(_0xcf852,null))[_0x11c2('0x25')](handleError(_0xcf852,null));};exports['describe']=function(_0x3b6236,_0x26733d){return db[_0x11c2('0x26')]['describe']()[_0x11c2('0x1a')](function(_0x1c3161){delete _0x1c3161['tags'];for(var _0x56fd68=0x0;_0x56fd68
','Attachments','Title','Data','user=','auth=Bearer\x20','join','toString','base64','moment','randomstring','path','util','node-tnef','../../../config/logger','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','indexOf','length','Anonymous','split','pop','isEmpty','html','test','replace','0x1?_0x50e79d['slice'](0x0,-0x1)['join']('\x20'):_0x1ac6a8[_0xa906('0xd')];}return _0xa906('0x10');}function getLastName(_0x411255){var _0x330e62=_[_0xa906('0x7')](_0x411255[_0xa906('0x8')]);if(_0x330e62&&_0x330e62[_0xa906('0xd')]){var _0x1851b7=_0x330e62['name'][_0xa906('0x11')](/\s+/);return _0x1851b7[_0xa906('0xf')]>0x1?_0x1851b7[_0xa906('0x12')]():'';}return'';}function getMails(_0x5c4409,_0x21966b){var _0x220f9d='';for(var _0x248b0a=0x0;_0x248b0a<_0x21966b[_0xa906('0x8')][_0xa906('0xf')];_0x248b0a+=0x1){if(_0x21966b[_0xa906('0x8')][_0x248b0a][_0xa906('0x9')]!==_0x5c4409){if(!_[_0xa906('0x13')](_0x220f9d)){_0x220f9d+=',';}_0x220f9d+=_0x21966b[_0xa906('0x8')][_0x248b0a][_0xa906('0xd')]||_0x21966b['value'][_0x248b0a]['address']||'';_0x220f9d+='\x20<';_0x220f9d+=_0x21966b['value'][_0x248b0a][_0xa906('0x9')]?_0x21966b[_0xa906('0x8')][_0x248b0a][_0xa906('0x9')]:_0xa906('0xa')+random[_0xa906('0xb')](0x6)+_0xa906('0xc');_0x220f9d+='>';}}return _0x220f9d;}function parseEmail(_0x4ac35a,_0x238d32,_0x5fa3f4){if(_0x238d32[_0xa906('0x14')]){var _0x2ca3a9=/